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
18 changes: 18 additions & 0 deletions PWGCF/Femto/Core/partitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,24 @@
(o2::aod::femtobase::stored::mass > (selection).massMin) && \
(o2::aod::femtobase::stored::mass < (selection).massMax)

// partition for resonance daughters (pion+/-, kaon+/- legs): unlike MAKE_TRACK_PARTITION, chargeSign
// and chargeAbs are compile-time constants on the selection struct (ConfResonanceDaughterSelection in
// trackBuilder.h), not runtime Configurables, so the sign comparison is just a comparison to a constant
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define MAKE_RESONANCE_DAUGHTER_PARTITION(selection) \
((selection).chargeSign > 0 ? o2::aod::femtobase::stored::signedPt > 0.f : o2::aod::femtobase::stored::signedPt < 0.f) && \
(nabs((selection).chargeAbs * o2::aod::femtobase::stored::signedPt) > (selection).ptMin) && \
(nabs((selection).chargeAbs * 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) && \
ifnode(TRACK_MOMENTUM((selection).chargeAbs, o2::aod::femtobase::stored::signedPt, o2::aod::femtobase::stored::eta) <= (selection).pidThres, \
ncheckbit(o2::aod::femtotracks::mask, (selection).maskLowMomentum) && \
(o2::aod::femtotracks::mask & (selection).rejectionMaskLowMomentum) == static_cast<o2::analysis::femto::datatypes::TrackMaskType>(0), \
ncheckbit(o2::aod::femtotracks::mask, (selection).maskHighMomentum) && \
(o2::aod::femtotracks::mask & (selection).rejectionMaskHighMomentum) == static_cast<o2::analysis::femto::datatypes::TrackMaskType>(0))

// partition for phis and rhos, i.e. resonance that are their own antiparticle -- both daughters are
// the same species, so the selection carries a single dauMask pair applied to both stored columns
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
Expand Down
48 changes: 37 additions & 11 deletions PWGCF/Femto/Core/trackBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,6 @@ constexpr const char PrefixTrackSelection1[] = "TrackSelection1";
constexpr const char PrefixTrackSelection2[] = "TrackSelection2";
constexpr const char PrefixTrackSelection3[] = "TrackSelection3";

// for resonances builder
constexpr const char PrefixPionPlus[] = "PionPlusSelection";
constexpr const char PrefixPionMinus[] = "PionMinusSelection";
constexpr const char PrefixKaonPlus[] = "KaonPlusSelection";
constexpr const char PrefixKaonMinus[] = "KaonMinusSelection";

// for dN/deta: tracks with TPC (ITS + TPC quality bits) and tracks without TPC (ITS quality bits only)
// set maskLowMomentum = maskHighMomentum (quality bits only), chargeSign = 0 and the eta/pT range of the measurement
constexpr const char PrefixTrackSelectionDndetaGlobal[] = "TrackSelectionDndetaGlobal"; // Global = ITS + TPC
Expand All @@ -176,14 +170,46 @@ using ConfTrackSelection1 = ConfTrackSelection<PrefixTrackSelection1>;
using ConfTrackSelection2 = ConfTrackSelection<PrefixTrackSelection2>;
using ConfTrackSelection3 = ConfTrackSelection<PrefixTrackSelection3>;

using ConfPionPlusSelection = ConfTrackSelection<PrefixPionPlus>;
using ConfPionMinusSelection = ConfTrackSelection<PrefixPionMinus>;
using ConfKaonPlusSelection = ConfTrackSelection<PrefixKaonPlus>;
using ConfKaonMinusSelection = ConfTrackSelection<PrefixKaonMinus>;

using ConfTrackSelectionDndetaGlobal = ConfTrackSelection<PrefixTrackSelectionDndetaGlobal>;
using ConfTrackSelectionDndetaItsOnly = ConfTrackSelection<PrefixTrackSelectionDndetaItsOnly>;

// Track selection for resonance daughters (pion+/-, kaon+/-). Charge sign and abs charge are fixed
// by the species itself, so they are compile-time constants rather than configurables. No pdg code
// here at all: the daughter mass used to reconstruct the resonance is set directly in the resonance
// builder (e.g. MassPiPlus/MassKMinus), never read from this selection. Used exclusively by the
// resonance builders via MAKE_RESONANCE_DAUGHTER_PARTITION.
template <auto& Prefix, int ChargeSign, float PidThresDefault>
struct ConfResonanceDaughterSelection : public o2::framework::ConfigurableGroup {
std::string prefix = Prefix;
static const int chargeAbs = 1;
static const int chargeSign = ChargeSign;
// filters for kinematics
o2::framework::Configurable<float> ptMin{"ptMin", 0.0f, "Minimum pT (GeV/c)"};
o2::framework::Configurable<float> ptMax{"ptMax", 6.f, "Maximum pT (GeV/c)"};
o2::framework::Configurable<float> etaMin{"etaMin", -0.9f, "Minimum eta"};
o2::framework::Configurable<float> etaMax{"etaMax", 0.9f, "Maximum eta"};
o2::framework::Configurable<float> phiMin{"phiMin", 0.f, "Minimum phi"};
o2::framework::Configurable<float> phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"};
// track selection masks
o2::framework::Configurable<datatypes::TrackMaskType> maskLowMomentum{"maskLowMomentum", 1ul, "Bitmask for selections below momentum threshold"};
o2::framework::Configurable<datatypes::TrackMaskType> maskHighMomentum{"maskHighMomentum", 2ul, "Bitmask for selections above momentum threshold"};
// track rejection masks
o2::framework::Configurable<datatypes::TrackMaskType> rejectionMaskLowMomentum{"rejectionMaskLowMomentum", 0ul, "Bitmask for rejections below momentum threshold"};
o2::framework::Configurable<datatypes::TrackMaskType> rejectionMaskHighMomentum{"rejectionMaskHighMomentum", 0ul, "Bitmask for rejections above momentum threshold"};
// momentum threshold for PID usage
o2::framework::Configurable<float> pidThres{"pidThres", PidThresDefault, "Momentum threshold for using TPCTOF/TOF pid for tracks with large momentum (GeV/c)"};
};

constexpr const char PrefixPionPlus[] = "PionPlusSelection";
constexpr const char PrefixPionMinus[] = "PionMinusSelection";
constexpr const char PrefixKaonPlus[] = "KaonPlusSelection";
constexpr const char PrefixKaonMinus[] = "KaonMinusSelection";

using ConfPionPlusSelection = ConfResonanceDaughterSelection<PrefixPionPlus, 1, 0.5f>;
using ConfPionMinusSelection = ConfResonanceDaughterSelection<PrefixPionMinus, -1, 0.5f>;
using ConfKaonPlusSelection = ConfResonanceDaughterSelection<PrefixKaonPlus, 1, 0.4f>;
using ConfKaonMinusSelection = ConfResonanceDaughterSelection<PrefixKaonMinus, -1, 0.4f>;

/// enum for all track selections
enum TrackSels {
// track quality cuts
Expand Down
8 changes: 4 additions & 4 deletions PWGCF/Femto/TableProducer/femtoProducerResonances.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ struct FemtoProducerResonances {

// setup for resonance daughter tracks
trackbuilder::ConfPionPlusSelection confPionPlusSelection;
o2::framework::Partition<FemtoTracks> pionPlusPartition = MAKE_TRACK_PARTITION(confPionPlusSelection);
o2::framework::Partition<FemtoTracks> pionPlusPartition = MAKE_RESONANCE_DAUGHTER_PARTITION(confPionPlusSelection);

trackbuilder::ConfPionMinusSelection confPionMinusSelection;
o2::framework::Partition<FemtoTracks> pionMinusPartition = MAKE_TRACK_PARTITION(confPionMinusSelection);
o2::framework::Partition<FemtoTracks> pionMinusPartition = MAKE_RESONANCE_DAUGHTER_PARTITION(confPionMinusSelection);

trackbuilder::ConfKaonPlusSelection confKaonPlusSelection;
o2::framework::Partition<FemtoTracks> kaonPlusPartition = MAKE_TRACK_PARTITION(confKaonPlusSelection);
o2::framework::Partition<FemtoTracks> kaonPlusPartition = MAKE_RESONANCE_DAUGHTER_PARTITION(confKaonPlusSelection);

trackbuilder::ConfKaonMinusSelection confKaonMinusSelection;
o2::framework::Partition<FemtoTracks> kaonMinusPartition = MAKE_TRACK_PARTITION(confKaonMinusSelection);
o2::framework::Partition<FemtoTracks> kaonMinusPartition = MAKE_RESONANCE_DAUGHTER_PARTITION(confKaonMinusSelection);

o2::framework::Preslice<FemtoTracks> perColtracks = o2::aod::femtobase::stored::fColId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ struct FemtoProducerTrackTrackTwoPhotonResonances {
o2::framework::expressions::Filter collisionFilter = MAKE_COLLISION_FILTER(collisionSelection);
colhistmanager::ConfCollisionBinning confCollisionBinning;

// setup for the two charged (pion) daughters -- plain track selections, same mechanism used for
// any other track daughter; sign is configured through these, not hardcoded in the builder
trackbuilder::ConfTrackSelection1 posDauSelection;
o2::framework::Partition<FemtoTracks> posDauPartition = MAKE_TRACK_PARTITION(posDauSelection);
// setup for the two charged (pion) daughters. Dedicated pion-species selections, same ones
// femtoProducerResonances.cxx uses for other two track resonances
trackbuilder::ConfPionPlusSelection posDauSelection;
o2::framework::Partition<FemtoTracks> posDauPartition = MAKE_RESONANCE_DAUGHTER_PARTITION(posDauSelection);
o2::framework::Preslice<FemtoTracks> perColPosDau = o2::aod::femtobase::stored::fColId;

trackbuilder::ConfTrackSelection2 negDauSelection;
o2::framework::Partition<FemtoTracks> negDauPartition = MAKE_TRACK_PARTITION(negDauSelection);
trackbuilder::ConfPionMinusSelection negDauSelection;
o2::framework::Partition<FemtoTracks> negDauPartition = MAKE_RESONANCE_DAUGHTER_PARTITION(negDauSelection);
o2::framework::Preslice<FemtoTracks> perColNegDau = o2::aod::femtobase::stored::fColId;

// setup for the neutral (pi0) daughter
Expand Down
Loading