File indexing completed on 2025-08-05 08:10:56
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef DODELTAPTCUTSTUDY_C
0010 #define DODELTAPTCUTSTUDY_C
0011
0012
0013 #include <array>
0014 #include <cstdlib>
0015 #include <utility>
0016
0017 #include <TROOT.h>
0018 #include <TString.h>
0019
0020 #include "/sphenix/user/danderson/install/include/sdeltaptcutstudy/SDeltaPtCutStudy.h"
0021
0022 using namespace std;
0023
0024
0025 R__LOAD_LIBRARY(/sphenix/user/danderson/install/lib/libsdeltaptcutstudy.so)
0026
0027
0028 static const bool DefBatch = false;
0029 static const size_t NPar = 3;
0030 static const size_t NTypes = 3;
0031
0032
0033
0034 void DoDeltaPtCutStudy(const bool inBatchMode = DefBatch) {
0035
0036
0037 gErrorIgnoreLevel = kWarning;
0038
0039
0040 const TString sInFile("../TruthMatching/input/merged/sPhenixG4_testingNewMatcher_oldEvaluator.pt020num10evt500pipm.d15m9y2023.root");
0041 const TString sOutFile("deltaPtStudy.testingSignChange_piboth.pt020num5evt500pipm.d3m10y2023.root");
0042 const TString sInTrack("ntp_track");
0043 const TString sInTruth("ntp_gtrack");
0044
0045
0046
0047
0048
0049
0050
0051 const vector<tuple<double, TString, uint32_t, uint32_t, uint32_t>> projParams = {
0052 make_tuple(0.5, "_pt05", 799, 20, 803),
0053 make_tuple(1.0, "_pt1", 633, 22, 636),
0054 make_tuple(2.0, "_pt2", 899, 23, 893),
0055 make_tuple(5.0, "_pt5", 617, 21, 620),
0056 make_tuple(10., "_pt10", 879, 33, 883),
0057 make_tuple(20., "_pt20", 859, 34, 863),
0058 make_tuple(30., "_pt30", 839, 47, 843),
0059 make_tuple(40., "_pt40", 819, 20, 813)
0060 };
0061
0062
0063
0064
0065
0066
0067
0068
0069 const vector<tuple<double, TString, uint32_t, uint32_t, bool>> flatParams = {
0070 make_tuple(0.50, "_dPt50", 899, 24, false),
0071 make_tuple(0.25, "_dPt25", 909, 26, false),
0072 make_tuple(0.10, "_dPt10", 879, 32, false),
0073 make_tuple(0.05, "_dPt05", 889, 25, false),
0074 make_tuple(0.03, "_dPt03", 859, 27, true),
0075 make_tuple(0.02, "_dPt02", 869, 28, false),
0076 make_tuple(0.01, "_dPt01", 839, 30, false)
0077 };
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087 const vector<tuple<double, TString, uint32_t, uint32_t, uint32_t, bool>> ptDependParams = {
0088 make_tuple(1.0, "_sigDPt10", 899, 24, 893, false),
0089 make_tuple(1.5, "_sigDPt15", 909, 26, 903, false),
0090 make_tuple(2.0, "_sigDPt20", 879, 32, 873, true),
0091 make_tuple(2.5, "_sigDPt25", 889, 25, 883, false),
0092 make_tuple(3.0, "_sigDPt30", 859, 27, 863, false)
0093 };
0094
0095
0096 array<float, NPar> sigHiGuess = {1., -1., 1.};
0097 array<float, NPar> sigLoGuess = {1., -1., 1.};
0098 pair<float, float> normRange = {0.2, 1.2};
0099 pair<float, float> ptFitRange = {0.5, 40.};
0100 pair<float, float> deltaFitRange = {0., 0.1};
0101
0102
0103 const uint32_t nInttTrkMin = 1;
0104 const uint32_t nMVtxTrkMin = 2;
0105 const uint32_t nTpcTrkMin = 35;
0106 const double qualTrkMax = 10.;
0107 const double vzTrkMax = 10.;
0108 const double ptTrkMin = 0.1;
0109
0110
0111 const pair<float, float> rPtRange = {0., 60.};
0112 const pair<float, float> rFracRange = {0., 4.};
0113 const pair<float, float> rDeltaRange = {0., 0.1};
0114 const array<uint32_t, NTypes> arrColGraph = {923, 923, 809};
0115 const array<uint32_t, NTypes> arrMarGraph = {20, 20, 46};
0116
0117
0118 const uint32_t fFil = 0;
0119 const uint32_t fLin = 1;
0120 const uint32_t fWid = 1;
0121 const uint32_t fTxt = 42;
0122 const uint32_t fAln = 12;
0123 const uint32_t fCnt = 1;
0124
0125
0126 const TString sPtProjBase("DeltaPtProj");
0127 const TString sPtDeltaBase("DeltaPt");
0128 const TString sPtTrueBase("PtTrue");
0129 const TString sPtRecoBase("PtReco");
0130 const TString sPtFracBase("PtFrac");
0131 const TString sPtTrkTruBase("PtTrkTruth");
0132
0133
0134 const vector<TString> sPlotTxt = {
0135 "#bf{#it{sPHENIX}} Simulation",
0136 "5 #pi^{-} + 5 #pi^{+}/event, p_{T} #in (0, 20) GeV/c",
0137 "#bf{Only #pi^{#pm}}"
0138 };
0139
0140
0141 bool doEffRebin = true;
0142 size_t nEffRebin = 5;
0143
0144
0145 SDeltaPtCutStudy *study = new SDeltaPtCutStudy();
0146 study -> SetInputOutputFiles(sInFile, sOutFile);
0147 study -> SetInputTuples(sInTrack, sInTruth);
0148 study -> SetGeneralTrackCuts(nInttTrkMin, nMVtxTrkMin, nTpcTrkMin, qualTrkMax, vzTrkMax, ptTrkMin);
0149 study -> SetSigmaFitGuesses(sigHiGuess, sigLoGuess);
0150 study -> SetNormAndFitRanges(normRange, ptFitRange, deltaFitRange);
0151 study -> SetPlotRanges(rPtRange, rFracRange, rDeltaRange);
0152 study -> SetGeneralStyleParameters(arrColGraph, arrMarGraph);
0153 study -> SetGeneralHistParameters(fFil, fLin, fWid, fTxt, fAln, fCnt);
0154 study -> SetHistBaseNames(sPtProjBase, sPtDeltaBase, sPtTrueBase, sPtRecoBase, sPtFracBase, sPtTrkTruBase);
0155 study -> SetPlotText(sPlotTxt);
0156 study -> SetEffRebinParameters(doEffRebin, nEffRebin);
0157 study -> SetProjectionParameters(projParams);
0158 study -> SetFlatCutParameters(flatParams);
0159 study -> SetPtDependCutParameters(ptDependParams);
0160 study -> Init();
0161 study -> Analyze();
0162 study -> End();
0163
0164 }
0165
0166 #endif
0167
0168