Skip to content

Commit a9b88de

Browse files
authored
[PWGHF] Remove option to run B analysis with J/Psi -> ee and add electron PID veto (#16582)
1 parent 5f62161 commit a9b88de

2 files changed

Lines changed: 17 additions & 106 deletions

File tree

PWGHF/D2H/TableProducer/candidateCreatorBToJpsiReduced.cxx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ struct HfCandidateCreatorBToJpsiReduced {
7575
Configurable<double> minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any B+ is smaller than this"};
7676
Configurable<double> minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"};
7777

78-
Configurable<bool> runJpsiToee{"runJpsiToee", false, "Run analysis for J/Psi to ee (debug)"};
7978
// selection
8079
Configurable<double> invMassWindowJpsiHadTolerance{"invMassWindowJpsiHadTolerance", 0.01, "invariant-mass window tolerance for J/Psi K pair preselections (GeV/c2)"};
8180

@@ -200,11 +199,7 @@ struct HfCandidateCreatorBToJpsiReduced {
200199
trackParCovJpsi.setAbsCharge(0); // to be sure
201200

202201
float invMassJpsi{0.f};
203-
if (runJpsiToee) {
204-
invMassJpsi = RecoDecay::m2(std::array{pVecDauPos, pVecDauNeg}, std::array{o2::constants::physics::MassElectron, o2::constants::physics::MassElectron});
205-
} else {
206-
invMassJpsi = RecoDecay::m2(std::array{pVecDauPos, pVecDauNeg}, std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon});
207-
}
202+
invMassJpsi = RecoDecay::m2(std::array{pVecDauPos, pVecDauNeg}, std::array{o2::constants::physics::MassMuon, o2::constants::physics::MassMuon});
208203
invMassJpsi = std::sqrt(invMassJpsi);
209204
registry.fill(HIST("hMassJpsi"), invMassJpsi);
210205

PWGHF/D2H/TableProducer/dataCreatorJpsiHadReduced.cxx

Lines changed: 16 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -137,36 +137,12 @@ struct HfDataCreatorJpsiHadReduced {
137137
Configurable<double> minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any B0 is smaller than this"};
138138
Configurable<double> minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"};
139139

140-
Configurable<bool> runJpsiToee{"runJpsiToee", false, "Run analysis for J/Psi to ee (debug)"};
141140
struct : o2::framework::ConfigurableGroup {
142141
// TPC PID
143142
Configurable<double> ptPidTpcMin{"ptPidTpcMin", 0.15, "Lower bound of track pT for TPC PID"};
144143
Configurable<double> ptPidTpcMax{"ptPidTpcMax", 5., "Upper bound of track pT for TPC PID"};
145-
Configurable<double> nSigmaTpcElMax{"nSigmaTpcElMax", 4., "Electron nsigma cut on TPC only"};
146-
Configurable<double> nSigmaTpcPiMin{"nSigmaTpcPiMin", 2.5, "Pion nsigma cut on TPC only"};
147-
Configurable<double> nSigmaTpcPiMax{"nSigmaTpcPiMax", 99., "Pion nsigma cut on TPC only"};
148-
Configurable<double> nSigmaTpcPrMin{"nSigmaTpcPrMin", -99., "Proton nsigma cut on TPC only"};
149-
Configurable<double> nSigmaTpcPrMax{"nSigmaTpcPrMax", 99, "Proton nsigma cut on TPC only"};
150-
Configurable<double> nSigmaTpcElCombinedMax{"nSigmaTpcElCombinedMax", 4., "Electron Nsigma cut on TPC combined with TOF"};
151-
Configurable<double> nSigmaTpcPiCombinedMin{"nSigmaTpcPiCombinedMin", 2.5, "Pion Nsigma cut on TPC combined with TOF"};
152-
Configurable<double> nSigmaTpcPiCombinedMax{"nSigmaTpcPiCombinedMax", 99., "Pion Nsigma cut on TPC combined with TOF"};
153-
Configurable<double> nSigmaTpcPrCombinedMin{"nSigmaTpcPrCombinedMin", -99., "Proton Nsigma cut on TPC combined with TOF"};
154-
Configurable<double> nSigmaTpcPrCombinedMax{"nSigmaTpcPrCombinedMax", 99, "Proton Nsigma cut on TPC combined with TOF"};
155-
// TOF PID
156-
Configurable<double> ptPidTofMin{"ptPidTofMin", 0.15, "Lower bound of track pT for TOF PID"};
157-
Configurable<double> ptPidTofMax{"ptPidTofMax", 5., "Upper bound of track pT for TOF PID"};
158-
Configurable<double> nSigmaTofElMax{"nSigmaTofElMax", 4., "Electron nsigma cut on TPC only"};
159-
Configurable<double> nSigmaTofPiMin{"nSigmaTofPiMin", -99, "Pion nsigma cut on TPC only"};
160-
Configurable<double> nSigmaTofPiMax{"nSigmaTofPiMax", 99., "Pion nsigma cut on TPC only"};
161-
Configurable<double> nSigmaTofPrMin{"nSigmaTofPrMin", -99, "Proton nsigma cut on TPC only"};
162-
Configurable<double> nSigmaTofPrMax{"nSigmaTofPrMax", 99., "Proton nsigma cut on TPC only"};
163-
Configurable<double> nSigmaTofElCombinedMax{"nSigmaTofElCombinedMax", 4., "Electron Nsigma cut on TOF combined with TPC"};
164-
Configurable<double> nSigmaTofPiCombinedMin{"nSigmaTofPiCombinedMin", 2.5, "Pion Nsigma cut on TOF combined with TPC"};
165-
Configurable<double> nSigmaTofPiCombinedMax{"nSigmaTofPiCombinedMax", 99., "Pion Nsigma cut on TOF combined with TPC"};
166-
Configurable<double> nSigmaTofPrCombinedMin{"nSigmaTofPrCombinedMin", -99., "Proton Nsigma cut on TOF combined with TPC"};
167-
Configurable<double> nSigmaTofPrCombinedMax{"nSigmaTofPrCombinedMax", 99, "Proton Nsigma cut on TOF combined with TPC"};
168-
// AND logic for TOF+TPC PID (as in Run2)
169-
Configurable<bool> usePidTpcAndTof{"usePidTpcAndTof", true, "Use AND logic for TPC and TOF PID"};
144+
Configurable<double> nSigmaTpcElMinForVeto{"nSigmaTpcElMinForVeto", -1., "Electron nsigma cut on TPC only for veto (electrons within min and max are discarded)"};
145+
Configurable<double> nSigmaTpcElMaxForVeto{"nSigmaTpcElMaxForVeto", 1., "Electron nsigma cut on TPC only for veto (electrons within min and max are discarded)"};
170146
} selectionsPid;
171147
Configurable<double> ptJpsiMin{"ptJpsiMin", 0., "Lower bound of J/Psi pT"};
172148
Configurable<double> ptJpsiMax{"ptJpsiMax", 50., "Upper bound of J/Psi pT"};
@@ -187,8 +163,6 @@ struct HfDataCreatorJpsiHadReduced {
187163
Configurable<std::string> ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"};
188164
Configurable<std::string> ccdbPathGrpMag{"ccdbPathGrpMag", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object (Run 3)"};
189165

190-
TrackSelectorPi selectorPion;
191-
TrackSelectorPr selectorProton;
192166
TrackSelectorEl selectorElectron;
193167

194168
// CCDB service
@@ -225,26 +199,8 @@ struct HfDataCreatorJpsiHadReduced {
225199

226200
void init(InitContext& initContext)
227201
{
228-
selectorPion.setRangePtTpc(selectionsPid.ptPidTpcMin, selectionsPid.ptPidTpcMax);
229-
selectorPion.setRangeNSigmaTpc(-selectionsPid.nSigmaTpcPiMax, selectionsPid.nSigmaTpcPiMax);
230-
selectorPion.setRangeNSigmaTpcCondTof(-selectionsPid.nSigmaTpcPiCombinedMax, selectionsPid.nSigmaTpcPiCombinedMax);
231-
selectorPion.setRangePtTof(selectionsPid.ptPidTofMin, selectionsPid.ptPidTofMax);
232-
selectorPion.setRangeNSigmaTof(-selectionsPid.nSigmaTofPiMax, selectionsPid.nSigmaTofPiMax);
233-
selectorPion.setRangeNSigmaTofCondTpc(-selectionsPid.nSigmaTofPiCombinedMax, selectionsPid.nSigmaTofPiCombinedMax);
234-
235-
selectorProton.setRangePtTpc(selectionsPid.ptPidTpcMin, selectionsPid.ptPidTpcMax);
236-
selectorProton.setRangeNSigmaTpc(-selectionsPid.nSigmaTpcPrMax, selectionsPid.nSigmaTpcPrMax);
237-
selectorProton.setRangeNSigmaTpcCondTof(-selectionsPid.nSigmaTpcPrCombinedMax, selectionsPid.nSigmaTpcPrCombinedMax);
238-
selectorProton.setRangePtTof(selectionsPid.ptPidTofMin, selectionsPid.ptPidTofMax);
239-
selectorProton.setRangeNSigmaTof(-selectionsPid.nSigmaTofPrMax, selectionsPid.nSigmaTofPrMax);
240-
selectorProton.setRangeNSigmaTofCondTpc(-selectionsPid.nSigmaTofPrCombinedMax, selectionsPid.nSigmaTofPrCombinedMax);
241-
242202
selectorElectron.setRangePtTpc(selectionsPid.ptPidTpcMin, selectionsPid.ptPidTpcMax);
243-
selectorElectron.setRangeNSigmaTpc(-selectionsPid.nSigmaTpcElMax, selectionsPid.nSigmaTpcElMax);
244-
selectorElectron.setRangeNSigmaTpcCondTof(-selectionsPid.nSigmaTofElCombinedMax, selectionsPid.nSigmaTofElCombinedMax);
245-
selectorElectron.setRangePtTof(selectionsPid.ptPidTofMin, selectionsPid.ptPidTofMax);
246-
selectorElectron.setRangeNSigmaTof(-selectionsPid.nSigmaTofElMax, selectionsPid.nSigmaTofElMax);
247-
selectorElectron.setRangeNSigmaTofCondTpc(-selectionsPid.nSigmaTofElCombinedMax, selectionsPid.nSigmaTofElCombinedMax);
203+
selectorElectron.setRangeNSigmaTpc(selectionsPid.nSigmaTpcElMinForVeto, selectionsPid.nSigmaTpcElMaxForVeto);
248204

249205
std::array<int, 4> doProcess = {doprocessJpsiKData, doprocessJpsiKMc, doprocessJpsiPhiData, doprocessJpsiPhiMc};
250206
if (std::accumulate(doProcess.begin(), doProcess.end(), 0) != 1) {
@@ -359,7 +315,7 @@ struct HfDataCreatorJpsiHadReduced {
359315
bool selectionTopol(const T1& candidate, const T2& trackPos, const T2& trackNeg)
360316
{
361317
auto candpT = candidate.pt();
362-
auto candInvMass = runJpsiToee ? HfHelper::invMassJpsiToEE(candidate) : HfHelper::invMassJpsiToMuMu(candidate);
318+
auto candInvMass = HfHelper::invMassJpsiToMuMu(candidate);
363319
auto pseudoPropDecLen = candidate.decayLengthXY() * candInvMass / candpT;
364320
auto pTBin = findBin(binsPt, candpT);
365321
if (pTBin == -1) {
@@ -444,23 +400,11 @@ struct HfDataCreatorJpsiHadReduced {
444400
template <typename T1>
445401
bool isSelectedJpsiDauPid(const T1& track)
446402
{
447-
int pidPion = -1;
448-
int pidProton = -1;
449403
int pidElectron = -1;
450404

451-
if (selectionsPid.usePidTpcAndTof) {
452-
pidPion = selectorPion.statusTpcAndTof(track, track.tpcNSigmaPi(), track.tofNSigmaPi());
453-
pidProton = selectorProton.statusTpcAndTof(track, track.tpcNSigmaPr(), track.tofNSigmaPr());
454-
pidElectron = selectorElectron.statusTpcAndTof(track, track.tpcNSigmaEl(), track.tofNSigmaEl());
455-
} else {
456-
pidPion = selectorPion.statusTpcOrTof(track, track.tpcNSigmaPi(), track.tofNSigmaPi());
457-
pidProton = selectorProton.statusTpcOrTof(track, track.tpcNSigmaPr(), track.tofNSigmaPr());
458-
pidElectron = selectorElectron.statusTpcOrTof(track, track.tpcNSigmaEl(), track.tofNSigmaEl());
459-
}
405+
pidElectron = selectorElectron.statusTpc(track, track.tpcNSigmaEl());
460406

461-
if (pidPion == TrackSelectorPID::Rejected ||
462-
pidProton == TrackSelectorPID::Rejected ||
463-
pidElectron == TrackSelectorPID::Rejected) {
407+
if (pidElectron == TrackSelectorPID::Accepted) {
464408
return false;
465409
}
466410
return true;
@@ -530,18 +474,10 @@ struct HfDataCreatorJpsiHadReduced {
530474
if constexpr (DecChannel == DecayChannel::BplusToJpsiK) {
531475
// B+ → J/Psi K+ → (µ+µ-) K+
532476
int indexRec = -1;
533-
if (!runJpsiToee) {
534-
indexRec = RecoDecay::getMatchedMCRec<true, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, Pdg::kBPlus, std::array{-kMuonMinus, +kMuonMinus, +kKPlus}, true, &sign, 3);
535-
} else {
536-
indexRec = RecoDecay::getMatchedMCRec<true, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, Pdg::kBPlus, std::array{-kElectron, +kElectron, +kKPlus}, true, &sign, 3);
537-
}
477+
indexRec = RecoDecay::getMatchedMCRec<true, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2]}, Pdg::kBPlus, std::array{-kMuonMinus, +kMuonMinus, +kKPlus}, true, &sign, 3);
538478
if (indexRec > -1) {
539479
// J/Psi → µ+µ-
540-
if (!runJpsiToee) {
541-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1]}, Pdg::kJPsi, std::array{-kMuonMinus, +kMuonMinus}, true);
542-
} else {
543-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1]}, Pdg::kJPsi, std::array{-kElectron, +kElectron}, true);
544-
}
480+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1]}, Pdg::kJPsi, std::array{-kMuonMinus, +kMuonMinus}, true);
545481
if (indexRec > -1) {
546482
flag = sign * o2::hf_decay::hf_cand_beauty::BplusToJpsiK;
547483
} else {
@@ -560,18 +496,10 @@ struct HfDataCreatorJpsiHadReduced {
560496
} else if constexpr (DecChannel == DecayChannel::BsToJpsiPhi) {
561497
// Bs → J/Psi phi → (µ+µ-) (K+K-)
562498
int indexRec = -1;
563-
if (!runJpsiToee) {
564-
indexRec = RecoDecay::getMatchedMCRec<true, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kBS, std::array{-kMuonMinus, +kMuonMinus, +kKPlus, -kKPlus}, true, &sign, 4);
565-
} else {
566-
indexRec = RecoDecay::getMatchedMCRec<true, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kBS, std::array{-kElectron, +kElectron, +kKPlus, -kKPlus}, true, &sign, 4);
567-
}
499+
indexRec = RecoDecay::getMatchedMCRec<true, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1], vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kBS, std::array{-kMuonMinus, +kMuonMinus, +kKPlus, -kKPlus}, true, &sign, 4);
568500
if (indexRec > -1) {
569501
// J/Psi → µ+µ-
570-
if (!runJpsiToee) {
571-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1]}, Pdg::kJPsi, std::array{-kMuonMinus, +kMuonMinus}, true, &sign, 1);
572-
} else {
573-
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1]}, Pdg::kJPsi, std::array{-kElectron, +kElectron}, true, &sign, 1);
574-
}
502+
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[0], vecDaughtersB[1]}, Pdg::kJPsi, std::array{-kMuonMinus, +kMuonMinus}, true, &sign, 1);
575503
if (indexRec > -1) {
576504
flag = sign * o2::hf_decay::hf_cand_beauty::BsToJpsiKK;
577505
indexRec = RecoDecay::getMatchedMCRec<false, false, false, true, true>(particlesMc, std::array{vecDaughtersB[2], vecDaughtersB[3]}, Pdg::kPhi, std::array{-kKPlus, +kKPlus}, true, &sign, 1);
@@ -639,15 +567,8 @@ struct HfDataCreatorJpsiHadReduced {
639567
// Match J/Psi -> µ+µ-
640568
auto candJpsiMC = particlesMc.rawIteratorAt(particle.daughtersIds().front());
641569
// Printf("Checking J/Psi -> µ+µ-");
642-
if (!runJpsiToee) {
643-
if (RecoDecay::isMatchedMCGen(particlesMc, candJpsiMC, static_cast<int>(Pdg::kJPsi), std::array{-kMuonMinus, +kMuonMinus}, true)) {
644-
flag = sign * o2::hf_decay::hf_cand_beauty::BplusToJpsiK;
645-
}
646-
} else { // debug
647-
// Printf("Checking J/Psi -> e+e-");
648-
if (RecoDecay::isMatchedMCGen(particlesMc, candJpsiMC, static_cast<int>(Pdg::kJPsi), std::array{-kElectron, +kElectron}, true)) {
649-
flag = sign * o2::hf_decay::hf_cand_beauty::BplusToJpsiK;
650-
}
570+
if (RecoDecay::isMatchedMCGen(particlesMc, candJpsiMC, static_cast<int>(Pdg::kJPsi), std::array{-kMuonMinus, +kMuonMinus}, true)) {
571+
flag = sign * o2::hf_decay::hf_cand_beauty::BplusToJpsiK;
651572
}
652573
}
653574

@@ -680,9 +601,8 @@ struct HfDataCreatorJpsiHadReduced {
680601
auto candJpsiMC = particlesMc.rawIteratorAt(particle.daughtersIds().front());
681602
auto candPhiMC = particlesMc.rawIteratorAt(particle.daughtersIds().back());
682603
// Printf("Checking J/Psi -> µ+µ- and phi -> K+K-");
683-
if (runJpsiToee && RecoDecay::isMatchedMCGen(particlesMc, candJpsiMC, static_cast<int>(Pdg::kJPsi), std::array{-kElectron, +kElectron}, true)) {
604+
if (RecoDecay::isMatchedMCGen(particlesMc, candJpsiMC, static_cast<int>(Pdg::kJPsi), std::array{-kMuonMinus, +kMuonMinus}, true)) {
684605
flag = sign * o2::hf_decay::hf_cand_beauty::BsToJpsiKK;
685-
} else if (!runJpsiToee && RecoDecay::isMatchedMCGen(particlesMc, candJpsiMC, static_cast<int>(Pdg::kJPsi), std::array{-kMuonMinus, +kMuonMinus}, true)) {
686606
flag = sign * o2::hf_decay::hf_cand_beauty::BsToJpsiKK;
687607
}
688608
// Check phi -> K+K-
@@ -776,7 +696,7 @@ struct HfDataCreatorJpsiHadReduced {
776696
// Apply the selections on the J/Psi candidates
777697
registry.fill(HIST("hSelectionsJpsi"), 1, candidate.pt());
778698

779-
if (!(candidate.hfflag() & (1 << (runJpsiToee ? aod::hf_cand_2prong::DecayType::JpsiToEE : aod::hf_cand_2prong::DecayType::JpsiToMuMu)))) {
699+
if (!(candidate.hfflag() & (1 << aod::hf_cand_2prong::DecayType::JpsiToMuMu))) {
780700
continue;
781701
}
782702
registry.fill(HIST("hSelectionsJpsi"), 2 + aod::SelectionStep::RecoSkims, candidate.pt());
@@ -829,7 +749,7 @@ struct HfDataCreatorJpsiHadReduced {
829749
registry.fill(HIST("hSelectionsJpsi"), 2 + aod::SelectionStep::RecoPID, candidate.pt());
830750

831751
int const indexHfCandJpsi = hfJpsi.lastIndex() + 1;
832-
float const invMassJpsi = runJpsiToee ? HfHelper::invMassJpsiToEE(candidate) : HfHelper::invMassJpsiToMuMu(candidate);
752+
float const invMassJpsi = HfHelper::invMassJpsiToMuMu(candidate);
833753
registry.fill(HIST("hMassJpsi"), invMassJpsi);
834754
registry.fill(HIST("hPtJpsi"), candidate.pt());
835755
registry.fill(HIST("hCpaJpsi"), candidate.cpa());
@@ -1053,11 +973,7 @@ struct HfDataCreatorJpsiHadReduced {
1053973
} // kaon loop
1054974
if (fillHfCandJpsi) { // fill Jpsi table only once per Jpsi candidate
1055975
double invMassJpsi{0.};
1056-
if (runJpsiToee) {
1057-
invMassJpsi = HfHelper::invMassJpsiToEE(candidate);
1058-
} else {
1059-
invMassJpsi = HfHelper::invMassJpsiToMuMu(candidate);
1060-
}
976+
invMassJpsi = HfHelper::invMassJpsiToMuMu(candidate);
1061977
hfJpsi(trackPos.globalIndex(), trackNeg.globalIndex(),
1062978
indexHfReducedCollision,
1063979
candidate.xSecondaryVertex(), candidate.ySecondaryVertex(), candidate.zSecondaryVertex(),

0 commit comments

Comments
 (0)