Skip to content

Commit 9ef18e9

Browse files
prchakraalibuild
andauthored
[PWGCF] FemtoUnivserse: Adding function for PID misidentification (#10094)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 74278d1 commit 9ef18e9

File tree

2 files changed

+70
-3
lines changed

2 files changed

+70
-3
lines changed

PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class FemtoUniverseParticleHisto
138138
if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) {
139139
/// Track histograms
140140
mHistogramRegistry->add((folderName + folderSuffix + "/hPDG").c_str(), "; PDG; Entries", kTH1I, {{6001, -3000, 3000}});
141-
mHistogramRegistry->add((folderName + folderSuffix + "/hOrigin_MC").c_str(), "; Origin; Entries", kTH1I, {{7, 0, 7}});
141+
mHistogramRegistry->add((folderName + folderSuffix + "/hOrigin_MC").c_str(), "; Origin; Entries", kTH1I, {{100, 0, 100}});
142142
mHistogramRegistry->add((folderName + folderSuffix + "/hNoMCtruthCounter").c_str(), "; Counter; Entries", kTH1I, {{1, 0, 1}});
143143
// DCA plots
144144
mHistogramRegistry->add((folderName + folderSuffix + "/hDCAxy_Material").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
@@ -147,6 +147,8 @@ class FemtoUniverseParticleHisto
147147
mHistogramRegistry->add((folderName + folderSuffix + "/hDCAxy_DaughterSigmaplus").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
148148
mHistogramRegistry->add((folderName + folderSuffix + "/hDCAxy_Primary").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
149149
mHistogramRegistry->add((folderName + folderSuffix + "/hDCAxy_Daughter").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
150+
mHistogramRegistry->add((folderName + folderSuffix + "/hDCAxy_NoMCTruthOrigin").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {tempFitVarpTAxis, tempFitVarAxis});
151+
mHistogramRegistry->add((folderName + folderSuffix + "/hMisidentification").c_str(), "; #it{p}_{T} (GeV/#it{c}); Particle; Particle", kTH3F, {{4, 0, 4}, {4, 0, 4}, tempFitVarpTAxis});
150152
} else if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0) {
151153
/// V0 histograms
152154
/// to be implemented
@@ -338,6 +340,10 @@ class FemtoUniverseParticleHisto
338340
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_DaughterSigmaplus"),
339341
part.pt(), part.tempFitVar());
340342
break;
343+
case (99):
344+
mHistogramRegistry->fill(histFolder + HIST("_MC/hDCAxy_NoMCTruthOrigin"),
345+
part.pt(), part.tempFitVar());
346+
break;
341347
default:
342348
LOG(fatal) << "femtouniverseparticleMC: not known value for ParticleOriginMCTruth - please check. Quitting!";
343349
}
@@ -355,6 +361,39 @@ class FemtoUniverseParticleHisto
355361
}
356362
}
357363

364+
template <typename T, typename H>
365+
void fillQA_MC_MisIden(T const& part, int pdgcode, int confPDG, H const& histFolder) // o2-linter: disable=name/function-variable
366+
{
367+
if (mHistogramRegistry) {
368+
if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack) {
369+
if (confPDG == mConfPDGCodePart[0]) {
370+
PDGbin = 0;
371+
} else if (confPDG == mConfPDGCodePart[1]) {
372+
PDGbin = 1;
373+
} else if (confPDG == mConfPDGCodePart[2]) {
374+
PDGbin = 2;
375+
} else {
376+
PDGbin = 3;
377+
}
378+
if (std::abs(pdgcode) == 211) {
379+
mHistogramRegistry->fill(histFolder + HIST("_MC/hMisidentification"),
380+
PDGbin, 0, part.pt());
381+
} else if (std::abs(pdgcode) == 321) {
382+
mHistogramRegistry->fill(histFolder + HIST("_MC/hMisidentification"),
383+
PDGbin, 1, part.pt());
384+
} else if (std::abs(pdgcode) == 2212) {
385+
mHistogramRegistry->fill(histFolder + HIST("_MC/hMisidentification"),
386+
PDGbin, 2, part.pt());
387+
} else {
388+
mHistogramRegistry->fill(histFolder + HIST("_MC/hMisidentification"),
389+
PDGbin, 3, part.pt());
390+
}
391+
}
392+
} else {
393+
LOG(fatal) << "FemtoUniverseParticleHisto: Histogramming for requested object not defined - quitting!";
394+
}
395+
}
396+
358397
/// Templated function to fill particle histograms for data/ Monte Carlo reconstructed and Monte Carlo truth
359398
/// Always calls fillQA_base fill histogramms with data/ Monte Carlo reconstructed
360399
/// In case of Monte Carlo, calls fillQA_base with Monte Carlo truth info and specialized function fillQA_MC for additional histogramms
@@ -387,12 +426,39 @@ class FemtoUniverseParticleHisto
387426
}
388427
}
389428

