24 cout <<
" Set input/output files:\n"
25 <<
" input = " << sInFile.Data() <<
"\n"
26 <<
" output = " << sOutFile.Data()
38 cout <<
" Set track/truth tuples:\n"
39 <<
" track tuple = " << sInTrack.Data() <<
"\n"
40 <<
" truth tuple = " << sInTruth.Data()
50 nInttTrkMin = nInttCut;
51 nMVtxTrkMin = nMvtxCut;
56 cout <<
" Set general track cuts:\n"
57 <<
" nIntt > " << nInttTrkMin <<
"\n"
58 <<
" nMvtx > " << nMVtxTrkMin <<
"\n"
59 <<
" nTpc > " << nTpcTrkMin <<
"\n"
60 <<
" quality < " << qualTrkMax <<
"\n"
61 <<
" |vz| < " << vzTrkMax <<
"\n"
62 <<
" pt > " << ptTrkMin
72 for (uint8_t iPar = 0; iPar <
Const::NPar; iPar++) {
73 sigHiGuess[iPar] = hiGuess[iPar];
74 sigLoGuess[iPar] = loGuess[iPar];
76 cout <<
" Set sigma(delta-pt / pt) fit guesses:\n"
77 <<
" high guess parameters = (" << sigHiGuess[0] <<
", " << sigHiGuess[1] <<
", " << sigHiGuess[2] <<
")\n"
78 <<
" low guess parameters = (" << sigLoGuess[0] <<
", " << sigLoGuess[1] <<
", " << sigLoGuess[2] <<
")"
88 normRange[0] = norm.first;
89 normRange[1] = norm.second;
90 ptFitRange[0] = ptFit.first;
91 ptFitRange[1] = ptFit.second;
92 deltaFitRange[0] = deltaFit.first;
93 deltaFitRange[1] = deltaFit.second;
94 cout <<
" Set normalization and fit ranges:\n"
95 <<
" normalization = (" << normRange[0] <<
", " << normRange[1] <<
")\n"
96 <<
" pt fit = (" << ptFitRange[0] <<
", " << ptFitRange[1] <<
")\n"
97 <<
" delta-pt fit = (" << deltaFitRange[0] <<
", " << deltaFitRange[1] <<
")"
107 rPtRange[0] = ptRange.first;
108 rPtRange[1] = ptRange.second;
109 rFracRange[0] = fracRange.first;
110 rFracRange[1] = fracRange.second;
111 rDeltaRange[0] = deltaRange.first;
112 rDeltaRange[1] = deltaRange.second;
113 cout <<
" Set plot ranges:\n"
114 <<
" pt = (" << rPtRange[0] <<
", " << rPtRange[1] <<
")\n"
115 <<
" frac = (" << rFracRange[0] <<
", " << rFracRange[1] <<
")\n"
116 <<
" delta = (" << rDeltaRange[0] <<
", " << rDeltaRange[1] <<
")"
126 fColTrue = arrCol[0];
127 fColPure = arrCol[1];
129 fMarTrue = arrMar[0];
130 fMarPure = arrMar[1];
132 cout <<
" Set general style parameters:\n"
133 <<
" colors (true, pure, track) = (" << fColTrue <<
", " << fColPure <<
", " << fColTrk <<
")\n"
134 <<
" markers (true, pure, track) = (" << fMarTrue <<
", " << fMarPure <<
", " << fMarTrk <<
")"
150 cout <<
" Set general histogram parameters:\n"
151 <<
" fill = " << fFil <<
"\n"
152 <<
" line = " << fLin <<
"\n"
153 <<
" width = " << fWid <<
"\n"
154 <<
" font = " << fTxt <<
"\n"
155 <<
" align = " << fAln <<
"\n"
156 <<
" center = " << fCnt
167 sPtDeltaBase = sDelta;
171 sPtTrkTruBase = sTrack;
172 cout <<
" Set histogram base names:\n"
173 <<
" " << sPtProjBase <<
"\n"
174 <<
" " << sPtDeltaBase <<
"\n"
175 <<
" " << sPtTrueBase <<
"\n"
176 <<
" " << sPtRecoBase <<
"\n"
177 <<
" " << sPtFracBase <<
"\n"
178 <<
" " << sPtTrkTruBase
188 nTxt = plotText.size();
191 cout <<
" Set plot text:" << endl;
192 for (
size_t iTxt = 0; iTxt < nTxt; iTxt++) {
193 cout <<
" " << sInfo[iTxt] << endl;
203 doEffRebin = doRebin;
205 cout <<
" Set efficiency rebinning parameters:\n"
206 <<
" do rebin? = " << doEffRebin <<
"\n"
207 <<
" nRebin = " << nEffRebin
217 nProj = projParams.size();
218 for (
auto param : projParams) {
219 ptProj.push_back(get<0>(param));
220 sProjSuffix.push_back(get<1>(param));
221 fColProj.push_back(get<2>(param));
222 fMarProj.push_back(get<3>(param));
223 fColFit.push_back(get<4>(param));
226 cout <<
" Set projection parameters." << endl;
235 bool cutSelected =
false;
237 for (
auto param : flatParams) {
240 ptDeltaMax.push_back(get<0>(param));
241 sDPtSuffix.push_back(get<1>(param));
242 fColCut.push_back(get<2>(param));
243 fMarCut.push_back(get<3>(param));
246 if (!cutSelected && get<4>(param)) {
252 nDPtCuts = flatParams.size();
254 cout <<
" Set flat delta-pt cut parameters." << endl;
263 bool cutSelected =
false;
265 for (
auto param : ptDependParams) {
268 ptDeltaSig.push_back(get<0>(param));
269 sSigSuffix.push_back(get<1>(param));
270 fColSig.push_back(get<2>(param));
271 fMarSig.push_back(get<3>(param));
272 fColSigFit.push_back(get<4>(param));
275 if (!cutSelected && get<5>(param)) {
281 nSigCuts = ptDependParams.size();
283 cout <<
" Set pt-dependent delta-pt cut parameters." << endl;
294 fOutput =
new TFile(sOutFile.Data(),
"recreate");
295 fInput =
new TFile(sInFile.Data(),
"read");
296 if (!fInput || !fOutput) {
297 cerr <<
"PANIC: couldn't open a file!\n"
298 <<
" fInput = " << fInput <<
"\n"
299 <<
" fOutput = " << fOutput <<
"\n"
301 assert(fOutput && fInput);
304 cout <<
" Opened files." << endl;
313 ntTrack = (TNtuple*) fInput ->
Get(sInTrack.Data());
314 ntTruth = (TNtuple*) fInput ->
Get(sInTruth.Data());
315 if (!ntTrack || !ntTruth) {
316 cerr <<
"PANIC: couldn't grab aninput tuple!\n"
317 <<
" ntTrack = " << ntTrack <<
"\n"
318 <<
" ntTruth = " << ntTruth <<
"\n"
320 assert(ntTrack && ntTruth);
323 cout <<
" Grabbed input tuples." << endl;
333 TDirectory *dNoCut = (TDirectory*) fOutput -> mkdir(
"NoCuts");
334 TDirectory *dFlatCut = (TDirectory*) fOutput -> mkdir(
"FlatCuts");
335 TDirectory *dSigmaCut = (TDirectory*) fOutput -> mkdir(
"SigmaCuts");
336 TDirectory *dProject = (TDirectory*) fOutput -> mkdir(
"Projections");
337 cout <<
" Made output directories." << endl;
347 hPtTrkTru ->
Write();
348 hPtDeltaVsFrac ->
Write();
349 hPtDeltaVsTrue ->
Write();
350 hPtDeltaVsTrack ->
Write();
351 hPtTrueVsTrack ->
Write();
356 for (
size_t iCut = 0; iCut < nDPtCuts; iCut++) {
357 hEffCut[iCut] ->
Write();
358 hPtDeltaCut[iCut] ->
Write();
359 hPtTrackCut[iCut] ->
Write();
360 hPtFracCut[iCut] ->
Write();
361 hPtTrkTruCut[iCut] ->
Write();
362 hPtDeltaVsFracCut[iCut] ->
Write();
363 hPtDeltaVsTrueCut[iCut] ->
Write();
364 hPtDeltaVsTrackCut[iCut] ->
Write();
365 hPtTrueVsTrackCut[iCut] ->
Write();
371 for (
size_t iSig = 0; iSig < nSigCuts; iSig++) {
372 hEffSig[iSig] ->
Write();
373 hPtDeltaSig[iSig] ->
Write();
374 hPtTrackSig[iSig] ->
Write();
375 hPtFracSig[iSig] ->
Write();
376 hPtTrkTruSig[iSig] ->
Write();
377 hPtDeltaVsFracSig[iSig] ->
Write();
378 hPtDeltaVsTrueSig[iSig] ->
Write();
379 hPtDeltaVsTrackSig[iSig] ->
Write();
380 hPtTrueVsTrackSig[iSig] ->
Write();
386 grSigProj ->
Write();
387 for (
size_t iProj = 0; iProj < nProj; iProj++) {
388 hPtDeltaProj[iProj] ->
Write();
389 fPtDeltaProj[iProj] ->
Write();
391 for (
size_t iSig = 0; iSig < nSigCuts; iSig++) {
392 fMuHiProj[iSig] ->
Write();
393 fMuLoProj[iSig] ->
Write();
394 grMuHiProj[iSig] ->
Write();
395 grMuLoProj[iSig] ->
Write();
398 cout <<
" Saved output." << endl;
412 cout <<
" Closed files." << endl;