From b04f601268590e95a7ffab04ac9011ef3f45ad50 Mon Sep 17 00:00:00 2001 From: Romain Schotter Date: Fri, 29 May 2026 16:01:29 +0000 Subject: [PATCH 01/22] Update strangeness data model to reduce derived data size (in pp) --- PWGLF/DataModel/LFStrangenessTables.h | 68 +++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 10 deletions(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index 777b2675c5f..b66ccbaed42 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -19,6 +19,7 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/McCollisionExtra.h" // IWYU pragma: keep (FIXME: not used, remove asap) #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Qvectors.h" @@ -278,15 +279,61 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_005, "AOD", "STRAEVSELS", 5, //! // stracollision::EnergyCommonZNC, stracollision::IsUPC); -DECLARE_SOA_TABLE(StraEvSelExtras, "AOD", "STRAEVSELEXTRAS", //! debug information - udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc - udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc - udcollision::TimeFDDA, // Average A-side time (ns) - udcollision::TimeFDDC, // Average C-side time (ns) - udcollision::TimeFV0A, // Average A-side time (ns) - udcollision::TimeFT0A, // Average A-side time (ns) - udcollision::TimeFT0C, // Average C-side time (ns) - udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent +DECLARE_SOA_TABLE_VERSIONED(StraEvSels_006, "AOD", "STRAEVSELS", 6, //! debug information + evsel::Sel8, evsel::Selection, //! event selection: sel8 + mult::MultFT0A, mult::MultFT0C, mult::MultFV0A, // FIT detectors + mult::MultFDDA, mult::MultFDDC, + mult::MultNTracksPVeta1, // track multiplicities with eta cut for INEL>0 + mult::MultPVTotalContributors, // number of PV contribs total + mult::MultNTracksGlobal, // global track multiplicities + collision::Flags, // Contains Vertex::Flags, with most notably the UPCMode to know whether the vertex has been found using UPC settings + evsel::Alias, // trigger aliases (e.g. kTVXinTRD for v2) + evsel::Rct); // Bitmask of RCT flags + +DECLARE_SOA_TABLE(StraEvSelExtras_000, "AOD", "STRAEVSELEXTRAS", //! debug information + udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc + udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc + udcollision::TimeFDDA, // Average A-side time (ns) + udcollision::TimeFDDC, // Average C-side time (ns) + udcollision::TimeFV0A, // Average A-side time (ns) + udcollision::TimeFT0A, // Average A-side time (ns) + udcollision::TimeFT0C, // Average C-side time (ns) + udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent + +DECLARE_SOA_TABLE_VERSIONED(StraEvSelExtras_001, "AOD", "STRAEVSELEXTRAS", 1, //! debug information + mult::MultZNA, mult::MultZNC, mult::MultZEM1, // ZDC signals + mult::MultZEM2, mult::MultZPA, mult::MultZPC, + mult::MultNTracksITSTPC, // track multiplicities, PV contribs, no eta cut + mult::MultAllTracksTPCOnly, // TPConly track multiplicities, all, no eta cut + mult::MultAllTracksITSTPC, // ITSTPC track multiplicities, all, no eta cut + evsel::NumTracksInTimeRange, // add occupancy in specified time interval by a number of tracks from nearby collisions + evsel::SumAmpFT0CInTimeRange, // add occupancy in specified time interval by a sum of FT0C amplitudes from nearby collisions + udcollision::TimeFDDA, // Average A-side time (ns) + udcollision::TimeFDDC, // Average C-side time (ns) + udcollision::TimeFV0A, // Average A-side time (ns) + udcollision::TimeFT0A, // Average A-side time (ns) + udcollision::TimeFT0C, // Average C-side time (ns) + udcollision::TriggerMaskFT0, // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent + udcollision::GapSide, // UPC info: 0 for side A, 1 for side C, 2 for both sides, 3 neither A or C, 4 not enough or too many pv contributors + udcollision::TotalFT0AmplitudeA, // UPC info: re-assigned FT0-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFT0AmplitudeC, // UPC info: re-assigned FT0-C amplitude, in case of SG event, from the most active bc + udcollision::TotalFV0AmplitudeA, // UPC info: re-assigned FV0-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFDDAmplitudeA, // UPC info: re-assigned FDD-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFDDAmplitudeC, // UPC info: re-assigned FDD-C amplitude, in case of SG event, from the most active bc + udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc + udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc + udzdc::EnergyCommonZNA, // UPC info: re-assigned ZN-A amplitude, in case of SG event, from the most active bc + udzdc::EnergyCommonZNC, // UPC info: re-assigned ZN-C amplitude, in case of SG event, from the most active bc + // Dynamic columns for manipulating information + // stracollision::TotalFV0AmplitudeA, + // stracollision::TotalFT0AmplitudeA, + // stracollision::TotalFT0AmplitudeC, + // stracollision::TotalFDDAmplitudeA, + // stracollision::TotalFDDAmplitudeC, + // stracollision::EnergyCommonZNA, + // stracollision::EnergyCommonZNC, + stracollision::IsUPC + ); DECLARE_SOA_TABLE(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8 @@ -330,7 +377,8 @@ DECLARE_SOA_TABLE(StraEvTimes, "AOD", "STRAEVTIMES", //! event time (FT0, TOF) using StraRawCents = StraRawCents_004; using StraCents = StraCents_002; -using StraEvSels = StraEvSels_005; +using StraEvSels = StraEvSels_006; +using StraEvSelExtras = StraEvSelExtras_001; using StraStamps = StraStamps_001; using StraCollision = StraCollisions::iterator; using StraCent = StraCents::iterator; From 53fc05404efa7d198485a400ce49ff37dcf35a6d Mon Sep 17 00:00:00 2001 From: Romain Schotter Date: Fri, 29 May 2026 16:02:29 +0000 Subject: [PATCH 02/22] Add converters for new data model --- .../Converters/straevselextrasconverter.cxx | 65 +++++++++++++++++++ .../Converters/straevselextrasconverter2.cxx | 65 +++++++++++++++++++ .../Converters/straevselsconverter6.cxx | 51 +++++++++++++++ 3 files changed, 181 insertions(+) create mode 100644 PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter.cxx create mode 100644 PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx create mode 100644 PWGLF/TableProducer/Strangeness/Converters/straevselsconverter6.cxx diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter.cxx new file mode 100644 index 00000000000..9679479ed59 --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter.cxx @@ -0,0 +1,65 @@ +// 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsParameters/AggregatedRunInfo.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::aod::evsel; + +// Converts straevselsextrasconverter1 converts StraEvSelExtras_000 into StraEvSelExtras_001 +struct straevselextrasconverter { + Produces straEvSelExtras_001; + + void process(soa::Join const& straEvSels_005) + { + for (auto& values : straEvSels_005) { + straEvSelExtras_001(values.multZNA(), + values.multZNC(), + values.multZEM1(), + values.multZEM2(), + values.multZPA(), + values.multZPC(), + values.multNTracksITSTPC(), + values.multAllTracksTPCOnly(), + values.multAllTracksITSTPC(), + values.trackOccupancyInTimeRange(), + values.ft0cOccupancyInTimeRange(), + values.timeFDDA(), + values.timeFDDC(), + values.timeFV0A(), + values.timeFT0A(), + values.timeFT0C(), + values.triggerMaskFT0(), + values.gapSide(), + values.totalFT0AmplitudeA(), + values.totalFT0AmplitudeC(), + values.totalFV0AmplitudeA(), + values.totalFDDAmplitudeA(), + values.totalFDDAmplitudeC(), + values.timeZNA(), + values.timeZNC(), + values.energyCommonZNA(), + values.energyCommonZNC()); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx new file mode 100644 index 00000000000..3fef1ff0d7f --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx @@ -0,0 +1,65 @@ +// 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsParameters/AggregatedRunInfo.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::aod::evsel; + +// Produce dummy StraEvSelExtras for analysis subscribing to StraEvSelExtras but not saved in the strangeness derived data (typically when running over pp strangeness derived data) +struct straevselextrasconverter2 { + Produces straEvSelExtras; + + void process(aod::StraEvSels const& straEvSels) + { + for (auto& values : straEvSels) { + straEvSelExtras(-999., // dummy multZNA, + -999., // dummy multZNC, + -999., // dummy multZEM1, + -999., // dummy multZEM2, + -999., // dummy multZPA, + -999., // dummy multZPC, + -999., // dummy multNTracksITSTPC, + -999., // dummy multAllTracksTPCOnly, + -999., // dummy multAllTracksITSTPC, + -999., // dummy trackOccupancyInTimeRange, + -999., // dummy ft0cOccupancyInTimeRange, + -999., // dummy timeFDDA, + -999., // dummy timeFDDC, + -999., // dummy timeFV0A, + -999., // dummy timeFT0A, + -999., // dummy timeFT0C, + 0, // dummy triggerMaskFT0, + -999, // dummy gapSide, + -999., // dummy totalFT0AmplitudeA, + -999., // dummy totalFT0AmplitudeC, + -999., // dummy totalFV0AmplitudeA, + -999., // dummy totalFDDAmplitudeA, + -999., // dummy totalFDDAmplitudeC, + -999., // dummy timeZNA, + -999., // dummy timeZNC, + -999., // dummy energyCommonZNA, + -999.); // dummy energyCommonZNC); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter6.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter6.cxx new file mode 100644 index 00000000000..0d6b4f85862 --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter6.cxx @@ -0,0 +1,51 @@ +// 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. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsParameters/AggregatedRunInfo.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::aod::evsel; + +// Converts Stra Event selections from 005 to 006 +struct straevselsconverter6 { + Produces straEvSels_006; + + void process(aod::StraEvSels_005 const& straEvSels_005) + { + for (auto& values : straEvSels_005) { + straEvSels_006(values.sel8(), + values.selection_raw(), + values.multFT0A(), + values.multFT0C(), + values.multFT0A(), + values.multFDDA(), + values.multFDDC(), + values.multNTracksPVeta1(), + values.multPVTotalContributors(), + values.multNTracksGlobal(), + values.flags(), + values.alias_raw(), + values.rct_raw()); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 8f12b022c9926ad9da410abccde8c99e0d604cec Mon Sep 17 00:00:00 2001 From: Romain Schotter Date: Fri, 29 May 2026 16:03:04 +0000 Subject: [PATCH 03/22] Update task producing or subscribing to StraEvSels --- PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx | 25 +- PWGDQ/Tasks/quarkoniaToHyperons.cxx | 116 ++- .../Strangeness/Converters/CMakeLists.txt | 30 +- .../TableProducer/Strangeness/cascadeflow.cxx | 673 ++----------- .../Strangeness/sigma0builder.cxx | 20 +- .../Strangeness/strangederivedbuilder.cxx | 42 +- PWGLF/Tasks/QC/strderivedGenQA.cxx | 50 +- .../Tasks/Resonances/higherMassResonances.cxx | 706 ++++--------- PWGLF/Tasks/Resonances/k892hadronphoton.cxx | 8 +- .../Strangeness/derivedcascadeanalysis.cxx | 8 +- .../derivedlambdakzeroanalysis.cxx | 8 +- .../Tasks/Strangeness/derivedupcanalysis.cxx | 600 ++++------- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 670 ++++++------- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 949 ++++++------------ .../strangenessderivedbinnedinfo.cxx | 51 +- .../Tasks/Strangeness/taskLambdaSpinCorr.cxx | 53 +- 16 files changed, 1334 insertions(+), 2675 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx b/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx index 246e811614f..d7dd238246f 100644 --- a/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx +++ b/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx @@ -16,23 +16,24 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/cascqaanalysis.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" #include -#include -#include #include using namespace o2; @@ -89,7 +90,7 @@ struct FlowEfficiencyCasc { AxisSpec axisK0sMass = {400, 0.4f, 0.6f, "Inv. Mass (GeV)"}; AxisSpec axisLambdaMass = {160, 1.08f, 1.16f, "Inv. Mass (GeV)"}; - using MyCollisions = soa::Join; + using MyCollisions = soa::Join; using MyMcCollisions = soa::Join; using CascMCCandidates = soa::Join; using V0MCCandidates = soa::Join; @@ -345,7 +346,7 @@ struct FlowEfficiencyCasc { } PROCESS_SWITCH(FlowEfficiencyCasc, processRec, "process reconstructed information", true); - void processGen(MyMcCollisions::iterator const&, soa::SmallGroups> const& coll, const soa::SmallGroups>& cascMCs, const soa::SmallGroups>& v0MCs) + void processGen(MyMcCollisions::iterator const&, soa::SmallGroups> const& coll, const soa::SmallGroups>& cascMCs, const soa::SmallGroups>& v0MCs) { registry.fill(HIST("mcEventCounter"), 0.5); int rectracknum = 0; diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index d4601569e86..b0017d58f55 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -29,51 +29,72 @@ // david.dobrigkeit.chinellato@cern.ch // +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include "Math/Vector3D.h" + +#include "DCAFitter/DCAFitterN.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "ReconstructionDataFormats/Track.h" +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Common/Core/trackUtilities.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/LFStrangenessMLTables.h" #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UPCHelpers.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Tools/ML/MlResponse.h" #include "Tools/ML/model.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include +#include +#include +#include #include -#include +#include -#include #include #include -#include #include #include #include @@ -139,7 +160,7 @@ struct QuarkoniaToHyperons { Configurable requireNoCollInTimeRangeStd{"requireNoCollInTimeRangeStd", true, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"}; Configurable requireNoCollInTimeRangeNarrow{"requireNoCollInTimeRangeNarrow", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"}; - Configurable maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position (cm)"}; + Configurable maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position"}; Configurable buildK0sK0sPairs{"buildK0sK0sPairs", false, "Build K0s K0s from charmonia decay"}; Configurable buildLaLaBarPairs{"buildLaLaBarPairs", false, "Build Lambda antiLambda from charmonia decay"}; @@ -368,7 +389,7 @@ struct QuarkoniaToHyperons { ConfigurableAxis axisHypPairPhi{"axisHypPairPhi", {180, 0.0f, constants::math::TwoPI}, "Hyperon pair azimuthal angle (rad)"}; } axes; - o2::base::MatLayerCylSet* lut; // material LUT for DCA fitter + o2::base::MatLayerCylSet* lut; // material LUT for DCA fitter o2::vertexing::DCAFitterN<2> fitter; // helper object @@ -378,7 +399,7 @@ struct QuarkoniaToHyperons { Service pdgDB; // For manual sliceBy - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; + PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; enum Selection : uint64_t { selCosPA = 0, selRadius, @@ -794,10 +815,10 @@ struct QuarkoniaToHyperons { histos.add("QA/XiXiBar/h3dMassXiXiBarVsDCAPair", "h3dMassXiXiBarVsDCAPair", kTH3F, {axes.axisDCAHypPair, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairCosPA", "h3dMassXiXiBarVsPairCosPA", kTH3F, {axes.axisHypPairCosPA, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairOpAngle", "h3dMassXiXiBarVsPairOpAngle", kTH3F, {axes.axisHypPairOpAngle, axes.axisPt, axes.axisQuarkoniumMass}); - histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairEta", "h3dMassXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisQuarkoniumMass}); - histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairPhi", "h3dMassXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisQuarkoniumMass}); - histos.add("QA/XiXiBar/h3dDeltaEtaXiXiBarVsPairEta", "h3dDeltaEtaXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); - histos.add("QA/XiXiBar/h3dDeltaPhiXiXiBarVsPairPhi", "h3dDeltaPhiXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); + histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairEta", "h3dMassXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisQuarkoniumMass}); + histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairPhi", "h3dMassXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisQuarkoniumMass}); + histos.add("QA/LaLaBar/h3dDeltaEtaXiXiBarVsPairEta", "h3dDeltaEtaXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); + histos.add("QA/LaLaBar/h3dDeltaPhiXiXiBarVsPairPhi", "h3dDeltaPhiXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); } } if (buildOmOmBarPairs) { @@ -890,8 +911,8 @@ struct QuarkoniaToHyperons { histos.add("QA/OmOmBar/h3dMassOmOmBarVsPairOpAngle", "h3dMassOmOmBarVsPairOpAngle", kTH3F, {axes.axisHypPairOpAngle, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/OmOmBar/h3dMassOmOmBarVsPairEta", "h3dMassOmOmBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/OmOmBar/h3dMassOmOmBarVsPairPhi", "h3dMassOmOmBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisQuarkoniumMass}); - histos.add("QA/OmOmBar/h3dDeltaEtaOmOmBarVsPairEta", "h3dDeltaEtaOmOmBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); - histos.add("QA/OmOmBar/h3dDeltaPhiOmOmBarVsPairPhi", "h3dDeltaPhiOmOmBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); + histos.add("QA/LaLaBar/h3dDeltaEtaOmOmBarVsPairEta", "h3dDeltaEtaOmOmBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); + histos.add("QA/LaLaBar/h3dDeltaPhiOmOmBarVsPairPhi", "h3dDeltaPhiOmOmBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); } } @@ -1061,13 +1082,11 @@ struct QuarkoniaToHyperons { std::array antiHyperonMomentum = {0.0f, 0.0f, 0.0f}; float DCADau = -999.f; float CosPA = -1.f; - float OpAngle = -999.f; - float Eta() const - { + float OpAngle = -999.f; + float Eta() const { return RecoDecay::eta(std::array{hyperonMomentum[0] + antiHyperonMomentum[0], hyperonMomentum[1] + antiHyperonMomentum[1], hyperonMomentum[2] + antiHyperonMomentum[2]}); } - float Phi() const - { + float Phi() const { return RecoDecay::phi(std::array{hyperonMomentum[0] + antiHyperonMomentum[0], hyperonMomentum[1] + antiHyperonMomentum[1]}); } }; @@ -1122,7 +1141,7 @@ struct QuarkoniaToHyperons { TVector3 hyp2Momentum(pairInfo.antiHyperonMomentum[0], pairInfo.antiHyperonMomentum[1], pairInfo.antiHyperonMomentum[2]); pairInfo.OpAngle = hyp1Momentum.Angle(hyp2Momentum); - if (d < 1e-5f) { // Parallel or nearly parallel lines + if (d < 1e-5f) { // Parallel or nearly parallel lines pairInfo.X = pairInfo.Y = pairInfo.Z = -999.f; // should we use another dummy value? Perhaps 999.f? return pairInfo; } @@ -1202,6 +1221,7 @@ struct QuarkoniaToHyperons { return pairInfo; } + template bool isEventAccepted(TCollision collision, bool fillHists) // check whether the collision passes our collision selections @@ -2497,7 +2517,7 @@ struct QuarkoniaToHyperons { // ______________________________________________________ // Real data processing - no MC subscription - void processRealData(soa::Join const& collisions, V0Candidates const& fullV0s, CascadeCandidates const& fullCascades, DauTracks const&) + void processRealData(soa::Join const& collisions, V0Candidates const& fullV0s, CascadeCandidates const& fullCascades, DauTracks const&) { // Custom grouping v0sGrouped.clear(); @@ -2674,7 +2694,7 @@ struct QuarkoniaToHyperons { // ______________________________________________________ // Simulated processing (subscribes to MC information too) - void processMonteCarlo(soa::Join const& collisions, V0MCCandidates const& fullV0s, CascadeMCCandidates const& fullCascades, DauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&, soa::Join const&) + void processMonteCarlo(soa::Join const& collisions, V0MCCandidates const& fullV0s, CascadeMCCandidates const& fullCascades, DauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&, soa::Join const&) { // Custom grouping v0sGrouped.clear(); diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 8239715863d..94b7800b352 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -9,11 +9,6 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. -o2physics_add_dpl_workflow(stradautracksconverter - SOURCES stradautracksconverter.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(stradautrackstpcpidconverter SOURCES stradautrackstpcpidconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -29,11 +24,6 @@ o2physics_add_dpl_workflow(stradautrackstofpidconverter2 PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(stradautracksextraconverter - SOURCES stradautracksextraconverter.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(stradautracksextraconverter2 SOURCES stradautracksextraconverter2.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -79,6 +69,21 @@ o2physics_add_dpl_workflow(straevselsconverter5 PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(straevselsconverter6 + SOURCES straevselsconverter6.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(straevselextrasconverter + SOURCES straevselextrasconverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(straevselextrasconverter2 + SOURCES straevselextrasconverter2.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(straevselsconverter2rawcents SOURCES straevselsconverter2rawcents.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -124,11 +129,6 @@ o2physics_add_dpl_workflow(stracentconverter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(stracentconverter2 - SOURCES stracentconverter2.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore - COMPONENT_NAME Analysis) - o2physics_add_dpl_workflow(stramccollmultconverter SOURCES stramccollmultconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 98d86a0c471..62d17b34371 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -20,42 +20,24 @@ #include "PWGLF/DataModel/cascqaanalysis.h" #include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/RecoDecay.h" +#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "Tools/ML/MlResponse.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include +#include "CCDB/BasicCCDBManager.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" + +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "Math/GenVector/Boost.h" +#include "TRandom3.h" + #include #include #include @@ -67,14 +49,13 @@ using namespace o2::framework::expressions; using std::array; using DauTracks = soa::Join; -using CollEventPlane = soa::Join::iterator; -using CollEventPlaneCentralFW = soa::Join::iterator; -using CollEventPlaneCentralFWOnlyFT0C = soa::Join::iterator; -using CollEventAndSpecPlane = soa::Join::iterator; -using CollEventAndSpecPlaneCentralFW = soa::Join::iterator; +using CollEventPlane = soa::Join::iterator; +using CollEventPlaneCentralFW = soa::Join::iterator; +using CollEventPlaneCentralFWOnlyFT0C = soa::Join::iterator; +using CollEventAndSpecPlane = soa::Join::iterator; +using CollEventAndSpecPlaneCentralFW = soa::Join::iterator; using MCCollisionsStra = soa::Join; using V0Candidates = soa::Join; -using V0MCCandidates = soa::Join; using CascCandidates = soa::Join; using CascMCCandidates = soa::Join; @@ -115,7 +96,6 @@ const double AlphaLambda[2] = {0.747, -0.757}; // decay parameter of Lambda and std::shared_ptr hMassBeforeSelVsPt[nCharges]; std::shared_ptr hMassAfterSelVsPt[nCharges]; -std::shared_ptr hMassAfterSelVsPtTrue[nCharges]; } // namespace lambdav2 namespace cascade_flow_cuts_ml @@ -185,9 +165,7 @@ struct cascadeFlow { // Output filling criteria struct : ConfigurableGroup { - Configurable isFillNominalMass{"isFillNominalMass", 1, ""}; Configurable isFillTree{"isFillTree", 1, ""}; - Configurable isFillTreeFull{"isFillTreeFull", 0, ""}; Configurable isFillTHNXi{"isFillTHNXi", 1, ""}; Configurable isFillTHNXi_PzVsPsi{"isFillTHNXi_PzVsPsi", 1, ""}; Configurable isFillTHNOmega{"isFillTHNOmega", 1, ""}; @@ -197,7 +175,6 @@ struct cascadeFlow { Configurable isFillTHN_V2{"isFillTHN_V2", 1, ""}; Configurable isFillTHN_Pz{"isFillTHN_Pz", 1, ""}; Configurable isFillTHN_PzFromLambda{"isFillTHN_PzFromLambda", 1, ""}; - Configurable isFillTHN_PzFromLambdaWLambdaMass{"isFillTHN_PzFromLambdaWLambdaMass", 1, ""}; Configurable isFillTHN_Acc{"isFillTHN_Acc", 1, ""}; Configurable isFillTHN_AccFromLambdaVsCasc{"isFillTHN_AccFromLambdaVsCasc", 1, ""}; Configurable isFillTHN_AccFromLambdaVsLambda{"isFillTHN_AccFromLambdaVsLambda", 1, ""}; @@ -271,8 +248,6 @@ struct cascadeFlow { Configurable MaxXiMass{"MaxXiMass", 1.345, ""}; Configurable MinOmegaMass{"MinOmegaMass", 1.655, ""}; Configurable MaxOmegaMass{"MaxOmegaMass", 1.690, ""}; - Configurable CMRlowerLimitMassXi{"CMRlowerLimitMassXi", 999, "Lower limit of rejected Xi candidates"}; // for Omega identification - Configurable CMRupperLimitMassXi{"CMRupperLimitMassXi", -999., "Upper limit of rejected Xi candidates"}; // for Omega identification } CandidateConfigs; struct : ConfigurableGroup { @@ -292,8 +267,6 @@ struct cascadeFlow { Configurable rapidityLambda{"rapidityLambda", 0.5, "rapidityLambda"}; Configurable etaLambda{"etaLambda", 0.8, "etaLambda"}; Configurable dauTrackV0Eta{"dauTrackV0Eta", 0.8, "dauTrackV0Eta"}; - Configurable isPositiveEta{"isPositiveEta", 0, "isPositiveEta"}; - Configurable isNegativeEta{"isNegativeEta", 0, "isNegativeEta"}; } V0Configs; Configurable sideBandStart{"sideBandStart", 5, "Start of the sideband region in number of sigmas"}; @@ -302,33 +275,26 @@ struct cascadeFlow { Configurable doNTPCSigmaCut{"doNTPCSigmaCut", 1, "doNtpcSigmaCut"}; Configurable nsigmatpcPr{"nsigmatpcPr", 5, "nsigmatpcPr"}; Configurable nsigmatpcPi{"nsigmatpcPi", 5, "nsigmatpcPi"}; - Configurable nsigmatpcKa{"nsigmatpcKa", 100, "nsigmatpcKa"}; Configurable mintpccrrows{"mintpccrrows", 70, "mintpccrrows"}; Configurable isStoreTrueCascOnly{"isStoreTrueCascOnly", 1, ""}; Configurable etaCascMCGen{"etaCascMCGen", 0.8, "etaCascMCGen"}; Configurable yCascMCGen{"yCascMCGen", 0.5, "yCascMCGen"}; - struct : ConfigurableGroup { - Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable> modelPathsCCDBXi{"modelPathsCCDBXi", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; - Configurable> modelPathsCCDBOmega{"modelPathsCCDBOmega", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; - Configurable> onnxFileNamesXi{"onnxFileNamesXi", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable> onnxFileNamesOmega{"onnxFileNamesOmega", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", true, "Flag to enable or disable the loading of models from CCDB"}; - Configurable acceptancePathsCCDBXi{"acceptancePathsCCDBXi", "Users/c/chdemart/AcceptanceXi", "Paths of Xi acceptance on CCDB"}; - Configurable acceptancePathsCCDBOmega{"acceptancePathsCCDBOmega", "Users/c/chdemart/AcceptanceOmega", "Paths of Omega acceptance on CCDB"}; - Configurable acceptancePathsCCDBLambda{"acceptancePathsCCDBLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of Lambda acceptance on CCDB"}; - Configurable acceptancePathsCCDBPrimaryLambda{"acceptancePathsCCDBPrimaryLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of PrimaryLambda acceptance on CCDB"}; - Configurable acceptanceHistoNameCasc{"acceptanceHistoNameCasc", "histoCos2ThetaNoFit2D", "Histo name of acceptance on CCDB"}; - Configurable acceptanceHistoNameLambda{"acceptanceHistoNameLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; - Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; - Configurable resoPaths{"resoPath", "Users/c/chdemart/Resolution/", "Paths of resolution"}; - Configurable resoHistoName{"resoHistoName", "hResoPerCentBinsV0A", "Histo name of resolution"}; - Configurable centWeightPaths{"centWeightPath", "Users/c/chdemart/CentralityWeight/", "Paths of centrality weight"}; - Configurable centWeightHistoName{"centWeightHistoName", "hCentWeight", "Histo name of centrality weight"}; - } ccdbConfigs; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable> modelPathsCCDBXi{"modelPathsCCDBXi", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; + Configurable> modelPathsCCDBOmega{"modelPathsCCDBOmega", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; + Configurable> onnxFileNamesXi{"onnxFileNamesXi", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable> onnxFileNamesOmega{"onnxFileNamesOmega", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; + Configurable loadModelsFromCCDB{"loadModelsFromCCDB", true, "Flag to enable or disable the loading of models from CCDB"}; + Configurable acceptancePathsCCDBXi{"acceptancePathsCCDBXi", "Users/c/chdemart/AcceptanceXi", "Paths of Xi acceptance on CCDB"}; + Configurable acceptancePathsCCDBOmega{"acceptancePathsCCDBOmega", "Users/c/chdemart/AcceptanceOmega", "Paths of Omega acceptance on CCDB"}; + Configurable acceptancePathsCCDBLambda{"acceptancePathsCCDBLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of Lambda acceptance on CCDB"}; + Configurable acceptancePathsCCDBPrimaryLambda{"acceptancePathsCCDBPrimaryLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of PrimaryLambda acceptance on CCDB"}; + Configurable acceptanceHistoNameCasc{"acceptanceHistoNameCasc", "histoCos2ThetaNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable acceptanceHistoNameLambda{"acceptanceHistoNameLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; // ML inference Configurable isApplyML{"isApplyML", 1, "Flag to apply ML selections"}; @@ -339,8 +305,6 @@ struct cascadeFlow { // acceptance crrection Configurable applyAcceptanceCorrection{"applyAcceptanceCorrection", false, "apply acceptance correction"}; - Configurable applyResoCorrection{"applyResoCorrection", false, "apply resolution correction"}; - Configurable applyCentWeightCorrection{"applyCentWeightCorrection", false, "apply centrality weight correction"}; o2::ccdb::CcdbApi ccdbApi; Service ccdb; @@ -449,8 +413,6 @@ struct cascadeFlow { if (std::abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi || std::abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr) return false; } - if (std::abs(bachExtra.tpcNSigmaKa()) > nsigmatpcKa) - return false; } counter++; @@ -458,20 +420,6 @@ struct cascadeFlow { return false; counter++; - - double pTotPosExtra = std::sqrt(casc.pxpos() * casc.pxpos() + casc.pypos() * casc.pypos() + casc.pzpos() * casc.pzpos()); - double pTotNegExtra = std::sqrt(casc.pxneg() * casc.pxneg() + casc.pyneg() * casc.pyneg() + casc.pzneg() * casc.pzneg()); - double pTotBachExtra = std::sqrt(casc.pxbach() * casc.pxbach() + casc.pybach() * casc.pybach() + casc.pzbach() * casc.pzbach()); - if (casc.sign() < 0) { - histos.fill(HIST("hNsigmaTPCPi"), posExtra.tpcNSigmaPr(), pTotPosExtra); - histos.fill(HIST("hNsigmaTPCPr"), negExtra.tpcNSigmaPi(), pTotNegExtra); - } else if (casc.sign() > 0) { - histos.fill(HIST("hNsigmaTPCPi"), posExtra.tpcNSigmaPi(), pTotPosExtra); - histos.fill(HIST("hNsigmaTPCPr"), negExtra.tpcNSigmaPr(), pTotNegExtra); - } - histos.fill(HIST("hNsigmaTPCBachKa"), bachExtra.tpcNSigmaKa(), pTotBachExtra); - histos.fill(HIST("hNsigmaTPCBachPi"), bachExtra.tpcNSigmaPi(), pTotBachExtra); - return true; } @@ -489,6 +437,10 @@ struct cascadeFlow { return false; counter++; + + // eta daughters) + // if (abs(posExtra.eta()) > V0Configs.dauTrackV0Eta || abs(negExtra.y()) > V0Configs.dauTrackV0Eta) return false; + return true; } template @@ -529,28 +481,6 @@ struct cascadeFlow { return false; if (std::abs(v0.eta()) > V0Configs.etaLambda) return false; - Float_t posDauEta = RecoDecay::eta(std::array{v0.pxpos(), v0.pypos(), v0.pzpos()}); - Float_t negDauEta = RecoDecay::eta(std::array{v0.pxneg(), v0.pyneg(), v0.pzneg()}); - if (std::abs(posDauEta) > V0Configs.dauTrackV0Eta) - return false; - if (std::abs(negDauEta) > V0Configs.dauTrackV0Eta) - return false; - if (V0Configs.isPositiveEta) { // v0 and daughter tracks required to have positive eta - if (v0.pzpos() <= 0) - return false; - if (v0.pzneg() <= 0) - return false; - if (v0.eta() <= 0) - return false; - } - if (V0Configs.isNegativeEta) { - if (v0.pzpos() >= 0) - return false; - if (v0.pzneg() >= 0) - return false; - if (v0.eta() >= 0) - return false; - } return true; } @@ -645,21 +575,13 @@ struct cascadeFlow { TH2F* hAcceptanceLambda; TH2F* hAcceptancePrimaryLambda; - // objects to use for resolution correction - TH1F* hReso; - - // objects to use for centrality weight - TH1F* hCentWeight; - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry histosMCGen{"histosMCGen", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - HistogramRegistry histosMCReco{"histosMCReco", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry resolution{"resolution", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; // Tables to produce Produces trainingSample; Produces analysisSample; - Produces analysisTopoSample; Produces analysisLambdaSample; Configurable> parSigmaMass{ "parSigmaMass", @@ -698,18 +620,13 @@ struct cascadeFlow { pdgCode); } - template - void fillAnalysedTable(collision_t coll, bool hasEventPlane, bool hasSpectatorPlane, cascade_t casc, float v2CSP, float v2CEP, float v1SP_ZDCA, float v1SP_ZDCC, float PsiT0C, float BDTresponseXi, float BDTresponseOmega, int pdgCode, bachExtra_t bachExtra) + template + void fillAnalysedTable(collision_t coll, bool hasEventPlane, bool hasSpectatorPlane, cascade_t casc, float v2CSP, float v2CEP, float v1SP_ZDCA, float v1SP_ZDCC, float PsiT0C, float BDTresponseXi, float BDTresponseOmega, int pdgCode) { double masses[nParticles]{o2::constants::physics::MassXiMinus, o2::constants::physics::MassOmegaMinus}; ROOT::Math::PxPyPzMVector cascadeVector[nParticles], lambdaVector, protonVector; float cosThetaStarLambda[nParticles], cosThetaStarProton; - - double massLambda = casc.mLambda(); - if (fillingConfigs.isFillNominalMass) - massLambda = o2::constants::physics::MassLambda; - - lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), massLambda); + lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), o2::constants::physics::MassLambda); ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()}; if (casc.sign() > 0) { protonVector.SetCoordinates(casc.pxneg(), casc.pyneg(), casc.pzneg(), o2::constants::physics::MassProton); @@ -739,66 +656,29 @@ struct cascadeFlow { // bool isTVXinTRD = 0; // if (coll.alias_bit(kTVXinTRD)) isTVXinTRD = 1; - if (fillingConfigs.isFillTreeFull) { - analysisTopoSample(coll.centFT0C(), - hasEventPlane, - hasSpectatorPlane, - casc.sign(), - casc.pt(), - casc.eta(), - casc.phi(), - casc.mLambda(), - casc.mXi(), - casc.mOmega(), - casc.cascradius(), - casc.v0radius(), - casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()), - casc.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), - casc.dcapostopv(), - casc.dcanegtopv(), - casc.dcabachtopv(), - casc.dcacascdaughters(), - casc.dcaV0daughters(), - casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ()), - casc.bachBaryonCosPA(), - casc.bachBaryonDCAxyToPV(), - bachExtra.tpcNSigmaKa(), - v2CSP, - v2CEP, - v1SP_ZDCA, - v1SP_ZDCC, - PsiT0C, - BDTresponseXi, - BDTresponseOmega, - cosThetaStarLambda[0], - cosThetaStarLambda[1], - cosThetaStarProton, - pdgCode); - } else { - analysisSample(coll.centFT0C(), - isNoCollInTimeRangeStd, - isNoCollInRofStd, - hasEventPlane, - hasSpectatorPlane, - casc.sign(), - casc.pt(), - casc.eta(), - casc.phi(), - casc.mLambda(), - casc.mXi(), - casc.mOmega(), - v2CSP, - v2CEP, - v1SP_ZDCA, - v1SP_ZDCC, - PsiT0C, - BDTresponseXi, - BDTresponseOmega, - cosThetaStarLambda[0], - cosThetaStarLambda[1], - cosThetaStarProton, - pdgCode); - } + analysisSample(coll.centFT0C(), + isNoCollInTimeRangeStd, + isNoCollInRofStd, + hasEventPlane, + hasSpectatorPlane, + casc.sign(), + casc.pt(), + casc.eta(), + casc.phi(), + casc.mLambda(), + casc.mXi(), + casc.mOmega(), + v2CSP, + v2CEP, + v1SP_ZDCA, + v1SP_ZDCC, + PsiT0C, + BDTresponseXi, + BDTresponseOmega, + cosThetaStarLambda[0], + cosThetaStarLambda[1], + cosThetaStarProton, + pdgCode); } template @@ -834,70 +714,41 @@ struct cascadeFlow { void initAcceptanceFromCCDB() { LOG(info) << "Loading acceptance from CCDB "; - TList* listAcceptanceXi = ccdb->get(ccdbConfigs.acceptancePathsCCDBXi); + TList* listAcceptanceXi = ccdb->get(acceptancePathsCCDBXi); if (!listAcceptanceXi) LOG(fatal) << "Problem getting TList object with acceptance for Xi!"; - TList* listAcceptanceOmega = ccdb->get(ccdbConfigs.acceptancePathsCCDBOmega); + TList* listAcceptanceOmega = ccdb->get(acceptancePathsCCDBOmega); if (!listAcceptanceOmega) LOG(fatal) << "Problem getting TList object with acceptance for Omega!"; - TList* listAcceptanceLambda = ccdb->get(ccdbConfigs.acceptancePathsCCDBLambda); + TList* listAcceptanceLambda = ccdb->get(acceptancePathsCCDBLambda); if (!listAcceptanceLambda) LOG(fatal) << "Problem getting TList object with acceptance for Lambda!"; - TList* listAcceptancePrimaryLambda = ccdb->get(ccdbConfigs.acceptancePathsCCDBPrimaryLambda); + TList* listAcceptancePrimaryLambda = ccdb->get(acceptancePathsCCDBPrimaryLambda); if (!listAcceptancePrimaryLambda) LOG(fatal) << "Problem getting TList object with acceptance for Primary Lambda!"; - hAcceptanceXi = static_cast(listAcceptanceXi->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameCasc->data()))); + hAcceptanceXi = static_cast(listAcceptanceXi->FindObject(Form("%s", acceptanceHistoNameCasc->data()))); if (!hAcceptanceXi) { LOG(fatal) << "The histogram for Xi is not there!"; } hAcceptanceXi->SetName("hAcceptanceXi"); - hAcceptanceOmega = static_cast(listAcceptanceOmega->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameCasc->data()))); + hAcceptanceOmega = static_cast(listAcceptanceOmega->FindObject(Form("%s", acceptanceHistoNameCasc->data()))); if (!hAcceptanceOmega) { LOG(fatal) << "The histogram for omega is not there!"; } hAcceptanceOmega->SetName("hAcceptanceOmega"); - hAcceptanceLambda = static_cast(listAcceptanceLambda->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameLambda->data()))); + hAcceptanceLambda = static_cast(listAcceptanceLambda->FindObject(Form("%s", acceptanceHistoNameLambda->data()))); if (!hAcceptanceLambda) { LOG(fatal) << "The histogram for Lambda is not there!"; } hAcceptanceLambda->SetName("hAcceptanceLambda"); - hAcceptancePrimaryLambda = static_cast(listAcceptancePrimaryLambda->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNamePrimaryLambda->data()))); + hAcceptancePrimaryLambda = static_cast(listAcceptancePrimaryLambda->FindObject(Form("%s", acceptanceHistoNamePrimaryLambda->data()))); if (!hAcceptancePrimaryLambda) { LOG(fatal) << "The histogram for Primary Lambda is not there!"; } hAcceptancePrimaryLambda->SetName("hAcceptancePrimaryLambda"); LOG(info) << "Acceptance now loaded"; } - void initResoFromCCDB() - { - LOG(info) << "Loading resolution from CCDB "; - TList* listReso = ccdb->get(ccdbConfigs.resoPaths); - if (!listReso) - LOG(fatal) << "Problem getting TList object with resolution!"; - - hReso = static_cast(listReso->FindObject(Form("%s", ccdbConfigs.resoHistoName->data()))); - if (!hReso) { - LOG(fatal) << "The histogram for resolution is not there"; - } - hReso->SetName("hReso"); - LOG(info) << "Resolution now loaded"; - } - - void initCentWeightFromCCDB() - { - LOG(info) << "Loading resolution from CCDB "; - TList* listCentWeight = ccdb->get(ccdbConfigs.centWeightPaths); - if (!listCentWeight) - LOG(fatal) << "Problem getting TList object with resolution!"; - - hCentWeight = static_cast(listCentWeight->FindObject(Form("%s", ccdbConfigs.centWeightHistoName->data()))); - if (!hCentWeight) { - LOG(fatal) << "The histogram for resolution is not there"; - } - hCentWeight->SetName("hCentWeight"); - LOG(info) << "Centrality weight now loaded"; - } void init(InitContext const&) { @@ -908,7 +759,6 @@ struct cascadeFlow { float maxMassLambda[2]{1.14, 1.14}; const AxisSpec shiftAxis = {10, 0, 10, "shift"}; const AxisSpec basisAxis = {2, 0, 2, "basis"}; - const AxisSpec axisNTPC = {100, -10, 10}; const AxisSpec massCascAxis[2]{{static_cast((maxMass[0] - minMass[0]) / 0.001f), minMass[0], maxMass[0], "#Xi candidate mass (GeV/c^{2})"}, {static_cast((maxMass[1] - minMass[1]) / 0.001f), minMass[1], maxMass[1], "#Omega candidate mass (GeV/c^{2})"}}; const AxisSpec massLambdaAxis[2]{{static_cast((maxMassLambda[0] - minMassLambda[0]) / 0.001f), minMassLambda[0], maxMassLambda[0], "#Lambda candidate mass (GeV/c^{2})"}, @@ -921,7 +771,6 @@ struct cascadeFlow { TString hNEventsLabels[10] = {"All", "sel8", "z vrtx", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "trackOccupancyInTimeRange", "kNoCollInTimeRange", "kNoCollInROF", "kTVXinTRD", "kIsGoodEventEP"}; TString hNEventsLabelsMC[6] = {"All", "z vtx", ">=1RecoColl", "1Reco", "2Reco", "EvSelected"}; TString hNCascLabelsMC[8] = {"All Xi", "all Omega", "Xi: has MC coll", "Om: has MC coll", "Xi: isPrimary", "Om: is Primary", "Xi: |eta|<0.8", "Om: |eta| < 0.8"}; - TString hNLambdaLabelsMC[5] = {"All Lambdas", "has MC coll", "isPrimary", "|eta|<0.8", "|y| < 0.5"}; resolution.add("QVectorsT0CTPCA", "QVectorsT0CTPCA", HistType::kTH2F, {axisQVs, CentAxisPerCent}); resolution.add("QVectorsT0CTPCC", "QVectorsT0CTPCC", HistType::kTH2F, {axisQVs, CentAxisPerCent}); @@ -967,12 +816,6 @@ struct cascadeFlow { histos.add("ShiftTPCL", "ShiftTPCL", kTProfile3D, {CentAxis, basisAxis, shiftAxis}); histos.add("ShiftTPCR", "ShiftTPCR", kTProfile3D, {CentAxis, basisAxis, shiftAxis}); - // PID TPC - histos.add("hNsigmaTPCBachPi", "hNsigmaTPCBachPi", HistType::kTH2F, {axisNTPC, {20, 0, 10}}); - histos.add("hNsigmaTPCBachKa", "hNsigmaTPCBachKa", HistType::kTH2F, {axisNTPC, {20, 0, 10}}); - histos.add("hNsigmaTPCPi", "hNsigmaTPCPi", HistType::kTH2F, {axisNTPC, {20, 0, 10}}); - histos.add("hNsigmaTPCPr", "hNsigmaTPCPr", HistType::kTH2F, {axisNTPC, {20, 0, 10}}); - histos.add("hNEvents", "hNEvents", {HistType::kTH1D, {{10, 0.f, 10.f}}}); for (Int_t n = 1; n <= histos.get(HIST("hNEvents"))->GetNbinsX(); n++) { histos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(n, hNEventsLabels[n - 1]); @@ -991,11 +834,6 @@ struct cascadeFlow { histos.add("Psi_EP_FT0A_shifted", "Psi_EP_FT0C_shifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); histos.add("Psi_EP_TPCA_shifted", "Psi_EP_FT0C_shifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); histos.add("Psi_EP_TPCC_shifted", "Psi_EP_FT0C_shifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); - histos.add("Psi_EP_FT0C_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); - histos.add("Psi_EP_FV0A_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); - histos.add("Psi_EP_FT0A_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); - histos.add("Psi_EP_TPCA_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); - histos.add("Psi_EP_TPCC_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); histos.add("hPsiZDCA_vs_ZDCC", "hPsiZDCA_vs_ZDCC", HistType::kTH2D, {{100, -o2::constants::math::PI, o2::constants::math::PI}, {100, -o2::constants::math::PI, o2::constants::math::PI}}); histos.add("hEventNchCorrelation", "hEventNchCorrelation", kTH2F, {{5000, 0, 5000}, {5000, 0, 2500}}); histos.add("hEventPVcontributorsVsCentrality", "hEventPVcontributorsVsCentrality", kTH2F, {{100, 0, 100}, {5000, 0, 5000}}); @@ -1029,10 +867,6 @@ struct cascadeFlow { histos.add("hv2CEPvsv2CSP", "hv2CEPvsV2CSP", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); histos.add("hv1EPvsv1SP", "hV1EPvsV1SP", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); histos.add("hv1SP_ZDCA_vs_ZDCC", "hv1SP_ZDCA_vs_ZDCC", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); - histos.add("hV0RapidityvsPt", "hV0RapidityvsPt", HistType::kTH2F, {{100, 0, 10}, {100, -2, 2}}); - histos.add("hEtaV0", "hEtaV0", HistType::kTH1F, {{100, -1, 1}}); - histos.add("hEtaV0posDau", "hEtaV0posDau", HistType::kTH1F, {{100, -1, 1}}); - histos.add("hEtaV0negDau", "hEtaV0negDau", HistType::kTH1F, {{100, -1, 1}}); const AxisSpec thnAxisFT0C{thnAxisConfigs.thnConfigAxisFT0C, "FT0C (%)"}; const AxisSpec thnAxisEta{thnAxisConfigs.thnConfigAxisEta, "#eta"}; @@ -1054,8 +888,6 @@ struct cascadeFlow { const AxisSpec thnAxisCosThetaOmegaAlpha{thnAxisConfigs.thnConfigAxisCosThetaOmegaAlpha, "CosThetaOmegaWithAlpha"}; const AxisSpec thnAxisCosThetaProtonAlpha{thnAxisConfigs.thnConfigAxisCosThetaProtonAlpha, "CosThetaProtonWithAlpha"}; - histos.add("hCentvsPtvsPrimaryFracLambda", "hCentvsPtvsPrimaryFracLambda", HistType::kTH3F, {{100, 0, 100}, thnAxisPtLambda, {4, -0.5, 3.5}}); - histos.add("hCentvsPrimaryFracLambda", "hCentvsPrimaryFracLambda", HistType::kTH2F, {{100, 0, 100}, {4, -0.5, 3.5}}); histos.add("massXi_ProtonAcc", "massXi", HistType::kTH1F, {thnAxisMassXi}); histos.add("massOmega_ProtonAcc", "massOmega", HistType::kTH1F, {thnAxisMassOmega}); @@ -1066,8 +898,6 @@ struct cascadeFlow { histos.add("hXiPzs2", "THn for Pzs2 of Xi", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassXi, thnAxisBDTScore, thnAxisPzs2Xi}); if (fillingConfigs.isFillTHN_PzFromLambda) histos.add("hXiPzs2FromLambda", "THn for Pzs2 of Xi", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassXi, thnAxisBDTScore, thnAxisPzs2Lambda}); - if (fillingConfigs.isFillTHN_PzFromLambdaWLambdaMass) - histos.add("hXiPzs2FromLambdaWLambdaMass", "THn for Pzs2 of Xi", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassXi, thnAxisMassLambda, thnAxisBDTScore, thnAxisPzs2Lambda}); if (fillingConfigs.isFillTHN_Acc) histos.add("hXiCos2Theta", "THn for Cos2Theta of Xi", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPt, thnAxisMassXi, thnAxisBDTScore, thnAxisCos2Theta}); if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) @@ -1094,8 +924,6 @@ struct cascadeFlow { histos.add("hOmegaPzs2", "THn for Pzs2 of Omega", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassOmega, thnAxisBDTScore, thnAxisPzs2Omega}); if (fillingConfigs.isFillTHN_PzFromLambda) histos.add("hOmegaPzs2FromLambda", "THn for Pzs2 of Omega", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassOmega, thnAxisBDTScore, thnAxisPzs2Lambda}); - if (fillingConfigs.isFillTHN_PzFromLambdaWLambdaMass) - histos.add("hOmegaPzs2FromLambdaWLambdaMass", "THn for Pzs2 of Omega", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassOmega, thnAxisMassLambda, thnAxisBDTScore, thnAxisPzs2Lambda}); if (fillingConfigs.isFillTHN_Acc) histos.add("hOmegaCos2Theta", "THn for Cos2Theta of Omega", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPt, thnAxisMassOmega, thnAxisBDTScore, thnAxisCos2Theta}); if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) @@ -1134,14 +962,8 @@ struct cascadeFlow { histosMCGen.add("h2DGenOmegaEta08", "h2DGenOmegaEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histosMCGen.add("h2DGenXiY05", "h2DGenXiY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histosMCGen.add("h2DGenOmegaY05", "h2DGenOmegaY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); - histosMCGen.add("h2DGenLambdaEta08", "h2DGenLambdaEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); - histosMCGen.add("h2DGenLambdaY05", "h2DGenLambdaY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); - histosMCGen.add("h2DGenAntiLambdaEta08", "h2DGenAntiLambdaEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); - histosMCGen.add("h2DGenAntiLambdaY05", "h2DGenAntiLambdaY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histosMCGen.add("hGenXiY", "hGenXiY", HistType::kTH1F, {{100, -1, 1}}); histosMCGen.add("hGenOmegaY", "hGenOmegaY", HistType::kTH1F, {{100, -1, 1}}); - histosMCGen.add("hGenLambdaY", "hGenLambdaY", HistType::kTH1F, {{100, -2, 2}}); - histosMCGen.add("hGenLambdaEta", "hGenLambdaEta", HistType::kTH1F, {{100, -2, 2}}); histosMCGen.add("hZvertexGen", "hZvertexGen", HistType::kTH1F, {{100, -20, 20}}); histosMCGen.add("hNEventsMC", "hNEventsMC", {HistType::kTH1F, {{6, 0.f, 6.f}}}); for (Int_t n = 1; n <= histosMCGen.get(HIST("hNEventsMC"))->GetNbinsX(); n++) { @@ -1151,13 +973,6 @@ struct cascadeFlow { for (Int_t n = 1; n <= histosMCGen.get(HIST("hNCascGen"))->GetNbinsX(); n++) { histosMCGen.get(HIST("hNCascGen"))->GetXaxis()->SetBinLabel(n, hNCascLabelsMC[n - 1]); } - histosMCGen.add("hNLambdaGen", "hNLambdaGen", {HistType::kTH1F, {{5, 0.f, 5.f}}}); - for (Int_t n = 1; n <= histosMCGen.get(HIST("hNLambdaGen"))->GetNbinsX(); n++) { - histosMCGen.get(HIST("hNLambdaGen"))->GetXaxis()->SetBinLabel(n, hNLambdaLabelsMC[n - 1]); - } - - histosMCReco.add("h2DRecoTrueLambda", "h2DRecoTrueLambda", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); - histosMCReco.add("h2DRecoTrueAntiLambda", "h2DRecoTrueAntiLambda", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); for (int iS{0}; iS < nParticles; ++iS) { cascadev2::hMassBeforeSelVsPt[iS] = histos.add(Form("hMassBeforeSelVsPt%s", cascadev2::speciesNames[iS].data()), "hMassBeforeSelVsPt", HistType::kTH2F, {massCascAxis[iS], ptAxisCasc}); @@ -1171,7 +986,6 @@ struct cascadeFlow { for (int iS{0}; iS < nCharges; ++iS) { lambdav2::hMassBeforeSelVsPt[iS] = histos.add(Form("hMassBeforeSelVsPt%s", lambdav2::speciesNames[iS].data()), "hMassBeforeSelVsPt", HistType::kTH2F, {massLambdaAxis[iS], ptAxisLambda}); lambdav2::hMassAfterSelVsPt[iS] = histos.add(Form("hMassAfterSelVsPt%s", lambdav2::speciesNames[iS].data()), "hMassAfterSelVsPt", HistType::kTH2F, {massLambdaAxis[iS], ptAxisLambda}); - lambdav2::hMassAfterSelVsPtTrue[iS] = histos.add(Form("hMassAfterSelVsPtTrue%s", lambdav2::speciesNames[iS].data()), "hMassAfterSelVsPtTrue", HistType::kTH2F, {massLambdaAxis[iS], ptAxisLambda}); } if (isApplyML) { @@ -1179,41 +993,27 @@ struct cascadeFlow { mlResponseXi.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); mlResponseOmega.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); // Bonus: retrieve the model from CCDB (needed for ML application on the GRID) - if (ccdbConfigs.loadModelsFromCCDB) { - ccdbApi.init(ccdbConfigs.ccdbUrl); - mlResponseXi.setModelPathsCCDB(ccdbConfigs.onnxFileNamesXi, ccdbApi, ccdbConfigs.modelPathsCCDBXi, ccdbConfigs.timestampCCDB); - mlResponseOmega.setModelPathsCCDB(ccdbConfigs.onnxFileNamesOmega, ccdbApi, ccdbConfigs.modelPathsCCDBOmega, ccdbConfigs.timestampCCDB); // TODO: use different model for Xi and Omega + if (loadModelsFromCCDB) { + ccdbApi.init(ccdbUrl); + mlResponseXi.setModelPathsCCDB(onnxFileNamesXi, ccdbApi, modelPathsCCDBXi, timestampCCDB); + mlResponseOmega.setModelPathsCCDB(onnxFileNamesOmega, ccdbApi, modelPathsCCDBOmega, timestampCCDB); // TODO: use different model for Xi and Omega } else { - mlResponseXi.setModelPathsLocal(ccdbConfigs.onnxFileNamesXi); - mlResponseOmega.setModelPathsLocal(ccdbConfigs.onnxFileNamesOmega); + mlResponseXi.setModelPathsLocal(onnxFileNamesXi); + mlResponseOmega.setModelPathsLocal(onnxFileNamesOmega); } mlResponseXi.init(); mlResponseOmega.init(); } if (applyAcceptanceCorrection) { - ccdb->setURL(ccdbConfigs.ccdbUrl); + ccdb->setURL(ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); initAcceptanceFromCCDB(); } - if (applyResoCorrection) { - ccdb->setURL(ccdbConfigs.ccdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); - initResoFromCCDB(); - } - if (applyCentWeightCorrection) { - ccdb->setURL(ccdbConfigs.ccdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setFatalWhenNull(false); - initCentWeightFromCCDB(); - } } - void processTrainingBackground(soa::Join::iterator const& coll, soa::Join const& Cascades, DauTracks const&) + void processTrainingBackground(soa::Join::iterator const& coll, soa::Join const& Cascades, DauTracks const&) { int counter = 0; @@ -1255,9 +1055,6 @@ struct cascadeFlow { continue; histos.fill(HIST("hCandidate"), ++counter); } - if (std::abs(bachExtra.tpcNSigmaKa()) > nsigmatpcKa) - continue; - histos.fill(HIST("hCandidate"), ++counter); } else { ++counter; } @@ -1269,7 +1066,7 @@ struct cascadeFlow { } } - void processTrainingSignal(soa::Join::iterator const& coll, CascMCCandidates const& Cascades, DauTracks const&, soa::Join const&) + void processTrainingSignal(soa::Join::iterator const& coll, CascMCCandidates const& Cascades, DauTracks const&, soa::Join const&) { if (!AcceptEvent(coll, 1)) { @@ -1343,9 +1140,6 @@ struct cascadeFlow { const float psiTPCA = std::atan2(coll.qvecBPosIm(), coll.qvecBPosRe()) * 0.5f; const float psiTPCC = std::atan2(coll.qvecBNegIm(), coll.qvecBNegRe()) * 0.5f; float psiT0CCorr = psiT0C; - histos.fill(HIST("Psi_EP_FT0C_notshifted"), coll.centFT0C(), psiT0C); - histos.fill(HIST("Psi_EP_TPCA_notshifted"), coll.centFT0C(), psiTPCA); - histos.fill(HIST("Psi_EP_TPCC_notshifted"), coll.centFT0C(), psiTPCC); for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), coll.centFT0C(), 0.5, ishift - 0.5, std::sin(ishift * 2 * psiT0C)); @@ -1379,6 +1173,7 @@ struct cascadeFlow { histos.fill(HIST("hPsiT0C"), psiT0CCorr); histos.fill(HIST("hPsiZDCA_vs_ZDCC"), coll.psiZDCC(), coll.psiZDCA()); histos.fill(HIST("hPsiT0CvsCentFT0C"), coll.centFT0C(), psiT0CCorr); + resolution.fill(HIST("QVectorsT0CTPCA"), eventplaneVecT0C.Dot(eventplaneVecTPCA), coll.centFT0C()); resolution.fill(HIST("QVectorsT0CTPCC"), eventplaneVecT0C.Dot(eventplaneVecTPCC), coll.centFT0C()); resolution.fill(HIST("QVectorsTPCAC"), eventplaneVecTPCA.Dot(eventplaneVecTPCC), coll.centFT0C()); @@ -1432,11 +1227,6 @@ struct cascadeFlow { cascadev2::hMassBeforeSelVsPt[0]->Fill(massCasc[0], casc.pt()); cascadev2::hMassBeforeSelVsPt[1]->Fill(massCasc[1], casc.pt()); - // competing mass rejection cut applied for Omegas - if (casc.mXi() > CandidateConfigs.CMRlowerLimitMassXi && casc.mXi() < CandidateConfigs.CMRupperLimitMassXi) { - continue; - } - if (isApplyML) { // Retrieve model output and selection outcome isSelectedCasc[0] = mlResponseXi.isSelectedMl(inputFeaturesCasc, casc.pt(), bdtScore[0]); @@ -1451,17 +1241,13 @@ struct cascadeFlow { if (isSelectedCasc[iS]) { cascadev2::hSignalScoreAfterSel[iS]->Fill(bdtScore[0][1]); cascadev2::hBkgScoreAfterSel[iS]->Fill(bdtScore[1][0]); + cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); } } } else { isSelectedCasc[0] = true; isSelectedCasc[1] = true; } - for (int iS{0}; iS < nParticles; ++iS) { - if (isSelectedCasc[iS]) { - cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); - } - } ROOT::Math::XYZVector cascQvec{std::cos(2 * casc.phi()), std::sin(2 * casc.phi()), 0}; auto v2CSP = cascQvec.Dot(eventplaneVecT0C); // not normalised by amplitude @@ -1479,12 +1265,7 @@ struct cascadeFlow { double masses[2]{o2::constants::physics::MassXiMinus, o2::constants::physics::MassOmegaMinus}; ROOT::Math::PxPyPzMVector cascadeVector[2], lambdaVector, protonVector; float cosThetaStarLambda[2], cosThetaStarProton; - - double massLambda = casc.mLambda(); - if (fillingConfigs.isFillNominalMass) - massLambda = o2::constants::physics::MassLambda; - - lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), massLambda); + lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), o2::constants::physics::MassLambda); ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()}; if (casc.sign() > 0) { protonVector.SetCoordinates(casc.pxneg(), casc.pyneg(), casc.pzneg(), o2::constants::physics::MassProton); @@ -1636,7 +1417,7 @@ struct cascadeFlow { if (isSelectedCasc[0] || isSelectedCasc[1]) { if (fillingConfigs.isFillTree) - fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0, bachExtra); + fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0); } } } @@ -1675,9 +1456,6 @@ struct cascadeFlow { const float psiT0C = std::atan2(coll.qvecFT0CIm(), coll.qvecFT0CRe()) * 0.5f; const float psiTPCA = std::atan2(coll.qvecBPosIm(), coll.qvecBPosRe()) * 0.5f; const float psiTPCC = std::atan2(coll.qvecBNegIm(), coll.qvecBNegRe()) * 0.5f; - histos.fill(HIST("Psi_EP_FT0C_notshifted"), coll.centFT0C(), psiT0C); - histos.fill(HIST("Psi_EP_TPCA_notshifted"), coll.centFT0C(), psiTPCA); - histos.fill(HIST("Psi_EP_TPCC_notshifted"), coll.centFT0C(), psiTPCC); float psiT0CCorr = psiT0C; for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), coll.centFT0C(), 0.5, ishift - 0.5, std::sin(ishift * 2 * psiT0C)); @@ -1763,11 +1541,6 @@ struct cascadeFlow { cascadev2::hMassBeforeSelVsPt[0]->Fill(massCasc[0], casc.pt()); cascadev2::hMassBeforeSelVsPt[1]->Fill(massCasc[1], casc.pt()); - // competing mass rejection cut applied for Omegas - if (casc.mXi() > CandidateConfigs.CMRlowerLimitMassXi && casc.mXi() < CandidateConfigs.CMRupperLimitMassXi) { - continue; - } - if (isApplyML) { // Retrieve model output and selection outcome isSelectedCasc[0] = mlResponseXi.isSelectedMl(inputFeaturesCasc, casc.pt(), bdtScore[0]); @@ -1782,17 +1555,13 @@ struct cascadeFlow { if (isSelectedCasc[iS]) { cascadev2::hSignalScoreAfterSel[iS]->Fill(bdtScore[0][1]); cascadev2::hBkgScoreAfterSel[iS]->Fill(bdtScore[1][0]); + cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); } } } else { isSelectedCasc[0] = true; isSelectedCasc[1] = true; } - for (int iS{0}; iS < nParticles; ++iS) { - if (isSelectedCasc[iS]) { - cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); - } - } ROOT::Math::XYZVector cascQvec{std::cos(2 * casc.phi()), std::sin(2 * casc.phi()), 0}; auto v2CSP = cascQvec.Dot(eventplaneVecT0C); // not normalised by amplitude @@ -1804,12 +1573,7 @@ struct cascadeFlow { double masses[nParticles]{o2::constants::physics::MassXiMinus, o2::constants::physics::MassOmegaMinus}; ROOT::Math::PxPyPzMVector cascadeVector[nParticles], lambdaVector, protonVector; float cosThetaStarLambda[nParticles], cosThetaStarProton; - - double massLambda = casc.mLambda(); - if (fillingConfigs.isFillNominalMass) - massLambda = o2::constants::physics::MassLambda; - - lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), massLambda); + lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), o2::constants::physics::MassLambda); ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()}; if (casc.sign() > 0) { protonVector.SetCoordinates(casc.pxneg(), casc.pyneg(), casc.pzneg(), o2::constants::physics::MassProton); @@ -1888,10 +1652,6 @@ struct cascadeFlow { histos.get(HIST("hXiV2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], v2CEP); if (fillingConfigs.isFillTHN_Pz) histos.get(HIST("hXiPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], pzs2Xi); - if (casc.mXi() > CandidateConfigs.MinXiMass && casc.mXi() < CandidateConfigs.MaxXiMass) { - if (fillingConfigs.isFillTHN_PzFromLambdaWLambdaMass) - histos.get(HIST("hXiPzs2FromLambdaWLambdaMass"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), casc.mLambda(), BDTresponse[0], pzs2LambdaFromCasc); - } if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_PzFromLambda) histos.get(HIST("hXiPzs2FromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], pzs2LambdaFromCasc); @@ -1928,10 +1688,6 @@ struct cascadeFlow { histos.get(HIST("hOmegaV2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], v2CEP); if (fillingConfigs.isFillTHN_Pz) histos.get(HIST("hOmegaPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], pzs2Omega); - if (casc.mOmega() > CandidateConfigs.MinOmegaMass && casc.mOmega() < CandidateConfigs.MaxOmegaMass) { - if (fillingConfigs.isFillTHN_PzFromLambdaWLambdaMass) - histos.get(HIST("hOmegaPzs2FromLambdaWLambdaMass"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), casc.mLambda(), BDTresponse[1], pzs2LambdaFromCasc); - } if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_PzFromLambda) histos.get(HIST("hOmegaPzs2FromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], pzs2LambdaFromCasc); @@ -1967,7 +1723,7 @@ struct cascadeFlow { if (isSelectedCasc[0] || isSelectedCasc[1]) { if (fillingConfigs.isFillTree) - fillAnalysedTable(coll, hasEventPlane, 0, casc, v2CSP, v2CEP, 0, 0, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0, bachExtra); + fillAnalysedTable(coll, hasEventPlane, 0, casc, v2CSP, v2CEP, 0, 0, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0); } } } @@ -2043,11 +1799,6 @@ struct cascadeFlow { const float psiT0A = std::atan2(qvecImT0A, qvecReT0A) * 0.5f; const float psiTPCA = std::atan2(coll.qvecBPosIm(), coll.qvecBPosRe()) * 0.5f; const float psiTPCC = std::atan2(coll.qvecBNegIm(), coll.qvecBNegRe()) * 0.5f; - histos.fill(HIST("Psi_EP_FT0C_notshifted"), coll.centFT0C(), psiT0C); - histos.fill(HIST("Psi_EP_FV0A_notshifted"), coll.centFT0C(), psiV0A); - histos.fill(HIST("Psi_EP_FT0A_notshifted"), coll.centFT0C(), psiT0A); - histos.fill(HIST("Psi_EP_TPCA_notshifted"), coll.centFT0C(), psiTPCA); - histos.fill(HIST("Psi_EP_TPCC_notshifted"), coll.centFT0C(), psiTPCC); float psiT0CCorr = psiT0C; for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), collisionCentrality, 0.5, ishift - 0.5, std::sin(ishift * 2 * psiT0C)); @@ -2121,17 +1872,6 @@ struct cascadeFlow { resolution.fill(HIST("QVectorsNormT0ATPCC"), eventplaneVecT0A.Dot(eventplaneVecTPCC) / (coll.qTPCL() * coll.sumAmplFT0A()), collisionCentrality); resolution.fill(HIST("QVectorsNormT0ATPCA"), eventplaneVecT0A.Dot(eventplaneVecTPCA) / (coll.qTPCR() * coll.sumAmplFT0A()), collisionCentrality); - double EPresolution = 1; - if (applyResoCorrection) { - int centBin = hReso->FindBin(collisionCentrality); - EPresolution = hReso->GetBinContent(centBin); - } - double centWeight = 1; - if (applyCentWeightCorrection) { - int centBin = hCentWeight->FindBin(collisionCentrality); - centWeight = hCentWeight->GetBinContent(centBin); - } - std::vector bdtScore[nParticles]; for (auto const& v0 : V0s) { @@ -2192,12 +1932,6 @@ struct cascadeFlow { if (!isSelectedV0[0] && !isSelectedV0[1]) continue; - histos.fill(HIST("hV0RapidityvsPt"), v0.pt(), v0.yLambda()); - histos.fill(HIST("hEtaV0"), v0.eta()); - Float_t posDauEta = RecoDecay::eta(std::array{v0.pxpos(), v0.pypos(), v0.pzpos()}); - histos.fill(HIST("hEtaV0posDau"), posDauEta); - Float_t negDauEta = RecoDecay::eta(std::array{v0.pxneg(), v0.pyneg(), v0.pzneg()}); - histos.fill(HIST("hEtaV0negDau"), negDauEta); ROOT::Math::XYZVector lambdaQvec{std::cos(2 * v0.phi()), std::sin(2 * v0.phi()), 0}; auto v2CSP = lambdaQvec.Dot(eventplaneVecT0C); // not normalised by amplitude auto lambdaminuspsiT0C = GetPhiInRange(v0.phi() - psiT0CCorr); @@ -2205,10 +1939,7 @@ struct cascadeFlow { ROOT::Math::XYZVector lambdaUvec{std::cos(v0.phi()), std::sin(v0.phi()), 0}; // polarization variables - double massLambda = v0.mLambda(); - if (fillingConfigs.isFillNominalMass) - massLambda = o2::constants::physics::MassLambda; - + double massLambda = o2::constants::physics::MassLambda; float cosThetaStarProton[nCharges]; ROOT::Math::PxPyPzMVector lambdaVector, protonVector[nCharges]; lambdaVector.SetCoordinates(v0.px(), v0.py(), v0.pz(), massLambda); @@ -2225,7 +1956,7 @@ struct cascadeFlow { // acceptance values if requested double meanCos2ThetaProtonFromLambda = 1; if (applyAcceptanceCorrection) { - int bin2DLambda = hAcceptancePrimaryLambda->FindBin(v0.pt(), v0.eta()); + int bin2DLambda = hAcceptanceLambda->FindBin(v0.pt(), v0.eta()); meanCos2ThetaProtonFromLambda = hAcceptancePrimaryLambda->GetBinContent(bin2DLambda); } @@ -2233,17 +1964,17 @@ struct cascadeFlow { double cos2ThetaLambda = 0; double cosThetaLambda = 0; if (chargeIndex == 0) { - pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; + pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; + cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; } else if (chargeIndex == 1) { - pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda / EPresolution; + pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; - cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda / EPresolution; + cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; } else { // I treat these bkg candidates as Lambdas for the purpose of calculating Pz - pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; + pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; + cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; } histos.fill(HIST("hv2CEPvsFT0C"), collisionCentrality, v2CEP); @@ -2255,15 +1986,14 @@ struct cascadeFlow { if (fillingConfigs.isFillTHN_V2) histos.get(HIST("hLambdaV2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), v2CEP); if (fillingConfigs.isFillTHN_Pz) { - // histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); - histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda, centWeight); + histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); } if (fillingConfigs.isFillTHN_Acc) histos.get(HIST("hLambdaCos2Theta"))->Fill(collisionCentrality, chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda); } if (fillingConfigs.isFillTHNLambda_PzVsPsi) { if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hLambdaPzVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C, centWeight); + histos.get(HIST("hLambdaPzVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C); if (fillingConfigs.isFillTHN_Acc) histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda, 2 * lambdaminuspsiT0C); } @@ -2330,9 +2060,6 @@ struct cascadeFlow { const float psiT0C = std::atan2(coll.qvecFT0CIm(), coll.qvecFT0CRe()) * 0.5f; const float psiTPCA = std::atan2(coll.qvecBPosIm(), coll.qvecBPosRe()) * 0.5f; const float psiTPCC = std::atan2(coll.qvecBNegIm(), coll.qvecBNegRe()) * 0.5f; - histos.fill(HIST("Psi_EP_FT0C_notshifted"), coll.centFT0C(), psiT0C); - histos.fill(HIST("Psi_EP_TPCA_notshifted"), coll.centFT0C(), psiTPCA); - histos.fill(HIST("Psi_EP_TPCC_notshifted"), coll.centFT0C(), psiTPCC); float psiT0CCorr = psiT0C; for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), coll.centFT0C(), 0.5, ishift - 0.5, std::sin(ishift * 2 * psiT0C)); @@ -2420,11 +2147,6 @@ struct cascadeFlow { cascadev2::hMassBeforeSelVsPt[0]->Fill(massCasc[0], casc.pt()); cascadev2::hMassBeforeSelVsPt[1]->Fill(massCasc[1], casc.pt()); - // competing mass rejection cut applied for Omegas - if (casc.mXi() > CandidateConfigs.CMRlowerLimitMassXi && casc.mXi() < CandidateConfigs.CMRupperLimitMassXi) { - continue; - } - if (isApplyML) { // Retrieve model output and selection outcome isSelectedCasc[0] = mlResponseXi.isSelectedMl(inputFeaturesCasc, casc.pt(), bdtScore[0]); @@ -2439,17 +2161,13 @@ struct cascadeFlow { if (isSelectedCasc[iS]) { cascadev2::hSignalScoreAfterSel[iS]->Fill(bdtScore[0][1]); cascadev2::hBkgScoreAfterSel[iS]->Fill(bdtScore[1][0]); + cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); } } } else { isSelectedCasc[0] = true; isSelectedCasc[1] = true; } - for (int iS{0}; iS < nParticles; ++iS) { - if (isSelectedCasc[iS]) { - cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); - } - } ROOT::Math::XYZVector cascQvec{std::cos(2 * casc.phi()), std::sin(2 * casc.phi()), 0}; auto v2CSP = cascQvec.Dot(eventplaneVecT0C); @@ -2485,11 +2203,11 @@ struct cascadeFlow { } if (isSelectedCasc[0] || isSelectedCasc[1]) if (fillingConfigs.isFillTree) - fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0, bachExtra); + fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0); } } - void processAnalyseMC(soa::Join::iterator const& coll, CascMCCandidates const& Cascades, DauTracks const&, soa::Join const&) + void processAnalyseMC(soa::Join::iterator const& coll, CascMCCandidates const& Cascades, DauTracks const&, soa::Join const&) { if (!AcceptEvent(coll, 1)) { @@ -2578,11 +2296,6 @@ struct cascadeFlow { cascadev2::hMassBeforeSelVsPt[0]->Fill(massCasc[0], casc.pt()); cascadev2::hMassBeforeSelVsPt[1]->Fill(massCasc[1], casc.pt()); - // competing mass rejection cut applied for Omegas - if (casc.mXi() > CandidateConfigs.CMRlowerLimitMassXi && casc.mXi() < CandidateConfigs.CMRupperLimitMassXi) { - continue; - } - if (isApplyML) { // Retrieve model output and selection outcome isSelectedCasc[0] = mlResponseXi.isSelectedMl(inputFeaturesCasc, casc.pt(), bdtScore[0]); @@ -2597,17 +2310,13 @@ struct cascadeFlow { if (isSelectedCasc[iS]) { cascadev2::hSignalScoreAfterSel[iS]->Fill(bdtScore[0][1]); cascadev2::hBkgScoreAfterSel[iS]->Fill(bdtScore[1][0]); + cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); } } } else { isSelectedCasc[0] = true; isSelectedCasc[1] = true; } - for (int iS{0}; iS < nParticles; ++iS) { - if (isSelectedCasc[iS]) { - cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); - } - } histos.fill(HIST("hCascadePhi"), casc.phi()); @@ -2622,29 +2331,16 @@ struct cascadeFlow { BDTresponse[0] = bdtScore[0][1]; BDTresponse[1] = bdtScore[1][1]; } - int chargeIndex = 0; - if (casc.sign() > 0) - chargeIndex = 1; - if (std::abs(casc.eta()) < CandidateConfigs.etaCasc) { - if (fillingConfigs.isFillTHNXi && fillingConfigs.isFillTHN_Pz) { - if (std::abs(pdgCode) == PDG_t::kXiMinus) - histos.get(HIST("hXiPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], 0); - } - if (fillingConfigs.isFillTHNOmega && fillingConfigs.isFillTHN_Pz) { - if (std::abs(pdgCode) == PDG_t::kOmegaMinus) - histos.get(HIST("hOmegaPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], 0); - } - } if (isStoreTrueCascOnly) { if (pdgCode == 0) continue; } if (isSelectedCasc[0] || isSelectedCasc[1]) - fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0C, BDTresponse[0], BDTresponse[1], pdgCode, bachExtra); + fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0C, BDTresponse[0], BDTresponse[1], pdgCode); } } - void processMCGen(MCCollisionsStra::iterator const& mcCollision, const soa::SmallGroups>& collisions, const soa::SmallGroups>& v0MC, const soa::SmallGroups>& cascMC) + void processMCGen(MCCollisionsStra::iterator const& mcCollision, const soa::SmallGroups>& collisions, const soa::SmallGroups>& cascMC) { histosMCGen.fill(HIST("hZvertexGen"), mcCollision.posZ()); @@ -2682,42 +2378,6 @@ struct cascadeFlow { histosMCGen.fill(HIST("hNEventsMC"), 5.5); - for (auto const& v0mc : v0MC) { - if (std::abs(v0mc.pdgCode()) == PDG_t::kLambda0) - histosMCGen.fill(HIST("hNLambdaGen"), 0.5); - if (!v0mc.has_straMCCollision()) - continue; - if (std::abs(v0mc.pdgCode()) == PDG_t::kLambda0) - histosMCGen.fill(HIST("hNLambdaGen"), 1.5); - if (!v0mc.isPhysicalPrimary()) - continue; - if (std::abs(v0mc.pdgCode()) == PDG_t::kLambda0) - histosMCGen.fill(HIST("hNLambdaGen"), 2.5); - - float ptmc = RecoDecay::sqrtSumOfSquares(v0mc.pxMC(), v0mc.pyMC()); - float lambdaMCeta = RecoDecay::eta(std::array{v0mc.pxMC(), v0mc.pyMC(), v0mc.pzMC()}); - float lambdaMCy = 0; - if (std::abs(v0mc.pdgCode()) == PDG_t::kLambda0) { - lambdaMCy = RecoDecay::y(std::array{v0mc.pxMC(), v0mc.pyMC(), v0mc.pzMC()}, constants::physics::MassLambda); - if (std::abs(lambdaMCeta) < etaCascMCGen) { - if (v0mc.pdgCode() == PDG_t::kLambda0) - histosMCGen.fill(HIST("h2DGenLambdaEta08"), centrality, ptmc); - else if (v0mc.pdgCode() == PDG_t::kLambda0Bar) - histosMCGen.fill(HIST("h2DGenAntiLambdaEta08"), centrality, ptmc); - histosMCGen.fill(HIST("hNLambdaGen"), 3.5); - } - if (std::abs(lambdaMCy) < yCascMCGen) { - if (v0mc.pdgCode() == PDG_t::kLambda0) - histosMCGen.fill(HIST("h2DGenLambdaY05"), centrality, ptmc); - else if (v0mc.pdgCode() == PDG_t::kLambda0Bar) - histosMCGen.fill(HIST("h2DGenAntiLambdaY05"), centrality, ptmc); - histosMCGen.fill(HIST("hNLambdaGen"), 4.5); - } - histosMCGen.fill(HIST("hGenLambdaY"), lambdaMCy); - histosMCGen.fill(HIST("hGenLambdaEta"), lambdaMCeta); - } - } - for (auto const& cascmc : cascMC) { if (std::abs(cascmc.pdgCode()) == PDG_t::kXiMinus) histosMCGen.fill(HIST("hNCascGen"), 0.5); @@ -2773,128 +2433,6 @@ struct cascadeFlow { } } - void processMCPrimaryLambdaFraction(soa::Join::iterator const& coll, V0MCCandidates const& V0s, DauTracks const&, soa::Join const&) - { - - Float_t collisionCentrality = 0; - if (isCollisionCentrality == 0) { // T0C - collisionCentrality = coll.centFT0C(); - } else if (isCollisionCentrality == 1) { // T0M - collisionCentrality = coll.centFT0M(); - } - - histos.fill(HIST("hEventCentralityBefEvSel"), collisionCentrality); - - if (!AcceptEvent(coll, 1)) { - return; - } - - // no EP requirements as in MC we do not have EP info - histos.fill(HIST("hNEvents"), 9.5); - histos.fill(HIST("hEventCentrality"), collisionCentrality); - histos.fill(HIST("hEventVertexZ"), coll.posZ()); - - for (auto const& v0 : V0s) { - - /// Add some minimal cuts for single track variables (min number of TPC clusters) - auto negExtra = v0.negTrackExtra_as(); - auto posExtra = v0.posTrackExtra_as(); - - int counterLambda = 0; - int counterALambda = 0; - bool isLambdaCandidate = 0; - bool isALambdaCandidate = 0; - - // check if v0 has MC info - if (!v0.has_v0MCCore()) - continue; - - //-- selections ------------------------------------------------------------ - if (isLambdaAccepted(negExtra, posExtra, counterLambda)) - isLambdaCandidate = 1; - if (isAntiLambdaAccepted(negExtra, posExtra, counterALambda)) - isALambdaCandidate = 1; - histos.fill(HIST("hLambdaDauSel"), counterLambda); - histos.fill(HIST("hALambdaDauSel"), counterALambda); - - if (v0.pt() < V0Configs.MinPtV0 || v0.pt() > V0Configs.MaxPtV0) { - continue; - } - - float massV0[nCharges]{v0.mLambda(), v0.mAntiLambda()}; - lambdav2::hMassBeforeSelVsPt[0]->Fill(massV0[0], v0.pt()); - lambdav2::hMassBeforeSelVsPt[1]->Fill(massV0[1], v0.pt()); - - bool isSelectedV0[2]{false, false}; - if (isV0TopoAccepted(v0) && isLambdaCandidate) - isSelectedV0[0] = true; - if (isV0TopoAccepted(v0) && isALambdaCandidate) - isSelectedV0[1] = true; - - if (isSelectedV0[0] && !isSelectedV0[1]) { // Lambdas - histos.fill(HIST("hLambdaCandidate"), 0); - } - if (isSelectedV0[1] && !isSelectedV0[0]) { // AntiLambdas - histos.fill(HIST("hLambdaCandidate"), 1); - } - if (isSelectedV0[0] && isSelectedV0[1]) { - histos.fill(HIST("hLambdaCandidate"), 2); - if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { - histos.fill(HIST("hLambdaCandidate"), 3); - continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle; checked to be zero in range 1.105 - 1.125 - } - if (!(v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) && !(v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda)) - histos.fill(HIST("hLambdaCandidate"), 4); // bkg candidates - } - if (!isSelectedV0[0] && !isSelectedV0[1]) - continue; - - lambdav2::hMassAfterSelVsPt[0]->Fill(massV0[0], v0.pt()); - lambdav2::hMassAfterSelVsPt[1]->Fill(massV0[1], v0.pt()); - //-------------------------------------------------------------- - - auto v0MC = v0.v0MCCore_as>(); - float ptmc = RecoDecay::sqrtSumOfSquares(v0MC.pxMC(), v0MC.pyMC()); - int pdgCode{v0MC.pdgCode()}; - // select true lambdas - bool isTrueLambda = 0; - bool isTrueALambda = 0; - if (pdgCode == PDG_t::kLambda0 && v0MC.pdgCodePositive() == PDG_t::kProton && v0MC.pdgCodeNegative() == PDG_t::kPiMinus) - isTrueLambda = 1; - else if (pdgCode == PDG_t::kLambda0Bar && v0MC.pdgCodePositive() == PDG_t::kPiPlus && v0MC.pdgCodeNegative() == PDG_t::kProtonBar) - isTrueALambda = 1; - if (!isTrueLambda && !isTrueALambda) - continue; - if (isTrueLambda) - lambdav2::hMassAfterSelVsPtTrue[0]->Fill(massV0[0], v0.pt()); - if (isTrueALambda) - lambdav2::hMassAfterSelVsPtTrue[1]->Fill(massV0[1], v0.pt()); - - bool isPrimary = v0MC.isPhysicalPrimary(); - - // histo for primary fraction - if (isTrueLambda) { - if (isPrimary) { - histos.fill(HIST("hCentvsPtvsPrimaryFracLambda"), collisionCentrality, v0.pt(), 0); - histos.fill(HIST("hCentvsPrimaryFracLambda"), collisionCentrality, 0); - histosMCReco.fill(HIST("h2DRecoTrueLambda"), collisionCentrality, ptmc); - } else { - histos.fill(HIST("hCentvsPtvsPrimaryFracLambda"), collisionCentrality, v0.pt(), 1); - histos.fill(HIST("hCentvsPrimaryFracLambda"), collisionCentrality, 1); - } - } else if (isTrueALambda) { - if (isPrimary) { - histos.fill(HIST("hCentvsPtvsPrimaryFracLambda"), collisionCentrality, v0.pt(), 2); - histos.fill(HIST("hCentvsPrimaryFracLambda"), collisionCentrality, 2); - histosMCReco.fill(HIST("h2DRecoTrueAntiLambda"), collisionCentrality, ptmc); - } else { - histos.fill(HIST("hCentvsPtvsPrimaryFracLambda"), collisionCentrality, v0.pt(), 3); - histos.fill(HIST("hCentvsPrimaryFracLambda"), collisionCentrality, 3); - } - } - } - } - PROCESS_SWITCH(cascadeFlow, processTrainingBackground, "Process to create the training dataset for the background", true); PROCESS_SWITCH(cascadeFlow, processTrainingSignal, "Process to create the training dataset for the signal", false); PROCESS_SWITCH(cascadeFlow, processAnalyseData, "Process to apply ML model to the data", false); @@ -2903,7 +2441,6 @@ struct cascadeFlow { PROCESS_SWITCH(cascadeFlow, processAnalyseLambdaEP2CentralFW, "Process to measure flow and polarization of Lambda - event plane calibration from central framework", false); PROCESS_SWITCH(cascadeFlow, processAnalyseMC, "Process to apply ML model to the MC", false); PROCESS_SWITCH(cascadeFlow, processMCGen, "Process to store MC generated particles", false); - PROCESS_SWITCH(cascadeFlow, processMCPrimaryLambdaFraction, "Process to compute primary lambda fraction", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index 3888e00f8e5..86bf8e6172d 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -3128,32 +3128,32 @@ struct sigma0builder { } // Sigma0 processing part - void processRealData(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&) + void processRealData(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&) { dataProcess(collisions, fullV0s, nullptr, nullptr, nullptr); } - void processRealDataWithTOF(soa::Join const& collisions, V0TOFStandardDerivedDatas const& fullV0s, dauTracks const&) + void processRealDataWithTOF(soa::Join const& collisions, V0TOFStandardDerivedDatas const& fullV0s, dauTracks const&) { dataProcess(collisions, fullV0s, nullptr, nullptr, nullptr); } - void processRealDataWithEMCal(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&, aod::EMCALClusters const& fullEMCalClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + void processRealDataWithEMCal(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&, aod::EMCALClusters const& fullEMCalClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) { dataProcess(collisions, fullV0s, fullEMCalClusters, emcmatchedtracks, nullptr); } - void processMonteCarlo(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) + void processMonteCarlo(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) { dataProcess(collisions, fullV0s, nullptr, nullptr, mcParticles); } - void processMonteCarloWithTOF(soa::Join const& collisions, V0TOFDerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) + void processMonteCarloWithTOF(soa::Join const& collisions, V0TOFDerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) { dataProcess(collisions, fullV0s, nullptr, nullptr, mcParticles); } - void processMonteCarloWithEMCal(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&, EMCalMCClusters const& fullEMCalMCClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + void processMonteCarloWithEMCal(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&, EMCalMCClusters const& fullEMCalMCClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) { dataProcess(collisions, fullV0s, fullEMCalMCClusters, emcmatchedtracks, mcParticles); } @@ -3164,22 +3164,22 @@ struct sigma0builder { } // Photon and lambda-specific part (QA) - void processV0QA(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&) + void processV0QA(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&) { runV0QA(collisions, fullV0s); } - void processV0MCQA(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) + void processV0MCQA(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) { runV0QA(collisions, fullV0s); } - void processV0Generated(soa::Join const& mcCollisions, soa::Join const& V0MCCores, soa::Join const& collisions) + void processV0Generated(soa::Join const& mcCollisions, soa::Join const& V0MCCores, soa::Join const& collisions) { runGenV0QA(mcCollisions, V0MCCores, collisions); } - void processPCMVsEMCalQA(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&, EMCalMCClusters const& fullEMCalMCClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + void processPCMVsEMCalQA(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&, EMCalMCClusters const& fullEMCalMCClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) { runPCMVsEMCalQA(collisions, fullV0s, fullEMCalMCClusters, emcmatchedtracks, mcParticles); } diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index f4afc11f227..0a48330dd14 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -560,7 +560,7 @@ struct strangederivedbuilder { products.strangeCents(collision.centFT0M(), collision.centFT0A(), centrality, collision.centFV0A(), collision.centFT0CVariant1(), collision.centFT0CVariant2(), collision.centMFT(), collision.centNGlobal(), collision.centNTPV()); - products.strangeEvSels(collision.sel8(), collision.selection_raw(), + products.strangeEvSels(collision.sel8(), collision.selection_raw(), collision.multFT0A() * static_cast(fillTruncationOptions.fillRawFT0A), collision.multFT0C() * static_cast(fillTruncationOptions.fillRawFT0C), collision.multFV0A() * static_cast(fillTruncationOptions.fillRawFV0A), @@ -569,30 +569,30 @@ struct strangederivedbuilder { collision.multNTracksPVeta1() * static_cast(fillTruncationOptions.fillRawNTracksEta1), collision.multPVTotalContributors() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), collision.multNTracksGlobal() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), - collision.multNTracksITSTPC() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), - collision.multAllTracksTPCOnly() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), - collision.multAllTracksITSTPC() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), - collision.multZNA() * static_cast(fillTruncationOptions.fillRawZDC), - collision.multZNC() * static_cast(fillTruncationOptions.fillRawZDC), - collision.multZEM1() * static_cast(fillTruncationOptions.fillRawZDC), - collision.multZEM2() * static_cast(fillTruncationOptions.fillRawZDC), - collision.multZPA() * static_cast(fillTruncationOptions.fillRawZDC), - collision.multZPC() * static_cast(fillTruncationOptions.fillRawZDC), - collision.trackOccupancyInTimeRange(), - collision.ft0cOccupancyInTimeRange(), - // UPC info - gapSide, - totalFT0AmplitudeA, totalFT0AmplitudeC, totalFV0AmplitudeA, - totalFDDAmplitudeA, totalFDDAmplitudeC, - energyCommonZNA, energyCommonZNC, // Collision flags collision.flags(), collision.alias_raw(), collision.rct_raw()); - products.strangeEvSelExtras(timeZNA, timeZNC, // ZDC info - timeFDDA, timeFDDC, // FDD info - timeFV0A, // FV0A info - timeFT0A, timeFT0C, ft0TriggerMask); // FT0 info + products.strangeEvSelExtras(collision.multZNA() * static_cast(fillTruncationOptions.fillRawZDC), + collision.multZNC() * static_cast(fillTruncationOptions.fillRawZDC), + collision.multZEM1() * static_cast(fillTruncationOptions.fillRawZDC), + collision.multZEM2() * static_cast(fillTruncationOptions.fillRawZDC), + collision.multZPA() * static_cast(fillTruncationOptions.fillRawZDC), + collision.multZPC() * static_cast(fillTruncationOptions.fillRawZDC), + collision.multNTracksITSTPC() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), + collision.multAllTracksTPCOnly() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), + collision.multAllTracksITSTPC() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), + collision.trackOccupancyInTimeRange(), + collision.ft0cOccupancyInTimeRange(), + timeFDDA, timeFDDC, // FDD info + timeFV0A, // FV0A info + timeFT0A, timeFT0C, ft0TriggerMask, // FT0 info + // UPC info + gapSide, + totalFT0AmplitudeA, totalFT0AmplitudeC, totalFV0AmplitudeA, + totalFDDAmplitudeA, totalFDDAmplitudeC, + timeZNA, timeZNC, // ZDC info + energyCommonZNA, energyCommonZNC); } else { // We are in Run 2 products.strangeCentsRun2(collision.centRun2V0M(), collision.centRun2V0A(), collision.centRun2SPDTracklets(), collision.centRun2SPDClusters()); diff --git a/PWGLF/Tasks/QC/strderivedGenQA.cxx b/PWGLF/Tasks/QC/strderivedGenQA.cxx index 7fa8d57ed56..daf46fd3713 100644 --- a/PWGLF/Tasks/QC/strderivedGenQA.cxx +++ b/PWGLF/Tasks/QC/strderivedGenQA.cxx @@ -23,27 +23,33 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include +#include +#include +#include +#include +#include +#include #include #include -#include #include #include @@ -53,7 +59,7 @@ using namespace o2::framework::expressions; using namespace std; using std::array; using dauTracks = soa::Join; -using StrCollisionsDatas = soa::Join; +using StrCollisionsDatas = soa::Join; using V0DerivedDatas = soa::Join; using V0DerivedMCDatas = soa::Join; using CascDerivedMCDatas = soa::Join; @@ -172,7 +178,7 @@ struct strderivedGenQA { ConfigurableAxis axisTrackProperties{"axisTrackProperties", {32, -0.5, 31.5f}, "Track Properties"}; } AxisConfig; - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; + PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; void init(InitContext const&) { @@ -589,7 +595,7 @@ struct strderivedGenQA { // ______________________________________________________ // Simulated processing // Return the list of indices to the recoed collision associated to a given MC collision. - std::vector getListOfRecoCollIndices(soa::Join const& mcCollisions, soa::Join const& collisions) + std::vector getListOfRecoCollIndices(soa::Join const& mcCollisions, soa::Join const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); for (auto const& mcCollision : mcCollisions) { @@ -612,7 +618,7 @@ struct strderivedGenQA { // ______________________________________________________ // Simulated processing // Fill generated event information (for event loss/splitting estimation) - void fillGeneratedEventProperties(soa::Join const& mcCollisions, soa::Join const& collisions) + void fillGeneratedEventProperties(soa::Join const& mcCollisions, soa::Join const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); for (auto const& mcCollision : mcCollisions) { @@ -1076,7 +1082,7 @@ struct strderivedGenQA { // ______________________________________________________ // Simulated processing (subscribes to MC information too) - void processGenerated(soa::Join const& mcCollisions, soa::Join const& V0MCCores, soa::Join const& CascMCCores, soa::Join const& collisions) + void processGenerated(soa::Join const& mcCollisions, soa::Join const& V0MCCores, soa::Join const& CascMCCores, soa::Join const& collisions) { fillGeneratedEventProperties(mcCollisions, collisions); std::vector listBestCollisionIdx = getListOfRecoCollIndices(mcCollisions, collisions); diff --git a/PWGLF/Tasks/Resonances/higherMassResonances.cxx b/PWGLF/Tasks/Resonances/higherMassResonances.cxx index 0e7e636e4a6..cbcc1409b6f 100644 --- a/PWGLF/Tasks/Resonances/higherMassResonances.cxx +++ b/PWGLF/Tasks/Resonances/higherMassResonances.cxx @@ -13,54 +13,48 @@ /// \brief glueball resonance /// \author Sawan +// #include #include "PWGLF/DataModel/LFStrangenessPIDTables.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/mcCentrality.h" -#include "PWGLF/Utils/inelGt.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" // -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" // #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" // #include "Common/DataModel/PIDResponseTPC.h" // #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" -#include -#include -#include -#include -#include -#include // -#include -#include -#include -#include -#include -#include -#include -#include -#include // - -#include -#include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" // +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/StepTHn.h" +#include "Framework/runDataProcessing.h" // +#include "ReconstructionDataFormats/Track.h" + +#include "Math/GenVector/Boost.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "TF1.h" +#include "TRandom3.h" +#include +#include +#include +#include #include +#include +#include #include -#include -#include #include #include #include -#include #include #include -#include #include #include @@ -71,7 +65,6 @@ using namespace o2::soa; using namespace o2::aod::rctsel; // using namespace o2::constants::physics; using std::array; -// FixME: Add INEL>0 selection for the derived data struct HigherMassResonances { SliceCache cache; @@ -103,43 +96,39 @@ struct HigherMassResonances { Configurable qAv0{"qAv0", false, "qAv0"}; Configurable qAPID{"qAPID", true, "qAPID"}; Configurable qAevents{"qAevents", false, "QA of events"}; - Configurable qAcorrelation2Dhist{"qAcorrelation2Dhist", true, "Lamda K0 mass correlation"}; - Configurable qAOptimisation{"qAOptimisation", false, "QA for optimisation with multiple THnSparse Axes"}; + Configurable correlation2Dhist{"correlation2Dhist", true, "Lamda K0 mass correlation"}; Configurable isApplyDCAv0topv{"isApplyDCAv0topv", false, "DCA V0 to PV"}; Configurable hasTPC{"hasTPC", false, "TPC"}; Configurable isselectTWOKsOnly{"isselectTWOKsOnly", true, "Select only events with two K0s"}; - Configurable isapplyPairRapidityMC{"isapplyPairRapidityMC", false, "Apply pair rapidity cut on reconstructed mother (after already applying rapidity cut on generated mother)"}; + Configurable isapplyPairRapidityRec{"isapplyPairRapidityRec", false, "Apply pair rapidity cut on reconstructed mother (after already applying rapidity cut on generated mother)"}; + Configurable isapplyPairRapidityGen{"isapplyPairRapidityGen", false, "Apply pair rapidity cut on generated mother (before applying rapidity cut on reconstructed mother)"}; Configurable cSelectMultEstimator{"cSelectMultEstimator", 0, "Select multiplicity estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C"}; - // Configurable configOccCut{"configOccCut", 1000, "Occupancy cut"}; - // Configurable isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"}; - // Configurable isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "No collision in time range standard"}; - // Configurable isSel8{"isSel8", false, "Event Selection 8"}; + Configurable configOccCut{"configOccCut", 1000, "Occupancy cut"}; + Configurable isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"}; + Configurable isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "No collision in time range standard"}; + Configurable isSel8{"isSel8", false, "Event Selection 8"}; // Configurables for event selection - Configurable isINELgt0{"isINELgt0", true, "INEL>0 selection"}; + // Configurable isINELgt0{"isINELgt0", true, "INEL>0 selection"}; Configurable isTriggerTVX{"isTriggerTVX", false, "TriggerTVX"}; - // Configurable isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", false, "IsGoodZvtxFT0vsPV"}; - // Configurable isApplyOccCut{"isApplyOccCut", true, "Apply occupancy cut"}; + Configurable isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", false, "IsGoodZvtxFT0vsPV"}; + Configurable isApplyOccCut{"isApplyOccCut", true, "Apply occupancy cut"}; Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; Configurable timFrameEvsel{"timFrameEvsel", true, "TPC Time frame boundary cut"}; - // Configurable isNoSameBunchPileup{"isNoSameBunchPileup", true, "kNoSameBunchPileup"}; + Configurable isNoSameBunchPileup{"isNoSameBunchPileup", true, "kNoSameBunchPileup"}; Configurable isAllLayersGoodITS{"isAllLayersGoodITS", true, "Require all ITS layers to be good"}; Configurable isNoTimeFrameBorder{"isNoTimeFrameBorder", true, "kNoTimeFrameBorder"}; Configurable isNoITSROFrameBorder{"isNoITSROFrameBorder", true, "kNoITSROFrameBorder"}; // Configurable parameters for V0 selection - Configurable confV0PtMin{"confV0PtMin", 0.f, "Minimum transverse momentum of V0"}; - Configurable confV0PtMax{"confV0PtMax", 100.f, "Maximum transverse momentum of V0"}; - Configurable confPiPtMin{"confPiPtMin", 0.1f, "Minimum transverse momentum of pion daughter"}; - Configurable confPiPtMax{"confPiPtMax", 100.f, "Maximum transverse momentum of pion daughter"}; - Configurable cMaxDeltaM{"cMaxDeltaM", 0.01f, "Sqrt((m1-mPDG)^2 + (m2-mPDG)^2) < cMaxDeltaM)"}; Configurable confV0DCADaughMax{"confV0DCADaughMax", 1.0f, "DCA b/w V0 daughters"}; - Configurable v0DCApostoPV{"v0DCApostoPV", 0.06, "DCA Pos To PV"}; - Configurable v0DCAnegtoPV{"v0DCAnegtoPV", 0.06, "DCA Neg To PV"}; + Configurable v0settingDcapostopv{"v0settingDcapostopv", 0.06, "DCA Pos To PV"}; + Configurable v0settingDcanegtopv{"v0settingDcanegtopv", 0.06, "DCA Neg To PV"}; Configurable cMaxV0DCA{"cMaxV0DCA", 0.5, "DCA V0 to PV"}; + Configurable confV0PtMin{"confV0PtMin", 0.f, "Minimum transverse momentum of V0"}; Configurable confV0CPAMin{"confV0CPAMin", 0.97f, "Minimum CPA of V0"}; Configurable confV0TranRadV0Min{"confV0TranRadV0Min", 0.5f, "Minimum transverse radius"}; - // Configurable confV0TranRadV0Max{"confV0TranRadV0Max", 200.f, "Maximum transverse radius"}; + Configurable confV0TranRadV0Max{"confV0TranRadV0Max", 200.f, "Maximum transverse radius"}; Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 15, "Maximum V0 life time"}; Configurable cSigmaMassKs0{"cSigmaMassKs0", 4, "n Sigma cut on Ks0 mass (Mass (Ks) - cSigmaMassKs0*cWidthKs0)"}; Configurable cWidthKs0{"cWidthKs0", 0.005, "Width of KS0"}; @@ -148,23 +137,25 @@ struct HigherMassResonances { Configurable confDaughPIDCutTPC{"confDaughPIDCutTPC", 5, "PID selections for KS0 daughters"}; Configurable confDaughPIDCutTOF{"confDaughPIDCutTOF", 5, "PID selections for KS0 daughters in TOF"}; Configurable confKsrapidity{"confKsrapidity", 0.5f, "Rapidity cut on K0s"}; - // Configurable isStandardV0{"isStandardV0", false, "Standard V0 selection"}; + Configurable angSepCut{"angSepCut", 0.01f, "Angular separation cut"}; + Configurable isapplyAngSepCut{"isapplyAngSepCut", false, "Apply angular separation cut"}; + Configurable isStandardV0{"isStandardV0", false, "Standard V0 selection"}; Configurable isApplyEtaCutK0s{"isApplyEtaCutK0s", false, "Apply eta cut on K0s daughters"}; Configurable cfgETAcut{"cfgETAcut", 0.8f, "Track ETA cut"}; - Configurable deltaRDaugherCut{"deltaRDaugherCut", 0.001f, "DeltaR cut on V0 daughters"}; - Configurable deltaRK0sCut{"deltaRK0sCut", 0.1f, "Apply deltaR cut between two K0s"}; // Configurable for track selection and multiplicity Configurable cfgPTcut{"cfgPTcut", 0.2f, "Track PT cut"}; Configurable cfgNmixedEvents{"cfgNmixedEvents", 5, "Number of mixed events"}; + ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"}; // Configurable for MC - // Configurable isMC{"isMC", false, "Is MC"}; + Configurable isMC{"isMC", false, "Is MC"}; Configurable isallGenCollisions{"isallGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; + Configurable iscTVXEvsel{"iscTVXEvsel", true, "Triggger selection"}; Configurable isavoidsplitrackMC{"isavoidsplitrackMC", false, "avoid split track in MC"}; Configurable isapplyRapidityMC{"isapplyRapidityMC", true, "Apply rapidity cut on generated and reconstructed particles"}; Configurable selectMCparticles{"selectMCparticles", 1, "0: f0(1710), 1: f2(1525), 2: a2(1320), 3: f0(1370), 4: f0(1500), 5: f2(1270)"}; - std::vector pdgCodes = {10331, 335, 115, 10221, 9030221, 225, 313}; + std::vector pdgCodes = {10331, 335, 115, 10221, 9030221, 225}; // output THnSparses Configurable activateHelicityFrame{"activateHelicityFrame", false, "Activate the THnSparse with cosThStar w.r.t. helicity axis"}; @@ -177,20 +168,16 @@ struct HigherMassResonances { // Other cuts on Ks and glueball Configurable isapplyCompetingcut{"isapplyCompetingcut", false, "Competing cascade rejection cut"}; Configurable competingcascrejlambda{"competingcascrejlambda", 0.005, "rejecting competing cascade lambda"}; - // Configurable tpcCrossedrows{"tpcCrossedrows", 70, "TPC crossed rows"}; - // Configurable tpcCrossedrowsOverfcls{"tpcCrossedrowsOverfcls", 0.8, "TPC crossed rows over findable clusters"}; - Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + Configurable tpcCrossedrows{"tpcCrossedrows", 70, "TPC crossed rows"}; + Configurable tpcCrossedrowsOverfcls{"tpcCrossedrowsOverfcls", 0.8, "TPC crossed rows over findable clusters"}; // // Mass and pT axis as configurables - ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"}; + Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; ConfigurableAxis configThnAxisPOL{"configThnAxisPOL", {20, -1.0, 1.0}, "Costheta axis"}; ConfigurableAxis configThnAxisPhi{"configThnAxisPhi", {70, 0.0f, 7.0f}, "Phi axis"}; // 0 to 2pi ConfigurableAxis ksMassBins{"ksMassBins", {200, 0.45f, 0.55f}, "K0s invariant mass axis"}; ConfigurableAxis cGlueMassBins{"cGlueMassBins", {200, 0.9f, 3.0f}, "Glueball invariant mass axis"}; ConfigurableAxis cPtBins{"cPtBins", {200, 0.0f, 20.0f}, "Glueball pT axis"}; - ConfigurableAxis configAxisDeltaM{"configAxisDeltaM", {80, 0.0, 0.08}, "#it{M} (GeV/#it{c}^{2})"}; - ConfigurableAxis configAxisAngleSep{"configAxisAngleSep", {200, 0.0, 2.0}, "Angular separation between V0s"}; - ConfigurableAxis configAxisPtCorr{"configAxisPtCorr", {1000, 0.0, 100.0}, "Pt correlation between two K0s"}; // fixed variables float rapidityMotherData = 0.5; @@ -230,9 +217,6 @@ struct HigherMassResonances { AxisSpec multiplicityAxis = {config.binsCent, "Multiplicity Axis"}; AxisSpec thnAxisPOL{config.configThnAxisPOL, "Configurabel theta axis"}; AxisSpec thnAxisPhi = {config.configThnAxisPhi, "Configurabel phi axis"}; // 0 to 2pi - AxisSpec deltaMAxis = {config.configAxisDeltaM, "#Delta M (GeV/#it{c}^{2})"}; - AxisSpec angleSepAxis = {config.configAxisAngleSep, "Angular separation between V0s"}; - AxisSpec ptCorrAxis = {config.configAxisPtCorr, "Pt correlation between two K0s"}; // THnSparses std::array sparses = {config.activateHelicityFrame, config.activateCollinsSoperFrame, config.activateProductionFrame, config.activateBeamAxisFrame, config.activateRandomFrame}; @@ -278,16 +262,16 @@ struct HigherMassResonances { hCutFlow->GetXaxis()->SetBinLabel(8, "Occupancy Cut"); hCutFlow->GetXaxis()->SetBinLabel(9, "rctChecker"); hCutFlow->GetXaxis()->SetBinLabel(10, "kIsTriggerTVX"); - hCutFlow->GetXaxis()->SetBinLabel(11, "No selection"); + hCutFlow->GetXaxis()->SetBinLabel(11, "kIsGoodZvtxFT0vsPV"); hCutFlow->GetXaxis()->SetBinLabel(12, "IsINELgt0"); - // hCutFlow->GetXaxis()->SetBinLabel(13, "isVertexITSTPC"); - // hCutFlow->GetXaxis()->SetBinLabel(14, "isVertexTOFMatched"); + hCutFlow->GetXaxis()->SetBinLabel(13, "isVertexITSTPC"); + hCutFlow->GetXaxis()->SetBinLabel(14, "isVertexTOFMatched"); std::shared_ptr hv0label = rEventSelection.get(HIST("htrackscheck_v0")); hv0label->GetXaxis()->SetBinLabel(1, "All Tracks"); hv0label->GetXaxis()->SetBinLabel(2, "DCA V0 to PV"); hv0label->GetXaxis()->SetBinLabel(3, "y K0s"); - hv0label->GetXaxis()->SetBinLabel(4, "V0 pT cut"); + hv0label->GetXaxis()->SetBinLabel(4, "Min V0 pT"); hv0label->GetXaxis()->SetBinLabel(5, "Daughter DCA"); hv0label->GetXaxis()->SetBinLabel(6, "CosPA"); hv0label->GetXaxis()->SetBinLabel(7, "Decay Radius"); @@ -303,11 +287,8 @@ struct HigherMassResonances { hv0DauLabel->GetXaxis()->SetBinLabel(4, "TPC CRFC"); hv0DauLabel->GetXaxis()->SetBinLabel(5, "TPC Chi2NCL"); hv0DauLabel->GetXaxis()->SetBinLabel(6, "Charge"); - hv0DauLabel->GetXaxis()->SetBinLabel(7, "Charge"); - hv0DauLabel->GetXaxis()->SetBinLabel(8, "Eta"); - hv0DauLabel->GetXaxis()->SetBinLabel(9, "PID TPC"); - hv0DauLabel->GetXaxis()->SetBinLabel(10, "PID TOF"); - hv0DauLabel->GetXaxis()->SetBinLabel(11, "Pt cut"); + hv0DauLabel->GetXaxis()->SetBinLabel(7, "Eta"); + hv0DauLabel->GetXaxis()->SetBinLabel(8, "PID TPC"); std::shared_ptr hv0labelmcrec = hMChists.get(HIST("events_checkrec")); hv0labelmcrec->GetXaxis()->SetBinLabel(1, "All Tracks"); @@ -333,34 +314,25 @@ struct HigherMassResonances { hv0labelmcgen->GetXaxis()->SetBinLabel(8, "Daughters K0s"); } - if (!config.qAOptimisation) { - hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); - hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); - hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); - } else { - hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, deltaMAxis, angleSepAxis, ptCorrAxis}, true); - hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, deltaMAxis, angleSepAxis, ptCorrAxis}, true); - hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, deltaMAxis, angleSepAxis, ptCorrAxis}, true); - } + hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); + hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); + hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); // K0s topological/PID cuts - if (config.qAcorrelation2Dhist) { + if (config.correlation2Dhist) { rKzeroShort.add("mass_lambda_kshort_before", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); rKzeroShort.add("mass_lambda_kshort_after10", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); } if (config.qAv0) { // Invariant Mass rKzeroShort.add("hMassK0Shortbefore", "hMassK0Shortbefore", kTHnSparseF, {k0ShortMassAxis, ptAxis}); - rKzeroShort.add("hK0ShortMassCorr", "hK0ShortMassCorr", kTHnSparseF, {k0ShortMassAxis, k0ShortMassAxis, deltaMAxis}); - // rKzeroShort.add("hK0ShortMassCorrAfterCut", "hK0ShortMassCorrAfterCut", kTH2F, {k0ShortMassAxis, k0ShortMassAxis}); - rKzeroShort.add("hK0sPtCorrelation", "hK0sPtCorrelation", kTH1F, {{1000, 0.0f, 100.0f}}); + rKzeroShort.add("hMasscorrelationbefore", "hMasscorrelationbefore", kTH2F, {k0ShortMassAxis, k0ShortMassAxis}); rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", kTHnSparseF, {k0ShortMassAxis, ptAxis}); // Topological histograms (after the selection) rKzeroShort.add("hDCAV0Daughters", "DCA between v0 daughters", {HistType::kTH1F, {{60, -3.0f, 3.0f}}}); rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.96f, 1.1f}}}); rKzeroShort.add("hLT", "hLT", {HistType::kTH1F, {{100, 0.0f, 50.0f}}}); rKzeroShort.add("angularSeparation", "Angular distribution between two K0s vs pT", {HistType::kTH1F, {{200, 0.0f, 4.0f}}}); - rKzeroShort.add("hDauDeltaR", "Delta R of positive and negative daughers", {HistType::kTHnSparseF, {angleSepAxis, angleSepAxis}}); } rKzeroShort.add("NksProduced", "Number of K0s produced", kTH1I, {{15, -0.5, 14.5}}); @@ -373,16 +345,11 @@ struct HigherMassResonances { } // For MC - if (doprocessGen || doprocessRec) { - hMChists.add("MCcorrections/hGenNo", "Generated collisions before and after event selection", kTH1F, {{5, 0.0f, 5.0f}}); + if (config.isMC) { hMChists.add("Genf1710", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL}); - hMChists.add("Genf1710Calib", "Calibrated Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL}); hMChists.add("Genf17102", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL}); - hMChists.add("Genf1710Calib2", "Calibrated Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL}); hMChists.add("Recf1710_pt1", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL}); - hMChists.add("Recf1710Calib_pt1", "Calibrated Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL}); hMChists.add("Recf1710_pt2", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL}); - hMChists.add("Recf1710Calib_pt2", "Calibrated Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL}); hMChists.add("h1Recsplit", "Rec p_{T}2", kTH1F, {ptAxis}); hMChists.add("Genf1710_mass", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis}); hMChists.add("Genf1710_mass2", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis}); @@ -401,22 +368,6 @@ struct HigherMassResonances { hMChists.add("Rec_Multiplicity", "Multiplicity in MC", kTH1F, {multiplicityAxis}); hMChists.add("MC_mult_after_event_sel", "Multiplicity in MC", kTH1F, {multiplicityAxis}); } - - if (doprocessEvtLossSigLossMC) { - hMChists.add("MCcorrections/hSignalLossDenominator", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); - hMChists.add("MCcorrections/hSignalLossNumerator", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); - hMChists.add("MCcorrections/MultiplicityRec", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {multiplicityAxis}); - hMChists.add("MCcorrections/MultiplicityGen", "Multiplicity in generated MC", kTH1F, {multiplicityAxis}); - hMChists.add("MCcorrections/hSignalLossDenominator2", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); - hMChists.add("MCcorrections/hSignalLossNumerator2", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); - hMChists.add("MCcorrections/MultiplicityRec2", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {multiplicityAxis}); - hMChists.add("MCcorrections/MultiplicityGen2", "Multiplicity in generated MC", kTH1F, {multiplicityAxis}); - - hMChists.add("MCcorrections/hSignalLossDenominator3", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); - hMChists.add("MCcorrections/hSignalLossDenominator4", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); - hMChists.add("MCcorrections/hSignalLossNumerator3", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); - hMChists.add("MCcorrections/hMultvsCent", "Kstar generated after event selection", kTH2F, {{multiplicityAxis}, {multiplicityAxis}}); - } } template @@ -430,8 +381,8 @@ struct HigherMassResonances { if (fillHist) rEventSelection.fill(HIST("hEventCut"), 1); - // if (config.isSel8 && !collision.sel8()) - // return false; + if (config.isSel8 && !collision.sel8()) + return false; if (fillHist) rEventSelection.fill(HIST("hEventCut"), 2); @@ -445,8 +396,8 @@ struct HigherMassResonances { if (fillHist) rEventSelection.fill(HIST("hEventCut"), 4); - // if (config.isNoSameBunchPileup && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup))) - // return false; + if (config.isNoSameBunchPileup && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup))) + return false; if (fillHist) rEventSelection.fill(HIST("hEventCut"), 5); @@ -458,8 +409,8 @@ struct HigherMassResonances { // if (config.isNoCollInTimeRangeStandard && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))) // return false; - // if (config.isApplyOccCut && (std::abs(collision.trackOccupancyInTimeRange()) > config.configOccCut)) - // return false; + if (config.isApplyOccCut && (std::abs(collision.trackOccupancyInTimeRange()) > config.configOccCut)) + return false; if (fillHist) rEventSelection.fill(HIST("hEventCut"), 7); @@ -473,85 +424,28 @@ struct HigherMassResonances { if (fillHist) rEventSelection.fill(HIST("hEventCut"), 9); - // if (config.isGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) - // return false; - // if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 10); - - if (config.isINELgt0 && !collision.isInelGt0()) { + if (config.isGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) return false; - } if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 11); + rEventSelection.fill(HIST("hEventCut"), 10); - // if (config.isVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + // if (config.isINELgt0 && !collision.isInelGt0()) { // return false; // } // if (fillHist) - // rEventSelection.fill(HIST("hEventCut"), 12); + rEventSelection.fill(HIST("hEventCut"), 11); - // if (config.isVertexTOFMatched && !collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + // if (config.isVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { // return false; // } - // if (fillHist) - // rEventSelection.fill(HIST("hEventCut"), 13); - - return true; - } - - template - bool selectionEventDerived(const Coll& collision, bool fillHist = true) - { if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 0); + rEventSelection.fill(HIST("hEventCut"), 12); - if (std::abs(collision.posZ()) > config.cutzvertex) - return false; - if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 1); - - // if (config.isSel8 && !collision.sel8()) - // return false; - if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 2); - - if (config.isNoTimeFrameBorder && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) - return false; - if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 3); - - if (config.isNoITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) - return false; - if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 4); - - // if (config.isNoSameBunchPileup && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup))) - // return false; - if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 5); - - if (config.isAllLayersGoodITS && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) - return false; - if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 6); - - // if (config.isNoCollInTimeRangeStandard && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))) - // return false; - - // if (config.isApplyOccCut && (std::abs(collision.trackOccupancyInTimeRange()) > config.configOccCut)) - // return false; - if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 7); - - if (rctCut.requireRCTFlagChecker && !rctChecker(collision)) - return false; - if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 8); - - if (config.isTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) + if (config.isVertexTOFMatched && !collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { return false; + } if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 9); + rEventSelection.fill(HIST("hEventCut"), 13); return true; } @@ -577,7 +471,7 @@ struct HigherMassResonances { rKzeroShort.fill(HIST("hDCAV0Daughters"), candidate.dcaV0daughters()); rKzeroShort.fill(HIST("hV0CosPA"), candidate.v0cosPA()); } - if (config.qAcorrelation2Dhist) + if (config.correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_before"), candidate.mK0Short(), candidate.mLambda()); rEventSelection.fill(HIST("htrackscheck_v0"), 0.5); @@ -592,7 +486,7 @@ struct HigherMassResonances { } rEventSelection.fill(HIST("htrackscheck_v0"), 2.5); - if (pT < config.confV0PtMin || pT > config.confV0PtMax) { + if (pT < config.confV0PtMin) { return false; } rEventSelection.fill(HIST("htrackscheck_v0"), 3.5); @@ -612,9 +506,9 @@ struct HigherMassResonances { } rEventSelection.fill(HIST("htrackscheck_v0"), 6.5); - // if (tranRad > config.confV0TranRadV0Max) { - // return false; - // } + if (tranRad > config.confV0TranRadV0Max) { + return false; + } rEventSelection.fill(HIST("htrackscheck_v0"), 7.5); if (std::fabs(ctauK0s) > config.cMaxV0LifeTime) { @@ -627,16 +521,16 @@ struct HigherMassResonances { } rEventSelection.fill(HIST("htrackscheck_v0"), 9.5); - if (config.qAcorrelation2Dhist) + if (config.correlation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after10"), candidate.mK0Short(), candidate.mLambda()); if (config.qAv0) { rKzeroShort.fill(HIST("hMassK0ShortSelected"), candidate.mK0Short(), candidate.pt()); } - // if (config.isStandardV0 && candidate.v0Type() != 1) { - // return false; // Only standard V0s are selected - // } + if (config.isStandardV0 && candidate.v0Type() != 1) { + return false; // Only standard V0s are selected + } rEventSelection.fill(HIST("htrackscheck_v0"), 10.5); if (candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) { @@ -664,12 +558,12 @@ struct HigherMassResonances { return false; rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 1.5); - // if (track.tpcNClsCrossedRows() < config.tpcCrossedrows) - // return false; + if (track.tpcNClsCrossedRows() < config.tpcCrossedrows) + return false; rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 2.5); - // if (track.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls) - // return false; + if (track.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls) + return false; rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 3.5); if (tpcNClsF < config.confDaughTPCnclsMin) { @@ -704,12 +598,6 @@ struct HigherMassResonances { if (std::abs(v0candidate.tofNSigmaK0PiMinus()) > config.confDaughPIDCutTOF && v0candidate.negativeHasTOF()) { return false; } - rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 9.5); - - if (track.pt() < config.confPiPtMin || track.pt() > config.confPiPtMax) { - return false; - } - rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 10.5); if (config.qAPID) { (charge == 1) ? rKzeroShort.fill(HIST("hNSigmaPosPionK0s_after"), track.tpcInnerParam(), track.tpcNSigmaPi()) : rKzeroShort.fill(HIST("hNSigmaNegPionK0s_after"), track.tpcInnerParam(), track.tpcNSigmaPi()); @@ -718,14 +606,7 @@ struct HigherMassResonances { return true; } - double deltaM(double m1, double m2) - { - const double d1 = m1 - o2::constants::physics::MassK0Short; - const double d2 = m2 - o2::constants::physics::MassK0Short; - return std::sqrt(d1 * d1 + d2 * d2); - } - - using EventCandidatesDerivedData = soa::Join; + using EventCandidatesDerivedData = soa::Join; using V0CandidatesDerivedData = soa::Join; // using DauTracks = soa::Join; using DauTracks = soa::Join; @@ -743,16 +624,16 @@ struct HigherMassResonances { return false; } - // if (posTrackExtra.tpcNClsCrossedRows() < config.tpcCrossedrows || negTrackExtra.tpcNClsCrossedRows() < config.tpcCrossedrows) { - // return false; - // } + if (posTrackExtra.tpcNClsCrossedRows() < config.tpcCrossedrows || negTrackExtra.tpcNClsCrossedRows() < config.tpcCrossedrows) { + return false; + } if (posTrackExtra.tpcNClsFound() < config.confDaughTPCnclsMin || negTrackExtra.tpcNClsFound() < config.confDaughTPCnclsMin) { return false; } - // if (posTrackExtra.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls || negTrackExtra.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls) { - // return false; - // } + if (posTrackExtra.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls || negTrackExtra.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls) { + return false; + } // check TPC PID if (((std::abs(posTrackExtra.tpcNSigmaPi()) > config.confDaughPIDCutTPC) || (std::abs(negTrackExtra.tpcNSigmaPi()) > config.confDaughPIDCutTPC))) { @@ -773,17 +654,32 @@ struct HigherMassResonances { return false; } - double deltaRDaugherPos = std::sqrt(TVector2::Phi_mpi_pi(v0.positivephi() - v0.negativephi()) * TVector2::Phi_mpi_pi(v0.positivephi() - v0.negativephi()) + (v0.positiveeta() - v0.negativeeta()) * (v0.positiveeta() - v0.negativeeta())); - double deltaRDaugherNeg = std::sqrt(TVector2::Phi_mpi_pi(v0.positivephi() - v0.negativephi()) * TVector2::Phi_mpi_pi(v0.positivephi() - v0.negativephi()) + (v0.positiveeta() - v0.negativeeta()) * (v0.positiveeta() - v0.negativeeta())); + // rKzeroShort.fill(HIST("negative_pt"), negTrackExtra.pt()); + // rKzeroShort.fill(HIST("positive_pt"), posTrackExtra.pt()); + // rKzeroShort.fill(HIST("negative_eta"), negTrackExtra.eta()); + // rKzeroShort.fill(HIST("positive_eta"), posTrackExtra.eta()); + // rKzeroShort.fill(HIST("negative_phi"), negTrackExtra.phi()); + // rKzeroShort.fill(HIST("positive_phi"), posTrackExtra.phi()); + return true; + } + + // Angular separation cut on KsKs pairs + template + bool applyAngSep(const T1& candidate1, const T2& candidate2) + { + double eta1, eta2, phi1, phi2; + eta1 = candidate1.eta(); + eta2 = candidate2.eta(); + phi1 = candidate1.phi(); + phi2 = candidate2.phi(); + double angle = std::sqrt(std::pow(eta1 - eta2, 2) + std::pow(phi1 - phi2, 2)); if (config.qAv0) { - rKzeroShort.fill(HIST("hDauDeltaR"), deltaRDaugherPos, deltaRDaugherNeg); + rKzeroShort.fill(HIST("angularSeparation"), angle); } - - if (deltaRDaugherPos < config.deltaRDaugherCut || deltaRDaugherNeg < config.deltaRDaugherCut) { + if (config.isapplyAngSepCut && angle > config.angSepCut) { return false; } - return true; } @@ -793,17 +689,16 @@ struct HigherMassResonances { Filter acceptenceFilter = (nabs(aod::track::eta) < config.cfgETAcut && nabs(aod::track::pt) > config.cfgPTcut); // Filters on V0s - Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > config.v0DCApostoPV && nabs(aod::v0data::dcanegtopv) > config.v0DCAnegtoPV); + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > config.v0settingDcapostopv && nabs(aod::v0data::dcanegtopv) > config.v0settingDcanegtopv); // Defining the type of the daughter tracks using EventCandidates = soa::Filtered>; using TrackCandidates = soa::Filtered>; using V0TrackCandidate = soa::Join; // For Monte Carlo - using EventCandidatesMC = soa::Join; + using EventCandidatesMC = soa::Join; using TrackCandidatesMC = soa::Filtered>; using V0TrackCandidatesMC = soa::Filtered>; - using EventMCGenerated = soa::Join; // zBeam direction in lab frame template @@ -1058,6 +953,34 @@ struct HigherMassResonances { continue; } + // if (postrack1.hasTOF()) { + // double nTOFSigmaPos1{postrack1.tofNSigmaPi()}; + // if ((std::abs(nTOFSigmaPos1) > config.confDaughPIDCutTOF)) { + // continue; + // } + // } + + // if (negtrack1.hasTOF()) { + // double nTOFSigmaNeg1{negtrack1.tofNSigmaPi()}; + // if (std::abs(nTOFSigmaNeg1) > config.confDaughPIDCutTOF) { + // continue; + // } + // } + + // if (postrack2.hasTOF()) { + // double nTOFSigmaPos2{postrack2.tofNSigmaPi()}; + // if ((std::abs(nTOFSigmaPos2) > config.confDaughPIDCutTOF)) { + // continue; + // } + // } + + // if (negtrack2.hasTOF()) { + // double nTOFSigmaNeg2{negtrack2.tofNSigmaPi()}; + // if (std::abs(nTOFSigmaNeg2) > config.confDaughPIDCutTOF) { + // continue; + // } + // } + if (std::find(v0indexes.begin(), v0indexes.end(), v1.globalIndex()) == v0indexes.end()) { v0indexes.push_back(v1.globalIndex()); } @@ -1073,14 +996,7 @@ struct HigherMassResonances { continue; } - double deltaRDaugherPos = std::sqrt(TVector2::Phi_mpi_pi(postrack1.phi() - negtrack1.phi()) * TVector2::Phi_mpi_pi(postrack1.phi() - negtrack1.phi()) + (postrack1.eta() - negtrack1.eta()) * (postrack1.eta() - negtrack1.eta())); - double deltaRDaugherNeg = std::sqrt(TVector2::Phi_mpi_pi(postrack2.phi() - negtrack2.phi()) * TVector2::Phi_mpi_pi(postrack2.phi() - negtrack2.phi()) + (postrack2.eta() - negtrack2.eta()) * (postrack2.eta() - negtrack2.eta())); - - if (config.qAv0) { - rKzeroShort.fill(HIST("hDauDeltaR"), deltaRDaugherPos, deltaRDaugherNeg); - } - - if (deltaRDaugherPos < config.deltaRDaugherCut || deltaRDaugherNeg < config.deltaRDaugherCut) { + if (!applyAngSep(v1, v2)) { continue; } @@ -1088,6 +1004,9 @@ struct HigherMassResonances { continue; } + if (config.qAv0) { + rKzeroShort.fill(HIST("hMasscorrelationbefore"), v1.mK0Short(), v2.mK0Short()); + } allConditionsMet = 1; daughter1 = ROOT::Math::PxPyPzMVector(v1.px(), v1.py(), v1.pz(), o2::constants::physics::MassK0Short); // Kshort daughter2 = ROOT::Math::PxPyPzMVector(v2.px(), v2.py(), v2.pz(), o2::constants::physics::MassK0Short); // Kshort @@ -1095,58 +1014,8 @@ struct HigherMassResonances { mother = daughter1 + daughter2; // invariant mass of Kshort pair isMix = false; - const double deltaMass = deltaM(v1.mK0Short(), v2.mK0Short()); - if (config.qAv0) { - rKzeroShort.fill(HIST("hK0ShortMassCorr"), v1.mK0Short(), v2.mK0Short(), deltaMass); - } - - if (!config.qAOptimisation) { - if (deltaMass > config.cMaxDeltaM) { - continue; - } - } - - // if (config.qAv0) { - // rKzeroShort.fill(HIST("hK0ShortMassCorrAfterCut"), v1.mK0Short(), v2.mK0Short()); - // } - - const double ptCorr = (mother.Pt() - daughter1.Pt() != 0.) ? daughter1.Pt() / (mother.Pt() - daughter1.Pt()) : 0.; - if (config.qAv0) { - rKzeroShort.fill(HIST("hK0sPtCorrelation"), ptCorr); - } - - double deltaRvalue = std::sqrt(TVector2::Phi_mpi_pi(v1.phi() - v2.phi()) * TVector2::Phi_mpi_pi(v1.phi() - v2.phi()) + (v1.eta() - v2.eta()) * (v1.eta() - v2.eta())); - - if (!config.qAOptimisation) { - if (deltaRvalue < config.deltaRK0sCut) { - continue; - } - } - - if (!config.isselectTWOKsOnly && !config.qAOptimisation) { + if (!config.isselectTWOKsOnly) fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); - } - - if (!config.isselectTWOKsOnly && config.qAOptimisation) { - - if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, mother.Pt(), mother.M(), deltaMass, deltaRvalue, ptCorr); - } - - for (int i = 0; i < config.cRotations; i++) { - double theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut); - - daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); - - motherRot = daughterRot + daughter2; - - // double pTcorrRot = std::abs(daughterRot.Pt() + daughter2.Pt()) / motherRot.Pt(); - double pTcorrRot = (motherRot.Pt() - daughterRot.Pt() != 0.) ? daughterRot.Pt() / (motherRot.Pt() - daughterRot.Pt()) : 0.; - - if (motherRot.Rapidity() < config.rapidityMotherData) - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), deltaMass, deltaRvalue, pTcorrRot); - } - } } int sizeofv0indexes = v0indexes.size(); rKzeroShort.fill(HIST("NksProduced"), sizeofv0indexes); @@ -1232,42 +1101,12 @@ struct HigherMassResonances { continue; } - double deltaRDaugherPos = std::sqrt(TVector2::Phi_mpi_pi(postrack1.phi() - negtrack1.phi()) * TVector2::Phi_mpi_pi(postrack1.phi() - negtrack1.phi()) + (postrack1.eta() - negtrack1.eta()) * (postrack1.eta() - negtrack1.eta())); - double deltaRDaugherNeg = std::sqrt(TVector2::Phi_mpi_pi(postrack2.phi() - negtrack2.phi()) * TVector2::Phi_mpi_pi(postrack2.phi() - negtrack2.phi()) + (postrack2.eta() - negtrack2.eta()) * (postrack2.eta() - negtrack2.eta())); - - if (deltaRDaugherPos < config.deltaRDaugherCut || deltaRDaugherNeg < config.deltaRDaugherCut) { - continue; - } - - if (config.isApplyEtaCutK0s && (t1.eta() < config.confDaughEta || t2.eta() < config.confDaughEta)) { - continue; - } - daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassK0Short); // Kshort daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), o2::constants::physics::MassK0Short); // Kshort mother = daughter1 + daughter2; // invariant mass of Kshort pair - const double deltaMass = deltaM(t1.mK0Short(), t2.mK0Short()); - - if (!config.qAOptimisation) { - if (deltaMass > config.cMaxDeltaM) { - continue; - } - } - isMix = true; - if (!config.qAOptimisation) - fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); - - if (config.qAOptimisation) { - double deltaRvalue = std::sqrt(TVector2::Phi_mpi_pi(daughter1.phi() - daughter2.phi()) * TVector2::Phi_mpi_pi(daughter1.phi() - daughter2.phi()) + (daughter1.eta() - daughter2.eta()) * (daughter1.eta() - daughter2.eta())); - const double deltaMass = deltaM(t1.mK0Short(), t2.mK0Short()); - // const double ptCorr = std::abs(daughter1.Pt() + daughter2.Pt()) / mother.Pt(); - const double ptCorr = (mother.Pt() - daughter1.Pt() != 0.) ? daughter1.Pt() / (mother.Pt() - daughter1.Pt()) : 0.; - if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { - hglue.fill(HIST("h3glueInvMassME"), multiplicity, mother.Pt(), mother.M(), deltaMass, deltaRvalue, ptCorr); - } - } + fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); } } }; @@ -1289,32 +1128,19 @@ struct HigherMassResonances { std::vector passKs; ROOT::Math::PxPyPzMVector lResonanceGen1; ROOT::Math::PxPyPzEVector lResonanceGen; - Service pdgDB; - // void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) - void processGen(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) + void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { - // if (config.isMC == false) { - // return; - // } - hMChists.fill(HIST("events_check"), 0.5); - - bool isINELgt0true = false; - - if (pwglf::isINELgtNmc(mcParticles, 0, pdgDB)) { - isINELgt0true = true; - } - if (config.isINELgt0 && !isINELgt0true) { + if (config.isMC == false) { return; } + hMChists.fill(HIST("events_check"), 0.5); std::vector selectedEvents(collisions.size()); int nevts = 0; multiplicityGen = -999.0; for (const auto& collision : collisions) { - hMChists.fill(HIST("MCcorrections/hGenNo"), 0.5); - // multiplicityGen = collision.centFT0M(); if (config.cSelectMultEstimator == kFT0M) { multiplicityGen = collision.centFT0M(); @@ -1332,7 +1158,7 @@ struct HigherMassResonances { continue; } - selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); } selectedEvents.resize(nevts); hMChists.fill(HIST("events_check"), 1.5); @@ -1342,10 +1168,6 @@ struct HigherMassResonances { return; } hMChists.fill(HIST("events_check"), 2.5); - hMChists.fill(HIST("MCcorrections/hGenNo"), 1.5); - - double genMultiplicity = mcCollision.centFT0M(); - for (const auto& mcParticle : mcParticles) { if (std::abs(mcParticle.pdgCode()) != config.pdgCodes[config.selectMCparticles]) // f2(1525), f0(1710) @@ -1396,18 +1218,16 @@ struct HigherMassResonances { auto helicityGen1 = lResonanceGen1.Vect().Dot(fourVecDauCM1.Vect()) / (std::sqrt(fourVecDauCM1.Vect().Mag2()) * std::sqrt(lResonanceGen1.Vect().Mag2())); hMChists.fill(HIST("Genf1710"), multiplicityGen, lResonanceGen.pt(), helicityGen); - hMChists.fill(HIST("Genf1710Calib"), genMultiplicity, lResonanceGen.pt(), helicityGen); hMChists.fill(HIST("Genf1710_mass"), lResonanceGen.M()); hMChists.fill(HIST("GenRapidity"), mcParticle.y()); hMChists.fill(HIST("GenEta"), mcParticle.eta()); hMChists.fill(HIST("GenPhi"), mcParticle.phi()); - if (config.isapplyPairRapidityMC && std::abs(lResonanceGen1.Rapidity()) >= config.rapidityMotherData) { + if (config.isapplyPairRapidityGen && std::abs(lResonanceGen1.Rapidity()) >= config.rapidityMotherData) { continue; } hMChists.fill(HIST("Genf17102"), multiplicityGen, lResonanceGen1.pt(), helicityGen1); - hMChists.fill(HIST("Genf1710Calib2"), genMultiplicity, lResonanceGen1.pt(), helicityGen1); hMChists.fill(HIST("Genf1710_mass2"), lResonanceGen1.M()); hMChists.fill(HIST("GenRapidity2"), lResonanceGen1.Rapidity()); hMChists.fill(HIST("GenEta2"), lResonanceGen1.Eta()); @@ -1418,121 +1238,14 @@ struct HigherMassResonances { } PROCESS_SWITCH(HigherMassResonances, processGen, "Process Generated", false); - void processEvtLossSigLossMC(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& recCollisions) - { - // auto multiplicityRec = -1; - bool isSelectedEvent = false; - auto multiplicity1 = -999.; - const int multMC = mcCollision.multMCNParticlesEta05(); - - for (const auto& RecCollision : recCollisions) { - if (!RecCollision.has_mcCollision()) - continue; - if (!selectionEvent(RecCollision, false)) // don't fill event cut histogram - continue; - - // const auto& mcCollisionRec = RecCollision.mcCollision_as(); - // multiplicityRec = mcCollisionRec.centFT0M(); - - if (config.cSelectMultEstimator == kFT0M) { - multiplicity1 = RecCollision.centFT0M(); - } else if (config.cSelectMultEstimator == kFT0A) { - multiplicity1 = RecCollision.centFT0A(); - } else if (config.cSelectMultEstimator == kFT0C) { - multiplicity1 = RecCollision.centFT0C(); - } else if (config.cSelectMultEstimator == kFV0A) { - multiplicity1 = RecCollision.centFV0A(); - } else { - multiplicity1 = RecCollision.centFT0M(); // default - } - - isSelectedEvent = true; - } - - bool isINELgt0true = false; - - if (pwglf::isINELgtNmc(mcParticles, 0, pdgDB)) { - isINELgt0true = true; - } - if (config.isINELgt0 && !isINELgt0true) { - return; - } - - if (std::abs(mcCollision.posZ()) > config.cutzvertex) { - return; - } - - auto multiplicityGen = -1; - multiplicityGen = mcCollision.centFT0M(); - hMChists.fill(HIST("MCcorrections/MultiplicityGen"), multiplicityGen); - hMChists.fill(HIST("MCcorrections/MultiplicityGen2"), multiplicity1); - hMChists.fill(HIST("MCcorrections/hMultvsCent"), multiplicity1, multMC); - - // Event loss - if (isSelectedEvent) { - hMChists.fill(HIST("MCcorrections/MultiplicityRec"), multiplicityGen); - hMChists.fill(HIST("MCcorrections/MultiplicityRec2"), multiplicity1); - } - - // Generated MC - for (const auto& mcPart : mcParticles) { - if (std::abs(mcPart.y()) >= config.rapidityMotherData || std::abs(mcPart.pdgCode()) != config.pdgCodes[config.selectMCparticles]) - continue; - - hMChists.fill(HIST("MCcorrections/hSignalLossDenominator"), mcPart.pt(), multiplicityGen); - hMChists.fill(HIST("MCcorrections/hSignalLossDenominator2"), mcPart.pt(), multiplicity1); - hMChists.fill(HIST("MCcorrections/hSignalLossDenominator3"), mcPart.pt(), multMC); - if (isSelectedEvent) { - hMChists.fill(HIST("MCcorrections/hSignalLossNumerator"), mcPart.pt(), multiplicityGen); - hMChists.fill(HIST("MCcorrections/hSignalLossNumerator2"), mcPart.pt(), multiplicity1); - hMChists.fill(HIST("MCcorrections/hSignalLossNumerator3"), mcPart.pt(), multMC); - } - - auto kDaughters = mcPart.daughters_as(); - if (kDaughters.size() != config.noOfDaughters) { - continue; - } - - for (const auto& kCurrentDaughter : kDaughters) { - // int daupdg = std::abs(kCurrentDaughter.pdgCode()); - - // if (!kCurrentDaughter.isPhysicalPrimary()) { - // continue; - // } - if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kK0Short) { - passKs.push_back(true); - if (passKs.size() == 1) { - daughter1 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassK0Short); - } else if (static_cast(passKs.size()) == config.noOfDaughters) { - daughter2 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassK0Short); - } - } - } - if (static_cast(passKs.size()) == config.noOfDaughters) { - lResonanceGen1 = daughter1 + daughter2; - hMChists.fill(HIST("MCcorrections/hSignalLossDenominator4"), lResonanceGen1.pt(), multiplicity1); - } - passKs.clear(); - } // end loop on gen particles - } - PROCESS_SWITCH(HigherMassResonances, processEvtLossSigLossMC, "Process Signal Loss, Event Loss", false); - int eventCounter = 0; std::vector gindex1, gindex2; - void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const&, V0TrackCandidatesMC const& V0s, aod::McParticles const&, EventMCGenerated const&) + void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const&, V0TrackCandidatesMC const& V0s, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) { - // if (config.isMC == false) { - // return; - // } - if (!collision.has_mcCollision()) { + if (config.isMC == false) { return; } - double multiplicityRec = -1.0; - // multiplicityRec = collision.mcCollision_as().centFT0M(); - const auto& mcCollisionRec = collision.mcCollision_as(); - multiplicityRec = mcCollisionRec.centFT0M(); - auto multiplicity = -999.0; if (config.cSelectMultEstimator == kFT0M) { multiplicity = collision.centFT0M(); @@ -1550,7 +1263,10 @@ struct HigherMassResonances { return; } hMChists.fill(HIST("Rec_Multiplicity"), multiplicity); - rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); + + if (!collision.has_mcCollision()) { + return; + } hMChists.fill(HIST("MC_mult_after_event_sel"), multiplicity); eventCounter++; @@ -1678,23 +1394,16 @@ struct HigherMassResonances { auto helicityRec2 = mother1.Vect().Dot(fourVecDauCM1.Vect()) / (std::sqrt(fourVecDauCM1.Vect().Mag2()) * std::sqrt(mother1.Vect().Mag2())); - // const double deltaMassRec = deltaM(mctrackv01.mK0Short(), mctrackv02.mK0Short()); - // if (deltaMassRec > config.cMaxDeltaM) { - // continue; - // } - hMChists.fill(HIST("Recf1710_pt1"), multiplicity, mothertrack1.pt(), mother1.M(), helicityRec2); - hMChists.fill(HIST("Recf1710Calib_pt1"), multiplicityRec, mothertrack1.pt(), mother1.M(), helicityRec2); hMChists.fill(HIST("RecRapidity"), mothertrack1.y()); hMChists.fill(HIST("RecPhi"), mothertrack1.phi()); hMChists.fill(HIST("RecEta"), mothertrack1.eta()); - if (config.isapplyPairRapidityMC && std::abs(mother.Rapidity()) >= config.rapidityMotherData) { + if (config.isapplyPairRapidityRec && std::abs(mother.Rapidity()) >= config.rapidityMotherData) { continue; } hMChists.fill(HIST("Recf1710_pt2"), multiplicity, mother.Pt(), mother.M(), helicityRec); - hMChists.fill(HIST("Recf1710Calib_pt2"), multiplicityRec, mother.Pt(), mother.M(), helicityRec); hMChists.fill(HIST("RecRapidity2"), mother.Rapidity()); hMChists.fill(HIST("RecPhi2"), mother.Phi()); hMChists.fill(HIST("RecEta2"), mother.Eta()); @@ -1722,7 +1431,7 @@ struct HigherMassResonances { multiplicity = collision.centFT0M(); // default } - if (!selectionEventDerived(collision, true)) { + if (!selectionEvent(collision, true)) { return; } @@ -1759,60 +1468,22 @@ struct HigherMassResonances { continue; } - allConditionsMet = 1; - daughter1 = ROOT::Math::PxPyPzMVector(v1.px(), v1.py(), v1.pz(), o2::constants::physics::MassK0Short); // Kshort - daughter2 = ROOT::Math::PxPyPzMVector(v2.px(), v2.py(), v2.pz(), o2::constants::physics::MassK0Short); // Kshort - - mother = daughter1 + daughter2; // invariant mass of Kshort pair - isMix = false; - - const double deltaMass = deltaM(v1.mK0Short(), v2.mK0Short()); - if (config.qAv0) { - rKzeroShort.fill(HIST("hK0ShortMassCorr"), v1.mK0Short(), v2.mK0Short(), deltaMass); - } - - if (deltaMass > config.cMaxDeltaM) { + if (!applyAngSep(v1, v2)) { continue; } - // if (config.qAv0) { - // rKzeroShort.fill(HIST("hK0ShortMassCorrAfterCut"), v1.mK0Short(), v2.mK0Short()); - // } - - const double ptCorr = (mother.Pt() - daughter1.Pt() != 0.) ? daughter1.Pt() / (mother.Pt() - daughter1.Pt()) : 0.; if (config.qAv0) { - rKzeroShort.fill(HIST("hK0sPtCorrelation"), ptCorr); + rKzeroShort.fill(HIST("hMasscorrelationbefore"), v1.mK0Short(), v2.mK0Short()); } + allConditionsMet = 1; + daughter1 = ROOT::Math::PxPyPzMVector(v1.px(), v1.py(), v1.pz(), o2::constants::physics::MassK0Short); // Kshort + daughter2 = ROOT::Math::PxPyPzMVector(v2.px(), v2.py(), v2.pz(), o2::constants::physics::MassK0Short); // Kshort - double deltaRvalue = std::sqrt(TVector2::Phi_mpi_pi(v1.phi() - v2.phi()) * TVector2::Phi_mpi_pi(v1.phi() - v2.phi()) + (v1.eta() - v2.eta()) * (v1.eta() - v2.eta())); - - if (!config.qAOptimisation) { - if (deltaRvalue < config.deltaRK0sCut) { - continue; - } - } + mother = daughter1 + daughter2; // invariant mass of Kshort pair + isMix = false; - if (!config.isselectTWOKsOnly && !config.qAOptimisation) + if (!config.isselectTWOKsOnly) fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); - - if (!config.isselectTWOKsOnly && config.qAOptimisation) { - - if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { - hglue.fill(HIST("h3glueInvMassDS"), multiplicity, mother.Pt(), mother.M(), deltaMass, deltaRvalue, ptCorr); - } - - for (int i = 0; i < config.cRotations; i++) { - double theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut); - - daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); - - motherRot = daughterRot + daughter2; - // double pTcorrRot = std::abs(daughterRot.Pt() + daughter2.Pt()) / motherRot.Pt(); - double pTcorrRot = (motherRot.Pt() - daughterRot.Pt() != 0.) ? daughterRot.Pt() / (motherRot.Pt() - daughterRot.Pt()) : 0.; - if (motherRot.Rapidity() < config.rapidityMotherData) - hglue.fill(HIST("h3glueInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), deltaMass, deltaRvalue, pTcorrRot); - } - } } int sizeofv0indexes = v0indexes.size(); rKzeroShort.fill(HIST("NksProduced"), sizeofv0indexes); @@ -1832,7 +1503,7 @@ struct HigherMassResonances { multiplicity = 0.0; multiplicity = c1.centFT0M(); - if (!selectionEventDerived(c1, false) || !selectionEventDerived(c2, false)) { + if (!selectionEvent(c1, false) || !selectionEvent(c2, false)) { continue; } @@ -1853,35 +1524,12 @@ struct HigherMassResonances { continue; } - if (config.isApplyEtaCutK0s && (t1.eta() < config.confDaughEta || t2.eta() < config.confDaughEta)) { - continue; - } - daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassK0Short); // Kshort daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), o2::constants::physics::MassK0Short); // Kshort mother = daughter1 + daughter2; // invariant mass of Kshort pair - const double deltaMass = deltaM(t1.mK0Short(), t2.mK0Short()); - - if (!config.qAOptimisation) { - if (deltaMass > config.cMaxDeltaM) { - continue; - } - } - isMix = true; - if (!config.qAOptimisation) - fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); - - if (config.qAOptimisation) { - double deltaRvalue = std::sqrt(TVector2::Phi_mpi_pi(daughter1.phi() - daughter2.phi()) * TVector2::Phi_mpi_pi(daughter1.phi() - daughter2.phi()) + (daughter1.eta() - daughter2.eta()) * (daughter1.eta() - daughter2.eta())); - const double deltaMass = deltaM(t1.mK0Short(), t2.mK0Short()); - // const double ptCorr = std::abs(daughter1.Pt() + daughter2.Pt()) / mother.Pt(); - const double ptCorr = (mother.Pt() - daughter1.Pt() != 0.) ? daughter1.Pt() / (mother.Pt() - daughter1.Pt()) : 0.; - if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { - hglue.fill(HIST("h3glueInvMassME"), multiplicity, mother.Pt(), mother.M(), deltaMass, deltaRvalue, ptCorr); - } - } + fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); } } } diff --git a/PWGLF/Tasks/Resonances/k892hadronphoton.cxx b/PWGLF/Tasks/Resonances/k892hadronphoton.cxx index 875e9f3379b..e4fbc8c83f8 100644 --- a/PWGLF/Tasks/Resonances/k892hadronphoton.cxx +++ b/PWGLF/Tasks/Resonances/k892hadronphoton.cxx @@ -78,7 +78,7 @@ struct k892hadronphoton { //__________________________________________________ // For manual sliceBy // SliceCache cache; - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; + PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -1241,18 +1241,18 @@ struct k892hadronphoton { } } - void processRealData(soa::Join const& collisions, KStars const& fullKStars) + void processRealData(soa::Join const& collisions, KStars const& fullKStars) { analyzeRecoeKStars(collisions, fullKStars); } - void processMonteCarlo(soa::Join const& collisions, MCKStars const& fullKStars) + void processMonteCarlo(soa::Join const& collisions, MCKStars const& fullKStars) { analyzeRecoeKStars(collisions, fullKStars); } // Simulated processing in Run 3 - void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& KStarGens) + void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& KStarGens) { analyzeGenerated(mcCollisions, collisions, KStarGens); } diff --git a/PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx index 0beb0bd3a46..93e3aafbb6b 100644 --- a/PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedcascadeanalysis.cxx @@ -252,7 +252,7 @@ struct Derivedcascadeanalysis { // For manual sliceBy // Preslice> perMcCollision = aod::v0data::straMCCollisionId; - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; + PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; PresliceUnsorted> perMcCollisionRun2 = aod::v0data::straMCCollisionId; void init(InitContext const&) @@ -1622,7 +1622,7 @@ struct Derivedcascadeanalysis { return listBestCollisionIdx; } - void processCascades(soa::Join::iterator const& coll, soa::Join const& Cascades, DauTracks const&) + void processCascades(soa::Join::iterator const& coll, soa::Join const& Cascades, DauTracks const&) { analyseCascades(coll, Cascades); } @@ -1631,7 +1631,7 @@ struct Derivedcascadeanalysis { analyseCascades(coll, Cascades); } - void processCascadesMCrec(soa::Join::iterator const& coll, CascMCCandidates const& Cascades, DauTracks const&, soa::Join const&) + void processCascadesMCrec(soa::Join::iterator const& coll, CascMCCandidates const& Cascades, DauTracks const&, soa::Join const&) { analyseCascades(coll, Cascades); } @@ -1640,7 +1640,7 @@ struct Derivedcascadeanalysis { analyseCascades(coll, Cascades); } - void processCascadesMCforEff(soa::Join const& mcCollisions, soa::Join const& Cascades, soa::Join const& collisions) + void processCascadesMCforEff(soa::Join const& mcCollisions, soa::Join const& Cascades, soa::Join const& collisions) { analyseCascadesMCforEff(mcCollisions, Cascades, collisions); } diff --git a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx index bb4241a513e..1d293c9c620 100644 --- a/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedlambdakzeroanalysis.cxx @@ -384,7 +384,7 @@ struct derivedlambdakzeroanalysis { // For manual sliceBy // Preslice> perMcCollision = aod::v0data::straMCCollisionId; - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; + PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; PresliceUnsorted> perMcCollisionRun2 = aod::v0data::straMCCollisionId; enum Selection : uint64_t { selCosPA = 0, @@ -3140,7 +3140,7 @@ struct derivedlambdakzeroanalysis { // ______________________________________________________ // Real data processing in Run 3 - no MC subscription - void processRealDataRun3(soa::Join::iterator const& collision, V0Candidates const& fullV0s, DauTracks const&) + void processRealDataRun3(soa::Join::iterator const& collision, V0Candidates const& fullV0s, DauTracks const&) { analyzeRecoedV0sInRealData(collision, fullV0s); } @@ -3154,7 +3154,7 @@ struct derivedlambdakzeroanalysis { // ______________________________________________________ // Simulated processing in Run 3 (subscribes to MC information too) - void processMonteCarloRun3(soa::Join::iterator const& collision, V0McCandidates const& fullV0s, DauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&) + void processMonteCarloRun3(soa::Join::iterator const& collision, V0McCandidates const& fullV0s, DauTracks const&, aod::MotherMCParts const&, soa::Join const& /*mccollisions*/, soa::Join const&) { analyzeRecoedV0sInMonteCarlo(collision, fullV0s); } @@ -3168,7 +3168,7 @@ struct derivedlambdakzeroanalysis { // ______________________________________________________ // Simulated processing in Run 3 (subscribes to MC information too) - void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& V0MCCores, soa::Join const& CascMCCores, soa::Join const& collisions) + void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& V0MCCores, soa::Join const& CascMCCores, soa::Join const& collisions) { analyzeGeneratedV0s(mcCollisions, V0MCCores, CascMCCores, collisions); } diff --git a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx index 766593fd89f..c20c6ddcead 100644 --- a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx @@ -18,39 +18,31 @@ #include "PWGLF/Utils/strangenessMasks.h" #include "PWGUD/Core/SGSelector.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/StaticFor.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include +#include #include -#include - -#include +#include #include -#include #include #include -#include -#include -#include #include #include -#include #include using namespace o2; @@ -84,6 +76,7 @@ using V0MCCoresFull = soa::Join; struct Derivedupcanalysis { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // master analysis switches Configurable analyseK0Short{"analyseK0Short", true, "process K0Short-like candidates"}; Configurable analyseLambda{"analyseLambda", true, "process Lambda-like candidates"}; @@ -166,27 +159,6 @@ struct Derivedupcanalysis { } casccuts; Configurable doBachelorBaryonCut{"doBachelorBaryonCut", false, "Enable Bachelor-Baryon cut "}; static constexpr float kNCtauCutsCasc[1][2] = {{6., 6.}}; - static constexpr int kDetectPropQABase = 1; - static constexpr int kDetectPropQAWithMass = 2; - static constexpr int kK0ShortPartID = 0; - static constexpr int kLambdaPartID = 1; - static constexpr int kAntiLambdaPartID = 2; - static constexpr int kFirstCascadePartID = 3; - static constexpr int kXiPartID = 3; - static constexpr int kAntiXiPartID = 4; - static constexpr int kOmegaPartID = 5; - static constexpr int kAntiOmegaPartID = 6; - static constexpr float kNoPidNsigmaCut = 1e5f; - static constexpr float kDefaultInvalidRapidity = 1e6f; - static constexpr float kDefaultInvalidCtau = 1e6f; - static constexpr float kDisabledArmenterosCut = 1e-4f; - static constexpr float kMotherRapidityMax = 0.5f; - static constexpr float kMissingSignal = -999.f; - static constexpr float kMissingSignalThreshold = 998.f; - static constexpr float kInvalidZdcTime = -12.f; - static constexpr float kMissingZdcTime = -11.f; - static constexpr float kInvalidFITTime = -42.f; - static constexpr float kMissingFITTime = -41.f; Configurable> nCtauCutCasc{"nCtauCutCasc", {kNCtauCutsCasc[0], 2, {"lifetimecutXi", "lifetimecutOmega"}}, "nCtauCutCasc"}; // UPC selections @@ -196,18 +168,6 @@ struct Derivedupcanalysis { Configurable ft0a{"ft0a", 100., "FT0A threshold"}; Configurable ft0c{"ft0c", 50., "FT0C threshold"}; Configurable zdc{"zdc", 1., "ZDC threshold"}; - Configurable fddaTimeCut{"fddaTimeCut", -1., "FDDA timing cut (ns); negative: no cut"}; - Configurable requireFDDATiming{"requireFDDATiming", true, "require valid FDDA timing for gap-side selection when fddaTimeCut is enabled"}; - Configurable fddcTimeCut{"fddcTimeCut", -1., "FDDC timing cut (ns); negative: no cut"}; - Configurable requireFDDCTiming{"requireFDDCTiming", true, "require valid FDDC timing for gap-side selection when fddcTimeCut is enabled"}; - Configurable fv0aTimeCut{"fv0aTimeCut", -1., "FV0A timing cut (ns); negative: no cut"}; - Configurable requireFV0ATiming{"requireFV0ATiming", true, "require valid FV0A timing for gap-side selection when fv0aTimeCut is enabled"}; - Configurable ft0aTimeCut{"ft0aTimeCut", -1., "FT0A timing cut (ns); negative: no cut"}; - Configurable requireFT0ATiming{"requireFT0ATiming", true, "require valid FT0A timing for gap-side selection when ft0aTimeCut is enabled"}; - Configurable ft0cTimeCut{"ft0cTimeCut", -1., "FT0C timing cut (ns); negative: no cut"}; - Configurable requireFT0CTiming{"requireFT0CTiming", true, "require valid FT0C timing for gap-side selection when ft0cTimeCut is enabled"}; - Configurable zdcTimeCut{"zdcTimeCut", 2., "ZDC timing cut (ns)"}; - Configurable requireZDCTiming{"requireZDCTiming", true, "require valid ZDC timing for gap-side selection"}; Configurable genGapSide{"genGapSide", 0, "0 -- A, 1 -- C, 2 -- double"}; } upcCuts; @@ -253,8 +213,6 @@ struct Derivedupcanalysis { ConfigurableAxis axisFDDCampl{"axisFDDCampl", {100, 0.0f, 2000.0f}, "FDDCamplitude"}; ConfigurableAxis axisZNAampl{"axisZNAampl", {100, 0.0f, 250.0f}, "ZNAamplitude"}; ConfigurableAxis axisZNCampl{"axisZNCampl", {100, 0.0f, 250.0f}, "ZNCamplitude"}; - ConfigurableAxis axisFitTime{"axisFitTime", {166, -42.5f, 40.5f}, "FIT time (ns)"}; - ConfigurableAxis axisZdcTime{"axisZdcTime", {110, -12.5f, 10.0f}, "ZDC time (ns)"}; } axisDetectors; // for MC @@ -263,7 +221,6 @@ struct Derivedupcanalysis { Configurable calculateFeeddownMatrix{"calculateFeeddownMatrix", true, "fill feeddown matrix if MC"}; ConfigurableAxis axisGeneratorIds{"axisGeneratorIds", {256, -0.5f, 255.5f}, "axis for generatorIds"}; Configurable checkNeutronsInMC{"checkNeutronsInMC", true, "require no neutrons for single-gap in MC"}; - Configurable requireGeneratedZDCNeutrons{"requireGeneratedZDCNeutrons", false, "require generated ZDC neutron topology in processGenerated"}; Configurable neutronEtaCut{"neutronEtaCut", 8.8, "ZN acceptance"}; // Occupancy cut @@ -311,7 +268,7 @@ struct Derivedupcanalysis { ConfigurableAxis axisOccupancy{"axisOccupancy", {VARIABLE_WIDTH, 0.0f, 250.0f, 500.0f, 750.0f, 1000.0f, 1500.0f, 2000.0f, 3000.0f, 4500.0f, 6000.0f, 8000.0f, 10000.0f, 50000.0f}, "Occupancy"}; // UPC axes - ConfigurableAxis axisSelGap{"axisSelGap", {7, -1.5, 5.5}, "Gap side"}; + ConfigurableAxis axisSelGap{"axisSelGap", {4, -1.5, 2.5}, "Gap side"}; // AP plot axes ConfigurableAxis axisAPAlpha{"axisAPAlpha", {220, -1.1f, 1.1f}, "V0 AP alpha"}; @@ -351,7 +308,7 @@ struct Derivedupcanalysis { template void addTopoHistograms(HistogramRegistry& histos) { - const bool isCascade = partID >= kFirstCascadePartID; + const bool isCascade = (partID > 2.5) ? true : false; if (isCascade) { histos.add(Form("%s/hCascCosPA", kParticlenames[partID].data()), "hCascCosPA", kTH2F, {axisPtCoarse, {100, 0.9f, 1.0f}}); histos.add(Form("%s/hDCACascDaughters", kParticlenames[partID].data()), "hDCACascDaughters", kTH2F, {axisPtCoarse, {44, 0.0f, 2.2f}}); @@ -385,7 +342,7 @@ struct Derivedupcanalysis { template void addTPCQAHistograms(HistogramRegistry& histos) { - const bool isCascade = partID >= kFirstCascadePartID; + const bool isCascade = (partID > 2.5) ? true : false; histos.add(Form("%s/h3dPosNsigmaTPC", kParticlenames[partID].data()), "h3dPosNsigmaTPC", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisNsigmaTPC}); histos.add(Form("%s/h3dNegNsigmaTPC", kParticlenames[partID].data()), "h3dNegNsigmaTPC", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisNsigmaTPC}); histos.add(Form("%s/h3dPosTPCsignal", kParticlenames[partID].data()), "h3dPosTPCsignal", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisTPCsignal}); @@ -416,7 +373,7 @@ struct Derivedupcanalysis { template void addTOFQAHistograms(HistogramRegistry& histos) { - const bool isCascade = partID >= kFirstCascadePartID; + const bool isCascade = (partID > 2.5) ? true : false; histos.add(Form("%s/h3dPosTOFdeltaT", kParticlenames[partID].data()), "h3dPosTOFdeltaT", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisTOFdeltaT}); histos.add(Form("%s/h3dNegTOFdeltaT", kParticlenames[partID].data()), "h3dNegTOFdeltaT", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisTOFdeltaT}); histos.add(Form("%s/h3dPosTOFdeltaTvsTrackPtot", kParticlenames[partID].data()), "h3dPosTOFdeltaTvsTrackPtot", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisTOFdeltaT}); @@ -433,7 +390,7 @@ struct Derivedupcanalysis { template void addKinematicQAHistograms(HistogramRegistry& histos) { - const bool isCascade = partID >= kFirstCascadePartID; + const bool isCascade = (partID > 2.5) ? true : false; histos.add(Form("%s/h3dPosEtaPt", kParticlenames[partID].data()), "h3dPosEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); histos.add(Form("%s/h3dNegEtaPt", kParticlenames[partID].data()), "h3dNegEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); histos.add(Form("%s/h3dRapPt", kParticlenames[partID].data()), "h3dRapPt", kTH3F, {axisPtCoarse, axisRap, axisSelGap}); @@ -445,8 +402,8 @@ struct Derivedupcanalysis { template void addDetectorPropHistograms(HistogramRegistry& histos) { - const bool isCascade = partID >= kFirstCascadePartID; - if (doDetectPropQA == kDetectPropQABase) { + const bool isCascade = (partID > 2.5) ? true : false; + if (doDetectPropQA == 1) { if (isCascade) { histos.add(Form("%s/h8dDetectPropVsCentrality", kParticlenames[partID].data()), "h8dDetectPropVsCentrality", kTHnSparseF, {axisDetectors.axisFT0ampl, axisDetMapCoarse, axisITScluMapCoarse, axisDetMapCoarse, axisITScluMapCoarse, axisDetMapCoarse, axisITScluMapCoarse, axisPtCoarse}); } else { @@ -456,7 +413,7 @@ struct Derivedupcanalysis { histos.add(Form("%s/h4dNegDetectPropVsCentrality", kParticlenames[partID].data()), "h4dNegDetectPropVsCentrality", kTHnSparseF, {axisDetectors.axisFT0ampl, axisDetMap, axisITScluMap, axisPtCoarse}); histos.add(Form("%s/h4dBachDetectPropVsCentrality", kParticlenames[partID].data()), "h4dBachDetectPropVsCentrality", kTHnSparseF, {axisDetectors.axisFT0ampl, axisDetMap, axisITScluMap, axisPtCoarse}); } - if (doDetectPropQA == kDetectPropQAWithMass) { + if (doDetectPropQA == 2) { if (isCascade) { histos.add(Form("%s/h9dDetectPropVsCentrality", kParticlenames[partID].data()), "h9dDetectPropVsCentrality", kTHnSparseF, {axisDetectors.axisFT0ampl, axisDetMapCoarse, axisITScluMapCoarse, axisDetMapCoarse, axisITScluMapCoarse, axisDetMapCoarse, axisITScluMapCoarse, axisPtCoarse, axisInvMass.at(partID)}); } else { @@ -499,7 +456,7 @@ struct Derivedupcanalysis { ft0ampl = coll.totalFT0AmplitudeA(); } float pT = cand.pt(); - float rapidity = kDefaultInvalidRapidity; + float rapidity = 1e6; // c x tau float ctau = 0; @@ -520,7 +477,7 @@ struct Derivedupcanalysis { uint negDetMap = computeDetBitmap(negTrackExtra.detectorMap()); int negITSclusMap = computeITSclusBitmap(negTrackExtra.itsClusterMap(), negIsFromAfterburner); - if (partID == kK0ShortPartID) { + if (partID == 0) { histos.fill(HIST("generalQA/h2dArmenterosSelected"), cand.alpha(), cand.qtarm()); invMass = cand.mK0Short(); rapidity = cand.yK0Short(); @@ -533,7 +490,7 @@ struct Derivedupcanalysis { tpcNsigmaPos = posTrackExtra.tpcNSigmaPi(); tpcNsigmaNeg = negTrackExtra.tpcNSigmaPi(); } - } else if (partID == kLambdaPartID) { + } else if (partID == 1) { invMass = cand.mLambda(); rapidity = cand.yLambda(); ctau = cand.distovertotmom(coll.posX(), coll.posY(), coll.posZ()) * o2::constants::physics::MassLambda0; @@ -545,7 +502,7 @@ struct Derivedupcanalysis { tpcNsigmaPos = posTrackExtra.tpcNSigmaPr(); tpcNsigmaNeg = negTrackExtra.tpcNSigmaPi(); } - } else if (partID == kAntiLambdaPartID) { + } else if (partID == 2) { invMass = cand.mAntiLambda(); rapidity = cand.yLambda(); ctau = cand.distovertotmom(coll.posX(), coll.posY(), coll.posZ()) * o2::constants::physics::MassLambda0Bar; @@ -579,13 +536,13 @@ struct Derivedupcanalysis { histos.fill(HIST(kParticlenames[partID]) + HIST("/h2dNegativeITSvsTPCpts"), negTrackExtra.tpcCrossedRows(), negTrackExtra.itsNCls()); histos.fill(HIST(kParticlenames[partID]) + HIST("/hCtau"), pT, ctau); } - if (doDetectPropQA == kDetectPropQABase) { + if (doDetectPropQA == 1) { histos.fill(HIST(kParticlenames[partID]) + HIST("/h6dDetectPropVsCentrality"), ft0ampl, posDetMap, posITSclusMap, negDetMap, negITSclusMap, pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dPosDetectPropVsCentrality"), ft0ampl, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dNegDetectPropVsCentrality"), ft0ampl, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pT); } - if (doDetectPropQA == kDetectPropQAWithMass) { - histos.fill(HIST(kParticlenames[partID]) + HIST("/h7dDetectPropVsCentrality"), ft0ampl, posDetMap, posITSclusMap, negDetMap, negITSclusMap, pT, invMass); + if (doDetectPropQA == 2) { + histos.fill(HIST(kParticlenames[partID]) + HIST("/h7dPosDetectPropVsCentrality"), ft0ampl, posDetMap, posITSclusMap, negDetMap, negITSclusMap, pT, invMass); histos.fill(HIST(kParticlenames[partID]) + HIST("/h5dPosDetectPropVsCentrality"), ft0ampl, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pT, invMass); histos.fill(HIST(kParticlenames[partID]) + HIST("/h5dNegDetectPropVsCentrality"), ft0ampl, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pT, invMass); } @@ -624,7 +581,7 @@ struct Derivedupcanalysis { centrality = coll.totalFT0AmplitudeA(); } float pT = cand.pt(); - float rapidity = kDefaultInvalidRapidity; + float rapidity = 1e6; // Access daughter tracks auto posTrackExtra = cand.template posTrackExtra_as(); @@ -655,9 +612,9 @@ struct Derivedupcanalysis { float tofDeltaTNeg = 0; float tofDeltaTBach = 0; - if (partID == kXiPartID) { + if (partID == 3) { invMass = cand.mXi(); - ctau = totalMom != 0 ? o2::constants::physics::MassXiMinus * decayPos / (totalMom * ctauxiPDG) : kDefaultInvalidCtau; + ctau = totalMom != 0 ? o2::constants::physics::MassXiMinus * decayPos / (totalMom * ctauxiPDG) : 1e6; rapidity = cand.yXi(); if (PIDConfigurations.doTPCQA) { @@ -670,9 +627,9 @@ struct Derivedupcanalysis { tofDeltaTNeg = cand.negTOFDeltaTXiPi(); tofDeltaTBach = cand.bachTOFDeltaTXiPi(); } - } else if (partID == kAntiXiPartID) { + } else if (partID == 4) { invMass = cand.mXi(); - ctau = totalMom != 0 ? o2::constants::physics::MassXiPlusBar * decayPos / (totalMom * ctauxiPDG) : kDefaultInvalidCtau; + ctau = totalMom != 0 ? o2::constants::physics::MassXiPlusBar * decayPos / (totalMom * ctauxiPDG) : 1e6; rapidity = cand.yXi(); if (PIDConfigurations.doTPCQA) { @@ -686,9 +643,9 @@ struct Derivedupcanalysis { tofDeltaTBach = cand.bachTOFDeltaTXiPi(); } - } else if (partID == kOmegaPartID) { + } else if (partID == 5) { invMass = cand.mOmega(); - ctau = totalMom != 0 ? o2::constants::physics::MassOmegaMinus * decayPos / (totalMom * ctauomegaPDG) : kDefaultInvalidCtau; + ctau = totalMom != 0 ? o2::constants::physics::MassOmegaMinus * decayPos / (totalMom * ctauomegaPDG) : 1e6; rapidity = cand.yOmega(); if (PIDConfigurations.doTPCQA) { @@ -702,9 +659,9 @@ struct Derivedupcanalysis { tofDeltaTBach = cand.bachTOFDeltaTOmKa(); } - } else if (partID == kAntiOmegaPartID) { + } else if (partID == 6) { invMass = cand.mOmega(); - ctau = totalMom != 0 ? o2::constants::physics::MassOmegaPlusBar * decayPos / (totalMom * ctauomegaPDG) : kDefaultInvalidCtau; + ctau = totalMom != 0 ? o2::constants::physics::MassOmegaPlusBar * decayPos / (totalMom * ctauomegaPDG) : 1e6; rapidity = cand.yOmega(); if (PIDConfigurations.doTPCQA) { @@ -771,13 +728,13 @@ struct Derivedupcanalysis { histos.fill(HIST(kParticlenames[partID]) + HIST("/h3dNegTOFdeltaTvsTrackPt"), centrality, cand.negativept(), tofDeltaTNeg); histos.fill(HIST(kParticlenames[partID]) + HIST("/h3dBachTOFdeltaTvsTrackPt"), centrality, cand.bachelorpt(), tofDeltaTBach); } - if (doDetectPropQA == kDetectPropQABase) { + if (doDetectPropQA == 1) { histos.fill(HIST(kParticlenames[partID]) + HIST("/h8dDetectPropVsCentrality"), centrality, posDetMap, posITSclusMap, negDetMap, negITSclusMap, bachDetMap, bachITSclusMap, pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dPosDetectPropVsCentrality"), centrality, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dNegDetectPropVsCentrality"), centrality, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dBachDetectPropVsCentrality"), centrality, bachTrackExtra.detectorMap(), bachTrackExtra.itsClusterMap(), pT); } - if (doDetectPropQA == kDetectPropQAWithMass) { + if (doDetectPropQA == 2) { histos.fill(HIST(kParticlenames[partID]) + HIST("/h9dDetectPropVsCentrality"), centrality, posDetMap, posITSclusMap, negDetMap, negITSclusMap, bachDetMap, bachITSclusMap, pT, invMass); histos.fill(HIST(kParticlenames[partID]) + HIST("/h5dPosDetectPropVsCentrality"), centrality, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pT, invMass); histos.fill(HIST(kParticlenames[partID]) + HIST("/h5dNegDetectPropVsCentrality"), centrality, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pT, invMass); @@ -832,7 +789,7 @@ struct Derivedupcanalysis { } else { setBits(maskTrackPropertiesV0, {selPosGoodTPCTrack, selPosGoodITSTrack}); // TPC signal is available: ask for positive track PID - if (PIDConfigurations.tpcPidNsigmaCut < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut maskK0ShortSpecific.set(selTPCPIDPositivePion); maskLambdaSpecific.set(selTPCPIDPositiveProton); maskAntiLambdaSpecific.set(selTPCPIDPositivePion); @@ -843,15 +800,15 @@ struct Derivedupcanalysis { maskAntiOmegaSpecific.set(selTPCPIDPositivePion); } // TOF PID - if (PIDConfigurations.tofPidNsigmaCutK0Pi < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutK0Pi < 1e+5) { // safeguard for no cut setBits(maskK0ShortSpecific, {selTOFNSigmaPositivePionK0Short, selTOFDeltaTPositivePionK0Short}); } - if (PIDConfigurations.tofPidNsigmaCutLaPr < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutLaPr < 1e+5) { // safeguard for no cut setBits(maskLambdaSpecific, {selTOFNSigmaPositiveProtonLambda, selTOFDeltaTPositiveProtonLambda}); setBits(maskXiSpecific, {selTOFNSigmaPositiveProtonLambdaXi, selTOFDeltaTPositiveProtonLambdaXi}); setBits(maskOmegaSpecific, {selTOFNSigmaPositiveProtonLambdaOmega, selTOFDeltaTPositiveProtonLambdaOmega}); } - if (PIDConfigurations.tofPidNsigmaCutLaPi < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutLaPi < 1e+5) { // safeguard for no cut setBits(maskAntiLambdaSpecific, {selTOFNSigmaPositivePionLambda, selTOFDeltaTPositivePionLambda}); setBits(maskAntiXiSpecific, {selTOFNSigmaPositivePionLambdaXi, selTOFDeltaTPositivePionLambdaXi}); setBits(maskAntiOmegaSpecific, {selTOFNSigmaPositivePionLambdaOmega, selTOFDeltaTPositivePionLambdaOmega}); @@ -863,26 +820,26 @@ struct Derivedupcanalysis { } else { setBits(maskTrackPropertiesV0, {selNegGoodTPCTrack, selNegGoodITSTrack}); // TPC signal is available: ask for negative track PID - if (PIDConfigurations.tpcPidNsigmaCut < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut maskK0ShortSpecific.set(selTPCPIDNegativePion); maskLambdaSpecific.set(selTPCPIDNegativePion); maskAntiLambdaSpecific.set(selTPCPIDNegativeProton); maskXiSpecific.set(selTPCPIDNegativePion); - maskAntiXiSpecific.set(selTPCPIDNegativeProton); + maskAntiXiSpecific.set(selTPCPIDPositiveProton); maskOmegaSpecific.set(selTPCPIDNegativePion); - maskAntiOmegaSpecific.set(selTPCPIDNegativeProton); + maskAntiOmegaSpecific.set(selTPCPIDPositiveProton); } // TOF PID - if (PIDConfigurations.tofPidNsigmaCutK0Pi < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutK0Pi < 1e+5) { // safeguard for no cut setBits(maskK0ShortSpecific, {selTOFNSigmaNegativePionK0Short, selTOFDeltaTNegativePionK0Short}); } - if (PIDConfigurations.tofPidNsigmaCutLaPr < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutLaPr < 1e+5) { // safeguard for no cut setBits(maskAntiLambdaSpecific, {selTOFNSigmaNegativeProtonLambda, selTOFDeltaTNegativeProtonLambda}); setBits(maskAntiXiSpecific, {selTOFNSigmaNegativeProtonLambdaXi, selTOFDeltaTNegativeProtonLambdaXi}); setBits(maskAntiOmegaSpecific, {selTOFNSigmaNegativeProtonLambdaOmega, selTOFDeltaTNegativeProtonLambdaOmega}); } - if (PIDConfigurations.tofPidNsigmaCutLaPi < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutLaPi < 1e+5) { // safeguard for no cut setBits(maskLambdaSpecific, {selTOFNSigmaNegativePionLambda, selTOFDeltaTNegativePionLambda}); setBits(maskXiSpecific, {selTOFNSigmaNegativePionLambdaXi, selTOFDeltaTNegativePionLambdaXi}); setBits(maskOmegaSpecific, {selTOFNSigmaNegativePionLambdaOmega, selTOFDeltaTNegativePionLambdaOmega}); @@ -895,18 +852,18 @@ struct Derivedupcanalysis { } else { setBits(maskTrackPropertiesCasc, {selBachGoodTPCTrack, selBachGoodITSTrack}); // TPC signal is available: ask for positive track PID - if (PIDConfigurations.tpcPidNsigmaCut < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut maskXiSpecific.set(selTPCPIDBachPion); maskAntiXiSpecific.set(selTPCPIDBachPion); maskOmegaSpecific.set(selTPCPIDBachKaon); maskAntiOmegaSpecific.set(selTPCPIDBachKaon); } // TOF PID - if (PIDConfigurations.tofPidNsigmaCutXiPi < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutXiPi < 1e+5) { // safeguard for no cut setBits(maskXiSpecific, {selTOFNSigmaBachPionXi, selTOFDeltaTBachPionXi}); setBits(maskAntiXiSpecific, {selTOFNSigmaBachPionXi, selTOFDeltaTBachPionXi}); } - if (PIDConfigurations.tofPidNsigmaCutOmegaKaon < kNoPidNsigmaCut) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutOmegaKaon < 1e+5) { // safeguard for no cut setBits(maskOmegaSpecific, {selTOFNSigmaBachKaonOmega, selTOFDeltaTBachKaonOmega}); setBits(maskAntiOmegaSpecific, {selTOFNSigmaBachKaonOmega, selTOFDeltaTBachKaonOmega}); } @@ -949,8 +906,8 @@ struct Derivedupcanalysis { histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(10, "kNoSameBunchPileup"); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoCollInTimeRangeStd"); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeNarrow"); - histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(13, "Above min occup."); - histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(14, "Below max occup."); + histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(13, "Below min occup."); + histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(14, "Above max occup."); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(15, "RCTFlagsChecker"); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(16, "isUPC"); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(17, "has UPC flag"); @@ -974,22 +931,6 @@ struct Derivedupcanalysis { histos.add("eventQA/hFT0", "hFT0", kTH3D, {axisDetectors.axisFT0Aampl, axisDetectors.axisFT0Campl, axisSelGap}); histos.add("eventQA/hFDD", "hFDD", kTH3D, {axisDetectors.axisFDDAampl, axisDetectors.axisFDDCampl, axisSelGap}); histos.add("eventQA/hZN", "hZN", kTH3D, {axisDetectors.axisZNAampl, axisDetectors.axisZNCampl, axisSelGap}); - histos.add("eventQA/hTimeFT0A", "hTimeFT0A", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); - histos.add("eventQA/hTimeFT0C", "hTimeFT0C", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); - histos.add("eventQA/hTimeFV0A", "hTimeFV0A", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); - histos.add("eventQA/hTimeFDDA", "hTimeFDDA", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); - histos.add("eventQA/hTimeFDDC", "hTimeFDDC", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); - histos.add("eventQA/hTimeFT0APreSel", "hTimeFT0APreSel", kTH1D, {axisDetectors.axisFitTime}); - histos.add("eventQA/hTimeFT0CPreSel", "hTimeFT0CPreSel", kTH1D, {axisDetectors.axisFitTime}); - histos.add("eventQA/hTimeFV0APreSel", "hTimeFV0APreSel", kTH1D, {axisDetectors.axisFitTime}); - histos.add("eventQA/hTimeFDDAPreSel", "hTimeFDDAPreSel", kTH1D, {axisDetectors.axisFitTime}); - histos.add("eventQA/hTimeFDDCPreSel", "hTimeFDDCPreSel", kTH1D, {axisDetectors.axisFitTime}); - histos.add("eventQA/hFT0Time", "hFT0Time", kTH3D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime, axisSelGap}); - histos.add("eventQA/hFDDTime", "hFDDTime", kTH3D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime, axisSelGap}); - histos.add("eventQA/hZNTime", "hZNTime", kTH3D, {axisDetectors.axisZdcTime, axisDetectors.axisZdcTime, axisSelGap}); - histos.add("eventQA/hFT0TimePreSel", "hFT0TimePreSel", kTH2D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime}); - histos.add("eventQA/hFDDTimePreSel", "hFDDTimePreSel", kTH2D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime}); - histos.add("eventQA/hZNTimePreSel", "hZNTimePreSel", kTH2D, {axisDetectors.axisZdcTime, axisDetectors.axisZdcTime}); if (doprocessGenerated) { histos.add("eventQA/mc/hEventSelectionMC", "hEventSelectionMC", kTH3D, {{3, -0.5, 2.5}, axisNTracksPVeta1, axisGeneratorIds}); @@ -1014,18 +955,18 @@ struct Derivedupcanalysis { histos.add("eventQA/mc/hNTracksPVeta1vsMCNParticlesEta10rec", "hNTracksPVeta1vsMCNParticlesEta10rec", kTH2D, {axisNTracksPVeta1, axisNTracksPVeta1}); histos.add("eventQA/mc/hNTracksGlobalvstotalMultMCParticles", "hNTracksGlobalvstotalMultMCParticles", kTH2D, {axisNTracksGlobal, axisNchInvMass}); histos.add("eventQA/mc/hNTracksPVeta1vstotalMultMCParticles", "hNTracksPVeta1vstotalMultMCParticles", kTH2D, {axisNTracksPVeta1, axisNchInvMass}); - histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {axisSelGap}); + histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {{5, -0.5, 4.5}}); } if (doprocessV0sMC) { if (analyseLambda && calculateFeeddownMatrix) - histos.add(Form("%s/h3dLambdaFeeddown", kParticlenames[kLambdaPartID].data()), "h3dLambdaFeeddown", kTH3F, {axisNTracksGlobal, axisPt, axisPt}); + histos.add(Form("%s/h3dLambdaFeeddown", kParticlenames[1].data()), "h3dLambdaFeeddown", kTH3F, {axisNTracksGlobal, axisPt, axisPt}); if (analyseAntiLambda && calculateFeeddownMatrix) - histos.add(Form("%s/h3dAntiLambdaFeeddown", kParticlenames[kAntiLambdaPartID].data()), "h3dAntiLambdaFeeddown", kTH3F, {axisNTracksGlobal, axisPt, axisPt}); + histos.add(Form("%s/h3dAntiLambdaFeeddown", kParticlenames[2].data()), "h3dAntiLambdaFeeddown", kTH3F, {axisNTracksGlobal, axisPt, axisPt}); } if (doprocessGenerated) { - for (int partID = kK0ShortPartID; partID <= kAntiOmegaPartID; partID++) { + for (int partID = 0; partID <= 6; partID++) { histos.add(Form("%s/mc/h7dGen", kParticlenames[partID].data()), "h7dGen", kTHnSparseF, {axisDetectors.axisFT0ampl, axisNchInvMass, axisNchInvMass, axisPt, axisSelGap, axisRap, axisGeneratorIds}); } } @@ -1048,17 +989,17 @@ struct Derivedupcanalysis { // K0s if (analyseK0Short) { - addHistograms(histos); + addHistograms<0>(histos); } // Lambda if (analyseLambda) { - addHistograms(histos); + addHistograms<1>(histos); } // Anti-Lambda if (analyseAntiLambda) { - addHistograms(histos); + addHistograms<2>(histos); } } @@ -1084,22 +1025,22 @@ struct Derivedupcanalysis { // Xi if (analyseXi) { - addHistograms(histos); + addHistograms<3>(histos); } // Anti-Xi if (analyseAntiXi) { - addHistograms(histos); + addHistograms<4>(histos); } // Omega if (analyseOmega) { - addHistograms(histos); + addHistograms<5>(histos); } // Anti-Omega if (analyseAntiOmega) { - addHistograms(histos); + addHistograms<6>(histos); } } @@ -1108,218 +1049,11 @@ struct Derivedupcanalysis { } } - template - int applyZDCTiming(int selGapSide, TCollision const& collision) - { - if (!upcCuts.requireZDCTiming) { - return selGapSide; - } - if (selGapSide == o2::aod::sgselector::SingleGapA || - selGapSide == o2::aod::sgselector::SingleGapC || - selGapSide == o2::aod::sgselector::DoubleGap) { - - const float timeZNA = collision.timeZNA(); - const float timeZNC = collision.timeZNC(); - const float cut = upcCuts.zdcTimeCut; - - const bool gapA = hasNoZdcNeutrons(timeZNA, cut); - const bool gapC = hasNoZdcNeutrons(timeZNC, cut); - const bool neutronA = hasZdcNeutrons(timeZNA, cut); - const bool neutronC = hasZdcNeutrons(timeZNC, cut); - - if (selGapSide == o2::aod::sgselector::SingleGapA) { // 0nXn - if (!(gapA && neutronC)) { - selGapSide = o2::aod::sgselector::NoGap; - } - } else if (selGapSide == o2::aod::sgselector::SingleGapC) { // Xn0n - if (!(neutronA && gapC)) { - selGapSide = o2::aod::sgselector::NoGap; - } - } else if (selGapSide == o2::aod::sgselector::DoubleGap) { - if (!(gapA && gapC)) { - selGapSide = o2::aod::sgselector::NoGap; - } - } - } - - return selGapSide; - } - - bool hasNoZdcNeutrons(float time, float cut) const - { - return (time != kMissingSignal) && (std::abs(time) > cut); - } - - bool hasZdcNeutrons(float time, float cut) const - { - return std::abs(time) < cut; - } - - bool isTimingCutEnabled(float cut, bool requireTiming) const - { - return requireTiming && cut >= 0.f; - } - - bool isTimingGap(float time, float cut) const - { - return (time != kMissingSignal) && (std::abs(time) > cut); - } - - bool isTimingActivity(float time, float cut) const - { - return std::abs(time) < cut; - } - - template - int applyFITTiming(int selGapSide, TCollision const& collision) - { - if (selGapSide != o2::aod::sgselector::SingleGapA && - selGapSide != o2::aod::sgselector::SingleGapC && - selGapSide != o2::aod::sgselector::DoubleGap) { - return selGapSide; - } - - const bool useFDDA = isTimingCutEnabled(upcCuts.fddaTimeCut, upcCuts.requireFDDATiming); - const bool useFDDC = isTimingCutEnabled(upcCuts.fddcTimeCut, upcCuts.requireFDDCTiming); - const bool useFV0A = isTimingCutEnabled(upcCuts.fv0aTimeCut, upcCuts.requireFV0ATiming); - const bool useFT0A = isTimingCutEnabled(upcCuts.ft0aTimeCut, upcCuts.requireFT0ATiming); - const bool useFT0C = isTimingCutEnabled(upcCuts.ft0cTimeCut, upcCuts.requireFT0CTiming); - - if (!(useFDDA || useFDDC || useFV0A || useFT0A || useFT0C)) { - return selGapSide; - } - - const bool gapFDDA = !useFDDA || isTimingGap(collision.timeFDDA(), upcCuts.fddaTimeCut); - const bool actFDDA = !useFDDA || isTimingActivity(collision.timeFDDA(), upcCuts.fddaTimeCut); - const bool gapFDDC = !useFDDC || isTimingGap(collision.timeFDDC(), upcCuts.fddcTimeCut); - const bool actFDDC = !useFDDC || isTimingActivity(collision.timeFDDC(), upcCuts.fddcTimeCut); - const bool gapFV0A = !useFV0A || isTimingGap(collision.timeFV0A(), upcCuts.fv0aTimeCut); - const bool actFV0A = !useFV0A || isTimingActivity(collision.timeFV0A(), upcCuts.fv0aTimeCut); - const bool gapFT0A = !useFT0A || isTimingGap(collision.timeFT0A(), upcCuts.ft0aTimeCut); - const bool actFT0A = !useFT0A || isTimingActivity(collision.timeFT0A(), upcCuts.ft0aTimeCut); - const bool gapFT0C = !useFT0C || isTimingGap(collision.timeFT0C(), upcCuts.ft0cTimeCut); - const bool actFT0C = !useFT0C || isTimingActivity(collision.timeFT0C(), upcCuts.ft0cTimeCut); - - if (selGapSide == o2::aod::sgselector::SingleGapA) { - if (!(gapFV0A && gapFDDA && gapFT0A && actFDDC && actFT0C)) { - selGapSide = o2::aod::sgselector::NoGap; - } - } else if (selGapSide == o2::aod::sgselector::SingleGapC) { - if (!(actFV0A && actFDDA && actFT0A && gapFDDC && gapFT0C)) { - selGapSide = o2::aod::sgselector::NoGap; - } - } else if (selGapSide == o2::aod::sgselector::DoubleGap) { - if (!(gapFV0A && gapFDDA && gapFT0A && gapFDDC && gapFT0C)) { - selGapSide = o2::aod::sgselector::NoGap; - } - } - - return selGapSide; - } - - template - int getGapSideWithoutRecoZDC(TCollision const& collision) - { - int selGapSide = o2::aod::sgselector::NoGap; - selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, std::numeric_limits::infinity()); - return applyFITTiming(selGapSide, collision); - } - - template - bool generatedNeutronsMatchGapSide(int selGapSide, TNeutrons const& neutrons) - { - bool neutronA = false; - bool neutronC = false; - for (const auto& neutron : neutrons) { - neutronA = neutronA || (neutron.eta() > neutronEtaCut); - neutronC = neutronC || (neutron.eta() < -neutronEtaCut); - } - - if (selGapSide == o2::aod::sgselector::SingleGapA) { // 0nXn - return !neutronA && neutronC; - } - if (selGapSide == o2::aod::sgselector::SingleGapC) { // Xn0n - return neutronA && !neutronC; - } - if (selGapSide == o2::aod::sgselector::DoubleGap) { - return !neutronA && !neutronC; - } - - return false; - } - - template - int applyGeneratedNeutronSelection(int selGapSide, TNeutrons const& neutrons) - { - if (!checkNeutronsInMC) { - return selGapSide; - } - if (selGapSide != o2::aod::sgselector::SingleGapA && - selGapSide != o2::aod::sgselector::SingleGapC && - selGapSide != o2::aod::sgselector::DoubleGap) { - return selGapSide; - } - - if (!generatedNeutronsMatchGapSide(selGapSide, neutrons)) { - selGapSide = o2::aod::sgselector::NoGap; - } - - return selGapSide; - } - - template - int getGapSideMC(TCollision const& collision, TNeutrons const& neutrons) - { - return applyGeneratedNeutronSelection(getGapSideWithoutRecoZDC(collision), neutrons); - } - - template - bool acceptGeneratedNeutronSelection(TNeutrons const& neutrons) - { - return !requireGeneratedZDCNeutrons || generatedNeutronsMatchGapSide(static_cast(upcCuts.genGapSide), neutrons); - } - template int getGapSide(TCollision const& collision) { - int selGapSide = o2::aod::sgselector::NoGap; - selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); - selGapSide = applyZDCTiming(selGapSide, collision); - return applyFITTiming(selGapSide, collision); - } - float sanitizeZdcTime(float time) const - { - if (!std::isfinite(time)) { - return kInvalidZdcTime; - } - if (std::abs(time) >= kMissingSignalThreshold) { - return kMissingZdcTime; - } - return time; - } - - float sanitizeFITTime(float time) const - { - if (!std::isfinite(time)) { - return kInvalidFITTime; - } - if (std::abs(time) >= kMissingSignalThreshold) { - return kMissingFITTime; - } - return time; - } - - template - void fillPreSelTimingHistograms(TCollision const& collision) - { - histos.fill(HIST("eventQA/hFT0TimePreSel"), sanitizeFITTime(collision.timeFT0A()), sanitizeFITTime(collision.timeFT0C())); - histos.fill(HIST("eventQA/hFDDTimePreSel"), sanitizeFITTime(collision.timeFDDA()), sanitizeFITTime(collision.timeFDDC())); - histos.fill(HIST("eventQA/hZNTimePreSel"), sanitizeZdcTime(collision.timeZNA()), sanitizeZdcTime(collision.timeZNC())); - histos.fill(HIST("eventQA/hTimeFT0APreSel"), sanitizeFITTime(collision.timeFT0A())); - histos.fill(HIST("eventQA/hTimeFT0CPreSel"), sanitizeFITTime(collision.timeFT0C())); - histos.fill(HIST("eventQA/hTimeFV0APreSel"), sanitizeFITTime(collision.timeFV0A())); - histos.fill(HIST("eventQA/hTimeFDDAPreSel"), sanitizeFITTime(collision.timeFDDA())); - histos.fill(HIST("eventQA/hTimeFDDCPreSel"), sanitizeFITTime(collision.timeFDDC())); + int selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); + return selGapSide; } template @@ -1357,26 +1091,14 @@ struct Derivedupcanalysis { auto znc = collision.energyCommonZNC(); constexpr float inf_f = std::numeric_limits::infinity(); - if (zna == -inf_f) { + if (zna == -inf_f) histos.fill(HIST("eventQA/hZN"), -1, znc, gap); - } else if (znc == -inf_f) { + else if (znc == -inf_f) histos.fill(HIST("eventQA/hZN"), zna, -1, gap); - } else if (zna == kMissingSignal && znc == kMissingSignal) { + else if (zna == -999 && znc == -999) histos.fill(HIST("eventQA/hZN"), -2, -2, gap); - } else if (zna == kMissingSignal || znc == kMissingSignal) { + else if (zna == -999 || znc == -999) LOG(warning) << "Only one ZDC signal is -999"; - } else { - histos.fill(HIST("eventQA/hZN"), zna, znc, gap); - } - - histos.fill(HIST("eventQA/hFT0Time"), sanitizeFITTime(collision.timeFT0A()), sanitizeFITTime(collision.timeFT0C()), gap); - histos.fill(HIST("eventQA/hFDDTime"), sanitizeFITTime(collision.timeFDDA()), sanitizeFITTime(collision.timeFDDC()), gap); - histos.fill(HIST("eventQA/hZNTime"), sanitizeZdcTime(collision.timeZNA()), sanitizeZdcTime(collision.timeZNC()), gap); - histos.fill(HIST("eventQA/hTimeFT0A"), sanitizeFITTime(collision.timeFT0A()), gap); - histos.fill(HIST("eventQA/hTimeFT0C"), sanitizeFITTime(collision.timeFT0C()), gap); - histos.fill(HIST("eventQA/hTimeFV0A"), sanitizeFITTime(collision.timeFV0A()), gap); - histos.fill(HIST("eventQA/hTimeFDDA"), sanitizeFITTime(collision.timeFDDA()), gap); - histos.fill(HIST("eventQA/hTimeFDDC"), sanitizeFITTime(collision.timeFDDC()), gap); } template @@ -1513,8 +1235,8 @@ struct Derivedupcanalysis { // c x tau float decayPos = std::hypot(casc.x() - coll.posX(), casc.y() - coll.posY(), casc.z() - coll.posZ()); float totalMom = std::hypot(casc.px(), casc.py(), casc.pz()); - float ctauXi = totalMom != 0 ? o2::constants::physics::MassXiMinus * decayPos / totalMom : kDefaultInvalidCtau; - float ctauOmega = totalMom != 0 ? o2::constants::physics::MassOmegaMinus * decayPos / totalMom : kDefaultInvalidCtau; + float ctauXi = totalMom != 0 ? o2::constants::physics::MassXiMinus * decayPos / totalMom : 1e6; + float ctauOmega = totalMom != 0 ? o2::constants::physics::MassOmegaMinus * decayPos / totalMom : 1e6; std::bitset bitMap = 0; @@ -1834,7 +1556,7 @@ struct Derivedupcanalysis { bitMap.set(selK0ShortCTau); // armenteros - if (v0.qtarm() * v0cuts.armPodCut > std::fabs(v0.alpha()) || v0cuts.armPodCut < kDisabledArmenterosCut) + if (v0.qtarm() * v0cuts.armPodCut > std::fabs(v0.alpha()) || v0cuts.armPodCut < 1e-4) bitMap.set(selK0ShortArmenteros); return bitMap; @@ -2042,7 +1764,31 @@ struct Derivedupcanalysis { continue; } - int selGapSide = collision.isUPC() ? getGapSideMC(collision, groupedNeutrons) : -1; + int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; + if (checkNeutronsInMC) { + for (const auto& neutron : groupedNeutrons) { + if (selGapSide < -0.5) + break; + + const float eta = neutron.eta(); + switch (selGapSide) { + case 0: // SGA + if (eta > neutronEtaCut) + selGapSide = -1; + break; + case 1: // SGC + if (eta < -neutronEtaCut) + selGapSide = -1; + break; + case 2: // DG + if (eta > neutronEtaCut) + selGapSide = 1; + else if (eta < -neutronEtaCut) + selGapSide = 0; + break; + } + } + } if (evSels.studyUPConly && (selGapSide != static_cast(upcCuts.genGapSide))) continue; @@ -2096,15 +1842,39 @@ struct Derivedupcanalysis { continue; } - int selGapSide = collision.isUPC() ? getGapSideMC(collision, groupedNeutrons) : -1; - - const bool passStd = !evSels.studyUPConly || (selGapSide == static_cast(upcCuts.genGapSide)); - if (passStd) { - ++nCollisions; - atLeastOne = true; + int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; + if (checkNeutronsInMC) { + for (const auto& neutron : groupedNeutrons) { + if (selGapSide < -0.5) + break; + + const float eta = neutron.eta(); + switch (selGapSide) { + case 0: // SGA + if (eta > neutronEtaCut) + selGapSide = -1; + break; + case 1: // SGC + if (eta < -neutronEtaCut) + selGapSide = -1; + break; + case 2: // DG + if (eta > neutronEtaCut) + selGapSide = 1; + else if (eta < -neutronEtaCut) + selGapSide = 0; + break; + } + } } - if (passStd && biggestNContribs < collision.multPVTotalContributors()) { + if (evSels.studyUPConly && (selGapSide != static_cast(upcCuts.genGapSide))) + continue; + + ++nCollisions; + atLeastOne = true; + + if (biggestNContribs < collision.multPVTotalContributors()) { biggestNContribs = collision.multPVTotalContributors(); if (static_cast(upcCuts.genGapSide) == 0) { ft0ampl = collision.totalFT0AmplitudeC(); @@ -2140,12 +1910,12 @@ struct Derivedupcanalysis { } const auto v0mother = v0.template motherMCPart_as(); - if (v0mother.size() == 0) { + if (v0mother.size() < 1) { return; } const float rapidityXi = RecoDecay::y(std::array{v0mother.px(), v0mother.py(), v0mother.pz()}, o2::constants::physics::MassXiMinus); - if (std::fabs(rapidityXi) > kMotherRapidityMax) { + if (std::fabs(rapidityXi) > 0.5f) { return; } @@ -2176,13 +1946,10 @@ struct Derivedupcanalysis { continue; } // event is accepted - if (collision.isUPC()) { - fillPreSelTimingHistograms(collision); - } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); - int selGapSide = collision.isUPC() ? getGapSide(collision) : o2::aod::sgselector::NoGap; - if (evSels.studyUPConly && (selGapSide < 0)) + int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; + if (evSels.studyUPConly && (selGapSide < -0.5)) continue; fillHistogramsQA(collision, selGapSide); @@ -2235,16 +2002,38 @@ struct Derivedupcanalysis { continue; } // event is accepted - if (collision.isUPC()) { - fillPreSelTimingHistograms(collision); - } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); + int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; + int selGapSideNoNeutrons = selGapSide; + auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex()); - int selGapSideNoNeutrons = collision.isUPC() ? getGapSideWithoutRecoZDC(collision) : o2::aod::sgselector::NoGap; - int selGapSide = applyGeneratedNeutronSelection(selGapSideNoNeutrons, groupedNeutrons); + if (checkNeutronsInMC) { + for (const auto& neutron : groupedNeutrons) { + if (selGapSide < -0.5) + break; + + const float eta = neutron.eta(); + switch (selGapSide) { + case 0: // SGA + if (eta > neutronEtaCut) + selGapSide = -1; + break; + case 1: // SGC + if (eta < -neutronEtaCut) + selGapSide = -1; + break; + case 2: // DG + if (eta > neutronEtaCut) + selGapSide = 1; + else if (eta < -neutronEtaCut) + selGapSide = 0; + break; + } + } + } - if (evSels.studyUPConly && (selGapSide < 0)) + if (evSels.studyUPConly && (selGapSide < -0.5)) continue; histos.fill(HIST("eventQA/hSelGapSideNoNeutrons"), selGapSideNoNeutrons); @@ -2298,13 +2087,10 @@ struct Derivedupcanalysis { continue; } // event is accepted - if (collision.isUPC()) { - fillPreSelTimingHistograms(collision); - } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); - int selGapSide = collision.isUPC() ? getGapSide(collision) : o2::aod::sgselector::NoGap; - if (evSels.studyUPConly && (selGapSide < 0)) + int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; + if (evSels.studyUPConly && (selGapSide < -0.5)) continue; fillHistogramsQA(collision, selGapSide); @@ -2353,16 +2139,38 @@ struct Derivedupcanalysis { continue; } // event is accepted - if (collision.isUPC()) { - fillPreSelTimingHistograms(collision); - } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); + int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; + int selGapSideNoNeutrons = selGapSide; + auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex()); - int selGapSideNoNeutrons = collision.isUPC() ? getGapSideWithoutRecoZDC(collision) : o2::aod::sgselector::NoGap; - int selGapSide = applyGeneratedNeutronSelection(selGapSideNoNeutrons, groupedNeutrons); + if (checkNeutronsInMC) { + for (const auto& neutron : groupedNeutrons) { + if (selGapSide < -0.5) + break; + + const float eta = neutron.eta(); + switch (selGapSide) { + case 0: // SGA + if (eta > neutronEtaCut) + selGapSide = -1; + break; + case 1: // SGC + if (eta < -neutronEtaCut) + selGapSide = -1; + break; + case 2: // DG + if (eta > neutronEtaCut) + selGapSide = 1; + else if (eta < -neutronEtaCut) + selGapSide = 0; + break; + } + } + } - if (evSels.studyUPConly && (selGapSide < 0)) + if (evSels.studyUPConly && (selGapSide < -0.5)) continue; histos.fill(HIST("eventQA/hSelGapSideNoNeutrons"), selGapSideNoNeutrons); @@ -2429,11 +2237,6 @@ struct Derivedupcanalysis { continue; } - auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex()); - if (!acceptGeneratedNeutronSelection(groupedNeutrons)) { - continue; - } - // float centrality = -1.f; float ft0ampl = -1.f; int nTracksGlobal = -1; @@ -2490,15 +2293,6 @@ struct Derivedupcanalysis { if (std::abs(mcCollision.posZ()) > maxZVtxPosition) continue; - if (std::find(generatorIds->begin(), generatorIds->end(), mcCollision.generatorsID()) == generatorIds->end()) { - continue; - } - - auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex()); - if (!acceptGeneratedNeutronSelection(groupedNeutrons)) { - continue; - } - // float centrality = -1.f; float ft0ampl = -1.f; int nTracksGlobal = -1; diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index d2d3064d37e..e241a72ef0f 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -15,50 +15,64 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/SPCalibrationTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/StepTHn.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "Math/GenVector/Boost.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" +#include "TF1.h" +#include "TRandom3.h" +#include +#include +#include +#include #include +#include #include -#include -#include +#include +#include -#include +#include +#include #include -#include #include +#include +#include +#include +#include // <<< CHANGED: for dedup sets #include +#include +#include // <<< CHANGED: for seenMap #include #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using std::array; using namespace o2::aod::rctsel; using dauTracks = soa::Join; @@ -76,9 +90,6 @@ struct lambdapolsp { Service pdg; o2::ccdb::CcdbApi ccdbApi; TH1D* hwgtAL; - TH1D* heffL; - TH1D* heffAL; - TH1D* hwgtRESO; // fill output struct : ConfigurableGroup { Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; @@ -90,7 +101,6 @@ struct lambdapolsp { } evselGrp; Configurable globalpt{"globalpt", true, "select tracks based on pt global vs tpc"}; Configurable cqvas{"cqvas", false, "change q vectors after shift correction"}; - Configurable normbymag{"normbymag", false, "normalize by magnitude of q vectors for SP"}; Configurable useprofile{"useprofile", 3, "flag to select profile vs Sparse"}; Configurable sys{"sys", 1, "flag to select systematic source"}; Configurable centestim{"centestim", 0, "flag to select centrality estimator"}; @@ -143,16 +153,10 @@ struct lambdapolsp { Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 3, "PID selections for Lambda daughters"}; Configurable usesubdet{"usesubdet", false, "use subdet"}; Configurable useAccCorr{"useAccCorr", false, "use acceptance correction"}; - Configurable useResoRBR{"useResoRBR", false, "use resolution correction RBR"}; Configurable useyldwgt{"useyldwgt", false, "use yield weight"}; - Configurable useeffwgt{"useeffwgt", false, "use eff weight"}; - Configurable usepsisubbeforeshift{"usepsisubbeforeshift", false, "use psi for sub detectors before shift modification"}; Configurable ConfAccPathL{"ConfAccPathL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrL", "Path to acceptance correction for Lambda"}; Configurable ConfAccPathAL{"ConfAccPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrAL", "Path to acceptance correction for AntiLambda"}; Configurable ConfWgtPathAL{"ConfWgtPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to yield weight correction for AntiLambda"}; - Configurable ConfEffWgtPathL{"ConfEffWgtPathL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to eff weight correction for Lambda"}; - Configurable ConfEffWgtPathAL{"ConfEffWgtPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to eff weight correction for AntiLambda"}; - Configurable ConfResoPath{"ConfResoPath", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrL", "Path to resolution correction run by run"}; struct : ConfigurableGroup { Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; @@ -182,16 +186,6 @@ struct lambdapolsp { ConfigurableAxis configbinAxis{"configbinAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "BA"}; */ // ConfigurableAxis configphiAxis{"configphiAxis", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.8, 1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 5.5, 6.28}, "PhiAxis"}; - - struct : ConfigurableGroup { - Configurable isQA{"isQA", true, "Flag to fill QA"}; - ConfigurableAxis centfineAxis{"centfineAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "Cent V0M"}; - ConfigurableAxis vxfineAxis{"vxfineAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "vx fine axis"}; - ConfigurableAxis vyfineAxis{"vyfineAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "vy fine axis"}; - ConfigurableAxis vzfineAxis{"vzfineAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "vz fine axis"}; - ConfigurableAxis qxZDCAxis{"qxZDCAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "qx axis"}; - ConfigurableAxis psiAxis{"psiAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "psi axis"}; - } QAgrp; struct : ConfigurableGroup { Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; @@ -205,13 +199,12 @@ struct lambdapolsp { ConfigurableAxis configthnAxisPol{"configthnAxisPol", {VARIABLE_WIDTH, -1.0, -0.6, -0.2, 0, 0.2, 0.4, 0.8}, "Pol"}; ConfigurableAxis configbinAxis{"configbinAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "BA"}; } axisGrp; - /* struct : ConfigurableGroup { ConfigurableAxis axisVertex{"axisVertex", {5, -10, 10}, "vertex axis for bin"}; ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {8, 0, 80}, "multiplicity percentile for bin"}; Configurable nMix{"nMix", 5, "number of event mixing"}; } meGrp; - */ + struct : ConfigurableGroup { ConfigurableAxis axisCosine{"axisCosine", {100, 0, 1}, "cosine axis"}; ConfigurableAxis axisRadius{"axisRadius", {200, 0, 100}, "radius axis"}; @@ -223,8 +216,6 @@ struct lambdapolsp { Configurable filldist{"filldist", true, "fill topo distr"}; Configurable lowmasscut{"lowmasscut", 1.11, "low mass cut"}; Configurable highmasscut{"highmasscut", 1.12, "high mass cut"}; - ConfigurableAxis axiscosphiminuspsi{"axiscosphiminuspsi", {200, -1, 1}, "cosphiminuspsi"}; - ConfigurableAxis axiseta{"axiseta", {16, -0.8, 0.8}, "eta axis"}; } distGrp; RCTFlagsChecker rctChecker; @@ -371,12 +362,6 @@ struct lambdapolsp { histos.add("hcentQyZDCA", "hcentQyZDCA", kTH2F, {axisGrp.configcentAxis, spAxis}); histos.add("hcentQxZDCC", "hcentQxZDCC", kTH2F, {axisGrp.configcentAxis, spAxis}); histos.add("hcentQyZDCC", "hcentQyZDCC", kTH2F, {axisGrp.configcentAxis, spAxis}); - - histos.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); - histos.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); - histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); - histos.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); - histos.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); } if (usesubdet) { histos.add("hSparseLambdaCosPsiA", "hSparseLambdaCosPsiA", HistType::kTHnSparseF, runaxes, true); @@ -431,7 +416,7 @@ struct lambdapolsp { } if (distGrp.filldist) { - /*histos.add("hcosinelambda", "hcosinelambda", HistType::kTH1D, {distGrp.axisCosine}, true); + histos.add("hcosinelambda", "hcosinelambda", HistType::kTH1D, {distGrp.axisCosine}, true); histos.add("hdcabwv0daughlambda", "hdcabwv0daughlambda", HistType::kTH1D, {distGrp.axisDca}, true); histos.add("hlifetimelambda", "hlifetimelambda", HistType::kTH1D, {distGrp.axisLT}, true); histos.add("hradiuslambda", "hradiuslambda", HistType::kTH1D, {distGrp.axisRadius}, true); @@ -454,13 +439,6 @@ struct lambdapolsp { histos.add("htpcnegantilambda", "htpcnegantilambda", HistType::kTH1D, {distGrp.axisnsig}, true); histos.add("hptposantilambda", "hptposantilambda", HistType::kTH1D, {distGrp.axispt}, true); histos.add("hptnegantilambda", "hptnegantilambda", HistType::kTH1D, {distGrp.axispt}, true); - */ - histos.add("hALcosphiminuspsiCvseta", "hALcosphiminuspsiCvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); - histos.add("hALcosphiminuspsiAvseta", "hALcosphiminuspsiAvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); - histos.add("hALcosphiminuspsivseta", "hALcosphiminuspsivseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); - histos.add("hLcosphiminuspsiCvseta", "hLcosphiminuspsiCvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); - histos.add("hLcosphiminuspsiAvseta", "hLcosphiminuspsiAvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); - histos.add("hLcosphiminuspsivseta", "hLcosphiminuspsivseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); } histos.add("hSparseGenLambda", "hSparseGenLambda", HistType::kTHnSparseF, runaxes2, true); @@ -468,32 +446,6 @@ struct lambdapolsp { histos.add("hSparseRecLambda", "hSparseRecLambda", HistType::kTHnSparseF, runaxes2, true); histos.add("hSparseRecAntiLambda", "hSparseRecAntiLambda", HistType::kTHnSparseF, runaxes2, true); - if (QAgrp.isQA) { - histos.add("hCentQxZDCA", "hCentQxZDCA", kTH2F, {{QAgrp.centfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hCentQyZDCA", "hCentQyZDCA", kTH2F, {{QAgrp.centfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hCentQxZDCC", "hCentQxZDCC", kTH2F, {{QAgrp.centfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hCentQyZDCC", "hCentQyZDCC", kTH2F, {{QAgrp.centfineAxis}, {QAgrp.qxZDCAxis}}); - - histos.add("hvxQxZDCA", "hvxQxZDCA", kTH2F, {{QAgrp.vxfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvxQyZDCA", "hvxQyZDCA", kTH2F, {{QAgrp.vxfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvxQxZDCC", "hvxQxZDCC", kTH2F, {{QAgrp.vxfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvxQyZDCC", "hvxQyZDCC", kTH2F, {{QAgrp.vxfineAxis}, {QAgrp.qxZDCAxis}}); - - histos.add("hvyQxZDCA", "hvyQxZDCA", kTH2F, {{QAgrp.vyfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvyQyZDCA", "hvyQyZDCA", kTH2F, {{QAgrp.vyfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvyQxZDCC", "hvyQxZDCC", kTH2F, {{QAgrp.vyfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvyQyZDCC", "hvyQyZDCC", kTH2F, {{QAgrp.vyfineAxis}, {QAgrp.qxZDCAxis}}); - - histos.add("hvzQxZDCA", "hvzQxZDCA", kTH2F, {{QAgrp.vzfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvzQyZDCA", "hvzQyZDCA", kTH2F, {{QAgrp.vzfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvzQxZDCC", "hvzQxZDCC", kTH2F, {{QAgrp.vzfineAxis}, {QAgrp.qxZDCAxis}}); - histos.add("hvzQyZDCC", "hvzQyZDCC", kTH2F, {{QAgrp.vzfineAxis}, {QAgrp.qxZDCAxis}}); - - histos.add("PsiZDCC", "PsiZDCC", kTH2F, {QAgrp.centfineAxis, QAgrp.psiAxis}); - histos.add("PsiZDCA", "PsiZDCA", kTH2F, {QAgrp.centfineAxis, QAgrp.psiAxis}); - histos.add("PsiZDC", "PsiZDC", kTH2F, {QAgrp.centfineAxis, QAgrp.psiAxis}); - } - ccdb->setURL(cfgCcdbParam.cfgURL); ccdbApi.init("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -501,12 +453,6 @@ struct lambdapolsp { ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); LOGF(info, "Getting alignment offsets from the CCDB..."); hwgtAL = ccdb->getForTimeStamp(ConfWgtPathAL.value, cfgCcdbParam.nolaterthan.value); - if (useeffwgt) { - heffL = ccdb->getForTimeStamp(ConfEffWgtPathL.value, cfgCcdbParam.nolaterthan.value); - heffAL = ccdb->getForTimeStamp(ConfEffWgtPathAL.value, cfgCcdbParam.nolaterthan.value); - } - if (useResoRBR) - hwgtRESO = ccdb->getForTimeStamp(ConfResoPath.value, cfgCcdbParam.nolaterthan.value); } template @@ -739,7 +685,7 @@ struct lambdapolsp { void fillHistograms(bool tag1, bool tag2, const ROOT::Math::PxPyPzMVector& particle, const ROOT::Math::PxPyPzMVector& daughter, double psiZDCC, double psiZDCA, double psiZDC, double centrality, - double candmass, double candpt, float desbinvalue, double acvalue, double wgtfactor, double resowgt) + double candmass, double candpt, float desbinvalue, double acvalue, double wgtfactor) { TRandom3 randPhi(0); @@ -761,17 +707,14 @@ struct lambdapolsp { auto PolC = TMath::Sin(phiminuspsiC); auto PolA = TMath::Sin(phiminuspsiA); auto Pol = TMath::Sin(phiminuspsi); + // auto PolSP = uy * TMath::Cos(psiZDC) - ux * TMath::Sin(psiZDC); + auto PolSP = uy * (modqxZDCC - modqxZDCA) - ux * (modqyZDCC - modqyZDCA); auto sinPhiStar = TMath::Sin(GetPhiInRange(phiangle)); auto cosPhiStar = TMath::Cos(GetPhiInRange(phiangle)); // auto sinThetaStarcosphiphiStar = sinThetaStar * TMath::Cos(2 * GetPhiInRange(particle.Phi() - phiangle)); // auto phiphiStar = GetPhiInRange(particle.Phi() - phiangle); acvalue = (4 / 3.14) * acvalue; - if (useResoRBR) { - Pol = Pol / resowgt; - PolA = PolA / resowgt; - PolC = PolC / resowgt; - } // PolC = PolC / acvalue; // PolA = PolA / acvalue; // Pol = Pol / acvalue; @@ -779,26 +722,8 @@ struct lambdapolsp { auto PolAwgt = PolA / acvalue; auto PolCwgt = PolC / acvalue; - // for SP calculation - const double qx = (modqxZDCC - modqxZDCA); - const double qy = (modqyZDCC - modqyZDCA); - const double qmag = std::sqrt(qx * qx + qy * qy); - auto PolSP = uy * (modqxZDCC - modqxZDCA) - ux * (modqyZDCC - modqyZDCA); - if (normbymag && qmag > 0.0) - PolSP = PolSP / qmag; - // SP numerators with A and C separately (use Q components) - auto PolSP_A = uy * modqxZDCA - ux * modqyZDCA; // u_y QxA - u_x QyA - auto PolSP_C = uy * modqxZDCC - ux * modqyZDCC; // u_y QxC - u_x QyC - - if (randGrp.useSP) { - Pol = PolSP; - PolA = PolSP_A; - PolC = PolSP_C; + if (randGrp.useSP) Polwgt = PolSP / acvalue; - PolAwgt = PolSP_A / acvalue; - PolCwgt = PolSP_C / acvalue; - } - ////////////////////////////// // Fill histograms using constructed names if (tag2) { @@ -850,10 +775,6 @@ struct lambdapolsp { // histos.fill(HIST("hSparseAntiLambda_corr1c"), candmass, candpt, phiphiStar, centrality, wgtfactor); histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, candpt, sinThetaStar, centrality, wgtfactor); // histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, candpt, sinThetaStarcosphiphiStar, centrality, wgtfactor); - if (randGrp.useSP) { - histos.fill(HIST("hSparseAntiLambda_avgux"), candmass, candpt, ux, centrality); - histos.fill(HIST("hSparseAntiLambda_avguy"), candmass, candpt, uy, centrality); - } } } if (tag1) { @@ -905,10 +826,6 @@ struct lambdapolsp { // histos.fill(HIST("hSparseLambda_corr1c"), candmass, candpt, phiphiStar, centrality, wgtfactor); histos.fill(HIST("hSparseLambda_corr2a"), candmass, candpt, sinThetaStar, centrality, wgtfactor); // histos.fill(HIST("hSparseLambda_corr2b"), candmass, candpt, sinThetaStarcosphiphiStar, centrality, wgtfactor); - if (randGrp.useSP) { - histos.fill(HIST("hSparseLambda_avgux"), candmass, candpt, ux, centrality); - histos.fill(HIST("hSparseLambda_avguy"), candmass, candpt, uy, centrality); - } } } } @@ -986,20 +903,13 @@ struct lambdapolsp { // currentRunNumber = collision.foundBC_as().runNumber(); auto bc = collision.foundBC_as(); - auto vz = collision.vz(); - auto vx = collision.vx(); - auto vy = collision.vy(); - auto qxZDCA = collision.qxZDCA(); auto qxZDCC = collision.qxZDCC(); auto qyZDCA = collision.qyZDCA(); auto qyZDCC = collision.qyZDCC(); auto psiZDCC = collision.psiZDCC(); auto psiZDCA = collision.psiZDCA(); - if (usepsisubbeforeshift) { - psiZDCC = 1.0 * std::atan2(qyZDCC, qxZDCC); - psiZDCA = 1.0 * std::atan2(qyZDCA, qxZDCA); - } + if (cqvas) { modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA); modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA); @@ -1013,42 +923,20 @@ struct lambdapolsp { } auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane*/ - /*if (useonlypsis) { psiZDC = psiZDCC - psiZDCA; }*/ - if (QAgrp.isQA) { - histos.fill(HIST("hCentQxZDCA"), centrality, modqxZDCA); - histos.fill(HIST("hCentQyZDCA"), centrality, modqyZDCA); - histos.fill(HIST("hCentQxZDCC"), centrality, modqxZDCC); - histos.fill(HIST("hCentQyZDCC"), centrality, modqyZDCC); - - histos.fill(HIST("hvxQxZDCA"), vx, modqxZDCA); - histos.fill(HIST("hvxQyZDCA"), vx, modqyZDCA); - histos.fill(HIST("hvxQxZDCC"), vx, modqxZDCC); - histos.fill(HIST("hvxQyZDCC"), vx, modqyZDCC); - - histos.fill(HIST("hvyQxZDCA"), vy, modqxZDCA); - histos.fill(HIST("hvyQyZDCA"), vy, modqyZDCA); - histos.fill(HIST("hvyQxZDCC"), vy, modqxZDCC); - histos.fill(HIST("hvyQyZDCC"), vy, modqyZDCC); - - histos.fill(HIST("hvzQxZDCA"), vz, modqxZDCA); - histos.fill(HIST("hvzQyZDCA"), vz, modqyZDCA); - histos.fill(HIST("hvzQxZDCC"), vz, modqxZDCC); - histos.fill(HIST("hvzQyZDCC"), vz, modqyZDCC); - - histos.fill(HIST("PsiZDCA"), centrality, psiZDCA); - histos.fill(HIST("PsiZDCC"), centrality, psiZDCC); - histos.fill(HIST("PsiZDC"), centrality, psiZDC); - } - histos.fill(HIST("hCentrality"), centrality); if (!checkwithpub) { // histos.fill(HIST("hVtxZ"), collision.posZ()); if (randGrp.useSP) { histos.fill(HIST("hpRes"), centrality, ((modqxZDCA * modqxZDCC) + (modqyZDCA * modqyZDCC))); + // histos.fill(HIST("hpResSin"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA - psiZDCC)))); + /*histos.fill(HIST("hpCosPsiA"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA)))); + histos.fill(HIST("hpCosPsiC"), centrality, (TMath::Cos(GetPhiInRange(psiZDCC)))); + histos.fill(HIST("hpSinPsiA"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA)))); + histos.fill(HIST("hpSinPsiC"), centrality, (TMath::Sin(GetPhiInRange(psiZDCC))));*/ histos.fill(HIST("hcentQxZDCA"), centrality, modqxZDCA); histos.fill(HIST("hcentQyZDCA"), centrality, modqyZDCA); histos.fill(HIST("hcentQxZDCC"), centrality, modqxZDCC); @@ -1058,15 +946,6 @@ struct lambdapolsp { } } - double resowgt = 1.0; - - if (useResoRBR) { - int binxreso = hwgtRESO->GetXaxis()->FindBin(centrality + 0.000001); - resowgt = hwgtRESO->GetBinContent(binxreso); - } else { - resowgt = 1.0; - } - ///////////checking v1//////////////////////////////// if (checkwithpub) { @@ -1261,6 +1140,7 @@ struct lambdapolsp { int taga = LambdaTag; int tagb = aLambdaTag; + // if (useAccCorr && (currentRunNumber != lastRunNumber)) { if (useAccCorr) { accprofileL = ccdb->getForTimeStamp(ConfAccPathL.value, bc.timestamp()); accprofileAL = ccdb->getForTimeStamp(ConfAccPathAL.value, bc.timestamp()); @@ -1275,79 +1155,147 @@ struct lambdapolsp { wgtvalue = 1.0; } - if (LambdaTag) { - Lambda = Proton + AntiPion; - tagb = 0; - if (useAccCorr) { - int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; + float desbinvalue = 0.0; + if (dosystematic) { + //////////////////////////////////////////////////// + float LTsys = TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda); + float CPAsys = v0.v0cosPA(); + float DCADaughsys = TMath::Abs(v0.dcaV0daughters()); + float DCApossys = TMath::Abs(v0.dcapostopv()); + float DCAnegsys = TMath::Abs(v0.dcanegtopv()); + float sysvar = -999.9; + double syst[10]; + if (sys == 1) { + double temp[10] = {26, 27, 28, 29, 30, 31, 32, 33, 34, 35}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = LTsys; } - if (distGrp.filldist && aLambdaTag == 0 && Lambda.M() > distGrp.lowmasscut && Lambda.M() < distGrp.highmasscut) { - /*histos.fill(HIST("hcosinelambda"), v0.v0cosPA()); - histos.fill(HIST("hdcabwv0daughlambda"), v0.dcaV0daughters()); - histos.fill(HIST("hlifetimelambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); - histos.fill(HIST("hradiuslambda"), v0.v0radius()); - histos.fill(HIST("htpcCRlambda"), postrack.tpcNClsCrossedRows()); - histos.fill(HIST("hdcaposlambda"), v0.dcapostopv()); - histos.fill(HIST("hdcaneglambda"), v0.dcanegtopv()); - histos.fill(HIST("htpcposlambda"), postrack.tpcNSigmaPr()); - histos.fill(HIST("htpcneglambda"), negtrack.tpcNSigmaPi()); - histos.fill(HIST("hptposlambda"), Proton.Pt()); - histos.fill(HIST("hptneglambda"), AntiPion.Pt());*/ - auto phiL = TMath::ATan2(v0.py(), v0.px()); - auto LcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiL - psiZDCC)); - auto LcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiL - psiZDCA)); - auto Lcosphiminuspsi = TMath::Cos(GetPhiInRange(phiL - psiZDC)); - histos.fill(HIST("hLcosphiminuspsiCvseta"), LcosphiminuspsiC, v0.eta()); - histos.fill(HIST("hLcosphiminuspsiAvseta"), LcosphiminuspsiA, v0.eta()); - histos.fill(HIST("hLcosphiminuspsivseta"), Lcosphiminuspsi, v0.eta()); + if (sys == 2) { + double temp[10] = {0.992, 0.993, 0.9935, 0.994, 0.9945, 0.995, 0.9955, 0.996, 0.9965, 0.997}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = CPAsys; + } + if (sys == 3) { + double temp[10] = {0.8, 0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = DCADaughsys; + } + if (sys == 4) { + double temp[10] = {0.05, 0.07, 0.1, 0.15, 0.18, 0.2, 0.22, 0.25, 0.28, 0.3}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = DCApossys; + } + if (sys == 5) { + double temp[10] = {0.05, 0.07, 0.1, 0.15, 0.18, 0.2, 0.22, 0.25, 0.28, 0.3}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = DCAnegsys; } - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); - } - tagb = aLambdaTag; - if (aLambdaTag) { - AntiLambda = AntiProton + Pion; - taga = 0; - if (useAccCorr) { - int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileAL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; + for (int i = 0; i < 10; i++) { + if (sys == 1 || sys == 3) { + if (sysvar < syst[i]) + desbinvalue = i + 0.5; + else + continue; + } + if (sys == 2 || sys == 4 || sys == 5) { + if (sysvar > syst[i]) + desbinvalue = i + 0.5; + else + continue; + } + + /////////////////////////////////////////////////// + if (LambdaTag) { + Lambda = Proton + AntiPion; + tagb = 0; + if (useAccCorr) { + int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; + } + + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), desbinvalue, acvalue, 1.0); + } + + tagb = aLambdaTag; + if (aLambdaTag) { + AntiLambda = AntiProton + Pion; + taga = 0; + if (useAccCorr) { + int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileAL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; + } + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), desbinvalue, acvalue, 1.0); + } } - if (distGrp.filldist && LambdaTag == 0 && AntiLambda.M() > distGrp.lowmasscut && AntiLambda.M() < distGrp.highmasscut) { - /*histos.fill(HIST("hcosineantilambda"), v0.v0cosPA()); - histos.fill(HIST("hdcabwv0daughantilambda"), v0.dcaV0daughters()); - histos.fill(HIST("hlifetimeantilambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); - histos.fill(HIST("hradiusantilambda"), v0.v0radius()); - histos.fill(HIST("htpcCRantilambda"), postrack.tpcNClsCrossedRows()); - histos.fill(HIST("hdcaposantilambda"), v0.dcapostopv()); - histos.fill(HIST("hdcanegantilambda"), v0.dcanegtopv()); - histos.fill(HIST("htpcposantilambda"), postrack.tpcNSigmaPi()); - histos.fill(HIST("htpcnegantilambda"), negtrack.tpcNSigmaPr()); - histos.fill(HIST("hptposantilambda"), Pion.Pt()); - histos.fill(HIST("hptnegantilambda"), AntiProton.Pt());*/ - auto phiAL = TMath::ATan2(v0.py(), v0.px()); - auto ALcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiAL - psiZDCC)); - auto ALcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiAL - psiZDCA)); - auto ALcosphiminuspsi = TMath::Cos(GetPhiInRange(phiAL - psiZDC)); - histos.fill(HIST("hALcosphiminuspsiCvseta"), ALcosphiminuspsiC, v0.eta()); - histos.fill(HIST("hALcosphiminuspsiAvseta"), ALcosphiminuspsiA, v0.eta()); - histos.fill(HIST("hALcosphiminuspsivseta"), ALcosphiminuspsi, v0.eta()); + } else { + if (LambdaTag) { + Lambda = Proton + AntiPion; + tagb = 0; + if (useAccCorr) { + int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; + } + if (distGrp.filldist && aLambdaTag == 0 && Lambda.M() > distGrp.lowmasscut && Lambda.M() < distGrp.highmasscut) { + histos.fill(HIST("hcosinelambda"), v0.v0cosPA()); + histos.fill(HIST("hdcabwv0daughlambda"), v0.dcaV0daughters()); + histos.fill(HIST("hlifetimelambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); + histos.fill(HIST("hradiuslambda"), v0.v0radius()); + histos.fill(HIST("htpcCRlambda"), postrack.tpcNClsCrossedRows()); + histos.fill(HIST("hdcaposlambda"), v0.dcapostopv()); + histos.fill(HIST("hdcaneglambda"), v0.dcanegtopv()); + histos.fill(HIST("htpcposlambda"), postrack.tpcNSigmaPr()); + histos.fill(HIST("htpcneglambda"), negtrack.tpcNSigmaPi()); + histos.fill(HIST("hptposlambda"), Proton.Pt()); + histos.fill(HIST("hptneglambda"), AntiPion.Pt()); + } + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0); + } + + tagb = aLambdaTag; + if (aLambdaTag) { + AntiLambda = AntiProton + Pion; + taga = 0; + if (useAccCorr) { + int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileAL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; + } + if (distGrp.filldist && LambdaTag == 0 && AntiLambda.M() > distGrp.lowmasscut && AntiLambda.M() < distGrp.highmasscut) { + histos.fill(HIST("hcosineantilambda"), v0.v0cosPA()); + histos.fill(HIST("hdcabwv0daughantilambda"), v0.dcaV0daughters()); + histos.fill(HIST("hlifetimeantilambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); + histos.fill(HIST("hradiusantilambda"), v0.v0radius()); + histos.fill(HIST("htpcCRantilambda"), postrack.tpcNClsCrossedRows()); + histos.fill(HIST("hdcaposantilambda"), v0.dcapostopv()); + histos.fill(HIST("hdcanegantilambda"), v0.dcanegtopv()); + histos.fill(HIST("htpcposantilambda"), postrack.tpcNSigmaPi()); + histos.fill(HIST("htpcnegantilambda"), negtrack.tpcNSigmaPr()); + histos.fill(HIST("hptposantilambda"), Pion.Pt()); + histos.fill(HIST("hptnegantilambda"), AntiProton.Pt()); + } + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue); } - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue, resowgt); } } } + // lastRunNumber = currentRunNumber; } PROCESS_SWITCH(lambdapolsp, processData, "Process data", true); // process function for derived data - mimics the functionality of the original data - void processDerivedData(soa::Join::iterator const& collision, v0Candidates const& V0s, dauTracks const&) + void processDerivedData(soa::Join::iterator const& collision, v0Candidates const& V0s, dauTracks const&) { //___________________________________________________________________________________________________ // event selection @@ -1364,11 +1312,8 @@ struct lambdapolsp { else if (centestim == 3) centrality = collision.centFV0A(); - auto vz = collision.posZ(); - auto vx = collision.posX(); - auto vy = collision.posY(); - auto runnumber = collision.runNumber(); + // auto centrality = collision.centFT0C(); if (!collision.triggereventsp()) { // provided by StraZDCSP return; } @@ -1394,6 +1339,14 @@ struct lambdapolsp { return; } + /*currentRunNumber = collision.foundBC_as().runNumber(); + auto bc = collision.foundBC_as(); + + if (useAccCorr && (currentRunNumber != lastRunNumber)) { + accprofileL = ccdb->getForTimeStamp(ConfAccPathL.value, bc.timestamp()); + accprofileAL = ccdb->getForTimeStamp(ConfAccPathAL.value, bc.timestamp()); + } + */ auto timestamps = ccdb->getRunDuration(runnumber, true); /// fatalise if timestamps are not found int64_t sorTimestamp = timestamps.first; // timestamp of the SOR/SOX/STF in ms int64_t eorTimestamp = timestamps.second; // timestamp of the EOR/EOX/ETF in ms @@ -1412,10 +1365,11 @@ struct lambdapolsp { auto qyZDCC = collision.qyZDCC(); auto psiZDCC = collision.psiZDCC(); auto psiZDCA = collision.psiZDCA(); - if (usepsisubbeforeshift) { - psiZDCC = 1.0 * std::atan2(qyZDCC, qxZDCC); - psiZDCA = 1.0 * std::atan2(qyZDCA, qxZDCA); - } + /*double modqxZDCA; + double modqyZDCA; + double modqxZDCC; + double modqyZDCC;*/ + if (cqvas) { modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA); modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA); @@ -1430,76 +1384,26 @@ struct lambdapolsp { auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane - if (QAgrp.isQA) { - histos.fill(HIST("hCentQxZDCA"), centrality, modqxZDCA); - histos.fill(HIST("hCentQyZDCA"), centrality, modqyZDCA); - histos.fill(HIST("hCentQxZDCC"), centrality, modqxZDCC); - histos.fill(HIST("hCentQyZDCC"), centrality, modqyZDCC); - - histos.fill(HIST("hvxQxZDCA"), vx, modqxZDCA); - histos.fill(HIST("hvxQyZDCA"), vx, modqyZDCA); - histos.fill(HIST("hvxQxZDCC"), vx, modqxZDCC); - histos.fill(HIST("hvxQyZDCC"), vx, modqyZDCC); - - histos.fill(HIST("hvyQxZDCA"), vy, modqxZDCA); - histos.fill(HIST("hvyQyZDCA"), vy, modqyZDCA); - histos.fill(HIST("hvyQxZDCC"), vy, modqxZDCC); - histos.fill(HIST("hvyQyZDCC"), vy, modqyZDCC); - - histos.fill(HIST("hvzQxZDCA"), vz, modqxZDCA); - histos.fill(HIST("hvzQyZDCA"), vz, modqyZDCA); - histos.fill(HIST("hvzQxZDCC"), vz, modqxZDCC); - histos.fill(HIST("hvzQyZDCC"), vz, modqyZDCC); - - histos.fill(HIST("PsiZDCA"), centrality, psiZDCA); - histos.fill(HIST("PsiZDCC"), centrality, psiZDCC); - histos.fill(HIST("PsiZDC"), centrality, psiZDC); - } - // fill histograms histos.fill(HIST("hCentrality"), centrality); if (!checkwithpub) { // histos.fill(HIST("hVtxZ"), collision.posZ()); if (randGrp.useSP) { - const double magA = std::sqrt(modqxZDCA * modqxZDCA + modqyZDCA * modqyZDCA); - const double magC = std::sqrt(modqxZDCC * modqxZDCC + modqyZDCC * modqyZDCC); - double cosPsiAminusC = 0.0; - if (normbymag && magA > 0. && magC > 0.) { - cosPsiAminusC = (modqxZDCA * modqxZDCC + modqyZDCA * modqyZDCC) / (magA * magC); - } else { - cosPsiAminusC = (modqxZDCA * modqxZDCC + modqyZDCA * modqyZDCC); - } - // histos.fill(HIST("hpRes"), centrality, ((modqxZDCA * modqxZDCC) + (modqyZDCA * modqyZDCC))); - histos.fill(HIST("hpRes"), centrality, cosPsiAminusC); + histos.fill(HIST("hpRes"), centrality, ((modqxZDCA * modqxZDCC) + (modqyZDCA * modqyZDCC))); + // histos.fill(HIST("hpResSin"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA - psiZDCC)))); + /*histos.fill(HIST("hpCosPsiA"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA)))); + histos.fill(HIST("hpCosPsiC"), centrality, (TMath::Cos(GetPhiInRange(psiZDCC)))); + histos.fill(HIST("hpSinPsiA"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA)))); + histos.fill(HIST("hpSinPsiC"), centrality, (TMath::Sin(GetPhiInRange(psiZDCC))));*/ histos.fill(HIST("hcentQxZDCA"), centrality, modqxZDCA); histos.fill(HIST("hcentQyZDCA"), centrality, modqyZDCA); histos.fill(HIST("hcentQxZDCC"), centrality, modqxZDCC); histos.fill(HIST("hcentQyZDCC"), centrality, modqyZDCC); - - auto QxtQxp = modqxZDCA * modqxZDCC; - auto QytQyp = modqyZDCA * modqyZDCC; - auto Qxytp = QxtQxp + QytQyp; - auto QxpQyt = modqxZDCA * modqyZDCC; - auto QxtQyp = modqxZDCC * modqyZDCA; - - histos.fill(HIST("hpQxtQxpvscent"), centrality, QxtQxp); - histos.fill(HIST("hpQytQypvscent"), centrality, QytQyp); - histos.fill(HIST("hpQxytpvscent"), centrality, Qxytp); - histos.fill(HIST("hpQxpQytvscent"), centrality, QxpQyt); - histos.fill(HIST("hpQxtQypvscent"), centrality, QxtQyp); } else { histos.fill(HIST("hpRes"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA - psiZDCC)))); } } - double resowgt = 1.0; - if (useResoRBR) { - int binxreso = hwgtRESO->GetXaxis()->FindBin(centrality + 0.000001); - resowgt = hwgtRESO->GetBinContent(binxreso); - } else { - resowgt = 1.0; - } - //___________________________________________________________________________________________________ // loop over V0s as necessary for (const auto& v0 : V0s) { @@ -1528,11 +1432,13 @@ struct lambdapolsp { Proton = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPr); AntiPion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPi); Lambdadummy = Proton + AntiPion; + // angleLambda = calculateAngleBetweenLorentzVectors(Proton, AntiPion); } if (aLambdaTag) { AntiProton = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPr); Pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPi); AntiLambdadummy = AntiProton + Pion; + // angleAntiLambda = calculateAngleBetweenLorentzVectors(AntiProton, Pion); } if (shouldReject(LambdaTag, aLambdaTag, Lambdadummy, AntiLambdadummy)) { @@ -1555,93 +1461,129 @@ struct lambdapolsp { int tagb = aLambdaTag; int tagc = K0sTag; + float desbinvalue = 0.0; + if (analyzeK0s && K0sTag) { K0s = Pion + AntiPion; double acvalue = 1.0; - fillHistograms(tagc, 0, K0s, Pion, psiZDCC, psiZDCA, psiZDC, centrality, v0.mK0Short(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); - } - - int binxwgt; - double wgtvalue; - int binxwgtAL; - double effwgtvalueAL; - double effwgtvalueL; + fillHistograms(tagc, 0, K0s, Pion, psiZDCC, psiZDCA, psiZDC, centrality, v0.mK0Short(), v0.pt(), v0.eta(), acvalue, 1.0); + } + + if (analyzeLambda && dosystematic) { + //////////////////////////////////////////////////// + float LTsys = TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda); + float CPAsys = v0.v0cosPA(); + float DCADaughsys = TMath::Abs(v0.dcaV0daughters()); + float DCApossys = TMath::Abs(v0.dcapostopv()); + float DCAnegsys = TMath::Abs(v0.dcanegtopv()); + float sysvar = -999.9; + double syst[10]; + if (sys == 1) { + double temp[10] = {26, 27, 28, 29, 30, 31, 32, 33, 34, 35}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = LTsys; + } + if (sys == 2) { + double temp[10] = {0.992, 0.993, 0.9935, 0.994, 0.9945, 0.995, 0.9955, 0.996, 0.9965, 0.997}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = CPAsys; + } + if (sys == 3) { + double temp[10] = {0.8, 0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = DCADaughsys; + } + if (sys == 4) { + double temp[10] = {0.05, 0.07, 0.1, 0.15, 0.18, 0.2, 0.22, 0.25, 0.28, 0.3}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = DCApossys; + } + if (sys == 5) { + double temp[10] = {0.05, 0.07, 0.1, 0.15, 0.18, 0.2, 0.22, 0.25, 0.28, 0.3}; + std::copy(std::begin(temp), std::end(temp), std::begin(syst)); + sysvar = DCAnegsys; + } - if (useyldwgt) { - binxwgt = hwgtAL->GetXaxis()->FindBin(v0.pt()); - wgtvalue = hwgtAL->GetBinContent(binxwgt); - } else { - wgtvalue = 1.0; - } - if (useeffwgt) { - binxwgtAL = heffAL->GetXaxis()->FindBin(v0.pt()); - effwgtvalueAL = heffAL->GetBinContent(binxwgtAL); - effwgtvalueL = heffL->GetBinContent(binxwgtAL); - } else { - effwgtvalueAL = 1.0; - effwgtvalueL = 1.0; - } + for (int i = 0; i < 10; i++) { + if (sys == 1 || sys == 3) { + if (sysvar < syst[i]) + desbinvalue = i + 0.5; + else + continue; + } + if (sys == 2 || sys == 4 || sys == 5) { + if (sysvar > syst[i]) + desbinvalue = i + 0.5; + else + continue; + } - if (analyzeLambda && LambdaTag) { - Lambda = Proton + AntiPion; - tagb = 0; - double acvalue = 1.0; - if (useAccCorr) { - int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; - } + /////////////////////////////////////////////////// + if (analyzeLambda && LambdaTag) { + Lambda = Proton + AntiPion; + tagb = 0; + double acvalue = 1.0; + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), desbinvalue, acvalue, 1.0); + } - if (distGrp.filldist && aLambdaTag == 0 && Lambda.M() > distGrp.lowmasscut && Lambda.M() < distGrp.highmasscut) { - auto phiL = TMath::ATan2(v0.py(), v0.px()); - auto LcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiL - psiZDCC)); - auto LcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiL - psiZDCA)); - auto Lcosphiminuspsi = TMath::Cos(GetPhiInRange(phiL - psiZDC)); - histos.fill(HIST("hLcosphiminuspsiCvseta"), LcosphiminuspsiC, v0.eta()); - histos.fill(HIST("hLcosphiminuspsiAvseta"), LcosphiminuspsiA, v0.eta()); - histos.fill(HIST("hLcosphiminuspsivseta"), Lcosphiminuspsi, v0.eta()); + tagb = aLambdaTag; + if (analyzeLambda && aLambdaTag) { + AntiLambda = AntiProton + Pion; + taga = 0; + double acvalue = 1.0; + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), desbinvalue, acvalue, 1.0); + } } + } else { - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, (1. / effwgtvalueL), resowgt); - } - - tagb = aLambdaTag; - if (analyzeLambda && aLambdaTag) { - AntiLambda = AntiProton + Pion; - taga = 0; - double acvalue = 1.0; - if (useAccCorr) { - int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileAL->GetBinContent(binx, biny); + int binxwgt; + double wgtvalue; + if (useyldwgt) { + binxwgt = hwgtAL->GetXaxis()->FindBin(v0.pt()); + wgtvalue = hwgtAL->GetBinContent(binxwgt); } else { - acvalue = 1.0; + wgtvalue = 1.0; } - - if (distGrp.filldist && LambdaTag == 0 && AntiLambda.M() > distGrp.lowmasscut && AntiLambda.M() < distGrp.highmasscut) { - auto phiAL = TMath::ATan2(v0.py(), v0.px()); - auto ALcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiAL - psiZDCC)); - auto ALcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiAL - psiZDCA)); - auto ALcosphiminuspsi = TMath::Cos(GetPhiInRange(phiAL - psiZDC)); - histos.fill(HIST("hALcosphiminuspsiCvseta"), ALcosphiminuspsiC, v0.eta()); - histos.fill(HIST("hALcosphiminuspsiAvseta"), ALcosphiminuspsiA, v0.eta()); - histos.fill(HIST("hALcosphiminuspsivseta"), ALcosphiminuspsi, v0.eta()); + if (analyzeLambda && LambdaTag) { + Lambda = Proton + AntiPion; + tagb = 0; + double acvalue = 1.0; + if (useAccCorr) { + int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; + } + // double acvalue = 1.0; + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0); } - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue * (1. / effwgtvalueAL), resowgt); + tagb = aLambdaTag; + if (analyzeLambda && aLambdaTag) { + AntiLambda = AntiProton + Pion; + taga = 0; + double acvalue = 1.0; + if (useAccCorr) { + int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileAL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; + } + // double acvalue = 1.0; + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue); + } } } // lastRunNumber = currentRunNumber; } PROCESS_SWITCH(lambdapolsp, processDerivedData, "Process derived data", false); - /* using TrackMCTrueTable = aod::McParticles; ROOT::Math::PxPyPzMVector lambdadummymc, antiLambdadummymc, protonmc, pionmc, antiProtonmc, antiPionmc; - void processMC(EventCandidatesMC::iterator const& collision, AllTrackCandidates const& tracks, TrackMCTrueTable const& GenParticles, ResoV0s const& V0s) + void processMC(EventCandidatesMC::iterator const& collision, AllTrackCandidates const& /*tracks*/, TrackMCTrueTable const& GenParticles, ResoV0s const& V0s) { if (!collision.sel8()) { return; @@ -1771,7 +1713,7 @@ struct lambdapolsp { } } PROCESS_SWITCH(lambdapolsp, processMC, "Process MC", false); -*/ + // Processing Event Mixing /* using BinningType = ColumnBinningPolicy; diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index b41281dedcf..7aee4ffe6f6 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -20,47 +20,48 @@ // #include "PWGLF/DataModel/LFSigmaTables.h" +#include "PWGLF/DataModel/LFStrangenessMLTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" + +#include "CCDB/BasicCCDBManager.h" +#include "Framework/ASoA.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include +#include +#include +#include +#include #include -#include +#include #include #include #include #include -#include -#include -#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using Sigma0s = soa::Join; +using std::array; using MCSigma0s = soa::Join; -using Sigma0sWithEMCal = soa::Join; -using MCSigma0sWithEMCal = soa::Join; +using Sigma0s = soa::Join; static const std::vector PhotonSels = {"NoSel", "V0Type", "DCADauToPV", "DCADau", "DauTPCCR", "TPCNSigmaEl", "V0pT", @@ -73,34 +74,24 @@ static const std::vector LambdaSels = {"NoSel", "V0Radius", "DCADau static const std::vector DirList = {"BeforeSel", "AfterSel"}; -enum CentEstimator { - kCentFT0C = 0, - kCentFT0M, - kCentFT0CVariant1, - kCentMFT, - kCentNGlobal, - kCentFV0A -}; - struct sigmaanalysis { Service ccdb; ctpRateFetcher rateFetcher; //__________________________________________________ - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // For manual sliceBy + // SliceCache cache; + PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; - // Species - Configurable doLambdaStar{"doLambdaStar", false, "Build Lambda(1520) instead of Sigma0"}; + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Event level Configurable doPPAnalysis{"doPPAnalysis", true, "if in pp, set to true"}; - Configurable centralityEstimator{"centralityEstimator", kCentFT0C, "Run 3 centrality estimator (0:CentFT0C, 1:CentFT0M, 2:CentFT0CVariant1, 3:CentMFT, 4:CentNGlobal, 5:CentFV0A)"}; Configurable fGetIR{"fGetIR", false, "Flag to retrieve the IR info."}; Configurable fIRCrashOnNull{"fIRCrashOnNull", false, "Flag to avoid CTP RateFetcher crash."}; Configurable irSource{"irSource", "T0VTX", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; struct : ConfigurableGroup { - std::string prefix = "eventSelections"; // JSON group name Configurable requireSel8{"requireSel8", true, "require sel8 event selection"}; Configurable requireTriggerTVX{"requireTriggerTVX", true, "require FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level"}; Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border"}; @@ -133,27 +124,20 @@ struct sigmaanalysis { } eventSelections; // Generated Sigma0s - struct : ConfigurableGroup { - std::string prefix = "genSelections"; // JSON group name - Configurable mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."}; - Configurable mc_rapidityMin{"mc_rapidityMin", -0.5, "Min generated particle rapidity"}; - Configurable mc_rapidityMax{"mc_rapidityMax", 0.5, "Max generated particle rapidity"}; - } genSelections; + Configurable mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."}; // QA - Configurable fdoSigma0QA{"doSigma0QA", false, "if true, perform Sigma0 QA analysis. Only works with MC."}; Configurable fillBkgQAhistos{"fillBkgQAhistos", false, "if true, fill MC QA histograms for Bkg study. Only works with MC."}; Configurable fillResoQAhistos{"fillResoQAhistos", false, "if true, fill MC QA histograms for pT resolution study. Only works with MC."}; - Configurable fillSelhistos{"fillSelhistos", true, "if true, fill QA histos for selections."}; // Analysis strategy: Configurable doMCAssociation{"doMCAssociation", false, "Flag to process only signal candidates. Use only with processMonteCarlo!"}; Configurable selRecoFromGenerator{"selRecoFromGenerator", false, "Flag to process only signal candidates from generator"}; + Configurable doPhotonLambdaSelQA{"doPhotonLambdaSelQA", false, "Flag to fill photon and lambda QA histos!"}; // For Selection: //// Lambda criteria:: struct : ConfigurableGroup { - std::string prefix = "lambdaSelections"; // JSON group name Configurable Lambda_MLThreshold{"Lambda_MLThreshold", 0.1, "Decision Threshold value to select lambdas"}; Configurable AntiLambda_MLThreshold{"AntiLambda_MLThreshold", 0.1, "Decision Threshold value to select antilambdas"}; Configurable LambdaMinDCANegToPv{"LambdaMinDCANegToPv", .05, "min DCA Neg To PV (cm)"}; @@ -170,9 +154,7 @@ struct sigmaanalysis { Configurable LambdaMinv0cospa{"LambdaMinv0cospa", 0.95, "Min V0 CosPA"}; Configurable LambdaMaxLifeTime{"LambdaMaxLifeTime", 30, "Max lifetime"}; Configurable LambdaWindow{"LambdaWindow", 0.015, "Mass window around expected (in GeV/c2)"}; - Configurable LambdaMinRapidity{"LambdaMinRapidity", -0.5, "v0 min rapidity"}; - Configurable LambdaMaxRapidity{"LambdaMaxRapidity", 0.5, "v0 max rapidity"}; - Configurable LambdaMinDauEta{"LambdaMinDauEta", -0.8, "Min pseudorapidity of daughter tracks"}; + Configurable LambdaMaxRap{"LambdaMaxRap", 0.8, "Max lambda rapidity"}; Configurable LambdaMaxDauEta{"LambdaMaxDauEta", 0.8, "Max pseudorapidity of daughter tracks"}; Configurable fselLambdaTPCPID{"fselLambdaTPCPID", true, "Flag to select lambda-like candidates using TPC NSigma."}; Configurable fselLambdaTOFPID{"fselLambdaTOFPID", false, "Flag to select lambda-like candidates using TOF NSigma."}; @@ -188,7 +170,6 @@ struct sigmaanalysis { //// Photon criteria: struct : ConfigurableGroup { - std::string prefix = "photonSelections"; // JSON group name Configurable Gamma_MLThreshold{"Gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"}; Configurable Photonv0TypeSel{"Photonv0TypeSel", 7, "select on a certain V0 type (leave negative if no selection desired)"}; Configurable PhotonMinDCADauToPv{"PhotonMinDCADauToPv", 0.0, "Min DCA daughter To PV (cm)"}; @@ -198,19 +179,16 @@ struct sigmaanalysis { Configurable PhotonMaxTPCNSigmas{"PhotonMaxTPCNSigmas", 7, "Max TPC NSigmas for daughters"}; Configurable PhotonMinPt{"PhotonMinPt", 0.0, "Min photon pT (GeV/c)"}; Configurable PhotonMaxPt{"PhotonMaxPt", 50.0, "Max photon pT (GeV/c)"}; - Configurable PhotonMinRapidity{"PhotonMinRapidity", -0.5, "v0 min rapidity"}; - Configurable PhotonMaxRapidity{"PhotonMaxRapidity", 0.5, "v0 max rapidity"}; - Configurable PhotonMinDauEta{"PhotonMinDauEta", -0.8, "Min pseudorapidity of daughter tracks"}; - Configurable PhotonMaxDauEta{"PhotonMaxDauEta", 0.8, "Max pseudorapidity of daughter tracks"}; + Configurable PhotonMaxRap{"PhotonMaxRap", 0.5, "Max photon rapidity"}; Configurable PhotonMinRadius{"PhotonMinRadius", 3.0, "Min photon conversion radius (cm)"}; Configurable PhotonMaxRadius{"PhotonMaxRadius", 115, "Max photon conversion radius (cm)"}; - Configurable PhotonMinZ{"PhotonMinZ", -240, "Min photon conversion point z value (cm)"}; Configurable PhotonMaxZ{"PhotonMaxZ", 240, "Max photon conversion point z value (cm)"}; Configurable PhotonMaxQt{"PhotonMaxQt", 0.05, "Max photon qt value (AP plot) (GeV/c)"}; Configurable PhotonMaxAlpha{"PhotonMaxAlpha", 0.95, "Max photon alpha absolute value (AP plot)"}; Configurable PhotonMinV0cospa{"PhotonMinV0cospa", 0.80, "Min V0 CosPA"}; Configurable PhotonMaxMass{"PhotonMaxMass", 0.10, "Max photon mass (GeV/c^{2})"}; Configurable PhotonPsiPairMax{"PhotonPsiPairMax", 1e+9, "maximum psi angle of the track pair"}; + Configurable PhotonMaxDauEta{"PhotonMaxDauEta", 0.8, "Max pseudorapidity of daughter tracks"}; Configurable PhotonLineCutZ0{"PhotonLineCutZ0", 7.0, "The offset for the linecute used in the Z vs R plot"}; Configurable PhotonPhiMin1{"PhotonPhiMin1", -1, "Phi min value to reject photons, region 1 (leave negative if no selection desired)"}; Configurable PhotonPhiMax1{"PhotonPhiMax1", -1, "Phi max value to reject photons, region 1 (leave negative if no selection desired)"}; @@ -218,36 +196,15 @@ struct sigmaanalysis { Configurable PhotonPhiMax2{"PhotonPhiMax2", -1, "Phi min value to reject photons, region 2 (leave negative if no selection desired)"}; } photonSelections; - //// Photon criteria: - struct : ConfigurableGroup { - std::string prefix = "EMCalPhotonSelections"; // JSON group name - Configurable definition{"definition", 13, "Cluster definitions to be accepted (e.g. 13 for kV3MostSplitLowSeed)"}; - Configurable MinCells{"MinCells", 1, "Min number of cells in cluster"}; - Configurable MinEnergy{"MinEnergy", 0.0, "Minimum energy of selected clusters (GeV)"}; - Configurable MaxEnergy{"MaxEnergy", 5, "Max energy of selected clusters (GeV)"}; - Configurable MaxEta{"MaxEta", 1.0, "Max absolute cluster Eta"}; - Configurable MinTime{"MinTime", -50, "Minimum time of selected clusters (ns)"}; - Configurable MaxTime{"MaxTime", 50, "Max time of selected clusters (ns)"}; - Configurable RemoveExotic{"RemoveExotic", false, "Flag to enable the removal of exotic clusters"}; - Configurable MinM02{"MinM02", -1., "Minimum shower shape long axis"}; - Configurable MaxM02{"MaxM02", 5., "Max shower shape long axis"}; - Configurable RemoveMatchedTrack{"RemoveMatchedTrack", true, "Flag to enable the removal of clusters matched to tracks"}; - - } EMCalPhotonSelections; - struct : ConfigurableGroup { - std::string prefix = "sigma0Selections"; // JSON group name - Configurable Sigma0MinRapidity{"Sigma0MinRapidity", -0.5, "sigma0 min rapidity"}; - Configurable Sigma0MaxRapidity{"Sigma0MaxRapidity", 0.5, "sigma0 max rapidity"}; + Configurable Sigma0MaxRap{"Sigma0MaxRap", 0.5, "Max sigma0 rapidity"}; Configurable Sigma0MaxRadius{"Sigma0MaxRadius", 200, "Max sigma0 decay radius"}; Configurable Sigma0MaxDCADau{"Sigma0MaxDCADau", 50, "Max sigma0 DCA between daughters"}; Configurable Sigma0MaxOPAngle{"Sigma0MaxOPAngle", 7, "Max sigma0 OP Angle between daughters"}; } sigma0Selections; struct : ConfigurableGroup { - std::string prefix = "pi0Selections"; // JSON group name - Configurable Pi0MinRapidity{"Pi0MinRapidity", -0.5, "pi0 min rapidity"}; - Configurable Pi0MaxRapidity{"Pi0MaxRapidity", 0.5, "pi0 max rapidity"}; + Configurable Pi0MaxRap{"Pi0MaxRap", 0.5, "Max sigma0 rapidity"}; Configurable Pi0MaxRadius{"Pi0MaxRadius", 200, "Max sigma0 decay radius"}; Configurable Pi0MaxDCADau{"Pi0MaxDCADau", 50, "Max sigma0 DCA between daughters"}; } pi0Selections; @@ -258,7 +215,6 @@ struct sigmaanalysis { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; ConfigurableAxis axisInvPt{"axisInvPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 5.0, 10.0, 20.0, 50.0}, ""}; ConfigurableAxis axisDeltaPt{"axisDeltaPt", {400, -50.0, 50.0}, ""}; - ConfigurableAxis axisReso{"axisReso", {400, -2.0, 2.0}, ""}; ConfigurableAxis axisRapidity{"axisRapidity", {100, -2.0f, 2.0f}, "Rapidity"}; ConfigurableAxis axisIRBinning{"axisIRBinning", {150, 0, 1500}, "Binning for the interaction rate (kHz)"}; ConfigurableAxis axisNch{"axisNch", {300, 0.0f, 3000.0f}, "N_{ch}"}; @@ -293,23 +249,15 @@ struct sigmaanalysis { ConfigurableAxis axisPhi{"axisPhi", {200, 0, 2 * o2::constants::math::PI}, "Phi for photons"}; ConfigurableAxis axisZ{"axisZ", {120, -120.0f, 120.0f}, "V0 Z position (cm)"}; - // EMCal-specifc - ConfigurableAxis axisClrDefinition{"axisClrDefinition", {51, -0.5, 50.5}, "Cluster Definition"}; - ConfigurableAxis axisClrNCells{"axisClrNCells", {25, 0.0, 25}, "N cells per cluster"}; - ConfigurableAxis axisClrEnergy{"axisClrEnergy", {400, 0.0, 10}, "Energy per cluster"}; - ConfigurableAxis axisClrTime{"axisClrTime", {300, -30.0, 30.0}, "cluster time (ns)"}; - ConfigurableAxis axisClrShape{"axisClrShape", {100, 0.0, 1.0}, "cluster shape"}; - ConfigurableAxis axisCandSel{"axisCandSel", {20, 0.5f, +20.5f}, "Candidate Selection"}; // ML ConfigurableAxis MLProb{"MLOutput", {100, 0.0f, 1.0f}, ""}; - int NSigma0Cand = 0; void init(InitContext const&) { LOGF(info, "Initializing now: cross-checking correctness..."); - if ((doprocessRealData + doprocessRealDataWithEMCal + doprocessMonteCarlo + doprocessMonteCarloWithEMCal + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || + if ((doprocessRealData + doprocessMonteCarlo + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || (doprocessGeneratedRun3 + doprocessPi0GeneratedRun3 > 1)) { LOGF(fatal, "You have enabled more than one process function. Please check your configuration! Aborting now."); } @@ -321,7 +269,6 @@ struct sigmaanalysis { // Event Counters histos.add("hEventCentrality", "hEventCentrality", kTH1D, {axisCentrality}); - histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2D, {{101, 0.0f, 101.0f}, axisNch}); histos.add("hEventSelection", "hEventSelection", kTH1D, {{21, -0.5f, +20.5f}}); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); @@ -356,82 +303,61 @@ struct sigmaanalysis { histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2D, {axisCentrality, axisIRBinning}); } - if (doprocessRealData || doprocessRealDataWithEMCal || doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { + if (doprocessRealData || doprocessMonteCarlo) { for (const auto& histodir : DirList) { - if (fillSelhistos) { - - if (doprocessRealData || doprocessMonteCarlo) { - - histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); - histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); - histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); - histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - - // PCM photons - histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); - histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hNegEta", "hNegEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hRadius", "hRadius", kTH1D, {axisV0Radius}); - histos.add(histodir + "/Photon/hZ", "hZ", kTH1D, {axisZ}); - histos.add(histodir + "/Photon/h2dRZCut", "h2dRZCut", kTH2D, {axisZ, axisV0Radius}); - histos.add(histodir + "/Photon/h2dRZPlane", "h2dRZPlane", kTH2D, {axisZ, axisV0Radius}); - histos.add(histodir + "/Photon/hCosPA", "hCosPA", kTH1D, {axisCosPA}); - histos.add(histodir + "/Photon/hPsiPair", "hPsiPair", kTH1D, {axisPsiPair}); - histos.add(histodir + "/Photon/hPhi", "hPhi", kTH1D, {axisPhi}); - histos.add(histodir + "/Photon/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); - histos.add(histodir + "/Photon/hMass", "hMass", kTH1D, {axisPhotonMass}); - histos.add(histodir + "/Photon/h3dPhotonYSigma0Mass", "h3dPhotonYSigma0Mass", kTH3D, {axisRapidity, axisPt, axisSigmaMass}); - histos.add(histodir + "/Photon/h3dPhotonRadiusSigma0Mass", "h3dPhotonRadiusSigma0Mass", kTH3D, {axisV0Radius, axisPt, axisSigmaMass}); - } - - if (doprocessRealDataWithEMCal || doprocessMonteCarloWithEMCal) { - // EMCal photons - histos.add(histodir + "/EMCalPhotonSel/hpT", "hpT", kTH1D, {axisPt}); - histos.add(histodir + "/EMCalPhotonSel/hDefinition", "hDefinition", kTH1D, {axisClrDefinition}); - histos.add(histodir + "/EMCalPhotonSel/hNCells", "hNCells", kTH1D, {axisClrNCells}); - histos.add(histodir + "/EMCalPhotonSel/hEnergy", "hEnergy", kTH1D, {axisClrEnergy}); - histos.add(histodir + "/EMCalPhotonSel/h2dEtaVsPhi", "h2dEtaVsPhi", kTH2D, {axisRapidity, axisPhi}); - histos.add(histodir + "/EMCalPhotonSel/hTime", "hTime", kTH1D, {axisClrTime}); - histos.add(histodir + "/EMCalPhotonSel/hExotic", "hExotic", kTH1D, {{2, -0.5f, 1.5f}}); - histos.add(histodir + "/EMCalPhotonSel/hShape", "hShape", kTH1D, {axisClrShape}); - } - - histos.add(histodir + "/Lambda/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); - histos.add(histodir + "/Lambda/hRadius", "hRadius", kTH1D, {axisV0Radius}); - histos.add(histodir + "/Lambda/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); - histos.add(histodir + "/Lambda/hCosPA", "hCosPA", kTH1D, {axisCosPA}); - histos.add(histodir + "/Lambda/hY", "hY", kTH1D, {axisRapidity}); - histos.add(histodir + "/Lambda/hPosEta", "hPosEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Lambda/hNegEta", "hNegEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Lambda/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Lambda/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Lambda/hPosITSCls", "hPosITSCls", kTH1D, {axisNCls}); - histos.add(histodir + "/Lambda/hNegITSCls", "hNegITSCls", kTH1D, {axisNCls}); - histos.add(histodir + "/Lambda/hPosChi2PerNc", "hPosChi2PerNc", kTH1D, {axisChi2PerNcl}); - histos.add(histodir + "/Lambda/hNegChi2PerNc", "hNegChi2PerNc", kTH1D, {axisChi2PerNcl}); - histos.add(histodir + "/Lambda/hLifeTime", "hLifeTime", kTH1D, {axisLifetime}); - histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_LambdaPr", "h2dTPCvsTOFNSigma_LambdaPr", kTH2D, {axisTPCNSigma, axisTOFNSigma}); - histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_LambdaPi", "h2dTPCvsTOFNSigma_LambdaPi", kTH2D, {axisTPCNSigma, axisTOFNSigma}); - histos.add(histodir + "/Lambda/hLambdaDCANegToPV", "hLambdaDCANegToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Lambda/hLambdaDCAPosToPV", "hLambdaDCAPosToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Lambda/hLambdapT", "hLambdapT", kTH1D, {axisPt}); - histos.add(histodir + "/Lambda/hLambdaMass", "hLambdaMass", kTH1D, {axisLambdaMass}); - histos.add(histodir + "/Lambda/h3dLambdaMass", "h3dLambdaMass", kTH3D, {axisCentrality, axisPt, axisLambdaMass}); - histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_ALambdaPr", "h2dTPCvsTOFNSigma_ALambdaPr", kTH2D, {axisTPCNSigma, axisTOFNSigma}); - histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_ALambdaPi", "h2dTPCvsTOFNSigma_ALambdaPi", kTH2D, {axisTPCNSigma, axisTOFNSigma}); - histos.add(histodir + "/Lambda/hALambdaDCANegToPV", "hALambdaDCANegToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Lambda/hALambdaDCAPosToPV", "hALambdaDCAPosToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Lambda/hALambdapT", "hALambdapT", kTH1D, {axisPt}); - histos.add(histodir + "/Lambda/hAntiLambdaMass", "hAntiLambdaMass", kTH1D, {axisLambdaMass}); - histos.add(histodir + "/Lambda/h3dAntiLambdaMass", "h3dAntiLambdaMass", kTH3D, {axisCentrality, axisPt, axisLambdaMass}); - } + histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); + histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); + histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); + histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + + histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); + histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hNegEta", "hNegEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hRadius", "hRadius", kTH1D, {axisV0Radius}); + histos.add(histodir + "/Photon/hZ", "hZ", kTH1D, {axisZ}); + histos.add(histodir + "/Photon/h2dRZCut", "h2dRZCut", kTH2D, {axisZ, axisV0Radius}); + histos.add(histodir + "/Photon/h2dRZPlane", "h2dRZPlane", kTH2D, {axisZ, axisV0Radius}); + histos.add(histodir + "/Photon/hCosPA", "hCosPA", kTH1D, {axisCosPA}); + histos.add(histodir + "/Photon/hPsiPair", "hPsiPair", kTH1D, {axisPsiPair}); + histos.add(histodir + "/Photon/hPhi", "hPhi", kTH1D, {axisPhi}); + histos.add(histodir + "/Photon/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); + histos.add(histodir + "/Photon/hMass", "hMass", kTH1D, {axisPhotonMass}); + + histos.add(histodir + "/Lambda/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); + histos.add(histodir + "/Lambda/hRadius", "hRadius", kTH1D, {axisV0Radius}); + histos.add(histodir + "/Lambda/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); + histos.add(histodir + "/Lambda/hCosPA", "hCosPA", kTH1D, {axisCosPA}); + histos.add(histodir + "/Lambda/hY", "hY", kTH1D, {axisRapidity}); + histos.add(histodir + "/Lambda/hPosEta", "hPosEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Lambda/hNegEta", "hNegEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Lambda/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Lambda/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Lambda/hPosITSCls", "hPosITSCls", kTH1D, {axisNCls}); + histos.add(histodir + "/Lambda/hNegITSCls", "hNegITSCls", kTH1D, {axisNCls}); + histos.add(histodir + "/Lambda/hPosChi2PerNc", "hPosChi2PerNc", kTH1D, {axisChi2PerNcl}); + histos.add(histodir + "/Lambda/hNegChi2PerNc", "hNegChi2PerNc", kTH1D, {axisChi2PerNcl}); + histos.add(histodir + "/Lambda/hLifeTime", "hLifeTime", kTH1D, {axisLifetime}); + histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_LambdaPr", "h2dTPCvsTOFNSigma_LambdaPr", kTH2D, {axisTPCNSigma, axisTOFNSigma}); + histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_LambdaPi", "h2dTPCvsTOFNSigma_LambdaPi", kTH2D, {axisTPCNSigma, axisTOFNSigma}); + histos.add(histodir + "/Lambda/hLambdaDCANegToPV", "hLambdaDCANegToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Lambda/hLambdaDCAPosToPV", "hLambdaDCAPosToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Lambda/hLambdapT", "hLambdapT", kTH1D, {axisPt}); + histos.add(histodir + "/Lambda/hLambdaMass", "hLambdaMass", kTH1D, {axisLambdaMass}); + histos.add(histodir + "/Lambda/h3dLambdaMass", "h3dLambdaMass", kTH3D, {axisCentrality, axisPt, axisLambdaMass}); + histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_ALambdaPr", "h2dTPCvsTOFNSigma_ALambdaPr", kTH2D, {axisTPCNSigma, axisTOFNSigma}); + histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_ALambdaPi", "h2dTPCvsTOFNSigma_ALambdaPi", kTH2D, {axisTPCNSigma, axisTOFNSigma}); + histos.add(histodir + "/Lambda/hALambdaDCANegToPV", "hALambdaDCANegToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Lambda/hALambdaDCAPosToPV", "hALambdaDCAPosToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Lambda/hALambdapT", "hALambdapT", kTH1D, {axisPt}); + histos.add(histodir + "/Lambda/hAntiLambdaMass", "hAntiLambdaMass", kTH1D, {axisLambdaMass}); + histos.add(histodir + "/Lambda/h3dAntiLambdaMass", "h3dAntiLambdaMass", kTH3D, {axisCentrality, axisPt, axisLambdaMass}); histos.add(histodir + "/h2dArmenteros", "h2dArmenteros", kTH2D, {axisAPAlpha, axisAPQt}); @@ -454,31 +380,29 @@ struct sigmaanalysis { histos.add(histodir + "/ASigma0/h3dOPAngleVsMass", "h3dOPAngleVsMass", kTH3D, {{140, 0.0f, +7.0f}, axisPt, axisSigmaMass}); // Process MC - if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { - - if (fillSelhistos) { - histos.add(histodir + "/MC/Photon/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); - histos.add(histodir + "/MC/Photon/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/hMCPt", "hMCPt", kTH1D, {axisPt}); - - if (doprocessMonteCarlo) { - histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); - histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); - } - - histos.add(histodir + "/MC/Lambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); - histos.add(histodir + "/MC/Lambda/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Lambda/hMCPt", "hMCPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Lambda/h3dTPCvsTOFNSigma_Pr", "h3dTPCvsTOFNSigma_Pr", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); - histos.add(histodir + "/MC/Lambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); - - histos.add(histodir + "/MC/ALambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); - histos.add(histodir + "/MC/ALambda/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/ALambda/hMCPt", "hMCPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pr", "h3dTPCvsTOFNSigma_Pr", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); - histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); - } + if (doprocessMonteCarlo) { + histos.add(histodir + "/MC/Photon/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); + histos.add(histodir + "/MC/Photon/hPt", "hPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Photon/hMCPt", "hMCPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + histos.add(histodir + "/MC/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); + histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); + + histos.add(histodir + "/MC/Lambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); + histos.add(histodir + "/MC/Lambda/hPt", "hPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Lambda/hMCPt", "hMCPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Lambda/h3dTPCvsTOFNSigma_Pr", "h3dTPCvsTOFNSigma_Pr", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); + histos.add(histodir + "/MC/Lambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); + + histos.add(histodir + "/MC/ALambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); + histos.add(histodir + "/MC/ALambda/hPt", "hPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/ALambda/hMCPt", "hMCPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pr", "h3dTPCvsTOFNSigma_Pr", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); + histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); + + histos.add(histodir + "/MC/h2dArmenteros", "h2dArmenteros", kTH2D, {axisAPAlpha, axisAPQt}); histos.add(histodir + "/MC/Sigma0/hPt", "hPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Sigma0/hMCPt", "hMCPt", kTH1D, {axisPt}); @@ -502,17 +426,19 @@ struct sigmaanalysis { histos.add(histodir + "/MC/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); histos.add(histodir + "/MC/ASigma0/h3dMCProcess", "h3dMCProcess", kTH3D, {{50, -0.5f, 49.5f}, axisPt, axisSigmaMass}); - // pT Resolution: - if (fillResoQAhistos) { - histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisReso}); - histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + // 1/pT Resolution: + if (fillResoQAhistos && histodir == "BeforeSel") { + histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); + histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); + histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); + histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h2dAntiLambdaPtResolution", "h2dAntiLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); - histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); + histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); + histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dSigma0RadiusResolution", "h2dSigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dASigma0RadiusResolution", "h2dASigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); } @@ -546,22 +472,20 @@ struct sigmaanalysis { histos.add("BkgStudy/h2dFakeDaughtersMatrix", "h2dFakeDaughtersMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); } - if (fillSelhistos) { - for (size_t i = 0; i < PhotonSels.size(); ++i) { - const auto& sel = PhotonSels[i]; + for (size_t i = 0; i < PhotonSels.size(); ++i) { + const auto& sel = PhotonSels[i]; - histos.add(Form("Selection/Photon/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisPhotonMass}); - histos.get(HIST("Selection/Photon/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str()); - histos.add(Form("Selection/Sigma0/h2dPhoton%s", sel.c_str()), ("h2dPhoton" + sel).c_str(), kTH2D, {axisPt, axisSigmaMass}); - } + histos.add(Form("Selection/Photon/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisPhotonMass}); + histos.get(HIST("Selection/Photon/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str()); + histos.add(Form("Selection/Sigma0/h2dPhoton%s", sel.c_str()), ("h2dPhoton" + sel).c_str(), kTH2D, {axisPt, axisSigmaMass}); + } - for (size_t i = 0; i < LambdaSels.size(); ++i) { - const auto& sel = LambdaSels[i]; + for (size_t i = 0; i < LambdaSels.size(); ++i) { + const auto& sel = LambdaSels[i]; - histos.add(Form("Selection/Lambda/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisLambdaMass}); - histos.get(HIST("Selection/Lambda/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str()); - histos.add(Form("Selection/Sigma0/h2dLambda%s", sel.c_str()), ("h2dLambda" + sel).c_str(), kTH2D, {axisPt, axisSigmaMass}); - } + histos.add(Form("Selection/Lambda/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisLambdaMass}); + histos.get(HIST("Selection/Lambda/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str()); + histos.add(Form("Selection/Sigma0/h2dLambda%s", sel.c_str()), ("h2dLambda" + sel).c_str(), kTH2D, {axisPt, axisSigmaMass}); } } @@ -589,54 +513,19 @@ struct sigmaanalysis { // Sigma0 specific if (doprocessGeneratedRun3) { - histos.add("Gen/hGenParticlesNoMCColl", "hGenParticlesNoMCColl", kTH1D, {{3, 0.5f, +3.5f}}); histos.add("Gen/h2dGenSigma0", "h2dGenSigma0", kTH2D, {axisCentrality, axisPt}); histos.add("Gen/h2dGenAntiSigma0", "h2dGenAntiSigma0", kTH2D, {axisCentrality, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC_RecoedEvt", "h2dGenSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt", "h2dGenAntiSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC", "h2dGenSigma0VsMultMC", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt}); - } - if (doprocessPi0GeneratedRun3) { // Pi0 specific + + } else { // Pi0 specific histos.add("Gen/h2dGenPi0VsMultMC_RecoedEvt", "h2dGenPi0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenPi0", "h2dGenPi0", kTH2D, {axisCentrality, axisPt}); histos.add("Gen/h2dGenPi0VsMultMC", "h2dGenPi0VsMultMC", kTH2D, {axisNch, axisPt}); } } - - // Sigma0 QA - if (fdoSigma0QA) { - histos.add("Sigma0QA/h2dAllSigma0CandMCRapVsRecoRap", "h2dAllSigma0CandMCRapVsRecoRap", kTH2D, {axisRapidity, axisRapidity}); - histos.add("Sigma0QA/h2dSigma0MCRapVsRecoRap", "h2dSigma0MCRapVsRecoRap", kTH2D, {axisRapidity, axisRapidity}); - histos.add("Sigma0QA/h2dASigma0MCRapVsRecoRap", "h2dASigma0MCRapVsRecoRap", kTH2D, {axisRapidity, axisRapidity}); - - histos.add("Sigma0QA/hDuplicates", "hDuplicates", kTH1D, {{10, -0.5f, +9.5f}}); - histos.add("Sigma0QA/hSigma0Duplicates", "hSigma0Duplicates", kTH1D, {{10, -0.5f, +9.5f}}); - histos.add("Sigma0QA/hASigma0Duplicates", "hASigma0Duplicates", kTH1D, {{10, -0.5f, +9.5f}}); - } - - // inspect histogram sizes, please - histos.print(); - } - - // Auxiliary function to get the centrality of a collision according to the selected estimator - template - auto getCentralityRun3(TCollision const& collision) - { - if (centralityEstimator == kCentFT0C) - return collision.centFT0C(); - else if (centralityEstimator == kCentFT0M) - return collision.centFT0M(); - else if (centralityEstimator == kCentFT0CVariant1) - return collision.centFT0CVariant1(); - else if (centralityEstimator == kCentMFT) - return collision.centMFT(); - else if (centralityEstimator == kCentNGlobal) - return collision.centNGlobal(); - else if (centralityEstimator == kCentFV0A) - return collision.centFV0A(); - - return -1.f; } // ______________________________________________________ @@ -749,7 +638,7 @@ struct sigmaanalysis { // Fetch interaction rate only if required (in order to limit ccdb calls) float interactionRate = (fGetIR) ? rateFetcher.fetch(ccdb.service, collision.timestamp(), collision.runNumber(), irSource, fIRCrashOnNull) * 1.e-3 : -1; - float centrality = getCentralityRun3(collision); + float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); if (fGetIR) { if (interactionRate < 0) @@ -774,7 +663,6 @@ struct sigmaanalysis { // Fill centrality histogram after event selection if (fillHists) histos.fill(HIST("hEventCentrality"), centrality); - histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); return true; } @@ -786,21 +674,12 @@ struct sigmaanalysis { std::vector getListOfRecoCollIndices(TMCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); - - // Custom grouping - std::vector> groupedCollisions(mcCollisions.size()); - - for (const auto& coll : collisions) { - groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); - } - for (auto const& mcCollision : mcCollisions) { + auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); int biggestNContribs = -1; int bestCollisionIndex = -1; - for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { + for (auto const& collision : groupedCollisions) { // consider event selections in the recoed <-> gen collision association, for the denominator (or numerator) of the efficiency (or signal loss)? - auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); - if (eventSelections.useEvtSelInDenomEff) { if (!IsEventAccepted(collision, false)) { continue; @@ -825,14 +704,6 @@ struct sigmaanalysis { void fillGeneratedEventProperties(TMCCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); - - // Custom grouping - std::vector> groupedCollisions(mcCollisions.size()); - - for (const auto& coll : collisions) { - groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); - } - for (auto const& mcCollision : mcCollisions) { // Apply selections on MC collisions if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { @@ -850,14 +721,14 @@ struct sigmaanalysis { histos.fill(HIST("Gen/hGenEvents"), mcCollision.multMCNParticlesEta05(), 0 /* all gen. events*/); + auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); // Check if there is at least one of the reconstructed collisions associated to this MC collision // If so, we consider it bool atLeastOne = false; int biggestNContribs = -1; float centrality = 100.5f; int nCollisions = 0; - for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { - auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + for (auto const& collision : groupedCollisions) { if (!IsEventAccepted(collision, false)) { continue; @@ -865,7 +736,7 @@ struct sigmaanalysis { if (biggestNContribs < collision.multPVTotalContributors()) { biggestNContribs = collision.multPVTotalContributors(); - centrality = getCentralityRun3(collision); + centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); } nCollisions++; @@ -898,17 +769,11 @@ struct sigmaanalysis { float centrality = 100.5f; // Has MC collision - if (!genParticle.has_straMCCollision()) { - histos.fill(HIST("Gen/hGenParticlesNoMCColl"), 1); - continue; - } - - // Rapidity selection - if ((genParticle.mcy() < genSelections.mc_rapidityMin) || (genParticle.mcy() > genSelections.mc_rapidityMax)) + if (!genParticle.has_straMCCollision()) continue; // Selection on the source (generator/transport) - if (!genParticle.producedByGenerator() && genSelections.mc_keepOnlyFromGenerator) + if (!genParticle.producedByGenerator() && mc_keepOnlyFromGenerator) continue; // Select corresponding mc collision && Basic event selection @@ -928,35 +793,33 @@ struct sigmaanalysis { //______________________________________________________________________________ // Generated Sigma0 processing - if constexpr (requires { genParticle.isSigma0(); }) { - if (doprocessGeneratedRun3) { + if constexpr (requires { genParticle.sigma0MCPt(); }) { - float ptmc = genParticle.mcpt(); + float ptmc = genParticle.sigma0MCPt(); - if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { - auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); - centrality = getCentralityRun3(collision); + if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { + auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); + centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); - if (genParticle.isSigma0()) - histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + if (genParticle.isSigma0()) + histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); - else - histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); - } + else + histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } - if (genParticle.isSigma0()) { - histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc); - histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); - } else { - histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc); - histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); - } + if (genParticle.isSigma0()) { + histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc); + histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); + } else { + histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc); + histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); } } //______________________________________________________________________________ // Generated Pi0 processing - if (doprocessPi0GeneratedRun3) { - float ptmc = genParticle.mcpt(); + if constexpr (requires { genParticle.pi0MCPt(); }) { + float ptmc = genParticle.pi0MCPt(); if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); @@ -978,16 +841,14 @@ struct sigmaanalysis { int TrkCode = 10; // 1: TPC-only, 2: TPC+Something, 3: ITS-Only, 4: ITS+TPC + Something, 10: anything else if (isGamma) { - if constexpr (requires { sigma.photonV0Type(); }) { - if (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() == 1) - TrkCode = 1; - if ((sigma.photonPosTrackCode() != 1 && sigma.photonNegTrackCode() == 1) || (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() != 1)) - TrkCode = 2; - if (sigma.photonPosTrackCode() == 3 && sigma.photonNegTrackCode() == 3) - TrkCode = 3; - if (sigma.photonPosTrackCode() == 2 || sigma.photonNegTrackCode() == 2) - TrkCode = 4; - } + if (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() == 1) + TrkCode = 1; + if ((sigma.photonPosTrackCode() != 1 && sigma.photonNegTrackCode() == 1) || (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() != 1)) + TrkCode = 2; + if (sigma.photonPosTrackCode() == 3 && sigma.photonNegTrackCode() == 3) + TrkCode = 3; + if (sigma.photonPosTrackCode() == 2 || sigma.photonNegTrackCode() == 2) + TrkCode = 4; } else { if (sigma.lambdaPosTrackCode() == 1 && sigma.lambdaNegTrackCode() == 1) TrkCode = 1; @@ -1002,55 +863,51 @@ struct sigmaanalysis { return TrkCode; } - template + template void getResolution(TSigma0Object const& sigma) { - // Check whether it is before or after selections - static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; - //_______________________________________ // Gamma MC association - if (sigma.photonPDGCode() == PDG_t::kGamma) { + if (sigma.photonPDGCode() == 22) { if (sigma.photonmcpt() > 0) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt() / sigma.photonmcpt()) - 1.f); // pT resolution - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.photonNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.photonPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution } } //_______________________________________ // Lambda MC association - if (sigma.lambdaPDGCode() == PDG_t::kLambda0) { + if (sigma.lambdaPDGCode() == 3122) { if (sigma.lambdamcpt() > 0) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution } } //_______________________________________ // AntiLambda MC association - if (sigma.lambdaPDGCode() == PDG_t::kLambda0Bar) { + if (sigma.lambdaPDGCode() == -3122) { if (sigma.lambdamcpt() > 0) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution } } //_______________________________________ // Sigma and AntiSigma MC association if (sigma.isSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution - if (sigma.mcpt() > 0) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), (sigma.pt() / sigma.mcpt()) - 1.f); // pT resolution - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution - } + histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + if (sigma.mcpt() > 0) + histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } if (sigma.isAntiSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution if (sigma.mcpt() > 0) - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } } @@ -1074,24 +931,24 @@ struct sigmaanalysis { //_______________________________________ // Real Gamma x Real Lambda - but not from the same sigma0/antisigma0! - if ((PhotonPDGCode == PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar)) && (!fIsSigma && !fIsAntiSigma)) { + if ((PhotonPDGCode == 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122)) && (!fIsSigma && !fIsAntiSigma)) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueDaughters"), sigmapT, sigmaMass); histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dTrueDaughtersMatrix"), LambdaPDGCodeMother, PhotonPDGCodeMother); } //_______________________________________ // Real Gamma x fake Lambda - if ((PhotonPDGCode == PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) + if ((PhotonPDGCode == 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueGammaFakeLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Real Lambda - if ((PhotonPDGCode != PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar))) + if ((PhotonPDGCode != 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122))) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeGammaTrueLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Fake Lambda - if ((PhotonPDGCode != PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) + if ((PhotonPDGCode != 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeDaughters"), sigmapT, sigmaMass); } @@ -1102,94 +959,68 @@ struct sigmaanalysis { // Check whether it is before or after selections static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; - float centrality = getCentralityRun3(collision); + // Get V0trackCode + int GammaTrkCode = retrieveV0TrackCode(sigma); + int LambdaTrkCode = retrieveV0TrackCode(sigma); - if (fillSelhistos) { - - // Get V0trackCode - int LambdaTrkCode = retrieveV0TrackCode(sigma); - - if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon - - // Base properties - int GammaTrkCode = retrieveV0TrackCode(sigma); - float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; - - //_______________________________________ - // Photon - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); - - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegEta"), sigma.photonNegEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hRadius"), sigma.photonRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hZ"), sigma.photonZconv()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZCut"), sigma.photonRadius(), photonRZLineCut); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZPlane"), sigma.photonZconv(), sigma.photonRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hCosPA"), sigma.photonCosPA()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPsiPair"), sigma.photonPsiPair()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPhi"), sigma.photonPhi()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dMass"), centrality, sigma.photonPt(), sigma.photonMass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hMass"), sigma.photonMass()); - - histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dPhotonYSigma0Mass"), sigma.photonY(), sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dPhotonRadiusSigma0Mass"), sigma.photonRadius(), sigma.pt(), sigma.sigma0Mass()); - } - - if constexpr (requires { sigma.photonDefinition(); }) { // Processing EMCal photon - - histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hpT"), sigma.photonPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hDefinition"), sigma.photonDefinition()); - histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hNCells"), sigma.photonNCells()); - histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hEnergy"), sigma.photonEnergy()); - histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/h2dEtaVsPhi"), sigma.photonEMCEta(), sigma.photonEMCPhi()); - histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hTime"), sigma.photonTime()); - histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hExotic"), sigma.photonIsExotic()); - histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hShape"), sigma.photonM02()); - } + float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; + float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + //_______________________________________ + // Photon + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); + + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegEta"), sigma.photonNegEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hRadius"), sigma.photonRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hZ"), sigma.photonZconv()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZCut"), sigma.photonRadius(), photonRZLineCut); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZPlane"), sigma.photonZconv(), sigma.photonRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hCosPA"), sigma.photonCosPA()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPsiPair"), sigma.photonPsiPair()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPhi"), sigma.photonPhi()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dMass"), centrality, sigma.photonPt(), sigma.photonMass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hMass"), sigma.photonMass()); - //_______________________________________ - // Lambdas - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hTrackCode"), LambdaTrkCode); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hRadius"), sigma.lambdaRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hDCADau"), sigma.lambdaDCADau()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hCosPA"), sigma.lambdaCosPA()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hY"), sigma.lambdaY()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosEta"), sigma.lambdaPosEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegEta"), sigma.lambdaNegEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosTPCCR"), sigma.lambdaPosTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegTPCCR"), sigma.lambdaNegTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosITSCls"), sigma.lambdaPosITSCls()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegITSCls"), sigma.lambdaNegITSCls()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosChi2PerNc"), sigma.lambdaPosChi2PerNcl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegChi2PerNc"), sigma.lambdaNegChi2PerNcl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLifeTime"), sigma.lambdaLifeTime()); - - histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - } + //_______________________________________ + // Lambdas + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hTrackCode"), LambdaTrkCode); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hRadius"), sigma.lambdaRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hDCADau"), sigma.lambdaDCADau()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hCosPA"), sigma.lambdaCosPA()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hY"), sigma.lambdaY()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosEta"), sigma.lambdaPosEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegEta"), sigma.lambdaNegEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosTPCCR"), sigma.lambdaPosTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegTPCCR"), sigma.lambdaNegTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosITSCls"), sigma.lambdaPosITSCls()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegITSCls"), sigma.lambdaNegITSCls()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosChi2PerNc"), sigma.lambdaPosChi2PerNcl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegChi2PerNc"), sigma.lambdaNegChi2PerNcl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLifeTime"), sigma.lambdaLifeTime()); //_______________________________________ // Sigmas and Lambdas + histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); + if (sigma.lambdaAlpha() > 0) { - if (fillSelhistos) { - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaDCANegToPV"), sigma.lambdaDCANegPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaDCAPosToPV"), sigma.lambdaDCAPosPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdapT"), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaMass"), sigma.lambdaMass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h3dLambdaMass"), centrality, sigma.lambdaPt(), sigma.lambdaMass()); - } + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaDCANegToPV"), sigma.lambdaDCANegPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaDCAPosToPV"), sigma.lambdaDCAPosPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdapT"), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaMass"), sigma.lambdaMass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h3dLambdaMass"), centrality, sigma.lambdaPt(), sigma.lambdaMass()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hMass"), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hPt"), sigma.pt()); @@ -1200,15 +1031,13 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); } else { - if (fillSelhistos) { - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdaDCANegToPV"), sigma.lambdaDCANegPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdaDCAPosToPV"), sigma.lambdaDCAPosPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdapT"), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hAntiLambdaMass"), sigma.antilambdaMass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h3dAntiLambdaMass"), centrality, sigma.lambdaPt(), sigma.antilambdaMass()); - } + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdaDCANegToPV"), sigma.lambdaDCANegPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdaDCAPosToPV"), sigma.lambdaDCAPosPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdapT"), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hAntiLambdaMass"), sigma.antilambdaMass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h3dAntiLambdaMass"), centrality, sigma.lambdaPt(), sigma.antilambdaMass()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/hMass"), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/hPt"), sigma.pt()); @@ -1222,51 +1051,52 @@ struct sigmaanalysis { //_______________________________________ // MC specific - if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { + if (doprocessMonteCarlo) { if constexpr (requires { sigma.lambdaPDGCode(); sigma.photonPDGCode(); }) { - if (fillSelhistos) { - //_______________________________________ - // Gamma MC association - if (sigma.photonPDGCode() == 22) { - - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hV0ToCollAssoc"), sigma.photonIsCorrectlyAssoc()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt"), sigma.photonPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hMCPt"), sigma.photonmcpt()); - - if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); - - if (!sigma.photonIsCorrectlyAssoc()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), sigma.photonmcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); - } - } + //_______________________________________ + // Gamma MC association + if (sigma.photonPDGCode() == 22) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hV0ToCollAssoc"), sigma.photonIsCorrectlyAssoc()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hMCPt"), sigma.photonmcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); + + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + + if (!sigma.photonIsCorrectlyAssoc()) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), sigma.photonmcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); } + } - //_______________________________________ - // Lambda MC association - if (sigma.lambdaPDGCode() == 3122) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hV0ToCollAssoc"), sigma.lambdaIsCorrectlyAssoc()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hPt"), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hMCPt"), sigma.lambdamcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/h3dTPCvsTOFNSigma_Pr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/h3dTPCvsTOFNSigma_Pi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.lambdaPt()); - } + //_______________________________________ + // Lambda MC association + if (sigma.lambdaPDGCode() == 3122) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hV0ToCollAssoc"), sigma.lambdaIsCorrectlyAssoc()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hPt"), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hMCPt"), sigma.lambdamcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/h3dTPCvsTOFNSigma_Pr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/h3dTPCvsTOFNSigma_Pi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.lambdaPt()); + } - //_______________________________________ - // AntiLambda MC association - if (sigma.lambdaPDGCode() == -3122) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hV0ToCollAssoc"), sigma.lambdaIsCorrectlyAssoc()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hPt"), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hMCPt"), sigma.lambdamcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/h3dTPCvsTOFNSigma_Pr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma(), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/h3dTPCvsTOFNSigma_Pi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma(), sigma.lambdaPt()); - } + //_______________________________________ + // AntiLambda MC association + if (sigma.lambdaPDGCode() == -3122) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hV0ToCollAssoc"), sigma.lambdaIsCorrectlyAssoc()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hPt"), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hMCPt"), sigma.lambdamcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/h3dTPCvsTOFNSigma_Pr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma(), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/h3dTPCvsTOFNSigma_Pi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma(), sigma.lambdaPt()); } + //_______________________________________ // Sigma0 MC association if (sigma.isSigma0()) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMCPt"), sigma.mcpt()); @@ -1284,6 +1114,9 @@ struct sigmaanalysis { //_______________________________________ // AntiSigma0 MC association if (sigma.isAntiSigma0()) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hMCPt"), sigma.mcpt()); @@ -1304,8 +1137,8 @@ struct sigmaanalysis { //_______________________________________ // pT resolution histos - if (fillResoQAhistos) - getResolution(sigma); + if ((mode == 0) && fillResoQAhistos) + getResolution(sigma); } } } @@ -1324,7 +1157,7 @@ struct sigmaanalysis { "TPCTOFPID", "DCADauToPV", "Mass"}; if (PDGRequired == 22) { - if constexpr (selection_index >= 0 && selection_index < static_cast(std::size(PhotonSelsLocal))) { + if constexpr (selection_index >= 0 && selection_index < (int)std::size(PhotonSelsLocal)) { histos.fill(HIST("Selection/Photon/hCandidateSel"), selection_index); histos.fill(HIST("Selection/Photon/h2d") + HIST(PhotonSelsLocal[selection_index]), sigma.photonPt(), sigma.photonMass()); histos.fill(HIST("Selection/Sigma0/h2dPhoton") + HIST(PhotonSelsLocal[selection_index]), sigma.pt(), sigma.sigma0Mass()); @@ -1332,7 +1165,7 @@ struct sigmaanalysis { } if (PDGRequired == 3122) { - if constexpr (selection_index >= 0 && selection_index < static_cast(std::size(LambdaSelsLocal))) { + if constexpr (selection_index >= 0 && selection_index < (int)std::size(LambdaSelsLocal)) { histos.fill(HIST("Selection/Lambda/hCandidateSel"), selection_index); histos.fill(HIST("Selection/Lambda/h2d") + HIST(LambdaSelsLocal[selection_index]), sigma.lambdaPt(), sigma.lambdaMass()); histos.fill(HIST("Selection/Sigma0/h2dLambda") + HIST(LambdaSelsLocal[selection_index]), sigma.pt(), sigma.sigma0Mass()); @@ -1340,40 +1173,6 @@ struct sigmaanalysis { } } - // Sigma0 QA analysis function - template - void doSigma0QA(TSigma0s const& fullSigma0s) - { - std::unordered_map sigma0Counts; - std::unordered_map sigma0Index; - - for (const auto& sigma0 : fullSigma0s) { - // Crosscheck reco rapidity and MC rapidity - histos.fill(HIST("Sigma0QA/h2dAllSigma0CandMCRapVsRecoRap"), sigma0.sigma0MCY(), sigma0.sigma0Y()); - - if (sigma0.isSigma0()) - histos.fill(HIST("Sigma0QA/h2dSigma0MCRapVsRecoRap"), sigma0.sigma0MCY(), sigma0.sigma0Y()); - if (sigma0.isAntiSigma0()) - histos.fill(HIST("Sigma0QA/h2dASigma0MCRapVsRecoRap"), sigma0.sigma0MCY(), sigma0.sigma0Y()); - - // grouping per mcparticle - if (sigma0.has_mcParticle()) { - sigma0Counts[sigma0.mcParticleId()] += 1; // duplicate count - sigma0Index[sigma0.mcParticleId()] = sigma0.globalIndex(); // saving index - } - } - for (const auto& [mcid, NDuplicates] : sigma0Counts) { - auto sigma0mc = fullSigma0s.rawIteratorAt(sigma0Index[mcid]); - histos.fill(HIST("Sigma0QA/hDuplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed - - if (sigma0mc.isSigma0()) - histos.fill(HIST("Sigma0QA/hSigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed - - if (sigma0mc.isAntiSigma0()) - histos.fill(HIST("Sigma0QA/hASigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed - } - } - // Apply specific selections for photons template bool selectPhoton(TV0Object const& cand) @@ -1406,11 +1205,7 @@ struct sigmaanalysis { return false; fillSelHistos<6>(cand, 22); - if ((cand.photonY() < photonSelections.PhotonMinRapidity) || (cand.photonY() > photonSelections.PhotonMaxRapidity)) - return false; - if ((cand.photonPosEta() < photonSelections.PhotonMinDauEta) || (cand.photonPosEta() > photonSelections.PhotonMaxDauEta)) - return false; - if ((cand.photonNegEta() < photonSelections.PhotonMinDauEta) || (cand.photonNegEta() > photonSelections.PhotonMaxDauEta)) + if ((TMath::Abs(cand.photonY()) > photonSelections.PhotonMaxRap) || (TMath::Abs(cand.photonPosEta()) > photonSelections.PhotonMaxDauEta) || (TMath::Abs(cand.photonNegEta()) > photonSelections.PhotonMaxDauEta)) return false; fillSelHistos<7>(cand, 22); @@ -1418,11 +1213,8 @@ struct sigmaanalysis { return false; fillSelHistos<8>(cand, 22); - if ((cand.photonZconv() < photonSelections.PhotonMinZ) || (cand.photonZconv() > photonSelections.PhotonMaxZ)) - return false; - float photonRZLineCut = TMath::Abs(cand.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; - if ((TMath::Abs(cand.photonRadius()) < photonRZLineCut)) + if ((TMath::Abs(cand.photonRadius()) < photonRZLineCut) || (TMath::Abs(cand.photonZconv()) > photonSelections.PhotonMaxZ)) return false; fillSelHistos<9>(cand, 22); @@ -1452,48 +1244,6 @@ struct sigmaanalysis { return true; } - // Apply specific selections for photons - template - bool selectEMCalPhoton(TClusterObject const& cand) - { - // Clusterizer - if (cand.photonDefinition() != EMCalPhotonSelections.definition && EMCalPhotonSelections.definition > -1) - return false; - - // Number of Cells - if (cand.photonNCells() < EMCalPhotonSelections.MinCells) - return false; - - // Energy - if (cand.photonEnergy() < EMCalPhotonSelections.MinEnergy || cand.photonEnergy() > EMCalPhotonSelections.MaxEnergy) - return false; - - // Eta - if (TMath::Abs(cand.photonEMCEta()) > EMCalPhotonSelections.MaxEta) - return false; - - // Timing - if (cand.photonTime() < EMCalPhotonSelections.MinTime || cand.photonTime() > EMCalPhotonSelections.MaxTime) - return false; - - // Exotic Clusters - if (cand.photonIsExotic() && EMCalPhotonSelections.RemoveExotic) { - return false; - } - - // Shower shape long axis - if (cand.photonNCells() > 1) { // Only if we have more than one - if (cand.photonM02() < EMCalPhotonSelections.MinM02 || cand.photonM02() > EMCalPhotonSelections.MaxM02) { - return false; - } - } - // Has matched track? - if (cand.photonHasAssocTrk() && EMCalPhotonSelections.RemoveMatchedTrack) - return false; - - return true; - } - // Apply specific selections for lambdas template bool selectLambda(TV0Object const& cand) @@ -1518,11 +1268,7 @@ struct sigmaanalysis { return false; fillSelHistos<4>(cand, 3122); - if ((cand.lambdaY() < lambdaSelections.LambdaMinRapidity) || (cand.lambdaY() > lambdaSelections.LambdaMaxRapidity)) - return false; - if ((cand.lambdaPosEta() < lambdaSelections.LambdaMinDauEta) || (cand.lambdaPosEta() > lambdaSelections.LambdaMaxDauEta)) - return false; - if ((cand.lambdaNegEta() < lambdaSelections.LambdaMinDauEta) || (cand.lambdaNegEta() > lambdaSelections.LambdaMaxDauEta)) + if ((TMath::Abs(cand.lambdaY()) > lambdaSelections.LambdaMaxRap) || (TMath::Abs(cand.lambdaPosEta()) > lambdaSelections.LambdaMaxDauEta) || (TMath::Abs(cand.lambdaNegEta()) > lambdaSelections.LambdaMaxDauEta)) return false; fillSelHistos<5>(cand, 3122); @@ -1604,29 +1350,22 @@ struct sigmaanalysis { bool processSigma0Candidate(TSigma0Object const& cand) { // Photon specific selections - if constexpr (requires { cand.photonV0Type(); }) { // Processing PCM photon - if (!selectPhoton(cand)) - return false; - } - - if constexpr (requires { cand.photonDefinition(); }) { // Processing EMCal photon - if (!selectEMCalPhoton(cand)) - return false; - } + if (!selectPhoton(cand)) + return false; // Lambda specific selections if (!selectLambda(cand)) return false; // Sigma0 specific selections - float rapidity = doLambdaStar ? cand.lambdaStarY() : cand.sigma0Y(); - if constexpr (requires { cand.sigma0MCY(); }) { // If MC - rapidity = cand.sigma0MCY(); - } - // Rapidity - if ((rapidity < sigma0Selections.Sigma0MinRapidity) || (rapidity > sigma0Selections.Sigma0MaxRapidity)) - return false; + if constexpr (requires { cand.sigma0MCY(); }) { // MC + if (TMath::Abs(cand.sigma0MCY()) > sigma0Selections.Sigma0MaxRap) + return false; + } else { // Real data + if (TMath::Abs(cand.sigma0Y()) > sigma0Selections.Sigma0MaxRap) + return false; + } // V0Pair Radius if (cand.radius() > sigma0Selections.Sigma0MaxRadius) @@ -1658,7 +1397,7 @@ struct sigmaanalysis { for (const auto& coll : collisions) { // Event selection - if (!IsEventAccepted(coll, true)) // TODO: Should I Add event selection for events without EMCal? + if (!IsEventAccepted(coll, true)) continue; // Sigma0s loop @@ -1685,9 +1424,6 @@ struct sigmaanalysis { fillHistos<1>(sigma0, coll); } } - - // Optionally run QA analysis for reco sigma0 - // if (fdoSigma0QA) doSigma0QA(fullSigma0s); // TODO: improve this to run sigma0 QA } // Apply selections in sigma0 candidates @@ -1730,26 +1466,10 @@ struct sigmaanalysis { (cand.photon2Pt() > photonSelections.PhotonMaxPt))) return false; - // Rapidity selection - if ((cand.photon1Y() < photonSelections.PhotonMinRapidity) || (cand.photon1Y() > photonSelections.PhotonMaxRapidity)) - return false; - if ((cand.photon1PosEta() < photonSelections.PhotonMinDauEta) || (cand.photon1PosEta() > photonSelections.PhotonMaxDauEta)) - return false; - if ((cand.photon1NegEta() < photonSelections.PhotonMinDauEta) || (cand.photon1NegEta() > photonSelections.PhotonMaxDauEta)) - return false; - - if ((cand.photon2Y() < photonSelections.PhotonMinRapidity) || (cand.photon2Y() > photonSelections.PhotonMaxRapidity)) - return false; - if ((cand.photon2PosEta() < photonSelections.PhotonMinDauEta) || (cand.photon2PosEta() > photonSelections.PhotonMaxDauEta)) - return false; - if ((cand.photon2NegEta() < photonSelections.PhotonMinDauEta) || (cand.photon2NegEta() > photonSelections.PhotonMaxDauEta)) + if ((TMath::Abs(cand.photon1Y()) > photonSelections.PhotonMaxRap) || (TMath::Abs(cand.photon1PosEta()) > photonSelections.PhotonMaxDauEta) || (TMath::Abs(cand.photon1NegEta()) > photonSelections.PhotonMaxDauEta)) return false; - // Z conversion - if ((cand.photon1Zconv() < photonSelections.PhotonMinZ) || (cand.photon1Zconv() > photonSelections.PhotonMaxZ)) - return false; - - if ((cand.photon2Zconv() < photonSelections.PhotonMinZ) || (cand.photon2Zconv() > photonSelections.PhotonMaxZ)) + if ((TMath::Abs(cand.photon2Y()) > photonSelections.PhotonMaxRap) || (TMath::Abs(cand.photon2PosEta()) > photonSelections.PhotonMaxDauEta) || (TMath::Abs(cand.photon2NegEta()) > photonSelections.PhotonMaxDauEta)) return false; if (((cand.photon1Radius() < photonSelections.PhotonMinRadius) || (cand.photon1Radius() > photonSelections.PhotonMaxRadius)) || @@ -1769,15 +1489,14 @@ struct sigmaanalysis { return false; // Pi0 specific selections - float pi0Y = cand.pi0Y(); - if constexpr (requires { cand.pi0MCY(); }) { // If MC - pi0Y = cand.pi0MCY(); + if constexpr (requires { cand.pi0MCY(); }) { // MC + if (TMath::Abs(cand.pi0MCY()) > pi0Selections.Pi0MaxRap) + return false; + } else { // DATA + if (TMath::Abs(cand.pi0Y()) > pi0Selections.Pi0MaxRap) + return false; } - // Rapidity - if ((pi0Y < pi0Selections.Pi0MinRapidity) || (pi0Y > pi0Selections.Pi0MaxRapidity)) - return false; - // V0Pair Radius if (cand.radius() > pi0Selections.Pi0MaxRadius) return false; @@ -1808,7 +1527,7 @@ struct sigmaanalysis { continue; // Pi0s loop - float centrality = getCentralityRun3(coll); + float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C(); for (size_t i = 0; i < pi0grouped[coll.globalIndex()].size(); i++) { auto pi0 = fullPi0s.rawIteratorAt(pi0grouped[coll.globalIndex()][i]); @@ -1835,54 +1554,42 @@ struct sigmaanalysis { } } - void processRealData(soa::Join const& collisions, Sigma0s const& fullSigma0s) - { - analyzeRecoeSigma0s(collisions, fullSigma0s); - } - - void processRealDataWithEMCal(soa::Join const& collisions, Sigma0sWithEMCal const& fullSigma0s) - { - analyzeRecoeSigma0s(collisions, fullSigma0s); - } - - void processMonteCarlo(soa::Join const& collisions, MCSigma0s const& fullSigma0s) + void processRealData(soa::Join const& collisions, Sigma0s const& fullSigma0s) { analyzeRecoeSigma0s(collisions, fullSigma0s); } - void processMonteCarloWithEMCal(soa::Join const& collisions, MCSigma0sWithEMCal const& fullSigma0s) + void processMonteCarlo(soa::Join const& collisions, MCSigma0s const& fullSigma0s) { analyzeRecoeSigma0s(collisions, fullSigma0s); } // Simulated processing in Run 3 - void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& Sigma0Gens) + void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& Sigma0Gens) { analyzeGenerated(mcCollisions, collisions, Sigma0Gens); } // _____________________________________________________ // Pi0 QA - void processPi0RealData(soa::Join const& collisions, soa::Join const& fullPi0s) + void processPi0RealData(soa::Join const& collisions, soa::Join const& fullPi0s) { analyzeRecoePi0s(collisions, fullPi0s); } - void processPi0MonteCarlo(soa::Join const& collisions, soa::Join const& fullPi0s) + void processPi0MonteCarlo(soa::Join const& collisions, soa::Join const& fullPi0s) { analyzeRecoePi0s(collisions, fullPi0s); } - void processPi0GeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& Pi0Gens) + void processPi0GeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& Pi0Gens) { analyzeGenerated(mcCollisions, collisions, Pi0Gens); } // _____________________________________________________ PROCESS_SWITCH(sigmaanalysis, processRealData, "Do real data analysis", true); - PROCESS_SWITCH(sigmaanalysis, processRealDataWithEMCal, "Do real data analysis with EMCal photons", false); PROCESS_SWITCH(sigmaanalysis, processMonteCarlo, "Do Monte-Carlo-based analysis", false); - PROCESS_SWITCH(sigmaanalysis, processMonteCarloWithEMCal, "Do Monte-Carlo-based analysis with EMCal photons", false); PROCESS_SWITCH(sigmaanalysis, processGeneratedRun3, "process MC generated Run 3", false); PROCESS_SWITCH(sigmaanalysis, processPi0RealData, "Do real data analysis for pi0 QA", false); PROCESS_SWITCH(sigmaanalysis, processPi0MonteCarlo, "Do Monte-Carlo-based analysis for pi0 QA", false); diff --git a/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx b/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx index 240e0b0922e..f06a64a5bbf 100644 --- a/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx +++ b/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx @@ -29,33 +29,35 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" +#include "Common/Core/TrackSelection.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include +#include +#include +#include +#include +#include + +#include #include #include #include @@ -69,6 +71,7 @@ const float ctauOmegaPDG = 2.461; // Omega PDG lifetime using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using std::array; using namespace o2::aod::rctsel; @@ -769,7 +772,7 @@ struct strangenessderivedbinnedinfo { // ______________________________________________________ // Real data processing - no MC subscription - void process(soa::Join::iterator const& collision, V0Candidates const& fullV0s, CascadeCandidates const& fullCascades, DauTracks const&) + void process(soa::Join::iterator const& collision, V0Candidates const& fullV0s, CascadeCandidates const& fullCascades, DauTracks const&) { // Fire up CCDB if (cfgSkimmedProcessing) { diff --git a/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx b/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx index 3bf53942f44..cc1805fb6ae 100644 --- a/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx +++ b/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx @@ -17,36 +17,36 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGMM/Mult/DataModel/Index.h" // for Particles2Tracks table -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/StepTHn.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "Math/GenVector/Boost.h" +#include "Math/Vector2D.h" +#include "Math/Vector3D.h" +#include "Math/Vector4D.h" + +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) -#include -#include - -#include #include #include #include @@ -54,6 +54,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using std::array; using namespace o2::aod::rctsel; using dauTracks = soa::Join; @@ -804,7 +805,7 @@ struct LfTaskLambdaSpinCorr { using v0Cand = soa::Filtered; // void processDerivedData(soa::Join::iterator const& collision, v0Candidates const& V0s, dauTracks const&) - void processDerivedData(soa::Join::iterator const& collision, v0Cand const& V0s, dauTracks const&) + void processDerivedData(soa::Join::iterator const& collision, v0Cand const& V0s, dauTracks const&) { histos.fill(HIST("hEvtSelInfo"), 0.5); if (rctCut.requireRCTFlagChecker && !rctChecker(collision)) { @@ -926,7 +927,7 @@ struct LfTaskLambdaSpinCorr { // Preslice tracksPerCollisionV0Mixed = o2::aod::v0data::straCollisionId; // for derived data only Preslice tracksPerCollisionV0Mixed = o2::aod::v0data::straCollisionId; // for derived data only // void processDerivedDataMixed(soa::Join const& collisions, v0Candidates const& V0s, dauTracks const&) - void processDerivedDataMixed(soa::Join const& collisions, v0Cand const& V0s, dauTracks const&) + void processDerivedDataMixed(soa::Join const& collisions, v0Cand const& V0s, dauTracks const&) { From a3cea84be31db9a8e4f1904f5fde7c747a8b980e Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 1 Jun 2026 12:06:59 +0000 Subject: [PATCH 04/22] Please consider the following formatting changes --- PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx | 4 +- PWGDQ/Tasks/quarkoniaToHyperons.cxx | 53 ++++-------- PWGLF/DataModel/LFStrangenessTables.h | 83 +++++++++---------- .../Converters/straevselextrasconverter2.cxx | 2 +- .../TableProducer/Strangeness/cascadeflow.cxx | 2 +- .../Strangeness/strangederivedbuilder.cxx | 6 +- PWGLF/Tasks/QC/strderivedGenQA.cxx | 4 +- .../Tasks/Resonances/higherMassResonances.cxx | 4 +- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 4 +- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 4 +- .../strangenessderivedbinnedinfo.cxx | 4 +- .../Tasks/Strangeness/taskLambdaSpinCorr.cxx | 4 +- 12 files changed, 75 insertions(+), 99 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx b/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx index d7dd238246f..07bb4b84eb7 100644 --- a/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx +++ b/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx @@ -18,14 +18,14 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/cascqaanalysis.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" #include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoAHelpers.h" diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index b0017d58f55..f09ddb7f810 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -29,36 +29,6 @@ // david.dobrigkeit.chinellato@cern.ch // -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include "Math/Vector3D.h" - -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "ReconstructionDataFormats/Track.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Common/Core/trackUtilities.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/LFStrangenessMLTables.h" #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" @@ -79,6 +49,11 @@ #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" +#include "DCAFitter/DCAFitterN.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DetectorsBase/GeometryManager.h" +#include "DetectorsBase/Propagator.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" @@ -86,6 +61,7 @@ #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/Track.h" +#include "Math/Vector3D.h" #include #include #include @@ -389,7 +365,7 @@ struct QuarkoniaToHyperons { ConfigurableAxis axisHypPairPhi{"axisHypPairPhi", {180, 0.0f, constants::math::TwoPI}, "Hyperon pair azimuthal angle (rad)"}; } axes; - o2::base::MatLayerCylSet* lut; // material LUT for DCA fitter + o2::base::MatLayerCylSet* lut; // material LUT for DCA fitter o2::vertexing::DCAFitterN<2> fitter; // helper object @@ -815,8 +791,8 @@ struct QuarkoniaToHyperons { histos.add("QA/XiXiBar/h3dMassXiXiBarVsDCAPair", "h3dMassXiXiBarVsDCAPair", kTH3F, {axes.axisDCAHypPair, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairCosPA", "h3dMassXiXiBarVsPairCosPA", kTH3F, {axes.axisHypPairCosPA, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairOpAngle", "h3dMassXiXiBarVsPairOpAngle", kTH3F, {axes.axisHypPairOpAngle, axes.axisPt, axes.axisQuarkoniumMass}); - histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairEta", "h3dMassXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisQuarkoniumMass}); - histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairPhi", "h3dMassXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisQuarkoniumMass}); + histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairEta", "h3dMassXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisQuarkoniumMass}); + histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairPhi", "h3dMassXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/LaLaBar/h3dDeltaEtaXiXiBarVsPairEta", "h3dDeltaEtaXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); histos.add("QA/LaLaBar/h3dDeltaPhiXiXiBarVsPairPhi", "h3dDeltaPhiXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); } @@ -1082,11 +1058,13 @@ struct QuarkoniaToHyperons { std::array antiHyperonMomentum = {0.0f, 0.0f, 0.0f}; float DCADau = -999.f; float CosPA = -1.f; - float OpAngle = -999.f; - float Eta() const { + float OpAngle = -999.f; + float Eta() const + { return RecoDecay::eta(std::array{hyperonMomentum[0] + antiHyperonMomentum[0], hyperonMomentum[1] + antiHyperonMomentum[1], hyperonMomentum[2] + antiHyperonMomentum[2]}); } - float Phi() const { + float Phi() const + { return RecoDecay::phi(std::array{hyperonMomentum[0] + antiHyperonMomentum[0], hyperonMomentum[1] + antiHyperonMomentum[1]}); } }; @@ -1141,7 +1119,7 @@ struct QuarkoniaToHyperons { TVector3 hyp2Momentum(pairInfo.antiHyperonMomentum[0], pairInfo.antiHyperonMomentum[1], pairInfo.antiHyperonMomentum[2]); pairInfo.OpAngle = hyp1Momentum.Angle(hyp2Momentum); - if (d < 1e-5f) { // Parallel or nearly parallel lines + if (d < 1e-5f) { // Parallel or nearly parallel lines pairInfo.X = pairInfo.Y = pairInfo.Z = -999.f; // should we use another dummy value? Perhaps 999.f? return pairInfo; } @@ -1221,7 +1199,6 @@ struct QuarkoniaToHyperons { return pairInfo; } - template bool isEventAccepted(TCollision collision, bool fillHists) // check whether the collision passes our collision selections diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index b66ccbaed42..fc664bee6d8 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -283,47 +283,47 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSels_006, "AOD", "STRAEVSELS", 6, //! evsel::Sel8, evsel::Selection, //! event selection: sel8 mult::MultFT0A, mult::MultFT0C, mult::MultFV0A, // FIT detectors mult::MultFDDA, mult::MultFDDC, - mult::MultNTracksPVeta1, // track multiplicities with eta cut for INEL>0 - mult::MultPVTotalContributors, // number of PV contribs total - mult::MultNTracksGlobal, // global track multiplicities - collision::Flags, // Contains Vertex::Flags, with most notably the UPCMode to know whether the vertex has been found using UPC settings - evsel::Alias, // trigger aliases (e.g. kTVXinTRD for v2) - evsel::Rct); // Bitmask of RCT flags - -DECLARE_SOA_TABLE(StraEvSelExtras_000, "AOD", "STRAEVSELEXTRAS", //! debug information - udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc - udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc - udcollision::TimeFDDA, // Average A-side time (ns) - udcollision::TimeFDDC, // Average C-side time (ns) - udcollision::TimeFV0A, // Average A-side time (ns) - udcollision::TimeFT0A, // Average A-side time (ns) - udcollision::TimeFT0C, // Average C-side time (ns) - udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent - -DECLARE_SOA_TABLE_VERSIONED(StraEvSelExtras_001, "AOD", "STRAEVSELEXTRAS", 1, //! debug information - mult::MultZNA, mult::MultZNC, mult::MultZEM1, // ZDC signals + mult::MultNTracksPVeta1, // track multiplicities with eta cut for INEL>0 + mult::MultPVTotalContributors, // number of PV contribs total + mult::MultNTracksGlobal, // global track multiplicities + collision::Flags, // Contains Vertex::Flags, with most notably the UPCMode to know whether the vertex has been found using UPC settings + evsel::Alias, // trigger aliases (e.g. kTVXinTRD for v2) + evsel::Rct); // Bitmask of RCT flags + +DECLARE_SOA_TABLE(StraEvSelExtras_000, "AOD", "STRAEVSELEXTRAS", //! debug information + udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc + udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc + udcollision::TimeFDDA, // Average A-side time (ns) + udcollision::TimeFDDC, // Average C-side time (ns) + udcollision::TimeFV0A, // Average A-side time (ns) + udcollision::TimeFT0A, // Average A-side time (ns) + udcollision::TimeFT0C, // Average C-side time (ns) + udcollision::TriggerMaskFT0); // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent + +DECLARE_SOA_TABLE_VERSIONED(StraEvSelExtras_001, "AOD", "STRAEVSELEXTRAS", 1, //! debug information + mult::MultZNA, mult::MultZNC, mult::MultZEM1, // ZDC signals mult::MultZEM2, mult::MultZPA, mult::MultZPC, - mult::MultNTracksITSTPC, // track multiplicities, PV contribs, no eta cut - mult::MultAllTracksTPCOnly, // TPConly track multiplicities, all, no eta cut - mult::MultAllTracksITSTPC, // ITSTPC track multiplicities, all, no eta cut - evsel::NumTracksInTimeRange, // add occupancy in specified time interval by a number of tracks from nearby collisions - evsel::SumAmpFT0CInTimeRange, // add occupancy in specified time interval by a sum of FT0C amplitudes from nearby collisions - udcollision::TimeFDDA, // Average A-side time (ns) - udcollision::TimeFDDC, // Average C-side time (ns) - udcollision::TimeFV0A, // Average A-side time (ns) - udcollision::TimeFT0A, // Average A-side time (ns) - udcollision::TimeFT0C, // Average C-side time (ns) - udcollision::TriggerMaskFT0, // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent - udcollision::GapSide, // UPC info: 0 for side A, 1 for side C, 2 for both sides, 3 neither A or C, 4 not enough or too many pv contributors - udcollision::TotalFT0AmplitudeA, // UPC info: re-assigned FT0-A amplitude, in case of SG event, from the most active bc - udcollision::TotalFT0AmplitudeC, // UPC info: re-assigned FT0-C amplitude, in case of SG event, from the most active bc - udcollision::TotalFV0AmplitudeA, // UPC info: re-assigned FV0-A amplitude, in case of SG event, from the most active bc - udcollision::TotalFDDAmplitudeA, // UPC info: re-assigned FDD-A amplitude, in case of SG event, from the most active bc - udcollision::TotalFDDAmplitudeC, // UPC info: re-assigned FDD-C amplitude, in case of SG event, from the most active bc - udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc - udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc - udzdc::EnergyCommonZNA, // UPC info: re-assigned ZN-A amplitude, in case of SG event, from the most active bc - udzdc::EnergyCommonZNC, // UPC info: re-assigned ZN-C amplitude, in case of SG event, from the most active bc + mult::MultNTracksITSTPC, // track multiplicities, PV contribs, no eta cut + mult::MultAllTracksTPCOnly, // TPConly track multiplicities, all, no eta cut + mult::MultAllTracksITSTPC, // ITSTPC track multiplicities, all, no eta cut + evsel::NumTracksInTimeRange, // add occupancy in specified time interval by a number of tracks from nearby collisions + evsel::SumAmpFT0CInTimeRange, // add occupancy in specified time interval by a sum of FT0C amplitudes from nearby collisions + udcollision::TimeFDDA, // Average A-side time (ns) + udcollision::TimeFDDC, // Average C-side time (ns) + udcollision::TimeFV0A, // Average A-side time (ns) + udcollision::TimeFT0A, // Average A-side time (ns) + udcollision::TimeFT0C, // Average C-side time (ns) + udcollision::TriggerMaskFT0, // 8 trigger bits: OrA, OrC, Semi-central, Central, Vertex, IsActiveA, IsActiveC, IsFlangeEvent + udcollision::GapSide, // UPC info: 0 for side A, 1 for side C, 2 for both sides, 3 neither A or C, 4 not enough or too many pv contributors + udcollision::TotalFT0AmplitudeA, // UPC info: re-assigned FT0-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFT0AmplitudeC, // UPC info: re-assigned FT0-C amplitude, in case of SG event, from the most active bc + udcollision::TotalFV0AmplitudeA, // UPC info: re-assigned FV0-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFDDAmplitudeA, // UPC info: re-assigned FDD-A amplitude, in case of SG event, from the most active bc + udcollision::TotalFDDAmplitudeC, // UPC info: re-assigned FDD-C amplitude, in case of SG event, from the most active bc + udzdc::TimeZNA, // UPC info: re-assigned ZN-A time, in case of SG event, from the most active bc + udzdc::TimeZNC, // UPC info: re-assigned ZN-C time, in case of SG event, from the most active bc + udzdc::EnergyCommonZNA, // UPC info: re-assigned ZN-A amplitude, in case of SG event, from the most active bc + udzdc::EnergyCommonZNC, // UPC info: re-assigned ZN-C amplitude, in case of SG event, from the most active bc // Dynamic columns for manipulating information // stracollision::TotalFV0AmplitudeA, // stracollision::TotalFT0AmplitudeA, @@ -332,8 +332,7 @@ DECLARE_SOA_TABLE_VERSIONED(StraEvSelExtras_001, "AOD", "STRAEVSELEXTRAS", 1, // stracollision::TotalFDDAmplitudeC, // stracollision::EnergyCommonZNA, // stracollision::EnergyCommonZNC, - stracollision::IsUPC - ); + stracollision::IsUPC); DECLARE_SOA_TABLE(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8 diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx index 3fef1ff0d7f..7bcea579b8d 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx @@ -43,7 +43,7 @@ struct straevselextrasconverter2 { -999., // dummy timeFV0A, -999., // dummy timeFT0A, -999., // dummy timeFT0C, - 0, // dummy triggerMaskFT0, + 0, // dummy triggerMaskFT0, -999, // dummy gapSide, -999., // dummy totalFT0AmplitudeA, -999., // dummy totalFT0AmplitudeC, diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 62d17b34371..2365a74dc4d 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -33,9 +33,9 @@ #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" +#include "Math/GenVector/Boost.h" #include "Math/Vector3D.h" #include "Math/Vector4D.h" -#include "Math/GenVector/Boost.h" #include "TRandom3.h" #include diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index 0a48330dd14..fc3ba0ff903 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -560,7 +560,7 @@ struct strangederivedbuilder { products.strangeCents(collision.centFT0M(), collision.centFT0A(), centrality, collision.centFV0A(), collision.centFT0CVariant1(), collision.centFT0CVariant2(), collision.centMFT(), collision.centNGlobal(), collision.centNTPV()); - products.strangeEvSels(collision.sel8(), collision.selection_raw(), + products.strangeEvSels(collision.sel8(), collision.selection_raw(), collision.multFT0A() * static_cast(fillTruncationOptions.fillRawFT0A), collision.multFT0C() * static_cast(fillTruncationOptions.fillRawFT0C), collision.multFV0A() * static_cast(fillTruncationOptions.fillRawFV0A), @@ -584,8 +584,8 @@ struct strangederivedbuilder { collision.multAllTracksITSTPC() * static_cast(fillTruncationOptions.fillRawNTracksForCorrelation), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange(), - timeFDDA, timeFDDC, // FDD info - timeFV0A, // FV0A info + timeFDDA, timeFDDC, // FDD info + timeFV0A, // FV0A info timeFT0A, timeFT0C, ft0TriggerMask, // FT0 info // UPC info gapSide, diff --git a/PWGLF/Tasks/QC/strderivedGenQA.cxx b/PWGLF/Tasks/QC/strderivedGenQA.cxx index daf46fd3713..4760a4e9520 100644 --- a/PWGLF/Tasks/QC/strderivedGenQA.cxx +++ b/PWGLF/Tasks/QC/strderivedGenQA.cxx @@ -23,14 +23,14 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" diff --git a/PWGLF/Tasks/Resonances/higherMassResonances.cxx b/PWGLF/Tasks/Resonances/higherMassResonances.cxx index cbcc1409b6f..e2b9736aef7 100644 --- a/PWGLF/Tasks/Resonances/higherMassResonances.cxx +++ b/PWGLF/Tasks/Resonances/higherMassResonances.cxx @@ -17,6 +17,8 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" // +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -25,8 +27,6 @@ #include "Common/DataModel/PIDResponseTOF.h" // #include "Common/DataModel/PIDResponseTPC.h" // #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisDataModel.h" diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index e241a72ef0f..6414e063449 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -15,6 +15,8 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/SPCalibrationTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" @@ -24,8 +26,6 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 7aee4ffe6f6..d3aa3dad172 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -24,6 +24,8 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" @@ -31,8 +33,6 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "CCDB/BasicCCDBManager.h" #include "Framework/ASoA.h" diff --git a/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx b/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx index f06a64a5bbf..e8b8ceeef2c 100644 --- a/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx +++ b/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx @@ -29,6 +29,8 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/Zorro.h" @@ -38,8 +40,6 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" diff --git a/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx b/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx index cc1805fb6ae..f89b3b5e6d6 100644 --- a/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx +++ b/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx @@ -19,6 +19,8 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGMM/Mult/DataModel/Index.h" // for Particles2Tracks table +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -27,8 +29,6 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "CCDB/BasicCCDBManager.h" #include "CommonConstants/PhysicsConstants.h" From 2f97dd4941246c4a498e81d2fa4aaff6f9cae6de Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 14:58:25 +0200 Subject: [PATCH 05/22] Remove unused McCollisionExtra.h include --- PWGLF/DataModel/LFStrangenessTables.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index acca95538a4..4eb92b3d43a 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -19,7 +19,6 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/McCollisionExtra.h" // IWYU pragma: keep (FIXME: not used, remove asap) #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Qvectors.h" From 212bc7209d665128b8db3441162741e403a9563b Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:02:17 +0200 Subject: [PATCH 06/22] Fix CMakeLists.txt for strangeness converters --- .../Strangeness/Converters/CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 94b7800b352..ac9d4aaf472 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -24,6 +24,16 @@ o2physics_add_dpl_workflow(stradautrackstofpidconverter2 PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(stradautrackstofpidconverter3 + SOURCES stradautrackstofpidconverter3.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(stradautracksextraconverter + SOURCES stradautracksextraconverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stradautracksextraconverter2 SOURCES stradautracksextraconverter2.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore @@ -129,6 +139,11 @@ o2physics_add_dpl_workflow(stracentconverter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(stracentconverter2 + SOURCES stracentconverter2.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stramccollmultconverter SOURCES stramccollmultconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore From 1d8a0d0a274f2e3f587ed960895cf1976aa0d791 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:03:38 +0200 Subject: [PATCH 07/22] Add workflow for stradautracksconverter --- PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index ac9d4aaf472..2cd12ee97b1 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -9,6 +9,11 @@ # granted to it by virtue of its status as an Intergovernmental Organization # or submit itself to any jurisdiction. +o2physics_add_dpl_workflow(stradautracksconverter + SOURCES stradautracksconverter.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stradautrackstpcpidconverter SOURCES stradautrackstpcpidconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore From b8ac0da07236e8d7255cefbbe4c8bd66848398aa Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:14:51 +0200 Subject: [PATCH 08/22] Update sigmaanalysis.cxx --- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 935 ++++++++++++++-------- 1 file changed, 614 insertions(+), 321 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index d3aa3dad172..c7bff11c752 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -20,48 +20,47 @@ // #include "PWGLF/DataModel/LFSigmaTables.h" -#include "PWGLF/DataModel/LFStrangenessMLTables.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include +#include #include #include #include #include +#include +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; -using MCSigma0s = soa::Join; using Sigma0s = soa::Join; +using MCSigma0s = soa::Join; +using Sigma0sWithEMCal = soa::Join; +using MCSigma0sWithEMCal = soa::Join; static const std::vector PhotonSels = {"NoSel", "V0Type", "DCADauToPV", "DCADau", "DauTPCCR", "TPCNSigmaEl", "V0pT", @@ -74,24 +73,34 @@ static const std::vector LambdaSels = {"NoSel", "V0Radius", "DCADau static const std::vector DirList = {"BeforeSel", "AfterSel"}; +enum CentEstimator { + kCentFT0C = 0, + kCentFT0M, + kCentFT0CVariant1, + kCentMFT, + kCentNGlobal, + kCentFV0A +}; + struct sigmaanalysis { Service ccdb; ctpRateFetcher rateFetcher; //__________________________________________________ - // For manual sliceBy - // SliceCache cache; - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // Species + Configurable doLambdaStar{"doLambdaStar", false, "Build Lambda(1520) instead of Sigma0"}; + // Event level Configurable doPPAnalysis{"doPPAnalysis", true, "if in pp, set to true"}; + Configurable centralityEstimator{"centralityEstimator", kCentFT0C, "Run 3 centrality estimator (0:CentFT0C, 1:CentFT0M, 2:CentFT0CVariant1, 3:CentMFT, 4:CentNGlobal, 5:CentFV0A)"}; Configurable fGetIR{"fGetIR", false, "Flag to retrieve the IR info."}; Configurable fIRCrashOnNull{"fIRCrashOnNull", false, "Flag to avoid CTP RateFetcher crash."}; Configurable irSource{"irSource", "T0VTX", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; struct : ConfigurableGroup { + std::string prefix = "eventSelections"; // JSON group name Configurable requireSel8{"requireSel8", true, "require sel8 event selection"}; Configurable requireTriggerTVX{"requireTriggerTVX", true, "require FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level"}; Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border"}; @@ -124,20 +133,27 @@ struct sigmaanalysis { } eventSelections; // Generated Sigma0s - Configurable mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."}; + struct : ConfigurableGroup { + std::string prefix = "genSelections"; // JSON group name + Configurable mc_keepOnlyFromGenerator{"mc_keepOnlyFromGenerator", true, "if true, consider only particles from generator to calculate efficiency."}; + Configurable mc_rapidityMin{"mc_rapidityMin", -0.5, "Min generated particle rapidity"}; + Configurable mc_rapidityMax{"mc_rapidityMax", 0.5, "Max generated particle rapidity"}; + } genSelections; // QA + Configurable fdoSigma0QA{"doSigma0QA", false, "if true, perform Sigma0 QA analysis. Only works with MC."}; Configurable fillBkgQAhistos{"fillBkgQAhistos", false, "if true, fill MC QA histograms for Bkg study. Only works with MC."}; Configurable fillResoQAhistos{"fillResoQAhistos", false, "if true, fill MC QA histograms for pT resolution study. Only works with MC."}; + Configurable fillSelhistos{"fillSelhistos", true, "if true, fill QA histos for selections."}; // Analysis strategy: Configurable doMCAssociation{"doMCAssociation", false, "Flag to process only signal candidates. Use only with processMonteCarlo!"}; Configurable selRecoFromGenerator{"selRecoFromGenerator", false, "Flag to process only signal candidates from generator"}; - Configurable doPhotonLambdaSelQA{"doPhotonLambdaSelQA", false, "Flag to fill photon and lambda QA histos!"}; // For Selection: //// Lambda criteria:: struct : ConfigurableGroup { + std::string prefix = "lambdaSelections"; // JSON group name Configurable Lambda_MLThreshold{"Lambda_MLThreshold", 0.1, "Decision Threshold value to select lambdas"}; Configurable AntiLambda_MLThreshold{"AntiLambda_MLThreshold", 0.1, "Decision Threshold value to select antilambdas"}; Configurable LambdaMinDCANegToPv{"LambdaMinDCANegToPv", .05, "min DCA Neg To PV (cm)"}; @@ -154,7 +170,9 @@ struct sigmaanalysis { Configurable LambdaMinv0cospa{"LambdaMinv0cospa", 0.95, "Min V0 CosPA"}; Configurable LambdaMaxLifeTime{"LambdaMaxLifeTime", 30, "Max lifetime"}; Configurable LambdaWindow{"LambdaWindow", 0.015, "Mass window around expected (in GeV/c2)"}; - Configurable LambdaMaxRap{"LambdaMaxRap", 0.8, "Max lambda rapidity"}; + Configurable LambdaMinRapidity{"LambdaMinRapidity", -0.5, "v0 min rapidity"}; + Configurable LambdaMaxRapidity{"LambdaMaxRapidity", 0.5, "v0 max rapidity"}; + Configurable LambdaMinDauEta{"LambdaMinDauEta", -0.8, "Min pseudorapidity of daughter tracks"}; Configurable LambdaMaxDauEta{"LambdaMaxDauEta", 0.8, "Max pseudorapidity of daughter tracks"}; Configurable fselLambdaTPCPID{"fselLambdaTPCPID", true, "Flag to select lambda-like candidates using TPC NSigma."}; Configurable fselLambdaTOFPID{"fselLambdaTOFPID", false, "Flag to select lambda-like candidates using TOF NSigma."}; @@ -170,6 +188,7 @@ struct sigmaanalysis { //// Photon criteria: struct : ConfigurableGroup { + std::string prefix = "photonSelections"; // JSON group name Configurable Gamma_MLThreshold{"Gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"}; Configurable Photonv0TypeSel{"Photonv0TypeSel", 7, "select on a certain V0 type (leave negative if no selection desired)"}; Configurable PhotonMinDCADauToPv{"PhotonMinDCADauToPv", 0.0, "Min DCA daughter To PV (cm)"}; @@ -179,16 +198,19 @@ struct sigmaanalysis { Configurable PhotonMaxTPCNSigmas{"PhotonMaxTPCNSigmas", 7, "Max TPC NSigmas for daughters"}; Configurable PhotonMinPt{"PhotonMinPt", 0.0, "Min photon pT (GeV/c)"}; Configurable PhotonMaxPt{"PhotonMaxPt", 50.0, "Max photon pT (GeV/c)"}; - Configurable PhotonMaxRap{"PhotonMaxRap", 0.5, "Max photon rapidity"}; + Configurable PhotonMinRapidity{"PhotonMinRapidity", -0.5, "v0 min rapidity"}; + Configurable PhotonMaxRapidity{"PhotonMaxRapidity", 0.5, "v0 max rapidity"}; + Configurable PhotonMinDauEta{"PhotonMinDauEta", -0.8, "Min pseudorapidity of daughter tracks"}; + Configurable PhotonMaxDauEta{"PhotonMaxDauEta", 0.8, "Max pseudorapidity of daughter tracks"}; Configurable PhotonMinRadius{"PhotonMinRadius", 3.0, "Min photon conversion radius (cm)"}; Configurable PhotonMaxRadius{"PhotonMaxRadius", 115, "Max photon conversion radius (cm)"}; + Configurable PhotonMinZ{"PhotonMinZ", -240, "Min photon conversion point z value (cm)"}; Configurable PhotonMaxZ{"PhotonMaxZ", 240, "Max photon conversion point z value (cm)"}; Configurable PhotonMaxQt{"PhotonMaxQt", 0.05, "Max photon qt value (AP plot) (GeV/c)"}; Configurable PhotonMaxAlpha{"PhotonMaxAlpha", 0.95, "Max photon alpha absolute value (AP plot)"}; Configurable PhotonMinV0cospa{"PhotonMinV0cospa", 0.80, "Min V0 CosPA"}; Configurable PhotonMaxMass{"PhotonMaxMass", 0.10, "Max photon mass (GeV/c^{2})"}; Configurable PhotonPsiPairMax{"PhotonPsiPairMax", 1e+9, "maximum psi angle of the track pair"}; - Configurable PhotonMaxDauEta{"PhotonMaxDauEta", 0.8, "Max pseudorapidity of daughter tracks"}; Configurable PhotonLineCutZ0{"PhotonLineCutZ0", 7.0, "The offset for the linecute used in the Z vs R plot"}; Configurable PhotonPhiMin1{"PhotonPhiMin1", -1, "Phi min value to reject photons, region 1 (leave negative if no selection desired)"}; Configurable PhotonPhiMax1{"PhotonPhiMax1", -1, "Phi max value to reject photons, region 1 (leave negative if no selection desired)"}; @@ -196,15 +218,36 @@ struct sigmaanalysis { Configurable PhotonPhiMax2{"PhotonPhiMax2", -1, "Phi min value to reject photons, region 2 (leave negative if no selection desired)"}; } photonSelections; + //// Photon criteria: + struct : ConfigurableGroup { + std::string prefix = "EMCalPhotonSelections"; // JSON group name + Configurable definition{"definition", 13, "Cluster definitions to be accepted (e.g. 13 for kV3MostSplitLowSeed)"}; + Configurable MinCells{"MinCells", 1, "Min number of cells in cluster"}; + Configurable MinEnergy{"MinEnergy", 0.0, "Minimum energy of selected clusters (GeV)"}; + Configurable MaxEnergy{"MaxEnergy", 5, "Max energy of selected clusters (GeV)"}; + Configurable MaxEta{"MaxEta", 1.0, "Max absolute cluster Eta"}; + Configurable MinTime{"MinTime", -50, "Minimum time of selected clusters (ns)"}; + Configurable MaxTime{"MaxTime", 50, "Max time of selected clusters (ns)"}; + Configurable RemoveExotic{"RemoveExotic", false, "Flag to enable the removal of exotic clusters"}; + Configurable MinM02{"MinM02", -1., "Minimum shower shape long axis"}; + Configurable MaxM02{"MaxM02", 5., "Max shower shape long axis"}; + Configurable RemoveMatchedTrack{"RemoveMatchedTrack", true, "Flag to enable the removal of clusters matched to tracks"}; + + } EMCalPhotonSelections; + struct : ConfigurableGroup { - Configurable Sigma0MaxRap{"Sigma0MaxRap", 0.5, "Max sigma0 rapidity"}; + std::string prefix = "sigma0Selections"; // JSON group name + Configurable Sigma0MinRapidity{"Sigma0MinRapidity", -0.5, "sigma0 min rapidity"}; + Configurable Sigma0MaxRapidity{"Sigma0MaxRapidity", 0.5, "sigma0 max rapidity"}; Configurable Sigma0MaxRadius{"Sigma0MaxRadius", 200, "Max sigma0 decay radius"}; Configurable Sigma0MaxDCADau{"Sigma0MaxDCADau", 50, "Max sigma0 DCA between daughters"}; Configurable Sigma0MaxOPAngle{"Sigma0MaxOPAngle", 7, "Max sigma0 OP Angle between daughters"}; } sigma0Selections; struct : ConfigurableGroup { - Configurable Pi0MaxRap{"Pi0MaxRap", 0.5, "Max sigma0 rapidity"}; + std::string prefix = "pi0Selections"; // JSON group name + Configurable Pi0MinRapidity{"Pi0MinRapidity", -0.5, "pi0 min rapidity"}; + Configurable Pi0MaxRapidity{"Pi0MaxRapidity", 0.5, "pi0 max rapidity"}; Configurable Pi0MaxRadius{"Pi0MaxRadius", 200, "Max sigma0 decay radius"}; Configurable Pi0MaxDCADau{"Pi0MaxDCADau", 50, "Max sigma0 DCA between daughters"}; } pi0Selections; @@ -215,6 +258,7 @@ struct sigmaanalysis { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; ConfigurableAxis axisInvPt{"axisInvPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 5.0, 10.0, 20.0, 50.0}, ""}; ConfigurableAxis axisDeltaPt{"axisDeltaPt", {400, -50.0, 50.0}, ""}; + ConfigurableAxis axisReso{"axisReso", {400, -2.0, 2.0}, ""}; ConfigurableAxis axisRapidity{"axisRapidity", {100, -2.0f, 2.0f}, "Rapidity"}; ConfigurableAxis axisIRBinning{"axisIRBinning", {150, 0, 1500}, "Binning for the interaction rate (kHz)"}; ConfigurableAxis axisNch{"axisNch", {300, 0.0f, 3000.0f}, "N_{ch}"}; @@ -249,15 +293,23 @@ struct sigmaanalysis { ConfigurableAxis axisPhi{"axisPhi", {200, 0, 2 * o2::constants::math::PI}, "Phi for photons"}; ConfigurableAxis axisZ{"axisZ", {120, -120.0f, 120.0f}, "V0 Z position (cm)"}; + // EMCal-specifc + ConfigurableAxis axisClrDefinition{"axisClrDefinition", {51, -0.5, 50.5}, "Cluster Definition"}; + ConfigurableAxis axisClrNCells{"axisClrNCells", {25, 0.0, 25}, "N cells per cluster"}; + ConfigurableAxis axisClrEnergy{"axisClrEnergy", {400, 0.0, 10}, "Energy per cluster"}; + ConfigurableAxis axisClrTime{"axisClrTime", {300, -30.0, 30.0}, "cluster time (ns)"}; + ConfigurableAxis axisClrShape{"axisClrShape", {100, 0.0, 1.0}, "cluster shape"}; + ConfigurableAxis axisCandSel{"axisCandSel", {20, 0.5f, +20.5f}, "Candidate Selection"}; // ML ConfigurableAxis MLProb{"MLOutput", {100, 0.0f, 1.0f}, ""}; + int NSigma0Cand = 0; void init(InitContext const&) { LOGF(info, "Initializing now: cross-checking correctness..."); - if ((doprocessRealData + doprocessMonteCarlo + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || + if ((doprocessRealData + doprocessRealDataWithEMCal + doprocessMonteCarlo + doprocessMonteCarloWithEMCal + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || (doprocessGeneratedRun3 + doprocessPi0GeneratedRun3 > 1)) { LOGF(fatal, "You have enabled more than one process function. Please check your configuration! Aborting now."); } @@ -269,6 +321,7 @@ struct sigmaanalysis { // Event Counters histos.add("hEventCentrality", "hEventCentrality", kTH1D, {axisCentrality}); + histos.add("hCentralityVsNch", "hCentralityVsNch", kTH2D, {{101, 0.0f, 101.0f}, axisNch}); histos.add("hEventSelection", "hEventSelection", kTH1D, {{21, -0.5f, +20.5f}}); histos.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); @@ -303,61 +356,82 @@ struct sigmaanalysis { histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2D, {axisCentrality, axisIRBinning}); } - if (doprocessRealData || doprocessMonteCarlo) { + if (doprocessRealData || doprocessRealDataWithEMCal || doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { for (const auto& histodir : DirList) { - histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); - histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); - histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); - histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - - histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); - histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hNegEta", "hNegEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hRadius", "hRadius", kTH1D, {axisV0Radius}); - histos.add(histodir + "/Photon/hZ", "hZ", kTH1D, {axisZ}); - histos.add(histodir + "/Photon/h2dRZCut", "h2dRZCut", kTH2D, {axisZ, axisV0Radius}); - histos.add(histodir + "/Photon/h2dRZPlane", "h2dRZPlane", kTH2D, {axisZ, axisV0Radius}); - histos.add(histodir + "/Photon/hCosPA", "hCosPA", kTH1D, {axisCosPA}); - histos.add(histodir + "/Photon/hPsiPair", "hPsiPair", kTH1D, {axisPsiPair}); - histos.add(histodir + "/Photon/hPhi", "hPhi", kTH1D, {axisPhi}); - histos.add(histodir + "/Photon/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); - histos.add(histodir + "/Photon/hMass", "hMass", kTH1D, {axisPhotonMass}); - - histos.add(histodir + "/Lambda/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); - histos.add(histodir + "/Lambda/hRadius", "hRadius", kTH1D, {axisV0Radius}); - histos.add(histodir + "/Lambda/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); - histos.add(histodir + "/Lambda/hCosPA", "hCosPA", kTH1D, {axisCosPA}); - histos.add(histodir + "/Lambda/hY", "hY", kTH1D, {axisRapidity}); - histos.add(histodir + "/Lambda/hPosEta", "hPosEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Lambda/hNegEta", "hNegEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Lambda/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Lambda/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Lambda/hPosITSCls", "hPosITSCls", kTH1D, {axisNCls}); - histos.add(histodir + "/Lambda/hNegITSCls", "hNegITSCls", kTH1D, {axisNCls}); - histos.add(histodir + "/Lambda/hPosChi2PerNc", "hPosChi2PerNc", kTH1D, {axisChi2PerNcl}); - histos.add(histodir + "/Lambda/hNegChi2PerNc", "hNegChi2PerNc", kTH1D, {axisChi2PerNcl}); - histos.add(histodir + "/Lambda/hLifeTime", "hLifeTime", kTH1D, {axisLifetime}); - histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_LambdaPr", "h2dTPCvsTOFNSigma_LambdaPr", kTH2D, {axisTPCNSigma, axisTOFNSigma}); - histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_LambdaPi", "h2dTPCvsTOFNSigma_LambdaPi", kTH2D, {axisTPCNSigma, axisTOFNSigma}); - histos.add(histodir + "/Lambda/hLambdaDCANegToPV", "hLambdaDCANegToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Lambda/hLambdaDCAPosToPV", "hLambdaDCAPosToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Lambda/hLambdapT", "hLambdapT", kTH1D, {axisPt}); - histos.add(histodir + "/Lambda/hLambdaMass", "hLambdaMass", kTH1D, {axisLambdaMass}); - histos.add(histodir + "/Lambda/h3dLambdaMass", "h3dLambdaMass", kTH3D, {axisCentrality, axisPt, axisLambdaMass}); - histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_ALambdaPr", "h2dTPCvsTOFNSigma_ALambdaPr", kTH2D, {axisTPCNSigma, axisTOFNSigma}); - histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_ALambdaPi", "h2dTPCvsTOFNSigma_ALambdaPi", kTH2D, {axisTPCNSigma, axisTOFNSigma}); - histos.add(histodir + "/Lambda/hALambdaDCANegToPV", "hALambdaDCANegToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Lambda/hALambdaDCAPosToPV", "hALambdaDCAPosToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Lambda/hALambdapT", "hALambdapT", kTH1D, {axisPt}); - histos.add(histodir + "/Lambda/hAntiLambdaMass", "hAntiLambdaMass", kTH1D, {axisLambdaMass}); - histos.add(histodir + "/Lambda/h3dAntiLambdaMass", "h3dAntiLambdaMass", kTH3D, {axisCentrality, axisPt, axisLambdaMass}); + if (fillSelhistos) { + + if (doprocessRealData || doprocessMonteCarlo) { + + histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); + histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); + histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); + histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + + // PCM photons + histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); + histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hNegEta", "hNegEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hRadius", "hRadius", kTH1D, {axisV0Radius}); + histos.add(histodir + "/Photon/hZ", "hZ", kTH1D, {axisZ}); + histos.add(histodir + "/Photon/h2dRZCut", "h2dRZCut", kTH2D, {axisZ, axisV0Radius}); + histos.add(histodir + "/Photon/h2dRZPlane", "h2dRZPlane", kTH2D, {axisZ, axisV0Radius}); + histos.add(histodir + "/Photon/hCosPA", "hCosPA", kTH1D, {axisCosPA}); + histos.add(histodir + "/Photon/hPsiPair", "hPsiPair", kTH1D, {axisPsiPair}); + histos.add(histodir + "/Photon/hPhi", "hPhi", kTH1D, {axisPhi}); + histos.add(histodir + "/Photon/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); + histos.add(histodir + "/Photon/hMass", "hMass", kTH1D, {axisPhotonMass}); + histos.add(histodir + "/Photon/h3dPhotonYSigma0Mass", "h3dPhotonYSigma0Mass", kTH3D, {axisRapidity, axisPt, axisSigmaMass}); + histos.add(histodir + "/Photon/h3dPhotonRadiusSigma0Mass", "h3dPhotonRadiusSigma0Mass", kTH3D, {axisV0Radius, axisPt, axisSigmaMass}); + } + + if (doprocessRealDataWithEMCal || doprocessMonteCarloWithEMCal) { + // EMCal photons + histos.add(histodir + "/EMCalPhotonSel/hpT", "hpT", kTH1D, {axisPt}); + histos.add(histodir + "/EMCalPhotonSel/hDefinition", "hDefinition", kTH1D, {axisClrDefinition}); + histos.add(histodir + "/EMCalPhotonSel/hNCells", "hNCells", kTH1D, {axisClrNCells}); + histos.add(histodir + "/EMCalPhotonSel/hEnergy", "hEnergy", kTH1D, {axisClrEnergy}); + histos.add(histodir + "/EMCalPhotonSel/h2dEtaVsPhi", "h2dEtaVsPhi", kTH2D, {axisRapidity, axisPhi}); + histos.add(histodir + "/EMCalPhotonSel/hTime", "hTime", kTH1D, {axisClrTime}); + histos.add(histodir + "/EMCalPhotonSel/hExotic", "hExotic", kTH1D, {{2, -0.5f, 1.5f}}); + histos.add(histodir + "/EMCalPhotonSel/hShape", "hShape", kTH1D, {axisClrShape}); + } + + histos.add(histodir + "/Lambda/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); + histos.add(histodir + "/Lambda/hRadius", "hRadius", kTH1D, {axisV0Radius}); + histos.add(histodir + "/Lambda/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); + histos.add(histodir + "/Lambda/hCosPA", "hCosPA", kTH1D, {axisCosPA}); + histos.add(histodir + "/Lambda/hY", "hY", kTH1D, {axisRapidity}); + histos.add(histodir + "/Lambda/hPosEta", "hPosEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Lambda/hNegEta", "hNegEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Lambda/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Lambda/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Lambda/hPosITSCls", "hPosITSCls", kTH1D, {axisNCls}); + histos.add(histodir + "/Lambda/hNegITSCls", "hNegITSCls", kTH1D, {axisNCls}); + histos.add(histodir + "/Lambda/hPosChi2PerNc", "hPosChi2PerNc", kTH1D, {axisChi2PerNcl}); + histos.add(histodir + "/Lambda/hNegChi2PerNc", "hNegChi2PerNc", kTH1D, {axisChi2PerNcl}); + histos.add(histodir + "/Lambda/hLifeTime", "hLifeTime", kTH1D, {axisLifetime}); + histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_LambdaPr", "h2dTPCvsTOFNSigma_LambdaPr", kTH2D, {axisTPCNSigma, axisTOFNSigma}); + histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_LambdaPi", "h2dTPCvsTOFNSigma_LambdaPi", kTH2D, {axisTPCNSigma, axisTOFNSigma}); + histos.add(histodir + "/Lambda/hLambdaDCANegToPV", "hLambdaDCANegToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Lambda/hLambdaDCAPosToPV", "hLambdaDCAPosToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Lambda/hLambdapT", "hLambdapT", kTH1D, {axisPt}); + histos.add(histodir + "/Lambda/hLambdaMass", "hLambdaMass", kTH1D, {axisLambdaMass}); + histos.add(histodir + "/Lambda/h3dLambdaMass", "h3dLambdaMass", kTH3D, {axisCentrality, axisPt, axisLambdaMass}); + histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_ALambdaPr", "h2dTPCvsTOFNSigma_ALambdaPr", kTH2D, {axisTPCNSigma, axisTOFNSigma}); + histos.add(histodir + "/Lambda/h2dTPCvsTOFNSigma_ALambdaPi", "h2dTPCvsTOFNSigma_ALambdaPi", kTH2D, {axisTPCNSigma, axisTOFNSigma}); + histos.add(histodir + "/Lambda/hALambdaDCANegToPV", "hALambdaDCANegToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Lambda/hALambdaDCAPosToPV", "hALambdaDCAPosToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Lambda/hALambdapT", "hALambdapT", kTH1D, {axisPt}); + histos.add(histodir + "/Lambda/hAntiLambdaMass", "hAntiLambdaMass", kTH1D, {axisLambdaMass}); + histos.add(histodir + "/Lambda/h3dAntiLambdaMass", "h3dAntiLambdaMass", kTH3D, {axisCentrality, axisPt, axisLambdaMass}); + } histos.add(histodir + "/h2dArmenteros", "h2dArmenteros", kTH2D, {axisAPAlpha, axisAPQt}); @@ -380,29 +454,31 @@ struct sigmaanalysis { histos.add(histodir + "/ASigma0/h3dOPAngleVsMass", "h3dOPAngleVsMass", kTH3D, {{140, 0.0f, +7.0f}, axisPt, axisSigmaMass}); // Process MC - if (doprocessMonteCarlo) { - histos.add(histodir + "/MC/Photon/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); - histos.add(histodir + "/MC/Photon/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/hMCPt", "hMCPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/MC/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); - histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); - - histos.add(histodir + "/MC/Lambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); - histos.add(histodir + "/MC/Lambda/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Lambda/hMCPt", "hMCPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Lambda/h3dTPCvsTOFNSigma_Pr", "h3dTPCvsTOFNSigma_Pr", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); - histos.add(histodir + "/MC/Lambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); - - histos.add(histodir + "/MC/ALambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); - histos.add(histodir + "/MC/ALambda/hPt", "hPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/ALambda/hMCPt", "hMCPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pr", "h3dTPCvsTOFNSigma_Pr", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); - histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); - - histos.add(histodir + "/MC/h2dArmenteros", "h2dArmenteros", kTH2D, {axisAPAlpha, axisAPQt}); + if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { + + if (fillSelhistos) { + histos.add(histodir + "/MC/Photon/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); + histos.add(histodir + "/MC/Photon/hPt", "hPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Photon/hMCPt", "hMCPt", kTH1D, {axisPt}); + + if (doprocessMonteCarlo) { + histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); + histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); + } + + histos.add(histodir + "/MC/Lambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); + histos.add(histodir + "/MC/Lambda/hPt", "hPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Lambda/hMCPt", "hMCPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Lambda/h3dTPCvsTOFNSigma_Pr", "h3dTPCvsTOFNSigma_Pr", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); + histos.add(histodir + "/MC/Lambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); + + histos.add(histodir + "/MC/ALambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); + histos.add(histodir + "/MC/ALambda/hPt", "hPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/ALambda/hMCPt", "hMCPt", kTH1D, {axisPt}); + histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pr", "h3dTPCvsTOFNSigma_Pr", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); + histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); + } histos.add(histodir + "/MC/Sigma0/hPt", "hPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Sigma0/hMCPt", "hMCPt", kTH1D, {axisPt}); @@ -426,19 +502,17 @@ struct sigmaanalysis { histos.add(histodir + "/MC/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); histos.add(histodir + "/MC/ASigma0/h3dMCProcess", "h3dMCProcess", kTH3D, {{50, -0.5f, 49.5f}, axisPt, axisSigmaMass}); - // 1/pT Resolution: - if (fillResoQAhistos && histodir == "BeforeSel") { - histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + // pT Resolution: + if (fillResoQAhistos) { + histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisReso}); + histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h2dAntiLambdaPtResolution", "h2dAntiLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); + histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dSigma0RadiusResolution", "h2dSigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dASigma0RadiusResolution", "h2dASigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); } @@ -472,20 +546,22 @@ struct sigmaanalysis { histos.add("BkgStudy/h2dFakeDaughtersMatrix", "h2dFakeDaughtersMatrix", kTHnSparseD, {{10001, -5000.5f, +5000.5f}, {10001, -5000.5f, +5000.5f}}); } - for (size_t i = 0; i < PhotonSels.size(); ++i) { - const auto& sel = PhotonSels[i]; + if (fillSelhistos) { + for (size_t i = 0; i < PhotonSels.size(); ++i) { + const auto& sel = PhotonSels[i]; - histos.add(Form("Selection/Photon/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisPhotonMass}); - histos.get(HIST("Selection/Photon/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str()); - histos.add(Form("Selection/Sigma0/h2dPhoton%s", sel.c_str()), ("h2dPhoton" + sel).c_str(), kTH2D, {axisPt, axisSigmaMass}); - } + histos.add(Form("Selection/Photon/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisPhotonMass}); + histos.get(HIST("Selection/Photon/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str()); + histos.add(Form("Selection/Sigma0/h2dPhoton%s", sel.c_str()), ("h2dPhoton" + sel).c_str(), kTH2D, {axisPt, axisSigmaMass}); + } - for (size_t i = 0; i < LambdaSels.size(); ++i) { - const auto& sel = LambdaSels[i]; + for (size_t i = 0; i < LambdaSels.size(); ++i) { + const auto& sel = LambdaSels[i]; - histos.add(Form("Selection/Lambda/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisLambdaMass}); - histos.get(HIST("Selection/Lambda/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str()); - histos.add(Form("Selection/Sigma0/h2dLambda%s", sel.c_str()), ("h2dLambda" + sel).c_str(), kTH2D, {axisPt, axisSigmaMass}); + histos.add(Form("Selection/Lambda/h2d%s", sel.c_str()), ("h2d" + sel).c_str(), kTH2D, {axisPt, axisLambdaMass}); + histos.get(HIST("Selection/Lambda/hCandidateSel"))->GetXaxis()->SetBinLabel(i + 1, sel.c_str()); + histos.add(Form("Selection/Sigma0/h2dLambda%s", sel.c_str()), ("h2dLambda" + sel).c_str(), kTH2D, {axisPt, axisSigmaMass}); + } } } @@ -513,19 +589,54 @@ struct sigmaanalysis { // Sigma0 specific if (doprocessGeneratedRun3) { + histos.add("Gen/hGenParticlesNoMCColl", "hGenParticlesNoMCColl", kTH1D, {{3, 0.5f, +3.5f}}); histos.add("Gen/h2dGenSigma0", "h2dGenSigma0", kTH2D, {axisCentrality, axisPt}); histos.add("Gen/h2dGenAntiSigma0", "h2dGenAntiSigma0", kTH2D, {axisCentrality, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC_RecoedEvt", "h2dGenSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt", "h2dGenAntiSigma0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenSigma0VsMultMC", "h2dGenSigma0VsMultMC", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenAntiSigma0VsMultMC", "h2dGenAntiSigma0VsMultMC", kTH2D, {axisNch, axisPt}); - - } else { // Pi0 specific + } + if (doprocessPi0GeneratedRun3) { // Pi0 specific histos.add("Gen/h2dGenPi0VsMultMC_RecoedEvt", "h2dGenPi0VsMultMC_RecoedEvt", kTH2D, {axisNch, axisPt}); histos.add("Gen/h2dGenPi0", "h2dGenPi0", kTH2D, {axisCentrality, axisPt}); histos.add("Gen/h2dGenPi0VsMultMC", "h2dGenPi0VsMultMC", kTH2D, {axisNch, axisPt}); } } + + // Sigma0 QA + if (fdoSigma0QA) { + histos.add("Sigma0QA/h2dAllSigma0CandMCRapVsRecoRap", "h2dAllSigma0CandMCRapVsRecoRap", kTH2D, {axisRapidity, axisRapidity}); + histos.add("Sigma0QA/h2dSigma0MCRapVsRecoRap", "h2dSigma0MCRapVsRecoRap", kTH2D, {axisRapidity, axisRapidity}); + histos.add("Sigma0QA/h2dASigma0MCRapVsRecoRap", "h2dASigma0MCRapVsRecoRap", kTH2D, {axisRapidity, axisRapidity}); + + histos.add("Sigma0QA/hDuplicates", "hDuplicates", kTH1D, {{10, -0.5f, +9.5f}}); + histos.add("Sigma0QA/hSigma0Duplicates", "hSigma0Duplicates", kTH1D, {{10, -0.5f, +9.5f}}); + histos.add("Sigma0QA/hASigma0Duplicates", "hASigma0Duplicates", kTH1D, {{10, -0.5f, +9.5f}}); + } + + // inspect histogram sizes, please + histos.print(); + } + + // Auxiliary function to get the centrality of a collision according to the selected estimator + template + auto getCentralityRun3(TCollision const& collision) + { + if (centralityEstimator == kCentFT0C) + return collision.centFT0C(); + else if (centralityEstimator == kCentFT0M) + return collision.centFT0M(); + else if (centralityEstimator == kCentFT0CVariant1) + return collision.centFT0CVariant1(); + else if (centralityEstimator == kCentMFT) + return collision.centMFT(); + else if (centralityEstimator == kCentNGlobal) + return collision.centNGlobal(); + else if (centralityEstimator == kCentFV0A) + return collision.centFV0A(); + + return -1.f; } // ______________________________________________________ @@ -638,7 +749,7 @@ struct sigmaanalysis { // Fetch interaction rate only if required (in order to limit ccdb calls) float interactionRate = (fGetIR) ? rateFetcher.fetch(ccdb.service, collision.timestamp(), collision.runNumber(), irSource, fIRCrashOnNull) * 1.e-3 : -1; - float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + float centrality = getCentralityRun3(collision); if (fGetIR) { if (interactionRate < 0) @@ -663,6 +774,7 @@ struct sigmaanalysis { // Fill centrality histogram after event selection if (fillHists) histos.fill(HIST("hEventCentrality"), centrality); + histos.fill(HIST("hCentralityVsNch"), centrality, collision.multNTracksPVeta1()); return true; } @@ -674,12 +786,21 @@ struct sigmaanalysis { std::vector getListOfRecoCollIndices(TMCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); int biggestNContribs = -1; int bestCollisionIndex = -1; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { // consider event selections in the recoed <-> gen collision association, for the denominator (or numerator) of the efficiency (or signal loss)? + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + if (eventSelections.useEvtSelInDenomEff) { if (!IsEventAccepted(collision, false)) { continue; @@ -704,6 +825,14 @@ struct sigmaanalysis { void fillGeneratedEventProperties(TMCCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { // Apply selections on MC collisions if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { @@ -721,14 +850,14 @@ struct sigmaanalysis { histos.fill(HIST("Gen/hGenEvents"), mcCollision.multMCNParticlesEta05(), 0 /* all gen. events*/); - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); // Check if there is at least one of the reconstructed collisions associated to this MC collision // If so, we consider it bool atLeastOne = false; int biggestNContribs = -1; float centrality = 100.5f; int nCollisions = 0; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); if (!IsEventAccepted(collision, false)) { continue; @@ -736,7 +865,7 @@ struct sigmaanalysis { if (biggestNContribs < collision.multPVTotalContributors()) { biggestNContribs = collision.multPVTotalContributors(); - centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + centrality = getCentralityRun3(collision); } nCollisions++; @@ -769,11 +898,17 @@ struct sigmaanalysis { float centrality = 100.5f; // Has MC collision - if (!genParticle.has_straMCCollision()) + if (!genParticle.has_straMCCollision()) { + histos.fill(HIST("Gen/hGenParticlesNoMCColl"), 1); + continue; + } + + // Rapidity selection + if ((genParticle.mcy() < genSelections.mc_rapidityMin) || (genParticle.mcy() > genSelections.mc_rapidityMax)) continue; // Selection on the source (generator/transport) - if (!genParticle.producedByGenerator() && mc_keepOnlyFromGenerator) + if (!genParticle.producedByGenerator() && genSelections.mc_keepOnlyFromGenerator) continue; // Select corresponding mc collision && Basic event selection @@ -793,33 +928,35 @@ struct sigmaanalysis { //______________________________________________________________________________ // Generated Sigma0 processing - if constexpr (requires { genParticle.sigma0MCPt(); }) { + if constexpr (requires { genParticle.isSigma0(); }) { + if (doprocessGeneratedRun3) { - float ptmc = genParticle.sigma0MCPt(); + float ptmc = genParticle.mcpt(); - if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { - auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); - centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); + if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { + auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); + centrality = getCentralityRun3(collision); - if (genParticle.isSigma0()) - histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + if (genParticle.isSigma0()) + histos.fill(HIST("Gen/h2dGenSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); - else - histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); - } + else + histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC_RecoedEvt"), mcCollision.multMCNParticlesEta05(), ptmc); + } - if (genParticle.isSigma0()) { - histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc); - histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); - } else { - histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc); - histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); + if (genParticle.isSigma0()) { + histos.fill(HIST("Gen/h2dGenSigma0"), centrality, ptmc); + histos.fill(HIST("Gen/h2dGenSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); + } else { + histos.fill(HIST("Gen/h2dGenAntiSigma0"), centrality, ptmc); + histos.fill(HIST("Gen/h2dGenAntiSigma0VsMultMC"), mcCollision.multMCNParticlesEta05(), ptmc); + } } } //______________________________________________________________________________ // Generated Pi0 processing - if constexpr (requires { genParticle.pi0MCPt(); }) { - float ptmc = genParticle.pi0MCPt(); + if (doprocessPi0GeneratedRun3) { + float ptmc = genParticle.mcpt(); if (listBestCollisionIdx[mcCollision.globalIndex()] > -1) { auto collision = collisions.iteratorAt(listBestCollisionIdx[mcCollision.globalIndex()]); @@ -841,14 +978,16 @@ struct sigmaanalysis { int TrkCode = 10; // 1: TPC-only, 2: TPC+Something, 3: ITS-Only, 4: ITS+TPC + Something, 10: anything else if (isGamma) { - if (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() == 1) - TrkCode = 1; - if ((sigma.photonPosTrackCode() != 1 && sigma.photonNegTrackCode() == 1) || (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() != 1)) - TrkCode = 2; - if (sigma.photonPosTrackCode() == 3 && sigma.photonNegTrackCode() == 3) - TrkCode = 3; - if (sigma.photonPosTrackCode() == 2 || sigma.photonNegTrackCode() == 2) - TrkCode = 4; + if constexpr (requires { sigma.photonV0Type(); }) { + if (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() == 1) + TrkCode = 1; + if ((sigma.photonPosTrackCode() != 1 && sigma.photonNegTrackCode() == 1) || (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() != 1)) + TrkCode = 2; + if (sigma.photonPosTrackCode() == 3 && sigma.photonNegTrackCode() == 3) + TrkCode = 3; + if (sigma.photonPosTrackCode() == 2 || sigma.photonNegTrackCode() == 2) + TrkCode = 4; + } } else { if (sigma.lambdaPosTrackCode() == 1 && sigma.lambdaNegTrackCode() == 1) TrkCode = 1; @@ -863,51 +1002,55 @@ struct sigmaanalysis { return TrkCode; } - template + template void getResolution(TSigma0Object const& sigma) { + // Check whether it is before or after selections + static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; + //_______________________________________ // Gamma MC association - if (sigma.photonPDGCode() == 22) { + if (sigma.photonPDGCode() == PDG_t::kGamma) { if (sigma.photonmcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.photonNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.photonPosTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt() / sigma.photonmcpt()) - 1.f); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution } } //_______________________________________ // Lambda MC association - if (sigma.lambdaPDGCode() == 3122) { + if (sigma.lambdaPDGCode() == PDG_t::kLambda0) { if (sigma.lambdamcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution } } //_______________________________________ // AntiLambda MC association - if (sigma.lambdaPDGCode() == -3122) { + if (sigma.lambdaPDGCode() == PDG_t::kLambda0Bar) { if (sigma.lambdamcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution } } //_______________________________________ // Sigma and AntiSigma MC association if (sigma.isSigma0()) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution - if (sigma.mcpt() > 0) - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + if (sigma.mcpt() > 0) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), (sigma.pt() / sigma.mcpt()) - 1.f); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + } } if (sigma.isAntiSigma0()) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution if (sigma.mcpt() > 0) - histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } } @@ -931,24 +1074,24 @@ struct sigmaanalysis { //_______________________________________ // Real Gamma x Real Lambda - but not from the same sigma0/antisigma0! - if ((PhotonPDGCode == 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122)) && (!fIsSigma && !fIsAntiSigma)) { + if ((PhotonPDGCode == PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar)) && (!fIsSigma && !fIsAntiSigma)) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueDaughters"), sigmapT, sigmaMass); histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dTrueDaughtersMatrix"), LambdaPDGCodeMother, PhotonPDGCodeMother); } //_______________________________________ // Real Gamma x fake Lambda - if ((PhotonPDGCode == 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) + if ((PhotonPDGCode == PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueGammaFakeLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Real Lambda - if ((PhotonPDGCode != 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122))) + if ((PhotonPDGCode != PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar))) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeGammaTrueLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Fake Lambda - if ((PhotonPDGCode != 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) + if ((PhotonPDGCode != PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeDaughters"), sigmapT, sigmaMass); } @@ -959,68 +1102,94 @@ struct sigmaanalysis { // Check whether it is before or after selections static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; - // Get V0trackCode - int GammaTrkCode = retrieveV0TrackCode(sigma); - int LambdaTrkCode = retrieveV0TrackCode(sigma); + float centrality = getCentralityRun3(collision); - float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; - float centrality = doPPAnalysis ? collision.centFT0M() : collision.centFT0C(); - //_______________________________________ - // Photon - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); - - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegEta"), sigma.photonNegEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hRadius"), sigma.photonRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hZ"), sigma.photonZconv()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZCut"), sigma.photonRadius(), photonRZLineCut); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZPlane"), sigma.photonZconv(), sigma.photonRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hCosPA"), sigma.photonCosPA()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPsiPair"), sigma.photonPsiPair()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPhi"), sigma.photonPhi()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dMass"), centrality, sigma.photonPt(), sigma.photonMass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hMass"), sigma.photonMass()); + if (fillSelhistos) { - //_______________________________________ - // Lambdas - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hTrackCode"), LambdaTrkCode); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hRadius"), sigma.lambdaRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hDCADau"), sigma.lambdaDCADau()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hCosPA"), sigma.lambdaCosPA()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hY"), sigma.lambdaY()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosEta"), sigma.lambdaPosEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegEta"), sigma.lambdaNegEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosTPCCR"), sigma.lambdaPosTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegTPCCR"), sigma.lambdaNegTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosITSCls"), sigma.lambdaPosITSCls()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegITSCls"), sigma.lambdaNegITSCls()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosChi2PerNc"), sigma.lambdaPosChi2PerNcl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegChi2PerNc"), sigma.lambdaNegChi2PerNcl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLifeTime"), sigma.lambdaLifeTime()); + // Get V0trackCode + int LambdaTrkCode = retrieveV0TrackCode(sigma); + + if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon + + // Base properties + int GammaTrkCode = retrieveV0TrackCode(sigma); + float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; + + //_______________________________________ + // Photon + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); + + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegEta"), sigma.photonNegEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hRadius"), sigma.photonRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hZ"), sigma.photonZconv()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZCut"), sigma.photonRadius(), photonRZLineCut); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZPlane"), sigma.photonZconv(), sigma.photonRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hCosPA"), sigma.photonCosPA()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPsiPair"), sigma.photonPsiPair()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPhi"), sigma.photonPhi()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dMass"), centrality, sigma.photonPt(), sigma.photonMass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hMass"), sigma.photonMass()); + + histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dPhotonYSigma0Mass"), sigma.photonY(), sigma.pt(), sigma.sigma0Mass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dPhotonRadiusSigma0Mass"), sigma.photonRadius(), sigma.pt(), sigma.sigma0Mass()); + } + + if constexpr (requires { sigma.photonDefinition(); }) { // Processing EMCal photon + + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hpT"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hDefinition"), sigma.photonDefinition()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hNCells"), sigma.photonNCells()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hEnergy"), sigma.photonEnergy()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/h2dEtaVsPhi"), sigma.photonEMCEta(), sigma.photonEMCPhi()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hTime"), sigma.photonTime()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hExotic"), sigma.photonIsExotic()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hShape"), sigma.photonM02()); + } + + //_______________________________________ + // Lambdas + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hTrackCode"), LambdaTrkCode); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hRadius"), sigma.lambdaRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hDCADau"), sigma.lambdaDCADau()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hCosPA"), sigma.lambdaCosPA()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hY"), sigma.lambdaY()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosEta"), sigma.lambdaPosEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegEta"), sigma.lambdaNegEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosTPCCR"), sigma.lambdaPosTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegTPCCR"), sigma.lambdaNegTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosITSCls"), sigma.lambdaPosITSCls()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegITSCls"), sigma.lambdaNegITSCls()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosChi2PerNc"), sigma.lambdaPosChi2PerNcl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegChi2PerNc"), sigma.lambdaNegChi2PerNcl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLifeTime"), sigma.lambdaLifeTime()); + + histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); + } //_______________________________________ // Sigmas and Lambdas - histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - if (sigma.lambdaAlpha() > 0) { - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaDCANegToPV"), sigma.lambdaDCANegPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaDCAPosToPV"), sigma.lambdaDCAPosPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdapT"), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaMass"), sigma.lambdaMass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h3dLambdaMass"), centrality, sigma.lambdaPt(), sigma.lambdaMass()); + if (fillSelhistos) { + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaDCANegToPV"), sigma.lambdaDCANegPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaDCAPosToPV"), sigma.lambdaDCAPosPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdapT"), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLambdaMass"), sigma.lambdaMass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h3dLambdaMass"), centrality, sigma.lambdaPt(), sigma.lambdaMass()); + } histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hMass"), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hPt"), sigma.pt()); @@ -1031,13 +1200,15 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); } else { - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdaDCANegToPV"), sigma.lambdaDCANegPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdaDCAPosToPV"), sigma.lambdaDCAPosPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdapT"), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hAntiLambdaMass"), sigma.antilambdaMass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h3dAntiLambdaMass"), centrality, sigma.lambdaPt(), sigma.antilambdaMass()); + if (fillSelhistos) { + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_ALambdaPi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdaDCANegToPV"), sigma.lambdaDCANegPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdaDCAPosToPV"), sigma.lambdaDCAPosPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hALambdapT"), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hAntiLambdaMass"), sigma.antilambdaMass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h3dAntiLambdaMass"), centrality, sigma.lambdaPt(), sigma.antilambdaMass()); + } histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/hMass"), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/hPt"), sigma.pt()); @@ -1051,52 +1222,51 @@ struct sigmaanalysis { //_______________________________________ // MC specific - if (doprocessMonteCarlo) { + if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { if constexpr (requires { sigma.lambdaPDGCode(); sigma.photonPDGCode(); }) { - //_______________________________________ - // Gamma MC association - if (sigma.photonPDGCode() == 22) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hV0ToCollAssoc"), sigma.photonIsCorrectlyAssoc()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt"), sigma.photonPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hMCPt"), sigma.photonmcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); - - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); - - if (!sigma.photonIsCorrectlyAssoc()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), sigma.photonmcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + if (fillSelhistos) { + //_______________________________________ + // Gamma MC association + if (sigma.photonPDGCode() == 22) { + + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hV0ToCollAssoc"), sigma.photonIsCorrectlyAssoc()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hMCPt"), sigma.photonmcpt()); + + if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + + if (!sigma.photonIsCorrectlyAssoc()) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), sigma.photonmcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + } + } } - } - //_______________________________________ - // Lambda MC association - if (sigma.lambdaPDGCode() == 3122) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hV0ToCollAssoc"), sigma.lambdaIsCorrectlyAssoc()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hPt"), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hMCPt"), sigma.lambdamcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/h3dTPCvsTOFNSigma_Pr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/h3dTPCvsTOFNSigma_Pi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.lambdaPt()); - } + //_______________________________________ + // Lambda MC association + if (sigma.lambdaPDGCode() == 3122) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hV0ToCollAssoc"), sigma.lambdaIsCorrectlyAssoc()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hPt"), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/hMCPt"), sigma.lambdamcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/h3dTPCvsTOFNSigma_Pr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma(), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Lambda/h3dTPCvsTOFNSigma_Pi"), sigma.lambdaNegPiTPCNSigma(), sigma.lambdaPiTOFNSigma(), sigma.lambdaPt()); + } - //_______________________________________ - // AntiLambda MC association - if (sigma.lambdaPDGCode() == -3122) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hV0ToCollAssoc"), sigma.lambdaIsCorrectlyAssoc()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hPt"), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hMCPt"), sigma.lambdamcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/h3dTPCvsTOFNSigma_Pr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma(), sigma.lambdaPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/h3dTPCvsTOFNSigma_Pi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma(), sigma.lambdaPt()); + //_______________________________________ + // AntiLambda MC association + if (sigma.lambdaPDGCode() == -3122) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hV0ToCollAssoc"), sigma.lambdaIsCorrectlyAssoc()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hPt"), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/hMCPt"), sigma.lambdamcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/h3dTPCvsTOFNSigma_Pr"), sigma.lambdaNegPrTPCNSigma(), sigma.aLambdaPrTOFNSigma(), sigma.lambdaPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/ALambda/h3dTPCvsTOFNSigma_Pi"), sigma.lambdaPosPiTPCNSigma(), sigma.aLambdaPiTOFNSigma(), sigma.lambdaPt()); + } } - //_______________________________________ // Sigma0 MC association if (sigma.isSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMCPt"), sigma.mcpt()); @@ -1114,9 +1284,6 @@ struct sigmaanalysis { //_______________________________________ // AntiSigma0 MC association if (sigma.isAntiSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hMCPt"), sigma.mcpt()); @@ -1137,8 +1304,8 @@ struct sigmaanalysis { //_______________________________________ // pT resolution histos - if ((mode == 0) && fillResoQAhistos) - getResolution(sigma); + if (fillResoQAhistos) + getResolution(sigma); } } } @@ -1157,7 +1324,7 @@ struct sigmaanalysis { "TPCTOFPID", "DCADauToPV", "Mass"}; if (PDGRequired == 22) { - if constexpr (selection_index >= 0 && selection_index < (int)std::size(PhotonSelsLocal)) { + if constexpr (selection_index >= 0 && selection_index < static_cast(std::size(PhotonSelsLocal))) { histos.fill(HIST("Selection/Photon/hCandidateSel"), selection_index); histos.fill(HIST("Selection/Photon/h2d") + HIST(PhotonSelsLocal[selection_index]), sigma.photonPt(), sigma.photonMass()); histos.fill(HIST("Selection/Sigma0/h2dPhoton") + HIST(PhotonSelsLocal[selection_index]), sigma.pt(), sigma.sigma0Mass()); @@ -1165,7 +1332,7 @@ struct sigmaanalysis { } if (PDGRequired == 3122) { - if constexpr (selection_index >= 0 && selection_index < (int)std::size(LambdaSelsLocal)) { + if constexpr (selection_index >= 0 && selection_index < static_cast(std::size(LambdaSelsLocal))) { histos.fill(HIST("Selection/Lambda/hCandidateSel"), selection_index); histos.fill(HIST("Selection/Lambda/h2d") + HIST(LambdaSelsLocal[selection_index]), sigma.lambdaPt(), sigma.lambdaMass()); histos.fill(HIST("Selection/Sigma0/h2dLambda") + HIST(LambdaSelsLocal[selection_index]), sigma.pt(), sigma.sigma0Mass()); @@ -1173,6 +1340,40 @@ struct sigmaanalysis { } } + // Sigma0 QA analysis function + template + void doSigma0QA(TSigma0s const& fullSigma0s) + { + std::unordered_map sigma0Counts; + std::unordered_map sigma0Index; + + for (const auto& sigma0 : fullSigma0s) { + // Crosscheck reco rapidity and MC rapidity + histos.fill(HIST("Sigma0QA/h2dAllSigma0CandMCRapVsRecoRap"), sigma0.sigma0MCY(), sigma0.sigma0Y()); + + if (sigma0.isSigma0()) + histos.fill(HIST("Sigma0QA/h2dSigma0MCRapVsRecoRap"), sigma0.sigma0MCY(), sigma0.sigma0Y()); + if (sigma0.isAntiSigma0()) + histos.fill(HIST("Sigma0QA/h2dASigma0MCRapVsRecoRap"), sigma0.sigma0MCY(), sigma0.sigma0Y()); + + // grouping per mcparticle + if (sigma0.has_mcParticle()) { + sigma0Counts[sigma0.mcParticleId()] += 1; // duplicate count + sigma0Index[sigma0.mcParticleId()] = sigma0.globalIndex(); // saving index + } + } + for (const auto& [mcid, NDuplicates] : sigma0Counts) { + auto sigma0mc = fullSigma0s.rawIteratorAt(sigma0Index[mcid]); + histos.fill(HIST("Sigma0QA/hDuplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed + + if (sigma0mc.isSigma0()) + histos.fill(HIST("Sigma0QA/hSigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed + + if (sigma0mc.isAntiSigma0()) + histos.fill(HIST("Sigma0QA/hASigma0Duplicates"), NDuplicates); // how many times a mc sigma0 was reconstructed + } + } + // Apply specific selections for photons template bool selectPhoton(TV0Object const& cand) @@ -1205,7 +1406,11 @@ struct sigmaanalysis { return false; fillSelHistos<6>(cand, 22); - if ((TMath::Abs(cand.photonY()) > photonSelections.PhotonMaxRap) || (TMath::Abs(cand.photonPosEta()) > photonSelections.PhotonMaxDauEta) || (TMath::Abs(cand.photonNegEta()) > photonSelections.PhotonMaxDauEta)) + if ((cand.photonY() < photonSelections.PhotonMinRapidity) || (cand.photonY() > photonSelections.PhotonMaxRapidity)) + return false; + if ((cand.photonPosEta() < photonSelections.PhotonMinDauEta) || (cand.photonPosEta() > photonSelections.PhotonMaxDauEta)) + return false; + if ((cand.photonNegEta() < photonSelections.PhotonMinDauEta) || (cand.photonNegEta() > photonSelections.PhotonMaxDauEta)) return false; fillSelHistos<7>(cand, 22); @@ -1213,8 +1418,11 @@ struct sigmaanalysis { return false; fillSelHistos<8>(cand, 22); + if ((cand.photonZconv() < photonSelections.PhotonMinZ) || (cand.photonZconv() > photonSelections.PhotonMaxZ)) + return false; + float photonRZLineCut = TMath::Abs(cand.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; - if ((TMath::Abs(cand.photonRadius()) < photonRZLineCut) || (TMath::Abs(cand.photonZconv()) > photonSelections.PhotonMaxZ)) + if ((TMath::Abs(cand.photonRadius()) < photonRZLineCut)) return false; fillSelHistos<9>(cand, 22); @@ -1244,6 +1452,48 @@ struct sigmaanalysis { return true; } + // Apply specific selections for photons + template + bool selectEMCalPhoton(TClusterObject const& cand) + { + // Clusterizer + if (cand.photonDefinition() != EMCalPhotonSelections.definition && EMCalPhotonSelections.definition > -1) + return false; + + // Number of Cells + if (cand.photonNCells() < EMCalPhotonSelections.MinCells) + return false; + + // Energy + if (cand.photonEnergy() < EMCalPhotonSelections.MinEnergy || cand.photonEnergy() > EMCalPhotonSelections.MaxEnergy) + return false; + + // Eta + if (TMath::Abs(cand.photonEMCEta()) > EMCalPhotonSelections.MaxEta) + return false; + + // Timing + if (cand.photonTime() < EMCalPhotonSelections.MinTime || cand.photonTime() > EMCalPhotonSelections.MaxTime) + return false; + + // Exotic Clusters + if (cand.photonIsExotic() && EMCalPhotonSelections.RemoveExotic) { + return false; + } + + // Shower shape long axis + if (cand.photonNCells() > 1) { // Only if we have more than one + if (cand.photonM02() < EMCalPhotonSelections.MinM02 || cand.photonM02() > EMCalPhotonSelections.MaxM02) { + return false; + } + } + // Has matched track? + if (cand.photonHasAssocTrk() && EMCalPhotonSelections.RemoveMatchedTrack) + return false; + + return true; + } + // Apply specific selections for lambdas template bool selectLambda(TV0Object const& cand) @@ -1268,7 +1518,11 @@ struct sigmaanalysis { return false; fillSelHistos<4>(cand, 3122); - if ((TMath::Abs(cand.lambdaY()) > lambdaSelections.LambdaMaxRap) || (TMath::Abs(cand.lambdaPosEta()) > lambdaSelections.LambdaMaxDauEta) || (TMath::Abs(cand.lambdaNegEta()) > lambdaSelections.LambdaMaxDauEta)) + if ((cand.lambdaY() < lambdaSelections.LambdaMinRapidity) || (cand.lambdaY() > lambdaSelections.LambdaMaxRapidity)) + return false; + if ((cand.lambdaPosEta() < lambdaSelections.LambdaMinDauEta) || (cand.lambdaPosEta() > lambdaSelections.LambdaMaxDauEta)) + return false; + if ((cand.lambdaNegEta() < lambdaSelections.LambdaMinDauEta) || (cand.lambdaNegEta() > lambdaSelections.LambdaMaxDauEta)) return false; fillSelHistos<5>(cand, 3122); @@ -1350,23 +1604,30 @@ struct sigmaanalysis { bool processSigma0Candidate(TSigma0Object const& cand) { // Photon specific selections - if (!selectPhoton(cand)) - return false; + if constexpr (requires { cand.photonV0Type(); }) { // Processing PCM photon + if (!selectPhoton(cand)) + return false; + } + + if constexpr (requires { cand.photonDefinition(); }) { // Processing EMCal photon + if (!selectEMCalPhoton(cand)) + return false; + } // Lambda specific selections if (!selectLambda(cand)) return false; // Sigma0 specific selections - // Rapidity - if constexpr (requires { cand.sigma0MCY(); }) { // MC - if (TMath::Abs(cand.sigma0MCY()) > sigma0Selections.Sigma0MaxRap) - return false; - } else { // Real data - if (TMath::Abs(cand.sigma0Y()) > sigma0Selections.Sigma0MaxRap) - return false; + float rapidity = doLambdaStar ? cand.lambdaStarY() : cand.sigma0Y(); + if constexpr (requires { cand.sigma0MCY(); }) { // If MC + rapidity = cand.sigma0MCY(); } + // Rapidity + if ((rapidity < sigma0Selections.Sigma0MinRapidity) || (rapidity > sigma0Selections.Sigma0MaxRapidity)) + return false; + // V0Pair Radius if (cand.radius() > sigma0Selections.Sigma0MaxRadius) return false; @@ -1397,7 +1658,7 @@ struct sigmaanalysis { for (const auto& coll : collisions) { // Event selection - if (!IsEventAccepted(coll, true)) + if (!IsEventAccepted(coll, true)) // TODO: Should I Add event selection for events without EMCal? continue; // Sigma0s loop @@ -1424,6 +1685,9 @@ struct sigmaanalysis { fillHistos<1>(sigma0, coll); } } + + // Optionally run QA analysis for reco sigma0 + // if (fdoSigma0QA) doSigma0QA(fullSigma0s); // TODO: improve this to run sigma0 QA } // Apply selections in sigma0 candidates @@ -1466,10 +1730,26 @@ struct sigmaanalysis { (cand.photon2Pt() > photonSelections.PhotonMaxPt))) return false; - if ((TMath::Abs(cand.photon1Y()) > photonSelections.PhotonMaxRap) || (TMath::Abs(cand.photon1PosEta()) > photonSelections.PhotonMaxDauEta) || (TMath::Abs(cand.photon1NegEta()) > photonSelections.PhotonMaxDauEta)) + // Rapidity selection + if ((cand.photon1Y() < photonSelections.PhotonMinRapidity) || (cand.photon1Y() > photonSelections.PhotonMaxRapidity)) + return false; + if ((cand.photon1PosEta() < photonSelections.PhotonMinDauEta) || (cand.photon1PosEta() > photonSelections.PhotonMaxDauEta)) + return false; + if ((cand.photon1NegEta() < photonSelections.PhotonMinDauEta) || (cand.photon1NegEta() > photonSelections.PhotonMaxDauEta)) + return false; + + if ((cand.photon2Y() < photonSelections.PhotonMinRapidity) || (cand.photon2Y() > photonSelections.PhotonMaxRapidity)) + return false; + if ((cand.photon2PosEta() < photonSelections.PhotonMinDauEta) || (cand.photon2PosEta() > photonSelections.PhotonMaxDauEta)) + return false; + if ((cand.photon2NegEta() < photonSelections.PhotonMinDauEta) || (cand.photon2NegEta() > photonSelections.PhotonMaxDauEta)) return false; - if ((TMath::Abs(cand.photon2Y()) > photonSelections.PhotonMaxRap) || (TMath::Abs(cand.photon2PosEta()) > photonSelections.PhotonMaxDauEta) || (TMath::Abs(cand.photon2NegEta()) > photonSelections.PhotonMaxDauEta)) + // Z conversion + if ((cand.photon1Zconv() < photonSelections.PhotonMinZ) || (cand.photon1Zconv() > photonSelections.PhotonMaxZ)) + return false; + + if ((cand.photon2Zconv() < photonSelections.PhotonMinZ) || (cand.photon2Zconv() > photonSelections.PhotonMaxZ)) return false; if (((cand.photon1Radius() < photonSelections.PhotonMinRadius) || (cand.photon1Radius() > photonSelections.PhotonMaxRadius)) || @@ -1489,14 +1769,15 @@ struct sigmaanalysis { return false; // Pi0 specific selections - if constexpr (requires { cand.pi0MCY(); }) { // MC - if (TMath::Abs(cand.pi0MCY()) > pi0Selections.Pi0MaxRap) - return false; - } else { // DATA - if (TMath::Abs(cand.pi0Y()) > pi0Selections.Pi0MaxRap) - return false; + float pi0Y = cand.pi0Y(); + if constexpr (requires { cand.pi0MCY(); }) { // If MC + pi0Y = cand.pi0MCY(); } + // Rapidity + if ((pi0Y < pi0Selections.Pi0MinRapidity) || (pi0Y > pi0Selections.Pi0MaxRapidity)) + return false; + // V0Pair Radius if (cand.radius() > pi0Selections.Pi0MaxRadius) return false; @@ -1527,7 +1808,7 @@ struct sigmaanalysis { continue; // Pi0s loop - float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C(); + float centrality = getCentralityRun3(coll); for (size_t i = 0; i < pi0grouped[coll.globalIndex()].size(); i++) { auto pi0 = fullPi0s.rawIteratorAt(pi0grouped[coll.globalIndex()][i]); @@ -1559,11 +1840,21 @@ struct sigmaanalysis { analyzeRecoeSigma0s(collisions, fullSigma0s); } + void processRealDataWithEMCal(soa::Join const& collisions, Sigma0sWithEMCal const& fullSigma0s) + { + analyzeRecoeSigma0s(collisions, fullSigma0s); + } + void processMonteCarlo(soa::Join const& collisions, MCSigma0s const& fullSigma0s) { analyzeRecoeSigma0s(collisions, fullSigma0s); } + void processMonteCarloWithEMCal(soa::Join const& collisions, MCSigma0sWithEMCal const& fullSigma0s) + { + analyzeRecoeSigma0s(collisions, fullSigma0s); + } + // Simulated processing in Run 3 void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& Sigma0Gens) { @@ -1589,7 +1880,9 @@ struct sigmaanalysis { // _____________________________________________________ PROCESS_SWITCH(sigmaanalysis, processRealData, "Do real data analysis", true); + PROCESS_SWITCH(sigmaanalysis, processRealDataWithEMCal, "Do real data analysis with EMCal photons", false); PROCESS_SWITCH(sigmaanalysis, processMonteCarlo, "Do Monte-Carlo-based analysis", false); + PROCESS_SWITCH(sigmaanalysis, processMonteCarloWithEMCal, "Do Monte-Carlo-based analysis with EMCal photons", false); PROCESS_SWITCH(sigmaanalysis, processGeneratedRun3, "process MC generated Run 3", false); PROCESS_SWITCH(sigmaanalysis, processPi0RealData, "Do real data analysis for pi0 QA", false); PROCESS_SWITCH(sigmaanalysis, processPi0MonteCarlo, "Do Monte-Carlo-based analysis for pi0 QA", false); From 23efd26b1e78410960b88a271b0b1d35dfe8d682 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:16:42 +0200 Subject: [PATCH 09/22] Update strangenessderivedbinnedinfo --- .../strangenessderivedbinnedinfo.cxx | 49 +++++++++---------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx b/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx index e8b8ceeef2c..3dea781c798 100644 --- a/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx +++ b/PWGLF/Tasks/Strangeness/strangenessderivedbinnedinfo.cxx @@ -32,32 +32,30 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include -#include -#include -#include -#include -#include - -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include #include #include #include @@ -71,7 +69,6 @@ const float ctauOmegaPDG = 2.461; // Omega PDG lifetime using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; using namespace o2::aod::rctsel; @@ -334,7 +331,7 @@ struct strangenessderivedbinnedinfo { histos.print(); } - template // TCollision should be of the type: soa::Join::iterator or so + template // TCollision should be of the type: soa::Join::iterator or so void initCCDB(TCollision const& collision) { if (mRunNumber == collision.runNumber()) { From 8dd450898845cae4e7bb683bed1dec5adddfd40c Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:18:03 +0200 Subject: [PATCH 10/22] Update taskLambdaSpinCorr --- .../Tasks/Strangeness/taskLambdaSpinCorr.cxx | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx b/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx index f89b3b5e6d6..9fcac3ab845 100644 --- a/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx +++ b/PWGLF/Tasks/Strangeness/taskLambdaSpinCorr.cxx @@ -17,36 +17,36 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGMM/Mult/DataModel/Index.h" // for Particles2Tracks table #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector2D.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" - -#include - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include + +#include #include #include #include @@ -54,7 +54,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; using namespace o2::aod::rctsel; using dauTracks = soa::Join; From d15190a9b5b9d2f61d027dc76868f2733f0ab229 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:20:36 +0200 Subject: [PATCH 11/22] Update lambdapolsp --- PWGLF/Tasks/Strangeness/lambdapolsp.cxx | 668 +++++++++++++----------- 1 file changed, 363 insertions(+), 305 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 6414e063449..3a44c100cdf 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -18,61 +18,47 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "TF1.h" -#include "TRandom3.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include -#include #include -#include -#include +#include +#include -#include -#include +#include #include +#include #include -#include -#include -#include -#include // <<< CHANGED: for dedup sets #include -#include -#include // <<< CHANGED: for seenMap #include #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; using namespace o2::aod::rctsel; using dauTracks = soa::Join; @@ -90,6 +76,9 @@ struct lambdapolsp { Service pdg; o2::ccdb::CcdbApi ccdbApi; TH1D* hwgtAL; + TH1D* heffL; + TH1D* heffAL; + TH1D* hwgtRESO; // fill output struct : ConfigurableGroup { Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; @@ -101,6 +90,7 @@ struct lambdapolsp { } evselGrp; Configurable globalpt{"globalpt", true, "select tracks based on pt global vs tpc"}; Configurable cqvas{"cqvas", false, "change q vectors after shift correction"}; + Configurable normbymag{"normbymag", false, "normalize by magnitude of q vectors for SP"}; Configurable useprofile{"useprofile", 3, "flag to select profile vs Sparse"}; Configurable sys{"sys", 1, "flag to select systematic source"}; Configurable centestim{"centestim", 0, "flag to select centrality estimator"}; @@ -153,10 +143,16 @@ struct lambdapolsp { Configurable ConfDaughPIDCuts{"ConfDaughPIDCuts", 3, "PID selections for Lambda daughters"}; Configurable usesubdet{"usesubdet", false, "use subdet"}; Configurable useAccCorr{"useAccCorr", false, "use acceptance correction"}; + Configurable useResoRBR{"useResoRBR", false, "use resolution correction RBR"}; Configurable useyldwgt{"useyldwgt", false, "use yield weight"}; + Configurable useeffwgt{"useeffwgt", false, "use eff weight"}; + Configurable usepsisubbeforeshift{"usepsisubbeforeshift", false, "use psi for sub detectors before shift modification"}; Configurable ConfAccPathL{"ConfAccPathL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrL", "Path to acceptance correction for Lambda"}; Configurable ConfAccPathAL{"ConfAccPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrAL", "Path to acceptance correction for AntiLambda"}; Configurable ConfWgtPathAL{"ConfWgtPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to yield weight correction for AntiLambda"}; + Configurable ConfEffWgtPathL{"ConfEffWgtPathL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to eff weight correction for Lambda"}; + Configurable ConfEffWgtPathAL{"ConfEffWgtPathAL", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_10082025/yieldweight2050", "Path to eff weight correction for AntiLambda"}; + Configurable ConfResoPath{"ConfResoPath", "Users/p/prottay/My/Object/From379780/Fulldata/NewPbPbpass4_28032025/acccorrL", "Path to resolution correction run by run"}; struct : ConfigurableGroup { Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; @@ -186,6 +182,16 @@ struct lambdapolsp { ConfigurableAxis configbinAxis{"configbinAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "BA"}; */ // ConfigurableAxis configphiAxis{"configphiAxis", {VARIABLE_WIDTH, 0.0, 0.2, 0.4, 0.8, 1.0, 2.0, 2.5, 3.0, 4.0, 5.0, 5.5, 6.28}, "PhiAxis"}; + + struct : ConfigurableGroup { + Configurable isQA{"isQA", true, "Flag to fill QA"}; + ConfigurableAxis centfineAxis{"centfineAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "Cent V0M"}; + ConfigurableAxis vxfineAxis{"vxfineAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "vx fine axis"}; + ConfigurableAxis vyfineAxis{"vyfineAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "vy fine axis"}; + ConfigurableAxis vzfineAxis{"vzfineAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "vz fine axis"}; + ConfigurableAxis qxZDCAxis{"qxZDCAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "qx axis"}; + ConfigurableAxis psiAxis{"psiAxis", {VARIABLE_WIDTH, 0.0, 10.0, 40.0, 80.0}, "psi axis"}; + } QAgrp; struct : ConfigurableGroup { Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; @@ -199,12 +205,13 @@ struct lambdapolsp { ConfigurableAxis configthnAxisPol{"configthnAxisPol", {VARIABLE_WIDTH, -1.0, -0.6, -0.2, 0, 0.2, 0.4, 0.8}, "Pol"}; ConfigurableAxis configbinAxis{"configbinAxis", {VARIABLE_WIDTH, -0.8, -0.4, -0.2, 0, 0.2, 0.4, 0.8}, "BA"}; } axisGrp; + /* struct : ConfigurableGroup { ConfigurableAxis axisVertex{"axisVertex", {5, -10, 10}, "vertex axis for bin"}; ConfigurableAxis axisMultiplicityClass{"axisMultiplicityClass", {8, 0, 80}, "multiplicity percentile for bin"}; Configurable nMix{"nMix", 5, "number of event mixing"}; } meGrp; - + */ struct : ConfigurableGroup { ConfigurableAxis axisCosine{"axisCosine", {100, 0, 1}, "cosine axis"}; ConfigurableAxis axisRadius{"axisRadius", {200, 0, 100}, "radius axis"}; @@ -216,6 +223,8 @@ struct lambdapolsp { Configurable filldist{"filldist", true, "fill topo distr"}; Configurable lowmasscut{"lowmasscut", 1.11, "low mass cut"}; Configurable highmasscut{"highmasscut", 1.12, "high mass cut"}; + ConfigurableAxis axiscosphiminuspsi{"axiscosphiminuspsi", {200, -1, 1}, "cosphiminuspsi"}; + ConfigurableAxis axiseta{"axiseta", {16, -0.8, 0.8}, "eta axis"}; } distGrp; RCTFlagsChecker rctChecker; @@ -362,6 +371,12 @@ struct lambdapolsp { histos.add("hcentQyZDCA", "hcentQyZDCA", kTH2F, {axisGrp.configcentAxis, spAxis}); histos.add("hcentQxZDCC", "hcentQxZDCC", kTH2F, {axisGrp.configcentAxis, spAxis}); histos.add("hcentQyZDCC", "hcentQyZDCC", kTH2F, {axisGrp.configcentAxis, spAxis}); + + histos.add("hpQxtQxpvscent", "hpQxtQxpvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); + histos.add("hpQytQypvscent", "hpQytQypvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); + histos.add("hpQxytpvscent", "hpQxytpvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); + histos.add("hpQxtQypvscent", "hpQxtQypvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); + histos.add("hpQxpQytvscent", "hpQxpQytvscent", HistType::kTHnSparseF, {axisGrp.configcentAxis, spAxis}, true); } if (usesubdet) { histos.add("hSparseLambdaCosPsiA", "hSparseLambdaCosPsiA", HistType::kTHnSparseF, runaxes, true); @@ -416,7 +431,7 @@ struct lambdapolsp { } if (distGrp.filldist) { - histos.add("hcosinelambda", "hcosinelambda", HistType::kTH1D, {distGrp.axisCosine}, true); + /*histos.add("hcosinelambda", "hcosinelambda", HistType::kTH1D, {distGrp.axisCosine}, true); histos.add("hdcabwv0daughlambda", "hdcabwv0daughlambda", HistType::kTH1D, {distGrp.axisDca}, true); histos.add("hlifetimelambda", "hlifetimelambda", HistType::kTH1D, {distGrp.axisLT}, true); histos.add("hradiuslambda", "hradiuslambda", HistType::kTH1D, {distGrp.axisRadius}, true); @@ -439,6 +454,13 @@ struct lambdapolsp { histos.add("htpcnegantilambda", "htpcnegantilambda", HistType::kTH1D, {distGrp.axisnsig}, true); histos.add("hptposantilambda", "hptposantilambda", HistType::kTH1D, {distGrp.axispt}, true); histos.add("hptnegantilambda", "hptnegantilambda", HistType::kTH1D, {distGrp.axispt}, true); + */ + histos.add("hALcosphiminuspsiCvseta", "hALcosphiminuspsiCvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hALcosphiminuspsiAvseta", "hALcosphiminuspsiAvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hALcosphiminuspsivseta", "hALcosphiminuspsivseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hLcosphiminuspsiCvseta", "hLcosphiminuspsiCvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hLcosphiminuspsiAvseta", "hLcosphiminuspsiAvseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); + histos.add("hLcosphiminuspsivseta", "hLcosphiminuspsivseta", HistType::kTH2D, {{distGrp.axiscosphiminuspsi}, {distGrp.axiseta}}); } histos.add("hSparseGenLambda", "hSparseGenLambda", HistType::kTHnSparseF, runaxes2, true); @@ -446,6 +468,32 @@ struct lambdapolsp { histos.add("hSparseRecLambda", "hSparseRecLambda", HistType::kTHnSparseF, runaxes2, true); histos.add("hSparseRecAntiLambda", "hSparseRecAntiLambda", HistType::kTHnSparseF, runaxes2, true); + if (QAgrp.isQA) { + histos.add("hCentQxZDCA", "hCentQxZDCA", kTH2F, {{QAgrp.centfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hCentQyZDCA", "hCentQyZDCA", kTH2F, {{QAgrp.centfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hCentQxZDCC", "hCentQxZDCC", kTH2F, {{QAgrp.centfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hCentQyZDCC", "hCentQyZDCC", kTH2F, {{QAgrp.centfineAxis}, {QAgrp.qxZDCAxis}}); + + histos.add("hvxQxZDCA", "hvxQxZDCA", kTH2F, {{QAgrp.vxfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvxQyZDCA", "hvxQyZDCA", kTH2F, {{QAgrp.vxfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvxQxZDCC", "hvxQxZDCC", kTH2F, {{QAgrp.vxfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvxQyZDCC", "hvxQyZDCC", kTH2F, {{QAgrp.vxfineAxis}, {QAgrp.qxZDCAxis}}); + + histos.add("hvyQxZDCA", "hvyQxZDCA", kTH2F, {{QAgrp.vyfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvyQyZDCA", "hvyQyZDCA", kTH2F, {{QAgrp.vyfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvyQxZDCC", "hvyQxZDCC", kTH2F, {{QAgrp.vyfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvyQyZDCC", "hvyQyZDCC", kTH2F, {{QAgrp.vyfineAxis}, {QAgrp.qxZDCAxis}}); + + histos.add("hvzQxZDCA", "hvzQxZDCA", kTH2F, {{QAgrp.vzfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvzQyZDCA", "hvzQyZDCA", kTH2F, {{QAgrp.vzfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvzQxZDCC", "hvzQxZDCC", kTH2F, {{QAgrp.vzfineAxis}, {QAgrp.qxZDCAxis}}); + histos.add("hvzQyZDCC", "hvzQyZDCC", kTH2F, {{QAgrp.vzfineAxis}, {QAgrp.qxZDCAxis}}); + + histos.add("PsiZDCC", "PsiZDCC", kTH2F, {QAgrp.centfineAxis, QAgrp.psiAxis}); + histos.add("PsiZDCA", "PsiZDCA", kTH2F, {QAgrp.centfineAxis, QAgrp.psiAxis}); + histos.add("PsiZDC", "PsiZDC", kTH2F, {QAgrp.centfineAxis, QAgrp.psiAxis}); + } + ccdb->setURL(cfgCcdbParam.cfgURL); ccdbApi.init("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -453,6 +501,12 @@ struct lambdapolsp { ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); LOGF(info, "Getting alignment offsets from the CCDB..."); hwgtAL = ccdb->getForTimeStamp(ConfWgtPathAL.value, cfgCcdbParam.nolaterthan.value); + if (useeffwgt) { + heffL = ccdb->getForTimeStamp(ConfEffWgtPathL.value, cfgCcdbParam.nolaterthan.value); + heffAL = ccdb->getForTimeStamp(ConfEffWgtPathAL.value, cfgCcdbParam.nolaterthan.value); + } + if (useResoRBR) + hwgtRESO = ccdb->getForTimeStamp(ConfResoPath.value, cfgCcdbParam.nolaterthan.value); } template @@ -685,7 +739,7 @@ struct lambdapolsp { void fillHistograms(bool tag1, bool tag2, const ROOT::Math::PxPyPzMVector& particle, const ROOT::Math::PxPyPzMVector& daughter, double psiZDCC, double psiZDCA, double psiZDC, double centrality, - double candmass, double candpt, float desbinvalue, double acvalue, double wgtfactor) + double candmass, double candpt, float desbinvalue, double acvalue, double wgtfactor, double resowgt) { TRandom3 randPhi(0); @@ -707,14 +761,17 @@ struct lambdapolsp { auto PolC = TMath::Sin(phiminuspsiC); auto PolA = TMath::Sin(phiminuspsiA); auto Pol = TMath::Sin(phiminuspsi); - // auto PolSP = uy * TMath::Cos(psiZDC) - ux * TMath::Sin(psiZDC); - auto PolSP = uy * (modqxZDCC - modqxZDCA) - ux * (modqyZDCC - modqyZDCA); auto sinPhiStar = TMath::Sin(GetPhiInRange(phiangle)); auto cosPhiStar = TMath::Cos(GetPhiInRange(phiangle)); // auto sinThetaStarcosphiphiStar = sinThetaStar * TMath::Cos(2 * GetPhiInRange(particle.Phi() - phiangle)); // auto phiphiStar = GetPhiInRange(particle.Phi() - phiangle); acvalue = (4 / 3.14) * acvalue; + if (useResoRBR) { + Pol = Pol / resowgt; + PolA = PolA / resowgt; + PolC = PolC / resowgt; + } // PolC = PolC / acvalue; // PolA = PolA / acvalue; // Pol = Pol / acvalue; @@ -722,8 +779,26 @@ struct lambdapolsp { auto PolAwgt = PolA / acvalue; auto PolCwgt = PolC / acvalue; - if (randGrp.useSP) + // for SP calculation + const double qx = (modqxZDCC - modqxZDCA); + const double qy = (modqyZDCC - modqyZDCA); + const double qmag = std::sqrt(qx * qx + qy * qy); + auto PolSP = uy * (modqxZDCC - modqxZDCA) - ux * (modqyZDCC - modqyZDCA); + if (normbymag && qmag > 0.0) + PolSP = PolSP / qmag; + // SP numerators with A and C separately (use Q components) + auto PolSP_A = uy * modqxZDCA - ux * modqyZDCA; // u_y QxA - u_x QyA + auto PolSP_C = uy * modqxZDCC - ux * modqyZDCC; // u_y QxC - u_x QyC + + if (randGrp.useSP) { + Pol = PolSP; + PolA = PolSP_A; + PolC = PolSP_C; Polwgt = PolSP / acvalue; + PolAwgt = PolSP_A / acvalue; + PolCwgt = PolSP_C / acvalue; + } + ////////////////////////////// // Fill histograms using constructed names if (tag2) { @@ -775,6 +850,10 @@ struct lambdapolsp { // histos.fill(HIST("hSparseAntiLambda_corr1c"), candmass, candpt, phiphiStar, centrality, wgtfactor); histos.fill(HIST("hSparseAntiLambda_corr2a"), candmass, candpt, sinThetaStar, centrality, wgtfactor); // histos.fill(HIST("hSparseAntiLambda_corr2b"), candmass, candpt, sinThetaStarcosphiphiStar, centrality, wgtfactor); + if (randGrp.useSP) { + histos.fill(HIST("hSparseAntiLambda_avgux"), candmass, candpt, ux, centrality); + histos.fill(HIST("hSparseAntiLambda_avguy"), candmass, candpt, uy, centrality); + } } } if (tag1) { @@ -826,6 +905,10 @@ struct lambdapolsp { // histos.fill(HIST("hSparseLambda_corr1c"), candmass, candpt, phiphiStar, centrality, wgtfactor); histos.fill(HIST("hSparseLambda_corr2a"), candmass, candpt, sinThetaStar, centrality, wgtfactor); // histos.fill(HIST("hSparseLambda_corr2b"), candmass, candpt, sinThetaStarcosphiphiStar, centrality, wgtfactor); + if (randGrp.useSP) { + histos.fill(HIST("hSparseLambda_avgux"), candmass, candpt, ux, centrality); + histos.fill(HIST("hSparseLambda_avguy"), candmass, candpt, uy, centrality); + } } } } @@ -903,13 +986,20 @@ struct lambdapolsp { // currentRunNumber = collision.foundBC_as().runNumber(); auto bc = collision.foundBC_as(); + auto vz = collision.vz(); + auto vx = collision.vx(); + auto vy = collision.vy(); + auto qxZDCA = collision.qxZDCA(); auto qxZDCC = collision.qxZDCC(); auto qyZDCA = collision.qyZDCA(); auto qyZDCC = collision.qyZDCC(); auto psiZDCC = collision.psiZDCC(); auto psiZDCA = collision.psiZDCA(); - + if (usepsisubbeforeshift) { + psiZDCC = 1.0 * std::atan2(qyZDCC, qxZDCC); + psiZDCA = 1.0 * std::atan2(qyZDCA, qxZDCA); + } if (cqvas) { modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA); modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA); @@ -923,20 +1013,42 @@ struct lambdapolsp { } auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane*/ + /*if (useonlypsis) { psiZDC = psiZDCC - psiZDCA; }*/ + if (QAgrp.isQA) { + histos.fill(HIST("hCentQxZDCA"), centrality, modqxZDCA); + histos.fill(HIST("hCentQyZDCA"), centrality, modqyZDCA); + histos.fill(HIST("hCentQxZDCC"), centrality, modqxZDCC); + histos.fill(HIST("hCentQyZDCC"), centrality, modqyZDCC); + + histos.fill(HIST("hvxQxZDCA"), vx, modqxZDCA); + histos.fill(HIST("hvxQyZDCA"), vx, modqyZDCA); + histos.fill(HIST("hvxQxZDCC"), vx, modqxZDCC); + histos.fill(HIST("hvxQyZDCC"), vx, modqyZDCC); + + histos.fill(HIST("hvyQxZDCA"), vy, modqxZDCA); + histos.fill(HIST("hvyQyZDCA"), vy, modqyZDCA); + histos.fill(HIST("hvyQxZDCC"), vy, modqxZDCC); + histos.fill(HIST("hvyQyZDCC"), vy, modqyZDCC); + + histos.fill(HIST("hvzQxZDCA"), vz, modqxZDCA); + histos.fill(HIST("hvzQyZDCA"), vz, modqyZDCA); + histos.fill(HIST("hvzQxZDCC"), vz, modqxZDCC); + histos.fill(HIST("hvzQyZDCC"), vz, modqyZDCC); + + histos.fill(HIST("PsiZDCA"), centrality, psiZDCA); + histos.fill(HIST("PsiZDCC"), centrality, psiZDCC); + histos.fill(HIST("PsiZDC"), centrality, psiZDC); + } + histos.fill(HIST("hCentrality"), centrality); if (!checkwithpub) { // histos.fill(HIST("hVtxZ"), collision.posZ()); if (randGrp.useSP) { histos.fill(HIST("hpRes"), centrality, ((modqxZDCA * modqxZDCC) + (modqyZDCA * modqyZDCC))); - // histos.fill(HIST("hpResSin"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA - psiZDCC)))); - /*histos.fill(HIST("hpCosPsiA"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA)))); - histos.fill(HIST("hpCosPsiC"), centrality, (TMath::Cos(GetPhiInRange(psiZDCC)))); - histos.fill(HIST("hpSinPsiA"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA)))); - histos.fill(HIST("hpSinPsiC"), centrality, (TMath::Sin(GetPhiInRange(psiZDCC))));*/ histos.fill(HIST("hcentQxZDCA"), centrality, modqxZDCA); histos.fill(HIST("hcentQyZDCA"), centrality, modqyZDCA); histos.fill(HIST("hcentQxZDCC"), centrality, modqxZDCC); @@ -946,6 +1058,15 @@ struct lambdapolsp { } } + double resowgt = 1.0; + + if (useResoRBR) { + int binxreso = hwgtRESO->GetXaxis()->FindBin(centrality + 0.000001); + resowgt = hwgtRESO->GetBinContent(binxreso); + } else { + resowgt = 1.0; + } + ///////////checking v1//////////////////////////////// if (checkwithpub) { @@ -1140,7 +1261,6 @@ struct lambdapolsp { int taga = LambdaTag; int tagb = aLambdaTag; - // if (useAccCorr && (currentRunNumber != lastRunNumber)) { if (useAccCorr) { accprofileL = ccdb->getForTimeStamp(ConfAccPathL.value, bc.timestamp()); accprofileAL = ccdb->getForTimeStamp(ConfAccPathAL.value, bc.timestamp()); @@ -1155,142 +1275,74 @@ struct lambdapolsp { wgtvalue = 1.0; } - float desbinvalue = 0.0; - if (dosystematic) { - //////////////////////////////////////////////////// - float LTsys = TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda); - float CPAsys = v0.v0cosPA(); - float DCADaughsys = TMath::Abs(v0.dcaV0daughters()); - float DCApossys = TMath::Abs(v0.dcapostopv()); - float DCAnegsys = TMath::Abs(v0.dcanegtopv()); - float sysvar = -999.9; - double syst[10]; - if (sys == 1) { - double temp[10] = {26, 27, 28, 29, 30, 31, 32, 33, 34, 35}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = LTsys; - } - if (sys == 2) { - double temp[10] = {0.992, 0.993, 0.9935, 0.994, 0.9945, 0.995, 0.9955, 0.996, 0.9965, 0.997}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = CPAsys; - } - if (sys == 3) { - double temp[10] = {0.8, 0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = DCADaughsys; - } - if (sys == 4) { - double temp[10] = {0.05, 0.07, 0.1, 0.15, 0.18, 0.2, 0.22, 0.25, 0.28, 0.3}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = DCApossys; + if (LambdaTag) { + Lambda = Proton + AntiPion; + tagb = 0; + if (useAccCorr) { + int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; } - if (sys == 5) { - double temp[10] = {0.05, 0.07, 0.1, 0.15, 0.18, 0.2, 0.22, 0.25, 0.28, 0.3}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = DCAnegsys; + if (distGrp.filldist && aLambdaTag == 0 && Lambda.M() > distGrp.lowmasscut && Lambda.M() < distGrp.highmasscut) { + /*histos.fill(HIST("hcosinelambda"), v0.v0cosPA()); + histos.fill(HIST("hdcabwv0daughlambda"), v0.dcaV0daughters()); + histos.fill(HIST("hlifetimelambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); + histos.fill(HIST("hradiuslambda"), v0.v0radius()); + histos.fill(HIST("htpcCRlambda"), postrack.tpcNClsCrossedRows()); + histos.fill(HIST("hdcaposlambda"), v0.dcapostopv()); + histos.fill(HIST("hdcaneglambda"), v0.dcanegtopv()); + histos.fill(HIST("htpcposlambda"), postrack.tpcNSigmaPr()); + histos.fill(HIST("htpcneglambda"), negtrack.tpcNSigmaPi()); + histos.fill(HIST("hptposlambda"), Proton.Pt()); + histos.fill(HIST("hptneglambda"), AntiPion.Pt());*/ + auto phiL = TMath::ATan2(v0.py(), v0.px()); + auto LcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiL - psiZDCC)); + auto LcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiL - psiZDCA)); + auto Lcosphiminuspsi = TMath::Cos(GetPhiInRange(phiL - psiZDC)); + histos.fill(HIST("hLcosphiminuspsiCvseta"), LcosphiminuspsiC, v0.eta()); + histos.fill(HIST("hLcosphiminuspsiAvseta"), LcosphiminuspsiA, v0.eta()); + histos.fill(HIST("hLcosphiminuspsivseta"), Lcosphiminuspsi, v0.eta()); } + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); + } - for (int i = 0; i < 10; i++) { - if (sys == 1 || sys == 3) { - if (sysvar < syst[i]) - desbinvalue = i + 0.5; - else - continue; - } - if (sys == 2 || sys == 4 || sys == 5) { - if (sysvar > syst[i]) - desbinvalue = i + 0.5; - else - continue; - } - - /////////////////////////////////////////////////// - if (LambdaTag) { - Lambda = Proton + AntiPion; - tagb = 0; - if (useAccCorr) { - int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; - } - - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), desbinvalue, acvalue, 1.0); - } - - tagb = aLambdaTag; - if (aLambdaTag) { - AntiLambda = AntiProton + Pion; - taga = 0; - if (useAccCorr) { - int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileAL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; - } - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), desbinvalue, acvalue, 1.0); - } - } - } else { - if (LambdaTag) { - Lambda = Proton + AntiPion; - tagb = 0; - if (useAccCorr) { - int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; - } - if (distGrp.filldist && aLambdaTag == 0 && Lambda.M() > distGrp.lowmasscut && Lambda.M() < distGrp.highmasscut) { - histos.fill(HIST("hcosinelambda"), v0.v0cosPA()); - histos.fill(HIST("hdcabwv0daughlambda"), v0.dcaV0daughters()); - histos.fill(HIST("hlifetimelambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); - histos.fill(HIST("hradiuslambda"), v0.v0radius()); - histos.fill(HIST("htpcCRlambda"), postrack.tpcNClsCrossedRows()); - histos.fill(HIST("hdcaposlambda"), v0.dcapostopv()); - histos.fill(HIST("hdcaneglambda"), v0.dcanegtopv()); - histos.fill(HIST("htpcposlambda"), postrack.tpcNSigmaPr()); - histos.fill(HIST("htpcneglambda"), negtrack.tpcNSigmaPi()); - histos.fill(HIST("hptposlambda"), Proton.Pt()); - histos.fill(HIST("hptneglambda"), AntiPion.Pt()); - } - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0); + tagb = aLambdaTag; + if (aLambdaTag) { + AntiLambda = AntiProton + Pion; + taga = 0; + if (useAccCorr) { + int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileAL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; } - - tagb = aLambdaTag; - if (aLambdaTag) { - AntiLambda = AntiProton + Pion; - taga = 0; - if (useAccCorr) { - int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileAL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; - } - if (distGrp.filldist && LambdaTag == 0 && AntiLambda.M() > distGrp.lowmasscut && AntiLambda.M() < distGrp.highmasscut) { - histos.fill(HIST("hcosineantilambda"), v0.v0cosPA()); - histos.fill(HIST("hdcabwv0daughantilambda"), v0.dcaV0daughters()); - histos.fill(HIST("hlifetimeantilambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); - histos.fill(HIST("hradiusantilambda"), v0.v0radius()); - histos.fill(HIST("htpcCRantilambda"), postrack.tpcNClsCrossedRows()); - histos.fill(HIST("hdcaposantilambda"), v0.dcapostopv()); - histos.fill(HIST("hdcanegantilambda"), v0.dcanegtopv()); - histos.fill(HIST("htpcposantilambda"), postrack.tpcNSigmaPi()); - histos.fill(HIST("htpcnegantilambda"), negtrack.tpcNSigmaPr()); - histos.fill(HIST("hptposantilambda"), Pion.Pt()); - histos.fill(HIST("hptnegantilambda"), AntiProton.Pt()); - } - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue); + if (distGrp.filldist && LambdaTag == 0 && AntiLambda.M() > distGrp.lowmasscut && AntiLambda.M() < distGrp.highmasscut) { + /*histos.fill(HIST("hcosineantilambda"), v0.v0cosPA()); + histos.fill(HIST("hdcabwv0daughantilambda"), v0.dcaV0daughters()); + histos.fill(HIST("hlifetimeantilambda"), TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda)); + histos.fill(HIST("hradiusantilambda"), v0.v0radius()); + histos.fill(HIST("htpcCRantilambda"), postrack.tpcNClsCrossedRows()); + histos.fill(HIST("hdcaposantilambda"), v0.dcapostopv()); + histos.fill(HIST("hdcanegantilambda"), v0.dcanegtopv()); + histos.fill(HIST("htpcposantilambda"), postrack.tpcNSigmaPi()); + histos.fill(HIST("htpcnegantilambda"), negtrack.tpcNSigmaPr()); + histos.fill(HIST("hptposantilambda"), Pion.Pt()); + histos.fill(HIST("hptnegantilambda"), AntiProton.Pt());*/ + auto phiAL = TMath::ATan2(v0.py(), v0.px()); + auto ALcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiAL - psiZDCC)); + auto ALcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiAL - psiZDCA)); + auto ALcosphiminuspsi = TMath::Cos(GetPhiInRange(phiAL - psiZDC)); + histos.fill(HIST("hALcosphiminuspsiCvseta"), ALcosphiminuspsiC, v0.eta()); + histos.fill(HIST("hALcosphiminuspsiAvseta"), ALcosphiminuspsiA, v0.eta()); + histos.fill(HIST("hALcosphiminuspsivseta"), ALcosphiminuspsi, v0.eta()); } + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue, resowgt); } } } - // lastRunNumber = currentRunNumber; } PROCESS_SWITCH(lambdapolsp, processData, "Process data", true); @@ -1312,8 +1364,11 @@ struct lambdapolsp { else if (centestim == 3) centrality = collision.centFV0A(); + auto vz = collision.posZ(); + auto vx = collision.posX(); + auto vy = collision.posY(); + auto runnumber = collision.runNumber(); - // auto centrality = collision.centFT0C(); if (!collision.triggereventsp()) { // provided by StraZDCSP return; } @@ -1339,14 +1394,6 @@ struct lambdapolsp { return; } - /*currentRunNumber = collision.foundBC_as().runNumber(); - auto bc = collision.foundBC_as(); - - if (useAccCorr && (currentRunNumber != lastRunNumber)) { - accprofileL = ccdb->getForTimeStamp(ConfAccPathL.value, bc.timestamp()); - accprofileAL = ccdb->getForTimeStamp(ConfAccPathAL.value, bc.timestamp()); - } - */ auto timestamps = ccdb->getRunDuration(runnumber, true); /// fatalise if timestamps are not found int64_t sorTimestamp = timestamps.first; // timestamp of the SOR/SOX/STF in ms int64_t eorTimestamp = timestamps.second; // timestamp of the EOR/EOX/ETF in ms @@ -1365,11 +1412,10 @@ struct lambdapolsp { auto qyZDCC = collision.qyZDCC(); auto psiZDCC = collision.psiZDCC(); auto psiZDCA = collision.psiZDCA(); - /*double modqxZDCA; - double modqyZDCA; - double modqxZDCC; - double modqyZDCC;*/ - + if (usepsisubbeforeshift) { + psiZDCC = 1.0 * std::atan2(qyZDCC, qxZDCC); + psiZDCA = 1.0 * std::atan2(qyZDCA, qxZDCA); + } if (cqvas) { modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA); modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA); @@ -1384,26 +1430,76 @@ struct lambdapolsp { auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane + if (QAgrp.isQA) { + histos.fill(HIST("hCentQxZDCA"), centrality, modqxZDCA); + histos.fill(HIST("hCentQyZDCA"), centrality, modqyZDCA); + histos.fill(HIST("hCentQxZDCC"), centrality, modqxZDCC); + histos.fill(HIST("hCentQyZDCC"), centrality, modqyZDCC); + + histos.fill(HIST("hvxQxZDCA"), vx, modqxZDCA); + histos.fill(HIST("hvxQyZDCA"), vx, modqyZDCA); + histos.fill(HIST("hvxQxZDCC"), vx, modqxZDCC); + histos.fill(HIST("hvxQyZDCC"), vx, modqyZDCC); + + histos.fill(HIST("hvyQxZDCA"), vy, modqxZDCA); + histos.fill(HIST("hvyQyZDCA"), vy, modqyZDCA); + histos.fill(HIST("hvyQxZDCC"), vy, modqxZDCC); + histos.fill(HIST("hvyQyZDCC"), vy, modqyZDCC); + + histos.fill(HIST("hvzQxZDCA"), vz, modqxZDCA); + histos.fill(HIST("hvzQyZDCA"), vz, modqyZDCA); + histos.fill(HIST("hvzQxZDCC"), vz, modqxZDCC); + histos.fill(HIST("hvzQyZDCC"), vz, modqyZDCC); + + histos.fill(HIST("PsiZDCA"), centrality, psiZDCA); + histos.fill(HIST("PsiZDCC"), centrality, psiZDCC); + histos.fill(HIST("PsiZDC"), centrality, psiZDC); + } + // fill histograms histos.fill(HIST("hCentrality"), centrality); if (!checkwithpub) { // histos.fill(HIST("hVtxZ"), collision.posZ()); if (randGrp.useSP) { - histos.fill(HIST("hpRes"), centrality, ((modqxZDCA * modqxZDCC) + (modqyZDCA * modqyZDCC))); - // histos.fill(HIST("hpResSin"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA - psiZDCC)))); - /*histos.fill(HIST("hpCosPsiA"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA)))); - histos.fill(HIST("hpCosPsiC"), centrality, (TMath::Cos(GetPhiInRange(psiZDCC)))); - histos.fill(HIST("hpSinPsiA"), centrality, (TMath::Sin(GetPhiInRange(psiZDCA)))); - histos.fill(HIST("hpSinPsiC"), centrality, (TMath::Sin(GetPhiInRange(psiZDCC))));*/ + const double magA = std::sqrt(modqxZDCA * modqxZDCA + modqyZDCA * modqyZDCA); + const double magC = std::sqrt(modqxZDCC * modqxZDCC + modqyZDCC * modqyZDCC); + double cosPsiAminusC = 0.0; + if (normbymag && magA > 0. && magC > 0.) { + cosPsiAminusC = (modqxZDCA * modqxZDCC + modqyZDCA * modqyZDCC) / (magA * magC); + } else { + cosPsiAminusC = (modqxZDCA * modqxZDCC + modqyZDCA * modqyZDCC); + } + // histos.fill(HIST("hpRes"), centrality, ((modqxZDCA * modqxZDCC) + (modqyZDCA * modqyZDCC))); + histos.fill(HIST("hpRes"), centrality, cosPsiAminusC); histos.fill(HIST("hcentQxZDCA"), centrality, modqxZDCA); histos.fill(HIST("hcentQyZDCA"), centrality, modqyZDCA); histos.fill(HIST("hcentQxZDCC"), centrality, modqxZDCC); histos.fill(HIST("hcentQyZDCC"), centrality, modqyZDCC); + + auto QxtQxp = modqxZDCA * modqxZDCC; + auto QytQyp = modqyZDCA * modqyZDCC; + auto Qxytp = QxtQxp + QytQyp; + auto QxpQyt = modqxZDCA * modqyZDCC; + auto QxtQyp = modqxZDCC * modqyZDCA; + + histos.fill(HIST("hpQxtQxpvscent"), centrality, QxtQxp); + histos.fill(HIST("hpQytQypvscent"), centrality, QytQyp); + histos.fill(HIST("hpQxytpvscent"), centrality, Qxytp); + histos.fill(HIST("hpQxpQytvscent"), centrality, QxpQyt); + histos.fill(HIST("hpQxtQypvscent"), centrality, QxtQyp); } else { histos.fill(HIST("hpRes"), centrality, (TMath::Cos(GetPhiInRange(psiZDCA - psiZDCC)))); } } + double resowgt = 1.0; + if (useResoRBR) { + int binxreso = hwgtRESO->GetXaxis()->FindBin(centrality + 0.000001); + resowgt = hwgtRESO->GetBinContent(binxreso); + } else { + resowgt = 1.0; + } + //___________________________________________________________________________________________________ // loop over V0s as necessary for (const auto& v0 : V0s) { @@ -1432,13 +1528,11 @@ struct lambdapolsp { Proton = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPr); AntiPion = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPi); Lambdadummy = Proton + AntiPion; - // angleLambda = calculateAngleBetweenLorentzVectors(Proton, AntiPion); } if (aLambdaTag) { AntiProton = ROOT::Math::PxPyPzMVector(v0.pxneg(), v0.pyneg(), v0.pzneg(), massPr); Pion = ROOT::Math::PxPyPzMVector(v0.pxpos(), v0.pypos(), v0.pzpos(), massPi); AntiLambdadummy = AntiProton + Pion; - // angleAntiLambda = calculateAngleBetweenLorentzVectors(AntiProton, Pion); } if (shouldReject(LambdaTag, aLambdaTag, Lambdadummy, AntiLambdadummy)) { @@ -1461,129 +1555,93 @@ struct lambdapolsp { int tagb = aLambdaTag; int tagc = K0sTag; - float desbinvalue = 0.0; - if (analyzeK0s && K0sTag) { K0s = Pion + AntiPion; double acvalue = 1.0; - fillHistograms(tagc, 0, K0s, Pion, psiZDCC, psiZDCA, psiZDC, centrality, v0.mK0Short(), v0.pt(), v0.eta(), acvalue, 1.0); - } - - if (analyzeLambda && dosystematic) { - //////////////////////////////////////////////////// - float LTsys = TMath::Abs(v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda); - float CPAsys = v0.v0cosPA(); - float DCADaughsys = TMath::Abs(v0.dcaV0daughters()); - float DCApossys = TMath::Abs(v0.dcapostopv()); - float DCAnegsys = TMath::Abs(v0.dcanegtopv()); - float sysvar = -999.9; - double syst[10]; - if (sys == 1) { - double temp[10] = {26, 27, 28, 29, 30, 31, 32, 33, 34, 35}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = LTsys; - } - if (sys == 2) { - double temp[10] = {0.992, 0.993, 0.9935, 0.994, 0.9945, 0.995, 0.9955, 0.996, 0.9965, 0.997}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = CPAsys; - } - if (sys == 3) { - double temp[10] = {0.8, 0.85, 0.9, 0.95, 1.0, 1.05, 1.1, 1.15, 1.2, 1.25}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = DCADaughsys; - } - if (sys == 4) { - double temp[10] = {0.05, 0.07, 0.1, 0.15, 0.18, 0.2, 0.22, 0.25, 0.28, 0.3}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = DCApossys; - } - if (sys == 5) { - double temp[10] = {0.05, 0.07, 0.1, 0.15, 0.18, 0.2, 0.22, 0.25, 0.28, 0.3}; - std::copy(std::begin(temp), std::end(temp), std::begin(syst)); - sysvar = DCAnegsys; - } - - for (int i = 0; i < 10; i++) { - if (sys == 1 || sys == 3) { - if (sysvar < syst[i]) - desbinvalue = i + 0.5; - else - continue; - } - if (sys == 2 || sys == 4 || sys == 5) { - if (sysvar > syst[i]) - desbinvalue = i + 0.5; - else - continue; - } + fillHistograms(tagc, 0, K0s, Pion, psiZDCC, psiZDCA, psiZDC, centrality, v0.mK0Short(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); + } - /////////////////////////////////////////////////// - if (analyzeLambda && LambdaTag) { - Lambda = Proton + AntiPion; - tagb = 0; - double acvalue = 1.0; - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), desbinvalue, acvalue, 1.0); - } + int binxwgt; + double wgtvalue; + int binxwgtAL; + double effwgtvalueAL; + double effwgtvalueL; - tagb = aLambdaTag; - if (analyzeLambda && aLambdaTag) { - AntiLambda = AntiProton + Pion; - taga = 0; - double acvalue = 1.0; - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), desbinvalue, acvalue, 1.0); - } - } + if (useyldwgt) { + binxwgt = hwgtAL->GetXaxis()->FindBin(v0.pt()); + wgtvalue = hwgtAL->GetBinContent(binxwgt); } else { + wgtvalue = 1.0; + } + if (useeffwgt) { + binxwgtAL = heffAL->GetXaxis()->FindBin(v0.pt()); + effwgtvalueAL = heffAL->GetBinContent(binxwgtAL); + effwgtvalueL = heffL->GetBinContent(binxwgtAL); + } else { + effwgtvalueAL = 1.0; + effwgtvalueL = 1.0; + } - int binxwgt; - double wgtvalue; - if (useyldwgt) { - binxwgt = hwgtAL->GetXaxis()->FindBin(v0.pt()); - wgtvalue = hwgtAL->GetBinContent(binxwgt); + if (analyzeLambda && LambdaTag) { + Lambda = Proton + AntiPion; + tagb = 0; + double acvalue = 1.0; + if (useAccCorr) { + int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileL->GetBinContent(binx, biny); } else { - wgtvalue = 1.0; + acvalue = 1.0; } - if (analyzeLambda && LambdaTag) { - Lambda = Proton + AntiPion; - tagb = 0; - double acvalue = 1.0; - if (useAccCorr) { - int binx = accprofileL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; - } - // double acvalue = 1.0; - fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0); + + if (distGrp.filldist && aLambdaTag == 0 && Lambda.M() > distGrp.lowmasscut && Lambda.M() < distGrp.highmasscut) { + auto phiL = TMath::ATan2(v0.py(), v0.px()); + auto LcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiL - psiZDCC)); + auto LcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiL - psiZDCA)); + auto Lcosphiminuspsi = TMath::Cos(GetPhiInRange(phiL - psiZDC)); + histos.fill(HIST("hLcosphiminuspsiCvseta"), LcosphiminuspsiC, v0.eta()); + histos.fill(HIST("hLcosphiminuspsiAvseta"), LcosphiminuspsiA, v0.eta()); + histos.fill(HIST("hLcosphiminuspsivseta"), Lcosphiminuspsi, v0.eta()); } - tagb = aLambdaTag; - if (analyzeLambda && aLambdaTag) { - AntiLambda = AntiProton + Pion; - taga = 0; - double acvalue = 1.0; - if (useAccCorr) { - int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); - int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); - acvalue = accprofileAL->GetBinContent(binx, biny); - } else { - acvalue = 1.0; - } - // double acvalue = 1.0; - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue); + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, (1. / effwgtvalueL), resowgt); + } + + tagb = aLambdaTag; + if (analyzeLambda && aLambdaTag) { + AntiLambda = AntiProton + Pion; + taga = 0; + double acvalue = 1.0; + if (useAccCorr) { + int binx = accprofileAL->GetXaxis()->FindBin(v0.eta()); + int biny = accprofileAL->GetYaxis()->FindBin(v0.pt()); + acvalue = accprofileAL->GetBinContent(binx, biny); + } else { + acvalue = 1.0; } + + if (distGrp.filldist && LambdaTag == 0 && AntiLambda.M() > distGrp.lowmasscut && AntiLambda.M() < distGrp.highmasscut) { + auto phiAL = TMath::ATan2(v0.py(), v0.px()); + auto ALcosphiminuspsiC = TMath::Cos(GetPhiInRange(phiAL - psiZDCC)); + auto ALcosphiminuspsiA = TMath::Cos(GetPhiInRange(phiAL - psiZDCA)); + auto ALcosphiminuspsi = TMath::Cos(GetPhiInRange(phiAL - psiZDC)); + histos.fill(HIST("hALcosphiminuspsiCvseta"), ALcosphiminuspsiC, v0.eta()); + histos.fill(HIST("hALcosphiminuspsiAvseta"), ALcosphiminuspsiA, v0.eta()); + histos.fill(HIST("hALcosphiminuspsivseta"), ALcosphiminuspsi, v0.eta()); + } + + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue * (1. / effwgtvalueAL), resowgt); } } // lastRunNumber = currentRunNumber; } PROCESS_SWITCH(lambdapolsp, processDerivedData, "Process derived data", false); + /* using TrackMCTrueTable = aod::McParticles; ROOT::Math::PxPyPzMVector lambdadummymc, antiLambdadummymc, protonmc, pionmc, antiProtonmc, antiPionmc; - void processMC(EventCandidatesMC::iterator const& collision, AllTrackCandidates const& /*tracks*/, TrackMCTrueTable const& GenParticles, ResoV0s const& V0s) + void processMC(EventCandidatesMC::iterator const& collision, AllTrackCandidates const& tracks, TrackMCTrueTable const& GenParticles, ResoV0s const& V0s) { if (!collision.sel8()) { return; @@ -1713,14 +1771,14 @@ struct lambdapolsp { } } PROCESS_SWITCH(lambdapolsp, processMC, "Process MC", false); - +*/ // Processing Event Mixing /* using BinningType = ColumnBinningPolicy; BinningType colBinning{{meGrp.axisVertex, meGrp.axisMultiplicityClass}, true}; Preslice tracksPerCollisionV0Mixed = o2::aod::v0data::straCollisionId; // for derived data only - void processDerivedDataMixed(soa::Join const& collisions, v0Candidates const& V0s, dauTracks const&) + void processDerivedDataMixed(soa::Join const& collisions, v0Candidates const& V0s, dauTracks const&) { TRandom3 randGen(0); @@ -1855,7 +1913,7 @@ struct lambdapolsp { PROCESS_SWITCH(lambdapolsp, processDerivedDataMixed, "Process mixed event using derived data", false); - void processDerivedDataMixed2(soa::Join const& collisions, v0Candidates const& V0s, dauTracks const&) + void processDerivedDataMixed2(soa::Join const& collisions, v0Candidates const& V0s, dauTracks const&) { TRandom3 randGen(0); From 5deaeb79ccd7c7696ac11641ac1c671ffc7579a5 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:22:10 +0200 Subject: [PATCH 12/22] Update derivedupcanalysis.cxx --- .../Tasks/Strangeness/derivedupcanalysis.cxx | 600 ++++++++++++------ 1 file changed, 403 insertions(+), 197 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx index c20c6ddcead..766593fd89f 100644 --- a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx @@ -18,31 +18,39 @@ #include "PWGLF/Utils/strangenessMasks.h" #include "PWGUD/Core/SGSelector.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include -#include +#include + +#include #include +#include #include #include +#include +#include +#include #include #include +#include #include using namespace o2; @@ -76,7 +84,6 @@ using V0MCCoresFull = soa::Join; struct Derivedupcanalysis { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // master analysis switches Configurable analyseK0Short{"analyseK0Short", true, "process K0Short-like candidates"}; Configurable analyseLambda{"analyseLambda", true, "process Lambda-like candidates"}; @@ -159,6 +166,27 @@ struct Derivedupcanalysis { } casccuts; Configurable doBachelorBaryonCut{"doBachelorBaryonCut", false, "Enable Bachelor-Baryon cut "}; static constexpr float kNCtauCutsCasc[1][2] = {{6., 6.}}; + static constexpr int kDetectPropQABase = 1; + static constexpr int kDetectPropQAWithMass = 2; + static constexpr int kK0ShortPartID = 0; + static constexpr int kLambdaPartID = 1; + static constexpr int kAntiLambdaPartID = 2; + static constexpr int kFirstCascadePartID = 3; + static constexpr int kXiPartID = 3; + static constexpr int kAntiXiPartID = 4; + static constexpr int kOmegaPartID = 5; + static constexpr int kAntiOmegaPartID = 6; + static constexpr float kNoPidNsigmaCut = 1e5f; + static constexpr float kDefaultInvalidRapidity = 1e6f; + static constexpr float kDefaultInvalidCtau = 1e6f; + static constexpr float kDisabledArmenterosCut = 1e-4f; + static constexpr float kMotherRapidityMax = 0.5f; + static constexpr float kMissingSignal = -999.f; + static constexpr float kMissingSignalThreshold = 998.f; + static constexpr float kInvalidZdcTime = -12.f; + static constexpr float kMissingZdcTime = -11.f; + static constexpr float kInvalidFITTime = -42.f; + static constexpr float kMissingFITTime = -41.f; Configurable> nCtauCutCasc{"nCtauCutCasc", {kNCtauCutsCasc[0], 2, {"lifetimecutXi", "lifetimecutOmega"}}, "nCtauCutCasc"}; // UPC selections @@ -168,6 +196,18 @@ struct Derivedupcanalysis { Configurable ft0a{"ft0a", 100., "FT0A threshold"}; Configurable ft0c{"ft0c", 50., "FT0C threshold"}; Configurable zdc{"zdc", 1., "ZDC threshold"}; + Configurable fddaTimeCut{"fddaTimeCut", -1., "FDDA timing cut (ns); negative: no cut"}; + Configurable requireFDDATiming{"requireFDDATiming", true, "require valid FDDA timing for gap-side selection when fddaTimeCut is enabled"}; + Configurable fddcTimeCut{"fddcTimeCut", -1., "FDDC timing cut (ns); negative: no cut"}; + Configurable requireFDDCTiming{"requireFDDCTiming", true, "require valid FDDC timing for gap-side selection when fddcTimeCut is enabled"}; + Configurable fv0aTimeCut{"fv0aTimeCut", -1., "FV0A timing cut (ns); negative: no cut"}; + Configurable requireFV0ATiming{"requireFV0ATiming", true, "require valid FV0A timing for gap-side selection when fv0aTimeCut is enabled"}; + Configurable ft0aTimeCut{"ft0aTimeCut", -1., "FT0A timing cut (ns); negative: no cut"}; + Configurable requireFT0ATiming{"requireFT0ATiming", true, "require valid FT0A timing for gap-side selection when ft0aTimeCut is enabled"}; + Configurable ft0cTimeCut{"ft0cTimeCut", -1., "FT0C timing cut (ns); negative: no cut"}; + Configurable requireFT0CTiming{"requireFT0CTiming", true, "require valid FT0C timing for gap-side selection when ft0cTimeCut is enabled"}; + Configurable zdcTimeCut{"zdcTimeCut", 2., "ZDC timing cut (ns)"}; + Configurable requireZDCTiming{"requireZDCTiming", true, "require valid ZDC timing for gap-side selection"}; Configurable genGapSide{"genGapSide", 0, "0 -- A, 1 -- C, 2 -- double"}; } upcCuts; @@ -213,6 +253,8 @@ struct Derivedupcanalysis { ConfigurableAxis axisFDDCampl{"axisFDDCampl", {100, 0.0f, 2000.0f}, "FDDCamplitude"}; ConfigurableAxis axisZNAampl{"axisZNAampl", {100, 0.0f, 250.0f}, "ZNAamplitude"}; ConfigurableAxis axisZNCampl{"axisZNCampl", {100, 0.0f, 250.0f}, "ZNCamplitude"}; + ConfigurableAxis axisFitTime{"axisFitTime", {166, -42.5f, 40.5f}, "FIT time (ns)"}; + ConfigurableAxis axisZdcTime{"axisZdcTime", {110, -12.5f, 10.0f}, "ZDC time (ns)"}; } axisDetectors; // for MC @@ -221,6 +263,7 @@ struct Derivedupcanalysis { Configurable calculateFeeddownMatrix{"calculateFeeddownMatrix", true, "fill feeddown matrix if MC"}; ConfigurableAxis axisGeneratorIds{"axisGeneratorIds", {256, -0.5f, 255.5f}, "axis for generatorIds"}; Configurable checkNeutronsInMC{"checkNeutronsInMC", true, "require no neutrons for single-gap in MC"}; + Configurable requireGeneratedZDCNeutrons{"requireGeneratedZDCNeutrons", false, "require generated ZDC neutron topology in processGenerated"}; Configurable neutronEtaCut{"neutronEtaCut", 8.8, "ZN acceptance"}; // Occupancy cut @@ -268,7 +311,7 @@ struct Derivedupcanalysis { ConfigurableAxis axisOccupancy{"axisOccupancy", {VARIABLE_WIDTH, 0.0f, 250.0f, 500.0f, 750.0f, 1000.0f, 1500.0f, 2000.0f, 3000.0f, 4500.0f, 6000.0f, 8000.0f, 10000.0f, 50000.0f}, "Occupancy"}; // UPC axes - ConfigurableAxis axisSelGap{"axisSelGap", {4, -1.5, 2.5}, "Gap side"}; + ConfigurableAxis axisSelGap{"axisSelGap", {7, -1.5, 5.5}, "Gap side"}; // AP plot axes ConfigurableAxis axisAPAlpha{"axisAPAlpha", {220, -1.1f, 1.1f}, "V0 AP alpha"}; @@ -308,7 +351,7 @@ struct Derivedupcanalysis { template void addTopoHistograms(HistogramRegistry& histos) { - const bool isCascade = (partID > 2.5) ? true : false; + const bool isCascade = partID >= kFirstCascadePartID; if (isCascade) { histos.add(Form("%s/hCascCosPA", kParticlenames[partID].data()), "hCascCosPA", kTH2F, {axisPtCoarse, {100, 0.9f, 1.0f}}); histos.add(Form("%s/hDCACascDaughters", kParticlenames[partID].data()), "hDCACascDaughters", kTH2F, {axisPtCoarse, {44, 0.0f, 2.2f}}); @@ -342,7 +385,7 @@ struct Derivedupcanalysis { template void addTPCQAHistograms(HistogramRegistry& histos) { - const bool isCascade = (partID > 2.5) ? true : false; + const bool isCascade = partID >= kFirstCascadePartID; histos.add(Form("%s/h3dPosNsigmaTPC", kParticlenames[partID].data()), "h3dPosNsigmaTPC", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisNsigmaTPC}); histos.add(Form("%s/h3dNegNsigmaTPC", kParticlenames[partID].data()), "h3dNegNsigmaTPC", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisNsigmaTPC}); histos.add(Form("%s/h3dPosTPCsignal", kParticlenames[partID].data()), "h3dPosTPCsignal", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisTPCsignal}); @@ -373,7 +416,7 @@ struct Derivedupcanalysis { template void addTOFQAHistograms(HistogramRegistry& histos) { - const bool isCascade = (partID > 2.5) ? true : false; + const bool isCascade = partID >= kFirstCascadePartID; histos.add(Form("%s/h3dPosTOFdeltaT", kParticlenames[partID].data()), "h3dPosTOFdeltaT", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisTOFdeltaT}); histos.add(Form("%s/h3dNegTOFdeltaT", kParticlenames[partID].data()), "h3dNegTOFdeltaT", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisTOFdeltaT}); histos.add(Form("%s/h3dPosTOFdeltaTvsTrackPtot", kParticlenames[partID].data()), "h3dPosTOFdeltaTvsTrackPtot", kTH3F, {axisDetectors.axisFT0ampl, axisPtCoarse, axisTOFdeltaT}); @@ -390,7 +433,7 @@ struct Derivedupcanalysis { template void addKinematicQAHistograms(HistogramRegistry& histos) { - const bool isCascade = (partID > 2.5) ? true : false; + const bool isCascade = partID >= kFirstCascadePartID; histos.add(Form("%s/h3dPosEtaPt", kParticlenames[partID].data()), "h3dPosEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); histos.add(Form("%s/h3dNegEtaPt", kParticlenames[partID].data()), "h3dNegEtaPt", kTH3F, {axisPtCoarse, axisEta, axisSelGap}); histos.add(Form("%s/h3dRapPt", kParticlenames[partID].data()), "h3dRapPt", kTH3F, {axisPtCoarse, axisRap, axisSelGap}); @@ -402,8 +445,8 @@ struct Derivedupcanalysis { template void addDetectorPropHistograms(HistogramRegistry& histos) { - const bool isCascade = (partID > 2.5) ? true : false; - if (doDetectPropQA == 1) { + const bool isCascade = partID >= kFirstCascadePartID; + if (doDetectPropQA == kDetectPropQABase) { if (isCascade) { histos.add(Form("%s/h8dDetectPropVsCentrality", kParticlenames[partID].data()), "h8dDetectPropVsCentrality", kTHnSparseF, {axisDetectors.axisFT0ampl, axisDetMapCoarse, axisITScluMapCoarse, axisDetMapCoarse, axisITScluMapCoarse, axisDetMapCoarse, axisITScluMapCoarse, axisPtCoarse}); } else { @@ -413,7 +456,7 @@ struct Derivedupcanalysis { histos.add(Form("%s/h4dNegDetectPropVsCentrality", kParticlenames[partID].data()), "h4dNegDetectPropVsCentrality", kTHnSparseF, {axisDetectors.axisFT0ampl, axisDetMap, axisITScluMap, axisPtCoarse}); histos.add(Form("%s/h4dBachDetectPropVsCentrality", kParticlenames[partID].data()), "h4dBachDetectPropVsCentrality", kTHnSparseF, {axisDetectors.axisFT0ampl, axisDetMap, axisITScluMap, axisPtCoarse}); } - if (doDetectPropQA == 2) { + if (doDetectPropQA == kDetectPropQAWithMass) { if (isCascade) { histos.add(Form("%s/h9dDetectPropVsCentrality", kParticlenames[partID].data()), "h9dDetectPropVsCentrality", kTHnSparseF, {axisDetectors.axisFT0ampl, axisDetMapCoarse, axisITScluMapCoarse, axisDetMapCoarse, axisITScluMapCoarse, axisDetMapCoarse, axisITScluMapCoarse, axisPtCoarse, axisInvMass.at(partID)}); } else { @@ -456,7 +499,7 @@ struct Derivedupcanalysis { ft0ampl = coll.totalFT0AmplitudeA(); } float pT = cand.pt(); - float rapidity = 1e6; + float rapidity = kDefaultInvalidRapidity; // c x tau float ctau = 0; @@ -477,7 +520,7 @@ struct Derivedupcanalysis { uint negDetMap = computeDetBitmap(negTrackExtra.detectorMap()); int negITSclusMap = computeITSclusBitmap(negTrackExtra.itsClusterMap(), negIsFromAfterburner); - if (partID == 0) { + if (partID == kK0ShortPartID) { histos.fill(HIST("generalQA/h2dArmenterosSelected"), cand.alpha(), cand.qtarm()); invMass = cand.mK0Short(); rapidity = cand.yK0Short(); @@ -490,7 +533,7 @@ struct Derivedupcanalysis { tpcNsigmaPos = posTrackExtra.tpcNSigmaPi(); tpcNsigmaNeg = negTrackExtra.tpcNSigmaPi(); } - } else if (partID == 1) { + } else if (partID == kLambdaPartID) { invMass = cand.mLambda(); rapidity = cand.yLambda(); ctau = cand.distovertotmom(coll.posX(), coll.posY(), coll.posZ()) * o2::constants::physics::MassLambda0; @@ -502,7 +545,7 @@ struct Derivedupcanalysis { tpcNsigmaPos = posTrackExtra.tpcNSigmaPr(); tpcNsigmaNeg = negTrackExtra.tpcNSigmaPi(); } - } else if (partID == 2) { + } else if (partID == kAntiLambdaPartID) { invMass = cand.mAntiLambda(); rapidity = cand.yLambda(); ctau = cand.distovertotmom(coll.posX(), coll.posY(), coll.posZ()) * o2::constants::physics::MassLambda0Bar; @@ -536,13 +579,13 @@ struct Derivedupcanalysis { histos.fill(HIST(kParticlenames[partID]) + HIST("/h2dNegativeITSvsTPCpts"), negTrackExtra.tpcCrossedRows(), negTrackExtra.itsNCls()); histos.fill(HIST(kParticlenames[partID]) + HIST("/hCtau"), pT, ctau); } - if (doDetectPropQA == 1) { + if (doDetectPropQA == kDetectPropQABase) { histos.fill(HIST(kParticlenames[partID]) + HIST("/h6dDetectPropVsCentrality"), ft0ampl, posDetMap, posITSclusMap, negDetMap, negITSclusMap, pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dPosDetectPropVsCentrality"), ft0ampl, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dNegDetectPropVsCentrality"), ft0ampl, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pT); } - if (doDetectPropQA == 2) { - histos.fill(HIST(kParticlenames[partID]) + HIST("/h7dPosDetectPropVsCentrality"), ft0ampl, posDetMap, posITSclusMap, negDetMap, negITSclusMap, pT, invMass); + if (doDetectPropQA == kDetectPropQAWithMass) { + histos.fill(HIST(kParticlenames[partID]) + HIST("/h7dDetectPropVsCentrality"), ft0ampl, posDetMap, posITSclusMap, negDetMap, negITSclusMap, pT, invMass); histos.fill(HIST(kParticlenames[partID]) + HIST("/h5dPosDetectPropVsCentrality"), ft0ampl, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pT, invMass); histos.fill(HIST(kParticlenames[partID]) + HIST("/h5dNegDetectPropVsCentrality"), ft0ampl, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pT, invMass); } @@ -581,7 +624,7 @@ struct Derivedupcanalysis { centrality = coll.totalFT0AmplitudeA(); } float pT = cand.pt(); - float rapidity = 1e6; + float rapidity = kDefaultInvalidRapidity; // Access daughter tracks auto posTrackExtra = cand.template posTrackExtra_as(); @@ -612,9 +655,9 @@ struct Derivedupcanalysis { float tofDeltaTNeg = 0; float tofDeltaTBach = 0; - if (partID == 3) { + if (partID == kXiPartID) { invMass = cand.mXi(); - ctau = totalMom != 0 ? o2::constants::physics::MassXiMinus * decayPos / (totalMom * ctauxiPDG) : 1e6; + ctau = totalMom != 0 ? o2::constants::physics::MassXiMinus * decayPos / (totalMom * ctauxiPDG) : kDefaultInvalidCtau; rapidity = cand.yXi(); if (PIDConfigurations.doTPCQA) { @@ -627,9 +670,9 @@ struct Derivedupcanalysis { tofDeltaTNeg = cand.negTOFDeltaTXiPi(); tofDeltaTBach = cand.bachTOFDeltaTXiPi(); } - } else if (partID == 4) { + } else if (partID == kAntiXiPartID) { invMass = cand.mXi(); - ctau = totalMom != 0 ? o2::constants::physics::MassXiPlusBar * decayPos / (totalMom * ctauxiPDG) : 1e6; + ctau = totalMom != 0 ? o2::constants::physics::MassXiPlusBar * decayPos / (totalMom * ctauxiPDG) : kDefaultInvalidCtau; rapidity = cand.yXi(); if (PIDConfigurations.doTPCQA) { @@ -643,9 +686,9 @@ struct Derivedupcanalysis { tofDeltaTBach = cand.bachTOFDeltaTXiPi(); } - } else if (partID == 5) { + } else if (partID == kOmegaPartID) { invMass = cand.mOmega(); - ctau = totalMom != 0 ? o2::constants::physics::MassOmegaMinus * decayPos / (totalMom * ctauomegaPDG) : 1e6; + ctau = totalMom != 0 ? o2::constants::physics::MassOmegaMinus * decayPos / (totalMom * ctauomegaPDG) : kDefaultInvalidCtau; rapidity = cand.yOmega(); if (PIDConfigurations.doTPCQA) { @@ -659,9 +702,9 @@ struct Derivedupcanalysis { tofDeltaTBach = cand.bachTOFDeltaTOmKa(); } - } else if (partID == 6) { + } else if (partID == kAntiOmegaPartID) { invMass = cand.mOmega(); - ctau = totalMom != 0 ? o2::constants::physics::MassOmegaPlusBar * decayPos / (totalMom * ctauomegaPDG) : 1e6; + ctau = totalMom != 0 ? o2::constants::physics::MassOmegaPlusBar * decayPos / (totalMom * ctauomegaPDG) : kDefaultInvalidCtau; rapidity = cand.yOmega(); if (PIDConfigurations.doTPCQA) { @@ -728,13 +771,13 @@ struct Derivedupcanalysis { histos.fill(HIST(kParticlenames[partID]) + HIST("/h3dNegTOFdeltaTvsTrackPt"), centrality, cand.negativept(), tofDeltaTNeg); histos.fill(HIST(kParticlenames[partID]) + HIST("/h3dBachTOFdeltaTvsTrackPt"), centrality, cand.bachelorpt(), tofDeltaTBach); } - if (doDetectPropQA == 1) { + if (doDetectPropQA == kDetectPropQABase) { histos.fill(HIST(kParticlenames[partID]) + HIST("/h8dDetectPropVsCentrality"), centrality, posDetMap, posITSclusMap, negDetMap, negITSclusMap, bachDetMap, bachITSclusMap, pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dPosDetectPropVsCentrality"), centrality, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dNegDetectPropVsCentrality"), centrality, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pT); histos.fill(HIST(kParticlenames[partID]) + HIST("/h4dBachDetectPropVsCentrality"), centrality, bachTrackExtra.detectorMap(), bachTrackExtra.itsClusterMap(), pT); } - if (doDetectPropQA == 2) { + if (doDetectPropQA == kDetectPropQAWithMass) { histos.fill(HIST(kParticlenames[partID]) + HIST("/h9dDetectPropVsCentrality"), centrality, posDetMap, posITSclusMap, negDetMap, negITSclusMap, bachDetMap, bachITSclusMap, pT, invMass); histos.fill(HIST(kParticlenames[partID]) + HIST("/h5dPosDetectPropVsCentrality"), centrality, posTrackExtra.detectorMap(), posTrackExtra.itsClusterMap(), pT, invMass); histos.fill(HIST(kParticlenames[partID]) + HIST("/h5dNegDetectPropVsCentrality"), centrality, negTrackExtra.detectorMap(), negTrackExtra.itsClusterMap(), pT, invMass); @@ -789,7 +832,7 @@ struct Derivedupcanalysis { } else { setBits(maskTrackPropertiesV0, {selPosGoodTPCTrack, selPosGoodITSTrack}); // TPC signal is available: ask for positive track PID - if (PIDConfigurations.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tpcPidNsigmaCut < kNoPidNsigmaCut) { // safeguard for no cut maskK0ShortSpecific.set(selTPCPIDPositivePion); maskLambdaSpecific.set(selTPCPIDPositiveProton); maskAntiLambdaSpecific.set(selTPCPIDPositivePion); @@ -800,15 +843,15 @@ struct Derivedupcanalysis { maskAntiOmegaSpecific.set(selTPCPIDPositivePion); } // TOF PID - if (PIDConfigurations.tofPidNsigmaCutK0Pi < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutK0Pi < kNoPidNsigmaCut) { // safeguard for no cut setBits(maskK0ShortSpecific, {selTOFNSigmaPositivePionK0Short, selTOFDeltaTPositivePionK0Short}); } - if (PIDConfigurations.tofPidNsigmaCutLaPr < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutLaPr < kNoPidNsigmaCut) { // safeguard for no cut setBits(maskLambdaSpecific, {selTOFNSigmaPositiveProtonLambda, selTOFDeltaTPositiveProtonLambda}); setBits(maskXiSpecific, {selTOFNSigmaPositiveProtonLambdaXi, selTOFDeltaTPositiveProtonLambdaXi}); setBits(maskOmegaSpecific, {selTOFNSigmaPositiveProtonLambdaOmega, selTOFDeltaTPositiveProtonLambdaOmega}); } - if (PIDConfigurations.tofPidNsigmaCutLaPi < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutLaPi < kNoPidNsigmaCut) { // safeguard for no cut setBits(maskAntiLambdaSpecific, {selTOFNSigmaPositivePionLambda, selTOFDeltaTPositivePionLambda}); setBits(maskAntiXiSpecific, {selTOFNSigmaPositivePionLambdaXi, selTOFDeltaTPositivePionLambdaXi}); setBits(maskAntiOmegaSpecific, {selTOFNSigmaPositivePionLambdaOmega, selTOFDeltaTPositivePionLambdaOmega}); @@ -820,26 +863,26 @@ struct Derivedupcanalysis { } else { setBits(maskTrackPropertiesV0, {selNegGoodTPCTrack, selNegGoodITSTrack}); // TPC signal is available: ask for negative track PID - if (PIDConfigurations.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tpcPidNsigmaCut < kNoPidNsigmaCut) { // safeguard for no cut maskK0ShortSpecific.set(selTPCPIDNegativePion); maskLambdaSpecific.set(selTPCPIDNegativePion); maskAntiLambdaSpecific.set(selTPCPIDNegativeProton); maskXiSpecific.set(selTPCPIDNegativePion); - maskAntiXiSpecific.set(selTPCPIDPositiveProton); + maskAntiXiSpecific.set(selTPCPIDNegativeProton); maskOmegaSpecific.set(selTPCPIDNegativePion); - maskAntiOmegaSpecific.set(selTPCPIDPositiveProton); + maskAntiOmegaSpecific.set(selTPCPIDNegativeProton); } // TOF PID - if (PIDConfigurations.tofPidNsigmaCutK0Pi < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutK0Pi < kNoPidNsigmaCut) { // safeguard for no cut setBits(maskK0ShortSpecific, {selTOFNSigmaNegativePionK0Short, selTOFDeltaTNegativePionK0Short}); } - if (PIDConfigurations.tofPidNsigmaCutLaPr < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutLaPr < kNoPidNsigmaCut) { // safeguard for no cut setBits(maskAntiLambdaSpecific, {selTOFNSigmaNegativeProtonLambda, selTOFDeltaTNegativeProtonLambda}); setBits(maskAntiXiSpecific, {selTOFNSigmaNegativeProtonLambdaXi, selTOFDeltaTNegativeProtonLambdaXi}); setBits(maskAntiOmegaSpecific, {selTOFNSigmaNegativeProtonLambdaOmega, selTOFDeltaTNegativeProtonLambdaOmega}); } - if (PIDConfigurations.tofPidNsigmaCutLaPi < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutLaPi < kNoPidNsigmaCut) { // safeguard for no cut setBits(maskLambdaSpecific, {selTOFNSigmaNegativePionLambda, selTOFDeltaTNegativePionLambda}); setBits(maskXiSpecific, {selTOFNSigmaNegativePionLambdaXi, selTOFDeltaTNegativePionLambdaXi}); setBits(maskOmegaSpecific, {selTOFNSigmaNegativePionLambdaOmega, selTOFDeltaTNegativePionLambdaOmega}); @@ -852,18 +895,18 @@ struct Derivedupcanalysis { } else { setBits(maskTrackPropertiesCasc, {selBachGoodTPCTrack, selBachGoodITSTrack}); // TPC signal is available: ask for positive track PID - if (PIDConfigurations.tpcPidNsigmaCut < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tpcPidNsigmaCut < kNoPidNsigmaCut) { // safeguard for no cut maskXiSpecific.set(selTPCPIDBachPion); maskAntiXiSpecific.set(selTPCPIDBachPion); maskOmegaSpecific.set(selTPCPIDBachKaon); maskAntiOmegaSpecific.set(selTPCPIDBachKaon); } // TOF PID - if (PIDConfigurations.tofPidNsigmaCutXiPi < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutXiPi < kNoPidNsigmaCut) { // safeguard for no cut setBits(maskXiSpecific, {selTOFNSigmaBachPionXi, selTOFDeltaTBachPionXi}); setBits(maskAntiXiSpecific, {selTOFNSigmaBachPionXi, selTOFDeltaTBachPionXi}); } - if (PIDConfigurations.tofPidNsigmaCutOmegaKaon < 1e+5) { // safeguard for no cut + if (PIDConfigurations.tofPidNsigmaCutOmegaKaon < kNoPidNsigmaCut) { // safeguard for no cut setBits(maskOmegaSpecific, {selTOFNSigmaBachKaonOmega, selTOFDeltaTBachKaonOmega}); setBits(maskAntiOmegaSpecific, {selTOFNSigmaBachKaonOmega, selTOFDeltaTBachKaonOmega}); } @@ -906,8 +949,8 @@ struct Derivedupcanalysis { histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(10, "kNoSameBunchPileup"); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoCollInTimeRangeStd"); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeNarrow"); - histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(13, "Below min occup."); - histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(14, "Above max occup."); + histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(13, "Above min occup."); + histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(14, "Below max occup."); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(15, "RCTFlagsChecker"); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(16, "isUPC"); histos.get(HIST("eventQA/hEventSelection"))->GetXaxis()->SetBinLabel(17, "has UPC flag"); @@ -931,6 +974,22 @@ struct Derivedupcanalysis { histos.add("eventQA/hFT0", "hFT0", kTH3D, {axisDetectors.axisFT0Aampl, axisDetectors.axisFT0Campl, axisSelGap}); histos.add("eventQA/hFDD", "hFDD", kTH3D, {axisDetectors.axisFDDAampl, axisDetectors.axisFDDCampl, axisSelGap}); histos.add("eventQA/hZN", "hZN", kTH3D, {axisDetectors.axisZNAampl, axisDetectors.axisZNCampl, axisSelGap}); + histos.add("eventQA/hTimeFT0A", "hTimeFT0A", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFT0C", "hTimeFT0C", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFV0A", "hTimeFV0A", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFDDA", "hTimeFDDA", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFDDC", "hTimeFDDC", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFT0APreSel", "hTimeFT0APreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFT0CPreSel", "hTimeFT0CPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFV0APreSel", "hTimeFV0APreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFDDAPreSel", "hTimeFDDAPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFDDCPreSel", "hTimeFDDCPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hFT0Time", "hFT0Time", kTH3D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hFDDTime", "hFDDTime", kTH3D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hZNTime", "hZNTime", kTH3D, {axisDetectors.axisZdcTime, axisDetectors.axisZdcTime, axisSelGap}); + histos.add("eventQA/hFT0TimePreSel", "hFT0TimePreSel", kTH2D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime}); + histos.add("eventQA/hFDDTimePreSel", "hFDDTimePreSel", kTH2D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime}); + histos.add("eventQA/hZNTimePreSel", "hZNTimePreSel", kTH2D, {axisDetectors.axisZdcTime, axisDetectors.axisZdcTime}); if (doprocessGenerated) { histos.add("eventQA/mc/hEventSelectionMC", "hEventSelectionMC", kTH3D, {{3, -0.5, 2.5}, axisNTracksPVeta1, axisGeneratorIds}); @@ -955,18 +1014,18 @@ struct Derivedupcanalysis { histos.add("eventQA/mc/hNTracksPVeta1vsMCNParticlesEta10rec", "hNTracksPVeta1vsMCNParticlesEta10rec", kTH2D, {axisNTracksPVeta1, axisNTracksPVeta1}); histos.add("eventQA/mc/hNTracksGlobalvstotalMultMCParticles", "hNTracksGlobalvstotalMultMCParticles", kTH2D, {axisNTracksGlobal, axisNchInvMass}); histos.add("eventQA/mc/hNTracksPVeta1vstotalMultMCParticles", "hNTracksPVeta1vstotalMultMCParticles", kTH2D, {axisNTracksPVeta1, axisNchInvMass}); - histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {{5, -0.5, 4.5}}); + histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {axisSelGap}); } if (doprocessV0sMC) { if (analyseLambda && calculateFeeddownMatrix) - histos.add(Form("%s/h3dLambdaFeeddown", kParticlenames[1].data()), "h3dLambdaFeeddown", kTH3F, {axisNTracksGlobal, axisPt, axisPt}); + histos.add(Form("%s/h3dLambdaFeeddown", kParticlenames[kLambdaPartID].data()), "h3dLambdaFeeddown", kTH3F, {axisNTracksGlobal, axisPt, axisPt}); if (analyseAntiLambda && calculateFeeddownMatrix) - histos.add(Form("%s/h3dAntiLambdaFeeddown", kParticlenames[2].data()), "h3dAntiLambdaFeeddown", kTH3F, {axisNTracksGlobal, axisPt, axisPt}); + histos.add(Form("%s/h3dAntiLambdaFeeddown", kParticlenames[kAntiLambdaPartID].data()), "h3dAntiLambdaFeeddown", kTH3F, {axisNTracksGlobal, axisPt, axisPt}); } if (doprocessGenerated) { - for (int partID = 0; partID <= 6; partID++) { + for (int partID = kK0ShortPartID; partID <= kAntiOmegaPartID; partID++) { histos.add(Form("%s/mc/h7dGen", kParticlenames[partID].data()), "h7dGen", kTHnSparseF, {axisDetectors.axisFT0ampl, axisNchInvMass, axisNchInvMass, axisPt, axisSelGap, axisRap, axisGeneratorIds}); } } @@ -989,17 +1048,17 @@ struct Derivedupcanalysis { // K0s if (analyseK0Short) { - addHistograms<0>(histos); + addHistograms(histos); } // Lambda if (analyseLambda) { - addHistograms<1>(histos); + addHistograms(histos); } // Anti-Lambda if (analyseAntiLambda) { - addHistograms<2>(histos); + addHistograms(histos); } } @@ -1025,22 +1084,22 @@ struct Derivedupcanalysis { // Xi if (analyseXi) { - addHistograms<3>(histos); + addHistograms(histos); } // Anti-Xi if (analyseAntiXi) { - addHistograms<4>(histos); + addHistograms(histos); } // Omega if (analyseOmega) { - addHistograms<5>(histos); + addHistograms(histos); } // Anti-Omega if (analyseAntiOmega) { - addHistograms<6>(histos); + addHistograms(histos); } } @@ -1050,12 +1109,219 @@ struct Derivedupcanalysis { } template - int getGapSide(TCollision const& collision) + int applyZDCTiming(int selGapSide, TCollision const& collision) { - int selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); + if (!upcCuts.requireZDCTiming) { + return selGapSide; + } + if (selGapSide == o2::aod::sgselector::SingleGapA || + selGapSide == o2::aod::sgselector::SingleGapC || + selGapSide == o2::aod::sgselector::DoubleGap) { + + const float timeZNA = collision.timeZNA(); + const float timeZNC = collision.timeZNC(); + const float cut = upcCuts.zdcTimeCut; + + const bool gapA = hasNoZdcNeutrons(timeZNA, cut); + const bool gapC = hasNoZdcNeutrons(timeZNC, cut); + const bool neutronA = hasZdcNeutrons(timeZNA, cut); + const bool neutronC = hasZdcNeutrons(timeZNC, cut); + + if (selGapSide == o2::aod::sgselector::SingleGapA) { // 0nXn + if (!(gapA && neutronC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::SingleGapC) { // Xn0n + if (!(neutronA && gapC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::DoubleGap) { + if (!(gapA && gapC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } + } + return selGapSide; } + bool hasNoZdcNeutrons(float time, float cut) const + { + return (time != kMissingSignal) && (std::abs(time) > cut); + } + + bool hasZdcNeutrons(float time, float cut) const + { + return std::abs(time) < cut; + } + + bool isTimingCutEnabled(float cut, bool requireTiming) const + { + return requireTiming && cut >= 0.f; + } + + bool isTimingGap(float time, float cut) const + { + return (time != kMissingSignal) && (std::abs(time) > cut); + } + + bool isTimingActivity(float time, float cut) const + { + return std::abs(time) < cut; + } + + template + int applyFITTiming(int selGapSide, TCollision const& collision) + { + if (selGapSide != o2::aod::sgselector::SingleGapA && + selGapSide != o2::aod::sgselector::SingleGapC && + selGapSide != o2::aod::sgselector::DoubleGap) { + return selGapSide; + } + + const bool useFDDA = isTimingCutEnabled(upcCuts.fddaTimeCut, upcCuts.requireFDDATiming); + const bool useFDDC = isTimingCutEnabled(upcCuts.fddcTimeCut, upcCuts.requireFDDCTiming); + const bool useFV0A = isTimingCutEnabled(upcCuts.fv0aTimeCut, upcCuts.requireFV0ATiming); + const bool useFT0A = isTimingCutEnabled(upcCuts.ft0aTimeCut, upcCuts.requireFT0ATiming); + const bool useFT0C = isTimingCutEnabled(upcCuts.ft0cTimeCut, upcCuts.requireFT0CTiming); + + if (!(useFDDA || useFDDC || useFV0A || useFT0A || useFT0C)) { + return selGapSide; + } + + const bool gapFDDA = !useFDDA || isTimingGap(collision.timeFDDA(), upcCuts.fddaTimeCut); + const bool actFDDA = !useFDDA || isTimingActivity(collision.timeFDDA(), upcCuts.fddaTimeCut); + const bool gapFDDC = !useFDDC || isTimingGap(collision.timeFDDC(), upcCuts.fddcTimeCut); + const bool actFDDC = !useFDDC || isTimingActivity(collision.timeFDDC(), upcCuts.fddcTimeCut); + const bool gapFV0A = !useFV0A || isTimingGap(collision.timeFV0A(), upcCuts.fv0aTimeCut); + const bool actFV0A = !useFV0A || isTimingActivity(collision.timeFV0A(), upcCuts.fv0aTimeCut); + const bool gapFT0A = !useFT0A || isTimingGap(collision.timeFT0A(), upcCuts.ft0aTimeCut); + const bool actFT0A = !useFT0A || isTimingActivity(collision.timeFT0A(), upcCuts.ft0aTimeCut); + const bool gapFT0C = !useFT0C || isTimingGap(collision.timeFT0C(), upcCuts.ft0cTimeCut); + const bool actFT0C = !useFT0C || isTimingActivity(collision.timeFT0C(), upcCuts.ft0cTimeCut); + + if (selGapSide == o2::aod::sgselector::SingleGapA) { + if (!(gapFV0A && gapFDDA && gapFT0A && actFDDC && actFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::SingleGapC) { + if (!(actFV0A && actFDDA && actFT0A && gapFDDC && gapFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::DoubleGap) { + if (!(gapFV0A && gapFDDA && gapFT0A && gapFDDC && gapFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } + + return selGapSide; + } + + template + int getGapSideWithoutRecoZDC(TCollision const& collision) + { + int selGapSide = o2::aod::sgselector::NoGap; + selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, std::numeric_limits::infinity()); + return applyFITTiming(selGapSide, collision); + } + + template + bool generatedNeutronsMatchGapSide(int selGapSide, TNeutrons const& neutrons) + { + bool neutronA = false; + bool neutronC = false; + for (const auto& neutron : neutrons) { + neutronA = neutronA || (neutron.eta() > neutronEtaCut); + neutronC = neutronC || (neutron.eta() < -neutronEtaCut); + } + + if (selGapSide == o2::aod::sgselector::SingleGapA) { // 0nXn + return !neutronA && neutronC; + } + if (selGapSide == o2::aod::sgselector::SingleGapC) { // Xn0n + return neutronA && !neutronC; + } + if (selGapSide == o2::aod::sgselector::DoubleGap) { + return !neutronA && !neutronC; + } + + return false; + } + + template + int applyGeneratedNeutronSelection(int selGapSide, TNeutrons const& neutrons) + { + if (!checkNeutronsInMC) { + return selGapSide; + } + if (selGapSide != o2::aod::sgselector::SingleGapA && + selGapSide != o2::aod::sgselector::SingleGapC && + selGapSide != o2::aod::sgselector::DoubleGap) { + return selGapSide; + } + + if (!generatedNeutronsMatchGapSide(selGapSide, neutrons)) { + selGapSide = o2::aod::sgselector::NoGap; + } + + return selGapSide; + } + + template + int getGapSideMC(TCollision const& collision, TNeutrons const& neutrons) + { + return applyGeneratedNeutronSelection(getGapSideWithoutRecoZDC(collision), neutrons); + } + + template + bool acceptGeneratedNeutronSelection(TNeutrons const& neutrons) + { + return !requireGeneratedZDCNeutrons || generatedNeutronsMatchGapSide(static_cast(upcCuts.genGapSide), neutrons); + } + + template + int getGapSide(TCollision const& collision) + { + int selGapSide = o2::aod::sgselector::NoGap; + selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); + selGapSide = applyZDCTiming(selGapSide, collision); + return applyFITTiming(selGapSide, collision); + } + float sanitizeZdcTime(float time) const + { + if (!std::isfinite(time)) { + return kInvalidZdcTime; + } + if (std::abs(time) >= kMissingSignalThreshold) { + return kMissingZdcTime; + } + return time; + } + + float sanitizeFITTime(float time) const + { + if (!std::isfinite(time)) { + return kInvalidFITTime; + } + if (std::abs(time) >= kMissingSignalThreshold) { + return kMissingFITTime; + } + return time; + } + + template + void fillPreSelTimingHistograms(TCollision const& collision) + { + histos.fill(HIST("eventQA/hFT0TimePreSel"), sanitizeFITTime(collision.timeFT0A()), sanitizeFITTime(collision.timeFT0C())); + histos.fill(HIST("eventQA/hFDDTimePreSel"), sanitizeFITTime(collision.timeFDDA()), sanitizeFITTime(collision.timeFDDC())); + histos.fill(HIST("eventQA/hZNTimePreSel"), sanitizeZdcTime(collision.timeZNA()), sanitizeZdcTime(collision.timeZNC())); + histos.fill(HIST("eventQA/hTimeFT0APreSel"), sanitizeFITTime(collision.timeFT0A())); + histos.fill(HIST("eventQA/hTimeFT0CPreSel"), sanitizeFITTime(collision.timeFT0C())); + histos.fill(HIST("eventQA/hTimeFV0APreSel"), sanitizeFITTime(collision.timeFV0A())); + histos.fill(HIST("eventQA/hTimeFDDAPreSel"), sanitizeFITTime(collision.timeFDDA())); + histos.fill(HIST("eventQA/hTimeFDDCPreSel"), sanitizeFITTime(collision.timeFDDC())); + } + template void fillHistogramsQA(TCollision const& collision, int const& gap) { @@ -1091,14 +1357,26 @@ struct Derivedupcanalysis { auto znc = collision.energyCommonZNC(); constexpr float inf_f = std::numeric_limits::infinity(); - if (zna == -inf_f) + if (zna == -inf_f) { histos.fill(HIST("eventQA/hZN"), -1, znc, gap); - else if (znc == -inf_f) + } else if (znc == -inf_f) { histos.fill(HIST("eventQA/hZN"), zna, -1, gap); - else if (zna == -999 && znc == -999) + } else if (zna == kMissingSignal && znc == kMissingSignal) { histos.fill(HIST("eventQA/hZN"), -2, -2, gap); - else if (zna == -999 || znc == -999) + } else if (zna == kMissingSignal || znc == kMissingSignal) { LOG(warning) << "Only one ZDC signal is -999"; + } else { + histos.fill(HIST("eventQA/hZN"), zna, znc, gap); + } + + histos.fill(HIST("eventQA/hFT0Time"), sanitizeFITTime(collision.timeFT0A()), sanitizeFITTime(collision.timeFT0C()), gap); + histos.fill(HIST("eventQA/hFDDTime"), sanitizeFITTime(collision.timeFDDA()), sanitizeFITTime(collision.timeFDDC()), gap); + histos.fill(HIST("eventQA/hZNTime"), sanitizeZdcTime(collision.timeZNA()), sanitizeZdcTime(collision.timeZNC()), gap); + histos.fill(HIST("eventQA/hTimeFT0A"), sanitizeFITTime(collision.timeFT0A()), gap); + histos.fill(HIST("eventQA/hTimeFT0C"), sanitizeFITTime(collision.timeFT0C()), gap); + histos.fill(HIST("eventQA/hTimeFV0A"), sanitizeFITTime(collision.timeFV0A()), gap); + histos.fill(HIST("eventQA/hTimeFDDA"), sanitizeFITTime(collision.timeFDDA()), gap); + histos.fill(HIST("eventQA/hTimeFDDC"), sanitizeFITTime(collision.timeFDDC()), gap); } template @@ -1235,8 +1513,8 @@ struct Derivedupcanalysis { // c x tau float decayPos = std::hypot(casc.x() - coll.posX(), casc.y() - coll.posY(), casc.z() - coll.posZ()); float totalMom = std::hypot(casc.px(), casc.py(), casc.pz()); - float ctauXi = totalMom != 0 ? o2::constants::physics::MassXiMinus * decayPos / totalMom : 1e6; - float ctauOmega = totalMom != 0 ? o2::constants::physics::MassOmegaMinus * decayPos / totalMom : 1e6; + float ctauXi = totalMom != 0 ? o2::constants::physics::MassXiMinus * decayPos / totalMom : kDefaultInvalidCtau; + float ctauOmega = totalMom != 0 ? o2::constants::physics::MassOmegaMinus * decayPos / totalMom : kDefaultInvalidCtau; std::bitset bitMap = 0; @@ -1556,7 +1834,7 @@ struct Derivedupcanalysis { bitMap.set(selK0ShortCTau); // armenteros - if (v0.qtarm() * v0cuts.armPodCut > std::fabs(v0.alpha()) || v0cuts.armPodCut < 1e-4) + if (v0.qtarm() * v0cuts.armPodCut > std::fabs(v0.alpha()) || v0cuts.armPodCut < kDisabledArmenterosCut) bitMap.set(selK0ShortArmenteros); return bitMap; @@ -1764,31 +2042,7 @@ struct Derivedupcanalysis { continue; } - int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; - if (checkNeutronsInMC) { - for (const auto& neutron : groupedNeutrons) { - if (selGapSide < -0.5) - break; - - const float eta = neutron.eta(); - switch (selGapSide) { - case 0: // SGA - if (eta > neutronEtaCut) - selGapSide = -1; - break; - case 1: // SGC - if (eta < -neutronEtaCut) - selGapSide = -1; - break; - case 2: // DG - if (eta > neutronEtaCut) - selGapSide = 1; - else if (eta < -neutronEtaCut) - selGapSide = 0; - break; - } - } - } + int selGapSide = collision.isUPC() ? getGapSideMC(collision, groupedNeutrons) : -1; if (evSels.studyUPConly && (selGapSide != static_cast(upcCuts.genGapSide))) continue; @@ -1842,39 +2096,15 @@ struct Derivedupcanalysis { continue; } - int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; - if (checkNeutronsInMC) { - for (const auto& neutron : groupedNeutrons) { - if (selGapSide < -0.5) - break; - - const float eta = neutron.eta(); - switch (selGapSide) { - case 0: // SGA - if (eta > neutronEtaCut) - selGapSide = -1; - break; - case 1: // SGC - if (eta < -neutronEtaCut) - selGapSide = -1; - break; - case 2: // DG - if (eta > neutronEtaCut) - selGapSide = 1; - else if (eta < -neutronEtaCut) - selGapSide = 0; - break; - } - } - } - - if (evSels.studyUPConly && (selGapSide != static_cast(upcCuts.genGapSide))) - continue; + int selGapSide = collision.isUPC() ? getGapSideMC(collision, groupedNeutrons) : -1; - ++nCollisions; - atLeastOne = true; + const bool passStd = !evSels.studyUPConly || (selGapSide == static_cast(upcCuts.genGapSide)); + if (passStd) { + ++nCollisions; + atLeastOne = true; + } - if (biggestNContribs < collision.multPVTotalContributors()) { + if (passStd && biggestNContribs < collision.multPVTotalContributors()) { biggestNContribs = collision.multPVTotalContributors(); if (static_cast(upcCuts.genGapSide) == 0) { ft0ampl = collision.totalFT0AmplitudeC(); @@ -1910,12 +2140,12 @@ struct Derivedupcanalysis { } const auto v0mother = v0.template motherMCPart_as(); - if (v0mother.size() < 1) { + if (v0mother.size() == 0) { return; } const float rapidityXi = RecoDecay::y(std::array{v0mother.px(), v0mother.py(), v0mother.pz()}, o2::constants::physics::MassXiMinus); - if (std::fabs(rapidityXi) > 0.5f) { + if (std::fabs(rapidityXi) > kMotherRapidityMax) { return; } @@ -1946,10 +2176,13 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); - int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; - if (evSels.studyUPConly && (selGapSide < -0.5)) + int selGapSide = collision.isUPC() ? getGapSide(collision) : o2::aod::sgselector::NoGap; + if (evSels.studyUPConly && (selGapSide < 0)) continue; fillHistogramsQA(collision, selGapSide); @@ -2002,38 +2235,16 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); - int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; - int selGapSideNoNeutrons = selGapSide; - auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex()); - if (checkNeutronsInMC) { - for (const auto& neutron : groupedNeutrons) { - if (selGapSide < -0.5) - break; - - const float eta = neutron.eta(); - switch (selGapSide) { - case 0: // SGA - if (eta > neutronEtaCut) - selGapSide = -1; - break; - case 1: // SGC - if (eta < -neutronEtaCut) - selGapSide = -1; - break; - case 2: // DG - if (eta > neutronEtaCut) - selGapSide = 1; - else if (eta < -neutronEtaCut) - selGapSide = 0; - break; - } - } - } + int selGapSideNoNeutrons = collision.isUPC() ? getGapSideWithoutRecoZDC(collision) : o2::aod::sgselector::NoGap; + int selGapSide = applyGeneratedNeutronSelection(selGapSideNoNeutrons, groupedNeutrons); - if (evSels.studyUPConly && (selGapSide < -0.5)) + if (evSels.studyUPConly && (selGapSide < 0)) continue; histos.fill(HIST("eventQA/hSelGapSideNoNeutrons"), selGapSideNoNeutrons); @@ -2087,10 +2298,13 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); - int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; - if (evSels.studyUPConly && (selGapSide < -0.5)) + int selGapSide = collision.isUPC() ? getGapSide(collision) : o2::aod::sgselector::NoGap; + if (evSels.studyUPConly && (selGapSide < 0)) continue; fillHistogramsQA(collision, selGapSide); @@ -2139,38 +2353,16 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); - int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; - int selGapSideNoNeutrons = selGapSide; - auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex()); - if (checkNeutronsInMC) { - for (const auto& neutron : groupedNeutrons) { - if (selGapSide < -0.5) - break; - - const float eta = neutron.eta(); - switch (selGapSide) { - case 0: // SGA - if (eta > neutronEtaCut) - selGapSide = -1; - break; - case 1: // SGC - if (eta < -neutronEtaCut) - selGapSide = -1; - break; - case 2: // DG - if (eta > neutronEtaCut) - selGapSide = 1; - else if (eta < -neutronEtaCut) - selGapSide = 0; - break; - } - } - } + int selGapSideNoNeutrons = collision.isUPC() ? getGapSideWithoutRecoZDC(collision) : o2::aod::sgselector::NoGap; + int selGapSide = applyGeneratedNeutronSelection(selGapSideNoNeutrons, groupedNeutrons); - if (evSels.studyUPConly && (selGapSide < -0.5)) + if (evSels.studyUPConly && (selGapSide < 0)) continue; histos.fill(HIST("eventQA/hSelGapSideNoNeutrons"), selGapSideNoNeutrons); @@ -2237,6 +2429,11 @@ struct Derivedupcanalysis { continue; } + auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex()); + if (!acceptGeneratedNeutronSelection(groupedNeutrons)) { + continue; + } + // float centrality = -1.f; float ft0ampl = -1.f; int nTracksGlobal = -1; @@ -2293,6 +2490,15 @@ struct Derivedupcanalysis { if (std::abs(mcCollision.posZ()) > maxZVtxPosition) continue; + if (std::find(generatorIds->begin(), generatorIds->end(), mcCollision.generatorsID()) == generatorIds->end()) { + continue; + } + + auto groupedNeutrons = neutrons.sliceBy(neutronsPerMcCollision, mcCollision.globalIndex()); + if (!acceptGeneratedNeutronSelection(groupedNeutrons)) { + continue; + } + // float centrality = -1.f; float ft0ampl = -1.f; int nTracksGlobal = -1; From ccb309edc8445880150e32c1e9cec1f6b88801b2 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:38:11 +0200 Subject: [PATCH 13/22] Update higherMassResonances --- .../Tasks/Resonances/higherMassResonances.cxx | 700 +++++++++++++----- 1 file changed, 526 insertions(+), 174 deletions(-) diff --git a/PWGLF/Tasks/Resonances/higherMassResonances.cxx b/PWGLF/Tasks/Resonances/higherMassResonances.cxx index e2b9736aef7..de6dfacd7e2 100644 --- a/PWGLF/Tasks/Resonances/higherMassResonances.cxx +++ b/PWGLF/Tasks/Resonances/higherMassResonances.cxx @@ -13,14 +13,14 @@ /// \brief glueball resonance /// \author Sawan -// #include #include "PWGLF/DataModel/LFStrangenessPIDTables.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" // +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/mcCentrality.h" +#include "PWGLF/Utils/inelGt.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" // #include "Common/DataModel/Multiplicity.h" @@ -28,33 +28,39 @@ #include "Common/DataModel/PIDResponseTPC.h" // #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" // -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" // -#include "ReconstructionDataFormats/Track.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "TF1.h" -#include "TRandom3.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include // +#include +#include +#include +#include +#include +#include +#include +#include +#include // + +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include -#include -#include #include +#include +#include #include #include #include +#include #include #include +#include #include #include @@ -65,6 +71,7 @@ using namespace o2::soa; using namespace o2::aod::rctsel; // using namespace o2::constants::physics; using std::array; +// FixME: Add INEL>0 selection for the derived data struct HigherMassResonances { SliceCache cache; @@ -96,39 +103,43 @@ struct HigherMassResonances { Configurable qAv0{"qAv0", false, "qAv0"}; Configurable qAPID{"qAPID", true, "qAPID"}; Configurable qAevents{"qAevents", false, "QA of events"}; - Configurable correlation2Dhist{"correlation2Dhist", true, "Lamda K0 mass correlation"}; + Configurable qAcorrelation2Dhist{"qAcorrelation2Dhist", true, "Lamda K0 mass correlation"}; + Configurable qAOptimisation{"qAOptimisation", false, "QA for optimisation with multiple THnSparse Axes"}; Configurable isApplyDCAv0topv{"isApplyDCAv0topv", false, "DCA V0 to PV"}; Configurable hasTPC{"hasTPC", false, "TPC"}; Configurable isselectTWOKsOnly{"isselectTWOKsOnly", true, "Select only events with two K0s"}; - Configurable isapplyPairRapidityRec{"isapplyPairRapidityRec", false, "Apply pair rapidity cut on reconstructed mother (after already applying rapidity cut on generated mother)"}; - Configurable isapplyPairRapidityGen{"isapplyPairRapidityGen", false, "Apply pair rapidity cut on generated mother (before applying rapidity cut on reconstructed mother)"}; + Configurable isapplyPairRapidityMC{"isapplyPairRapidityMC", false, "Apply pair rapidity cut on reconstructed mother (after already applying rapidity cut on generated mother)"}; Configurable cSelectMultEstimator{"cSelectMultEstimator", 0, "Select multiplicity estimator: 0 - FT0M, 1 - FT0A, 2 - FT0C"}; - Configurable configOccCut{"configOccCut", 1000, "Occupancy cut"}; - Configurable isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"}; - Configurable isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "No collision in time range standard"}; - Configurable isSel8{"isSel8", false, "Event Selection 8"}; + // Configurable configOccCut{"configOccCut", 1000, "Occupancy cut"}; + // Configurable isVertexTOFMatched{"isVertexTOFMatched", false, "Vertex TOF Matched"}; + // Configurable isNoCollInTimeRangeStandard{"isNoCollInTimeRangeStandard", false, "No collision in time range standard"}; + // Configurable isSel8{"isSel8", false, "Event Selection 8"}; // Configurables for event selection - // Configurable isINELgt0{"isINELgt0", true, "INEL>0 selection"}; + Configurable isINELgt0{"isINELgt0", true, "INEL>0 selection"}; Configurable isTriggerTVX{"isTriggerTVX", false, "TriggerTVX"}; - Configurable isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", false, "IsGoodZvtxFT0vsPV"}; - Configurable isApplyOccCut{"isApplyOccCut", true, "Apply occupancy cut"}; + // Configurable isGoodZvtxFT0vsPV{"isGoodZvtxFT0vsPV", false, "IsGoodZvtxFT0vsPV"}; + // Configurable isApplyOccCut{"isApplyOccCut", true, "Apply occupancy cut"}; Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; Configurable timFrameEvsel{"timFrameEvsel", true, "TPC Time frame boundary cut"}; - Configurable isNoSameBunchPileup{"isNoSameBunchPileup", true, "kNoSameBunchPileup"}; + // Configurable isNoSameBunchPileup{"isNoSameBunchPileup", true, "kNoSameBunchPileup"}; Configurable isAllLayersGoodITS{"isAllLayersGoodITS", true, "Require all ITS layers to be good"}; Configurable isNoTimeFrameBorder{"isNoTimeFrameBorder", true, "kNoTimeFrameBorder"}; Configurable isNoITSROFrameBorder{"isNoITSROFrameBorder", true, "kNoITSROFrameBorder"}; // Configurable parameters for V0 selection + Configurable confV0PtMin{"confV0PtMin", 0.f, "Minimum transverse momentum of V0"}; + Configurable confV0PtMax{"confV0PtMax", 100.f, "Maximum transverse momentum of V0"}; + Configurable confPiPtMin{"confPiPtMin", 0.1f, "Minimum transverse momentum of pion daughter"}; + Configurable confPiPtMax{"confPiPtMax", 100.f, "Maximum transverse momentum of pion daughter"}; + Configurable cMaxDeltaM{"cMaxDeltaM", 0.01f, "Sqrt((m1-mPDG)^2 + (m2-mPDG)^2) < cMaxDeltaM)"}; Configurable confV0DCADaughMax{"confV0DCADaughMax", 1.0f, "DCA b/w V0 daughters"}; - Configurable v0settingDcapostopv{"v0settingDcapostopv", 0.06, "DCA Pos To PV"}; - Configurable v0settingDcanegtopv{"v0settingDcanegtopv", 0.06, "DCA Neg To PV"}; + Configurable v0DCApostoPV{"v0DCApostoPV", 0.06, "DCA Pos To PV"}; + Configurable v0DCAnegtoPV{"v0DCAnegtoPV", 0.06, "DCA Neg To PV"}; Configurable cMaxV0DCA{"cMaxV0DCA", 0.5, "DCA V0 to PV"}; - Configurable confV0PtMin{"confV0PtMin", 0.f, "Minimum transverse momentum of V0"}; Configurable confV0CPAMin{"confV0CPAMin", 0.97f, "Minimum CPA of V0"}; Configurable confV0TranRadV0Min{"confV0TranRadV0Min", 0.5f, "Minimum transverse radius"}; - Configurable confV0TranRadV0Max{"confV0TranRadV0Max", 200.f, "Maximum transverse radius"}; + // Configurable confV0TranRadV0Max{"confV0TranRadV0Max", 200.f, "Maximum transverse radius"}; Configurable cMaxV0LifeTime{"cMaxV0LifeTime", 15, "Maximum V0 life time"}; Configurable cSigmaMassKs0{"cSigmaMassKs0", 4, "n Sigma cut on Ks0 mass (Mass (Ks) - cSigmaMassKs0*cWidthKs0)"}; Configurable cWidthKs0{"cWidthKs0", 0.005, "Width of KS0"}; @@ -137,25 +148,23 @@ struct HigherMassResonances { Configurable confDaughPIDCutTPC{"confDaughPIDCutTPC", 5, "PID selections for KS0 daughters"}; Configurable confDaughPIDCutTOF{"confDaughPIDCutTOF", 5, "PID selections for KS0 daughters in TOF"}; Configurable confKsrapidity{"confKsrapidity", 0.5f, "Rapidity cut on K0s"}; - Configurable angSepCut{"angSepCut", 0.01f, "Angular separation cut"}; - Configurable isapplyAngSepCut{"isapplyAngSepCut", false, "Apply angular separation cut"}; - Configurable isStandardV0{"isStandardV0", false, "Standard V0 selection"}; + // Configurable isStandardV0{"isStandardV0", false, "Standard V0 selection"}; Configurable isApplyEtaCutK0s{"isApplyEtaCutK0s", false, "Apply eta cut on K0s daughters"}; Configurable cfgETAcut{"cfgETAcut", 0.8f, "Track ETA cut"}; + Configurable deltaRDaugherCut{"deltaRDaugherCut", 0.001f, "DeltaR cut on V0 daughters"}; + Configurable deltaRK0sCut{"deltaRK0sCut", 0.1f, "Apply deltaR cut between two K0s"}; // Configurable for track selection and multiplicity Configurable cfgPTcut{"cfgPTcut", 0.2f, "Track PT cut"}; Configurable cfgNmixedEvents{"cfgNmixedEvents", 5, "Number of mixed events"}; - ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"}; // Configurable for MC - Configurable isMC{"isMC", false, "Is MC"}; + // Configurable isMC{"isMC", false, "Is MC"}; Configurable isallGenCollisions{"isallGenCollisions", true, "To fill all generated collisions for the signal loss calculations"}; - Configurable iscTVXEvsel{"iscTVXEvsel", true, "Triggger selection"}; Configurable isavoidsplitrackMC{"isavoidsplitrackMC", false, "avoid split track in MC"}; Configurable isapplyRapidityMC{"isapplyRapidityMC", true, "Apply rapidity cut on generated and reconstructed particles"}; Configurable selectMCparticles{"selectMCparticles", 1, "0: f0(1710), 1: f2(1525), 2: a2(1320), 3: f0(1370), 4: f0(1500), 5: f2(1270)"}; - std::vector pdgCodes = {10331, 335, 115, 10221, 9030221, 225}; + std::vector pdgCodes = {10331, 335, 115, 10221, 9030221, 225, 313}; // output THnSparses Configurable activateHelicityFrame{"activateHelicityFrame", false, "Activate the THnSparse with cosThStar w.r.t. helicity axis"}; @@ -168,16 +177,20 @@ struct HigherMassResonances { // Other cuts on Ks and glueball Configurable isapplyCompetingcut{"isapplyCompetingcut", false, "Competing cascade rejection cut"}; Configurable competingcascrejlambda{"competingcascrejlambda", 0.005, "rejecting competing cascade lambda"}; - Configurable tpcCrossedrows{"tpcCrossedrows", 70, "TPC crossed rows"}; - Configurable tpcCrossedrowsOverfcls{"tpcCrossedrowsOverfcls", 0.8, "TPC crossed rows over findable clusters"}; + // Configurable tpcCrossedrows{"tpcCrossedrows", 70, "TPC crossed rows"}; + // Configurable tpcCrossedrowsOverfcls{"tpcCrossedrowsOverfcls", 0.8, "TPC crossed rows over findable clusters"}; + Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; // // Mass and pT axis as configurables - Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; + ConfigurableAxis binsCent{"binsCent", {VARIABLE_WIDTH, 0., 5., 10., 30., 50., 70., 100., 110., 150.}, "Binning of the centrality axis"}; ConfigurableAxis configThnAxisPOL{"configThnAxisPOL", {20, -1.0, 1.0}, "Costheta axis"}; ConfigurableAxis configThnAxisPhi{"configThnAxisPhi", {70, 0.0f, 7.0f}, "Phi axis"}; // 0 to 2pi ConfigurableAxis ksMassBins{"ksMassBins", {200, 0.45f, 0.55f}, "K0s invariant mass axis"}; ConfigurableAxis cGlueMassBins{"cGlueMassBins", {200, 0.9f, 3.0f}, "Glueball invariant mass axis"}; ConfigurableAxis cPtBins{"cPtBins", {200, 0.0f, 20.0f}, "Glueball pT axis"}; + ConfigurableAxis configAxisDeltaM{"configAxisDeltaM", {80, 0.0, 0.08}, "#it{M} (GeV/#it{c}^{2})"}; + ConfigurableAxis configAxisAngleSep{"configAxisAngleSep", {200, 0.0, 2.0}, "Angular separation between V0s"}; + ConfigurableAxis configAxisPtCorr{"configAxisPtCorr", {1000, 0.0, 100.0}, "Pt correlation between two K0s"}; // fixed variables float rapidityMotherData = 0.5; @@ -217,6 +230,9 @@ struct HigherMassResonances { AxisSpec multiplicityAxis = {config.binsCent, "Multiplicity Axis"}; AxisSpec thnAxisPOL{config.configThnAxisPOL, "Configurabel theta axis"}; AxisSpec thnAxisPhi = {config.configThnAxisPhi, "Configurabel phi axis"}; // 0 to 2pi + AxisSpec deltaMAxis = {config.configAxisDeltaM, "#Delta M (GeV/#it{c}^{2})"}; + AxisSpec angleSepAxis = {config.configAxisAngleSep, "Angular separation between V0s"}; + AxisSpec ptCorrAxis = {config.configAxisPtCorr, "Pt correlation between two K0s"}; // THnSparses std::array sparses = {config.activateHelicityFrame, config.activateCollinsSoperFrame, config.activateProductionFrame, config.activateBeamAxisFrame, config.activateRandomFrame}; @@ -262,16 +278,16 @@ struct HigherMassResonances { hCutFlow->GetXaxis()->SetBinLabel(8, "Occupancy Cut"); hCutFlow->GetXaxis()->SetBinLabel(9, "rctChecker"); hCutFlow->GetXaxis()->SetBinLabel(10, "kIsTriggerTVX"); - hCutFlow->GetXaxis()->SetBinLabel(11, "kIsGoodZvtxFT0vsPV"); + hCutFlow->GetXaxis()->SetBinLabel(11, "No selection"); hCutFlow->GetXaxis()->SetBinLabel(12, "IsINELgt0"); - hCutFlow->GetXaxis()->SetBinLabel(13, "isVertexITSTPC"); - hCutFlow->GetXaxis()->SetBinLabel(14, "isVertexTOFMatched"); + // hCutFlow->GetXaxis()->SetBinLabel(13, "isVertexITSTPC"); + // hCutFlow->GetXaxis()->SetBinLabel(14, "isVertexTOFMatched"); std::shared_ptr hv0label = rEventSelection.get(HIST("htrackscheck_v0")); hv0label->GetXaxis()->SetBinLabel(1, "All Tracks"); hv0label->GetXaxis()->SetBinLabel(2, "DCA V0 to PV"); hv0label->GetXaxis()->SetBinLabel(3, "y K0s"); - hv0label->GetXaxis()->SetBinLabel(4, "Min V0 pT"); + hv0label->GetXaxis()->SetBinLabel(4, "V0 pT cut"); hv0label->GetXaxis()->SetBinLabel(5, "Daughter DCA"); hv0label->GetXaxis()->SetBinLabel(6, "CosPA"); hv0label->GetXaxis()->SetBinLabel(7, "Decay Radius"); @@ -287,8 +303,11 @@ struct HigherMassResonances { hv0DauLabel->GetXaxis()->SetBinLabel(4, "TPC CRFC"); hv0DauLabel->GetXaxis()->SetBinLabel(5, "TPC Chi2NCL"); hv0DauLabel->GetXaxis()->SetBinLabel(6, "Charge"); - hv0DauLabel->GetXaxis()->SetBinLabel(7, "Eta"); - hv0DauLabel->GetXaxis()->SetBinLabel(8, "PID TPC"); + hv0DauLabel->GetXaxis()->SetBinLabel(7, "Charge"); + hv0DauLabel->GetXaxis()->SetBinLabel(8, "Eta"); + hv0DauLabel->GetXaxis()->SetBinLabel(9, "PID TPC"); + hv0DauLabel->GetXaxis()->SetBinLabel(10, "PID TOF"); + hv0DauLabel->GetXaxis()->SetBinLabel(11, "Pt cut"); std::shared_ptr hv0labelmcrec = hMChists.get(HIST("events_checkrec")); hv0labelmcrec->GetXaxis()->SetBinLabel(1, "All Tracks"); @@ -314,25 +333,34 @@ struct HigherMassResonances { hv0labelmcgen->GetXaxis()->SetBinLabel(8, "Daughters K0s"); } - hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); - hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); - hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); + if (!config.qAOptimisation) { + hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); + hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); + hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL, thnAxisPhi}, true); + } else { + hglue.add("h3glueInvMassDS", "h3glueInvMassDS", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, deltaMAxis, angleSepAxis, ptCorrAxis}, true); + hglue.add("h3glueInvMassME", "h3glueInvMassME", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, deltaMAxis, angleSepAxis, ptCorrAxis}, true); + hglue.add("h3glueInvMassRot", "h3glueInvMassRot", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, deltaMAxis, angleSepAxis, ptCorrAxis}, true); + } // K0s topological/PID cuts - if (config.correlation2Dhist) { + if (config.qAcorrelation2Dhist) { rKzeroShort.add("mass_lambda_kshort_before", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); rKzeroShort.add("mass_lambda_kshort_after10", "mass under lambda hypotheses and Kshort mass", kTH2F, {{100, 0.2, 0.8}, {100, 0.9, 1.5}}); } if (config.qAv0) { // Invariant Mass rKzeroShort.add("hMassK0Shortbefore", "hMassK0Shortbefore", kTHnSparseF, {k0ShortMassAxis, ptAxis}); - rKzeroShort.add("hMasscorrelationbefore", "hMasscorrelationbefore", kTH2F, {k0ShortMassAxis, k0ShortMassAxis}); + rKzeroShort.add("hK0ShortMassCorr", "hK0ShortMassCorr", kTHnSparseF, {k0ShortMassAxis, k0ShortMassAxis, deltaMAxis}); + // rKzeroShort.add("hK0ShortMassCorrAfterCut", "hK0ShortMassCorrAfterCut", kTH2F, {k0ShortMassAxis, k0ShortMassAxis}); + rKzeroShort.add("hK0sPtCorrelation", "hK0sPtCorrelation", kTH1F, {{1000, 0.0f, 100.0f}}); rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", kTHnSparseF, {k0ShortMassAxis, ptAxis}); // Topological histograms (after the selection) rKzeroShort.add("hDCAV0Daughters", "DCA between v0 daughters", {HistType::kTH1F, {{60, -3.0f, 3.0f}}}); rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.96f, 1.1f}}}); rKzeroShort.add("hLT", "hLT", {HistType::kTH1F, {{100, 0.0f, 50.0f}}}); rKzeroShort.add("angularSeparation", "Angular distribution between two K0s vs pT", {HistType::kTH1F, {{200, 0.0f, 4.0f}}}); + rKzeroShort.add("hDauDeltaR", "Delta R of positive and negative daughers", {HistType::kTHnSparseF, {angleSepAxis, angleSepAxis}}); } rKzeroShort.add("NksProduced", "Number of K0s produced", kTH1I, {{15, -0.5, 14.5}}); @@ -345,11 +373,16 @@ struct HigherMassResonances { } // For MC - if (config.isMC) { + if (doprocessGen || doprocessRec) { + hMChists.add("MCcorrections/hGenNo", "Generated collisions before and after event selection", kTH1F, {{5, 0.0f, 5.0f}}); hMChists.add("Genf1710", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL}); + hMChists.add("Genf1710Calib", "Calibrated Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL}); hMChists.add("Genf17102", "Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL}); + hMChists.add("Genf1710Calib2", "Calibrated Gen f_{0}(1710)", kTHnSparseF, {multiplicityAxis, ptAxis, thnAxisPOL}); hMChists.add("Recf1710_pt1", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL}); + hMChists.add("Recf1710Calib_pt1", "Calibrated Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL}); hMChists.add("Recf1710_pt2", "Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL}); + hMChists.add("Recf1710Calib_pt2", "Calibrated Rec f_{0}(1710) p_{T}", kTHnSparseF, {multiplicityAxis, ptAxis, glueballMassAxis, thnAxisPOL}); hMChists.add("h1Recsplit", "Rec p_{T}2", kTH1F, {ptAxis}); hMChists.add("Genf1710_mass", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis}); hMChists.add("Genf1710_mass2", "Gen f_{0}(1710) mass", kTH1F, {glueballMassAxis}); @@ -368,6 +401,22 @@ struct HigherMassResonances { hMChists.add("Rec_Multiplicity", "Multiplicity in MC", kTH1F, {multiplicityAxis}); hMChists.add("MC_mult_after_event_sel", "Multiplicity in MC", kTH1F, {multiplicityAxis}); } + + if (doprocessEvtLossSigLossMC) { + hMChists.add("MCcorrections/hSignalLossDenominator", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); + hMChists.add("MCcorrections/hSignalLossNumerator", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); + hMChists.add("MCcorrections/MultiplicityRec", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {multiplicityAxis}); + hMChists.add("MCcorrections/MultiplicityGen", "Multiplicity in generated MC", kTH1F, {multiplicityAxis}); + hMChists.add("MCcorrections/hSignalLossDenominator2", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); + hMChists.add("MCcorrections/hSignalLossNumerator2", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); + hMChists.add("MCcorrections/MultiplicityRec2", "Multiplicity in generated MC with at least 1 reconstruction", kTH1F, {multiplicityAxis}); + hMChists.add("MCcorrections/MultiplicityGen2", "Multiplicity in generated MC", kTH1F, {multiplicityAxis}); + + hMChists.add("MCcorrections/hSignalLossDenominator3", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); + hMChists.add("MCcorrections/hSignalLossDenominator4", "Kstar generated before event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); + hMChists.add("MCcorrections/hSignalLossNumerator3", "Kstar generated after event selection", kTH2F, {{ptAxis}, {multiplicityAxis}}); + hMChists.add("MCcorrections/hMultvsCent", "Kstar generated after event selection", kTH2F, {{multiplicityAxis}, {multiplicityAxis}}); + } } template @@ -381,8 +430,8 @@ struct HigherMassResonances { if (fillHist) rEventSelection.fill(HIST("hEventCut"), 1); - if (config.isSel8 && !collision.sel8()) - return false; + // if (config.isSel8 && !collision.sel8()) + // return false; if (fillHist) rEventSelection.fill(HIST("hEventCut"), 2); @@ -396,8 +445,8 @@ struct HigherMassResonances { if (fillHist) rEventSelection.fill(HIST("hEventCut"), 4); - if (config.isNoSameBunchPileup && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup))) - return false; + // if (config.isNoSameBunchPileup && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup))) + // return false; if (fillHist) rEventSelection.fill(HIST("hEventCut"), 5); @@ -409,8 +458,8 @@ struct HigherMassResonances { // if (config.isNoCollInTimeRangeStandard && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))) // return false; - if (config.isApplyOccCut && (std::abs(collision.trackOccupancyInTimeRange()) > config.configOccCut)) - return false; + // if (config.isApplyOccCut && (std::abs(collision.trackOccupancyInTimeRange()) > config.configOccCut)) + // return false; if (fillHist) rEventSelection.fill(HIST("hEventCut"), 7); @@ -424,28 +473,85 @@ struct HigherMassResonances { if (fillHist) rEventSelection.fill(HIST("hEventCut"), 9); - if (config.isGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) + // if (config.isGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) + // return false; + // if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 10); + + if (config.isINELgt0 && !collision.isInelGt0()) { return false; + } if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 10); + rEventSelection.fill(HIST("hEventCut"), 11); - // if (config.isINELgt0 && !collision.isInelGt0()) { + // if (config.isVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { // return false; // } // if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 11); + // rEventSelection.fill(HIST("hEventCut"), 12); - // if (config.isVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + // if (config.isVertexTOFMatched && !collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { // return false; // } + // if (fillHist) + // rEventSelection.fill(HIST("hEventCut"), 13); + + return true; + } + + template + bool selectionEventDerived(const Coll& collision, bool fillHist = true) + { if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 12); + rEventSelection.fill(HIST("hEventCut"), 0); - if (config.isVertexTOFMatched && !collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { + if (std::abs(collision.posZ()) > config.cutzvertex) return false; - } if (fillHist) - rEventSelection.fill(HIST("hEventCut"), 13); + rEventSelection.fill(HIST("hEventCut"), 1); + + // if (config.isSel8 && !collision.sel8()) + // return false; + if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 2); + + if (config.isNoTimeFrameBorder && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) + return false; + if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 3); + + if (config.isNoITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) + return false; + if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 4); + + // if (config.isNoSameBunchPileup && (!collision.selection_bit(aod::evsel::kNoSameBunchPileup))) + // return false; + if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 5); + + if (config.isAllLayersGoodITS && !collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) + return false; + if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 6); + + // if (config.isNoCollInTimeRangeStandard && (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard))) + // return false; + + // if (config.isApplyOccCut && (std::abs(collision.trackOccupancyInTimeRange()) > config.configOccCut)) + // return false; + if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 7); + + if (rctCut.requireRCTFlagChecker && !rctChecker(collision)) + return false; + if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 8); + + if (config.isTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) + return false; + if (fillHist) + rEventSelection.fill(HIST("hEventCut"), 9); return true; } @@ -471,7 +577,7 @@ struct HigherMassResonances { rKzeroShort.fill(HIST("hDCAV0Daughters"), candidate.dcaV0daughters()); rKzeroShort.fill(HIST("hV0CosPA"), candidate.v0cosPA()); } - if (config.correlation2Dhist) + if (config.qAcorrelation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_before"), candidate.mK0Short(), candidate.mLambda()); rEventSelection.fill(HIST("htrackscheck_v0"), 0.5); @@ -486,7 +592,7 @@ struct HigherMassResonances { } rEventSelection.fill(HIST("htrackscheck_v0"), 2.5); - if (pT < config.confV0PtMin) { + if (pT < config.confV0PtMin || pT > config.confV0PtMax) { return false; } rEventSelection.fill(HIST("htrackscheck_v0"), 3.5); @@ -506,9 +612,9 @@ struct HigherMassResonances { } rEventSelection.fill(HIST("htrackscheck_v0"), 6.5); - if (tranRad > config.confV0TranRadV0Max) { - return false; - } + // if (tranRad > config.confV0TranRadV0Max) { + // return false; + // } rEventSelection.fill(HIST("htrackscheck_v0"), 7.5); if (std::fabs(ctauK0s) > config.cMaxV0LifeTime) { @@ -521,16 +627,16 @@ struct HigherMassResonances { } rEventSelection.fill(HIST("htrackscheck_v0"), 9.5); - if (config.correlation2Dhist) + if (config.qAcorrelation2Dhist) rKzeroShort.fill(HIST("mass_lambda_kshort_after10"), candidate.mK0Short(), candidate.mLambda()); if (config.qAv0) { rKzeroShort.fill(HIST("hMassK0ShortSelected"), candidate.mK0Short(), candidate.pt()); } - if (config.isStandardV0 && candidate.v0Type() != 1) { - return false; // Only standard V0s are selected - } + // if (config.isStandardV0 && candidate.v0Type() != 1) { + // return false; // Only standard V0s are selected + // } rEventSelection.fill(HIST("htrackscheck_v0"), 10.5); if (candidate.mK0Short() < lowmasscutks0 || candidate.mK0Short() > highmasscutks0) { @@ -558,12 +664,12 @@ struct HigherMassResonances { return false; rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 1.5); - if (track.tpcNClsCrossedRows() < config.tpcCrossedrows) - return false; + // if (track.tpcNClsCrossedRows() < config.tpcCrossedrows) + // return false; rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 2.5); - if (track.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls) - return false; + // if (track.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls) + // return false; rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 3.5); if (tpcNClsF < config.confDaughTPCnclsMin) { @@ -598,6 +704,12 @@ struct HigherMassResonances { if (std::abs(v0candidate.tofNSigmaK0PiMinus()) > config.confDaughPIDCutTOF && v0candidate.negativeHasTOF()) { return false; } + rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 9.5); + + if (track.pt() < config.confPiPtMin || track.pt() > config.confPiPtMax) { + return false; + } + rEventSelection.fill(HIST("htrackscheck_v0_daughters"), 10.5); if (config.qAPID) { (charge == 1) ? rKzeroShort.fill(HIST("hNSigmaPosPionK0s_after"), track.tpcInnerParam(), track.tpcNSigmaPi()) : rKzeroShort.fill(HIST("hNSigmaNegPionK0s_after"), track.tpcInnerParam(), track.tpcNSigmaPi()); @@ -606,6 +718,13 @@ struct HigherMassResonances { return true; } + double deltaM(double m1, double m2) + { + const double d1 = m1 - o2::constants::physics::MassK0Short; + const double d2 = m2 - o2::constants::physics::MassK0Short; + return std::sqrt(d1 * d1 + d2 * d2); + } + using EventCandidatesDerivedData = soa::Join; using V0CandidatesDerivedData = soa::Join; // using DauTracks = soa::Join; @@ -624,16 +743,16 @@ struct HigherMassResonances { return false; } - if (posTrackExtra.tpcNClsCrossedRows() < config.tpcCrossedrows || negTrackExtra.tpcNClsCrossedRows() < config.tpcCrossedrows) { - return false; - } + // if (posTrackExtra.tpcNClsCrossedRows() < config.tpcCrossedrows || negTrackExtra.tpcNClsCrossedRows() < config.tpcCrossedrows) { + // return false; + // } if (posTrackExtra.tpcNClsFound() < config.confDaughTPCnclsMin || negTrackExtra.tpcNClsFound() < config.confDaughTPCnclsMin) { return false; } - if (posTrackExtra.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls || negTrackExtra.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls) { - return false; - } + // if (posTrackExtra.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls || negTrackExtra.tpcCrossedRowsOverFindableCls() < config.tpcCrossedrowsOverfcls) { + // return false; + // } // check TPC PID if (((std::abs(posTrackExtra.tpcNSigmaPi()) > config.confDaughPIDCutTPC) || (std::abs(negTrackExtra.tpcNSigmaPi()) > config.confDaughPIDCutTPC))) { @@ -654,32 +773,17 @@ struct HigherMassResonances { return false; } - // rKzeroShort.fill(HIST("negative_pt"), negTrackExtra.pt()); - // rKzeroShort.fill(HIST("positive_pt"), posTrackExtra.pt()); - // rKzeroShort.fill(HIST("negative_eta"), negTrackExtra.eta()); - // rKzeroShort.fill(HIST("positive_eta"), posTrackExtra.eta()); - // rKzeroShort.fill(HIST("negative_phi"), negTrackExtra.phi()); - // rKzeroShort.fill(HIST("positive_phi"), posTrackExtra.phi()); - return true; - } - - // Angular separation cut on KsKs pairs - template - bool applyAngSep(const T1& candidate1, const T2& candidate2) - { - double eta1, eta2, phi1, phi2; - eta1 = candidate1.eta(); - eta2 = candidate2.eta(); - phi1 = candidate1.phi(); - phi2 = candidate2.phi(); + double deltaRDaugherPos = std::sqrt(TVector2::Phi_mpi_pi(v0.positivephi() - v0.negativephi()) * TVector2::Phi_mpi_pi(v0.positivephi() - v0.negativephi()) + (v0.positiveeta() - v0.negativeeta()) * (v0.positiveeta() - v0.negativeeta())); + double deltaRDaugherNeg = std::sqrt(TVector2::Phi_mpi_pi(v0.positivephi() - v0.negativephi()) * TVector2::Phi_mpi_pi(v0.positivephi() - v0.negativephi()) + (v0.positiveeta() - v0.negativeeta()) * (v0.positiveeta() - v0.negativeeta())); - double angle = std::sqrt(std::pow(eta1 - eta2, 2) + std::pow(phi1 - phi2, 2)); if (config.qAv0) { - rKzeroShort.fill(HIST("angularSeparation"), angle); + rKzeroShort.fill(HIST("hDauDeltaR"), deltaRDaugherPos, deltaRDaugherNeg); } - if (config.isapplyAngSepCut && angle > config.angSepCut) { + + if (deltaRDaugherPos < config.deltaRDaugherCut || deltaRDaugherNeg < config.deltaRDaugherCut) { return false; } + return true; } @@ -689,16 +793,17 @@ struct HigherMassResonances { Filter acceptenceFilter = (nabs(aod::track::eta) < config.cfgETAcut && nabs(aod::track::pt) > config.cfgPTcut); // Filters on V0s - Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > config.v0settingDcapostopv && nabs(aod::v0data::dcanegtopv) > config.v0settingDcanegtopv); + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > config.v0DCApostoPV && nabs(aod::v0data::dcanegtopv) > config.v0DCAnegtoPV); // Defining the type of the daughter tracks using EventCandidates = soa::Filtered>; using TrackCandidates = soa::Filtered>; using V0TrackCandidate = soa::Join; // For Monte Carlo - using EventCandidatesMC = soa::Join; + using EventCandidatesMC = soa::Join; using TrackCandidatesMC = soa::Filtered>; using V0TrackCandidatesMC = soa::Filtered>; + using EventMCGenerated = soa::Join; // zBeam direction in lab frame template @@ -953,34 +1058,6 @@ struct HigherMassResonances { continue; } - // if (postrack1.hasTOF()) { - // double nTOFSigmaPos1{postrack1.tofNSigmaPi()}; - // if ((std::abs(nTOFSigmaPos1) > config.confDaughPIDCutTOF)) { - // continue; - // } - // } - - // if (negtrack1.hasTOF()) { - // double nTOFSigmaNeg1{negtrack1.tofNSigmaPi()}; - // if (std::abs(nTOFSigmaNeg1) > config.confDaughPIDCutTOF) { - // continue; - // } - // } - - // if (postrack2.hasTOF()) { - // double nTOFSigmaPos2{postrack2.tofNSigmaPi()}; - // if ((std::abs(nTOFSigmaPos2) > config.confDaughPIDCutTOF)) { - // continue; - // } - // } - - // if (negtrack2.hasTOF()) { - // double nTOFSigmaNeg2{negtrack2.tofNSigmaPi()}; - // if (std::abs(nTOFSigmaNeg2) > config.confDaughPIDCutTOF) { - // continue; - // } - // } - if (std::find(v0indexes.begin(), v0indexes.end(), v1.globalIndex()) == v0indexes.end()) { v0indexes.push_back(v1.globalIndex()); } @@ -996,7 +1073,14 @@ struct HigherMassResonances { continue; } - if (!applyAngSep(v1, v2)) { + double deltaRDaugherPos = std::sqrt(TVector2::Phi_mpi_pi(postrack1.phi() - negtrack1.phi()) * TVector2::Phi_mpi_pi(postrack1.phi() - negtrack1.phi()) + (postrack1.eta() - negtrack1.eta()) * (postrack1.eta() - negtrack1.eta())); + double deltaRDaugherNeg = std::sqrt(TVector2::Phi_mpi_pi(postrack2.phi() - negtrack2.phi()) * TVector2::Phi_mpi_pi(postrack2.phi() - negtrack2.phi()) + (postrack2.eta() - negtrack2.eta()) * (postrack2.eta() - negtrack2.eta())); + + if (config.qAv0) { + rKzeroShort.fill(HIST("hDauDeltaR"), deltaRDaugherPos, deltaRDaugherNeg); + } + + if (deltaRDaugherPos < config.deltaRDaugherCut || deltaRDaugherNeg < config.deltaRDaugherCut) { continue; } @@ -1004,9 +1088,6 @@ struct HigherMassResonances { continue; } - if (config.qAv0) { - rKzeroShort.fill(HIST("hMasscorrelationbefore"), v1.mK0Short(), v2.mK0Short()); - } allConditionsMet = 1; daughter1 = ROOT::Math::PxPyPzMVector(v1.px(), v1.py(), v1.pz(), o2::constants::physics::MassK0Short); // Kshort daughter2 = ROOT::Math::PxPyPzMVector(v2.px(), v2.py(), v2.pz(), o2::constants::physics::MassK0Short); // Kshort @@ -1014,8 +1095,58 @@ struct HigherMassResonances { mother = daughter1 + daughter2; // invariant mass of Kshort pair isMix = false; - if (!config.isselectTWOKsOnly) + const double deltaMass = deltaM(v1.mK0Short(), v2.mK0Short()); + if (config.qAv0) { + rKzeroShort.fill(HIST("hK0ShortMassCorr"), v1.mK0Short(), v2.mK0Short(), deltaMass); + } + + if (!config.qAOptimisation) { + if (deltaMass > config.cMaxDeltaM) { + continue; + } + } + + // if (config.qAv0) { + // rKzeroShort.fill(HIST("hK0ShortMassCorrAfterCut"), v1.mK0Short(), v2.mK0Short()); + // } + + const double ptCorr = (mother.Pt() - daughter1.Pt() != 0.) ? daughter1.Pt() / (mother.Pt() - daughter1.Pt()) : 0.; + if (config.qAv0) { + rKzeroShort.fill(HIST("hK0sPtCorrelation"), ptCorr); + } + + double deltaRvalue = std::sqrt(TVector2::Phi_mpi_pi(v1.phi() - v2.phi()) * TVector2::Phi_mpi_pi(v1.phi() - v2.phi()) + (v1.eta() - v2.eta()) * (v1.eta() - v2.eta())); + + if (!config.qAOptimisation) { + if (deltaRvalue < config.deltaRK0sCut) { + continue; + } + } + + if (!config.isselectTWOKsOnly && !config.qAOptimisation) { fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); + } + + if (!config.isselectTWOKsOnly && config.qAOptimisation) { + + if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, mother.Pt(), mother.M(), deltaMass, deltaRvalue, ptCorr); + } + + for (int i = 0; i < config.cRotations; i++) { + double theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut); + + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + + // double pTcorrRot = std::abs(daughterRot.Pt() + daughter2.Pt()) / motherRot.Pt(); + double pTcorrRot = (motherRot.Pt() - daughterRot.Pt() != 0.) ? daughterRot.Pt() / (motherRot.Pt() - daughterRot.Pt()) : 0.; + + if (motherRot.Rapidity() < config.rapidityMotherData) + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), deltaMass, deltaRvalue, pTcorrRot); + } + } } int sizeofv0indexes = v0indexes.size(); rKzeroShort.fill(HIST("NksProduced"), sizeofv0indexes); @@ -1101,12 +1232,42 @@ struct HigherMassResonances { continue; } + double deltaRDaugherPos = std::sqrt(TVector2::Phi_mpi_pi(postrack1.phi() - negtrack1.phi()) * TVector2::Phi_mpi_pi(postrack1.phi() - negtrack1.phi()) + (postrack1.eta() - negtrack1.eta()) * (postrack1.eta() - negtrack1.eta())); + double deltaRDaugherNeg = std::sqrt(TVector2::Phi_mpi_pi(postrack2.phi() - negtrack2.phi()) * TVector2::Phi_mpi_pi(postrack2.phi() - negtrack2.phi()) + (postrack2.eta() - negtrack2.eta()) * (postrack2.eta() - negtrack2.eta())); + + if (deltaRDaugherPos < config.deltaRDaugherCut || deltaRDaugherNeg < config.deltaRDaugherCut) { + continue; + } + + if (config.isApplyEtaCutK0s && (t1.eta() < config.confDaughEta || t2.eta() < config.confDaughEta)) { + continue; + } + daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassK0Short); // Kshort daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), o2::constants::physics::MassK0Short); // Kshort mother = daughter1 + daughter2; // invariant mass of Kshort pair + const double deltaMass = deltaM(t1.mK0Short(), t2.mK0Short()); + + if (!config.qAOptimisation) { + if (deltaMass > config.cMaxDeltaM) { + continue; + } + } + isMix = true; - fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); + if (!config.qAOptimisation) + fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); + + if (config.qAOptimisation) { + double deltaRvalue = std::sqrt(TVector2::Phi_mpi_pi(daughter1.phi() - daughter2.phi()) * TVector2::Phi_mpi_pi(daughter1.phi() - daughter2.phi()) + (daughter1.eta() - daughter2.eta()) * (daughter1.eta() - daughter2.eta())); + const double deltaMass = deltaM(t1.mK0Short(), t2.mK0Short()); + // const double ptCorr = std::abs(daughter1.Pt() + daughter2.Pt()) / mother.Pt(); + const double ptCorr = (mother.Pt() - daughter1.Pt() != 0.) ? daughter1.Pt() / (mother.Pt() - daughter1.Pt()) : 0.; + if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { + hglue.fill(HIST("h3glueInvMassME"), multiplicity, mother.Pt(), mother.M(), deltaMass, deltaRvalue, ptCorr); + } + } } } }; @@ -1128,19 +1289,32 @@ struct HigherMassResonances { std::vector passKs; ROOT::Math::PxPyPzMVector lResonanceGen1; ROOT::Math::PxPyPzEVector lResonanceGen; + Service pdgDB; - void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) + // void processGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) + void processGen(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) { - if (config.isMC == false) { + // if (config.isMC == false) { + // return; + // } + hMChists.fill(HIST("events_check"), 0.5); + + bool isINELgt0true = false; + + if (pwglf::isINELgtNmc(mcParticles, 0, pdgDB)) { + isINELgt0true = true; + } + if (config.isINELgt0 && !isINELgt0true) { return; } - hMChists.fill(HIST("events_check"), 0.5); std::vector selectedEvents(collisions.size()); int nevts = 0; multiplicityGen = -999.0; for (const auto& collision : collisions) { + hMChists.fill(HIST("MCcorrections/hGenNo"), 0.5); + // multiplicityGen = collision.centFT0M(); if (config.cSelectMultEstimator == kFT0M) { multiplicityGen = collision.centFT0M(); @@ -1158,7 +1332,7 @@ struct HigherMassResonances { continue; } - selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); } selectedEvents.resize(nevts); hMChists.fill(HIST("events_check"), 1.5); @@ -1168,6 +1342,10 @@ struct HigherMassResonances { return; } hMChists.fill(HIST("events_check"), 2.5); + hMChists.fill(HIST("MCcorrections/hGenNo"), 1.5); + + double genMultiplicity = mcCollision.centFT0M(); + for (const auto& mcParticle : mcParticles) { if (std::abs(mcParticle.pdgCode()) != config.pdgCodes[config.selectMCparticles]) // f2(1525), f0(1710) @@ -1218,16 +1396,18 @@ struct HigherMassResonances { auto helicityGen1 = lResonanceGen1.Vect().Dot(fourVecDauCM1.Vect()) / (std::sqrt(fourVecDauCM1.Vect().Mag2()) * std::sqrt(lResonanceGen1.Vect().Mag2())); hMChists.fill(HIST("Genf1710"), multiplicityGen, lResonanceGen.pt(), helicityGen); + hMChists.fill(HIST("Genf1710Calib"), genMultiplicity, lResonanceGen.pt(), helicityGen); hMChists.fill(HIST("Genf1710_mass"), lResonanceGen.M()); hMChists.fill(HIST("GenRapidity"), mcParticle.y()); hMChists.fill(HIST("GenEta"), mcParticle.eta()); hMChists.fill(HIST("GenPhi"), mcParticle.phi()); - if (config.isapplyPairRapidityGen && std::abs(lResonanceGen1.Rapidity()) >= config.rapidityMotherData) { + if (config.isapplyPairRapidityMC && std::abs(lResonanceGen1.Rapidity()) >= config.rapidityMotherData) { continue; } hMChists.fill(HIST("Genf17102"), multiplicityGen, lResonanceGen1.pt(), helicityGen1); + hMChists.fill(HIST("Genf1710Calib2"), genMultiplicity, lResonanceGen1.pt(), helicityGen1); hMChists.fill(HIST("Genf1710_mass2"), lResonanceGen1.M()); hMChists.fill(HIST("GenRapidity2"), lResonanceGen1.Rapidity()); hMChists.fill(HIST("GenEta2"), lResonanceGen1.Eta()); @@ -1238,14 +1418,121 @@ struct HigherMassResonances { } PROCESS_SWITCH(HigherMassResonances, processGen, "Process Generated", false); + void processEvtLossSigLossMC(EventMCGenerated::iterator const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& recCollisions) + { + // auto multiplicityRec = -1; + bool isSelectedEvent = false; + auto multiplicity1 = -999.; + const int multMC = mcCollision.multMCNParticlesEta05(); + + for (const auto& RecCollision : recCollisions) { + if (!RecCollision.has_mcCollision()) + continue; + if (!selectionEvent(RecCollision, false)) // don't fill event cut histogram + continue; + + // const auto& mcCollisionRec = RecCollision.mcCollision_as(); + // multiplicityRec = mcCollisionRec.centFT0M(); + + if (config.cSelectMultEstimator == kFT0M) { + multiplicity1 = RecCollision.centFT0M(); + } else if (config.cSelectMultEstimator == kFT0A) { + multiplicity1 = RecCollision.centFT0A(); + } else if (config.cSelectMultEstimator == kFT0C) { + multiplicity1 = RecCollision.centFT0C(); + } else if (config.cSelectMultEstimator == kFV0A) { + multiplicity1 = RecCollision.centFV0A(); + } else { + multiplicity1 = RecCollision.centFT0M(); // default + } + + isSelectedEvent = true; + } + + bool isINELgt0true = false; + + if (pwglf::isINELgtNmc(mcParticles, 0, pdgDB)) { + isINELgt0true = true; + } + if (config.isINELgt0 && !isINELgt0true) { + return; + } + + if (std::abs(mcCollision.posZ()) > config.cutzvertex) { + return; + } + + auto multiplicityGen = -1; + multiplicityGen = mcCollision.centFT0M(); + hMChists.fill(HIST("MCcorrections/MultiplicityGen"), multiplicityGen); + hMChists.fill(HIST("MCcorrections/MultiplicityGen2"), multiplicity1); + hMChists.fill(HIST("MCcorrections/hMultvsCent"), multiplicity1, multMC); + + // Event loss + if (isSelectedEvent) { + hMChists.fill(HIST("MCcorrections/MultiplicityRec"), multiplicityGen); + hMChists.fill(HIST("MCcorrections/MultiplicityRec2"), multiplicity1); + } + + // Generated MC + for (const auto& mcPart : mcParticles) { + if (std::abs(mcPart.y()) >= config.rapidityMotherData || std::abs(mcPart.pdgCode()) != config.pdgCodes[config.selectMCparticles]) + continue; + + hMChists.fill(HIST("MCcorrections/hSignalLossDenominator"), mcPart.pt(), multiplicityGen); + hMChists.fill(HIST("MCcorrections/hSignalLossDenominator2"), mcPart.pt(), multiplicity1); + hMChists.fill(HIST("MCcorrections/hSignalLossDenominator3"), mcPart.pt(), multMC); + if (isSelectedEvent) { + hMChists.fill(HIST("MCcorrections/hSignalLossNumerator"), mcPart.pt(), multiplicityGen); + hMChists.fill(HIST("MCcorrections/hSignalLossNumerator2"), mcPart.pt(), multiplicity1); + hMChists.fill(HIST("MCcorrections/hSignalLossNumerator3"), mcPart.pt(), multMC); + } + + auto kDaughters = mcPart.daughters_as(); + if (kDaughters.size() != config.noOfDaughters) { + continue; + } + + for (const auto& kCurrentDaughter : kDaughters) { + // int daupdg = std::abs(kCurrentDaughter.pdgCode()); + + // if (!kCurrentDaughter.isPhysicalPrimary()) { + // continue; + // } + if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kK0Short) { + passKs.push_back(true); + if (passKs.size() == 1) { + daughter1 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassK0Short); + } else if (static_cast(passKs.size()) == config.noOfDaughters) { + daughter2 = ROOT::Math::PxPyPzMVector(kCurrentDaughter.px(), kCurrentDaughter.py(), kCurrentDaughter.pz(), o2::constants::physics::MassK0Short); + } + } + } + if (static_cast(passKs.size()) == config.noOfDaughters) { + lResonanceGen1 = daughter1 + daughter2; + hMChists.fill(HIST("MCcorrections/hSignalLossDenominator4"), lResonanceGen1.pt(), multiplicity1); + } + passKs.clear(); + } // end loop on gen particles + } + PROCESS_SWITCH(HigherMassResonances, processEvtLossSigLossMC, "Process Signal Loss, Event Loss", false); + int eventCounter = 0; std::vector gindex1, gindex2; - void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const&, V0TrackCandidatesMC const& V0s, aod::McParticles const&, aod::McCollisions const& /*mcCollisions*/) + void processRec(EventCandidatesMC::iterator const& collision, TrackCandidatesMC const&, V0TrackCandidatesMC const& V0s, aod::McParticles const&, EventMCGenerated const&) { - if (config.isMC == false) { + // if (config.isMC == false) { + // return; + // } + if (!collision.has_mcCollision()) { return; } + double multiplicityRec = -1.0; + // multiplicityRec = collision.mcCollision_as().centFT0M(); + const auto& mcCollisionRec = collision.mcCollision_as(); + multiplicityRec = mcCollisionRec.centFT0M(); + auto multiplicity = -999.0; if (config.cSelectMultEstimator == kFT0M) { multiplicity = collision.centFT0M(); @@ -1263,10 +1550,7 @@ struct HigherMassResonances { return; } hMChists.fill(HIST("Rec_Multiplicity"), multiplicity); - - if (!collision.has_mcCollision()) { - return; - } + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); hMChists.fill(HIST("MC_mult_after_event_sel"), multiplicity); eventCounter++; @@ -1394,16 +1678,23 @@ struct HigherMassResonances { auto helicityRec2 = mother1.Vect().Dot(fourVecDauCM1.Vect()) / (std::sqrt(fourVecDauCM1.Vect().Mag2()) * std::sqrt(mother1.Vect().Mag2())); + // const double deltaMassRec = deltaM(mctrackv01.mK0Short(), mctrackv02.mK0Short()); + // if (deltaMassRec > config.cMaxDeltaM) { + // continue; + // } + hMChists.fill(HIST("Recf1710_pt1"), multiplicity, mothertrack1.pt(), mother1.M(), helicityRec2); + hMChists.fill(HIST("Recf1710Calib_pt1"), multiplicityRec, mothertrack1.pt(), mother1.M(), helicityRec2); hMChists.fill(HIST("RecRapidity"), mothertrack1.y()); hMChists.fill(HIST("RecPhi"), mothertrack1.phi()); hMChists.fill(HIST("RecEta"), mothertrack1.eta()); - if (config.isapplyPairRapidityRec && std::abs(mother.Rapidity()) >= config.rapidityMotherData) { + if (config.isapplyPairRapidityMC && std::abs(mother.Rapidity()) >= config.rapidityMotherData) { continue; } hMChists.fill(HIST("Recf1710_pt2"), multiplicity, mother.Pt(), mother.M(), helicityRec); + hMChists.fill(HIST("Recf1710Calib_pt2"), multiplicityRec, mother.Pt(), mother.M(), helicityRec); hMChists.fill(HIST("RecRapidity2"), mother.Rapidity()); hMChists.fill(HIST("RecPhi2"), mother.Phi()); hMChists.fill(HIST("RecEta2"), mother.Eta()); @@ -1431,7 +1722,7 @@ struct HigherMassResonances { multiplicity = collision.centFT0M(); // default } - if (!selectionEvent(collision, true)) { + if (!selectionEventDerived(collision, true)) { return; } @@ -1468,13 +1759,6 @@ struct HigherMassResonances { continue; } - if (!applyAngSep(v1, v2)) { - continue; - } - - if (config.qAv0) { - rKzeroShort.fill(HIST("hMasscorrelationbefore"), v1.mK0Short(), v2.mK0Short()); - } allConditionsMet = 1; daughter1 = ROOT::Math::PxPyPzMVector(v1.px(), v1.py(), v1.pz(), o2::constants::physics::MassK0Short); // Kshort daughter2 = ROOT::Math::PxPyPzMVector(v2.px(), v2.py(), v2.pz(), o2::constants::physics::MassK0Short); // Kshort @@ -1482,8 +1766,53 @@ struct HigherMassResonances { mother = daughter1 + daughter2; // invariant mass of Kshort pair isMix = false; - if (!config.isselectTWOKsOnly) + const double deltaMass = deltaM(v1.mK0Short(), v2.mK0Short()); + if (config.qAv0) { + rKzeroShort.fill(HIST("hK0ShortMassCorr"), v1.mK0Short(), v2.mK0Short(), deltaMass); + } + + if (deltaMass > config.cMaxDeltaM) { + continue; + } + + // if (config.qAv0) { + // rKzeroShort.fill(HIST("hK0ShortMassCorrAfterCut"), v1.mK0Short(), v2.mK0Short()); + // } + + const double ptCorr = (mother.Pt() - daughter1.Pt() != 0.) ? daughter1.Pt() / (mother.Pt() - daughter1.Pt()) : 0.; + if (config.qAv0) { + rKzeroShort.fill(HIST("hK0sPtCorrelation"), ptCorr); + } + + double deltaRvalue = std::sqrt(TVector2::Phi_mpi_pi(v1.phi() - v2.phi()) * TVector2::Phi_mpi_pi(v1.phi() - v2.phi()) + (v1.eta() - v2.eta()) * (v1.eta() - v2.eta())); + + if (!config.qAOptimisation) { + if (deltaRvalue < config.deltaRK0sCut) { + continue; + } + } + + if (!config.isselectTWOKsOnly && !config.qAOptimisation) fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); + + if (!config.isselectTWOKsOnly && config.qAOptimisation) { + + if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { + hglue.fill(HIST("h3glueInvMassDS"), multiplicity, mother.Pt(), mother.M(), deltaMass, deltaRvalue, ptCorr); + } + + for (int i = 0; i < config.cRotations; i++) { + double theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / config.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / config.rotationalCut); + + daughterRot = ROOT::Math::PxPyPzMVector(daughter1.Px() * std::cos(theta2) - daughter1.Py() * std::sin(theta2), daughter1.Px() * std::sin(theta2) + daughter1.Py() * std::cos(theta2), daughter1.Pz(), daughter1.M()); + + motherRot = daughterRot + daughter2; + // double pTcorrRot = std::abs(daughterRot.Pt() + daughter2.Pt()) / motherRot.Pt(); + double pTcorrRot = (motherRot.Pt() - daughterRot.Pt() != 0.) ? daughterRot.Pt() / (motherRot.Pt() - daughterRot.Pt()) : 0.; + if (motherRot.Rapidity() < config.rapidityMotherData) + hglue.fill(HIST("h3glueInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), deltaMass, deltaRvalue, pTcorrRot); + } + } } int sizeofv0indexes = v0indexes.size(); rKzeroShort.fill(HIST("NksProduced"), sizeofv0indexes); @@ -1503,7 +1832,7 @@ struct HigherMassResonances { multiplicity = 0.0; multiplicity = c1.centFT0M(); - if (!selectionEvent(c1, false) || !selectionEvent(c2, false)) { + if (!selectionEventDerived(c1, false) || !selectionEventDerived(c2, false)) { continue; } @@ -1524,12 +1853,35 @@ struct HigherMassResonances { continue; } + if (config.isApplyEtaCutK0s && (t1.eta() < config.confDaughEta || t2.eta() < config.confDaughEta)) { + continue; + } + daughter1 = ROOT::Math::PxPyPzMVector(t1.px(), t1.py(), t1.pz(), o2::constants::physics::MassK0Short); // Kshort daughter2 = ROOT::Math::PxPyPzMVector(t2.px(), t2.py(), t2.pz(), o2::constants::physics::MassK0Short); // Kshort mother = daughter1 + daughter2; // invariant mass of Kshort pair + const double deltaMass = deltaM(t1.mK0Short(), t2.mK0Short()); + + if (!config.qAOptimisation) { + if (deltaMass > config.cMaxDeltaM) { + continue; + } + } + isMix = true; - fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); + if (!config.qAOptimisation) + fillInvMass(mother, multiplicity, daughter1, daughter2, isMix); + + if (config.qAOptimisation) { + double deltaRvalue = std::sqrt(TVector2::Phi_mpi_pi(daughter1.phi() - daughter2.phi()) * TVector2::Phi_mpi_pi(daughter1.phi() - daughter2.phi()) + (daughter1.eta() - daughter2.eta()) * (daughter1.eta() - daughter2.eta())); + const double deltaMass = deltaM(t1.mK0Short(), t2.mK0Short()); + // const double ptCorr = std::abs(daughter1.Pt() + daughter2.Pt()) / mother.Pt(); + const double ptCorr = (mother.Pt() - daughter1.Pt() != 0.) ? daughter1.Pt() / (mother.Pt() - daughter1.Pt()) : 0.; + if (std::abs(mother.Rapidity()) < config.rapidityMotherData) { + hglue.fill(HIST("h3glueInvMassME"), multiplicity, mother.Pt(), mother.M(), deltaMass, deltaRvalue, ptCorr); + } + } } } } From c4d35ed37363789c22cf69367e589e0b7d981ce3 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:45:50 +0200 Subject: [PATCH 14/22] Update strderivedGenQA --- PWGLF/Tasks/QC/strderivedGenQA.cxx | 38 +++++++++++++----------------- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/PWGLF/Tasks/QC/strderivedGenQA.cxx b/PWGLF/Tasks/QC/strderivedGenQA.cxx index 4760a4e9520..4d1c2878d26 100644 --- a/PWGLF/Tasks/QC/strderivedGenQA.cxx +++ b/PWGLF/Tasks/QC/strderivedGenQA.cxx @@ -24,32 +24,26 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include -#include -#include -#include -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include #include +#include #include #include From f05fb2a320c2f1765b856e6fdbeab6daaafc5e51 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:50:06 +0200 Subject: [PATCH 15/22] Update cascadeflow --- .../TableProducer/Strangeness/cascadeflow.cxx | 657 +++++++++++++++--- 1 file changed, 560 insertions(+), 97 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx index 2365a74dc4d..f5cac87074d 100644 --- a/PWGLF/TableProducer/Strangeness/cascadeflow.cxx +++ b/PWGLF/TableProducer/Strangeness/cascadeflow.cxx @@ -20,24 +20,42 @@ #include "PWGLF/DataModel/cascqaanalysis.h" #include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/Core/RecoDecay.h" #include "Tools/ML/MlResponse.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "TRandom3.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include #include #include #include @@ -56,6 +74,7 @@ using CollEventAndSpecPlane = soa::Join::iterator; using MCCollisionsStra = soa::Join; using V0Candidates = soa::Join; +using V0MCCandidates = soa::Join; using CascCandidates = soa::Join; using CascMCCandidates = soa::Join; @@ -96,6 +115,7 @@ const double AlphaLambda[2] = {0.747, -0.757}; // decay parameter of Lambda and std::shared_ptr hMassBeforeSelVsPt[nCharges]; std::shared_ptr hMassAfterSelVsPt[nCharges]; +std::shared_ptr hMassAfterSelVsPtTrue[nCharges]; } // namespace lambdav2 namespace cascade_flow_cuts_ml @@ -165,7 +185,9 @@ struct cascadeFlow { // Output filling criteria struct : ConfigurableGroup { + Configurable isFillNominalMass{"isFillNominalMass", 1, ""}; Configurable isFillTree{"isFillTree", 1, ""}; + Configurable isFillTreeFull{"isFillTreeFull", 0, ""}; Configurable isFillTHNXi{"isFillTHNXi", 1, ""}; Configurable isFillTHNXi_PzVsPsi{"isFillTHNXi_PzVsPsi", 1, ""}; Configurable isFillTHNOmega{"isFillTHNOmega", 1, ""}; @@ -175,6 +197,7 @@ struct cascadeFlow { Configurable isFillTHN_V2{"isFillTHN_V2", 1, ""}; Configurable isFillTHN_Pz{"isFillTHN_Pz", 1, ""}; Configurable isFillTHN_PzFromLambda{"isFillTHN_PzFromLambda", 1, ""}; + Configurable isFillTHN_PzFromLambdaWLambdaMass{"isFillTHN_PzFromLambdaWLambdaMass", 1, ""}; Configurable isFillTHN_Acc{"isFillTHN_Acc", 1, ""}; Configurable isFillTHN_AccFromLambdaVsCasc{"isFillTHN_AccFromLambdaVsCasc", 1, ""}; Configurable isFillTHN_AccFromLambdaVsLambda{"isFillTHN_AccFromLambdaVsLambda", 1, ""}; @@ -248,6 +271,8 @@ struct cascadeFlow { Configurable MaxXiMass{"MaxXiMass", 1.345, ""}; Configurable MinOmegaMass{"MinOmegaMass", 1.655, ""}; Configurable MaxOmegaMass{"MaxOmegaMass", 1.690, ""}; + Configurable CMRlowerLimitMassXi{"CMRlowerLimitMassXi", 999, "Lower limit of rejected Xi candidates"}; // for Omega identification + Configurable CMRupperLimitMassXi{"CMRupperLimitMassXi", -999., "Upper limit of rejected Xi candidates"}; // for Omega identification } CandidateConfigs; struct : ConfigurableGroup { @@ -267,6 +292,8 @@ struct cascadeFlow { Configurable rapidityLambda{"rapidityLambda", 0.5, "rapidityLambda"}; Configurable etaLambda{"etaLambda", 0.8, "etaLambda"}; Configurable dauTrackV0Eta{"dauTrackV0Eta", 0.8, "dauTrackV0Eta"}; + Configurable isPositiveEta{"isPositiveEta", 0, "isPositiveEta"}; + Configurable isNegativeEta{"isNegativeEta", 0, "isNegativeEta"}; } V0Configs; Configurable sideBandStart{"sideBandStart", 5, "Start of the sideband region in number of sigmas"}; @@ -275,26 +302,33 @@ struct cascadeFlow { Configurable doNTPCSigmaCut{"doNTPCSigmaCut", 1, "doNtpcSigmaCut"}; Configurable nsigmatpcPr{"nsigmatpcPr", 5, "nsigmatpcPr"}; Configurable nsigmatpcPi{"nsigmatpcPi", 5, "nsigmatpcPi"}; + Configurable nsigmatpcKa{"nsigmatpcKa", 100, "nsigmatpcKa"}; Configurable mintpccrrows{"mintpccrrows", 70, "mintpccrrows"}; Configurable isStoreTrueCascOnly{"isStoreTrueCascOnly", 1, ""}; Configurable etaCascMCGen{"etaCascMCGen", 0.8, "etaCascMCGen"}; Configurable yCascMCGen{"yCascMCGen", 0.5, "yCascMCGen"}; - Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable> modelPathsCCDBXi{"modelPathsCCDBXi", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; - Configurable> modelPathsCCDBOmega{"modelPathsCCDBOmega", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; - Configurable> onnxFileNamesXi{"onnxFileNamesXi", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable> onnxFileNamesOmega{"onnxFileNamesOmega", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", true, "Flag to enable or disable the loading of models from CCDB"}; - Configurable acceptancePathsCCDBXi{"acceptancePathsCCDBXi", "Users/c/chdemart/AcceptanceXi", "Paths of Xi acceptance on CCDB"}; - Configurable acceptancePathsCCDBOmega{"acceptancePathsCCDBOmega", "Users/c/chdemart/AcceptanceOmega", "Paths of Omega acceptance on CCDB"}; - Configurable acceptancePathsCCDBLambda{"acceptancePathsCCDBLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of Lambda acceptance on CCDB"}; - Configurable acceptancePathsCCDBPrimaryLambda{"acceptancePathsCCDBPrimaryLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of PrimaryLambda acceptance on CCDB"}; - Configurable acceptanceHistoNameCasc{"acceptanceHistoNameCasc", "histoCos2ThetaNoFit2D", "Histo name of acceptance on CCDB"}; - Configurable acceptanceHistoNameLambda{"acceptanceHistoNameLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; - Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; + struct : ConfigurableGroup { + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable> modelPathsCCDBXi{"modelPathsCCDBXi", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; + Configurable> modelPathsCCDBOmega{"modelPathsCCDBOmega", std::vector{"Users/c/chdemart/CascadesFlow"}, "Paths of models on CCDB"}; + Configurable> onnxFileNamesXi{"onnxFileNamesXi", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable> onnxFileNamesOmega{"onnxFileNamesOmega", std::vector{"model_onnx.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB"}; + Configurable loadModelsFromCCDB{"loadModelsFromCCDB", true, "Flag to enable or disable the loading of models from CCDB"}; + Configurable acceptancePathsCCDBXi{"acceptancePathsCCDBXi", "Users/c/chdemart/AcceptanceXi", "Paths of Xi acceptance on CCDB"}; + Configurable acceptancePathsCCDBOmega{"acceptancePathsCCDBOmega", "Users/c/chdemart/AcceptanceOmega", "Paths of Omega acceptance on CCDB"}; + Configurable acceptancePathsCCDBLambda{"acceptancePathsCCDBLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of Lambda acceptance on CCDB"}; + Configurable acceptancePathsCCDBPrimaryLambda{"acceptancePathsCCDBPrimaryLambda", "Users/c/chdemart/AcceptanceLambda", "Paths of PrimaryLambda acceptance on CCDB"}; + Configurable acceptanceHistoNameCasc{"acceptanceHistoNameCasc", "histoCos2ThetaNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable acceptanceHistoNameLambda{"acceptanceHistoNameLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable acceptanceHistoNamePrimaryLambda{"acceptanceHistoNamePrimaryLambda", "histoCos2ThetaLambdaFromCNoFit2D", "Histo name of acceptance on CCDB"}; + Configurable resoPaths{"resoPath", "Users/c/chdemart/Resolution/", "Paths of resolution"}; + Configurable resoHistoName{"resoHistoName", "hResoPerCentBinsV0A", "Histo name of resolution"}; + Configurable centWeightPaths{"centWeightPath", "Users/c/chdemart/CentralityWeight/", "Paths of centrality weight"}; + Configurable centWeightHistoName{"centWeightHistoName", "hCentWeight", "Histo name of centrality weight"}; + } ccdbConfigs; // ML inference Configurable isApplyML{"isApplyML", 1, "Flag to apply ML selections"}; @@ -305,6 +339,8 @@ struct cascadeFlow { // acceptance crrection Configurable applyAcceptanceCorrection{"applyAcceptanceCorrection", false, "apply acceptance correction"}; + Configurable applyResoCorrection{"applyResoCorrection", false, "apply resolution correction"}; + Configurable applyCentWeightCorrection{"applyCentWeightCorrection", false, "apply centrality weight correction"}; o2::ccdb::CcdbApi ccdbApi; Service ccdb; @@ -413,6 +449,8 @@ struct cascadeFlow { if (std::abs(posExtra.tpcNSigmaPi()) > nsigmatpcPi || std::abs(negExtra.tpcNSigmaPr()) > nsigmatpcPr) return false; } + if (std::abs(bachExtra.tpcNSigmaKa()) > nsigmatpcKa) + return false; } counter++; @@ -420,6 +458,20 @@ struct cascadeFlow { return false; counter++; + + double pTotPosExtra = std::sqrt(casc.pxpos() * casc.pxpos() + casc.pypos() * casc.pypos() + casc.pzpos() * casc.pzpos()); + double pTotNegExtra = std::sqrt(casc.pxneg() * casc.pxneg() + casc.pyneg() * casc.pyneg() + casc.pzneg() * casc.pzneg()); + double pTotBachExtra = std::sqrt(casc.pxbach() * casc.pxbach() + casc.pybach() * casc.pybach() + casc.pzbach() * casc.pzbach()); + if (casc.sign() < 0) { + histos.fill(HIST("hNsigmaTPCPi"), posExtra.tpcNSigmaPr(), pTotPosExtra); + histos.fill(HIST("hNsigmaTPCPr"), negExtra.tpcNSigmaPi(), pTotNegExtra); + } else if (casc.sign() > 0) { + histos.fill(HIST("hNsigmaTPCPi"), posExtra.tpcNSigmaPi(), pTotPosExtra); + histos.fill(HIST("hNsigmaTPCPr"), negExtra.tpcNSigmaPr(), pTotNegExtra); + } + histos.fill(HIST("hNsigmaTPCBachKa"), bachExtra.tpcNSigmaKa(), pTotBachExtra); + histos.fill(HIST("hNsigmaTPCBachPi"), bachExtra.tpcNSigmaPi(), pTotBachExtra); + return true; } @@ -437,10 +489,6 @@ struct cascadeFlow { return false; counter++; - - // eta daughters) - // if (abs(posExtra.eta()) > V0Configs.dauTrackV0Eta || abs(negExtra.y()) > V0Configs.dauTrackV0Eta) return false; - return true; } template @@ -481,6 +529,28 @@ struct cascadeFlow { return false; if (std::abs(v0.eta()) > V0Configs.etaLambda) return false; + Float_t posDauEta = RecoDecay::eta(std::array{v0.pxpos(), v0.pypos(), v0.pzpos()}); + Float_t negDauEta = RecoDecay::eta(std::array{v0.pxneg(), v0.pyneg(), v0.pzneg()}); + if (std::abs(posDauEta) > V0Configs.dauTrackV0Eta) + return false; + if (std::abs(negDauEta) > V0Configs.dauTrackV0Eta) + return false; + if (V0Configs.isPositiveEta) { // v0 and daughter tracks required to have positive eta + if (v0.pzpos() <= 0) + return false; + if (v0.pzneg() <= 0) + return false; + if (v0.eta() <= 0) + return false; + } + if (V0Configs.isNegativeEta) { + if (v0.pzpos() >= 0) + return false; + if (v0.pzneg() >= 0) + return false; + if (v0.eta() >= 0) + return false; + } return true; } @@ -575,13 +645,21 @@ struct cascadeFlow { TH2F* hAcceptanceLambda; TH2F* hAcceptancePrimaryLambda; + // objects to use for resolution correction + TH1F* hReso; + + // objects to use for centrality weight + TH1F* hCentWeight; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry histosMCGen{"histosMCGen", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; + HistogramRegistry histosMCReco{"histosMCReco", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; HistogramRegistry resolution{"resolution", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; // Tables to produce Produces trainingSample; Produces analysisSample; + Produces analysisTopoSample; Produces analysisLambdaSample; Configurable> parSigmaMass{ "parSigmaMass", @@ -620,13 +698,18 @@ struct cascadeFlow { pdgCode); } - template - void fillAnalysedTable(collision_t coll, bool hasEventPlane, bool hasSpectatorPlane, cascade_t casc, float v2CSP, float v2CEP, float v1SP_ZDCA, float v1SP_ZDCC, float PsiT0C, float BDTresponseXi, float BDTresponseOmega, int pdgCode) + template + void fillAnalysedTable(collision_t coll, bool hasEventPlane, bool hasSpectatorPlane, cascade_t casc, float v2CSP, float v2CEP, float v1SP_ZDCA, float v1SP_ZDCC, float PsiT0C, float BDTresponseXi, float BDTresponseOmega, int pdgCode, bachExtra_t bachExtra) { double masses[nParticles]{o2::constants::physics::MassXiMinus, o2::constants::physics::MassOmegaMinus}; ROOT::Math::PxPyPzMVector cascadeVector[nParticles], lambdaVector, protonVector; float cosThetaStarLambda[nParticles], cosThetaStarProton; - lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), o2::constants::physics::MassLambda); + + double massLambda = casc.mLambda(); + if (fillingConfigs.isFillNominalMass) + massLambda = o2::constants::physics::MassLambda; + + lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), massLambda); ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()}; if (casc.sign() > 0) { protonVector.SetCoordinates(casc.pxneg(), casc.pyneg(), casc.pzneg(), o2::constants::physics::MassProton); @@ -656,29 +739,66 @@ struct cascadeFlow { // bool isTVXinTRD = 0; // if (coll.alias_bit(kTVXinTRD)) isTVXinTRD = 1; - analysisSample(coll.centFT0C(), - isNoCollInTimeRangeStd, - isNoCollInRofStd, - hasEventPlane, - hasSpectatorPlane, - casc.sign(), - casc.pt(), - casc.eta(), - casc.phi(), - casc.mLambda(), - casc.mXi(), - casc.mOmega(), - v2CSP, - v2CEP, - v1SP_ZDCA, - v1SP_ZDCC, - PsiT0C, - BDTresponseXi, - BDTresponseOmega, - cosThetaStarLambda[0], - cosThetaStarLambda[1], - cosThetaStarProton, - pdgCode); + if (fillingConfigs.isFillTreeFull) { + analysisTopoSample(coll.centFT0C(), + hasEventPlane, + hasSpectatorPlane, + casc.sign(), + casc.pt(), + casc.eta(), + casc.phi(), + casc.mLambda(), + casc.mXi(), + casc.mOmega(), + casc.cascradius(), + casc.v0radius(), + casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()), + casc.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), + casc.dcapostopv(), + casc.dcanegtopv(), + casc.dcabachtopv(), + casc.dcacascdaughters(), + casc.dcaV0daughters(), + casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ()), + casc.bachBaryonCosPA(), + casc.bachBaryonDCAxyToPV(), + bachExtra.tpcNSigmaKa(), + v2CSP, + v2CEP, + v1SP_ZDCA, + v1SP_ZDCC, + PsiT0C, + BDTresponseXi, + BDTresponseOmega, + cosThetaStarLambda[0], + cosThetaStarLambda[1], + cosThetaStarProton, + pdgCode); + } else { + analysisSample(coll.centFT0C(), + isNoCollInTimeRangeStd, + isNoCollInRofStd, + hasEventPlane, + hasSpectatorPlane, + casc.sign(), + casc.pt(), + casc.eta(), + casc.phi(), + casc.mLambda(), + casc.mXi(), + casc.mOmega(), + v2CSP, + v2CEP, + v1SP_ZDCA, + v1SP_ZDCC, + PsiT0C, + BDTresponseXi, + BDTresponseOmega, + cosThetaStarLambda[0], + cosThetaStarLambda[1], + cosThetaStarProton, + pdgCode); + } } template @@ -714,41 +834,70 @@ struct cascadeFlow { void initAcceptanceFromCCDB() { LOG(info) << "Loading acceptance from CCDB "; - TList* listAcceptanceXi = ccdb->get(acceptancePathsCCDBXi); + TList* listAcceptanceXi = ccdb->get(ccdbConfigs.acceptancePathsCCDBXi); if (!listAcceptanceXi) LOG(fatal) << "Problem getting TList object with acceptance for Xi!"; - TList* listAcceptanceOmega = ccdb->get(acceptancePathsCCDBOmega); + TList* listAcceptanceOmega = ccdb->get(ccdbConfigs.acceptancePathsCCDBOmega); if (!listAcceptanceOmega) LOG(fatal) << "Problem getting TList object with acceptance for Omega!"; - TList* listAcceptanceLambda = ccdb->get(acceptancePathsCCDBLambda); + TList* listAcceptanceLambda = ccdb->get(ccdbConfigs.acceptancePathsCCDBLambda); if (!listAcceptanceLambda) LOG(fatal) << "Problem getting TList object with acceptance for Lambda!"; - TList* listAcceptancePrimaryLambda = ccdb->get(acceptancePathsCCDBPrimaryLambda); + TList* listAcceptancePrimaryLambda = ccdb->get(ccdbConfigs.acceptancePathsCCDBPrimaryLambda); if (!listAcceptancePrimaryLambda) LOG(fatal) << "Problem getting TList object with acceptance for Primary Lambda!"; - hAcceptanceXi = static_cast(listAcceptanceXi->FindObject(Form("%s", acceptanceHistoNameCasc->data()))); + hAcceptanceXi = static_cast(listAcceptanceXi->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameCasc->data()))); if (!hAcceptanceXi) { LOG(fatal) << "The histogram for Xi is not there!"; } hAcceptanceXi->SetName("hAcceptanceXi"); - hAcceptanceOmega = static_cast(listAcceptanceOmega->FindObject(Form("%s", acceptanceHistoNameCasc->data()))); + hAcceptanceOmega = static_cast(listAcceptanceOmega->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameCasc->data()))); if (!hAcceptanceOmega) { LOG(fatal) << "The histogram for omega is not there!"; } hAcceptanceOmega->SetName("hAcceptanceOmega"); - hAcceptanceLambda = static_cast(listAcceptanceLambda->FindObject(Form("%s", acceptanceHistoNameLambda->data()))); + hAcceptanceLambda = static_cast(listAcceptanceLambda->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNameLambda->data()))); if (!hAcceptanceLambda) { LOG(fatal) << "The histogram for Lambda is not there!"; } hAcceptanceLambda->SetName("hAcceptanceLambda"); - hAcceptancePrimaryLambda = static_cast(listAcceptancePrimaryLambda->FindObject(Form("%s", acceptanceHistoNamePrimaryLambda->data()))); + hAcceptancePrimaryLambda = static_cast(listAcceptancePrimaryLambda->FindObject(Form("%s", ccdbConfigs.acceptanceHistoNamePrimaryLambda->data()))); if (!hAcceptancePrimaryLambda) { LOG(fatal) << "The histogram for Primary Lambda is not there!"; } hAcceptancePrimaryLambda->SetName("hAcceptancePrimaryLambda"); LOG(info) << "Acceptance now loaded"; } + void initResoFromCCDB() + { + LOG(info) << "Loading resolution from CCDB "; + TList* listReso = ccdb->get(ccdbConfigs.resoPaths); + if (!listReso) + LOG(fatal) << "Problem getting TList object with resolution!"; + + hReso = static_cast(listReso->FindObject(Form("%s", ccdbConfigs.resoHistoName->data()))); + if (!hReso) { + LOG(fatal) << "The histogram for resolution is not there"; + } + hReso->SetName("hReso"); + LOG(info) << "Resolution now loaded"; + } + + void initCentWeightFromCCDB() + { + LOG(info) << "Loading resolution from CCDB "; + TList* listCentWeight = ccdb->get(ccdbConfigs.centWeightPaths); + if (!listCentWeight) + LOG(fatal) << "Problem getting TList object with resolution!"; + + hCentWeight = static_cast(listCentWeight->FindObject(Form("%s", ccdbConfigs.centWeightHistoName->data()))); + if (!hCentWeight) { + LOG(fatal) << "The histogram for resolution is not there"; + } + hCentWeight->SetName("hCentWeight"); + LOG(info) << "Centrality weight now loaded"; + } void init(InitContext const&) { @@ -759,6 +908,7 @@ struct cascadeFlow { float maxMassLambda[2]{1.14, 1.14}; const AxisSpec shiftAxis = {10, 0, 10, "shift"}; const AxisSpec basisAxis = {2, 0, 2, "basis"}; + const AxisSpec axisNTPC = {100, -10, 10}; const AxisSpec massCascAxis[2]{{static_cast((maxMass[0] - minMass[0]) / 0.001f), minMass[0], maxMass[0], "#Xi candidate mass (GeV/c^{2})"}, {static_cast((maxMass[1] - minMass[1]) / 0.001f), minMass[1], maxMass[1], "#Omega candidate mass (GeV/c^{2})"}}; const AxisSpec massLambdaAxis[2]{{static_cast((maxMassLambda[0] - minMassLambda[0]) / 0.001f), minMassLambda[0], maxMassLambda[0], "#Lambda candidate mass (GeV/c^{2})"}, @@ -771,6 +921,7 @@ struct cascadeFlow { TString hNEventsLabels[10] = {"All", "sel8", "z vrtx", "kNoSameBunchPileup", "kIsGoodZvtxFT0vsPV", "trackOccupancyInTimeRange", "kNoCollInTimeRange", "kNoCollInROF", "kTVXinTRD", "kIsGoodEventEP"}; TString hNEventsLabelsMC[6] = {"All", "z vtx", ">=1RecoColl", "1Reco", "2Reco", "EvSelected"}; TString hNCascLabelsMC[8] = {"All Xi", "all Omega", "Xi: has MC coll", "Om: has MC coll", "Xi: isPrimary", "Om: is Primary", "Xi: |eta|<0.8", "Om: |eta| < 0.8"}; + TString hNLambdaLabelsMC[5] = {"All Lambdas", "has MC coll", "isPrimary", "|eta|<0.8", "|y| < 0.5"}; resolution.add("QVectorsT0CTPCA", "QVectorsT0CTPCA", HistType::kTH2F, {axisQVs, CentAxisPerCent}); resolution.add("QVectorsT0CTPCC", "QVectorsT0CTPCC", HistType::kTH2F, {axisQVs, CentAxisPerCent}); @@ -816,6 +967,12 @@ struct cascadeFlow { histos.add("ShiftTPCL", "ShiftTPCL", kTProfile3D, {CentAxis, basisAxis, shiftAxis}); histos.add("ShiftTPCR", "ShiftTPCR", kTProfile3D, {CentAxis, basisAxis, shiftAxis}); + // PID TPC + histos.add("hNsigmaTPCBachPi", "hNsigmaTPCBachPi", HistType::kTH2F, {axisNTPC, {20, 0, 10}}); + histos.add("hNsigmaTPCBachKa", "hNsigmaTPCBachKa", HistType::kTH2F, {axisNTPC, {20, 0, 10}}); + histos.add("hNsigmaTPCPi", "hNsigmaTPCPi", HistType::kTH2F, {axisNTPC, {20, 0, 10}}); + histos.add("hNsigmaTPCPr", "hNsigmaTPCPr", HistType::kTH2F, {axisNTPC, {20, 0, 10}}); + histos.add("hNEvents", "hNEvents", {HistType::kTH1D, {{10, 0.f, 10.f}}}); for (Int_t n = 1; n <= histos.get(HIST("hNEvents"))->GetNbinsX(); n++) { histos.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(n, hNEventsLabels[n - 1]); @@ -834,6 +991,11 @@ struct cascadeFlow { histos.add("Psi_EP_FT0A_shifted", "Psi_EP_FT0C_shifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); histos.add("Psi_EP_TPCA_shifted", "Psi_EP_FT0C_shifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); histos.add("Psi_EP_TPCC_shifted", "Psi_EP_FT0C_shifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); + histos.add("Psi_EP_FT0C_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); + histos.add("Psi_EP_FV0A_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); + histos.add("Psi_EP_FT0A_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); + histos.add("Psi_EP_TPCA_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); + histos.add("Psi_EP_TPCC_notshifted", "Psi_EP_FT0C_notshifted", HistType::kTH2D, {CentAxis, {100, -o2::constants::math::PI, o2::constants::math::PI}}); histos.add("hPsiZDCA_vs_ZDCC", "hPsiZDCA_vs_ZDCC", HistType::kTH2D, {{100, -o2::constants::math::PI, o2::constants::math::PI}, {100, -o2::constants::math::PI, o2::constants::math::PI}}); histos.add("hEventNchCorrelation", "hEventNchCorrelation", kTH2F, {{5000, 0, 5000}, {5000, 0, 2500}}); histos.add("hEventPVcontributorsVsCentrality", "hEventPVcontributorsVsCentrality", kTH2F, {{100, 0, 100}, {5000, 0, 5000}}); @@ -867,6 +1029,10 @@ struct cascadeFlow { histos.add("hv2CEPvsv2CSP", "hv2CEPvsV2CSP", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); histos.add("hv1EPvsv1SP", "hV1EPvsV1SP", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); histos.add("hv1SP_ZDCA_vs_ZDCC", "hv1SP_ZDCA_vs_ZDCC", HistType::kTH2F, {{100, -1, 1}, {100, -1, 1}}); + histos.add("hV0RapidityvsPt", "hV0RapidityvsPt", HistType::kTH2F, {{100, 0, 10}, {100, -2, 2}}); + histos.add("hEtaV0", "hEtaV0", HistType::kTH1F, {{100, -1, 1}}); + histos.add("hEtaV0posDau", "hEtaV0posDau", HistType::kTH1F, {{100, -1, 1}}); + histos.add("hEtaV0negDau", "hEtaV0negDau", HistType::kTH1F, {{100, -1, 1}}); const AxisSpec thnAxisFT0C{thnAxisConfigs.thnConfigAxisFT0C, "FT0C (%)"}; const AxisSpec thnAxisEta{thnAxisConfigs.thnConfigAxisEta, "#eta"}; @@ -888,6 +1054,8 @@ struct cascadeFlow { const AxisSpec thnAxisCosThetaOmegaAlpha{thnAxisConfigs.thnConfigAxisCosThetaOmegaAlpha, "CosThetaOmegaWithAlpha"}; const AxisSpec thnAxisCosThetaProtonAlpha{thnAxisConfigs.thnConfigAxisCosThetaProtonAlpha, "CosThetaProtonWithAlpha"}; + histos.add("hCentvsPtvsPrimaryFracLambda", "hCentvsPtvsPrimaryFracLambda", HistType::kTH3F, {{100, 0, 100}, thnAxisPtLambda, {4, -0.5, 3.5}}); + histos.add("hCentvsPrimaryFracLambda", "hCentvsPrimaryFracLambda", HistType::kTH2F, {{100, 0, 100}, {4, -0.5, 3.5}}); histos.add("massXi_ProtonAcc", "massXi", HistType::kTH1F, {thnAxisMassXi}); histos.add("massOmega_ProtonAcc", "massOmega", HistType::kTH1F, {thnAxisMassOmega}); @@ -898,6 +1066,8 @@ struct cascadeFlow { histos.add("hXiPzs2", "THn for Pzs2 of Xi", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassXi, thnAxisBDTScore, thnAxisPzs2Xi}); if (fillingConfigs.isFillTHN_PzFromLambda) histos.add("hXiPzs2FromLambda", "THn for Pzs2 of Xi", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassXi, thnAxisBDTScore, thnAxisPzs2Lambda}); + if (fillingConfigs.isFillTHN_PzFromLambdaWLambdaMass) + histos.add("hXiPzs2FromLambdaWLambdaMass", "THn for Pzs2 of Xi", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassXi, thnAxisMassLambda, thnAxisBDTScore, thnAxisPzs2Lambda}); if (fillingConfigs.isFillTHN_Acc) histos.add("hXiCos2Theta", "THn for Cos2Theta of Xi", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPt, thnAxisMassXi, thnAxisBDTScore, thnAxisCos2Theta}); if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) @@ -924,6 +1094,8 @@ struct cascadeFlow { histos.add("hOmegaPzs2", "THn for Pzs2 of Omega", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassOmega, thnAxisBDTScore, thnAxisPzs2Omega}); if (fillingConfigs.isFillTHN_PzFromLambda) histos.add("hOmegaPzs2FromLambda", "THn for Pzs2 of Omega", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassOmega, thnAxisBDTScore, thnAxisPzs2Lambda}); + if (fillingConfigs.isFillTHN_PzFromLambdaWLambdaMass) + histos.add("hOmegaPzs2FromLambdaWLambdaMass", "THn for Pzs2 of Omega", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisPt, thnAxisMassOmega, thnAxisMassLambda, thnAxisBDTScore, thnAxisPzs2Lambda}); if (fillingConfigs.isFillTHN_Acc) histos.add("hOmegaCos2Theta", "THn for Cos2Theta of Omega", HistType::kTHnF, {thnAxisFT0C, thnAxisCharge, thnAxisEta, thnAxisPt, thnAxisMassOmega, thnAxisBDTScore, thnAxisCos2Theta}); if (fillingConfigs.isFillTHN_AccFromLambdaVsCasc) @@ -962,8 +1134,14 @@ struct cascadeFlow { histosMCGen.add("h2DGenOmegaEta08", "h2DGenOmegaEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histosMCGen.add("h2DGenXiY05", "h2DGenXiY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histosMCGen.add("h2DGenOmegaY05", "h2DGenOmegaY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histosMCGen.add("h2DGenLambdaEta08", "h2DGenLambdaEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histosMCGen.add("h2DGenLambdaY05", "h2DGenLambdaY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histosMCGen.add("h2DGenAntiLambdaEta08", "h2DGenAntiLambdaEta08", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histosMCGen.add("h2DGenAntiLambdaY05", "h2DGenAntiLambdaY05", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); histosMCGen.add("hGenXiY", "hGenXiY", HistType::kTH1F, {{100, -1, 1}}); histosMCGen.add("hGenOmegaY", "hGenOmegaY", HistType::kTH1F, {{100, -1, 1}}); + histosMCGen.add("hGenLambdaY", "hGenLambdaY", HistType::kTH1F, {{100, -2, 2}}); + histosMCGen.add("hGenLambdaEta", "hGenLambdaEta", HistType::kTH1F, {{100, -2, 2}}); histosMCGen.add("hZvertexGen", "hZvertexGen", HistType::kTH1F, {{100, -20, 20}}); histosMCGen.add("hNEventsMC", "hNEventsMC", {HistType::kTH1F, {{6, 0.f, 6.f}}}); for (Int_t n = 1; n <= histosMCGen.get(HIST("hNEventsMC"))->GetNbinsX(); n++) { @@ -973,6 +1151,13 @@ struct cascadeFlow { for (Int_t n = 1; n <= histosMCGen.get(HIST("hNCascGen"))->GetNbinsX(); n++) { histosMCGen.get(HIST("hNCascGen"))->GetXaxis()->SetBinLabel(n, hNCascLabelsMC[n - 1]); } + histosMCGen.add("hNLambdaGen", "hNLambdaGen", {HistType::kTH1F, {{5, 0.f, 5.f}}}); + for (Int_t n = 1; n <= histosMCGen.get(HIST("hNLambdaGen"))->GetNbinsX(); n++) { + histosMCGen.get(HIST("hNLambdaGen"))->GetXaxis()->SetBinLabel(n, hNLambdaLabelsMC[n - 1]); + } + + histosMCReco.add("h2DRecoTrueLambda", "h2DRecoTrueLambda", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); + histosMCReco.add("h2DRecoTrueAntiLambda", "h2DRecoTrueAntiLambda", HistType::kTH2F, {{100, 0, 100}, {400, 0, 20}}); for (int iS{0}; iS < nParticles; ++iS) { cascadev2::hMassBeforeSelVsPt[iS] = histos.add(Form("hMassBeforeSelVsPt%s", cascadev2::speciesNames[iS].data()), "hMassBeforeSelVsPt", HistType::kTH2F, {massCascAxis[iS], ptAxisCasc}); @@ -986,6 +1171,7 @@ struct cascadeFlow { for (int iS{0}; iS < nCharges; ++iS) { lambdav2::hMassBeforeSelVsPt[iS] = histos.add(Form("hMassBeforeSelVsPt%s", lambdav2::speciesNames[iS].data()), "hMassBeforeSelVsPt", HistType::kTH2F, {massLambdaAxis[iS], ptAxisLambda}); lambdav2::hMassAfterSelVsPt[iS] = histos.add(Form("hMassAfterSelVsPt%s", lambdav2::speciesNames[iS].data()), "hMassAfterSelVsPt", HistType::kTH2F, {massLambdaAxis[iS], ptAxisLambda}); + lambdav2::hMassAfterSelVsPtTrue[iS] = histos.add(Form("hMassAfterSelVsPtTrue%s", lambdav2::speciesNames[iS].data()), "hMassAfterSelVsPtTrue", HistType::kTH2F, {massLambdaAxis[iS], ptAxisLambda}); } if (isApplyML) { @@ -993,24 +1179,38 @@ struct cascadeFlow { mlResponseXi.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); mlResponseOmega.configure(binsPtMl, cutsMl, cutDirMl, nClassesMl); // Bonus: retrieve the model from CCDB (needed for ML application on the GRID) - if (loadModelsFromCCDB) { - ccdbApi.init(ccdbUrl); - mlResponseXi.setModelPathsCCDB(onnxFileNamesXi, ccdbApi, modelPathsCCDBXi, timestampCCDB); - mlResponseOmega.setModelPathsCCDB(onnxFileNamesOmega, ccdbApi, modelPathsCCDBOmega, timestampCCDB); // TODO: use different model for Xi and Omega + if (ccdbConfigs.loadModelsFromCCDB) { + ccdbApi.init(ccdbConfigs.ccdbUrl); + mlResponseXi.setModelPathsCCDB(ccdbConfigs.onnxFileNamesXi, ccdbApi, ccdbConfigs.modelPathsCCDBXi, ccdbConfigs.timestampCCDB); + mlResponseOmega.setModelPathsCCDB(ccdbConfigs.onnxFileNamesOmega, ccdbApi, ccdbConfigs.modelPathsCCDBOmega, ccdbConfigs.timestampCCDB); // TODO: use different model for Xi and Omega } else { - mlResponseXi.setModelPathsLocal(onnxFileNamesXi); - mlResponseOmega.setModelPathsLocal(onnxFileNamesOmega); + mlResponseXi.setModelPathsLocal(ccdbConfigs.onnxFileNamesXi); + mlResponseOmega.setModelPathsLocal(ccdbConfigs.onnxFileNamesOmega); } mlResponseXi.init(); mlResponseOmega.init(); } if (applyAcceptanceCorrection) { - ccdb->setURL(ccdbUrl); + ccdb->setURL(ccdbConfigs.ccdbUrl); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); initAcceptanceFromCCDB(); } + if (applyResoCorrection) { + ccdb->setURL(ccdbConfigs.ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + initResoFromCCDB(); + } + if (applyCentWeightCorrection) { + ccdb->setURL(ccdbConfigs.ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setFatalWhenNull(false); + initCentWeightFromCCDB(); + } } void processTrainingBackground(soa::Join::iterator const& coll, soa::Join const& Cascades, DauTracks const&) @@ -1055,6 +1255,9 @@ struct cascadeFlow { continue; histos.fill(HIST("hCandidate"), ++counter); } + if (std::abs(bachExtra.tpcNSigmaKa()) > nsigmatpcKa) + continue; + histos.fill(HIST("hCandidate"), ++counter); } else { ++counter; } @@ -1140,6 +1343,9 @@ struct cascadeFlow { const float psiTPCA = std::atan2(coll.qvecBPosIm(), coll.qvecBPosRe()) * 0.5f; const float psiTPCC = std::atan2(coll.qvecBNegIm(), coll.qvecBNegRe()) * 0.5f; float psiT0CCorr = psiT0C; + histos.fill(HIST("Psi_EP_FT0C_notshifted"), coll.centFT0C(), psiT0C); + histos.fill(HIST("Psi_EP_TPCA_notshifted"), coll.centFT0C(), psiTPCA); + histos.fill(HIST("Psi_EP_TPCC_notshifted"), coll.centFT0C(), psiTPCC); for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), coll.centFT0C(), 0.5, ishift - 0.5, std::sin(ishift * 2 * psiT0C)); @@ -1173,7 +1379,6 @@ struct cascadeFlow { histos.fill(HIST("hPsiT0C"), psiT0CCorr); histos.fill(HIST("hPsiZDCA_vs_ZDCC"), coll.psiZDCC(), coll.psiZDCA()); histos.fill(HIST("hPsiT0CvsCentFT0C"), coll.centFT0C(), psiT0CCorr); - resolution.fill(HIST("QVectorsT0CTPCA"), eventplaneVecT0C.Dot(eventplaneVecTPCA), coll.centFT0C()); resolution.fill(HIST("QVectorsT0CTPCC"), eventplaneVecT0C.Dot(eventplaneVecTPCC), coll.centFT0C()); resolution.fill(HIST("QVectorsTPCAC"), eventplaneVecTPCA.Dot(eventplaneVecTPCC), coll.centFT0C()); @@ -1227,6 +1432,11 @@ struct cascadeFlow { cascadev2::hMassBeforeSelVsPt[0]->Fill(massCasc[0], casc.pt()); cascadev2::hMassBeforeSelVsPt[1]->Fill(massCasc[1], casc.pt()); + // competing mass rejection cut applied for Omegas + if (casc.mXi() > CandidateConfigs.CMRlowerLimitMassXi && casc.mXi() < CandidateConfigs.CMRupperLimitMassXi) { + continue; + } + if (isApplyML) { // Retrieve model output and selection outcome isSelectedCasc[0] = mlResponseXi.isSelectedMl(inputFeaturesCasc, casc.pt(), bdtScore[0]); @@ -1241,13 +1451,17 @@ struct cascadeFlow { if (isSelectedCasc[iS]) { cascadev2::hSignalScoreAfterSel[iS]->Fill(bdtScore[0][1]); cascadev2::hBkgScoreAfterSel[iS]->Fill(bdtScore[1][0]); - cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); } } } else { isSelectedCasc[0] = true; isSelectedCasc[1] = true; } + for (int iS{0}; iS < nParticles; ++iS) { + if (isSelectedCasc[iS]) { + cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); + } + } ROOT::Math::XYZVector cascQvec{std::cos(2 * casc.phi()), std::sin(2 * casc.phi()), 0}; auto v2CSP = cascQvec.Dot(eventplaneVecT0C); // not normalised by amplitude @@ -1265,7 +1479,12 @@ struct cascadeFlow { double masses[2]{o2::constants::physics::MassXiMinus, o2::constants::physics::MassOmegaMinus}; ROOT::Math::PxPyPzMVector cascadeVector[2], lambdaVector, protonVector; float cosThetaStarLambda[2], cosThetaStarProton; - lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), o2::constants::physics::MassLambda); + + double massLambda = casc.mLambda(); + if (fillingConfigs.isFillNominalMass) + massLambda = o2::constants::physics::MassLambda; + + lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), massLambda); ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()}; if (casc.sign() > 0) { protonVector.SetCoordinates(casc.pxneg(), casc.pyneg(), casc.pzneg(), o2::constants::physics::MassProton); @@ -1417,7 +1636,7 @@ struct cascadeFlow { if (isSelectedCasc[0] || isSelectedCasc[1]) { if (fillingConfigs.isFillTree) - fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0); + fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0, bachExtra); } } } @@ -1456,6 +1675,9 @@ struct cascadeFlow { const float psiT0C = std::atan2(coll.qvecFT0CIm(), coll.qvecFT0CRe()) * 0.5f; const float psiTPCA = std::atan2(coll.qvecBPosIm(), coll.qvecBPosRe()) * 0.5f; const float psiTPCC = std::atan2(coll.qvecBNegIm(), coll.qvecBNegRe()) * 0.5f; + histos.fill(HIST("Psi_EP_FT0C_notshifted"), coll.centFT0C(), psiT0C); + histos.fill(HIST("Psi_EP_TPCA_notshifted"), coll.centFT0C(), psiTPCA); + histos.fill(HIST("Psi_EP_TPCC_notshifted"), coll.centFT0C(), psiTPCC); float psiT0CCorr = psiT0C; for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), coll.centFT0C(), 0.5, ishift - 0.5, std::sin(ishift * 2 * psiT0C)); @@ -1541,6 +1763,11 @@ struct cascadeFlow { cascadev2::hMassBeforeSelVsPt[0]->Fill(massCasc[0], casc.pt()); cascadev2::hMassBeforeSelVsPt[1]->Fill(massCasc[1], casc.pt()); + // competing mass rejection cut applied for Omegas + if (casc.mXi() > CandidateConfigs.CMRlowerLimitMassXi && casc.mXi() < CandidateConfigs.CMRupperLimitMassXi) { + continue; + } + if (isApplyML) { // Retrieve model output and selection outcome isSelectedCasc[0] = mlResponseXi.isSelectedMl(inputFeaturesCasc, casc.pt(), bdtScore[0]); @@ -1555,13 +1782,17 @@ struct cascadeFlow { if (isSelectedCasc[iS]) { cascadev2::hSignalScoreAfterSel[iS]->Fill(bdtScore[0][1]); cascadev2::hBkgScoreAfterSel[iS]->Fill(bdtScore[1][0]); - cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); } } } else { isSelectedCasc[0] = true; isSelectedCasc[1] = true; } + for (int iS{0}; iS < nParticles; ++iS) { + if (isSelectedCasc[iS]) { + cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); + } + } ROOT::Math::XYZVector cascQvec{std::cos(2 * casc.phi()), std::sin(2 * casc.phi()), 0}; auto v2CSP = cascQvec.Dot(eventplaneVecT0C); // not normalised by amplitude @@ -1573,7 +1804,12 @@ struct cascadeFlow { double masses[nParticles]{o2::constants::physics::MassXiMinus, o2::constants::physics::MassOmegaMinus}; ROOT::Math::PxPyPzMVector cascadeVector[nParticles], lambdaVector, protonVector; float cosThetaStarLambda[nParticles], cosThetaStarProton; - lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), o2::constants::physics::MassLambda); + + double massLambda = casc.mLambda(); + if (fillingConfigs.isFillNominalMass) + massLambda = o2::constants::physics::MassLambda; + + lambdaVector.SetCoordinates(casc.pxlambda(), casc.pylambda(), casc.pzlambda(), massLambda); ROOT::Math::Boost lambdaBoost{lambdaVector.BoostToCM()}; if (casc.sign() > 0) { protonVector.SetCoordinates(casc.pxneg(), casc.pyneg(), casc.pzneg(), o2::constants::physics::MassProton); @@ -1652,6 +1888,10 @@ struct cascadeFlow { histos.get(HIST("hXiV2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], v2CEP); if (fillingConfigs.isFillTHN_Pz) histos.get(HIST("hXiPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], pzs2Xi); + if (casc.mXi() > CandidateConfigs.MinXiMass && casc.mXi() < CandidateConfigs.MaxXiMass) { + if (fillingConfigs.isFillTHN_PzFromLambdaWLambdaMass) + histos.get(HIST("hXiPzs2FromLambdaWLambdaMass"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), casc.mLambda(), BDTresponse[0], pzs2LambdaFromCasc); + } if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_PzFromLambda) histos.get(HIST("hXiPzs2FromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], pzs2LambdaFromCasc); @@ -1688,6 +1928,10 @@ struct cascadeFlow { histos.get(HIST("hOmegaV2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], v2CEP); if (fillingConfigs.isFillTHN_Pz) histos.get(HIST("hOmegaPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], pzs2Omega); + if (casc.mOmega() > CandidateConfigs.MinOmegaMass && casc.mOmega() < CandidateConfigs.MaxOmegaMass) { + if (fillingConfigs.isFillTHN_PzFromLambdaWLambdaMass) + histos.get(HIST("hOmegaPzs2FromLambdaWLambdaMass"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), casc.mLambda(), BDTresponse[1], pzs2LambdaFromCasc); + } if (casc.mLambda() > CandidateConfigs.MinLambdaMass && casc.mLambda() < CandidateConfigs.MaxLambdaMass) { if (fillingConfigs.isFillTHN_PzFromLambda) histos.get(HIST("hOmegaPzs2FromLambda"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], pzs2LambdaFromCasc); @@ -1723,7 +1967,7 @@ struct cascadeFlow { if (isSelectedCasc[0] || isSelectedCasc[1]) { if (fillingConfigs.isFillTree) - fillAnalysedTable(coll, hasEventPlane, 0, casc, v2CSP, v2CEP, 0, 0, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0); + fillAnalysedTable(coll, hasEventPlane, 0, casc, v2CSP, v2CEP, 0, 0, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0, bachExtra); } } } @@ -1799,6 +2043,11 @@ struct cascadeFlow { const float psiT0A = std::atan2(qvecImT0A, qvecReT0A) * 0.5f; const float psiTPCA = std::atan2(coll.qvecBPosIm(), coll.qvecBPosRe()) * 0.5f; const float psiTPCC = std::atan2(coll.qvecBNegIm(), coll.qvecBNegRe()) * 0.5f; + histos.fill(HIST("Psi_EP_FT0C_notshifted"), coll.centFT0C(), psiT0C); + histos.fill(HIST("Psi_EP_FV0A_notshifted"), coll.centFT0C(), psiV0A); + histos.fill(HIST("Psi_EP_FT0A_notshifted"), coll.centFT0C(), psiT0A); + histos.fill(HIST("Psi_EP_TPCA_notshifted"), coll.centFT0C(), psiTPCA); + histos.fill(HIST("Psi_EP_TPCC_notshifted"), coll.centFT0C(), psiTPCC); float psiT0CCorr = psiT0C; for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), collisionCentrality, 0.5, ishift - 0.5, std::sin(ishift * 2 * psiT0C)); @@ -1872,6 +2121,17 @@ struct cascadeFlow { resolution.fill(HIST("QVectorsNormT0ATPCC"), eventplaneVecT0A.Dot(eventplaneVecTPCC) / (coll.qTPCL() * coll.sumAmplFT0A()), collisionCentrality); resolution.fill(HIST("QVectorsNormT0ATPCA"), eventplaneVecT0A.Dot(eventplaneVecTPCA) / (coll.qTPCR() * coll.sumAmplFT0A()), collisionCentrality); + double EPresolution = 1; + if (applyResoCorrection) { + int centBin = hReso->FindBin(collisionCentrality); + EPresolution = hReso->GetBinContent(centBin); + } + double centWeight = 1; + if (applyCentWeightCorrection) { + int centBin = hCentWeight->FindBin(collisionCentrality); + centWeight = hCentWeight->GetBinContent(centBin); + } + std::vector bdtScore[nParticles]; for (auto const& v0 : V0s) { @@ -1932,6 +2192,12 @@ struct cascadeFlow { if (!isSelectedV0[0] && !isSelectedV0[1]) continue; + histos.fill(HIST("hV0RapidityvsPt"), v0.pt(), v0.yLambda()); + histos.fill(HIST("hEtaV0"), v0.eta()); + Float_t posDauEta = RecoDecay::eta(std::array{v0.pxpos(), v0.pypos(), v0.pzpos()}); + histos.fill(HIST("hEtaV0posDau"), posDauEta); + Float_t negDauEta = RecoDecay::eta(std::array{v0.pxneg(), v0.pyneg(), v0.pzneg()}); + histos.fill(HIST("hEtaV0negDau"), negDauEta); ROOT::Math::XYZVector lambdaQvec{std::cos(2 * v0.phi()), std::sin(2 * v0.phi()), 0}; auto v2CSP = lambdaQvec.Dot(eventplaneVecT0C); // not normalised by amplitude auto lambdaminuspsiT0C = GetPhiInRange(v0.phi() - psiT0CCorr); @@ -1939,7 +2205,10 @@ struct cascadeFlow { ROOT::Math::XYZVector lambdaUvec{std::cos(v0.phi()), std::sin(v0.phi()), 0}; // polarization variables - double massLambda = o2::constants::physics::MassLambda; + double massLambda = v0.mLambda(); + if (fillingConfigs.isFillNominalMass) + massLambda = o2::constants::physics::MassLambda; + float cosThetaStarProton[nCharges]; ROOT::Math::PxPyPzMVector lambdaVector, protonVector[nCharges]; lambdaVector.SetCoordinates(v0.px(), v0.py(), v0.pz(), massLambda); @@ -1956,7 +2225,7 @@ struct cascadeFlow { // acceptance values if requested double meanCos2ThetaProtonFromLambda = 1; if (applyAcceptanceCorrection) { - int bin2DLambda = hAcceptanceLambda->FindBin(v0.pt(), v0.eta()); + int bin2DLambda = hAcceptancePrimaryLambda->FindBin(v0.pt(), v0.eta()); meanCos2ThetaProtonFromLambda = hAcceptancePrimaryLambda->GetBinContent(bin2DLambda); } @@ -1964,17 +2233,17 @@ struct cascadeFlow { double cos2ThetaLambda = 0; double cosThetaLambda = 0; if (chargeIndex == 0) { - pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; } else if (chargeIndex == 1) { - pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + pzs2Lambda = cosThetaStarProton[1] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda / EPresolution; cos2ThetaLambda = cosThetaStarProton[1] * cosThetaStarProton[1]; - cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda; + cosThetaLambda = cosThetaStarProton[1] / cascadev2::AlphaLambda[1] / meanCos2ThetaProtonFromLambda / EPresolution; } else { // I treat these bkg candidates as Lambdas for the purpose of calculating Pz - pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + pzs2Lambda = cosThetaStarProton[0] * std::sin(2 * (v0.phi() - psiT0CCorr)) / lambdav2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; cos2ThetaLambda = cosThetaStarProton[0] * cosThetaStarProton[0]; - cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda; + cosThetaLambda = cosThetaStarProton[0] / cascadev2::AlphaLambda[0] / meanCos2ThetaProtonFromLambda / EPresolution; } histos.fill(HIST("hv2CEPvsFT0C"), collisionCentrality, v2CEP); @@ -1986,14 +2255,15 @@ struct cascadeFlow { if (fillingConfigs.isFillTHN_V2) histos.get(HIST("hLambdaV2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), v2CEP); if (fillingConfigs.isFillTHN_Pz) { - histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); + // histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda); + histos.get(HIST("hLambdaPzs2"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), pzs2Lambda, centWeight); } if (fillingConfigs.isFillTHN_Acc) histos.get(HIST("hLambdaCos2Theta"))->Fill(collisionCentrality, chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda); } if (fillingConfigs.isFillTHNLambda_PzVsPsi) { if (fillingConfigs.isFillTHN_Pz) - histos.get(HIST("hLambdaPzVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C); + histos.get(HIST("hLambdaPzVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.pt(), v0.mLambda(), cosThetaLambda, 2 * lambdaminuspsiT0C, centWeight); if (fillingConfigs.isFillTHN_Acc) histos.get(HIST("hLambdaCos2ThetaVsPsi"))->Fill(collisionCentrality, chargeIndex, v0.eta(), v0.pt(), v0.mLambda(), cos2ThetaLambda, 2 * lambdaminuspsiT0C); } @@ -2060,6 +2330,9 @@ struct cascadeFlow { const float psiT0C = std::atan2(coll.qvecFT0CIm(), coll.qvecFT0CRe()) * 0.5f; const float psiTPCA = std::atan2(coll.qvecBPosIm(), coll.qvecBPosRe()) * 0.5f; const float psiTPCC = std::atan2(coll.qvecBNegIm(), coll.qvecBNegRe()) * 0.5f; + histos.fill(HIST("Psi_EP_FT0C_notshifted"), coll.centFT0C(), psiT0C); + histos.fill(HIST("Psi_EP_TPCA_notshifted"), coll.centFT0C(), psiTPCA); + histos.fill(HIST("Psi_EP_TPCC_notshifted"), coll.centFT0C(), psiTPCC); float psiT0CCorr = psiT0C; for (int ishift = 1; ishift <= 10; ishift++) { histos.fill(HIST("ShiftFT0C"), coll.centFT0C(), 0.5, ishift - 0.5, std::sin(ishift * 2 * psiT0C)); @@ -2147,6 +2420,11 @@ struct cascadeFlow { cascadev2::hMassBeforeSelVsPt[0]->Fill(massCasc[0], casc.pt()); cascadev2::hMassBeforeSelVsPt[1]->Fill(massCasc[1], casc.pt()); + // competing mass rejection cut applied for Omegas + if (casc.mXi() > CandidateConfigs.CMRlowerLimitMassXi && casc.mXi() < CandidateConfigs.CMRupperLimitMassXi) { + continue; + } + if (isApplyML) { // Retrieve model output and selection outcome isSelectedCasc[0] = mlResponseXi.isSelectedMl(inputFeaturesCasc, casc.pt(), bdtScore[0]); @@ -2161,13 +2439,17 @@ struct cascadeFlow { if (isSelectedCasc[iS]) { cascadev2::hSignalScoreAfterSel[iS]->Fill(bdtScore[0][1]); cascadev2::hBkgScoreAfterSel[iS]->Fill(bdtScore[1][0]); - cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); } } } else { isSelectedCasc[0] = true; isSelectedCasc[1] = true; } + for (int iS{0}; iS < nParticles; ++iS) { + if (isSelectedCasc[iS]) { + cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); + } + } ROOT::Math::XYZVector cascQvec{std::cos(2 * casc.phi()), std::sin(2 * casc.phi()), 0}; auto v2CSP = cascQvec.Dot(eventplaneVecT0C); @@ -2203,7 +2485,7 @@ struct cascadeFlow { } if (isSelectedCasc[0] || isSelectedCasc[1]) if (fillingConfigs.isFillTree) - fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0); + fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0CCorr, BDTresponse[0], BDTresponse[1], 0, bachExtra); } } @@ -2296,6 +2578,11 @@ struct cascadeFlow { cascadev2::hMassBeforeSelVsPt[0]->Fill(massCasc[0], casc.pt()); cascadev2::hMassBeforeSelVsPt[1]->Fill(massCasc[1], casc.pt()); + // competing mass rejection cut applied for Omegas + if (casc.mXi() > CandidateConfigs.CMRlowerLimitMassXi && casc.mXi() < CandidateConfigs.CMRupperLimitMassXi) { + continue; + } + if (isApplyML) { // Retrieve model output and selection outcome isSelectedCasc[0] = mlResponseXi.isSelectedMl(inputFeaturesCasc, casc.pt(), bdtScore[0]); @@ -2310,13 +2597,17 @@ struct cascadeFlow { if (isSelectedCasc[iS]) { cascadev2::hSignalScoreAfterSel[iS]->Fill(bdtScore[0][1]); cascadev2::hBkgScoreAfterSel[iS]->Fill(bdtScore[1][0]); - cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); } } } else { isSelectedCasc[0] = true; isSelectedCasc[1] = true; } + for (int iS{0}; iS < nParticles; ++iS) { + if (isSelectedCasc[iS]) { + cascadev2::hMassAfterSelVsPt[iS]->Fill(massCasc[iS], casc.pt()); + } + } histos.fill(HIST("hCascadePhi"), casc.phi()); @@ -2331,16 +2622,29 @@ struct cascadeFlow { BDTresponse[0] = bdtScore[0][1]; BDTresponse[1] = bdtScore[1][1]; } + int chargeIndex = 0; + if (casc.sign() > 0) + chargeIndex = 1; + if (std::abs(casc.eta()) < CandidateConfigs.etaCasc) { + if (fillingConfigs.isFillTHNXi && fillingConfigs.isFillTHN_Pz) { + if (std::abs(pdgCode) == PDG_t::kXiMinus) + histos.get(HIST("hXiPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mXi(), BDTresponse[0], 0); + } + if (fillingConfigs.isFillTHNOmega && fillingConfigs.isFillTHN_Pz) { + if (std::abs(pdgCode) == PDG_t::kOmegaMinus) + histos.get(HIST("hOmegaPzs2"))->Fill(coll.centFT0C(), chargeIndex, casc.pt(), casc.mOmega(), BDTresponse[1], 0); + } + } if (isStoreTrueCascOnly) { if (pdgCode == 0) continue; } if (isSelectedCasc[0] || isSelectedCasc[1]) - fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0C, BDTresponse[0], BDTresponse[1], pdgCode); + fillAnalysedTable(coll, hasEventPlane, hasSpectatorPlane, casc, v2CSP, v2CEP, v1SP_ZDCA, v1SP_ZDCC, psiT0C, BDTresponse[0], BDTresponse[1], pdgCode, bachExtra); } } - void processMCGen(MCCollisionsStra::iterator const& mcCollision, const soa::SmallGroups>& collisions, const soa::SmallGroups>& cascMC) + void processMCGen(MCCollisionsStra::iterator const& mcCollision, const soa::SmallGroups>& collisions, const soa::SmallGroups>& v0MC, const soa::SmallGroups>& cascMC) { histosMCGen.fill(HIST("hZvertexGen"), mcCollision.posZ()); @@ -2378,6 +2682,42 @@ struct cascadeFlow { histosMCGen.fill(HIST("hNEventsMC"), 5.5); + for (auto const& v0mc : v0MC) { + if (std::abs(v0mc.pdgCode()) == PDG_t::kLambda0) + histosMCGen.fill(HIST("hNLambdaGen"), 0.5); + if (!v0mc.has_straMCCollision()) + continue; + if (std::abs(v0mc.pdgCode()) == PDG_t::kLambda0) + histosMCGen.fill(HIST("hNLambdaGen"), 1.5); + if (!v0mc.isPhysicalPrimary()) + continue; + if (std::abs(v0mc.pdgCode()) == PDG_t::kLambda0) + histosMCGen.fill(HIST("hNLambdaGen"), 2.5); + + float ptmc = RecoDecay::sqrtSumOfSquares(v0mc.pxMC(), v0mc.pyMC()); + float lambdaMCeta = RecoDecay::eta(std::array{v0mc.pxMC(), v0mc.pyMC(), v0mc.pzMC()}); + float lambdaMCy = 0; + if (std::abs(v0mc.pdgCode()) == PDG_t::kLambda0) { + lambdaMCy = RecoDecay::y(std::array{v0mc.pxMC(), v0mc.pyMC(), v0mc.pzMC()}, constants::physics::MassLambda); + if (std::abs(lambdaMCeta) < etaCascMCGen) { + if (v0mc.pdgCode() == PDG_t::kLambda0) + histosMCGen.fill(HIST("h2DGenLambdaEta08"), centrality, ptmc); + else if (v0mc.pdgCode() == PDG_t::kLambda0Bar) + histosMCGen.fill(HIST("h2DGenAntiLambdaEta08"), centrality, ptmc); + histosMCGen.fill(HIST("hNLambdaGen"), 3.5); + } + if (std::abs(lambdaMCy) < yCascMCGen) { + if (v0mc.pdgCode() == PDG_t::kLambda0) + histosMCGen.fill(HIST("h2DGenLambdaY05"), centrality, ptmc); + else if (v0mc.pdgCode() == PDG_t::kLambda0Bar) + histosMCGen.fill(HIST("h2DGenAntiLambdaY05"), centrality, ptmc); + histosMCGen.fill(HIST("hNLambdaGen"), 4.5); + } + histosMCGen.fill(HIST("hGenLambdaY"), lambdaMCy); + histosMCGen.fill(HIST("hGenLambdaEta"), lambdaMCeta); + } + } + for (auto const& cascmc : cascMC) { if (std::abs(cascmc.pdgCode()) == PDG_t::kXiMinus) histosMCGen.fill(HIST("hNCascGen"), 0.5); @@ -2433,6 +2773,128 @@ struct cascadeFlow { } } + void processMCPrimaryLambdaFraction(soa::Join::iterator const& coll, V0MCCandidates const& V0s, DauTracks const&, soa::Join const&) + { + + Float_t collisionCentrality = 0; + if (isCollisionCentrality == 0) { // T0C + collisionCentrality = coll.centFT0C(); + } else if (isCollisionCentrality == 1) { // T0M + collisionCentrality = coll.centFT0M(); + } + + histos.fill(HIST("hEventCentralityBefEvSel"), collisionCentrality); + + if (!AcceptEvent(coll, 1)) { + return; + } + + // no EP requirements as in MC we do not have EP info + histos.fill(HIST("hNEvents"), 9.5); + histos.fill(HIST("hEventCentrality"), collisionCentrality); + histos.fill(HIST("hEventVertexZ"), coll.posZ()); + + for (auto const& v0 : V0s) { + + /// Add some minimal cuts for single track variables (min number of TPC clusters) + auto negExtra = v0.negTrackExtra_as(); + auto posExtra = v0.posTrackExtra_as(); + + int counterLambda = 0; + int counterALambda = 0; + bool isLambdaCandidate = 0; + bool isALambdaCandidate = 0; + + // check if v0 has MC info + if (!v0.has_v0MCCore()) + continue; + + //-- selections ------------------------------------------------------------ + if (isLambdaAccepted(negExtra, posExtra, counterLambda)) + isLambdaCandidate = 1; + if (isAntiLambdaAccepted(negExtra, posExtra, counterALambda)) + isALambdaCandidate = 1; + histos.fill(HIST("hLambdaDauSel"), counterLambda); + histos.fill(HIST("hALambdaDauSel"), counterALambda); + + if (v0.pt() < V0Configs.MinPtV0 || v0.pt() > V0Configs.MaxPtV0) { + continue; + } + + float massV0[nCharges]{v0.mLambda(), v0.mAntiLambda()}; + lambdav2::hMassBeforeSelVsPt[0]->Fill(massV0[0], v0.pt()); + lambdav2::hMassBeforeSelVsPt[1]->Fill(massV0[1], v0.pt()); + + bool isSelectedV0[2]{false, false}; + if (isV0TopoAccepted(v0) && isLambdaCandidate) + isSelectedV0[0] = true; + if (isV0TopoAccepted(v0) && isALambdaCandidate) + isSelectedV0[1] = true; + + if (isSelectedV0[0] && !isSelectedV0[1]) { // Lambdas + histos.fill(HIST("hLambdaCandidate"), 0); + } + if (isSelectedV0[1] && !isSelectedV0[0]) { // AntiLambdas + histos.fill(HIST("hLambdaCandidate"), 1); + } + if (isSelectedV0[0] && isSelectedV0[1]) { + histos.fill(HIST("hLambdaCandidate"), 2); + if (v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda && v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda) { + histos.fill(HIST("hLambdaCandidate"), 3); + continue; // in case of ambiguity between Lambda and AntiLambda, I skip the particle; checked to be zero in range 1.105 - 1.125 + } + if (!(v0.mLambda() > V0Configs.MinMassLambda && v0.mLambda() < V0Configs.MaxMassLambda) && !(v0.mAntiLambda() > V0Configs.MinMassLambda && v0.mAntiLambda() < V0Configs.MaxMassLambda)) + histos.fill(HIST("hLambdaCandidate"), 4); // bkg candidates + } + if (!isSelectedV0[0] && !isSelectedV0[1]) + continue; + + lambdav2::hMassAfterSelVsPt[0]->Fill(massV0[0], v0.pt()); + lambdav2::hMassAfterSelVsPt[1]->Fill(massV0[1], v0.pt()); + //-------------------------------------------------------------- + + auto v0MC = v0.v0MCCore_as>(); + float ptmc = RecoDecay::sqrtSumOfSquares(v0MC.pxMC(), v0MC.pyMC()); + int pdgCode{v0MC.pdgCode()}; + // select true lambdas + bool isTrueLambda = 0; + bool isTrueALambda = 0; + if (pdgCode == PDG_t::kLambda0 && v0MC.pdgCodePositive() == PDG_t::kProton && v0MC.pdgCodeNegative() == PDG_t::kPiMinus) + isTrueLambda = 1; + else if (pdgCode == PDG_t::kLambda0Bar && v0MC.pdgCodePositive() == PDG_t::kPiPlus && v0MC.pdgCodeNegative() == PDG_t::kProtonBar) + isTrueALambda = 1; + if (!isTrueLambda && !isTrueALambda) + continue; + if (isTrueLambda) + lambdav2::hMassAfterSelVsPtTrue[0]->Fill(massV0[0], v0.pt()); + if (isTrueALambda) + lambdav2::hMassAfterSelVsPtTrue[1]->Fill(massV0[1], v0.pt()); + + bool isPrimary = v0MC.isPhysicalPrimary(); + + // histo for primary fraction + if (isTrueLambda) { + if (isPrimary) { + histos.fill(HIST("hCentvsPtvsPrimaryFracLambda"), collisionCentrality, v0.pt(), 0); + histos.fill(HIST("hCentvsPrimaryFracLambda"), collisionCentrality, 0); + histosMCReco.fill(HIST("h2DRecoTrueLambda"), collisionCentrality, ptmc); + } else { + histos.fill(HIST("hCentvsPtvsPrimaryFracLambda"), collisionCentrality, v0.pt(), 1); + histos.fill(HIST("hCentvsPrimaryFracLambda"), collisionCentrality, 1); + } + } else if (isTrueALambda) { + if (isPrimary) { + histos.fill(HIST("hCentvsPtvsPrimaryFracLambda"), collisionCentrality, v0.pt(), 2); + histos.fill(HIST("hCentvsPrimaryFracLambda"), collisionCentrality, 2); + histosMCReco.fill(HIST("h2DRecoTrueAntiLambda"), collisionCentrality, ptmc); + } else { + histos.fill(HIST("hCentvsPtvsPrimaryFracLambda"), collisionCentrality, v0.pt(), 3); + histos.fill(HIST("hCentvsPrimaryFracLambda"), collisionCentrality, 3); + } + } + } + } + PROCESS_SWITCH(cascadeFlow, processTrainingBackground, "Process to create the training dataset for the background", true); PROCESS_SWITCH(cascadeFlow, processTrainingSignal, "Process to create the training dataset for the signal", false); PROCESS_SWITCH(cascadeFlow, processAnalyseData, "Process to apply ML model to the data", false); @@ -2441,6 +2903,7 @@ struct cascadeFlow { PROCESS_SWITCH(cascadeFlow, processAnalyseLambdaEP2CentralFW, "Process to measure flow and polarization of Lambda - event plane calibration from central framework", false); PROCESS_SWITCH(cascadeFlow, processAnalyseMC, "Process to apply ML model to the MC", false); PROCESS_SWITCH(cascadeFlow, processMCGen, "Process to store MC generated particles", false); + PROCESS_SWITCH(cascadeFlow, processMCPrimaryLambdaFraction, "Process to compute primary lambda fraction", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From abb19f0a90571341de200354df184ac4eafa8d04 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:52:50 +0200 Subject: [PATCH 16/22] Update quarkoniaToHyperons --- PWGDQ/Tasks/quarkoniaToHyperons.cxx | 71 +++++++++++++++-------------- 1 file changed, 37 insertions(+), 34 deletions(-) diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index f09ddb7f810..7012a6a6f12 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -34,43 +34,46 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/UPCHelpers.h" -#include "Common/Core/TrackSelection.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Tools/ML/MlResponse.h" #include "Tools/ML/model.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/Vector3D.h" -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include +#include +#include #include #include +#include #include #include #include @@ -136,7 +139,7 @@ struct QuarkoniaToHyperons { Configurable requireNoCollInTimeRangeStd{"requireNoCollInTimeRangeStd", true, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"}; Configurable requireNoCollInTimeRangeNarrow{"requireNoCollInTimeRangeNarrow", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds"}; - Configurable maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position"}; + Configurable maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position (cm)"}; Configurable buildK0sK0sPairs{"buildK0sK0sPairs", false, "Build K0s K0s from charmonia decay"}; Configurable buildLaLaBarPairs{"buildLaLaBarPairs", false, "Build Lambda antiLambda from charmonia decay"}; @@ -793,8 +796,8 @@ struct QuarkoniaToHyperons { histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairOpAngle", "h3dMassXiXiBarVsPairOpAngle", kTH3F, {axes.axisHypPairOpAngle, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairEta", "h3dMassXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/XiXiBar/h3dMassXiXiBarVsPairPhi", "h3dMassXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisQuarkoniumMass}); - histos.add("QA/LaLaBar/h3dDeltaEtaXiXiBarVsPairEta", "h3dDeltaEtaXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); - histos.add("QA/LaLaBar/h3dDeltaPhiXiXiBarVsPairPhi", "h3dDeltaPhiXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); + histos.add("QA/XiXiBar/h3dDeltaEtaXiXiBarVsPairEta", "h3dDeltaEtaXiXiBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); + histos.add("QA/XiXiBar/h3dDeltaPhiXiXiBarVsPairPhi", "h3dDeltaPhiXiXiBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); } } if (buildOmOmBarPairs) { @@ -887,8 +890,8 @@ struct QuarkoniaToHyperons { histos.add("QA/OmOmBar/h3dMassOmOmBarVsPairOpAngle", "h3dMassOmOmBarVsPairOpAngle", kTH3F, {axes.axisHypPairOpAngle, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/OmOmBar/h3dMassOmOmBarVsPairEta", "h3dMassOmOmBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisQuarkoniumMass}); histos.add("QA/OmOmBar/h3dMassOmOmBarVsPairPhi", "h3dMassOmOmBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisQuarkoniumMass}); - histos.add("QA/LaLaBar/h3dDeltaEtaOmOmBarVsPairEta", "h3dDeltaEtaOmOmBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); - histos.add("QA/LaLaBar/h3dDeltaPhiOmOmBarVsPairPhi", "h3dDeltaPhiOmOmBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); + histos.add("QA/OmOmBar/h3dDeltaEtaOmOmBarVsPairEta", "h3dDeltaEtaOmOmBarVsPairEta", kTH3F, {axes.axisHypPairEta, axes.axisPt, axes.axisHypPairEta}); + histos.add("QA/OmOmBar/h3dDeltaPhiOmOmBarVsPairPhi", "h3dDeltaPhiOmOmBarVsPairPhi", kTH3F, {axes.axisHypPairPhi, axes.axisPt, axes.axisHypPairPhi}); } } @@ -932,7 +935,7 @@ struct QuarkoniaToHyperons { histos.print(); } - template // TCollision should be of the type: soa::Join::iterator or so + template // TCollision should be of the type: soa::Join::iterator or so void initCCDB(TCollision const& collision) { if (mRunNumber == collision.runNumber() || (ccdbConfigurations.useCustomRunNumber && mRunNumber == ccdbConfigurations.customRunNumber)) { From 54289cf64c81a5cf019ae0ae35003ba30f21a2cc Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:55:18 +0200 Subject: [PATCH 17/22] Update flowEfficiencyCasc --- PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx b/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx index 07bb4b84eb7..9a67d39f461 100644 --- a/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx +++ b/PWGCF/Flow/Tasks/flowEfficiencyCasc.cxx @@ -16,24 +16,23 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/cascqaanalysis.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include using namespace o2; From 6af29bd4b90c64f4ca44db2d5c60a8d859d747ce Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 17:04:18 +0200 Subject: [PATCH 18/22] Fix warning about unused variables --- .../Strangeness/Converters/straevselextrasconverter2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx index 7bcea579b8d..db8f92b1337 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx @@ -26,7 +26,7 @@ struct straevselextrasconverter2 { void process(aod::StraEvSels const& straEvSels) { - for (auto& values : straEvSels) { + for (const auto& /*values*/ : straEvSels) { straEvSelExtras(-999., // dummy multZNA, -999., // dummy multZNC, -999., // dummy multZEM1, From 0e13b5a523f97078de74178a75f77263409f5cf4 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 17:27:01 +0200 Subject: [PATCH 19/22] Fix formatting copyright line 1/3 --- .../Strangeness/Converters/straevselextrasconverter.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter.cxx index 9679479ed59..27e7d930ebc 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter.cxx @@ -8,6 +8,7 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. + #include "PWGLF/DataModel/LFStrangenessTables.h" #include "CCDB/BasicCCDBManager.h" From 760d79c9fa070741761849f531644abbbeb25f37 Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 17:27:19 +0200 Subject: [PATCH 20/22] Fix formatting copyright line 2/3 --- .../Strangeness/Converters/straevselextrasconverter2.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx index db8f92b1337..ebde2d2b457 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx @@ -8,6 +8,7 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. + #include "PWGLF/DataModel/LFStrangenessTables.h" #include "CCDB/BasicCCDBManager.h" From 92a8f80d175bb8a5971c386f457888204171a43f Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 17:27:46 +0200 Subject: [PATCH 21/22] Fix formatting copyright line 3/3 --- .../Strangeness/Converters/straevselsconverter6.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter6.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter6.cxx index 0d6b4f85862..148d892eda5 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter6.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselsconverter6.cxx @@ -8,6 +8,7 @@ // In applying this license CERN does not waive the privileges and immunities // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. + #include "PWGLF/DataModel/LFStrangenessTables.h" #include "CCDB/BasicCCDBManager.h" From 7eb8deec4756aeff189e001c21f8e9d5a999c79a Mon Sep 17 00:00:00 2001 From: SCHOTTER Romain <47983209+romainschotter@users.noreply.github.com> Date: Mon, 1 Jun 2026 21:36:01 +0200 Subject: [PATCH 22/22] Fix warning about unused variables --- .../Strangeness/Converters/straevselextrasconverter2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx index ebde2d2b457..0d06b2cd1df 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx +++ b/PWGLF/TableProducer/Strangeness/Converters/straevselextrasconverter2.cxx @@ -27,7 +27,7 @@ struct straevselextrasconverter2 { void process(aod::StraEvSels const& straEvSels) { - for (const auto& /*values*/ : straEvSels) { + for (int ii = 0; ii < straEvSels.size(); ii++) { straEvSelExtras(-999., // dummy multZNA, -999., // dummy multZNC, -999., // dummy multZEM1,