Skip to content

Commit dee81e9

Browse files
author
Henrik Fribert
committed
Implementation of the sigma+ via PCM recsontruction and bdt selection (ML)
1 parent 6561bed commit dee81e9

11 files changed

Lines changed: 899 additions & 14 deletions

‎PWGCF/Femto/Core/kinkBuilder.h‎

Lines changed: 453 additions & 5 deletions
Large diffs are not rendered by default.

‎PWGCF/Femto/Core/kinkHistManager.h‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ struct ConfSigmaPlusBinning : o2::framework::ConfigurableGroup {
105105
std::string prefix = Prefix;
106106
KINK_DEFAULT_BINNING(1.1, 1.3)
107107
};
108+
template <auto& Prefix>
109+
struct ConfSigmaPlusPcmBinning : o2::framework::ConfigurableGroup {
110+
std::string prefix = Prefix;
111+
KINK_DEFAULT_BINNING(1.1, 1.3)
112+
};
108113

109114
#undef KINK_DEFAULT_BINNING
110115

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

122+
constexpr const char PrefixSigmaPlusPcmBinning1[] = "SigmaPlusPcmBinning1";
123+
using ConfSigmaPlusPcmBinning1 = ConfSigmaPlusPcmBinning<PrefixSigmaPlusPcmBinning1>;
124+
117125
template <auto& Prefix>
118126
struct ConfKinkQaBinning : o2::framework::ConfigurableGroup {
119127
std::string prefix = Prefix;
@@ -262,6 +270,8 @@ constexpr char PrefixSigmaPlusQa[] = "SigmaPlusQA/";
262270
constexpr char PrefixSigmaPlus1Se[] = "SigmaPlus1/SE/";
263271
constexpr char PrefixSigmaPlus1Me[] = "SigmaPlus1/ME/";
264272
constexpr char PrefixSigmaPlus2[] = "SigmaPlus2/";
273+
constexpr char PrefixSigmaPlusPcm1Se[] = "SigmaPlusPcm1/SE/";
274+
constexpr char PrefixSigmaPlusPcm1Me[] = "SigmaPlusPcm1/ME/";
265275

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

511-
if constexpr (isEqual(kink, modes::Kink::kSigma) || isEqual(kink, modes::Kink::kSigmaPlus)) {
521+
if constexpr (isEqual(kink, modes::Kink::kSigma) || isEqual(kink, modes::Kink::kSigmaPlus) || isEqual(kink, modes::Kink::kSigmaPlusPcm)) {
512522
mHistogramRegistry->fill(HIST(kinkPrefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), kinkcandidate.sign());
513523
}
514524
}

‎PWGCF/Femto/Core/mcBuilder.h‎

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ struct McBuilderProducts : o2::framework::ProducesGroup {
6666
o2::framework::Produces<o2::aod::FLcLabels> producedLcLabels;
6767
o2::framework::Produces<o2::aod::FSigmaLabels> producedSigmaLabels;
6868
o2::framework::Produces<o2::aod::FSigmaPlusLabels> producedSigmaPlusLabels;
69+
o2::framework::Produces<o2::aod::FSigmaPlusPcmLabels> producedSigmaPlusPcmLabels;
6970
o2::framework::Produces<o2::aod::FXiLabels> producedXiLabels;
7071
o2::framework::Produces<o2::aod::FOmegaLabels> producedOmegaLabels;
7172
};
@@ -86,6 +87,7 @@ struct ConfMcTables : o2::framework::ConfigurableGroup {
8687
o2::framework::Configurable<int> producedLcLabels{"producedLcLabels", -1, "Produce Lc labels (-1: auto; 0 off; 1 on)"};
8788
o2::framework::Configurable<int> producedSigmaLabels{"producedSigmaLabels", -1, "Produce sigma labels (-1: auto; 0 off; 1 on)"};
8889
o2::framework::Configurable<int> producedSigmaPlusLabels{"producedSigmaPlusLabels", -1, "Produce sigma plus labels (-1: auto; 0 off; 1 on)"};
90+
o2::framework::Configurable<int> producedSigmaPlusPcmLabels{"producedSigmaPlusPcmLabels", -1, "Produce sigma plus (PCM) labels (-1: auto; 0 off; 1 on)"};
8991
o2::framework::Configurable<int> producedXiLabels{"producedXiLabels", -1, "Produce xi labels (-1: auto; 0 off; 1 on)"};
9092
o2::framework::Configurable<int> producedOmegaLabels{"producedOmegaLabels", -1, "Produce omega labels (-1: auto; 0 off; 1 on)"};
9193
};
@@ -159,6 +161,7 @@ class McBuilder
159161
mProduceLcLabels = utils::enableTable("FLcLabels_001", table.producedLcLabels.value, initContext);
160162
mProduceSigmaLabels = utils::enableTable("FSigmaLabels_001", table.producedSigmaLabels.value, initContext);
161163
mProduceSigmaPlusLabels = utils::enableTable("FSigmaPlusLabels_001", table.producedSigmaPlusLabels.value, initContext);
164+
mProduceSigmaPlusPcmLabels = utils::enableTable("FSigmaPlusPcmLabels_001", table.producedSigmaPlusPcmLabels.value, initContext);
162165
mProduceXiLabels = utils::enableTable("FXiLabels_001", table.producedXiLabels.value, initContext);
163166
mProduceOmegaLabels = utils::enableTable("FOmegaLabels_001", table.producedOmegaLabels.value, initContext);
164167

@@ -167,7 +170,7 @@ class McBuilder
167170
mProduceMcMothers || mProduceMcPartonicMothers ||
168171
mProduceTrackLabels ||
169172
mProduceLambdaLabels || mProduceK0shortLabels ||
170-
mProduceSigmaLabels || mProduceSigmaPlusLabels ||
173+
mProduceSigmaLabels || mProduceSigmaPlusLabels || mProduceSigmaPlusPcmLabels ||
171174
mProduceXiLabels || mProduceOmegaLabels ||
172175
mProduceD0Labels || mProduceLcLabels) {
173176
mFillAnyTable = true;
@@ -426,6 +429,16 @@ class McBuilder
426429
fillMcLabelGeneric<system>(sigmaPlusDaughter, mcParticles, mcCols, mcProducts, [](auto& prod, int64_t p) { prod.producedSigmaPlusLabels(p); }, true);
427430
}
428431

