Skip to content

Commit ae1a5a5

Browse files
committed
Feat: add mass selection and histograms
1 parent ef1157a commit ae1a5a5

File tree

4 files changed

+44
-7
lines changed

4 files changed

+44
-7
lines changed

PWGCF/Femto/Core/partitions.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
ncheckbit(o2::aod::femtotracks::mask, selection.maskHighMomentum) && \
4545
(o2::aod::femtotracks::mask & selection.rejectionMaskHighMomentum) == static_cast<o2::aod::femtodatatypes::TrackMaskType>(0))
4646

47+
// track partition with optional mass cut
48+
#define MAKE_TRACK_PARTITION_WITH_MASS(selection) \
49+
MAKE_TRACK_PARTITION(selection) && \
50+
(o2::aod::femtobase::stored::mass > selection.massMin) && \
51+
(o2::aod::femtobase::stored::mass < selection.massMax)
52+
4753
// partition for phis and rhos, i.e. resonance that are their own antiparticle
4854
#define MAKE_RESONANCE_0_PARTITON(selection) \
4955
(o2::aod::femtobase::stored::pt > selection.ptMin) && \

PWGCF/Femto/Core/trackBuilder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ struct ConfTrackSelection : public o2::framework::ConfigurableGroup {
143143
o2::framework::Configurable<float> etaMax{"etaMax", 0.9f, "Maximum eta"};
144144
o2::framework::Configurable<float> phiMin{"phiMin", 0.f, "Minimum phi"};
145145
o2::framework::Configurable<float> phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"};
146+
o2::framework::Configurable<float> massMin{"massMin", 0.f, "Minimum TOF mass (only used if enabled)"};
147+
o2::framework::Configurable<float> massMax{"massMax", 2.f, "Maximum TOF mass (only used if enabled)"};
146148
// track selection masks
147149
o2::framework::Configurable<o2::aod::femtodatatypes::TrackMaskType> maskLowMomentum{"maskLowMomentum", 1ul, "Bitmask for selections below momentum threshold"};
148150
o2::framework::Configurable<o2::aod::femtodatatypes::TrackMaskType> maskHighMomentum{"maskHighMomentum", 2ul, "Bitmask for selections above momentum threshold"};

PWGCF/Femto/Core/trackHistManager.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ enum TrackHist {
4545
kEta,
4646
kPhi,
4747
kSign,
48+
kMass,
4849
// qa variables
4950
kPAtPv,
5051
kPTpc,
@@ -145,6 +146,7 @@ struct ConfTrackBinning : o2::framework::ConfigurableGroup {
145146
o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"};
146147
o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"};
147148
o2::framework::ConfigurableAxis sign{"sign", {{3, -1.5, 1.5}}, "Sign"};
149+
o2::framework::ConfigurableAxis mass{"mass", {{200, 0.f, 2.f}}, "Mass (if enabled, plot TOF mass, otherwise PDG mass)"};
148150
o2::framework::ConfigurableAxis pdgCodes{"pdgCodes", {{8001, -4000.5, 4000.5}}, "MC ONLY: PDG codes of selected tracks"};
149151
};
150152

@@ -268,7 +270,8 @@ constexpr std::array<histmanager::HistInfo<TrackHist>, kTrackHistLast>
268270
{kPt, o2::framework::kTH1F, "hPt", "Transverse Momentum; p_{T} (GeV/#it{c}); Entries"},
269271
{kEta, o2::framework::kTH1F, "hEta", "Pseudorapidity; #eta; Entries"},
270272
{kPhi, o2::framework::kTH1F, "hPhi", "Azimuthal angle; #varphi; Entries"},
271-
{kSign, o2::framework::kTH1F, "hSign", "Sign of charge ; Sign; Entries"},
273+
{kSign, o2::framework::kTH1F, "hSign", "Sign of charge; Sign; Entries"},
274+
{kMass, o2::framework::kTH1F, "hMass", "Mass; m (GeV/#it{c}^{2}); Entries"},
272275
{kPAtPv, o2::framework::kTH1F, "hPAtPv", "Momentum at Primary vertex; p_{vertex}; Entries"},
273276
{kPTpc, o2::framework::kTH1F, "hPTpc", "Momentum at inner wall of TPC; p_{TPC}; Entries"},
274277
{kItsCluster, o2::framework::kTH1F, "hItsCluster", "ITS cluster; ITS cluster; Entries"},
@@ -353,7 +356,8 @@ constexpr std::array<histmanager::HistInfo<TrackHist>, kTrackHistLast>
353356
{kPt, {conf.pt}}, \
354357
{kEta, {conf.eta}}, \
355358
{kPhi, {conf.phi}}, \
356-
{kSign, {conf.sign}},
359+
{kSign, {conf.sign}}, \
360+
{kMass, {conf.mass}},
357361

358362
#define TRACK_HIST_QA_MAP(confAnalysis, confQa) \
359363
{kPAtPv, {confQa.p}}, \
@@ -637,6 +641,7 @@ class TrackHistManager
637641
mHistogramRegistry->add(analysisDir + getHistNameV2(kEta, HistTable), getHistDesc(kEta, HistTable), getHistType(kEta, HistTable), {Specs.at(kEta)});
638642
mHistogramRegistry->add(analysisDir + getHistNameV2(kPhi, HistTable), getHistDesc(kPhi, HistTable), getHistType(kPhi, HistTable), {Specs.at(kPhi)});
639643
mHistogramRegistry->add(analysisDir + getHistNameV2(kSign, HistTable), getHistDesc(kSign, HistTable), getHistType(kSign, HistTable), {Specs.at(kSign)});
644+
mHistogramRegistry->add(analysisDir + getHistNameV2(kMass, HistTable), getHistDesc(kMass, HistTable), getHistType(kMass, HistTable), {Specs.at(kMass)});
640645
}
641646

642647
void initQa(std::map<TrackHist, std::vector<o2::framework::AxisSpec>> const& Specs)
@@ -784,6 +789,11 @@ class TrackHistManager
784789
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kEta, HistTable)), track.eta());
785790
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kPhi, HistTable)), track.phi());
786791
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), track.sign());
792+
if constexpr (utils::HasMass<T>) {
793+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), track.mass());
794+
} else {
795+
mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), utils::getMass(mPdgCode));
796+
}
787797
}
788798

