From 485d5f0f11114368d7d6b50b243a9042211e97cb Mon Sep 17 00:00:00 2001 From: prottayHEP Date: Fri, 15 Mar 2024 11:40:51 +0530 Subject: [PATCH] added opening angle, TOF only and QA hist --- PWGLF/Tasks/Resonances/kstarqa.cxx | 252 ++++++++++++++++++----------- 1 file changed, 161 insertions(+), 91 deletions(-) diff --git a/PWGLF/Tasks/Resonances/kstarqa.cxx b/PWGLF/Tasks/Resonances/kstarqa.cxx index 446c8e3c8f3..3ef9c4c6eaf 100644 --- a/PWGLF/Tasks/Resonances/kstarqa.cxx +++ b/PWGLF/Tasks/Resonances/kstarqa.cxx @@ -84,10 +84,11 @@ struct kstarqa { Configurable nBins{"nBins", 100, "N bins in all histos"}; // Confugrable for QA histograms - Configurable QAbefore{"QAbefore", false, "QAbefore"}; - Configurable QAafter{"QAafter", false, "QAafter"}; - Configurable QAv0{"QAv0", false, "QAv0"}; - Configurable onlyTPC{"onlyTPC", false, "only TPC tracks"}; + Configurable QA{"QA", false, "QA"}; + Configurable QAbefore{"QAbefore", true, "QAbefore"}; + Configurable QAafter{"QAafter", true, "QAafter"}; + Configurable onlyTPCQA{"onlyTPCQA", false, "only TPC tracks"}; + Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; // Configurable for event selection Configurable @@ -100,8 +101,14 @@ struct kstarqa { Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; - Configurable nsigmaCutTPC{"nsigmacutTPC", 3.0, - "Value of the TPC Nsigma cut"}; + Configurable nsigmaCutTPCPi{"nsigmacutTPCPi", 3.0, + "Value of the TPC Nsigma cut for pions"}; + Configurable nsigmaCutTPCKa{"nsigmacutTPCKa", 3.0, + "Value of the TPC Nsigma cut for kaons"}; + Configurable nsigmaCutTOFPi{"nsigmacutTOFPi", 3.0, + "Value of the TOF Nsigma cut for pions"}; + Configurable nsigmaCutTOFKa{"nsigmacutTOFKa", 3.0, + "Value of the TOF Nsigma cut for kaons"}; Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the Combined Nsigma cut"}; Configurable cfgNoMixedEvents{"cfgNoMixedEvents", 5, @@ -111,6 +118,8 @@ struct kstarqa { Configurable iscustomDCAcut{"iscustomDCAcut", false, "iscustomDCAcut"}; Configurable ismanualDCAcut{"ismanualDCAcut", true, "ismanualDCAcut"}; Configurable cfgITScluster{"cfgITScluster", 0, "Number of ITS cluster"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 70, "Number of TPC cluster"}; + Configurable cfgRCRFC{"cfgRCRFC", 0.8f, "Crossed Rows to Findable Clusters"}; ConfigurableAxis cMixMultBins{"cMixMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f}, "Mixing bins - multiplicity"}; Configurable timFrameEvsel{"timFrameEvsel", false, "TPC Time frame boundary cut"}; @@ -131,31 +140,39 @@ struct kstarqa { // for primary tracks if (QAbefore && QAafter) { histos.add("hNsigmaPionTPC_before", "NsigmaPion TPC distribution before", - kTH1F, {{200, -10.0f, 10.0f}}); + kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); histos.add("hNsigmaPionTOF_before", "NsigmaPion TOF distribution before", - kTH1F, {{200, -10.0f, 10.0f}}); + kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + histos.add("hNsigmaKaonTPC_before", "NsigmaKaon TPC distribution before", + kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + histos.add("hNsigmaKaonTOF_before", "NsigmaKaon TOF distribution before", + kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); histos.add("hEta_after", "Eta distribution", kTH1F, {{200, -1.0f, 1.0f}}); - histos.add("hDcaxy_after", "Dcaxy distribution", kTH1F, - {{200, -10.0f, 10.0f}}); - histos.add("hDcaz_after", "Dcaz distribution", kTH1F, - {{200, -10.0f, 10.0f}}); - histos.add("hNsigmaPionTPC_after", "NsigmaPion TPC distribution", kTH1F, - {{200, -10.0f, 10.0f}}); - histos.add("hNsigmaPionTOF_after", "NsigmaPion TOF distribution", kTH1F, - {{200, -10.0f, 10.0f}}); + histos.add("hCRFC_after", "CRFC after distribution", kTH1F, + {{100, 0.0f, 10.0f}}); + histos.add("hCRFC_before", "CRFC before distribution", kTH1F, + {{100, 0.0f, 10.0f}}); + histos.add("hNsigmaPionTPC_after", "NsigmaPion TPC distribution", + kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + histos.add("hNsigmaPionTOF_after", "NsigmaPion TOF distribution", + kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + histos.add("hNsigmaKaonTPC_after", "NsigmaKaon TPC distribution", + kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); + histos.add("hNsigmaKaonTOF_after", "NsigmaKaon TOF distribution", + kTH2F, {{100, 0.0f, 10.0f}, {200, -10.0f, 10.0f}}); } // CKStar histograms histos.add("h3CKSInvMassUnlikeSign", "Invariant mass of CKS meson Unlike Sign", kTHnSparseF, - {{200, 0.0, 200.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true); + {{100, 0.0, 1.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true); histos.add("h3CKSInvMasslikeSign", "Invariant mass of CKS meson like Sign", kTHnSparseF, - {{200, 0.0, 200.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true); + {{100, 0.0, 1.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true); histos.add("h3CKSInvMassMixed", "Invariant mass of CKS meson Mixed", kTHnSparseF, - {{200, 0.0, 200.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true); + {{100, 0.0, 1.0}, {200, 0.0f, 20.0f}, {90, 0.6, 1.5}}, true); } double massPi = TDatabasePDG::Instance() @@ -176,7 +193,7 @@ struct kstarqa { !(candidate.isGlobalTrackWoDCA() && candidate.isPVContributor() && std::abs(candidate.dcaXY()) < cfgCutDCAxy && std::abs(candidate.dcaZ()) < cfgCutDCAz && - candidate.itsNCls() > cfgITScluster)) { + candidate.itsNCls() > cfgITScluster && candidate.tpcNClsFound() > cfgTPCcluster && candidate.tpcCrossedRowsOverFindableCls() > cfgRCRFC)) { return false; } return true; @@ -186,28 +203,47 @@ struct kstarqa { bool selectionPID(const T& candidate, int PID) { if (PID == 0) { - if (candidate.hasTOF() && - (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + - candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < - (nsigmaCutCombined * nsigmaCutCombined)) { - return true; - } - if (onlyTPC) { + if (onlyTOF) { + if (candidate.hasTOF() && + std::abs(candidate.tofNSigmaPi()) < nsigmaCutTOFPi) { + return true; + } + } else if (onlyTPCQA) { + if (std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { + return true; + } + } else { + if (candidate.hasTOF() && + (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < + (nsigmaCutCombined * nsigmaCutCombined)) { + return true; + } if (!candidate.hasTOF() && - std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPC) { + std::abs(candidate.tpcNSigmaPi()) < nsigmaCutTPCPi) { return true; } } } else if (PID == 1) { - if (candidate.hasTOF() && - (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + - candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < - (nsigmaCutCombined * nsigmaCutCombined)) { - return true; + if (onlyTOF) { + if (candidate.hasTOF() && + std::abs(candidate.tofNSigmaKa()) < nsigmaCutTOFKa) { + return true; + } } - if (onlyTPC) { + if (onlyTPCQA) { + if (std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { + return true; + } + } else { + if (candidate.hasTOF() && + (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < + (nsigmaCutCombined * nsigmaCutCombined)) { + return true; + } if (!candidate.hasTOF() && - std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPC) { + std::abs(candidate.tpcNSigmaKa()) < nsigmaCutTPCKa) { return true; } } @@ -249,12 +285,12 @@ struct kstarqa { using BinningTypeTPCMultiplicity = ColumnBinningPolicy; - // using BinningTypeVertexContributor = - // ColumnBinningPolicy; - using BinningTypeCentralityM = - ColumnBinningPolicy; using BinningTypeVertexContributor = + ColumnBinningPolicy; + using BinningTypeCentralityM = ColumnBinningPolicy; + // using BinningTypeVertexContributor = + // ColumnBinningPolicy; BinningTypeVertexContributor binningOnPositions{ {axisVertex, axisMultiplicity}, @@ -264,6 +300,13 @@ struct kstarqa { BinningTypeVertexContributor> pair{binningOnPositions, cfgNoMixedEvents, -1, &cache}; + double totmomka = 0.0; + double totmompi = 0.0; + double totmomkamix = 0.0; + double totmompimix = 0.0; + double openingangle = 0.0; + double openinganglemix = 0.0; + void processSE(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&) @@ -286,6 +329,15 @@ struct kstarqa { std::vector PionSign = {}; std::vector KaonSign = {}; + std::vector PionPx = {}; + std::vector KaonPx = {}; + std::vector PionPy = {}; + std::vector KaonPy = {}; + std::vector PionPz = {}; + std::vector KaonPz = {}; + std::vector PionP = {}; + std::vector KaonP = {}; + float multiplicity = 0.0f; /* if (cfgMultFT0) multiplicity = collision.multZeqFT0A() + collision.multZeqFT0C(); @@ -299,89 +351,98 @@ struct kstarqa { rEventSelection.fill(HIST("hmult"), multiplicity); for (auto track1 : tracks) { - /* + if (QAbefore) { - histos.fill(HIST("hNsigmaPionTPC_before"), track1.tpcNSigmaPi()); - histos.fill(HIST("hNsigmaPionTOF_before"), track1.tofNSigmaPi()); + histos.fill(HIST("hNsigmaKaonTPC_before"), track1.pt(), track1.tpcNSigmaKa()); + histos.fill(HIST("hNsigmaKaonTOF_before"), track1.pt(), track1.tofNSigmaKa()); + histos.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls()); } - */ - - if (!selectionPID(track1, 1)) - continue; // for primary particle PID if (!selectionTrack(track1)) { continue; } - /* if (QAafter) { histos.fill(HIST("hEta_after"), track1.eta()); - histos.fill(HIST("hDcaxy_after"), track1.dcaXY()); - histos.fill(HIST("hDcaz_after"), track1.dcaZ()); - histos.fill(HIST("hNsigmaPionTPC_after"), track1.tpcNSigmaPi()); - histos.fill(HIST("hNsigmaPionTOF_after"), track1.tofNSigmaPi()); + histos.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls()); + histos.fill(HIST("hNsigmaKaonTPC_after"), track1.pt(), track1.tpcNSigmaKa()); + histos.fill(HIST("hNsigmaKaonTOF_after"), track1.pt(), track1.tofNSigmaKa()); } - */ + + if (!selectionPID(track1, 1)) // kaon + continue; + + totmomka = TMath::Sqrt(track1.px() * track1.px() + track1.py() * track1.py() + track1.pz() * track1.pz()); + ROOT::Math::PtEtaPhiMVector temp1(track1.pt(), track1.eta(), track1.phi(), massKa); kaons.push_back(temp1); KaonIndex.push_back(track1.globalIndex()); KaoncollIndex.push_back(track1.collisionId()); KaonSign.push_back(track1.sign()); + KaonPx.push_back(track1.px()); + KaonPy.push_back(track1.py()); + KaonPz.push_back(track1.pz()); + KaonP.push_back(totmomka); } // track loop ends for (auto track2 : tracks) { - /* + if (QAbefore) { - histos.fill(HIST("hNsigmaPionTPC_before"), track1.tpcNSigmaPi()); - histos.fill(HIST("hNsigmaPionTOF_before"), track1.tofNSigmaPi()); + histos.fill(HIST("hNsigmaPionTPC_before"), track2.pt(), track2.tpcNSigmaPi()); + histos.fill(HIST("hNsigmaPionTOF_before"), track2.pt(), track2.tofNSigmaPi()); } - */ - - if (!selectionPID(track2, 0)) - continue; // for primary particle PID if (!selectionTrack(track2)) { continue; } - /* if (QAafter) { - histos.fill(HIST("hEta_after"), track1.eta()); - histos.fill(HIST("hDcaxy_after"), track1.dcaXY()); - histos.fill(HIST("hDcaz_after"), track1.dcaZ()); - histos.fill(HIST("hNsigmaPionTPC_after"), track1.tpcNSigmaPi()); - histos.fill(HIST("hNsigmaPionTOF_after"), track1.tofNSigmaPi()); + histos.fill(HIST("hNsigmaPionTPC_after"), track2.pt(), track2.tpcNSigmaPi()); + histos.fill(HIST("hNsigmaPionTOF_after"), track2.pt(), track2.tofNSigmaPi()); } - */ + + if (!selectionPID(track2, 0)) // pion + continue; + + totmompi = TMath::Sqrt(track2.px() * track2.px() + track2.py() * track2.py() + track2.pz() * track2.pz()); + ROOT::Math::PtEtaPhiMVector temp2(track2.pt(), track2.eta(), track2.phi(), massPi); pions.push_back(temp2); PionIndex.push_back(track2.globalIndex()); PioncollIndex.push_back(track2.collisionId()); PionSign.push_back(track2.sign()); - + PionPx.push_back(track2.px()); + PionPy.push_back(track2.py()); + PionPz.push_back(track2.pz()); + PionP.push_back(totmompi); } // track loop ends - if (pions.size() != 0 && kaons.size() != 0) { - for (auto ikaon = kaons.begin(); ikaon != kaons.end(); ++ikaon) { - auto i1 = std::distance(kaons.begin(), ikaon); - for (auto ipion = pions.begin(); ipion != pions.end(); - ++ipion) { - auto i3 = std::distance(pions.begin(), ipion); - - if (PionIndex.at(i3) <= KaonIndex.at(i1)) - continue; - CKSVector = kaons.at(i1) + pions.at(i3); - - if (TMath::Abs(CKSVector.Rapidity()) < 0.5) { - if (PionSign.at(i3) * KaonSign.at(i1) < 0) - histos.fill(HIST("h3CKSInvMassUnlikeSign"), multiplicity, - CKSVector.Pt(), CKSVector.M()); - else if (PionSign.at(i3) * KaonSign.at(i1) > 0) - histos.fill(HIST("h3CKSInvMasslikeSign"), multiplicity, - CKSVector.Pt(), CKSVector.M()); + if (!QA) { + if (pions.size() != 0 && kaons.size() != 0) { + for (auto ikaon = kaons.begin(); ikaon != kaons.end(); ++ikaon) { + auto i1 = std::distance(kaons.begin(), ikaon); + for (auto ipion = pions.begin(); ipion != pions.end(); + ++ipion) { + auto i3 = std::distance(pions.begin(), ipion); + + if (PionIndex.at(i3) <= KaonIndex.at(i1)) + continue; + CKSVector = kaons.at(i1) + pions.at(i3); + + openingangle = TMath::Abs((PionPx.at(i3) * KaonPx.at(i1) + PionPy.at(i3) * KaonPy.at(i1) + PionPz.at(i3) * KaonPz.at(i1)) / (PionP.at(i3) * KaonP.at(i1))); + // openingangle = (PionPx.at(i3)*KaonPx.at(i1) + PionPy.at(i3)*KaonPy.at(i1) + PionPz.at(i3)*KaonPz.at(i1)); + // LOG(info) << "opening angle" << openingangle; + if (TMath::Abs(CKSVector.Rapidity()) < 0.5) { + if (PionSign.at(i3) * KaonSign.at(i1) < 0) + histos.fill(HIST("h3CKSInvMassUnlikeSign"), openingangle, + CKSVector.Pt(), CKSVector.M()); + else if (PionSign.at(i3) * KaonSign.at(i1) > 0) + histos.fill(HIST("h3CKSInvMasslikeSign"), openingangle, + CKSVector.Pt(), CKSVector.M()); + } } } } @@ -411,9 +472,9 @@ struct kstarqa { float multiplicity = 0.0f; /* if (cfgMultFT0) multiplicity = c1.multZeqFT0A() + c1.multZeqFT0C(); - if (cfgMultFT0 == 0 && cfgCentFT0C == 1) + if (cfgMultFT0 == 0 && cfgCentFT0C == 1) multiplicity = c1.centFT0C(); - if (cfgMultFT0 == 0 && cfgCentFT0C == 0)*/ + if (cfgMultFT0 == 0 && cfgCentFT0C == 0)*/ multiplicity = c1.centFT0M(); for (auto& [t1, t2] : o2::soa::combinations( @@ -433,12 +494,21 @@ struct kstarqa { TLorentzVector PION; PION.SetPtEtaPhiM(t2.pt(), t2.eta(), t2.phi(), massPi); + totmompimix = TMath::Sqrt(t2.px() * t2.px() + t2.py() * t2.py() + t2.pz() * t2.pz()); + totmomkamix = TMath::Sqrt(t1.px() * t1.px() + t1.py() * t1.py() + t1.pz() * t1.pz()); + + openinganglemix = TMath::Abs((t1.px() * t2.px() + t1.py() * t2.py() + t1.pz() * t2.pz()) / (totmomkamix * totmompimix)); + + // LOG(info) << "mix angle" << openinganglemix; + TLorentzVector CKSmix = KAON + PION; - if (TMath::Abs(CKSmix.Rapidity()) < 0.5) { - if (t1.sign() * t2.sign() < 0) - histos.fill(HIST("h3CKSInvMassMixed"), multiplicity, CKSmix.Pt(), - CKSmix.M()); + if (!QA) { + if (TMath::Abs(CKSmix.Rapidity()) < 0.5) { + if (t1.sign() * t2.sign() < 0) + histos.fill(HIST("h3CKSInvMassMixed"), openingangle, CKSmix.Pt(), + CKSmix.M()); + } } } }