From b0a86c1b4ffcc532e9aade9499481cbe4085cd15 Mon Sep 17 00:00:00 2001 From: sawan Date: Wed, 29 Apr 2026 19:37:47 +0530 Subject: [PATCH] configurable for mother id check --- PWGLF/Tasks/Resonances/kstarqa.cxx | 90 ++++++++++++++++++------------ 1 file changed, 53 insertions(+), 37 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 45e210e1cb1..15a859b5f5f 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -82,6 +82,7 @@ struct Kstarqa { struct : ConfigurableGroup { // Configurables for event selections + Configurable isCheckMotherClosure{"isCheckMotherClosure", false, "Check mother globalid in MC for closure"}; Configurable isSquarePIDcut{"isSquarePIDcut", false, "Apply square PID cut"}; Configurable isINELgt0{"isINELgt0", true, "INEL>0 selection"}; Configurable isINELgt0Gen{"isINELgt0Gen", false, "Apply INEL>0 in Gen direclty from collisions in addition to already applied from pwglf::inelGt"}; @@ -406,6 +407,7 @@ struct Kstarqa { rEventSelection.add("tracksCheckData", "No. of events in the data", kTH1I, {{10, 0, 10}}); rEventSelection.add("eventsCheckGen", "No. of events in the generated MC", kTH1I, {{10, 0, 10}}); + rEventSelection.add("eventsCheckRec", "No. of events in the generated MC", kTH1I, {{5, 0, 5}}); rEventSelection.add("recMCparticles", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}}); rEventSelection.add("hOccupancy", "Occupancy distribution", kTH1F, {{1000, 0, 15000}}); @@ -439,11 +441,16 @@ struct Kstarqa { std::shared_ptr hGenTracks = rEventSelection.get(HIST("eventsCheckGen")); hGenTracks->GetXaxis()->SetBinLabel(1, "All events"); - hGenTracks->GetXaxis()->SetBinLabel(2, "INELgt0+vtz"); + hGenTracks->GetXaxis()->SetBinLabel(2, "Vz cut"); hGenTracks->GetXaxis()->SetBinLabel(3, "INELgt0"); - hGenTracks->GetXaxis()->SetBinLabel(4, "All Collisions"); - hGenTracks->GetXaxis()->SetBinLabel(5, "Gen events with at least 1 rec event"); - hGenTracks->GetXaxis()->SetBinLabel(6, "Rec events"); + hGenTracks->GetXaxis()->SetBinLabel(4, "PWGlf:INELgt0"); + hGenTracks->GetXaxis()->SetBinLabel(5, "Atleat 1rec"); + + std::shared_ptr hRecTracks = rEventSelection.get(HIST("eventsCheckRec")); + hRecTracks->GetXaxis()->SetBinLabel(1, "All events"); + hRecTracks->GetXaxis()->SetBinLabel(2, "has_MCcollision"); + hRecTracks->GetXaxis()->SetBinLabel(3, "INELgt0"); + hRecTracks->GetXaxis()->SetBinLabel(4, "Event_Selection"); // Multplicity distribution if (cQAevents) { @@ -1443,7 +1450,9 @@ struct Kstarqa { void processSEMC(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) { - // auto oldindex = -999; + // if (configGp.isCheckMotherClosure) { + auto oldindex = -999; + // } if (!collision.has_mcCollision()) { return; } @@ -1580,45 +1589,48 @@ struct Kstarqa { hPID.fill(HIST("After/hNsigma_TPC_TOF_Pi_after"), track2.tpcNSigmaPi(), track2.tofNSigmaPi() - configGp.shiftInNsigmaTOFPi, track2.pt()); } - // for (const auto& mothertrack1 : mctrack1.mothers_as()) { - // for (const auto& mothertrack2 : mctrack2.mothers_as()) { + if (configGp.isCheckMotherClosure) { + for (const auto& mothertrack1 : mctrack1.mothers_as()) { + for (const auto& mothertrack2 : mctrack2.mothers_as()) { - // if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) { - // continue; - // } + if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) { + continue; + } - // if (!mothertrack1.producedByGenerator()) { - // continue; - // } + if (!mothertrack1.producedByGenerator()) { + continue; + } - // if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) { - // continue; - // } - // rEventSelection.fill(HIST("recMCparticles"), 11.5); + if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) { + continue; + } + rEventSelection.fill(HIST("recMCparticles"), 11.5); - // oldindex = mothertrack1.globalIndex(); + oldindex = mothertrack1.globalIndex(); - // daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); - // daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); - // mother = daughter1 + daughter2; // Kstar meson + daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); + daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); + mother = daughter1 + daughter2; // Kstar meson - // hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt()); - // hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt()); + hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt()); + hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt()); - // isMix = false; - // fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); - // } - // } + isMix = false; + fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); + } + } + } else { - daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); - daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); - mother = daughter1 + daughter2; // Kstar meson + daughter1 = ROOT::Math::PxPyPzMVector(track1.px(), track1.py(), track1.pz(), massKa); + daughter2 = ROOT::Math::PxPyPzMVector(track2.px(), track2.py(), track2.pz(), massPi); + mother = daughter1 + daughter2; // Kstar meson - hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt()); - hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt()); + hOthers.fill(HIST("hKstar_rap_pt"), mother.Rapidity(), mother.Pt()); + hOthers.fill(HIST("hKstar_eta_pt"), mother.Eta(), mother.Pt()); - isMix = false; - fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); + isMix = false; + fillInvMass(daughter1, daughter2, mother, multiplicity, isMix, track1, track2); + } } } PROCESS_SWITCH(Kstarqa, processSEMC, "Process same event in MC", false); @@ -1633,10 +1645,12 @@ struct Kstarqa { if (configGp.isApplyMCGenVz && std::abs(mcCollision.posZ()) > configGp.cutzvertex) { return; } + rEventSelection.fill(HIST("eventsCheckGen"), 1.5); if (configGp.isINELgt0Gen && !mcCollision.isInelGt0()) { return; } + rEventSelection.fill(HIST("eventsCheckGen"), 2.5); std::vector selectedEvents(collisions.size()); int nevts = 0; @@ -1651,10 +1665,9 @@ struct Kstarqa { if (configGp.isINELgt0 && !isINELgt0true) { return; } - rEventSelection.fill(HIST("eventsCheckGen"), 2.5); + rEventSelection.fill(HIST("eventsCheckGen"), 3.5); for (const auto& collision : collisions) { - rEventSelection.fill(HIST("eventsCheckGen"), 3.5); if (!selectionEvent(collision, false)) { // don't fill event cut histogram continue; @@ -1944,10 +1957,12 @@ struct Kstarqa { void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, EventMCGenerated const&) { + rEventSelection.fill(HIST("eventsCheckRec"), 0.5); if (!collision.has_mcCollision()) { return; } + rEventSelection.fill(HIST("eventsCheckRec"), 1.5); double multiplicityRec = -1.0; // multiplicityRec = collision.mcCollision_as().centFT0M(); @@ -1957,6 +1972,7 @@ struct Kstarqa { if (configGp.isINELgt0 && !collision.isInelGt0()) { return; } + rEventSelection.fill(HIST("eventsCheckRec"), 2.5); // multiplicity = collision.centFT0M(); if (cSelectMultEstimator == kFT0M) { @@ -1977,8 +1993,8 @@ struct Kstarqa { if (!selectionEvent(collision, true)) { // fill MC event cut histogram return; } + rEventSelection.fill(HIST("eventsCheckRec"), 3.5); - rEventSelection.fill(HIST("eventsCheckGen"), 5.5); hInvMass.fill(HIST("h1RecMult"), multiplicity); hInvMass.fill(HIST("h1RecMult2"), multiplicityRec);