Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
464 changes: 458 additions & 6 deletions PWGCF/Femto/Core/kinkBuilder.h

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion PWGCF/Femto/Core/kinkHistManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ struct ConfSigmaPlusBinning : o2::framework::ConfigurableGroup {
std::string prefix = Prefix;
KINK_DEFAULT_BINNING(1.1, 1.3)
};
template <auto& Prefix>
struct ConfSigmaPlusPcmBinning : o2::framework::ConfigurableGroup {
std::string prefix = Prefix;
KINK_DEFAULT_BINNING(1.1, 1.3)
};

#undef KINK_DEFAULT_BINNING

Expand All @@ -114,6 +119,9 @@ using ConfSigmaBinning1 = ConfSigmaBinning<PrefixSigmaBinning1>;
constexpr const char PrefixSigmaPlusBinning1[] = "SigmaPlusBinning1";
using ConfSigmaPlusBinning1 = ConfSigmaPlusBinning<PrefixSigmaPlusBinning1>;

constexpr const char PrefixSigmaPlusPcmBinning1[] = "SigmaPlusPcmBinning1";
using ConfSigmaPlusPcmBinning1 = ConfSigmaPlusPcmBinning<PrefixSigmaPlusPcmBinning1>;

template <auto& Prefix>
struct ConfKinkQaBinning : o2::framework::ConfigurableGroup {
std::string prefix = Prefix;
Expand Down Expand Up @@ -262,6 +270,8 @@ constexpr char PrefixSigmaPlusQa[] = "SigmaPlusQA/";
constexpr char PrefixSigmaPlus1Se[] = "SigmaPlus1/SE/";
constexpr char PrefixSigmaPlus1Me[] = "SigmaPlus1/ME/";
constexpr char PrefixSigmaPlus2[] = "SigmaPlus2/";
constexpr char PrefixSigmaPlusPcm1Se[] = "SigmaPlusPcm1/SE/";
constexpr char PrefixSigmaPlusPcm1Me[] = "SigmaPlusPcm1/ME/";

constexpr std::string_view AnalysisDir = "Analysis/";
constexpr std::string_view QaDir = "QA/";
Expand Down Expand Up @@ -508,7 +518,7 @@ class KinkHistManager
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(AnalysisDir) + HIST(getHistName(kPhi, HistTable)), kinkcandidate.phi());
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), kinkcandidate.mass());

if constexpr (isEqual(kink, modes::Kink::kSigma) || isEqual(kink, modes::Kink::kSigmaPlus)) {
if constexpr (isEqual(kink, modes::Kink::kSigma) || isEqual(kink, modes::Kink::kSigmaPlus) || isEqual(kink, modes::Kink::kSigmaPlusPcm)) {
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), kinkcandidate.sign());
}
}
Expand Down
34 changes: 33 additions & 1 deletion PWGCF/Femto/Core/mcBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ struct McBuilderProducts : o2::framework::ProducesGroup {
o2::framework::Produces<o2::aod::FLcLabels> producedLcLabels;
o2::framework::Produces<o2::aod::FSigmaLabels> producedSigmaLabels;
o2::framework::Produces<o2::aod::FSigmaPlusLabels> producedSigmaPlusLabels;
o2::framework::Produces<o2::aod::FSigmaPlusPcmLabels> producedSigmaPlusPcmLabels;
o2::framework::Produces<o2::aod::FXiLabels> producedXiLabels;
o2::framework::Produces<o2::aod::FOmegaLabels> producedOmegaLabels;
};
Expand All @@ -86,6 +87,7 @@ struct ConfMcTables : o2::framework::ConfigurableGroup {
o2::framework::Configurable<int> producedLcLabels{"producedLcLabels", -1, "Produce Lc labels (-1: auto; 0 off; 1 on)"};
o2::framework::Configurable<int> producedSigmaLabels{"producedSigmaLabels", -1, "Produce sigma labels (-1: auto; 0 off; 1 on)"};
o2::framework::Configurable<int> producedSigmaPlusLabels{"producedSigmaPlusLabels", -1, "Produce sigma plus labels (-1: auto; 0 off; 1 on)"};
o2::framework::Configurable<int> producedSigmaPlusPcmLabels{"producedSigmaPlusPcmLabels", -1, "Produce sigma plus (PCM) labels (-1: auto; 0 off; 1 on)"};
o2::framework::Configurable<int> producedXiLabels{"producedXiLabels", -1, "Produce xi labels (-1: auto; 0 off; 1 on)"};
o2::framework::Configurable<int> producedOmegaLabels{"producedOmegaLabels", -1, "Produce omega labels (-1: auto; 0 off; 1 on)"};
};
Expand Down Expand Up @@ -159,6 +161,7 @@ class McBuilder
mProduceLcLabels = utils::enableTable("FLcLabels_001", table.producedLcLabels.value, initContext);
mProduceSigmaLabels = utils::enableTable("FSigmaLabels_001", table.producedSigmaLabels.value, initContext);
mProduceSigmaPlusLabels = utils::enableTable("FSigmaPlusLabels_001", table.producedSigmaPlusLabels.value, initContext);
mProduceSigmaPlusPcmLabels = utils::enableTable("FSigmaPlusPcmLabels_001", table.producedSigmaPlusPcmLabels.value, initContext);
mProduceXiLabels = utils::enableTable("FXiLabels_001", table.producedXiLabels.value, initContext);
mProduceOmegaLabels = utils::enableTable("FOmegaLabels_001", table.producedOmegaLabels.value, initContext);

