Skip to content

Commit

Permalink
Additional 3d histograms (optional) and low k* cut (AliceO2Group#3594)
Browse files Browse the repository at this point in the history
* Additional 3d histograms (optional) and low k* cut

* clang formating

---------

Co-authored-by: Georgios Mantzaridis <[email protected]>
  • Loading branch information
gmantzar and Georgios Mantzaridis authored Oct 11, 2023
1 parent 9cfe224 commit 09c72eb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 16 deletions.
29 changes: 21 additions & 8 deletions PWGCF/FemtoDream/FemtoDreamContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class FemtoDreamContainer
/// \param kTAxis axis object for the kT axis
/// \param mTAxis axis object for the mT axis
template <typename T>
void init_base(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots)
void init_base(std::string folderName, std::string femtoObs, T femtoObsAxis, T multAxis, T kTAxis, T mTAxis, T multAxis3D, T mTAxis3D, bool use3dplots, bool extendedplots)
{

mHistogramRegistry->add((folderName + "/relPairDist").c_str(), ("; " + femtoObs + "; Entries").c_str(), kTH1F, {femtoObsAxis});
Expand All @@ -86,6 +86,9 @@ class FemtoDreamContainer
if (use3dplots) {
mHistogramRegistry->add((folderName + "/relPairkstarmTMult").c_str(), ("; " + femtoObs + "; #it{m}_{T} (GeV/#it{c}^{2}); Multiplicity").c_str(), kTH3F, {femtoObsAxis, mTAxis3D, multAxis3D});
}
if (extendedplots) {
mHistogramRegistry->add((folderName + "/mTPtPart1PtPart2").c_str(), "; #it{m}_{T} (GeV/#it{c}^{2}); #it{p} _{T} Particle 1 (GeV/#it{c}); #it{p} _{T} Particle 1 (GeV/#it{c})", kTH3F, {mTAxis3D, {375, 0., 7.5}, {375, 0., 7.5}});
}
}

/// Initializes specialized Monte Carlo truth histograms for the task
Expand Down Expand Up @@ -115,13 +118,14 @@ class FemtoDreamContainer
/// \param mTBins mT binning for the histograms
/// \param isMC add Monte Carlo truth histograms to the output file
template <typename T>
void init(HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, bool isMC, bool use3dplots)
void init(HistogramRegistry* registry, T& kstarBins, T& multBins, T& kTBins, T& mTBins, T& multBins3D, T& mTBins3D, bool isMC, bool use3dplots, bool extendedplots, float highkstarCut)
{
mHistogramRegistry = registry;
std::string femtoObs;
if constexpr (mFemtoObs == femtoDreamContainer::Observable::kstar) {
femtoObs = "#it{k*} (GeV/#it{c})";
}
mHighkstarCut = highkstarCut;
std::vector<double> tmpVecMult = multBins;
framework::AxisSpec multAxis = {tmpVecMult, "Multiplicity"};
framework::AxisSpec femtoObsAxis = {kstarBins, femtoObs.c_str()};
Expand All @@ -133,10 +137,10 @@ class FemtoDreamContainer

std::string folderName = static_cast<std::string>(mFolderSuffix[mEventType]) + static_cast<std::string>(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kRecon]);

init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots);
init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots, extendedplots);
if (isMC) {
folderName = static_cast<std::string>(mFolderSuffix[mEventType]) + static_cast<std::string>(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth]);
init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots);
init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, use3dplots, extendedplots);
init_MC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis);
}
}
Expand All @@ -159,7 +163,7 @@ class FemtoDreamContainer
/// \param part2 Particle two
/// \param mult Multiplicity of the event
template <o2::aod::femtodreamMCparticle::MCType mc, typename T>
void setPair_base(const float femtoObs, const float mT, T const& part1, T const& part2, const int mult, bool use3dplots)
void setPair_base(const float femtoObs, const float mT, T const& part1, T const& part2, const int mult, bool use3dplots, bool extendedplots)
{
const float kT = FemtoDreamMath::getkT(part1, mMassOne, part2, mMassTwo);
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/relPairDist"), femtoObs);
Expand All @@ -175,6 +179,9 @@ class FemtoDreamContainer
if (use3dplots) {
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/relPairkstarmTMult"), femtoObs, mT, mult);
}
if (extendedplots) {
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[mc]) + HIST("/mTPtPart1PtPart2"), mT, part1.pt(), part2.pt());
}
}

