Skip to content

Commit ab71ca1

Browse files
committed
Fix missing preslice for event mixing
1 parent bd9b294 commit ab71ca1

File tree

3 files changed

+25
-24
lines changed

3 files changed

+25
-24
lines changed

PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,11 @@ DECLARE_SOA_TABLE(HfcRedTrigs, "AOD", "HFCREDTRIG", //! Table with charm hadron
102102
aod::hf_correlation_trigger_reduced::PtTrig);
103103

104104
DECLARE_SOA_TABLE(HfcRedTrigCharms, "AOD", "HFCREDTRIGCHARM", //! Table with Same Event Charm-Hadron pairs information
105-
aod::hf_correlation_trigger_reduced::HfcRedCorrCollId,
106105
aod::hf_correlation_trigger_reduced::InvMassTrig,
107106
aod::hf_correlation_trigger_reduced::BdtScore0Trig,
108107
aod::hf_correlation_trigger_reduced::BdtScore1Trig);
109108

110109
DECLARE_SOA_TABLE(HfcRedTrigHads, "AOD", "HFCREDTRIGHAD", //! Table with Same Event Charm-Hadron pairs information
111-
aod::hf_correlation_trigger_reduced::HfcRedCorrCollId,
112110
aod::hf_correlation_trigger_reduced::NTpcCrossedRowsTrig,
113111
aod::hf_correlation_trigger_reduced::ItsClusterMapTrig,
114112
aod::hf_correlation_trigger_reduced::ItsNClsTrig,
@@ -117,7 +115,6 @@ DECLARE_SOA_TABLE(HfcRedTrigHads, "AOD", "HFCREDTRIGHAD", //! Table with Same Ev
117115

118116
namespace hf_assoc_track_reduced
119117
{
120-
DECLARE_SOA_INDEX_COLUMN(HfcRedCorrColl, hfcRedCorrColl); //! ReducedCollision index
121118
DECLARE_SOA_COLUMN(OriginTrackId, originTrackId, int); //! Original track index
122119
DECLARE_SOA_COLUMN(NTpcCrossedRows, nTpcCrossedRows, int); //! Number of crossed TPC Rows
123120
DECLARE_SOA_COLUMN(ItsClusterMap, itsClusterMap, int); //! ITS cluster map, one bit per a layer, starting from the innermost
@@ -143,17 +140,16 @@ DECLARE_SOA_TABLE(AssocTrackSels, "AOD", "ASSOCTRACKSEL", //! Table with associa
143140
aod::hf_assoc_track_reduced::ItsClusterMap,
144141
aod::hf_assoc_track_reduced::ItsNCls,
145142
aod::hf_assoc_track_reduced::DcaXY,
146-
aod::hf_assoc_track_reduced::DcaZ)
143+
aod::hf_assoc_track_reduced::DcaZ);
147144

148145
DECLARE_SOA_TABLE(HfcRedTrkAssocs, "AOD", "HFCREDTRKASSOC", //! Table with associated track info
149146
soa::Index<>,
150147
aod::hf_correlation_trigger_reduced::HfcRedCorrCollId,
151148
aod::hf_assoc_track_reduced::PhiAssocTrack,
152149
aod::hf_assoc_track_reduced::EtaAssocTrack,
153-
aod::hf_assoc_track_reduced::PtAssocTrack)
150+
aod::hf_assoc_track_reduced::PtAssocTrack);
154151

155152
DECLARE_SOA_TABLE(HfcRedTrkSels, "AOD", "HFCREDSETRKSEL", //! Table with Same Event Track Selections information
156-
aod::hf_correlation_trigger_reduced::HfcRedCorrCollId,
157153
aod::hf_assoc_track_reduced::NTpcCrossedRows,
158154
aod::hf_assoc_track_reduced::ItsClusterMap,
159155
aod::hf_assoc_track_reduced::ItsNCls,
@@ -163,14 +159,13 @@ DECLARE_SOA_TABLE(HfcRedTrkSels, "AOD", "HFCREDSETRKSEL", //! Table with Same Ev
163159
// definition of columns and tables for Charm-Hadron and Hadron-Hadron correlation pairs
164160
namespace hf_correlation_charm_hadron_reduced
165161
{
166-
DECLARE_SOA_INDEX_COLUMN(HfcRedCorrColl, hfcRedCorrColl); //! ReducedCollision index
167162
DECLARE_SOA_COLUMN(DeltaPhi, deltaPhi, float); //! DeltaPhi between charm hadron and Hadrons
168163
DECLARE_SOA_COLUMN(DeltaEta, deltaEta, float); //! DeltaEta between charm hadron and Hadrons
169164
DECLARE_SOA_COLUMN(PoolBin, poolBin, int); //! Pool Bin for the MixedEvent
170165
} // namespace hf_correlation_charm_hadron_reduced
171166

172167
DECLARE_SOA_TABLE(HfcRedSEPairs, "AOD", "HFCREDSEPAIR", //! Table with Same Event Trig-Assoc pairs
173-
aod::hf_correlation_charm_hadron_reduced::HfcRedCorrCollId,
168+
aod::hf_correlation_trigger_reduced::HfcRedCorrCollId,
174169
aod::hf_correlation_trigger_reduced::PtTrig,
175170
aod::hf_assoc_track_reduced::PtAssocTrack,
176171
aod::hf_correlation_charm_hadron_reduced::DeltaEta,

PWGHF/HFC/TableProducer/correlatorFlowCharmHadronsReduced.cxx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,18 @@ struct HfCorrelatorFlowCharmHadronsReduced {
108108

109109
SliceCache cache;
110110

111-
using AssocTracks = aod::HfcRedTrkAssocs;
112-
// using AssocTracks = soa::Filtered<soa::Join<aod::HfcRedTrkAssocs, aod::HfcRedTrkSels>>;
111+
using AssocTracks = soa::Filtered<soa::Join<aod::HfcRedTrkAssocs, aod::HfcRedTrkSels>>;
113112
using SameEvtPairsChHad = soa::Filtered<soa::Join<aod::HfcRedSEPairs, aod::HfcRedTrigCharms, aod::HfcRedTrkSels>>;
114113
using SameEvtPairsHadHad = soa::Filtered<soa::Join<aod::HfcRedSEPairs, aod::HfcRedTrigHads, aod::HfcRedTrkSels>>;
114+
using TrigCands = soa::Join<aod::HfcRedTrigs, aod::HfcRedTrigCharms>;
115115

116116
Filter filterTrackData = (nabs(aod::hf_assoc_track_reduced::dcaXY) < dcaXYTrackMax) && (nabs(aod::hf_assoc_track_reduced::dcaZ) < dcaZTrackMax) && (aod::hf_assoc_track_reduced::nTpcCrossedRows > tpcCrossedRowsMin) && (aod::hf_assoc_track_reduced::itsNCls > itsNClsMin);
117117
Filter filterSameEvtPairsChHad = (nabs(aod::hf_assoc_track_reduced::dcaXY) < dcaXYTrackMax) && (nabs(aod::hf_assoc_track_reduced::dcaZ) < dcaZTrackMax) && (aod::hf_assoc_track_reduced::nTpcCrossedRows > tpcCrossedRowsMin) && (aod::hf_assoc_track_reduced::itsNCls > itsNClsMin);
118118
Filter filterSameEvtPairsHadHad = (nabs(aod::hf_assoc_track_reduced::dcaXY) < dcaXYTrackMax) && (nabs(aod::hf_assoc_track_reduced::dcaZ) < dcaZTrackMax) && (aod::hf_assoc_track_reduced::nTpcCrossedRows > tpcCrossedRowsMin) && (aod::hf_assoc_track_reduced::itsNCls > itsNClsMin);
119119

120+
Preslice<AssocTracks> tracksPerCol = aod::hf_correlation_trigger_reduced::hfcRedCorrCollId;
121+
Preslice<TrigCands> candPerCol = aod::hf_correlation_trigger_reduced::hfcRedCorrCollId;
122+
120123
ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0, -2.5, 2.5, 10.0}, "Z vertex position pools"};
121124
ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0., 900., 1800., 6000.}, "Event multiplicity pools (FT0M)"};
122125
ConfigurableAxis centPoolBins{"centPoolBins", {VARIABLE_WIDTH, 0., 10., 20., 30.}, "Event centrality pools"};
@@ -224,12 +227,10 @@ struct HfCorrelatorFlowCharmHadronsReduced {
224227
void fillSameEvent(TPair const& pair,
225228
TBinningType binPolicy)
226229
{
227-
// auto collision = pair.template hfcRedCorrColl_as<o2::aod::HfcRedCorrColls>();
228-
int poolBin = -1;
229-
// int poolBin = getPoolBin<true>(collision, binPolicy);
230+
auto collision = pair.template hfcRedCorrColl_as<o2::aod::HfcRedCorrColls>();
231+
int poolBin = getPoolBin<true>(collision, binPolicy);
230232
registry.fill(HIST("hCollisionPoolBin"), poolBin);
231-
registry.fill(HIST("hZVtx"), -1, poolBin);
232-
// registry.fill(HIST("hZVtx"), collision.posZ(), poolBin);
233+
registry.fill(HIST("hZVtx"), collision.posZ(), poolBin);
233234
registry.fill(HIST("hPoolBinTrig"), poolBin);
234235
registry.fill(HIST("hPoolBinAssoc"), poolBin);
235236
if constexpr (fillTables) {
@@ -290,9 +291,9 @@ struct HfCorrelatorFlowCharmHadronsReduced {
290291
entryCorrPair(poolBinTrig, ptTrig, ptAssoc, deltaEta, deltaPhi);
291292
}
292293
if constexpr (fillSparses) {
293-
if constexpr (requires{ trigCand.bdtScore0(); }) { // Separate Charm-Had and Had-Had cases
294+
if constexpr (requires{ trigCand.bdtScore0Trig(); }) { // Separate Charm-Had and Had-Had cases
294295
registry.fill(HIST("hSparseCorrelationsMECharmHad"), poolBinTrig, ptTrig, ptAssoc, deltaEta,
295-
deltaPhi, trigCand.bdtScore0(), trigCand.bdtScore1(), trigCand.invMassCand());
296+
deltaPhi, trigCand.bdtScore0Trig(), trigCand.bdtScore1Trig(), trigCand.invMassTrig());
296297
} else {
297298
registry.fill(HIST("hSparseCorrelationsMEHadHad"), poolBinTrig, ptTrig, ptAssoc, deltaEta, deltaPhi);
298299
}
@@ -354,7 +355,7 @@ struct HfCorrelatorFlowCharmHadronsReduced {
354355
PROCESS_SWITCH(HfCorrelatorFlowCharmHadronsReduced, processSameEventHadHadWCentMix, "Process Same Event for Had-Had with centrality pools", false);
355356

356357
void processMixedEventCharmHadWCentMix(aod::HfcRedCorrColls const& collisions,
357-
soa::Join<aod::HfcRedTrigs, aod::HfcRedTrigCharms> const& candidates,
358+
TrigCands const& candidates,
358359
AssocTracks const& tracks)
359360
{
360361
if (fillSparses && fillTables) {
@@ -368,7 +369,7 @@ struct HfCorrelatorFlowCharmHadronsReduced {
368369
PROCESS_SWITCH(HfCorrelatorFlowCharmHadronsReduced, processMixedEventCharmHadWCentMix, "Process Mixed Event for Charm-Had with centrality pools", false);
369370

370371
void processMixedEventCharmHadWMultMix(aod::HfcRedCorrColls const& collisions,
371-
soa::Join<aod::HfcRedTrigs, aod::HfcRedTrigCharms> const& candidates,
372+
TrigCands const& candidates,
372373
AssocTracks const& tracks)
373374
{
374375
if (fillSparses && fillTables) {

PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,17 +316,19 @@ struct HfDerivedDataCreatorCorrelationsReduced {
316316
double deltaEta = assTrk.eta() - trigCand.eta();
317317
double deltaPhi = RecoDecay::constrainAngle(assTrk.phi() - trigCand.phi(), -o2::constants::math::PIHalf);
318318
rowSEPairs(rowCollisions.lastIndex(), trigCand.pt(), assTrkPt, deltaEta, deltaPhi);
319-
rowAssocTrkSels(rowCollisions.lastIndex(), assTrk.tpcNClsCrossedRows(), assTrk.itsClusterMap(), assTrk.itsNCls(), assTrk.dcaXY(), assTrk.dcaZ());
319+
rowAssocTrkSels(assTrk.tpcNClsCrossedRows(), assTrk.itsClusterMap(), assTrk.itsNCls(), assTrk.dcaXY(), assTrk.dcaZ());
320320
if constexpr (candType == CandType::Hadron) {
321-
rowTrigHads(rowCollisions.lastIndex(), trigCand.tpcNClsCrossedRows(), trigCand.itsClusterMap(), trigCand.itsNCls(), trigCand.dcaXY(), trigCand.dcaZ());
321+
rowTrigHads(trigCand.tpcNClsCrossedRows(), trigCand.itsClusterMap(), trigCand.itsNCls(), trigCand.dcaXY(), trigCand.dcaZ());
322322
} else {
323323
std::array<float, 2> outputMl = getCandMlScores<candType>(trigCand);
324-
rowTrigCharms(rowCollisions.lastIndex(), getCandMass<candType>(trigCand), outputMl[0], outputMl[1]);
324+
rowTrigCharms(getCandMass<candType>(trigCand), outputMl[0], outputMl[1]);
325325
}
326326
}
327327
}
328328
}
329329

330+
/// Fill charm hadron tables for mixed-event
331+
/// \param trigCands are the charm trigger candidates
330332
template <CandType candType, typename TTrigCands>
331333
void fillCharmMixedEvent(TTrigCands const& trigCands)
332334
{
@@ -336,10 +338,13 @@ struct HfDerivedDataCreatorCorrelationsReduced {
336338

337339
std::array<float, 2> outputMl = getCandMlScores<candType>(trigCand);
338340
rowTrigs(rowCollisions.lastIndex(), trigCand.phi(), trigCand.eta(), trigCand.pt());
339-
rowTrigCharms(rowCollisions.lastIndex(), getCandMass<candType>(trigCand), outputMl[0], outputMl[1]);
341+
rowTrigCharms(getCandMass<candType>(trigCand), outputMl[0], outputMl[1]);
340342
}
341343
}
342344

345+
/// Fill track tables for mixed-event
346+
/// \param assTrks are the associated tracks
347+
/// \param collCentrality is the collision centrality
343348
template <typename TAssocTrks>
344349
void fillTrkMixedEvent(TAssocTrks const& assTrks,
345350
const float collCentrality)
@@ -360,7 +365,7 @@ struct HfDerivedDataCreatorCorrelationsReduced {
360365
registry.fill(HIST("hPhiVsPtAssoc"), RecoDecay::constrainAngle(assTrk.phi(), -o2::constants::math::PIHalf), assTrkPt);
361366
registry.fill(HIST("hEtaVsPtAssoc"), assTrk.eta(), assTrkPt);
362367
rowAssocTrks(rowCollisions.lastIndex(), assTrk.phi(), assTrk.eta(), assTrkPt);
363-
rowAssocTrkSels(rowCollisions.lastIndex(), assTrk.tpcNClsCrossedRows(), assTrk.itsClusterMap(), assTrk.itsNCls(), assTrk.dcaXY(), assTrk.dcaZ());
368+
rowAssocTrkSels(assTrk.tpcNClsCrossedRows(), assTrk.itsClusterMap(), assTrk.itsNCls(), assTrk.dcaXY(), assTrk.dcaZ());
364369
}
365370
}
366371

0 commit comments

Comments
 (0)