Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plot_efficiency_purity.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file plot_efficiency_purity.C
2 {
3  vector< TString > v_cuts;
4 
5  TString base_ep = "em_cluster_e/em_track_ptotal > ";
6  TString base_prob = "em_cluster_prob >= ";
7 
8  Double_t cut_ep = 0.90;
9  Double_t cut_prob = 0.02;
10  v_cuts.push_back(TString(base_ep) += cut_ep);
11  v_cuts.push_back(TString(base_prob) += cut_prob);
12 
13  for ( unsigned i = 0; i < v_cuts.size(); i++ )
14  {
15  cout << v_cuts.at(i) << endl;
16  }
17 
18  vector< float > v_momenta;
19  v_momenta.push_back(1.0);
20  v_momenta.push_back(2.0);
21  v_momenta.push_back(5.0);
22  v_momenta.push_back(10.0);
23  v_momenta.push_back(20.0);
24 
25  /* Loop over detectors */
26  {
27  //...
28  /* loope over cuts */
29  {
30  /* loop over energies */
31  {
32  vector< float > v_rates_tp;
33  vector< float > v_rates_fp;
34 
35  for ( unsigned idx_p = 0; idx_p < v_momenta.size(); idx_p++ )
36  {
37  v_rates_tp.push_back( 1. - 0.1 * v_momenta.at(idx_p) );
38  v_rates_fp.push_back( 0.1 * v_momenta.at(idx_p) );
39  }
40  TGraph* g_tp = new TGraph(v_momenta.size(), &(v_momenta[0]), &(v_rates_tp[0]));
41  TGraph* g_fp = new TGraph(v_momenta.size(), &(v_momenta[0]), &(v_rates_fp[0]));
42 
43  g_tp->SetMarkerColor(kGreen+2);
44  g_fp->SetMarkerColor(kRed+2);
45 
46  g_tp->SetLineColor(g_tp->GetMarkerColor());
47  g_fp->SetLineColor(g_fp->GetMarkerColor());
48 
49  g_tp->Draw("LPA");
50  g_fp->Draw("LPsame");
51  }
52  }
53  }
54  return 0;
55 }