/// Called by setPair only in case of Monte Carlo truth
Expand Down Expand Up @@ -205,17 +212,22 @@ class FemtoDreamContainer
/// \param part2 Particle two
/// \param mult Multiplicity of the event
template <bool isMC, typename T>
void setPair(T const& part1, T const& part2, const int mult, bool use3dplots)
void setPair(T const& part1, T const& part2, const int mult, bool use3dplots, bool extendedplots)
{
float femtoObs, femtoObsMC;
// Calculate femto observable and the mT with reconstructed information
if constexpr (mFemtoObs == femtoDreamContainer::Observable::kstar) {
femtoObs = FemtoDreamMath::getkstar(part1, mMassOne, part2, mMassTwo);
}
if (mHighkstarCut > 0) {
if (femtoObs > mHighkstarCut) {
return;
}
}
const float mT = FemtoDreamMath::getmT(part1, mMassOne, part2, mMassTwo);

if (mHistogramRegistry) {
setPair_base<o2::aod::femtodreamMCparticle::MCType::kRecon>(femtoObs, mT, part1, part2, mult, use3dplots);
setPair_base<o2::aod::femtodreamMCparticle::MCType::kRecon>(femtoObs, mT, part1, part2, mult, use3dplots, extendedplots);

if constexpr (isMC) {
if (part1.has_fdMCParticle() && part2.has_fdMCParticle()) {
Expand All @@ -226,7 +238,7 @@ class FemtoDreamContainer
const float mTMC = FemtoDreamMath::getmT(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo);

if (abs(part1.fdMCParticle().pdgMCTruth()) == mPDGOne && abs(part2.fdMCParticle().pdgMCTruth()) == mPDGTwo) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
setPair_base<o2::aod::femtodreamMCparticle::MCType::kTruth>(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots);
setPair_base<o2::aod::femtodreamMCparticle::MCType::kTruth>(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots, extendedplots);
setPair_MC(femtoObsMC, femtoObs, mT, mult);
} else {
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth]) + HIST("/hFakePairsCounter"), 0);
Expand All @@ -248,6 +260,7 @@ class FemtoDreamContainer
float mMassTwo = 0.f; ///< PDG mass of particle 2
int mPDGOne = 0; ///< PDG code of particle 1
int mPDGTwo = 0; ///< PDG code of particle 2
float mHighkstarCut = 6.;
};

} // namespace o2::analysis::femtoDream
Expand Down
10 changes: 6 additions & 4 deletions PWGCF/FemtoDream/femtoDreamPairTaskTrackTrack.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ struct femtoDreamPairTaskTrackTrack {
Configurable<bool> ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"};
Configurable<std::vector<float>> ConfTrkPIDnSigmaMax{"ConfTrkPIDnSigmaMax", std::vector<float>{4.f, 3.f, 2.f}, "This configurable needs to be the same as the one used in the producer task"};
Configurable<bool> ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"};
Configurable<bool> ConfExtendedPlots{"ConfExtendedPlots", false, "Enable additional three dimensional histogramms. High memory consumption. Use for debugging"};
Configurable<float> ConfHighkstarCut{"ConfHighkstarCut", 6., "Set a cut for high k*, above which the pairs are rejected. Set it to -1 to deactivate it"};

/// Particle 1
Configurable<int> ConfPDGCodePartOne{"ConfPDGCodePartOne", 2212, "Particle 1 - PDG code"};
Expand Down Expand Up @@ -143,8 +145,8 @@ struct femtoDreamPairTaskTrackTrack {
MixQaRegistry.add("MixingQA/hSECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}});
MixQaRegistry.add("MixingQA/hMECollisionBins", ";bin;Entries", kTH1F, {{120, -0.5, 119.5}});

sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D);
mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D);
sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D, ConfExtendedPlots, ConfHighkstarCut);
mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D, ConfExtendedPlots, ConfHighkstarCut);
sameEventCont.setPDGCodes(ConfPDGCodePartOne, ConfPDGCodePartTwo);
mixedEventCont.setPDGCodes(ConfPDGCodePartOne, ConfPDGCodePartTwo);
pairCleaner.init(&qaRegistry);
Expand Down Expand Up @@ -249,7 +251,7 @@ struct femtoDreamPairTaskTrackTrack {
if (!pairCleaner.isCleanPair(p1, p2, parts)) {
continue;
}
sameEventCont.setPair<isMC>(p1, p2, multCol, ConfUse3D);
sameEventCont.setPair<isMC>(p1, p2, multCol, ConfUse3D, ConfExtendedPlots);
}
}

