Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SDeltaPtCutStudy.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file SDeltaPtCutStudy.cc
1 // ----------------------------------------------------------------------------
2 // 'SDeltaPtCutStudy.cc'
3 // Derek Anderson
4 // 06.29.2023
5 //
6 // Reads in the 'ntp_track' Ntuple
7 // generated by the SVtxEvaluator
8 // class and studies how deltapt/pt
9 // varies with quality cuts.
10 // ----------------------------------------------------------------------------
11 
12 #define SDELTAPTCUTSTUDY_CC
13 
14 // header files
15 #include "SDeltaPtCutStudy.h"
16 #include "SDeltaPtCutStudy.io.h"
17 #include "SDeltaPtCutStudy.sys.h"
18 #include "SDeltaPtCutStudy.ana.h"
19 #include "SDeltaPtCutStudy.plot.h"
20 
21 using namespace std;
22 
23 
24 
25 // ctor/dtor ------------------------------------------------------------------
26 
28 
29  cout << "\n Beginning delta-pt cut study..." << endl;
30 
31 } // end ctor
32 
33 
34 
35 
37 
38  /* nothing to do here */
39 
40 } // end dtor
41 
42 
43 
44 // main methods --------------------------------------------------------------
45 
47 
48  // announce initialization
49  cout << " Initializing..." << endl;
50 
51  // grab input
52  OpenFiles();
53  GetTuples();
54 
55  // initialize internal vectors & input/output
56  InitVectors();
57  InitTuples();
58  InitHists();
59  return;
60 
61 } // end Init()
62 
63 
64 
66 
67  // announce analysis
68  cout << " Analyzing..." << endl;
69 
70  // grab no. of entries for tuple loops
71  nTrks = ntTrack -> GetEntries();
72  nTrus = ntTruth -> GetEntries();
73  cout << " Beginning tuple loops: " << nTrks << " reco. tracks and " << nTrus << " particles to process" << endl;
74 
75  // do 1st loop over tracks to:
76  // (1) apply flat delta-pt cuts
77  // (2) get graphs for pt-dependent cuts
78  ApplyFlatDeltaPtCuts();
79  CreateSigmaGraphs();
80 
81  // do 2nd loop over tracks to:
82  // (1) apply pt-dependent cuts
83  // (2) calculate rejection factors
84  ApplyPtDependentDeltaPtCuts();
85  CalculateRejectionFactors();
86 
87  // get truth info and efficiencies
88  FillTruthHistograms();
89  CalculateEfficiencies();
90  return;
91 
92 } // end Analyze()
93 
94 
95 
97 
98  // announce completion
99  cout << " Finishing..." << endl;
100 
101  // plot results
102  SetStyles();
103  MakePlots();
104 
105  // save and close
106  SaveOutput();
107  CloseFiles();
108 
109  // announce end
110  cout << " Done with delta-pt cut study!\n" << endl;
111  return ;
112 
113 } // end End()
114 
115 // end ------------------------------------------------------------------------