Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2b20afc
Update FemtoDerived.h
zhangbiao-phy May 14, 2025
7a1e24c
Update taskCharmHadronsFemtoDream.cxx
zhangbiao-phy May 14, 2025
1bae271
Update FemtoDerived.h
zhangbiao-phy May 14, 2025
16d45ef
Add timestamps into the table
zhangbiao-phy May 14, 2025
698c259
Update FemtoDerived.h
zhangbiao-phy May 14, 2025
d0fa944
Update femtoDreamProducer.cxx
zhangbiao-phy May 14, 2025
804185e
Update taskCharmHadronsFemtoDream.cxx
zhangbiao-phy May 14, 2025
5ed45f0
Please consider the following formatting changes
alibuild May 14, 2025
db0aae2
Merge pull request #35 from alibuild/alibot-cleanup-11191
zhangbiao-phy May 14, 2025
1e5509c
Please consider the following formatting changes
alibuild May 14, 2025
f6f85d5
Merge pull request #36 from alibuild/alibot-cleanup-11191
zhangbiao-phy May 15, 2025
099112e
Update taskCharmHadronsFemtoDream.cxx
zhangbiao-phy May 15, 2025
6a5caae
Update FemtoDerived.h
zhangbiao-phy May 15, 2025
bb6aa93
Please consider the following formatting changes
alibuild May 15, 2025
74ca25c
Merge pull request #37 from alibuild/alibot-cleanup-11191
zhangbiao-phy May 15, 2025
49a243c
remove useless code
zhangbiao-phy May 15, 2025
2d98b88
Update FemtoDerived.h
zhangbiao-phy May 15, 2025
b90b527
Please consider the following formatting changes
alibuild May 15, 2025
902f26d
Merge pull request #38 from alibuild/alibot-cleanup-11191
zhangbiao-phy May 15, 2025
f15abf0
remove useless code
zhangbiao-phy May 15, 2025
e046fe5
Update FemtoDerived.h
zhangbiao-phy May 15, 2025
bd9e762
Update taskCharmHadronsFemtoDream.cxx
zhangbiao-phy May 15, 2025
787aa76
fix name
zhangbiao-phy May 15, 2025
74fe8a3
remove useless code
zhangbiao-phy May 15, 2025
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
41 changes: 28 additions & 13 deletions PWGCF/DataModel/FemtoDerived.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ enum CharmHadronMassHypo {
lcToPKPi = 1,
lcToPiKP = 2
};

DECLARE_SOA_COLUMN(GIndexCol, gIndexCol, int); //! Global index for the collision

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a normal column and how do you plan to use it, specifically outside or inside O2Physics?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I use it outside for mixing events locally. I will merge the DF directly, so I also add timestamp

