Skip to content

Commit 44d6408

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add-upc-to-taskDplus
2 parents 488109c + 89253ce commit 44d6408

File tree

11 files changed

+1340
-915
lines changed

11 files changed

+1340
-915
lines changed

PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx

Lines changed: 935 additions & 720 deletions
Large diffs are not rendered by default.

PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,24 @@ namespace full
6666
{
6767
DECLARE_SOA_COLUMN(M, m, float); //! Invariant mass of candidate (GeV/c2)
6868
DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of candidate (GeV/c)
69-
// ML scores
7069
DECLARE_SOA_COLUMN(MlScore0, mlScore0, float); //! ML score of the first configured index
7170
DECLARE_SOA_COLUMN(MlScore1, mlScore1, float); //! ML score of the second configured index
71+
DECLARE_SOA_COLUMN(ScalarProd, scalarProd, float); //! Scalar product
72+
DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality
7273
} // namespace full
73-
DECLARE_SOA_TABLE(HfCandPtCent, "AOD", "HFCANDPTCENT",
74+
DECLARE_SOA_TABLE(HfCandMPtInfos, "AOD", "HFCANDMPTINFO",
7475
full::M,
7576
full::Pt,
7677
full::MlScore0,
7778
full::MlScore1);
79+
80+
DECLARE_SOA_TABLE(HfCandFlowInfos, "AOD", "HFCANDFLOWINFO",
81+
full::M,
82+
full::Pt,
83+
full::MlScore0,
84+
full::MlScore1,
85+
full::ScalarProd,
86+
full::Cent);
7887
} // namespace o2::aod
7988

