Skip to content

Commit f2629f0

Browse files
author
Barbara Chytla
committed
Fixing cascade QA plots to match true selection
1 parent 37738ef commit f2629f0

File tree

1 file changed

+78
-47
lines changed

1 file changed

+78
-47
lines changed

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx

Lines changed: 78 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ struct femtoUniversePairTaskTrackCascadeExtended {
148148
FemtoUniverseDetaDphiStar<aod::femtouniverseparticle::ParticleType::kTrack, aod::femtouniverseparticle::ParticleType::kCascade> pairCloseRejection;
149149
FemtoUniverseDetaDphiStar<aod::femtouniverseparticle::ParticleType::kCascade, aod::femtouniverseparticle::ParticleType::kCascade> pairCloseRejectionCasc;
150150

151-
HistogramRegistry rXiQA{"xi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
151+
HistogramRegistry CascQAExtra{"CascQAExtra", {}, OutputObjHandlingPolicy::AnalysisObject, true, true};
152152
HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject};
153153
HistogramRegistry resultRegistry{"Correlations", {}, OutputObjHandlingPolicy::AnalysisObject};
154154
HistogramRegistry registryMCgen{"MCgenHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true};
@@ -259,23 +259,23 @@ struct femtoUniversePairTaskTrackCascadeExtended {
259259
AxisSpec multAxis = {multBinning, "Multiplicity"};
260260

261261
// Histograms
262-
rXiQA.add("hMassXi", "hMassXi", {HistType::kTH1F, {aXiMassAxis}});
263-
rXiQA.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {aXiMassAxis}});
264-
rXiQA.add("hPtXi", "hPtXi", {HistType::kTH1F, {{ptAxis}}});
265-
rXiQA.add("hEtaXi", "hEtaXi", {HistType::kTH1F, {{etaAxis}}});
266-
rXiQA.add("hPhiXi", "hPhiXi", {HistType::kTH1F, {{phiAxis}}});
267-
rXiQA.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {aDCADaughAxis}});
268-
rXiQA.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {aCPAAxis}});
269-
rXiQA.add("hV0TranRad", "hV0TranRad", {HistType::kTH1F, {tranRadAxis}});
270-
rXiQA.add("hDCACascDaughters", "hDCACascDaughters", {HistType::kTH1F, {aDCADaughAxis}});
271-
rXiQA.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {aCPAAxis}});
272-
rXiQA.add("hCascTranRad", "hCascTranRad", {HistType::kTH1F, {tranRadAxis}});
273-
rXiQA.add("hDcaPostoPV", "hDcaPostoPV", {HistType::kTH1F, {aDCAToPVAxis}});
274-
rXiQA.add("hDcaNegtoPV", "hDcaNegtoPV", {HistType::kTH1F, {aDCAToPVAxis}});
275-
rXiQA.add("hDcaBachtoPV", "hDcaBachtoPV", {HistType::kTH1F, {aDCAToPVAxis}});
276-
rXiQA.add("hDcaV0toPV", "hDcaV0toPV", {HistType::kTH1F, {aDCAToPVAxis}});
277-
rXiQA.add("hInvMpT", "hInvMpT", kTH2F, {{ptAxis}, {aXiMassAxis}});
278-
rXiQA.add("hInvMpTmult", "hInvMpTmult", kTH3F, {{ptAxis}, {aXiMassAxis}, {multAxis}});
262+
CascQAExtra.add("hMassXi", "hMassXi", {HistType::kTH1F, {aXiMassAxis}});
263+
CascQAExtra.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {aXiMassAxis}});
264+
CascQAExtra.add("hPtXi", "hPtXi", {HistType::kTH1F, {{ptAxis}}});
265+
CascQAExtra.add("hEtaXi", "hEtaXi", {HistType::kTH1F, {{etaAxis}}});
266+
CascQAExtra.add("hPhiXi", "hPhiXi", {HistType::kTH1F, {{phiAxis}}});
267+
CascQAExtra.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {aDCADaughAxis}});
268+
CascQAExtra.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {aCPAAxis}});
269+
CascQAExtra.add("hV0TranRad", "hV0TranRad", {HistType::kTH1F, {tranRadAxis}});
270+
CascQAExtra.add("hDCACascDaughters", "hDCACascDaughters", {HistType::kTH1F, {aDCADaughAxis}});
271+
CascQAExtra.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {aCPAAxis}});
272+
CascQAExtra.add("hCascTranRad", "hCascTranRad", {HistType::kTH1F, {tranRadAxis}});
273+
CascQAExtra.add("hDcaPostoPV", "hDcaPostoPV", {HistType::kTH1F, {aDCAToPVAxis}});
274+
CascQAExtra.add("hDcaNegtoPV", "hDcaNegtoPV", {HistType::kTH1F, {aDCAToPVAxis}});
275+
CascQAExtra.add("hDcaBachtoPV", "hDcaBachtoPV", {HistType::kTH1F, {aDCAToPVAxis}});
276+
CascQAExtra.add("hDcaV0toPV", "hDcaV0toPV", {HistType::kTH1F, {aDCAToPVAxis}});
277+
CascQAExtra.add("hInvMpT", "hInvMpT", kTH2F, {{ptAxis}, {aXiMassAxis}});
278+
CascQAExtra.add("hInvMpTmult", "hInvMpTmult", kTH3F, {{ptAxis}, {aXiMassAxis}, {multAxis}});
279279

