Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DoTrackCutStudy.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DoTrackCutStudy.C
1 // ----------------------------------------------------------------------------
2 // 'DoTrackCutStudy.C'
3 // Derek Anderson
4 // 12.15.2022
5 //
6 // Runs the 'STrackCutStudy' class with
7 // maximal output. (Has to be run via
8 // condor.)
9 // ----------------------------------------------------------------------------
10 
11 #ifndef DOTRACKCUTSTUDY_C
12 #define DOTRACKCUTSTUDY_C
13 
14 // standard c includes
15 #include <cstdlib>
16 #include <utility>
17 // root includes
18 #include "TROOT.h"
19 #include "TString.h"
20 // user includes
21 #include </sphenix/user/danderson/install/include/strackcutstudy/STrackCutStudy.h>
22 
23 using namespace std;
24 
25 // load libraries
26 R__LOAD_LIBRARY(/sphenix/user/danderson/install/lib/libstrackcutstudy.so)
27 
28 // global constants
29 static const Ssiz_t NTxt = 3;
30 static const Bool_t DefBatch = false;
31 
32 
33 
34 void DoTrackCutStudy(const Bool_t inBatchMode = DefBatch) {
35 
36  // lower verbosity
37  gErrorIgnoreLevel = kWarning;
38 
39  // i/o parameters
40  const TString sOutFile("trackCutStudy.testFastCutStudy_slow.pt020n20pim.d30m3y2023.root");
41  const TString sInFileEO("input/embed_only/final_merge/sPhenixG4_run6hijing50khz_embedScanOn_embedOnly.pt020n20pim.d24m3y2023.root");
42  const TString sInFilePU("input/with_pileup/merged/sPhenixG4_forTrackCutStudy_hijing50khz_embedOnly0t19_g4svtxeval.d14m11y2022.root");
43  const TString sInTupleEO("ntp_track");
44  const TString sInTuplePU("ntp_gtrack");
45  const TString sInClusterEO("ntp_cluster");
46 
47  // study parameters
48  const Bool_t makePlots(true);
49  const Bool_t doPileup(true);
50  const Bool_t doIntNorm(false);
51  const Bool_t doBeforeCuts(true);
52  const Bool_t doAvgClusterCalc(false);
53  const Double_t normalPtFracMin(0.20);
54  const Double_t normalPtFracMax(1.20);
55 
56  // cut flags
57  const Bool_t doPrimaryCut = false;
58  const Bool_t doMVtxCut = true;
59  const Bool_t doTpcCut = true;
60  const Bool_t doVzCut = true;
61  const Bool_t doDcaXyCut = false;
62  const Bool_t doDcaZcut = false;
63  const Bool_t doQualityCut = true;
64 
65  // track cuts
66  const pair<UInt_t, UInt_t> nMVtxRange = {2, 100};
67  const pair<UInt_t, UInt_t> nTpcRange = {20, 100};
68  const pair<Double_t, Double_t> vzRange = {-10., 10.};
69  const pair<Double_t, Double_t> dcaXyRange = {-20., 20.};
70  const pair<Double_t, Double_t> dcaZrange = {-20., 20.};
71  const pair<Double_t, Double_t> qualityRange = {0., 10.};
72 
73  // text for plot
74  const TString sTxtEO[NTxt] = {"#bf{#it{sPHENIX}} Simulation", "20 #pi^{-}/event, p_{T} #in (0, 20) GeV/c", "#bf{Only #pi^{-}}"};
75  const TString sTxtPU[NTxt] = {"#bf{#it{sPHENIX}} Simulation", "0-20 fm Hijing, 50 kHz pileup #oplus 5 #pi^{-}/event", "#bf{With pileup}"};
76 
77  // run track cut study
78  STrackCutStudy *study = new STrackCutStudy();
79  study -> SetBatchMode(inBatchMode);
80  study -> SetInputOutputFiles(sInFileEO, sInFilePU, sOutFile);
81  study -> SetInputTuples(sInTupleEO, sInTuplePU);
82  study -> SetStudyParameters(makePlots, doPileup, doIntNorm, doBeforeCuts, doAvgClusterCalc, normalPtFracMin, normalPtFracMax);
83  study -> SetCutFlags(doPrimaryCut, doMVtxCut, doTpcCut, doVzCut, doDcaXyCut, doDcaZcut, doQualityCut);
84  study -> SetTrackCuts(nMVtxRange, nTpcRange, vzRange, dcaXyRange, dcaZrange, qualityRange);
85  study -> SetPlotText(NTxt, NTxt, sTxtEO, sTxtPU);
86  study -> Init();
87  study -> Analyze();
88  study -> End();
89 
90 } // end 'DoTrackCutStudy()'
91 
92 #endif
93 
94 // end ------------------------------------------------------------------------