diff --git a/PWGLF/Tasks/Nuspex/piKpRAA.cxx b/PWGLF/Tasks/Nuspex/piKpRAA.cxx index 1320d56c7c0..95eaa7b8948 100644 --- a/PWGLF/Tasks/Nuspex/piKpRAA.cxx +++ b/PWGLF/Tasks/Nuspex/piKpRAA.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -189,6 +190,8 @@ struct PiKpRAA { // Configurables Event Selection Configurable isNoCollInTimeRangeStrict{"isNoCollInTimeRangeStrict", true, "use isNoCollInTimeRangeStrict?"}; + Configurable selNoSameBunchPileup{"selNoSameBunchPileup", true, "selNoSameBunchPileup?"}; + Configurable selIsGoodZvtxFT0vsPV{"selIsGoodZvtxFT0vsPV", true, "selIsGoodZvtxFT0vsPV?"}; Configurable isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "use isNoCollInTimeRangeStandard?"}; Configurable isNoCollInRofStrict{"isNoCollInRofStrict", true, "use isNoCollInRofStrict?"}; Configurable isNoCollInRofStandard{"isNoCollInRofStandard", false, "use isNoCollInRofStandard?"}; @@ -196,13 +199,14 @@ struct PiKpRAA { Configurable isNoCollInTimeRangeNarrow{"isNoCollInTimeRangeNarrow", false, "use isNoCollInTimeRangeNarrow?"}; Configurable isOccupancyCut{"isOccupancyCut", true, "Occupancy cut?"}; Configurable isCentSel{"isCentSel", true, "Centrality selection?"}; + Configurable selHasFT0{"selHasFT0", true, "Has FT0?"}; Configurable isT0Ccent{"isT0Ccent", true, "Use T0C-based centrality?"}; Configurable isZvtxPosSel{"isZvtxPosSel", true, "Zvtx position selection?"}; + Configurable isZvtxPosSelMC{"isZvtxPosSelMC", true, "Zvtx position selection for MC events?"}; Configurable selINELgt0{"selINELgt0", true, "Select INEL > 0?"}; Configurable isApplyFT0CbasedOccupancy{"isApplyFT0CbasedOccupancy", false, "T0C Occu cut"}; Configurable applyNchSel{"applyNchSel", false, "Use mid-rapidity-based Nch selection"}; Configurable skipRecoColGTOne{"skipRecoColGTOne", true, "Remove collisions if reconstructed more than once"}; - Configurable detector4Calibration{"detector4Calibration", "T0M", "Detector for nSigma-Nch rejection"}; // Event selection Configurable posZcut{"posZcut", +10.0, "z-vertex position cut"}; @@ -256,6 +260,7 @@ struct PiKpRAA { NoHighMultCollInPrevRof, NoCollInTimeRangeNarrow, OccuCut, + HasFT0, Centrality, VtxZ, NchSel, @@ -361,6 +366,8 @@ struct PiKpRAA { registry.add("EventCounter", ";;Events", kTH1F, {axisEvent}); registry.add("zPos", "With Event Selection;;Entries;", kTH1F, {axisZpos}); registry.add("T0Ccent", ";;Entries", kTH1F, {axisCent}); + registry.add("T0CcentVsFoundFT0", ";Found(=1.5) NOT Found(=0.5);", kTH2F, {{{axisCent}, {2, 0, 2}}}); + registry.add("NchVsCent", "Measured Nch v.s. Centrality (At least Once Rec. Coll. + Sel. criteria);;Nch", kTH2F, {{axisCent, {nBinsNch, minNch, maxNch}}}); registry.add("NclVsEtaPID", ";#eta;Ncl used for PID", kTH2F, {{{axisEta}, {161, -0.5, 160.5}}}); registry.add("NclVsEtaPIDp", ";#eta;#LTNcl#GT used for PID", kTProfile, {axisEta}); registry.add("dcaVsPtPi", "Primary pions;#it{p}_{T} (GeV/#it{c});DCA_{xy} (cm);Centrality Perc.;", kTH3F, {axisPt, axisDCAxy, axisCent}); @@ -379,10 +386,11 @@ struct PiKpRAA { x->SetBinLabel(9, "NoHighMultCollInPrevRof"); x->SetBinLabel(10, "NoCollInTimeRangeNarrow"); x->SetBinLabel(11, "Occupancy Cut"); - x->SetBinLabel(12, "Cent. Sel."); - x->SetBinLabel(13, "VtxZ Sel."); - x->SetBinLabel(14, "Nch Sel."); - x->SetBinLabel(15, "INEL > 0"); + x->SetBinLabel(12, "Has FT0?"); + x->SetBinLabel(13, "Cent. Sel."); + x->SetBinLabel(14, "VtxZ Sel."); + x->SetBinLabel(15, "Nch Sel."); + x->SetBinLabel(16, "INEL > 0"); if (doprocessCalibrationAndV0s) { registry.add("NchVsNPV", ";Nch; NPV;", kTH2F, {{{nBinsNPV, minNpv, maxNpv}, {nBinsNch, minNch, maxNch}}}); @@ -564,7 +572,6 @@ struct PiKpRAA { LOG(info) << "\tccdbNoLaterThan=" << ccdbNoLaterThan.value; LOG(info) << "\tapplyNchSel=" << applyNchSel.value; LOG(info) << "\tselINELgt0=" << selINELgt0.value; - LOG(info) << "\tdetector4Calibration=" << detector4Calibration.value; LOG(info) << "\tv0TypeSelection=" << static_cast(v0Selections.v0TypeSelection); LOG(info) << "\tselElecFromGammas=" << v0Selections.selElecFromGammas; LOG(info) << "\trequireITShit=" << v0Selections.requireITShit; @@ -633,6 +640,7 @@ struct PiKpRAA { const uint64_t timeStamp{foundBC.timestamp()}; const int magField{getMagneticField(timeStamp)}; const double nPV{collision.multNTracksPVeta1() / 1.}; + const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()}; if (applyNchSel) { const int nextRunNumber{foundBC.runNumber()}; @@ -687,7 +695,7 @@ struct PiKpRAA { registry.fill(HIST("NchVsNPV"), nPV, nch); registry.fill(HIST("zPos"), collision.posZ()); - const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()}; + registry.fill(HIST("NchVsCent"), centrality, nch); if (v0Selections.applyPhiCut) { const int nextRunNumber{foundBC.runNumber()}; @@ -1407,6 +1415,13 @@ struct PiKpRAA { nChMC++; } + //--------------------------- + // Only MC events with |Vtx Z| < 10 cm + //--------------------------- + if (isZvtxPosSelMC && (std::fabs(mccollision.posZ()) > posZcut)) { + return; + } + //--------------------------- // Only INEL > 0 generated events //--------------------------- @@ -1414,12 +1429,14 @@ struct PiKpRAA { if (!(nChMC > kZeroInt)) { return; } - } // selINELgt0 condition: Rejects all NON-INEL > 0 + } const auto& nRecColls{collisions.size()}; registry.fill(HIST("NumberOfRecoCollisions"), nRecColls); + //--------------------------- // Only Generated evets with at least one reconstrued collision + //--------------------------- if (nRecColls > kZeroInt) { // Finds the collisions with the largest number of contributors @@ -1427,6 +1444,12 @@ struct PiKpRAA { int biggestNContribs{-1}; int bestCollisionIndex{-1}; for (const auto& collision : collisions) { + + const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()}; + if (selHasFT0 && !collision.has_foundFT0()) { + continue; + } + if (biggestNContribs < collision.numContrib()) { biggestNContribs = collision.numContrib(); bestCollisionIndex = collision.globalIndex(); @@ -1434,7 +1457,6 @@ struct PiKpRAA { // Needed to calculate denominator of the Event Splitting correction if (isEventSelected(collision)) { - const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()}; registry.fill(HIST("Centrality_AllRecoEvt"), centrality); } } @@ -1445,7 +1467,20 @@ struct PiKpRAA { //--------------------------- for (const auto& collision : collisions) { - // Choose the collisions with the largest number of contributors + const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()}; + + //--------------------------- + // Reject collisions if has_foundFT0() returns false + //--------------------------- + if (selHasFT0 && !collision.has_foundFT0()) { + registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 0.5); + continue; + } + registry.fill(HIST("T0CcentVsFoundFT0"), centrality, 1.5); + + //--------------------------- + // Pick the collisions with the largest number of contributors + //--------------------------- if (bestCollisionIndex != collision.globalIndex()) { continue; } @@ -1472,7 +1507,6 @@ struct PiKpRAA { // Needed to construct the correlation between MC Nch v.s. centrality //--------------------------- - const float centrality{isT0Ccent ? collision.centFT0C() : collision.centFT0M()}; registry.fill(HIST("Centrality_WRecoEvt"), centrality); registry.fill(HIST("zPosMC"), mccollision.posZ()); @@ -1634,6 +1668,7 @@ struct PiKpRAA { // This is needed for the number of the Tracking Efficiency // and the spectra to be corrected //--------------------------- + int nCh{0}; for (const auto& track : groupedTracks) { // Track Selection if (track.eta() < v0Selections.minEtaDaughter || track.eta() > v0Selections.maxEtaDaughter) @@ -1693,6 +1728,7 @@ struct PiKpRAA { registry.fill(HIST("NclVsPhip"), pOrPt, phiPrime, ncl); registry.fill(HIST("NclVsEtaPID"), eta, ncl); registry.fill(HIST("NclVsEtaPIDp"), eta, ncl); + nCh++; bool isPrimary{false}; if (particle.isPhysicalPrimary()) @@ -1729,6 +1765,7 @@ struct PiKpRAA { } registry.fill(HIST("PtResolution"), particle.pt(), (track.pt() - particle.pt()) / particle.pt()); } // Loop over reconstructed tracks + registry.fill(HIST("NchVsCent"), centrality, nCh); } // Loop over Reco. Collisions: Only the collisions with the largest number of contributors } // If condition: Only simulated evets with at least one reconstrued collision @@ -2093,15 +2130,19 @@ struct PiKpRAA { } registry.fill(HIST("EventCounter"), EvCutLabel::SelEigth); - if (!col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - return false; + if (selNoSameBunchPileup) { + if (!col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + return false; + } + registry.fill(HIST("EventCounter"), EvCutLabel::NoSameBunchPileup); } - registry.fill(HIST("EventCounter"), EvCutLabel::NoSameBunchPileup); - if (!col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - return false; + if (selIsGoodZvtxFT0vsPV) { + if (!col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + registry.fill(HIST("EventCounter"), EvCutLabel::IsGoodZvtxFT0vsPV); } - registry.fill(HIST("EventCounter"), EvCutLabel::IsGoodZvtxFT0vsPV); if (isNoCollInTimeRangeStrict) { if (!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { @@ -2155,6 +2196,13 @@ struct PiKpRAA { registry.fill(HIST("EventCounter"), EvCutLabel::OccuCut); } + if (selHasFT0) { + if (!col.has_foundFT0()) { + return false; + } + registry.fill(HIST("EventCounter"), EvCutLabel::HasFT0); + } + if (isCentSel) { if (col.centFT0C() < minT0CcentCut || col.centFT0C() > maxT0CcentCut) { return false;