Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
event_counts.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file event_counts.C
2 {
3  gStyle->SetOptStat(0);
4 
5  unsigned col1 = kOrange+7;
6  unsigned col2 = kBlue+2;
7 
8  /* open inout files and merge trees */
9  TChain chain_event("ntp_event");
10  chain_event.Add("data_3pions/p250_e20_0events_file1093_LeptoAna_TruthEvent.root");
11  chain_event.Add("data_3pions/p250_e20_0events_file1096_LeptoAna_TruthEvent.root");
12  chain_event.Add("data_3pions/p250_e20_0events_file1101_LeptoAna_TruthEvent.root");
13  chain_event.Add("data_3pions/p250_e20_0events_file1115_LeptoAna_TruthEvent.root");
14  chain_event.Add("data_3pions/p250_e20_0events_file1122_LeptoAna_TruthEvent.root");
15  chain_event.Add("data_3pions/p250_e20_0events_file1127_LeptoAna_TruthEvent.root");
16  chain_event.Add("data_3pions/p250_e20_0events_file1131_LeptoAna_TruthEvent.root");
17  chain_event.Add("data_3pions/p250_e20_0events_file1164_LeptoAna_TruthEvent.root");
18 
19  TChain chain("candidates");
20  chain.Add("data_3pions/p250_e20_0events_file1093_LeptoAna_r05.root");
21  chain.Add("data_3pions/p250_e20_0events_file1096_LeptoAna_r05.root");
22  chain.Add("data_3pions/p250_e20_0events_file1101_LeptoAna_r05.root");
23  chain.Add("data_3pions/p250_e20_0events_file1115_LeptoAna_r05.root");
24  chain.Add("data_3pions/p250_e20_0events_file1122_LeptoAna_r05.root");
25  chain.Add("data_3pions/p250_e20_0events_file1127_LeptoAna_r05.root");
26  chain.Add("data_3pions/p250_e20_0events_file1131_LeptoAna_r05.root");
27  chain.Add("data_3pions/p250_e20_0events_file1164_LeptoAna_r05.root");
28 
29  /* particle selection */
30  cout << "TOTAL events: " << chain_event.GetEntries() << endl;
31  cout << " && tau within abs(eta)<1: " << chain_event.GetEntries("abs(tau_eta) < 1.0") << endl;
32 
33  cout << "TOTAL tau found: " << chain.GetEntries("evtgen_is_tau == 1") << endl;
34  cout << " && tau within abs(jet_eta)<1 && jet_pT > 5 GeV: " << chain.GetEntries("evtgen_is_tau == 1 && abs(jet_eta) < 1.0 && jet_ptrans > 5") << endl;
35  cout << " && Delte_R < 0.1: " << chain.GetEntries("evtgen_is_tau == 1 && abs(jet_eta) < 1.0 && jet_ptrans>5 && sqrt( (evtgen_tau_eta-jet_eta)*(evtgen_tau_eta-jet_eta) + (evtgen_tau_phi-jet_phi)*(evtgen_tau_phi-jet_phi) ) < 0.1") << endl;
36 
37  cout << endl;
38  cout << endl;
39  cout << endl;
40 
41  cout << "OTHER JETS found within acceptance: " << chain.GetEntries("evtgen_is_tau == 0 && abs(jet_eta) < 1.0 && jet_ptrans>5") << endl;
42 
43 
44 
45  /* Plot tau angle reconstruction quality */
46  TCanvas *c1 = new TCanvas();
47  chain.Draw("sqrt( (evtgen_tau_eta-jet_eta)*(evtgen_tau_eta-jet_eta) + (evtgen_tau_phi-jet_phi)*(evtgen_tau_phi-jet_phi) ) >> h1(50,0,0.5)", "evtgen_is_tau == 1 && abs(jet_eta) < 1.0 && jet_ptrans > 5" );
48  h1->GetXaxis()->SetTitle("#DeltaR (#tau_{jet} - #tau_{true})");
49  c1->Print("plots/event_counts_deltaR.eps");
50  c1->Print("plots/event_counts_deltaR.png");
51 
52 
53  return 0;
54 }