Expand Down Expand Up @@ -328,7 +330,7 @@ struct femtoDreamPairTaskTrackTrack {
}
}

mixedEventCont.setPair<isMC>(p1, p2, multCol, ConfUse3D);
mixedEventCont.setPair<isMC>(p1, p2, multCol, ConfUse3D, ConfExtendedPlots);
}
}

Expand Down
11 changes: 7 additions & 4 deletions PWGCF/FemtoDream/femtoDreamPairTaskTrackV0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ struct femtoDreamPairTaskTrackV0 {
/// Correlation part
Configurable<bool> ConfIsMC{"ConfIsMC", false, "Enable additional Histogramms in the case of a MonteCarlo Run"};
Configurable<bool> ConfUse3D{"ConfUse3D", false, "Enable three dimensional histogramms (to be used only for analysis with high statistics): k* vs mT vs multiplicity"};
Configurable<bool> ConfExtendedPlots{"ConfExtendedPlots", false, "Enable additional three dimensional histogramms. High memory consumption. Use for debugging"};
Configurable<float> ConfHighkstarCut{"ConfHighkstarCut", 6., "Set a cut for high k*, above which the pairs are rejected. Set it to -1 to deactivate it"};

ConfigurableAxis ConfMultBins{"ConfMultBins", {VARIABLE_WIDTH, 0.0f, 20.0f, 40.0f, 60.0f, 80.0f, 100.0f, 200.0f, 99999.f}, "Mixing bins - multiplicity"};
ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"};
ConfigurableAxis ConfkstarBins{"ConfkstarBins", {1500, 0., 6.}, "binning kstar"};
Expand Down Expand Up @@ -138,9 +141,9 @@ struct femtoDreamPairTaskTrackV0 {
posChildHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, ConfDummy, ConfDummy, ConfDummy, ConfDummy, false, false);
negChildHistos.init(&qaRegistry, ConfChildTempFitVarpTBins, ConfChildTempFitVarBins, ConfDummy, ConfDummy, ConfDummy, ConfDummy, false, false);

sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D);
sameEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D, ConfExtendedPlots, ConfHighkstarCut);
sameEventCont.setPDGCodes(ConfTrkPDGCodePartOne, ConfV0PDGCodePartTwo);
mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D);
mixedEventCont.init(&resultRegistry, ConfkstarBins, ConfMultBins, ConfkTBins, ConfmTBins, ConfmultBins3D, ConfmTBins3D, ConfIsMC, ConfUse3D, ConfExtendedPlots, ConfHighkstarCut);
mixedEventCont.setPDGCodes(ConfTrkPDGCodePartOne, ConfV0PDGCodePartTwo);
pairCleaner.init(&qaRegistry);
if (ConfIsCPR.value) {
Expand Down Expand Up @@ -201,7 +204,7 @@ struct femtoDreamPairTaskTrackV0 {
if (!pairCleaner.isCleanPair(p1, p2, parts)) {
continue;
}
sameEventCont.setPair<isMC>(p1, p2, multCol, ConfUse3D);
sameEventCont.setPair<isMC>(p1, p2, multCol, ConfUse3D, ConfExtendedPlots);
}
}

Expand Down Expand Up @@ -254,7 +257,7 @@ struct femtoDreamPairTaskTrackV0 {
if (!pairCleaner.isCleanPair(p1, p2, parts)) {
continue;
}
mixedEventCont.setPair<isMC>(p1, p2, multCol, ConfUse3D);
mixedEventCont.setPair<isMC>(p1, p2, multCol, ConfUse3D, ConfExtendedPlots);
}
}

Expand Down

0 comments on commit 09c72eb

Please sign in to comment.