Skip to content

Commit c6f252f

Browse files
authored
[PWGHF] Select correct hfflag when running JPsiToee (#12134)
1 parent 67dedda commit c6f252f

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ struct HfDataCreatorJpsiHadReduced {
770770
// Apply the selections on the J/Psi candidates
771771
registry.fill(HIST("hSelectionsJpsi"), 1, candidate.pt());
772772

773-
if (!(candidate.hfflag() & 1 << aod::hf_cand_2prong::DecayType::JpsiToMuMu)) {
773+
if (!(candidate.hfflag() & (1 << (runJpsiToee ? aod::hf_cand_2prong::DecayType::JpsiToEE : aod::hf_cand_2prong::DecayType::JpsiToMuMu)))) {
774774
continue;
775775
}
776776
registry.fill(HIST("hSelectionsJpsi"), 2 + aod::SelectionStep::RecoSkims, candidate.pt());
@@ -824,12 +824,7 @@ struct HfDataCreatorJpsiHadReduced {
824824
registry.fill(HIST("hSelectionsJpsi"), 2 + aod::SelectionStep::RecoPID, candidate.pt());
825825

826826
int indexHfCandJpsi = hfJpsi.lastIndex() + 1;
827-
float invMassJpsi{0.f};
828-
if (runJpsiToee) {
829-
invMassJpsi = hfHelper.invMassJpsiToEE(candidate);
830-
} else {
831-
invMassJpsi = hfHelper.invMassJpsiToMuMu(candidate);
832-
}
827+
float invMassJpsi = runJpsiToee ? hfHelper.invMassJpsiToEE(candidate) : hfHelper.invMassJpsiToMuMu(candidate);
833828
registry.fill(HIST("hMassJpsi"), invMassJpsi);
834829
registry.fill(HIST("hPtJpsi"), candidate.pt());
835830
registry.fill(HIST("hCpaJpsi"), candidate.cpa());

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,12 @@ struct HfCandidateCreator2Prong {
121121
float toMicrometers = 10000.; // from cm to µm
122122
double massPi{0.};
123123
double massK{0.};
124+
double massE{0.};
125+
double massMu{0.};
124126
double massPiK{0.};
125127
double massKPi{0.};
128+
double massEE{0.};
129+
double massMuMu{0.};
126130
double bz{0.};
127131

128132
std::shared_ptr<TH1> hCandidates;
@@ -170,6 +174,8 @@ struct HfCandidateCreator2Prong {
170174

171175
// histograms
172176
registry.add("hMass2", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {axisMass}});
177+
registry.add("hMassEE", "2-prong candidates;inv. mass (e e) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {axisMass}});
178+
registry.add("hMassMuMu", "2-prong candidates;inv. mass (#mu #mu) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {axisMass}});
173179
registry.add("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}});
174180
registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}});
175181
registry.add("hCovPVYY", "2-prong candidates;YY element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}});
@@ -188,6 +194,8 @@ struct HfCandidateCreator2Prong {
188194

189195
massPi = MassPiPlus;
190196
massK = MassKPlus;
197+
massE = MassElectron;
198+
massMu = MassMuon;
191199

192200
if (std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) == 1) {
193201
registry.fill(HIST("hVertexerType"), aod::hf_cand::VertexerType::DCAFitter);
@@ -361,8 +369,12 @@ struct HfCandidateCreator2Prong {
361369
auto arrayMomenta = std::array{pvec0, pvec1};
362370
massPiK = RecoDecay::m(arrayMomenta, std::array{massPi, massK});
363371
massKPi = RecoDecay::m(arrayMomenta, std::array{massK, massPi});
372+
massEE = RecoDecay::m(arrayMomenta, std::array{massE, massE});
373+
massMuMu = RecoDecay::m(arrayMomenta, std::array{massMu, massMu});
364374
registry.fill(HIST("hMass2"), massPiK);
365375
registry.fill(HIST("hMass2"), massKPi);
376+
registry.fill(HIST("hMassEE"), massEE);
377+
registry.fill(HIST("hMassMuMu"), massMuMu);
366378
}
367379
}
368380
}

0 commit comments

Comments
 (0)