Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:00

0001 // ----------------------------------------------------------------------------
0002 // 'DoFastTrackCutStudy.C'
0003 // Derek Anderson
0004 // 03.30.2023
0005 //
0006 // Runs the 'STrackCutStudy' class with minimal amount
0007 // of output.  (Can be run from command line.)
0008 // ----------------------------------------------------------------------------
0009 
0010 #ifndef DOTRACKCUTSTUDY_C
0011 #define DOTRACKCUTSTUDY_C
0012 
0013 // standard c includes
0014 #include <cstdlib>
0015 #include <utility>
0016 // root includes
0017 #include "TROOT.h"
0018 #include "TString.h"
0019 // user includes
0020 #include </sphenix/user/danderson/install/include/strackcutstudy/STrackCutStudy.h>
0021 
0022 using namespace std;
0023 
0024 // load libraries
0025 R__LOAD_LIBRARY(/sphenix/user/danderson/install/lib/libstrackcutstudy.so)
0026 
0027 // global constants
0028 static const Ssiz_t NTxt     = 4;
0029 static const Bool_t DefBatch = false;
0030 
0031 
0032 
0033 void DoFastTrackCutStudy(const Bool_t inBatchMode = DefBatch) {
0034 
0035   // lower verbosity
0036   gErrorIgnoreLevel = kWarning;
0037 
0038   // i/o parameters
0039   const TString sOutFile("trackCutStudy.forTpcSeedCheck_afterFix.pt020n5pim.d18m4y2023.root");
0040   const TString sInFileEO("input/embed_only/final_merge/sPhenixG4_forSectorCheck_embedScanOn_embedOnly.pt020n5pim.d11m4y2023.root");
0041   const TString sInFilePU("input/with_pileup/merged/sPhenixG4_forTrackCutStudy_hijing50khz_embedOnly0t19_g4svtxeval.d14m11y2022.root");
0042   const TString sInTupleEO("ntp_track");
0043   const TString sInTuplePU("ntp_gtrack");
0044   const TString sInClusterEO("ntp_cluster");
0045 
0046   // study parameters
0047   const Bool_t   makePlots(false);
0048   const Bool_t   doPileup(false);
0049   const Bool_t   doIntNorm(false);
0050   const Bool_t   doBeforeCuts(false);
0051   const Bool_t   doAvgClusterCalc(false);
0052   const Double_t normalPtFracMin(0.20);
0053   const Double_t normalPtFracMax(1.20);
0054 
0055   // cut flags
0056   const Bool_t doPrimaryCut = false;
0057   const Bool_t doMVtxCut    = true;
0058   const Bool_t doTpcCut     = true;
0059   const Bool_t doVzCut      = true;
0060   const Bool_t doDcaXyCut   = false;
0061   const Bool_t doDcaZcut    = false;
0062   const Bool_t doQualityCut = true;
0063 
0064   // track cuts
0065   const pair<UInt_t,   UInt_t>   nMVtxRange   = {2,    100};
0066   const pair<UInt_t,   UInt_t>   nTpcRange    = {20,   100};
0067   const pair<Double_t, Double_t> vzRange      = {-10.,  10.};
0068   const pair<Double_t, Double_t> dcaXyRange   = {-20., 20.};
0069   const pair<Double_t, Double_t> dcaZrange    = {-20., 20.};
0070   const pair<Double_t, Double_t> qualityRange = {0.,   10.};
0071 
0072   // text for plot
0073   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}}}"};
0074   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}}"};
0075 
0076   // run track cut study
0077   STrackCutStudy *study = new STrackCutStudy();
0078   study -> SetBatchMode(inBatchMode);
0079   study -> SetInputOutputFiles(sInFileEO, sInFilePU, sOutFile);
0080   study -> SetInputTuples(sInTupleEO, sInTuplePU);
0081   study -> SetStudyParameters(makePlots, doPileup, doIntNorm, doBeforeCuts, doAvgClusterCalc, normalPtFracMin, normalPtFracMax);
0082   study -> SetCutFlags(doPrimaryCut, doMVtxCut, doTpcCut, doVzCut, doDcaXyCut, doDcaZcut, doQualityCut);
0083   study -> SetTrackCuts(nMVtxRange, nTpcRange, vzRange, dcaXyRange, dcaZrange, qualityRange);
0084   study -> SetPlotText(NTxt, NTxt, sTxtEO, sTxtPU);
0085   study -> Init();
0086   study -> Analyze();
0087   study -> End();
0088 
0089 }  // end 'DoTrackCutStudy()'
0090 
0091 #endif
0092 
0093 // end ------------------------------------------------------------------------