diff --git a/PWGLF/Tasks/Resonances/kstar892LightIon.cxx b/PWGLF/Tasks/Resonances/kstar892LightIon.cxx index 238ff319118..5f1b3d84925 100644 --- a/PWGLF/Tasks/Resonances/kstar892LightIon.cxx +++ b/PWGLF/Tasks/Resonances/kstar892LightIon.cxx @@ -82,7 +82,6 @@ struct Kstar892LightIon { struct : ConfigurableGroup { // Configurables for event selections Configurable cfgVrtxZCut{"cfgVrtxZCut", 10.0f, "Accepted z-vertex range (cm)"}; - Configurable isApplycutVzLoss{"isApplycutVzLoss", true, "Apply Vertex-z cut in processAllLossMC"}; Configurable isApplysel8{"isApplysel8", true, "Apply sel8 event selection"}; Configurable isApplyINELgt0{"isApplyINELgt0", true, "INEL>0 selection"}; Configurable isTriggerTVX{"isTriggerTVX", true, "TriggerTVX"}; @@ -99,7 +98,9 @@ struct Kstar892LightIon { Configurable isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"}; // check - Configurable isApplyEvSelFactors{"isApplyEvSelFactors", false, "Apply event selection cut in processCorrFactors"}; + Configurable isApplyMCGenInelgt0{"isApplyMCGenInelgt0", true, "Apply INEL>0 cut in MC Gen Collisions"}; + Configurable isApplyMCGenTVX{"isApplyMCGenTVX", true, "Apply TVX cut in MC Gen Collisions"}; + Configurable isApplyMCGenVz{"isApplyMCGenVz", true, "Apply Vz cut in MC Gen Collisions"}; // Configurables for track selections Configurable isPVContributor{"isPVContributor", true, "PV contributor track selection"}; // PV Contriuibutor @@ -817,7 +818,7 @@ struct Kstar892LightIon { using EventCandidates = soa::Join; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs using TrackCandidates = soa::Join; - using EventMCGenerated = soa::Join; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs + using EventMCGenerated = soa::Join; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs using EventCandidatesMC = soa::Join; using TrackCandidatesMC = soa::Join; @@ -1272,6 +1273,19 @@ struct Kstar892LightIon { void processGen(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { + + if (selectionConfig.isApplyMCGenInelgt0 && !mcCollision.isInelGt0()) { + return; + } + + if (selectionConfig.isApplyMCGenTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) { + return; + } + + if (selectionConfig.isApplyMCGenVz && std::abs(mcCollision.posZ()) >= selectionConfig.cfgVrtxZCut) { + return; + } + std::vector selectedEvents(collisions.size()); int nevts = 0; centrality = -1.0; @@ -1590,8 +1604,20 @@ struct Kstar892LightIon { } PROCESS_SWITCH(Kstar892LightIon, processRec, "Process Reconstructed", false); - void processEvtLossSigLossMC(aod::McCollisions::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& recCollisions) + void processEvtLossSigLossMC(EventMCGenerated::iterator const& mcCollision, const soa::SmallGroups& recCollisions, aod::McParticles const& mcParticles) { + if (selectionConfig.isApplyMCGenInelgt0 && !mcCollision.isInelGt0()) { + return; + } + + if (selectionConfig.isApplyMCGenTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) { + return; + } + + if (selectionConfig.isApplyMCGenVz && std::abs(mcCollision.posZ()) >= selectionConfig.cfgVrtxZCut) { + return; + } + auto impactPar = mcCollision.impactParameter(); hMC.fill(HIST("ImpactCorr/hImpactParameterGen"), impactPar); @@ -1639,11 +1665,21 @@ struct Kstar892LightIon { } PROCESS_SWITCH(Kstar892LightIon, processEvtLossSigLossMC, "Process Signal Loss, Event Loss using impact parameter", false); - using McCollisionMults = soa::Join; - using LabeledTracks = soa::Join; - - void processLossMCMultiplicity(McCollisionMults::iterator const& mcCollision, aod::McParticles const& mcParticles, soa::SmallGroups const& recCollisions) + void processLossMCMultiplicity(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, soa::SmallGroups const& recCollisions) { + + if (selectionConfig.isApplyMCGenInelgt0 && !mcCollision.isInelGt0()) { + return; + } + + if (selectionConfig.isApplyMCGenTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) { + return; + } + + if (selectionConfig.isApplyMCGenVz && std::abs(mcCollision.posZ()) >= selectionConfig.cfgVrtxZCut) { + return; + } + const int multMC = mcCollision.multMCNParticlesEta05(); hMC.fill(HIST("LossMult/hMultMC"), multMC); @@ -1697,10 +1733,19 @@ struct Kstar892LightIon { } PROCESS_SWITCH(Kstar892LightIon, processLossMCMultiplicity, "Signal + Event loss (using MC multiplicity)", false); - void processAllLossMC(McCollisionMults::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& recCollisions) + void processAllLossMC(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& recCollisions) { - if (selectionConfig.isApplycutVzLoss && std::abs(mcCollision.posZ()) > selectionConfig.cfgVrtxZCut) + if (selectionConfig.isApplyMCGenInelgt0 && !mcCollision.isInelGt0()) { + return; + } + + if (selectionConfig.isApplyMCGenTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) { return; + } + + if (selectionConfig.isApplyMCGenVz && std::abs(mcCollision.posZ()) >= selectionConfig.cfgVrtxZCut) { + return; + } // Event loss estimation auto impactPar = mcCollision.impactParameter(); diff --git a/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx b/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx index 3fce22fb5ac..78e07fbd4f4 100644 --- a/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/phianalysisrun3_PbPb.cxx @@ -96,6 +96,7 @@ struct phianalysisrun3_PbPb { Configurable additionalEvSel5{"additionalEvSel5", true, "Additional evsel5"}; Configurable additionalEvSel6{"additionalEvSel6", true, "Additional evsel6"}; Configurable cutvz{"cutvz", true, "Vz cut"}; + Configurable cutvzgen{"cutvzgen", true, "Vz cut"}; Configurable isINELgt0{"isINELgt0", true, "INEL>0 selection"}; } selectionConfig; Configurable cfgMultFT0{"cfgMultFT0", true, "cfgMultFT0"}; @@ -134,7 +135,8 @@ struct phianalysisrun3_PbPb { ConfigurableAxis binsMult{"binsMult", {500, 0.0f, +500.0f}, ""}; Configurable isApplyCentFT0C{"isApplyCentFT0C", true, "Centrality based on FT0C"}; Configurable isApplyCentFT0M{"isApplyCentFV0M", false, "Centrality based on FT0M"}; - + Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; + Configurable isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"}; Configurable genacceptancecut{"genacceptancecut", true, "use acceptance cut for generated"}; // MC Configurable isMC{"isMC", false, "Run MC"}; @@ -1693,59 +1695,77 @@ struct phianalysisrun3_PbPb { } } PROCESS_SWITCH(phianalysisrun3_PbPb, processMixedEventMC, "Process Mixed event MC", true); - void processGen1(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) + void processGen1(McCollisionMults::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { + // all events histos.fill(HIST("hMC1"), 0.5); - if (!selectionConfig.cutvz || std::abs(mcCollision.posZ()) < selectionConfig.cfgCutVertex) { + + // vertex QA (not selection) + if (!selectionConfig.cutvzgen || + std::abs(mcCollision.posZ()) < selectionConfig.cfgCutVertex) { histos.fill(HIST("hMC1"), 1.5); } + + // INEL>0 selection + if (isApplyInelgt0 && !mcCollision.isInelGt0()) + return; + + histos.fill(HIST("hMC1"), 2.5); + + // TVX selection + if (isApplyTVX && + !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) + return; + + histos.fill(HIST("hMC1"), 3.5); std::vector selectedEvents(collisions.size()); int nevts = 0; auto multiplicity = -1.0; for (const auto& collision : collisions) { - histos.fill(HIST("hMC1"), 2.5); + histos.fill(HIST("hMC1"), 4.5); if (cfgDoSel8 && !collision.sel8()) { continue; } + histos.fill(HIST("hMC1"), 5.5); if (selectionConfig.cutvz && std::abs(collision.mcCollision().posZ()) > selectionConfig.cfgCutVertex) { continue; } - histos.fill(HIST("hMC1"), 3.5); + histos.fill(HIST("hMC1"), 6.5); if (selectionConfig.additionalEvSel1 && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { continue; } - histos.fill(HIST("hMC1"), 4.5); + histos.fill(HIST("hMC1"), 7.5); if (selectionConfig.additionalEvSel2 && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { continue; } - histos.fill(HIST("hMC1"), 5.5); + histos.fill(HIST("hMC1"), 8.5); if (selectionConfig.additionalEvSel3 && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { continue; } - histos.fill(HIST("hMC1"), 6.5); + histos.fill(HIST("hMC1"), 9.5); if (selectionConfig.additionalEvSel4 && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { continue; } - histos.fill(HIST("hMC1"), 7.5); + histos.fill(HIST("hMC1"), 10.5); if (selectionConfig.additionalEvSel5 && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { continue; } - histos.fill(HIST("hMC1"), 8.5); + histos.fill(HIST("hMC1"), 11.5); if (selectionConfig.additionalEvSel6 && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { continue; } - histos.fill(HIST("hMC1"), 9.5); + histos.fill(HIST("hMC1"), 12.5); if (selectionConfig.isINELgt0 && !collision.isInelGt0()) { continue; } - histos.fill(HIST("hMC1"), 10.5); + histos.fill(HIST("hMC1"), 13.5); int occupancy = collision.trackOccupancyInTimeRange(); if (selectionConfig.fillOccupancy && (occupancy < cfgMinOccupancy || occupancy > cfgMaxOccupancy)) { continue; } - histos.fill(HIST("hMC1"), 11.5); + histos.fill(HIST("hMC1"), 14.5); const int kCentFT0C = 0; const int kCentFT0A = 1; const int kCentFT0M = 2; @@ -1765,11 +1785,11 @@ struct phianalysisrun3_PbPb { } selectedEvents.resize(nevts); const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); - histos.fill(HIST("hMC1"), 12.5); + histos.fill(HIST("hMC1"), 15.5); if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection return; } - histos.fill(HIST("hMC1"), 13.5); + histos.fill(HIST("hMC1"), 16.5); for (const auto& mcParticle : mcParticles) { if (mcParticle.y() < rapiditycut1 || mcParticle.y() > rapiditycut2) { @@ -1861,7 +1881,7 @@ struct phianalysisrun3_PbPb { multiplicity = collision.centFV0A(); } histos.fill(HIST("Centrec1"), multiplicity); - histos.fill(HIST("hMC1"), 14.5); + histos.fill(HIST("hMC1"), 17.5); auto oldindex = -999; for (const auto& track1 : tracks) { if (!selectionTrack(track1)) { @@ -1958,10 +1978,17 @@ struct phianalysisrun3_PbPb { void processEvtLossSigLossMC(McCollisionMults::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& recCollisions) { - if (selectionConfig.cutvz && + if (selectionConfig.cutvzgen && std::abs(mcCollision.posZ()) > selectionConfig.cfgCutVertex) { return; } + if (isApplyInelgt0 && !mcCollision.isInelGt0()) { + return; + } + + if (isApplyTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) { + return; + } // Event loss estimation auto impactPar = mcCollision.impactParameter(); histos.fill(HIST("QAevent/hImpactParameterGen"), impactPar); @@ -2026,10 +2053,17 @@ struct phianalysisrun3_PbPb { PROCESS_SWITCH(phianalysisrun3_PbPb, processEvtLossSigLossMC, "Process Signal Loss, Event Loss", false); void processEvtLossSigLossMC1(McCollisionMults::iterator const& mcCollision, soa::SmallGroups const& collisions, aod::McParticles const& GenParticles) { - if (selectionConfig.cutvz && + if (selectionConfig.cutvzgen && std::abs(mcCollision.posZ()) > selectionConfig.cfgCutVertex) { return; } + if (isApplyInelgt0 && !mcCollision.isInelGt0()) { + return; + } + + if (isApplyTVX && !(mcCollision.multMCFT0C() > 0 && mcCollision.multMCFT0A() > 0)) { + return; + } // All generated events histos.fill(HIST("MCEventHist"), 1); histos.fill(HIST("hImpactParameterGen1"), mcCollision.impactParameter());