Expand All @@ -167,7 +170,7 @@ class McBuilder
mProduceMcMothers || mProduceMcPartonicMothers ||
mProduceTrackLabels ||
mProduceLambdaLabels || mProduceK0shortLabels ||
mProduceSigmaLabels || mProduceSigmaPlusLabels ||
mProduceSigmaLabels || mProduceSigmaPlusLabels || mProduceSigmaPlusPcmLabels ||
mProduceXiLabels || mProduceOmegaLabels ||
mProduceD0Labels || mProduceLcLabels) {
mFillAnyTable = true;
Expand Down Expand Up @@ -426,6 +429,21 @@ class McBuilder
fillMcLabelGeneric<system>(sigmaPlusDaughter, mcParticles, mcCols, mcProducts, [](auto& prod, int64_t p) { prod.producedSigmaPlusLabels(p); }, true);
}

template <modes::System system, typename T1, typename T2, typename T3, typename T4, typename T5>
void fillMcSigmaPlusPcmWithLabel(T1 const& sigmaPlusPcm, T2 const& chaDaughter, T3 const& mcParticles, T4 const& mcCols, T5& mcProducts)
{
if (!mProduceSigmaPlusPcmLabels) {
mcProducts.producedSigmaPlusPcmLabels(-1);
return;
}
// true sigma plus (proton and photon from it): label of the sigma plus, otherwise label of the proton, its mother gives the origin of the background
if (sigmaPlusPcm.has_mcParticle()) {
fillMcLabelGeneric<system>(sigmaPlusPcm, mcParticles, mcCols, mcProducts, [](auto& prod, int64_t p) { prod.producedSigmaPlusPcmLabels(p); });
} else {
fillMcLabelGeneric<system>(chaDaughter, mcParticles, mcCols, mcProducts, [](auto& prod, int64_t p) { prod.producedSigmaPlusPcmLabels(p); });
}
}

