Skip to content

Commit 663243c

Browse files
xinxiang LIUxinxiang LIU
authored andcommitted
new version after Maiita's comments
1 parent 80b8699 commit 663243c

File tree

1 file changed

+23
-46
lines changed

1 file changed

+23
-46
lines changed

PWGHF/D2H/Tasks/taskCharmPolarisation.cxx

Lines changed: 23 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,7 @@ struct HfTaskCharmPolarisation {
447447
}
448448
if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) {
449449
std::vector<AxisSpec> hRecoHelicityAxes(hHelicityaxes);
450-
if (doprocessLcToPK0SMc) {
451-
hRecoHelicityAxes.insert(hRecoHelicityAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
452-
} else {
453-
hRecoHelicityAxes.insert(hRecoHelicityAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
454-
}
450+
hRecoHelicityAxes.insert(hRecoHelicityAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
455451
registry.add("hRecoPromptHelicity", "THn for Lc->pK0S prompt", HistType::kTHnSparseF, hRecoHelicityAxes);
456452
registry.add("hRecoNonPromptHelicity", "THn for Lc->pK0S non-prompt", HistType::kTHnSparseF, hRecoHelicityAxes);
457453
}
@@ -472,15 +468,13 @@ struct HfTaskCharmPolarisation {
472468
}
473469
}
474470
if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) {
475-
if (doprocessDstarMc || doprocessDstarMcWithMl || doprocessDstarMcInPbPb || doprocessDstarMcWithMlInPbPb || doprocessLcToPKPiMc || doprocessLcToPKPiMcWithMl || doprocessLcToPKPiBackgroundMcWithMl) {
476-
std::vector<AxisSpec> const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge};
477-
std::vector<AxisSpec> const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge};
478-
registry.add("hGenPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes);
479-
registry.add("hGenNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes);
480-
if (activatePartRecoDstar) {
481-
registry.add("hGenPartRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes);
482-
registry.add("hGenPartRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes);
483-
}
471+
std::vector<AxisSpec> const hgenPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge};
472+
std::vector<AxisSpec> const hgenNonPromptAxes = {thnAxisPt, thnAxisNumPvContributors, thnAxisY, thnAxisCosThetaStarHelicity, thnAxisPtB, thnAxisDausAcc, thnAxisResoChannelLc, thnAxisCharge};
473+
registry.add("hGenPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes);
474+
registry.add("hGenNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes);
475+
if (activatePartRecoDstar) {
476+
registry.add("hGenPartRecoPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for partially reconstructed generated prompt D*+ candidates", HistType::kTHnSparseF, hgenPromptAxes);
477+
registry.add("hGenPartRecoNonPromptHelicity", "THn for polarisation studies with cosThStar w.r.t. helicity axis and BDT scores for partially reconstructed generated non-prompt D*+ candidates", HistType::kTHnSparseF, hgenNonPromptAxes);
484478
}
485479
}
486480
if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) {
@@ -559,11 +553,7 @@ struct HfTaskCharmPolarisation {
559553
}
560554
if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) {
561555
std::vector<AxisSpec> hRecoProductionAxes(hProductionaxes);
562-
if (doprocessLcToPK0SMc) {
563-
hRecoProductionAxes.insert(hRecoProductionAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
564-
} else {
565-
hRecoProductionAxes.insert(hRecoProductionAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
566-
}
556+
hRecoProductionAxes.insert(hRecoProductionAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
567557
registry.add("hRecoPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for reconstructed prompt Lc+ candidates", HistType::kTHnSparseF, hRecoProductionAxes);
568558
registry.add("hRecoNonPromptProduction", "THn for polarisation studies with cosThStar w.r.t. production axis and BDT scores for reconstructed non-prompt Lc+ candidates", HistType::kTHnSparseF, hRecoProductionAxes);
569559
}
@@ -668,11 +658,7 @@ struct HfTaskCharmPolarisation {
668658
}
669659
if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) {
670660
std::vector<AxisSpec> hRecoBeamAxes(hBeamaxes);
671-
if (doprocessLcToPK0SMc) {
672-
hRecoBeamAxes.insert(hRecoBeamAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
673-
} else {
674-
hRecoBeamAxes.insert(hRecoBeamAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
675-
}
661+
hRecoBeamAxes.insert(hRecoBeamAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
676662
registry.add("hRecoPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis for Lc -> pK0S", HistType::kTHnSparseF, hRecoBeamAxes);
677663
registry.add("hRecoNonPromptBeam", "THn for polarisation studies with cosThStar w.r.t. beam axis for Lc -> pK0S", HistType::kTHnSparseF, hRecoBeamAxes);
678664
}
@@ -766,11 +752,7 @@ struct HfTaskCharmPolarisation {
766752
}
767753
if (doprocessLcToPK0SMc || doprocessLcToPK0SMcWithMl) {
768754
std::vector<AxisSpec> hRecoRandomAxes(hRandomaxes);
769-
if (doprocessLcToPK0SMc) {
770-
hRecoRandomAxes.insert(hRecoRandomAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
771-
} else {
772-
hRecoRandomAxes.insert(hRecoRandomAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
773-
}
755+
hRecoRandomAxes.insert(hRecoRandomAxes.end(), {thnAxisAbsEtaTrackMin, thnAxisNumItsClsMin, thnAxisNumTpcClsMin, thnAxisCharge});
774756
registry.add("hRecoPromptRandom", "THn for Lc->pK0S prompt, random axis", HistType::kTHnSparseF, hRecoRandomAxes);
775757
registry.add("hRecoNonPromptRandom", "THn for Lc->pK0S non-prompt, random axis", HistType::kTHnSparseF, hRecoRandomAxes);
776758
}
@@ -1689,7 +1671,7 @@ struct HfTaskCharmPolarisation {
16891671
}
16901672
} else if constexpr (CosThetaStarType == charm_polarisation::CosThetaStarType::Beam) { // Beam
16911673
if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) { // Lc+ -> pK0s remove the axis of resochannel
1692-
if (origin == RecoDecay::OriginType::Prompt) {
1674+
if (origin == RecoDecay::OriginType::Prompt) { // prompt
16931675
registry.fill(HIST("hGenPromptBeam"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, areDausInAcc, charge);
16941676
} else { // non-prompt
16951677
registry.fill(HIST("hGenNonPromptBeam"), ptCharmHad, numPvContributors, std::abs(rapCharmHad), cosThetaStar, ptBhadMother, areDausInAcc, charge);
@@ -1916,16 +1898,11 @@ struct HfTaskCharmPolarisation {
19161898
}
19171899
} else {
19181900
/// data
1919-
if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi) {
1901+
if constexpr (Channel == charm_polarisation::DecayChannel::LcToPKPi || Channel == charm_polarisation::DecayChannel::LcToPK0S) {
19201902
/// Calculate the electric charge from reconstructed daughter tracks
19211903
/// Lc charge == first daughter charge
19221904
auto trackProng0 = candidate.template prong0_as<Trk>();
19231905
charge = static_cast<int8_t>(trackProng0.sign());
1924-
} else if constexpr (Channel == charm_polarisation::DecayChannel::LcToPK0S) {
1925-
/// For Lc -> p K0S, the proton is the first daughter (prong0)
1926-
/// Lc charge == proton charge
1927-
auto trackProng0 = candidate.template prong0_as<Trk>();
1928-
charge = static_cast<int8_t>(trackProng0.sign());
19291906
}
19301907
}
19311908

@@ -2140,17 +2117,16 @@ struct HfTaskCharmPolarisation {
21402117
}
21412118
}
21422119
isRotatedCandidate = 0;
2143-
std::array<float, 3> twoVecProton = candidate.pVectorProng0();
2144-
std::array<float, 3> twoVecK0s = candidate.pVectorProng1();
2145-
pxCharmHad = twoVecProton[0] + twoVecK0s[0];
2146-
pyCharmHad = twoVecProton[1] + twoVecK0s[1];
2147-
pzCharmHad = twoVecProton[2] + twoVecK0s[2];
2148-
pxDau = twoVecProton[0];
2149-
pyDau = twoVecProton[1];
2150-
pzDau = twoVecProton[2];
2120+
std::array<float, 3> threeVecProton = candidate.pVectorProng0();
2121+
std::array<float, 3> threeVecK0s = candidate.pVectorProng1();
2122+
pxCharmHad = threeVecProton[0] + threeVecK0s[0];
2123+
pyCharmHad = threeVecProton[1] + threeVecK0s[1];
2124+
pzCharmHad = threeVecProton[2] + threeVecK0s[2];
2125+
pxDau = threeVecProton[0];
2126+
pyDau = threeVecProton[1];
2127+
pzDau = threeVecProton[2];
21512128
massDau = MassProton;
2152-
invMassCharmHad = RecoDecay::m(std::array{twoVecProton, twoVecK0s},
2153-
std::array{MassProton, MassK0Short});
2129+
invMassCharmHad = HfHelper::invMassLcToK0sP(candidate);
21542130
invMassCharmHadForSparse = invMassCharmHad;
21552131
rapidity = RecoDecay::y(std::array{pxCharmHad, pyCharmHad, pzCharmHad}, MassLambdaCPlus);
21562132
}
@@ -2220,6 +2196,7 @@ struct HfTaskCharmPolarisation {
22202196
if constexpr (Channel != charm_polarisation::DecayChannel::LcToPK0S) {
22212197
nMuons = candidate.nTracksDecayed();
22222198
} else {
2199+
/// TODO: add π → μ in the data model for Λc → pK0s
22232200
nMuons = 0;
22242201
}
22252202
}

0 commit comments

Comments
 (0)