Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
test_cuts.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file test_cuts.C
1 #include "tau_commons.h"
2 
8 int test_cuts()
9 {
10  gStyle->SetOptStat(0);
11 
12  unsigned col1 = kOrange+7;
13  unsigned col2 = kBlue+2;
14 
15  /* open inout files and merge trees */
16  TChain chain("event");
17  chain.Add("/gpfs/mnt/gpfs02/phenix/scratch/spjeffas/data/LeptoAna_p250_e20_1000events_1seed_3pion_r05.root");
18 
19  /* particle selection */
20  float n_trueaccept_uds = chain.GetEntries(tau_commons::select_true_uds );
21  float n_trueaccept_tau = chain.GetEntries(tau_commons::select_true_tau );
22 
23 
24  //&& tau_commons::select_accept_jet
25 
26  /* True positive = tau-identified-as-tau */
27  float n_tau_as_tau = chain.GetEntries( tau_commons::select_true_tau && tau_commons::select_tau);
28  float n_tau_as_uds = chain.GetEntries( tau_commons::select_true_tau && !tau_commons::select_tau);
29 
30  float n_uds_as_uds = chain.GetEntries( tau_commons::select_true_uds && !tau_commons::select_tau );
31  float n_uds_as_tau = chain.GetEntries( tau_commons::select_true_uds && tau_commons::select_tau );
32 
33  cout << "Selection of TRUE TAU: " << tau_commons::select_true_tau.GetTitle() << endl;
34  cout << "Selection of TRUE QUARK: " << tau_commons::select_true_uds.GetTitle() << endl;
35  cout << "Selection of JET acceptance: " << tau_commons::select_accept_jet.GetTitle() << endl;
36  cout << endl;
37  cout << "Total sample TAU: " << n_trueaccept_tau << endl;
38  cout << "Total sample QUARK: " << n_trueaccept_uds << endl;
39  cout << endl;
40  cout << "Selection of RECO TAU: " << tau_commons::select_tau.GetTitle() << endl;
41  cout << endl;
42  cout << "Tau-as-tau (True Positive): " << n_tau_as_tau << endl;
43  cout << "Tau-as-uds (False Negative): " << n_tau_as_uds << endl;
44  cout << "Uds-as-uds (True Negative): " << n_uds_as_uds << endl;
45  cout << "Uds-as-tau (False Positive): " << n_uds_as_tau << endl;
46 
47  cout << endl;
48  cout << "True positive rate: " << n_tau_as_tau / ( n_tau_as_tau + n_tau_as_uds ) << endl;
49  cout << "False positive rate: " << n_uds_as_tau / ( n_uds_as_tau + n_tau_as_tau ) << endl;
50  cout << endl;
51  cout << "Tau recovery efficiency: " << n_tau_as_tau / n_trueaccept_tau << endl;
52  cout << endl;
53 
54 
55  return 0;
56 }