template <modes::System system, typename T1, typename T2, typename T3, typename T4>
void fillMcXiWithLabel(T1 const& xi, T2 const& mcParticles, T3 const& mcCols, T4& mcProducts)
{
Expand Down Expand Up @@ -741,6 +759,7 @@ class McBuilder
bool mProduceLcLabels = false;
bool mProduceSigmaLabels = false;
bool mProduceSigmaPlusLabels = false;
bool mProduceSigmaPlusPcmLabels = false;
bool mProduceXiLabels = false;
bool mProduceOmegaLabels = false;
bool mProduceMcMotherLabels = false;
Expand All @@ -767,6 +786,7 @@ struct McBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {
o2::framework::Produces<o2::aod::StoredFTrackLabels> producedTrackLabels;
o2::framework::Produces<o2::aod::StoredFSigmaLabels> producedSigmaLabels;
o2::framework::Produces<o2::aod::StoredFSigmaPlusLabels> producedSigmaPlusLabels;
o2::framework::Produces<o2::aod::StoredFSigmaPlusPcmLabels> producedSigmaPlusPcmLabels;
};

struct ConfMcTablesDerivedToDerived : o2::framework::ConfigurableGroup {
Expand Down Expand Up @@ -850,6 +870,18 @@ class McBuilderDerivedToDerived
this->getOrCreateMcParticleRow(mcParticle, mcCols, mcMothers, mcPartonicMothers, mcProducts));
}

template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
void fillSigmaPlusPcmWithLabel(T1 const& sigmaPlusPcm, T2 const& mcCols, T3 const& /*mcParticles*/, T4 const& mcMothers, T5 const& mcPartonicMothers, T6& mcProducts)
{
if (!sigmaPlusPcm.has_fMcParticle()) {
mcProducts.producedSigmaPlusPcmLabels(-1);
return;
}
auto mcParticle = sigmaPlusPcm.template fMcParticle_as<T3>();
mcProducts.producedSigmaPlusPcmLabels(
this->getOrCreateMcParticleRow(mcParticle, mcCols, mcMothers, mcPartonicMothers, mcProducts));
}

