Skip to content

Commit

Permalink
Merge branch 'AliceO2Group:master' into hist-pT-DeltaPhipair2
Browse files Browse the repository at this point in the history
  • Loading branch information
Shunsuke-Kurita authored Dec 19, 2024
2 parents e46b8cd + d9e659c commit 7589902
Show file tree
Hide file tree
Showing 63 changed files with 2,907 additions and 2,844 deletions.
8 changes: 4 additions & 4 deletions EventFiltering/PWGHF/HFFilterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,22 +198,22 @@ static const std::array<o2::framework::AxisSpec, kNBeautyParticles> massAxisB =
// channels to trigger on for femto
constexpr int activeFemtoChannels[2][5] = {{1, 1, 1, 1, 0}, // pD0, pD+, pDs, pLc, pXic
{0, 0, 0, 1, 0}}; // only for deLc
static const std::vector<std::string> labelsColumnsFemtoChannels = {"protonDZero", "protonDPlus", "protonDs", "protonLc", "protonXic"};
static const std::vector<std::string> labelsColumnsFemtoChannels = {"DZero", "DPlus", "Ds", "Lc", "Xic"};
static const std::vector<std::string> labelsRowsFemtoChannels = {"protonCharmFemto", "deuteronCharmFemto"};
constexpr float cutsPtThresholdsForFemto[1][2] = {{8., 1.4}}; // proton, deuteron
static const std::vector<std::string> labelsColumnsPtThresholdsForFemto = {"Proton", "Deuteron"};

// min and max pT for all tracks combined (except for V0 and cascades)
constexpr float cutsPt[2][7] = {{1., 0.1, 0.8, 0.5, 0.1, 0.2, 0.4},
{100000., 100000., 5., 100000., 100000., 100000., 100000.}}; // beauty, D*, femto, SigmaC, Xic*+ -> SigmaC++K-
static const std::vector<std::string> labelsColumnsCutsPt = {"Beauty", "DstarPlus", "FemtoProton", "CharmBaryon", "SoftPiSigmaC", "SoftKaonXicResoToSigmaC", "FemtoDeuteron"};
static const std::vector<std::string> labelsColumnsCutsPt = {"Beauty", "DstarPlus", "PrForFemto", "CharmBaryon", "SoftPiSigmaC", "SoftKaonXicResoToSigmaC", "DeForFemto"};
static const std::vector<std::string> labelsRowsCutsPt = {"Minimum", "Maximum"};

// PID cuts
constexpr float cutsNsigma[3][7] = {{3., 3., 3., 5., 3., 3., 5.}, // TPC proton from Lc, pi/K from D0, K from 3-prong, femto selected proton, pi/K from Xic/Omegac, K from Xic*->SigmaC-Kaon, femto selected deuteron
{3., 3., 3., 2.5, 3., 3., 5.}, // TOF proton from Lc, pi/K from D0, K from 3-prong, femto selected proton, pi/K from Xic/Omegac, K from Xic*->SigmaC-Kaon, femto selected deuteron
{999., 999., 999., 2.5, 999., 999., 5.}}; // Sum in quadrature of TPC and TOF (used only for femto selected proton and deuteron for pT < 4 GeV/c)
static const std::vector<std::string> labelsColumnsNsigma = {"PrFromLc", "PiKaFromDZero", "KaFrom3Prong", "FemtoProton", "PiKaFromCharmBaryon", "SoftKaonFromXicResoToSigmaC", "FemtoDeuteron"};
static const std::vector<std::string> labelsColumnsNsigma = {"PrFromLc", "PiKaFromDZero", "KaFrom3Prong", "PrForFemto", "PiKaFromCharmBaryon", "SoftKaonFromXicResoToSigmaC", "DeForFemto"};
static const std::vector<std::string> labelsRowsNsigma = {"TPC", "TOF", "Comb"};

// high pt
Expand Down Expand Up @@ -1111,7 +1111,7 @@ inline int8_t HfFilterHelper::isSelectedSigmaCInDeltaMassRange(const T& pTrackSa
return retValue;
}

