From 6c59df43e885fb536638ab981d0cfeb8773c07ba Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Mon, 21 Jul 2025 04:08:46 +0530 Subject: [PATCH 01/29] [PWGLF] Added new process function for rotational method 1. Added new process function for rotational method 2. Improved efficiency of the analysis task --- .../Resonances/lambda1520analysisinpp.cxx | 700 ++++++++++-------- 1 file changed, 380 insertions(+), 320 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index d280d3c1da3..6207ebef55a 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -79,82 +79,89 @@ 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.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"}; + } 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.8, "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"}; + } 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.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"}; + } configPID; + + struct : ConfigurableGroup { + /// 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 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.4, "Minimum opening angle between daughters"}; + Configurable cMaxOpeningAngle{"cMaxOpeningAngle", 2.4, "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"}; @@ -163,7 +170,7 @@ struct Lstaranalysis { Configurable cUseEtacutMC{"cUseEtacutMC", true, "MC eta cut"}; // cuts on mother - Configurable cfgCutsOnMother{"cfgCutsOnMother", false, "Enable additional cuts on mother"}; + Configurable cfgUseCutsOnMother{"cfgUseCutsOnMother", 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"}; @@ -174,23 +181,28 @@ struct Lstaranalysis { 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 collisionFilter_MC = 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.f || ((aod::track::tofExpMom > 0.f) && (/* (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 == 0) || + ((configTracks.trackSelection == 1) && requireGlobalTrackInFilter()) || + ((configTracks.trackSelection == 2) && requireGlobalTrackWoPtEtaInFilter()) || + ((configTracks.trackSelection == 3) && requireGlobalTrackWoDCAInFilter()) || + ((configTracks.trackSelection == 4) && requireQualityTracksInFilter()) || + ((configTracks.trackSelection == 5) && 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>; @@ -211,22 +223,18 @@ struct Lstaranalysis { ConfigurableAxis binsnTPCSignal{"binsnTPCSignal", {1000, 0, 1000}, ""}; ConfigurableAxis binsEtaPhi{"binsEtaPhi", {350, -3.5, 3.5}, ""}; - float centrality; - 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 @@ -244,19 +252,15 @@ struct Lstaranalysis { AxisSpec axisMClabel{6, -1.5, 5.5, "MC Label"}; AxisSpec axisEtaPhi{binsEtaPhi, ""}; AxisSpec axisPhi{350, 0, 7, "#Phi"}; - AxisSpec axisMultMix{cfgMultBins, "Multiplicity"}; - AxisSpec axisVtxMix{cfgVtxBins, "Vertex Z (cm)"}; + AxisSpec axisMultMix{configBkg.cfgMultBins, "Multiplicity"}; + AxisSpec axisVtxMix{configBkg.cfgVtxBins, "Vertex Z (cm)"}; AxisSpec idxMCAxis = {26, -0.5, 25.5, "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.0f, 1000.0f}}); } // Test on Mixed event if (doprocessME) { @@ -266,12 +270,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/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., 15.}}); 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}}); } } @@ -326,7 +328,7 @@ struct Lstaranalysis { histos.add("QA/QAafter/Proton/TPCnclusterPhipr", "TPC ncluster vs phi", kTHnSparseF, {{160, 0, 160, "TPC nCluster"}, {63, 0, 6.28, "#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 +342,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 } } @@ -407,38 +417,28 @@ struct Lstaranalysis { float massKa = MassKaonCharged; float massPr = MassProton; + double pi = o2::constants::math::PI; + double twopi = o2::constants::math::TwoPI; 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) { + 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; @@ -466,34 +466,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 (configTracks.cDCAr7SigCut) { if (std::abs(track.dcaXY()) > (0.004f + 0.0130f / (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; @@ -505,30 +505,32 @@ struct Lstaranalysis { template 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 = static_cast>(configPID.protonTPCPIDpTintv); + vProtonTPCPIDpTintv.insert(vProtonTPCPIDpTintv.begin(), configTracks.cMinPtcut); + auto vProtonTPCPIDcuts = static_cast>(configPID.protonTPCPIDcuts); + auto vProtonTOFPIDpTintv = static_cast>(configPID.protonTOFPIDpTintv); + auto vProtonTPCTOFCombinedpTintv = static_cast>(configPID.protonTPCTOFCombinedpTintv); + auto vProtonTPCTOFCombinedPIDcuts = static_cast>(configPID.protonTPCTOFCombinedPIDcuts); + auto vProtonTOFPIDcuts = static_cast>(configPID.protonTOFPIDcuts); 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 +545,22 @@ struct Lstaranalysis { // Case 3: Has TOF → use TPC + TOF (square or circular) if (candidate.hasTOF()) { - if (cPIDcutType == 1) { + if (configPID.cPIDcutType == 1) { // 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 == 2) { // 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; } @@ -572,23 +574,25 @@ struct Lstaranalysis { template 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 = static_cast>(configPID.kaonTPCPIDpTintv); + vKaonTPCPIDpTintv.insert(vKaonTPCPIDpTintv.begin(), configTracks.cMinPtcut); + auto vKaonTPCPIDcuts = static_cast>(configPID.kaonTPCPIDcuts); + auto vKaonTOFPIDpTintv = static_cast>(configPID.kaonTOFPIDpTintv); + auto vKaonTPCTOFCombinedpTintv = static_cast>(configPID.kaonTPCTOFCombinedpTintv); + auto vKaonTPCTOFCombinedPIDcuts = static_cast>(configPID.kaonTPCTOFCombinedPIDcuts); + auto vKaonTOFPIDcuts = static_cast>(configPID.kaonTOFPIDcuts); 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 +600,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 +616,22 @@ struct Lstaranalysis { // Case 3: TOF is available → apply TPC+TOF PID logic if (candidate.hasTOF()) { - if (cPIDcutType == 1) { + if (configPID.cPIDcutType == 1) { // 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 == 2) { // 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; } @@ -648,83 +652,85 @@ struct Lstaranalysis { return true; } - template + 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.; + + // 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 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; + auto deltaPhi = 0; + + if (cfgUseDeltaEtaPhiCuts) { + deltaEta = std::abs(trk1etaPr - trk2etaKa); + deltaPhi = std::abs(trk1phiPr - trk2phiKa); + deltaPhi = (deltaPhi > pi) ? (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 +741,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,7 +749,7 @@ 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)) @@ -751,10 +757,10 @@ struct Lstaranalysis { //// 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 +770,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 +787,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) > static_cast(0.5)) 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.0); + } else if (IsMix) { + histos.fill(HIST("QAevent/hPairsCounterMixedE"), 1.0); } } //// 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(pi - pi / configBkg.rotationalcut, pi + 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()) >= 0.5) + 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{}; @@ -933,11 +965,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) > static_cast(0.5)) // 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 +977,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,12 +1035,19 @@ 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); + void processRotational(EventCandidates::iterator const& collision, TrackCandidates const& tracks) + { + if (!colCuts.isSelected(collision, false)) // Default event selection + return; + + fillHistograms(collision, tracks, tracks); + } + PROCESS_SWITCH(Lstaranalysis, processRotational, "Process Rotational Background", false); + void processMC(MCEventCandidates::iterator const& collision, aod::McCollisions const&, MCTrackCandidates const& tracks, aod::McParticles const&) @@ -1003,7 +1057,7 @@ 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); @@ -1016,9 +1070,7 @@ struct Lstaranalysis { 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()); @@ -1052,6 +1104,13 @@ struct Lstaranalysis { if (cUseRapcutMC && std::abs(part.y()) > static_cast(0.5)) // rapidity cut continue; + if (cfgUseDaughterEtaCutMC) { + for (auto& 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,37 +1122,37 @@ 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); } } @@ -1140,13 +1199,14 @@ struct Lstaranalysis { // 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,18 +1218,18 @@ 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); From ad96fd280bc96501bf5f0f4fae26ede4d19d42d2 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Mon, 21 Jul 2025 04:09:52 +0530 Subject: [PATCH 02/29] [PWGLF] Added a switch for QA plots --- PWGLF/Utils/collisionCuts.h | 68 ++++++++++++++++++++++++++----------- 1 file changed, 49 insertions(+), 19 deletions(-) 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; } From 39bc8ffff5748919df9abff0a0a32e22d4a0b5ae Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 10:53:11 +0530 Subject: [PATCH 03/29] fix cpplint --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 6207ebef55a..9e3c530a90f 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -37,6 +37,7 @@ #include "TPDGCode.h" #include "TRandom.h" #include "TVector3.h" +#include using namespace o2; using namespace o2::soa; From 322e9eb9bd4a08706a8180f4700598bfe469e342 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 11:16:51 +0530 Subject: [PATCH 04/29] fix cpplint error --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 9e3c530a90f..1ffb5c4d7f7 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -19,6 +19,7 @@ // 3. C++ system headers #include +#include // 4. Other includes: O2 framework, ROOT, etc. #include "PWGLF/Utils/collisionCuts.h" @@ -37,7 +38,6 @@ #include "TPDGCode.h" #include "TRandom.h" #include "TVector3.h" -#include using namespace o2; using namespace o2::soa; From 0e28f8b34800392da294b20cde31e01c044a0a28 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 12:02:40 +0530 Subject: [PATCH 05/29] fix linter errors --- .../Resonances/lambda1520analysisinpp.cxx | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 1ffb5c4d7f7..1df791d7122 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -37,7 +37,6 @@ #include "Math/Vector4D.h" #include "TPDGCode.h" #include "TRandom.h" -#include "TVector3.h" using namespace o2; using namespace o2::soa; @@ -189,18 +188,18 @@ struct Lstaranalysis { // Pre-filters for efficient process Filter zVtxFilter = (nabs(o2::aod::collision::posZ) <= configEvents.cfgEvtZvtx); - Filter collisionFilter_MC = nabs(aod::mccollision::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.f || ((aod::track::tofExpMom > 0.f) && (/* (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 == 0) || - ((configTracks.trackSelection == 1) && requireGlobalTrackInFilter()) || - ((configTracks.trackSelection == 2) && requireGlobalTrackWoPtEtaInFilter()) || - ((configTracks.trackSelection == 3) && requireGlobalTrackWoDCAInFilter()) || - ((configTracks.trackSelection == 4) && requireQualityTracksInFilter()) || - ((configTracks.trackSelection == 5) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); + Filter trackFilter = (configTracks.trackSelection == static_cast(0)) || + ((configTracks.trackSelection == static_cast(1)) && requireGlobalTrackInFilter()) || + ((configTracks.trackSelection == static_cast(2)) && requireGlobalTrackWoPtEtaInFilter()) || + ((configTracks.trackSelection == static_cast(3)) && requireGlobalTrackWoDCAInFilter()) || + ((configTracks.trackSelection == static_cast(4)) && requireQualityTracksInFilter()) || + ((configTracks.trackSelection == static_cast(5)) && 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(); @@ -454,8 +453,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()) >= static_cast(3)) { + if (std::abs(mcparticle.eta()) < static_cast(1.0)) return true; } } @@ -555,7 +554,7 @@ struct Lstaranalysis { return true; } } - } else if (configPID.cPIDcutType == 2) { + } else if (configPID.cPIDcutType == static_cast(2)) { // Circular cut for (size_t i = 0; i < vProtonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vProtonTPCTOFCombinedpTintv[i]) { @@ -627,7 +626,7 @@ struct Lstaranalysis { } } } - } else if (configPID.cPIDcutType == 2) { + } else if (configPID.cPIDcutType == static_cast(2)) { // Circular cut for (size_t i = 0; i < vKaonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vKaonTPCTOFCombinedpTintv[i]) { @@ -855,7 +854,7 @@ struct Lstaranalysis { auto resonanceRotPt = lResonanceRot.Pt(); // Rapidity cut - if (std::abs(lResonanceRot.Rapidity()) >= 0.5) + if (std::abs(lResonanceRot.Rapidity()) >= static_cast(0.5)) continue; if (cfgUseCutsOnMother) { @@ -937,7 +936,7 @@ struct Lstaranalysis { motherstrk1 = getMothersIndeces(mctrk1); mothersPDGtrk1 = getMothersPDGCodes(mctrk1); } - while (motherstrk1.size() > 2) { + while (motherstrk1.size() > static_cast(2)) { motherstrk1.pop_back(); mothersPDGtrk1.pop_back(); } @@ -947,18 +946,18 @@ struct Lstaranalysis { motherstrk2 = getMothersIndeces(mctrk2); mothersPDGtrk2 = getMothersPDGCodes(mctrk2); } - while (motherstrk2.size() > 2) { + while (motherstrk2.size() > static_cast(2)) { 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]) != kLambda1520PDG) 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()); @@ -1062,12 +1061,12 @@ struct Lstaranalysis { } PROCESS_SWITCH(Lstaranalysis, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == 102134); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == kLambda1520PDG); // 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()) > static_cast(10.0)) ? false : true; bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); bool isSel8 = collision.sel8(); bool isTrueINELgt0 = isTrueINEL0(collision, mcParticles); @@ -1106,7 +1105,7 @@ struct Lstaranalysis { continue; if (cfgUseDaughterEtaCutMC) { - for (auto& daughters : part.daughters_as()) { + for (auto const& daughters : part.daughters_as()) { if (std::fabs(daughters.eta()) > configTracks.cfgCutEta) continue; // eta cut for daughters } // loop over daughters From 318c935315123701678d8578bb3881a08d935cad Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 12:12:21 +0530 Subject: [PATCH 06/29] fix linter issue --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 1df791d7122..d7a55335340 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -9,9 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +/// /// \file lstaranalysis.cxx /// \brief This standalone task reconstructs track-track decay of lambda(1520) resonance candidate /// \author Hirak Kumar Koley +/// // 1. Own header (doesn't exist) From 0cee1262feb4e7e42369a4f070633d9a8403bee9 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 12:14:05 +0530 Subject: [PATCH 07/29] fix linter issue --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index d7a55335340..1d2dcd586ec 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -10,7 +10,7 @@ // 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 /// From a8c6f5d017cf517f04a13bc87e4345dcca5d9b62 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 12:20:23 +0530 Subject: [PATCH 08/29] fix linter --- .../Tasks/Resonances/lambda1520analysisinpp.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 1d2dcd586ec..e0634bdfad4 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -68,7 +68,7 @@ enum { kAllCutsINELg010, }; -struct Lstaranalysis { +struct Lflambda1520analysisinpp { // Define slice per Resocollision SliceCache cache; Preslice perCollision = o2::aod::track::collisionId; @@ -413,7 +413,7 @@ struct Lstaranalysis { } // Print output histograms statistics - LOG(info) << "Size of the histograms in LstarAnalysis:"; + LOG(info) << "Size of the histograms in Lflambda1520analysisinpp:"; histos.print(); } @@ -1039,7 +1039,7 @@ struct Lstaranalysis { fillHistograms(collision, tracks, tracks); } - PROCESS_SWITCH(Lstaranalysis, processData, "Process Event for data without partition", false); + PROCESS_SWITCH(Lflambda1520analysisinpp, processData, "Process Event for data without partition", false); void processRotational(EventCandidates::iterator const& collision, TrackCandidates const& tracks) { @@ -1048,7 +1048,7 @@ struct Lstaranalysis { fillHistograms(collision, tracks, tracks); } - PROCESS_SWITCH(Lstaranalysis, processRotational, "Process Rotational Background", false); + PROCESS_SWITCH(Lflambda1520analysisinpp, processRotational, "Process Rotational Background", false); void processMC(MCEventCandidates::iterator const& collision, aod::McCollisions const&, @@ -1061,7 +1061,7 @@ struct Lstaranalysis { fillHistograms(collision, tracks, tracks); } - PROCESS_SWITCH(Lstaranalysis, processMC, "Process Event for MC Light without partition", false); + PROCESS_SWITCH(Lflambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == kLambda1520PDG); // Lambda(1520) @@ -1197,7 +1197,7 @@ struct Lstaranalysis { if (isInAfterAllCuts && isTrueINELgt0 && inVtx10) histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCutsINELg010); } - PROCESS_SWITCH(Lstaranalysis, processMCTrue, "Process Event for MC only", false); + PROCESS_SWITCH(Lflambda1520analysisinpp, processMCTrue, "Process Event for MC only", false); // Processing Event Mixing using BinningTypeVtxZT0M = ColumnBinningPolicy; @@ -1234,10 +1234,10 @@ struct Lstaranalysis { fillHistograms(collision1, tracks1, tracks2); } } - PROCESS_SWITCH(Lstaranalysis, processME, "Process EventMixing light without partition", false); + PROCESS_SWITCH(Lflambda1520analysisinpp, processME, "Process EventMixing light without partition", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } From 2ca85659717c3462b8850744ab5041fb673c9886 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 12:21:40 +0530 Subject: [PATCH 09/29] fix linter --- .../Tasks/Resonances/lambda1520analysisinpp.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index e0634bdfad4..9672f2c8d88 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -68,7 +68,7 @@ enum { kAllCutsINELg010, }; -struct Lflambda1520analysisinpp { +struct Lambda1520analysisinpp { // Define slice per Resocollision SliceCache cache; Preslice perCollision = o2::aod::track::collisionId; @@ -413,7 +413,7 @@ struct Lflambda1520analysisinpp { } // Print output histograms statistics - LOG(info) << "Size of the histograms in Lflambda1520analysisinpp:"; + LOG(info) << "Size of the histograms in Lambda1520analysisinpp:"; histos.print(); } @@ -1039,7 +1039,7 @@ struct Lflambda1520analysisinpp { fillHistograms(collision, tracks, tracks); } - PROCESS_SWITCH(Lflambda1520analysisinpp, 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) { @@ -1048,7 +1048,7 @@ struct Lflambda1520analysisinpp { fillHistograms(collision, tracks, tracks); } - PROCESS_SWITCH(Lflambda1520analysisinpp, processRotational, "Process Rotational Background", false); + PROCESS_SWITCH(Lambda1520analysisinpp, processRotational, "Process Rotational Background", false); void processMC(MCEventCandidates::iterator const& collision, aod::McCollisions const&, @@ -1061,7 +1061,7 @@ struct Lflambda1520analysisinpp { fillHistograms(collision, tracks, tracks); } - PROCESS_SWITCH(Lflambda1520analysisinpp, 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) == kLambda1520PDG); // Lambda(1520) @@ -1197,7 +1197,7 @@ struct Lflambda1520analysisinpp { if (isInAfterAllCuts && isTrueINELgt0 && inVtx10) histos.fill(HIST("Event/hMCEventIndices"), centrality, kAllCutsINELg010); } - PROCESS_SWITCH(Lflambda1520analysisinpp, processMCTrue, "Process Event for MC only", false); + PROCESS_SWITCH(Lambda1520analysisinpp, processMCTrue, "Process Event for MC only", false); // Processing Event Mixing using BinningTypeVtxZT0M = ColumnBinningPolicy; @@ -1234,10 +1234,10 @@ struct Lflambda1520analysisinpp { fillHistograms(collision1, tracks1, tracks2); } } - PROCESS_SWITCH(Lflambda1520analysisinpp, 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)}; } From 96138cfa185ddea1f6bcd3055885a1e8652da32c Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 13:57:09 +0530 Subject: [PATCH 10/29] fix clang-format --- .../Resonances/lambda1520analysisinpp.cxx | 60 ++++++++++--------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 9672f2c8d88..629b3e7eb1a 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -1,3 +1,4 @@ + // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. @@ -9,21 +10,10 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// /// \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 -#include - -// 4. Other includes: O2 framework, ROOT, etc. #include "PWGLF/Utils/collisionCuts.h" #include "Common/DataModel/Centrality.h" @@ -40,6 +30,9 @@ #include "TPDGCode.h" #include "TRandom.h" +#include +#include + using namespace o2; using namespace o2::soa; using namespace o2::aod; @@ -68,6 +61,20 @@ enum { kAllCutsINELg010, }; +enum TrackSelectionType { + kAllTracks = 0, + kGlobalTracks, + kGlobalTracksWoPtEta, + kGlobalTracksWoDCA, + kQualityTracks, + kInAcceptanceTracks, +}; + +enum PIDCutType { + kSquareType = 1, + kCircularType, +}; + struct Lambda1520analysisinpp { // Define slice per Resocollision SliceCache cache; @@ -196,12 +203,13 @@ struct Lambda1520analysisinpp { Filter tofPIDFilter = aod::track::tofExpMom < 0.f || ((aod::track::tofExpMom > 0.f) && (/* (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 == static_cast(0)) || - ((configTracks.trackSelection == static_cast(1)) && requireGlobalTrackInFilter()) || - ((configTracks.trackSelection == static_cast(2)) && requireGlobalTrackWoPtEtaInFilter()) || - ((configTracks.trackSelection == static_cast(3)) && requireGlobalTrackWoDCAInFilter()) || - ((configTracks.trackSelection == static_cast(4)) && requireQualityTracksInFilter()) || - ((configTracks.trackSelection == static_cast(5)) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); + Filter trackFilter = (configTracks.trackSelection == kAllTracks) || + ((configTracks.trackSelection == kGlobalTracks) && requireGlobalTrackInFilter()) || + ((configTracks.trackSelection == kGlobalTracksWoPtEta) && requireGlobalTrackWoPtEtaInFilter()) || + ((configTracks.trackSelection == kGlobalTracksWoDCA) && requireGlobalTrackWoDCAInFilter()) || + ((configTracks.trackSelection == kQualityTracks) && requireQualityTracksInFilter()) || + ((configTracks.trackSelection == kInAcceptanceTracks) && 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(); @@ -419,8 +427,6 @@ struct Lambda1520analysisinpp { float massKa = MassKaonCharged; float massPr = MassProton; - double pi = o2::constants::math::PI; - double twopi = o2::constants::math::TwoPI; int kLambda1520PDG = static_cast(102134); // PDG code for Lambda(1520) @@ -455,8 +461,8 @@ struct Lambda1520analysisinpp { continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); if (p != nullptr) { - if (std::abs(p->Charge()) >= static_cast(3)) { - if (std::abs(mcparticle.eta()) < static_cast(1.0)) + if (std::abs(p->Charge()) >= 3) { + if (std::abs(mcparticle.eta()) < 1.0) return true; } } @@ -547,7 +553,7 @@ struct Lambda1520analysisinpp { // Case 3: Has TOF → use TPC + TOF (square or circular) if (candidate.hasTOF()) { - if (configPID.cPIDcutType == 1) { + if (configPID.cPIDcutType == kSquareType) { // Rectangular cut for (size_t i = 0; i < vProtonTOFPIDpTintv.size(); ++i) { if (pt < vProtonTOFPIDpTintv[i]) { @@ -556,7 +562,7 @@ struct Lambda1520analysisinpp { return true; } } - } else if (configPID.cPIDcutType == static_cast(2)) { + } else if (configPID.cPIDcutType == kCircularType) { // Circular cut for (size_t i = 0; i < vProtonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vProtonTPCTOFCombinedpTintv[i]) { @@ -618,7 +624,7 @@ struct Lambda1520analysisinpp { // Case 3: TOF is available → apply TPC+TOF PID logic if (candidate.hasTOF()) { - if (configPID.cPIDcutType == 1) { + if (configPID.cPIDcutType == kSquareType) { // Rectangular cut for (size_t i = 0; i < vKaonTOFPIDpTintv.size(); ++i) { if (pt < vKaonTOFPIDpTintv[i]) { @@ -628,7 +634,7 @@ struct Lambda1520analysisinpp { } } } - } else if (configPID.cPIDcutType == static_cast(2)) { + } else if (configPID.cPIDcutType == kCircularType) { // Circular cut for (size_t i = 0; i < vKaonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vKaonTPCTOFCombinedpTintv[i]) { @@ -712,7 +718,7 @@ struct Lambda1520analysisinpp { if (cfgUseDeltaEtaPhiCuts) { deltaEta = std::abs(trk1etaPr - trk2etaKa); deltaPhi = std::abs(trk1phiPr - trk2phiKa); - deltaPhi = (deltaPhi > pi) ? (twopi - deltaPhi) : deltaPhi; + deltaPhi = (deltaPhi > o2::constants::math::PI) ? (o2::constants::math::TwoPI - deltaPhi) : deltaPhi; if (deltaEta >= cMaxDeltaEtaCut) continue; if (deltaPhi >= cMaxDeltaPhiCut) @@ -844,7 +850,7 @@ struct Lambda1520analysisinpp { if (trk1.sign() * trk2.sign() < 0) { if constexpr (IsRot) { for (int i = 0; i < configBkg.cNofRotations; i++) { - float theta = rn->Uniform(pi - pi / configBkg.rotationalcut, pi + pi / configBkg.rotationalcut); + 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; From a4a83a1df16fccd02c29a0ea959276ee15848e21 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 14:01:01 +0530 Subject: [PATCH 11/29] removed blank line --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 629b3e7eb1a..0be672be305 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -1,4 +1,3 @@ - // Copyright 2019-2020 CERN and copyright holders of ALICE O2. // See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. // All rights not expressly granted are reserved. From 143c83b0998552be180192c94f220878e957ef07 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 14:11:46 +0530 Subject: [PATCH 12/29] fix cpplint --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 0be672be305..975736b2bbc 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -460,7 +460,7 @@ struct Lambda1520analysisinpp { continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); if (p != nullptr) { - if (std::abs(p->Charge()) >= 3) { + if (std::abs(p->Charge()/3.0) >= 1.0) { if (std::abs(mcparticle.eta()) < 1.0) return true; } From 982b0bdb0199734d1b9d1542a4f0a73ebfeeabee Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 22 Jul 2025 08:42:19 +0000 Subject: [PATCH 13/29] Please consider the following formatting changes --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 975736b2bbc..fc96842f2b5 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -460,7 +460,7 @@ struct Lambda1520analysisinpp { continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); if (p != nullptr) { - if (std::abs(p->Charge()/3.0) >= 1.0) { + if (std::abs(p->Charge() / 3.0) >= 1.0) { if (std::abs(mcparticle.eta()) < 1.0) return true; } From 10fbdee9593a1f73ee0944d2926846fcb54039a6 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 14:33:45 +0530 Subject: [PATCH 14/29] fix --- .../Resonances/lambda1520analysisinpp.cxx | 104 +++++++++--------- 1 file changed, 53 insertions(+), 51 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index fc96842f2b5..11873f60822 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -42,36 +42,36 @@ 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, }; enum TrackSelectionType { - kAllTracks = 0, - kGlobalTracks, - kGlobalTracksWoPtEta, - kGlobalTracksWoDCA, - kQualityTracks, - kInAcceptanceTracks, + allTracks = 0, + globalTracks, + globalTracksWoPtEta, + globalTracksWoDCA, + qualityTracks, + inAcceptanceTracks, }; enum PIDCutType { - kSquareType = 1, - kCircularType, + squareType = 1, + circularType, }; struct Lambda1520analysisinpp { @@ -202,12 +202,12 @@ struct Lambda1520analysisinpp { Filter tofPIDFilter = aod::track::tofExpMom < 0.f || ((aod::track::tofExpMom > 0.f) && (/* (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 == kAllTracks) || - ((configTracks.trackSelection == kGlobalTracks) && requireGlobalTrackInFilter()) || - ((configTracks.trackSelection == kGlobalTracksWoPtEta) && requireGlobalTrackWoPtEtaInFilter()) || - ((configTracks.trackSelection == kGlobalTracksWoDCA) && requireGlobalTrackWoDCAInFilter()) || - ((configTracks.trackSelection == kQualityTracks) && requireQualityTracksInFilter()) || - ((configTracks.trackSelection == kInAcceptanceTracks) && requireTrackCutInFilter(TrackSelectionFlags::kInAcceptanceTracks)); + 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); @@ -451,6 +451,8 @@ struct Lambda1520analysisinpp { return returnValue; } + auto static constexpr tripleCharge = 3.f; + // Check if the collision is INEL>0 template bool isTrueINEL0(MCColl const& /*mccoll*/, MCPart const& mcparts) @@ -460,7 +462,7 @@ struct Lambda1520analysisinpp { continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); if (p != nullptr) { - if (std::abs(p->Charge() / 3.0) >= 1.0) { + if (std::abs(p->Charge()) >= tripleCharge) { // check if the particle is charged if (std::abs(mcparticle.eta()) < 1.0) return true; } @@ -552,7 +554,7 @@ struct Lambda1520analysisinpp { // Case 3: Has TOF → use TPC + TOF (square or circular) if (candidate.hasTOF()) { - if (configPID.cPIDcutType == kSquareType) { + if (configPID.cPIDcutType == squareType) { // Rectangular cut for (size_t i = 0; i < vProtonTOFPIDpTintv.size(); ++i) { if (pt < vProtonTOFPIDpTintv[i]) { @@ -561,7 +563,7 @@ struct Lambda1520analysisinpp { return true; } } - } else if (configPID.cPIDcutType == kCircularType) { + } else if (configPID.cPIDcutType == circularType) { // Circular cut for (size_t i = 0; i < vProtonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vProtonTPCTOFCombinedpTintv[i]) { @@ -623,7 +625,7 @@ struct Lambda1520analysisinpp { // Case 3: TOF is available → apply TPC+TOF PID logic if (candidate.hasTOF()) { - if (configPID.cPIDcutType == kSquareType) { + if (configPID.cPIDcutType == squareType) { // Rectangular cut for (size_t i = 0; i < vKaonTOFPIDpTintv.size(); ++i) { if (pt < vKaonTOFPIDpTintv[i]) { @@ -633,7 +635,7 @@ struct Lambda1520analysisinpp { } } } - } else if (configPID.cPIDcutType == kCircularType) { + } else if (configPID.cPIDcutType == circularType) { // Circular cut for (size_t i = 0; i < vKaonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vKaonTPCTOFCombinedpTintv[i]) { @@ -1164,43 +1166,43 @@ struct Lambda1520analysisinpp { } // 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(Lambda1520analysisinpp, processMCTrue, "Process Event for MC only", false); From a199f87f247bdabb9362cb7c35ca16970f55da5d Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 14:37:43 +0530 Subject: [PATCH 15/29] fix linter error --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 11873f60822..065ddc98a1b 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -427,7 +427,7 @@ struct Lambda1520analysisinpp { float massKa = MassKaonCharged; float massPr = MassProton; - int kLambda1520PDG = static_cast(102134); // PDG code for Lambda(1520) + int cLambda1520PDG = static_cast(102134); // PDG code for Lambda(1520) // Centralicity estimator selection template @@ -451,7 +451,7 @@ struct Lambda1520analysisinpp { return returnValue; } - auto static constexpr tripleCharge = 3.f; + auto static constexpr cTripleCharge = 3.f; // Check if the collision is INEL>0 template @@ -462,7 +462,7 @@ struct Lambda1520analysisinpp { continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); if (p != nullptr) { - if (std::abs(p->Charge()) >= tripleCharge) { // check if the particle is charged + if (std::abs(p->Charge()) >= cTripleCharge) { // check if the particle is charged if (std::abs(mcparticle.eta()) < 1.0) return true; } @@ -966,7 +966,7 @@ struct Lambda1520analysisinpp { if (motherstrk1[0] != motherstrk2[0]) // Same mother continue; - if (std::abs(mothersPDGtrk1[0]) != kLambda1520PDG) + if (std::abs(mothersPDGtrk1[0]) != cLambda1520PDG) 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()); @@ -1070,7 +1070,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == kLambda1520PDG); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == cLambda1520PDG); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { @@ -1086,7 +1086,7 @@ struct Lambda1520analysisinpp { // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != kLambda1520PDG) // Lambda1520(0) + if (std::abs(part.pdgCode()) != cLambda1520PDG) // Lambda1520(0) continue; std::vector daughterPDGs; From 6335c822640a179b3e2bad7ea2d724df0dd75e66 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Tue, 22 Jul 2025 14:52:29 +0530 Subject: [PATCH 16/29] fix linter --- .../Resonances/lambda1520analysisinpp.cxx | 112 +++++++++--------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 065ddc98a1b..194677849cb 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -42,36 +42,36 @@ using namespace o2::constants::physics; using LorentzVectorPtEtaPhiMass = ROOT::Math::PtEtaPhiMVector; enum { - inel = 1, - inel10, - inelg0, - inelg010, - trig, - trig10, - trigINELg0, - trigINELg010, - sel8, - sel810, - sel8INELg0, - sel8INELg010, - allCuts, - allCuts10, - allCutsINELg0, - allCutsINELg010, + Inel = 1, + Inel10, + Inelg0, + Inelg010, + Trig, + Trig10, + TrigINELg0, + TrigINELg010, + Sel8, + Sel810, + Sel8INELg0, + Sel8INELg010, + AllCuts, + AllCuts10, + AllCutsINELg0, + AllCutsINELg010, }; enum TrackSelectionType { - allTracks = 0, - globalTracks, - globalTracksWoPtEta, - globalTracksWoDCA, - qualityTracks, - inAcceptanceTracks, + AllTracks = 0, + GlobalTracks, + GlobalTracksWoPtEta, + GlobalTracksWoDCA, + QualityTracks, + InAcceptanceTracks, }; enum PIDCutType { - squareType = 1, - circularType, + SquareType = 1, + CircularType, }; struct Lambda1520analysisinpp { @@ -202,12 +202,12 @@ struct Lambda1520analysisinpp { Filter tofPIDFilter = aod::track::tofExpMom < 0.f || ((aod::track::tofExpMom > 0.f) && (/* (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 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); @@ -427,7 +427,7 @@ struct Lambda1520analysisinpp { float massKa = MassKaonCharged; float massPr = MassProton; - int cLambda1520PDG = static_cast(102134); // PDG code for Lambda(1520) + auto static constexpr Lambda1520PDG = 102134; // PDG code for Lambda(1520) // Centralicity estimator selection template @@ -451,7 +451,7 @@ struct Lambda1520analysisinpp { return returnValue; } - auto static constexpr cTripleCharge = 3.f; + auto static constexpr TripleCharge = 3.f; // Check if the collision is INEL>0 template @@ -462,7 +462,7 @@ struct Lambda1520analysisinpp { continue; auto p = pdg->GetParticle(mcparticle.pdgCode()); if (p != nullptr) { - if (std::abs(p->Charge()) >= cTripleCharge) { // check if the particle is charged + if (std::abs(p->Charge()) >= TripleCharge) { // check if the particle is charged if (std::abs(mcparticle.eta()) < 1.0) return true; } @@ -554,7 +554,7 @@ struct Lambda1520analysisinpp { // Case 3: Has TOF → use TPC + TOF (square or circular) if (candidate.hasTOF()) { - if (configPID.cPIDcutType == squareType) { + if (configPID.cPIDcutType == SquareType) { // Rectangular cut for (size_t i = 0; i < vProtonTOFPIDpTintv.size(); ++i) { if (pt < vProtonTOFPIDpTintv[i]) { @@ -563,7 +563,7 @@ struct Lambda1520analysisinpp { return true; } } - } else if (configPID.cPIDcutType == circularType) { + } else if (configPID.cPIDcutType == CircularType) { // Circular cut for (size_t i = 0; i < vProtonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vProtonTPCTOFCombinedpTintv[i]) { @@ -625,7 +625,7 @@ struct Lambda1520analysisinpp { // Case 3: TOF is available → apply TPC+TOF PID logic if (candidate.hasTOF()) { - if (configPID.cPIDcutType == squareType) { + if (configPID.cPIDcutType == SquareType) { // Rectangular cut for (size_t i = 0; i < vKaonTOFPIDpTintv.size(); ++i) { if (pt < vKaonTOFPIDpTintv[i]) { @@ -635,7 +635,7 @@ struct Lambda1520analysisinpp { } } } - } else if (configPID.cPIDcutType == circularType) { + } else if (configPID.cPIDcutType == CircularType) { // Circular cut for (size_t i = 0; i < vKaonTPCTOFCombinedpTintv.size(); ++i) { if (pt < vKaonTPCTOFCombinedpTintv[i]) { @@ -966,7 +966,7 @@ struct Lambda1520analysisinpp { if (motherstrk1[0] != motherstrk2[0]) // Same mother continue; - if (std::abs(mothersPDGtrk1[0]) != cLambda1520PDG) + if (std::abs(mothersPDGtrk1[0]) != Lambda1520PDG) 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()); @@ -1070,7 +1070,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == cLambda1520PDG); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == Lambda1520PDG); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { @@ -1086,7 +1086,7 @@ struct Lambda1520analysisinpp { // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != cLambda1520PDG) // Lambda1520(0) + if (std::abs(part.pdgCode()) != Lambda1520PDG) // Lambda1520(0) continue; std::vector daughterPDGs; @@ -1166,43 +1166,43 @@ struct Lambda1520analysisinpp { } // QA for Trigger efficiency - histos.fill(HIST("Event/hMCEventIndices"), centrality, inel); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inel); if (inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, inel10); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inel10); if (isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, inelg0); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inelg0); if (inVtx10 && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, inelg010); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Inelg010); // TVX MB trigger if (isTriggerTVX) - histos.fill(HIST("Event/hMCEventIndices"), centrality, trig); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Trig); if (isTriggerTVX && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, trig10); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Trig10); if (isTriggerTVX && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, trigINELg0); + histos.fill(HIST("Event/hMCEventIndices"), centrality, TrigINELg0); if (isTriggerTVX && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, trigINELg010); + histos.fill(HIST("Event/hMCEventIndices"), centrality, TrigINELg010); // Sel8 event selection if (isSel8) - histos.fill(HIST("Event/hMCEventIndices"), centrality, sel8); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8); if (isSel8 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, sel810); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel810); if (isSel8 && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, sel8INELg0); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8INELg0); if (isSel8 && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, sel8INELg010); + histos.fill(HIST("Event/hMCEventIndices"), centrality, Sel8INELg010); // CollisionCuts selection if (isInAfterAllCuts) - histos.fill(HIST("Event/hMCEventIndices"), centrality, allCuts); + histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCuts); if (isInAfterAllCuts && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, allCuts10); + histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCuts10); if (isInAfterAllCuts && isTrueINELgt0) - histos.fill(HIST("Event/hMCEventIndices"), centrality, allCutsINELg0); + histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCutsINELg0); if (isInAfterAllCuts && isTrueINELgt0 && inVtx10) - histos.fill(HIST("Event/hMCEventIndices"), centrality, allCutsINELg010); + histos.fill(HIST("Event/hMCEventIndices"), centrality, AllCutsINELg010); } PROCESS_SWITCH(Lambda1520analysisinpp, processMCTrue, "Process Event for MC only", false); From ff4bac3cefb3d1d49a1c1218b5e03227015acaae Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Wed, 23 Jul 2025 00:26:29 +0530 Subject: [PATCH 17/29] removed magic numbers --- .../Resonances/lambda1520analysisinpp.cxx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 194677849cb..8c6f773f957 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -108,6 +108,7 @@ struct Lambda1520analysisinpp { Configurable cMinPtcut{"cMinPtcut", 0.15f, "Minimal pT for tracks"}; Configurable cMinTPCNClsFound{"cMinTPCNClsFound", 120, "minimum TPCNClsFound value for good track"}; Configurable cfgCutEta{"cfgCutEta", 0.8, "Eta range for tracks"}; + Configurable cfgCutRapidity{"cfgCutRapidity", 0.5, "rapidity range for particles"}; Configurable cfgMinCrossedRows{"cfgMinCrossedRows", 70, "min crossed rows for good track"}; // DCA Selections @@ -652,15 +653,21 @@ struct Lambda1520analysisinpp { return false; } + auto static constexpr MinPtforPionRejection = 1.f; + auto static constexpr MaxPtforPionRejection = 2.f; + auto static constexpr MaxnSigmaforPionRejection = 2.f; + 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; } + auto static constexpr MaxNoLambda1520Daughters = 2; + template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksType& dTracks2) { @@ -828,7 +835,7 @@ struct Lambda1520analysisinpp { if constexpr (IsData || IsMix) { // Rapidity cut - if (std::abs(resonanceRapidity) > static_cast(0.5)) + if (std::abs(resonanceRapidity) > configTracks.cfgCutRapidity) continue; } @@ -863,7 +870,7 @@ struct Lambda1520analysisinpp { auto resonanceRotPt = lResonanceRot.Pt(); // Rapidity cut - if (std::abs(lResonanceRot.Rapidity()) >= static_cast(0.5)) + if (std::abs(lResonanceRot.Rapidity()) >= configTracks.cfgCutRapidity) continue; if (cfgUseCutsOnMother) { @@ -945,7 +952,7 @@ struct Lambda1520analysisinpp { motherstrk1 = getMothersIndeces(mctrk1); mothersPDGtrk1 = getMothersPDGCodes(mctrk1); } - while (motherstrk1.size() > static_cast(2)) { + while (motherstrk1.size() > MaxNoLambda1520Daughters) { motherstrk1.pop_back(); mothersPDGtrk1.pop_back(); } @@ -955,7 +962,7 @@ struct Lambda1520analysisinpp { motherstrk2 = getMothersIndeces(mctrk2); mothersPDGtrk2 = getMothersPDGCodes(mctrk2); } - while (motherstrk2.size() > static_cast(2)) { + while (motherstrk2.size() > MaxNoLambda1520Daughters) { motherstrk2.pop_back(); mothersPDGtrk2.pop_back(); } @@ -974,7 +981,7 @@ struct Lambda1520analysisinpp { if (cUseEtacutMC && std::abs(lResonance.Eta()) > cEtacutMC) // eta cut continue; - if (cUseRapcutMC && std::abs(resonanceRapidity) > 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(), resonancePt); @@ -1075,7 +1082,7 @@ struct Lambda1520analysisinpp { 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()) > static_cast(10.0)) ? 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); @@ -1110,7 +1117,7 @@ struct Lambda1520analysisinpp { 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) { From 2fb0bc32269e40a8b41757f48b54ccd9f4fc44eb Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Wed, 23 Jul 2025 01:25:03 +0530 Subject: [PATCH 18/29] Updated --- .../Resonances/lambda1520analysisinpp.cxx | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 8c6f773f957..e11caede5ef 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -513,15 +513,15 @@ struct Lambda1520analysisinpp { // candidate.tpcNSigmaPr(), candidate.tofNSigmaPr(), tpcPIDPassed, tofPIDPassed, tpcPIDPassed || tofPIDPassed); template - bool pTdependentPIDProton(const T& candidate) + bool ptDependentPidProton(const T& candidate) { - auto vProtonTPCPIDpTintv = static_cast>(configPID.protonTPCPIDpTintv); + auto vProtonTPCPIDpTintv = std::vector(configPID.protonTPCPIDpTintv); vProtonTPCPIDpTintv.insert(vProtonTPCPIDpTintv.begin(), configTracks.cMinPtcut); - auto vProtonTPCPIDcuts = static_cast>(configPID.protonTPCPIDcuts); - auto vProtonTOFPIDpTintv = static_cast>(configPID.protonTOFPIDpTintv); - auto vProtonTPCTOFCombinedpTintv = static_cast>(configPID.protonTPCTOFCombinedpTintv); - auto vProtonTPCTOFCombinedPIDcuts = static_cast>(configPID.protonTPCTOFCombinedPIDcuts); - auto vProtonTOFPIDcuts = static_cast>(configPID.protonTOFPIDcuts); + auto vProtonTPCPIDcuts = std::vector(configPID.protonTPCPIDcuts); + auto vProtonTOFPIDpTintv = std::vector(configPID.protonTOFPIDpTintv); + auto vProtonTPCTOFCombinedpTintv = std::vector(configPID.protonTPCTOFCombinedpTintv); + auto vProtonTPCTOFCombinedPIDcuts = std::vector(configPID.protonTPCTOFCombinedPIDcuts); + auto vProtonTOFPIDcuts = std::vector(configPID.protonTOFPIDcuts); float pt = candidate.pt(); float ptSwitchToTOF = vProtonTPCPIDpTintv.back(); @@ -582,15 +582,15 @@ struct Lambda1520analysisinpp { } template - bool pTdependentPIDKaon(const T& candidate) + bool ptDependentPidKaon(const T& candidate) { - auto vKaonTPCPIDpTintv = static_cast>(configPID.kaonTPCPIDpTintv); + auto vKaonTPCPIDpTintv = std::vector(configPID.kaonTPCPIDpTintv); vKaonTPCPIDpTintv.insert(vKaonTPCPIDpTintv.begin(), configTracks.cMinPtcut); - auto vKaonTPCPIDcuts = static_cast>(configPID.kaonTPCPIDcuts); - auto vKaonTOFPIDpTintv = static_cast>(configPID.kaonTOFPIDpTintv); - auto vKaonTPCTOFCombinedpTintv = static_cast>(configPID.kaonTPCTOFCombinedpTintv); - auto vKaonTPCTOFCombinedPIDcuts = static_cast>(configPID.kaonTPCTOFCombinedPIDcuts); - auto vKaonTOFPIDcuts = static_cast>(configPID.kaonTOFPIDcuts); + auto vKaonTPCPIDcuts = std::vector(configPID.kaonTPCPIDcuts); + auto vKaonTOFPIDpTintv = std::vector(configPID.kaonTOFPIDpTintv); + auto vKaonTPCTOFCombinedpTintv = std::vector(configPID.kaonTPCTOFCombinedpTintv); + auto vKaonTPCTOFCombinedPIDcuts = std::vector(configPID.kaonTPCTOFCombinedPIDcuts); + auto vKaonTOFPIDcuts = std::vector(configPID.kaonTOFPIDcuts); float pt = candidate.pt(); float ptSwitchToTOF = vKaonTPCPIDpTintv.back(); @@ -768,7 +768,7 @@ struct Lambda1520analysisinpp { 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 From 52c528e3e03edc11cdf9297ba1e528ebc50807a2 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Wed, 23 Jul 2025 15:00:30 +0530 Subject: [PATCH 19/29] fixed unneccesary casts and linter issue --- .../Resonances/lambda1520analysisinpp.cxx | 68 +++++++++---------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index e11caede5ef..1274580dfad 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -88,7 +88,7 @@ struct Lambda1520analysisinpp { o2::analysis::CollisonCuts colCuts; struct : ConfigurableGroup { - Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.f, "Evt sel: Max. z-Vertex (cm)"}; + Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.0, "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"}; @@ -105,7 +105,7 @@ struct Lambda1520analysisinpp { 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 cMinPtcut{"cMinPtcut", 0.15, "Minimal pT for tracks"}; Configurable cMinTPCNClsFound{"cMinTPCNClsFound", 120, "minimum TPCNClsFound value for good track"}; Configurable cfgCutEta{"cfgCutEta", 0.8, "Eta range for tracks"}; Configurable cfgCutRapidity{"cfgCutRapidity", 0.5, "rapidity range for particles"}; @@ -113,9 +113,9 @@ struct Lambda1520analysisinpp { // DCA Selections // DCAr to PV - Configurable cMaxDCArToPVcut{"cMaxDCArToPVcut", 0.1f, "Track DCAr cut to PV Maximum"}; + Configurable cMaxDCArToPVcut{"cMaxDCArToPVcut", 0.1, "Track DCAr cut to PV Maximum"}; // DCAz to PV - Configurable cMaxDCAzToPVcut{"cMaxDCAzToPVcut", 0.1f, "Track DCAz cut to PV Maximum"}; + Configurable cMaxDCAzToPVcut{"cMaxDCAzToPVcut", 0.1, "Track DCAz cut to PV Maximum"}; // Track selections Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz @@ -131,7 +131,7 @@ struct Lambda1520analysisinpp { struct : ConfigurableGroup { /// PID Selections - Configurable pidnSigmaPreSelectionCut{"pidnSigmaPreSelectionCut", 4.0f, "pidnSigma Cut for pre-selection of tracks"}; + Configurable pidnSigmaPreSelectionCut{"pidnSigmaPreSelectionCut", 4.0, "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 @@ -155,8 +155,8 @@ struct Lambda1520analysisinpp { struct : ConfigurableGroup { /// 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"}; + ConfigurableAxis cfgVtxBins{"cfgVtxBins", {VARIABLE_WIDTH, -10.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0}, "Mixing bins - z-vertex"}; + ConfigurableAxis cfgMultBins{"cfgMultBins", {VARIABLE_WIDTH, 0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Mixing bins - multiplicity"}; // Rotational background Configurable rotationalcut{"rotationalcut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; @@ -201,7 +201,7 @@ struct Lambda1520analysisinpp { // Filter centralityFilter = nabs(aod::cent::centFT0C) <= cfg_Event_CentralityMax; // Filter triggerFilter = (o2::aod::evsel::sel8 == true); - Filter tofPIDFilter = aod::track::tofExpMom < 0.f || ((aod::track::tofExpMom > 0.f) && (/* (nabs(aod::pidtof::tofNSigmaPi) < configPID.pidnSigmaPreSelectionCut) || */ (nabs(aod::pidtof::tofNSigmaKa) < configPID.pidnSigmaPreSelectionCut) || (nabs(aod::pidtof::tofNSigmaPr) < configPID.pidnSigmaPreSelectionCut))); // TOF + Filter tofPIDFilter = aod::track::tofExpMom < 0.0 || ((aod::track::tofExpMom > 0.0) && (/* (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()) || @@ -269,8 +269,8 @@ struct Lambda1520analysisinpp { if (cFilladditionalQAeventPlots) { // event histograms if (doprocessData) { - 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.0f, 1000.0f}}); + histos.add("QAevent/hPairsCounterSameE", "total valid no. of pairs sameE", HistType::kTH1F, {{1, 0.5, 1.5}}); + histos.add("QAevent/hnTrksSameE", "n tracks per event SameE", HistType::kTH1F, {{1000, 0.0, 1000.0}}); } // Test on Mixed event if (doprocessME) { @@ -280,10 +280,10 @@ struct Lambda1520analysisinpp { 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("QAevent/hPairsCounterMixedE", "total valid no. of pairs mixedE", HistType::kTH1F, {{1, 0.5f, 1.5f}}); + histos.add("QAevent/hPairsCounterMixedE", "total valid no. of pairs mixedE", HistType::kTH1F, {{1, 0.5, 1.5}}); histos.add("QAevent/hVertexZMixedE", "Collision Vertex Z position", HistType::kTH1F, {{100, -15., 15.}}); - histos.add("QAevent/hMultiplicityPercentMixedE", "Multiplicity percentile of collision", HistType::kTH1F, {{120, 0.0f, 120.0f}}); - histos.add("QAevent/hnTrksMixedE", "n tracks per event MixedE", HistType::kTH1F, {{1000, 0.0f, 1000.0f}}); + histos.add("QAevent/hMultiplicityPercentMixedE", "Multiplicity percentile of collision", HistType::kTH1F, {{120, 0.0, 120.0}}); + histos.add("QAevent/hnTrksMixedE", "n tracks per event MixedE", HistType::kTH1F, {{1000, 0.0, 1000.0}}); } } @@ -428,8 +428,6 @@ struct Lambda1520analysisinpp { float massKa = MassKaonCharged; float massPr = MassProton; - auto static constexpr Lambda1520PDG = 102134; // PDG code for Lambda(1520) - // Centralicity estimator selection template float centEst(Coll collisions) @@ -452,7 +450,7 @@ struct Lambda1520analysisinpp { return returnValue; } - auto static constexpr TripleCharge = 3.f; + auto static constexpr TripleCharge = 3.0; // Check if the collision is INEL>0 template @@ -479,7 +477,7 @@ struct Lambda1520analysisinpp { if (std::abs(track.pt()) < configTracks.cMinPtcut) return false; if (configTracks.cDCAr7SigCut) { - if (std::abs(track.dcaXY()) > (0.004f + 0.0130f / (track.pt()))) // 7 - Sigma cut + if (std::abs(track.dcaXY()) > (0.004 + 0.0130 / (track.pt()))) // 7 - Sigma cut return false; } else { if (std::abs(track.dcaXY()) > configTracks.cMaxDCArToPVcut) @@ -515,13 +513,13 @@ struct Lambda1520analysisinpp { template bool ptDependentPidProton(const T& candidate) { - auto vProtonTPCPIDpTintv = std::vector(configPID.protonTPCPIDpTintv); + auto vProtonTPCPIDpTintv = configPID.protonTPCPIDpTintv.value; vProtonTPCPIDpTintv.insert(vProtonTPCPIDpTintv.begin(), configTracks.cMinPtcut); - auto vProtonTPCPIDcuts = std::vector(configPID.protonTPCPIDcuts); - auto vProtonTOFPIDpTintv = std::vector(configPID.protonTOFPIDpTintv); - auto vProtonTPCTOFCombinedpTintv = std::vector(configPID.protonTPCTOFCombinedpTintv); - auto vProtonTPCTOFCombinedPIDcuts = std::vector(configPID.protonTPCTOFCombinedPIDcuts); - auto vProtonTOFPIDcuts = std::vector(configPID.protonTOFPIDcuts); + 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(); @@ -584,13 +582,13 @@ struct Lambda1520analysisinpp { template bool ptDependentPidKaon(const T& candidate) { - auto vKaonTPCPIDpTintv = std::vector(configPID.kaonTPCPIDpTintv); + auto vKaonTPCPIDpTintv = configPID.kaonTPCPIDpTintv.value; vKaonTPCPIDpTintv.insert(vKaonTPCPIDpTintv.begin(), configTracks.cMinPtcut); - auto vKaonTPCPIDcuts = std::vector(configPID.kaonTPCPIDcuts); - auto vKaonTOFPIDpTintv = std::vector(configPID.kaonTOFPIDpTintv); - auto vKaonTPCTOFCombinedpTintv = std::vector(configPID.kaonTPCTOFCombinedpTintv); - auto vKaonTPCTOFCombinedPIDcuts = std::vector(configPID.kaonTPCTOFCombinedPIDcuts); - auto vKaonTOFPIDcuts = std::vector(configPID.kaonTOFPIDcuts); + 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(); @@ -653,9 +651,9 @@ struct Lambda1520analysisinpp { return false; } - auto static constexpr MinPtforPionRejection = 1.f; - auto static constexpr MaxPtforPionRejection = 2.f; - auto static constexpr MaxnSigmaforPionRejection = 2.f; + auto static constexpr MinPtforPionRejection = 1.0; + auto static constexpr MaxPtforPionRejection = 2.0; + auto static constexpr MaxnSigmaforPionRejection = 2.0; template bool rejectPion(const T& candidate) @@ -973,7 +971,7 @@ struct Lambda1520analysisinpp { if (motherstrk1[0] != motherstrk2[0]) // Same mother continue; - if (std::abs(mothersPDGtrk1[0]) != Lambda1520PDG) + if (std::abs(mothersPDGtrk1[0]) != 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()); @@ -1077,7 +1075,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == Lambda1520PDG); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == kLambda1520_Py); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { @@ -1093,7 +1091,7 @@ struct Lambda1520analysisinpp { // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != Lambda1520PDG) // Lambda1520(0) + if (std::abs(part.pdgCode()) != kLambda1520_Py) // Lambda1520(0) continue; std::vector daughterPDGs; From ecb2cfdafe839c7c834217088125657ab162d830 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Wed, 23 Jul 2025 15:39:06 +0530 Subject: [PATCH 20/29] fixed floating numbers --- .../Resonances/lambda1520analysisinpp.cxx | 112 +++++++++--------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 1274580dfad..61f0644adf5 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -88,7 +88,7 @@ struct Lambda1520analysisinpp { o2::analysis::CollisonCuts colCuts; struct : ConfigurableGroup { - Configurable cfgEvtZvtx{"cfgEvtZvtx", 10.0, "Evt sel: Max. z-Vertex (cm)"}; + 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"}; @@ -105,17 +105,17 @@ struct Lambda1520analysisinpp { 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.15, "Minimal pT for tracks"}; + Configurable cMinPtcut{"cMinPtcut", 0.15f, "Minimal pT for tracks"}; Configurable cMinTPCNClsFound{"cMinTPCNClsFound", 120, "minimum TPCNClsFound value for good track"}; - Configurable cfgCutEta{"cfgCutEta", 0.8, "Eta range for tracks"}; - Configurable cfgCutRapidity{"cfgCutRapidity", 0.5, "rapidity range for particles"}; + 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.1, "Track DCAr cut to PV Maximum"}; + Configurable cMaxDCArToPVcut{"cMaxDCArToPVcut", 0.1f, "Track DCAr cut to PV Maximum"}; // DCAz to PV - Configurable cMaxDCAzToPVcut{"cMaxDCAzToPVcut", 0.1, "Track DCAz cut to PV Maximum"}; + Configurable cMaxDCAzToPVcut{"cMaxDCAzToPVcut", 0.1f, "Track DCAz cut to PV Maximum"}; // Track selections Configurable cfgPrimaryTrack{"cfgPrimaryTrack", true, "Primary track selection"}; // kGoldenChi2 | kDCAxy | kDCAz @@ -131,32 +131,32 @@ struct Lambda1520analysisinpp { struct : ConfigurableGroup { /// PID Selections - Configurable pidnSigmaPreSelectionCut{"pidnSigmaPreSelectionCut", 4.0, "pidnSigma Cut for pre-selection of tracks"}; + 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.5}, "pT intervals for Kaon TPC PID cuts"}; + 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.}, "pT intervals for Kaon TOF 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.}, "pT intervals for Kaon TPC-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.9}, "pT intervals for Kaon TPC PID cuts"}; + 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.}, "pT intervals for Kaon TOF 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.}, "pT intervals for Proton TPC-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.0, -8.0, -6.0, -4.0, -2.0, 0.0, 2.0, 4.0, 6.0, 8.0, 10.0}, "Mixing bins - z-vertex"}; - ConfigurableAxis cfgMultBins{"cfgMultBins", {VARIABLE_WIDTH, 0.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 60.0, 70.0, 80.0, 90.0, 100.0, 110.0}, "Mixing bins - multiplicity"}; + 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)"}; @@ -167,23 +167,23 @@ struct Lambda1520analysisinpp { // Additional purity check Configurable crejectPion{"crejectPion", false, "Switch to turn on/off pion contamination"}; Configurable cUseOpeningAngleCut{"cUseOpeningAngleCut", false, "Kinematic Cuts for p-K pair opening angle"}; - Configurable cMinOpeningAngle{"cMinOpeningAngle", 1.4, "Minimum opening angle between daughters"}; - Configurable cMaxOpeningAngle{"cMaxOpeningAngle", 2.4, "Maximum opening angle between daughters"}; + 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 cfgUseCutsOnMother{"cfgUseCutsOnMother", 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 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"}; @@ -201,8 +201,8 @@ struct Lambda1520analysisinpp { // Filter centralityFilter = nabs(aod::cent::centFT0C) <= cfg_Event_CentralityMax; // Filter triggerFilter = (o2::aod::evsel::sel8 == true); - Filter tofPIDFilter = aod::track::tofExpMom < 0.0 || ((aod::track::tofExpMom > 0.0) && (/* (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 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()) || @@ -221,17 +221,17 @@ struct Lambda1520analysisinpp { 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, 14f, 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}, ""}; + ConfigurableAxis binsEtaPhi{"binsEtaPhi", {350, -3.5f, 3.5f}, ""}; void init(framework::InitContext&) { @@ -259,17 +259,17 @@ struct Lambda1520analysisinpp { 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{configBkg.cfgMultBins, "Multiplicity"}; AxisSpec axisVtxMix{configBkg.cfgVtxBins, "Vertex Z (cm)"}; - AxisSpec idxMCAxis = {26, -0.5, 25.5, "Index"}; + AxisSpec idxMCAxis = {26, -0.5f, 25.5f, "Index"}; if (cFilladditionalQAeventPlots) { // event histograms if (doprocessData) { - histos.add("QAevent/hPairsCounterSameE", "total valid no. of pairs sameE", HistType::kTH1F, {{1, 0.5, 1.5}}); + 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 @@ -280,10 +280,10 @@ struct Lambda1520analysisinpp { 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("QAevent/hPairsCounterMixedE", "total valid no. of pairs mixedE", HistType::kTH1F, {{1, 0.5, 1.5}}); - histos.add("QAevent/hVertexZMixedE", "Collision Vertex Z position", HistType::kTH1F, {{100, -15., 15.}}); - histos.add("QAevent/hMultiplicityPercentMixedE", "Multiplicity percentile of collision", HistType::kTH1F, {{120, 0.0, 120.0}}); - histos.add("QAevent/hnTrksMixedE", "n tracks per event MixedE", HistType::kTH1F, {{1000, 0.0, 1000.0}}); + 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("QAevent/hnTrksMixedE", "n tracks per event MixedE", HistType::kTH1F, {{1000, 0.0f, 1000.0f}}); } } @@ -322,7 +322,7 @@ struct Lambda1520analysisinpp { 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}}); @@ -335,7 +335,7 @@ struct Lambda1520analysisinpp { 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 (cFill1DQAs) { @@ -432,7 +432,7 @@ struct Lambda1520analysisinpp { template float centEst(Coll collisions) { - float returnValue = -999.0; + float returnValue = -999.0f; switch (centEstimator) { case 0: returnValue = collisions.centFT0M(); @@ -450,7 +450,7 @@ struct Lambda1520analysisinpp { return returnValue; } - auto static constexpr TripleCharge = 3.0; + auto static constexpr TripleCharge = 3.0f; // Check if the collision is INEL>0 template @@ -462,7 +462,7 @@ struct Lambda1520analysisinpp { auto p = pdg->GetParticle(mcparticle.pdgCode()); if (p != nullptr) { if (std::abs(p->Charge()) >= TripleCharge) { // check if the particle is charged - if (std::abs(mcparticle.eta()) < 1.0) + if (std::abs(mcparticle.eta()) < 1.0f) return true; } } @@ -477,7 +477,7 @@ struct Lambda1520analysisinpp { if (std::abs(track.pt()) < configTracks.cMinPtcut) return false; if (configTracks.cDCAr7SigCut) { - if (std::abs(track.dcaXY()) > (0.004 + 0.0130 / (track.pt()))) // 7 - Sigma cut + if (std::abs(track.dcaXY()) > (0.004f + 0.013f / (track.pt()))) // 7 - Sigma cut return false; } else { if (std::abs(track.dcaXY()) > configTracks.cMaxDCArToPVcut) @@ -651,9 +651,9 @@ struct Lambda1520analysisinpp { return false; } - auto static constexpr MinPtforPionRejection = 1.0; - auto static constexpr MaxPtforPionRejection = 2.0; - auto static constexpr MaxnSigmaforPionRejection = 2.0; + auto static constexpr MinPtforPionRejection = 1.0f; + auto static constexpr MaxPtforPionRejection = 2.0f; + auto static constexpr MaxnSigmaforPionRejection = 2.0f; template bool rejectPion(const T& candidate) @@ -708,7 +708,7 @@ struct Lambda1520analysisinpp { 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(); @@ -716,10 +716,10 @@ struct Lambda1520analysisinpp { 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 = 0; - auto deltaPhi = 0; + auto deltaEta = 0.0f; + auto deltaPhi = 0.0f; if (cfgUseDeltaEtaPhiCuts) { deltaEta = std::abs(trk1etaPr - trk2etaKa); @@ -846,9 +846,9 @@ struct Lambda1520analysisinpp { if (cFilladditionalQAeventPlots) { if constexpr (IsData) { - histos.fill(HIST("QAevent/hPairsCounterSameE"), 1.0); + histos.fill(HIST("QAevent/hPairsCounterSameE"), 1.0f); } else if (IsMix) { - histos.fill(HIST("QAevent/hPairsCounterMixedE"), 1.0); + histos.fill(HIST("QAevent/hPairsCounterMixedE"), 1.0f); } } From 74ff38f8ade656f1b483846b07c4015c3c1a77b0 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Wed, 23 Jul 2025 17:24:42 +0530 Subject: [PATCH 21/29] Updated --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 61f0644adf5..2b0783a8085 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -971,7 +971,7 @@ struct Lambda1520analysisinpp { if (motherstrk1[0] != motherstrk2[0]) // Same mother continue; - if (std::abs(mothersPDGtrk1[0]) != kLambda1520_Py) + 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()); @@ -1075,7 +1075,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == kLambda1520_Py); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == Pdg::kLambda1520_Py); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { @@ -1091,7 +1091,7 @@ struct Lambda1520analysisinpp { // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != kLambda1520_Py) // Lambda1520(0) + if (std::abs(part.pdgCode()) != Pdg::kLambda1520_Py) // Lambda1520(0) continue; std::vector daughterPDGs; From 7764eeec98a93adb6144703958836ce388c17707 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Thu, 24 Jul 2025 22:17:39 +0530 Subject: [PATCH 22/29] fixed missing f --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 2b0783a8085..af848970430 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -222,7 +222,7 @@ struct Lambda1520analysisinpp { /// Figures 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, 14f, 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 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}"}; @@ -1075,7 +1075,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == Pdg::kLambda1520_Py); // Lambda(1520) + Partition selectedMCParticles = (std::abs(aod::mcparticle::pdgCode) == Pdg::kLambda1520_Py); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { From 810ec7028bd7cad2f487c9160927b89a9fa1b209 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 25 Jul 2025 00:00:47 +0530 Subject: [PATCH 23/29] Update --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index af848970430..8e514a1e80c 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -1075,7 +1075,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (std::abs(aod::mcparticle::pdgCode) == Pdg::kLambda1520_Py); // Lambda(1520) + Partition selectedMCParticles = (aod::mcparticle::pdgCode.abs() == Pdg::kLambda1520_Py); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { From dc8b13c6df2433aab5d292a3438a9e8e3c26bd1d Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 25 Jul 2025 00:24:18 +0530 Subject: [PATCH 24/29] Updated --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 8e514a1e80c..4a52049f773 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -427,6 +427,7 @@ struct Lambda1520analysisinpp { float massKa = MassKaonCharged; float massPr = MassProton; + int Lambda1520Pdg = Pdg::kLambda1520_Py; // PDG code for Lambda(1520) // Centralicity estimator selection template @@ -971,7 +972,7 @@ struct Lambda1520analysisinpp { if (motherstrk1[0] != motherstrk2[0]) // Same mother continue; - if (std::abs(mothersPDGtrk1[0]) != Pdg::kLambda1520_Py) + if (std::abs(mothersPDGtrk1[0]) != Lambda1520Pdg) 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()); @@ -1075,7 +1076,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (aod::mcparticle::pdgCode.abs() == Pdg::kLambda1520_Py); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == Lambda1520Pdg); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { @@ -1091,7 +1092,7 @@ struct Lambda1520analysisinpp { // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != Pdg::kLambda1520_Py) // Lambda1520(0) + if (std::abs(part.pdgCode()) != Lambda1520Pdg) // Lambda1520(0) continue; std::vector daughterPDGs; From 5a2cadf6de5f4770fea2cad1e5281f1b0789e2b8 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 25 Jul 2025 00:27:06 +0530 Subject: [PATCH 25/29] fix linter --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 4a52049f773..16d1fb9e1fd 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -427,7 +427,7 @@ struct Lambda1520analysisinpp { float massKa = MassKaonCharged; float massPr = MassProton; - int Lambda1520Pdg = Pdg::kLambda1520_Py; // PDG code for Lambda(1520) + int lambda1520Pdg = Pdg::kLambda1520_Py; // PDG code for Lambda(1520) // Centralicity estimator selection template @@ -972,7 +972,7 @@ struct Lambda1520analysisinpp { if (motherstrk1[0] != motherstrk2[0]) // Same mother continue; - if (std::abs(mothersPDGtrk1[0]) != Lambda1520Pdg) + if (std::abs(mothersPDGtrk1[0]) != lambda1520Pdg) 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()); @@ -1076,7 +1076,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == Lambda1520Pdg); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == lambda1520Pdg); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { @@ -1092,7 +1092,7 @@ struct Lambda1520analysisinpp { // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != Lambda1520Pdg) // Lambda1520(0) + if (std::abs(part.pdgCode()) != lambda1520Pdg) // Lambda1520(0) continue; std::vector daughterPDGs; From 1ce2f56eafbf322d5e54de6426aaae20ff5704c1 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 25 Jul 2025 00:52:50 +0530 Subject: [PATCH 26/29] direct use of kLambda1520_Py --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 16d1fb9e1fd..8b86a9e6d2d 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -427,7 +427,6 @@ struct Lambda1520analysisinpp { float massKa = MassKaonCharged; float massPr = MassProton; - int lambda1520Pdg = Pdg::kLambda1520_Py; // PDG code for Lambda(1520) // Centralicity estimator selection template @@ -972,7 +971,7 @@ struct Lambda1520analysisinpp { if (motherstrk1[0] != motherstrk2[0]) // Same mother continue; - if (std::abs(mothersPDGtrk1[0]) != lambda1520Pdg) + 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()); @@ -1076,7 +1075,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == lambda1520Pdg); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == (int)Pdg::kLambda1520_Py); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { @@ -1092,7 +1091,7 @@ struct Lambda1520analysisinpp { // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != lambda1520Pdg) // Lambda1520(0) + if (std::abs(part.pdgCode()) != Pdg::kLambda1520_Py) // Lambda1520(0) continue; std::vector daughterPDGs; From 842311801fab1379c0c838438a89d44eea797146 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 25 Jul 2025 01:00:10 +0530 Subject: [PATCH 27/29] (int) to static_cast --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 8b86a9e6d2d..b0893126086 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -1075,7 +1075,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == (int)Pdg::kLambda1520_Py); // 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) { From 56ccc462e6f03fe4d988e3c5848cfcded9988e05 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 25 Jul 2025 01:02:17 +0530 Subject: [PATCH 28/29] removed double checking of Lambda1520 --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index b0893126086..6953c6128c2 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -1075,7 +1075,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == static_cast(Pdg::kLambda1520_Py)); // Lambda(1520) + Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == (int)Pdg::kLambda1520_Py); // Lambda(1520) void processMCTrue(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) { @@ -1091,9 +1091,6 @@ struct Lambda1520analysisinpp { // Not related to the real collisions for (const auto& part : mcParts) { // loop over all MC particles - if (std::abs(part.pdgCode()) != Pdg::kLambda1520_Py) // Lambda1520(0) - continue; - std::vector daughterPDGs; if (part.has_daughters()) { auto daughter01 = mcParticles.rawIteratorAt(part.daughtersIds()[0] - mcParticles.offset()); From a5c6edfc0b80d23ca0ad88d9f77acdf0bb9192b1 Mon Sep 17 00:00:00 2001 From: Hirak Koley Date: Fri, 25 Jul 2025 01:04:19 +0530 Subject: [PATCH 29/29] Updated --- PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index 6953c6128c2..0348751dae9 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -1075,7 +1075,7 @@ struct Lambda1520analysisinpp { } PROCESS_SWITCH(Lambda1520analysisinpp, processMC, "Process Event for MC Light without partition", false); - Partition selectedMCParticles = (nabs(aod::mcparticle::pdgCode) == (int)Pdg::kLambda1520_Py); // 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) {