23 #include <TCollection.h>
52 : TNamed(name, title), fQAHistList() {
56 for (Int_t itype = 0; itype <
kNtypes; itype++) {
58 for (Int_t
i = 0;
i < 20;
i++) {
84 THashList* table =
new THashList;
85 table->SetOwner(kTRUE);
86 table->SetName(
"Event");
89 table =
new THashList;
90 table->SetOwner(kTRUE);
91 table->SetName(
"Track");
94 table =
new THashList;
95 table->SetOwner(kTRUE);
96 table->SetName(
"Pair");
101 TH2I* fPdgCutQA = 0x0;
102 TProfile2D* fEffCutQA = 0x0;
107 for (Int_t itype = 0; itype <
kNtypes; itype++) {
109 TString logic =
"passed";
110 if (itype ==
kPrePair) logic =
"rejected";
112 const TVectorD* binsX =
120 binsX->GetMatrixArray());
123 fPdgCutQA =
new TH2I(Form(
"%sPDG",
fTypeKeys[itype]),
124 Form(
"%sPDG;cuts;PDG code;# %s %ss",
129 binsX->GetMatrixArray(),
130 binsPdg->GetNrows() - 1,
131 binsPdg->GetMatrixArray());
134 new TProfile2D(Form(
"%sMatchEff",
fTypeKeys[itype]),
135 Form(
"%sMatchEff;cuts;detector;<#epsilon_{match}^{MC}>",
138 binsX->GetMatrixArray(),
139 binsDet->GetNrows() - 1,
140 binsDet->GetMatrixArray());
156 for (Int_t
i = 0;
i <
fNCuts[itype];
i++) {
157 fCutQA->GetXaxis()->SetBinLabel(
i + 1,
fCutNames[
i][itype]);
159 fPdgCutQA->GetXaxis()->SetBinLabel(
i + 1,
fCutNames[
i][itype]);
161 fEffCutQA->GetXaxis()->SetBinLabel(
i + 1,
fCutNames[
i][itype]);
168 for (Int_t
i = 0;
i < binsPdg->GetNrows() - 1;
i++) {
170 case 1: pdglbl =
"electron";
break;
171 case 2: pdglbl =
"muon";
break;
172 case 3: pdglbl =
"pion";
break;
173 case 4: pdglbl =
"kaon";
break;
174 case 5: pdglbl =
"proton";
break;
176 fPdgCutQA->GetYaxis()->SetBinLabel(
i + 1, pdglbl.Data());
183 for (Int_t
i = 0;
i < binsDet->GetNrows() - 1;
i++) {
204 fEffCutQA->GetYaxis()->SetBinLabel(
i + 1, detlbl.Data());
211 static_cast<THashList*
>(
fQAHistList.FindObject(
"Event"))
217 static_cast<THashList*
>(
fQAHistList.FindObject(
"Track"))
220 static_cast<THashList*
>(
fQAHistList.FindObject(
"Track"))
221 ->AddLast(fPdgCutQA);
223 static_cast<THashList*
>(
fQAHistList.FindObject(
"Track"))
224 ->AddLast(fEffCutQA);
228 static_cast<THashList*
>(
fQAHistList.FindObject(
"Pair"))
246 TIter listIterator(filter->
GetCuts());
248 Bool_t addCut = kTRUE;
267 TIter listIterator(filter->
GetCuts());
269 Bool_t addCut = kTRUE;
288 TIter listIterator(filter->
GetCuts());
290 Bool_t addCut = kTRUE;
309 TIter listIterator(pairFilter->
GetCuts());
311 Bool_t addCut = kTRUE;
328 if (!pairFilter)
return;
330 TIter listIterator(pairFilter->
GetCuts());
332 Bool_t addCut = kTRUE;
351 TIter listIterator(eventFilter->
GetCuts());
353 Bool_t addCut = kTRUE;
378 switch (TMath::Abs(pdg)) {
379 case 11: pdglbl =
"electron";
break;
380 case 13: pdglbl =
"muon";
break;
381 case 211: pdglbl =
"pion";
break;
382 case 321: pdglbl =
"kaon";
break;
383 case 2212: pdglbl =
"proton";
break;
388 THashList* histos = 0x0;
391 histos =
static_cast<THashList*
>(
fQAHistList.FindObject(
"Event"));
396 histos =
static_cast<THashList*
>(
fQAHistList.FindObject(
"Track"));
400 histos =
static_cast<THashList*
>(
fQAHistList.FindObject(
"Pair"));
406 for (Int_t iCut = 0; iCut <
fNCuts[idx] - 1; ++iCut) {
408 UInt_t cutMask = (1 << (iCut + 1)) - 1;
411 if ((mask & cutMask) == cutMask) {
412 static_cast<TH1I*
>(histos->FindObject(
fTypeKeys[idx]))->
Fill(cutstep);
414 static_cast<TH2I*
>(histos->FindObject(Form(
"%sPDG",
fTypeKeys[idx])))
415 ->Fill(cutstep, pdglbl.Data(), 1.);
419 TProfile2D* detQA =
static_cast<TProfile2D*
>(
420 histos->FindObject(Form(
"%sMatchEff",
fTypeKeys[idx])));
460 switch (TMath::Abs(pdg)) {
461 case 11: pdglbl =
"electron";
break;
462 case 13: pdglbl =
"muon";
break;
463 case 211: pdglbl =
"pion";
break;
464 case 321: pdglbl =
"kaon";
break;
465 case 2212: pdglbl =
"proton";
break;
470 THashList* histos = 0x0;
473 histos =
static_cast<THashList*
>(
fQAHistList.FindObject(
"Event"));
478 histos =
static_cast<THashList*
>(
fQAHistList.FindObject(
"Track"));
482 histos =
static_cast<THashList*
>(
fQAHistList.FindObject(
"Pair"));
487 static_cast<TH1I*
>(histos->FindObject(
fTypeKeys[idx]))->
Fill(0);
489 static_cast<TH2I*
>(histos->FindObject(Form(
"%sPDG",
fTypeKeys[idx])))
490 ->Fill(0., pdglbl.Data(), 1.);
494 TProfile2D* detQA =
static_cast<TProfile2D*
>(
495 histos->FindObject(Form(
"%sMatchEff",
fTypeKeys[idx])));
524 if (obj->IsA() == CbmMCTrack::Class())
526 else if (obj->IsA() == PairAnalysisTrack::Class())
528 else if (obj->IsA() == PairAnalysisPairLV::Class())
530 else if (obj->IsA() == PairAnalysisPairKF::Class())
532 else if (obj->IsA() == PairAnalysisEvent::Class())
536 "ERROR: object type not supported, please let the author know "