Skip to content

Commit 7d40bc8

Browse files
[PWGHF,PWGCF] Split same-event table and add the collision infos into lcp femto task (#11191)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent fc54a67 commit 7d40bc8

File tree

3 files changed

+86
-124
lines changed

3 files changed

+86
-124
lines changed

PWGCF/DataModel/FemtoDerived.h

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ enum CharmHadronMassHypo {
210210
lcToPKPi = 1,
211211
lcToPiKP = 2
212212
};
213-
213+
DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collision
214+
DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the collision
215+
DECLARE_SOA_COLUMN(VertexZ, vertexZ, float); //! VertexZ for the collision
214216
DECLARE_SOA_COLUMN(TrackId, trackId, int); //! track id to match associate particle with charm hadron prongs
215217
DECLARE_SOA_COLUMN(Charge, charge, int8_t); //! Charge of charm hadron
216218
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Track id of charm hadron prong0
@@ -233,12 +235,16 @@ DECLARE_SOA_COLUMN(FlagMc, flagMc, int8_t); //! To selec
233235
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! flag for reconstruction level matching (1 for prompt, 2 for non-prompt)
234236
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! flag for generator level matching (1 for prompt, 2 for non-prompt)
235237
DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order (0 for Lc -> pkpi, 1 for Lc -> pikp)
236-
DECLARE_SOA_COLUMN(PtAssoc, ptAssoc, float); //! Transverse momentum of associate femto particle
238+
DECLARE_SOA_COLUMN(TrkPt, trkPt, float); //! Transverse momentum of associate femto particle
239+
DECLARE_SOA_COLUMN(TrkEta, trkEta, float); //! Eta of associate femto particle
240+
DECLARE_SOA_COLUMN(TrkPhi, trkPhi, float); //! Phi of associate femto particle
237241
DECLARE_SOA_COLUMN(Kstar, kstar, float); //! Relative momentum in particles pair frame
238242
DECLARE_SOA_COLUMN(KT, kT, float); //! kT distribution of particle pairs
239243
DECLARE_SOA_COLUMN(MT, mT, float); //! Transverse mass distribution
240244
DECLARE_SOA_COLUMN(CharmM, charmM, float); //! Charm hadron mass
241245
DECLARE_SOA_COLUMN(CharmPt, charmPt, float); //! Transverse momentum of charm hadron for result task
246+
DECLARE_SOA_COLUMN(CharmEta, charmEta, float); //! Eta of charm hadron for result task
247+
DECLARE_SOA_COLUMN(CharmPhi, charmPhi, float); //! Phi of charm hadron for result task
242248
DECLARE_SOA_COLUMN(Mult, mult, int); //! Charge particle multiplicity
243249
DECLARE_SOA_COLUMN(MultPercentile, multPercentile, float); //! Multiplicity precentile
244250
DECLARE_SOA_COLUMN(PairSign, pairSign, int8_t); //! Selection between like sign (1) and unlike sign pair (2)
@@ -281,6 +287,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta,
281287
DECLARE_SOA_TABLE(FDHfCand, "AOD", "FDHFCAND", //! Table to store the derived data for charm hadron candidates
282288
o2::soa::Index<>,
283289
femtodreamparticle::FDCollisionId,
290+
fdhf::TimeStamp,
284291
fdhf::Charge,
285292
fdhf::Prong0Id,
286293
fdhf::Prong1Id,
@@ -305,31 +312,39 @@ DECLARE_SOA_TABLE(FDHfCand, "AOD", "FDHFCAND", //! Table to store the derived da
305312
fdhf::Phi<fdhf::Prong0Pt, fdhf::Prong0Phi, fdhf::Prong0Eta, fdhf::Prong1Pt, fdhf::Prong1Phi, fdhf::Prong1Eta, fdhf::Prong2Pt, fdhf::Prong2Phi, fdhf::Prong2Eta>,
306313
fdhf::Pt<fdhf::Prong0Pt, fdhf::Prong0Phi, fdhf::Prong0Eta, fdhf::Prong1Pt, fdhf::Prong1Phi, fdhf::Prong1Eta, fdhf::Prong2Pt, fdhf::Prong2Phi, fdhf::Prong2Eta>);
307314

308-
DECLARE_SOA_TABLE(FDResultsHF, "AOD", "FDRESULTSHF", //! table to store results for HF femtoscopy
315+
DECLARE_SOA_TABLE(FDHfCharm, "AOD", "FDHFCHARM", //! table to store results for HF femtoscopy
316+
fdhf::GIndexCol,
317+
fdhf::TimeStamp,
309318
fdhf::CharmM,
310319
fdhf::CharmPt,
311-
fdhf::PtAssoc,
320+
fdhf::CharmEta,
321+
fdhf::CharmPhi,
322+
fdhf::Charge,
312323
fdhf::BDTBkg,
313324
fdhf::BDTPrompt,
314325
fdhf::BDTFD,
315-
fdhf::Kstar,
316-
fdhf::KT,
317-
fdhf::MT,
318-
fdhf::Mult,
319-
fdhf::MultPercentile,
320-
fdhf::Charge,
321-
fdhf::PairSign,
322-
fdhf::ProcessType,
323326
fdhf::FlagMc,
324327
fdhf::OriginMcRec);
325328

326-
DECLARE_SOA_TABLE(FDResultsHFTrkInfo, "AOD", "FDRESULTSHFTRKINFO", //! table to store results for HF femtoscopy
329+
DECLARE_SOA_TABLE(FDHfTrk, "AOD", "FDHFTRK", //! table to store results for HF femtoscopy
330+
fdhf::GIndexCol,
331+
fdhf::TimeStamp,
332+
fdhf::TrkPt,
333+
fdhf::TrkEta,
334+
fdhf::TrkPhi,
335+
femtodreamparticle::Sign,
327336
femtodreamparticle::TPCNClsFound,
328337
track::TPCNClsFindable,
329338
femtodreamparticle::TPCNClsCrossedRows,
330339
femtodreamparticle::TPCNSigmaPr,
331340
femtodreamparticle::TOFNSigmaPr);
332341

342+
DECLARE_SOA_TABLE(FDHfColl, "AOD", "FDHFCOLL", //! table to store results for HF femtoscopy
343+
fdhf::GIndexCol,
344+
fdhf::TimeStamp,
345+
fdhf::VertexZ,
346+
fdhf::Mult);
347+
333348
DECLARE_SOA_TABLE(FDHfCandMC, "AOD", "FDHFCANDMC", //! Table for reconstructed MC charm hadron candidates
334349
o2::soa::Index<>,
335350
fdhf::FlagMc,

PWGHF/HFC/TableProducer/femtoDreamProducer.cxx

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -475,37 +475,41 @@ struct HfFemtoDreamProducer {
475475
LOGF(fatal, "Please check your Ml configuration!!");
476476
}
477477
}
478+
auto bc = col.template bc_as<aod::BCsWithTimestamps>();
479+
int64_t timeStamp = bc.timestamp();
478480
auto fillTable = [&](int CandFlag,
479481
int FunctionSelection,
480482
float BDTScoreBkg,
481483
float BDTScorePrompt,
482484
float BDTScoreFD) {
483485
if (FunctionSelection >= 1){
484-
rowCandCharmHad(
485-
outputCollision.lastIndex(),
486-
trackPos1.sign() + trackNeg.sign() + trackPos2.sign(),
487-
trackPos1.globalIndex(),
488-
trackNeg.globalIndex(),
489-
trackPos2.globalIndex(),
490-
trackPos1.pt(),
491-
trackNeg.pt(),
492-
trackPos2.pt(),
493-
trackPos1.eta(),
494-
trackNeg.eta(),
495-
trackPos2.eta(),
496-
trackPos1.phi(),
497-
trackNeg.phi(),
498-
trackPos2.phi(),
499-
1 << CandFlag,
500-
BDTScoreBkg,
501-
BDTScorePrompt,
502-
BDTScoreFD);
503-
504-
// Row for MC candidate charm hadron (if constexpr isMc)
505-
if constexpr (isMc) {
506-
rowCandMcCharmHad(
507-
candidate.flagMcMatchRec(),
508-
candidate.originMcRec());}
486+
rowCandCharmHad(
487+
outputCollision.lastIndex(),
488+
timeStamp,
489+
trackPos1.sign() + trackNeg.sign() + trackPos2.sign(),
490+
trackPos1.globalIndex(),
491+
trackNeg.globalIndex(),
492+
trackPos2.globalIndex(),
493+
trackPos1.pt(),
494+
trackNeg.pt(),
495+
trackPos2.pt(),
496+
trackPos1.eta(),
497+
trackNeg.eta(),
498+
trackPos2.eta(),
499+
trackPos1.phi(),
500+
trackNeg.phi(),
501+
trackPos2.phi(),
502+
1 << CandFlag,
503+
BDTScoreBkg,
504+
BDTScorePrompt,
505+
BDTScoreFD);
506+
507+
// Row for MC candidate charm hadron (if constexpr isMc)
508+
if constexpr (isMc) {
509+
rowCandMcCharmHad(
510+
candidate.flagMcMatchRec(),
511+
candidate.originMcRec());
512+
}
509513
} };
510514

511515
fillTable(0, candidate.isSelLcToPKPi(), outputMlPKPi.at(0), outputMlPKPi.at(1), outputMlPKPi.at(2));

PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx

Lines changed: 29 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ struct HfTaskCharmHadronsFemtoDream {
4747
NegativeCharge = -1
4848
};
4949

50-
enum PairSign {
51-
PairNotDefined = 0,
52-
LikeSignPair = 1,
53-
UnLikeSignPair = 2
54-
};
55-
5650
/// Binning configurables
5751
ConfigurableAxis bin4Dkstar{"bin4Dkstar", {1500, 0., 6.}, "binning kstar for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <<Confuse4D>> to true in order to use)"};
5852
ConfigurableAxis bin4DMult{"bin4Dmult", {VARIABLE_WIDTH, 0.0f, 4.0f, 8.0f, 12.0f, 16.0f, 20.0f, 24.0f, 28.0f, 32.0f, 36.0f, 40.0f, 44.0f, 48.0f, 52.0f, 56.0f, 60.0f, 64.0f, 68.0f, 72.0f, 76.0f, 80.0f, 84.0f, 88.0f, 92.0f, 96.0f, 100.0f, 200.0f}, "multiplicity Binning for the 4Dimensional plot: k* vs multiplicity vs multiplicity percentile vs mT (set <<Confuse4D>> to true in order to use)"};
@@ -195,8 +189,9 @@ struct HfTaskCharmHadronsFemtoDream {
195189

196190
SliceCache cache;
197191
Preslice<aod::FDParticles> perCol = aod::femtodreamparticle::fdCollisionId;
198-
Produces<o2::aod::FDResultsHF> fillFemtoResult;
199-
Produces<o2::aod::FDResultsHFTrkInfo> fillFemtoResultTrkInfo;
192+
Produces<o2::aod::FDHfCharm> rowFemtoResultCharm;
193+
Produces<o2::aod::FDHfTrk> rowFemtoResultTrk;
194+
Produces<o2::aod::FDHfColl> rowFemtoResultColl;
200195

201196
void init(InitContext& /*context*/)
202197
{
@@ -243,25 +238,12 @@ struct HfTaskCharmHadronsFemtoDream {
243238
registryMixQa.fill(HIST("MixingQA/hSECollisionPool"), col.posZ(), col.multNtr());
244239
}
245240

246-
template <typename Part1>
247-
void fillTableTrkInfo(Part1 const& p1)
248-
{
249-
fillFemtoResultTrkInfo(
250-
p1.tpcNClsFound(),
251-
p1.tpcNClsFindable(),
252-
p1.tpcNClsCrossedRows(),
253-
p1.tpcNSigmaPr(),
254-
p1.tofNSigmaPr());
255-
}
256-
257241
/// This function processes the same event and takes care of all the histogramming
258242
template <bool isMc, typename PartitionType, typename CandType, typename TableTracks, typename Collision>
259243
void doSameEvent(PartitionType& sliceTrk1, CandType& sliceCharmHad, TableTracks const& parts, Collision const& col)
260244
{
261245
fillCollision(col);
262246

263-
processType = 1; // for same event
264-
265247
for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceTrk1, sliceCharmHad))) {
266248

267249
if (p1.trackId() == p2.prong0Id() || p1.trackId() == p2.prong1Id() || p1.trackId() == p2.prong2Id())
@@ -285,24 +267,11 @@ struct HfTaskCharmHadronsFemtoDream {
285267
chargeTrack = NegativeCharge;
286268
}
287269

288-
int pairSign = 0;
289-
if (chargeTrack == p2.charge()) {
290-
pairSign = LikeSignPair;
291-
} else {
292-
pairSign = UnLikeSignPair;
293-
}
294-
295270
float kstar = FemtoDreamMath::getkstar(p1, massOne, p2, massTwo);
296271
if (kstar > highkstarCut) {
297272
continue;
298273
}
299274

300-
// if (chargeTrack == 1) {
301-
// partSign = 1;
302-
// } else {
303-
// partSign = 1 << 1;
304-
// }
305-
306275
float invMass;
307276
if (p2.candidateSelFlag() == 1) {
308277
invMass = p2.m(std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus});
@@ -326,24 +295,39 @@ struct HfTaskCharmHadronsFemtoDream {
326295
charmHadMc = p2.flagMc();
327296
originType = p2.originMcRec();
328297
}
329-
fillFemtoResult(
298+
299+
rowFemtoResultCharm(
300+
col.globalIndex(),
301+
p2.timeStamp(),
330302
invMass,
331303
p2.pt(),
332-
p1.pt(),
304+
p2.eta(),
305+
p2.phi(),
306+
p2.charge(),
333307
p2.bdtBkg(),
334308
p2.bdtPrompt(),
335309
p2.bdtFD(),
336-
kstar,
337-
FemtoDreamMath::getkT(p1, massOne, p2, massTwo),
338-
FemtoDreamMath::getmT(p1, massOne, p2, massTwo),
339-
col.multNtr(),
340-
col.multV0M(),
341-
p2.charge(),
342-
pairSign,
343-
processType,
344310
charmHadMc,
345311
originType);
346-
fillTableTrkInfo(p1);
312+
313+
rowFemtoResultTrk(
314+
col.globalIndex(),
315+
p2.timeStamp(),
316+
p1.pt(),
317+
p1.eta(),
318+
p1.phi(),
319+
chargeTrack,
320+
p1.tpcNClsFound(),
321+
p1.tpcNClsFindable(),
322+
p1.tpcNClsCrossedRows(),
323+
p1.tpcNSigmaPr(),
324+
p1.tofNSigmaPr());
325+
326+
rowFemtoResultColl(
327+
col.globalIndex(),
328+
p2.timeStamp(),
329+
col.posZ(),
330+
col.multNtr());
347331

348332
sameEventCont.setPair<isMc, true>(p1, p2, col.multNtr(), col.multV0M(), use4D, extendedPlots, smearingByOrigin);
349333
}
@@ -354,8 +338,6 @@ struct HfTaskCharmHadronsFemtoDream {
354338
{
355339

356340
// Mixed events that contain the pair of interest
357-
processType = 2; // for mixed event
358-
359341
Partition<CollisionType> PartitionMaskedCol1 = (aod::femtodreamcollision::bitmaskTrackOne & BitMask) == BitMask;
360342
PartitionMaskedCol1.bindTable(cols);
361343

@@ -384,20 +366,6 @@ struct HfTaskCharmHadronsFemtoDream {
384366
continue;
385367
}
386368

387-
float chargeTrack = 0.;
388-
if ((p1.cut() & 2) == 2) {
389-
chargeTrack = PositiveCharge;
390-
} else {
391-
chargeTrack = NegativeCharge;
392-
}
393-
394-
int pairSign = 0;
395-
if (chargeTrack == p2.charge()) {
396-
pairSign = LikeSignPair;
397-
} else {
398-
pairSign = UnLikeSignPair;
399-
}
400-
401369
float kstar = FemtoDreamMath::getkstar(p1, massOne, p2, massTwo);
402370
if (kstar > highkstarCut) {
403371
continue;
@@ -417,31 +385,6 @@ struct HfTaskCharmHadronsFemtoDream {
417385
continue;
418386
}
419387

420-
int charmHadMc = 0;
421-
int originType = 0;
422-
if constexpr (isMc) {
423-
charmHadMc = p2.flagMc();
424-
originType = p2.originMcRec();
425-
}
426-
fillFemtoResult(
427-
invMass,
428-
p2.pt(),
429-
p1.pt(),
430-
p2.bdtBkg(),
431-
p2.bdtPrompt(),
432-
p2.bdtFD(),
433-
kstar,
434-
FemtoDreamMath::getkT(p1, massOne, p2, massTwo),
435-
FemtoDreamMath::getmT(p1, massOne, p2, massTwo),
436-
collision1.multNtr(),
437-
collision1.multV0M(),
438-
p2.charge(),
439-
pairSign,
440-
processType,
441-
charmHadMc,
442-
originType);
443-
fillTableTrkInfo(p1);
444-
445388
// if constexpr (!isMc) mixedEventCont.setPair<isMc, true>(p1, p2, collision1.multNtr(), collision1.multV0M(), use4D, extendedPlots, smearingByOrigin);
446389
mixedEventCont.setPair<isMc, true>(p1, p2, collision1.multNtr(), collision1.multV0M(), use4D, extendedPlots, smearingByOrigin);
447390
}

0 commit comments

Comments
 (0)