Skip to content

Commit 3b6c927

Browse files
authored
PWGHF: Improve debugging logs (#3461)
* Remove Printf * Replace Printf with LOGF
1 parent 3010c70 commit 3b6c927

30 files changed

+49
-135
lines changed

PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ struct HfCandidateCreatorChicMc {
265265

266266
// Match generated particles.
267267
for (const auto& particle : mcParticles) {
268-
// Printf("New gen. candidate");
269268
flag = 0;
270269
origin = 0;
271270
channel = 0;

PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,6 @@ struct HfCandidateCreatorXMc {
277277

278278
// Match reconstructed candidates.
279279
for (const auto& candidate : candidates) {
280-
// Printf("New rec. candidate");
281280
flag = 0;
282281
origin = 0;
283282
channel = 0;
@@ -290,18 +289,22 @@ struct HfCandidateCreatorXMc {
290289
daughterPosJpsi,
291290
daughterNegJpsi};
292291

293-
// X → J/ψ π+ π-
294-
// Printf("Checking X → J/ψ π+ π-");
292+
// X → J/ψ π+ π−
293+
294+
// J/ψ → e+ e−
295295
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kElectron, -kElectron}, true);
296+
// X → π+ π− e+ e−
296297
if (indexRec > -1) {
297298
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kElectron, -kElectron}, true, &sign, 2);
298299
if (indexRec > -1) {
299300
flag = 1 << hf_cand_x::DecayType::XToJpsiToEEPiPi;
300301
}
301302
}
302303

304+
// J/ψ → μ+ μ−
303305
if (flag == 0) {
304306
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayJpsiDaughters, pdg::Code::kJPsi, std::array{+kMuonPlus, -kMuonPlus}, true);
307+
// X → π+ π− μ+ μ−
305308
if (indexRec > -1) {
306309
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, pdgCodeX, std::array{+kPiPlus, -kPiPlus, +kMuonPlus, -kMuonPlus}, true, &sign, 2);
307310
if (indexRec > -1) {
@@ -321,22 +324,21 @@ struct HfCandidateCreatorXMc {
321324

322325
// Match generated particles.
323326
for (const auto& particle : mcParticles) {
324-
// Printf("New gen. candidate");
325327
flag = 0;
326328
origin = 0;
327329
channel = 0;
328330

329-
// X → J/ψ π+ π-
330-
// Printf("Checking X → J/ψ π+ π-");
331+
// X → J/ψ π+ π−
331332
if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdgCodeX, std::array{pdgCodeJpsi, +kPiPlus, -kPiPlus}, true)) {
332-
// Match J/psi --> e+e-
333333
std::vector<int> arrDaughter;
334334
RecoDecay::getDaughters(particle, &arrDaughter, std::array{pdgCodeJpsi}, 1);
335335
auto jpsiCandMC = mcParticles.rawIteratorAt(arrDaughter[0]);
336+
// J/ψ → e+ e−
336337
if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, pdgCodeJpsi, std::array{+kElectron, -kElectron}, true)) {
337338
flag = 1 << hf_cand_x::DecayType::XToJpsiToEEPiPi;
338339
}
339340

341+
// J/ψ → μ+ μ−
340342
if (flag == 0) {
341343
if (RecoDecay::isMatchedMCGen(mcParticles, jpsiCandMC, pdgCodeJpsi, std::array{+kMuonPlus, -kMuonPlus}, true)) {
342344
flag = 1 << hf_cand_x::DecayType::XToJpsiToMuMuPiPi;

PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ struct HfCandidateSelectorChicToJpsiGamma {
7777

7878
auto mchic = RecoDecay::getMassPDG(20443); // chi_c1(1p)
7979
if (std::abs(invMassChicToJpsiGamma(hfCandChic) - mchic) > cuts->get(pTBin, "m")) {
80-
// Printf("Chic topol selection failed at mass diff check");
80+
// LOGF(debug, "Chic topol selection failed at mass diff check");
8181
return false; // check that mass difference is within bounds
8282
}
8383

@@ -224,7 +224,7 @@ struct HfCandidateSelectorChicToJpsiGamma {
224224
}
225225

226226
hfSelChicToJpsiGammaCandidate(selJpsiToEE, selJpsiToMuMu);
227-
// Printf("Chi_c candidate selection successful, candidate should be selected");
227+
// LOGF(debug, "Chi_c candidate selection successful, candidate should be selected");
228228
}
229229
}
230230
};

PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,23 @@ struct HfCandidateSelectorXToJpsiPiPi {
7373
auto candpT = hfCandX.pt();
7474
int pTBin = findBin(binsPt, candpT);
7575
if (pTBin == -1) {
76-
// Printf("X topol selection failed at getpTBin");
76+
// LOGF(debug, "X topol selection failed at getpTBin");
7777
return false;
7878
}
7979

8080
if (candpT < ptCandMin || candpT >= ptCandMax) {
81-
// Printf("X topol selection failed at cand pT check");
81+
// LOGF(debug, "X topol selection failed at cand pT check");
8282
return false; // check that the candidate pT is within the analysis range
8383
}
8484

8585
// TODO: replace hardcoded mass with "RecoDecay::getMassPDG(9920443)"
8686
if (std::abs(invMassXToJpsiPiPi(hfCandX) - 3.87168) > cuts->get(pTBin, "m")) {
87-
// Printf("X topol selection failed at mass diff check");
87+
// LOGF(debug, "X topol selection failed at mass diff check");
8888
return false; // check that mass difference is within bounds
8989
}
9090

9191
if ((hfCandJpsi.pt() < cuts->get(pTBin, "pT Jpsi")) || (trackNeg.pt() < cuts->get(pTBin, "pT Pi")) || (trackPos.pt() < cuts->get(pTBin, "pT Pi"))) {
92-
// Printf("X topol selection failed at daughter pT check");
92+
// LOGF(debug, "X topol selection failed at daughter pT check");
9393
return false; // cut on daughter pT
9494
}
9595

@@ -219,7 +219,7 @@ struct HfCandidateSelectorXToJpsiPiPi {
219219
// daughter track validity selection
220220
if (!daughterSelection(trackPos) || !daughterSelection(trackNeg)) {
221221
hfSelXToJpsiPiPiCandidate(0, 0);
222-
// Printf("X candidate selection failed at daughter selection");
222+
// LOGF(debug, "X candidate selection failed at daughter selection");
223223
continue;
224224
}
225225

@@ -228,18 +228,18 @@ struct HfCandidateSelectorXToJpsiPiPi {
228228

229229
if (!selectionTopol(hfCandX, candJpsi, trackPos, trackNeg)) {
230230
hfSelXToJpsiPiPiCandidate(0, 0);
231-
// Printf("X candidate selection failed at selection topology");
231+
// LOGF(debug, "X candidate selection failed at selection topology");
232232
continue;
233233
}
234234

235235
if (selectionPID(trackPos) == 0 || selectionPID(trackNeg) == 0) {
236236
hfSelXToJpsiPiPiCandidate(0, 0);
237-
// Printf("X candidate selection failed at selection PID");
237+
// LOGF(debug, "X candidate selection failed at selection PID");
238238
continue;
239239
}
240240

241241
hfSelXToJpsiPiPiCandidate(selJpsiToEE, selJpsiToMuMu);
242-
// Printf("X candidate selection successful, candidate should be selected");
242+
// LOGF(debug, "X candidate selection successful, candidate should be selected");
243243
}
244244
}
245245
};

PWGHF/ALICE3/Tasks/taskChic.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ struct HfTaskChicMc {
155155
aod::TracksWMc const& tracks)
156156
{
157157
// MC rec.
158-
// Printf("MC Candidates: %d", candidates.size());
159158
int decayMode = modeChicToJpsiToMuMuGamma ? hf_cand_chic::DecayType::ChicToJpsiToMuMuGamma : hf_cand_chic::DecayType::ChicToJpsiToEEGamma;
160159
for (const auto& candidate : candidates) {
161160
if (!(candidate.hfflag() & 1 << decayMode)) {
@@ -199,12 +198,10 @@ struct HfTaskChicMc {
199198
}
200199
} // rec
201200
// MC gen.
202-
// Printf("MC Particles: %d", mcParticles.size());
203201
for (const auto& particle : mcParticles) {
204202
if (particle.flagMcMatchGen() == 1 << decayMode) {
205203
auto mchic = RecoDecay::getMassPDG(pdg::Code::kChiC1); // chi_c1(1p)
206204
if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, mchic)) > yCandMax) {
207-
// Printf("MC Gen.: Y rejection: %g", RecoDecay::Y(std::array{particle.px(), particle.py(), particle.pz()}, 3.87168));
208205
continue;
209206
}
210207

PWGHF/ALICE3/Tasks/taskJpsi.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ struct HfTaskJpsiMc {
196196
aod::TracksWMc const& tracks)
197197
{
198198
// MC rec.
199-
// Printf("MC Candidates: %d", candidates.size());
200199
int decayMode = modeJpsiToMuMu ? DecayType::JpsiToMuMu : DecayType::JpsiToEE;
201200

202201
for (const auto& candidate : candidates) {
@@ -274,7 +273,6 @@ struct HfTaskJpsiMc {
274273
}
275274
}
276275
// MC gen.
277-
// Printf("MC Particles: %d", mcParticles.size());
278276
for (const auto& particle : mcParticles) {
279277
if (particle.flagMcMatchGen() == 1 << decayMode) {
280278
if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, RecoDecay::getMassPDG(particle.pdgCode()))) > yCandMax) {

PWGHF/ALICE3/Tasks/taskX.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ struct HfTaskXMc {
159159
aod::TracksWMc const& tracks)
160160
{
161161
// MC rec.
162-
// Printf("MC Candidates: %d", candidates.size());
163162
int decayMode = modeXToJpsiToMuMuPiPi ? hf_cand_x::DecayType::XToJpsiToMuMuPiPi : hf_cand_x::DecayType::XToJpsiToEEPiPi;
164163
for (const auto& candidate : candidates) {
165164
if (!(candidate.hfflag() & 1 << decayMode)) {
@@ -206,12 +205,10 @@ struct HfTaskXMc {
206205
}
207206
} // rec
208207
// MC gen.
209-
// Printf("MC Particles: %d", mcParticles.size());
210208
for (const auto& particle : mcParticles) {
211209
if (particle.flagMcMatchGen() == 1 << decayMode) {
212210
// TODO: add X(3872) mass such that we can use the getMassPDG function instead of hardcoded mass
213211
if (yCandMax >= 0. && std::abs(RecoDecay::y(std::array{particle.px(), particle.py(), particle.pz()}, 3.87168)) > yCandMax) {
214-
// Printf("MC Gen.: Y rejection: %g", RecoDecay::Y(std::array{particle.px(), particle.py(), particle.pz()}, 3.87168));
215212
continue;
216213
}
217214
registry.fill(HIST("hPtGen"), particle.pt());

PWGHF/D2H/TableProducer/dataCreatorD0PiReduced.cxx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ struct HfDataCreatorD0PiReduced {
160160
}
161161
// reject pion not compatible with D0/D0bar hypothesis
162162
if (!((candD0.isSelD0() >= selectionFlagD0 && trackPion.sign() < 0) || (candD0.isSelD0bar() >= selectionFlagD0bar && trackPion.sign() > 0))) {
163-
// Printf("D0: %d, D0bar%d, sign: %d", candD0.isSelD0(), candD0.isSelD0bar(), track.sign());
163+
// LOGF(debug, "D0: %d, D0bar%d, sign: %d", candD0.isSelD0(), candD0.isSelD0bar(), track.sign());
164164
return false;
165165
}
166166
// reject pions that are D daughters
@@ -397,11 +397,9 @@ struct HfDataCreatorD0PiReducedMc {
397397
candD0.prong1_as<aod::TracksWMc>(),
398398
trackPion.track_as<aod::TracksWMc>()};
399399
// B+ → D0(bar) π+ → (K+ π-) π+
400-
// Printf("Checking B+ → D0bar π+");
401400
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersBplus, pdg::Code::kBPlus, std::array{+kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2);
402401
if (indexRec > -1) {
403402
// D0bar → K+ π-
404-
// Printf("Checking D0bar → K+ π-");
405403
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD0, pdg::Code::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign, 1);
406404
if (indexRec > -1) {
407405
flag = sign * BIT(hf_cand_bplus::DecayType::BplusToD0Pi);
@@ -418,14 +416,12 @@ struct HfDataCreatorD0PiReducedMc {
418416

419417
// Match generated particles.
420418
for (const auto& particle : mcParticles) {
421-
// Printf("New gen. candidate");
422419
flag = 0;
423420
origin = 0;
424421
// B+ → D0bar π+
425422
if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kBPlus, std::array{static_cast<int>(pdg::Code::kD0), +kPiPlus}, true)) {
426-
// Match D0bar -> π- K+
423+
// D0bar π- K+
427424
auto candD0MC = mcParticles.rawIteratorAt(particle.daughtersIds().front());
428-
// Printf("Checking D0bar -> π- K+");
429425
if (RecoDecay::isMatchedMCGen(mcParticles, candD0MC, static_cast<int>(pdg::Code::kD0), std::array{+kPiPlus, -kKPlus}, true, &sign)) {
430426
flag = sign * BIT(hf_cand_bplus::DecayType::BplusToD0Pi);
431427
}

PWGHF/D2H/TableProducer/dataCreatorDplusPiReduced.cxx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,9 @@ struct HfDataCreatorDplusPiReducedMc {
405405
candD.prong2_as<aod::TracksWMc>(),
406406
trackPion.track_as<aod::TracksWMc>()};
407407
// B0 → D- π+ → (π- K+ π-) π+
408-
// Printf("Checking B0 → D- π+");
409408
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersB0, pdg::Code::kB0, std::array{-kPiPlus, +kKPlus, -kPiPlus, +kPiPlus}, true, &sign, 2);
410409
if (indexRec > -1) {
411410
// D- → π- K+ π-
412-
// Printf("Checking D- → π- K+ π-");
413411
indexRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughtersD, pdg::Code::kDMinus, std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign, 2);
414412
if (indexRec > -1) {
415413
flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi);
@@ -427,14 +425,12 @@ struct HfDataCreatorDplusPiReducedMc {
427425

428426
// Match generated particles.
429427
for (const auto& particle : mcParticles) {
430-
// Printf("New gen. candidate");
431428
flag = 0;
432429
origin = 0;
433430
// B0 → D- π+
434431
if (RecoDecay::isMatchedMCGen(mcParticles, particle, pdg::Code::kB0, std::array{-static_cast<int>(pdg::Code::kDPlus), +kPiPlus}, true)) {
435-
// Match D- -> π- K+ π-
432+
// D- π- K+ π-
436433
auto candDMC = mcParticles.rawIteratorAt(particle.daughtersIds().front());
437-
// Printf("Checking D- -> π- K+ π-");
438434
if (RecoDecay::isMatchedMCGen(mcParticles, candDMC, -static_cast<int>(pdg::Code::kDPlus), std::array{-kPiPlus, +kKPlus, -kPiPlus}, true, &sign)) {
439435
flag = sign * BIT(hf_cand_b0::DecayType::B0ToDPi);
440436
}

PWGHF/D2H/Tasks/taskB0.cxx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ struct HfTaskB0 {
264264
} // rec
265265

266266
// MC gen. level
267-
// Printf("MC Particles: %d", mcParticles.size());
268267
for (const auto& particle : mcParticles) {
269268
if (TESTBIT(std::abs(particle.flagMcMatchGen()), hf_cand_b0::DecayType::B0ToDPi)) {
270269

0 commit comments

Comments
 (0)