DECLARE_SOA_COLUMN(TimeStamp, timeStamp, int64_t); //! Timestamp for the collision
DECLARE_SOA_COLUMN(VertexZ, vertexZ, float); //! VertexZ for the collision
DECLARE_SOA_COLUMN(TrackId, trackId, int); //! track id to match associate particle with charm hadron prongs
DECLARE_SOA_COLUMN(Charge, charge, int8_t); //! Charge of charm hadron
DECLARE_SOA_COLUMN(Prong0Id, prong0Id, int); //! Track id of charm hadron prong0
Expand All @@ -233,12 +235,16 @@ DECLARE_SOA_COLUMN(FlagMc, flagMc, int8_t); //! To selec
DECLARE_SOA_COLUMN(OriginMcRec, originMcRec, int8_t); //! flag for reconstruction level matching (1 for prompt, 2 for non-prompt)
DECLARE_SOA_COLUMN(OriginMcGen, originMcGen, int8_t); //! flag for generator level matching (1 for prompt, 2 for non-prompt)
DECLARE_SOA_COLUMN(IsCandidateSwapped, isCandidateSwapped, int8_t); //! swapping of the prongs order (0 for Lc -> pkpi, 1 for Lc -> pikp)
DECLARE_SOA_COLUMN(PtAssoc, ptAssoc, float); //! Transverse momentum of associate femto particle
DECLARE_SOA_COLUMN(TrkPt, trkPt, float); //! Transverse momentum of associate femto particle
DECLARE_SOA_COLUMN(TrkEta, trkEta, float); //! Eta of associate femto particle
DECLARE_SOA_COLUMN(TrkPhi, trkPhi, float); //! Phi of associate femto particle
DECLARE_SOA_COLUMN(Kstar, kstar, float); //! Relative momentum in particles pair frame
DECLARE_SOA_COLUMN(KT, kT, float); //! kT distribution of particle pairs
DECLARE_SOA_COLUMN(MT, mT, float); //! Transverse mass distribution
DECLARE_SOA_COLUMN(CharmM, charmM, float); //! Charm hadron mass
DECLARE_SOA_COLUMN(CharmPt, charmPt, float); //! Transverse momentum of charm hadron for result task
DECLARE_SOA_COLUMN(CharmEta, charmEta, float); //! Eta of charm hadron for result task
DECLARE_SOA_COLUMN(CharmPhi, charmPhi, float); //! Phi of charm hadron for result task
DECLARE_SOA_COLUMN(Mult, mult, int); //! Charge particle multiplicity
DECLARE_SOA_COLUMN(MultPercentile, multPercentile, float); //! Multiplicity precentile
DECLARE_SOA_COLUMN(PairSign, pairSign, int8_t); //! Selection between like sign (1) and unlike sign pair (2)
Expand Down Expand Up @@ -281,6 +287,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta,
DECLARE_SOA_TABLE(FDHfCand, "AOD", "FDHFCAND", //! Table to store the derived data for charm hadron candidates
o2::soa::Index<>,
femtodreamparticle::FDCollisionId,
fdhf::TimeStamp,
fdhf::Charge,
fdhf::Prong0Id,
fdhf::Prong1Id,
Expand All @@ -305,31 +312,39 @@ DECLARE_SOA_TABLE(FDHfCand, "AOD", "FDHFCAND", //! Table to store the derived da
fdhf::Phi<fdhf::Prong0Pt, fdhf::Prong0Phi, fdhf::Prong0Eta, fdhf::Prong1Pt, fdhf::Prong1Phi, fdhf::Prong1Eta, fdhf::Prong2Pt, fdhf::Prong2Phi, fdhf::Prong2Eta>,
fdhf::Pt<fdhf::Prong0Pt, fdhf::Prong0Phi, fdhf::Prong0Eta, fdhf::Prong1Pt, fdhf::Prong1Phi, fdhf::Prong1Eta, fdhf::Prong2Pt, fdhf::Prong2Phi, fdhf::Prong2Eta>);

DECLARE_SOA_TABLE(FDResultsHF, "AOD", "FDRESULTSHF", //! table to store results for HF femtoscopy
DECLARE_SOA_TABLE(FDHfCharm, "AOD", "FDHFCHARM", //! table to store results for HF femtoscopy
fdhf::GIndexCol,
fdhf::TimeStamp,
fdhf::CharmM,
fdhf::CharmPt,
fdhf::PtAssoc,
fdhf::CharmEta,
fdhf::CharmPhi,
fdhf::Charge,
fdhf::BDTBkg,
fdhf::BDTPrompt,
fdhf::BDTFD,
fdhf::Kstar,
fdhf::KT,
fdhf::MT,
fdhf::Mult,
fdhf::MultPercentile,
fdhf::Charge,
fdhf::PairSign,
fdhf::ProcessType,
fdhf::FlagMc,
fdhf::OriginMcRec);

DECLARE_SOA_TABLE(FDResultsHFTrkInfo, "AOD", "FDRESULTSHFTRKINFO", //! table to store results for HF femtoscopy
DECLARE_SOA_TABLE(FDHfTrk, "AOD", "FDHFTRK", //! table to store results for HF femtoscopy
fdhf::GIndexCol,
fdhf::TimeStamp,
fdhf::TrkPt,
fdhf::TrkEta,
fdhf::TrkPhi,
femtodreamparticle::Sign,
femtodreamparticle::TPCNClsFound,
track::TPCNClsFindable,
femtodreamparticle::TPCNClsCrossedRows,
femtodreamparticle::TPCNSigmaPr,
femtodreamparticle::TOFNSigmaPr);

DECLARE_SOA_TABLE(FDHfColl, "AOD", "FDHFCOLL", //! table to store results for HF femtoscopy
fdhf::GIndexCol,
fdhf::TimeStamp,
fdhf::VertexZ,
fdhf::Mult);

DECLARE_SOA_TABLE(FDHfCandMC, "AOD", "FDHFCANDMC", //! Table for reconstructed MC charm hadron candidates
o2::soa::Index<>,
fdhf::FlagMc,
Expand Down
54 changes: 29 additions & 25 deletions PWGHF/HFC/TableProducer/femtoDreamProducer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -475,37 +475,41 @@ struct HfFemtoDreamProducer {
LOGF(fatal, "Please check your Ml configuration!!");
}
}
auto bc = col.template bc_as<aod::BCsWithTimestamps>();
int64_t timeStamp = bc.timestamp();
auto fillTable = [&](int CandFlag,
int FunctionSelection,
float BDTScoreBkg,
float BDTScorePrompt,
float BDTScoreFD) {
if (FunctionSelection >= 1){
rowCandCharmHad(
outputCollision.lastIndex(),
trackPos1.sign() + trackNeg.sign() + trackPos2.sign(),
trackPos1.globalIndex(),
trackNeg.globalIndex(),
trackPos2.globalIndex(),
trackPos1.pt(),
trackNeg.pt(),
trackPos2.pt(),
trackPos1.eta(),
trackNeg.eta(),
trackPos2.eta(),
trackPos1.phi(),
trackNeg.phi(),
trackPos2.phi(),
1 << CandFlag,
BDTScoreBkg,
BDTScorePrompt,
BDTScoreFD);

// Row for MC candidate charm hadron (if constexpr isMc)
if constexpr (isMc) {
rowCandMcCharmHad(
candidate.flagMcMatchRec(),
candidate.originMcRec());}
rowCandCharmHad(
outputCollision.lastIndex(),
timeStamp,
trackPos1.sign() + trackNeg.sign() + trackPos2.sign(),
trackPos1.globalIndex(),
trackNeg.globalIndex(),
trackPos2.globalIndex(),
trackPos1.pt(),
trackNeg.pt(),
trackPos2.pt(),
trackPos1.eta(),
trackNeg.eta(),
trackPos2.eta(),
trackPos1.phi(),
trackNeg.phi(),
trackPos2.phi(),
1 << CandFlag,
BDTScoreBkg,
BDTScorePrompt,
BDTScoreFD);

// Row for MC candidate charm hadron (if constexpr isMc)
if constexpr (isMc) {
rowCandMcCharmHad(
candidate.flagMcMatchRec(),
candidate.originMcRec());
}
} };

fillTable(0, candidate.isSelLcToPKPi(), outputMlPKPi.at(0), outputMlPKPi.at(1), outputMlPKPi.at(2));
Expand Down
115 changes: 29 additions & 86 deletions PWGHF/HFC/Tasks/taskCharmHadronsFemtoDream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ struct HfTaskCharmHadronsFemtoDream {
NegativeCharge = -1
};

enum PairSign {
PairNotDefined = 0,
LikeSignPair = 1,
UnLikeSignPair = 2
};

/// Binning configurables
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)"};
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)"};
Expand Down Expand Up @@ -195,8 +189,9 @@ struct HfTaskCharmHadronsFemtoDream {

SliceCache cache;
Preslice<aod::FDParticles> perCol = aod::femtodreamparticle::fdCollisionId;
Produces<o2::aod::FDResultsHF> fillFemtoResult;
Produces<o2::aod::FDResultsHFTrkInfo> fillFemtoResultTrkInfo;
Produces<o2::aod::FDHfCharm> rowFemtoResultCharm;
Produces<o2::aod::FDHfTrk> rowFemtoResultTrk;
Produces<o2::aod::FDHfColl> rowFemtoResultColl;

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

template <typename Part1>
void fillTableTrkInfo(Part1 const& p1)
{
fillFemtoResultTrkInfo(
p1.tpcNClsFound(),
p1.tpcNClsFindable(),
p1.tpcNClsCrossedRows(),
p1.tpcNSigmaPr(),
p1.tofNSigmaPr());
}

/// This function processes the same event and takes care of all the histogramming
template <bool isMc, typename PartitionType, typename CandType, typename TableTracks, typename Collision>
void doSameEvent(PartitionType& sliceTrk1, CandType& sliceCharmHad, TableTracks const& parts, Collision const& col)
{
fillCollision(col);

processType = 1; // for same event

for (auto const& [p1, p2] : combinations(CombinationsFullIndexPolicy(sliceTrk1, sliceCharmHad))) {

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

int pairSign = 0;
if (chargeTrack == p2.charge()) {
pairSign = LikeSignPair;
} else {
pairSign = UnLikeSignPair;
}

float kstar = FemtoDreamMath::getkstar(p1, massOne, p2, massTwo);
if (kstar > highkstarCut) {
continue;
}

// if (chargeTrack == 1) {
// partSign = 1;
// } else {
// partSign = 1 << 1;
// }

float invMass;
if (p2.candidateSelFlag() == 1) {
invMass = p2.m(std::array{o2::constants::physics::MassProton, o2::constants::physics::MassKPlus, o2::constants::physics::MassPiPlus});
Expand All @@ -326,24 +295,39 @@ struct HfTaskCharmHadronsFemtoDream {
charmHadMc = p2.flagMc();
originType = p2.originMcRec();
}
fillFemtoResult(

rowFemtoResultCharm(
col.globalIndex(),
p2.timeStamp(),
invMass,
p2.pt(),
p1.pt(),
p2.eta(),
p2.phi(),
p2.charge(),
p2.bdtBkg(),
p2.bdtPrompt(),
p2.bdtFD(),
kstar,
FemtoDreamMath::getkT(p1, massOne, p2, massTwo),
FemtoDreamMath::getmT(p1, massOne, p2, massTwo),
col.multNtr(),
col.multV0M(),
p2.charge(),
pairSign,
processType,
charmHadMc,
originType);
fillTableTrkInfo(p1);

rowFemtoResultTrk(
col.globalIndex(),
p2.timeStamp(),
p1.pt(),
p1.eta(),
p1.phi(),
chargeTrack,
p1.tpcNClsFound(),
p1.tpcNClsFindable(),
p1.tpcNClsCrossedRows(),
p1.tpcNSigmaPr(),
p1.tofNSigmaPr());

rowFemtoResultColl(
col.globalIndex(),
p2.timeStamp(),
col.posZ(),
col.multNtr());

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

// Mixed events that contain the pair of interest
processType = 2; // for mixed event

Partition<CollisionType> PartitionMaskedCol1 = (aod::femtodreamcollision::bitmaskTrackOne & BitMask) == BitMask;
PartitionMaskedCol1.bindTable(cols);

Expand Down Expand Up @@ -384,20 +366,6 @@ struct HfTaskCharmHadronsFemtoDream {
continue;
}

float chargeTrack = 0.;
if ((p1.cut() & 2) == 2) {
chargeTrack = PositiveCharge;
} else {
chargeTrack = NegativeCharge;
}

int pairSign = 0;
if (chargeTrack == p2.charge()) {
pairSign = LikeSignPair;
} else {
pairSign = UnLikeSignPair;
}

float kstar = FemtoDreamMath::getkstar(p1, massOne, p2, massTwo);
if (kstar > highkstarCut) {
continue;
Expand All @@ -417,31 +385,6 @@ struct HfTaskCharmHadronsFemtoDream {
continue;
}

int charmHadMc = 0;
int originType = 0;
if constexpr (isMc) {
charmHadMc = p2.flagMc();
originType = p2.originMcRec();
}
fillFemtoResult(
invMass,
p2.pt(),
p1.pt(),
p2.bdtBkg(),
p2.bdtPrompt(),
p2.bdtFD(),
kstar,
FemtoDreamMath::getkT(p1, massOne, p2, massTwo),
FemtoDreamMath::getmT(p1, massOne, p2, massTwo),
collision1.multNtr(),
collision1.multV0M(),
p2.charge(),
pairSign,
processType,
charmHadMc,
originType);
fillTableTrkInfo(p1);

// if constexpr (!isMc) mixedEventCont.setPair<isMc, true>(p1, p2, collision1.multNtr(), collision1.multV0M(), use4D, extendedPlots, smearingByOrigin);
mixedEventCont.setPair<isMc, true>(p1, p2, collision1.multNtr(), collision1.multV0M(), use4D, extendedPlots, smearingByOrigin);
}
Expand Down