429+
/// Templated function to fill particle histograms for data/ Monte Carlo reconstructed and Monte Carlo truth
430+
/// Always calls fillQA_base fill histogramms with data/ Monte Carlo reconstructed
431+
/// In case of Monte Carlo, calls fillQA_base with Monte Carlo truth info and specialized function fillQA_MC for additional histogramms
432+
/// \tparam T particle type
433+
/// \tparam isMC fills the additional histograms for Monte Carlo truth
434+
/// \param part particle for which the histograms should be filled
435+
template <bool isMC, bool isDebug, typename T>
436+
void fillQAMisIden(T const& part, int confPDG)
437+
{
438+
fillQABaseMisiden<isMC, isDebug, T>(part, HIST(o2::aod::femtouniverseparticle::ParticleTypeName[mParticleType]) + HIST(mFolderSuffix[mFolderSuffixType]), confPDG);
439+
}
440+
441+
template <bool isMC, bool isDebug, typename T, typename H>
442+
void fillQABaseMisiden(T const& part, H const& histFolder, int confPDG)
443+
{
444+
std::string tempFitVarName;
445+
if (mHistogramRegistry) {
446+
if constexpr (isMC) {
447+
if (part.has_fdMCParticle()) {
448+
fillQA_MC_MisIden(part, (part.fdMCParticle()).pdgMCTruth(), confPDG, histFolder);
449+
}
450+
}
451+
}
452+
}
453+
390454
private:
391455
HistogramRegistry* mHistogramRegistry; ///< For QA output
392456
static constexpr o2::aod::femtouniverseparticle::ParticleType mParticleType = particleType; ///< Type of the particle under analysis // o2-linter: disable=name/constexpr-constant
393457
static constexpr int mFolderSuffixType = suffixType; ///< Counter for the folder suffix specified below // o2-linter: disable=name/constexpr-constant
394458
static constexpr std::string_view mFolderSuffix[5] = {"", "_one", "_two", "_pos", "_neg"}; ///< Suffix for the folder name in case of analyses of pairs of the same kind (T-T, V-V, C-C) // o2-linter: disable=name/constexpr-constant
459+
int mConfPDGCodePart[4] = {211, 321, 2212, 9999}; ///< PDG code as per analysis
395460
int mPDG = 0; ///< PDG code of the selected particle
461+
int PDGbin = 0;
396462
};
397463
} // namespace o2::analysis::femto_universe
398464

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrack3DMultKtExtended.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
462462
continue;
463463
}
464464
trackHistoPartOne.fillQA<isMC, true>(part);
465+
trackHistoPartOne.fillQAMisIden<isMC, true>(part, trackonefilter.ConfPDGCodePartOne);
465466
}
466467
}
467468

@@ -667,7 +668,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
667668
doSameEvent<false>(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multV0M(), 1, fillQA);
668669
}
669670
if (cfgProcessPP) {
670-
doSameEvent<false>(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multV0M(), 2, fillQA, mcparts);
671+
doSameEvent<true>(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multV0M(), 2, fillQA, mcparts);
671672
}
672673
if (cfgProcessMM) {
673674
doSameEvent<false>(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multV0M(), 3, fillQA);
@@ -677,7 +678,7 @@ struct femtoUniversePairTaskTrackTrack3DMultKtExtended {
677678
doSameEvent<false>(thegroupPartsOne, thegroupPartsTwo, parts, col.magField(), col.multNtr(), 1, fillQA);
678679
}
679680
if (cfgProcessPP) {
680-
doSameEvent<false>(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multNtr(), 2, fillQA, mcparts);
681+
doSameEvent<true>(thegroupPartsOne, thegroupPartsOne, parts, col.magField(), col.multNtr(), 2, fillQA, mcparts);
681682
}
682683
if (cfgProcessMM) {
683684
doSameEvent<false>(thegroupPartsTwo, thegroupPartsTwo, parts, col.magField(), col.multNtr(), 3, fillQA);

0 commit comments

Comments
 (0)