Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-04-03 08:08:38

0001 // ----------------------------------------------------------------------------
0002 // 'SDeltaPtCutStudy.cc'
0003 // Derek Anderson
0004 // 06.29.2023
0005 //
0006 // Reads in the 'ntp_track' Ntuple
0007 // generated by the SVtxEvaluator
0008 // class and studies how deltapt/pt
0009 // varies with quality cuts.
0010 // ----------------------------------------------------------------------------
0011 
0012 #define SDELTAPTCUTSTUDY_CC
0013 
0014 // header files
0015 #include "SDeltaPtCutStudy.h"
0016 #include "SDeltaPtCutStudy.io.h"
0017 #include "SDeltaPtCutStudy.sys.h"
0018 #include "SDeltaPtCutStudy.ana.h"
0019 #include "SDeltaPtCutStudy.plot.h"
0020 
0021 using namespace std;
0022 
0023 
0024 
0025 // ctor/dtor ------------------------------------------------------------------
0026 
0027 SDeltaPtCutStudy::SDeltaPtCutStudy() {
0028 
0029   cout << "\n  Beginning delta-pt cut study..."  << endl;
0030 
0031 }  // end ctor
0032 
0033 
0034 
0035 
0036 SDeltaPtCutStudy::~SDeltaPtCutStudy() {
0037 
0038   /* nothing to do here */
0039 
0040 }  // end dtor
0041 
0042 
0043 
0044 //  main methods --------------------------------------------------------------
0045 
0046 void SDeltaPtCutStudy::Init() {
0047 
0048   // announce initialization
0049   cout << "    Initializing..." << endl;
0050 
0051   // grab input
0052   OpenFiles();
0053   GetTuples();
0054 
0055   // initialize internal vectors & input/output
0056   InitVectors();
0057   InitTuples();
0058   InitHists();
0059   return;
0060 
0061 }  // end Init()
0062 
0063 
0064 
0065 void SDeltaPtCutStudy::Analyze() {
0066 
0067   // announce analysis
0068   cout << "    Analyzing..." << endl;
0069 
0070   // grab no. of entries for tuple loops
0071   nTrks = ntTrack -> GetEntries();
0072   nTrus = ntTruth -> GetEntries();
0073   cout << "      Beginning tuple loops: " << nTrks << " reco. tracks and " << nTrus << " particles to process" << endl;
0074 
0075   // do 1st loop over tracks to:
0076   //   (1) apply flat delta-pt cuts
0077   //   (2) get graphs for pt-dependent cuts
0078   ApplyFlatDeltaPtCuts();
0079   CreateSigmaGraphs();
0080 
0081   // do 2nd loop over tracks to:
0082   //   (1) apply pt-dependent cuts
0083   //   (2) calculate rejection factors
0084   ApplyPtDependentDeltaPtCuts();
0085   CalculateRejectionFactors();
0086 
0087   // get truth info and efficiencies
0088   FillTruthHistograms();
0089   CalculateEfficiencies();
0090   return;
0091 
0092 }  // end Analyze()
0093 
0094 
0095 
0096 void SDeltaPtCutStudy::End() {
0097 
0098   // announce completion
0099   cout << "    Finishing..." << endl;
0100 
0101   // plot results
0102   SetStyles();
0103   MakePlots();
0104 
0105   // save and close
0106   SaveOutput();
0107   CloseFiles();
0108 
0109   // announce end
0110   cout << "  Done with delta-pt cut study!\n" << endl;
0111   return ;
0112 
0113 }  // end End()
0114 
0115 // end ------------------------------------------------------------------------