Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
makePlot_reco_electron_id.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file makePlot_reco_electron_id.C
1 /* em_cluster_caloid values:
2  1 = CEMC
3  4 = EEMC
4  5 = FEMC
5 */
6 
7 int
9 {
10  gStyle->SetOptStat(0);
11 
12  TFile *fin = new TFile("../../data/Sample_DISReco_ep.root", "OPEN");
13  //TFile *fin = new TFile("../../data/DISReco_Pythia6_DIS_20x250_1k.root", "OPEN");
14 
15  TTree *t_reco = (TTree*)fin->Get("event_cluster");
16 
17  /* define cuts */
18  TCut cut_pid_e("em_evtgen_pid == 11");
19  TCut cut_pid_pion("abs(em_evtgen_pid) == 211");
20  TCut cut_eta( "1" );
21 
22  TCanvas *ctemp = new TCanvas();
23 
24  /* E over p ratio */
25  ctemp->cd();
26 
27  TH1F* h_e_over_p_electron = new TH1F("h_e_over_p_electron", ";E / p", 100, 0, 2);
28  TH1F* h_e_over_p_pion = (TH1F*)h_e_over_p_electron->Clone("h_e_over_p_pion");
29 
30  h_e_over_p_electron->SetLineColor( kBlue );
31  h_e_over_p_pion->SetLineColor( kRed );
32 
33  t_reco->Draw( "em_cluster_e / em_track_ptotal >> h_e_over_p_electron", cut_pid_e && cut_eta );
34  t_reco->Draw( "em_cluster_e / em_track_ptotal >> h_e_over_p_pion", cut_pid_pion && cut_eta );
35 
36  TCanvas *c1 = new TCanvas();
37  c1->SetLogy(1);
38  h_e_over_p_electron->Draw("");
39  h_e_over_p_pion->Draw("sames");
40 
41  c1->Print("plots/electron_id_c1.eps");
42  c1->Print("plots/electron_id_c1.png");
43 
44 
45  /* Cluster shape */
46  ctemp->cd();
47 
48  TH1F* h_em_prob_electron = new TH1F("h_em_prob_electron", ";electron shape probability", 100, 0, 1.0);
49  TH1F* h_em_prob_pion = (TH1F*)h_em_prob_electron->Clone("h_em_prob_pion");
50 
51  h_em_prob_electron->SetLineColor( kBlue );
52  h_em_prob_pion->SetLineColor( kRed );
53 
54  t_reco->Draw( "em_cluster_prob >> h_em_prob_electron", cut_pid_e && cut_eta );
55  t_reco->Draw( "em_cluster_prob >> h_em_prob_pion", cut_pid_pion && cut_eta );
56 
57  TCanvas *c2 = new TCanvas();
58  c2->SetLogy(1);
59  h_em_prob_pion->Draw("");
60  h_em_prob_electron->Draw("sames");
61 
62  c2->Print("plots/electron_id_c2.eps");
63  c2->Print("plots/electron_id_c2.png");
64 
65 
66  /* Cluster pseudorapidity */
67  ctemp->cd();
68 
69  TH1F* h_em_eta_electron = new TH1F("h_em_eta_electron", ";#eta", 101, -5.05, 5.05);
70  TH1F* h_em_eta_pion = (TH1F*)h_em_eta_electron->Clone("h_em_eta_pion");
71 
72  h_em_eta_electron->SetLineColor( kBlue );
73  h_em_eta_pion->SetLineColor( kRed );
74 
75  //t_reco->Draw( "-1*log(tan(em_cluster_theta/2.0)) >> h_em_eta_electron", cut_pid_e );
76  //t_reco->Draw( "-1*log(tan(em_cluster_theta/2.0)) >> h_em_eta_pion", cut_pid_pion );
77 
78  t_reco->Draw( "em_cluster_eta >> h_em_eta_electron", cut_pid_e );
79  t_reco->Draw( "em_cluster_eta >> h_em_eta_pion", cut_pid_pion );
80 
81  TCanvas *c3 = new TCanvas();
82  c3->SetLogy(1);
83  h_em_eta_pion->Draw("");
84  h_em_eta_electron->Draw("sames");
85 
86  c3->Print("plots/electron_id_c3.eps");
87  c3->Print("plots/electron_id_c3.png");
88 
89 
90  return 1;
91 }