From 13610f9ad6188d5ae3197782ee0e39f1a14b6909 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Thu, 2 May 2024 21:02:30 +0200 Subject: [PATCH] add QA plots for MC + add dca v0-to-pv cut (#5958) --- PWGLF/Tasks/Nuspex/antidLambdaEbye.cxx | 61 +++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/antidLambdaEbye.cxx b/PWGLF/Tasks/Nuspex/antidLambdaEbye.cxx index 0e466424e7d..042be378bb6 100644 --- a/PWGLF/Tasks/Nuspex/antidLambdaEbye.cxx +++ b/PWGLF/Tasks/Nuspex/antidLambdaEbye.cxx @@ -138,11 +138,19 @@ float etaFromMom(std::array const& momA, std::array const& m (1.f * momA[2] + 1.f * momB[2]) * (1.f * momA[2] + 1.f * momB[2])) - (1.f * momA[2] + 1.f * momB[2]))); } +float CalculateDCAStraightToPV(float X, float Y, float Z, float Px, float Py, float Pz, float pvX, float pvY, float pvZ) +{ + return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz)); +} } // namespace struct CandidateV0 { float pt; float eta; + float mass; + float cpa; + float dcav0daugh; + float dcav0pv; int64_t globalIndexPos = -999; int64_t globalIndexNeg = -999; }; @@ -245,8 +253,8 @@ struct antidLambdaEbye { Configurable tofMassMaxQA{"tofMassMaxQA", 0.6f, "(temporary) tof mass cut (for QA histograms)"}; Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"}; - Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.1f, "DCA Pos To PV"}; - Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.1f, "DCA Neg To PV"}; + Configurable v0setting_dcav0pv{"v0setting_dcav0pv", 1, "DCA V0 to Pv"}; + Configurable v0setting_dcadaughtopv{"v0setting_dcadaughtopv", 0.1f, "DCA Pos To PV"}; Configurable v0setting_cospa{"v0setting_cospa", 0.98, "V0 CosPA"}; Configurable v0setting_radius{"v0setting_radius", 0.5f, "v0radius"}; Configurable v0setting_lifetime{"v0setting_lifetime", 40.f, "v0 lifetime cut"}; @@ -480,13 +488,26 @@ struct antidLambdaEbye { // v0 QA histos.add("QA/massLambda", ";Centrality (%);#it{p}_{T} (GeV/#it{c});#it{M}(p + #pi^{-}) (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, massLambdaAxis}); histos.add("QA/cosPa", ";cosPa;Entries", HistType::kTH1F, {cosPaAxis}); + histos.add("QA/cosPaSig", ";cosPa;Entries", HistType::kTH1F, {cosPaAxis}); + histos.add("QA/cosPaBkg", ";cosPa;Entries", HistType::kTH1F, {cosPaAxis}); + histos.add("QA/dcaV0daughSig", ";dcaV0daugh;Entries", HistType::kTH1F, {dcaV0daughAxis}); + histos.add("QA/dcaV0daughBkg", ";dcaV0daugh;Entries", HistType::kTH1F, {dcaV0daughAxis}); + histos.add("QA/dcaV0PvSig", ";dcaV0Pv;Entries", HistType::kTH1F, {dcaV0daughAxis}); + histos.add("QA/dcaV0PvBkg", ";dcaV0Pv;Entries", HistType::kTH1F, {dcaV0daughAxis}); + histos.add("QA/cosPaDcaV0daughSig", ";cosPa;dcaV0daugh", HistType::kTH2F, {cosPaAxis, dcaV0daughAxis}); + histos.add("QA/cosPaDcaV0daughBkg", ";cosPa;dcaV0daugh", HistType::kTH2F, {cosPaAxis, dcaV0daughAxis}); + histos.add("QA/massLambdaEvRej", ";Centrality (%);#it{p}_{T} (GeV/#it{c});#it{M}(p + #pi^{-}) (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, massLambdaAxis}); + histos.add("QA/massLambdaEvRejSig", ";Centrality (%);#it{p}_{T} (GeV/#it{c});#it{M}(p + #pi^{-}) (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, massLambdaAxis}); + histos.add("QA/massLambdaEvRejBkg", ";Centrality (%);#it{p}_{T} (GeV/#it{c});#it{M}(p + #pi^{-}) (GeV/#it{c}^{2});Entries", HistType::kTH3F, {centAxis, momAxis, massLambdaAxis}); histos.add("QA/radius", ";radius;Entries", HistType::kTH1F, {radiusAxis}); histos.add("QA/dcaV0daugh", ";dcaV0daugh;Entries", HistType::kTH1F, {dcaV0daughAxis}); + histos.add("QA/dcaV0Pv", ";dcaV0Pv;Entries", HistType::kTH1F, {dcaV0daughAxis}); histos.add("QA/dcaPosPv", ";dcaPosPv;Entries", HistType::kTH1F, {dcaDaughPvAxis}); histos.add("QA/dcaNegPv", ";dcaNegPv;Entries", HistType::kTH1F, {dcaDaughPvAxis}); histos.add("QA/cosPaBeforeCut", ";cosPa;Entries", HistType::kTH1F, {cosPaAxis}); histos.add("QA/radiusBeforeCut", ";radius;Entries", HistType::kTH1F, {radiusAxis}); histos.add("QA/dcaV0daughBeforeCut", ";dcaV0daugh;Entries", HistType::kTH1F, {dcaV0daughAxis}); + histos.add("QA/dcaV0PvBeforeCut", ";dcaV0Pv;Entries", HistType::kTH1F, {dcaV0daughAxis}); // d QA histos.add("QA/dcaPv", ";#it{p}_{T} (GeV/#it{c});dcaPv;Entries", HistType::kTH2F, {momAxis, dcaDaughPvAxis}); @@ -726,6 +747,17 @@ struct antidLambdaEbye { continue; } + float dcaV0Pv = CalculateDCAStraightToPV( + vtx[0], vtx[1], vtx[2], + momPos[0] + momNeg[0], + momPos[1] + momNeg[1], + momPos[2] + momNeg[2], + collision.posX(), collision.posY(), collision.posZ()); + histos.fill(HIST("QA/dcaV0PvBeforeCut"), dcaV0Pv); + if (std::abs(dcaV0Pv) > v0setting_dcav0pv) { + continue; + } + double cosPA = RecoDecay::cpa(primVtx, vtx, momV0); histos.fill(HIST("QA/cosPaBeforeCut"), cosPA); if (cosPA < v0setting_cospa) { @@ -741,13 +773,13 @@ struct antidLambdaEbye { o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, posTrackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); auto posDcaToPv = std::hypot(dcaInfo[0], dcaInfo[1]); - if (posDcaToPv < v0setting_dcapostopv && std::abs(dcaInfo[0]) < v0setting_dcapostopv) { + if (posDcaToPv < v0setting_dcadaughtopv && std::abs(dcaInfo[0]) < v0setting_dcadaughtopv) { continue; } o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, negTrackCov, 2.f, fitter.getMatCorrType(), &dcaInfo); auto negDcaToPv = std::hypot(dcaInfo[0], dcaInfo[1]); - if (negDcaToPv < v0setting_dcanegtopv && std::abs(dcaInfo[0]) < v0setting_dcanegtopv) { + if (negDcaToPv < v0setting_dcadaughtopv && std::abs(dcaInfo[0]) < v0setting_dcadaughtopv) { continue; } @@ -764,6 +796,7 @@ struct antidLambdaEbye { histos.fill(HIST("QA/dcaV0daugh"), dcaV0dau); histos.fill(HIST("QA/dcaPosPv"), posDcaToPv); histos.fill(HIST("QA/dcaNegPv"), negDcaToPv); + histos.fill(HIST("QA/dcaV0Pv"), dcaV0Pv); if (matter) { tempHistos.fill(HIST("tempLambda"), std::abs(etaV0), ptV0); @@ -777,6 +810,10 @@ struct antidLambdaEbye { CandidateV0 candV0; candV0.pt = ptV0; candV0.eta = etaV0; + candV0.mass = mLambda; + candV0.cpa = cosPA; + candV0.dcav0daugh = dcaV0dau; + candV0.dcav0pv = dcaV0Pv; candV0.globalIndexPos = posTrack.globalIndex(); candV0.globalIndexNeg = negTrack.globalIndex(); candidateV0s.push_back(candV0); @@ -795,6 +832,9 @@ struct antidLambdaEbye { candidateV0s.push_back(candV0); return -1; } + for (auto& candidateV0 : candidateV0s) { + histos.fill(HIST("QA/massLambdaEvRej"), centrality, candidateV0.pt, candidateV0.mass); + } histos.fill(HIST("nEv"), subsample, centrality); @@ -874,12 +914,23 @@ struct antidLambdaEbye { continue; if (!((mcTrackPos.pdgCode() == 2212 && mcTrackNeg.pdgCode() == -211) || (mcTrackPos.pdgCode() == 211 && mcTrackNeg.pdgCode() == -2212))) continue; - if (std::abs(posMother.pdgCode()) != 3122) + if (std::abs(posMother.pdgCode()) != 3122) { + histos.fill(HIST("QA/cosPaBkg"), candidateV0.cpa); + histos.fill(HIST("QA/dcaV0daughBkg"), candidateV0.dcav0daugh); + histos.fill(HIST("QA/dcaV0PvBkg"), candidateV0.dcav0pv); + histos.fill(HIST("QA/cosPaDcaV0daughBkg"), candidateV0.cpa, candidateV0.dcav0daugh); + histos.fill(HIST("QA/massLambdaEvRejBkg"), centrality, candidateV0.pt, candidateV0.mass); continue; + } if (!posMother.isPhysicalPrimary() && !posMother.has_mothers()) continue; if (((posMother.flags() & 0x8) && doprocessMcRun2) || (posMother.flags() & 0x2) || (posMother.flags() & 0x1)) continue; + histos.fill(HIST("QA/cosPaSig"), candidateV0.cpa); + histos.fill(HIST("QA/dcaV0daughSig"), candidateV0.dcav0daugh); + histos.fill(HIST("QA/dcaV0PvSig"), candidateV0.dcav0pv); + histos.fill(HIST("QA/cosPaDcaV0daughSig"), candidateV0.cpa, candidateV0.dcav0daugh); + histos.fill(HIST("QA/massLambdaEvRejSig"), centrality, candidateV0.pt, candidateV0.mass); if (posMother.pdgCode() > 0) { histos.fill(HIST("recL"), centrality, candidateV0.pt, std::abs(candidateV0.eta)); if (fillOnlySignal)