432+
template <modes::System system, typename T1, typename T2, typename T3, typename T4>
433+
void fillMcSigmaPlusPcmWithLabel(T1 const& sigmaPlusPcm, T2 const& mcParticles, T3 const& mcCols, T4& mcProducts)
434+
{
435+
if (!mProduceSigmaPlusPcmLabels) {
436+
mcProducts.producedSigmaPlusPcmLabels(-1);
437+
return;
438+
}
439+
fillMcLabelGeneric<system>(sigmaPlusPcm, mcParticles, mcCols, mcProducts, [](auto& prod, int64_t p) { prod.producedSigmaPlusPcmLabels(p); });
440+
}
441+
429442
template <modes::System system, typename T1, typename T2, typename T3, typename T4>
430443
void fillMcXiWithLabel(T1 const& xi, T2 const& mcParticles, T3 const& mcCols, T4& mcProducts)
431444
{
@@ -741,6 +754,7 @@ class McBuilder
741754
bool mProduceLcLabels = false;
742755
bool mProduceSigmaLabels = false;
743756
bool mProduceSigmaPlusLabels = false;
757+
bool mProduceSigmaPlusPcmLabels = false;
744758
bool mProduceXiLabels = false;
745759
bool mProduceOmegaLabels = false;
746760
bool mProduceMcMotherLabels = false;
@@ -767,6 +781,7 @@ struct McBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {
767781
o2::framework::Produces<o2::aod::StoredFTrackLabels> producedTrackLabels;
768782
o2::framework::Produces<o2::aod::StoredFSigmaLabels> producedSigmaLabels;
769783
o2::framework::Produces<o2::aod::StoredFSigmaPlusLabels> producedSigmaPlusLabels;
784+
o2::framework::Produces<o2::aod::StoredFSigmaPlusPcmLabels> producedSigmaPlusPcmLabels;
770785
};
771786

772787
struct ConfMcTablesDerivedToDerived : o2::framework::ConfigurableGroup {
@@ -850,6 +865,18 @@ class McBuilderDerivedToDerived
850865
this->getOrCreateMcParticleRow(mcParticle, mcCols, mcMothers, mcPartonicMothers, mcProducts));
851866
}
852867

