Skip to content

Commit 604235e

Browse files
committed
Implement Stefano comments
1 parent 99339f0 commit 604235e

File tree

1 file changed

+10
-62
lines changed

1 file changed

+10
-62
lines changed

PWGHF/HFC/TableProducer/correlatorFlowCharmHadrons.cxx

Lines changed: 10 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -85,33 +85,27 @@ struct HfCorrelatorFlowCharmHadrons {
8585

8686
using CollsWithCentMult = soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::FV0Mults, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As>;
8787
using CandDsDataWMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi, aod::HfMlDsToKKPi>>;
88-
using CandDsData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi>>;
8988
using CandDplusDataWMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfMlDplusToPiKPi>>;
90-
using CandDplusData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi>>;
9189
using TracksData = soa::Filtered<soa::Join<aod::TracksWDca, aod::TrackSelection, aod::TracksExtra>>;
9290

9391
Filter filterSelectDsCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlag || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlag;
9492
Filter filterSelectDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlag;
9593
Filter filterSelectTrackData = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax);
9694

97-
Preslice<CandDsData> candsDsPerColl = aod::hf_cand::collisionId;
9895
Preslice<CandDsDataWMl> candsDsPerCollWMl = aod::hf_cand::collisionId;
99-
Preslice<CandDplusData> candsDplusPerColl = aod::hf_cand::collisionId;
10096
Preslice<CandDplusDataWMl> candsDplusPerCollWMl = aod::hf_cand::collisionId;
10197
Preslice<TracksData> trackIndicesPerColl = aod::track::collisionId;
10298

103-
Partition<CandDsData> selectedDsToKKPi = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlag;
104-
Partition<CandDsData> selectedDsToPiKK = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlag;
10599
Partition<CandDsDataWMl> selectedDsToKKPiWMl = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlag;
106100
Partition<CandDsDataWMl> selectedDsToPiKKWMl = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlag;
107101

108102
HistogramRegistry registry{"registry", {}};
109103