template <typename T1, typename T2>
void reset(T1 const& mcCols, T2 const& mcParticles)
{
Expand Down
3 changes: 2 additions & 1 deletion PWGCF/Femto/Core/modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ enum class V0 : o2::analysis::femto::datatypes::V0Type {

enum class Kink : o2::analysis::femto::datatypes::KinkType {
kSigma,
kSigmaPlus
kSigmaPlus,
kSigmaPlusPcm
};

enum class Cascade : o2::analysis::femto::datatypes::CascadeType {
Expand Down
5 changes: 5 additions & 0 deletions PWGCF/Femto/Core/particleCleaner.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ constexpr const char PrefixSigmaPlusCleaner2[] = "SigmaPlusCleaner2";
using ConfSigmaPlusCleaner1 = ConfParticleCleaner<PrefixSigmaPlusCleaner1>;
using ConfSigmaPlusCleaner2 = ConfParticleCleaner<PrefixSigmaPlusCleaner2>;

constexpr const char PrefixSigmaPlusPcmCleaner1[] = "SigmaPlusPcmCleaner1";
constexpr const char PrefixSigmaPlusPcmCleaner2[] = "SigmaPlusPcmCleaner2";
using ConfSigmaPlusPcmCleaner1 = ConfParticleCleaner<PrefixSigmaPlusPcmCleaner1>;
using ConfSigmaPlusPcmCleaner2 = ConfParticleCleaner<PrefixSigmaPlusPcmCleaner2>;

constexpr const char PrefixXiCleaner1[] = "XiCleaner1";
constexpr const char PrefixXiCleaner2[] = "XiCleaner2";
using ConfXiCleaner1 = ConfParticleCleaner<PrefixXiCleaner1>;
Expand Down
15 changes: 15 additions & 0 deletions PWGCF/Femto/Core/partitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,21 @@
(o2::aod::femtobase::stored::mass < (selection).massMax) && \
ncheckbit(o2::aod::femtokinks::mask, (selection).mask)

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define MAKE_SIGMAPLUSPCM_PARTITION(selection) \
ifnode((selection).sign.node() != 0, \
ifnode((selection).sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \
(nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \
(nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \
(o2::aod::femtobase::stored::eta > (selection).etaMin) && \
(o2::aod::femtobase::stored::eta < (selection).etaMax) && \
(o2::aod::femtobase::stored::phi > (selection).phiMin) && \
(o2::aod::femtobase::stored::phi < (selection).phiMax) && \
(o2::aod::femtobase::stored::mass > (selection).massMin) && \
(o2::aod::femtobase::stored::mass < (selection).massMax) && \
(o2::aod::femtokinks::mlScore >= (selection).mlScoreMin) && \
ncheckbit(o2::aod::femtokinks::mask, (selection).mask)
Comment thread
ariedel-cern marked this conversation as resolved.
Resolved

// partition for D0
// sign of signedPt encodes the hypothesis: D0 (+) / D0bar (-)
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
Expand Down
85 changes: 85 additions & 0 deletions PWGCF/Femto/DataModel/FemtoTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,18 @@ DECLARE_SOA_COLUMN(DauTpcNSigmaPi, dauTpcNSigmaPi, float);
DECLARE_SOA_COLUMN(DauTofNSigmaPr, dauTofNSigmaPr, float);
DECLARE_SOA_COLUMN(PtOriginal, ptOriginal, float);

// columns for sigma plus reconstructed with a PCM photon
DECLARE_SOA_COLUMN(MlScore, mlScore, float); //! BDT score of the candidate
DECLARE_SOA_COLUMN(FlightDirTilt, flightDirTilt, float); //! Tilt of the flight direction needed for a real solution of the missing photon
DECLARE_SOA_COLUMN(DauDcaXY, dauDcaXY, float); //! DCAxy of the charged daughter to the primary vertex
DECLARE_SOA_COLUMN(DauDcaZ, dauDcaZ, float); //! DCAz of the charged daughter to the primary vertex
DECLARE_SOA_COLUMN(PhotonDcaXYToPV, photonDcaXYToPV, float); //! Transverse DCA of the photon flight line to the primary vertex
DECLARE_SOA_COLUMN(PhotonDcaZToPV, photonDcaZToPV, float); //! Longitudinal DCA of the photon flight line to the primary vertex
DECLARE_SOA_COLUMN(PhotonCosPAToPV, photonCosPAToPV, float); //! Cosine of the photon pointing angle to the primary vertex
DECLARE_SOA_COLUMN(PhotonConvRadius, photonConvRadius, float); //! Conversion radius of the photon
DECLARE_SOA_COLUMN(AntiSigmaPointingAngle, antiSigmaPointingAngle, float); //! Angle between the unbent proton momentum and the flight direction
DECLARE_SOA_COLUMN(DcaDauPhoton, dcaDauPhoton, float); //! DCA between charged daughter and photon at the decay vertex

// id column for charged daughter track
DECLARE_SOA_INDEX_COLUMN_FULL(ChaDau, chaDau, int32_t, FTracks, "_ChaDau"); //!

Expand Down Expand Up @@ -1266,6 +1278,72 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusExtras_002, "FSIGMAPLUSEXTRAS", 2,
using FSigmaPlusExtras = FSigmaPlusExtras_002;
using StoredFSigmaPlusExtras = StoredFSigmaPlusExtras_002;

// table for basic sigma plus information, sigma plus reconstructed with a PCM photon
DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcm_001, "FSIGMAPLUSPCM", 1,
o2::soa::Index<>,
femtobase::stored::FColId,
femtobase::stored::SignedPt, // use sign to differentiate between sigma plus (+1) and anti sigma plus (-1)
femtobase::stored::Eta,
femtobase::stored::Phi,
femtobase::stored::Mass,
femtokinks::ChaDauId,
femtobase::dynamic::Sign<femtobase::stored::SignedPt>,
femtobase::dynamic::Pt<femtobase::stored::SignedPt>,
femtobase::dynamic::P<femtobase::stored::SignedPt, femtobase::stored::Eta>,
femtobase::dynamic::Px<femtobase::stored::SignedPt, femtobase::stored::Phi>,
femtobase::dynamic::Py<femtobase::stored::SignedPt, femtobase::stored::Phi>,
femtobase::dynamic::Pz<femtobase::stored::SignedPt, femtobase::stored::Eta>,
femtobase::dynamic::Theta<femtobase::stored::Eta>);
using FSigmaPlusPcm = FSigmaPlusPcm_001;
using FSigmaPlusPcmRow = FSigmaPlusPcm::iterator;
using StoredFSigmaPlusPcm = StoredFSigmaPlusPcm_001;

// table for basic sigma plus information, sigma plus reconstructed with a PCM photon, compressed/binned kinematics
DECLARE_SOA_TABLE_STAGED_VERSIONED(FLiteSigmaPlusPcm_001, "FLITESIGMAPCM", 1,
o2::soa::Index<>,
femtobase::stored::FLiteColId,
femtobase::lite::SignedBinnedPt,
femtobase::lite::BinnedEta,
femtobase::lite::BinnedPhi,
femtokinks::lite::BinnedSigmaMass,
femtokinks::lite::ChaDauId,
femtobase::lite::Sign<femtobase::lite::SignedBinnedPt>,
femtobase::lite::SignedPt<femtobase::lite::SignedBinnedPt>,
femtobase::lite::signedpt::Pt<femtobase::lite::SignedBinnedPt>,
femtobase::lite::Eta<femtobase::lite::BinnedEta>,
femtobase::lite::Phi<femtobase::lite::BinnedPhi>,
femtokinks::lite::SigmaMass<femtokinks::lite::BinnedSigmaMass>);
using FLiteSigmaPlusPcm = FLiteSigmaPlusPcm_001;
using FLiteSigmaPlusPcmRow = FLiteSigmaPlusPcm::iterator;
using StoredFLiteSigmaPlusPcm = StoredFLiteSigmaPlusPcm_001;

DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmMasks_001, "FSIGMAPCMMASKS", 1,
femtokinks::Mask);
using FSigmaPlusPcmMasks = FSigmaPlusPcmMasks_001;
using StoredFSigmaPlusPcmMasks = StoredFSigmaPlusPcmMasks_001;

DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmMlScores_001, "FSIGMAPCMML", 1,
femtokinks::MlScore);
using FSigmaPlusPcmMlScores = FSigmaPlusPcmMlScores_001;
using StoredFSigmaPlusPcmMlScores = StoredFSigmaPlusPcmMlScores_001;

DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmExtras_001, "FSIGMAPCMEXTRA", 1,
femtokinks::FlightDirTilt,
femtokinks::DcaMothToPV,
femtokinks::DauDcaXY,
femtokinks::DauDcaZ,
femtokinks::DauTpcNSigmaPr,
femtokinks::DauTofNSigmaPr,
femtokinks::PhotonDcaXYToPV,
femtokinks::PhotonDcaZToPV,
femtokinks::PhotonCosPAToPV,
femtokinks::PhotonConvRadius,
femtokinks::AntiSigmaPointingAngle,
femtokinks::DcaDauPhoton,
femtokinks::TransRadius);
using FSigmaPlusPcmExtras = FSigmaPlusPcmExtras_001;
using StoredFSigmaPlusPcmExtras = StoredFSigmaPlusPcmExtras_001;

namespace femtocascades
{
// columns for cascade bit masks
Expand Down Expand Up @@ -1754,6 +1832,13 @@ using FSigmaPlusLabel = FSigmaPlusLabels::iterator;
using StoredFSigmaPlusLabels = StoredFSigmaPlusLabels_001;
using StoredFSigmaPlusLabel = StoredFSigmaPlusLabels::iterator;

DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmLabels_001, "FSIGMAPCMLABEL", 1, //! label from femto sigma plus (PCM) to femto mc particle
femtolabels::FMcParticleId);
using FSigmaPlusPcmLabels = FSigmaPlusPcmLabels_001;
using FSigmaPlusPcmLabel = FSigmaPlusPcmLabels::iterator;
using StoredFSigmaPlusPcmLabels = StoredFSigmaPlusPcmLabels_001;
using StoredFSigmaPlusPcmLabel = StoredFSigmaPlusPcmLabels::iterator;

DECLARE_SOA_TABLE_STAGED_VERSIONED(FXiLabels_001, "FXILABEL", 1, //! label from femto xi to femto mc particle
femtolabels::FMcParticleId);
using FXiLabels = FXiLabels_001;
Expand Down
Loading
Loading