280280
eventHisto.init(&qaRegistry);
281281
/// nSigma debug histograms for the selected particle species only i.e. not sigmas of all particles mixed together
@@ -371,44 +371,69 @@ struct femtoUniversePairTaskTrackCascadeExtended {
371371
}
372372
}
373373

374-
void processCascadeQA([[maybe_unused]] const FilteredFDCollision& col, const FemtoFullParticles& parts, const aod::FDCascParticles& fdcascs)
374+
template <class T>
375+
using hasSigma = decltype(std::declval<T&>().tpcNSigmaStorePr());
376+
377+
// Additional cascade QA plots
378+
template <class TableType, typename PartitionType>
379+
void doCascadeQA([[maybe_unused]] const FilteredFDCollision& col, const TableType& parts, PartitionType& partsTwo, const aod::FDCascParticles& fdcascs)
375380
{
376-
for (const auto& casc : fdcascs) {
377-
const auto& part = casc.fdParticle_as<FemtoFullParticles>();
378-
rXiQA.fill(HIST("hMassXi"), part.mLambda());
381+
auto groupPartsTwo = partsTwo->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache);
382+
383+
// Basic particle loop
384+
for (const auto& part : groupPartsTwo) {
385+
CascQAExtra.fill(HIST("hMassXi"), part.mLambda());
379386

380387
const auto& posChild = parts.iteratorAt(part.globalIndex() - 3 - parts.begin().globalIndex());
381388
const auto& negChild = parts.iteratorAt(part.globalIndex() - 2 - parts.begin().globalIndex());
382389
const auto& bachelor = parts.iteratorAt(part.globalIndex() - 1 - parts.begin().globalIndex());
383390

384-
float posChildTPC, negChildTPC, bachelorTPC, posChildTOF, negChildTOF, bachelorTOF;
385-
if (!isParticleTPC(posChild, CascChildTable[confCascType1][0], &posChildTPC) || !isParticleTPC(negChild, CascChildTable[confCascType1][1], &negChildTPC) || !isParticleTPC(bachelor, CascChildTable[confCascType1][2], &bachelorTPC))
386-
continue;
391+
if constexpr (std::experimental::is_detected<hasSigma, typename TableType::iterator>::value) {
392+
float posChildTPC, negChildTPC, bachelorTPC, posChildTOF, negChildTOF, bachelorTOF;
393+
if (!isParticleTPC(posChild, CascChildTable[confCascType1][0], &posChildTPC) || !isParticleTPC(negChild, CascChildTable[confCascType1][1], &negChildTPC) || !isParticleTPC(bachelor, CascChildTable[confCascType1][2], &bachelorTPC))
394+
continue;
387395

388-
if (!isParticleTOF(posChild, CascChildTable[confCascType1][0], &posChildTOF) || !isParticleTOF(negChild, CascChildTable[confCascType1][1], &negChildTOF) || !isParticleTOF(bachelor, CascChildTable[confCascType1][2], &bachelorTOF))
389-
continue;
396+
if (!isParticleTOF(posChild, CascChildTable[confCascType1][0], &posChildTOF) || !isParticleTOF(negChild, CascChildTable[confCascType1][1], &negChildTOF) || !isParticleTOF(bachelor, CascChildTable[confCascType1][2], &bachelorTOF))
397+
continue;
390398

391-
rXiQA.fill(HIST("hPtXi"), part.pt());
392-
rXiQA.fill(HIST("hEtaXi"), part.eta());
393-
rXiQA.fill(HIST("hPhiXi"), part.phi());
394-
rXiQA.fill(HIST("hMassXiSelected"), part.mLambda());
395-
rXiQA.fill(HIST("hDCAV0Daughters"), casc.dcaV0daughters());
396-
rXiQA.fill(HIST("hV0CosPA"), casc.cpav0());
397-
rXiQA.fill(HIST("hV0TranRad"), casc.v0radius());
398-
rXiQA.fill(HIST("hCascCosPA"), casc.cpaCasc());
399-
rXiQA.fill(HIST("hDCACascDaughters"), casc.dcacascdaughters());
400-
rXiQA.fill(HIST("hCascTranRad"), casc.cascradius());
401-
rXiQA.fill(HIST("hDcaPostoPV"), casc.dcapostopv());
402-
rXiQA.fill(HIST("hDcaNegtoPV"), casc.dcanegtopv());
403-
rXiQA.fill(HIST("hDcaBachtoPV"), casc.dcabachtopv());
404-
rXiQA.fill(HIST("hDcaV0toPV"), casc.dcav0topv());
405-
rXiQA.fill(HIST("hInvMpT"), part.pt(), part.mLambda());
399+
CascQAExtra.fill(HIST("hPtXi"), part.pt());
400+
CascQAExtra.fill(HIST("hEtaXi"), part.eta());
401+
CascQAExtra.fill(HIST("hPhiXi"), part.phi());
402+
CascQAExtra.fill(HIST("hMassXiSelected"), part.mLambda());
403+
CascQAExtra.fill(HIST("hInvMpT"), part.pt(), part.mLambda());
404+
}
406405
}
407-
}
408-
PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processCascadeQA, "Enable processing cascades", false);
409406

