diff --git a/PWGLF/Tasks/Resonances/kstar892LightIon.cxx b/PWGLF/Tasks/Resonances/kstar892LightIon.cxx index 8c4da69d91f..958697541a3 100644 --- a/PWGLF/Tasks/Resonances/kstar892LightIon.cxx +++ b/PWGLF/Tasks/Resonances/kstar892LightIon.cxx @@ -14,8 +14,6 @@ /// \author Subhadeep Mandal /// \since 22/11/2025 -#include "PWGLF/DataModel/mcCentrality.h" - #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -63,8 +61,15 @@ using namespace o2::aod::rctsel; struct Kstar892LightIon { SliceCache cache; + // Histograms are defined with HistogramRegistry + HistogramRegistry hEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hInvMass{"InvMass", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hMC{"MC", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hPID{"PID", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry hOthers{"Others", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + struct : ConfigurableGroup { - Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; + Configurable requireRCTFlagChecker{"requireRCTFlagChecker", false, "Check event quality in run condition table"}; Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; Configurable cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", false, "Evt sel: RCT flag checker ZDC check"}; Configurable cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; @@ -73,7 +78,7 @@ struct Kstar892LightIon { struct : ConfigurableGroup { // Configurables for event selections - Configurable cutVrtxZ{"cutVrtxZ", 10.0f, "Accepted z-vertex range (cm)"}; + Configurable cfgVrtxZCut{"cfgVrtxZCut", 10.0f, "Accepted z-vertex range (cm)"}; Configurable isTriggerTVX{"isTriggerTVX", true, "TriggerTVX"}; Configurable isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", true, "IsGoodZvtxFT0vsPV"}; Configurable isApplyOccCut{"isApplyOccCut", false, "Apply occupancy cut"}; @@ -88,8 +93,8 @@ struct Kstar892LightIon { Configurable isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"}; // Configurables for track selections - Configurable cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; // PV Contriuibutor - Configurable cfgPrimaryTrack{"cfgPrimaryTrack", false, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable isPVContributor{"isPVContributor", true, "PV contributor track selection"}; // PV Contriuibutor + Configurable isPrimaryTrack{"isPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz Configurable isGlobalTracks{"isGlobalTracks", true, "isGlobalTracks"}; Configurable cfgCutPT{"cfgCutPT", 0.1f, "PT cut on daughter track"}; @@ -103,10 +108,14 @@ struct Kstar892LightIon { Configurable cfgITSChi2NCl{"cfgITSChi2NCl", 36.0, "ITS Chi2/NCl"}; Configurable cfgTPCChi2NClMax{"cfgTPCChi2NClMax", 4.0, "TPC Chi2/NCl"}; Configurable cfgTPCChi2NClMin{"cfgTPCChi2NClMin", 0.0, "TPC Chi2/NCl"}; - Configurable cfgUseITSTPCRefit{"cfgUseITSTPCRefit", false, "Require ITS Refit"}; + Configurable isUseITSTPCRefit{"isUseITSTPCRefit", false, "Require ITS Refit"}; Configurable isApplyPtDepDCAxyCut{"isApplyPtDepDCAxyCut", false, "Apply pT dependent DCAxy cut"}; Configurable isGoldenChi2{"isGoldenChi2", false, "Apply golden chi2 cut"}; Configurable cfgDeepAngle{"cfgDeepAngle", 0.04, "Deep Angle cut value"}; + // Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", false, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) + Configurable cfgBetaCutTOF{"cfgBetaCutTOF", 0.0, "cut TOF beta"}; + + Configurable isAvoidsplitrackMC{"isAvoidsplitrackMC", true, "avoid split track in MC"}; // cuts on mother // Configurable isApplyCutsOnMother{"isApplyCutsOnMother", false, "Enable additional cuts on Kstar mother"}; @@ -114,6 +123,12 @@ struct Kstar892LightIon { // Configurable cMaxMinvMotherCut{"cMaxMinvMotherCut", 1.5, "Maximum mass of mother cut"}; Configurable motherRapidityCut{"motherRapidityCut", 0.5, "Maximum rapidity of mother"}; // PID selections + + Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; + Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; + Configurable onlyTPC{"onlyTPC", false, "only TPC tracks"}; + Configurable isApplypTdepPID{"isApplypTdepPID", false, "Apply pT dependent PID"}; + Configurable nsigmaCutTPCPi{"nsigmaCutTPCPi", 3.0, "TPC Nsigma cut for pions"}; Configurable nsigmaCutTPCKa{"nsigmaCutTPCKa", 3.0, "TPC Nsigma cut for kaons"}; Configurable nsigmaCutTOFPi{"nsigmaCutTOFPi", 3.0, "TOF Nsigma cut for pions"}; @@ -125,13 +140,6 @@ struct Kstar892LightIon { float lowPtCutPID = 0.5; } selectionConfig; - // Histograms are defined with HistogramRegistry - HistogramRegistry hEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry hInvMass{"InvMass", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry hMC{"MC", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry hPID{"PID", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry hOthers{"Others", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - Configurable calcLikeSign{"calcLikeSign", true, "Calculate Like Sign"}; Configurable calcRotational{"calcRotational", true, "Calculate Rotational"}; Configurable cRotations{"cRotations", 3, "Number of random rotations in the rotational background"}; @@ -140,21 +148,13 @@ struct Kstar892LightIon { // Confugrable for QA histograms Configurable cQAplots{"cQAplots", true, "cQAplots"}; Configurable cQAevents{"cQAevents", true, "centrality dist, DCAxy, DCAz"}; - Configurable onlyTOF{"onlyTOF", false, "only TOF tracks"}; - Configurable onlyTOFHIT{"onlyTOFHIT", false, "accept only TOF hit tracks at high pt"}; - Configurable onlyTPC{"onlyTPC", false, "only TPC tracks"}; - Configurable cSelectMultEstimator{"cSelectMultEstimator", 0, "Select centrality estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C, 3 - FV0A"}; - Configurable applypTdepPID{"applypTdepPID", false, "Apply pT dependent PID"}; - // Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", false, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) - Configurable cBetaCutTOF{"cBetaCutTOF", 0.0, "cut TOF beta"}; + Configurable selectCentEstimator{"selectCentEstimator", 0, "Select centrality estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C, 3 - FV0A"}; // Configurable for histograms - Configurable avoidsplitrackMC{"avoidsplitrackMC", true, "avoid split track in MC"}; - ConfigurableAxis binsCentPlot{"binsCentPlot", {110, 0.0, 110}, "THnSpare centrality axis"}; + ConfigurableAxis binsCentPlot{"binsCentPlot", {110, 0.0, 110}, "Centrality axis"}; ConfigurableAxis axisdEdx{"axisdEdx", {1, 0.0f, 200.0f}, "dE/dx (a.u.)"}; ConfigurableAxis axisPtfordEbydx{"axisPtfordEbydx", {1, 0, 20}, "pT (GeV/c)"}; - // ConfigurableAxis axisMultdist{"axisMultdist", {1, 0, 70000}, "centrality distribution"}; ConfigurableAxis invMassKstarAxis{"invMassKstarAxis", {300, 0.7f, 1.3f}, "Kstar invariant mass axis"}; ConfigurableAxis ptAxisKstar{"ptAxisKstar", {200, 0.0f, 20.0f}, "Kstar pT axis"}; ConfigurableAxis binsImpactPar{"binsImpactPar", {100, 0, 25}, "Binning of the impact parameter axis"}; @@ -186,16 +186,17 @@ struct Kstar892LightIon { { rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); // Axes - AxisSpec vertexZAxis = {60, -15., 15., "vrtx_{Z} [cm] for plots"}; + AxisSpec vertexZAxis = {60, -15., 15., "V_{Z} (cm) for plots"}; AxisSpec ptAxis = {ptAxisKstar, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec invmassAxis = {invMassKstarAxis, "Invariant mass (GeV/#it{c}^{2})"}; - AxisSpec centralityAxis = {binsCentPlot, "centrality Axis"}; + AxisSpec centralityAxis = {binsCentPlot, "Centrality Axis"}; AxisSpec impactParAxis = {binsImpactPar, "Impact Parameter (cm)"}; // Histograms // Event selection hEventSelection.add("hVertexZ", "hVertexZ", kTH1F, {vertexZAxis}); hEventSelection.add("hCentrality", "Centrality percentile", kTH1F, {{110, 0, 110}}); + hEventSelection.add("hOccupancy", "Occupancy distribution", kTH1F, {{1000, 0, 15000}}); hEventSelection.add("hEventCut", "No. of event after cuts", kTH1D, {{20, 0, 20}}); std::shared_ptr hCutFlow = hEventSelection.get(HIST("hEventCut")); @@ -204,7 +205,7 @@ struct Kstar892LightIon { std::vector eveCutLabels = { "All Events", - Form("|Vz| < %.1f", selectionConfig.cutVrtxZ.value), + Form("|Vz| < %.1f", selectionConfig.cfgVrtxZCut.value), "sel8", std::string("kNoTimeFrameBorder") + check(selectionConfig.isNoTimeFrameBorder.value), std::string("kNoITSROFrameBorder") + check(selectionConfig.isNoITSROFrameBorder.value), @@ -268,34 +269,34 @@ struct Kstar892LightIon { } // KStar histograms - hInvMass.add("h3KstarInvMassUnlikeSign", "kstar Unlike Sign", kTHnSparseF, {centralityAxis, ptAxis, invmassAxis}); - hInvMass.add("h3KstarInvMassMixed", "kstar Mixed", kTHnSparseF, {centralityAxis, ptAxis, invmassAxis}); + hInvMass.add("h3KstarInvMassUnlikeSign", "kstar Unlike Sign", kTH3F, {centralityAxis, ptAxis, invmassAxis}); + hInvMass.add("h3KstarInvMassMixed", "kstar Mixed", kTH3F, {centralityAxis, ptAxis, invmassAxis}); if (calcLikeSign) { - hInvMass.add("h3KstarInvMasslikeSignPP", "kstar like Sign", kTHnSparseF, {centralityAxis, ptAxis, invmassAxis}); - hInvMass.add("h3KstarInvMasslikeSignMM", "kstar like Sign", kTHnSparseF, {centralityAxis, ptAxis, invmassAxis}); + hInvMass.add("h3KstarInvMasslikeSignPP", "kstar like Sign", kTH3F, {centralityAxis, ptAxis, invmassAxis}); + hInvMass.add("h3KstarInvMasslikeSignMM", "kstar like Sign", kTH3F, {centralityAxis, ptAxis, invmassAxis}); } if (calcRotational) - hInvMass.add("h3KstarInvMassRotated", "kstar rotated", kTHnSparseF, {centralityAxis, ptAxis, invmassAxis}); + hInvMass.add("h3KstarInvMassRotated", "kstar rotated", kTH3F, {centralityAxis, ptAxis, invmassAxis}); // MC histograms if (doprocessGen) { - hMC.add("hk892GenpT", "pT distribution of True MC K(892)0", kTHnSparseF, {ptAxis, centralityAxis}); - hMC.add("hk892GenpT2", "pT distribution of True MC K(892)0", kTHnSparseF, {ptAxis, centralityAxis}); - hMC.add("h1genmass", "Invariant mass of generated kstar meson", kTH1F, {invmassAxis}); - hMC.add("h1GenCent", "centrality generated", kTH1F, {centralityAxis}); - hMC.add("hAllGenCollisions", "All generated events", kTH1F, {centralityAxis}); - hMC.add("hAllGenCollisions1Rec", "All gen events with at least one rec event", kTH1F, {centralityAxis}); - hMC.add("hAllKstarGenCollisisons", "All generated Kstar in events with rapidity in 0.5", kTH2F, {ptAxis, centralityAxis}); - hMC.add("hAllKstarGenCollisisons1Rec", "All generated Kstar in events with at least one rec event in rapidity in 0.5", kTH2F, {ptAxis, centralityAxis}); + hMC.add("Gen/hk892GenpT", "pT distribution of True MC K(892)0", kTH2F, {ptAxis, centralityAxis}); + hMC.add("Gen/hk892GenpT2", "pT distribution of True MC K(892)0", kTH2F, {ptAxis, centralityAxis}); + hMC.add("Gen/h1genmass", "Invariant mass of generated kstar meson", kTH1F, {invmassAxis}); + hMC.add("Gen/h1GenCent", "centrality generated", kTH1F, {centralityAxis}); + hMC.add("Gen/hAllGenCollisions", "All generated events", kTH1F, {centralityAxis}); + hMC.add("Gen/hAllGenCollisions1Rec", "All gen events with at least one rec event", kTH1F, {centralityAxis}); + hMC.add("Gen/hAllKstarGenCollisisons", "All generated Kstar in events with rapidity in 0.5", kTH2F, {ptAxis, centralityAxis}); + hMC.add("Gen/hAllKstarGenCollisisons1Rec", "All generated Kstar in events with at least one rec event in rapidity in 0.5", kTH2F, {ptAxis, centralityAxis}); } if (doprocessRec) { - hMC.add("hAllRecCollisions", "All reconstructed events", kTH1F, {centralityAxis}); - hMC.add("h1KstarRecMass", "Invariant mass of kstar meson", kTH1F, {invmassAxis}); - hMC.add("h2KstarRecpt1", "pT of kstar meson", kTHnSparseF, {ptAxis, centralityAxis, invmassAxis}); - hMC.add("h2KstarRecpt2", "pT of kstar meson", kTHnSparseF, {ptAxis, centralityAxis, invmassAxis}); - hMC.add("h1RecCent", "centrality reconstructed", kTH1F, {centralityAxis}); - hMC.add("h1KSRecsplit", "KS meson Rec split", kTH1F, {{100, 0.0f, 10.0f}}); + hMC.add("Rec/hAllRecCollisions", "All reconstructed events", kTH1F, {centralityAxis}); + hMC.add("Rec/h1KstarRecMass", "Invariant mass of kstar meson", kTH1F, {invmassAxis}); + hMC.add("Rec/h2KstarRecpt1", "pT of kstar meson", kTH3F, {ptAxis, centralityAxis, invmassAxis}); + hMC.add("Rec/h2KstarRecpt2", "pT of kstar meson", kTH3F, {ptAxis, centralityAxis, invmassAxis}); + hMC.add("Rec/h1RecCent", "centrality reconstructed", kTH1F, {centralityAxis}); + hMC.add("Rec/h1KSRecsplit", "KS meson Rec split", kTH1F, {{100, 0.0f, 10.0f}}); } // Signal Loss & Event Loss @@ -319,43 +320,6 @@ struct Kstar892LightIon { hMC.add("CorrFactors/h2dGenKstar", "Centrality vs p_{T}", kTH2D, {{101, 0.0f, 101.0f}, ptAxis}); hMC.add("CorrFactors/h3dGenKstarVsMultMCVsCentrality", "MC centrality vs centrality vs p_{T}", kTH3D, {axisNch, {101, 0.0f, 101.0f}, ptAxis}); } - - hEventSelection.add("tracksCheckData", "No. of events in the data", kTH1I, {{10, 0, 10}}); - hEventSelection.add("eventsCheckGen", "No. of events in the generated MC", kTH1I, {{10, 0, 10}}); - hEventSelection.add("recMCparticles", "No. of events in the reconstructed MC", kTH1I, {{20, 0, 20}}); - hEventSelection.add("hOccupancy", "Occupancy distribution", kTH1F, {{1000, 0, 15000}}); - - std::shared_ptr hrecLabel = hEventSelection.get(HIST("recMCparticles")); - hrecLabel->GetXaxis()->SetBinLabel(1, "All tracks"); - hrecLabel->GetXaxis()->SetBinLabel(2, "has_MC"); - hrecLabel->GetXaxis()->SetBinLabel(3, "Track selection"); - hrecLabel->GetXaxis()->SetBinLabel(4, "StrictlyUpperIndex"); - hrecLabel->GetXaxis()->SetBinLabel(5, "Unlike Sign"); - hrecLabel->GetXaxis()->SetBinLabel(6, "Physical Primary"); - hrecLabel->GetXaxis()->SetBinLabel(7, "TrackPDG Check1"); - hrecLabel->GetXaxis()->SetBinLabel(8, "TrackPDG Check2"); - hrecLabel->GetXaxis()->SetBinLabel(9, "Global Index"); - hrecLabel->GetXaxis()->SetBinLabel(10, "Generator"); - hrecLabel->GetXaxis()->SetBinLabel(11, "Mother y"); - hrecLabel->GetXaxis()->SetBinLabel(12, "Mother PDG"); - hrecLabel->GetXaxis()->SetBinLabel(13, "Track PID"); - hrecLabel->GetXaxis()->SetBinLabel(14, "Track MID"); - hrecLabel->GetXaxis()->SetBinLabel(15, "Track y"); - hrecLabel->GetXaxis()->SetBinLabel(16, "Split tracks"); - hrecLabel->GetXaxis()->SetBinLabel(17, "DeepAngle Cut"); - - std::shared_ptr hDataTracks = hEventSelection.get(HIST("tracksCheckData")); - hDataTracks->GetXaxis()->SetBinLabel(1, "All tracks"); - hDataTracks->GetXaxis()->SetBinLabel(2, "Track selection"); - hDataTracks->GetXaxis()->SetBinLabel(3, "PID Cut"); - hDataTracks->GetXaxis()->SetBinLabel(4, "Remove Fake Tracks"); - hDataTracks->GetXaxis()->SetBinLabel(5, "Rapidity Cut"); - hDataTracks->GetXaxis()->SetBinLabel(6, "MID"); - hDataTracks->GetXaxis()->SetBinLabel(7, "DeepAngle Cut"); - - std::shared_ptr hGenTracks = hEventSelection.get(HIST("eventsCheckGen")); - hGenTracks->GetXaxis()->SetBinLabel(1, "All events"); - hGenTracks->GetXaxis()->SetBinLabel(4, "Event Reconstructed"); } double massPi = o2::constants::physics::MassPiPlus; @@ -367,7 +331,7 @@ struct Kstar892LightIon { if (fillHist) hEventSelection.fill(HIST("hEventCut"), 0); - if (std::abs(collision.posZ()) > selectionConfig.cutVrtxZ) + if (std::abs(collision.posZ()) > selectionConfig.cfgVrtxZCut) return false; if (fillHist) hEventSelection.fill(HIST("hEventCut"), 1); @@ -469,9 +433,9 @@ struct Kstar892LightIon { return false; if (candidate.tpcChi2NCl() >= selectionConfig.cfgTPCChi2NClMax || candidate.tpcChi2NCl() < selectionConfig.cfgTPCChi2NClMin) return false; - if (selectionConfig.cfgPVContributor && !candidate.isPVContributor()) + if (selectionConfig.isPVContributor && !candidate.isPVContributor()) return false; - if (selectionConfig.cfgUseITSTPCRefit && (!(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit))) + if (selectionConfig.isUseITSTPCRefit && (!(o2::aod::track::ITSrefit) || !(o2::aod::track::TPCrefit))) return false; } else if (!selectionConfig.isGlobalTracks) { if (std::abs(candidate.pt()) < selectionConfig.cfgCutPT) @@ -494,9 +458,9 @@ struct Kstar892LightIon { return false; if (candidate.tpcChi2NCl() >= selectionConfig.cfgTPCChi2NClMax || candidate.tpcChi2NCl() < selectionConfig.cfgTPCChi2NClMin) return false; - if (selectionConfig.cfgPVContributor && !candidate.isPVContributor()) + if (selectionConfig.isPVContributor && !candidate.isPVContributor()) return false; - if (selectionConfig.cfgPrimaryTrack && !candidate.isPrimaryTrack()) + if (selectionConfig.isPrimaryTrack && !candidate.isPrimaryTrack()) return false; } @@ -525,23 +489,23 @@ struct Kstar892LightIon { bool selectionPID(const T& candidate, int PID) { if (PID == PIDParticle::kPion) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < selectionConfig.nsigmaCutTOFPi && candidate.beta() > cBetaCutTOF) { + if (selectionConfig.onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < selectionConfig.nsigmaCutTOFPi && candidate.beta() > selectionConfig.cfgBetaCutTOF) { return true; } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < selectionConfig.nsigmaCutTOFPi && candidate.beta() > cBetaCutTOF) { + } else if (selectionConfig.onlyTOFHIT) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaPi()) < selectionConfig.nsigmaCutTOFPi && candidate.beta() > selectionConfig.cfgBetaCutTOF) { return true; } if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCPi) { return true; } - } else if (onlyTPC) { + } else if (selectionConfig.onlyTPC) { if (std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCPi) { return true; } } else { - if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (selectionConfig.nsigmaCutCombinedPi * selectionConfig.nsigmaCutCombinedPi) && candidate.beta() > cBetaCutTOF) { + if (candidate.hasTOF() && (candidate.tofNSigmaPi() * candidate.tofNSigmaPi() + candidate.tpcNSigmaPi() * candidate.tpcNSigmaPi()) < (selectionConfig.nsigmaCutCombinedPi * selectionConfig.nsigmaCutCombinedPi) && candidate.beta() > selectionConfig.cfgBetaCutTOF) { return true; } if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPi()) < selectionConfig.nsigmaCutTPCPi) { @@ -549,23 +513,23 @@ struct Kstar892LightIon { } } } else if (PID == PIDParticle::kKaon) { - if (onlyTOF) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < selectionConfig.nsigmaCutTOFKa && candidate.beta() > cBetaCutTOF) { + if (selectionConfig.onlyTOF) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < selectionConfig.nsigmaCutTOFKa && candidate.beta() > selectionConfig.cfgBetaCutTOF) { return true; } - } else if (onlyTOFHIT) { - if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < selectionConfig.nsigmaCutTOFKa && candidate.beta() > cBetaCutTOF) { + } else if (selectionConfig.onlyTOFHIT) { + if (candidate.hasTOF() && std::abs(candidate.tofNSigmaKa()) < selectionConfig.nsigmaCutTOFKa && candidate.beta() > selectionConfig.cfgBetaCutTOF) { return true; } if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCKa) { return true; } - } else if (onlyTPC) { + } else if (selectionConfig.onlyTPC) { if (std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCKa) { return true; } } else { - if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (selectionConfig.nsigmaCutCombinedKa * selectionConfig.nsigmaCutCombinedKa) && candidate.beta() > cBetaCutTOF) { + if (candidate.hasTOF() && (candidate.tofNSigmaKa() * candidate.tofNSigmaKa() + candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa()) < (selectionConfig.nsigmaCutCombinedKa * selectionConfig.nsigmaCutCombinedKa) && candidate.beta() > selectionConfig.cfgBetaCutTOF) { return true; } if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaKa()) < selectionConfig.nsigmaCutTPCKa) { @@ -603,27 +567,6 @@ struct Kstar892LightIon { return false; } - // Defining filters for events (event selection) - // Processed events will be already fulfilling the event selection - // requirements - // Filter eventFilter = (o2::aod::evsel::sel8 == true); - Filter posZFilter = (nabs(o2::aod::collision::posZ) < selectionConfig.cutVrtxZ); - - // Filter acceptanceFilter = (nabs(aod::track::eta) < selectionConfig.cfgCutEtaMax && nabs(aod::track::pt) > selectionConfig.cfgCutPT) && (nabs(aod::track::eta) > selectionConfig.cfgCutEtaMin); - Filter acceptanceFilter = (nabs(aod::track::eta) < selectionConfig.cfgCutEtaMax && nabs(aod::track::pt) > selectionConfig.cfgCutPT); - // Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < selectionConfig.cfgCutDCAxyMax) && (nabs(aod::track::dcaZ) < selectionConfig.cfgCutDCAz) && (nabs(aod::track::dcaXY) > selectionConfig.cfgCutDCAxyMin); - Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < selectionConfig.cfgCutDCAxyMax) && (nabs(aod::track::dcaZ) < selectionConfig.cfgCutDCAz); - - using EventCandidates = soa::Filtered>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs - using EventCandidatesMix = soa::Filtered>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs - using TrackCandidates = soa::Filtered>; - using EventCandidatesMC = soa::Join; - // using EventCandidatesMC = soa::Filtered>; - - using TrackCandidatesMC = soa::Filtered>; - // using EventMCGenerated = soa::Join; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs - using EventMCGenerated = soa::Join; - //*********Varibles declaration*************** float centrality{-1.0}, theta2; ROOT::Math::PxPyPzMVector daughter1, daughter2, daughterRot, mother, motherRot; @@ -662,6 +605,27 @@ struct Kstar892LightIon { } } + // Defining filters for events (event selection) + // Processed events will be already fulfilling the event selection + // requirements + // Filter eventFilter = (o2::aod::evsel::sel8 == true); + Filter posZFilter = (nabs(o2::aod::collision::posZ) < selectionConfig.cfgVrtxZCut); + Filter acceptanceFilter = (nabs(aod::track::eta) < selectionConfig.cfgCutEtaMax && nabs(aod::track::pt) > selectionConfig.cfgCutPT); + Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < selectionConfig.cfgCutDCAxyMax) && (nabs(aod::track::dcaZ) < selectionConfig.cfgCutDCAz); + + // using EventCandidates = soa::Filtered>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs + // using EventCandidatesMC = soa::Filtered>; + // using TrackCandidates = soa::Filtered>; + // using TrackCandidatesMC = soa::Filtered>; + using EventCandidatesMix = soa::Filtered>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs + + 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 EventCandidatesMC = soa::Join; + using TrackCandidatesMC = soa::Join; + void processSE(EventCandidates::iterator const& collision, TrackCandidates const& tracks, aod::BCs const&) { int occupancy = collision.trackOccupancyInTimeRange(); @@ -673,25 +637,25 @@ struct Kstar892LightIon { centrality = -1; - if (cSelectMultEstimator == kFT0M) { + if (selectCentEstimator == kFT0M) { centrality = collision.centFT0M(); - } else if (cSelectMultEstimator == kFT0A) { + } else if (selectCentEstimator == kFT0A) { centrality = collision.centFT0A(); - } else if (cSelectMultEstimator == kFT0C) { + } else if (selectCentEstimator == kFT0C) { centrality = collision.centFT0C(); - } else if (cSelectMultEstimator == kFV0A) { + } else if (selectCentEstimator == kFV0A) { centrality = collision.centFV0A(); } else { centrality = collision.centFT0M(); // default } - /* else if (cSelectMultEstimator == 4) { + /* else if (selectCentEstimator == 4) { centrality = collision.centMFT(); } */ - /* else if (cSelectMultEstimator == 5) { + /* else if (selectCentEstimator == 5) { centrality = collision.centNGlobal(); } */ - /* else if (cSelectMultEstimator == 6) { + /* else if (selectCentEstimator == 6) { centrality = collision.centNTPV(); } */ @@ -702,11 +666,9 @@ struct Kstar892LightIon { } for (const auto& [track1, track2] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { - hEventSelection.fill(HIST("tracksCheckData"), 0.5); if (!selectionTrack(track1) || !selectionTrack(track2)) { continue; } - hEventSelection.fill(HIST("tracksCheckData"), 1.5); if (track1.globalIndex() == track2.globalIndex()) continue; @@ -714,7 +676,6 @@ struct Kstar892LightIon { if (!selectionPair(track1, track2)) { continue; } - hEventSelection.fill(HIST("tracksCheckData"), 6.5); if (cQAplots) { hOthers.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls()); @@ -742,20 +703,16 @@ struct Kstar892LightIon { } // since we are using combinations full index policy, so repeated pairs are allowed, so we can check one with Kaon and other with pion - if (!applypTdepPID && !selectionPID(track1, 1)) // Track 1 is checked with Kaon + if (!selectionConfig.isApplypTdepPID && !selectionPID(track1, 1)) // Track 1 is checked with Kaon continue; - if (!applypTdepPID && !selectionPID(track2, 0)) // Track 2 is checked with Pion + if (!selectionConfig.isApplypTdepPID && !selectionPID(track2, 0)) // Track 2 is checked with Pion continue; - if (applypTdepPID && !selectionPIDNew(track1, 1)) // Track 1 is checked with Kaon + if (selectionConfig.isApplypTdepPID && !selectionPIDNew(track1, 1)) // Track 1 is checked with Kaon continue; - if (applypTdepPID && !selectionPIDNew(track2, 0)) // Track 2 is checked with Pion + if (selectionConfig.isApplypTdepPID && !selectionPIDNew(track2, 0)) // Track 2 is checked with Pion continue; - hEventSelection.fill(HIST("tracksCheckData"), 2.5); - - hEventSelection.fill(HIST("tracksCheckData"), 5.5); - if (cQAplots) { hOthers.fill(HIST("hEta_after"), track1.eta()); hOthers.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls()); @@ -804,6 +761,134 @@ struct Kstar892LightIon { } PROCESS_SWITCH(Kstar892LightIon, processSE, "Process Same event", true); + void processSEMC(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) + { + // auto oldindex = -999; + if (!collision.has_mcCollision()) { + return; + } + int occupancy = collision.trackOccupancyInTimeRange(); + hEventSelection.fill(HIST("hOccupancy"), occupancy); + + if (!selectionEvent(collision, false)) { // don't fill event cut histogram + return; + } + + centrality = -1; + + if (selectCentEstimator == kFT0M) { + centrality = collision.centFT0M(); + } else if (selectCentEstimator == kFT0A) { + centrality = collision.centFT0A(); + } else if (selectCentEstimator == kFT0C) { + centrality = collision.centFT0C(); + } else if (selectCentEstimator == kFV0A) { + centrality = collision.centFV0A(); + } else { + centrality = collision.centFT0M(); // default + } + + // Fill the event counter + if (cQAevents) { + hEventSelection.fill(HIST("hVertexZ"), collision.posZ()); + hEventSelection.fill(HIST("hCentrality"), centrality); + } + + for (const auto& [track1, track2] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { + if (!selectionTrack(track1) || !selectionTrack(track2)) + continue; + + const auto mctrack1 = track1.mcParticle(); + const auto mctrack2 = track2.mcParticle(); + + if (!track1.has_mcParticle() || !track2.has_mcParticle()) + continue; // skip if no MC particle associated + + if (!mctrack1.isPhysicalPrimary() || !mctrack2.isPhysicalPrimary()) + continue; + + if (track1.globalIndex() == track2.globalIndex()) + continue; + + if (cQAplots) { + hOthers.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls()); + hOthers.fill(HIST("dE_by_dx_TPC"), track1.p(), track1.tpcSignal()); + + if (track1.sign() < 0) { + hPID.fill(HIST("Before/hTPCnsigKa_Neg_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); + hPID.fill(HIST("Before/hTPCnsigPi_Neg_mult_pt"), track1.tpcNSigmaPi(), centrality, track1.pt()); + hPID.fill(HIST("Before/hTOFnsigKa_Neg_mult_pt"), track1.tofNSigmaKa(), centrality, track1.pt()); + hPID.fill(HIST("Before/hTOFnsigPi_Neg_mult_pt"), track1.tofNSigmaPi(), centrality, track1.pt()); + } else { + hPID.fill(HIST("Before/hTPCnsigKa_Pos_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); + hPID.fill(HIST("Before/hTPCnsigPi_Pos_mult_pt"), track1.tpcNSigmaPi(), centrality, track1.pt()); + hPID.fill(HIST("Before/hTOFnsigKa_Pos_mult_pt"), track1.tofNSigmaKa(), centrality, track1.pt()); + hPID.fill(HIST("Before/hTOFnsigPi_Pos_mult_pt"), track1.tofNSigmaPi(), centrality, track1.pt()); + } + + hPID.fill(HIST("Before/hNsigma_TPC_TOF_Ka_pt"), track1.tpcNSigmaKa(), track1.tofNSigmaKa(), track1.pt()); + hPID.fill(HIST("Before/hNsigma_TPC_TOF_Pi_pt"), track1.tpcNSigmaPi(), track1.tofNSigmaPi(), track1.pt()); + } + + if (cQAevents) { + hOthers.fill(HIST("hDcaxy_cent_pt"), track1.dcaXY(), centrality, track1.pt()); + hOthers.fill(HIST("hDcaz_cent_pt"), track1.dcaZ(), centrality, track1.pt()); + } + + // since we are using combinations full index policy, so repeated pairs are allowed, so we can check one with Kaon and other with pion + if (!selectionConfig.isApplypTdepPID && (!selectionPID(track1, 1) || !selectionPID(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplypTdepPID && (!selectionPIDNew(track1, 1) || !selectionPIDNew(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (cQAplots) { + hOthers.fill(HIST("hEta_after"), track1.eta()); + hOthers.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls()); + hOthers.fill(HIST("hDcaxyPi"), track2.dcaXY()); + hOthers.fill(HIST("hDcaxyKa"), track1.dcaXY()); + hOthers.fill(HIST("hDcazPi"), track2.dcaZ()); + hOthers.fill(HIST("hDcazKa"), track1.dcaZ()); + + if (track1.sign() < 0) { + hPID.fill(HIST("After/hTPCnsigKa_Neg_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); + hPID.fill(HIST("After/hTOFnsigKa_Neg_mult_pt"), track1.tofNSigmaKa(), centrality, track1.pt()); + } else if (track1.sign() > 0) { + hPID.fill(HIST("After/hTPCnsigKa_Pos_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); + hPID.fill(HIST("After/hTOFnsigKa_Pos_mult_pt"), track1.tofNSigmaKa(), centrality, track1.pt()); + } + + if (track2.sign() < 0) { + hPID.fill(HIST("After/hTPCnsigPi_Neg_mult_pt"), track2.tpcNSigmaPi(), centrality, track2.pt()); + hPID.fill(HIST("After/hTOFnsigPi_Neg_mult_pt"), track2.tofNSigmaPi(), centrality, track2.pt()); + } else if (track2.sign() > 0) { + hPID.fill(HIST("After/hTPCnsigPi_Pos_mult_pt"), track2.tpcNSigmaPi(), centrality, track2.pt()); + hPID.fill(HIST("After/hTOFnsigPi_Pos_mult_pt"), track2.tofNSigmaPi(), centrality, track2.pt()); + } + + hPID.fill(HIST("After/hNsigma_TPC_TOF_Ka_pt"), track1.tpcNSigmaKa(), track1.tofNSigmaKa(), track1.pt()); + hPID.fill(HIST("After/hNsigma_TPC_TOF_Pi_pt"), track2.tpcNSigmaPi(), track2.tofNSigmaPi(), track2.pt()); + } + 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 + + /* if (selectionConfig.isApplyCutsOnMother) { + if (mother.Pt() >= selectionConfig.cMaxPtMotherCut) // excluding candidates in overflow + continue; + if (mother.M() >= selectionConfig.cMaxMinvMotherCut) // excluding candidates in overflow + continue; + } */ + + 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, centrality, isMix, track1, track2); + } + } + PROCESS_SWITCH(Kstar892LightIon, processSEMC, "Process same event in MC", false); + ConfigurableAxis axisVertex{"axisVertex", {20, -10, 10}, "vertex axis for ME mixing"}; // ConfigurableAxis axisCentralityClass{"axisCentralityClass", {10, 0, 100}, "centrality percentile for ME mixing"}; ConfigurableAxis axisCentrality{"axisCentrality", {2000, 0, 10000}, "TPC centrality axis for ME mixing"}; @@ -839,13 +924,17 @@ struct Kstar892LightIon { for (const auto& [t1, t2] : o2::soa::combinations(o2::soa::CombinationsFullIndexPolicy(tracks1, tracks2))) { if (!selectionTrack(t1) || !selectionTrack(t2)) continue; - if (!selectionPID(t1, 1) || !selectionPID(t2, 0)) - continue; if (!selectionPair(t1, t2)) { continue; } + if (!selectionConfig.isApplypTdepPID && (!selectionPID(t1, 1) || !selectionPID(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplypTdepPID && (!selectionPIDNew(t1, 1) || !selectionPIDNew(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), massKa); daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), massPi); mother = daughter1 + daughter2; @@ -860,13 +949,13 @@ struct Kstar892LightIon { }; // Call mixing based on selected estimator - if (cSelectMultEstimator == kFT0M) { + if (selectCentEstimator == kFT0M) { runMixing(pair1, [](const auto& c) { return c.centFT0M(); }); - } else if (cSelectMultEstimator == kFT0A) { + } else if (selectCentEstimator == kFT0A) { runMixing(pair2, [](const auto& c) { return c.centFT0A(); }); - } else if (cSelectMultEstimator == kFT0C) { + } else if (selectCentEstimator == kFT0C) { runMixing(pair3, [](const auto& c) { return c.centFT0C(); }); - } else if (cSelectMultEstimator == kFV0A) { + } else if (selectCentEstimator == kFV0A) { runMixing(pair4, [](const auto& c) { return c.centFV0A(); }); } } @@ -906,7 +995,14 @@ struct Kstar892LightIon { if (!selectionTrack(t1) || !selectionTrack(t2)) continue; - if (!selectionPID(t1, 1) || !selectionPID(t2, 0)) + if (!selectionPair(t1, t2)) { + continue; + } + + if (!selectionConfig.isApplypTdepPID && (!selectionPID(t1, 1) || !selectionPID(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion + continue; + + if (selectionConfig.isApplypTdepPID && (!selectionPIDNew(t1, 1) || !selectionPIDNew(t2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion continue; if (!t1.has_mcParticle() || !t2.has_mcParticle()) { @@ -933,185 +1029,42 @@ struct Kstar892LightIon { } }; // Call mixing based on selected estimator - if (cSelectMultEstimator == kFT0M) { + if (selectCentEstimator == kFT0M) { runMixing(pairmc1, [](const auto& c) { return c.centFT0M(); }); - } else if (cSelectMultEstimator == kFT0A) { + } else if (selectCentEstimator == kFT0A) { runMixing(pairmc2, [](const auto& c) { return c.centFT0A(); }); - } else if (cSelectMultEstimator == kFT0C) { + } else if (selectCentEstimator == kFT0C) { runMixing(pairmc3, [](const auto& c) { return c.centFT0C(); }); - } else if (cSelectMultEstimator == kFV0A) { + } else if (selectCentEstimator == kFV0A) { runMixing(pairmc4, [](const auto& c) { return c.centFV0A(); }); } } PROCESS_SWITCH(Kstar892LightIon, processMEMC, "Process mixed-event in MC", false); - void processSEMC(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const& tracks, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) - { - // auto oldindex = -999; - if (!collision.has_mcCollision()) { - return; - } - int occupancy = collision.trackOccupancyInTimeRange(); - hEventSelection.fill(HIST("hOccupancy"), occupancy); - - if (!selectionEvent(collision, false)) { // don't fill event cut histogram - return; - } - - centrality = -1; - - if (cSelectMultEstimator == kFT0M) { - centrality = collision.centFT0M(); - } else if (cSelectMultEstimator == kFT0A) { - centrality = collision.centFT0A(); - } else if (cSelectMultEstimator == kFT0C) { - centrality = collision.centFT0C(); - } else if (cSelectMultEstimator == kFV0A) { - centrality = collision.centFV0A(); - } else { - centrality = collision.centFT0M(); // default - } - - // Fill the event counter - if (cQAevents) { - hEventSelection.fill(HIST("hVertexZ"), collision.posZ()); - hEventSelection.fill(HIST("hCentrality"), centrality); - } - - for (const auto& [track1, track2] : combinations(CombinationsFullIndexPolicy(tracks, tracks))) { - hEventSelection.fill(HIST("tracksCheckData"), 0.5); - if (!selectionTrack(track1) || !selectionTrack(track2)) - continue; - - const auto mctrack1 = track1.mcParticle(); - const auto mctrack2 = track2.mcParticle(); - - if (!track1.has_mcParticle() || !track2.has_mcParticle()) - continue; // skip if no MC particle associated - - if (!mctrack1.isPhysicalPrimary() || !mctrack2.isPhysicalPrimary()) - continue; - - hEventSelection.fill(HIST("tracksCheckData"), 1.5); - - if (track1.globalIndex() == track2.globalIndex()) - continue; - hEventSelection.fill(HIST("tracksCheckData"), 6.5); - - if (cQAplots) { - hOthers.fill(HIST("hCRFC_before"), track1.tpcCrossedRowsOverFindableCls()); - hOthers.fill(HIST("dE_by_dx_TPC"), track1.p(), track1.tpcSignal()); - - if (track1.sign() < 0) { - hPID.fill(HIST("Before/hTPCnsigKa_Neg_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); - hPID.fill(HIST("Before/hTPCnsigPi_Neg_mult_pt"), track1.tpcNSigmaPi(), centrality, track1.pt()); - hPID.fill(HIST("Before/hTOFnsigKa_Neg_mult_pt"), track1.tofNSigmaKa(), centrality, track1.pt()); - hPID.fill(HIST("Before/hTOFnsigPi_Neg_mult_pt"), track1.tofNSigmaPi(), centrality, track1.pt()); - } else { - hPID.fill(HIST("Before/hTPCnsigKa_Pos_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); - hPID.fill(HIST("Before/hTPCnsigPi_Pos_mult_pt"), track1.tpcNSigmaPi(), centrality, track1.pt()); - hPID.fill(HIST("Before/hTOFnsigKa_Pos_mult_pt"), track1.tofNSigmaKa(), centrality, track1.pt()); - hPID.fill(HIST("Before/hTOFnsigPi_Pos_mult_pt"), track1.tofNSigmaPi(), centrality, track1.pt()); - } - - hPID.fill(HIST("Before/hNsigma_TPC_TOF_Ka_pt"), track1.tpcNSigmaKa(), track1.tofNSigmaKa(), track1.pt()); - hPID.fill(HIST("Before/hNsigma_TPC_TOF_Pi_pt"), track1.tpcNSigmaPi(), track1.tofNSigmaPi(), track1.pt()); - } - - if (cQAevents) { - hOthers.fill(HIST("hDcaxy_cent_pt"), track1.dcaXY(), centrality, track1.pt()); - hOthers.fill(HIST("hDcaz_cent_pt"), track1.dcaZ(), centrality, track1.pt()); - } - - // since we are using combinations full index policy, so repeated pairs are allowed, so we can check one with Kaon and other with pion - if (!applypTdepPID && (!selectionPID(track1, 1) || !selectionPID(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion - continue; - hEventSelection.fill(HIST("tracksCheckData"), 2.5); - - if (applypTdepPID && (!selectionPIDNew(track1, 1) || !selectionPIDNew(track2, 0))) // Track 1 is checked with Kaon, track 2 is checked with Pion - continue; - hEventSelection.fill(HIST("tracksCheckData"), 3.5); - - hEventSelection.fill(HIST("tracksCheckData"), 4.5); - - if (cQAplots) { - hOthers.fill(HIST("hEta_after"), track1.eta()); - hOthers.fill(HIST("hCRFC_after"), track1.tpcCrossedRowsOverFindableCls()); - hOthers.fill(HIST("hDcaxyPi"), track2.dcaXY()); - hOthers.fill(HIST("hDcaxyKa"), track1.dcaXY()); - hOthers.fill(HIST("hDcazPi"), track2.dcaZ()); - hOthers.fill(HIST("hDcazKa"), track1.dcaZ()); - - if (track1.sign() < 0) { - hPID.fill(HIST("After/hTPCnsigKa_Neg_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); - hPID.fill(HIST("After/hTOFnsigKa_Neg_mult_pt"), track1.tofNSigmaKa(), centrality, track1.pt()); - } else if (track1.sign() > 0) { - hPID.fill(HIST("After/hTPCnsigKa_Pos_mult_pt"), track1.tpcNSigmaKa(), centrality, track1.pt()); - hPID.fill(HIST("After/hTOFnsigKa_Pos_mult_pt"), track1.tofNSigmaKa(), centrality, track1.pt()); - } - - if (track2.sign() < 0) { - hPID.fill(HIST("After/hTPCnsigPi_Neg_mult_pt"), track2.tpcNSigmaPi(), centrality, track2.pt()); - hPID.fill(HIST("After/hTOFnsigPi_Neg_mult_pt"), track2.tofNSigmaPi(), centrality, track2.pt()); - } else if (track2.sign() > 0) { - hPID.fill(HIST("After/hTPCnsigPi_Pos_mult_pt"), track2.tpcNSigmaPi(), centrality, track2.pt()); - hPID.fill(HIST("After/hTOFnsigPi_Pos_mult_pt"), track2.tofNSigmaPi(), centrality, track2.pt()); - } - - hPID.fill(HIST("After/hNsigma_TPC_TOF_Ka_pt"), track1.tpcNSigmaKa(), track1.tofNSigmaKa(), track1.pt()); - hPID.fill(HIST("After/hNsigma_TPC_TOF_Pi_pt"), track2.tpcNSigmaPi(), track2.tofNSigmaPi(), track2.pt()); - } - 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 - - /* if (selectionConfig.isApplyCutsOnMother) { - if (mother.Pt() >= selectionConfig.cMaxPtMotherCut) // excluding candidates in overflow - continue; - if (mother.M() >= selectionConfig.cMaxMinvMotherCut) // excluding candidates in overflow - continue; - } */ - - 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, centrality, isMix, track1, track2); - } - } - PROCESS_SWITCH(Kstar892LightIon, processSEMC, "Process same event in MC", false); - void processGen(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { - hEventSelection.fill(HIST("eventsCheckGen"), 0.5); - - if (std::abs(mcCollision.posZ()) < selectionConfig.cutVrtxZ) - hEventSelection.fill(HIST("eventsCheckGen"), 1.5); - std::vector selectedEvents(collisions.size()); int nevts = 0; centrality = -1.0; - hEventSelection.fill(HIST("eventsCheckGen"), 2.5); - for (const auto& collision : collisions) { if (!selectionEvent(collision, false)) { // don't fill event cut histogram continue; } centrality = collision.centFT0M(); - if (cSelectMultEstimator == kFT0M) { + if (selectCentEstimator == kFT0M) { centrality = collision.centFT0M(); - } else if (cSelectMultEstimator == kFT0A) { + } else if (selectCentEstimator == kFT0A) { centrality = collision.centFT0A(); - } else if (cSelectMultEstimator == kFT0C) { + } else if (selectCentEstimator == kFT0C) { centrality = collision.centFT0C(); - } else if (cSelectMultEstimator == kFV0A) { + } else if (selectCentEstimator == kFV0A) { centrality = collision.centFV0A(); } else { centrality = collision.centFT0M(); // default } - hMC.fill(HIST("h1GenCent"), centrality); + hMC.fill(HIST("Gen/h1GenCent"), centrality); int occupancy = collision.trackOccupancyInTimeRange(); hEventSelection.fill(HIST("hOccupancy"), occupancy); @@ -1122,18 +1075,17 @@ struct Kstar892LightIon { for (const auto& mcParticle : mcParticles) { if (std::abs(mcParticle.y()) < selectionConfig.motherRapidityCut && std::abs(mcParticle.pdgCode()) == o2::constants::physics::kK0Star892) { - hMC.fill(HIST("hAllKstarGenCollisisons"), mcParticle.pt(), centrality); + hMC.fill(HIST("Gen/hAllKstarGenCollisisons"), mcParticle.pt(), centrality); } } const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); - hMC.fill(HIST("hAllGenCollisions"), centrality); + hMC.fill(HIST("Gen/hAllGenCollisions"), centrality); if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection return; } - hMC.fill(HIST("hAllGenCollisions1Rec"), centrality); - hEventSelection.fill(HIST("eventsCheckGen"), 3.5); + hMC.fill(HIST("Gen/hAllGenCollisions1Rec"), centrality); for (const auto& mcParticle : mcParticles) { @@ -1151,7 +1103,7 @@ struct Kstar892LightIon { if (std::abs(mcParticle.pdgCode()) != o2::constants::physics::kK0Star892) { continue; } - hMC.fill(HIST("hAllKstarGenCollisisons1Rec"), mcParticle.pt(), centrality); + hMC.fill(HIST("Gen/hAllKstarGenCollisisons1Rec"), mcParticle.pt(), centrality); auto kDaughters = mcParticle.daughters_as(); if (kDaughters.size() != noOfDaughters) { @@ -1185,7 +1137,7 @@ struct Kstar892LightIon { } if ((passkaon && passpion) && (hasPos && hasNeg)) { - hMC.fill(HIST("hk892GenpT"), mcParticle.pt(), centrality); + hMC.fill(HIST("Gen/hk892GenpT"), mcParticle.pt(), centrality); } } } @@ -1197,27 +1149,27 @@ struct Kstar892LightIon { return; } - // centrality = collision.centFT0M(); + centrality = collision.centFT0M(); - if (cSelectMultEstimator == kFT0M) { + if (selectCentEstimator == kFT0M) { centrality = collision.centFT0M(); - } else if (cSelectMultEstimator == kFT0A) { + } else if (selectCentEstimator == kFT0A) { centrality = collision.centFT0A(); - } else if (cSelectMultEstimator == kFT0C) { + } else if (selectCentEstimator == kFT0C) { centrality = collision.centFT0C(); - } else if (cSelectMultEstimator == kFV0A) { + } else if (selectCentEstimator == kFV0A) { centrality = collision.centFV0A(); } else { centrality = collision.centFT0M(); // default } - hMC.fill(HIST("hAllRecCollisions"), centrality); + hMC.fill(HIST("Rec/hAllRecCollisions"), centrality); if (!selectionEvent(collision, true)) { // fill MC event cut histogram return; } - hMC.fill(HIST("h1RecCent"), centrality); + hMC.fill(HIST("Rec/h1RecCent"), centrality); if (cQAevents) { hEventSelection.fill(HIST("hVertexZ"), collision.posZ()); @@ -1240,12 +1192,9 @@ struct Kstar892LightIon { if (indexCheck && (track2.index() < track1.index())) continue; - hEventSelection.fill(HIST("recMCparticles"), 6.5); - if (!selectionPair(track1, track2)) { continue; } - hEventSelection.fill(HIST("recMCparticles"), 16.5); if (cQAevents) { hOthers.fill(HIST("hDcaxy_cent_pt"), track1.dcaXY(), centrality, track1.pt()); @@ -1255,7 +1204,6 @@ struct Kstar892LightIon { if (track1.sign() * track2.sign() >= 0) { continue; } - hEventSelection.fill(HIST("recMCparticles"), 4.5); const auto mctrack1 = track1.mcParticle(); const auto mctrack2 = track2.mcParticle(); @@ -1292,7 +1240,6 @@ struct Kstar892LightIon { if (!(track1PDG == PDG_t::kPiPlus && track2PDG == PDG_t::kKPlus) && !(track1PDG == PDG_t::kKPlus && track2PDG == PDG_t::kPiPlus)) { continue; } - hEventSelection.fill(HIST("recMCparticles"), 7.5); for (const auto& mothertrack1 : mctrack1.mothers_as()) { for (const auto& mothertrack2 : mctrack2.mothers_as()) { @@ -1303,32 +1250,25 @@ struct Kstar892LightIon { if (mothertrack1.globalIndex() != mothertrack2.globalIndex()) { continue; } - hEventSelection.fill(HIST("recMCparticles"), 8.5); if (!mothertrack1.producedByGenerator()) { continue; } - hEventSelection.fill(HIST("recMCparticles"), 9.5); if (std::abs(mothertrack1.y()) >= selectionConfig.motherRapidityCut) { continue; } - hEventSelection.fill(HIST("recMCparticles"), 10.5); if (std::abs(mothertrack1.pdgCode()) != o2::constants::physics::kK0Star892) { continue; } - hEventSelection.fill(HIST("recMCparticles"), 11.5); if (track1PDG == PDG_t::kPiPlus) { - if (!applypTdepPID && !(selectionPID(track1, 0) && selectionPID(track2, 1))) { // pion and kaon + if (!selectionConfig.isApplypTdepPID && !(selectionPID(track1, 0) && selectionPID(track2, 1))) { // pion and kaon continue; - } else if (applypTdepPID && !(selectionPIDNew(track1, 0) && selectionPIDNew(track2, 1))) { // pion and kaon + } else if (selectionConfig.isApplypTdepPID && !(selectionPIDNew(track1, 0) && selectionPIDNew(track2, 1))) { // pion and kaon continue; } - hEventSelection.fill(HIST("recMCparticles"), 12.5); - - hEventSelection.fill(HIST("recMCparticles"), 13.5); if (cQAplots) { if (track1.sign() < 0 && track2.sign() > 0) { @@ -1345,14 +1285,11 @@ struct Kstar892LightIon { } } else if (track1PDG == PDG_t::kKPlus) { - if (!applypTdepPID && !(selectionPID(track1, 1) && selectionPID(track2, 0))) { // kaon and pion + if (!selectionConfig.isApplypTdepPID && !(selectionPID(track1, 1) && selectionPID(track2, 0))) { // kaon and pion continue; - } else if (applypTdepPID && !(selectionPIDNew(track1, 1) && selectionPIDNew(track2, 0))) { // kaon and pion + } else if (selectionConfig.isApplypTdepPID && !(selectionPIDNew(track1, 1) && selectionPIDNew(track2, 0))) { // kaon and pion continue; } - hEventSelection.fill(HIST("recMCparticles"), 12.5); - - hEventSelection.fill(HIST("recMCparticles"), 13.5); if (cQAplots) { if (track1.sign() < 0 && track2.sign() > 0) { @@ -1376,11 +1313,10 @@ struct Kstar892LightIon { continue; } */ - if (avoidsplitrackMC && oldindex == mothertrack1.globalIndex()) { - hMC.fill(HIST("h1KSRecsplit"), mothertrack1.pt()); + if (selectionConfig.isAvoidsplitrackMC && oldindex == mothertrack1.globalIndex()) { + hMC.fill(HIST("Rec/h1KSRecsplit"), mothertrack1.pt()); continue; } - hEventSelection.fill(HIST("recMCparticles"), 15.5); oldindex = mothertrack1.globalIndex(); @@ -1394,14 +1330,14 @@ struct Kstar892LightIon { mother = daughter1 + daughter2; // Kstar meson - hMC.fill(HIST("h2KstarRecpt2"), mothertrack1.pt(), centrality, std::sqrt(mothertrack1.e() * mothertrack1.e() - mothertrack1.p() * mothertrack1.p())); + hMC.fill(HIST("Rec/h2KstarRecpt2"), mothertrack1.pt(), centrality, std::sqrt(mothertrack1.e() * mothertrack1.e() - mothertrack1.p() * mothertrack1.p())); if (mother.Rapidity() >= selectionConfig.motherRapidityCut) { continue; } - hMC.fill(HIST("h1KstarRecMass"), mother.M()); - hMC.fill(HIST("h2KstarRecpt1"), mother.Pt(), centrality, mother.M()); + hMC.fill(HIST("Rec/h1KstarRecMass"), mother.M()); + hMC.fill(HIST("Rec/h2KstarRecpt1"), mother.Pt(), centrality, mother.M()); } } } @@ -1421,13 +1357,13 @@ struct Kstar892LightIon { if (!selectionEvent(RecCollision, false)) // don't fill event cut histogram continue; - if (cSelectMultEstimator == kFT0M) { + if (selectCentEstimator == kFT0M) { centrality = RecCollision.centFT0M(); - } else if (cSelectMultEstimator == kFT0A) { + } else if (selectCentEstimator == kFT0A) { centrality = RecCollision.centFT0A(); - } else if (cSelectMultEstimator == kFT0C) { + } else if (selectCentEstimator == kFT0C) { centrality = RecCollision.centFT0C(); - } else if (cSelectMultEstimator == kFV0A) { + } else if (selectCentEstimator == kFV0A) { centrality = RecCollision.centFV0A(); } else { centrality = RecCollision.centFT0M(); // default @@ -1455,7 +1391,7 @@ struct Kstar892LightIon { } } // end loop on gen particles } - PROCESS_SWITCH(Kstar892LightIon, processEvtLossSigLossMC, "Process Signal Loss, Event Loss for Kstar in Light Ion", false); + PROCESS_SWITCH(Kstar892LightIon, processEvtLossSigLossMC, "Process Signal Loss, Event Loss using impact parameter", false); using McCollisionMults = soa::Join; using LabeledTracks = soa::Join; @@ -1464,7 +1400,7 @@ struct Kstar892LightIon { { hMC.fill(HIST("CorrFactors/hGenEvents"), mcCollision.multMCNParticlesEta08(), 0.5); - if (std::abs(mcCollision.posZ()) > selectionConfig.cutVrtxZ) + if (std::abs(mcCollision.posZ()) > selectionConfig.cfgVrtxZCut) return; hMC.fill(HIST("CorrFactors/hGenEvents"), mcCollision.multMCNParticlesEta08(), 1.5); @@ -1530,7 +1466,7 @@ struct Kstar892LightIon { hMC.fill(HIST("CorrFactors/hGenEvents"), mcCollision.multMCNParticlesEta08(), 2.5); } - PROCESS_SWITCH(Kstar892LightIon, processCorrFactors, "Process Signal Loss, Event Loss", false); + PROCESS_SWITCH(Kstar892LightIon, processCorrFactors, "Process Signal Loss, Event Loss using chaged particle multiplicity", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)