19#include <TCollection.h>
51 for (
Int_t i = 0; i < 20; i++) {
79 THashList* table =
new THashList;
80 table->SetOwner(kTRUE);
81 table->SetName(
"Event");
84 table =
new THashList;
85 table->SetOwner(kTRUE);
86 table->SetName(
"Track");
89 table =
new THashList;
90 table->SetOwner(kTRUE);
91 table->SetName(
"Pair");
96 TH2I* fPdgCutQA = 0x0;
97 TProfile2D* fEffCutQA = 0x0;
104 TString logic =
"passed";
110 fNCuts[itype], binsX->GetMatrixArray());
113 fPdgCutQA =
new TH2I(Form(
"%sPDG",
fTypeKeys[itype]),
114 Form(
"%sPDG;cuts;PDG code;# %s %ss",
fTypeKeys[itype], logic.Data(),
fTypeKeys[itype]),
115 fNCuts[itype], binsX->GetMatrixArray(), binsPdg->GetNrows() - 1, binsPdg->GetMatrixArray());
118 new TProfile2D(Form(
"%sMatchEff",
fTypeKeys[itype]),
119 Form(
"%sMatchEff;cuts;detector;<#epsilon_{match}^{MC}>",
fTypeKeys[itype]),
fNCuts[itype],
120 binsX->GetMatrixArray(), binsDet->GetNrows() - 1, binsDet->GetMatrixArray());
138 fCutQA->GetXaxis()->SetBinLabel(i + 1,
fCutNames[i][itype]);
139 if (fPdgCutQA) fPdgCutQA->GetXaxis()->SetBinLabel(i + 1,
fCutNames[i][itype]);
140 if (fEffCutQA) fEffCutQA->GetXaxis()->SetBinLabel(i + 1,
fCutNames[i][itype]);
147 for (
Int_t i = 0; i < binsPdg->GetNrows() - 1; i++) {
149 case 1: pdglbl =
"electron";
break;
150 case 2: pdglbl =
"muon";
break;
151 case 3: pdglbl =
"pion";
break;
152 case 4: pdglbl =
"kaon";
break;
153 case 5: pdglbl =
"proton";
break;
155 fPdgCutQA->GetYaxis()->SetBinLabel(i + 1, pdglbl.Data());
162 for (
Int_t i = 0; i < binsDet->GetNrows() - 1; i++) {
171 fEffCutQA->GetYaxis()->SetBinLabel(i + 1, detlbl.Data());
178 static_cast<THashList*
>(
fQAHistList.FindObject(
"Event"))->AddLast(fCutQA);
183 static_cast<THashList*
>(
fQAHistList.FindObject(
"Track"))->AddLast(fCutQA);
184 if (fPdgCutQA)
static_cast<THashList*
>(
fQAHistList.FindObject(
"Track"))->AddLast(fPdgCutQA);
185 if (fEffCutQA)
static_cast<THashList*
>(
fQAHistList.FindObject(
"Track"))->AddLast(fEffCutQA);
189 static_cast<THashList*
>(
fQAHistList.FindObject(
"Pair"))->AddLast(fCutQA);
207 TIter listIterator(filter->
GetCuts());
229 TIter listIterator(filter->
GetCuts());
252 TIter listIterator(filter->
GetCuts());
274 TIter listIterator(pairFilter->
GetCuts());
294 if (!pairFilter)
return;
296 TIter listIterator(pairFilter->
GetCuts());
319 TIter listIterator(eventFilter->
GetCuts());
347 switch (TMath::Abs(pdg)) {
348 case 11: pdglbl =
"electron";
break;
349 case 13: pdglbl =
"muon";
break;
350 case 211: pdglbl =
"pion";
break;
351 case 321: pdglbl =
"kaon";
break;
352 case 2212: pdglbl =
"proton";
break;
357 THashList* histos = 0x0;
369 for (
Int_t iCut = 0; iCut <
fNCuts[idx] - 1; ++iCut) {
371 UInt_t cutMask = (1 << (iCut + 1)) - 1;
374 if ((mask & cutMask) == cutMask) {
375 static_cast<TH1I*
>(histos->FindObject(
fTypeKeys[idx]))->Fill(cutstep);
376 if (pdg)
static_cast<TH2I*
>(histos->FindObject(Form(
"%sPDG",
fTypeKeys[idx])))->Fill(cutstep, pdglbl.Data(), 1.);
380 TProfile2D* detQA =
static_cast<TProfile2D*
>(histos->FindObject(Form(
"%sMatchEff",
fTypeKeys[idx])));
382#if (ROOT_VERSION_CODE >= ROOT_VERSION(6, 26, 0))
430 switch (TMath::Abs(pdg)) {
431 case 11: pdglbl =
"electron";
break;
432 case 13: pdglbl =
"muon";
break;
433 case 211: pdglbl =
"pion";
break;
434 case 321: pdglbl =
"kaon";
break;
435 case 2212: pdglbl =
"proton";
break;
440 THashList* histos = 0x0;
451 static_cast<TH1I*
>(histos->FindObject(
fTypeKeys[idx]))->Fill(0);
452 if (pdg)
static_cast<TH2I*
>(histos->FindObject(Form(
"%sPDG",
fTypeKeys[idx])))->Fill(0., pdglbl.Data(), 1.);
456 TProfile2D* detQA =
static_cast<TProfile2D*
>(histos->FindObject(Form(
"%sMatchEff",
fTypeKeys[idx])));
458#if (ROOT_VERSION_CODE >= ROOT_VERSION(6, 26, 0))
496 else if (obj->IsA() == PairAnalysisTrack::Class())
498 else if (obj->IsA() == PairAnalysisPairLV::Class())
500 else if (obj->IsA() == PairAnalysisPairKF::Class())
502 else if (obj->IsA() == PairAnalysisEvent::Class())
506 "ERROR: object type not supported, please let the author know "
XPU_D constexpr auto ToIntegralType(T enumerator) -> typename std::underlying_type< T >::type
@ kMvd
Micro-Vertex Detector.
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kSts
Silicon Tracking System.
@ kMuch
Muon detection system.
@ kRich
Ring-Imaging Cherenkov Detector.
ClassImp(PairAnalysisCutQa) PairAnalysisCutQa
void Fill(UInt_t mask, TObject *obj, UInt_t addIdx=0)
void AddTrackFilter2(AnalysisFilter *trkFilter2)
void AddTrackFilter(AnalysisFilter *trkFilter)
void AddPrePairFilter(AnalysisFilter *pairFilter)
const char * fCutNames[20][fNtypes]
virtual ~PairAnalysisCutQa()
void AddPairFilter(AnalysisFilter *pairFilter)
void AddEventFilter(AnalysisFilter *eventFilter)
const char * fTypeKeys[fNtypes]
UInt_t GetObjIndex(TObject *obj)
void FillAll(TObject *obj, UInt_t addIdx=0)
static constexpr Int_t fNtypes
void AddTrackFilterMC(AnalysisFilter *trkFilterMC)
TVectorD * MakeLinBinning(Int_t nbinsX, Double_t xmin, Double_t xmax)
TString GetDetName(ECbmModuleId det)