Skip to content

Commit 70ae48d

Browse files
mapalharesalibuild
andauthored
[PWGLF/NuSpEx] Changed track selection: nTPCClus -> ntpcNClsCrossedRows and fix EvtSel (#15345)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 9db8942 commit 70ae48d

File tree

1 file changed

+69
-62
lines changed

1 file changed

+69
-62
lines changed

PWGLF/TableProducer/Nuspex/lnnRecoTask.cxx

Lines changed: 69 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ std::shared_ptr<TH2> h2FT0CnClusTPCtoTrBfSel;
8787
std::shared_ptr<TH2> h2FT0CnClusTPCtoPiBfSel;
8888
std::shared_ptr<TH2> h2FT0Cchi2NClTPCtoTrBfSel;
8989
std::shared_ptr<TH2> h2FT0Cchi2NClITStoTrBfSel;
90+
std::shared_ptr<TH2> h2FT0CnTPCNClsCrossedRows3HBfSel;
91+
std::shared_ptr<TH2> h2FT0CnTPCNClsCrossedRowsPiBfSel;
9092
// QA ITS-TPC and ITS-TPC-TOF track signals
9193
std::shared_ptr<TH2> h2FT0CptTrBfSelItsTpc;
9294
std::shared_ptr<TH2> h2FT0CptTrBfSelItsTpcTof;
@@ -101,14 +103,9 @@ std::shared_ptr<TH2> hPtTrkItsTpcTofTrStr;
101103
std::shared_ptr<TH2> hPtItsTpcPiStr;
102104
std::shared_ptr<TH2> hPtTrkItsTpcPiStr;
103105
// QA reco generated candidate and daugher particles from secondary vertex
104-
std::shared_ptr<TH2> h2FT0CPtGenColRecoGenCandMC;
105-
std::shared_ptr<TH2> h2FT0CPtGenColRecoGenTrStrMC;
106-
std::shared_ptr<TH2> h2FT0CPtGenColRecoGenPiStrMC;
107-
std::shared_ptr<TH2> h2FT0CPtRecColRecoGenCandMC;
108-
std::shared_ptr<TH2> h2FT0CPtRecColRecoGenTrStrMC;
109-
std::shared_ptr<TH2> h2FT0CPtRecColRecoGenPiStrMC;
110-
std::shared_ptr<TH2> h2FT0CPtRecColRecoTrStrMC;
111-
std::shared_ptr<TH2> h2FT0CPtRecColRecoPiStrMC;
106+
std::shared_ptr<TH2> h2FT0CPtGenColRecCandMC;
107+
std::shared_ptr<TH2> h2FT0CPtGenColRecTrStrMC;
108+
std::shared_ptr<TH2> h2FT0CPtGenColRecPiStrMC;
112109
// QA signal generated candidate and daugher particles from secondary vertex
113110
std::shared_ptr<TH2> h2FT0CPtGenColGenCandMC;
114111
std::shared_ptr<TH2> h2FT0CPtGenColGenTrStrMC;
@@ -200,13 +197,16 @@ struct lnnRecoTask {
200197
Configurable<float> tpcRigidityMin3H{"tpcRigidityMin3H", 0.2, "Minimum rigidity of the triton candidate"};
201198
Configurable<float> nSigmaCutMinTPC{"nSigmaCutMinTPC", -5, "triton dEdx cut (n sigma)"};
202199
Configurable<float> nSigmaCutMaxTPC{"nSigmaCutMaxTPC", 5, "triton dEdx cut (n sigma)"};
200+
Configurable<float> nTPCNClsCrossedRows3H{"nTPCNClsCrossedRows3H", 80, "Number of crossed TPC Rows for triton"};
201+
Configurable<float> nTPCNClsCrossedRowsPi{"nTPCNClsCrossedRowsPi", 80, "Number of crossed TPC Rows for pions"};
203202
Configurable<float> nTPCClusMin3H{"nTPCClusMin3H", 80, "triton NTPC clusters cut"};
204203
Configurable<float> nTPCClusMinPi{"nTPCClusMinPi", 60, "pion NTPC clusters cut"};
205204
Configurable<float> ptMinTOF{"ptMinTOF", 0.8, "minimum pt for TOF cut"};
206205
Configurable<float> trTOFMass2Cut{"trTOFMass2Cut", 5.5, "minimum Triton mass square to TOF"};
207206
Configurable<float> betaTrTOF{"betaTrTOF", 0.4, "minimum beta TOF cut"};
208207
Configurable<bool> mcSignalOnly{"mcSignalOnly", true, "If true, save only signal in MC"};
209-
Configurable<bool> doTrackQA{"doTrackQA", true, "If true, compute the QA studies beased on detectors (ITS-TPC-TOF) signals"};
208+
Configurable<bool> doTrackQA{"doTrackQA", true, "if true, compute the QA studies beased on detectors (ITS-TPC-TOF) signals"};
209+
Configurable<bool> useNoSameBunchPileup{"useNoSameBunchPileup", false, "reject collisions in case of pileup with another collision in the same foundBC"};
210210

211211
// Define o2 fitter, 2-prong, active memory (no need to redefine per event)
212212
o2::vertexing::DCAFitterN<2> fitter;
@@ -247,6 +247,7 @@ struct lnnRecoTask {
247247
ConfigurableAxis betaBins{"betaBins", {550, 0.f, 1.1f}, "Binning for Beta"};
248248
ConfigurableAxis dcaXYBins{"dcaXYBins", {550, -5.f, 5.f}, "Binning for dcaXY triton"};
249249
ConfigurableAxis tpcNClusBins{"tpcNClusBins", {260, 30, 165}, "Binning for nClusTPC"};
250+
ConfigurableAxis tpcNClsCrossedRowsBins{"TPCNClsCrossedRowsBins", {260, 30, 165}, "Binning for TPCNClsCrossedRows"};
250251
ConfigurableAxis tpcChi2NClusBins{"tpcChi2NClusBins", {20, 0.5, 10}, "Binning for chi2NClusTPC"};
251252
ConfigurableAxis itsChi2NClusBins{"itsChi2NClusBins", {72, 0, 36}, "Binning for chi2NClusTPC"};
252253
ConfigurableAxis candPtBins{"candPtBins", {160, 0, 8}, "Binning for lnn cand pt"};
@@ -302,6 +303,7 @@ struct lnnRecoTask {
302303
const AxisSpec betaAxis{betaBins, "#beta_{TOF}"};
303304
const AxisSpec dcaXYAxis(dcaXYBins, "DCA_{xy} ({}^{3}H (cm)");
304305
const AxisSpec tpcNClusAxis(tpcNClusBins, "N_{clus}^{TPC}");
306+
const AxisSpec tpcNClsCrossedRowsAxis(tpcNClsCrossedRowsBins, "N_{TPC} crossed rows");
305307
const AxisSpec tpcChi2NClusAxis(tpcChi2NClusBins, "{#Chi}^{2}/N_{clus}^{TPC}");
306308
const AxisSpec itsChi2NClusAxis(itsChi2NClusBins, "{#Chi}^{2}/N_{clus}^{ITS}");
307309
const AxisSpec candPtAxis(candPtBins, "#it{p}_{T} (Gev/#it{c})");
@@ -315,16 +317,18 @@ struct lnnRecoTask {
315317
hdEdxTot = qaRegistry.add<TH2>("hdEdxTot", ";p_{TPC}/z (GeV/#it{c}); dE/dx", HistType::kTH2F, {rigidityAxis, dEdxAxis});
316318
h3HMassPtTOF = qaRegistry.add<TH2>("PID/hTrMassPtTOF", "; #it{p}_{T} ({}^{3}H) (GeV/#it{c}); #frac{m^{2}}{z^{2}} (GeV^{2}/#it{c}^{4})", HistType::kTH2F, {tPtAxis, mTOFAxis});
317319
h3HSignalPtTOF = qaRegistry.add<TH2>("PID/h3HSignalPtTOF", "; #it{p}_{T}({}^{3}H) (GeV/#it{c}); #beta_{TOF}", HistType::kTH2F, {tPtAxis, betaAxis});
318-
hEvents = qaRegistry.add<TH1>("hEvents", ";Events; ", HistType::kTH1D, {{3, -0.5, 2.5}});
320+
hEvents = qaRegistry.add<TH1>("hEvents", ";Events; ", HistType::kTH1D, {{4, -0.5, 3.5}});
319321
hLnnCandLoss = qaRegistry.add<TH1>("CandCounts/hLnnCandLoss", ";CandLoss; ", HistType::kTH1D, {{7, -0.5, 6.5}});
320322
// QA its-tpc and its-tpc-tof tracks before selection
321323
h2FT0CnClusTPCtoTrBfSel = qaRegistry.add<TH2>("QATracks/h2FT0CnClusTPCtoTrBfSel", ";FT0C (%);N_{clus}^{TPC}", HistType::kTH2F, {centAxis, tpcNClusAxis});
322324
h2FT0CnClusTPCtoPiBfSel = qaRegistry.add<TH2>("QATracks/h2FT0CnClusTPCtoPiBfSel", ";FT0C (%);N_{clus}^{TPC}", HistType::kTH2F, {centAxis, tpcNClusAxis});
323325
h2FT0Cchi2NClTPCtoTrBfSel = qaRegistry.add<TH2>("QATracks/h2FT0Cchi2NClTPCtoTrBfSel", ";FT0C (%);{#Chi}^{2}/N_{clus}^{TPC} ", HistType::kTH2F, {centAxis, tpcChi2NClusAxis});
324326
h2FT0Cchi2NClITStoTrBfSel = qaRegistry.add<TH2>("QATracks/h2FT0Cchi2NClITStoTrBfSel", ";FT0C (%);{#Chi}^{2}/N_{clus}^{ITS}", HistType::kTH2F, {centAxis, itsChi2NClusAxis});
325-
h2FT0CptTrBfSelItsTpc = qaRegistry.add<TH2>("QATracks/h2FT0CptTrBfSelItsTpc", "; #it{p}_{T}({}^{3}H) (GeV/#it{c}); #beta_{TOF}", HistType::kTH2F, {centAxis, candPtBins});
326-
h2FT0CptTrBfSelItsTpcTof = qaRegistry.add<TH2>("QATracks/h2FT0CptTrBfSelItsTpcTof", "; #it{p}_{T}({}^{3}H) (GeV/#it{c}); #beta_{TOF}", HistType::kTH2F, {centAxis, candPtBins});
327-
h2FT0CptPiBfSelItsTpc = qaRegistry.add<TH2>("QATracks/h2FT0CptPiBfSelItsTpc", "; #it{p}_{T}({}^{3}H) (GeV/#it{c}); #beta_{TOF}", HistType::kTH2F, {centAxis, candPtBins});
327+
h2FT0CnTPCNClsCrossedRows3HBfSel = qaRegistry.add<TH2>("QATracks/h2FT0CnTPCNClsCrossedRows3H", ";FT0C (%);N_{TPC} crossed rows", HistType::kTH2F, {centAxis, tpcNClsCrossedRowsAxis});
328+
h2FT0CnTPCNClsCrossedRowsPiBfSel = qaRegistry.add<TH2>("QATracks/h2FT0CnTPCNClsCrossedRowsPi", ";FT0C (%);N_{TPC} crossed rows", HistType::kTH2F, {centAxis, tpcNClsCrossedRowsAxis});
329+
h2FT0CptTrBfSelItsTpc = qaRegistry.add<TH2>("QATracks/h2FT0CptTrBfSelItsTpc", ";FT0C (%);#it{p}_{T}", HistType::kTH2F, {centAxis, candPtBins});
330+
h2FT0CptTrBfSelItsTpcTof = qaRegistry.add<TH2>("QATracks/h2FT0CptTrBfSelItsTpcTof", ";FT0C (%);#it{p}_{T}", HistType::kTH2F, {centAxis, candPtBins});
331+
h2FT0CptPiBfSelItsTpc = qaRegistry.add<TH2>("QATracks/h2FT0CptPiBfSelItsTpc", ";FT0C (%);#it{p}_{T}", HistType::kTH2F, {centAxis, candPtBins});
328332
// QA its-tpc, its-tpc-tof, and generated MC
329333
hPtItsTpcTrStr = qaRegistry.add<TH2>("MC/McTracks/hPtItsTpcTrStr", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {{10, 0, 100}, {160, 0, 8}});
330334
hPtTrkItsTpcTrStr = qaRegistry.add<TH2>("MC/McTracks/hPtTrkItsTpcTrStr", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {{10, 0, 100}, {160, 0, 8}});
@@ -338,6 +342,7 @@ struct lnnRecoTask {
338342
hEvents->GetXaxis()->SetBinLabel(1, "All");
339343
hEvents->GetXaxis()->SetBinLabel(2, "sel8");
340344
hEvents->GetXaxis()->SetBinLabel(3, "z_{vtx}");
345+
hEvents->GetXaxis()->SetBinLabel(4, "NoSameBunchPileUp");
341346
hLnnCandLoss->GetYaxis()->SetTitle("#it{N}_{cand}");
342347
hLnnCandLoss->GetXaxis()->SetTitle("Cuts");
343348
hLnnCandLoss->GetXaxis()->SetBinLabel(1, "Initial");
@@ -349,19 +354,15 @@ struct lnnRecoTask {
349354
hLnnCandLoss->GetXaxis()->SetBinLabel(7, "cosPA");
350355
if (doprocessMC) {
351356
hDecayChannel = qaRegistry.add<TH1>("MC/hDecayChannel", ";Decay channel; ", HistType::kTH1D, {{2, -0.5, 1.5}});
352-
hDecayChannel->GetXaxis()->SetBinLabel(1, "2-body");
357+
hDecayChannel->GetXaxis()->SetBinLabel(1, "All");
358+
hDecayChannel->GetXaxis()->SetBinLabel(2, "2-body");
353359
hIsMatterGen = qaRegistry.add<TH1>("MC/hIsMatterGen", ";; ", HistType::kTH1D, {{2, -0.5, 1.5}});
354360
hIsMatterGen->GetXaxis()->SetBinLabel(1, "Matter");
355361
hIsMatterGen->GetXaxis()->SetBinLabel(2, "Antimatter");
356362
// QA for generated mother candidate and daughter particles
357-
h2FT0CPtGenColRecoGenCandMC = qaRegistry.add<TH2>("MC/QARecoGenSV/h2FT0CPtGenColRecoGenCandMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
358-
h2FT0CPtGenColRecoGenTrStrMC = qaRegistry.add<TH2>("MC/QARecoGenSV/h2FT0CPtGenColRecoGenTrStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
359-
h2FT0CPtGenColRecoGenPiStrMC = qaRegistry.add<TH2>("MC/QARecoGenSV/h2FT0CPtGenColRecoGenPiStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
360-
h2FT0CPtRecColRecoGenCandMC = qaRegistry.add<TH2>("MC/QARecoGenSV/h2FT0CPtRecColRecoGenCandMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
361-
h2FT0CPtRecColRecoGenTrStrMC = qaRegistry.add<TH2>("MC/QARecoGenSV/h2FT0CPtRecColRecoGenTrStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
362-
h2FT0CPtRecColRecoGenPiStrMC = qaRegistry.add<TH2>("MC/QARecoGenSV/h2FT0CPtRecColRecoGenPiStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
363-
h2FT0CPtRecColRecoTrStrMC = qaRegistry.add<TH2>("MC/QARecoGenSV/h2FT0CPtRecColRecoTrStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
364-
h2FT0CPtRecColRecoPiStrMC = qaRegistry.add<TH2>("MC/QARecoGenSV/h2FT0CPtRecColRecoPiStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
363+
h2FT0CPtGenColRecCandMC = qaRegistry.add<TH2>("MC/RecMcCol/h2FT0CPtGenColRecCandMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
364+
h2FT0CPtGenColRecTrStrMC = qaRegistry.add<TH2>("MC/RecMcCol/h2FT0CPtGenColRecTrStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
365+
h2FT0CPtGenColRecPiStrMC = qaRegistry.add<TH2>("MC/RecMcCol/h2FT0CPtGenColRecPiStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
365366
// QA signal generated candidate and daugher particles from secondary vertex
366367
h2FT0CPtGenColGenCandMC = qaRegistry.add<TH2>("MC/QASignalGenSV/h2FT0CPtGenColGenCandMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
367368
h2FT0CPtGenColGenTrStrMC = qaRegistry.add<TH2>("MC/QASignalGenSV/h2FT0CPtGenColGenTrStrMC", ";FT0C (%);#it{p}_{T} (GeV/#it{c})", HistType::kTH2F, {centAxis, candPtAxis});
@@ -484,6 +485,8 @@ struct lnnRecoTask {
484485
// fill QA track histogram studies to check track signal before selections
485486
h2FT0CnClusTPCtoTrBfSel->Fill(collision.centFT0C(), h3track.tpcNClsFound());
486487
h2FT0CnClusTPCtoPiBfSel->Fill(collision.centFT0C(), pitrack.tpcNClsFound());
488+
h2FT0CnTPCNClsCrossedRows3HBfSel->Fill(collision.centFT0C(), h3track.tpcNClsCrossedRows());
489+
h2FT0CnTPCNClsCrossedRowsPiBfSel->Fill(collision.centFT0C(), pitrack.tpcNClsCrossedRows());
487490
h2FT0Cchi2NClTPCtoTrBfSel->Fill(collision.centFT0C(), h3track.tpcChi2NCl());
488491
h2FT0Cchi2NClITStoTrBfSel->Fill(collision.centFT0C(), h3track.itsChi2NCl());
489492

@@ -503,11 +506,11 @@ struct lnnRecoTask {
503506
}
504507

505508
if (h3Rigidity < tpcRigidityMin3H ||
506-
h3track.tpcNClsFound() < nTPCClusMin3H ||
509+
h3track.tpcNClsCrossedRows() < nTPCNClsCrossedRows3H ||
507510
h3track.tpcChi2NCl() < chi2nClusTPCMin ||
508511
h3track.tpcChi2NCl() > chi2nClusTPCMax ||
509512
h3track.itsChi2NCl() > chi2nClusITS ||
510-
pitrack.tpcNClsFound() < nTPCClusMinPi) {
513+
pitrack.tpcNClsCrossedRows() < nTPCNClsCrossedRowsPi) {
511514
continue;
512515
}
513516

@@ -697,32 +700,31 @@ struct lnnRecoTask {
697700
if (!mcPart.has_mothers())
698701
return false;
699702

700-
bool motherIsAccepted = true;
703+
if (mcPart.getProcess() != 4)
704+
return false;
705+
706+
bool motherIsAccepted = false;
701707
auto mothers = mcPart.mothers_as<o2::aod::McParticles>();
702708
for (const auto& mother : mothers) {
703-
if (mcPart.getProcess() == 4) {
704-
motherIsAccepted = false;
705-
// só aceita se a mãe for um Lnn
706-
if (std::abs(mother.pdgCode()) == lnnPdg) {
707-
motherIsAccepted = true;
708-
}
709+
if (std::abs(mother.pdgCode()) == lnnPdg) {
710+
motherIsAccepted = true;
711+
break;
709712
}
710713
}
711714
return motherIsAccepted;
712715
}
713716

714717
template <class Tcoll>
715-
void fillMcHistograms(TracksFullMC::iterator const& mcTrack, aod::McParticles::iterator const& mc, bool motherIsAccepted, Tcoll const& collision)
718+
void fillMcHistograms(TracksFullMC::iterator const& mcTrack, aod::McParticles::iterator const& mc, Tcoll const& collision)
716719
{
717720

718721
bool passedTrackITS = mcTrack.hasITS();
719722
bool passedTrackTPC = mcTrack.hasTPC();
720723
bool passedTrackTOF = mcTrack.hasTOF();
721724

722-
if (!motherIsAccepted)
723-
return;
725+
int pdg = std::abs(mc.pdgCode());
724726

725-
if (std::abs(mc.pdgCode()) == h3DauPdg) {
727+
if (pdg == h3DauPdg) {
726728
hPtGeneratedTrStr->Fill(collision.centFT0C(), mc.pt());
727729

728730
if (passedTrackITS && passedTrackTPC) {
@@ -735,7 +737,7 @@ struct lnnRecoTask {
735737
}
736738
}
737739

738-
if (std::abs(mc.pdgCode()) == piDauPdg) {
740+
if (pdg == piDauPdg) {
739741
hPtGeneratedPiStr->Fill(collision.centFT0C(), mc.pt());
740742
if (passedTrackITS && passedTrackTPC) {
741743
hPtItsTpcPiStr->Fill(collision.centFT0C(), mc.pt());
@@ -761,6 +763,10 @@ struct lnnRecoTask {
761763
continue;
762764
}
763765
hEvents->Fill(2.);
766+
if (useNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
767+
continue;
768+
}
769+
hEvents->Fill(3.);
764770

765771
hZvtx->Fill(collision.posZ());
766772
hCentFT0A->Fill(collision.centFT0A());
@@ -809,9 +815,11 @@ struct lnnRecoTask {
809815
continue;
810816

811817
auto mc = trackMC.mcParticle();
812-
bool motherIsAccepted = isLnnDecay(mc);
813818

814-
fillMcHistograms(trackMC, mc, motherIsAccepted, collision);
819+
if (!isLnnDecay(mc))
820+
continue;
821+
822+
fillMcHistograms(trackMC, mc, collision);
815823
}
816824

817825
lnnCandidates.clear();
@@ -822,6 +830,7 @@ struct lnnRecoTask {
822830
if (collision.has_mcCollision()) {
823831
recoCollisionIds[collision.mcCollisionId()] = collision.globalIndex();
824832
}
833+
825834
if ((!collision.sel8())) {
826835
continue;
827836
}
@@ -830,6 +839,10 @@ struct lnnRecoTask {
830839
continue;
831840
}
832841
hEvents->Fill(2.);
842+
if (useNoSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) {
843+
continue;
844+
}
845+
hEvents->Fill(3.);
833846

834847
hZvtx->Fill(collision.posZ());
835848
hCentFT0A->Fill(collision.centFT0A());
@@ -854,19 +867,10 @@ struct lnnRecoTask {
854867
continue;
855868
}
856869
int chargeFactor = -1 + 2 * (lnnCand.pdgCode > 0);
857-
858-
// Fill 2D map for generated daughter particles which the mother candidate is reconstructed
859-
h2FT0CPtGenColRecoGenCandMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPt());
860-
h2FT0CPtGenColRecoGenTrStrMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPt3H());
861-
h2FT0CPtGenColRecoGenPiStrMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPtPi());
862-
if (lnnCand.recoMcColl) {
863-
h2FT0CPtRecColRecoGenCandMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPt());
864-
h2FT0CPtRecColRecoGenTrStrMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPt3H());
865-
h2FT0CPtRecColRecoGenPiStrMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPtPi());
866-
if (lnnCand.isReco && lnnCand.survEvSelection) {
867-
h2FT0CPtRecColRecoTrStrMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.recoPt3H());
868-
h2FT0CPtRecColRecoPiStrMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.recoPtPi());
869-
}
870+
if (lnnCand.recoMcColl && lnnCand.survEvSelection) {
871+
h2FT0CPtGenColRecCandMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPt());
872+
h2FT0CPtGenColRecTrStrMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPt3H());
873+
h2FT0CPtGenColRecPiStrMC->Fill(collision.centFT0C(), chargeFactor * lnnCand.genPtPi());
870874
}
871875
outputMCTable(collision.centFT0A(), collision.centFT0C(), collision.centFT0M(),
872876
collision.posX(), collision.posY(), collision.posZ(),
@@ -890,6 +894,9 @@ struct lnnRecoTask {
890894
continue;
891895
}
892896
float cent = collisionFT0Ccent[mcPart.mcCollisionId()];
897+
898+
h2FT0CPtGenColGenCandMC->Fill(cent, mcPart.pt());
899+
893900
constexpr std::size_t kVtxDim = 3;
894901
std::array<float, kVtxDim> secVtx;
895902
std::array<float, kVtxDim> primVtx = {mcPart.vx(), mcPart.vy(), mcPart.vz()};
@@ -902,14 +909,17 @@ struct lnnRecoTask {
902909
bool is3HFound = false;
903910

904911
for (const auto& mcDaught : mcPart.daughters_as<aod::McParticles>()) {
905-
if (std::abs(mcDaught.pdgCode()) == h3DauPdg) {
912+
int pdg = std::abs(mcDaught.pdgCode());
913+
914+
if (pdg == h3DauPdg) {
906915
secVtx = {mcDaught.vx(), mcDaught.vy(), mcDaught.vz()};
907916
mom3H = mcDaught.pVector();
917+
h2FT0CPtGenColGenTrStrMC->Fill(cent, mcDaught.pt());
908918
is3HFound = true;
909-
break;
910919
}
911-
if (std::abs(mcDaught.pdgCode()) == piDauPdg) {
920+
if (pdg == piDauPdg) {
912921
momPi = mcDaught.pVector();
922+
h2FT0CPtGenColGenPiStrMC->Fill(cent, mcDaught.pt());
913923
}
914924
}
915925

@@ -918,9 +928,9 @@ struct lnnRecoTask {
918928
} else {
919929
hIsMatterGen->Fill(1.);
920930
}
931+
921932
if (!is3HFound) {
922933
hDecayChannel->Fill(1.);
923-
continue;
924934
}
925935
hDecayChannel->Fill(0.);
926936
if (std::find(filledMothers.begin(), filledMothers.end(), mcPart.globalIndex()) != std::end(filledMothers)) {
@@ -941,18 +951,15 @@ struct lnnRecoTask {
941951
lnnCand.posTrackID = -1;
942952
lnnCand.negTrackID = -1;
943953
lnnCand.isSignal = true;
944-
if (lnnCand.isSignal) {
945-
h2FT0CPtGenColGenCandMC->Fill(cent, chargeFactor * lnnCand.genPt());
946-
h2FT0CPtGenColGenTrStrMC->Fill(cent, chargeFactor * lnnCand.genPt3H());
947-
h2FT0CPtGenColGenPiStrMC->Fill(cent, chargeFactor * lnnCand.genPtPi());
948-
}
949954

950-
float centFT0C = -1.;
955+
float centFT0A = -1, centFT0C = -1, centFT0M = -1;
951956
if (lnnCand.recoMcColl) {
952957
auto recoCollision = collisions.rawIteratorAt(recoCollisionIds[mcPart.mcCollisionId()]);
958+
centFT0A = recoCollision.centFT0A();
953959
centFT0C = recoCollision.centFT0C();
960+
centFT0M = recoCollision.centFT0M();
954961
}
955-
outputMCTable(-1, centFT0C, -1,
962+
outputMCTable(centFT0A, centFT0C, centFT0M,
956963
-1, -1, -1,
957964
0,
958965
-1, -1, -1,

0 commit comments

Comments
 (0)