diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index d280d3c1da3..0348751dae9 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -9,18 +9,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file lstaranalysis.cxx +/// \file lambda1520analysisinpp.cxx /// \brief This standalone task reconstructs track-track decay of lambda(1520) resonance candidate /// \author Hirak Kumar Koley -// 1. Own header (doesn't exist) - -// 2. C system headers (none) - -// 3. C++ system headers -#include - -// 4. Other includes: O2 framework, ROOT, etc. #include "PWGLF/Utils/collisionCuts.h" #include "Common/DataModel/Centrality.h" @@ -36,7 +28,9 @@ #include "Math/Vector4D.h" #include "TPDGCode.h" #include "TRandom.h" -#include "TVector3.h" + +#include +#include using namespace o2; using namespace o2::soa; @@ -48,25 +42,39 @@ using namespace o2::constants::physics; using LorentzVectorPtEtaPhiMass = ROOT::Math::PtEtaPhiMVector; enum { - kINEL = 1, - kINEL10, - kINELg0, - kINELg010, - kTrig, - kTrig10, - kTrigINELg0, - kTrigINELg010, - kSel8, - kSel810, - kSel8INELg0, - kSel8INELg010, - kAllCuts, - kAllCuts10, - kAllCutsINELg0, - kAllCutsINELg010, + Inel = 1, + Inel10, + Inelg0, + Inelg010, + Trig, + Trig10, + TrigINELg0, + TrigINELg010, + Sel8, + Sel810, + Sel8INELg0, + Sel8INELg010, + AllCuts, + AllCuts10, + AllCutsINELg0, + AllCutsINELg010, }; -struct Lstaranalysis { +enum TrackSelectionType { + AllTracks = 0, + GlobalTracks, + GlobalTracksWoPtEta, + GlobalTracksWoDCA, + QualityTracks, + InAcceptanceTracks, +}; + +enum PIDCutType { + SquareType = 1, + CircularType, +}; + +struct Lambda1520analysisinpp { // Define slice per Resocollision SliceCache cache; Preslice perCollision = o2::aod::track::collisionId; @@ -79,118 +87,132 @@ struct Lstaranalysis { /// Event cuts o2::analysis::CollisonCuts colCuts; - Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; - Configurable cfgEvtOccupancyInTimeRangeMax{"cfgEvtOccupancyInTimeRangeMax", -1, "Evt sel: maximum track occupancy"}; - Configurable cfgEvtOccupancyInTimeRangeMin{"cfgEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; - Configurable cfgEvtTriggerCheck{"cfgEvtTriggerCheck", false, "Evt sel: check for trigger"}; - Configurable cfgEvtOfflineCheck{"cfgEvtOfflineCheck", true, "Evt sel: check for offline selection"}; - Configurable cfgEvtTriggerTVXSel{"cfgEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; - Configurable cfgEvtTFBorderCut{"cfgEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; - Configurable cfgEvtUseITSTPCvertex{"cfgEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; - Configurable cfgEvtZvertexTimedifference{"cfgEvtZvertexTimedifference", false, "Evt sel: apply Z-vertex time difference"}; - Configurable cfgEvtPileupRejection{"cfgEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; - Configurable cfgEvtNoITSROBorderCut{"cfgEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; - Configurable cfgEvtCollInTimeRangeStandard{"cfgEvtCollInTimeRangeStandard", false, "Evt sel: apply NoCollInTimeRangeStandard"}; - - Configurable cfgEventCentralityMin{"cfgEventCentralityMin", 0.0f, "Event sel: minimum centrality"}; - Configurable cfgEventCentralityMax{"cfgEventCentralityMax", 100.0f, "Event sel: maximum centrality"}; - - // Configurables - // Pre-selection Track cuts - Configurable trackSelection{"trackSelection", 0, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; - Configurable cMinPtcut{"cMinPtcut", 0.15f, "Minimal pT for tracks"}; - Configurable cMinTPCNClsFound{"cMinTPCNClsFound", 120, "minimum TPCNClsFound value for good track"}; - Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"}; - Configurable cfgMinCrossedRows{"cfgMinCrossedRows", 70, "min crossed rows for good track"}; - - // DCA Selections - // DCAr to PV - Configurable cMaxDCArToPVcut{"cMaxDCArToPVcut", 0.1f, "Track DCAr cut to PV Maximum"}; - // DCAz to PV - Configurable cMaxDCAzToPVcut{"cMaxDCAzToPVcut", 0.1f, "Track DCAz cut to PV Maximum"}; - - // Track selections - Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) - Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz - Configurable cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; // PV Contriuibutor - Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; - Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; - Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; - Configurable cTPCNClsFound{"cTPCNClsFound", false, "Switch to turn on/off TPCNClsFound cut"}; - Configurable cDCAr7SigCut{"cDCAr7SigCut", false, "Track DCAr 7 Sigma cut to PV Maximum"}; - - /// PID Selections - Configurable cByPassTOF{"cByPassTOF", false, "By pass TOF PID selection"}; // By pass TOF PID selection - Configurable cPIDcutType{"cPIDcutType", 2, "cPIDcutType = 1 for square cut, 2 for circular cut"}; // By pass TOF PID selection - - // Kaon - Configurable> kaonTPCPIDpTintv{"kaonTPCPIDpTintv", {0.5}, "pT intervals for Kaon TPC PID cuts"}; - Configurable> kaonTPCPIDcuts{"kaonTPCPIDcuts", {2}, "nSigma list for Kaon TPC PID cuts"}; - Configurable> kaonTOFPIDpTintv{"kaonTOFPIDpTintv", {999.}, "pT intervals for Kaon TOF PID cuts"}; - Configurable> kaonTOFPIDcuts{"kaonTOFPIDcuts", {2}, "nSigma list for Kaon TOF PID cuts"}; - Configurable> kaonTPCTOFCombinedpTintv{"kaonTPCTOFCombinedpTintv", {999.}, "pT intervals for Kaon TPC-TOF PID cuts"}; - Configurable> kaonTPCTOFCombinedPIDcuts{"kaonTPCTOFCombinedPIDcuts", {2}, "nSigma list for Kaon TPC-TOF PID cuts"}; - - // Proton - Configurable> protonTPCPIDpTintv{"protonTPCPIDpTintv", {0.9}, "pT intervals for Kaon TPC PID cuts"}; - Configurable> protonTPCPIDcuts{"protonTPCPIDcuts", {2}, "nSigma list for Kaon TPC PID cuts"}; - Configurable> protonTOFPIDpTintv{"protonTOFPIDpTintv", {999.}, "pT intervals for Kaon TOF PID cuts"}; - Configurable> protonTOFPIDcuts{"protonTOFPIDcuts", {2}, "nSigma list for Kaon TOF PID cuts"}; - Configurable> protonTPCTOFCombinedpTintv{"protonTPCTOFCombinedpTintv", {999.}, "pT intervals for Proton TPC-TOF PID cuts"}; - Configurable> protonTPCTOFCombinedPIDcuts{"protonTPCTOFCombinedPIDcuts", {2}, "nSigma list for Proton TPC-TOF PID cuts"}; + struct : ConfigurableGroup { + Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.0f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable cfgEvtOccupancyInTimeRangeMax{"cfgEvtOccupancyInTimeRangeMax", -1, "Evt sel: maximum track occupancy"}; + Configurable cfgEvtOccupancyInTimeRangeMin{"cfgEvtOccupancyInTimeRangeMin", -1, "Evt sel: minimum track occupancy"}; + Configurable cfgEvtTriggerCheck{"cfgEvtTriggerCheck", false, "Evt sel: check for trigger"}; + Configurable cfgEvtOfflineCheck{"cfgEvtOfflineCheck", true, "Evt sel: check for offline selection"}; + Configurable cfgEvtTriggerTVXSel{"cfgEvtTriggerTVXSel", false, "Evt sel: triggerTVX selection (MB)"}; + Configurable cfgEvtTFBorderCut{"cfgEvtTFBorderCut", false, "Evt sel: apply TF border cut"}; + Configurable cfgEvtUseITSTPCvertex{"cfgEvtUseITSTPCvertex", false, "Evt sel: use at lease on ITS-TPC track for vertexing"}; + Configurable cfgEvtZvertexTimedifference{"cfgEvtZvertexTimedifference", false, "Evt sel: apply Z-vertex time difference"}; + Configurable cfgEvtPileupRejection{"cfgEvtPileupRejection", false, "Evt sel: apply pileup rejection"}; + Configurable cfgEvtNoITSROBorderCut{"cfgEvtNoITSROBorderCut", false, "Evt sel: apply NoITSRO border cut"}; + Configurable cfgEvtCollInTimeRangeStandard{"cfgEvtCollInTimeRangeStandard", false, "Evt sel: apply NoCollInTimeRangeStandard"}; + } configEvents; + + struct : ConfigurableGroup { + // Pre-selection Track cuts + Configurable trackSelection{"trackSelection", 0, "Track selection: 0 -> No Cut, 1 -> kGlobalTrack, 2 -> kGlobalTrackWoPtEta, 3 -> kGlobalTrackWoDCA, 4 -> kQualityTracks, 5 -> kInAcceptanceTracks"}; + Configurable cMinPtcut{"cMinPtcut", 0.15f, "Minimal pT for tracks"}; + Configurable cMinTPCNClsFound{"cMinTPCNClsFound", 120, "minimum TPCNClsFound value for good track"}; + Configurable cfgCutEta{"cfgCutEta", 0.8f, "Eta range for tracks"}; + Configurable cfgCutRapidity{"cfgCutRapidity", 0.5f, "rapidity range for particles"}; + Configurable cfgMinCrossedRows{"cfgMinCrossedRows", 70, "min crossed rows for good track"}; + + // DCA Selections + // DCAr to PV + Configurable cMaxDCArToPVcut{"cMaxDCArToPVcut", 0.1f, "Track DCAr cut to PV Maximum"}; + // DCAz to PV + Configurable cMaxDCAzToPVcut{"cMaxDCAzToPVcut", 0.1f, "Track DCAz cut to PV Maximum"}; + + // Track selections + Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgGlobalWoDCATrack{"cfgGlobalWoDCATrack", true, "Global track selection without DCA"}; // kQualityTracks (kTrackType | kTPCNCls | kTPCCrossedRows | kTPCCrossedRowsOverNCls | kTPCChi2NDF | kTPCRefit | kITSNCls | kITSChi2NDF | kITSRefit | kITSHits) | kInAcceptanceTracks (kPtRange | kEtaRange) + Configurable cfgGlobalTrack{"cfgGlobalTrack", false, "Global track selection"}; // kGoldenChi2 | kDCAxy | kDCAz + Configurable cfgPVContributor{"cfgPVContributor", false, "PV contributor track selection"}; // PV Contriuibutor + Configurable cfgHasTOF{"cfgHasTOF", false, "Require TOF"}; + Configurable cfgUseTPCRefit{"cfgUseTPCRefit", false, "Require TPC Refit"}; + Configurable cfgUseITSRefit{"cfgUseITSRefit", false, "Require ITS Refit"}; + Configurable cTPCNClsFound{"cTPCNClsFound", false, "Switch to turn on/off TPCNClsFound cut"}; + Configurable cDCAr7SigCut{"cDCAr7SigCut", false, "Track DCAr 7 Sigma cut to PV Maximum"}; + } configTracks; + + struct : ConfigurableGroup { + /// PID Selections + Configurable pidnSigmaPreSelectionCut{"pidnSigmaPreSelectionCut", 4.0f, "pidnSigma Cut for pre-selection of tracks"}; + Configurable cByPassTOF{"cByPassTOF", false, "By pass TOF PID selection"}; // By pass TOF PID selection + Configurable cPIDcutType{"cPIDcutType", 2, "cPIDcutType = 1 for square cut, 2 for circular cut"}; // By pass TOF PID selection + + // Kaon + Configurable> kaonTPCPIDpTintv{"kaonTPCPIDpTintv", {0.5f}, "pT intervals for Kaon TPC PID cuts"}; + Configurable> kaonTPCPIDcuts{"kaonTPCPIDcuts", {2}, "nSigma list for Kaon TPC PID cuts"}; + Configurable> kaonTOFPIDpTintv{"kaonTOFPIDpTintv", {999.0f}, "pT intervals for Kaon TOF PID cuts"}; + Configurable> kaonTOFPIDcuts{"kaonTOFPIDcuts", {2}, "nSigma list for Kaon TOF PID cuts"}; + Configurable> kaonTPCTOFCombinedpTintv{"kaonTPCTOFCombinedpTintv", {999.0f}, "pT intervals for Kaon TPC-TOF PID cuts"}; + Configurable> kaonTPCTOFCombinedPIDcuts{"kaonTPCTOFCombinedPIDcuts", {2}, "nSigma list for Kaon TPC-TOF PID cuts"}; + + // Proton + Configurable> protonTPCPIDpTintv{"protonTPCPIDpTintv", {0.9f}, "pT intervals for Kaon TPC PID cuts"}; + Configurable> protonTPCPIDcuts{"protonTPCPIDcuts", {2}, "nSigma list for Kaon TPC PID cuts"}; + Configurable> protonTOFPIDpTintv{"protonTOFPIDpTintv", {999.0f}, "pT intervals for Kaon TOF PID cuts"}; + Configurable> protonTOFPIDcuts{"protonTOFPIDcuts", {2}, "nSigma list for Kaon TOF PID cuts"}; + Configurable> protonTPCTOFCombinedpTintv{"protonTPCTOFCombinedpTintv", {999.0f}, "pT intervals for Proton TPC-TOF PID cuts"}; + Configurable> protonTPCTOFCombinedPIDcuts{"protonTPCTOFCombinedPIDcuts", {2}, "nSigma list for Proton TPC-TOF PID cuts"}; + } configPID; + + struct : ConfigurableGroup { + /// Event Mixing + Configurable nEvtMixing{"nEvtMixing", 10, "Number of events to mix"}; + ConfigurableAxis cfgVtxBins{"cfgVtxBins", {VARIABLE_WIDTH, -10.0f, -8.0f, -6.0f, -4.0f, -2.0f, 0.0f, 2.0f, 4.0f, 6.0f, 8.0f, 10.0f}, "Mixing bins - z-vertex"}; + ConfigurableAxis cfgMultBins{"cfgMultBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 110.0f}, "Mixing bins - multiplicity"}; + + // Rotational background + Configurable rotationalcut{"rotationalcut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + Configurable cNofRotations{"cNofRotations", 3, "Number of random rotations in the rotational background"}; + Configurable cfgRotPr{"cfgRotPr", true, "rotate Proton"}; + } configBkg; // Additional purity check Configurable crejectPion{"crejectPion", false, "Switch to turn on/off pion contamination"}; - Configurable cApplyOpeningAngle{"cApplyOpeningAngle", false, "Kinematic Cuts for p-K pair opening angle"}; - Configurable cMinOpeningAngle{"cMinOpeningAngle", 1.4, "Maximum deltaEta between daughters"}; - Configurable cMaxOpeningAngle{"cMaxOpeningAngle", 2.4, "Maximum deltaPhi between daughters"}; - - /// Event Mixing - Configurable nEvtMixing{"nEvtMixing", 10, "Number of events to mix"}; - ConfigurableAxis cfgVtxBins{"cfgVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis cfgMultBins{"cfgMultBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.0f, 110.0f}, "Mixing bins - multiplicity"}; - - // Rotational background - Configurable isCalcRotBkg{"isCalcRotBkg", true, "Calculate rotational background"}; - Configurable rotationalcut{"rotationalcut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; - Configurable cNofRotations{"cNofRotations", 3, "Number of random rotations in the rotational background"}; + Configurable cUseOpeningAngleCut{"cUseOpeningAngleCut", false, "Kinematic Cuts for p-K pair opening angle"}; + Configurable cMinOpeningAngle{"cMinOpeningAngle", 1.4f, "Minimum opening angle between daughters"}; + Configurable cMaxOpeningAngle{"cMaxOpeningAngle", 2.4f, "Maximum opening angle between daughters"}; + Configurable cfgUseDeltaEtaPhiCuts{"cfgUseDeltaEtaPhiCuts", false, "Switch to turn on/off delta eta and delta phi cuts"}; + Configurable cfgUseDaughterEtaCutMC{"cfgUseDaughterEtaCutMC", false, "Switch to turn on/off eta cuts for daughters in MC"}; // MC selection cut - Configurable cZvertCutMC{"cZvertCutMC", 10.0, "MC Z-vertex cut"}; - Configurable cEtacutMC{"cEtacutMC", 0.5, "MC eta cut"}; + Configurable cZvertCutMC{"cZvertCutMC", 10.0f, "MC Z-vertex cut"}; + Configurable cEtacutMC{"cEtacutMC", 0.5f, "MC eta cut"}; Configurable cUseRapcutMC{"cUseRapcutMC", true, "MC eta cut"}; Configurable cUseEtacutMC{"cUseEtacutMC", true, "MC eta cut"}; // cuts on mother - Configurable cfgCutsOnMother{"cfgCutsOnMother", false, "Enable additional cuts on mother"}; - Configurable cMaxPtMotherCut{"cMaxPtMotherCut", 10.0, "Maximum pt of mother cut"}; - Configurable cMaxMinvMotherCut{"cMaxMinvMotherCut", 3.0, "Maximum Minv of mother cut"}; - Configurable cMaxDeltaEtaCut{"cMaxDeltaEtaCut", 0.7, "Maximum deltaEta between daughters"}; - Configurable cMaxDeltaPhiCut{"cMaxDeltaPhiCut", 1.5, "Maximum deltaPhi between daughters"}; + Configurable cfgUseCutsOnMother{"cfgUseCutsOnMother", false, "Enable additional cuts on mother"}; + Configurable cMaxPtMotherCut{"cMaxPtMotherCut", 10.0f, "Maximum pt of mother cut"}; + Configurable cMaxMinvMotherCut{"cMaxMinvMotherCut", 3.0f, "Maximum Minv of mother cut"}; + Configurable cMaxDeltaEtaCut{"cMaxDeltaEtaCut", 0.7f, "Maximum deltaEta between daughters"}; + Configurable cMaxDeltaPhiCut{"cMaxDeltaPhiCut", 1.5f, "Maximum deltaPhi between daughters"}; // switches Configurable cFillMultQA{"cFillMultQA", false, "Turn on/off additional QA plots"}; Configurable cFilladditionalQAeventPlots{"cFilladditionalQAeventPlots", false, "Additional QA event plots"}; Configurable cFilladditionalMEPlots{"cFilladditionalMEPlots", false, "Additional Mixed event plots"}; Configurable cFilldeltaEtaPhiPlots{"cFilldeltaEtaPhiPlots", false, "Enamble additional cuts on daughters"}; - Configurable cFillinvmass1DPlots{"cFillinvmass1DPlots", false, "Invariant mass 1D"}; - Configurable multEstimator{"multEstimator", 0, "Select multiplicity estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C"}; - - Configurable cfgCentEst{"cfgCentEst", 2, "Centrality estimator, 1: FT0C, 2: FT0M"}; + Configurable cFill1DQAs{"cFill1DQAs", false, "Invariant mass 1D"}; + Configurable centEstimator{"centEstimator", 0, "Select centrality estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C"}; TRandom* rn = new TRandom(); // Pre-filters for efficient process - // Filter tofPIDFilter = aod::track::tofExpMom < 0.f || ((aod::track::tofExpMom > 0.f) && ((nabs(aod::pidtof::tofNSigmaPi) < pidnSigmaPreSelectionCut) || (nabs(aod::pidtof::tofNSigmaKa) < pidnSigmaPreSelectionCut) || (nabs(aod::pidtof::tofNSigmaPr) < pidnSigmaPreSelectionCut))); // TOF - // Filter tpcPIDFilter = nabs(aod::pidtpc::tpcNSigmaPi) < pidnSigmaPreSelectionCut || nabs(aod::pidtpc::tpcNSigmaKa) < pidnSigmaPreSelectionCut || nabs(aod::pidtpc::tpcNSigmaPr) < pidnSigmaPreSelectionCut; // TPC - /* Filter trackFilter = (trackSelection == 0) || - ((trackSelection == 1) && requireGlobalTrackInFilter()) || - ((trackSelection == 2) && requireGlobalTrackWoPtEtaInFilter()) || - ((trackSelection == 3) && requireGlobalTrackWoDCAInFilter()) || - ((trackSelection == 4) && requireQualityTracksInFilter()) || - ((trackSelection == 5) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); */ - Filter trackEtaFilter = nabs(aod::track::eta) < cfgCutEta; // Eta cut + Filter zVtxFilter = (nabs(o2::aod::collision::posZ) <= configEvents.cfgEvtZvtx); + Filter collisionFilterMC = nabs(aod::mccollision::posZ) <= configEvents.cfgEvtZvtx; + // Filter centralityFilter = nabs(aod::cent::centFT0C) <= cfg_Event_CentralityMax; + // Filter triggerFilter = (o2::aod::evsel::sel8 == true); + + Filter tofPIDFilter = aod::track::tofExpMom < 0.0f || ((aod::track::tofExpMom > 0.0f) && (/* (nabs(aod::pidtof::tofNSigmaPi) < configPID.pidnSigmaPreSelectionCut) || */ (nabs(aod::pidtof::tofNSigmaKa) < configPID.pidnSigmaPreSelectionCut) || (nabs(aod::pidtof::tofNSigmaPr) < configPID.pidnSigmaPreSelectionCut))); // TOF + Filter tpcPIDFilter = /* nabs(aod::pidtpc::tpcNSigmaPi) < configPID.pidnSigmaPreSelectionCut || */ nabs(aod::pidtpc::tpcNSigmaKa) < configPID.pidnSigmaPreSelectionCut || nabs(aod::pidtpc::tpcNSigmaPr) < configPID.pidnSigmaPreSelectionCut; // TPC + Filter trackFilter = (configTracks.trackSelection == AllTracks) || + ((configTracks.trackSelection == GlobalTracks) && requireGlobalTrackInFilter()) || + ((configTracks.trackSelection == GlobalTracksWoPtEta) && requireGlobalTrackWoPtEtaInFilter()) || + ((configTracks.trackSelection == GlobalTracksWoDCA) && requireGlobalTrackWoDCAInFilter()) || + ((configTracks.trackSelection == QualityTracks) && requireQualityTracksInFilter()) || + ((configTracks.trackSelection == InAcceptanceTracks) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); + + Filter acceptanceFilter = (nabs(aod::track::eta) < configTracks.cfgCutEta && nabs(aod::track::pt) > configTracks.cMinPtcut); + // Filter DCAcutFilter = (nabs(aod::track::dcaXY) < configTracks.cfgCutDCAxy) && (nabs(aod::track::dcaZ) < configTracks.cfgCutDCAz); + // Filter primarytrackFilter = requirePVContributor() && requirePrimaryTrack() && requireGlobalTrackWoDCA(); using EventCandidates = soa::Join; using TrackCandidates = soa::Filtered>; @@ -199,34 +221,30 @@ struct Lstaranalysis { using MCTrackCandidates = soa::Filtered>; /// Figures - ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.25, 1.3, 1.4, 1.5, 1.6, 1.7, 1.75, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.6, 3.7, 3.8, 3.9, 4.0, 4.1, 4.2, 4.5, 4.6, 4.8, 4.9, 5.0, 5.5, 5.6, 6.0, 6.4, 6.5, 7.0, 7.2, 8.0, 9.0, 9.5, 9.6, 10.0, 11.0, 11.5, 12.0, 13.0, 14.0, 14.4, 15.0, 16.0, 18.0, 19.2, 20.}, "Binning of the pT axis"}; - ConfigurableAxis binsPtQA{"binsPtQA", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.4, 2.6, 2.8, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0, 7.2, 7.4, 7.6, 7.8, 8.0, 8.2, 8.4, 8.6, 8.8, 9.0, 9.2, 9.4, 9.6, 9.8, 10.0, 10.2, 10.4, 10.6, 10.8, 11, 11.2, 11.4, 11.6, 11.8, 12, 12.2, 12.4, 12.6, 12.8, 13, 13.2, 13.4, 13.6, 13.8, 14, 14.2, 14.4, 14.6, 14.8, 15, 15.2, 15.4, 15.6, 15.8, 16, 16.2, 16.4, 16.6, 16.8, 17, 17.2, 17.4, 17.6, 17.8, 18, 18.2, 18.4, 18.6, 18.8, 19, 19.2, 19.4, 19.6, 19.8, 20}, "Binning of the pT axis"}; - ConfigurableAxis binsEta{"binsEta", {150, -1.5, 1.5}, ""}; - ConfigurableAxis binsMass{"binsMass", {70, 1.3, 2.0}, "Invariant Mass (GeV/#it{c}^2)"}; - ConfigurableAxis binsMult{"binsMult", {105, 0.0, 105.0}, "mult_{FT0M}"}; - ConfigurableAxis binsDCAz{"binsDCAz", {40, -0.2, 0.2}, ""}; - ConfigurableAxis binsDCAxy{"binsDCAxy", {40, -0.2, 0.2}, ""}; + ConfigurableAxis binsPt{"binsPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.12f, 0.14f, 0.16f, 0.18f, 0.2f, 0.25f, 0.3f, 0.35f, 0.4f, 0.45f, 0.5f, 0.55f, 0.6f, 0.65f, 0.7f, 0.75f, 0.8f, 0.85f, 0.9f, 0.95f, 1.0f, 1.1f, 1.2f, 1.25f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.75f, 1.8f, 1.9f, 2.0f, 2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f, 3.0f, 3.1f, 3.2f, 3.3f, 3.4f, 3.6f, 3.7f, 3.8f, 3.9f, 4.0f, 4.1f, 4.2f, 4.5f, 4.6f, 4.8f, 4.9f, 5.0f, 5.5f, 5.6f, 6.0f, 6.4f, 6.5f, 7.0f, 7.2f, 8.0f, 9.0f, 9.5f, 9.6f, 10.0f, 11.0f, 11.5f, 12.0f, 13.0f, 14.0f, 14.4f, 15.0f, 16.0f, 18.0f, 19.2f, 20.0f}, "Binning of the pT axis"}; + ConfigurableAxis binsPtQA{"binsPtQA", {VARIABLE_WIDTH, 0.0f, 0.2f, 0.4f, 0.6f, 0.8f, 1.0f, 1.2f, 1.4f, 1.6f, 1.8f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.2f, 4.4f, 4.6f, 4.8f, 5.0f, 5.2f, 5.4f, 5.6f, 5.8f, 6.0f, 6.2f, 6.4f, 6.6f, 6.8f, 7.0f, 7.2f, 7.4f, 7.6f, 7.8f, 8.0f, 8.2f, 8.4f, 8.6f, 8.8f, 9.0f, 9.2f, 9.4f, 9.6f, 9.8f, 10.0f, 10.2f, 10.4f, 10.6f, 10.8f, 11.0f, 11.2f, 11.4f, 11.6f, 11.8f, 12.0f, 12.2f, 12.4f, 12.6f, 12.8f, 13.0f, 13.2f, 13.4f, 13.6f, 13.8f, 14.0f, 14.2f, 14.4f, 14.6f, 14.8f, 15.0f, 15.2f, 15.4f, 15.6f, 15.8f, 16.0f, 16.2f, 16.4f, 16.6f, 16.8f, 17.0f, 17.2f, 17.4f, 17.6f, 17.8f, 18.0f, 18.2f, 18.4f, 18.6f, 18.8f, 19.0f, 19.2f, 19.4f, 19.6f, 19.8f, 20.0f}, "Binning of the pT axis"}; + ConfigurableAxis binsEta{"binsEta", {150, -1.5f, 1.5f}, ""}; + ConfigurableAxis binsMass{"binsMass", {70, 1.3f, 2.0f}, "Invariant Mass (GeV/#it{c}^2)"}; + ConfigurableAxis binsMult{"binsMult", {105, 0.0f, 105.0f}, "mult_{FT0M}"}; + ConfigurableAxis binsDCAz{"binsDCAz", {40, -0.2f, 0.2f}, ""}; + ConfigurableAxis binsDCAxy{"binsDCAxy", {40, -0.2f, 0.2f}, ""}; ConfigurableAxis binsTPCXrows{"binsTPCXrows", {100, 60, 160}, ""}; - ConfigurableAxis binsnSigma{"binsnSigma", {130, -6.5, 6.5}, ""}; + ConfigurableAxis binsnSigma{"binsnSigma", {130, -6.5f, 6.5f}, ""}; ConfigurableAxis binsnTPCSignal{"binsnTPCSignal", {1000, 0, 1000}, ""}; - ConfigurableAxis binsEtaPhi{"binsEtaPhi", {350, -3.5, 3.5}, ""}; - - float centrality; + ConfigurableAxis binsEtaPhi{"binsEtaPhi", {350, -3.5f, 3.5f}, ""}; void init(framework::InitContext&) { - centrality = -999; - - colCuts.setCuts(cfgEvtZvtx, cfgEvtTriggerCheck, cfgEvtOfflineCheck, /*checkRun3*/ true, /*triggerTVXsel*/ false, cfgEvtOccupancyInTimeRangeMax, cfgEvtOccupancyInTimeRangeMin); + colCuts.setCuts(configEvents.cfgEvtZvtx, configEvents.cfgEvtTriggerCheck, configEvents.cfgEvtOfflineCheck, /*checkRun3*/ true, /*triggerTVXsel*/ false, configEvents.cfgEvtOccupancyInTimeRangeMax, configEvents.cfgEvtOccupancyInTimeRangeMin); colCuts.init(&histos); - colCuts.setTriggerTVX(cfgEvtTriggerTVXSel); - colCuts.setApplyTFBorderCut(cfgEvtTFBorderCut); - colCuts.setApplyITSTPCvertex(cfgEvtUseITSTPCvertex); - colCuts.setApplyZvertexTimedifference(cfgEvtZvertexTimedifference); - colCuts.setApplyPileupRejection(cfgEvtPileupRejection); - colCuts.setApplyNoITSROBorderCut(cfgEvtNoITSROBorderCut); - colCuts.setApplyCollInTimeRangeStandard(cfgEvtCollInTimeRangeStandard); + colCuts.setTriggerTVX(configEvents.cfgEvtTriggerTVXSel); + colCuts.setApplyTFBorderCut(configEvents.cfgEvtTFBorderCut); + colCuts.setApplyITSTPCvertex(configEvents.cfgEvtUseITSTPCvertex); + colCuts.setApplyZvertexTimedifference(configEvents.cfgEvtZvertexTimedifference); + colCuts.setApplyPileupRejection(configEvents.cfgEvtPileupRejection); + colCuts.setApplyNoITSROBorderCut(configEvents.cfgEvtNoITSROBorderCut); + colCuts.setApplyCollInTimeRangeStandard(configEvents.cfgEvtCollInTimeRangeStandard); colCuts.printCuts(); // axes @@ -241,22 +259,18 @@ struct Lstaranalysis { AxisSpec axisTPCXrow{binsTPCXrows, "#Xrows_{TPC}"}; AxisSpec axisPIDQA{binsnSigma, "#sigma"}; AxisSpec axisTPCSignal{binsnTPCSignal, ""}; - AxisSpec axisMClabel{6, -1.5, 5.5, "MC Label"}; + AxisSpec axisMClabel{6, -1.5f, 5.5f, "MC Label"}; AxisSpec axisEtaPhi{binsEtaPhi, ""}; AxisSpec axisPhi{350, 0, 7, "#Phi"}; - AxisSpec axisMultMix{cfgMultBins, "Multiplicity"}; - AxisSpec axisVtxMix{cfgVtxBins, "Vertex Z (cm)"}; - AxisSpec idxMCAxis = {26, -0.5, 25.5, "Index"}; + AxisSpec axisMultMix{configBkg.cfgMultBins, "Multiplicity"}; + AxisSpec axisVtxMix{configBkg.cfgVtxBins, "Vertex Z (cm)"}; + AxisSpec idxMCAxis = {26, -0.5f, 25.5f, "Index"}; if (cFilladditionalQAeventPlots) { // event histograms if (doprocessData) { - histos.add("TestME/hPairsCounterSameE", "tot n pairs sameE", HistType::kTH1F, {{1, 0.5f, 1.5f}}); - histos.add("QAevent/hEvtCounterSameE", "Number of analyzed Same Events", HistType::kTH1F, {{1, 0.5, 1.5}}); - histos.add("QAevent/hVertexZSameE", "Collision Vertex Z position", HistType::kTH1F, {{100, -15., 15.}}); - histos.add("QAevent/hMultiplicityPercentSameE", "Multiplicity percentile of collision", HistType::kTH1F, {{120, 0.0f, 120.0f}}); - histos.add("TestME/hCollisionIndexSameE", "coll index sameE", HistType::kTH1F, {{500, 0.0f, 500.0f}}); - histos.add("TestME/hnTrksSameE", "n tracks per event SameE", HistType::kTH1F, {{1000, 0.0f, 1000.0f}}); + histos.add("QAevent/hPairsCounterSameE", "total valid no. of pairs sameE", HistType::kTH1F, {{1, 0.5f, 1.5f}}); + histos.add("QAevent/hnTrksSameE", "n tracks per event SameE", HistType::kTH1F, {{1000, 0.0, 1000.0}}); } // Test on Mixed event if (doprocessME) { @@ -266,12 +280,10 @@ struct Lstaranalysis { histos.add("QAevent/hMixPool_Multiplicity", "Mixed Event Pool: Multiplicity;Multiplicity;Counts", HistType::kTH1F, {axisMultMix}); histos.add("QAevent/hMixPool_VtxZ_vs_Multiplicity", "Mixed Event Pool: Vertex Z vs Multiplicity;Counts", HistType::kTH2F, {axisVtxMix, axisMultMix}); - histos.add("TestME/hPairsCounterMixedE", "tot n pairs mixedE", HistType::kTH1F, {{1, 0.5f, 1.5f}}); - histos.add("QAevent/hEvtCounterMixedE", "Number of analyzed Mixed Events", HistType::kTH1F, {{1, 0.5, 1.5}}); - histos.add("QAevent/hVertexZMixedE", "Collision Vertex Z position", HistType::kTH1F, {{100, -15., 15.}}); + histos.add("QAevent/hPairsCounterMixedE", "total valid no. of pairs mixedE", HistType::kTH1F, {{1, 0.5f, 1.5f}}); + histos.add("QAevent/hVertexZMixedE", "Collision Vertex Z position", HistType::kTH1F, {{100, -15.0f, 15.0f}}); histos.add("QAevent/hMultiplicityPercentMixedE", "Multiplicity percentile of collision", HistType::kTH1F, {{120, 0.0f, 120.0f}}); - histos.add("TestME/hCollisionIndexMixedE", "coll index mixedE", HistType::kTH1F, {{500, 0.0f, 500.0f}}); - histos.add("TestME/hnTrksMixedE", "n tracks per event MixedE", HistType::kTH1F, {{1000, 0.0f, 1000.0f}}); + histos.add("QAevent/hnTrksMixedE", "n tracks per event MixedE", HistType::kTH1F, {{1000, 0.0f, 1000.0f}}); } } @@ -310,7 +322,7 @@ struct Lstaranalysis { histos.add("QA/QAafter/Kaon/pT", "pT distribution of Kaons; #it{p}_{T} (GeV/#it{c}); Counts;", {HistType::kTH1F, {axisPt}}); histos.add("QA/QAafter/Kaon/eta", "#eta distribution of Kaons; #eta; Counts;", {HistType::kTH1F, {axisEta}}); histos.add("QA/QAafter/Kaon/TPC_Signal_ka_all", "TPC Signal for Kaon;#it{p} (GeV/#it{c});TPC Signal (A.U.)", {HistType::kTH2F, {axisPt, axisTPCSignal}}); - histos.add("QA/QAafter/Kaon/TPCnclusterPhika", "TPC ncluster vs phi", kTHnSparseF, {{160, 0, 160, "TPC nCluster"}, {63, 0, 6.28, "#phi"}}); + histos.add("QA/QAafter/Kaon/TPCnclusterPhika", "TPC ncluster vs phi", kTHnSparseF, {{160, 0, 160, "TPC nCluster"}, {63, 0.0f, 6.28f, "#phi"}}); // --- Proton histos.add("QA/QAafter/Proton/TOF_TPC_Map_pr_all", "TOF + TPC Combined PID for Proton;{#sigma_{TOF}^{Proton}};{#sigma_{TPC}^{Proton}}", {HistType::kTH2F, {axisPIDQA, axisPIDQA}}); @@ -323,10 +335,10 @@ struct Lstaranalysis { histos.add("QA/QAafter/Proton/pT", "pT distribution of Protons; #it{p}_{T} (GeV/#it{c}); Counts;", {HistType::kTH1F, {axisPt}}); histos.add("QA/QAafter/Proton/eta", "#eta distribution of Protons; #eta; Counts;", {HistType::kTH1F, {axisEta}}); histos.add("QA/QAafter/Proton/TPC_Signal_pr_all", "TPC Signal for Proton;#it{p} (GeV/#it{c});TPC Signal (A.U.)", {HistType::kTH2F, {axisPt, axisTPCSignal}}); - histos.add("QA/QAafter/Proton/TPCnclusterPhipr", "TPC ncluster vs phi", kTHnSparseF, {{160, 0, 160, "TPC nCluster"}, {63, 0, 6.28, "#phi"}}); + histos.add("QA/QAafter/Proton/TPCnclusterPhipr", "TPC ncluster vs phi", kTHnSparseF, {{160, 0, 160, "TPC nCluster"}, {63, 0.0f, 6.28f, "#phi"}}); // Mass QA 1D for quick check - if (cFillinvmass1DPlots) { + if (cFill1DQAs) { histos.add("Result/Data/lambda1520invmass", "Invariant mass of #Lambda(1520) K^{#pm}p^{#mp}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); histos.add("Result/Data/antilambda1520invmass", "Invariant mass of #Lambda(1520) K^{#mp}p^{#pm}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); histos.add("Result/Data/lambda1520invmassLSPP", "Invariant mass of #Lambda(1520) Like Sign Method K^{#plus}p^{#plus}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); // K+ + Pr @@ -340,33 +352,41 @@ struct Lstaranalysis { histos.add("QAafter/deltaEta", "deltaEta of kaon and proton candidates", HistType::kTH1F, {axisEtaPhi}); histos.add("QAafter/deltaPhi", "deltaPhi of kaon and proton candidates", HistType::kTH1F, {axisEtaPhi}); - histos.add("QAafter/deltaEtaafter", "deltaEta of kaon and proton candidates", HistType::kTH1F, {axisEtaPhi}); - histos.add("QAafter/deltaPhiafter", "deltaPhi of kaon and proton candidates", HistType::kTH1F, {axisEtaPhi}); - histos.add("QAafter/EtaPrafter", "Eta of proton candidates", HistType::kTH1F, {axisEta}); histos.add("QAafter/PhiPrafter", "Phi of proton candidates", HistType::kTH1F, {axisPhi}); - histos.add("QAafter/EtaKaafter", "Eta of kaon candidates", HistType::kTH1F, {axisEta}); histos.add("QAafter/PhiKaafter", "Phi of kaon candidates", HistType::kTH1F, {axisPhi}); } - if (isCalcRotBkg) { - histos.add("Result/Data/h3lambda1520InvMassRotation", "Invariant mass of #Lambda(1520) rotation", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); - } - // 3d histogram histos.add("Result/Data/h3lambda1520invmass", "Invariant mass of #Lambda(1520) K^{#pm}p^{#mp}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); histos.add("Result/Data/h3antilambda1520invmass", "Invariant mass of #Lambda(1520) K^{#mp}p^{#pm}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); histos.add("Result/Data/h3lambda1520invmassLSPP", "Invariant mass of #Lambda(1520) Like Sign Method K^{#plus}p^{#plus}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); // K+ + Pr histos.add("Result/Data/h3lambda1520invmassLSMM", "Invariant mass of #Lambda(1520) Like Sign Method K^{#minus}p^{#minus}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); // K- + anti-Pr } + + if (doprocessRotational) { + if (cFill1DQAs) { + histos.add("Result/Data/lambda1520InvMassRotation", "Invariant mass of #Lambda(1520) Like Sign Method K^{#plus}p^{#plus}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); // K+ + Pr + histos.add("Result/Data/antilambda1520InvMassRotation", "Invariant mass of #Lambda(1520) Like Sign Method K^{#minus}p^{#minus}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); // K- + anti-Pr + } + histos.add("Result/Data/h3lambda1520InvMassRotation", "Invariant mass of #Lambda(1520) rotation", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); + histos.add("Result/Data/h3antilambda1520InvMassRotation", "Invariant mass of #Lambda(1520) rotation", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); + } + // Mixed event histograms if (doprocessME) { - if (cFillinvmass1DPlots) { - histos.add("Result/Data/lambda1520invmassME", "Invariant mass of #Lambda(1520) mixed event K^{#pm}p^{#mp}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); + if (cFill1DQAs) { + histos.add("Result/Data/lambda1520invmassME_UnlikeSign", "Invariant mass of #Lambda(1520) mixed event K^{#pm}p^{#mp}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); + histos.add("Result/Data/antilambda1520invmassME_UnlikeSign", "Invariant mass of #Lambda(1520) mixed event K^{#pm}p^{#mp}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); } - histos.add("Result/Data/h3lambda1520invmassME", "Invariant mass of #Lambda(1520) mixed event K^{#pm}p^{#mp}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); + histos.add("Result/Data/h3lambda1520invmassME_UnlikeSign", "Invariant mass of #Lambda(1520) mixed event K^{#pm}p^{#mp}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); + histos.add("Result/Data/h3antilambda1520invmassME_UnlikeSign", "Invariant mass of #Lambda(1520) mixed event K^{#pm}p^{#mp}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); if (cFilladditionalMEPlots) { - histos.add("Result/Data/h3lambda1520invmassME_DS", "Invariant mass of #Lambda(1520) mixed event DS", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); - histos.add("Result/Data/h3lambda1520invmassME_DSAnti", "Invariant mass of #Lambda(1520) mixed event DSAnti", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); + if (cFill1DQAs) { + histos.add("Result/Data/lambda1520invmassME_LSPP", "Invariant mass of #Lambda(1520) Like Sign Method K^{#plus}p^{#plus}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); // K+ + Pr + histos.add("Result/Data/lambda1520invmassME_LSMM", "Invariant mass of #Lambda(1520) Like Sign Method K^{#minus}p^{#minus}; Invariant Mass (GeV/#it{c}^2); Counts;", {HistType::kTH1F, {axisMassLambda1520}}); // K- + anti-Pr + } + histos.add("Result/Data/h3lambda1520invmassME_LSPP", "Invariant mass of #Lambda(1520) mixed event Like Sign Method K^{#plus}p^{#plus}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); // K+ + Pr + histos.add("Result/Data/h3lambda1520invmassME_LSMM", "Invariant mass of #Lambda(1520) mixed event Like Sign Method K^{#minus}p^{#minus}", HistType::kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); // K- + anti-Pr } } @@ -401,49 +421,37 @@ struct Lstaranalysis { } // Print output histograms statistics - LOG(info) << "Size of the histograms in LstarAnalysis:"; + LOG(info) << "Size of the histograms in Lambda1520analysisinpp:"; histos.print(); } float massKa = MassKaonCharged; float massPr = MassProton; - int kLambda1520PDG = static_cast(102134); // PDG code for Lambda(1520) - - template - float getCentrality(CollisionType const& collision) - { - if (cfgCentEst == static_cast(1)) { - return collision.multFT0C(); - } else if (cfgCentEst == static_cast(2)) { - return collision.multFT0M(); - } else { - return -999; - } - } - // Centralicity estimator selection - template - float centEst(ResoColl ResoEvents) + template + float centEst(Coll collisions) { - float returnValue = -999.0; - switch (multEstimator) { + float returnValue = -999.0f; + switch (centEstimator) { case 0: - returnValue = ResoEvents.centFT0M(); + returnValue = collisions.centFT0M(); break; case 1: - returnValue = ResoEvents.centFT0A(); + returnValue = collisions.centFT0A(); break; case 2: - returnValue = ResoEvents.centFT0C(); + returnValue = collisions.centFT0C(); break; default: - returnValue = ResoEvents.centFT0M(); + returnValue = collisions.centFT0M(); break; } return returnValue; } + auto static constexpr TripleCharge = 3.0f; + // Check if the collision is INEL>0 template bool isTrueINEL0(MCColl const& /*mccoll*/, MCPart const& mcparts) @@ -453,8 +461,8 @@ struct Lstaranalysis { continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); if (p != nullptr) { - if (std::abs(p->Charge()) >= 3) { - if (std::abs(mcparticle.eta()) < 1) + if (std::abs(p->Charge()) >= TripleCharge) { // check if the particle is charged + if (std::abs(mcparticle.eta()) < 1.0f) return true; } } @@ -466,34 +474,34 @@ struct Lstaranalysis { bool trackCut(const TrackType track) { // basic track cuts - if (std::abs(track.pt()) < cMinPtcut) + if (std::abs(track.pt()) < configTracks.cMinPtcut) return false; - if (cDCAr7SigCut) { - if (std::abs(track.dcaXY()) > (0.004f + 0.0130f / (track.pt()))) // 7 - Sigma cut + if (configTracks.cDCAr7SigCut) { + if (std::abs(track.dcaXY()) > (0.004f + 0.013f / (track.pt()))) // 7 - Sigma cut return false; } else { - if (std::abs(track.dcaXY()) > cMaxDCArToPVcut) + if (std::abs(track.dcaXY()) > configTracks.cMaxDCArToPVcut) return false; } - if (std::abs(track.dcaZ()) > cMaxDCAzToPVcut) + if (std::abs(track.dcaZ()) > configTracks.cMaxDCAzToPVcut) return false; - if (cTPCNClsFound && (track.tpcNClsFound() < cMinTPCNClsFound)) + if (configTracks.cTPCNClsFound && (track.tpcNClsFound() < configTracks.cMinTPCNClsFound)) return false; - if (track.tpcNClsCrossedRows() < cfgMinCrossedRows) + if (track.tpcNClsCrossedRows() < configTracks.cfgMinCrossedRows) return false; - if (cfgHasTOF && !track.hasTOF()) + if (configTracks.cfgHasTOF && !track.hasTOF()) return false; - if (cfgPrimaryTrack && !track.isPrimaryTrack()) + if (configTracks.cfgPrimaryTrack && !track.isPrimaryTrack()) return false; - if (cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + if (configTracks.cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) return false; - if (cfgPVContributor && !track.isPVContributor()) + if (configTracks.cfgPVContributor && !track.isPVContributor()) return false; - if (cfgGlobalTrack && !track.isGlobalTrack()) + if (configTracks.cfgGlobalTrack && !track.isGlobalTrack()) return false; - if (cfgUseITSRefit && !track.passedITSRefit()) + if (configTracks.cfgUseITSRefit && !track.passedITSRefit()) return false; - if (cfgUseTPCRefit && !track.passedTPCRefit()) + if (configTracks.cfgUseTPCRefit && !track.passedTPCRefit()) return false; return true; @@ -503,32 +511,34 @@ struct Lstaranalysis { // candidate.tpcNSigmaPr(), candidate.tofNSigmaPr(), tpcPIDPassed, tofPIDPassed, tpcPIDPassed || tofPIDPassed); template - bool pTdependentPIDProton(const T& candidate) + bool ptDependentPidProton(const T& candidate) { - auto vProtonTPCPIDpTintv = static_cast>(protonTPCPIDpTintv); - vProtonTPCPIDpTintv.insert(vProtonTPCPIDpTintv.begin(), cMinPtcut); - auto vProtonTPCPIDcuts = static_cast>(protonTPCPIDcuts); - auto vProtonTOFPIDpTintv = static_cast>(protonTOFPIDpTintv); - auto vProtonTPCTOFCombinedpTintv = static_cast>(protonTPCTOFCombinedpTintv); - auto vProtonTPCTOFCombinedPIDcuts = static_cast>(protonTPCTOFCombinedPIDcuts); - auto vProtonTOFPIDcuts = static_cast>(protonTOFPIDcuts); + auto vProtonTPCPIDpTintv = configPID.protonTPCPIDpTintv.value; + vProtonTPCPIDpTintv.insert(vProtonTPCPIDpTintv.begin(), configTracks.cMinPtcut); + auto vProtonTPCPIDcuts = configPID.protonTPCPIDcuts.value; + auto vProtonTOFPIDpTintv = configPID.protonTOFPIDpTintv.value; + auto vProtonTPCTOFCombinedpTintv = configPID.protonTPCTOFCombinedpTintv.value; + auto vProtonTPCTOFCombinedPIDcuts = configPID.protonTPCTOFCombinedPIDcuts.value; + auto vProtonTOFPIDcuts = configPID.protonTOFPIDcuts.value; float pt = candidate.pt(); float ptSwitchToTOF = vProtonTPCPIDpTintv.back(); + float tpcNsigmaPr = candidate.tpcNSigmaPr(); + float tofNsigmaPr = candidate.tofNSigmaPr(); bool tpcPIDPassed = false; // TPC PID (interval check) for (size_t i = 0; i < vProtonTPCPIDpTintv.size() - 1; ++i) { if (pt > vProtonTPCPIDpTintv[i] && pt < vProtonTPCPIDpTintv[i + 1]) { - if (std::abs(candidate.tpcNSigmaPr()) < vProtonTPCPIDcuts[i]) + if (std::abs(tpcNsigmaPr) < vProtonTPCPIDcuts[i]) tpcPIDPassed = true; } } // TOF bypass option (for QA or MC) - if (cByPassTOF) { - return std::abs(candidate.tpcNSigmaPr()) < vProtonTPCPIDcuts.back(); + if (configPID.cByPassTOF) { + return std::abs(tpcNsigmaPr) < vProtonTPCPIDcuts.back(); } // Case 1: No TOF and pt ≤ threshold → accept only via TPC PID @@ -543,22 +553,22 @@ struct Lstaranalysis { // Case 3: Has TOF → use TPC + TOF (square or circular) if (candidate.hasTOF()) { - if (cPIDcutType == 1) { + if (configPID.cPIDcutType == SquareType) { // Rectangular cut for (size_t i = 0; i < vProtonTOFPIDpTintv.size(); ++i) { if (pt < vProtonTOFPIDpTintv[i]) { - if (std::abs(candidate.tofNSigmaPr()) < vProtonTOFPIDcuts[i] && - std::abs(candidate.tpcNSigmaPr()) < vProtonTPCPIDcuts.back()) + if (std::abs(tofNsigmaPr) < vProtonTOFPIDcuts[i] && + std::abs(tpcNsigmaPr) < vProtonTPCPIDcuts.back()) return true; } } - } else if (cPIDcutType == 2) { + } else if (configPID.cPIDcutType == CircularType) { // Circular cut for (size_t i = 0; i < vProtonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vProtonTPCTOFCombinedpTintv[i]) { float combinedSigma2 = - candidate.tpcNSigmaPr() * candidate.tpcNSigmaPr() + - candidate.tofNSigmaPr() * candidate.tofNSigmaPr(); + tpcNsigmaPr * tpcNsigmaPr + + tofNsigmaPr * tofNsigmaPr; if (combinedSigma2 < vProtonTPCTOFCombinedPIDcuts[i] * vProtonTPCTOFCombinedPIDcuts[i]) return true; } @@ -570,25 +580,27 @@ struct Lstaranalysis { } template - bool pTdependentPIDKaon(const T& candidate) + bool ptDependentPidKaon(const T& candidate) { - auto vKaonTPCPIDpTintv = static_cast>(kaonTPCPIDpTintv); - vKaonTPCPIDpTintv.insert(vKaonTPCPIDpTintv.begin(), cMinPtcut); - auto vKaonTPCPIDcuts = static_cast>(kaonTPCPIDcuts); - auto vKaonTOFPIDpTintv = static_cast>(kaonTOFPIDpTintv); - auto vKaonTPCTOFCombinedpTintv = static_cast>(kaonTPCTOFCombinedpTintv); - auto vKaonTPCTOFCombinedPIDcuts = static_cast>(kaonTPCTOFCombinedPIDcuts); - auto vKaonTOFPIDcuts = static_cast>(kaonTOFPIDcuts); + auto vKaonTPCPIDpTintv = configPID.kaonTPCPIDpTintv.value; + vKaonTPCPIDpTintv.insert(vKaonTPCPIDpTintv.begin(), configTracks.cMinPtcut); + auto vKaonTPCPIDcuts = configPID.kaonTPCPIDcuts.value; + auto vKaonTOFPIDpTintv = configPID.kaonTOFPIDpTintv.value; + auto vKaonTPCTOFCombinedpTintv = configPID.kaonTPCTOFCombinedpTintv.value; + auto vKaonTPCTOFCombinedPIDcuts = configPID.kaonTPCTOFCombinedPIDcuts.value; + auto vKaonTOFPIDcuts = configPID.kaonTOFPIDcuts.value; float pt = candidate.pt(); float ptSwitchToTOF = vKaonTPCPIDpTintv.back(); + float tpcNsigmaKa = candidate.tpcNSigmaKa(); + float tofNsigmaKa = candidate.tofNSigmaKa(); bool tpcPIDPassed = false; // TPC PID interval-based check for (size_t i = 0; i < vKaonTPCPIDpTintv.size() - 1; ++i) { if (pt > vKaonTPCPIDpTintv[i] && pt < vKaonTPCPIDpTintv[i + 1]) { - if (std::abs(candidate.tpcNSigmaKa()) < vKaonTPCPIDcuts[i]) { + if (std::abs(tpcNsigmaKa) < vKaonTPCPIDcuts[i]) { tpcPIDPassed = true; break; } @@ -596,8 +608,8 @@ struct Lstaranalysis { } // TOF bypass option - if (cByPassTOF) { - return std::abs(candidate.tpcNSigmaKa()) < vKaonTPCPIDcuts.back(); + if (configPID.cByPassTOF) { + return std::abs(tpcNsigmaKa) < vKaonTPCPIDcuts.back(); } // Case 1: No TOF and pt ≤ ptSwitch → use TPC-only @@ -612,22 +624,22 @@ struct Lstaranalysis { // Case 3: TOF is available → apply TPC+TOF PID logic if (candidate.hasTOF()) { - if (cPIDcutType == 1) { + if (configPID.cPIDcutType == SquareType) { // Rectangular cut for (size_t i = 0; i < vKaonTOFPIDpTintv.size(); ++i) { if (pt < vKaonTOFPIDpTintv[i]) { - if (std::abs(candidate.tofNSigmaKa()) < vKaonTOFPIDcuts[i] && - std::abs(candidate.tpcNSigmaKa()) < vKaonTPCPIDcuts.back()) { + if (std::abs(tofNsigmaKa) < vKaonTOFPIDcuts[i] && + std::abs(tpcNsigmaKa) < vKaonTPCPIDcuts.back()) { return true; } } } - } else if (cPIDcutType == 2) { + } else if (configPID.cPIDcutType == CircularType) { // Circular cut for (size_t i = 0; i < vKaonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vKaonTPCTOFCombinedpTintv[i]) { - float combinedSigma2 = candidate.tpcNSigmaKa() * candidate.tpcNSigmaKa() + - candidate.tofNSigmaKa() * candidate.tofNSigmaKa(); + float combinedSigma2 = tpcNsigmaKa * tpcNsigmaKa + + tofNsigmaKa * tofNsigmaKa; if (combinedSigma2 < vKaonTPCTOFCombinedPIDcuts[i] * vKaonTPCTOFCombinedPIDcuts[i]) { return true; } @@ -639,92 +651,100 @@ struct Lstaranalysis { return false; } + auto static constexpr MinPtforPionRejection = 1.0f; + auto static constexpr MaxPtforPionRejection = 2.0f; + auto static constexpr MaxnSigmaforPionRejection = 2.0f; + template bool rejectPion(const T& candidate) { - if (candidate.pt() > static_cast(1.0) && candidate.pt() < static_cast(2.0) && !candidate.hasTOF() && candidate.tpcNSigmaPi() < static_cast(2)) { + if (candidate.pt() > MinPtforPionRejection && candidate.pt() < MaxPtforPionRejection && !candidate.hasTOF() && candidate.tpcNSigmaPi() < MaxnSigmaforPionRejection) { return false; } return true; } - template + auto static constexpr MaxNoLambda1520Daughters = 2; + + template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2) { - auto multiplicity = collision.centFT0M(); + auto centrality = centEst(collision); // Multiplicity correlation calibration plots if (cFillMultQA) { if constexpr (IsData) { - histos.fill(HIST("MultCalib/centGloPVpr"), multiplicity, dTracks1.size(), collision.multNTracksPV()); - histos.fill(HIST("MultCalib/centGloPVka"), multiplicity, dTracks2.size(), collision.multNTracksPV()); + histos.fill(HIST("MultCalib/centGloPVpr"), centrality, dTracks1.size(), collision.multNTracksPV()); + histos.fill(HIST("MultCalib/centGloPVka"), centrality, dTracks2.size(), collision.multNTracksPV()); } } if (cFilladditionalQAeventPlots) { - if constexpr (!IsMix) { - histos.fill(HIST("QAevent/hVertexZSameE"), collision.posZ()); - histos.fill(HIST("QAevent/hMultiplicityPercentSameE"), multiplicity); - histos.fill(HIST("TestME/hCollisionIndexSameE"), collision.globalIndex()); - histos.fill(HIST("TestME/hnTrksSameE"), dTracks1.size()); - } else { + if constexpr (IsData) { + histos.fill(HIST("QAevent/hnTrksSameE"), dTracks1.size()); + } else if constexpr (IsMix) { histos.fill(HIST("QAevent/hVertexZMixedE"), collision.posZ()); - histos.fill(HIST("QAevent/hMultiplicityPercentMixedE"), multiplicity); - histos.fill(HIST("TestME/hCollisionIndexMixedE"), collision.globalIndex()); - histos.fill(HIST("TestME/hnTrksMixedE"), dTracks1.size()); + histos.fill(HIST("QAevent/hMultiplicityPercentMixedE"), centrality); + histos.fill(HIST("QAevent/hnTrksMixedE"), dTracks1.size()); } } // LOG(info) << "After pass, Collision index:" << collision.index() << "multiplicity: " << collision.centFT0M() << endl; - LorentzVectorPtEtaPhiMass lDecayDaughter1, lDecayDaughter2, lResonance, ldaughterRot, lresonanceRot; + LorentzVectorPtEtaPhiMass lDecayDaughter1, lDecayDaughter2, lResonance, ldaughterRot, lResonanceRot; for (const auto& [trk1, trk2] : combinations(CombinationsFullIndexPolicy(dTracks1, dTracks2))) { // Full index policy is needed to consider all possible combinations if (trk1.index() == trk2.index()) continue; // We need to run (0,1), (1,0) pairs as well. but same id pairs are not needed. - if (cFilladditionalQAeventPlots) { - if constexpr (IsData) { - histos.fill(HIST("TestME/hPairsCounterSameE"), 1.0); - } else if (IsMix) { - histos.fill(HIST("TestME/hPairsCounterMixedE"), 1.0); - } - } - // apply the track cut if (!trackCut(trk1) || !trackCut(trk2)) continue; //// Initialize variables - // Trk1: Proton, Trk2: Kaon + // Trk1: Proton auto isTrk1hasTOF = trk1.hasTOF(); - auto isTrk2hasTOF = trk2.hasTOF(); - auto trk1ptPr = trk1.pt(); + auto trk1etaPr = trk1.eta(); + auto trk1phiPr = trk1.phi(); auto trk1NSigmaPrTPC = trk1.tpcNSigmaPr(); - auto trk1NSigmaPrTOF = (isTrk1hasTOF) ? trk1.tofNSigmaPr() : -999.; + auto trk1NSigmaPrTOF = (isTrk1hasTOF) ? trk1.tofNSigmaPr() : -999.0f; + + // Trk2: Kaon + auto isTrk2hasTOF = trk2.hasTOF(); auto trk2ptKa = trk2.pt(); + auto trk2etaKa = trk2.eta(); + auto trk2phiKa = trk2.phi(); auto trk2NSigmaKaTPC = trk2.tpcNSigmaKa(); - auto trk2NSigmaKaTOF = (isTrk2hasTOF) ? trk2.tofNSigmaKa() : -999.; + auto trk2NSigmaKaTOF = (isTrk2hasTOF) ? trk2.tofNSigmaKa() : -999.0f; - auto deltaEta = std::abs(trk1.eta() - trk2.eta()); - auto deltaPhi = std::abs(trk1.phi() - trk2.phi()); - deltaPhi = (deltaPhi > constants::math::PI) ? (constants::math::TwoPI - deltaPhi) : deltaPhi; + auto deltaEta = 0.0f; + auto deltaPhi = 0.0f; + + if (cfgUseDeltaEtaPhiCuts) { + deltaEta = std::abs(trk1etaPr - trk2etaKa); + deltaPhi = std::abs(trk1phiPr - trk2phiKa); + deltaPhi = (deltaPhi > o2::constants::math::PI) ? (o2::constants::math::TwoPI - deltaPhi) : deltaPhi; + if (deltaEta >= cMaxDeltaEtaCut) + continue; + if (deltaPhi >= cMaxDeltaPhiCut) + continue; + } //// QA plots before the selection // --- Track QA all if constexpr (IsData) { - histos.fill(HIST("QA/QAbefore/Track/TPC_Nsigma_pr_all"), multiplicity, trk1ptPr, trk1NSigmaPrTPC); + histos.fill(HIST("QA/QAbefore/Track/TPC_Nsigma_pr_all"), centrality, trk1ptPr, trk1NSigmaPrTPC); if (isTrk1hasTOF) { - histos.fill(HIST("QA/QAbefore/Track/TOF_Nsigma_pr_all"), multiplicity, trk1ptPr, trk1NSigmaPrTOF); + histos.fill(HIST("QA/QAbefore/Track/TOF_Nsigma_pr_all"), centrality, trk1ptPr, trk1NSigmaPrTOF); histos.fill(HIST("QA/QAbefore/Track/TOF_TPC_Map_pr_all"), trk1NSigmaPrTOF, trk1NSigmaPrTPC); } if (!isTrk1hasTOF) { histos.fill(HIST("QA/QAbefore/Track/TPConly_Nsigma_pr"), trk1ptPr, trk1NSigmaPrTPC); } - histos.fill(HIST("QA/QAbefore/Track/TPC_Nsigma_ka_all"), multiplicity, trk2ptKa, trk2NSigmaKaTPC); + histos.fill(HIST("QA/QAbefore/Track/TPC_Nsigma_ka_all"), centrality, trk2ptKa, trk2NSigmaKaTPC); if (isTrk2hasTOF) { - histos.fill(HIST("QA/QAbefore/Track/TOF_Nsigma_ka_all"), multiplicity, trk2ptKa, trk2NSigmaKaTOF); + histos.fill(HIST("QA/QAbefore/Track/TOF_Nsigma_ka_all"), centrality, trk2ptKa, trk2NSigmaKaTOF); histos.fill(HIST("QA/QAbefore/Track/TOF_TPC_Map_ka_all"), trk2NSigmaKaTOF, trk2NSigmaKaTPC); } if (!isTrk2hasTOF) { @@ -735,7 +755,7 @@ struct Lstaranalysis { histos.fill(HIST("QA/QAbefore/Track/dcaXY"), trk1ptPr, trk1.dcaXY()); histos.fill(HIST("QA/QAbefore/Track/TPC_CR"), trk1ptPr, trk1.tpcNClsCrossedRows()); histos.fill(HIST("QA/QAbefore/Track/pT"), trk1ptPr); - histos.fill(HIST("QA/QAbefore/Track/eta"), trk1.eta()); + histos.fill(HIST("QA/QAbefore/Track/eta"), trk1etaPr); if (cFilldeltaEtaPhiPlots) { histos.fill(HIST("QAbefore/deltaEta"), deltaEta); histos.fill(HIST("QAbefore/deltaPhi"), deltaPhi); @@ -743,18 +763,18 @@ struct Lstaranalysis { } //// Apply the pid selection - if (crejectPion && rejectPion(trk2)) + if (crejectPion && rejectPion(trk2)) // to remove pion contamination from the kaon track continue; - if (!pTdependentPIDProton(trk1) || !pTdependentPIDKaon(trk2)) + if (!ptDependentPidProton(trk1) || !ptDependentPidKaon(trk2)) continue; //// QA plots after the selection if constexpr (IsData) { // --- PID QA Proton - histos.fill(HIST("QA/QAafter/Proton/TPC_Nsigma_pr_all"), multiplicity, trk1ptPr, trk1NSigmaPrTPC); + histos.fill(HIST("QA/QAafter/Proton/TPC_Nsigma_pr_all"), centrality, trk1ptPr, trk1NSigmaPrTPC); histos.fill(HIST("QA/QAafter/Proton/TPC_Signal_pr_all"), trk1.tpcInnerParam(), trk1.tpcSignal()); if (isTrk1hasTOF) { - histos.fill(HIST("QA/QAafter/Proton/TOF_Nsigma_pr_all"), multiplicity, trk1ptPr, trk1NSigmaPrTOF); + histos.fill(HIST("QA/QAafter/Proton/TOF_Nsigma_pr_all"), centrality, trk1ptPr, trk1NSigmaPrTOF); histos.fill(HIST("QA/QAafter/Proton/TOF_TPC_Map_pr_all"), trk1NSigmaPrTOF, trk1NSigmaPrTPC); } if (!isTrk1hasTOF) { @@ -764,14 +784,14 @@ struct Lstaranalysis { histos.fill(HIST("QA/QAafter/Proton/dcaXY"), trk1ptPr, trk1.dcaXY()); histos.fill(HIST("QA/QAafter/Proton/TPC_CR"), trk1ptPr, trk1.tpcNClsCrossedRows()); histos.fill(HIST("QA/QAafter/Proton/pT"), trk1ptPr); - histos.fill(HIST("QA/QAafter/Proton/eta"), trk1.eta()); - histos.fill(HIST("QA/QAafter/Proton/TPCnclusterPhipr"), trk1.tpcNClsFound(), trk1.phi()); + histos.fill(HIST("QA/QAafter/Proton/eta"), trk1etaPr); + histos.fill(HIST("QA/QAafter/Proton/TPCnclusterPhipr"), trk1.tpcNClsFound(), trk1phiPr); // --- PID QA Kaon - histos.fill(HIST("QA/QAafter/Kaon/TPC_Nsigma_ka_all"), multiplicity, trk2ptKa, trk2NSigmaKaTPC); + histos.fill(HIST("QA/QAafter/Kaon/TPC_Nsigma_ka_all"), centrality, trk2ptKa, trk2NSigmaKaTPC); histos.fill(HIST("QA/QAafter/Kaon/TPC_Signal_ka_all"), trk2.tpcInnerParam(), trk2.tpcSignal()); if (isTrk2hasTOF) { - histos.fill(HIST("QA/QAafter/Kaon/TOF_Nsigma_ka_all"), multiplicity, trk2ptKa, trk2NSigmaKaTOF); + histos.fill(HIST("QA/QAafter/Kaon/TOF_Nsigma_ka_all"), centrality, trk2ptKa, trk2NSigmaKaTOF); histos.fill(HIST("QA/QAafter/Kaon/TOF_TPC_Map_ka_all"), trk2NSigmaKaTOF, trk2NSigmaKaTPC); } if (!isTrk2hasTOF) { @@ -781,98 +801,124 @@ struct Lstaranalysis { histos.fill(HIST("QA/QAafter/Kaon/dcaXY"), trk2ptKa, trk2.dcaXY()); histos.fill(HIST("QA/QAafter/Kaon/TPC_CR"), trk2ptKa, trk2.tpcNClsCrossedRows()); histos.fill(HIST("QA/QAafter/Kaon/pT"), trk2ptKa); - histos.fill(HIST("QA/QAafter/Kaon/eta"), trk2.eta()); - histos.fill(HIST("QA/QAafter/Kaon/TPCnclusterPhika"), trk2.tpcNClsFound(), trk2.phi()); + histos.fill(HIST("QA/QAafter/Kaon/eta"), trk2etaKa); + histos.fill(HIST("QA/QAafter/Kaon/TPCnclusterPhika"), trk2.tpcNClsFound(), trk2phiKa); if (cFilldeltaEtaPhiPlots) { + histos.fill(HIST("QAafter/PhiPrafter"), trk1phiPr); + histos.fill(HIST("QAafter/PhiKaafter"), trk2phiKa); histos.fill(HIST("QAafter/deltaEta"), deltaEta); histos.fill(HIST("QAafter/deltaPhi"), deltaPhi); } } + //// Resonance reconstruction + lDecayDaughter1 = LorentzVectorPtEtaPhiMass(trk1ptPr, trk1etaPr, trk1phiPr, massPr); + lDecayDaughter2 = LorentzVectorPtEtaPhiMass(trk2ptKa, trk2etaKa, trk2phiKa, massKa); + // Apply kinematic opening angle cut - if (cApplyOpeningAngle) { - TVector3 v1(trk1.px(), trk1.py(), trk1.pz()); - TVector3 v2(trk2.px(), trk2.py(), trk2.pz()); - float alpha = v1.Angle(v2); + if (cUseOpeningAngleCut) { + auto v1 = lDecayDaughter1.Vect(); + auto v2 = lDecayDaughter2.Vect(); + float alpha = std::acos(v1.Dot(v2) / (v1.R() * v2.R())); if (alpha > cMinOpeningAngle && alpha < cMaxOpeningAngle) continue; } - //// Resonance reconstruction - lDecayDaughter1 = LorentzVectorPtEtaPhiMass(trk1.pt(), trk1.eta(), trk1.phi(), massPr); - lDecayDaughter2 = LorentzVectorPtEtaPhiMass(trk2.pt(), trk2.eta(), trk2.phi(), massKa); lResonance = lDecayDaughter1 + lDecayDaughter2; + auto resonanceMass = lResonance.M(); + auto resonancePt = lResonance.Pt(); + auto resonanceRapidity = lResonance.Rapidity(); + if constexpr (IsData || IsMix) { // Rapidity cut - if (std::abs(lResonance.Rapidity()) > static_cast(0.5)) + if (std::abs(resonanceRapidity) > configTracks.cfgCutRapidity) continue; } - if (cfgCutsOnMother) { - if (lResonance.Pt() >= cMaxPtMotherCut) // excluding candidates in overflow + if (cfgUseCutsOnMother) { + if (resonancePt >= cMaxPtMotherCut) // excluding candidates in overflow continue; - if (lResonance.M() >= cMaxMinvMotherCut) // excluding candidates in overflow + if (resonanceMass >= cMaxMinvMotherCut) // excluding candidates in overflow continue; } - if (cFilldeltaEtaPhiPlots) { - if (deltaEta >= cMaxDeltaEtaCut) - continue; - if (deltaPhi >= cMaxDeltaPhiCut) - continue; - - if constexpr (!IsMix) { - histos.fill(HIST("QAafter/EtaPrafter"), trk1.eta()); - histos.fill(HIST("QAafter/PhiPrafter"), trk1.phi()); - histos.fill(HIST("QAafter/EtaKaafter"), trk2.eta()); - histos.fill(HIST("QAafter/PhiKaafter"), trk2.phi()); - histos.fill(HIST("QAafter/deltaEtaafter"), deltaEta); - histos.fill(HIST("QAafter/deltaPhiafter"), deltaPhi); + if (cFilladditionalQAeventPlots) { + if constexpr (IsData) { + histos.fill(HIST("QAevent/hPairsCounterSameE"), 1.0f); + } else if (IsMix) { + histos.fill(HIST("QAevent/hPairsCounterMixedE"), 1.0f); } } //// Un-like sign pair only if (trk1.sign() * trk2.sign() < 0) { - if constexpr (IsData) { - if (isCalcRotBkg) { - for (int i = 0; i < cNofRotations; i++) { - float theta2 = rn->Uniform(constants::math::PI - constants::math::PI / rotationalcut, constants::math::PI + constants::math::PI / rotationalcut); - ldaughterRot = LorentzVectorPtEtaPhiMass(trk2.pt(), trk2.eta(), trk2.phi() + theta2, massKa); // for rotated background - lresonanceRot = lDecayDaughter1 + ldaughterRot; - histos.fill(HIST("Result/Data/h3lambda1520InvMassRotation"), multiplicity, lresonanceRot.Pt(), lresonanceRot.M()); + if constexpr (IsRot) { + for (int i = 0; i < configBkg.cNofRotations; i++) { + float theta = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / configBkg.rotationalcut, o2::constants::math::PI + o2::constants::math::PI / configBkg.rotationalcut); + if (configBkg.cfgRotPr) { + ldaughterRot = LorentzVectorPtEtaPhiMass(trk1ptPr, trk1etaPr, trk1phiPr + theta, massPr); + lResonanceRot = ldaughterRot + lDecayDaughter2; + } else { + ldaughterRot = LorentzVectorPtEtaPhiMass(trk2ptKa, trk2etaKa, trk2phiKa + theta, massKa); + lResonanceRot = lDecayDaughter1 + ldaughterRot; + } + auto resonanceRotMass = lResonanceRot.M(); + auto resonanceRotPt = lResonanceRot.Pt(); + + // Rapidity cut + if (std::abs(lResonanceRot.Rapidity()) >= configTracks.cfgCutRapidity) + continue; + + if (cfgUseCutsOnMother) { + if (resonanceRotPt >= cMaxPtMotherCut) // excluding candidates in overflow + continue; + if (resonanceRotMass >= cMaxMinvMotherCut) // excluding candidates in overflow + continue; + } + if (trk1.sign() < 0) { + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/lambda1520InvMassRotation"), resonanceRotMass); + } + histos.fill(HIST("Result/Data/h3lambda1520InvMassRotation"), centrality, resonanceRotPt, resonanceRotMass); + } else if (trk1.sign() > 0) { + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/antilambda1520InvMassRotation"), resonanceRotMass); + } + histos.fill(HIST("Result/Data/h3antilambda1520InvMassRotation"), centrality, resonanceRotPt, resonanceRotMass); } } - + } + if constexpr (IsData) { if (trk1.sign() < 0) { - if (cFillinvmass1DPlots) { - histos.fill(HIST("Result/Data/lambda1520invmass"), lResonance.M()); + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/lambda1520invmass"), resonanceMass); } - histos.fill(HIST("Result/Data/h3lambda1520invmass"), multiplicity, lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmass"), centrality, resonancePt, resonanceMass); } else if (trk1.sign() > 0) { - if (cFillinvmass1DPlots) { - histos.fill(HIST("Result/Data/antilambda1520invmass"), lResonance.M()); + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/antilambda1520invmass"), resonanceMass); } - histos.fill(HIST("Result/Data/h3antilambda1520invmass"), multiplicity, lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3antilambda1520invmass"), centrality, resonancePt, resonanceMass); } } else if (IsMix) { - if (cFillinvmass1DPlots) { - histos.fill(HIST("Result/Data/lambda1520invmassME"), lResonance.M()); - } - histos.fill(HIST("Result/Data/h3lambda1520invmassME"), multiplicity, lResonance.Pt(), lResonance.M()); - if (cFilladditionalMEPlots) { - if (trk1.sign() < 0) { - histos.fill(HIST("Result/Data/h3lambda1520invmassME_DS"), multiplicity, lResonance.Pt(), lResonance.M()); - } else if (trk1.sign() > 0) { - histos.fill(HIST("Result/Data/h3lambda1520invmassME_DSAnti"), multiplicity, lResonance.Pt(), lResonance.M()); + if (trk1.sign() < 0) { + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/lambda1520invmassME_UnlikeSign"), resonanceMass); } + histos.fill(HIST("Result/Data/h3lambda1520invmassME_UnlikeSign"), centrality, resonancePt, resonanceMass); + } else if (trk1.sign() > 0) { + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/antilambda1520invmassME_UnlikeSign"), resonanceMass); + } + histos.fill(HIST("Result/Data/h3antilambda1520invmassME_UnlikeSign"), centrality, resonancePt, resonanceMass); } } // MC if constexpr (IsMC) { - + // now we do mc true // ------ Temporal lambda function to prevent error in build auto getMothersIndeces = [&](auto const& theMcParticle) { std::vector lMothersIndeces{}; @@ -904,7 +950,7 @@ struct Lstaranalysis { motherstrk1 = getMothersIndeces(mctrk1); mothersPDGtrk1 = getMothersPDGCodes(mctrk1); } - while (motherstrk1.size() > 2) { + while (motherstrk1.size() > MaxNoLambda1520Daughters) { motherstrk1.pop_back(); mothersPDGtrk1.pop_back(); } @@ -914,18 +960,18 @@ struct Lstaranalysis { motherstrk2 = getMothersIndeces(mctrk2); mothersPDGtrk2 = getMothersPDGCodes(mctrk2); } - while (motherstrk2.size() > 2) { + while (motherstrk2.size() > MaxNoLambda1520Daughters) { motherstrk2.pop_back(); mothersPDGtrk2.pop_back(); } - if (std::abs(mctrk1.pdgCode()) != 2212 || std::abs(mctrk2.pdgCode()) != 321) + if (std::abs(mctrk1.pdgCode()) != kProton || std::abs(mctrk2.pdgCode()) != kKPlus) continue; if (motherstrk1[0] != motherstrk2[0]) // Same mother continue; - if (std::abs(mothersPDGtrk1[0]) != 102134) + if (std::abs(mothersPDGtrk1[0]) != Pdg::kLambda1520_Py) continue; // LOGF(info, "mother trk1 id: %d, mother trk1: %d, trk1 id: %d, trk1 pdgcode: %d, mother trk2 id: %d, mother trk2: %d, trk2 id: %d, trk2 pdgcode: %d", motherstrk1[0], mothersPDGtrk1[0], trk1.globalIndex(), mctrk1.pdgCode(), motherstrk2[0], mothersPDGtrk2[0], trk2.globalIndex(), mctrk2.pdgCode()); @@ -933,11 +979,11 @@ struct Lstaranalysis { if (cUseEtacutMC && std::abs(lResonance.Eta()) > cEtacutMC) // eta cut continue; - if (cUseRapcutMC && std::abs(lResonance.Rapidity()) > static_cast(0.5)) // rapidity cut + if (cUseRapcutMC && std::abs(resonanceRapidity) > configTracks.cfgCutRapidity) // rapidity cut continue; - histos.fill(HIST("QA/MC/h2RecoEtaPt_after"), lResonance.Eta(), lResonance.Pt()); - histos.fill(HIST("QA/MC/h2RecoPhiRapidity_after"), lResonance.Phi(), lResonance.Rapidity()); + histos.fill(HIST("QA/MC/h2RecoEtaPt_after"), lResonance.Eta(), resonancePt); + histos.fill(HIST("QA/MC/h2RecoPhiRapidity_after"), lResonance.Phi(), resonanceRapidity); // Track selection check. histos.fill(HIST("QA/MC/trkDCAxy_pr"), trk1ptPr, trk1.dcaXY()); @@ -945,35 +991,50 @@ struct Lstaranalysis { histos.fill(HIST("QA/MC/trkDCAz_pr"), trk1ptPr, trk1.dcaZ()); histos.fill(HIST("QA/MC/trkDCAz_ka"), trk2ptKa, trk2.dcaZ()); - histos.fill(HIST("QA/MC/TPC_Nsigma_pr_all"), multiplicity, trk1ptPr, trk1NSigmaPrTPC); + histos.fill(HIST("QA/MC/TPC_Nsigma_pr_all"), centrality, trk1ptPr, trk1NSigmaPrTPC); if (isTrk1hasTOF) { - histos.fill(HIST("QA/MC/TOF_Nsigma_pr_all"), multiplicity, trk1ptPr, trk1NSigmaPrTOF); + histos.fill(HIST("QA/MC/TOF_Nsigma_pr_all"), centrality, trk1ptPr, trk1NSigmaPrTOF); } - histos.fill(HIST("QA/MC/TPC_Nsigma_ka_all"), multiplicity, trk2ptKa, trk2NSigmaKaTPC); + histos.fill(HIST("QA/MC/TPC_Nsigma_ka_all"), centrality, trk2ptKa, trk2NSigmaKaTPC); if (isTrk2hasTOF) { - histos.fill(HIST("QA/MC/TOF_Nsigma_ka_all"), multiplicity, trk2ptKa, trk2NSigmaKaTOF); + histos.fill(HIST("QA/MC/TOF_Nsigma_ka_all"), centrality, trk2ptKa, trk2NSigmaKaTOF); } // MC histograms if (mothersPDGtrk1[0] > 0) { - histos.fill(HIST("Result/MC/h3lambda1520Recoinvmass"), multiplicity, lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/MC/h3lambda1520Recoinvmass"), centrality, resonancePt, resonanceMass); } else { - histos.fill(HIST("Result/MC/h3antilambda1520Recoinvmass"), multiplicity, lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/MC/h3antilambda1520Recoinvmass"), centrality, resonancePt, resonanceMass); } } } else { if constexpr (IsData) { // Like sign pair ++ if (trk1.sign() > 0) { - if (cFillinvmass1DPlots) { - histos.fill(HIST("Result/Data/lambda1520invmassLSPP"), lResonance.M()); + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/lambda1520invmassLSPP"), resonanceMass); } - histos.fill(HIST("Result/Data/h3lambda1520invmassLSPP"), multiplicity, lResonance.Pt(), lResonance.M()); + histos.fill(HIST("Result/Data/h3lambda1520invmassLSPP"), centrality, resonancePt, resonanceMass); } else { // Like sign pair -- - if (cFillinvmass1DPlots) { - histos.fill(HIST("Result/Data/lambda1520invmassLSMM"), lResonance.M()); + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/lambda1520invmassLSMM"), resonanceMass); + } + histos.fill(HIST("Result/Data/h3lambda1520invmassLSMM"), centrality, resonancePt, resonanceMass); + } + } else if (IsMix) { + if (cFilladditionalMEPlots) { + // Like sign pair ++ + if (trk1.sign() > 0) { + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/lambda1520invmassME_LSPP"), resonanceMass); + } + histos.fill(HIST("Result/Data/h3lambda1520invmassME_LSPP"), centrality, resonancePt, resonanceMass); + } else { // Like sign pair -- + if (cFill1DQAs) { + histos.fill(HIST("Result/Data/lambda1520invmassME_LSMM"), resonanceMass); + } + histos.fill(HIST("Result/Data/h3lambda1520invmassME_LSMM"), centrality, resonancePt, resonanceMass); } - histos.fill(HIST("Result/Data/h3lambda1520invmassLSMM"), multiplicity, lResonance.Pt(), lResonance.M()); } } } @@ -988,11 +1049,18 @@ struct Lstaranalysis { colCuts.fillQA(collision); - if (cFilladditionalQAeventPlots) - histos.fill(HIST("QAevent/hEvtCounterSameE"), 1.0); - fillHistograms(collision, tracks, tracks); + fillHistograms(collision, tracks, tracks); } - PROCESS_SWITCH(Lstaranalysis, processData, "Process Event for data without partition", false); + PROCESS_SWITCH(Lambda1520analysisinpp, processData, "Process Event for data without partition", false); + + void processRotational(EventCandidates::iterator const& collision, TrackCandidates const& tracks) + { + if (!colCuts.isSelected(collision, false)) // Default event selection + return; + + fillHistograms(collision, tracks, tracks); + } + PROCESS_SWITCH(Lambda1520analysisinpp, processRotational, "Process Rotational Background", false); void processMC(MCEventCandidates::iterator const& collision, aod::McCollisions const&, @@ -1003,31 +1071,26 @@ struct Lstaranalysis { if (std::abs(collision.posZ()) > cZvertCutMC) // Z-vertex cut return; - fillHistograms(collision, tracks, tracks); + fillHistograms(collision, tracks, tracks); } - PROCESS_SWITCH(Lstaranalysis, processMC, "Process Event for MC Light without partition", false); + PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == 102134); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == static_cast(Pdg::kLambda1520_Py)); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { bool isInAfterAllCuts = colCuts.isSelected(collision); - bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > 10.) ? false : true; + bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > configEvents.cfgEvtZvtx) ? false : true; bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); bool isSel8 = collision.sel8(); bool isTrueINELgt0 = isTrueINEL0(collision, mcParticles); - centrality = centEst(collision); - - auto multiplicity = collision.centFT0M(); + auto centrality = centEst(collision); auto mcParts = selectedMCParticles->sliceBy(perMcCollision, collision.mcCollision().globalIndex()); // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != kLambda1520PDG) // Lambda1520(0) - continue; - std::vector daughterPDGs; if (part.has_daughters()) { auto daughter01 = mcParticles.rawIteratorAt(part.daughtersIds()[0] - mcParticles.offset()); @@ -1049,9 +1112,16 @@ struct Lstaranalysis { histos.fill(HIST("QA/MC/h2GenEtaPt_beforeanycut"), part.eta(), part.pt()); histos.fill(HIST("QA/MC/h2GenPhiRapidity_beforeanycut"), part.phi(), part.y()); - if (cUseRapcutMC && std::abs(part.y()) > static_cast(0.5)) // rapidity cut + if (cUseRapcutMC && std::abs(part.y()) > configTracks.cfgCutRapidity) // rapidity cut continue; + if (cfgUseDaughterEtaCutMC) { + for (auto const& daughters : part.daughters_as()) { + if (std::fabs(daughters.eta()) > configTracks.cfgCutEta) + continue; // eta cut for daughters + } // loop over daughters + } + histos.fill(HIST("QA/MC/h2GenEtaPt_afterRapcut"), part.eta(), part.pt()); histos.fill(HIST("QA/MC/h2GenPhiRapidity_afterRapcut"), part.phi(), part.y()); @@ -1063,90 +1133,91 @@ struct Lstaranalysis { // without any event selection if (part.pdgCode() > 0) - histos.fill(HIST("Result/MC/Genlambda1520pt"), 0, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genlambda1520pt"), 0, part.pt(), centrality); else - histos.fill(HIST("Result/MC/Genantilambda1520pt"), 0, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genantilambda1520pt"), 0, part.pt(), centrality); if (inVtx10) // INEL10 { if (part.pdgCode() > 0) - histos.fill(HIST("Result/MC/Genlambda1520pt"), 1, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genlambda1520pt"), 1, part.pt(), centrality); else - histos.fill(HIST("Result/MC/Genantilambda1520pt"), 1, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genantilambda1520pt"), 1, part.pt(), centrality); } if (inVtx10 && isSel8) // INEL>10, vtx10 { if (part.pdgCode() > 0) - histos.fill(HIST("Result/MC/Genlambda1520pt"), 2, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genlambda1520pt"), 2, part.pt(), centrality); else - histos.fill(HIST("Result/MC/Genantilambda1520pt"), 2, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genantilambda1520pt"), 2, part.pt(), centrality); } if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX { if (part.pdgCode() > 0) - histos.fill(HIST("Result/MC/Genlambda1520pt"), 3, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genlambda1520pt"), 3, part.pt(), centrality); else - histos.fill(HIST("Result/MC/Genantilambda1520pt"), 3, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genantilambda1520pt"), 3, part.pt(), centrality); } if (isInAfterAllCuts) // after all event selection { if (part.pdgCode() > 0) - histos.fill(HIST("Result/MC/Genlambda1520pt"), 4, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genlambda1520pt"), 4, part.pt(), centrality); else - histos.fill(HIST("Result/MC/Genantilambda1520pt"), 4, part.pt(), multiplicity); + histos.fill(HIST("Result/MC/Genantilambda1520pt"), 4, part.pt(), centrality); } } // QA for Trigger efficiency - histos.fill(HIST("Event/hMCEventIndices"), centrality, kINEL); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inel); if (inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kINEL10); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inel10); if (isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kINELg0); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inelg0); if (inVtx10 && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kINELg010); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inelg010); // TVX MB trigger if (isTriggerTVX) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrig); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Trig); if (isTriggerTVX && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrig10); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Trig10); if (isTriggerTVX && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrigINELg0); + histos.fill(HIST("Event/hMCEventIndices"), centrality, TrigINELg0); if (isTriggerTVX && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kTrigINELg010); + histos.fill(HIST("Event/hMCEventIndices"), centrality, TrigINELg010); // Sel8 event selection if (isSel8) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8); if (isSel8 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel810); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel810); if (isSel8 && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8INELg0); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8INELg0); if (isSel8 && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kSel8INELg010); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8INELg010); // CollisionCuts selection if (isInAfterAllCuts) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCuts); + histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCuts); if (isInAfterAllCuts && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCuts10); + histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCuts10); if (isInAfterAllCuts && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCutsINELg0); + histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCutsINELg0); if (isInAfterAllCuts && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCutsINELg010); + histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCutsINELg010); } - PROCESS_SWITCH(Lstaranalysis, processMCTrue, "Process Event for MC only", false); + PROCESS_SWITCH(Lambda1520analysisinpp, processMCTrue, "Process Event for MC only", false); // Processing Event Mixing using BinningTypeVtxZT0M = ColumnBinningPolicy; - BinningTypeVtxZT0M colBinning{{cfgVtxBins, cfgMultBins}, true}; void processME(EventCandidates const& collision, TrackCandidates const& tracks) { auto tracksTuple = std::make_tuple(tracks); - SameKindPair pairs{colBinning, nEvtMixing, -1, collision, tracksTuple, &cache}; // -1 is the number of the bin to skip + + BinningTypeVtxZT0M colBinning{{configBkg.cfgVtxBins, configBkg.cfgMultBins}, true}; + SameKindPair pairs{colBinning, configBkg.nEvtMixing, -1, collision, tracksTuple, &cache}; // -1 is the number of the bin to skip for (const auto& [collision1, tracks1, collision2, tracks2] : pairs) { // LOGF(info, "Mixed event collisions: (%d, %d)", collision1.globalIndex(), collision2.globalIndex()); @@ -1158,24 +1229,24 @@ struct Lstaranalysis { if (cFilladditionalQAeventPlots) { // Fill histograms for the characteristics of the *mixed* events (collision1 and collision2) // This will show the distribution of events that are actually being mixed. - histos.fill(HIST("QAevent/hMixPool_VtxZ"), collision1.posZ()); - histos.fill(HIST("QAevent/hMixPool_Multiplicity"), collision1.centFT0M()); // Assuming getCentrality() gives multiplicity + if (cFill1DQAs) { + histos.fill(HIST("QAevent/hMixPool_VtxZ"), collision1.posZ()); + histos.fill(HIST("QAevent/hMixPool_Multiplicity"), collision1.centFT0M()); + } histos.fill(HIST("QAevent/hMixPool_VtxZ_vs_Multiplicity"), collision1.posZ(), collision1.centFT0M()); // You might also want to fill for collision2 if you want to see both partners' distributions // histos.fill(HIST("QAevent/hMixPool_VtxZ"), collision2.posZ()); - // histos.fill(HIST("QAevent/hMixPool_Multiplicity"), collision2.getCentrality()); - // histos.fill(HIST("QAevent/hMixPool_VtxZ_vs_Multiplicity"), collision2.posZ(), collision2.getCentrality()); - - histos.fill(HIST("QAevent/hEvtCounterMixedE"), 1.f); + // histos.fill(HIST("QAevent/hMixPool_Multiplicity"), collision2.centFT0M()); + // histos.fill(HIST("QAevent/hMixPool_VtxZ_vs_Multiplicity"), collision2.posZ(), collision2.centFT0M()); } - fillHistograms(collision1, tracks1, tracks2); + fillHistograms(collision1, tracks1, tracks2); } } - PROCESS_SWITCH(Lstaranalysis, processME, "Process EventMixing light without partition", false); + PROCESS_SWITCH(Lambda1520analysisinpp, processME, "Process EventMixing light without partition", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/Utils/collisionCuts.h b/PWGLF/Utils/collisionCuts.h index 399454e9368..b1a80cfe075 100644 --- a/PWGLF/Utils/collisionCuts.h +++ b/PWGLF/Utils/collisionCuts.h @@ -16,15 +16,17 @@ /// original author: Laura Serksnyte, TU München /// /// \author Bong-Hwi Lim +/// \author Hirak Kumar Koley #ifndef PWGLF_UTILS_COLLISIONCUTS_H_ #define PWGLF_UTILS_COLLISIONCUTS_H_ -#include +#include "Common/DataModel/EventSelection.h" #include "Framework/HistogramRegistry.h" #include "Framework/Logger.h" -#include "Common/DataModel/EventSelection.h" + +#include namespace o2::analysis { @@ -185,13 +187,15 @@ class CollisonCuts /// \param col Collision /// \return whether or not the collisions fulfills the specified selections template - bool isSelected(T const& col) + bool isSelected(T const& col, const bool QA = true) { - mHistogramRegistry->fill(HIST("Event/posZ_noCut"), col.posZ()); - if (mCheckIsRun3) { - mHistogramRegistry->fill(HIST("Event/trackOccupancyInTimeRange_noCut"), col.trackOccupancyInTimeRange()); + if (QA) { + mHistogramRegistry->fill(HIST("Event/posZ_noCut"), col.posZ()); + if (mCheckIsRun3) { + mHistogramRegistry->fill(HIST("Event/trackOccupancyInTimeRange_noCut"), col.trackOccupancyInTimeRange()); + } + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllEvent); } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllEvent); if (std::abs(col.posZ()) > mZvtxMax) { LOGF(debug, "Vertex out of range"); return false; @@ -204,48 +208,66 @@ class CollisonCuts } mInitialColBitScan = false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagZvertex); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagZvertex); + } if (mCheckIsRun3) { // Run3 case if (!col.selection_bit(aod::evsel::kIsTriggerTVX) && mTriggerTVXselection) { LOGF(debug, "Offline selection TVX failed (Run3)"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTrigerTVX); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTrigerTVX); + } if (!col.selection_bit(aod::evsel::kNoTimeFrameBorder) && mApplyTFBorderCut) { LOGF(debug, "Time frame border cut failed"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTimeFrameBorder); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagTimeFrameBorder); + } if (!col.selection_bit(aod::evsel::kNoITSROFrameBorder) && mApplyNoITSROBorderCut) { LOGF(debug, "NoITSRO frame border cut failed"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagITSROFrameBorder); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagITSROFrameBorder); + } if (!col.sel8() && mCheckOffline) { LOGF(debug, "Offline selection failed (Run3)"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagSel8); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagSel8); + } if (!col.selection_bit(o2::aod::evsel::kIsVertexITSTPC) && mApplyITSTPCvertex) { LOGF(debug, "ITS-TPC matching cut failed"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagVertexITSTPC); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagVertexITSTPC); + } if (!col.selection_bit(o2::aod::evsel::kNoSameBunchPileup) && mApplyPileupRejection) { LOGF(debug, "Pileup rejection failed"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagBunchPileup); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagBunchPileup); + } if (!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow) && mApplyCollInTimeRangeNarrow) { LOGF(debug, "NoCollInTimeRangeNarrow selection failed"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kNoCollInTimeRangeNarrow); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kNoCollInTimeRangeNarrow); + } if (!col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV) && mApplyZvertexTimedifference) { LOGF(debug, "Z-vertex time difference cut failed"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagZvtxFT0vsPV); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagZvtxFT0vsPV); + } if (mtrackOccupancyInTimeRangeMax > 0 && col.trackOccupancyInTimeRange() > mtrackOccupancyInTimeRangeMax) { LOGF(debug, "trackOccupancyInTimeRange selection failed"); return false; @@ -254,12 +276,16 @@ class CollisonCuts LOGF(debug, "trackOccupancyInTimeRange selection failed"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagOccupancy); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kFlagOccupancy); + } if ((!col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) && mApplyCollInTimeRangeStandard) { LOGF(debug, "NoCollInTimeRangeStandard selection failed"); return false; } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kNoCollInTimeRangeStandard); + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kNoCollInTimeRangeStandard); + } } else { // Run2 case if (mCheckOffline && !col.sel7()) { LOGF(debug, "Offline selection failed (sel7)"); @@ -275,9 +301,13 @@ class CollisonCuts LOGF(debug, "INELgtZERO selection failed"); return false; } + if (QA) { + mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllpassed); + } + } + if (QA) { mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllpassed); } - mHistogramRegistry->fill(HIST("CollCutCounts"), EvtSel::kAllpassed); return true; }