/// Mass selection of Xic candidates to build Lb candidates
/// Mass selection of Xic candidates to build Xib candidates
/// \param pTrackSameChargeFirst is the first same-charge track momentum
/// \param pTrackSameChargeSecond is the second same-charge track momentum
/// \param pTrackOppositeCharge is the opposite charge track momentum
Expand Down
98 changes: 49 additions & 49 deletions PWGCF/FemtoUniverse/Core/FemtoUniverse3DContainer.h

Large diffs are not rendered by default.

92 changes: 44 additions & 48 deletions PWGCF/FemtoUniverse/Core/FemtoUniverseAngularContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <string>

#include "Framework/HistogramRegistry.h"
#include "Common/Core/RecoDecay.h"
#include "PWGCF/FemtoUniverse/Core/FemtoUniverseMath.h"

#include "Math/Vector4D.h"
Expand All @@ -33,10 +34,10 @@

using namespace o2::framework;

namespace o2::analysis::femtoUniverse
namespace o2::analysis::femto_universe
{

namespace femtoUniverseAngularContainer
namespace femto_universe_angular_container
{
/// Femtoscopic observable to be computed
enum Observable { kstar ///< kstar
Expand All @@ -46,15 +47,15 @@ enum Observable { kstar ///< kstar
enum EventType { same, ///< Pair from same event
mixed ///< Pair from mixed event
};
}; // namespace femtoUniverseAngularContainer
}; // namespace femto_universe_angular_container

/// \class FemtoUniverseAngularContainer
/// \brief Container for all histogramming related to the correlation function. The two
/// particles of the pair are passed here, and the correlation function and QA histograms
/// are filled according to the specified observable
/// \tparam eventType Type of the event (same/mixed)
/// \tparam obs Observable to be computed (k*/Q_inv/...)
template <femtoUniverseAngularContainer::EventType eventType, femtoUniverseAngularContainer::Observable obs>
template <femto_universe_angular_container::EventType eventType, femto_universe_angular_container::Observable obs>
class FemtoUniverseAngularContainer
{
public:
Expand All @@ -71,7 +72,7 @@ class FemtoUniverseAngularContainer
/// \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*/, T etaAxis, T phiAxis, bool use3dplots)
void initBase(std::string folderName, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*kTAxis*/, T /*mTAxis*/, T /*multAxis3D*/, T /*mTAxis3D*/, T etaAxis, T phiAxis, bool use3dplots)
{
mHistogramRegistry->add((folderName + "/DeltaEtaDeltaPhi").c_str(), "; #Delta#varphi (rad); #Delta#eta", kTH2F, {phiAxis, etaAxis});
if (use3dplots) {
Expand All @@ -85,13 +86,13 @@ class FemtoUniverseAngularContainer
/// \param folderName Name of the directory in the output file (no suffix for reconstructed data/ Monte Carlo; "_MC" for Monte Carlo Truth)
/// \param femtoObsAxis axis object for the femto observable axis
template <typename T>
void init_MC(std::string /*folderName*/, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*mTAxis*/)
void initMC(std::string /*folderName*/, std::string /*femtoObs*/, T /*femtoObsAxis*/, T /*multAxis*/, T /*mTAxis*/)
{
}

/// Templated function to initialize the histograms for the task
/// Always calls init_base to initialize the histograms for data/ Monte Carlo reconstructed
/// In case of Monte Carlo, calls init_base again for Monte Carlo truth and the specialized function init_MC for additional histogramms
/// Always calls initBase to initialize the histograms for data/ Monte Carlo reconstructed
/// In case of Monte Carlo, calls initBase again for Monte Carlo truth and the specialized function initMC for additional histogramms
/// \tparam T type of the configurable for the axis configuration
/// \param registry Histogram registry to be passed
/// \param kstarBins k* binning for the histograms
Expand All @@ -106,7 +107,7 @@ class FemtoUniverseAngularContainer
{
mHistogramRegistry = registry;
std::string femtoObs;
if constexpr (mFemtoObs == femtoUniverseAngularContainer::Observable::kstar) {
if constexpr (FemtoObs == femto_universe_angular_container::Observable::kstar) {
femtoObs = "#it{k*} (GeV/#it{c})";
}

Expand All @@ -120,18 +121,18 @@ class FemtoUniverseAngularContainer
framework::AxisSpec mTAxis3D = {mTBins3D, "#it{m}_{T} (GeV/#it{c})"};

// angular correlations
mPhiLow = (-static_cast<int>(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins;
mPhiHigh = 2 * o2::constants::math::PI + (-static_cast<int>(phiBins / 4) + 0.5) * 2. * o2::constants::math::PI / phiBins;
mPhiLow = (-static_cast<int>(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins;
mPhiHigh = o2::constants::math::TwoPI + (-static_cast<int>(phiBins / 4) + 0.5) * o2::constants::math::TwoPI / phiBins;
framework::AxisSpec phiAxis = {phiBins, mPhiLow, mPhiHigh};
framework::AxisSpec etaAxis = {etaBins, -2.0, 2.0};

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

init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots);
initBase(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots);
if (isMC) {
folderName = static_cast<std::string>(mFolderSuffix[mEventType]) + static_cast<std::string>(o2::aod::femtouniverseMCparticle::MCTypeName[o2::aod::femtouniverseMCparticle::MCType::kTruth]);
init_base(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots);
init_MC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis);
folderName = static_cast<std::string>(FolderSuffix[EventType]) + static_cast<std::string>(o2::aod::femtouniverse_mc_particle::MCTypeName[o2::aod::femtouniverse_mc_particle::MCType::kTruth]);
initBase(folderName, femtoObs, femtoObsAxis, multAxis, kTAxis, mTAxis, multAxis3D, mTAxis3D, etaAxis, phiAxis, use3dplots);
initMC(folderName, femtoObs, femtoObsAxis, multAxis, mTAxis);
}
}

Expand All @@ -152,20 +153,15 @@ class FemtoUniverseAngularContainer
/// \param part1 Particle one
/// \param part2 Particle two
/// \param mult Multiplicity of the event
template <o2::aod::femtouniverseMCparticle::MCType mc, typename T>
void setPair_base(const float /*femtoObs*/, const float /*mT*/, T const& part1, T const& part2, const int /*mult*/, bool use3dplots, float weight = 1.0f)
template <o2::aod::femtouniverse_mc_particle::MCType mc, typename T>
void setPairBase(const float /*femtoObs*/, const float /*mT*/, T const& part1, T const& part2, const int /*mult*/, bool use3dplots, float weight = 1.0f)
{
delta_eta = part1.eta() - part2.eta();
delta_phi = part1.phi() - part2.phi();
deltaEta = part1.eta() - part2.eta();

while (delta_phi < mPhiLow) {
delta_phi += o2::constants::math::TwoPI;
}
while (delta_phi > mPhiHigh) {
delta_phi -= o2::constants::math::TwoPI;
}
deltaPhi = part1.phi() - part2.phi();
deltaPhi = RecoDecay::constrainAngle(deltaPhi, 0);

mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtouniverseMCparticle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), delta_phi, delta_eta, weight);
mHistogramRegistry->fill(HIST(FolderSuffix[EventType]) + HIST(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]) + HIST("/DeltaEtaDeltaPhi"), deltaPhi, deltaEta, weight);
if (use3dplots) {
// use 3d plots
}
Expand All @@ -175,20 +171,20 @@ class FemtoUniverseAngularContainer
/// Fills MC truth specific histogramms:
/// - kstar distribution plots with RECONSTRUCTED information but ONLY for non-fake candidates; needed for purity calculations of tracks
/// - kstar resolution matrix
/// Note: Standard histogramms with MC truth information are filled with the setPair_base function
/// Note: Standard histogramms with MC truth information are filled with the setPairBase function
/// \param part1 Particle one
/// \param part2 Particle two
/// \param mult Multiplicity of the event
void setPair_MC(const float /*femtoObsMC*/, const float /*femtoObs*/, const float /*mT*/, const int /*mult*/)
void setPairMC(const float /*femtoObsMC*/, const float /*femtoObs*/, const float /*mT*/, const int /*mult*/)
{
if (mHistogramRegistry) {
// Fill the kstar distributions with the reconstructed information but only for particles with the right PDG code
}
}

/// Templated function to handle data/ Monte Carlo reconstructed and Monte Carlo truth
/// Always calls setPair_base to compute the observables with reconstructed data
/// In case of Monte Carlo, calls setPair_base with MC info and specialized function setPair_MC for additional histogramms
/// Always calls setPairBase to compute the observables with reconstructed data
/// In case of Monte Carlo, calls setPairBase with MC info and specialized function setPairMC for additional histogramms
/// \tparam T type of the femtouniverseparticle
/// \param part1 Particle one
/// \param part2 Particle two
Expand All @@ -198,25 +194,25 @@ class FemtoUniverseAngularContainer
{
float femtoObs, femtoObsMC;
// Calculate femto observable and the mT with reconstructed information
if constexpr (mFemtoObs == femtoUniverseAngularContainer::Observable::kstar) {
if constexpr (FemtoObs == femto_universe_angular_container::Observable::kstar) {
femtoObs = FemtoUniverseMath::getkstar(part1, mMassOne, part2, mMassTwo);
}
const float mT = FemtoUniverseMath::getmT(part1, mMassOne, part2, mMassTwo);

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

if constexpr (isMC) {
if (part1.has_fdMCParticle() && part2.has_fdMCParticle()) {
// calculate the femto observable and the mT with MC truth information
if constexpr (mFemtoObs == femtoUniverseAngularContainer::Observable::kstar) {
if constexpr (FemtoObs == femto_universe_angular_container::Observable::kstar) {
femtoObsMC = FemtoUniverseMath::getkstar(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo);
}
const float mTMC = FemtoUniverseMath::getmT(part1.fdMCParticle(), mMassOne, part2.fdMCParticle(), mMassTwo);

if (abs(part1.fdMCParticle().pdgMCTruth()) == abs(mPDGOne) && abs(part2.fdMCParticle().pdgMCTruth()) == abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
setPair_base<o2::aod::femtouniverseMCparticle::MCType::kTruth>(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots, weight);
setPair_MC(femtoObsMC, femtoObs, mT, mult);
if (std::abs(part1.fdMCParticle().pdgMCTruth()) == std::abs(mPDGOne) && std::abs(part2.fdMCParticle().pdgMCTruth()) == std::abs(mPDGTwo)) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
setPairBase<o2::aod::femtouniverse_mc_particle::MCType::kTruth>(femtoObsMC, mTMC, part1.fdMCParticle(), part2.fdMCParticle(), mult, use3dplots, weight);
setPairMC(femtoObsMC, femtoObs, mT, mult);
} else {
}

Expand All @@ -227,20 +223,20 @@ class FemtoUniverseAngularContainer
}

protected:
HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output
static constexpr std::string_view mFolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to mEventType
static constexpr femtoUniverseAngularContainer::Observable mFemtoObs = obs; ///< Femtoscopic observable to be computed (according to femtoUniverseAngularContainer::Observable)
static constexpr int mEventType = eventType; ///< Type of the event (same/mixed, according to femtoUniverseAngularContainer::EventType)
float mMassOne = 0.f; ///< PDG mass of particle 1
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
HistogramRegistry* mHistogramRegistry = nullptr; ///< For QA output
static constexpr std::string_view FolderSuffix[2] = {"SameEvent", "MixedEvent"}; ///< Folder naming for the output according to EventType
static constexpr femto_universe_angular_container::Observable FemtoObs = obs; ///< Femtoscopic observable to be computed (according to femto_universe_angular_container::Observable)
static constexpr int EventType = eventType; ///< Type of the event (same/mixed, according to femto_universe_angular_container::EventType)
float mMassOne = 0.f; ///< PDG mass of particle 1
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
double mPhiLow;
double mPhiHigh;
double delta_eta;
double delta_phi;
double deltaEta;
double deltaPhi;
};

} // namespace o2::analysis::femtoUniverse
} // namespace o2::analysis::femto_universe

#endif // PWGCF_FEMTOUNIVERSE_CORE_FEMTOUNIVERSEANGULARCONTAINER_H_
Loading

0 comments on commit 7589902

Please sign in to comment.