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