410-
template <class T>
411-
using hasSigma = decltype(std::declval<T&>().tpcNSigmaStorePr());
407+
// Cascade extended table loop
408+
for (const auto& casc : fdcascs) {
409+
const auto& part = casc.fdParticle_as<FemtoFullParticles>();
410+
411+
const auto& posChildExt = parts.iteratorAt(part.globalIndex() - 3 - parts.begin().globalIndex());
412+
const auto& negChildExt = parts.iteratorAt(part.globalIndex() - 2 - parts.begin().globalIndex());
413+
const auto& bachelorExt = parts.iteratorAt(part.globalIndex() - 1 - parts.begin().globalIndex());
414+
415+
if constexpr (std::experimental::is_detected<hasSigma, typename TableType::iterator>::value) {
416+
float posChildTPCExt, negChildTPCExt, bachelorTPCExt, posChildTOFExt, negChildTOFExt, bachelorTOFExt;
417+
if (!isParticleTPC(posChildExt, CascChildTable[confCascType1][0], &posChildTPCExt) || !isParticleTPC(negChildExt, CascChildTable[confCascType1][1], &negChildTPCExt) || !isParticleTPC(bachelorExt, CascChildTable[confCascType1][2], &bachelorTPCExt))
418+
continue;
419+
420+
if (!isParticleTOF(posChildExt, CascChildTable[confCascType1][0], &posChildTOFExt) || !isParticleTOF(negChildExt, CascChildTable[confCascType1][1], &negChildTOFExt) || !isParticleTOF(bachelorExt, CascChildTable[confCascType1][2], &bachelorTOFExt))
421+
continue;
422+
423+
CascQAExtra.fill(HIST("hDCAV0Daughters"), casc.dcaV0daughters());
424+
CascQAExtra.fill(HIST("hV0CosPA"), casc.cpav0());
425+
CascQAExtra.fill(HIST("hV0TranRad"), casc.v0radius());
426+
CascQAExtra.fill(HIST("hCascCosPA"), casc.cpaCasc());
427+
CascQAExtra.fill(HIST("hDCACascDaughters"), casc.dcacascdaughters());
428+
CascQAExtra.fill(HIST("hCascTranRad"), casc.cascradius());
429+
CascQAExtra.fill(HIST("hDcaPostoPV"), casc.dcapostopv());
430+
CascQAExtra.fill(HIST("hDcaNegtoPV"), casc.dcanegtopv());
431+
CascQAExtra.fill(HIST("hDcaBachtoPV"), casc.dcabachtopv());
432+
CascQAExtra.fill(HIST("hDcaV0toPV"), casc.dcav0topv());
433+
}
434+
}
435+
436+
}
412437

413438
/// track - cascade correlations
414439
template <class TableType, typename PartitionType>
@@ -469,7 +494,7 @@ struct femtoUniversePairTaskTrackCascadeExtended {
469494
bachHistos.fillQABase<false, false>(bachelor, HIST("hBachelor"));
470495
cascQAHistos.fillQA<false, false>(part);
471496
}
472-
rXiQA.fill(HIST("hInvMpTmult"), part.pt(), part.mLambda(), multCol);
497+
CascQAExtra.fill(HIST("hInvMpTmult"), part.pt(), part.mLambda(), multCol);
473498
}
474499

475500
for (const auto& part : groupPartsOne) {
@@ -552,6 +577,12 @@ struct femtoUniversePairTaskTrackCascadeExtended {
552577
}
553578
}
554579

580+
void processCascadeQA([[maybe_unused]] const FilteredFDCollision& col, const FemtoFullParticles& parts, const aod::FDCascParticles& fdcascs)
581+
{
582+
doCascadeQA(col, parts, partsTwoFull, fdcascs);
583+
}
584+
PROCESS_SWITCH(femtoUniversePairTaskTrackCascadeExtended, processCascadeQA, "Enable additional QA for cascades", false);
585+
555586
void processSameEvent(const FilteredFDCollision& col, const FemtoFullParticles& parts)
556587
{
557588
doSameEvent(col, parts, partsOneFull, partsTwoFull);

0 commit comments

Comments
 (0)