789799
template <typename T>

PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ struct FemtoPairTrackTrack {
5454

5555
using FemtoTracks = o2::soa::Join<o2::aod::FTracks, o2::aod::FTrackMasks>;
5656

57-
using FemtoTracksWithLabel = o2::soa::Join<FemtoTracks, o2::aod::FTrackLabels>;
57+
// for analysis which require particles at high pt, add tof mass so sidebands can be used
58+
using FemtoTracksWithMass = o2::soa::Join<FemtoTracks, o2::aod::FTrackMass>;
59+
60+
using FemtoTracksWithLabel = o2::soa::Join<FemtoTracksWithMass, o2::aod::FTrackLabels>;
5861

5962
o2::framework::SliceCache cache;
6063

@@ -76,8 +79,12 @@ struct FemtoPairTrackTrack {
7679
o2::framework::Partition<FemtoTracks> trackPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2);
7780
o2::framework::Preslice<FemtoTracks> perColtracks = o2::aod::femtobase::stored::fColId;
7881

79-
o2::framework::Partition<FemtoTracksWithLabel> trackWithLabelPartition1 = MAKE_TRACK_PARTITION(confTrackSelections1);
80-
o2::framework::Partition<FemtoTracksWithLabel> trackWithLabelPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2);
82+
o2::framework::Partition<FemtoTracksWithMass> trackWithMassPartition1 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections1);
83+
o2::framework::Partition<FemtoTracksWithMass> trackWithMassPartition2 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections2);
84+
o2::framework::Preslice<FemtoTracksWithMass> perColtracksWithMass = o2::aod::femtobase::stored::fColId;
85+
86+
o2::framework::Partition<FemtoTracksWithLabel> trackWithLabelPartition1 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections1);
87+
o2::framework::Partition<FemtoTracksWithLabel> trackWithLabelPartition2 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections2);
8188
o2::framework::Preslice<FemtoTracksWithLabel> perColtracksWithLabel = o2::aod::femtobase::stored::fColId;
8289

8390
// setup pairs
@@ -108,10 +115,10 @@ struct FemtoPairTrackTrack {
108115

109116
void init(o2::framework::InitContext&)
110117
{
111-
if ((doprocessSameEvent + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventMc) > 1) {
118+
if ((doprocessSameEvent + doprocessSameEventWithMass + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventWithMass + doprocessMixedEventMc) > 1) {
112119
LOG(fatal) << "More than 1 same or mixed event process function is activated. Breaking...";
113120
}
114-
bool processData = doprocessSameEvent || doprocessMixedEvent;
121+
bool processData = doprocessSameEvent || doprocessMixedEvent || doprocessSameEventWithMass || doprocessMixedEventWithMass;
115122
bool processMc = doprocessSameEventMc || doprocessMixedEventMc;
116123
if (processData && processMc) {
117124
LOG(fatal) << "Both data and mc processing is activated. Breaking...";
@@ -152,6 +159,12 @@ struct FemtoPairTrackTrack {
152159
}
153160
PROCESS_SWITCH(FemtoPairTrackTrack, processSameEvent, "Enable processing same event processing", true);
154161

162+
void processSameEventWithMass(FilteredFemtoCollision const& col, FemtoTracksWithMass const& tracks)
163+
{
164+
pairTrackTrackBuilder.processSameEvent<modes::Mode::kAnalysis>(col, tracks, trackWithMassPartition1, trackWithMassPartition2, cache);
165+
}
166+
PROCESS_SWITCH(FemtoPairTrackTrack, processSameEventWithMass, "Enable processing same event processing (with track masses)", false);
167+
155168
void processSameEventMc(FilteredFemtoCollisionWithLabel const& col, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, o2::aod::FMcParticles const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers)
156169
{
157170
pairTrackTrackBuilder.processSameEvent<modes::Mode::kAnalysis_Mc>(col, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, mcParticles, mcMothers, mcPartonicMothers, cache);
@@ -164,6 +177,12 @@ struct FemtoPairTrackTrack {
164177
}
165178
PROCESS_SWITCH(FemtoPairTrackTrack, processMixedEvent, "Enable processing mixed event processing", true);
166179

180+
void processMixedEventWithMass(FilteredFemtoCollisions const& cols, FemtoTracksWithMass const& tracks)
181+
{
182+
pairTrackTrackBuilder.processMixedEvent<modes::Mode::kAnalysis>(cols, tracks, trackWithMassPartition1, trackWithMassPartition2, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent);
183+
}
184+
PROCESS_SWITCH(FemtoPairTrackTrack, processMixedEventWithMass, "Enable processing mixed event processing (with track masses)", false);
185+
167186
void processMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, o2::aod::FMcParticles const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers)
168187
{
169188
pairTrackTrackBuilder.processMixedEvent<modes::Mode::kAnalysis_Mc>(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, mcParticles, mcMothers, mcPartonicMothers, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent);

0 commit comments

Comments
 (0)