8089
enum DecayChannel { DplusToPiKPi = 0,
@@ -98,7 +107,8 @@ enum QvecEstimator { FV0A = 0,
98107
TPCTot };
99108

100109
struct HfTaskFlowCharmHadrons {
101-
Produces<o2::aod::HfCandPtCent> rowCandidateMassPtMlScores;
110+
Produces<o2::aod::HfCandMPtInfos> rowCandMassPtMl;
111+
Produces<o2::aod::HfCandFlowInfos> rowCandMassPtMlSpCent;
102112

103113
Configurable<int> harmonic{"harmonic", 2, "harmonic number"};
104114
Configurable<int> qvecDetector{"qvecDetector", 3, "Detector for Q vector estimation (FV0A: 0, FT0M: 1, FT0A: 2, FT0C: 3, TPC Pos: 4, TPC Neg: 5, TPC Tot: 6)"};
@@ -108,7 +118,9 @@ struct HfTaskFlowCharmHadrons {
108118
Configurable<float> centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP/EP computation (not applied in resolution process)"};
109119
Configurable<bool> storeEP{"storeEP", false, "Flag to store EP-related axis"};
110120
Configurable<bool> storeMl{"storeMl", false, "Flag to store ML scores"};
111-
Configurable<bool> fillMassPtMlTree{"fillMassPtMlTree", false, "Flag to fill mass and pt tree"};
121+
Configurable<bool> fillMassPtMlTree{"fillMassPtMlTree", false, "Flag to fill mass, pt and ML scores tree"};
122+
Configurable<bool> fillMassPtMlSpCentTree{"fillMassPtMlSpCentTree", false, "Flag to fill mass, pt, ML scores, SP and centrality tree"};
123+
Configurable<bool> fillSparse{"fillSparse", true, "Flag to fill sparse"};
112124
Configurable<float> downSampleFactor{"downSampleFactor", 1., "Fraction of candidates to keep in TTree"};
113125
Configurable<float> ptDownSampleMax{"ptDownSampleMax", 10., "Maximum pt for the application of the downsampling factor"};
114126
Configurable<bool> storeResoOccu{"storeResoOccu", false, "Flag to store Occupancy in resolution ThnSparse"};
@@ -296,20 +308,6 @@ struct HfTaskFlowCharmHadrons {
296308
}
297309
}; // end init
298310

299-
/// Fill the mass, pt and ML scores of a candidate
300-
/// \param mass is the candidate mass
301-
/// \param pt is the candidate transverse momentum
302-
/// \param mlscore0 is the first ML score
303-
/// \param mlscore1 is the second ML score
304-
void fillMassPt(const float mass, const float pt, const float mlscore0, const float mlscore1)
305-
{
306-
rowCandidateMassPtMlScores(
307-
mass,
308-
pt,
309-
mlscore0,
310-
mlscore1);
311-
}
312-
313311
/// Compute the Q vector for the candidate's tracks
314312
/// \param cand is the candidate
315313
/// \param tracksQx is the X component of the Q vector for the tracks
@@ -697,15 +695,21 @@ struct HfTaskFlowCharmHadrons {
697695
float const scalprodCand = cosNPhi * xQVec + sinNPhi * yQVec;
698696
float const cosDeltaPhi = std::cos(harmonic * (phiCand - evtPl));
699697

700-
if (fillMassPtMlTree && storeMl) {
698+
if (fillMassPtMlTree || fillMassPtMlSpCentTree) {
701699
if (downSampleFactor < 1.) {
702700
float const pseudoRndm = ptCand * 1000. - static_cast<int64_t>(ptCand * 1000);
703701
if (ptCand < ptDownSampleMax && pseudoRndm >= downSampleFactor) {
704702
continue;
705703
}
706704
}
707-
fillMassPt(massCand, ptCand, outputMl[0], outputMl[1]);
708-
} else {
705+
if (fillMassPtMlTree) {
706+
rowCandMassPtMl(massCand, ptCand, outputMl[0], outputMl[1]);
707+
}
708+
if (fillMassPtMlSpCentTree) {
709+
rowCandMassPtMlSpCent(massCand, ptCand, outputMl[0], outputMl[1], scalprodCand, cent);
710+
}
711+
}
712+
if (fillSparse) {
709713
fillThn(massCand, ptCand, cent, cosNPhi, sinNPhi, cosDeltaPhi, scalprodCand, outputMl, occupancy, hfevflag);
710714
}
711715
}

PWGHF/D2H/Tasks/taskLc.cxx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -462,18 +462,18 @@ struct HfTaskLc {
462462
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
463463
occ = o2::hf_occupancy::getOccupancyColl(collision, occEstimator);
464464
}
465-
double massLc(-1);
466465
double outputBkg(-1), outputPrompt(-1), outputFD(-1);
467466
const float properLifetime = HfHelper::ctLc(candidate) * CtToProperLifetimePs;
468467

469468
auto fillTHnRecSig = [&](bool isPKPi) {
470-
massLc = isPKPi ? HfHelper::invMassLcToPKPi(candidate) : HfHelper::invMassLcToPiKP(candidate);
469+
const auto massLc = isPKPi ? HfHelper::invMassLcToPKPi(candidate) : HfHelper::invMassLcToPiKP(candidate);
471470

472471
if constexpr (FillMl) {
473-
if (candidate.mlProbLcToPKPi().size() == NumberOfMlClasses) {
474-
outputBkg = isPKPi ? candidate.mlProbLcToPKPi()[MlClassBackground] : candidate.mlProbLcToPiKP()[MlClassBackground]; /// bkg score
475-
outputPrompt = isPKPi ? candidate.mlProbLcToPKPi()[MlClassPrompt] : candidate.mlProbLcToPiKP()[MlClassPrompt]; /// prompt score
476-
outputFD = isPKPi ? candidate.mlProbLcToPKPi()[MlClassNonPrompt] : candidate.mlProbLcToPiKP()[MlClassNonPrompt]; /// non-prompt score
472+
const auto& mlProb = isPKPi ? candidate.mlProbLcToPKPi() : candidate.mlProbLcToPiKP();
473+
if (mlProb.size() == NumberOfMlClasses) {
474+
outputBkg = mlProb[MlClassBackground]; /// bkg score
475+
outputPrompt = mlProb[MlClassPrompt]; /// prompt score
476+
outputFD = mlProb[MlClassNonPrompt]; /// non-prompt score
477477
}
478478
/// Fill the ML outputScores and variables of candidate
479479
std::vector<double> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors), ptRecB, static_cast<double>(originType)};
@@ -655,18 +655,18 @@ struct HfTaskLc {
655655
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
656656
occ = o2::hf_occupancy::getOccupancyColl(collision, occEstimator);
657657
}
658-
double massLc(-1);
659658
double outputBkg(-1), outputPrompt(-1), outputFD(-1);
660659
const float properLifetime = HfHelper::ctLc(candidate) * CtToProperLifetimePs;
661660

662661
auto fillTHnData = [&](bool isPKPi) {
663-
massLc = isPKPi ? HfHelper::invMassLcToPKPi(candidate) : HfHelper::invMassLcToPiKP(candidate);
662+
const auto massLc = isPKPi ? HfHelper::invMassLcToPKPi(candidate) : HfHelper::invMassLcToPiKP(candidate);
664663

665664
if constexpr (FillMl) {
666-
if (candidate.mlProbLcToPKPi().size() == NumberOfMlClasses) {
667-
outputBkg = isPKPi ? candidate.mlProbLcToPKPi()[MlClassBackground] : candidate.mlProbLcToPiKP()[MlClassBackground]; /// bkg score
668-
outputPrompt = isPKPi ? candidate.mlProbLcToPKPi()[MlClassPrompt] : candidate.mlProbLcToPiKP()[MlClassPrompt]; /// prompt score
669-
outputFD = isPKPi ? candidate.mlProbLcToPKPi()[MlClassNonPrompt] : candidate.mlProbLcToPiKP()[MlClassNonPrompt]; /// non-prompt score
665+
const auto& mlProb = isPKPi ? candidate.mlProbLcToPKPi() : candidate.mlProbLcToPiKP();
666+
if (mlProb.size() == NumberOfMlClasses) {
667+
outputBkg = mlProb[MlClassBackground]; /// bkg score
668+
outputPrompt = mlProb[MlClassPrompt]; /// prompt score
669+
outputFD = mlProb[MlClassNonPrompt]; /// non-prompt score
670670
}
671671
/// Fill the ML outputScores and variables of candidate
672672
std::vector<double> valuesToFill{massLc, pt, cent, outputBkg, outputPrompt, outputFD, static_cast<double>(numPvContributors)};
16 KB
Binary file not shown.

PWGHF/HFC/Tasks/taskCorrelationLcHadrons.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ struct HfTaskCorrelationLcHadrons {
232232
registry.add("hCorrel2DVsPtSidebandLeft", stringLcHadron + "Left" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}, {axisCentFT0M}}});
233233
registry.add("hCorrel2DVsPtSidebandRight", stringLcHadron + "Right" + stringSideband + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtLc}, {axisPtHadron}, {axisPoolBin}, {axisCentFT0M}}});
234234
registry.add("hCorrel2DVsPtSignalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}, {axisCentFT0M}}});
235-
registry.add("hCorrel2DVsPtGlobalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}, {axisCentFT0M}, {axisMassLc}}});
235+
registry.add("hCorrel2DVsPtGlobalRegion", stringLcHadron + stringSignal + stringDeltaPhi + stringDeltaEta + stringPtLc + stringPtHadron + "entries", {HistType::kTHnSparseF, {{axisDeltaPhi}, {axisDeltaEta}, {axisPtCorr}, {axisPtHadron}, {axisPoolBin}, {axisMassLc}}});
236236
registry.get<THnSparse>(HIST("hCorrel2DVsPtSidebandLeft"))->Sumw2();
237237
registry.get<THnSparse>(HIST("hCorrel2DVsPtSidebandRight"))->Sumw2();
238238
registry.get<THnSparse>(HIST("hCorrel2DVsPtSignalRegion"))->Sumw2();
@@ -516,7 +516,7 @@ struct HfTaskCorrelationLcHadrons {
516516
}
517517
// check if correlation entry belongs to signal region, sidebands or is outside both, and fill correlation plots
518518
if (storeMass) {
519-
registry.fill(HIST("hCorrel2DVsPtGlobalRegion"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, cent, massLc, efficiencyWeight);
519+
registry.fill(HIST("hCorrel2DVsPtGlobalRegion"), deltaPhi, deltaEta, ptLc, ptHadron, poolBin, massLc, efficiencyWeight);
520520
continue;
521521
}
522522
if (massLc > signalRegionInner->at(ptBinLc) && massLc < signalRegionOuter->at(ptBinLc)) {

0 commit comments

Comments
 (0)