Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
25 changes: 21 additions & 4 deletions PWGHF/HFC/Tasks/taskCharmHadronsTrackFemtoDream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ struct HfTaskCharmHadronsTrackFemtoDream {
Configurable<float> charmHadMinInvMass{"charmHadMinInvMass", 2.15, "Minimum charm invariant mass or DeltaM (GeV/c2)"};
Configurable<float> charmHadMinPt{"charmHadMinPt", 0., "Minimum pT of Charm Hadron (particle 2)"};
Configurable<float> charmHadMaxPt{"charmHadMaxPt", 999., "Maximum pT of Charm Hadron (particle 2)"};
Configurable<int> charmHadPDGCode{"charmHadPDGCode", Pdg::kLambdaCPlus, "PDG code of particle 2 Charm Hadron"};
Configurable<float> charmHadPromptBDTmin{"charmHadPromptBDTmin", 0., "Minimum prompt bdt score Charm Hadron (particle 2)"};
Configurable<float> charmHadPromptBDTmax{"charmHadPromptBDTmax", 1., "Maximum prompt bdt score Charm Hadron (particle 2)"};
} charmSel;
Expand Down Expand Up @@ -316,6 +315,7 @@ struct HfTaskCharmHadronsTrackFemtoDream {

float massOne = 0.f;
float massTwo = 0.f;
int charmHadPDGCode = -1; // PDG code of the charm hadron, set in init() from the enabled process function
int64_t processType = 0;

void init(InitContext& /*context*/)
Expand All @@ -337,7 +337,24 @@ struct HfTaskCharmHadronsTrackFemtoDream {
}

massOne = o2::analysis::femtoDream::getMass(trackSel.pdgCodeTrack1.value);
massTwo = processSc ? 0.f : o2::analysis::femtoDream::getMass(charmSel.charmHadPDGCode.value);
// The mass hypothesis of the charm hadron enters the pair kT, k* and mT and the
// internal calculations of the container, so it is defined by the process function in use.
if (processSc) {
// the mass is set per candidate, since it depends on the SigmaC charge; a supported
// placeholder is needed here, because the containers are initialised with it
charmHadPDGCode = Pdg::kSigmaCPlusPlus;
} else if (doprocessDataLcTrk || doprocessMcLcTrk) {
charmHadPDGCode = Pdg::kLambdaCPlus;
} else if (doprocessDataDplusTrk || doprocessMcDplusTrk || doprocessMcDplusTrkGen) {
charmHadPDGCode = Pdg::kDPlus;
} else if (doprocessDataD0Trk || doprocessMcD0Trk) {
charmHadPDGCode = Pdg::kD0;
} else if (doprocessDataXicTrk || doprocessMcXicTrk) {
charmHadPDGCode = Pdg::kXiCPlus;
} else {
charmHadPDGCode = Pdg::kDStar;
}
massTwo = processSc ? 0.f : o2::analysis::femtoDream::getMass(charmHadPDGCode);

// setup columnpolicy for binning
colBinningMult = {{mixingBinVztx, mixingBinMult}};
Expand All @@ -354,15 +371,15 @@ struct HfTaskCharmHadronsTrackFemtoDream {
highkstarCut,
smearingByOrigin, binInvMass);

sameEventCont.setPDGCodes(trackSel.pdgCodeTrack1.value, charmSel.charmHadPDGCode.value);
sameEventCont.setPDGCodes(trackSel.pdgCodeTrack1.value, charmHadPDGCode);
mixedEventCont.init(&registry,
binkstar, binpTTrack, binkT, binmT, mixingBinMult, mixingBinMultPercentile,
bin4Dkstar, bin4DmT, bin4DMult, bin4DmultPercentile,
isMc, pairQASetting.use4D, pairQASetting.extendedPlots,
highkstarCut,
smearingByOrigin, binInvMass);

mixedEventCont.setPDGCodes(trackSel.pdgCodeTrack1.value, charmSel.charmHadPDGCode.value);
mixedEventCont.setPDGCodes(trackSel.pdgCodeTrack1.value, charmHadPDGCode);
registryMixQa.add("MixingQA/hSECollisionBins", "; bin; Entries", kTH1F, {{120, -0.5, 119.5}});
registryMixQa.add("MixingQA/hSECollisionPool", "; Vz (cm); Mul", kTH2F, {{100, -10, 10}, {200, 0, 200}});
registryMixQa.add("MixingQA/hMECollisionBins", "; bin; Entries", kTH1F, {{120, -0.5, 119.5}});
Expand Down
21 changes: 17 additions & 4 deletions PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ struct HfTaskCharmHadronsV0FemtoDream {
Configurable<float> charmHadMinInvMass{"charmHadMinInvMass", 2.15, "Minimum invariant mass of Charm Hadron (particle 2)"};
Configurable<float> charmHadMinPt{"charmHadMinPt", 0., "Minimum pT of Charm Hadron (particle 2)"};
Configurable<float> charmHadMaxPt{"charmHadMaxPt", 999., "Maximum pT of Charm Hadron (particle 2)"};
Configurable<int> charmHadPDGCode{"charmHadPDGCode", 4122, "PDG code of particle 2 Charm Hadron"};
Configurable<float> charmHadPromptBDTmin{"charmHadPromptBDTmin", 0., "Minimum prompt bdt score Charm Hadron (particle 2)"};
Configurable<float> charmHadPromptBDTmax{"charmHadPromptBDTmax", 1., "Maximum prompt bdt score Charm Hadron (particle 2)"};
} charmSel;
Expand Down Expand Up @@ -316,7 +315,8 @@ struct HfTaskCharmHadronsV0FemtoDream {
HistogramRegistry registryCharmHadronQa{"registryCharmHadronQa"};

float massOne = o2::analysis::femtoDream::getMass(v0Sel.pdgCodeV0);
float massTwo = o2::analysis::femtoDream::getMass(charmSel.charmHadPDGCode);
float massTwo = -1.f; // set in init() from the enabled process function
int charmHadPDGCode = -1; // PDG code of the charm hadron, set in init() from the enabled process function
int8_t partSign = 0;
int64_t processType = 0;

Expand All @@ -326,6 +326,19 @@ struct HfTaskCharmHadronsV0FemtoDream {
if (std::accumulate(processes.begin(), processes.end(), 0) != 1) {
LOGP(fatal, "One and only one process function must be enabled at a time.");
}

// The mass hypothesis of the charm hadron enters the pair kT, k* and mT and the
// internal calculations of the container, so it is defined by the process function in use.
if (doprocessDataLcV0) {
charmHadPDGCode = o2::constants::physics::Pdg::kLambdaCPlus;
} else if (doprocessDataDplusV0 || doprocessMcDplusV0) {
charmHadPDGCode = o2::constants::physics::Pdg::kDPlus;
} else if (doprocessDataD0V0) {
charmHadPDGCode = o2::constants::physics::Pdg::kD0;
} else {
charmHadPDGCode = o2::constants::physics::Pdg::kDStar;
}
massTwo = o2::analysis::femtoDream::getMass(charmHadPDGCode);
bool process3Prong = doprocessDataLcV0 || doprocessDataDplusV0 || doprocessMcDplusV0;
bool process2Prong = doprocessDataD0V0;
bool processDstar = doprocessDataDstarV0 || doprocessMcDstarV0;
Expand All @@ -349,15 +362,15 @@ struct HfTaskCharmHadronsV0FemtoDream {
highkstarCut,
smearingByOrigin, AxisBinning.binInvMass);

sameEventCont.setPDGCodes(v0Sel.pdgCodeV0, charmSel.charmHadPDGCode);
sameEventCont.setPDGCodes(v0Sel.pdgCodeV0, charmHadPDGCode);
mixedEventCont.init(&registry,
AxisBinning.binkstar, AxisBinning.binpTV0, AxisBinning.binkT, AxisBinning.binmT, AxisBinning.mixingBinMult, AxisBinning.mixingBinMultPercentile,
AxisBinning.bin4Dkstar, AxisBinning.bin4DmT, AxisBinning.bin4DMult, AxisBinning.bin4DmultPercentile,
isMc, use4D, extendedPlots,
highkstarCut,
smearingByOrigin, AxisBinning.binInvMass);

mixedEventCont.setPDGCodes(v0Sel.pdgCodeV0, charmSel.charmHadPDGCode);
mixedEventCont.setPDGCodes(v0Sel.pdgCodeV0, charmHadPDGCode);
registryMixQa.add("MixingQA/hSECollisionBins", "; bin; Entries", kTH1F, {{120, -0.5, 119.5}});
registryMixQa.add("MixingQA/hSECollisionPool", "; Vz (cm); Mul", kTH2F, {{100, -10, 10}, {200, 0, 200}});
registryMixQa.add("MixingQA/hMECollisionBins", "; bin; Entries", kTH1F, {{120, -0.5, 119.5}});
Expand Down
Loading