868+
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
869+
void fillSigmaPlusPcmWithLabel(T1 const& sigmaPlusPcm, T2 const& mcCols, T3 const& /*mcParticles*/, T4 const& mcMothers, T5 const& mcPartonicMothers, T6& mcProducts)
870+
{
871+
if (!sigmaPlusPcm.has_fMcParticle()) {
872+
mcProducts.producedSigmaPlusPcmLabels(-1);
873+
return;
874+
}
875+
auto mcParticle = sigmaPlusPcm.template fMcParticle_as<T3>();
876+
mcProducts.producedSigmaPlusPcmLabels(
877+
this->getOrCreateMcParticleRow(mcParticle, mcCols, mcMothers, mcPartonicMothers, mcProducts));
878+
}
879+
853880
template <typename T1, typename T2>
854881
void reset(T1 const& mcCols, T2 const& mcParticles)
855882
{

‎PWGCF/Femto/Core/modes.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ enum class V0 : o2::analysis::femto::datatypes::V0Type {
219219

220220
enum class Kink : o2::analysis::femto::datatypes::KinkType {
221221
kSigma,
222-
kSigmaPlus
222+
kSigmaPlus,
223+
kSigmaPlusPcm
223224
};
224225

225226
enum class Cascade : o2::analysis::femto::datatypes::CascadeType {

‎PWGCF/Femto/Core/particleCleaner.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ constexpr const char PrefixSigmaPlusCleaner2[] = "SigmaPlusCleaner2";
7373
using ConfSigmaPlusCleaner1 = ConfParticleCleaner<PrefixSigmaPlusCleaner1>;
7474
using ConfSigmaPlusCleaner2 = ConfParticleCleaner<PrefixSigmaPlusCleaner2>;
7575

76+
constexpr const char PrefixSigmaPlusPcmCleaner1[] = "SigmaPlusPcmCleaner1";
77+
constexpr const char PrefixSigmaPlusPcmCleaner2[] = "SigmaPlusPcmCleaner2";
78+
using ConfSigmaPlusPcmCleaner1 = ConfParticleCleaner<PrefixSigmaPlusPcmCleaner1>;
79+
using ConfSigmaPlusPcmCleaner2 = ConfParticleCleaner<PrefixSigmaPlusPcmCleaner2>;
80+
7681
constexpr const char PrefixXiCleaner1[] = "XiCleaner1";
7782
constexpr const char PrefixXiCleaner2[] = "XiCleaner2";
7883
using ConfXiCleaner1 = ConfParticleCleaner<PrefixXiCleaner1>;

‎PWGCF/Femto/Core/partitions.h‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,35 @@
244244
(o2::aod::femtobase::stored::mass < (selection).massMax) && \
245245
ncheckbit(o2::aod::femtokinks::mask, (selection).mask)
246246

247+
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
248+
#define MAKE_SIGMAPLUSPCM_PARTITION(selection) \
249+
ifnode((selection).sign.node() != 0, \
250+
ifnode((selection).sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \
251+
(nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \
252+
(nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \
253+
(o2::aod::femtobase::stored::eta > (selection).etaMin) && \
254+
(o2::aod::femtobase::stored::eta < (selection).etaMax) && \
255+
(o2::aod::femtobase::stored::phi > (selection).phiMin) && \
256+
(o2::aod::femtobase::stored::phi < (selection).phiMax) && \
257+
(o2::aod::femtobase::stored::mass > (selection).massMin) && \
258+
(o2::aod::femtobase::stored::mass < (selection).massMax) && \
259+
ncheckbit(o2::aod::femtokinks::mask, (selection).mask)
260+
261+
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
262+
#define MAKE_SIGMAPLUSPCM_ML_PARTITION(selection) \
263+
ifnode((selection).sign.node() != 0, \
264+
ifnode((selection).sign.node() > 0, o2::aod::femtobase::stored::signedPt > 0.f, o2::aod::femtobase::stored::signedPt < 0.f), true) && \
265+
(nabs(o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \
266+
(nabs(o2::aod::femtobase::stored::signedPt) < (selection).ptMax) && \
267+
(o2::aod::femtobase::stored::eta > (selection).etaMin) && \
268+
(o2::aod::femtobase::stored::eta < (selection).etaMax) && \
269+
(o2::aod::femtobase::stored::phi > (selection).phiMin) && \
270+
(o2::aod::femtobase::stored::phi < (selection).phiMax) && \
271+
(o2::aod::femtobase::stored::mass > (selection).massMin) && \
272+
(o2::aod::femtobase::stored::mass < (selection).massMax) && \
273+
(o2::aod::femtokinks::mlScore > (selection).mlScoreMin) && \
274+
ncheckbit(o2::aod::femtokinks::mask, (selection).mask)
275+
247276
// partition for D0
248277
// sign of signedPt encodes the hypothesis: D0 (+) / D0bar (-)
249278
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)

‎PWGCF/Femto/DataModel/FemtoTables.h‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,18 @@ DECLARE_SOA_COLUMN(DauTpcNSigmaPi, dauTpcNSigmaPi, float);
10201020
DECLARE_SOA_COLUMN(DauTofNSigmaPr, dauTofNSigmaPr, float);
10211021
DECLARE_SOA_COLUMN(PtOriginal, ptOriginal, float);
10221022

1023+
// columns for sigma plus reconstructed with a PCM photon
1024+
DECLARE_SOA_COLUMN(MlScore, mlScore, float); //! BDT score of the candidate
1025+
DECLARE_SOA_COLUMN(FlightDirTilt, flightDirTilt, float); //! Tilt of the flight direction needed for a real solution of the missing photon
1026+
DECLARE_SOA_COLUMN(DauDcaXY, dauDcaXY, float); //! DCAxy of the charged daughter to the primary vertex
1027+
DECLARE_SOA_COLUMN(DauDcaZ, dauDcaZ, float); //! DCAz of the charged daughter to the primary vertex
1028+
DECLARE_SOA_COLUMN(PhotonDcaXYToPV, photonDcaXYToPV, float); //! Transverse DCA of the photon flight line to the primary vertex
1029+
DECLARE_SOA_COLUMN(PhotonDcaZToPV, photonDcaZToPV, float); //! Longitudinal DCA of the photon flight line to the primary vertex
1030+
DECLARE_SOA_COLUMN(PhotonCosPAToPV, photonCosPAToPV, float); //! Cosine of the photon pointing angle to the primary vertex
1031+
DECLARE_SOA_COLUMN(PhotonConvRadius, photonConvRadius, float); //! Conversion radius of the photon
1032+
DECLARE_SOA_COLUMN(AntiSigmaPointingAngle, antiSigmaPointingAngle, float); //! Angle between the unbent proton momentum and the flight direction
1033+
DECLARE_SOA_COLUMN(DcaDauPhoton, dcaDauPhoton, float); //! DCA between charged daughter and photon at the decay vertex
1034+
10231035
// id column for charged daughter track
10241036
DECLARE_SOA_INDEX_COLUMN_FULL(ChaDau, chaDau, int32_t, FTracks, "_ChaDau"); //!
10251037

@@ -1190,6 +1202,68 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusExtras_002, "FSIGMAPLUSEXTRAS", 2,
11901202
using FSigmaPlusExtras = FSigmaPlusExtras_002;
11911203
using StoredFSigmaPlusExtras = StoredFSigmaPlusExtras_002;
11921204

1205+
// table for basic sigma plus information, sigma plus reconstructed with a PCM photon
1206+
DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcm_001, "FSIGMAPLUSPCM", 1,
1207+
o2::soa::Index<>,
1208+
femtobase::stored::FColId,
1209+
femtobase::stored::SignedPt, // use sign to differentiate between sigma plus (+1) and anti sigma plus (-1)
1210+
femtobase::stored::Eta,
1211+
femtobase::stored::Phi,
1212+
femtobase::stored::Mass,
1213+
femtokinks::ChaDauId,
1214+
femtobase::dynamic::Sign<femtobase::stored::SignedPt>,
1215+
femtobase::dynamic::Pt<femtobase::stored::SignedPt>,
1216+
femtobase::dynamic::P<femtobase::stored::SignedPt, femtobase::stored::Eta>,
1217+
femtobase::dynamic::Px<femtobase::stored::SignedPt, femtobase::stored::Phi>,
1218+
femtobase::dynamic::Py<femtobase::stored::SignedPt, femtobase::stored::Phi>,
1219+
femtobase::dynamic::Pz<femtobase::stored::SignedPt, femtobase::stored::Eta>,
1220+
femtobase::dynamic::Theta<femtobase::stored::Eta>);
1221+
using FSigmaPlusPcm = FSigmaPlusPcm_001;
1222+
using FSigmaPlusPcmRow = FSigmaPlusPcm::iterator;
1223+
using StoredFSigmaPlusPcm = StoredFSigmaPlusPcm_001;
1224+
1225+
// table for basic sigma plus information, sigma plus reconstructed with a PCM photon, compressed/binned kinematics
1226+
DECLARE_SOA_TABLE_STAGED_VERSIONED(FLiteSigmaPlusPcm_001, "FLITESIGMAPCM", 1,
1227+
o2::soa::Index<>,
1228+
femtobase::stored::FLiteColId,
1229+
femtobase::lite::SignedBinnedPt,
1230+
femtobase::lite::BinnedEta,
1231+
femtobase::lite::BinnedPhi,
1232+
femtokinks::lite::BinnedSigmaMass,
1233+
femtokinks::lite::ChaDauId,
1234+
femtobase::lite::Sign<femtobase::lite::SignedBinnedPt>,
1235+
femtobase::lite::SignedPt<femtobase::lite::SignedBinnedPt>,
1236+
femtobase::lite::signedpt::Pt<femtobase::lite::SignedBinnedPt>,
1237+
femtobase::lite::Eta<femtobase::lite::BinnedEta>,
1238+
femtobase::lite::Phi<femtobase::lite::BinnedPhi>,
1239+
femtokinks::lite::SigmaMass<femtokinks::lite::BinnedSigmaMass>);
1240+
using FLiteSigmaPlusPcm = FLiteSigmaPlusPcm_001;
1241+
using FLiteSigmaPlusPcmRow = FLiteSigmaPlusPcm::iterator;
1242+
using StoredFLiteSigmaPlusPcm = StoredFLiteSigmaPlusPcm_001;
1243+
1244+
DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmMasks_001, "FSIGMAPCMMASKS", 1,
1245+
femtokinks::Mask);
1246+
using FSigmaPlusPcmMasks = FSigmaPlusPcmMasks_001;
1247+
using StoredFSigmaPlusPcmMasks = StoredFSigmaPlusPcmMasks_001;
1248+
1249+
DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmExtras_001, "FSIGMAPCMEXTRA", 1,
1250+
femtokinks::MlScore,
1251+
femtokinks::FlightDirTilt,
1252+
femtokinks::DcaMothToPV,
1253+
femtokinks::DauDcaXY,
1254+
femtokinks::DauDcaZ,
1255+
femtokinks::DauTpcNSigmaPr,
1256+
femtokinks::DauTofNSigmaPr,
1257+
femtokinks::PhotonDcaXYToPV,
1258+
femtokinks::PhotonDcaZToPV,
1259+
femtokinks::PhotonCosPAToPV,
1260+
femtokinks::PhotonConvRadius,
1261+
femtokinks::AntiSigmaPointingAngle,
1262+
femtokinks::DcaDauPhoton,
1263+
femtokinks::TransRadius);
1264+
using FSigmaPlusPcmExtras = FSigmaPlusPcmExtras_001;
1265+
using StoredFSigmaPlusPcmExtras = StoredFSigmaPlusPcmExtras_001;
1266+
11931267
namespace femtocascades
11941268
{
11951269
// columns for cascade bit masks
@@ -1666,6 +1740,13 @@ using FSigmaPlusLabel = FSigmaPlusLabels::iterator;
16661740
using StoredFSigmaPlusLabels = StoredFSigmaPlusLabels_001;
16671741
using StoredFSigmaPlusLabel = StoredFSigmaPlusLabels::iterator;
16681742

1743+
DECLARE_SOA_TABLE_STAGED_VERSIONED(FSigmaPlusPcmLabels_001, "FSIGMAPCMLABEL", 1, //! label from femto sigma plus (PCM) to femto mc particle
1744+
femtolabels::FMcParticleId);
1745+
using FSigmaPlusPcmLabels = FSigmaPlusPcmLabels_001;
1746+
using FSigmaPlusPcmLabel = FSigmaPlusPcmLabels::iterator;
1747+
using StoredFSigmaPlusPcmLabels = StoredFSigmaPlusPcmLabels_001;
1748+
using StoredFSigmaPlusPcmLabel = StoredFSigmaPlusPcmLabels::iterator;
1749+
16691750
DECLARE_SOA_TABLE_STAGED_VERSIONED(FXiLabels_001, "FXILABEL", 1, //! label from femto xi to femto mc particle
16701751
femtolabels::FMcParticleId);
16711752
using FXiLabels = FXiLabels_001;

0 commit comments

Comments
 (0)