diff --git a/PWGLF/Tasks/Resonances/kstarInOO.cxx b/PWGLF/Tasks/Resonances/kstarInOO.cxx index 17ba713c086..64edb8f43a7 100644 --- a/PWGLF/Tasks/Resonances/kstarInOO.cxx +++ b/PWGLF/Tasks/Resonances/kstarInOO.cxx @@ -66,7 +66,10 @@ struct kstarInOO { // Event Selection Configurable cfgEventVtxCut{"cfgEventVtxCut", 10.0, "V_z cut selection"}; - ConfigurableAxis cfgCentAxis{"cfgCentAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; + ConfigurableAxis cfgCentAxis{"cfgCentAxis", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0}, "Binning of the centrality axis"}; + Configurable cfgOccupancySel{"cfgOccupancySel", false, "Occupancy selection"}; + Configurable cfgOccupancyMax{"cfgOccupancyMax", 999999, "maximum occupancy of tracks in neighbouring collisions in a given time range"}; + Configurable cfgOccupancyMin{"cfgOccupancyMin", -100, "minimum occupancy of tracks in neighbouring collisions in a given time range"}; // Track Selection // General @@ -90,6 +93,11 @@ struct kstarInOO { // PID Configurable cfgTrackTPCPID{"cfgTrackTPCPID", true, "Enables TPC PID"}; Configurable cfgTrackTOFPID{"cfgTrackTOFPID", true, "Enables TOF PID"}; + Configurable cfgTrackSquarePIDCut{"cfgTrackSqurePIDCut", true, "Enables PID cut shape square switch"}; + Configurable cfgTrackCirclePIDCut{"cfgTrackCirclePIDCut", true, "Enables PID cut shape circle switch"}; + Configurable cfgTrackCircleValue{"cfgTrackCircleValue", 2, "Enables TOF TPC PID circle cut value"}; + Configurable cfgTrackTOFHard{"cfgTrackTOFHard", false, "Enables TOF Hard"}; + Configurable cfgTrackTPCPIDnSig{"cfgTrackTPCPIDnSig", 4.0, "nTPC PID sigma"}; Configurable cfgTrackTOFPIDnSig{"cfgTrackTOFPIDnSig", 4.0, "nTOF PID sigma"}; Configurable cDebugLevel{"cDebugLevel", 0, "Resolution of Debug"}; @@ -98,6 +106,7 @@ struct kstarInOO { ConfigurableAxis cfgBinsMixMult{"cfgBinsCent", {VARIABLE_WIDTH, 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Binning of the centrality axis"}; ConfigurableAxis cfgBinsMixVtx{"cfgBinsMixVtx", {VARIABLE_WIDTH, -10.0f, -5.f, 0.f, 5.f, 10.f}, "Mixing bins - z-vertex"}; Configurable cfgMixNMixedEvents{"cfgMixNMixedEvents", 10, "Number of mixed events per event"}; + Configurable cfgVtxMixCut{"cfgVtxMixCut", 10, "Vertex Mix Cut"}; // MCGen Configurable cfgForceGenReco{"cfgForceGenReco", false, "Only consider events which are reconstructed (neglect event-loss)"}; @@ -181,14 +190,8 @@ struct kstarInOO { } if (cfgMcHistos) { - histos.add("hPion_PID_Purity", "hPion_PID_Purity", kTH1F, {{3, -1.5, 1.5}}); - histos.add("hKaon_PID_Purity", "hKaon_PID_Purity", kTH1F, {{3, -1.5, 1.5}}); - histos.add("hSimplePion_PID_Purity", "hSimplePion_PID_Purity", kTH1F, {{3, -1.5, 1.5}}); - histos.add("hSimpleKaon_PID_Purity", "hSimpleKaon_PID_Purity", kTH1F, {{3, -1.5, 1.5}}); - histos.add("nEvents_MC", "nEvents_MC", kTH1F, {{4, 0.0, 4.0}}); histos.add("nEvents_MC_True", "nEvents_MC_True", kTH1F, {{4, 0.0, 4.0}}); - histos.add("hMC_kstar_True", "hMC_kstar_True", kTHnSparseF, {cfgCentAxis, ptAxis}); histos.add("hMC_USS_True", "hMC_USS_True", kTHnSparseF, {cfgCentAxis, ptAxis, minvAxis}); @@ -248,6 +251,10 @@ struct kstarInOO { return false; if (!event.selection_bit(aod::evsel::kNoCollInTimeRangeStandard)) return false; + if (!event.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) + return false; + if (cfgOccupancySel && (event.trackOccupancyInTimeRange() > cfgOccupancyMax || event.trackOccupancyInTimeRange() < cfgOccupancyMin)) + return false; if (cfgEventCutQA) { histos.fill(HIST("hPosZ_AC"), event.posZ()); @@ -322,19 +329,42 @@ struct kstarInOO { histos.fill(HIST("QA_nSigma_kaon_TOF_BC"), candidate.pt(), candidate.tofNSigmaKa()); histos.fill(HIST("QA_kaon_TPC_TOF_BC"), candidate.tpcNSigmaKa(), candidate.tofNSigmaKa()); } - + double tpcpid = 0; + double tofpid = 0; bool tpcPIDPassed{false}, tofPIDPassed{false}; // TPC - if (std::abs(candidate.tpcNSigmaKa()) < cfgTrackTPCPIDnSig) - tpcPIDPassed = true; - // TOF - if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaKa()) < cfgTrackTOFPIDnSig) { + if (cfgTrackSquarePIDCut) { + if (std::abs(candidate.tpcNSigmaKa()) < cfgTrackTPCPIDnSig) + tpcPIDPassed = true; + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaKa()) < cfgTrackTOFPIDnSig) { + tofPIDPassed = true; + } + } else { + if (!cfgTrackTOFHard) { + tofPIDPassed = true; + } else { + tofPIDPassed = false; + } + } + } // end of square cut + if (cfgTrackCirclePIDCut) { + if (std::abs(candidate.tpcNSigmaKa()) < cfgTrackTPCPIDnSig) + tpcpid = std::abs(candidate.tpcNSigmaKa()); + tofpid = 0; + + if (candidate.hasTOF()) { + tofpid = std::abs(candidate.tofNSigmaKa()); + } else { + if (cfgTrackTOFHard) { + tofpid = 999; + } + } + if (std::sqrt(tpcpid * tpcpid + tofpid * tofpid) < cfgTrackCircleValue) { + tpcPIDPassed = true; tofPIDPassed = true; } - } else { - tofPIDPassed = true; - } + } // circular cut // TPC & TOF if (tpcPIDPassed && tofPIDPassed) { if (cfgTrackCutQA && QA) { @@ -355,18 +385,44 @@ struct kstarInOO { histos.fill(HIST("QA_nSigma_pion_TOF_BC"), candidate.pt(), candidate.tofNSigmaPi()); histos.fill(HIST("QA_pion_TPC_TOF_BC"), candidate.tpcNSigmaPi(), candidate.tofNSigmaPi()); } + double tpcpid = 0; + double tofpid = 0; bool tpcPIDPassed{false}, tofPIDPassed{false}; // TPC - if (std::abs(candidate.tpcNSigmaPi()) < cfgTrackTPCPIDnSig) - tpcPIDPassed = true; - if (candidate.hasTOF()) { - if (std::abs(candidate.tofNSigmaPi()) < cfgTrackTOFPIDnSig) { + if (cfgTrackSquarePIDCut) { + if (std::abs(candidate.tpcNSigmaPi()) < cfgTrackTPCPIDnSig) + tpcPIDPassed = true; + if (candidate.hasTOF()) { + if (std::abs(candidate.tofNSigmaPi()) < cfgTrackTOFPIDnSig) { + tofPIDPassed = true; + } + } else { + if (!cfgTrackTOFHard) { + tofPIDPassed = true; + } else { + tofPIDPassed = false; + } + } + } // end of square cut + if (cfgTrackCirclePIDCut) { + if (std::abs(candidate.tpcNSigmaPi()) < cfgTrackTPCPIDnSig) + tpcpid = std::abs(candidate.tpcNSigmaPi()); + tofpid = 0; + + if (candidate.hasTOF()) { + tofpid = std::abs(candidate.tofNSigmaPi()); + } else { + if (cfgTrackTOFHard) { + tofpid = 999; + } + } + if (std::sqrt(tpcpid * tpcpid + tofpid * tofpid) < cfgTrackCircleValue) { + tpcPIDPassed = true; tofPIDPassed = true; } - } else { - tofPIDPassed = true; - } - // TPC & TOF + } // circular cut + + // TPC & TOF if (tpcPIDPassed && tofPIDPassed) { if (cfgTrackCutQA && QA) { histos.fill(HIST("QA_nSigma_pion_TPC_AC"), candidate.pt(), candidate.tpcNSigmaPi()); @@ -421,8 +477,6 @@ struct kstarInOO { auto centrality = collision1.centFT0C(); std::vector mcMemory; - std::vector PIDPurityKey_Kaon; - std::vector PIDPurityKey_Pion; for (const auto& [trk1, trk2] : combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!trk1.has_mcParticle() || !trk2.has_mcParticle()) @@ -544,9 +598,6 @@ struct kstarInOO { if (!trackPIDKaon(trk1, QA) || !trackPIDPion(trk2, QA)) return {-1.0, -1.0}; - // if (trk1.index() >= trk2.index()) - // return {-1.0, -1.0}; - // I checked that index and globalIndex was same function if (trk1.globalIndex() >= trk2.globalIndex()) return {-1.0, -1.0}; @@ -626,9 +677,20 @@ struct kstarInOO { } auto goodEv1 = eventSelection(collision1); auto goodEv2 = eventSelection(collision2); + bool VtxMixFlag = false; + bool CentMixFlag = false; + // bool OccupanacyMixFlag = false; + if (std::fabs(collision1.posZ() - collision2.posZ()) <= cfgVtxMixCut) // set default to maybe 10 + VtxMixFlag = true; + if (std::fabs(collision1.centFT0C() - collision2.centFT0C()) <= cfgVtxMixCut) // set default to maybe 10 + CentMixFlag = true; if (!goodEv1 || !goodEv2) continue; + if (!CentMixFlag) + continue; + if (!VtxMixFlag) + continue; TrackSlicing(collision1, tracks1, collision2, tracks2, true, false); } @@ -669,36 +731,6 @@ struct kstarInOO { if (!INELgt0) return; - auto tracks1 = kaonMC->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - for (const auto& kaon : tracks1) { - if (!trackSelection(kaon, false)) - continue; - if (!trackPIDKaon(kaon, false)) - continue; - auto particle1 = kaon.mcParticle(); - if (std::fabs(particle1.pdgCode()) == 321) - histos.fill(HIST("hSimpleKaon_PID_Purity"), 1); // histogram with two bins, -1.5, 1.5 fill 1 or -1 - else if (std::fabs(particle1.pdgCode()) == 211) - histos.fill(HIST("hSimpleKaon_PID_Purity"), -1); // histogram with two bins, -1.5, 1.5 fill 1 or -1 - else - histos.fill(HIST("hSimpleKaon_PID_Purity"), 0); // histogram with two bins, -1.5, 1.5 fill 1 or -1 - } - - auto tracks2 = pionMC->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - for (const auto& pion : tracks2) { - if (!trackSelection(pion, false)) - continue; - if (!trackPIDPion(pion, false)) - continue; - auto particle2 = pion.mcParticle(); - if (std::fabs(particle2.pdgCode()) == 211) - histos.fill(HIST("hSimplePion_PID_Purity"), 1); // histogram with two bins, -1.5, 1.5 fill 1 or -1 - else if (std::fabs(particle2.pdgCode()) == 321) - histos.fill(HIST("hSimplePion_PID_Purity"), -1); // histogram with two bins, -1.5, 1.5 fill 1 or -1 - else - histos.fill(HIST("hSimplePion_PID_Purity"), 0); // histogram with two bins, -1.5, 1.5 fill 1 or -1 - } - if (cfgMcHistos) { histos.fill(HIST("nEvents_MC"), 1.5); }