110104
void init(InitContext&)
111105
{
112-
if (doprocessDplus || doprocessDplusWithMl) {
106+
if (doprocessDplusWithMl) {
113107
massCharm = o2::constants::physics::MassDPlus;
114-
} else if (doprocessDs || doprocessDsWithMl) {
108+
} else if (doprocessDsWithMl) {
115109
massCharm = o2::constants::physics::MassDS;
116110
}
117111

@@ -122,7 +116,7 @@ struct HfCorrelatorFlowCharmHadrons {
122116
}; // end init
123117

124118
/// Check event selections for collision and fill the collision table
125-
/// \param collision is the collision with the Q vector information and event plane
119+
/// \param collision is the collision
126120
template <typename Coll>
127121
bool checkAndFillCollision(Coll const& collision)
128122
{
@@ -196,7 +190,7 @@ struct HfCorrelatorFlowCharmHadrons {
196190

197191
/// Fill charm hadron tables
198192
/// \param candidates are the selected charm hadron candidates
199-
template <DecayChannel channel, bool applyMl, typename TCand>
193+
template <DecayChannel channel, typename TCand>
200194
void fillCharmHadronTables(TCand const& candidates)
201195
{
202196
int indexRedColl = rowCollisions.lastIndex();
@@ -207,10 +201,8 @@ struct HfCorrelatorFlowCharmHadrons {
207201
double massCand = getCandMass<channel>(candidate);
208202
rowCharmCandidates(indexRedColl, candidate.phi(), candidate.eta(), candidate.pt(), massCand, candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
209203

210-
if constexpr (applyMl) {
211-
std::vector<float> outputMl = getCandMlScores<channel>(candidate);
212-
rowCharmCandidatesMl(indexRedColl, outputMl[0], outputMl[1]);
213-
}
204+
std::vector<float> outputMl = getCandMlScores<channel>(candidate);
205+
rowCharmCandidatesMl(indexRedColl, outputMl[0], outputMl[1]);
214206
}
215207
}
216208

@@ -229,71 +221,27 @@ struct HfCorrelatorFlowCharmHadrons {
229221
}
230222
}
231223

232-
// Dplus with rectangular cuts
233-
void processDplus(CollsWithCentMult const& colls,
234-
CandDplusData const& candsDplus,
235-
TracksData const& tracks)
236-
{
237-
for (const auto& coll : colls) {
238-
auto thisCollId = coll.globalIndex();
239-
auto candsCThisColl = candsDplus.sliceBy(candsDplusPerColl, thisCollId);
240-
if (forceCharmInCollision && candsCThisColl.size() < 1) {
241-
continue;
242-
}
243-
if (!checkAndFillCollision(coll)) {
244-
continue;
245-
}
246-
auto trackIdsThisColl = tracks.sliceBy(trackIndicesPerColl, thisCollId);
247-
fillCharmHadronTables<DecayChannel::DplusToPiKPi, false>(candsCThisColl);
248-
fillTracksTables(trackIdsThisColl);
249-
}
250-
}
251-
PROCESS_SWITCH(HfCorrelatorFlowCharmHadrons, processDplus, "Process Dplus candidates", true);
252-
253224
// Dplus with ML selections
254225
void processDplusWithMl(CollsWithCentMult const& colls,
255226
CandDplusDataWMl const& candsDplus,
256227
TracksData const& tracks)
257228
{
258229
for (const auto& coll : colls) {
259230
auto thisCollId = coll.globalIndex();
260-
auto candsCThisColl = candsDplus.sliceBy(candsDplusPerColl, thisCollId);
231+
auto candsCThisColl = candsDplus.sliceBy(candsDplusPerCollWMl, thisCollId);
261232
if (forceCharmInCollision && candsCThisColl.size() < 1) {
262233
continue;
263234
}
264235
if (!checkAndFillCollision(coll)) {
265236
continue;
266237
}
267238
auto trackIdsThisColl = tracks.sliceBy(trackIndicesPerColl, thisCollId);
268-
fillCharmHadronTables<DecayChannel::DplusToPiKPi, true>(candsCThisColl);
239+
fillCharmHadronTables<DecayChannel::DplusToPiKPi>(candsCThisColl);
269240
fillTracksTables(trackIdsThisColl);
270241
}
271242
}
272243
PROCESS_SWITCH(HfCorrelatorFlowCharmHadrons, processDplusWithMl, "Process Dplus candidates with ML info", false);
273244

274-
// Ds with rectangular cuts
275-
void processDs(CollsWithCentMult const& colls,
276-
TracksData const& tracks,
277-
CandDsData const&)
278-
{
279-
for (const auto& coll : colls) {
280-
auto thisCollId = coll.globalIndex();
281-
auto candsDsToKKPi = selectedDsToKKPi->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache);
282-
auto candsDsToPiKK = selectedDsToPiKK->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache);
283-
if (forceCharmInCollision && candsDsToKKPi.size() < 1 && candsDsToPiKK.size() < 1) {
284-
continue;
285-
}
286-
if (!checkAndFillCollision(coll)) {
287-
continue;
288-
}
289-
auto trackIdsThisColl = tracks.sliceBy(trackIndicesPerColl, thisCollId);
290-
fillCharmHadronTables<DecayChannel::DsToPiKK, false>(candsDsToPiKK);
291-
fillCharmHadronTables<DecayChannel::DsToKKPi, false>(candsDsToKKPi);
292-
fillTracksTables(trackIdsThisColl);
293-
}
294-
}
295-
PROCESS_SWITCH(HfCorrelatorFlowCharmHadrons, processDs, "Process Ds candidates", false);
296-
297245
// Ds with ML selections
298246
void processDsWithMl(CollsWithCentMult const& colls,
299247
TracksData const& tracks,
@@ -310,8 +258,8 @@ struct HfCorrelatorFlowCharmHadrons {
310258
continue;
311259
}
312260
auto trackIdsThisColl = tracks.sliceBy(trackIndicesPerColl, thisCollId);
313-
fillCharmHadronTables<DecayChannel::DsToPiKK, true>(candsDsToPiKKWMl);
314-
fillCharmHadronTables<DecayChannel::DsToKKPi, true>(candsDsToKKPiWMl);
261+
fillCharmHadronTables<DecayChannel::DsToPiKK>(candsDsToPiKKWMl);
262+
fillCharmHadronTables<DecayChannel::DsToKKPi>(candsDsToKKPiWMl);
315263
fillTracksTables(trackIdsThisColl);
316264
}
317265
}

0 commit comments

Comments
 (0)