diff --git a/ALICE3/Core/Decayer.h b/ALICE3/Core/Decayer.h index 33696b19683..bec6b9506d9 100644 --- a/ALICE3/Core/Decayer.h +++ b/ALICE3/Core/Decayer.h @@ -21,18 +21,18 @@ #include "ALICE3/Core/TrackUtilities.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include -#include -#include +#include // IWYU pragma: keep #include #include -#include #include #include #include -#include +#include #include namespace o2 diff --git a/ALICE3/Core/DelphesO2LutWriter.cxx b/ALICE3/Core/DelphesO2LutWriter.cxx index 987383092ec..c2df9431ef4 100644 --- a/ALICE3/Core/DelphesO2LutWriter.cxx +++ b/ALICE3/Core/DelphesO2LutWriter.cxx @@ -25,14 +25,27 @@ #include "ALICE3/Core/FastTracker.h" #include "ALICE3/Core/TrackUtilities.h" -#include "TAxis.h" -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "TMatrixD.h" -#include "TMatrixDSymEigen.h" -#include "TVectorD.h" - +#include +#include + +#include +#include +#include +#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) +#include +#include +#include +#include +#include +#include + +#include + +#include #include +#include +#include #include // #define USE_FWD_PARAM diff --git a/ALICE3/Core/DelphesO2LutWriter.h b/ALICE3/Core/DelphesO2LutWriter.h index 1528ab80bac..e234efd3bdb 100644 --- a/ALICE3/Core/DelphesO2LutWriter.h +++ b/ALICE3/Core/DelphesO2LutWriter.h @@ -23,10 +23,13 @@ #include "ALICE3/Core/DelphesO2TrackSmearer.h" #include "ALICE3/Core/FastTracker.h" -#include "ReconstructionDataFormats/PID.h" +#include -#include "TGraph.h" +#include +#include + +#include #include namespace o2::fastsim diff --git a/ALICE3/Core/DelphesO2TrackSmearer.cxx b/ALICE3/Core/DelphesO2TrackSmearer.cxx index 7fca0dc19be..7d7f6fc6077 100644 --- a/ALICE3/Core/DelphesO2TrackSmearer.cxx +++ b/ALICE3/Core/DelphesO2TrackSmearer.cxx @@ -28,12 +28,6 @@ /// @author: Roberto Preghenella /// @email: preghenella@bo.infn.it -// #include "TrackSmearer.hh" -// #include "TrackUtils.hh" -// #include "TRandom.h" -// #include -// #include - #include "ALICE3/Core/DelphesO2TrackSmearer.h" #include "ALICE3/Core/GeometryContainer.h" @@ -41,7 +35,11 @@ #include #include -#include +#include + +#include +#include +#include #include namespace o2 diff --git a/ALICE3/Core/DelphesO2TrackSmearer.h b/ALICE3/Core/DelphesO2TrackSmearer.h index afb0c7690cf..6d941f336ca 100644 --- a/ALICE3/Core/DelphesO2TrackSmearer.h +++ b/ALICE3/Core/DelphesO2TrackSmearer.h @@ -27,22 +27,14 @@ #include #include -#include - +#include #include -#include -#include -#include -#include +#include /////////////////////////////// /// DelphesO2/src/lutCovm.hh // /////////////////////////////// -/// @author: Roberto Preghenella -/// @email: preghenella@bo.infn.it - -// #pragma // once #define LUTCOVM_VERSION 20210801 struct map_t { @@ -154,17 +146,6 @@ struct lutEntry_t { /// DelphesO2/src/TrackSmearer.hh // //////////////////////////////////// -/// @author: Roberto Preghenella -/// @email: preghenella@bo.infn.it - -// #ifndef _DelphesO2_TrackSmearer_h_ -// #define _DelphesO2_TrackSmearer_h_ - -// #include "ReconstructionDataFormats/Track.h" -// #include "classes/DelphesClasses.h" -// #include "lutCovm.hh" -// #include - using O2Track = o2::track::TrackParCov; namespace o2 @@ -269,10 +250,9 @@ class TrackSmearer } // namespace delphes } // namespace o2 -// #endif /** _DelphesO2_TrackSmearer_h_ **/ - namespace o2::delphes { using DelphesO2TrackSmearer = TrackSmearer; } + #endif // ALICE3_CORE_DELPHESO2TRACKSMEARER_H_ diff --git a/ALICE3/Core/DetLayer.cxx b/ALICE3/Core/DetLayer.cxx index 2e72d641a2b..d93fd77373f 100644 --- a/ALICE3/Core/DetLayer.cxx +++ b/ALICE3/Core/DetLayer.cxx @@ -21,8 +21,10 @@ #include #include +#include +#include + #include -#include namespace o2::fastsim { diff --git a/ALICE3/Core/DetLayer.h b/ALICE3/Core/DetLayer.h index 32c5a839684..b3ed3ed6b34 100644 --- a/ALICE3/Core/DetLayer.h +++ b/ALICE3/Core/DetLayer.h @@ -22,6 +22,7 @@ #include #include +#include #include namespace o2::fastsim diff --git a/ALICE3/Core/FastTracker.cxx b/ALICE3/Core/FastTracker.cxx index be4ef7d2a12..254ab8d6643 100644 --- a/ALICE3/Core/FastTracker.cxx +++ b/ALICE3/Core/FastTracker.cxx @@ -11,24 +11,37 @@ #include "FastTracker.h" -#include "Common/Core/TableHelper.h" - +#include "DetLayer.h" +#include "GeometryContainer.h" + +#include +#include +#include +#include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) #include +#include +#include #include #include -#include +#include +#include + +#include +#include -#include -#include -#include +#include +#include +#include +#include +#include #include -#include #include namespace o2 diff --git a/ALICE3/Core/FastTracker.h b/ALICE3/Core/FastTracker.h index d361e261603..d593c568fb9 100644 --- a/ALICE3/Core/FastTracker.h +++ b/ALICE3/Core/FastTracker.h @@ -16,11 +16,14 @@ #include "GeometryContainer.h" #include -#include -#include #include -#include +#include + +#include + +#include +#include #include #include diff --git a/ALICE3/Core/GeometryContainer.cxx b/ALICE3/Core/GeometryContainer.cxx index f58c9b80926..aee8e36ebd8 100644 --- a/ALICE3/Core/GeometryContainer.cxx +++ b/ALICE3/Core/GeometryContainer.cxx @@ -19,13 +19,19 @@ #include "Common/Core/TableHelper.h" +#include +#include +#include + #include #include +#include #include #include #include +#include #include #include #include @@ -35,6 +41,7 @@ #include #include +#include #include namespace o2::fastsim diff --git a/ALICE3/Core/GeometryContainer.h b/ALICE3/Core/GeometryContainer.h index b3e9e23a538..d5892b5b97b 100644 --- a/ALICE3/Core/GeometryContainer.h +++ b/ALICE3/Core/GeometryContainer.h @@ -18,8 +18,6 @@ #ifndef ALICE3_CORE_GEOMETRYCONTAINER_H_ #define ALICE3_CORE_GEOMETRYCONTAINER_H_ -#include "DetLayer.h" - #include #include #include diff --git a/ALICE3/Core/TOFResoALICE3.cxx b/ALICE3/Core/TOFResoALICE3.cxx index ebd5247230b..6d3bdd40383 100644 --- a/ALICE3/Core/TOFResoALICE3.cxx +++ b/ALICE3/Core/TOFResoALICE3.cxx @@ -18,6 +18,10 @@ #include "ALICE3/Core/TOFResoALICE3.h" +#include + +#include + namespace o2::pid::tof { diff --git a/ALICE3/Core/TOFResoALICE3.h b/ALICE3/Core/TOFResoALICE3.h index b102091f756..e392d120ecf 100644 --- a/ALICE3/Core/TOFResoALICE3.h +++ b/ALICE3/Core/TOFResoALICE3.h @@ -16,14 +16,18 @@ /// \brief Implementation for the TOF PID response of the expected times resolution /// -#ifndef O2_ANALYSIS_PID_TOFRESOALICE3_H_ -#define O2_ANALYSIS_PID_TOFRESOALICE3_H_ +#ifndef ALICE3_CORE_TOFRESOALICE3_H_ +#define ALICE3_CORE_TOFRESOALICE3_H_ -// O2 includes -#include "PID/ParamBase.h" -#include "PID/DetectorResponse.h" -#include "PID/PIDTOF.h" -#include "ReconstructionDataFormats/PID.h" +#include +#include + +#include + +#include +#include + +#include namespace o2::pid::tof { @@ -72,4 +76,4 @@ float TOFResoALICE3ParamTrack(const T& track, const Parameters& parameters) } // namespace o2::pid::tof -#endif +#endif // ALICE3_CORE_TOFRESOALICE3_H_ diff --git a/ALICE3/Core/TrackUtilities.cxx b/ALICE3/Core/TrackUtilities.cxx index c07fe145ccf..739e1df28ae 100644 --- a/ALICE3/Core/TrackUtilities.cxx +++ b/ALICE3/Core/TrackUtilities.cxx @@ -17,6 +17,13 @@ #include "TrackUtilities.h" +#include +#include + +#include + +#include +#include #include void o2::upgrade::convertTLorentzVectorToO2Track(const int charge, diff --git a/ALICE3/Core/TrackUtilities.h b/ALICE3/Core/TrackUtilities.h index edf92224edb..d883a0d2dc8 100644 --- a/ALICE3/Core/TrackUtilities.h +++ b/ALICE3/Core/TrackUtilities.h @@ -18,9 +18,9 @@ #ifndef ALICE3_CORE_TRACKUTILITIES_H_ #define ALICE3_CORE_TRACKUTILITIES_H_ -#include "ReconstructionDataFormats/Track.h" +#include -#include "TLorentzVector.h" +#include #include diff --git a/ALICE3/DataModel/A3DecayFinderTables.h b/ALICE3/DataModel/A3DecayFinderTables.h index f6e3eba8cc6..bd9aa5592b3 100644 --- a/ALICE3/DataModel/A3DecayFinderTables.h +++ b/ALICE3/DataModel/A3DecayFinderTables.h @@ -18,11 +18,12 @@ #ifndef ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_ #define ALICE3_DATAMODEL_A3DECAYFINDERTABLES_H_ -// O2 includes #include "Common/Core/RecoDecay.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisDataModel.h" +#include + +#include +#include enum a3selectionBit : uint32_t { kDCAxy = 0, kInnerTOFPion, diff --git a/ALICE3/DataModel/ECAL.h b/ALICE3/DataModel/ECAL.h index 1e029d24174..9ef1e8a3391 100644 --- a/ALICE3/DataModel/ECAL.h +++ b/ALICE3/DataModel/ECAL.h @@ -16,11 +16,10 @@ /// \brief Set of tables for the ALICE3 ECAL information /// -#ifndef O2_ANALYSIS_ALICE3_ECAL_H_ -#define O2_ANALYSIS_ALICE3_ECAL_H_ +#ifndef ALICE3_DATAMODEL_ECAL_H_ +#define ALICE3_DATAMODEL_ECAL_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { @@ -53,4 +52,4 @@ using ECAL = ECALs::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_ALICE3_ECAL_H_ +#endif // ALICE3_DATAMODEL_ECAL_H_ diff --git a/ALICE3/DataModel/FTOF.h b/ALICE3/DataModel/FTOF.h index e24c1c0585d..3d047c21fd5 100644 --- a/ALICE3/DataModel/FTOF.h +++ b/ALICE3/DataModel/FTOF.h @@ -16,11 +16,10 @@ /// \brief Set of tables for the ALICE3 FTOF information /// -#ifndef O2_ANALYSIS_ALICE3_FTOF_H_ -#define O2_ANALYSIS_ALICE3_FTOF_H_ +#ifndef ALICE3_DATAMODEL_FTOF_H_ +#define ALICE3_DATAMODEL_FTOF_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { @@ -61,4 +60,4 @@ using FTOF = FTOFs::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_ALICE3_FTOF_H_ +#endif // ALICE3_DATAMODEL_FTOF_H_ diff --git a/ALICE3/DataModel/MID.h b/ALICE3/DataModel/MID.h index 7d932b90802..7357e689eda 100644 --- a/ALICE3/DataModel/MID.h +++ b/ALICE3/DataModel/MID.h @@ -16,11 +16,12 @@ /// \brief Set of tables for the ALICE3 MID information /// -#ifndef O2_ANALYSIS_ALICE3_MID_H_ -#define O2_ANALYSIS_ALICE3_MID_H_ +#ifndef ALICE3_DATAMODEL_MID_H_ +#define ALICE3_DATAMODEL_MID_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { @@ -41,4 +42,4 @@ using MID = MIDs::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_ALICE3_MID_H_ +#endif // ALICE3_DATAMODEL_MID_H_ diff --git a/ALICE3/DataModel/OTFCollision.h b/ALICE3/DataModel/OTFCollision.h index 933bceab62c..e146515f89b 100644 --- a/ALICE3/DataModel/OTFCollision.h +++ b/ALICE3/DataModel/OTFCollision.h @@ -19,8 +19,7 @@ #ifndef ALICE3_DATAMODEL_OTFCOLLISION_H_ #define ALICE3_DATAMODEL_OTFCOLLISION_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFMCParticle.h b/ALICE3/DataModel/OTFMCParticle.h index 987ed28b858..403bf6deada 100644 --- a/ALICE3/DataModel/OTFMCParticle.h +++ b/ALICE3/DataModel/OTFMCParticle.h @@ -19,8 +19,7 @@ #ifndef ALICE3_DATAMODEL_OTFMCPARTICLE_H_ #define ALICE3_DATAMODEL_OTFMCPARTICLE_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFMulticharm.h b/ALICE3/DataModel/OTFMulticharm.h index 5c4224bdce5..643d36c0adb 100644 --- a/ALICE3/DataModel/OTFMulticharm.h +++ b/ALICE3/DataModel/OTFMulticharm.h @@ -20,10 +20,9 @@ #ifndef ALICE3_DATAMODEL_OTFMULTICHARM_H_ #define ALICE3_DATAMODEL_OTFMULTICHARM_H_ -// O2 includes #include "ALICE3/DataModel/OTFStrangeness.h" -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFPIDTrk.h b/ALICE3/DataModel/OTFPIDTrk.h index ce8a5d07a4f..c07a0d6579c 100644 --- a/ALICE3/DataModel/OTFPIDTrk.h +++ b/ALICE3/DataModel/OTFPIDTrk.h @@ -20,8 +20,10 @@ #ifndef ALICE3_DATAMODEL_OTFPIDTRK_H_ #define ALICE3_DATAMODEL_OTFPIDTRK_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFRICH.h b/ALICE3/DataModel/OTFRICH.h index 05771dda57b..bcd42d585ed 100644 --- a/ALICE3/DataModel/OTFRICH.h +++ b/ALICE3/DataModel/OTFRICH.h @@ -19,8 +19,10 @@ #ifndef ALICE3_DATAMODEL_OTFRICH_H_ #define ALICE3_DATAMODEL_OTFRICH_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFStrangeness.h b/ALICE3/DataModel/OTFStrangeness.h index 7ee5c862313..395f1ab8681 100644 --- a/ALICE3/DataModel/OTFStrangeness.h +++ b/ALICE3/DataModel/OTFStrangeness.h @@ -19,10 +19,13 @@ #ifndef ALICE3_DATAMODEL_OTFSTRANGENESS_H_ #define ALICE3_DATAMODEL_OTFSTRANGENESS_H_ -// O2 includes #include "Common/Core/RecoDecay.h" -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include +#include namespace o2::aod { diff --git a/ALICE3/DataModel/OTFTOF.h b/ALICE3/DataModel/OTFTOF.h index 150efc91f5e..b4bf1f26670 100644 --- a/ALICE3/DataModel/OTFTOF.h +++ b/ALICE3/DataModel/OTFTOF.h @@ -20,8 +20,10 @@ #ifndef ALICE3_DATAMODEL_OTFTOF_H_ #define ALICE3_DATAMODEL_OTFTOF_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include +#include + +#include namespace o2::aod { diff --git a/ALICE3/DataModel/RICH.h b/ALICE3/DataModel/RICH.h index ab670002078..a1fc7c7c692 100644 --- a/ALICE3/DataModel/RICH.h +++ b/ALICE3/DataModel/RICH.h @@ -16,12 +16,11 @@ /// \brief Set of tables for the ALICE3 RICH information /// -#ifndef O2_ANALYSIS_ALICE3_RICH_H_ -#define O2_ANALYSIS_ALICE3_RICH_H_ +#ifndef ALICE3_DATAMODEL_RICH_H_ +#define ALICE3_DATAMODEL_RICH_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" -#include "ReconstructionDataFormats/PID.h" +#include +#include namespace o2::aod { @@ -176,4 +175,4 @@ using FRICH = FRICHs::iterator; } // namespace o2::aod -#endif // O2_ANALYSIS_ALICE3_RICH_H_ +#endif // ALICE3_DATAMODEL_RICH_H_ diff --git a/ALICE3/DataModel/collisionAlice3.h b/ALICE3/DataModel/collisionAlice3.h index ddb10ca9f1d..a1238e9e1d9 100644 --- a/ALICE3/DataModel/collisionAlice3.h +++ b/ALICE3/DataModel/collisionAlice3.h @@ -19,8 +19,7 @@ #ifndef ALICE3_DATAMODEL_COLLISIONALICE3_H_ #define ALICE3_DATAMODEL_COLLISIONALICE3_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/ALICE3/DataModel/tracksAlice3.h b/ALICE3/DataModel/tracksAlice3.h index 6e03e5e68ba..04cb2d1a9d4 100644 --- a/ALICE3/DataModel/tracksAlice3.h +++ b/ALICE3/DataModel/tracksAlice3.h @@ -19,9 +19,8 @@ #ifndef ALICE3_DATAMODEL_TRACKSALICE3_H_ #define ALICE3_DATAMODEL_TRACKSALICE3_H_ -// O2 includes -#include "Framework/AnalysisDataModel.h" #include +#include namespace o2::aod { diff --git a/ALICE3/ML/HfMlResponse3Prong.h b/ALICE3/ML/HfMlResponse3Prong.h index 24c7b479213..7c360634d37 100644 --- a/ALICE3/ML/HfMlResponse3Prong.h +++ b/ALICE3/ML/HfMlResponse3Prong.h @@ -19,8 +19,6 @@ #include "Tools/ML/MlResponse.h" #include -#include -#include #include // Fill the map of available input features diff --git a/ALICE3/Macros/testFastTracker.C b/ALICE3/Macros/testFastTracker.C index f9ec72e0765..c07b7e3ac98 100644 --- a/ALICE3/Macros/testFastTracker.C +++ b/ALICE3/Macros/testFastTracker.C @@ -17,8 +17,7 @@ #include #include - -#include +#include void testFastTracker(std::string geometryFile = "a3geo.ini") { diff --git a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx index 366ffb6a290..c4a028f9445 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx @@ -20,17 +20,30 @@ #include "ALICE3/DataModel/OTFMCParticle.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 diff --git a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx index 293745458c9..c4caf97f17a 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyDetectorGeometryProvider.cxx @@ -16,14 +16,23 @@ /// \author Nicolò Jacazio , Universita del Piemonte Orientale (IT) /// -#include "ALICE3/Core/FastTracker.h" +#include "GeometryContainer.h" #include +#include +#include #include +#include #include +#include +#include +#include #include -#include +#include +#include + +#include #include #include diff --git a/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx b/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx index c11327e9f03..42c9a022fe6 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyRichPid.cxx @@ -30,42 +30,41 @@ /// \since May 22, 2024 /// +#include "GeometryContainer.h" + #include "ALICE3/Core/DelphesO2TrackSmearer.h" -#include "ALICE3/Core/FastTracker.h" #include "ALICE3/Core/TrackUtilities.h" #include "ALICE3/DataModel/OTFCollision.h" #include "ALICE3/DataModel/OTFRICH.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.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 diff --git a/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx b/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx index 75e9d41d5c2..731bc940b5b 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTofPid.cxx @@ -24,44 +24,50 @@ /// \since May 22, 2024 /// +#include "GeometryContainer.h" + #include "ALICE3/Core/DelphesO2TrackSmearer.h" -#include "ALICE3/Core/FastTracker.h" #include "ALICE3/Core/TrackUtilities.h" #include "ALICE3/DataModel/OTFCollision.h" #include "ALICE3/DataModel/OTFTOF.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.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 #include #include #include +#include + using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx index 5989f9d3965..10aaa8aa030 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTracker.cxx @@ -23,6 +23,8 @@ /// \author Roberto Preghenella preghenella@bo.infn.it /// +#include "GeometryContainer.h" + #include "ALICE3/Core/DelphesO2TrackSmearer.h" #include "ALICE3/Core/DetLayer.h" #include "ALICE3/Core/FastTracker.h" @@ -35,37 +37,73 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.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 +#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 std::array; diff --git a/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx b/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx index 78db04bba62..fdb0e72afe2 100644 --- a/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx +++ b/ALICE3/TableProducer/OTF/onTheFlyTrackerPid.cxx @@ -20,43 +20,39 @@ /// \since May 22, 2025 /// -#include "ALICE3/Core/DelphesO2TrackSmearer.h" -#include "ALICE3/Core/FastTracker.h" +#include "GeometryContainer.h" + #include "ALICE3/Core/TrackUtilities.h" -#include "ALICE3/DataModel/OTFCollision.h" #include "ALICE3/DataModel/OTFPIDTrk.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.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 #include #include #include diff --git a/ALICE3/TableProducer/alice3-centrality.cxx b/ALICE3/TableProducer/alice3-centrality.cxx index 48c7ae617bf..bc06a838697 100644 --- a/ALICE3/TableProducer/alice3-centrality.cxx +++ b/ALICE3/TableProducer/alice3-centrality.cxx @@ -11,13 +11,26 @@ /// \author Nicolo' Jacazio , CERN /// \author David Dobrigkeit Chinellato , UNICAMP/CERN -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/TrackSelectionTables.h" + #include -#include "Common/DataModel/Centrality.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3-correlatorDDbar.cxx b/ALICE3/TableProducer/alice3-correlatorDDbar.cxx index b17216e9b76..0e27bec4476 100644 --- a/ALICE3/TableProducer/alice3-correlatorDDbar.cxx +++ b/ALICE3/TableProducer/alice3-correlatorDDbar.cxx @@ -14,19 +14,26 @@ /// /// \author Fabio Colamaria , INFN Bari -#include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" #include "ALICE3/DataModel/A3DecayFinderTables.h" -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - +#include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include using namespace o2; diff --git a/ALICE3/TableProducer/alice3-decayfinder.cxx b/ALICE3/TableProducer/alice3-decayfinder.cxx index a78a2ce252c..588f5b6aaa6 100644 --- a/ALICE3/TableProducer/alice3-decayfinder.cxx +++ b/ALICE3/TableProducer/alice3-decayfinder.cxx @@ -21,34 +21,36 @@ #include "ALICE3/DataModel/OTFPIDTrk.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/RICH.h" #include "ALICE3/Utils/utilsHfAlice3.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.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/RunningWorkflowInfo.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 using namespace o2; diff --git a/ALICE3/TableProducer/alice3-decaypreselector.cxx b/ALICE3/TableProducer/alice3-decaypreselector.cxx index 7c28a51d118..3b138ad03b7 100644 --- a/ALICE3/TableProducer/alice3-decaypreselector.cxx +++ b/ALICE3/TableProducer/alice3-decaypreselector.cxx @@ -17,43 +17,30 @@ // HF decays. Work in progress: use at your own risk! // -#include "PWGLF/DataModel/LFParticleIdentification.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" - #include "ALICE3/DataModel/A3DecayFinderTables.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/TrackSelectionTables.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 using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; // simple checkers // #define biton(var, nbit) ((var) |= (static_cast(1) << (nbit))) diff --git a/ALICE3/TableProducer/alice3-dq-table-maker.cxx b/ALICE3/TableProducer/alice3-dq-table-maker.cxx index 9fdc1cd2953..a6f36151732 100644 --- a/ALICE3/TableProducer/alice3-dq-table-maker.cxx +++ b/ALICE3/TableProducer/alice3-dq-table-maker.cxx @@ -22,34 +22,35 @@ #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" #include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGDQ/DataModel/ReducedTablesAlice3.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" #include "ALICE3/DataModel/collisionAlice3.h" #include "ALICE3/DataModel/tracksAlice3.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/McCollisionExtra.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - -#include "THashList.h" -#include "TList.h" - +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include #include #include #include -#include #include #include diff --git a/ALICE3/TableProducer/alice3-trackextension.cxx b/ALICE3/TableProducer/alice3-trackextension.cxx index 578d1979310..384810ffdeb 100644 --- a/ALICE3/TableProducer/alice3-trackextension.cxx +++ b/ALICE3/TableProducer/alice3-trackextension.cxx @@ -13,11 +13,16 @@ // Task performing basic track selection for the ALICE3. // -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/Core/trackUtilities.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3-trackselection.cxx b/ALICE3/TableProducer/alice3-trackselection.cxx index 58f3a4f33ce..1a621f81df7 100644 --- a/ALICE3/TableProducer/alice3-trackselection.cxx +++ b/ALICE3/TableProducer/alice3-trackselection.cxx @@ -14,11 +14,23 @@ /// \brief Track selection for the ALICE3 studies /// -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/Core/trackUtilities.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/TableProducer/alice3HfSelector3Prong.cxx b/ALICE3/TableProducer/alice3HfSelector3Prong.cxx index d075b56b0c9..89c34ff1cf3 100644 --- a/ALICE3/TableProducer/alice3HfSelector3Prong.cxx +++ b/ALICE3/TableProducer/alice3HfSelector3Prong.cxx @@ -16,12 +16,9 @@ #include "PWGHF/Core/SelectorCuts.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" #include "ALICE3/DataModel/A3DecayFinderTables.h" -#include "ALICE3/DataModel/OTFPIDTrk.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/RICH.h" #include "ALICE3/ML/HfMlResponse3Prong.h" #include "ALICE3/Utils/utilsHfAlice3.h" #include "ALICE3/Utils/utilsSelectionsAlice3.h" @@ -36,14 +33,14 @@ #include #include #include -#include #include +#include #include -#include +#include + #include -#include #include #include diff --git a/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx b/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx index b74a75ad29b..7a97f1420ff 100644 --- a/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx +++ b/ALICE3/TableProducer/alice3HfTreeCreator3Prong.cxx @@ -16,14 +16,9 @@ /// \author Marcello Di Costanzo , Turin Polytechnic University and INFN Turin #include "ALICE3/DataModel/A3DecayFinderTables.h" -#include "ALICE3/DataModel/OTFPIDTrk.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/RICH.h" #include "ALICE3/Utils/utilsHfAlice3.h" #include "Common/Core/RecoDecay.h" -#include #include #include #include @@ -32,8 +27,9 @@ #include #include +#include #include -#include +#include using namespace o2; using namespace o2::analysis; diff --git a/ALICE3/TableProducer/alice3MulticharmFinder.cxx b/ALICE3/TableProducer/alice3MulticharmFinder.cxx index 16e0e9571c7..fd4a7a47881 100644 --- a/ALICE3/TableProducer/alice3MulticharmFinder.cxx +++ b/ALICE3/TableProducer/alice3MulticharmFinder.cxx @@ -23,40 +23,44 @@ #include "ALICE3/DataModel/A3DecayFinderTables.h" #include "ALICE3/DataModel/OTFCollision.h" #include "ALICE3/DataModel/OTFMulticharm.h" -#include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFStrangeness.h" -#include "ALICE3/DataModel/OTFTOF.h" #include "ALICE3/DataModel/tracksAlice3.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexer.h" -#include "DetectorsVertexing/PVertexerHelpers.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.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 #include using namespace o2; diff --git a/ALICE3/TableProducer/alice3TrackingTranslator.cxx b/ALICE3/TableProducer/alice3TrackingTranslator.cxx index 706d5cba462..c68cb2adbe3 100644 --- a/ALICE3/TableProducer/alice3TrackingTranslator.cxx +++ b/ALICE3/TableProducer/alice3TrackingTranslator.cxx @@ -24,20 +24,29 @@ #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 @@ -313,7 +322,7 @@ struct Alice3TrackingTranslator { float collisionY = 0.0f; float collisionZ = 0.0f; - tableOTFLUTConfigId(0); // dummy for the moment + tableOTFLUTConfigId(0); // dummy for the moment // Determine the collision ID for the new entry. // If the table is empty, lastIndex() returns -1, so we start at 0. diff --git a/ALICE3/TableProducer/alice3strangenessFinder.cxx b/ALICE3/TableProducer/alice3strangenessFinder.cxx index f2a60b5ab8c..3d79ff057a4 100644 --- a/ALICE3/TableProducer/alice3strangenessFinder.cxx +++ b/ALICE3/TableProducer/alice3strangenessFinder.cxx @@ -31,18 +31,30 @@ #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "DCAFitter/DCAFitterN.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 diff --git a/ALICE3/Tasks/ECALqa.cxx b/ALICE3/Tasks/ECALqa.cxx index 5e337cefdbd..73a73ca32a3 100644 --- a/ALICE3/Tasks/ECALqa.cxx +++ b/ALICE3/Tasks/ECALqa.cxx @@ -16,16 +16,24 @@ /// \brief Task to use the ALICE3 ECAL table /// -// O2 includes #include "ALICE3/DataModel/ECAL.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/PID.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; -using namespace o2::track; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/ALICE3/Tasks/alice3-cdeuteron.cxx b/ALICE3/Tasks/alice3-cdeuteron.cxx index c3c67e2efdb..6dc574189f2 100644 --- a/ALICE3/Tasks/alice3-cdeuteron.cxx +++ b/ALICE3/Tasks/alice3-cdeuteron.cxx @@ -12,18 +12,30 @@ /// \author Nicolo' Jacazio , CERN /// \author Alexander Kalweit , CERN -// O2 includes -#include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/PIDResponseTOF.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/PID.h" - -#include "TLorentzVector.h" +#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; diff --git a/ALICE3/Tasks/alice3-dilepton.cxx b/ALICE3/Tasks/alice3-dilepton.cxx index 4ed9ee35a87..099e6205262 100644 --- a/ALICE3/Tasks/alice3-dilepton.cxx +++ b/ALICE3/Tasks/alice3-dilepton.cxx @@ -23,13 +23,23 @@ #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 using namespace o2; diff --git a/ALICE3/Tasks/alice3-dq-efficiency.cxx b/ALICE3/Tasks/alice3-dq-efficiency.cxx index 87b782e62cb..99dcd281727 100644 --- a/ALICE3/Tasks/alice3-dq-efficiency.cxx +++ b/ALICE3/Tasks/alice3-dq-efficiency.cxx @@ -26,26 +26,23 @@ #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGDQ/DataModel/ReducedTablesAlice3.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/collisionAlice3.h" -#include "ALICE3/DataModel/tracksAlice3.h" #include "Common/Core/TableHelper.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include -#include #include -#include -#include #include #include +#include +#include #include #include #include @@ -58,6 +55,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; // Some definitions namespace o2::aod diff --git a/ALICE3/Tasks/alice3-lutmaker.cxx b/ALICE3/Tasks/alice3-lutmaker.cxx index 8b1fddb95df..de28c90583c 100644 --- a/ALICE3/Tasks/alice3-lutmaker.cxx +++ b/ALICE3/Tasks/alice3-lutmaker.cxx @@ -13,10 +13,28 @@ /// \brief Task to extract LUTs for the fast simulation from full simulation /// \since 27/04/2021 +#include +#include #include +#include +#include +#include +#include +#include +#include #include -#include -#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include struct Alice3LutMaker { static constexpr int nSpecies = 8; diff --git a/ALICE3/Tasks/alice3-qa-multiplicity.cxx b/ALICE3/Tasks/alice3-qa-multiplicity.cxx index b798209dfde..a5440ff8d53 100644 --- a/ALICE3/Tasks/alice3-qa-multiplicity.cxx +++ b/ALICE3/Tasks/alice3-qa-multiplicity.cxx @@ -10,12 +10,22 @@ // or submit itself to any jurisdiction. /// \author Nicolo' Jacazio , CERN -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/ALICE3/Tasks/alice3-qa-singleparticle.cxx b/ALICE3/Tasks/alice3-qa-singleparticle.cxx index 70559fdd33c..fcd3f92bbc9 100644 --- a/ALICE3/Tasks/alice3-qa-singleparticle.cxx +++ b/ALICE3/Tasks/alice3-qa-singleparticle.cxx @@ -15,14 +15,29 @@ /// \brief Task to monitor the single particle QA, at the particle and track level, showing the tracked and the origin of particles /// +#include +#include +#include #include +#include #include +#include +#include #include +#include #include #include +#include +#include #include +#include +#include + +#include +#include +#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx b/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx index b6c8058f747..67ada10b571 100644 --- a/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx +++ b/ALICE3/Tasks/alice3-taskcorrelationDDbar.cxx @@ -14,17 +14,26 @@ /// /// \author Fabio Colamaria , INFN Bari -#include - -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - #include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/Utils/utilsAnalysis.h" #include "PWGHF/HFC/DataModel/CorrelationTables.h" -// #include "PWGHF/DataModel/CandidateReconstructionTables.h" -// #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" + +#include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/Tasks/alice3DecayerQa.cxx b/ALICE3/Tasks/alice3DecayerQa.cxx index ea02c5cb29e..b84d33af111 100644 --- a/ALICE3/Tasks/alice3DecayerQa.cxx +++ b/ALICE3/Tasks/alice3DecayerQa.cxx @@ -19,16 +19,18 @@ #include "ALICE3/DataModel/OTFMCParticle.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamRegistry.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" #include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3Efficiency.cxx b/ALICE3/Tasks/alice3Efficiency.cxx index 7741ea24696..bb44f33a6e2 100644 --- a/ALICE3/Tasks/alice3Efficiency.cxx +++ b/ALICE3/Tasks/alice3Efficiency.cxx @@ -17,16 +17,24 @@ /// \since May 27, 2025 /// +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include #include +#include #include -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/ConfigParamRegistry.h" -#include "TEfficiency.h" -#include "THashList.h" - using namespace o2; using namespace o2::framework; std::map effVsPt; diff --git a/ALICE3/Tasks/alice3HfTask3Prong.cxx b/ALICE3/Tasks/alice3HfTask3Prong.cxx index b962c368932..4f21bada994 100644 --- a/ALICE3/Tasks/alice3HfTask3Prong.cxx +++ b/ALICE3/Tasks/alice3HfTask3Prong.cxx @@ -14,16 +14,11 @@ /// \author Marcello Di Costanzo , Polytechnic University of Turin and INFN Turin #include "ALICE3/DataModel/A3DecayFinderTables.h" -#include "ALICE3/DataModel/OTFPIDTrk.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/RICH.h" #include "ALICE3/Utils/utilsHfAlice3.h" #include "ALICE3/Utils/utilsSelectionsAlice3.h" #include "Common/Core/RecoDecay.h" #include -#include #include #include #include @@ -33,12 +28,12 @@ #include #include #include -#include #include #include +#include #include -#include +#include #include #include diff --git a/ALICE3/Tasks/alice3Multicharm.cxx b/ALICE3/Tasks/alice3Multicharm.cxx index 41ff2f2b38a..56689b48530 100644 --- a/ALICE3/Tasks/alice3Multicharm.cxx +++ b/ALICE3/Tasks/alice3Multicharm.cxx @@ -20,43 +20,28 @@ // Uses specific ALICE 3 PID and performance for studying // HF decays. Work in progress: use at your own risk! -#include "ALICE3/DataModel/A3DecayFinderTables.h" #include "ALICE3/DataModel/OTFMulticharm.h" -#include "ALICE3/DataModel/OTFRICH.h" -#include "ALICE3/DataModel/OTFStrangeness.h" -#include "ALICE3/DataModel/OTFTOF.h" -#include "ALICE3/DataModel/tracksAlice3.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.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 "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexer.h" -#include "DetectorsVertexing/PVertexerHelpers.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.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 using namespace o2; diff --git a/ALICE3/Tasks/alice3PidEvaluation.cxx b/ALICE3/Tasks/alice3PidEvaluation.cxx index 2ee64ea7623..888b7a27dde 100644 --- a/ALICE3/Tasks/alice3PidEvaluation.cxx +++ b/ALICE3/Tasks/alice3PidEvaluation.cxx @@ -23,23 +23,24 @@ #include "ALICE3/DataModel/OTFPIDTrk.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CommonUtils/NameConf.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" - -#include "TH1F.h" -#include "TH2F.h" -#include "TProfile.h" -#include "TVector3.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include #include +#include +#include #include #include #include diff --git a/ALICE3/Tasks/alice3SeparationPower.cxx b/ALICE3/Tasks/alice3SeparationPower.cxx index 2c7a829f5bb..77f425d36d4 100644 --- a/ALICE3/Tasks/alice3SeparationPower.cxx +++ b/ALICE3/Tasks/alice3SeparationPower.cxx @@ -17,21 +17,25 @@ /// \since May 13, 2025 /// -#include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" #include +#include #include +#include #include -#include +#include +#include #include #include #include +#include -#include +#include +#include +#include #include -#include #include using namespace o2; diff --git a/ALICE3/Tasks/alice3Strangeness.cxx b/ALICE3/Tasks/alice3Strangeness.cxx index 3b539616fab..499624cd6bf 100644 --- a/ALICE3/Tasks/alice3Strangeness.cxx +++ b/ALICE3/Tasks/alice3Strangeness.cxx @@ -24,33 +24,25 @@ #include "ALICE3/DataModel/tracksAlice3.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.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 using namespace o2; diff --git a/ALICE3/Tasks/alice3TrackingPerformance.cxx b/ALICE3/Tasks/alice3TrackingPerformance.cxx index a5958bab772..fe903bf6176 100644 --- a/ALICE3/Tasks/alice3TrackingPerformance.cxx +++ b/ALICE3/Tasks/alice3TrackingPerformance.cxx @@ -19,14 +19,24 @@ #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamRegistry.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include #include +#include #include using namespace o2; diff --git a/ALICE3/Tasks/pidFTOFqa.cxx b/ALICE3/Tasks/pidFTOFqa.cxx index 52dbaf8dcfa..ba899e4dc85 100644 --- a/ALICE3/Tasks/pidFTOFqa.cxx +++ b/ALICE3/Tasks/pidFTOFqa.cxx @@ -9,14 +9,19 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// O2 includes -#include "ReconstructionDataFormats/Track.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" #include "ALICE3/DataModel/FTOF.h" -#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/ALICE3/Tasks/pidRICHqa.cxx b/ALICE3/Tasks/pidRICHqa.cxx index 3a8a960b4ed..4a420ffe34f 100644 --- a/ALICE3/Tasks/pidRICHqa.cxx +++ b/ALICE3/Tasks/pidRICHqa.cxx @@ -15,12 +15,28 @@ /// \brief Task to produce QA output of the PID with ALICE3 RICH running on the MC. /// -// O2 includes #include "ALICE3/DataModel/RICH.h" #include "Common/DataModel/PIDResponseTOF.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/PID.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::track; @@ -36,7 +52,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" +#include namespace o2::aod { diff --git a/ALICE3/Utils/utilsHfAlice3.h b/ALICE3/Utils/utilsHfAlice3.h index b0106f739e4..04d089f8a58 100644 --- a/ALICE3/Utils/utilsHfAlice3.h +++ b/ALICE3/Utils/utilsHfAlice3.h @@ -19,6 +19,11 @@ #include "PWGHF/Core/HfHelper.h" +#include "Common/Core/RecoDecay.h" + +#include +#include + namespace o2::analysis { diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index f13d9b685ff..beb55ae8fd9 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -481,6 +481,9 @@ struct HfFilter { // Main struct for HF triggers { for (const auto& collision : collisions) { + // all processed collisions + hProcessedEvents->Fill(0); + bool keepEvent[kNtriggersHF]{false}; bool isSelectedTVX = evSel.applyTVX ? collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) : true; bool isSelectedTFBorder = evSel.applyTFBorderCut ? collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) : true; @@ -527,8 +530,6 @@ struct HfFilter { // Main struct for HF triggers currentRun = bc.runNumber(); } - hProcessedEvents->Fill(0); - std::vector> indicesDau2Prong{}, indicesDau2ProngPrompt{}; auto cand2ProngsThisColl = cand2Prongs.sliceBy(hf2ProngPerCollision, thisCollId); diff --git a/EventFiltering/PWGHF/HFFilterHelpers.h b/EventFiltering/PWGHF/HFFilterHelpers.h index fa577f33d6f..639f4c2619e 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -640,6 +640,15 @@ class HfFilterHelper mSigmaPars3Prongs[1] = 0.00176f; mDeltaMassPars3Prongs[0] = -0.013f; mDeltaMassPars3Prongs[1] = 0.00029f; + } else if (recoPass == "2026_pass1") { + mSigmaPars2Prongs[0] = 0.01424f; + mSigmaPars2Prongs[1] = 0.00178f; + mDeltaMassPars2Prongs[0] = 0.004f; + mDeltaMassPars2Prongs[1] = 0.0001f; + mSigmaPars3Prongs[0] = 0.00796f; + mSigmaPars3Prongs[1] = 0.00176f; + mDeltaMassPars3Prongs[0] = 0.004f; + mDeltaMassPars3Prongs[1] = 0.0001f; } else { LOGP(fatal, "Mass resolution parametrisation {} not supported! Please set 2023_pass3", recoPass.data()); } diff --git a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt index b10c105e3c0..a10cc46db09 100644 --- a/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt +++ b/PWGCF/EbyEFluctuations/Tasks/CMakeLists.txt @@ -78,3 +78,8 @@ o2physics_add_dpl_workflow(radial-flow-decorr SOURCES radialFlowDecorr.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(net-prot-cumulants + SOURCES netprotcumulants.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx b/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx new file mode 100644 index 00000000000..66eadcf5369 --- /dev/null +++ b/PWGCF/EbyEFluctuations/Tasks/netprotcumulants.cxx @@ -0,0 +1,2988 @@ +// 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. + +/// \file NetProtCumulants.cxx +/// \brief Task for analyzing efficiency of proton, and net-proton distributions in MC reconstructed and generated, and calculating net-proton cumulants +/// \author Yash Parakh + +#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/PIDResponseITS.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.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/RunningWorkflowInfo.h" +#include "Framework/StepTHn.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 + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +struct NetProtCumulants { + // events + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + // MC + Configurable cfgIsMC{"cfgIsMC", true, "Run MC"}; + // tracks + Configurable cfgCutPtLower{"cfgCutPtLower", 0.2f, "Lower pT cut"}; + Configurable cfgCutPtUpper{"cfgCutPtUpper", 3.0f, "Higher pT cut"}; + Configurable cfgCutEta{"cfgCutEta", 0.8f, "absolute Eta cut"}; + Configurable cfgPIDchoice{"cfgPIDchoice", 1, "PID selection fucntion choice"}; + Configurable cfgCutPtUpperTPC{"cfgCutPtUpperTPC", 0.6f, "Upper pT cut for PID using TPC only"}; + Configurable cfgnSigmaCutTPC{"cfgnSigmaCutTPC", 2.0f, "PID nSigma cut for TPC"}; + Configurable cfgnSigmaCutTOF{"cfgnSigmaCutTOF", 2.0f, "PID nSigma cut for TOF"}; + Configurable cfgnSigmaCutCombTPCTOF{"cfgnSigmaCutCombTPCTOF", 2.0f, "PID nSigma combined cut for TPC and TOF"}; + Configurable cfgCutTpcChi2NCl{"cfgCutTpcChi2NCl", 2.5f, "Maximum TPCchi2NCl"}; + Configurable cfgCutItsChi2NCl{"cfgCutItsChi2NCl", 36.0f, "Maximum ITSchi2NCl"}; + Configurable cfgCutDCAxy{"cfgCutDCAxy", 2.0f, "DCAxy range for tracks"}; + Configurable cfgCutDCAz{"cfgCutDCAz", 2.0f, "DCAz range for tracks"}; + Configurable cfgITScluster{"cfgITScluster", 1, "Minimum Number of ITS cluster"}; + Configurable cfgTPCcluster{"cfgTPCcluster", 80, "Minimum Number of TPC cluster"}; + Configurable cfgTPCnCrossedRows{"cfgTPCnCrossedRows", 70, "Minimum Number of TPC crossed-rows"}; + Configurable cfgUseItsPid{"cfgUseItsPid", true, "Use ITS nSigma Cut"}; + + // Calculation of cumulants central/error + Configurable cfgNSubsample{"cfgNSubsample", 10, "Number of subsamples for ERR"}; + Configurable cfgIsCalculateCentral{"cfgIsCalculateCentral", true, "Calculate Central value"}; + Configurable cfgIsCalculateError{"cfgIsCalculateError", false, "Calculate Error"}; + + // Efficiencies + Configurable> cfgPtBins{"cfgPtBins", {0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0}, "Pt Bins for Efficiency of protons"}; + Configurable> cfgProtonEff{"cfgProtonEff", {0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9}, "Efficiency of protons"}; + Configurable> cfgAntiprotonEff{"cfgAntiprotonEff", {0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9, 0.9}, "Efficiency of anti-protons"}; + + Configurable cfgLoadEff{"cfgLoadEff", true, "Load efficiency from file"}; + Configurable cfgEvSelkNoSameBunchPileup{"cfgEvSelkNoSameBunchPileup", true, "Pileup removal"}; + Configurable cfgUseGoodITSLayerAllCut{"cfgUseGoodITSLayerAllCut", true, "Remove time interval with dead ITS zone"}; + Configurable cfgIfRejectElectron{"cfgIfRejectElectron", true, "Remove electrons"}; + Configurable cfgIfMandatoryTOF{"cfgIfMandatoryTOF", true, "Mandatory TOF requirement to remove pileup"}; + Configurable cfgEvSelkIsVertexTOFmatched{"cfgEvSelkIsVertexTOFmatched", true, "If matched with TOF, for pileup"}; + ConfigurableAxis cfgCentralityBins{"cfgCentralityBins", {90, 0., 90.}, "Centrality/Multiplicity percentile bining"}; + + // Connect to ccdb + Service ccdb; + Configurable ccdbNoLaterThan{"ccdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable ccdbUrl{"ccdbUrl", "https://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbPath{"ccdbPath", "Users/s/swati/EtavsPtEfficiency_LHC24f3b_PIDchoice0", "CCDB path to ccdb object containing eff(pt, eta) in 2D hist"}; + + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + TRandom3* fRndm = new TRandom3(0); + + // Eff histograms 2d: eff(pT, eta) + TH2F* hRatio2DEtaVsPtProton = nullptr; + TH2F* hRatio2DEtaVsPtAntiproton = nullptr; + + // Filter command for rec (data)*********** + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + Filter trackFilter = (nabs(aod::track::eta) < cfgCutEta) && (aod::track::pt > cfgCutPtLower) && (aod::track::pt < 5.0f) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && (aod::track::tpcChi2NCl < cfgCutTpcChi2NCl) && (aod::track::itsChi2NCl < cfgCutItsChi2NCl) && (nabs(aod::track::dcaZ) < cfgCutDCAz) && (nabs(aod::track::dcaXY) < cfgCutDCAxy); + + // filtering collisions and tracks for real data*********** + using AodCollisions = soa::Filtered>; + using AodTracks = soa::Filtered>; + + // filtering collisions and tracks for MC rec data*********** + using MyMCRecCollisions = soa::Filtered>; + using MyMCRecCollision = MyMCRecCollisions::iterator; + using MyMCTracks = soa::Filtered>; + using EventCandidatesMC = soa::Join; + + // Equivalent of the AliRoot task UserCreateOutputObjects + void init(o2::framework::InitContext&) + { + // Loading efficiency histograms from ccdb + if (cfgLoadEff) { + + // Accessing eff histograms + ccdb->setURL(ccdbUrl.value); + // Enabling object caching, otherwise each call goes to the CCDB server + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + // Not later than now, will be replaced by the value of the train creation + // This avoids that users can replace objects **while** a train is running + ccdb->setCreatedNotAfter(ccdbNoLaterThan.value); + LOGF(info, "Getting object %s", ccdbPath.value.data()); + TList* lst = ccdb->getForTimeStamp(ccdbPath.value, ccdbNoLaterThan.value); + hRatio2DEtaVsPtProton = reinterpret_cast(lst->FindObject("hRatio2DEtaVsPtProton")); + hRatio2DEtaVsPtAntiproton = reinterpret_cast(lst->FindObject("hRatio2DEtaVsPtAntiproton")); + if (!hRatio2DEtaVsPtProton || !hRatio2DEtaVsPtAntiproton) + LOGF(info, "FATAL!! could not get efficiency---------> check"); + } + + // Define your axes + // Constant bin width axis + AxisSpec vtxZAxis = {100, -20, 20}; + // Variable bin width axis + std::vector ptBinning = {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, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8, 3.9, 4.0}; + AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; + std::vector etaBinning = {-0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8}; + AxisSpec etaAxis = {etaBinning, "#it{#eta}"}; + // std::vector centBining = {0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90}; + // AxisSpec centAxis = {centBining, "Multiplicity percentile from FT0C (%)"}; + const AxisSpec centAxis{cfgCentralityBins, "Multiplicity percentile from FT0C (%)"}; + AxisSpec netprotonAxis = {41, -20.5, 20.5, "net-proton number"}; + AxisSpec protonAxis = {21, -0.5, 20.5, "proton number"}; + AxisSpec antiprotonAxis = {21, -0.5, 20.5, "antiproton number"}; + AxisSpec nSigmaAxis = {200, -5.0, 5.0, "nSigma(Proton)"}; + + auto noSubsample = static_cast(cfgNSubsample); + float maxSubsample = 1.0 * noSubsample; + AxisSpec subsampleAxis = {noSubsample, 0.0, maxSubsample, "subsample no."}; + + // For purity (data) + AxisSpec nSigmaWideAxis = {400, -10.0, 10.0, "nSigma"}; + + histos.add("h2_nSigmaTPC_p", "nSigmaTPC vs pT (proton candidates);pT; nSigmaTPC", + kTH2F, {ptAxis, nSigmaWideAxis}); + + histos.add("h2_nSigmaTPC_ap", "nSigmaTPC vs pT (antiproton candidates);pT; nSigmaTPC", + kTH2F, {ptAxis, nSigmaWideAxis}); + + histos.add("h2_nSigmaTOF_p", "nSigmaTOF vs pT (proton candidates);pT; nSigmaTOF", + kTH2F, {ptAxis, nSigmaWideAxis}); + + histos.add("h2_nSigmaTOF_ap", "nSigmaTOF vs pT (antiproton candidates);pT; nSigmaTOF", + kTH2F, {ptAxis, nSigmaWideAxis}); + + // histograms for events + histos.add("hZvtx_after", "Vertex dist. after event selection;Z (cm)", kTH1F, {vtxZAxis}); + histos.add("hCentrec", "MCRec Multiplicity percentile from FT0C (%)", kTH1F, {{100, 0.0, 100.0}}); + // tracks Rec level histograms + histos.add("hrecPtAll", "Reconstructed All particles;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPtProton", "Reconstructed Protons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPtAntiproton", "Reconstructed Antiprotons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPhiAll", "Reconstructed All particles;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hrecPhiProton", "Reconstructed Protons;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hrecPhiAntiproton", "Reconstructed Antiprotons;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hrecEtaAll", "Reconstructed All particles;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hrecEtaProton", "Reconstructed Proton;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hrecEtaAntiproton", "Reconstructed Antiprotons;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hrecDcaXYAll", "Reconstructed All particles;DCA_{xy} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaXYProton", "Reconstructed Proton;DCA_{xy} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaXYAntiproton", "Reconstructed Antiprotons;DCA_{xy} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaZAll", "Reconstructed All particles;DCA_{z} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaZProton", "Reconstructed Proton;DCA_{z} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecDcaZAntiproton", "Reconstructed Antiprotons;DCA_{z} (in cm)", kTH1F, {{400, -2.0, 2.0}}); + histos.add("hrecPtDistProtonVsCentrality", "Reconstructed proton number vs centrality in 2D", kTH2F, {ptAxis, centAxis}); + histos.add("hrecPtDistAntiprotonVsCentrality", "Reconstructed antiproton number vs centrality in 2D", kTH2F, {ptAxis, centAxis}); + histos.add("hrecNetProtonVsCentrality", "Reconstructed net-proton number vs centrality in 2D", kTH2F, {netprotonAxis, centAxis}); + histos.add("hrecProtonVsCentrality", "Reconstructed proton number vs centrality in 2D", kTH2F, {protonAxis, centAxis}); + histos.add("hrecAntiprotonVsCentrality", "Reconstructed antiproton number vs centrality in 2D", kTH2F, {antiprotonAxis, centAxis}); + histos.add("hrecProfileTotalProton", "Reconstructed total proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hrecProfileProton", "Reconstructed proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hrecProfileAntiproton", "Reconstructed antiproton number vs. centrality", kTProfile, {centAxis}); + histos.add("hCorrProfileTotalProton", "Eff. Corrected total proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hCorrProfileProton", "Eff. Corrected proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hCorrProfileAntiproton", "Eff. Corrected antiproton number vs. centrality", kTProfile, {centAxis}); + histos.add("hrec2DEtaVsPtProton", "2D hist of Reconstructed Proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis}); + histos.add("hrec2DEtaVsPtAntiproton", "2D hist of Reconstructed Anti-proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis}); + histos.add("hgen2DEtaVsPtProton", "2D hist of Generated Proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis}); + histos.add("hgen2DEtaVsPtAntiproton", "2D hist of Generated Anti-proton y: eta vs. x: pT", kTH2F, {ptAxis, etaAxis}); + + // 2D histograms of nSigma + histos.add("h2DnsigmaTpcVsPt", "2D hist of nSigmaTPC vs. pT", kTH2F, {ptAxis, nSigmaAxis}); + histos.add("h2DnsigmaTofVsPt", "2D hist of nSigmaTOF vs. pT", kTH2F, {ptAxis, nSigmaAxis}); + histos.add("h2DnsigmaItsVsPt", "2D hist of nSigmaITS vs. pT", kTH2F, {ptAxis, nSigmaAxis}); + + if (cfgIsCalculateCentral) { + // uncorrected + histos.add("Prof_mu1_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu2_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu3_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu4_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu5_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu6_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu7_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_mu8_netproton", "", {HistType::kTProfile, {centAxis}}); + + // eff. corrected + histos.add("Prof_Q11_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_3", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_4", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q21_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q22_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q31_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q32_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q33_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q41_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q42_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q43_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q44_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q21_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q22_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3132_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3132_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3132_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3133_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3133_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3133_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3233_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3233_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q3233_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2241_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2241_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2241_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2242_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2242_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2242_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2243_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2243_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2243_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2244_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2244_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2244_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2141_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2141_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2141_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2142_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2142_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2142_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2143_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2143_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2143_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2144_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2144_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2144_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1151_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1151_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1151_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1152_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1152_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1152_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1153_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1153_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1153_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1154_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1154_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1154_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1155_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1155_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1155_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2221_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2122_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_02", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_12", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_22", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_02", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_12", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_22", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_200", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_201", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_210", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_211", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1131_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1132_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1133_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_5", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q11_6", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_40", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1121_41", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_30", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_31", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_40", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1122_41", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2211_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2111_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_001", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_010", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_100", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_011", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_101", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_110", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1141_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1142_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1143_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_20", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q1144_21", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2131_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2131_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2131_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2132_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2132_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2132_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2133_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2133_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2133_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2231_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2231_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2231_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2232_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2232_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2232_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2233_11", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2233_01", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q2233_10", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q51_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q52_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q53_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q54_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q55_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q21_3", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q22_3", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q31_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q32_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q33_2", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q61_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q62_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q63_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q64_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q65_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q66_1", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112122_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112131_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112132_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112133_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112231_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112232_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112233_111", "", {HistType::kTProfile, {centAxis}}); + histos.add("Prof_Q112221_111", "", {HistType::kTProfile, {centAxis}}); + } + + if (cfgIsCalculateError) { + // uncorrected + histos.add("Prof2D_mu1_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu2_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu3_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu4_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu5_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu6_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu7_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_mu8_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + + // eff. corrected + histos.add("Prof2D_Q11_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_3", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_4", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q21_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q22_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q31_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q32_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q33_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q41_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q42_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q43_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q44_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q21_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q22_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3132_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3132_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3132_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3133_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3133_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3133_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3233_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3233_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q3233_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2241_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2241_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2241_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2242_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2242_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2242_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2243_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2243_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2243_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2244_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2244_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2244_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2141_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2141_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2141_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2142_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2142_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2142_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2143_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2143_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2143_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2144_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2144_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2144_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1151_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1151_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1151_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1152_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1152_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1152_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1153_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1153_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1153_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1154_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1154_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1154_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1155_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1155_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1155_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2221_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2122_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_02", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_12", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_22", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_02", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_12", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_22", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_200", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_201", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_210", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_211", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1131_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1132_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1133_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_5", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q11_6", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_40", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1121_41", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_30", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_31", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_40", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1122_41", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2211_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2111_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_001", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_010", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_100", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_011", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_101", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_110", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1141_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1142_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1143_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_20", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q1144_21", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2131_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2131_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2131_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2132_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2132_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2132_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2133_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2133_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2133_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2231_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2231_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2231_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2232_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2232_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2232_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2233_11", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2233_01", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q2233_10", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q51_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q52_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q53_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q54_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q55_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q21_3", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q22_3", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q31_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q32_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q33_2", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q61_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q62_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q63_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q64_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q65_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q66_1", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112122_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112131_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112132_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112133_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112231_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112232_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112233_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("Prof2D_Q112221_111", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + } + + if (cfgIsMC) { + // MC event counts + histos.add("hMC", "MC Event statistics", kTH1F, {{10, 0.0f, 10.0f}}); + histos.add("hCentgen", "MCGen Multiplicity percentile from FT0C (%)", kTH1F, {{100, 0.0, 100.0}}); + // tracks Gen level histograms + histos.add("hgenPtAll", "Generated All particles;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hgenPtProton", "Generated Protons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hgenPtAntiproton", "Generated Antiprotons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPartPtAll", "Reconstructed All particles filled mcparticle pt;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPartPtProton", "Reconstructed Protons filled mcparticle pt;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecPartPtAntiproton", "Reconstructed Antiprotons filled mcparticle pt;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hgenPhiAll", "Generated All particles;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hgenPhiProton", "Generated Protons;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hgenPhiAntiproton", "Generated Antiprotons;#phi", kTH1F, {{100, 0., 7.}}); + histos.add("hgenEtaAll", "Generated All particles;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hgenEtaProton", "Generated Proton;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hgenEtaAntiproton", "Generated Antiprotons;#eta", kTH1F, {{100, -2.01, 2.01}}); + histos.add("hgenPtDistProtonVsCentrality", "Generated proton number vs centrality in 2D", kTH2F, {ptAxis, centAxis}); + histos.add("hgenPtDistAntiprotonVsCentrality", "Generated antiproton number vs centrality in 2D", kTH2F, {ptAxis, centAxis}); + histos.add("hrecTruePtProton", "Reconstructed pdgcode verified protons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hrecTruePtAntiproton", "Reconstructed pdgcode verified Antiprotons;#it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + histos.add("hgenNetProtonVsCentrality", "Generated net-proton number vs centrality in 2D", kTH2F, {netprotonAxis, centAxis}); + histos.add("hgenProtonVsCentrality", "Generated proton number vs centrality in 2D", kTH2F, {protonAxis, centAxis}); + histos.add("hgenAntiprotonVsCentrality", "Generated antiproton number vs centrality in 2D", kTH2F, {antiprotonAxis, centAxis}); + histos.add("hgenProfileTotalProton", "Generated total proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hgenProfileProton", "Generated proton number vs. centrality", kTProfile, {centAxis}); + histos.add("hgenProfileAntiproton", "Generated antiproton number vs. centrality", kTProfile, {centAxis}); + + if (cfgIsCalculateCentral) { + histos.add("GenProf_mu1_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu2_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu3_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu4_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu5_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu6_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu7_netproton", "", {HistType::kTProfile, {centAxis}}); + histos.add("GenProf_mu8_netproton", "", {HistType::kTProfile, {centAxis}}); + } + + if (cfgIsCalculateError) { + histos.add("GenProf2D_mu1_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu2_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu3_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu4_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu5_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu6_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu7_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + histos.add("GenProf2D_mu8_netproton", "", {HistType::kTProfile2D, {centAxis, subsampleAxis}}); + } + } + } // end init() + + template + bool selectionPIDold(const T& candidate) + { + if (!candidate.hasTPC()) + return false; + + //! PID checking as done in Run2 my analysis + //! ---------------------------------------------------------------------- + int flag = 0; //! pid check main flag + + if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) { + if (std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC) { + flag = 1; + } + } + if (candidate.hasTOF() && candidate.pt() > cfgCutPtUpperTPC && candidate.pt() < 5.0f) { + const float combNSigmaPr = std::sqrt(std::pow(candidate.tpcNSigmaPr(), 2.0) + std::pow(candidate.tofNSigmaPr(), 2.0)); + const float combNSigmaPi = std::sqrt(std::pow(candidate.tpcNSigmaPi(), 2.0) + std::pow(candidate.tofNSigmaPi(), 2.0)); + const float combNSigmaKa = std::sqrt(std::pow(candidate.tpcNSigmaKa(), 2.0) + std::pow(candidate.tofNSigmaKa(), 2.0)); + + int flag2 = 0; + if (combNSigmaPr < 3.0) + flag2 += 1; + if (combNSigmaPi < 3.0) + flag2 += 1; + if (combNSigmaKa < 3.0) + flag2 += 1; + if (!(flag2 > 1) && !(combNSigmaPr > combNSigmaPi) && !(combNSigmaPr > combNSigmaKa)) { + if (combNSigmaPr < cfgnSigmaCutCombTPCTOF) { + flag = 1; + } + } + } + if (flag == 1) + return true; + else + return false; + } + + template + bool selectionPIDoldTOFveto(const T& candidate) + { + if (!candidate.hasTPC()) + return false; + + //! PID checking as done in Run2 my analysis + //! ---------------------------------------------------------------------- + int flag = 0; //! pid check main flag + + if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) { + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC) { + flag = 1; + } + if (candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOF) { + flag = 1; + } + } + if (candidate.hasTOF() && candidate.pt() > cfgCutPtUpperTPC && candidate.pt() < 5.0f) { + const float combNSigmaPr = std::sqrt(std::pow(candidate.tpcNSigmaPr(), 2.0) + std::pow(candidate.tofNSigmaPr(), 2.0)); + const float combNSigmaPi = std::sqrt(std::pow(candidate.tpcNSigmaPi(), 2.0) + std::pow(candidate.tofNSigmaPi(), 2.0)); + const float combNSigmaKa = std::sqrt(std::pow(candidate.tpcNSigmaKa(), 2.0) + std::pow(candidate.tofNSigmaKa(), 2.0)); + + int flag2 = 0; + if (combNSigmaPr < 3.0) + flag2 += 1; + if (combNSigmaPi < 3.0) + flag2 += 1; + if (combNSigmaKa < 3.0) + flag2 += 1; + if (!(flag2 > 1) && !(combNSigmaPr > combNSigmaPi) && !(combNSigmaPr > combNSigmaKa)) { + if (combNSigmaPr < cfgnSigmaCutCombTPCTOF) { + flag = 1; + } + } + } + if (flag == 1) + return true; + else + return false; + } + + // electron rejection function + template + bool isElectron(const T& candidate) // Victor's BF analysis + { + if (candidate.tpcNSigmaEl() > -3.0f && candidate.tpcNSigmaEl() < 5.0f && std::abs(candidate.tpcNSigmaPi()) > 3.0f && std::abs(candidate.tpcNSigmaKa()) > 3.0f && std::abs(candidate.tpcNSigmaPr()) > 3.0f) { + return true; + } + return false; + } + + template + bool selectionPIDnew(const T& candidate) // Victor's BF analysis + { + // electron rejection + if (candidate.tpcNSigmaEl() > -3.0f && candidate.tpcNSigmaEl() < 5.0f && std::abs(candidate.tpcNSigmaPi()) > 3.0f && std::abs(candidate.tpcNSigmaKa()) > 3.0f && std::abs(candidate.tpcNSigmaPr()) > 3.0f) { + return false; + } + + //! if pt < threshold + if (candidate.pt() > 0.2f && candidate.pt() <= cfgCutPtUpperTPC) { + if (!candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaPi()) > cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaKa()) > cfgnSigmaCutTPC) { + return true; + } + if (candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaPi()) > cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaKa()) > cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOF && std::abs(candidate.tofNSigmaPi()) > cfgnSigmaCutTOF && std::abs(candidate.tofNSigmaKa()) > cfgnSigmaCutTOF) { + return true; + } + } + + //! if pt > threshold + if (candidate.pt() > cfgCutPtUpperTPC) { + if (candidate.hasTOF() && std::abs(candidate.tpcNSigmaPr()) < cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaPi()) > cfgnSigmaCutTPC && std::abs(candidate.tpcNSigmaKa()) > cfgnSigmaCutTPC && std::abs(candidate.tofNSigmaPr()) < cfgnSigmaCutTOF && std::abs(candidate.tofNSigmaPi()) > cfgnSigmaCutTOF && std::abs(candidate.tofNSigmaKa()) > cfgnSigmaCutTOF) { + return true; + } + } + return false; + } + + // Function to check which pt bin the track lies in and assign the corresponding efficiency + + template + float getEfficiency(const T& candidate) + { + // Load eff from histograms in CCDB + if (cfgLoadEff) { + if (candidate.sign() > 0) { + float effmeanval = hRatio2DEtaVsPtProton->GetBinContent(hRatio2DEtaVsPtProton->FindBin(candidate.pt(), candidate.eta())); + return effmeanval; + } + if (candidate.sign() < 0) { + float effmeanval = hRatio2DEtaVsPtAntiproton->GetBinContent(hRatio2DEtaVsPtAntiproton->FindBin(candidate.pt(), candidate.eta())); + return effmeanval; + } + return 0.0; + } else { + // Find the pt bin index based on the track's pt value + int binIndex = -1; + + for (int i = 0; i < 16; ++i) { + if (candidate.pt() >= cfgPtBins.value[i] && candidate.pt() < cfgPtBins.value[i + 1]) { + binIndex = i; + break; + } + } + // If the pt is outside the defined bins, return a default efficiency or handle it differently + if (binIndex == -1) { + return 0.0; // Default efficiency (0% if outside bins) + } + if (candidate.sign() > 0) + return cfgProtonEff.value[binIndex]; + if (candidate.sign() < 0) + return cfgAntiprotonEff.value[binIndex]; + return 0.0; + } + } + + void processMCGen(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups& collisions) + { + histos.fill(HIST("hMC"), 0.5); + if (std::abs(mcCollision.posZ()) < cfgCutVertex) { + histos.fill(HIST("hMC"), 1.5); + } + auto cent = 0; + + int nchInel = 0; + for (const auto& mcParticle : mcParticles) { + auto pdgcode = std::abs(mcParticle.pdgCode()); + if (mcParticle.isPhysicalPrimary() && (pdgcode == PDG_t::kPiPlus || pdgcode == PDG_t::kKPlus || pdgcode == PDG_t::kProton || pdgcode == PDG_t::kElectron || pdgcode == PDG_t::kMuonMinus)) { + if (std::abs(mcParticle.eta()) < 1.0) { + nchInel = nchInel + 1; + } + } + } + if (nchInel > 0 && std::abs(mcCollision.posZ()) < cfgCutVertex) + histos.fill(HIST("hMC"), 2.5); + std::vector selectedEvents(collisions.size()); + int nevts = 0; + + for (const auto& collision : collisions) { + if (!collision.sel8() || std::abs(collision.mcCollision().posZ()) > cfgCutVertex) { + continue; + } + if (cfgUseGoodITSLayerAllCut && !(collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll))) { + continue; + } + if (cfgEvSelkNoSameBunchPileup && !(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + continue; + } + if (cfgEvSelkIsVertexTOFmatched && !(collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) { + continue; + } + + cent = collision.centFT0C(); + + selectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + } + selectedEvents.resize(nevts); + const auto evtReconstructedAndSelected = std::find(selectedEvents.begin(), selectedEvents.end(), mcCollision.globalIndex()) != selectedEvents.end(); + histos.fill(HIST("hMC"), 3.5); + if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection + return; + } + histos.fill(HIST("hMC"), 4.5); + histos.fill(HIST("hCentgen"), cent); + + // creating phi, pt, eta dstribution of generted MC particles + + float nProt = 0.0; + float nAntiprot = 0.0; + + for (const auto& mcParticle : mcParticles) { + if (!mcParticle.has_mcCollision()) + continue; + + if (mcParticle.isPhysicalPrimary()) { + if ((mcParticle.pt() > cfgCutPtLower) && (mcParticle.pt() < 5.0f) && (std::abs(mcParticle.eta()) < cfgCutEta)) { + histos.fill(HIST("hgenPtAll"), mcParticle.pt()); + histos.fill(HIST("hgenEtaAll"), mcParticle.eta()); + histos.fill(HIST("hgenPhiAll"), mcParticle.phi()); + + if (std::abs(mcParticle.pdgCode()) == PDG_t::kProton /*&& std::abs(mcParticle.y()) < 0.5*/) { + if (mcParticle.pdgCode() == PDG_t::kProton) { + histos.fill(HIST("hgenPtProton"), mcParticle.pt()); //! hist for p gen + histos.fill(HIST("hgenPtDistProtonVsCentrality"), mcParticle.pt(), cent); + histos.fill(HIST("hgen2DEtaVsPtProton"), mcParticle.pt(), mcParticle.eta()); + histos.fill(HIST("hgenEtaProton"), mcParticle.eta()); + histos.fill(HIST("hgenPhiProton"), mcParticle.phi()); + if (mcParticle.pt() < cfgCutPtUpper) + nProt = nProt + 1.0; + } + if (mcParticle.pdgCode() == PDG_t::kProtonBar) { + histos.fill(HIST("hgenPtAntiproton"), mcParticle.pt()); //! hist for anti-p gen + histos.fill(HIST("hgenPtDistAntiprotonVsCentrality"), mcParticle.pt(), cent); + histos.fill(HIST("hgen2DEtaVsPtAntiproton"), mcParticle.pt(), mcParticle.eta()); + histos.fill(HIST("hgenEtaAntiproton"), mcParticle.eta()); + histos.fill(HIST("hgenPhiAntiproton"), mcParticle.phi()); + if (mcParticle.pt() < cfgCutPtUpper) + nAntiprot = nAntiprot + 1.0; + } + } + } + } + } //! end particle loop + + float netProt = nProt - nAntiprot; + histos.fill(HIST("hgenNetProtonVsCentrality"), netProt, cent); + histos.fill(HIST("hgenProtonVsCentrality"), nProt, cent); + histos.fill(HIST("hgenAntiprotonVsCentrality"), nAntiprot, cent); + histos.fill(HIST("hgenProfileTotalProton"), cent, (nProt + nAntiprot)); + histos.fill(HIST("hgenProfileProton"), cent, nProt); + histos.fill(HIST("hgenProfileAntiproton"), cent, nAntiprot); + + // Profiles for generated level cumulants + //------------------------------------------------------------------------------------------- + + if (cfgIsCalculateCentral) { + histos.get(HIST("GenProf_mu1_netproton"))->Fill(cent, std::pow(netProt, 1.0)); + histos.get(HIST("GenProf_mu2_netproton"))->Fill(cent, std::pow(netProt, 2.0)); + histos.get(HIST("GenProf_mu3_netproton"))->Fill(cent, std::pow(netProt, 3.0)); + histos.get(HIST("GenProf_mu4_netproton"))->Fill(cent, std::pow(netProt, 4.0)); + histos.get(HIST("GenProf_mu5_netproton"))->Fill(cent, std::pow(netProt, 5.0)); + histos.get(HIST("GenProf_mu6_netproton"))->Fill(cent, std::pow(netProt, 6.0)); + histos.get(HIST("GenProf_mu7_netproton"))->Fill(cent, std::pow(netProt, 7.0)); + histos.get(HIST("GenProf_mu8_netproton"))->Fill(cent, std::pow(netProt, 8.0)); + } + + if (cfgIsCalculateError) { + + float lRandom = fRndm->Rndm(); + int sampleIndex = static_cast(cfgNSubsample * lRandom); + + histos.get(HIST("GenProf2D_mu1_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 1.0)); + histos.get(HIST("GenProf2D_mu2_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 2.0)); + histos.get(HIST("GenProf2D_mu3_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 3.0)); + histos.get(HIST("GenProf2D_mu4_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 4.0)); + histos.get(HIST("GenProf2D_mu5_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 5.0)); + histos.get(HIST("GenProf2D_mu6_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 6.0)); + histos.get(HIST("GenProf2D_mu7_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 7.0)); + histos.get(HIST("GenProf2D_mu8_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 8.0)); + } + //------------------------------------------------------------------------------------------- + } + PROCESS_SWITCH(NetProtCumulants, processMCGen, "Process Generated", false); + + void processMCRec(MyMCRecCollision const& collision, MyMCTracks const& tracks, aod::McCollisions const&, aod::McParticles const&) + { + if (!collision.has_mcCollision()) { + return; + } + + if (!collision.sel8()) { + return; + } + if (cfgUseGoodITSLayerAllCut && !(collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll))) { + return; + } + if (cfgEvSelkNoSameBunchPileup && !(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + return; + } + if (cfgEvSelkIsVertexTOFmatched && !(collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) { + return; + ; + } + + auto cent = collision.centFT0C(); + histos.fill(HIST("hCentrec"), cent); + histos.fill(HIST("hMC"), 5.5); + histos.fill(HIST("hZvtx_after"), collision.posZ()); + + float nProt = 0.0; + float nAntiprot = 0.0; + std::array powerEffProt = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array powerEffAntiprot = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array fTCP0 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array fTCP1 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + + o2::aod::ITSResponse itsResponse; + + // Start of the Monte-Carlo reconstructed tracks + for (const auto& track : tracks) { + if (!track.has_collision()) { + continue; + } + + if (!track.has_mcParticle()) //! check if track has corresponding MC particle + { + continue; + } + if (!track.isPVContributor()) //! track check as used in data + { + continue; + } + + auto particle = track.mcParticle(); + if (!particle.has_mcCollision()) + continue; + if ((particle.pt() < cfgCutPtLower) || (particle.pt() > 5.0f) || (std::abs(particle.eta()) > cfgCutEta)) { + continue; + } + if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows)) { + continue; + } + + if (particle.isPhysicalPrimary()) { + histos.fill(HIST("hrecPartPtAll"), particle.pt()); + histos.fill(HIST("hrecPtAll"), track.pt()); + histos.fill(HIST("hrecEtaAll"), particle.eta()); + histos.fill(HIST("hrecPhiAll"), particle.phi()); + histos.fill(HIST("hrecDcaXYAll"), track.dcaXY()); + histos.fill(HIST("hrecDcaZAll"), track.dcaZ()); + + // rejecting electron + if (cfgIfRejectElectron && isElectron(track)) { + continue; + } + // use ITS pid as well + if (cfgUseItsPid && (std::abs(itsResponse.nSigmaITS(track)) > 3.0)) { + continue; + } + // required tracks with TOF mandatory to avoid pileup + if (cfgIfMandatoryTOF && !track.hasTOF()) { + continue; + } + + bool trackSelected = false; + if (cfgPIDchoice == 0) + trackSelected = selectionPIDoldTOFveto(track); + if (cfgPIDchoice == 1) + trackSelected = selectionPIDnew(track); + if (cfgPIDchoice == 2) + trackSelected = selectionPIDold(track); + + if (trackSelected) { + // filling nSigma distribution + histos.fill(HIST("h2DnsigmaTpcVsPt"), track.pt(), track.tpcNSigmaPr()); + histos.fill(HIST("h2DnsigmaTofVsPt"), track.pt(), track.tofNSigmaPr()); + histos.fill(HIST("h2DnsigmaItsVsPt"), track.pt(), itsResponse.nSigmaITS(track)); + + if (track.sign() > 0) { + histos.fill(HIST("hrecPartPtProton"), particle.pt()); //! hist for p rec + histos.fill(HIST("hrecPtProton"), track.pt()); //! hist for p rec + histos.fill(HIST("hrecPtDistProtonVsCentrality"), particle.pt(), cent); + histos.fill(HIST("hrec2DEtaVsPtProton"), particle.pt(), particle.eta()); + histos.fill(HIST("hrecEtaProton"), particle.eta()); + histos.fill(HIST("hrecPhiProton"), particle.phi()); + histos.fill(HIST("hrecDcaXYProton"), track.dcaXY()); + histos.fill(HIST("hrecDcaZProton"), track.dcaZ()); + if (particle.pt() < cfgCutPtUpper) { + nProt = nProt + 1.0; + float pEff = getEfficiency(track); // get efficiency of track + if (pEff != 0) { + for (int i = 1; i < 7; i++) { + powerEffProt[i] += std::pow(1.0 / pEff, i); + } + } + } + if (particle.pdgCode() == PDG_t::kProton) { + histos.fill(HIST("hrecTruePtProton"), particle.pt()); //! hist for p purity + } + } + if (track.sign() < 0) { + histos.fill(HIST("hrecPartPtAntiproton"), particle.pt()); //! hist for anti-p rec + histos.fill(HIST("hrecPtAntiproton"), track.pt()); //! hist for anti-p rec + histos.fill(HIST("hrecPtDistAntiprotonVsCentrality"), particle.pt(), cent); + histos.fill(HIST("hrec2DEtaVsPtAntiproton"), particle.pt(), particle.eta()); + histos.fill(HIST("hrecEtaAntiproton"), particle.eta()); + histos.fill(HIST("hrecPhiAntiproton"), particle.phi()); + histos.fill(HIST("hrecDcaXYAntiproton"), track.dcaXY()); + histos.fill(HIST("hrecDcaZAntiproton"), track.dcaZ()); + if (particle.pt() < cfgCutPtUpper) { + nAntiprot = nAntiprot + 1.0; + float pEff = getEfficiency(track); // get efficiency of track + if (pEff != 0) { + for (int i = 1; i < 7; i++) { + powerEffAntiprot[i] += std::pow(1.0 / pEff, i); + } + } + } + if (particle.pdgCode() == PDG_t::kProtonBar) { + histos.fill(HIST("hrecTruePtAntiproton"), particle.pt()); //! hist for anti-p purity + } + } + } //! checking PID + } //! checking if primary + } //! end track loop + + float netProt = nProt - nAntiprot; + histos.fill(HIST("hrecNetProtonVsCentrality"), netProt, cent); + histos.fill(HIST("hrecProtonVsCentrality"), nProt, cent); + histos.fill(HIST("hrecAntiprotonVsCentrality"), nAntiprot, cent); + histos.fill(HIST("hrecProfileTotalProton"), cent, (nProt + nAntiprot)); + histos.fill(HIST("hrecProfileProton"), cent, nProt); + histos.fill(HIST("hrecProfileAntiproton"), cent, nAntiprot); + histos.fill(HIST("hCorrProfileTotalProton"), cent, (powerEffProt[1] + powerEffAntiprot[1])); + histos.fill(HIST("hCorrProfileProton"), cent, powerEffProt[1]); + histos.fill(HIST("hCorrProfileAntiproton"), cent, powerEffAntiprot[1]); + + // Calculating q_{r,s} as required + for (int i = 1; i < 7; i++) { + fTCP0[i] = powerEffProt[i] + powerEffAntiprot[i]; + fTCP1[i] = powerEffProt[i] - powerEffAntiprot[i]; + } + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + float fQ11_1 = fTCP1[1]; + float fQ11_2 = std::pow(fTCP1[1], 2); + float fQ11_3 = std::pow(fTCP1[1], 3); + float fQ11_4 = std::pow(fTCP1[1], 4); + float fQ11_5 = std::pow(fTCP1[1], 5); + float fQ11_6 = std::pow(fTCP1[1], 6); + + float fQ21_3 = std::pow(fTCP0[1], 3); + float fQ22_3 = std::pow(fTCP0[2], 3); + float fQ31_2 = std::pow(fTCP1[1], 2); + float fQ32_2 = std::pow(fTCP1[2], 2); + float fQ33_2 = std::pow(fTCP1[3], 2); + + float fQ61_1 = fTCP0[1]; + float fQ62_1 = fTCP0[2]; + float fQ63_1 = fTCP0[3]; + float fQ64_1 = fTCP0[4]; + float fQ65_1 = fTCP0[5]; + float fQ66_1 = fTCP0[6]; + + float fQ112122_111 = fTCP1[1] * fTCP0[1] * fTCP0[2]; + float fQ112131_111 = fTCP1[1] * fTCP0[1] * fTCP1[1]; + float fQ112132_111 = fTCP1[1] * fTCP0[1] * fTCP1[2]; + float fQ112133_111 = fTCP1[1] * fTCP0[1] * fTCP1[3]; + float fQ112231_111 = fTCP1[1] * fTCP0[2] * fTCP1[1]; + float fQ112232_111 = fTCP1[1] * fTCP0[2] * fTCP1[2]; + float fQ112233_111 = fTCP1[1] * fTCP0[2] * fTCP1[3]; + float fQ112221_111 = fTCP1[1] * fTCP0[2] * fTCP0[1]; + + float fQ21_1 = fTCP0[1]; + float fQ22_1 = fTCP0[2]; + float fQ31_1 = fTCP1[1]; + float fQ32_1 = fTCP1[2]; + float fQ33_1 = fTCP1[3]; + float fQ41_1 = fTCP0[1]; + float fQ42_1 = fTCP0[2]; + float fQ43_1 = fTCP0[3]; + float fQ44_1 = fTCP0[4]; + float fQ21_2 = std::pow(fTCP0[1], 2); + float fQ22_2 = std::pow(fTCP0[2], 2); + float fQ1121_11 = fTCP1[1] * fTCP0[1]; + float fQ1121_01 = fTCP0[1]; + float fQ1121_10 = fTCP1[1]; + float fQ1121_20 = std::pow(fTCP1[1], 2); + float fQ1121_21 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ1122_11 = fTCP1[1] * fTCP0[2]; + float fQ1122_01 = fTCP0[2]; + float fQ1122_10 = fTCP1[1]; + float fQ1122_20 = std::pow(fTCP1[1], 2); + float fQ1122_21 = std::pow(fTCP1[1], 2) * fTCP0[2]; + float fQ1131_11 = fTCP1[1] * fTCP1[1]; + float fQ1131_01 = fTCP1[1]; + float fQ1131_10 = fTCP1[1]; + float fQ1132_11 = fTCP1[1] * fTCP1[2]; + float fQ1132_01 = fTCP1[2]; + float fQ1132_10 = fTCP1[1]; + float fQ1133_11 = fTCP1[1] * fTCP1[3]; + float fQ1133_01 = fTCP1[3]; + float fQ1133_10 = fTCP1[1]; + float fQ2122_11 = fTCP0[1] * fTCP0[2]; + float fQ2122_01 = fTCP0[2]; + float fQ2122_10 = fTCP0[1]; + + ///////////////---------------------> + float fQ3132_11 = fTCP1[1] * fTCP1[2]; + float fQ3132_01 = fTCP1[2]; + float fQ3132_10 = fTCP1[1]; + float fQ3133_11 = fTCP1[1] * fTCP1[3]; + float fQ3133_01 = fTCP1[3]; + float fQ3133_10 = fTCP1[1]; + float fQ3233_11 = fTCP1[2] * fTCP1[3]; + float fQ3233_01 = fTCP1[3]; + float fQ3233_10 = fTCP1[2]; + float fQ2241_11 = fTCP0[2] * fTCP0[1]; + float fQ2241_01 = fTCP0[1]; + float fQ2241_10 = fTCP0[2]; + float fQ2242_11 = fTCP0[2] * fTCP0[2]; + float fQ2242_01 = fTCP0[2]; + float fQ2242_10 = fTCP0[2]; + float fQ2243_11 = fTCP0[2] * fTCP0[3]; + float fQ2243_01 = fTCP0[3]; + float fQ2243_10 = fTCP0[2]; + float fQ2244_11 = fTCP0[2] * fTCP0[4]; + float fQ2244_01 = fTCP0[4]; + float fQ2244_10 = fTCP0[2]; + float fQ2141_11 = fTCP0[1] * fTCP0[1]; + float fQ2141_01 = fTCP0[1]; + float fQ2141_10 = fTCP0[1]; + float fQ2142_11 = fTCP0[1] * fTCP0[2]; + float fQ2142_01 = fTCP0[2]; + float fQ2142_10 = fTCP0[1]; + float fQ2143_11 = fTCP0[1] * fTCP0[3]; + float fQ2143_01 = fTCP0[3]; + float fQ2143_10 = fTCP0[1]; + float fQ2144_11 = fTCP0[1] * fTCP0[4]; + float fQ2144_01 = fTCP0[4]; + float fQ2144_10 = fTCP0[1]; + float fQ1151_11 = fTCP1[1] * fTCP1[1]; + float fQ1151_01 = fTCP1[1]; + float fQ1151_10 = fTCP1[1]; + float fQ1152_11 = fTCP1[1] * fTCP1[2]; + float fQ1152_01 = fTCP1[2]; + float fQ1152_10 = fTCP1[1]; + float fQ1153_11 = fTCP1[1] * fTCP1[3]; + float fQ1153_01 = fTCP1[3]; + float fQ1153_10 = fTCP1[1]; + float fQ1154_11 = fTCP1[1] * fTCP1[4]; + float fQ1154_01 = fTCP1[4]; + float fQ1154_10 = fTCP1[1]; + float fQ1155_11 = fTCP1[1] * fTCP1[5]; + float fQ1155_01 = fTCP1[5]; + float fQ1155_10 = fTCP1[1]; + + float fQ112233_001 = fTCP1[3]; + float fQ112233_010 = fTCP0[2]; + float fQ112233_100 = fTCP1[1]; + float fQ112233_011 = fTCP0[2] * fTCP1[3]; + float fQ112233_101 = fTCP1[1] * fTCP1[3]; + float fQ112233_110 = fTCP1[1] * fTCP0[2]; + float fQ112232_001 = fTCP1[2]; + float fQ112232_010 = fTCP0[2]; + float fQ112232_100 = fTCP1[1]; + float fQ112232_011 = fTCP0[2] * fTCP1[2]; + float fQ112232_101 = fTCP1[1] * fTCP1[2]; + float fQ112232_110 = fTCP1[1] * fTCP0[2]; + // + float fQ112231_001 = fTCP1[1]; + float fQ112231_010 = fTCP0[2]; + float fQ112231_100 = fTCP1[1]; + float fQ112231_011 = fTCP0[2] * fTCP1[1]; + float fQ112231_101 = fTCP1[1] * fTCP1[1]; + float fQ112231_110 = fTCP1[1] * fTCP0[2]; + float fQ112133_001 = fTCP1[3]; + float fQ112133_010 = fTCP0[1]; + float fQ112133_100 = fTCP1[1]; + float fQ112133_011 = fTCP0[1] * fTCP1[3]; + float fQ112133_101 = fTCP1[1] * fTCP1[3]; + float fQ112133_110 = fTCP1[1] * fTCP0[1]; + + float fQ112132_001 = fTCP1[2]; + float fQ112132_010 = fTCP0[1]; + float fQ112132_100 = fTCP1[1]; + float fQ112132_011 = fTCP0[1] * fTCP1[2]; + float fQ112132_101 = fTCP1[1] * fTCP1[2]; + float fQ112132_110 = fTCP1[1] * fTCP0[1]; + float fQ112131_001 = fTCP1[1]; + float fQ112131_010 = fTCP0[1]; + float fQ112131_100 = fTCP1[1]; + float fQ112131_011 = fTCP0[1] * fTCP1[1]; + float fQ112131_101 = fTCP1[1] * fTCP1[1]; + float fQ112131_110 = fTCP1[1] * fTCP0[1]; + + float fQ2221_11 = fTCP0[2] * fTCP0[1]; + float fQ2221_01 = fTCP0[1]; + float fQ2221_10 = fTCP0[2]; + float fQ2221_21 = std::pow(fTCP0[2], 2) * fTCP0[1]; + float fQ2221_20 = std::pow(fTCP0[2], 2); + + float fQ2122_21 = std::pow(fTCP0[1], 2) * fTCP0[2]; + float fQ2122_20 = std::pow(fTCP0[1], 2); + float fQ1121_02 = std::pow(fTCP0[1], 2); + float fQ1121_12 = fTCP1[1] * std::pow(fTCP0[1], 2); + float fQ1121_22 = std::pow(fTCP1[1], 2) * std::pow(fTCP0[1], 2); + float fQ1122_02 = std::pow(fTCP0[2], 2); + float fQ1122_12 = fTCP1[1] * std::pow(fTCP0[2], 2); + float fQ1122_22 = std::pow(fTCP1[1], 2) * std::pow(fTCP0[2], 2); + + float fQ112221_001 = fTCP0[1]; + float fQ112221_010 = fTCP0[2]; + float fQ112221_100 = fTCP1[1]; + float fQ112221_011 = fTCP0[2] * fTCP0[1]; + float fQ112221_101 = fTCP1[1] * fTCP0[1]; + float fQ112221_110 = fTCP1[1] * fTCP0[2]; + float fQ112221_200 = std::pow(fTCP1[1], 2); + float fQ112221_201 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ112221_210 = std::pow(fTCP1[1], 2) * fTCP0[2]; + float fQ112221_211 = std::pow(fTCP1[1], 2) * fTCP0[2] * fTCP0[1]; + float fQ1131_21 = std::pow(fTCP1[1], 2) * fTCP1[1]; + float fQ1131_20 = std::pow(fTCP1[1], 2); + float fQ1131_31 = std::pow(fTCP1[1], 3) * fTCP1[1]; + float fQ1131_30 = std::pow(fTCP1[1], 3); + + float fQ1132_21 = std::pow(fTCP1[1], 2) * fTCP1[2]; + float fQ1132_20 = std::pow(fTCP1[1], 2); + float fQ1132_31 = std::pow(fTCP1[1], 3) * fTCP1[2]; + float fQ1132_30 = std::pow(fTCP1[1], 3); + float fQ1133_21 = std::pow(fTCP1[1], 2) * fTCP1[3]; + float fQ1133_20 = std::pow(fTCP1[1], 2); + float fQ1133_31 = std::pow(fTCP1[1], 3) * fTCP1[3]; + float fQ1133_30 = std::pow(fTCP1[1], 3); + float fQ1121_30 = std::pow(fTCP1[1], 3); + float fQ1121_31 = std::pow(fTCP1[1], 3) * fTCP0[1]; + float fQ1121_40 = std::pow(fTCP1[1], 4); + float fQ1121_41 = std::pow(fTCP1[1], 4) * fTCP0[1]; + float fQ1122_30 = std::pow(fTCP1[1], 3); + float fQ1122_31 = std::pow(fTCP1[1], 3) * fTCP0[2]; + float fQ1122_40 = std::pow(fTCP1[1], 4); + float fQ1122_41 = std::pow(fTCP1[1], 4) * fTCP0[2]; + + float fQ2211_11 = fTCP0[2] * fTCP1[1]; + float fQ2211_01 = fTCP1[1]; + float fQ2211_10 = fTCP0[2]; + float fQ2211_20 = std::pow(fTCP0[2], 2); + float fQ2211_21 = std::pow(fTCP0[2], 2) * fTCP1[1]; + float fQ2111_11 = fTCP0[1] * fTCP1[1]; + float fQ2111_01 = fTCP1[1]; + float fQ2111_10 = fTCP0[1]; + float fQ2111_20 = std::pow(fTCP0[1], 2); + float fQ2111_21 = std::pow(fTCP0[1], 2) * fTCP1[1]; + + float fQ112122_001 = fTCP0[2]; + float fQ112122_010 = fTCP0[1]; + float fQ112122_100 = fTCP1[1]; + float fQ112122_011 = fTCP0[1] * fTCP0[2]; + float fQ112122_101 = fTCP1[1] * fTCP0[2]; + float fQ112122_110 = fTCP1[1] * fTCP0[1]; + + float fQ1141_11 = fTCP1[1] * fTCP0[1]; + float fQ1141_01 = fTCP0[1]; + float fQ1141_10 = fTCP1[1]; + float fQ1141_20 = std::pow(fTCP1[1], 2); + float fQ1141_21 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ1142_11 = fTCP1[1] * fTCP0[2]; + float fQ1142_01 = fTCP0[2]; + float fQ1142_10 = fTCP1[1]; + float fQ1142_20 = std::pow(fTCP1[1], 2); + float fQ1142_21 = std::pow(fTCP1[1], 2) * fTCP0[2]; + + float fQ1143_11 = fTCP1[1] * fTCP0[3]; + float fQ1143_01 = fTCP0[3]; + float fQ1143_10 = fTCP1[1]; + float fQ1143_20 = std::pow(fTCP1[1], 2); + float fQ1143_21 = std::pow(fTCP1[1], 2) * fTCP0[3]; + float fQ1144_11 = fTCP1[1] * fTCP0[4]; + float fQ1144_01 = fTCP0[4]; + float fQ1144_10 = fTCP1[1]; + float fQ1144_20 = std::pow(fTCP1[1], 2); + float fQ1144_21 = std::pow(fTCP1[1], 2) * fTCP0[4]; + float fQ2131_11 = fTCP0[1] * fTCP1[1]; + float fQ2131_01 = fTCP1[1]; + float fQ2131_10 = fTCP0[1]; + + float fQ2132_11 = fTCP0[1] * fTCP1[2]; + float fQ2132_01 = fTCP1[2]; + float fQ2132_10 = fTCP0[1]; + float fQ2133_11 = fTCP0[1] * fTCP1[3]; + float fQ2133_01 = fTCP1[3]; + float fQ2133_10 = fTCP0[1]; + float fQ2231_11 = fTCP0[2] * fTCP1[1]; + float fQ2231_01 = fTCP1[1]; + float fQ2231_10 = fTCP0[2]; + float fQ2232_11 = fTCP0[2] * fTCP1[2]; + float fQ2232_01 = fTCP1[2]; + float fQ2232_10 = fTCP0[2]; + float fQ2233_11 = fTCP0[2] * fTCP1[3]; + float fQ2233_01 = fTCP1[3]; + float fQ2233_10 = fTCP0[2]; + + float fQ51_1 = fTCP1[1]; + float fQ52_1 = fTCP1[2]; + float fQ53_1 = fTCP1[3]; + float fQ54_1 = fTCP1[4]; + float fQ55_1 = fTCP1[5]; + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + if (cfgIsCalculateCentral) { + + // uncorrected + histos.get(HIST("Prof_mu1_netproton"))->Fill(cent, std::pow(netProt, 1.0)); + histos.get(HIST("Prof_mu2_netproton"))->Fill(cent, std::pow(netProt, 2.0)); + histos.get(HIST("Prof_mu3_netproton"))->Fill(cent, std::pow(netProt, 3.0)); + histos.get(HIST("Prof_mu4_netproton"))->Fill(cent, std::pow(netProt, 4.0)); + histos.get(HIST("Prof_mu5_netproton"))->Fill(cent, std::pow(netProt, 5.0)); + histos.get(HIST("Prof_mu6_netproton"))->Fill(cent, std::pow(netProt, 6.0)); + histos.get(HIST("Prof_mu7_netproton"))->Fill(cent, std::pow(netProt, 7.0)); + histos.get(HIST("Prof_mu8_netproton"))->Fill(cent, std::pow(netProt, 8.0)); + + // eff. corrected + histos.get(HIST("Prof_Q11_1"))->Fill(cent, fQ11_1); + histos.get(HIST("Prof_Q11_2"))->Fill(cent, fQ11_2); + histos.get(HIST("Prof_Q11_3"))->Fill(cent, fQ11_3); + histos.get(HIST("Prof_Q11_4"))->Fill(cent, fQ11_4); + histos.get(HIST("Prof_Q21_1"))->Fill(cent, fQ21_1); + histos.get(HIST("Prof_Q22_1"))->Fill(cent, fQ22_1); + histos.get(HIST("Prof_Q31_1"))->Fill(cent, fQ31_1); + histos.get(HIST("Prof_Q32_1"))->Fill(cent, fQ32_1); + histos.get(HIST("Prof_Q33_1"))->Fill(cent, fQ33_1); + histos.get(HIST("Prof_Q41_1"))->Fill(cent, fQ41_1); + histos.get(HIST("Prof_Q42_1"))->Fill(cent, fQ42_1); + histos.get(HIST("Prof_Q43_1"))->Fill(cent, fQ43_1); + histos.get(HIST("Prof_Q44_1"))->Fill(cent, fQ44_1); + histos.get(HIST("Prof_Q21_2"))->Fill(cent, fQ21_2); + histos.get(HIST("Prof_Q22_2"))->Fill(cent, fQ22_2); + histos.get(HIST("Prof_Q1121_11"))->Fill(cent, fQ1121_11); + histos.get(HIST("Prof_Q1121_01"))->Fill(cent, fQ1121_01); + histos.get(HIST("Prof_Q1121_10"))->Fill(cent, fQ1121_10); + histos.get(HIST("Prof_Q1121_20"))->Fill(cent, fQ1121_20); + histos.get(HIST("Prof_Q1121_21"))->Fill(cent, fQ1121_21); + histos.get(HIST("Prof_Q1122_11"))->Fill(cent, fQ1122_11); + histos.get(HIST("Prof_Q1122_01"))->Fill(cent, fQ1122_01); + histos.get(HIST("Prof_Q1122_10"))->Fill(cent, fQ1122_10); + histos.get(HIST("Prof_Q1122_20"))->Fill(cent, fQ1122_20); + histos.get(HIST("Prof_Q1122_21"))->Fill(cent, fQ1122_21); + histos.get(HIST("Prof_Q1131_11"))->Fill(cent, fQ1131_11); + histos.get(HIST("Prof_Q1131_01"))->Fill(cent, fQ1131_01); + histos.get(HIST("Prof_Q1131_10"))->Fill(cent, fQ1131_10); + histos.get(HIST("Prof_Q1132_11"))->Fill(cent, fQ1132_11); + histos.get(HIST("Prof_Q1132_01"))->Fill(cent, fQ1132_01); + histos.get(HIST("Prof_Q1132_10"))->Fill(cent, fQ1132_10); + histos.get(HIST("Prof_Q1133_11"))->Fill(cent, fQ1133_11); + histos.get(HIST("Prof_Q1133_01"))->Fill(cent, fQ1133_01); + histos.get(HIST("Prof_Q1133_10"))->Fill(cent, fQ1133_10); + histos.get(HIST("Prof_Q2122_11"))->Fill(cent, fQ2122_11); + histos.get(HIST("Prof_Q2122_01"))->Fill(cent, fQ2122_01); + histos.get(HIST("Prof_Q2122_10"))->Fill(cent, fQ2122_10); + histos.get(HIST("Prof_Q3132_11"))->Fill(cent, fQ3132_11); + histos.get(HIST("Prof_Q3132_01"))->Fill(cent, fQ3132_01); + histos.get(HIST("Prof_Q3132_10"))->Fill(cent, fQ3132_10); + histos.get(HIST("Prof_Q3133_11"))->Fill(cent, fQ3133_11); + histos.get(HIST("Prof_Q3133_01"))->Fill(cent, fQ3133_01); + histos.get(HIST("Prof_Q3133_10"))->Fill(cent, fQ3133_10); + histos.get(HIST("Prof_Q3233_11"))->Fill(cent, fQ3233_11); + histos.get(HIST("Prof_Q3233_01"))->Fill(cent, fQ3233_01); + histos.get(HIST("Prof_Q3233_10"))->Fill(cent, fQ3233_10); + histos.get(HIST("Prof_Q2241_11"))->Fill(cent, fQ2241_11); + histos.get(HIST("Prof_Q2241_01"))->Fill(cent, fQ2241_01); + histos.get(HIST("Prof_Q2241_10"))->Fill(cent, fQ2241_10); + histos.get(HIST("Prof_Q2242_11"))->Fill(cent, fQ2242_11); + histos.get(HIST("Prof_Q2242_01"))->Fill(cent, fQ2242_01); + histos.get(HIST("Prof_Q2242_10"))->Fill(cent, fQ2242_10); + histos.get(HIST("Prof_Q2243_11"))->Fill(cent, fQ2243_11); + histos.get(HIST("Prof_Q2243_01"))->Fill(cent, fQ2243_01); + histos.get(HIST("Prof_Q2243_10"))->Fill(cent, fQ2243_10); + histos.get(HIST("Prof_Q2244_11"))->Fill(cent, fQ2244_11); + histos.get(HIST("Prof_Q2244_01"))->Fill(cent, fQ2244_01); + histos.get(HIST("Prof_Q2244_10"))->Fill(cent, fQ2244_10); + histos.get(HIST("Prof_Q2141_11"))->Fill(cent, fQ2141_11); + histos.get(HIST("Prof_Q2141_01"))->Fill(cent, fQ2141_01); + histos.get(HIST("Prof_Q2141_10"))->Fill(cent, fQ2141_10); + histos.get(HIST("Prof_Q2142_11"))->Fill(cent, fQ2142_11); + histos.get(HIST("Prof_Q2142_01"))->Fill(cent, fQ2142_01); + histos.get(HIST("Prof_Q2142_10"))->Fill(cent, fQ2142_10); + histos.get(HIST("Prof_Q2143_11"))->Fill(cent, fQ2143_11); + histos.get(HIST("Prof_Q2143_01"))->Fill(cent, fQ2143_01); + histos.get(HIST("Prof_Q2143_10"))->Fill(cent, fQ2143_10); + histos.get(HIST("Prof_Q2144_11"))->Fill(cent, fQ2144_11); + histos.get(HIST("Prof_Q2144_01"))->Fill(cent, fQ2144_01); + histos.get(HIST("Prof_Q2144_10"))->Fill(cent, fQ2144_10); + histos.get(HIST("Prof_Q1151_11"))->Fill(cent, fQ1151_11); + histos.get(HIST("Prof_Q1151_01"))->Fill(cent, fQ1151_01); + histos.get(HIST("Prof_Q1151_10"))->Fill(cent, fQ1151_10); + histos.get(HIST("Prof_Q1152_11"))->Fill(cent, fQ1152_11); + histos.get(HIST("Prof_Q1152_01"))->Fill(cent, fQ1152_01); + histos.get(HIST("Prof_Q1152_10"))->Fill(cent, fQ1152_10); + histos.get(HIST("Prof_Q1153_11"))->Fill(cent, fQ1153_11); + histos.get(HIST("Prof_Q1153_01"))->Fill(cent, fQ1153_01); + histos.get(HIST("Prof_Q1153_10"))->Fill(cent, fQ1153_10); + histos.get(HIST("Prof_Q1154_11"))->Fill(cent, fQ1154_11); + histos.get(HIST("Prof_Q1154_01"))->Fill(cent, fQ1154_01); + histos.get(HIST("Prof_Q1154_10"))->Fill(cent, fQ1154_10); + histos.get(HIST("Prof_Q1155_11"))->Fill(cent, fQ1155_11); + histos.get(HIST("Prof_Q1155_01"))->Fill(cent, fQ1155_01); + histos.get(HIST("Prof_Q1155_10"))->Fill(cent, fQ1155_10); + histos.get(HIST("Prof_Q112233_001"))->Fill(cent, fQ112233_001); + histos.get(HIST("Prof_Q112233_010"))->Fill(cent, fQ112233_010); + histos.get(HIST("Prof_Q112233_100"))->Fill(cent, fQ112233_100); + histos.get(HIST("Prof_Q112233_011"))->Fill(cent, fQ112233_011); + histos.get(HIST("Prof_Q112233_101"))->Fill(cent, fQ112233_101); + histos.get(HIST("Prof_Q112233_110"))->Fill(cent, fQ112233_110); + histos.get(HIST("Prof_Q112232_001"))->Fill(cent, fQ112232_001); + histos.get(HIST("Prof_Q112232_010"))->Fill(cent, fQ112232_010); + histos.get(HIST("Prof_Q112232_100"))->Fill(cent, fQ112232_100); + histos.get(HIST("Prof_Q112232_011"))->Fill(cent, fQ112232_011); + histos.get(HIST("Prof_Q112232_101"))->Fill(cent, fQ112232_101); + histos.get(HIST("Prof_Q112232_110"))->Fill(cent, fQ112232_110); + histos.get(HIST("Prof_Q112231_001"))->Fill(cent, fQ112231_001); + histos.get(HIST("Prof_Q112231_010"))->Fill(cent, fQ112231_010); + histos.get(HIST("Prof_Q112231_100"))->Fill(cent, fQ112231_100); + histos.get(HIST("Prof_Q112231_011"))->Fill(cent, fQ112231_011); + histos.get(HIST("Prof_Q112231_101"))->Fill(cent, fQ112231_101); + histos.get(HIST("Prof_Q112231_110"))->Fill(cent, fQ112231_110); + histos.get(HIST("Prof_Q112133_001"))->Fill(cent, fQ112133_001); + histos.get(HIST("Prof_Q112133_010"))->Fill(cent, fQ112133_010); + histos.get(HIST("Prof_Q112133_100"))->Fill(cent, fQ112133_100); + histos.get(HIST("Prof_Q112133_011"))->Fill(cent, fQ112133_011); + histos.get(HIST("Prof_Q112133_101"))->Fill(cent, fQ112133_101); + histos.get(HIST("Prof_Q112133_110"))->Fill(cent, fQ112133_110); + histos.get(HIST("Prof_Q112132_001"))->Fill(cent, fQ112132_001); + histos.get(HIST("Prof_Q112132_010"))->Fill(cent, fQ112132_010); + histos.get(HIST("Prof_Q112132_100"))->Fill(cent, fQ112132_100); + histos.get(HIST("Prof_Q112132_011"))->Fill(cent, fQ112132_011); + histos.get(HIST("Prof_Q112132_101"))->Fill(cent, fQ112132_101); + histos.get(HIST("Prof_Q112132_110"))->Fill(cent, fQ112132_110); + histos.get(HIST("Prof_Q112131_001"))->Fill(cent, fQ112131_001); + histos.get(HIST("Prof_Q112131_010"))->Fill(cent, fQ112131_010); + histos.get(HIST("Prof_Q112131_100"))->Fill(cent, fQ112131_100); + histos.get(HIST("Prof_Q112131_011"))->Fill(cent, fQ112131_011); + histos.get(HIST("Prof_Q112131_101"))->Fill(cent, fQ112131_101); + histos.get(HIST("Prof_Q112131_110"))->Fill(cent, fQ112131_110); + histos.get(HIST("Prof_Q2221_11"))->Fill(cent, fQ2221_11); + histos.get(HIST("Prof_Q2221_01"))->Fill(cent, fQ2221_01); + histos.get(HIST("Prof_Q2221_10"))->Fill(cent, fQ2221_10); + histos.get(HIST("Prof_Q2221_21"))->Fill(cent, fQ2221_21); + histos.get(HIST("Prof_Q2221_20"))->Fill(cent, fQ2221_20); + histos.get(HIST("Prof_Q2122_21"))->Fill(cent, fQ2122_21); + histos.get(HIST("Prof_Q2122_20"))->Fill(cent, fQ2122_20); + histos.get(HIST("Prof_Q1121_02"))->Fill(cent, fQ1121_02); + histos.get(HIST("Prof_Q1121_12"))->Fill(cent, fQ1121_12); + histos.get(HIST("Prof_Q1121_22"))->Fill(cent, fQ1121_22); + histos.get(HIST("Prof_Q1122_02"))->Fill(cent, fQ1122_02); + histos.get(HIST("Prof_Q1122_12"))->Fill(cent, fQ1122_12); + histos.get(HIST("Prof_Q1122_22"))->Fill(cent, fQ1122_22); + histos.get(HIST("Prof_Q112221_001"))->Fill(cent, fQ112221_001); + histos.get(HIST("Prof_Q112221_010"))->Fill(cent, fQ112221_010); + histos.get(HIST("Prof_Q112221_100"))->Fill(cent, fQ112221_100); + histos.get(HIST("Prof_Q112221_011"))->Fill(cent, fQ112221_011); + histos.get(HIST("Prof_Q112221_101"))->Fill(cent, fQ112221_101); + histos.get(HIST("Prof_Q112221_110"))->Fill(cent, fQ112221_110); + histos.get(HIST("Prof_Q112221_200"))->Fill(cent, fQ112221_200); + histos.get(HIST("Prof_Q112221_201"))->Fill(cent, fQ112221_201); + histos.get(HIST("Prof_Q112221_210"))->Fill(cent, fQ112221_210); + histos.get(HIST("Prof_Q112221_211"))->Fill(cent, fQ112221_211); + histos.get(HIST("Prof_Q1131_21"))->Fill(cent, fQ1131_21); + histos.get(HIST("Prof_Q1131_20"))->Fill(cent, fQ1131_20); + histos.get(HIST("Prof_Q1131_31"))->Fill(cent, fQ1131_31); + histos.get(HIST("Prof_Q1131_30"))->Fill(cent, fQ1131_30); + histos.get(HIST("Prof_Q1132_21"))->Fill(cent, fQ1132_21); + histos.get(HIST("Prof_Q1132_20"))->Fill(cent, fQ1132_20); + histos.get(HIST("Prof_Q1132_31"))->Fill(cent, fQ1132_31); + histos.get(HIST("Prof_Q1132_30"))->Fill(cent, fQ1132_30); + histos.get(HIST("Prof_Q1133_21"))->Fill(cent, fQ1133_21); + histos.get(HIST("Prof_Q1133_20"))->Fill(cent, fQ1133_20); + histos.get(HIST("Prof_Q1133_31"))->Fill(cent, fQ1133_31); + histos.get(HIST("Prof_Q1133_30"))->Fill(cent, fQ1133_30); + histos.get(HIST("Prof_Q11_5"))->Fill(cent, fQ11_5); + histos.get(HIST("Prof_Q11_6"))->Fill(cent, fQ11_6); + histos.get(HIST("Prof_Q1121_30"))->Fill(cent, fQ1121_30); + histos.get(HIST("Prof_Q1121_31"))->Fill(cent, fQ1121_31); + histos.get(HIST("Prof_Q1121_40"))->Fill(cent, fQ1121_40); + histos.get(HIST("Prof_Q1121_41"))->Fill(cent, fQ1121_41); + histos.get(HIST("Prof_Q1122_30"))->Fill(cent, fQ1122_30); + histos.get(HIST("Prof_Q1122_31"))->Fill(cent, fQ1122_31); + histos.get(HIST("Prof_Q1122_40"))->Fill(cent, fQ1122_40); + histos.get(HIST("Prof_Q1122_41"))->Fill(cent, fQ1122_41); + histos.get(HIST("Prof_Q2211_11"))->Fill(cent, fQ2211_11); + histos.get(HIST("Prof_Q2211_01"))->Fill(cent, fQ2211_01); + histos.get(HIST("Prof_Q2211_10"))->Fill(cent, fQ2211_10); + histos.get(HIST("Prof_Q2211_20"))->Fill(cent, fQ2211_20); + histos.get(HIST("Prof_Q2211_21"))->Fill(cent, fQ2211_21); + histos.get(HIST("Prof_Q2111_11"))->Fill(cent, fQ2111_11); + histos.get(HIST("Prof_Q2111_01"))->Fill(cent, fQ2111_01); + histos.get(HIST("Prof_Q2111_10"))->Fill(cent, fQ2111_10); + histos.get(HIST("Prof_Q2111_20"))->Fill(cent, fQ2111_20); + histos.get(HIST("Prof_Q2111_21"))->Fill(cent, fQ2111_21); + histos.get(HIST("Prof_Q112122_001"))->Fill(cent, fQ112122_001); + histos.get(HIST("Prof_Q112122_010"))->Fill(cent, fQ112122_010); + histos.get(HIST("Prof_Q112122_100"))->Fill(cent, fQ112122_100); + histos.get(HIST("Prof_Q112122_011"))->Fill(cent, fQ112122_011); + histos.get(HIST("Prof_Q112122_101"))->Fill(cent, fQ112122_101); + histos.get(HIST("Prof_Q112122_110"))->Fill(cent, fQ112122_110); + histos.get(HIST("Prof_Q1141_11"))->Fill(cent, fQ1141_11); + histos.get(HIST("Prof_Q1141_01"))->Fill(cent, fQ1141_01); + histos.get(HIST("Prof_Q1141_10"))->Fill(cent, fQ1141_10); + histos.get(HIST("Prof_Q1141_20"))->Fill(cent, fQ1141_20); + histos.get(HIST("Prof_Q1141_21"))->Fill(cent, fQ1141_21); + histos.get(HIST("Prof_Q1142_11"))->Fill(cent, fQ1142_11); + histos.get(HIST("Prof_Q1142_01"))->Fill(cent, fQ1142_01); + histos.get(HIST("Prof_Q1142_10"))->Fill(cent, fQ1142_10); + histos.get(HIST("Prof_Q1142_20"))->Fill(cent, fQ1142_20); + histos.get(HIST("Prof_Q1142_21"))->Fill(cent, fQ1142_21); + histos.get(HIST("Prof_Q1143_11"))->Fill(cent, fQ1143_11); + histos.get(HIST("Prof_Q1143_01"))->Fill(cent, fQ1143_01); + histos.get(HIST("Prof_Q1143_10"))->Fill(cent, fQ1143_10); + histos.get(HIST("Prof_Q1143_20"))->Fill(cent, fQ1143_20); + histos.get(HIST("Prof_Q1143_21"))->Fill(cent, fQ1143_21); + histos.get(HIST("Prof_Q1144_11"))->Fill(cent, fQ1144_11); + histos.get(HIST("Prof_Q1144_01"))->Fill(cent, fQ1144_01); + histos.get(HIST("Prof_Q1144_10"))->Fill(cent, fQ1144_10); + histos.get(HIST("Prof_Q1144_20"))->Fill(cent, fQ1144_20); + histos.get(HIST("Prof_Q1144_21"))->Fill(cent, fQ1144_21); + histos.get(HIST("Prof_Q2131_11"))->Fill(cent, fQ2131_11); + histos.get(HIST("Prof_Q2131_01"))->Fill(cent, fQ2131_01); + histos.get(HIST("Prof_Q2131_10"))->Fill(cent, fQ2131_10); + histos.get(HIST("Prof_Q2132_11"))->Fill(cent, fQ2132_11); + histos.get(HIST("Prof_Q2132_01"))->Fill(cent, fQ2132_01); + histos.get(HIST("Prof_Q2132_10"))->Fill(cent, fQ2132_10); + histos.get(HIST("Prof_Q2133_11"))->Fill(cent, fQ2133_11); + histos.get(HIST("Prof_Q2133_01"))->Fill(cent, fQ2133_01); + histos.get(HIST("Prof_Q2133_10"))->Fill(cent, fQ2133_10); + histos.get(HIST("Prof_Q2231_11"))->Fill(cent, fQ2231_11); + histos.get(HIST("Prof_Q2231_01"))->Fill(cent, fQ2231_01); + histos.get(HIST("Prof_Q2231_10"))->Fill(cent, fQ2231_10); + histos.get(HIST("Prof_Q2232_11"))->Fill(cent, fQ2232_11); + histos.get(HIST("Prof_Q2232_01"))->Fill(cent, fQ2232_01); + histos.get(HIST("Prof_Q2232_10"))->Fill(cent, fQ2232_10); + histos.get(HIST("Prof_Q2233_11"))->Fill(cent, fQ2233_11); + histos.get(HIST("Prof_Q2233_01"))->Fill(cent, fQ2233_01); + histos.get(HIST("Prof_Q2233_10"))->Fill(cent, fQ2233_10); + histos.get(HIST("Prof_Q51_1"))->Fill(cent, fQ51_1); + histos.get(HIST("Prof_Q52_1"))->Fill(cent, fQ52_1); + histos.get(HIST("Prof_Q53_1"))->Fill(cent, fQ53_1); + histos.get(HIST("Prof_Q54_1"))->Fill(cent, fQ54_1); + histos.get(HIST("Prof_Q55_1"))->Fill(cent, fQ55_1); + histos.get(HIST("Prof_Q21_3"))->Fill(cent, fQ21_3); + histos.get(HIST("Prof_Q22_3"))->Fill(cent, fQ22_3); + histos.get(HIST("Prof_Q31_2"))->Fill(cent, fQ31_2); + histos.get(HIST("Prof_Q32_2"))->Fill(cent, fQ32_2); + histos.get(HIST("Prof_Q33_2"))->Fill(cent, fQ33_2); + histos.get(HIST("Prof_Q61_1"))->Fill(cent, fQ61_1); + histos.get(HIST("Prof_Q62_1"))->Fill(cent, fQ62_1); + histos.get(HIST("Prof_Q63_1"))->Fill(cent, fQ63_1); + histos.get(HIST("Prof_Q64_1"))->Fill(cent, fQ64_1); + histos.get(HIST("Prof_Q65_1"))->Fill(cent, fQ65_1); + histos.get(HIST("Prof_Q66_1"))->Fill(cent, fQ66_1); + histos.get(HIST("Prof_Q112122_111"))->Fill(cent, fQ112122_111); + histos.get(HIST("Prof_Q112131_111"))->Fill(cent, fQ112131_111); + histos.get(HIST("Prof_Q112132_111"))->Fill(cent, fQ112132_111); + histos.get(HIST("Prof_Q112133_111"))->Fill(cent, fQ112133_111); + histos.get(HIST("Prof_Q112231_111"))->Fill(cent, fQ112231_111); + histos.get(HIST("Prof_Q112232_111"))->Fill(cent, fQ112232_111); + histos.get(HIST("Prof_Q112233_111"))->Fill(cent, fQ112233_111); + histos.get(HIST("Prof_Q112221_111"))->Fill(cent, fQ112221_111); + } + + if (cfgIsCalculateError) { + // selecting subsample and filling profiles + float lRandom = fRndm->Rndm(); + int sampleIndex = static_cast(cfgNSubsample * lRandom); + + histos.get(HIST("Prof2D_mu1_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 1.0)); + histos.get(HIST("Prof2D_mu2_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 2.0)); + histos.get(HIST("Prof2D_mu3_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 3.0)); + histos.get(HIST("Prof2D_mu4_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 4.0)); + histos.get(HIST("Prof2D_mu5_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 5.0)); + histos.get(HIST("Prof2D_mu6_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 6.0)); + histos.get(HIST("Prof2D_mu7_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 7.0)); + histos.get(HIST("Prof2D_mu8_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 8.0)); + + histos.get(HIST("Prof2D_Q11_1"))->Fill(cent, sampleIndex, fQ11_1); + histos.get(HIST("Prof2D_Q11_2"))->Fill(cent, sampleIndex, fQ11_2); + histos.get(HIST("Prof2D_Q11_3"))->Fill(cent, sampleIndex, fQ11_3); + histos.get(HIST("Prof2D_Q11_4"))->Fill(cent, sampleIndex, fQ11_4); + histos.get(HIST("Prof2D_Q21_1"))->Fill(cent, sampleIndex, fQ21_1); + histos.get(HIST("Prof2D_Q22_1"))->Fill(cent, sampleIndex, fQ22_1); + histos.get(HIST("Prof2D_Q31_1"))->Fill(cent, sampleIndex, fQ31_1); + histos.get(HIST("Prof2D_Q32_1"))->Fill(cent, sampleIndex, fQ32_1); + histos.get(HIST("Prof2D_Q33_1"))->Fill(cent, sampleIndex, fQ33_1); + histos.get(HIST("Prof2D_Q41_1"))->Fill(cent, sampleIndex, fQ41_1); + histos.get(HIST("Prof2D_Q42_1"))->Fill(cent, sampleIndex, fQ42_1); + histos.get(HIST("Prof2D_Q43_1"))->Fill(cent, sampleIndex, fQ43_1); + histos.get(HIST("Prof2D_Q44_1"))->Fill(cent, sampleIndex, fQ44_1); + histos.get(HIST("Prof2D_Q21_2"))->Fill(cent, sampleIndex, fQ21_2); + histos.get(HIST("Prof2D_Q22_2"))->Fill(cent, sampleIndex, fQ22_2); + histos.get(HIST("Prof2D_Q1121_11"))->Fill(cent, sampleIndex, fQ1121_11); + histos.get(HIST("Prof2D_Q1121_01"))->Fill(cent, sampleIndex, fQ1121_01); + histos.get(HIST("Prof2D_Q1121_10"))->Fill(cent, sampleIndex, fQ1121_10); + histos.get(HIST("Prof2D_Q1121_20"))->Fill(cent, sampleIndex, fQ1121_20); + histos.get(HIST("Prof2D_Q1121_21"))->Fill(cent, sampleIndex, fQ1121_21); + histos.get(HIST("Prof2D_Q1122_11"))->Fill(cent, sampleIndex, fQ1122_11); + histos.get(HIST("Prof2D_Q1122_01"))->Fill(cent, sampleIndex, fQ1122_01); + histos.get(HIST("Prof2D_Q1122_10"))->Fill(cent, sampleIndex, fQ1122_10); + histos.get(HIST("Prof2D_Q1122_20"))->Fill(cent, sampleIndex, fQ1122_20); + histos.get(HIST("Prof2D_Q1122_21"))->Fill(cent, sampleIndex, fQ1122_21); + histos.get(HIST("Prof2D_Q1131_11"))->Fill(cent, sampleIndex, fQ1131_11); + histos.get(HIST("Prof2D_Q1131_01"))->Fill(cent, sampleIndex, fQ1131_01); + histos.get(HIST("Prof2D_Q1131_10"))->Fill(cent, sampleIndex, fQ1131_10); + histos.get(HIST("Prof2D_Q1132_11"))->Fill(cent, sampleIndex, fQ1132_11); + histos.get(HIST("Prof2D_Q1132_01"))->Fill(cent, sampleIndex, fQ1132_01); + histos.get(HIST("Prof2D_Q1132_10"))->Fill(cent, sampleIndex, fQ1132_10); + histos.get(HIST("Prof2D_Q1133_11"))->Fill(cent, sampleIndex, fQ1133_11); + histos.get(HIST("Prof2D_Q1133_01"))->Fill(cent, sampleIndex, fQ1133_01); + histos.get(HIST("Prof2D_Q1133_10"))->Fill(cent, sampleIndex, fQ1133_10); + histos.get(HIST("Prof2D_Q2122_11"))->Fill(cent, sampleIndex, fQ2122_11); + histos.get(HIST("Prof2D_Q2122_01"))->Fill(cent, sampleIndex, fQ2122_01); + histos.get(HIST("Prof2D_Q2122_10"))->Fill(cent, sampleIndex, fQ2122_10); + histos.get(HIST("Prof2D_Q3132_11"))->Fill(cent, sampleIndex, fQ3132_11); + histos.get(HIST("Prof2D_Q3132_01"))->Fill(cent, sampleIndex, fQ3132_01); + histos.get(HIST("Prof2D_Q3132_10"))->Fill(cent, sampleIndex, fQ3132_10); + histos.get(HIST("Prof2D_Q3133_11"))->Fill(cent, sampleIndex, fQ3133_11); + histos.get(HIST("Prof2D_Q3133_01"))->Fill(cent, sampleIndex, fQ3133_01); + histos.get(HIST("Prof2D_Q3133_10"))->Fill(cent, sampleIndex, fQ3133_10); + histos.get(HIST("Prof2D_Q3233_11"))->Fill(cent, sampleIndex, fQ3233_11); + histos.get(HIST("Prof2D_Q3233_01"))->Fill(cent, sampleIndex, fQ3233_01); + histos.get(HIST("Prof2D_Q3233_10"))->Fill(cent, sampleIndex, fQ3233_10); + histos.get(HIST("Prof2D_Q2241_11"))->Fill(cent, sampleIndex, fQ2241_11); + histos.get(HIST("Prof2D_Q2241_01"))->Fill(cent, sampleIndex, fQ2241_01); + histos.get(HIST("Prof2D_Q2241_10"))->Fill(cent, sampleIndex, fQ2241_10); + histos.get(HIST("Prof2D_Q2242_11"))->Fill(cent, sampleIndex, fQ2242_11); + histos.get(HIST("Prof2D_Q2242_01"))->Fill(cent, sampleIndex, fQ2242_01); + histos.get(HIST("Prof2D_Q2242_10"))->Fill(cent, sampleIndex, fQ2242_10); + histos.get(HIST("Prof2D_Q2243_11"))->Fill(cent, sampleIndex, fQ2243_11); + histos.get(HIST("Prof2D_Q2243_01"))->Fill(cent, sampleIndex, fQ2243_01); + histos.get(HIST("Prof2D_Q2243_10"))->Fill(cent, sampleIndex, fQ2243_10); + histos.get(HIST("Prof2D_Q2244_11"))->Fill(cent, sampleIndex, fQ2244_11); + histos.get(HIST("Prof2D_Q2244_01"))->Fill(cent, sampleIndex, fQ2244_01); + histos.get(HIST("Prof2D_Q2244_10"))->Fill(cent, sampleIndex, fQ2244_10); + histos.get(HIST("Prof2D_Q2141_11"))->Fill(cent, sampleIndex, fQ2141_11); + histos.get(HIST("Prof2D_Q2141_01"))->Fill(cent, sampleIndex, fQ2141_01); + histos.get(HIST("Prof2D_Q2141_10"))->Fill(cent, sampleIndex, fQ2141_10); + histos.get(HIST("Prof2D_Q2142_11"))->Fill(cent, sampleIndex, fQ2142_11); + histos.get(HIST("Prof2D_Q2142_01"))->Fill(cent, sampleIndex, fQ2142_01); + histos.get(HIST("Prof2D_Q2142_10"))->Fill(cent, sampleIndex, fQ2142_10); + histos.get(HIST("Prof2D_Q2143_11"))->Fill(cent, sampleIndex, fQ2143_11); + histos.get(HIST("Prof2D_Q2143_01"))->Fill(cent, sampleIndex, fQ2143_01); + histos.get(HIST("Prof2D_Q2143_10"))->Fill(cent, sampleIndex, fQ2143_10); + histos.get(HIST("Prof2D_Q2144_11"))->Fill(cent, sampleIndex, fQ2144_11); + histos.get(HIST("Prof2D_Q2144_01"))->Fill(cent, sampleIndex, fQ2144_01); + histos.get(HIST("Prof2D_Q2144_10"))->Fill(cent, sampleIndex, fQ2144_10); + histos.get(HIST("Prof2D_Q1151_11"))->Fill(cent, sampleIndex, fQ1151_11); + histos.get(HIST("Prof2D_Q1151_01"))->Fill(cent, sampleIndex, fQ1151_01); + histos.get(HIST("Prof2D_Q1151_10"))->Fill(cent, sampleIndex, fQ1151_10); + histos.get(HIST("Prof2D_Q1152_11"))->Fill(cent, sampleIndex, fQ1152_11); + histos.get(HIST("Prof2D_Q1152_01"))->Fill(cent, sampleIndex, fQ1152_01); + histos.get(HIST("Prof2D_Q1152_10"))->Fill(cent, sampleIndex, fQ1152_10); + histos.get(HIST("Prof2D_Q1153_11"))->Fill(cent, sampleIndex, fQ1153_11); + histos.get(HIST("Prof2D_Q1153_01"))->Fill(cent, sampleIndex, fQ1153_01); + histos.get(HIST("Prof2D_Q1153_10"))->Fill(cent, sampleIndex, fQ1153_10); + histos.get(HIST("Prof2D_Q1154_11"))->Fill(cent, sampleIndex, fQ1154_11); + histos.get(HIST("Prof2D_Q1154_01"))->Fill(cent, sampleIndex, fQ1154_01); + histos.get(HIST("Prof2D_Q1154_10"))->Fill(cent, sampleIndex, fQ1154_10); + histos.get(HIST("Prof2D_Q1155_11"))->Fill(cent, sampleIndex, fQ1155_11); + histos.get(HIST("Prof2D_Q1155_01"))->Fill(cent, sampleIndex, fQ1155_01); + histos.get(HIST("Prof2D_Q1155_10"))->Fill(cent, sampleIndex, fQ1155_10); + histos.get(HIST("Prof2D_Q112233_001"))->Fill(cent, sampleIndex, fQ112233_001); + histos.get(HIST("Prof2D_Q112233_010"))->Fill(cent, sampleIndex, fQ112233_010); + histos.get(HIST("Prof2D_Q112233_100"))->Fill(cent, sampleIndex, fQ112233_100); + histos.get(HIST("Prof2D_Q112233_011"))->Fill(cent, sampleIndex, fQ112233_011); + histos.get(HIST("Prof2D_Q112233_101"))->Fill(cent, sampleIndex, fQ112233_101); + histos.get(HIST("Prof2D_Q112233_110"))->Fill(cent, sampleIndex, fQ112233_110); + histos.get(HIST("Prof2D_Q112232_001"))->Fill(cent, sampleIndex, fQ112232_001); + histos.get(HIST("Prof2D_Q112232_010"))->Fill(cent, sampleIndex, fQ112232_010); + histos.get(HIST("Prof2D_Q112232_100"))->Fill(cent, sampleIndex, fQ112232_100); + histos.get(HIST("Prof2D_Q112232_011"))->Fill(cent, sampleIndex, fQ112232_011); + histos.get(HIST("Prof2D_Q112232_101"))->Fill(cent, sampleIndex, fQ112232_101); + histos.get(HIST("Prof2D_Q112232_110"))->Fill(cent, sampleIndex, fQ112232_110); + histos.get(HIST("Prof2D_Q112231_001"))->Fill(cent, sampleIndex, fQ112231_001); + histos.get(HIST("Prof2D_Q112231_010"))->Fill(cent, sampleIndex, fQ112231_010); + histos.get(HIST("Prof2D_Q112231_100"))->Fill(cent, sampleIndex, fQ112231_100); + histos.get(HIST("Prof2D_Q112231_011"))->Fill(cent, sampleIndex, fQ112231_011); + histos.get(HIST("Prof2D_Q112231_101"))->Fill(cent, sampleIndex, fQ112231_101); + histos.get(HIST("Prof2D_Q112231_110"))->Fill(cent, sampleIndex, fQ112231_110); + histos.get(HIST("Prof2D_Q112133_001"))->Fill(cent, sampleIndex, fQ112133_001); + histos.get(HIST("Prof2D_Q112133_010"))->Fill(cent, sampleIndex, fQ112133_010); + histos.get(HIST("Prof2D_Q112133_100"))->Fill(cent, sampleIndex, fQ112133_100); + histos.get(HIST("Prof2D_Q112133_011"))->Fill(cent, sampleIndex, fQ112133_011); + histos.get(HIST("Prof2D_Q112133_101"))->Fill(cent, sampleIndex, fQ112133_101); + histos.get(HIST("Prof2D_Q112133_110"))->Fill(cent, sampleIndex, fQ112133_110); + histos.get(HIST("Prof2D_Q112132_001"))->Fill(cent, sampleIndex, fQ112132_001); + histos.get(HIST("Prof2D_Q112132_010"))->Fill(cent, sampleIndex, fQ112132_010); + histos.get(HIST("Prof2D_Q112132_100"))->Fill(cent, sampleIndex, fQ112132_100); + histos.get(HIST("Prof2D_Q112132_011"))->Fill(cent, sampleIndex, fQ112132_011); + histos.get(HIST("Prof2D_Q112132_101"))->Fill(cent, sampleIndex, fQ112132_101); + histos.get(HIST("Prof2D_Q112132_110"))->Fill(cent, sampleIndex, fQ112132_110); + histos.get(HIST("Prof2D_Q112131_001"))->Fill(cent, sampleIndex, fQ112131_001); + histos.get(HIST("Prof2D_Q112131_010"))->Fill(cent, sampleIndex, fQ112131_010); + histos.get(HIST("Prof2D_Q112131_100"))->Fill(cent, sampleIndex, fQ112131_100); + histos.get(HIST("Prof2D_Q112131_011"))->Fill(cent, sampleIndex, fQ112131_011); + histos.get(HIST("Prof2D_Q112131_101"))->Fill(cent, sampleIndex, fQ112131_101); + histos.get(HIST("Prof2D_Q112131_110"))->Fill(cent, sampleIndex, fQ112131_110); + histos.get(HIST("Prof2D_Q2221_11"))->Fill(cent, sampleIndex, fQ2221_11); + histos.get(HIST("Prof2D_Q2221_01"))->Fill(cent, sampleIndex, fQ2221_01); + histos.get(HIST("Prof2D_Q2221_10"))->Fill(cent, sampleIndex, fQ2221_10); + histos.get(HIST("Prof2D_Q2221_21"))->Fill(cent, sampleIndex, fQ2221_21); + histos.get(HIST("Prof2D_Q2221_20"))->Fill(cent, sampleIndex, fQ2221_20); + histos.get(HIST("Prof2D_Q2122_21"))->Fill(cent, sampleIndex, fQ2122_21); + histos.get(HIST("Prof2D_Q2122_20"))->Fill(cent, sampleIndex, fQ2122_20); + histos.get(HIST("Prof2D_Q1121_02"))->Fill(cent, sampleIndex, fQ1121_02); + histos.get(HIST("Prof2D_Q1121_12"))->Fill(cent, sampleIndex, fQ1121_12); + histos.get(HIST("Prof2D_Q1121_22"))->Fill(cent, sampleIndex, fQ1121_22); + histos.get(HIST("Prof2D_Q1122_02"))->Fill(cent, sampleIndex, fQ1122_02); + histos.get(HIST("Prof2D_Q1122_12"))->Fill(cent, sampleIndex, fQ1122_12); + histos.get(HIST("Prof2D_Q1122_22"))->Fill(cent, sampleIndex, fQ1122_22); + histos.get(HIST("Prof2D_Q112221_001"))->Fill(cent, sampleIndex, fQ112221_001); + histos.get(HIST("Prof2D_Q112221_010"))->Fill(cent, sampleIndex, fQ112221_010); + histos.get(HIST("Prof2D_Q112221_100"))->Fill(cent, sampleIndex, fQ112221_100); + histos.get(HIST("Prof2D_Q112221_011"))->Fill(cent, sampleIndex, fQ112221_011); + histos.get(HIST("Prof2D_Q112221_101"))->Fill(cent, sampleIndex, fQ112221_101); + histos.get(HIST("Prof2D_Q112221_110"))->Fill(cent, sampleIndex, fQ112221_110); + histos.get(HIST("Prof2D_Q112221_200"))->Fill(cent, sampleIndex, fQ112221_200); + histos.get(HIST("Prof2D_Q112221_201"))->Fill(cent, sampleIndex, fQ112221_201); + histos.get(HIST("Prof2D_Q112221_210"))->Fill(cent, sampleIndex, fQ112221_210); + histos.get(HIST("Prof2D_Q112221_211"))->Fill(cent, sampleIndex, fQ112221_211); + histos.get(HIST("Prof2D_Q1131_21"))->Fill(cent, sampleIndex, fQ1131_21); + histos.get(HIST("Prof2D_Q1131_20"))->Fill(cent, sampleIndex, fQ1131_20); + histos.get(HIST("Prof2D_Q1131_31"))->Fill(cent, sampleIndex, fQ1131_31); + histos.get(HIST("Prof2D_Q1131_30"))->Fill(cent, sampleIndex, fQ1131_30); + histos.get(HIST("Prof2D_Q1132_21"))->Fill(cent, sampleIndex, fQ1132_21); + histos.get(HIST("Prof2D_Q1132_20"))->Fill(cent, sampleIndex, fQ1132_20); + histos.get(HIST("Prof2D_Q1132_31"))->Fill(cent, sampleIndex, fQ1132_31); + histos.get(HIST("Prof2D_Q1132_30"))->Fill(cent, sampleIndex, fQ1132_30); + histos.get(HIST("Prof2D_Q1133_21"))->Fill(cent, sampleIndex, fQ1133_21); + histos.get(HIST("Prof2D_Q1133_20"))->Fill(cent, sampleIndex, fQ1133_20); + histos.get(HIST("Prof2D_Q1133_31"))->Fill(cent, sampleIndex, fQ1133_31); + histos.get(HIST("Prof2D_Q1133_30"))->Fill(cent, sampleIndex, fQ1133_30); + histos.get(HIST("Prof2D_Q11_5"))->Fill(cent, sampleIndex, fQ11_5); + histos.get(HIST("Prof2D_Q11_6"))->Fill(cent, sampleIndex, fQ11_6); + histos.get(HIST("Prof2D_Q1121_30"))->Fill(cent, sampleIndex, fQ1121_30); + histos.get(HIST("Prof2D_Q1121_31"))->Fill(cent, sampleIndex, fQ1121_31); + histos.get(HIST("Prof2D_Q1121_40"))->Fill(cent, sampleIndex, fQ1121_40); + histos.get(HIST("Prof2D_Q1121_41"))->Fill(cent, sampleIndex, fQ1121_41); + histos.get(HIST("Prof2D_Q1122_30"))->Fill(cent, sampleIndex, fQ1122_30); + histos.get(HIST("Prof2D_Q1122_31"))->Fill(cent, sampleIndex, fQ1122_31); + histos.get(HIST("Prof2D_Q1122_40"))->Fill(cent, sampleIndex, fQ1122_40); + histos.get(HIST("Prof2D_Q1122_41"))->Fill(cent, sampleIndex, fQ1122_41); + histos.get(HIST("Prof2D_Q2211_11"))->Fill(cent, sampleIndex, fQ2211_11); + histos.get(HIST("Prof2D_Q2211_01"))->Fill(cent, sampleIndex, fQ2211_01); + histos.get(HIST("Prof2D_Q2211_10"))->Fill(cent, sampleIndex, fQ2211_10); + histos.get(HIST("Prof2D_Q2211_20"))->Fill(cent, sampleIndex, fQ2211_20); + histos.get(HIST("Prof2D_Q2211_21"))->Fill(cent, sampleIndex, fQ2211_21); + histos.get(HIST("Prof2D_Q2111_11"))->Fill(cent, sampleIndex, fQ2111_11); + histos.get(HIST("Prof2D_Q2111_01"))->Fill(cent, sampleIndex, fQ2111_01); + histos.get(HIST("Prof2D_Q2111_10"))->Fill(cent, sampleIndex, fQ2111_10); + histos.get(HIST("Prof2D_Q2111_20"))->Fill(cent, sampleIndex, fQ2111_20); + histos.get(HIST("Prof2D_Q2111_21"))->Fill(cent, sampleIndex, fQ2111_21); + histos.get(HIST("Prof2D_Q112122_001"))->Fill(cent, sampleIndex, fQ112122_001); + histos.get(HIST("Prof2D_Q112122_010"))->Fill(cent, sampleIndex, fQ112122_010); + histos.get(HIST("Prof2D_Q112122_100"))->Fill(cent, sampleIndex, fQ112122_100); + histos.get(HIST("Prof2D_Q112122_011"))->Fill(cent, sampleIndex, fQ112122_011); + histos.get(HIST("Prof2D_Q112122_101"))->Fill(cent, sampleIndex, fQ112122_101); + histos.get(HIST("Prof2D_Q112122_110"))->Fill(cent, sampleIndex, fQ112122_110); + histos.get(HIST("Prof2D_Q1141_11"))->Fill(cent, sampleIndex, fQ1141_11); + histos.get(HIST("Prof2D_Q1141_01"))->Fill(cent, sampleIndex, fQ1141_01); + histos.get(HIST("Prof2D_Q1141_10"))->Fill(cent, sampleIndex, fQ1141_10); + histos.get(HIST("Prof2D_Q1141_20"))->Fill(cent, sampleIndex, fQ1141_20); + histos.get(HIST("Prof2D_Q1141_21"))->Fill(cent, sampleIndex, fQ1141_21); + histos.get(HIST("Prof2D_Q1142_11"))->Fill(cent, sampleIndex, fQ1142_11); + histos.get(HIST("Prof2D_Q1142_01"))->Fill(cent, sampleIndex, fQ1142_01); + histos.get(HIST("Prof2D_Q1142_10"))->Fill(cent, sampleIndex, fQ1142_10); + histos.get(HIST("Prof2D_Q1142_20"))->Fill(cent, sampleIndex, fQ1142_20); + histos.get(HIST("Prof2D_Q1142_21"))->Fill(cent, sampleIndex, fQ1142_21); + histos.get(HIST("Prof2D_Q1143_11"))->Fill(cent, sampleIndex, fQ1143_11); + histos.get(HIST("Prof2D_Q1143_01"))->Fill(cent, sampleIndex, fQ1143_01); + histos.get(HIST("Prof2D_Q1143_10"))->Fill(cent, sampleIndex, fQ1143_10); + histos.get(HIST("Prof2D_Q1143_20"))->Fill(cent, sampleIndex, fQ1143_20); + histos.get(HIST("Prof2D_Q1143_21"))->Fill(cent, sampleIndex, fQ1143_21); + histos.get(HIST("Prof2D_Q1144_11"))->Fill(cent, sampleIndex, fQ1144_11); + histos.get(HIST("Prof2D_Q1144_01"))->Fill(cent, sampleIndex, fQ1144_01); + histos.get(HIST("Prof2D_Q1144_10"))->Fill(cent, sampleIndex, fQ1144_10); + histos.get(HIST("Prof2D_Q1144_20"))->Fill(cent, sampleIndex, fQ1144_20); + histos.get(HIST("Prof2D_Q1144_21"))->Fill(cent, sampleIndex, fQ1144_21); + histos.get(HIST("Prof2D_Q2131_11"))->Fill(cent, sampleIndex, fQ2131_11); + histos.get(HIST("Prof2D_Q2131_01"))->Fill(cent, sampleIndex, fQ2131_01); + histos.get(HIST("Prof2D_Q2131_10"))->Fill(cent, sampleIndex, fQ2131_10); + histos.get(HIST("Prof2D_Q2132_11"))->Fill(cent, sampleIndex, fQ2132_11); + histos.get(HIST("Prof2D_Q2132_01"))->Fill(cent, sampleIndex, fQ2132_01); + histos.get(HIST("Prof2D_Q2132_10"))->Fill(cent, sampleIndex, fQ2132_10); + histos.get(HIST("Prof2D_Q2133_11"))->Fill(cent, sampleIndex, fQ2133_11); + histos.get(HIST("Prof2D_Q2133_01"))->Fill(cent, sampleIndex, fQ2133_01); + histos.get(HIST("Prof2D_Q2133_10"))->Fill(cent, sampleIndex, fQ2133_10); + histos.get(HIST("Prof2D_Q2231_11"))->Fill(cent, sampleIndex, fQ2231_11); + histos.get(HIST("Prof2D_Q2231_01"))->Fill(cent, sampleIndex, fQ2231_01); + histos.get(HIST("Prof2D_Q2231_10"))->Fill(cent, sampleIndex, fQ2231_10); + histos.get(HIST("Prof2D_Q2232_11"))->Fill(cent, sampleIndex, fQ2232_11); + histos.get(HIST("Prof2D_Q2232_01"))->Fill(cent, sampleIndex, fQ2232_01); + histos.get(HIST("Prof2D_Q2232_10"))->Fill(cent, sampleIndex, fQ2232_10); + histos.get(HIST("Prof2D_Q2233_11"))->Fill(cent, sampleIndex, fQ2233_11); + histos.get(HIST("Prof2D_Q2233_01"))->Fill(cent, sampleIndex, fQ2233_01); + histos.get(HIST("Prof2D_Q2233_10"))->Fill(cent, sampleIndex, fQ2233_10); + histos.get(HIST("Prof2D_Q51_1"))->Fill(cent, sampleIndex, fQ51_1); + histos.get(HIST("Prof2D_Q52_1"))->Fill(cent, sampleIndex, fQ52_1); + histos.get(HIST("Prof2D_Q53_1"))->Fill(cent, sampleIndex, fQ53_1); + histos.get(HIST("Prof2D_Q54_1"))->Fill(cent, sampleIndex, fQ54_1); + histos.get(HIST("Prof2D_Q55_1"))->Fill(cent, sampleIndex, fQ55_1); + histos.get(HIST("Prof2D_Q21_3"))->Fill(cent, sampleIndex, fQ21_3); + histos.get(HIST("Prof2D_Q22_3"))->Fill(cent, sampleIndex, fQ22_3); + histos.get(HIST("Prof2D_Q31_2"))->Fill(cent, sampleIndex, fQ31_2); + histos.get(HIST("Prof2D_Q32_2"))->Fill(cent, sampleIndex, fQ32_2); + histos.get(HIST("Prof2D_Q33_2"))->Fill(cent, sampleIndex, fQ33_2); + histos.get(HIST("Prof2D_Q61_1"))->Fill(cent, sampleIndex, fQ61_1); + histos.get(HIST("Prof2D_Q62_1"))->Fill(cent, sampleIndex, fQ62_1); + histos.get(HIST("Prof2D_Q63_1"))->Fill(cent, sampleIndex, fQ63_1); + histos.get(HIST("Prof2D_Q64_1"))->Fill(cent, sampleIndex, fQ64_1); + histos.get(HIST("Prof2D_Q65_1"))->Fill(cent, sampleIndex, fQ65_1); + histos.get(HIST("Prof2D_Q66_1"))->Fill(cent, sampleIndex, fQ66_1); + histos.get(HIST("Prof2D_Q112122_111"))->Fill(cent, sampleIndex, fQ112122_111); + histos.get(HIST("Prof2D_Q112131_111"))->Fill(cent, sampleIndex, fQ112131_111); + histos.get(HIST("Prof2D_Q112132_111"))->Fill(cent, sampleIndex, fQ112132_111); + histos.get(HIST("Prof2D_Q112133_111"))->Fill(cent, sampleIndex, fQ112133_111); + histos.get(HIST("Prof2D_Q112231_111"))->Fill(cent, sampleIndex, fQ112231_111); + histos.get(HIST("Prof2D_Q112232_111"))->Fill(cent, sampleIndex, fQ112232_111); + histos.get(HIST("Prof2D_Q112233_111"))->Fill(cent, sampleIndex, fQ112233_111); + histos.get(HIST("Prof2D_Q112221_111"))->Fill(cent, sampleIndex, fQ112221_111); + } + } + PROCESS_SWITCH(NetProtCumulants, processMCRec, "Process Generated", false); + + void processDataRec(AodCollisions::iterator const& coll, aod::BCsWithTimestamps const&, AodTracks const& inputTracks) + { + if (!coll.sel8()) { + return; + } + if (cfgUseGoodITSLayerAllCut && !(coll.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll))) { + return; + } + if (cfgEvSelkNoSameBunchPileup && !(coll.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + // rejects collisions which are associated with the same "found-by-T0" bunch crossing + // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof + return; + } + + if (cfgEvSelkIsVertexTOFmatched && !(coll.selection_bit(o2::aod::evsel::kIsVertexTOFmatched))) { + return; + ; + } + + histos.fill(HIST("hZvtx_after"), coll.posZ()); + // variables + auto cent = coll.centFT0C(); + histos.fill(HIST("hCentrec"), cent); + + float nProt = 0.0; + float nAntiprot = 0.0; + std::array powerEffProt = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array powerEffAntiprot = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array fTCP0 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + std::array fTCP1 = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + + o2::aod::ITSResponse itsResponse; + + // Start of the Monte-Carlo reconstructed tracks + for (const auto& track : inputTracks) { + if (!track.has_collision()) { + continue; + } + + if (!track.isPVContributor()) //! track check as used in data + { + continue; + } + if ((track.pt() < cfgCutPtLower) || (track.pt() > 5.0f) || (std::abs(track.eta()) > cfgCutEta)) { + continue; + } + if (!(track.itsNCls() > cfgITScluster) || !(track.tpcNClsFound() >= cfgTPCcluster) || !(track.tpcNClsCrossedRows() >= cfgTPCnCrossedRows)) { + continue; + } + // for purity calculation + float nsTPC = track.tpcNSigmaPr(); + float nsTOF = track.tofNSigmaPr(); + + if (track.sign() > 0) { + + histos.fill(HIST("h2_nSigmaTPC_p"), track.pt(), nsTPC); + + if (track.hasTOF()) { + histos.fill(HIST("h2_nSigmaTOF_p"), track.pt(), nsTOF); + } + } + + if (track.sign() < 0) { + + histos.fill(HIST("h2_nSigmaTPC_ap"), track.pt(), nsTPC); + + if (track.hasTOF()) { + histos.fill(HIST("h2_nSigmaTOF_ap"), track.pt(), nsTOF); + } + } + + histos.fill(HIST("hrecPtAll"), track.pt()); + histos.fill(HIST("hrecEtaAll"), track.eta()); + histos.fill(HIST("hrecPhiAll"), track.phi()); + histos.fill(HIST("hrecDcaXYAll"), track.dcaXY()); + histos.fill(HIST("hrecDcaZAll"), track.dcaZ()); + + // rejecting electron + if (cfgIfRejectElectron && isElectron(track)) { + continue; + } + // use ITS pid as well + if (cfgUseItsPid && (std::abs(itsResponse.nSigmaITS(track)) > 3.0)) { + continue; + } + // required tracks with TOF mandatory to avoid pileup + if (cfgIfMandatoryTOF && !track.hasTOF()) { + continue; + } + + bool trackSelected = false; + if (cfgPIDchoice == 0) + trackSelected = selectionPIDoldTOFveto(track); + if (cfgPIDchoice == 1) + trackSelected = selectionPIDnew(track); + if (cfgPIDchoice == 2) + trackSelected = selectionPIDold(track); + + if (trackSelected) { + + // filling nSigma distribution + histos.fill(HIST("h2DnsigmaTpcVsPt"), track.pt(), track.tpcNSigmaPr()); + histos.fill(HIST("h2DnsigmaTofVsPt"), track.pt(), track.tofNSigmaPr()); + histos.fill(HIST("h2DnsigmaItsVsPt"), track.pt(), itsResponse.nSigmaITS(track)); + + // for protons + if (track.sign() > 0) { + histos.fill(HIST("hrecPtProton"), track.pt()); //! hist for p rec + histos.fill(HIST("hrecPtDistProtonVsCentrality"), track.pt(), cent); + histos.fill(HIST("hrecEtaProton"), track.eta()); + histos.fill(HIST("hrecPhiProton"), track.phi()); + histos.fill(HIST("hrecDcaXYProton"), track.dcaXY()); + histos.fill(HIST("hrecDcaZProton"), track.dcaZ()); + + if (track.pt() < cfgCutPtUpper) { + nProt = nProt + 1.0; + float pEff = getEfficiency(track); // get efficiency of track + if (pEff != 0) { + for (int i = 1; i < 7; i++) { + powerEffProt[i] += std::pow(1.0 / pEff, i); + } + } + } + } + // for anti-protons + if (track.sign() < 0) { + histos.fill(HIST("hrecPtAntiproton"), track.pt()); //! hist for anti-p rec + histos.fill(HIST("hrecPtDistAntiprotonVsCentrality"), track.pt(), cent); + histos.fill(HIST("hrecEtaAntiproton"), track.eta()); + histos.fill(HIST("hrecPhiAntiproton"), track.phi()); + histos.fill(HIST("hrecDcaXYAntiproton"), track.dcaXY()); + histos.fill(HIST("hrecDcaZAntiproton"), track.dcaZ()); + if (track.pt() < cfgCutPtUpper) { + nAntiprot = nAntiprot + 1.0; + float pEff = getEfficiency(track); // get efficiency of track + if (pEff != 0) { + for (int i = 1; i < 7; i++) { + powerEffAntiprot[i] += std::pow(1.0 / pEff, i); + } + } + } + } + + } //! checking PID + } //! end track loop + + float netProt = nProt - nAntiprot; + histos.fill(HIST("hrecNetProtonVsCentrality"), netProt, cent); + histos.fill(HIST("hrecProtonVsCentrality"), nProt, cent); + histos.fill(HIST("hrecAntiprotonVsCentrality"), nAntiprot, cent); + histos.fill(HIST("hrecProfileTotalProton"), cent, (nProt + nAntiprot)); + histos.fill(HIST("hrecProfileProton"), cent, nProt); + histos.fill(HIST("hrecProfileAntiproton"), cent, nAntiprot); + histos.fill(HIST("hCorrProfileTotalProton"), cent, (powerEffProt[1] + powerEffAntiprot[1])); + histos.fill(HIST("hCorrProfileProton"), cent, powerEffProt[1]); + histos.fill(HIST("hCorrProfileAntiproton"), cent, powerEffAntiprot[1]); + + // Calculating q_{r,s} as required + for (int i = 1; i < 7; i++) { + fTCP0[i] = powerEffProt[i] + powerEffAntiprot[i]; + fTCP1[i] = powerEffProt[i] - powerEffAntiprot[i]; + } + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + float fQ11_1 = fTCP1[1]; + float fQ11_2 = std::pow(fTCP1[1], 2); + float fQ11_3 = std::pow(fTCP1[1], 3); + float fQ11_4 = std::pow(fTCP1[1], 4); + float fQ11_5 = std::pow(fTCP1[1], 5); + float fQ11_6 = std::pow(fTCP1[1], 6); + + float fQ21_3 = std::pow(fTCP0[1], 3); + float fQ22_3 = std::pow(fTCP0[2], 3); + float fQ31_2 = std::pow(fTCP1[1], 2); + float fQ32_2 = std::pow(fTCP1[2], 2); + float fQ33_2 = std::pow(fTCP1[3], 2); + + float fQ61_1 = fTCP0[1]; + float fQ62_1 = fTCP0[2]; + float fQ63_1 = fTCP0[3]; + float fQ64_1 = fTCP0[4]; + float fQ65_1 = fTCP0[5]; + float fQ66_1 = fTCP0[6]; + + float fQ112122_111 = fTCP1[1] * fTCP0[1] * fTCP0[2]; + float fQ112131_111 = fTCP1[1] * fTCP0[1] * fTCP1[1]; + float fQ112132_111 = fTCP1[1] * fTCP0[1] * fTCP1[2]; + float fQ112133_111 = fTCP1[1] * fTCP0[1] * fTCP1[3]; + float fQ112231_111 = fTCP1[1] * fTCP0[2] * fTCP1[1]; + float fQ112232_111 = fTCP1[1] * fTCP0[2] * fTCP1[2]; + float fQ112233_111 = fTCP1[1] * fTCP0[2] * fTCP1[3]; + float fQ112221_111 = fTCP1[1] * fTCP0[2] * fTCP0[1]; + + float fQ21_1 = fTCP0[1]; + float fQ22_1 = fTCP0[2]; + float fQ31_1 = fTCP1[1]; + float fQ32_1 = fTCP1[2]; + float fQ33_1 = fTCP1[3]; + float fQ41_1 = fTCP0[1]; + float fQ42_1 = fTCP0[2]; + float fQ43_1 = fTCP0[3]; + float fQ44_1 = fTCP0[4]; + float fQ21_2 = std::pow(fTCP0[1], 2); + float fQ22_2 = std::pow(fTCP0[2], 2); + float fQ1121_11 = fTCP1[1] * fTCP0[1]; + float fQ1121_01 = fTCP0[1]; + float fQ1121_10 = fTCP1[1]; + float fQ1121_20 = std::pow(fTCP1[1], 2); + float fQ1121_21 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ1122_11 = fTCP1[1] * fTCP0[2]; + float fQ1122_01 = fTCP0[2]; + float fQ1122_10 = fTCP1[1]; + float fQ1122_20 = std::pow(fTCP1[1], 2); + float fQ1122_21 = std::pow(fTCP1[1], 2) * fTCP0[2]; + float fQ1131_11 = fTCP1[1] * fTCP1[1]; + float fQ1131_01 = fTCP1[1]; + float fQ1131_10 = fTCP1[1]; + float fQ1132_11 = fTCP1[1] * fTCP1[2]; + float fQ1132_01 = fTCP1[2]; + float fQ1132_10 = fTCP1[1]; + float fQ1133_11 = fTCP1[1] * fTCP1[3]; + float fQ1133_01 = fTCP1[3]; + float fQ1133_10 = fTCP1[1]; + float fQ2122_11 = fTCP0[1] * fTCP0[2]; + float fQ2122_01 = fTCP0[2]; + float fQ2122_10 = fTCP0[1]; + + ///////////////---------------------> + float fQ3132_11 = fTCP1[1] * fTCP1[2]; + float fQ3132_01 = fTCP1[2]; + float fQ3132_10 = fTCP1[1]; + float fQ3133_11 = fTCP1[1] * fTCP1[3]; + float fQ3133_01 = fTCP1[3]; + float fQ3133_10 = fTCP1[1]; + float fQ3233_11 = fTCP1[2] * fTCP1[3]; + float fQ3233_01 = fTCP1[3]; + float fQ3233_10 = fTCP1[2]; + float fQ2241_11 = fTCP0[2] * fTCP0[1]; + float fQ2241_01 = fTCP0[1]; + float fQ2241_10 = fTCP0[2]; + float fQ2242_11 = fTCP0[2] * fTCP0[2]; + float fQ2242_01 = fTCP0[2]; + float fQ2242_10 = fTCP0[2]; + float fQ2243_11 = fTCP0[2] * fTCP0[3]; + float fQ2243_01 = fTCP0[3]; + float fQ2243_10 = fTCP0[2]; + float fQ2244_11 = fTCP0[2] * fTCP0[4]; + float fQ2244_01 = fTCP0[4]; + float fQ2244_10 = fTCP0[2]; + float fQ2141_11 = fTCP0[1] * fTCP0[1]; + float fQ2141_01 = fTCP0[1]; + float fQ2141_10 = fTCP0[1]; + float fQ2142_11 = fTCP0[1] * fTCP0[2]; + float fQ2142_01 = fTCP0[2]; + float fQ2142_10 = fTCP0[1]; + float fQ2143_11 = fTCP0[1] * fTCP0[3]; + float fQ2143_01 = fTCP0[3]; + float fQ2143_10 = fTCP0[1]; + float fQ2144_11 = fTCP0[1] * fTCP0[4]; + float fQ2144_01 = fTCP0[4]; + float fQ2144_10 = fTCP0[1]; + float fQ1151_11 = fTCP1[1] * fTCP1[1]; + float fQ1151_01 = fTCP1[1]; + float fQ1151_10 = fTCP1[1]; + float fQ1152_11 = fTCP1[1] * fTCP1[2]; + float fQ1152_01 = fTCP1[2]; + float fQ1152_10 = fTCP1[1]; + float fQ1153_11 = fTCP1[1] * fTCP1[3]; + float fQ1153_01 = fTCP1[3]; + float fQ1153_10 = fTCP1[1]; + float fQ1154_11 = fTCP1[1] * fTCP1[4]; + float fQ1154_01 = fTCP1[4]; + float fQ1154_10 = fTCP1[1]; + float fQ1155_11 = fTCP1[1] * fTCP1[5]; + float fQ1155_01 = fTCP1[5]; + float fQ1155_10 = fTCP1[1]; + + float fQ112233_001 = fTCP1[3]; + float fQ112233_010 = fTCP0[2]; + float fQ112233_100 = fTCP1[1]; + float fQ112233_011 = fTCP0[2] * fTCP1[3]; + float fQ112233_101 = fTCP1[1] * fTCP1[3]; + float fQ112233_110 = fTCP1[1] * fTCP0[2]; + float fQ112232_001 = fTCP1[2]; + float fQ112232_010 = fTCP0[2]; + float fQ112232_100 = fTCP1[1]; + float fQ112232_011 = fTCP0[2] * fTCP1[2]; + float fQ112232_101 = fTCP1[1] * fTCP1[2]; + float fQ112232_110 = fTCP1[1] * fTCP0[2]; + // + float fQ112231_001 = fTCP1[1]; + float fQ112231_010 = fTCP0[2]; + float fQ112231_100 = fTCP1[1]; + float fQ112231_011 = fTCP0[2] * fTCP1[1]; + float fQ112231_101 = fTCP1[1] * fTCP1[1]; + float fQ112231_110 = fTCP1[1] * fTCP0[2]; + float fQ112133_001 = fTCP1[3]; + float fQ112133_010 = fTCP0[1]; + float fQ112133_100 = fTCP1[1]; + float fQ112133_011 = fTCP0[1] * fTCP1[3]; + float fQ112133_101 = fTCP1[1] * fTCP1[3]; + float fQ112133_110 = fTCP1[1] * fTCP0[1]; + + float fQ112132_001 = fTCP1[2]; + float fQ112132_010 = fTCP0[1]; + float fQ112132_100 = fTCP1[1]; + float fQ112132_011 = fTCP0[1] * fTCP1[2]; + float fQ112132_101 = fTCP1[1] * fTCP1[2]; + float fQ112132_110 = fTCP1[1] * fTCP0[1]; + float fQ112131_001 = fTCP1[1]; + float fQ112131_010 = fTCP0[1]; + float fQ112131_100 = fTCP1[1]; + float fQ112131_011 = fTCP0[1] * fTCP1[1]; + float fQ112131_101 = fTCP1[1] * fTCP1[1]; + float fQ112131_110 = fTCP1[1] * fTCP0[1]; + + float fQ2221_11 = fTCP0[2] * fTCP0[1]; + float fQ2221_01 = fTCP0[1]; + float fQ2221_10 = fTCP0[2]; + float fQ2221_21 = std::pow(fTCP0[2], 2) * fTCP0[1]; + float fQ2221_20 = std::pow(fTCP0[2], 2); + + float fQ2122_21 = std::pow(fTCP0[1], 2) * fTCP0[2]; + float fQ2122_20 = std::pow(fTCP0[1], 2); + float fQ1121_02 = std::pow(fTCP0[1], 2); + float fQ1121_12 = fTCP1[1] * std::pow(fTCP0[1], 2); + float fQ1121_22 = std::pow(fTCP1[1], 2) * std::pow(fTCP0[1], 2); + float fQ1122_02 = std::pow(fTCP0[2], 2); + float fQ1122_12 = fTCP1[1] * std::pow(fTCP0[2], 2); + float fQ1122_22 = std::pow(fTCP1[1], 2) * std::pow(fTCP0[2], 2); + + float fQ112221_001 = fTCP0[1]; + float fQ112221_010 = fTCP0[2]; + float fQ112221_100 = fTCP1[1]; + float fQ112221_011 = fTCP0[2] * fTCP0[1]; + float fQ112221_101 = fTCP1[1] * fTCP0[1]; + float fQ112221_110 = fTCP1[1] * fTCP0[2]; + float fQ112221_200 = std::pow(fTCP1[1], 2); + float fQ112221_201 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ112221_210 = std::pow(fTCP1[1], 2) * fTCP0[2]; + float fQ112221_211 = std::pow(fTCP1[1], 2) * fTCP0[2] * fTCP0[1]; + float fQ1131_21 = std::pow(fTCP1[1], 2) * fTCP1[1]; + float fQ1131_20 = std::pow(fTCP1[1], 2); + float fQ1131_31 = std::pow(fTCP1[1], 3) * fTCP1[1]; + float fQ1131_30 = std::pow(fTCP1[1], 3); + + float fQ1132_21 = std::pow(fTCP1[1], 2) * fTCP1[2]; + float fQ1132_20 = std::pow(fTCP1[1], 2); + float fQ1132_31 = std::pow(fTCP1[1], 3) * fTCP1[2]; + float fQ1132_30 = std::pow(fTCP1[1], 3); + float fQ1133_21 = std::pow(fTCP1[1], 2) * fTCP1[3]; + float fQ1133_20 = std::pow(fTCP1[1], 2); + float fQ1133_31 = std::pow(fTCP1[1], 3) * fTCP1[3]; + float fQ1133_30 = std::pow(fTCP1[1], 3); + float fQ1121_30 = std::pow(fTCP1[1], 3); + float fQ1121_31 = std::pow(fTCP1[1], 3) * fTCP0[1]; + float fQ1121_40 = std::pow(fTCP1[1], 4); + float fQ1121_41 = std::pow(fTCP1[1], 4) * fTCP0[1]; + float fQ1122_30 = std::pow(fTCP1[1], 3); + float fQ1122_31 = std::pow(fTCP1[1], 3) * fTCP0[2]; + float fQ1122_40 = std::pow(fTCP1[1], 4); + float fQ1122_41 = std::pow(fTCP1[1], 4) * fTCP0[2]; + + float fQ2211_11 = fTCP0[2] * fTCP1[1]; + float fQ2211_01 = fTCP1[1]; + float fQ2211_10 = fTCP0[2]; + float fQ2211_20 = std::pow(fTCP0[2], 2); + float fQ2211_21 = std::pow(fTCP0[2], 2) * fTCP1[1]; + float fQ2111_11 = fTCP0[1] * fTCP1[1]; + float fQ2111_01 = fTCP1[1]; + float fQ2111_10 = fTCP0[1]; + float fQ2111_20 = std::pow(fTCP0[1], 2); + float fQ2111_21 = std::pow(fTCP0[1], 2) * fTCP1[1]; + + float fQ112122_001 = fTCP0[2]; + float fQ112122_010 = fTCP0[1]; + float fQ112122_100 = fTCP1[1]; + float fQ112122_011 = fTCP0[1] * fTCP0[2]; + float fQ112122_101 = fTCP1[1] * fTCP0[2]; + float fQ112122_110 = fTCP1[1] * fTCP0[1]; + + float fQ1141_11 = fTCP1[1] * fTCP0[1]; + float fQ1141_01 = fTCP0[1]; + float fQ1141_10 = fTCP1[1]; + float fQ1141_20 = std::pow(fTCP1[1], 2); + float fQ1141_21 = std::pow(fTCP1[1], 2) * fTCP0[1]; + float fQ1142_11 = fTCP1[1] * fTCP0[2]; + float fQ1142_01 = fTCP0[2]; + float fQ1142_10 = fTCP1[1]; + float fQ1142_20 = std::pow(fTCP1[1], 2); + float fQ1142_21 = std::pow(fTCP1[1], 2) * fTCP0[2]; + + float fQ1143_11 = fTCP1[1] * fTCP0[3]; + float fQ1143_01 = fTCP0[3]; + float fQ1143_10 = fTCP1[1]; + float fQ1143_20 = std::pow(fTCP1[1], 2); + float fQ1143_21 = std::pow(fTCP1[1], 2) * fTCP0[3]; + float fQ1144_11 = fTCP1[1] * fTCP0[4]; + float fQ1144_01 = fTCP0[4]; + float fQ1144_10 = fTCP1[1]; + float fQ1144_20 = std::pow(fTCP1[1], 2); + float fQ1144_21 = std::pow(fTCP1[1], 2) * fTCP0[4]; + float fQ2131_11 = fTCP0[1] * fTCP1[1]; + float fQ2131_01 = fTCP1[1]; + float fQ2131_10 = fTCP0[1]; + + float fQ2132_11 = fTCP0[1] * fTCP1[2]; + float fQ2132_01 = fTCP1[2]; + float fQ2132_10 = fTCP0[1]; + float fQ2133_11 = fTCP0[1] * fTCP1[3]; + float fQ2133_01 = fTCP1[3]; + float fQ2133_10 = fTCP0[1]; + float fQ2231_11 = fTCP0[2] * fTCP1[1]; + float fQ2231_01 = fTCP1[1]; + float fQ2231_10 = fTCP0[2]; + float fQ2232_11 = fTCP0[2] * fTCP1[2]; + float fQ2232_01 = fTCP1[2]; + float fQ2232_10 = fTCP0[2]; + float fQ2233_11 = fTCP0[2] * fTCP1[3]; + float fQ2233_01 = fTCP1[3]; + float fQ2233_10 = fTCP0[2]; + + float fQ51_1 = fTCP1[1]; + float fQ52_1 = fTCP1[2]; + float fQ53_1 = fTCP1[3]; + float fQ54_1 = fTCP1[4]; + float fQ55_1 = fTCP1[5]; + + //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + if (cfgIsCalculateCentral) { + + // uncorrected + histos.get(HIST("Prof_mu1_netproton"))->Fill(cent, std::pow(netProt, 1.0)); + histos.get(HIST("Prof_mu2_netproton"))->Fill(cent, std::pow(netProt, 2.0)); + histos.get(HIST("Prof_mu3_netproton"))->Fill(cent, std::pow(netProt, 3.0)); + histos.get(HIST("Prof_mu4_netproton"))->Fill(cent, std::pow(netProt, 4.0)); + histos.get(HIST("Prof_mu5_netproton"))->Fill(cent, std::pow(netProt, 5.0)); + histos.get(HIST("Prof_mu6_netproton"))->Fill(cent, std::pow(netProt, 6.0)); + histos.get(HIST("Prof_mu7_netproton"))->Fill(cent, std::pow(netProt, 7.0)); + histos.get(HIST("Prof_mu8_netproton"))->Fill(cent, std::pow(netProt, 8.0)); + + // eff. corrected + histos.get(HIST("Prof_Q11_1"))->Fill(cent, fQ11_1); + histos.get(HIST("Prof_Q11_2"))->Fill(cent, fQ11_2); + histos.get(HIST("Prof_Q11_3"))->Fill(cent, fQ11_3); + histos.get(HIST("Prof_Q11_4"))->Fill(cent, fQ11_4); + histos.get(HIST("Prof_Q21_1"))->Fill(cent, fQ21_1); + histos.get(HIST("Prof_Q22_1"))->Fill(cent, fQ22_1); + histos.get(HIST("Prof_Q31_1"))->Fill(cent, fQ31_1); + histos.get(HIST("Prof_Q32_1"))->Fill(cent, fQ32_1); + histos.get(HIST("Prof_Q33_1"))->Fill(cent, fQ33_1); + histos.get(HIST("Prof_Q41_1"))->Fill(cent, fQ41_1); + histos.get(HIST("Prof_Q42_1"))->Fill(cent, fQ42_1); + histos.get(HIST("Prof_Q43_1"))->Fill(cent, fQ43_1); + histos.get(HIST("Prof_Q44_1"))->Fill(cent, fQ44_1); + histos.get(HIST("Prof_Q21_2"))->Fill(cent, fQ21_2); + histos.get(HIST("Prof_Q22_2"))->Fill(cent, fQ22_2); + histos.get(HIST("Prof_Q1121_11"))->Fill(cent, fQ1121_11); + histos.get(HIST("Prof_Q1121_01"))->Fill(cent, fQ1121_01); + histos.get(HIST("Prof_Q1121_10"))->Fill(cent, fQ1121_10); + histos.get(HIST("Prof_Q1121_20"))->Fill(cent, fQ1121_20); + histos.get(HIST("Prof_Q1121_21"))->Fill(cent, fQ1121_21); + histos.get(HIST("Prof_Q1122_11"))->Fill(cent, fQ1122_11); + histos.get(HIST("Prof_Q1122_01"))->Fill(cent, fQ1122_01); + histos.get(HIST("Prof_Q1122_10"))->Fill(cent, fQ1122_10); + histos.get(HIST("Prof_Q1122_20"))->Fill(cent, fQ1122_20); + histos.get(HIST("Prof_Q1122_21"))->Fill(cent, fQ1122_21); + histos.get(HIST("Prof_Q1131_11"))->Fill(cent, fQ1131_11); + histos.get(HIST("Prof_Q1131_01"))->Fill(cent, fQ1131_01); + histos.get(HIST("Prof_Q1131_10"))->Fill(cent, fQ1131_10); + histos.get(HIST("Prof_Q1132_11"))->Fill(cent, fQ1132_11); + histos.get(HIST("Prof_Q1132_01"))->Fill(cent, fQ1132_01); + histos.get(HIST("Prof_Q1132_10"))->Fill(cent, fQ1132_10); + histos.get(HIST("Prof_Q1133_11"))->Fill(cent, fQ1133_11); + histos.get(HIST("Prof_Q1133_01"))->Fill(cent, fQ1133_01); + histos.get(HIST("Prof_Q1133_10"))->Fill(cent, fQ1133_10); + histos.get(HIST("Prof_Q2122_11"))->Fill(cent, fQ2122_11); + histos.get(HIST("Prof_Q2122_01"))->Fill(cent, fQ2122_01); + histos.get(HIST("Prof_Q2122_10"))->Fill(cent, fQ2122_10); + histos.get(HIST("Prof_Q3132_11"))->Fill(cent, fQ3132_11); + histos.get(HIST("Prof_Q3132_01"))->Fill(cent, fQ3132_01); + histos.get(HIST("Prof_Q3132_10"))->Fill(cent, fQ3132_10); + histos.get(HIST("Prof_Q3133_11"))->Fill(cent, fQ3133_11); + histos.get(HIST("Prof_Q3133_01"))->Fill(cent, fQ3133_01); + histos.get(HIST("Prof_Q3133_10"))->Fill(cent, fQ3133_10); + histos.get(HIST("Prof_Q3233_11"))->Fill(cent, fQ3233_11); + histos.get(HIST("Prof_Q3233_01"))->Fill(cent, fQ3233_01); + histos.get(HIST("Prof_Q3233_10"))->Fill(cent, fQ3233_10); + histos.get(HIST("Prof_Q2241_11"))->Fill(cent, fQ2241_11); + histos.get(HIST("Prof_Q2241_01"))->Fill(cent, fQ2241_01); + histos.get(HIST("Prof_Q2241_10"))->Fill(cent, fQ2241_10); + histos.get(HIST("Prof_Q2242_11"))->Fill(cent, fQ2242_11); + histos.get(HIST("Prof_Q2242_01"))->Fill(cent, fQ2242_01); + histos.get(HIST("Prof_Q2242_10"))->Fill(cent, fQ2242_10); + histos.get(HIST("Prof_Q2243_11"))->Fill(cent, fQ2243_11); + histos.get(HIST("Prof_Q2243_01"))->Fill(cent, fQ2243_01); + histos.get(HIST("Prof_Q2243_10"))->Fill(cent, fQ2243_10); + histos.get(HIST("Prof_Q2244_11"))->Fill(cent, fQ2244_11); + histos.get(HIST("Prof_Q2244_01"))->Fill(cent, fQ2244_01); + histos.get(HIST("Prof_Q2244_10"))->Fill(cent, fQ2244_10); + histos.get(HIST("Prof_Q2141_11"))->Fill(cent, fQ2141_11); + histos.get(HIST("Prof_Q2141_01"))->Fill(cent, fQ2141_01); + histos.get(HIST("Prof_Q2141_10"))->Fill(cent, fQ2141_10); + histos.get(HIST("Prof_Q2142_11"))->Fill(cent, fQ2142_11); + histos.get(HIST("Prof_Q2142_01"))->Fill(cent, fQ2142_01); + histos.get(HIST("Prof_Q2142_10"))->Fill(cent, fQ2142_10); + histos.get(HIST("Prof_Q2143_11"))->Fill(cent, fQ2143_11); + histos.get(HIST("Prof_Q2143_01"))->Fill(cent, fQ2143_01); + histos.get(HIST("Prof_Q2143_10"))->Fill(cent, fQ2143_10); + histos.get(HIST("Prof_Q2144_11"))->Fill(cent, fQ2144_11); + histos.get(HIST("Prof_Q2144_01"))->Fill(cent, fQ2144_01); + histos.get(HIST("Prof_Q2144_10"))->Fill(cent, fQ2144_10); + histos.get(HIST("Prof_Q1151_11"))->Fill(cent, fQ1151_11); + histos.get(HIST("Prof_Q1151_01"))->Fill(cent, fQ1151_01); + histos.get(HIST("Prof_Q1151_10"))->Fill(cent, fQ1151_10); + histos.get(HIST("Prof_Q1152_11"))->Fill(cent, fQ1152_11); + histos.get(HIST("Prof_Q1152_01"))->Fill(cent, fQ1152_01); + histos.get(HIST("Prof_Q1152_10"))->Fill(cent, fQ1152_10); + histos.get(HIST("Prof_Q1153_11"))->Fill(cent, fQ1153_11); + histos.get(HIST("Prof_Q1153_01"))->Fill(cent, fQ1153_01); + histos.get(HIST("Prof_Q1153_10"))->Fill(cent, fQ1153_10); + histos.get(HIST("Prof_Q1154_11"))->Fill(cent, fQ1154_11); + histos.get(HIST("Prof_Q1154_01"))->Fill(cent, fQ1154_01); + histos.get(HIST("Prof_Q1154_10"))->Fill(cent, fQ1154_10); + histos.get(HIST("Prof_Q1155_11"))->Fill(cent, fQ1155_11); + histos.get(HIST("Prof_Q1155_01"))->Fill(cent, fQ1155_01); + histos.get(HIST("Prof_Q1155_10"))->Fill(cent, fQ1155_10); + histos.get(HIST("Prof_Q112233_001"))->Fill(cent, fQ112233_001); + histos.get(HIST("Prof_Q112233_010"))->Fill(cent, fQ112233_010); + histos.get(HIST("Prof_Q112233_100"))->Fill(cent, fQ112233_100); + histos.get(HIST("Prof_Q112233_011"))->Fill(cent, fQ112233_011); + histos.get(HIST("Prof_Q112233_101"))->Fill(cent, fQ112233_101); + histos.get(HIST("Prof_Q112233_110"))->Fill(cent, fQ112233_110); + histos.get(HIST("Prof_Q112232_001"))->Fill(cent, fQ112232_001); + histos.get(HIST("Prof_Q112232_010"))->Fill(cent, fQ112232_010); + histos.get(HIST("Prof_Q112232_100"))->Fill(cent, fQ112232_100); + histos.get(HIST("Prof_Q112232_011"))->Fill(cent, fQ112232_011); + histos.get(HIST("Prof_Q112232_101"))->Fill(cent, fQ112232_101); + histos.get(HIST("Prof_Q112232_110"))->Fill(cent, fQ112232_110); + histos.get(HIST("Prof_Q112231_001"))->Fill(cent, fQ112231_001); + histos.get(HIST("Prof_Q112231_010"))->Fill(cent, fQ112231_010); + histos.get(HIST("Prof_Q112231_100"))->Fill(cent, fQ112231_100); + histos.get(HIST("Prof_Q112231_011"))->Fill(cent, fQ112231_011); + histos.get(HIST("Prof_Q112231_101"))->Fill(cent, fQ112231_101); + histos.get(HIST("Prof_Q112231_110"))->Fill(cent, fQ112231_110); + histos.get(HIST("Prof_Q112133_001"))->Fill(cent, fQ112133_001); + histos.get(HIST("Prof_Q112133_010"))->Fill(cent, fQ112133_010); + histos.get(HIST("Prof_Q112133_100"))->Fill(cent, fQ112133_100); + histos.get(HIST("Prof_Q112133_011"))->Fill(cent, fQ112133_011); + histos.get(HIST("Prof_Q112133_101"))->Fill(cent, fQ112133_101); + histos.get(HIST("Prof_Q112133_110"))->Fill(cent, fQ112133_110); + histos.get(HIST("Prof_Q112132_001"))->Fill(cent, fQ112132_001); + histos.get(HIST("Prof_Q112132_010"))->Fill(cent, fQ112132_010); + histos.get(HIST("Prof_Q112132_100"))->Fill(cent, fQ112132_100); + histos.get(HIST("Prof_Q112132_011"))->Fill(cent, fQ112132_011); + histos.get(HIST("Prof_Q112132_101"))->Fill(cent, fQ112132_101); + histos.get(HIST("Prof_Q112132_110"))->Fill(cent, fQ112132_110); + histos.get(HIST("Prof_Q112131_001"))->Fill(cent, fQ112131_001); + histos.get(HIST("Prof_Q112131_010"))->Fill(cent, fQ112131_010); + histos.get(HIST("Prof_Q112131_100"))->Fill(cent, fQ112131_100); + histos.get(HIST("Prof_Q112131_011"))->Fill(cent, fQ112131_011); + histos.get(HIST("Prof_Q112131_101"))->Fill(cent, fQ112131_101); + histos.get(HIST("Prof_Q112131_110"))->Fill(cent, fQ112131_110); + histos.get(HIST("Prof_Q2221_11"))->Fill(cent, fQ2221_11); + histos.get(HIST("Prof_Q2221_01"))->Fill(cent, fQ2221_01); + histos.get(HIST("Prof_Q2221_10"))->Fill(cent, fQ2221_10); + histos.get(HIST("Prof_Q2221_21"))->Fill(cent, fQ2221_21); + histos.get(HIST("Prof_Q2221_20"))->Fill(cent, fQ2221_20); + histos.get(HIST("Prof_Q2122_21"))->Fill(cent, fQ2122_21); + histos.get(HIST("Prof_Q2122_20"))->Fill(cent, fQ2122_20); + histos.get(HIST("Prof_Q1121_02"))->Fill(cent, fQ1121_02); + histos.get(HIST("Prof_Q1121_12"))->Fill(cent, fQ1121_12); + histos.get(HIST("Prof_Q1121_22"))->Fill(cent, fQ1121_22); + histos.get(HIST("Prof_Q1122_02"))->Fill(cent, fQ1122_02); + histos.get(HIST("Prof_Q1122_12"))->Fill(cent, fQ1122_12); + histos.get(HIST("Prof_Q1122_22"))->Fill(cent, fQ1122_22); + histos.get(HIST("Prof_Q112221_001"))->Fill(cent, fQ112221_001); + histos.get(HIST("Prof_Q112221_010"))->Fill(cent, fQ112221_010); + histos.get(HIST("Prof_Q112221_100"))->Fill(cent, fQ112221_100); + histos.get(HIST("Prof_Q112221_011"))->Fill(cent, fQ112221_011); + histos.get(HIST("Prof_Q112221_101"))->Fill(cent, fQ112221_101); + histos.get(HIST("Prof_Q112221_110"))->Fill(cent, fQ112221_110); + histos.get(HIST("Prof_Q112221_200"))->Fill(cent, fQ112221_200); + histos.get(HIST("Prof_Q112221_201"))->Fill(cent, fQ112221_201); + histos.get(HIST("Prof_Q112221_210"))->Fill(cent, fQ112221_210); + histos.get(HIST("Prof_Q112221_211"))->Fill(cent, fQ112221_211); + histos.get(HIST("Prof_Q1131_21"))->Fill(cent, fQ1131_21); + histos.get(HIST("Prof_Q1131_20"))->Fill(cent, fQ1131_20); + histos.get(HIST("Prof_Q1131_31"))->Fill(cent, fQ1131_31); + histos.get(HIST("Prof_Q1131_30"))->Fill(cent, fQ1131_30); + histos.get(HIST("Prof_Q1132_21"))->Fill(cent, fQ1132_21); + histos.get(HIST("Prof_Q1132_20"))->Fill(cent, fQ1132_20); + histos.get(HIST("Prof_Q1132_31"))->Fill(cent, fQ1132_31); + histos.get(HIST("Prof_Q1132_30"))->Fill(cent, fQ1132_30); + histos.get(HIST("Prof_Q1133_21"))->Fill(cent, fQ1133_21); + histos.get(HIST("Prof_Q1133_20"))->Fill(cent, fQ1133_20); + histos.get(HIST("Prof_Q1133_31"))->Fill(cent, fQ1133_31); + histos.get(HIST("Prof_Q1133_30"))->Fill(cent, fQ1133_30); + histos.get(HIST("Prof_Q11_5"))->Fill(cent, fQ11_5); + histos.get(HIST("Prof_Q11_6"))->Fill(cent, fQ11_6); + histos.get(HIST("Prof_Q1121_30"))->Fill(cent, fQ1121_30); + histos.get(HIST("Prof_Q1121_31"))->Fill(cent, fQ1121_31); + histos.get(HIST("Prof_Q1121_40"))->Fill(cent, fQ1121_40); + histos.get(HIST("Prof_Q1121_41"))->Fill(cent, fQ1121_41); + histos.get(HIST("Prof_Q1122_30"))->Fill(cent, fQ1122_30); + histos.get(HIST("Prof_Q1122_31"))->Fill(cent, fQ1122_31); + histos.get(HIST("Prof_Q1122_40"))->Fill(cent, fQ1122_40); + histos.get(HIST("Prof_Q1122_41"))->Fill(cent, fQ1122_41); + histos.get(HIST("Prof_Q2211_11"))->Fill(cent, fQ2211_11); + histos.get(HIST("Prof_Q2211_01"))->Fill(cent, fQ2211_01); + histos.get(HIST("Prof_Q2211_10"))->Fill(cent, fQ2211_10); + histos.get(HIST("Prof_Q2211_20"))->Fill(cent, fQ2211_20); + histos.get(HIST("Prof_Q2211_21"))->Fill(cent, fQ2211_21); + histos.get(HIST("Prof_Q2111_11"))->Fill(cent, fQ2111_11); + histos.get(HIST("Prof_Q2111_01"))->Fill(cent, fQ2111_01); + histos.get(HIST("Prof_Q2111_10"))->Fill(cent, fQ2111_10); + histos.get(HIST("Prof_Q2111_20"))->Fill(cent, fQ2111_20); + histos.get(HIST("Prof_Q2111_21"))->Fill(cent, fQ2111_21); + histos.get(HIST("Prof_Q112122_001"))->Fill(cent, fQ112122_001); + histos.get(HIST("Prof_Q112122_010"))->Fill(cent, fQ112122_010); + histos.get(HIST("Prof_Q112122_100"))->Fill(cent, fQ112122_100); + histos.get(HIST("Prof_Q112122_011"))->Fill(cent, fQ112122_011); + histos.get(HIST("Prof_Q112122_101"))->Fill(cent, fQ112122_101); + histos.get(HIST("Prof_Q112122_110"))->Fill(cent, fQ112122_110); + histos.get(HIST("Prof_Q1141_11"))->Fill(cent, fQ1141_11); + histos.get(HIST("Prof_Q1141_01"))->Fill(cent, fQ1141_01); + histos.get(HIST("Prof_Q1141_10"))->Fill(cent, fQ1141_10); + histos.get(HIST("Prof_Q1141_20"))->Fill(cent, fQ1141_20); + histos.get(HIST("Prof_Q1141_21"))->Fill(cent, fQ1141_21); + histos.get(HIST("Prof_Q1142_11"))->Fill(cent, fQ1142_11); + histos.get(HIST("Prof_Q1142_01"))->Fill(cent, fQ1142_01); + histos.get(HIST("Prof_Q1142_10"))->Fill(cent, fQ1142_10); + histos.get(HIST("Prof_Q1142_20"))->Fill(cent, fQ1142_20); + histos.get(HIST("Prof_Q1142_21"))->Fill(cent, fQ1142_21); + histos.get(HIST("Prof_Q1143_11"))->Fill(cent, fQ1143_11); + histos.get(HIST("Prof_Q1143_01"))->Fill(cent, fQ1143_01); + histos.get(HIST("Prof_Q1143_10"))->Fill(cent, fQ1143_10); + histos.get(HIST("Prof_Q1143_20"))->Fill(cent, fQ1143_20); + histos.get(HIST("Prof_Q1143_21"))->Fill(cent, fQ1143_21); + histos.get(HIST("Prof_Q1144_11"))->Fill(cent, fQ1144_11); + histos.get(HIST("Prof_Q1144_01"))->Fill(cent, fQ1144_01); + histos.get(HIST("Prof_Q1144_10"))->Fill(cent, fQ1144_10); + histos.get(HIST("Prof_Q1144_20"))->Fill(cent, fQ1144_20); + histos.get(HIST("Prof_Q1144_21"))->Fill(cent, fQ1144_21); + histos.get(HIST("Prof_Q2131_11"))->Fill(cent, fQ2131_11); + histos.get(HIST("Prof_Q2131_01"))->Fill(cent, fQ2131_01); + histos.get(HIST("Prof_Q2131_10"))->Fill(cent, fQ2131_10); + histos.get(HIST("Prof_Q2132_11"))->Fill(cent, fQ2132_11); + histos.get(HIST("Prof_Q2132_01"))->Fill(cent, fQ2132_01); + histos.get(HIST("Prof_Q2132_10"))->Fill(cent, fQ2132_10); + histos.get(HIST("Prof_Q2133_11"))->Fill(cent, fQ2133_11); + histos.get(HIST("Prof_Q2133_01"))->Fill(cent, fQ2133_01); + histos.get(HIST("Prof_Q2133_10"))->Fill(cent, fQ2133_10); + histos.get(HIST("Prof_Q2231_11"))->Fill(cent, fQ2231_11); + histos.get(HIST("Prof_Q2231_01"))->Fill(cent, fQ2231_01); + histos.get(HIST("Prof_Q2231_10"))->Fill(cent, fQ2231_10); + histos.get(HIST("Prof_Q2232_11"))->Fill(cent, fQ2232_11); + histos.get(HIST("Prof_Q2232_01"))->Fill(cent, fQ2232_01); + histos.get(HIST("Prof_Q2232_10"))->Fill(cent, fQ2232_10); + histos.get(HIST("Prof_Q2233_11"))->Fill(cent, fQ2233_11); + histos.get(HIST("Prof_Q2233_01"))->Fill(cent, fQ2233_01); + histos.get(HIST("Prof_Q2233_10"))->Fill(cent, fQ2233_10); + histos.get(HIST("Prof_Q51_1"))->Fill(cent, fQ51_1); + histos.get(HIST("Prof_Q52_1"))->Fill(cent, fQ52_1); + histos.get(HIST("Prof_Q53_1"))->Fill(cent, fQ53_1); + histos.get(HIST("Prof_Q54_1"))->Fill(cent, fQ54_1); + histos.get(HIST("Prof_Q55_1"))->Fill(cent, fQ55_1); + histos.get(HIST("Prof_Q21_3"))->Fill(cent, fQ21_3); + histos.get(HIST("Prof_Q22_3"))->Fill(cent, fQ22_3); + histos.get(HIST("Prof_Q31_2"))->Fill(cent, fQ31_2); + histos.get(HIST("Prof_Q32_2"))->Fill(cent, fQ32_2); + histos.get(HIST("Prof_Q33_2"))->Fill(cent, fQ33_2); + histos.get(HIST("Prof_Q61_1"))->Fill(cent, fQ61_1); + histos.get(HIST("Prof_Q62_1"))->Fill(cent, fQ62_1); + histos.get(HIST("Prof_Q63_1"))->Fill(cent, fQ63_1); + histos.get(HIST("Prof_Q64_1"))->Fill(cent, fQ64_1); + histos.get(HIST("Prof_Q65_1"))->Fill(cent, fQ65_1); + histos.get(HIST("Prof_Q66_1"))->Fill(cent, fQ66_1); + histos.get(HIST("Prof_Q112122_111"))->Fill(cent, fQ112122_111); + histos.get(HIST("Prof_Q112131_111"))->Fill(cent, fQ112131_111); + histos.get(HIST("Prof_Q112132_111"))->Fill(cent, fQ112132_111); + histos.get(HIST("Prof_Q112133_111"))->Fill(cent, fQ112133_111); + histos.get(HIST("Prof_Q112231_111"))->Fill(cent, fQ112231_111); + histos.get(HIST("Prof_Q112232_111"))->Fill(cent, fQ112232_111); + histos.get(HIST("Prof_Q112233_111"))->Fill(cent, fQ112233_111); + histos.get(HIST("Prof_Q112221_111"))->Fill(cent, fQ112221_111); + } + + if (cfgIsCalculateError) { + // selecting subsample and filling profiles + float lRandom = fRndm->Rndm(); + int sampleIndex = static_cast(cfgNSubsample * lRandom); + + histos.get(HIST("Prof2D_mu1_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 1.0)); + histos.get(HIST("Prof2D_mu2_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 2.0)); + histos.get(HIST("Prof2D_mu3_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 3.0)); + histos.get(HIST("Prof2D_mu4_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 4.0)); + histos.get(HIST("Prof2D_mu5_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 5.0)); + histos.get(HIST("Prof2D_mu6_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 6.0)); + histos.get(HIST("Prof2D_mu7_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 7.0)); + histos.get(HIST("Prof2D_mu8_netproton"))->Fill(cent, sampleIndex, std::pow(netProt, 8.0)); + + histos.get(HIST("Prof2D_Q11_1"))->Fill(cent, sampleIndex, fQ11_1); + histos.get(HIST("Prof2D_Q11_2"))->Fill(cent, sampleIndex, fQ11_2); + histos.get(HIST("Prof2D_Q11_3"))->Fill(cent, sampleIndex, fQ11_3); + histos.get(HIST("Prof2D_Q11_4"))->Fill(cent, sampleIndex, fQ11_4); + histos.get(HIST("Prof2D_Q21_1"))->Fill(cent, sampleIndex, fQ21_1); + histos.get(HIST("Prof2D_Q22_1"))->Fill(cent, sampleIndex, fQ22_1); + histos.get(HIST("Prof2D_Q31_1"))->Fill(cent, sampleIndex, fQ31_1); + histos.get(HIST("Prof2D_Q32_1"))->Fill(cent, sampleIndex, fQ32_1); + histos.get(HIST("Prof2D_Q33_1"))->Fill(cent, sampleIndex, fQ33_1); + histos.get(HIST("Prof2D_Q41_1"))->Fill(cent, sampleIndex, fQ41_1); + histos.get(HIST("Prof2D_Q42_1"))->Fill(cent, sampleIndex, fQ42_1); + histos.get(HIST("Prof2D_Q43_1"))->Fill(cent, sampleIndex, fQ43_1); + histos.get(HIST("Prof2D_Q44_1"))->Fill(cent, sampleIndex, fQ44_1); + histos.get(HIST("Prof2D_Q21_2"))->Fill(cent, sampleIndex, fQ21_2); + histos.get(HIST("Prof2D_Q22_2"))->Fill(cent, sampleIndex, fQ22_2); + histos.get(HIST("Prof2D_Q1121_11"))->Fill(cent, sampleIndex, fQ1121_11); + histos.get(HIST("Prof2D_Q1121_01"))->Fill(cent, sampleIndex, fQ1121_01); + histos.get(HIST("Prof2D_Q1121_10"))->Fill(cent, sampleIndex, fQ1121_10); + histos.get(HIST("Prof2D_Q1121_20"))->Fill(cent, sampleIndex, fQ1121_20); + histos.get(HIST("Prof2D_Q1121_21"))->Fill(cent, sampleIndex, fQ1121_21); + histos.get(HIST("Prof2D_Q1122_11"))->Fill(cent, sampleIndex, fQ1122_11); + histos.get(HIST("Prof2D_Q1122_01"))->Fill(cent, sampleIndex, fQ1122_01); + histos.get(HIST("Prof2D_Q1122_10"))->Fill(cent, sampleIndex, fQ1122_10); + histos.get(HIST("Prof2D_Q1122_20"))->Fill(cent, sampleIndex, fQ1122_20); + histos.get(HIST("Prof2D_Q1122_21"))->Fill(cent, sampleIndex, fQ1122_21); + histos.get(HIST("Prof2D_Q1131_11"))->Fill(cent, sampleIndex, fQ1131_11); + histos.get(HIST("Prof2D_Q1131_01"))->Fill(cent, sampleIndex, fQ1131_01); + histos.get(HIST("Prof2D_Q1131_10"))->Fill(cent, sampleIndex, fQ1131_10); + histos.get(HIST("Prof2D_Q1132_11"))->Fill(cent, sampleIndex, fQ1132_11); + histos.get(HIST("Prof2D_Q1132_01"))->Fill(cent, sampleIndex, fQ1132_01); + histos.get(HIST("Prof2D_Q1132_10"))->Fill(cent, sampleIndex, fQ1132_10); + histos.get(HIST("Prof2D_Q1133_11"))->Fill(cent, sampleIndex, fQ1133_11); + histos.get(HIST("Prof2D_Q1133_01"))->Fill(cent, sampleIndex, fQ1133_01); + histos.get(HIST("Prof2D_Q1133_10"))->Fill(cent, sampleIndex, fQ1133_10); + histos.get(HIST("Prof2D_Q2122_11"))->Fill(cent, sampleIndex, fQ2122_11); + histos.get(HIST("Prof2D_Q2122_01"))->Fill(cent, sampleIndex, fQ2122_01); + histos.get(HIST("Prof2D_Q2122_10"))->Fill(cent, sampleIndex, fQ2122_10); + histos.get(HIST("Prof2D_Q3132_11"))->Fill(cent, sampleIndex, fQ3132_11); + histos.get(HIST("Prof2D_Q3132_01"))->Fill(cent, sampleIndex, fQ3132_01); + histos.get(HIST("Prof2D_Q3132_10"))->Fill(cent, sampleIndex, fQ3132_10); + histos.get(HIST("Prof2D_Q3133_11"))->Fill(cent, sampleIndex, fQ3133_11); + histos.get(HIST("Prof2D_Q3133_01"))->Fill(cent, sampleIndex, fQ3133_01); + histos.get(HIST("Prof2D_Q3133_10"))->Fill(cent, sampleIndex, fQ3133_10); + histos.get(HIST("Prof2D_Q3233_11"))->Fill(cent, sampleIndex, fQ3233_11); + histos.get(HIST("Prof2D_Q3233_01"))->Fill(cent, sampleIndex, fQ3233_01); + histos.get(HIST("Prof2D_Q3233_10"))->Fill(cent, sampleIndex, fQ3233_10); + histos.get(HIST("Prof2D_Q2241_11"))->Fill(cent, sampleIndex, fQ2241_11); + histos.get(HIST("Prof2D_Q2241_01"))->Fill(cent, sampleIndex, fQ2241_01); + histos.get(HIST("Prof2D_Q2241_10"))->Fill(cent, sampleIndex, fQ2241_10); + histos.get(HIST("Prof2D_Q2242_11"))->Fill(cent, sampleIndex, fQ2242_11); + histos.get(HIST("Prof2D_Q2242_01"))->Fill(cent, sampleIndex, fQ2242_01); + histos.get(HIST("Prof2D_Q2242_10"))->Fill(cent, sampleIndex, fQ2242_10); + histos.get(HIST("Prof2D_Q2243_11"))->Fill(cent, sampleIndex, fQ2243_11); + histos.get(HIST("Prof2D_Q2243_01"))->Fill(cent, sampleIndex, fQ2243_01); + histos.get(HIST("Prof2D_Q2243_10"))->Fill(cent, sampleIndex, fQ2243_10); + histos.get(HIST("Prof2D_Q2244_11"))->Fill(cent, sampleIndex, fQ2244_11); + histos.get(HIST("Prof2D_Q2244_01"))->Fill(cent, sampleIndex, fQ2244_01); + histos.get(HIST("Prof2D_Q2244_10"))->Fill(cent, sampleIndex, fQ2244_10); + histos.get(HIST("Prof2D_Q2141_11"))->Fill(cent, sampleIndex, fQ2141_11); + histos.get(HIST("Prof2D_Q2141_01"))->Fill(cent, sampleIndex, fQ2141_01); + histos.get(HIST("Prof2D_Q2141_10"))->Fill(cent, sampleIndex, fQ2141_10); + histos.get(HIST("Prof2D_Q2142_11"))->Fill(cent, sampleIndex, fQ2142_11); + histos.get(HIST("Prof2D_Q2142_01"))->Fill(cent, sampleIndex, fQ2142_01); + histos.get(HIST("Prof2D_Q2142_10"))->Fill(cent, sampleIndex, fQ2142_10); + histos.get(HIST("Prof2D_Q2143_11"))->Fill(cent, sampleIndex, fQ2143_11); + histos.get(HIST("Prof2D_Q2143_01"))->Fill(cent, sampleIndex, fQ2143_01); + histos.get(HIST("Prof2D_Q2143_10"))->Fill(cent, sampleIndex, fQ2143_10); + histos.get(HIST("Prof2D_Q2144_11"))->Fill(cent, sampleIndex, fQ2144_11); + histos.get(HIST("Prof2D_Q2144_01"))->Fill(cent, sampleIndex, fQ2144_01); + histos.get(HIST("Prof2D_Q2144_10"))->Fill(cent, sampleIndex, fQ2144_10); + histos.get(HIST("Prof2D_Q1151_11"))->Fill(cent, sampleIndex, fQ1151_11); + histos.get(HIST("Prof2D_Q1151_01"))->Fill(cent, sampleIndex, fQ1151_01); + histos.get(HIST("Prof2D_Q1151_10"))->Fill(cent, sampleIndex, fQ1151_10); + histos.get(HIST("Prof2D_Q1152_11"))->Fill(cent, sampleIndex, fQ1152_11); + histos.get(HIST("Prof2D_Q1152_01"))->Fill(cent, sampleIndex, fQ1152_01); + histos.get(HIST("Prof2D_Q1152_10"))->Fill(cent, sampleIndex, fQ1152_10); + histos.get(HIST("Prof2D_Q1153_11"))->Fill(cent, sampleIndex, fQ1153_11); + histos.get(HIST("Prof2D_Q1153_01"))->Fill(cent, sampleIndex, fQ1153_01); + histos.get(HIST("Prof2D_Q1153_10"))->Fill(cent, sampleIndex, fQ1153_10); + histos.get(HIST("Prof2D_Q1154_11"))->Fill(cent, sampleIndex, fQ1154_11); + histos.get(HIST("Prof2D_Q1154_01"))->Fill(cent, sampleIndex, fQ1154_01); + histos.get(HIST("Prof2D_Q1154_10"))->Fill(cent, sampleIndex, fQ1154_10); + histos.get(HIST("Prof2D_Q1155_11"))->Fill(cent, sampleIndex, fQ1155_11); + histos.get(HIST("Prof2D_Q1155_01"))->Fill(cent, sampleIndex, fQ1155_01); + histos.get(HIST("Prof2D_Q1155_10"))->Fill(cent, sampleIndex, fQ1155_10); + histos.get(HIST("Prof2D_Q112233_001"))->Fill(cent, sampleIndex, fQ112233_001); + histos.get(HIST("Prof2D_Q112233_010"))->Fill(cent, sampleIndex, fQ112233_010); + histos.get(HIST("Prof2D_Q112233_100"))->Fill(cent, sampleIndex, fQ112233_100); + histos.get(HIST("Prof2D_Q112233_011"))->Fill(cent, sampleIndex, fQ112233_011); + histos.get(HIST("Prof2D_Q112233_101"))->Fill(cent, sampleIndex, fQ112233_101); + histos.get(HIST("Prof2D_Q112233_110"))->Fill(cent, sampleIndex, fQ112233_110); + histos.get(HIST("Prof2D_Q112232_001"))->Fill(cent, sampleIndex, fQ112232_001); + histos.get(HIST("Prof2D_Q112232_010"))->Fill(cent, sampleIndex, fQ112232_010); + histos.get(HIST("Prof2D_Q112232_100"))->Fill(cent, sampleIndex, fQ112232_100); + histos.get(HIST("Prof2D_Q112232_011"))->Fill(cent, sampleIndex, fQ112232_011); + histos.get(HIST("Prof2D_Q112232_101"))->Fill(cent, sampleIndex, fQ112232_101); + histos.get(HIST("Prof2D_Q112232_110"))->Fill(cent, sampleIndex, fQ112232_110); + histos.get(HIST("Prof2D_Q112231_001"))->Fill(cent, sampleIndex, fQ112231_001); + histos.get(HIST("Prof2D_Q112231_010"))->Fill(cent, sampleIndex, fQ112231_010); + histos.get(HIST("Prof2D_Q112231_100"))->Fill(cent, sampleIndex, fQ112231_100); + histos.get(HIST("Prof2D_Q112231_011"))->Fill(cent, sampleIndex, fQ112231_011); + histos.get(HIST("Prof2D_Q112231_101"))->Fill(cent, sampleIndex, fQ112231_101); + histos.get(HIST("Prof2D_Q112231_110"))->Fill(cent, sampleIndex, fQ112231_110); + histos.get(HIST("Prof2D_Q112133_001"))->Fill(cent, sampleIndex, fQ112133_001); + histos.get(HIST("Prof2D_Q112133_010"))->Fill(cent, sampleIndex, fQ112133_010); + histos.get(HIST("Prof2D_Q112133_100"))->Fill(cent, sampleIndex, fQ112133_100); + histos.get(HIST("Prof2D_Q112133_011"))->Fill(cent, sampleIndex, fQ112133_011); + histos.get(HIST("Prof2D_Q112133_101"))->Fill(cent, sampleIndex, fQ112133_101); + histos.get(HIST("Prof2D_Q112133_110"))->Fill(cent, sampleIndex, fQ112133_110); + histos.get(HIST("Prof2D_Q112132_001"))->Fill(cent, sampleIndex, fQ112132_001); + histos.get(HIST("Prof2D_Q112132_010"))->Fill(cent, sampleIndex, fQ112132_010); + histos.get(HIST("Prof2D_Q112132_100"))->Fill(cent, sampleIndex, fQ112132_100); + histos.get(HIST("Prof2D_Q112132_011"))->Fill(cent, sampleIndex, fQ112132_011); + histos.get(HIST("Prof2D_Q112132_101"))->Fill(cent, sampleIndex, fQ112132_101); + histos.get(HIST("Prof2D_Q112132_110"))->Fill(cent, sampleIndex, fQ112132_110); + histos.get(HIST("Prof2D_Q112131_001"))->Fill(cent, sampleIndex, fQ112131_001); + histos.get(HIST("Prof2D_Q112131_010"))->Fill(cent, sampleIndex, fQ112131_010); + histos.get(HIST("Prof2D_Q112131_100"))->Fill(cent, sampleIndex, fQ112131_100); + histos.get(HIST("Prof2D_Q112131_011"))->Fill(cent, sampleIndex, fQ112131_011); + histos.get(HIST("Prof2D_Q112131_101"))->Fill(cent, sampleIndex, fQ112131_101); + histos.get(HIST("Prof2D_Q112131_110"))->Fill(cent, sampleIndex, fQ112131_110); + histos.get(HIST("Prof2D_Q2221_11"))->Fill(cent, sampleIndex, fQ2221_11); + histos.get(HIST("Prof2D_Q2221_01"))->Fill(cent, sampleIndex, fQ2221_01); + histos.get(HIST("Prof2D_Q2221_10"))->Fill(cent, sampleIndex, fQ2221_10); + histos.get(HIST("Prof2D_Q2221_21"))->Fill(cent, sampleIndex, fQ2221_21); + histos.get(HIST("Prof2D_Q2221_20"))->Fill(cent, sampleIndex, fQ2221_20); + histos.get(HIST("Prof2D_Q2122_21"))->Fill(cent, sampleIndex, fQ2122_21); + histos.get(HIST("Prof2D_Q2122_20"))->Fill(cent, sampleIndex, fQ2122_20); + histos.get(HIST("Prof2D_Q1121_02"))->Fill(cent, sampleIndex, fQ1121_02); + histos.get(HIST("Prof2D_Q1121_12"))->Fill(cent, sampleIndex, fQ1121_12); + histos.get(HIST("Prof2D_Q1121_22"))->Fill(cent, sampleIndex, fQ1121_22); + histos.get(HIST("Prof2D_Q1122_02"))->Fill(cent, sampleIndex, fQ1122_02); + histos.get(HIST("Prof2D_Q1122_12"))->Fill(cent, sampleIndex, fQ1122_12); + histos.get(HIST("Prof2D_Q1122_22"))->Fill(cent, sampleIndex, fQ1122_22); + histos.get(HIST("Prof2D_Q112221_001"))->Fill(cent, sampleIndex, fQ112221_001); + histos.get(HIST("Prof2D_Q112221_010"))->Fill(cent, sampleIndex, fQ112221_010); + histos.get(HIST("Prof2D_Q112221_100"))->Fill(cent, sampleIndex, fQ112221_100); + histos.get(HIST("Prof2D_Q112221_011"))->Fill(cent, sampleIndex, fQ112221_011); + histos.get(HIST("Prof2D_Q112221_101"))->Fill(cent, sampleIndex, fQ112221_101); + histos.get(HIST("Prof2D_Q112221_110"))->Fill(cent, sampleIndex, fQ112221_110); + histos.get(HIST("Prof2D_Q112221_200"))->Fill(cent, sampleIndex, fQ112221_200); + histos.get(HIST("Prof2D_Q112221_201"))->Fill(cent, sampleIndex, fQ112221_201); + histos.get(HIST("Prof2D_Q112221_210"))->Fill(cent, sampleIndex, fQ112221_210); + histos.get(HIST("Prof2D_Q112221_211"))->Fill(cent, sampleIndex, fQ112221_211); + histos.get(HIST("Prof2D_Q1131_21"))->Fill(cent, sampleIndex, fQ1131_21); + histos.get(HIST("Prof2D_Q1131_20"))->Fill(cent, sampleIndex, fQ1131_20); + histos.get(HIST("Prof2D_Q1131_31"))->Fill(cent, sampleIndex, fQ1131_31); + histos.get(HIST("Prof2D_Q1131_30"))->Fill(cent, sampleIndex, fQ1131_30); + histos.get(HIST("Prof2D_Q1132_21"))->Fill(cent, sampleIndex, fQ1132_21); + histos.get(HIST("Prof2D_Q1132_20"))->Fill(cent, sampleIndex, fQ1132_20); + histos.get(HIST("Prof2D_Q1132_31"))->Fill(cent, sampleIndex, fQ1132_31); + histos.get(HIST("Prof2D_Q1132_30"))->Fill(cent, sampleIndex, fQ1132_30); + histos.get(HIST("Prof2D_Q1133_21"))->Fill(cent, sampleIndex, fQ1133_21); + histos.get(HIST("Prof2D_Q1133_20"))->Fill(cent, sampleIndex, fQ1133_20); + histos.get(HIST("Prof2D_Q1133_31"))->Fill(cent, sampleIndex, fQ1133_31); + histos.get(HIST("Prof2D_Q1133_30"))->Fill(cent, sampleIndex, fQ1133_30); + histos.get(HIST("Prof2D_Q11_5"))->Fill(cent, sampleIndex, fQ11_5); + histos.get(HIST("Prof2D_Q11_6"))->Fill(cent, sampleIndex, fQ11_6); + histos.get(HIST("Prof2D_Q1121_30"))->Fill(cent, sampleIndex, fQ1121_30); + histos.get(HIST("Prof2D_Q1121_31"))->Fill(cent, sampleIndex, fQ1121_31); + histos.get(HIST("Prof2D_Q1121_40"))->Fill(cent, sampleIndex, fQ1121_40); + histos.get(HIST("Prof2D_Q1121_41"))->Fill(cent, sampleIndex, fQ1121_41); + histos.get(HIST("Prof2D_Q1122_30"))->Fill(cent, sampleIndex, fQ1122_30); + histos.get(HIST("Prof2D_Q1122_31"))->Fill(cent, sampleIndex, fQ1122_31); + histos.get(HIST("Prof2D_Q1122_40"))->Fill(cent, sampleIndex, fQ1122_40); + histos.get(HIST("Prof2D_Q1122_41"))->Fill(cent, sampleIndex, fQ1122_41); + histos.get(HIST("Prof2D_Q2211_11"))->Fill(cent, sampleIndex, fQ2211_11); + histos.get(HIST("Prof2D_Q2211_01"))->Fill(cent, sampleIndex, fQ2211_01); + histos.get(HIST("Prof2D_Q2211_10"))->Fill(cent, sampleIndex, fQ2211_10); + histos.get(HIST("Prof2D_Q2211_20"))->Fill(cent, sampleIndex, fQ2211_20); + histos.get(HIST("Prof2D_Q2211_21"))->Fill(cent, sampleIndex, fQ2211_21); + histos.get(HIST("Prof2D_Q2111_11"))->Fill(cent, sampleIndex, fQ2111_11); + histos.get(HIST("Prof2D_Q2111_01"))->Fill(cent, sampleIndex, fQ2111_01); + histos.get(HIST("Prof2D_Q2111_10"))->Fill(cent, sampleIndex, fQ2111_10); + histos.get(HIST("Prof2D_Q2111_20"))->Fill(cent, sampleIndex, fQ2111_20); + histos.get(HIST("Prof2D_Q2111_21"))->Fill(cent, sampleIndex, fQ2111_21); + histos.get(HIST("Prof2D_Q112122_001"))->Fill(cent, sampleIndex, fQ112122_001); + histos.get(HIST("Prof2D_Q112122_010"))->Fill(cent, sampleIndex, fQ112122_010); + histos.get(HIST("Prof2D_Q112122_100"))->Fill(cent, sampleIndex, fQ112122_100); + histos.get(HIST("Prof2D_Q112122_011"))->Fill(cent, sampleIndex, fQ112122_011); + histos.get(HIST("Prof2D_Q112122_101"))->Fill(cent, sampleIndex, fQ112122_101); + histos.get(HIST("Prof2D_Q112122_110"))->Fill(cent, sampleIndex, fQ112122_110); + histos.get(HIST("Prof2D_Q1141_11"))->Fill(cent, sampleIndex, fQ1141_11); + histos.get(HIST("Prof2D_Q1141_01"))->Fill(cent, sampleIndex, fQ1141_01); + histos.get(HIST("Prof2D_Q1141_10"))->Fill(cent, sampleIndex, fQ1141_10); + histos.get(HIST("Prof2D_Q1141_20"))->Fill(cent, sampleIndex, fQ1141_20); + histos.get(HIST("Prof2D_Q1141_21"))->Fill(cent, sampleIndex, fQ1141_21); + histos.get(HIST("Prof2D_Q1142_11"))->Fill(cent, sampleIndex, fQ1142_11); + histos.get(HIST("Prof2D_Q1142_01"))->Fill(cent, sampleIndex, fQ1142_01); + histos.get(HIST("Prof2D_Q1142_10"))->Fill(cent, sampleIndex, fQ1142_10); + histos.get(HIST("Prof2D_Q1142_20"))->Fill(cent, sampleIndex, fQ1142_20); + histos.get(HIST("Prof2D_Q1142_21"))->Fill(cent, sampleIndex, fQ1142_21); + histos.get(HIST("Prof2D_Q1143_11"))->Fill(cent, sampleIndex, fQ1143_11); + histos.get(HIST("Prof2D_Q1143_01"))->Fill(cent, sampleIndex, fQ1143_01); + histos.get(HIST("Prof2D_Q1143_10"))->Fill(cent, sampleIndex, fQ1143_10); + histos.get(HIST("Prof2D_Q1143_20"))->Fill(cent, sampleIndex, fQ1143_20); + histos.get(HIST("Prof2D_Q1143_21"))->Fill(cent, sampleIndex, fQ1143_21); + histos.get(HIST("Prof2D_Q1144_11"))->Fill(cent, sampleIndex, fQ1144_11); + histos.get(HIST("Prof2D_Q1144_01"))->Fill(cent, sampleIndex, fQ1144_01); + histos.get(HIST("Prof2D_Q1144_10"))->Fill(cent, sampleIndex, fQ1144_10); + histos.get(HIST("Prof2D_Q1144_20"))->Fill(cent, sampleIndex, fQ1144_20); + histos.get(HIST("Prof2D_Q1144_21"))->Fill(cent, sampleIndex, fQ1144_21); + histos.get(HIST("Prof2D_Q2131_11"))->Fill(cent, sampleIndex, fQ2131_11); + histos.get(HIST("Prof2D_Q2131_01"))->Fill(cent, sampleIndex, fQ2131_01); + histos.get(HIST("Prof2D_Q2131_10"))->Fill(cent, sampleIndex, fQ2131_10); + histos.get(HIST("Prof2D_Q2132_11"))->Fill(cent, sampleIndex, fQ2132_11); + histos.get(HIST("Prof2D_Q2132_01"))->Fill(cent, sampleIndex, fQ2132_01); + histos.get(HIST("Prof2D_Q2132_10"))->Fill(cent, sampleIndex, fQ2132_10); + histos.get(HIST("Prof2D_Q2133_11"))->Fill(cent, sampleIndex, fQ2133_11); + histos.get(HIST("Prof2D_Q2133_01"))->Fill(cent, sampleIndex, fQ2133_01); + histos.get(HIST("Prof2D_Q2133_10"))->Fill(cent, sampleIndex, fQ2133_10); + histos.get(HIST("Prof2D_Q2231_11"))->Fill(cent, sampleIndex, fQ2231_11); + histos.get(HIST("Prof2D_Q2231_01"))->Fill(cent, sampleIndex, fQ2231_01); + histos.get(HIST("Prof2D_Q2231_10"))->Fill(cent, sampleIndex, fQ2231_10); + histos.get(HIST("Prof2D_Q2232_11"))->Fill(cent, sampleIndex, fQ2232_11); + histos.get(HIST("Prof2D_Q2232_01"))->Fill(cent, sampleIndex, fQ2232_01); + histos.get(HIST("Prof2D_Q2232_10"))->Fill(cent, sampleIndex, fQ2232_10); + histos.get(HIST("Prof2D_Q2233_11"))->Fill(cent, sampleIndex, fQ2233_11); + histos.get(HIST("Prof2D_Q2233_01"))->Fill(cent, sampleIndex, fQ2233_01); + histos.get(HIST("Prof2D_Q2233_10"))->Fill(cent, sampleIndex, fQ2233_10); + histos.get(HIST("Prof2D_Q51_1"))->Fill(cent, sampleIndex, fQ51_1); + histos.get(HIST("Prof2D_Q52_1"))->Fill(cent, sampleIndex, fQ52_1); + histos.get(HIST("Prof2D_Q53_1"))->Fill(cent, sampleIndex, fQ53_1); + histos.get(HIST("Prof2D_Q54_1"))->Fill(cent, sampleIndex, fQ54_1); + histos.get(HIST("Prof2D_Q55_1"))->Fill(cent, sampleIndex, fQ55_1); + histos.get(HIST("Prof2D_Q21_3"))->Fill(cent, sampleIndex, fQ21_3); + histos.get(HIST("Prof2D_Q22_3"))->Fill(cent, sampleIndex, fQ22_3); + histos.get(HIST("Prof2D_Q31_2"))->Fill(cent, sampleIndex, fQ31_2); + histos.get(HIST("Prof2D_Q32_2"))->Fill(cent, sampleIndex, fQ32_2); + histos.get(HIST("Prof2D_Q33_2"))->Fill(cent, sampleIndex, fQ33_2); + histos.get(HIST("Prof2D_Q61_1"))->Fill(cent, sampleIndex, fQ61_1); + histos.get(HIST("Prof2D_Q62_1"))->Fill(cent, sampleIndex, fQ62_1); + histos.get(HIST("Prof2D_Q63_1"))->Fill(cent, sampleIndex, fQ63_1); + histos.get(HIST("Prof2D_Q64_1"))->Fill(cent, sampleIndex, fQ64_1); + histos.get(HIST("Prof2D_Q65_1"))->Fill(cent, sampleIndex, fQ65_1); + histos.get(HIST("Prof2D_Q66_1"))->Fill(cent, sampleIndex, fQ66_1); + histos.get(HIST("Prof2D_Q112122_111"))->Fill(cent, sampleIndex, fQ112122_111); + histos.get(HIST("Prof2D_Q112131_111"))->Fill(cent, sampleIndex, fQ112131_111); + histos.get(HIST("Prof2D_Q112132_111"))->Fill(cent, sampleIndex, fQ112132_111); + histos.get(HIST("Prof2D_Q112133_111"))->Fill(cent, sampleIndex, fQ112133_111); + histos.get(HIST("Prof2D_Q112231_111"))->Fill(cent, sampleIndex, fQ112231_111); + histos.get(HIST("Prof2D_Q112232_111"))->Fill(cent, sampleIndex, fQ112232_111); + histos.get(HIST("Prof2D_Q112233_111"))->Fill(cent, sampleIndex, fQ112233_111); + histos.get(HIST("Prof2D_Q112221_111"))->Fill(cent, sampleIndex, fQ112221_111); + } + } + PROCESS_SWITCH(NetProtCumulants, processDataRec, "Process real data", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + WorkflowSpec workflow{adaptAnalysisTask(cfgc)}; + return workflow; +} diff --git a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx index fbb529fbb52..eb5ec1866a7 100644 --- a/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/partNumFluc.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -449,236 +450,6 @@ class FluctuationCalculatorTrack std::array mQs; }; -struct HolderCcdb { - std::map> runNumbersIndicesGroupIndices; - - std::vector fPtMeanDcaXyP; - std::vector fPtMeanDcaXyM; - std::vector fPtMeanDcaZP; - std::vector fPtMeanDcaZM; - std::vector fPtSigmaDcaXyP; - std::vector fPtSigmaDcaXyM; - std::vector fPtSigmaDcaZP; - std::vector fPtSigmaDcaZM; - - std::vector hCentralityPtEtaShiftTpcNSigmaPiP; - std::vector hCentralityPtEtaShiftTpcNSigmaPiM; - std::vector hCentralityPtEtaShiftTpcNSigmaKaP; - std::vector hCentralityPtEtaShiftTpcNSigmaKaM; - std::vector hCentralityPtEtaShiftTpcNSigmaPrP; - std::vector hCentralityPtEtaShiftTpcNSigmaPrM; - std::vector hCentralityPtEtaShiftTofNSigmaPiP; - std::vector hCentralityPtEtaShiftTofNSigmaPiM; - std::vector hCentralityPtEtaShiftTofNSigmaKaP; - std::vector hCentralityPtEtaShiftTofNSigmaKaM; - std::vector hCentralityPtEtaShiftTofNSigmaPrP; - std::vector hCentralityPtEtaShiftTofNSigmaPrM; - - std::vector hVzCentralityPtEtaEfficiencyTpcPiP; - std::vector hVzCentralityPtEtaEfficiencyTpcPiM; - std::vector hVzCentralityPtEtaEfficiencyTpcKaP; - std::vector hVzCentralityPtEtaEfficiencyTpcKaM; - std::vector hVzCentralityPtEtaEfficiencyTpcPrP; - std::vector hVzCentralityPtEtaEfficiencyTpcPrM; - std::vector hVzCentralityPtEtaEfficiencyTpcTofPiP; - std::vector hVzCentralityPtEtaEfficiencyTpcTofPiM; - std::vector hVzCentralityPtEtaEfficiencyTpcTofKaP; - std::vector hVzCentralityPtEtaEfficiencyTpcTofKaM; - std::vector hVzCentralityPtEtaEfficiencyTpcTofPrP; - std::vector hVzCentralityPtEtaEfficiencyTpcTofPrM; - - void clear() - { - runNumbersIndicesGroupIndices.clear(); - - fPtMeanDcaXyP.clear(); - fPtMeanDcaXyM.clear(); - fPtMeanDcaZP.clear(); - fPtMeanDcaZM.clear(); - fPtSigmaDcaXyP.clear(); - fPtSigmaDcaXyM.clear(); - fPtSigmaDcaZP.clear(); - fPtSigmaDcaZM.clear(); - - hCentralityPtEtaShiftTpcNSigmaPiP.clear(); - hCentralityPtEtaShiftTpcNSigmaPiM.clear(); - hCentralityPtEtaShiftTpcNSigmaKaP.clear(); - hCentralityPtEtaShiftTpcNSigmaKaM.clear(); - hCentralityPtEtaShiftTpcNSigmaPrP.clear(); - hCentralityPtEtaShiftTpcNSigmaPrM.clear(); - hCentralityPtEtaShiftTofNSigmaPiP.clear(); - hCentralityPtEtaShiftTofNSigmaPiM.clear(); - hCentralityPtEtaShiftTofNSigmaKaP.clear(); - hCentralityPtEtaShiftTofNSigmaKaM.clear(); - hCentralityPtEtaShiftTofNSigmaPrP.clear(); - hCentralityPtEtaShiftTofNSigmaPrM.clear(); - - hVzCentralityPtEtaEfficiencyTpcPiP.clear(); - hVzCentralityPtEtaEfficiencyTpcPiM.clear(); - hVzCentralityPtEtaEfficiencyTpcKaP.clear(); - hVzCentralityPtEtaEfficiencyTpcKaM.clear(); - hVzCentralityPtEtaEfficiencyTpcPrP.clear(); - hVzCentralityPtEtaEfficiencyTpcPrM.clear(); - hVzCentralityPtEtaEfficiencyTpcTofPiP.clear(); - hVzCentralityPtEtaEfficiencyTpcTofPiM.clear(); - hVzCentralityPtEtaEfficiencyTpcTofKaP.clear(); - hVzCentralityPtEtaEfficiencyTpcTofKaM.clear(); - hVzCentralityPtEtaEfficiencyTpcTofPrP.clear(); - hVzCentralityPtEtaEfficiencyTpcTofPrM.clear(); - } -}; - -struct HolderMcEvent { - std::int32_t runNumber = 0; - std::int32_t runIndex = 0; - std::int32_t runGroupIndex = 0; - double vz = 0.; - - void clear() - { - runNumber = 0; - runIndex = 0; - runGroupIndex = 0; - vz = 0.; - } -}; - -struct HolderEvent { - static constexpr std::pair RangeCentrality = {0., 100.}; - - std::int32_t runNumber = 0; - std::int32_t runIndex = 0; - std::int32_t runGroupIndex = 0; - double vz = 0.; - std::int32_t nGlobalTracksP = 0; - std::int32_t nGlobalTracksM = 0; - std::int32_t nPvContributorsP = 0; - std::int32_t nPvContributorsM = 0; - double meanDcaXyP = 0.; - double meanDcaXyM = 0.; - double meanSquareDcaXyP = 0.; - double meanSquareDcaXyM = 0.; - double meanDcaZP = 0.; - double meanDcaZM = 0.; - double meanSquareDcaZP = 0.; - double meanSquareDcaZM = 0.; - std::int32_t nTofBetaP = 0; - std::int32_t nTofBetaM = 0; - double centrality = 0.; - std::int32_t subgroupIndex = 0; - std::int32_t nChPMc = 0; - std::int32_t nChMMc = 0; - std::int32_t nKaPMc = 0; - std::int32_t nKaMMc = 0; - std::int32_t nPrPMc = 0; - std::int32_t nPrMMc = 0; - std::int32_t nChP = 0; - std::int32_t nChM = 0; - std::int32_t nKaP = 0; - std::int32_t nKaM = 0; - std::int32_t nPrP = 0; - std::int32_t nPrM = 0; - - void clear() - { - runNumber = 0; - runIndex = 0; - runGroupIndex = 0; - vz = 0.; - nGlobalTracksP = 0; - nGlobalTracksM = 0; - nPvContributorsP = 0; - nPvContributorsM = 0; - meanDcaXyP = 0.; - meanDcaXyM = 0.; - meanSquareDcaXyP = 0.; - meanSquareDcaXyM = 0.; - meanDcaZP = 0.; - meanDcaZM = 0.; - meanSquareDcaZP = 0.; - meanSquareDcaZM = 0.; - nTofBetaP = 0; - nTofBetaM = 0; - centrality = 0.; - subgroupIndex = 0; - nChPMc = 0; - nChMMc = 0; - nKaPMc = 0; - nKaMMc = 0; - nPrPMc = 0; - nPrMMc = 0; - nChP = 0; - nChM = 0; - nKaP = 0; - nKaM = 0; - nPrP = 0; - nPrM = 0; - } -}; - -struct HolderMcParticle { - std::int32_t pdgCode = 0; - std::int32_t charge = 0; - double pt = 0.; - double eta = 0.; - double phi = 0.; - - void clear() - { - pdgCode = 0; - charge = 0; - pt = 0.; - eta = 0.; - phi = 0.; - } -}; - -struct HolderTrack { - static constexpr double TruncationAbsNSigmaPid = 999.; - static constexpr double truncateNSigmaPid(const double value) { return (!(std::abs(value) < TruncationAbsNSigmaPid) ? -TruncationAbsNSigmaPid : value); } - - double dcaXY = 0.; - double dcaZ = 0.; - std::int32_t sign = 0; - double p = 0.; - double pt = 0.; - double eta = 0.; - double phi = 0.; - bool hasTpcPid = false; - double tpcNSigmaPi = 0.; - double tpcNSigmaKa = 0.; - double tpcNSigmaPr = 0.; - bool hasTofPid = false; - double tofNSigmaPi = 0.; - double tofNSigmaKa = 0.; - double tofNSigmaPr = 0.; - double tpcTofNSigmaPi = 0.; - double tpcTofNSigmaKa = 0.; - double tpcTofNSigmaPr = 0.; - - void clear() - { - dcaXY = 0.; - dcaZ = 0.; - sign = 0; - p = 0.; - pt = 0.; - eta = 0.; - phi = 0.; - hasTpcPid = false; - tpcNSigmaPi = 0.; - tpcNSigmaKa = 0.; - tpcNSigmaPr = 0.; - hasTofPid = false; - tofNSigmaPi = 0.; - tofNSigmaKa = 0.; - tofNSigmaPr = 0.; - tpcTofNSigmaPi = 0.; - tpcTofNSigmaKa = 0.; - tpcTofNSigmaPr = 0.; - } -}; - struct PartNumFluc { enum class CentralityDefinition { kFt0a = 0, kFt0c, @@ -780,11 +551,180 @@ struct PartNumFluc { Service pdg; Service ccdb; - HolderCcdb holderCcdb; - HolderMcEvent holderMcEvent; - HolderEvent holderEvent; - HolderMcParticle holderMcParticle; - HolderTrack holderTrack; + struct HolderCcdb { + std::map> runNumbersIndicesGroupIndices; + + std::vector fPtMeanDcaXyP; + std::vector fPtMeanDcaXyM; + std::vector fPtMeanDcaZP; + std::vector fPtMeanDcaZM; + std::vector fPtSigmaDcaXyP; + std::vector fPtSigmaDcaXyM; + std::vector fPtSigmaDcaZP; + std::vector fPtSigmaDcaZM; + + std::vector hCentralityPtEtaShiftTpcNSigmaPiP; + std::vector hCentralityPtEtaShiftTpcNSigmaPiM; + std::vector hCentralityPtEtaShiftTpcNSigmaKaP; + std::vector hCentralityPtEtaShiftTpcNSigmaKaM; + std::vector hCentralityPtEtaShiftTpcNSigmaPrP; + std::vector hCentralityPtEtaShiftTpcNSigmaPrM; + std::vector hCentralityPtEtaShiftTofNSigmaPiP; + std::vector hCentralityPtEtaShiftTofNSigmaPiM; + std::vector hCentralityPtEtaShiftTofNSigmaKaP; + std::vector hCentralityPtEtaShiftTofNSigmaKaM; + std::vector hCentralityPtEtaShiftTofNSigmaPrP; + std::vector hCentralityPtEtaShiftTofNSigmaPrM; + + std::vector hVzCentralityPtEtaEfficiencyTpcPiP; + std::vector hVzCentralityPtEtaEfficiencyTpcPiM; + std::vector hVzCentralityPtEtaEfficiencyTpcKaP; + std::vector hVzCentralityPtEtaEfficiencyTpcKaM; + std::vector hVzCentralityPtEtaEfficiencyTpcPrP; + std::vector hVzCentralityPtEtaEfficiencyTpcPrM; + std::vector hVzCentralityPtEtaEfficiencyTpcTofPiP; + std::vector hVzCentralityPtEtaEfficiencyTpcTofPiM; + std::vector hVzCentralityPtEtaEfficiencyTpcTofKaP; + std::vector hVzCentralityPtEtaEfficiencyTpcTofKaM; + std::vector hVzCentralityPtEtaEfficiencyTpcTofPrP; + std::vector hVzCentralityPtEtaEfficiencyTpcTofPrM; + + void clear() + { + runNumbersIndicesGroupIndices.clear(); + + fPtMeanDcaXyP.clear(); + fPtMeanDcaXyM.clear(); + fPtMeanDcaZP.clear(); + fPtMeanDcaZM.clear(); + fPtSigmaDcaXyP.clear(); + fPtSigmaDcaXyM.clear(); + fPtSigmaDcaZP.clear(); + fPtSigmaDcaZM.clear(); + + hCentralityPtEtaShiftTpcNSigmaPiP.clear(); + hCentralityPtEtaShiftTpcNSigmaPiM.clear(); + hCentralityPtEtaShiftTpcNSigmaKaP.clear(); + hCentralityPtEtaShiftTpcNSigmaKaM.clear(); + hCentralityPtEtaShiftTpcNSigmaPrP.clear(); + hCentralityPtEtaShiftTpcNSigmaPrM.clear(); + hCentralityPtEtaShiftTofNSigmaPiP.clear(); + hCentralityPtEtaShiftTofNSigmaPiM.clear(); + hCentralityPtEtaShiftTofNSigmaKaP.clear(); + hCentralityPtEtaShiftTofNSigmaKaM.clear(); + hCentralityPtEtaShiftTofNSigmaPrP.clear(); + hCentralityPtEtaShiftTofNSigmaPrM.clear(); + + hVzCentralityPtEtaEfficiencyTpcPiP.clear(); + hVzCentralityPtEtaEfficiencyTpcPiM.clear(); + hVzCentralityPtEtaEfficiencyTpcKaP.clear(); + hVzCentralityPtEtaEfficiencyTpcKaM.clear(); + hVzCentralityPtEtaEfficiencyTpcPrP.clear(); + hVzCentralityPtEtaEfficiencyTpcPrM.clear(); + hVzCentralityPtEtaEfficiencyTpcTofPiP.clear(); + hVzCentralityPtEtaEfficiencyTpcTofPiM.clear(); + hVzCentralityPtEtaEfficiencyTpcTofKaP.clear(); + hVzCentralityPtEtaEfficiencyTpcTofKaM.clear(); + hVzCentralityPtEtaEfficiencyTpcTofPrP.clear(); + hVzCentralityPtEtaEfficiencyTpcTofPrM.clear(); + } + } holderCcdb; + + struct HolderMcEvent { + std::int32_t runNumber{}; + std::int32_t runIndex{}; + std::int32_t runGroupIndex{}; + double vz{}; + std::int32_t nChP{}; + std::int32_t nChM{}; + std::int32_t nKaP{}; + std::int32_t nKaM{}; + std::int32_t nPrP{}; + std::int32_t nPrM{}; + + void clear() + { + *this = {}; + } + } holderMcEvent; + + struct HolderEvent { + static constexpr std::pair RangeCentrality = {0., 100.}; + + std::int32_t runNumber{}; + std::int32_t runIndex{}; + std::int32_t runGroupIndex{}; + double vz{}; + std::int32_t nGlobalTracksP{}; + std::int32_t nGlobalTracksM{}; + std::int32_t nPvContributorsP{}; + std::int32_t nPvContributorsM{}; + double meanDcaXyP{}; + double meanDcaXyM{}; + double meanSquareDcaXyP{}; + double meanSquareDcaXyM{}; + double meanDcaZP{}; + double meanDcaZM{}; + double meanSquareDcaZP{}; + double meanSquareDcaZM{}; + std::int32_t nTofBetaP{}; + std::int32_t nTofBetaM{}; + double centrality{}; + std::int32_t subgroupIndex{}; + std::int32_t nChP{}; + std::int32_t nChM{}; + std::int32_t nKaP{}; + std::int32_t nKaM{}; + std::int32_t nPrP{}; + std::int32_t nPrM{}; + + void clear() + { + *this = {}; + } + } holderEvent; + + struct HolderMcParticle { + std::int32_t pdgCode{}; + std::int32_t charge{}; + double pt{}; + double eta{}; + double phi{}; + + void clear() + { + *this = {}; + } + } holderMcParticle; + + struct HolderTrack { + static constexpr double TruncationAbsNSigmaPid = 999.; + static constexpr double truncateNSigmaPid(const double value) { return (!(std::abs(value) < TruncationAbsNSigmaPid) ? -TruncationAbsNSigmaPid : value); } + + double dcaXY{}; + double dcaZ{}; + std::int32_t sign{}; + double p{}; + double pt{}; + double eta{}; + double phi{}; + bool hasTpcPid{}; + double tpcNSigmaPi{}; + double tpcNSigmaKa{}; + double tpcNSigmaPr{}; + bool hasTofPid{}; + double tofNSigmaPi{}; + double tofNSigmaKa{}; + double tofNSigmaPr{}; + double tpcTofNSigmaPi{}; + double tpcTofNSigmaKa{}; + double tpcTofNSigmaPr{}; + + void clear() + { + *this = {}; + } + } holderTrack; std::unique_ptr fluctuationCalculatorTrackChP; std::unique_ptr fluctuationCalculatorTrackChM; @@ -815,8 +755,8 @@ struct PartNumFluc { HistogramRegistry hrCounter{"hrCounter", {}, OutputObjHandlingPolicy::AnalysisObject}; Filter filterCollision = (aod::evsel::sel8 == true); - Filter filterfTrack = requireQualityTracksInFilter(); - Filter filterfMcCollision = (aod::mccollisionprop::numRecoCollision > 0); + Filter filterTrack = requireQualityTracksInFilter(); + Filter filterMcCollision = (aod::mccollisionprop::numRecoCollision > 0); Preslice presliceTracksPerCollision = aod::track::collisionId; @@ -850,7 +790,7 @@ struct PartNumFluc { LOG(fatal) << "Invalid ccdb_object!"; } - const TGraph* const gRunNumberGroupIndex = dynamic_cast(ccdbObject->FindObject("gRunNumberGroupIndex")); + const TGraph* const gRunNumberGroupIndex = dynamic_cast(ccdbObject->FindObject("gRunNumberGroupIndex")); if (!gRunNumberGroupIndex || gRunNumberGroupIndex->IsA() != TGraph::Class()) { LOG(fatal) << "Invalid gRunNumberGroupIndex!"; } @@ -914,6 +854,42 @@ struct PartNumFluc { break; } + const auto readListRunGroup = [&](const std::int32_t runGroupIndex) -> const TList* { + const std::string name = Form("lRunGroup_%d", runGroupIndex); + const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(name.c_str())); + if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { + LOG(fatal) << "Invalid " << name << "!"; + } + return lRunGroup; + }; + const auto readFormula = [&](const TList* const lRunGroup, const char* const nameBase, const bool doAddingSuffixMc, const std::int32_t runGroupIndex) -> const TFormula* { + const std::string name = Form("%s%s_runGroup%d", nameBase, doAddingSuffixMc ? "_mc" : "", runGroupIndex); + const TFormula* const formula = dynamic_cast(lRunGroup->FindObject(name.c_str())); + if (!formula || formula->IsA() != TFormula::Class()) { + LOG(fatal) << "Invalid " << name << "!"; + } + LOG(info) << "Reading from CCDB: " << formula->GetName() << " \"" << formula->GetExpFormula("clingp") << "\""; + return formula; + }; + const auto readH3 = [&](const TList* const lRunGroup, const char* const nameBase, const bool doAddingSuffixMc, const std::int32_t runGroupIndex) -> const TH3* { + const std::string name = Form("%s%s_runGroup%d", nameBase, doAddingSuffixMc ? "_mc" : "", runGroupIndex); + const TH3* const h3 = dynamic_cast(lRunGroup->FindObject(name.c_str())); + if (!h3 || !h3->InheritsFrom(TH3::Class())) { + LOG(fatal) << "Invalid " << name << "!"; + } + LOG(info) << "Reading from CCDB: " << h3->GetName(); + return h3; + }; + const auto readHn = [&](const TList* const lRunGroup, const char* const nameBase, const bool doAddingSuffixMc, const std::int32_t runGroupIndex, const std::int32_t nDimensions) -> const THnBase* { + const std::string name = Form("%s%s_runGroup%d", nameBase, doAddingSuffixMc ? "_mc" : "", runGroupIndex); + const THnBase* const hn = dynamic_cast(lRunGroup->FindObject(name.c_str())); + if (!hn || !hn->InheritsFrom(THnBase::Class()) || hn->GetNdimensions() != nDimensions) { + LOG(fatal) << "Invalid " << name << "!"; + } + LOG(info) << "Reading from CCDB: " << hn->GetName(); + return hn; + }; + if (groupTrack.cfgFlagRecalibrationDca.value) { LOG(info) << "Enabling DCA recalibration."; @@ -926,157 +902,47 @@ struct PartNumFluc { holderCcdb.fPtSigmaDcaZP.resize(nRunGroups); holderCcdb.fPtSigmaDcaZM.resize(nRunGroups); for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.fPtMeanDcaXyP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtMeanDcaXyP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtMeanDcaXyP[iRunGroup] || holderCcdb.fPtMeanDcaXyP[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtMeanDcaXyP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtMeanDcaXyP[iRunGroup]->GetName() << " \"" << holderCcdb.fPtMeanDcaXyP[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtMeanDcaXyM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtMeanDcaXyM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtMeanDcaXyM[iRunGroup] || holderCcdb.fPtMeanDcaXyM[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtMeanDcaXyM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtMeanDcaXyM[iRunGroup]->GetName() << " \"" << holderCcdb.fPtMeanDcaXyM[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtMeanDcaZP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtMeanDcaZP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtMeanDcaZP[iRunGroup] || holderCcdb.fPtMeanDcaZP[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtMeanDcaZP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtMeanDcaZP[iRunGroup]->GetName() << " \"" << holderCcdb.fPtMeanDcaZP[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtMeanDcaZM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtMeanDcaZM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtMeanDcaZM[iRunGroup] || holderCcdb.fPtMeanDcaZM[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtMeanDcaZM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtMeanDcaZM[iRunGroup]->GetName() << " \"" << holderCcdb.fPtMeanDcaZM[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtSigmaDcaXyP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtSigmaDcaXyP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtSigmaDcaXyP[iRunGroup] || holderCcdb.fPtSigmaDcaXyP[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtSigmaDcaXyP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtSigmaDcaXyP[iRunGroup]->GetName() << " \"" << holderCcdb.fPtSigmaDcaXyP[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtSigmaDcaXyM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtSigmaDcaXyM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtSigmaDcaXyM[iRunGroup] || holderCcdb.fPtSigmaDcaXyM[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtSigmaDcaXyM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtSigmaDcaXyM[iRunGroup]->GetName() << " \"" << holderCcdb.fPtSigmaDcaXyM[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtSigmaDcaZP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtSigmaDcaZP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtSigmaDcaZP[iRunGroup] || holderCcdb.fPtSigmaDcaZP[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtSigmaDcaZP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtSigmaDcaZP[iRunGroup]->GetName() << " \"" << holderCcdb.fPtSigmaDcaZP[iRunGroup]->GetExpFormula("clingp") << "\""; - holderCcdb.fPtSigmaDcaZM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("fPtSigmaDcaZM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.fPtSigmaDcaZM[iRunGroup] || holderCcdb.fPtSigmaDcaZM[iRunGroup]->IsA() != TFormula::Class()) { - LOG(fatal) << "Invalid " << Form("fPtSigmaDcaZM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.fPtSigmaDcaZM[iRunGroup]->GetName() << " \"" << holderCcdb.fPtSigmaDcaZM[iRunGroup]->GetExpFormula("clingp") << "\""; + const TList* const lRunGroup = readListRunGroup(iRunGroup + 1); + holderCcdb.fPtMeanDcaXyP[iRunGroup] = readFormula(lRunGroup, "fPtMeanDcaXyP", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtMeanDcaXyM[iRunGroup] = readFormula(lRunGroup, "fPtMeanDcaXyM", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtMeanDcaZP[iRunGroup] = readFormula(lRunGroup, "fPtMeanDcaZP", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtMeanDcaZM[iRunGroup] = readFormula(lRunGroup, "fPtMeanDcaZM", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtSigmaDcaXyP[iRunGroup] = readFormula(lRunGroup, "fPtSigmaDcaXyP", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtSigmaDcaXyM[iRunGroup] = readFormula(lRunGroup, "fPtSigmaDcaXyM", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtSigmaDcaZP[iRunGroup] = readFormula(lRunGroup, "fPtSigmaDcaZP", doprocessMc.value, iRunGroup + 1); + holderCcdb.fPtSigmaDcaZM[iRunGroup] = readFormula(lRunGroup, "fPtSigmaDcaZM", doprocessMc.value, iRunGroup + 1); } } if (groupTrack.cfgFlagRecalibrationNSigmaPi.value || groupTrack.cfgFlagRecalibrationNSigmaKa.value || groupTrack.cfgFlagRecalibrationNSigmaPr.value) { - if (groupTrack.cfgFlagRecalibrationNSigmaPi.value) { - LOG(info) << "Enabling nSigmaPi recalibration."; - - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM.resize(nRunGroups); + const auto readH3ShiftNSigmaPid = [&](std::initializer_list*, const char*>> pairsVectorH3NameBase) { + for (const auto& [vectorH3, nameBase] : pairsVectorH3NameBase) { + vectorH3->resize(nRunGroups); + } for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaPiP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaPiP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; + const TList* const lRunGroup = readListRunGroup(iRunGroup + 1); + for (const auto& [vectorH3, nameBase] : pairsVectorH3NameBase) { + (*vectorH3)[iRunGroup] = readH3(lRunGroup, nameBase, doprocessMc.value, iRunGroup + 1); } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaPiM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaPiM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaPiP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaPiP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaPiM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaPiM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM[iRunGroup]->GetName(); } + }; + + if (groupTrack.cfgFlagRecalibrationNSigmaPi.value) { + LOG(info) << "Enabling nSigmaPi recalibration."; + + readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiP, "hCentralityPtEtaShiftTpcNSigmaPiP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPiM, "hCentralityPtEtaShiftTpcNSigmaPiM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPiP, "hCentralityPtEtaShiftTofNSigmaPiP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPiM, "hCentralityPtEtaShiftTofNSigmaPiM"}}); } if (groupTrack.cfgFlagRecalibrationNSigmaKa.value) { LOG(info) << "Enabling nSigmaKa recalibration."; - holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM.resize(nRunGroups); - for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaKaP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaKaP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaKaM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaKaM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaKaP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaKaP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaKaM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaKaM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM[iRunGroup]->GetName(); - } + readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaP, "hCentralityPtEtaShiftTpcNSigmaKaP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaKaM, "hCentralityPtEtaShiftTpcNSigmaKaM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaKaP, "hCentralityPtEtaShiftTofNSigmaKaP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaKaM, "hCentralityPtEtaShiftTofNSigmaKaM"}}); } if (groupTrack.cfgFlagRecalibrationNSigmaPr.value) { LOG(info) << "Enabling nSigmaPr recalibration."; - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP.resize(nRunGroups); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM.resize(nRunGroups); - for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaPrP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaPrP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTpcNSigmaPrM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTpcNSigmaPrM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaPrP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaPrP%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP[iRunGroup]->GetName(); - holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hCentralityPtEtaShiftTofNSigmaPrM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1))); - if (!holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM[iRunGroup] || !holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM[iRunGroup]->InheritsFrom(TH3::Class())) { - LOG(fatal) << "Invalid " << Form("hCentralityPtEtaShiftTofNSigmaPrM%s_runGroup%d", doprocessMc.value ? "_mc" : "", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM[iRunGroup]->GetName(); - } + readH3ShiftNSigmaPid({{&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrP, "hCentralityPtEtaShiftTpcNSigmaPrP"}, {&holderCcdb.hCentralityPtEtaShiftTpcNSigmaPrM, "hCentralityPtEtaShiftTpcNSigmaPrM"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPrP, "hCentralityPtEtaShiftTofNSigmaPrP"}, {&holderCcdb.hCentralityPtEtaShiftTofNSigmaPrM, "hCentralityPtEtaShiftTofNSigmaPrM"}}); } } @@ -1576,8 +1442,6 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - static constexpr std::int32_t NDimensionsEfficiency = 4; - const AxisSpec asCentrality(groupEvent.cfgAxisCentrality, "Centrality (%)"); const HistogramConfigSpec hcsDistribution(HistType::kTHnSparseD, {asCentrality, {200, -0.5, 199.5}, {200, -0.5, 199.5}}); const HistogramConfigSpec hcsFluctuationCalculator(HistType::kTH3D, {asCentrality, {groupEvent.cfgNSubgroups.value, -0.5, groupEvent.cfgNSubgroups.value - 0.5, "Subgroup Index"}, {fluctuation_calculator_base::NOrderVectors, -0.5, fluctuation_calculator_base::NOrderVectors - 0.5, "Order Vector Index"}}); @@ -1648,109 +1512,34 @@ struct PartNumFluc { hrCalculationFluctuation.add("CalculationFluctuation/hFluctuationCalculatorPrN", "", hcsFluctuationCalculator); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM.resize(nRunGroups); + const auto readHnEfficiency = [&](std::initializer_list*, const char*>> pairsVectorHnNameBase) { + for (const auto& [vectorHn, nameBase] : pairsVectorHnNameBase) { + vectorHn->resize(nRunGroups); + } for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; + const TList* const lRunGroup = readListRunGroup(iRunGroup + 1); + for (const auto& [vectorHn, nameBase] : pairsVectorHnNameBase) { + (*vectorHn)[iRunGroup] = readHn(lRunGroup, nameBase, false, iRunGroup + 1, 4); } - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcPiP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcPiP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcPiM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcPiM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofPiP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofPiP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofPiM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofPiM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM[iRunGroup]->GetName(); } + }; + + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { + readHnEfficiency({{&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiP, "hVzCentralityPtEtaEfficiencyTpcPiP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPiM, "hVzCentralityPtEtaEfficiencyTpcPiM"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiP, "hVzCentralityPtEtaEfficiencyTpcTofPiP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPiM, "hVzCentralityPtEtaEfficiencyTpcTofPiM"}}); } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value) { - holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM.resize(nRunGroups); - for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcKaP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcKaP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcKaM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcKaM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofKaP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofKaP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofKaM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofKaM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM[iRunGroup]->GetName(); - } + readHnEfficiency({{&holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaP, "hVzCentralityPtEtaEfficiencyTpcKaP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcKaM, "hVzCentralityPtEtaEfficiencyTpcKaM"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaP, "hVzCentralityPtEtaEfficiencyTpcTofKaP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofKaM, "hVzCentralityPtEtaEfficiencyTpcTofKaM"}}); } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP.resize(nRunGroups); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM.resize(nRunGroups); - for (std::int32_t const& iRunGroup : std::views::iota(0, nRunGroups)) { - const TList* const lRunGroup = dynamic_cast(ccdbObject->FindObject(Form("lRunGroup_%d", iRunGroup + 1))); - if (!lRunGroup || lRunGroup->IsA() != TList::Class()) { - LOG(fatal) << "Invalid " << Form("lRunGroup_%d", iRunGroup + 1) << "!"; - } - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcPrP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcPrP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcPrM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcPrM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofPrP_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofPrP_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP[iRunGroup]->GetName(); - holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup] = dynamic_cast(lRunGroup->FindObject(Form("hVzCentralityPtEtaEfficiencyTpcTofPrM_runGroup%d", iRunGroup + 1))); - if (!holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup] || !holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup]->InheritsFrom(THnBase::Class()) || holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup]->GetNdimensions() != NDimensionsEfficiency) { - LOG(fatal) << "Invalid " << Form("hVzCentralityPtEtaEfficiencyTpcTofPrM_runGroup%d", iRunGroup + 1) << "!"; - } - LOG(info) << "Reading from CCDB: " << holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM[iRunGroup]->GetName(); - } + readHnEfficiency({{&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrP, "hVzCentralityPtEtaEfficiencyTpcPrP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcPrM, "hVzCentralityPtEtaEfficiencyTpcPrM"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrP, "hVzCentralityPtEtaEfficiencyTpcTofPrP"}, {&holderCcdb.hVzCentralityPtEtaEfficiencyTpcTofPrM, "hVzCentralityPtEtaEfficiencyTpcTofPrM"}}); } } } template - double getEfficiency() + double getEfficiency(const bool doUsingMcParticleMomentum) { static_assert(particleSpecies == ParticleSpecies::kPi || particleSpecies == ParticleSpecies::kKa || particleSpecies == ParticleSpecies::kPr); static_assert(pidStrategy == PidStrategy::kTpc || pidStrategy == PidStrategy::kTpcTof); @@ -1762,7 +1551,7 @@ struct PartNumFluc { return 0.; } const THnBase* const hVzCentralityPtEtaEfficiency = pointersVectorHistogramEfficiency[static_cast(particleSpecies)][holderMcParticle.charge > 0 ? 0 : 1][pidStrategy == PidStrategy::kTpc ? 0 : 1]->at(std::abs(holderEvent.runGroupIndex) - 1); - return hVzCentralityPtEtaEfficiency ? hVzCentralityPtEtaEfficiency->GetBinContent(hVzCentralityPtEtaEfficiency->GetBin(std::array{holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta}.data())) : 0.; + return hVzCentralityPtEtaEfficiency ? (doUsingMcParticleMomentum ? hVzCentralityPtEtaEfficiency->GetBinContent(hVzCentralityPtEtaEfficiency->GetBin(std::array{holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta}.data())) : hVzCentralityPtEtaEfficiency->GetBinContent(hVzCentralityPtEtaEfficiency->GetBin(std::array{holderEvent.vz, holderEvent.centrality, holderTrack.pt, holderTrack.eta}.data()))) : 0.; } if (holderTrack.sign == 0) { @@ -1862,10 +1651,9 @@ struct PartNumFluc { return holderTrack.sign; } - template - bool isGoodMomentum() + bool isGoodMomentum(const bool doUsingMcParticleMomentum) { - if constexpr (doProcessingMc) { + if (doUsingMcParticleMomentum) { if (!(groupTrack.cfgCutMinPt.value < holderMcParticle.pt && holderMcParticle.pt < groupTrack.cfgCutMaxPt.value)) { return false; } @@ -1951,6 +1739,59 @@ struct PartNumFluc { return true; } + template + void calculateFluctuation() + { + const bool doUsingMcParticleMomentum = doProcessingMc && groupTrack.cfgFlagMcParticleMomentum.value; + if (!(isGoodMomentum(doUsingMcParticleMomentum) && holderTrack.hasTpcPid)) { + return; + } + + const auto processSign = [&](const std::int32_t sign, const std::int32_t pdgCodeP, const std::int32_t pdgCodeM, std::int32_t& nP, std::int32_t& nM, std::unique_ptr& fluctuationCalculatorTrackP, std::unique_ptr& fluctuationCalculatorTrackM, std::unique_ptr& fluctuationCalculatorTrackT, std::unique_ptr& fluctuationCalculatorTrackN) { + if (std::abs(sign) != 1) { + return; + } + if constexpr (doProcessingMc) { + if (holderMcParticle.pdgCode != (sign > 0 ? pdgCodeP : pdgCodeM)) { + return; + } + } + + const double efficiency = getEfficiency(doUsingMcParticleMomentum); + if (sign > 0) { + nP++; + fluctuationCalculatorTrackP->fill(1., efficiency); + fluctuationCalculatorTrackT->fill(1., efficiency); + fluctuationCalculatorTrackN->fill(1., efficiency); + } else { + nM++; + fluctuationCalculatorTrackM->fill(1., efficiency); + fluctuationCalculatorTrackT->fill(1., efficiency); + fluctuationCalculatorTrackN->fill(-1., efficiency); + } + }; // NOLINT(readability/braces) + + const auto processSpecies = [&](const double thresholdPtTof, const std::int32_t pdgCodeP, const std::int32_t pdgCodeM, std::int32_t& nP, std::int32_t& nM, std::unique_ptr& fluctuationCalculatorTrackP, std::unique_ptr& fluctuationCalculatorTrackM, std::unique_ptr& fluctuationCalculatorTrackT, std::unique_ptr& fluctuationCalculatorTrackN) { + if ((doUsingMcParticleMomentum ? holderMcParticle.pt : holderTrack.pt) < thresholdPtTof) { + processSign.template operator()(isPid(groupTrack.cfgFlagRejectionOthers.value), pdgCodeP, pdgCodeM, nP, nM, fluctuationCalculatorTrackP, fluctuationCalculatorTrackM, fluctuationCalculatorTrackT, fluctuationCalculatorTrackN); + } else if (holderTrack.hasTofPid) { + processSign.template operator()(isPid(groupTrack.cfgFlagRejectionOthers.value), pdgCodeP, pdgCodeM, nP, nM, fluctuationCalculatorTrackP, fluctuationCalculatorTrackM, fluctuationCalculatorTrackT, fluctuationCalculatorTrackN); + } + }; // NOLINT(readability/braces) + + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { + processSpecies.template operator()(groupTrack.cfgThresholdPtTofPi.value, PDG_t::kPiPlus, PDG_t::kPiMinus, holderEvent.nChP, holderEvent.nChM, fluctuationCalculatorTrackChP, fluctuationCalculatorTrackChM, fluctuationCalculatorTrackChT, fluctuationCalculatorTrackChN); + processSpecies.template operator()(groupTrack.cfgThresholdPtTofKa.value, PDG_t::kKPlus, PDG_t::kKMinus, holderEvent.nChP, holderEvent.nChM, fluctuationCalculatorTrackChP, fluctuationCalculatorTrackChM, fluctuationCalculatorTrackChT, fluctuationCalculatorTrackChN); + processSpecies.template operator()(groupTrack.cfgThresholdPtTofPr.value, PDG_t::kProton, PDG_t::kProtonBar, holderEvent.nChP, holderEvent.nChM, fluctuationCalculatorTrackChP, fluctuationCalculatorTrackChM, fluctuationCalculatorTrackChT, fluctuationCalculatorTrackChN); + } + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { + processSpecies.template operator()(groupTrack.cfgThresholdPtTofKa.value, PDG_t::kKPlus, PDG_t::kKMinus, holderEvent.nKaP, holderEvent.nKaM, fluctuationCalculatorTrackKaP, fluctuationCalculatorTrackKaM, fluctuationCalculatorTrackKaT, fluctuationCalculatorTrackKaN); + } + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { + processSpecies.template operator()(groupTrack.cfgThresholdPtTofPr.value, PDG_t::kProton, PDG_t::kProtonBar, holderEvent.nPrP, holderEvent.nPrM, fluctuationCalculatorTrackPrP, fluctuationCalculatorTrackPrM, fluctuationCalculatorTrackPrT, fluctuationCalculatorTrackPrN); + } + } + template bool initTrack(const T& track) { @@ -2418,236 +2259,6 @@ struct PartNumFluc { return true; } - template - void calculateFluctuation() - { - if (isGoodMomentum() && holderTrack.hasTpcPid) { - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPi.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofKa.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPr.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nChP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChP->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nChM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackChM->fill(1., efficiency); - fluctuationCalculatorTrackChT->fill(1., efficiency); - fluctuationCalculatorTrackChN->fill(-1., efficiency); - } break; - } - } - } - - if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofKa.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nKaP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackKaP->fill(1., efficiency); - fluctuationCalculatorTrackKaT->fill(1., efficiency); - fluctuationCalculatorTrackKaN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nKaM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackKaM->fill(1., efficiency); - fluctuationCalculatorTrackKaT->fill(1., efficiency); - fluctuationCalculatorTrackKaN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nKaP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackKaP->fill(1., efficiency); - fluctuationCalculatorTrackKaT->fill(1., efficiency); - fluctuationCalculatorTrackKaN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nKaM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackKaM->fill(1., efficiency); - fluctuationCalculatorTrackKaT->fill(1., efficiency); - fluctuationCalculatorTrackKaN->fill(-1., efficiency); - } break; - } - } - } - - if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - if ((doProcessingMc ? holderMcParticle.pt : holderTrack.pt) < groupTrack.cfgThresholdPtTofPr.value) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nPrP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackPrP->fill(1., efficiency); - fluctuationCalculatorTrackPrT->fill(1., efficiency); - fluctuationCalculatorTrackPrN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nPrM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackPrM->fill(1., efficiency); - fluctuationCalculatorTrackPrT->fill(1., efficiency); - fluctuationCalculatorTrackPrN->fill(-1., efficiency); - } break; - } - } else if (holderTrack.hasTofPid) { - switch (isPid(groupTrack.cfgFlagRejectionOthers.value)) { - case 1: { - holderEvent.nPrP++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackPrP->fill(1., efficiency); - fluctuationCalculatorTrackPrT->fill(1., efficiency); - fluctuationCalculatorTrackPrN->fill(1., efficiency); - } break; - case -1: { - holderEvent.nPrM++; - - const double efficiency = getEfficiency(); - - fluctuationCalculatorTrackPrM->fill(1., efficiency); - fluctuationCalculatorTrackPrT->fill(1., efficiency); - fluctuationCalculatorTrackPrN->fill(-1., efficiency); - } break; - } - } - } - } - } - template bool initMcEvent(const MC& mcCollision) { @@ -2675,7 +2286,7 @@ struct PartNumFluc { return false; } - if (groupEvent.cfgFlagInelEvent.value && !mcCollision.isInelGt0()) { + if (groupEvent.cfgFlagInelEventMc.value && !mcCollision.isInelGt0()) { hrCounter.fill(HIST("hNMcEvents"), 3.); return false; } @@ -3052,8 +2663,8 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldPi.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcPiP"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChP++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); @@ -3066,8 +2677,8 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldPi.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcPiM"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChM++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); @@ -3080,14 +2691,14 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldKa.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcKaP"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChP++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum()) { - holderEvent.nKaPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum(true)) { + holderMcEvent.nKaP++; fluctuationCalculatorTrackKaP->fill(1., 1.); fluctuationCalculatorTrackKaT->fill(1., 1.); fluctuationCalculatorTrackKaN->fill(1., 1.); @@ -3100,14 +2711,14 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldKa.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcKaM"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChM++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum()) { - holderEvent.nKaMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationKa.value && isGoodMomentum(true)) { + holderMcEvent.nKaM++; fluctuationCalculatorTrackKaM->fill(1., 1.); fluctuationCalculatorTrackKaT->fill(1., 1.); fluctuationCalculatorTrackKaN->fill(-1., 1.); @@ -3120,14 +2731,14 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldPr.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcPrP"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChP++; fluctuationCalculatorTrackChP->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum()) { - holderEvent.nPrPMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum(true)) { + holderMcEvent.nPrP++; fluctuationCalculatorTrackPrP->fill(1., 1.); fluctuationCalculatorTrackPrT->fill(1., 1.); fluctuationCalculatorTrackPrN->fill(1., 1.); @@ -3140,14 +2751,14 @@ struct PartNumFluc { if (groupAnalysis.cfgFlagCalculationYieldPr.value) { hrCalculationYield.fill(HIST("CalculationYield/hVzCentralityPtEtaMc_mcPrM"), holderEvent.vz, holderEvent.centrality, holderMcParticle.pt, holderMcParticle.eta); } - if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum()) { - holderEvent.nChMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationCh.value && isGoodMomentum(true)) { + holderMcEvent.nChM++; fluctuationCalculatorTrackChM->fill(1., 1.); fluctuationCalculatorTrackChT->fill(1., 1.); fluctuationCalculatorTrackChN->fill(-1., 1.); } - if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum()) { - holderEvent.nPrMMc++; + if (groupAnalysis.cfgFlagCalculationFluctuationPr.value && isGoodMomentum(true)) { + holderMcEvent.nPrM++; fluctuationCalculatorTrackPrM->fill(1., 1.); fluctuationCalculatorTrackPrT->fill(1., 1.); fluctuationCalculatorTrackPrN->fill(-1., 1.); @@ -3158,7 +2769,7 @@ struct PartNumFluc { } if (groupAnalysis.cfgFlagCalculationFluctuationCh.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNChPNChM_mc"), holderEvent.centrality, holderEvent.nChPMc, holderEvent.nChMMc); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNChPNChM_mc"), holderEvent.centrality, holderMcEvent.nChP, holderMcEvent.nChM); for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorChP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackChP->getProductFast(iOrderVector)); hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorChM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackChM->getProductFast(iOrderVector)); @@ -3167,7 +2778,7 @@ struct PartNumFluc { } } if (groupAnalysis.cfgFlagCalculationFluctuationKa.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNKaPNKaM_mc"), holderEvent.centrality, holderEvent.nKaPMc, holderEvent.nKaMMc); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNKaPNKaM_mc"), holderEvent.centrality, holderMcEvent.nKaP, holderMcEvent.nKaM); for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorKaP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackKaP->getProductFast(iOrderVector)); hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorKaM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackKaM->getProductFast(iOrderVector)); @@ -3176,7 +2787,7 @@ struct PartNumFluc { } } if (groupAnalysis.cfgFlagCalculationFluctuationPr.value) { - hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNPrPNPrM_mc"), holderEvent.centrality, holderEvent.nPrPMc, holderEvent.nPrMMc); + hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hCentralityNPrPNPrM_mc"), holderEvent.centrality, holderMcEvent.nPrP, holderMcEvent.nPrM); for (std::int32_t const& iOrderVector : std::views::iota(0, static_cast(fluctuation_calculator_base::NOrderVectors))) { hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorPrP_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackPrP->getProductFast(iOrderVector)); hrCalculationFluctuation.fill(HIST("CalculationFluctuation/hFluctuationCalculatorPrM_mc"), holderEvent.centrality, holderEvent.subgroupIndex, iOrderVector, fluctuationCalculatorTrackPrM->getProductFast(iOrderVector)); @@ -3628,11 +3239,7 @@ struct PartNumFluc { } if ((groupAnalysis.cfgFlagCalculationFluctuationCh.value || groupAnalysis.cfgFlagCalculationFluctuationKa.value || groupAnalysis.cfgFlagCalculationFluctuationPr.value) && (!groupTrack.cfgFlagMcParticlePhysicalPrimary.value || mcParticle.isPhysicalPrimary())) { - if (groupTrack.cfgFlagMcParticleMomentum.value) { - calculateFluctuation(); - } else { - calculateFluctuation(); - } + calculateFluctuation(); } } diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index 3a7738b2cc1..f1a76754cd0 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -204,10 +204,10 @@ class FemtoUniverseDetaDphiStar std::string histSuffixkT1 = std::to_string(static_cast(ktBins[j] * 100.0)); std::string histSuffixkT2 = std::to_string(static_cast(ktBins[j + 1] * 100.0)); std::string histFolderkT = "kT_" + histSuffixkT1 + "_" + histSuffixkT2 + "/"; - histdetadphisamebeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {200, -0.3, 0.3}}); + histdetadphisamebeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadphimixedbeforekT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiBeforeMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadphisameafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterSame").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); } } } @@ -877,7 +877,7 @@ class FemtoUniverseDetaDphiStar badpoints++; } } - return badpoints / entries; + return (static_cast(badpoints) / static_cast(entries)); } // Get particle charge from mask diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index f5a4409a2e7..7d20486a76a 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -96,6 +96,14 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable> confCPRdeltaEtaCutMaxVector{"confCPRdeltaEtaCutMaxVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Eta max cut for Close Pair Rejection"}; Configurable> confCPRdeltaEtaCutMinVector{"confCPRdeltaEtaCutMinVector", std::vector{0.0, 0.0, 0.0, 0.0}, "Delta Eta min cut for Close Pair Rejection"}; Configurable confIsCPRkT{"confIsCPRkT", true, "kT dependent deltaEta-deltaPhi cut for Close Pair Rejection"}; + Configurable confTrkDCAxyMax{"confTrkDCAxyMax", 0.2, "Max DCA in xy "}; + Configurable confTrkDCAzMax{"confTrkDCAzMax", 0.2, "Max DCA in z "}; + Configurable confTrkTPCcRowsMin{"confTrkTPCcRowsMin", 80, "Min of TPC crossed rows"}; + Configurable confTrkTPCfClsMin{"confTrkTPCfClsMin", 0.83, "Min. fraction of crossed rows/findable TPC clusters"}; + Configurable confTrkTPCfracsClsMax{"confTrkTPCfracsClsMax", 1.0, "Max of fraction of TPC shared cluster "}; + Configurable confTrkTPCnClsMin{"confTrkTPCnClsMin", 80, "Min number of TPC clusters"}; + Configurable confTrkTPCsClsMax{"confTrkTPCsClsMax", 160, "Max number of TPC shared clusters"}; + Configurable confPairFracSharedTPCcls{"confPairFracSharedTPCcls", 1.0, "Max. fraction of TPC shared clusters between two closed tracks"}; Configurable confCPRChosenRadii{"confCPRChosenRadii", 0.80, "Delta Eta cut for Close Pair Rejection"}; Configurable confUseCCImCut{"confUseCCImCut", false, "Fill SH within specific quadrants of qout-qside"}; Configurable confMinqTcut{"confMinqTcut", 0.005, "Min. qT cut on filling SH"}; @@ -113,7 +121,15 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { using FemtoFullParticles = soa::Join; // Filters for selecting particles (both p1 and p2) - Filter trackAdditionalfilter = (nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax); // example filtering on Configurable + Filter trackAdditionalfilter = ((nabs(aod::femtouniverseparticle::eta) < twotracksconfigs.confEtaMax) && + (aod::track::dcaXY <= twotracksconfigs.confTrkDCAxyMax) && + (aod::track::dcaZ <= twotracksconfigs.confTrkDCAzMax) && + (aod::femtouniverseparticle::tpcNClsCrossedRows >= twotracksconfigs.confTrkTPCcRowsMin) && + (aod::femtouniverseparticle::tpcFractionSharedCls <= twotracksconfigs.confTrkTPCfracsClsMax) && + (aod::femtouniverseparticle::tpcNClsFound >= twotracksconfigs.confTrkTPCnClsMin) && + ((aod::femtouniverseparticle::tpcNClsCrossedRows / aod::track::tpcNClsFindable) >= twotracksconfigs.confTrkTPCfClsMin) && + (aod::track::tpcNClsShared >= twotracksconfigs.confTrkTPCsClsMax)); + using FilteredFemtoFullParticles = soa::Filtered; // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this optionconfIsCPRkT using FemtoRecoParticles = soa::Join; @@ -542,6 +558,10 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (kT < firstRealElement || kT > lastElement) continue; + float pairFractionTPCsCls = static_cast((p1.tpcNClsShared() + p2.tpcNClsShared())) / static_cast((p1.tpcNClsFound() + p2.tpcNClsFound())); + if (pairFractionTPCsCls > twotracksconfigs.confPairFracSharedTPCcls.value) { + continue; + } if (twotracksconfigs.confIsCPR.value) { if (twotracksconfigs.confCPRFracMax.value) { @@ -585,6 +605,11 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { if (kT < firstRealElement || kT > lastElement) continue; + float pairFractionTPCsCls = static_cast((p1.tpcNClsShared() + p2.tpcNClsShared())) / static_cast((p1.tpcNClsFound() + p2.tpcNClsFound())); + if (pairFractionTPCsCls > twotracksconfigs.confPairFracSharedTPCcls.value) { + continue; + } + double rand; rand = randgen->Rndm(); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx index afee000d7d6..fd24e2b8227 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx @@ -111,6 +111,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { Configurable confPDGCodeV0{"confPDGCodeV0", 3122, "V0 -- PDG code"}; Configurable confPDGCodePosChild{"confPDGCodePosChild", 2212, "Positive Child -- PDG code"}; Configurable confPDGCodeNegChild{"confPDGCodeNegChild", 211, "Negative Child -- PDG code"}; + Configurable confSeparateInvMassCheck{"confSeparateInvMassCheck", false, "Apply additional cut separate for mLambda and mAntiLambda"}; } V0configs; /// Partitioning for particle 2 @@ -159,12 +160,13 @@ struct FemtoUniversePairTaskTrackV0Helicity { ConfigurableAxis confmTBins3D{"confmTBins3D", {VARIABLE_WIDTH, 1.02f, 1.14f, 1.20f, 1.26f, 1.38f, 1.56f, 1.86f, 4.50f}, "mT binning for the 3D plot: k* vs multiplicity vs mT (set to true in order to use)"}; ConfigurableAxis confMultBins3D{"confMultBins3D", {VARIABLE_WIDTH, 0.0f, 20.0f, 30.0f, 40.0f, 99999.0f}, "multiplicity binning for the 3D plot: k* vs multiplicity vs mT (set to true in order to use)"}; - /// Helicity ranges (approximate) + /// Helicity ranges and configurables Configurable cfgProcessHel{"cfgProcessHel", true, "Process particle pairs from all helicity ranges"}; - Configurable cfgProcessHel1{"cfgProcessHel1", false, "Process particle pairs from the helicity range 1"}; // 1.0 > cosineTheta >= 0.1 + Configurable cfgProcessHel1{"cfgProcessHel1", false, "Process particle pairs from the helicity range 1"}; // 1.0 >= cosineTheta >= 0.1 Configurable cfgProcessHel2{"cfgProcessHel2", false, "Process particle pairs from the helicity range 2"}; // 0.1 > cosineTheta >= -0.1 Configurable cfgProcessHel3{"cfgProcessHel3", false, "Process particle pairs from the helicity range 3"}; // -0.1 > cosineTheta >= -0.5 Configurable cfgProcessHel4{"cfgProcessHel4", false, "Process particle pairs from the helicity range 4"}; // -0.5 > cosineTheta >= -1.0 + ConfigurableAxis confInvMassMotherpTBinsHel{"confInvMassMotherpTBinsHel", {5, 0, 5}, "pT binning in the pT vs. InvMassMother plot for helicity"}; /// Efficiency Configurable confLocalEfficiency{"confLocalEfficiency", "", "Local path to efficiency .root file"}; @@ -218,10 +220,17 @@ struct FemtoUniversePairTaskTrackV0Helicity { } } - bool invMLambda(float invMassLambda, float invMassAntiLambda) + bool invMLambda(float invMassLambda, float invMassAntiLambda, int V0Type) { - if ((invMassLambda < V0configs.confV0InvMassLowLimit || invMassLambda > V0configs.confV0InvMassUpLimit) && (invMassAntiLambda < V0configs.confV0InvMassLowLimit || invMassAntiLambda > V0configs.confV0InvMassUpLimit)) { - return false; + if (V0configs.confSeparateInvMassCheck) { + const float pMass = V0Type ? invMassAntiLambda : invMassLambda; + if (pMass < V0configs.confV0InvMassLowLimit || pMass > V0configs.confV0InvMassUpLimit) { + return false; + } + } else { + if ((invMassLambda < V0configs.confV0InvMassLowLimit || invMassLambda > V0configs.confV0InvMassUpLimit) && (invMassAntiLambda < V0configs.confV0InvMassLowLimit || invMassAntiLambda > V0configs.confV0InvMassUpLimit)) { + return false; + } } return true; } @@ -287,6 +296,10 @@ struct FemtoUniversePairTaskTrackV0Helicity { thetaRegistry.add("Theta/NegativeChild/hThetaPt", " ; p_{T} (GeV/#it{c}); cos(#theta)", kTH2F, {{100, 0, 10}, {110, -1.1, 1.1}}); thetaRegistry.add("Theta/NegativeChild/hThetaEta", " ; #eta; cos(#theta)", kTH2F, {{100, -1, 1}, {110, -1.1, 1.1}}); thetaRegistry.add("Theta/NegativeChild/hThetaPhi", " ; #phi; cos(#theta)", kTH2F, {{100, -1, 7}, {110, -1.1, 1.1}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel1", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel2", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel3", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel4", " ; p_{T}, M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, {100, 0.5, 1.5}}); /// MC Truth registryMCtruth.add("plus/MCtruthLambda", "MC truth Lambdas;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}}); @@ -427,7 +440,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// Histogramming same event for (const auto& part : groupPartsTwo) { - if (!invMLambda(part.mLambda(), part.mAntiLambda())) + if (!invMLambda(part.mLambda(), part.mAntiLambda(), V0configs.confV0Type1)) continue; const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); @@ -453,6 +466,15 @@ struct FemtoUniversePairTaskTrackV0Helicity { thetaRegistry.fill(HIST("Theta/NegativeChild/hThetaPt"), negChild.pt(), cosineTheta); thetaRegistry.fill(HIST("Theta/NegativeChild/hThetaEta"), negChild.eta(), cosineTheta); thetaRegistry.fill(HIST("Theta/NegativeChild/hThetaPhi"), negChild.phi(), cosineTheta); + + if (cosineTheta <= 1.0 && cosineTheta >= 0.1) + thetaRegistry.fill(HIST("Theta/Mother/hInvMassMotherHel1"), part.pt(), part.mLambda()); + else if (cosineTheta < 0.1 && cosineTheta >= -0.1) + thetaRegistry.fill(HIST("Theta/Mother/hInvMassMotherHel2"), part.pt(), part.mLambda()); + else if (cosineTheta < -0.1 && cosineTheta >= -0.5) + thetaRegistry.fill(HIST("Theta/Mother/hInvMassMotherHel3"), part.pt(), part.mLambda()); + else if (cosineTheta < -0.5 && cosineTheta >= -1) + thetaRegistry.fill(HIST("Theta/Mother/hInvMassMotherHel4"), part.pt(), part.mLambda()); } for (const auto& part : groupPartsOne) { @@ -476,7 +498,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// Now build the combinations for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut - if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type1)) continue; /// PID using stored binned nsigma if (!isParticleCombined(p1, trackconfigs.confTrackChoicePartOne)) @@ -517,7 +539,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { } case 1: { - if (cosineTheta < 1.0 && cosineTheta >= 0.1) + if (cosineTheta <= 1.0 && cosineTheta >= 0.1) sameEventContHel1.setPair(p1, p2, multCol, confUse3D, weight); break; @@ -592,7 +614,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { /// Histogramming same event for (const auto& part : groupPartsTwo) { - if (!invMLambda(part.mLambda(), part.mAntiLambda())) + if (!invMLambda(part.mLambda(), part.mAntiLambda(), V0configs.confV0Type2)) continue; const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); @@ -613,10 +635,10 @@ struct FemtoUniversePairTaskTrackV0Helicity { auto pairProcessFunc = [&](auto& p1, auto& p2) -> void { // Lambda invariant mass cut for p1 - if (!invMLambda(p1.mLambda(), p1.mAntiLambda())) + if (!invMLambda(p1.mLambda(), p1.mAntiLambda(), V0configs.confV0Type2)) return; // Lambda invariant mass cut for p2 - if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type2)) return; // track cleaning if (!pairCleanerV0.isCleanPair(p1, p2, parts)) { @@ -773,7 +795,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut - if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) + if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type1)) continue; /// PID using stored binned nsigma if (!isParticleCombined(p1, trackconfigs.confTrackChoicePartOne)) @@ -815,7 +837,7 @@ struct FemtoUniversePairTaskTrackV0Helicity { } case 1: { - if (cosineTheta < 1.0 && cosineTheta >= 0.1) + if (cosineTheta <= 1.0 && cosineTheta >= 0.1) mixedEventContHel1.setPair(p1, p2, multCol, confUse3D, weight); break; @@ -907,11 +929,11 @@ struct FemtoUniversePairTaskTrackV0Helicity { for (const auto& [p1, p2] : combinations(CombinationsFullIndexPolicy(groupPartsOne, groupPartsTwo))) { // Lambda invariant mass cut for p1 - if (!invMLambda(p1.mLambda(), p1.mAntiLambda())) { + if (!invMLambda(p1.mLambda(), p1.mAntiLambda(), V0configs.confV0Type2)) { continue; } // Lambda invariant mass cut for p2 - if (!invMLambda(p2.mLambda(), p2.mAntiLambda())) { + if (!invMLambda(p2.mLambda(), p2.mAntiLambda(), V0configs.confV0Type2)) { continue; } diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 9adde113460..8dd974cf75f 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -230,7 +230,9 @@ struct ZdcQVectors { std::vector capCOORDS = {"X", "Y"}; AxisSpec axisPsiA = {100, -PI, PI, "#Psi_{1} ZNA"}; + AxisSpec axisPsiAShifted = {100, -PI, PI, "#Psi_{1} ZNA Shifted"}; AxisSpec axisPsiC = {100, -PI, PI, "#Psi_{1} ZNC"}; + AxisSpec axisPsiCShifted = {100, -PI, PI, "#Psi_{1} ZNC Shifted"}; // This is the only histogram that is AL~WA~YS filled. registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); @@ -306,12 +308,16 @@ struct ZdcQVectors { registry.add("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}}); registry.add("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}}); - registry.add("QA/psiZDCA", "psiZDCA", kTH2D, {axisPsiA, {100, 0, 100}}); - registry.add("QA/psiZDCA_shift", "psiZDCA_shift", kTH2D, {axisPsiA, {100, 0, 100}}); - registry.add("QA/psiZDCC", "psiZDCC", kTH2D, {axisPsiC, {100, 0, 100}}); - registry.add("QA/psiZDCC_shift", "psiZDCC_shift", kTH2D, {axisPsiC, {100, 0, 100}}); - registry.add("QA/psiZDCAC", "psiZDCAC", kTH2D, {axisPsiA, axisPsiC}); - registry.add("QA/psiZDCAC_shift", "psiZDCAC_shift", kTH2D, {axisPsiA, axisPsiC}); + registry.add("QA/shift/psiZDCA", "psiZDCA", kTH2D, {axisPsiA, {100, 0, 100}}); + registry.add("QA/shift/psiZDCA_shift", "psiZDCA_shift", kTH2D, {axisPsiA, {100, 0, 100}}); + registry.add("QA/shift/psiZDCC", "psiZDCC", kTH2D, {axisPsiC, {100, 0, 100}}); + registry.add("QA/shift/psiZDCC_shift", "psiZDCC_shift", kTH2D, {axisPsiC, {100, 0, 100}}); + registry.add("QA/shift/psiZDCAC", "psiZDCAC", kTH2D, {axisPsiA, axisPsiC}); + registry.add("QA/shift/psiZDCAC_shift", "psiZDCAC_shift", kTH2D, {axisPsiA, axisPsiC}); + + registry.add("QA/shift/DeltaPsiZDCA", "DeltaPsiZDCA", kTH2D, {axisPsiAShifted, axisPsiA}); + registry.add("QA/shift/DeltaPsiZDCC", "DeltaPsiZDCC", kTH2D, {axisPsiCShifted, axisPsiC}); + registry.add("QA/shift/DeltaPsiZDCAC", "DeltaPsiZDCAC", kTH2D, {axisPsiA, axisPsiC}); registry.add("QA/before/ZNA_pmC", "ZNA_pmC", kTProfile, {{1, 0, 1.}}); registry.add("QA/before/ZNA_pm1", "ZNA_pm1", kTProfile, {{1, 0, 1.}}); @@ -1162,12 +1168,15 @@ struct ZdcQVectors { psiZDCAshift = std::atan2(std::sin(psiZDCAshift), std::cos(psiZDCAshift)); if (cfgFillHistRegistry && !cfgFillNothing) { - registry.fill(HIST("QA/psiZDCA"), psiZDCA, centrality); - registry.fill(HIST("QA/psiZDCC"), psiZDCC, centrality); - registry.fill(HIST("QA/psiZDCAC"), psiZDCA, psiZDCC); - registry.fill(HIST("QA/psiZDCA_shift"), psiZDCAshift, centrality); - registry.fill(HIST("QA/psiZDCC_shift"), psiZDCCshift, centrality); - registry.fill(HIST("QA/psiZDCAC_shift"), psiZDCAshift, psiZDCCshift); + registry.fill(HIST("QA/shift/psiZDCA"), psiZDCA, centrality); + registry.fill(HIST("QA/shift/psiZDCC"), psiZDCC, centrality); + registry.fill(HIST("QA/shift/psiZDCAC"), psiZDCA, psiZDCC); + registry.fill(HIST("QA/shift/psiZDCA_shift"), psiZDCAshift, centrality); + registry.fill(HIST("QA/shift/psiZDCC_shift"), psiZDCCshift, centrality); + registry.fill(HIST("QA/shift/psiZDCAC_shift"), psiZDCAshift, psiZDCCshift); + registry.fill(HIST("QA/shift/DeltaPsiZDCA"), psiZDCAshift, psiZDCA); + registry.fill(HIST("QA/shift/DeltaPsiZDCC"), psiZDCCshift, psiZDCC); + registry.fill(HIST("QA/shift/DeltaPsiZDCAC"), psiZDCAshift - psiZDCA, psiZDCCshift - psiZDCC); } double qXaShift = std::hypot(qRec[1], qRec[0]) * std::cos(psiZDCAshift); @@ -1178,10 +1187,10 @@ struct ZdcQVectors { if (isSelected && cfgFillHistRegistry && !cfgFillNothing) { fillCommonRegistry(qRec[0], qRec[1], qRec[2], qRec[3], v, centrality, rsTimestamp); registry.fill(HIST("QA/centrality_after"), centrality); - registry.get(HIST("QA/after/ZNA_Qx"))->Fill(Form("%d", runnumber), qRec[0]); - registry.get(HIST("QA/after/ZNA_Qy"))->Fill(Form("%d", runnumber), qRec[1]); - registry.get(HIST("QA/after/ZNC_Qx"))->Fill(Form("%d", runnumber), qRec[2]); - registry.get(HIST("QA/after/ZNC_Qy"))->Fill(Form("%d", runnumber), qRec[3]); + registry.get(HIST("QA/after/ZNA_Qx"))->Fill(Form("%d", runnumber), qXaShift); + registry.get(HIST("QA/after/ZNA_Qy"))->Fill(Form("%d", runnumber), qYaShift); + registry.get(HIST("QA/after/ZNC_Qx"))->Fill(Form("%d", runnumber), qXcShift); + registry.get(HIST("QA/after/ZNC_Qy"))->Fill(Form("%d", runnumber), qYcShift); } spTableZDC(runnumber, cents, v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, isSelected, eventSelectionFlags); diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index a323867eb6b..d863773ce4c 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -154,9 +154,11 @@ struct FlowSP { Filter trackFilter = nabs(aod::track::eta) < cfgTrackSelsEta && aod::track::pt > cfgTrackSelsPtmin&& aod::track::pt < cfgTrackSelsPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t) true)) && nabs(aod::track::dcaXY) < cfgTrackSelsDCAxy&& nabs(aod::track::dcaZ) < cfgTrackSelsDCAz; Filter trackFilterMC = nabs(aod::mcparticle::eta) < cfgTrackSelsEta && aod::mcparticle::pt > cfgTrackSelsPtmin&& aod::mcparticle::pt < cfgTrackSelsPtmax; using GeneralCollisions = soa::Join; - using UnfilteredTracks = soa::Join; + using UnfilteredTracksPID = soa::Join; + using UnfilteredTracks = soa::Join; using UsedTracks = soa::Filtered; + using UsedTracksPID = soa::Filtered; using ZDCCollisions = soa::Filtered>; // For MC Reco and Gen @@ -230,6 +232,8 @@ struct FlowSP { double psiFull = 0; double trackPxA = 0; double trackPxC = 0; + double meanPxA = 0; + double meanPxC = 0; } spm; OutputObj fWeights{GFWWeights("weights")}; @@ -341,6 +345,7 @@ struct FlowSP { AxisSpec axisdEdx = {300, 0, 300, "dEdx for PID"}; AxisSpec axisBeta = {150, 0, 1.5, "Beta for PID"}; AxisSpec axisCharge = {3, 0, 3, "Charge: 0 = inclusive, 1 = positive, 2 = negative"}; + AxisSpec axisPx = {1000, -0.05, 0.05, "p_{x} (GeV/c)"}; std::vector ptbinning = {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.2, 2.4, 2.6, 2.8, 3, 3.5, 4, 5, 6, 8, 10}; AxisSpec axisPt = {ptbinning, "#it{p}_{T} GeV/#it{c}"}; @@ -425,6 +430,7 @@ struct FlowSP { histos.add("QA/after/PsiA_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); histos.add("QA/after/PsiC_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); histos.add("QA/after/PsiFull_vs_Vz", "", {HistType::kTH2D, {axisPhiPlane, axisVz}}); + // histos.add("QA/after/DeltaPsivsPx", "", {HistType::kTH3D, {axisCent, axisPhiPlane, axisPx}}); } if (cfgFillQABefore) { @@ -432,7 +438,7 @@ struct FlowSP { } } - if (doprocessData || doprocessMCReco) { + if (doprocessData || doprocessMCReco || doprocessDataPID) { if (cfgFillTrackQA) { histos.add("incl/QA/after/pt_phi", "", {HistType::kTH2D, {axisPt, axisPhiMod}}); @@ -459,7 +465,7 @@ struct FlowSP { histos.addClone("incl/QA/after/", "incl/QA/before/"); } - if (cfgFillPIDQA) { + if (cfgFillPIDQA && doprocessDataPID) { histos.add("hPIDcounts", "", kTH2D, {{{4, 0, 4}, axisPt}}); histos.get(HIST("hPIDcounts"))->GetXaxis()->SetBinLabel(1, "UFO"); histos.get(HIST("hPIDcounts"))->GetXaxis()->SetBinLabel(2, "Pion"); @@ -499,6 +505,10 @@ struct FlowSP { histos.addClone("incl/pion/", "incl/proton/"); } + if (cfgFillEventQA) { + histos.add("QA/hCentFull", " ; Centrality (%); ", {HistType::kTH1D, {axisCent}}); + } + if (doprocessMCReco) { registry.add("trackMCReco/after/hIsPhysicalPrimary", "", {HistType::kTH2D, {{2, 0, 2}, axisCentrality}}); registry.add("trackMCReco/hTrackSize_unFiltered", "", {HistType::kTH2D, {{100, 0, 200000}, axisCentrality}}); @@ -514,6 +524,7 @@ struct FlowSP { registry.addClone("trackMCReco/after/incl/", "trackMCReco/after/neg/"); registry.addClone("trackMCReco/after/", "trackMCReco/before/"); } + if (doprocessData) { registry.add("QQCorrelations/qAqCX", "", kTProfile, {axisCent}); registry.add("QQCorrelations/qAqCY", "", kTProfile, {axisCent}); @@ -524,8 +535,12 @@ struct FlowSP { if (cfgFillGeneralV1Histos) { // track properties per centrality and per eta, pt bin + registry.add("incl/vnCodd", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnAodd", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnCSetPlane", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnASetPlane", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); } if (cfgFillMeanPT) { registry.add("incl/meanPT/meanRelPtA", "", kTProfile2D, {axisEtaVn, axisCentrality}); @@ -534,41 +549,33 @@ struct FlowSP { registry.add("incl/meanPT/hMeanPtEtaCent", "", kTProfile2D, {axisEtaVn, axisCent}); registry.add("incl/meanPT/ptV1A", "", kTProfile2D, {axisEtaVn, axisCent}); registry.add("incl/meanPT/ptV1C", "", kTProfile2D, {axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1Aodd", "", kTProfile2D, {axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1Codd", "", kTProfile2D, {axisEtaVn, axisCent}); registry.add("incl/meanPT/hMeanPtCent", "", kTProfile, {axisCent}); - } - if (cfgFillPID) { - registry.add("incl/pion/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - if (cfgFillEventPlane) { - registry.add("incl/pion/vnA_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnC_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnFull_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - } + registry.add("incl/meanPT/ptV1A3D", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1C3D", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + + registry.add("incl/meanPT/ptV1A3Dx", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1C3Dx", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + + registry.add("incl/meanPT/ptV1A3Dy", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + registry.add("incl/meanPT/ptV1C3Dy", "", kTProfile3D, {axisPt, axisEtaVn, axisCent}); + + registry.add("incl/meanPT/meanPxA", "", kTH3D, {axisCent, axisPhiPlane, axisPx}); + registry.add("incl/meanPT/meanPxC", "", kTH3D, {axisCent, axisPhiPlane, axisPx}); } if (cfgFillXandYterms) { registry.add("incl/vnAx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnAy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnCx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/vnCy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - if (cfgFillPID) { - registry.add("incl/pion/vnAx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnAy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnCx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/vnCy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - } } if (cfgFillMixedHarmonics) { registry.add("incl/MH/vnAxCxUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/MH/vnAyCyUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/MH/vnAxCyUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); registry.add("incl/MH/vnAyCxUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - if (cfgFillPID) { - registry.add("incl/pion/MH/vnAxCxUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/MH/vnAyCyUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/MH/vnAxCyUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - registry.add("incl/pion/MH/vnAyCxUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); - } } if (cfgFillEventPlane) { registry.add("incl/vnA_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); @@ -585,21 +592,53 @@ struct FlowSP { histos.add("QA/hCosPhiASinsPhiC", "hCosPhiASinsPhiC; Centrality(%); #LT Cos(#Psi^{A})Sin(#Psi^{C})#GT", kTProfile, {axisCent}); histos.add("QA/hFullEvPlaneRes", "hFullEvPlaneRes; Centrality(%); -#LT Cos(#Psi^{A} - #Psi^{C})#GT ", kTProfile, {axisCent}); } - if (cfgFillEventQA) { - histos.add("QA/hCentFull", " ; Centrality (%); ", {HistType::kTH1D, {axisCent}}); - } - } // end of doprocessData - if (cfgFillChargeDependence || cfgFillPID) { - registry.addClone("incl/pion/", "incl/proton/"); - registry.addClone("incl/pion/", "incl/kaon/"); + + } // end of doProcessData + + if (cfgFillChargeDependence || cfgFillChargeDependenceQA) { + LOGF(info, "Cloning charge dependence histograms"); registry.addClone("incl/", "pos/"); registry.addClone("incl/", "neg/"); - } - if (cfgFillPIDQA || cfgFillChargeDependenceQA) { + histos.addClone("incl/", "pos/"); histos.addClone("incl/", "neg/"); } + if (doprocessDataPID) { + if (cfgFillGeneralV1Histos) { + registry.add("incl/pion/vnCodd", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnAodd", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnC", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnA", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnCSetPlane", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/vnASetPlane", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + } + + if (cfgFillEventPlane) { + registry.add("incl/pion/vnA_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnC_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnFull_EP", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + } + if (cfgFillXandYterms) { + registry.add("incl/pion/vnAx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnAy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnCx", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/vnCy", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + } + if (cfgFillMixedHarmonics) { + registry.add("incl/pion/MH/vnAxCxUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/MH/vnAyCyUx_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/MH/vnAxCyUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + registry.add("incl/pion/MH/vnAyCxUy_MH", "", kTProfile3D, {axisPt, axisEtaVn, axisCentrality}); + } + registry.addClone("incl/pion/", "incl/proton/"); + registry.addClone("incl/pion/", "incl/kaon/"); + if (cfgFillChargeDependence) { + registry.addClone("incl/", "pos/"); + registry.addClone("incl/", "neg/"); + } + } + } else if (doprocessMCGen) { registry.add("trackMCGen/nCollReconstructedPerMcCollision", "", {HistType::kTH1D, {{10, -5, 5}}}); registry.add("trackMCGen/after/incl/hPt_hadron", "", {HistType::kTH3D, {axisPt, axisEta, axisCentrality}}); @@ -966,7 +1005,7 @@ struct FlowSP { histos.fill(HIST("hTrackCount"), trackSel_DCAz); - if (track.tpcNClsFound() < cfgTrackSelsNcls) + if (track.tpcNClsCrossedRows() < cfgTrackSelsNcls) return false; histos.fill(HIST("hTrackCount"), trackSel_NCls); @@ -1039,6 +1078,7 @@ struct FlowSP { histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiA_vs_Vz"), psiA, collision.posZ(), spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiC_vs_Vz"), psiC, collision.posZ(), spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiFull_vs_Vz"), psiFull, collision.posZ(), spm.centWeight); + // histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/DeltaPsivsPx"), spm.centrality, psiA - psiC - constants::math::PI, track.px(), spm.centWeight); } } return; @@ -1048,10 +1088,18 @@ struct FlowSP { inline void fillHistograms(TrackObject track) { double weight = spm.wacc[ct][pt] * spm.weff[ct][pt] * spm.centWeight; + int scale = 1.0; + int minusQ = -1.0; + if (track.eta() < 0) + scale = -1.0; if (cfgFillGeneralV1Histos) { + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnAodd"), track.pt(), track.eta(), spm.centrality, scale * (spm.uy * spm.qyA + spm.ux * spm.qxA) / std::sqrt(std::fabs(spm.corrQQ)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnCodd"), track.pt(), track.eta(), spm.centrality, scale * (spm.uy * spm.qyC + spm.ux * spm.qxC) / std::sqrt(std::fabs(spm.corrQQ)), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnA"), track.pt(), track.eta(), spm.centrality, (spm.uy * spm.qyA + spm.ux * spm.qxA) / std::sqrt(std::fabs(spm.corrQQ)), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnC"), track.pt(), track.eta(), spm.centrality, (spm.uy * spm.qyC + spm.ux * spm.qxC) / std::sqrt(std::fabs(spm.corrQQ)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnCSetPlane"), track.pt(), track.eta(), spm.centrality, (spm.uy + spm.ux) / std::sqrt(std::fabs(spm.corrQQ)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("vnASetPlane"), track.pt(), track.eta(), spm.centrality, (minusQ * spm.ux - spm.uy) / std::sqrt(std::fabs(spm.corrQQ)), weight); } if (cfgFillMixedHarmonics) { @@ -1079,6 +1127,18 @@ struct FlowSP { registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/hMeanPtCent"), spm.centrality, track.pt(), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A"), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C"), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1Aodd"), track.eta(), spm.centrality, track.pt() * scale * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1Codd"), track.eta(), spm.centrality, track.pt() * scale * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A3D"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C3D"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)), weight); + + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A3Dx"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQx)) * spm.meanPtWeight)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C3Dx"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQx)) * spm.meanPtWeight)), weight); + + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1A3Dy"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyA) / (std::sqrt(std::fabs(spm.corrQQy)) * spm.meanPtWeight)), weight); + registry.fill(HIST(Charge[ct]) + HIST(Species[pt]) + HIST("meanPT/ptV1C3Dy"), track.pt(), track.eta(), spm.centrality, track.pt() * ((spm.uy * spm.qyC) / (std::sqrt(std::fabs(spm.corrQQy)) * spm.meanPtWeight)), weight); } } @@ -1105,25 +1165,26 @@ struct FlowSP { histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hDCAxy_pt"), track.pt(), track.dcaXY(), spm.wacc[ct][par] * spm.weff[ct][par]); histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hDCAz_pt"), track.pt(), track.dcaZ(), spm.wacc[ct][par] * spm.weff[ct][par]); histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hSharedClusters_pt"), track.pt(), track.tpcFractionSharedCls(), spm.wacc[ct][par] * spm.weff[ct][par]); - histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hCrossedRows_pt"), track.pt(), track.tpcNClsFound(), spm.wacc[ct][par] * spm.weff[ct][par]); - histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hCrossedRows_vs_SharedClusters"), track.tpcNClsFound(), track.tpcFractionSharedCls(), spm.wacc[ct][par] * spm.weff[ct][par]); + histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hCrossedRows_pt"), track.pt(), track.tpcNClsCrossedRows(), spm.wacc[ct][par] * spm.weff[ct][par]); + histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hCrossedRows_vs_SharedClusters"), track.tpcNClsCrossedRows(), track.tpcFractionSharedCls(), spm.wacc[ct][par] * spm.weff[ct][par]); histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hMeanPtEta"), track.eta(), spm.centrality, track.pt(), spm.wacc[ct][par] * spm.weff[ct][par]); } template inline void fillPIDQA(TrackObject track) { - if (!cfgFillPIDQA || !cfgFillTrackQA) + if (!cfgFillTrackQA) return; - - histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaPi()); - histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaPi()); - histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaKa()); - histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaKa()); - histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaPr()); - histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaPr()); - histos.fill(HIST(Charge[ct]) + HIST("QA/") + HIST(Time[ft]) + HIST("hdEdxTPC_pt"), track.pt(), track.tpcSignal()); - histos.fill(HIST(Charge[ct]) + HIST("QA/") + HIST(Time[ft]) + HIST("hBetaTOF_pt"), track.pt(), track.beta()); + if constexpr (framework::has_type_v) { + histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaPi()); + histos.fill(HIST(Charge[ct]) + HIST("pion/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaPi()); + histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaKa()); + histos.fill(HIST(Charge[ct]) + HIST("kaon/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaKa()); + histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTOF_pt"), track.pt(), track.tofNSigmaPr()); + histos.fill(HIST(Charge[ct]) + HIST("proton/") + HIST("QA/") + HIST(Time[ft]) + HIST("hNsigmaTPC_pt"), track.pt(), track.tpcNSigmaPr()); + histos.fill(HIST(Charge[ct]) + HIST("QA/") + HIST(Time[ft]) + HIST("hdEdxTPC_pt"), track.pt(), track.tpcSignal()); + histos.fill(HIST(Charge[ct]) + HIST("QA/") + HIST(Time[ft]) + HIST("hBetaTOF_pt"), track.pt(), track.beta()); + } } template @@ -1339,12 +1400,11 @@ struct FlowSP { TProfile* relPxCNeg = new TProfile("relPxCNeg", "relPxCNeg", 8, -0.8, 0.8); TProfile* relPxCPos = new TProfile("relPxCPos", "relPxCPos", 8, -0.8, 0.8); - for (const auto& track : tracks) { - - ParticleType trackPID = (cfgFillPID || cfgFillPIDQA) ? getTrackPID(track) : kUnidentified; + double sumPxAEvent = 0; + int meanPxEventCount = 0; + double sumPxCEvent = 0; - if (cfgFillPIDQA) - histos.fill(HIST("hPIDcounts"), trackPID, track.pt()); + for (const auto& track : tracks) { if (track.sign() == 0) continue; @@ -1355,21 +1415,6 @@ struct FlowSP { if (cfgFillQABefore) { fillAllQA(track); - if (cfgFillPIDQA) { - switch (trackPID) { - case kPions: - fillAllQA(track); - break; - case kKaons: - fillAllQA(track); - break; - case kProtons: - fillAllQA(track); - break; - default: /* do nothing */ - break; - } - } } if (!trackSelected(track, field)) @@ -1419,21 +1464,6 @@ struct FlowSP { histos.fill(HIST("hTrackCount"), trackSel_ParticleWeights); fillAllQA(track); - if (cfgFillPIDQA) { - switch (trackPID) { - case kPions: - fillAllQA(track); - break; - case kKaons: - fillAllQA(track); - break; - case kProtons: - fillAllQA(track); - break; - default: /* do nothing */ - break; - } - } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - spm.ux = std::cos(cfgHarm * phi); @@ -1449,6 +1479,9 @@ struct FlowSP { // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + spm.meanPxA = track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)); + spm.meanPxC = track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / (std::sqrt(std::fabs(spm.corrQQ)) * spm.meanPtWeight)); + fillHistograms(track); if (cfgFillChargeDependence) { @@ -1462,79 +1495,41 @@ struct FlowSP { } } - if (cfgFillPID) { - switch (trackPID) { - case kPions: - fillHistograms(track); - break; - case kKaons: - fillHistograms(track); - break; - case kProtons: - fillHistograms(track); - break; - default: /* do nothing */ - break; - } - if (cfgFillChargeDependence) { - switch (spm.charge) { - case kPositive: { - switch (trackPID) { - case kPions: - fillHistograms(track); - break; - case kKaons: - fillHistograms(track); - break; - case kProtons: - fillHistograms(track); - break; - default: /* do nothing */ - break; - } - break; - } - case kNegative: { - switch (trackPID) { - case kPions: - fillHistograms(track); - break; - case kKaons: - fillHistograms(track); - break; - case kProtons: - fillHistograms(track); - break; - default: /* do nothing */ - break; - } - break; - } - } - } - } // end of fillPID - double drelPxA = track.pt() * ((spm.uy * spm.qyA + spm.ux * spm.qxA) / std::sqrt(std::fabs(spm.corrQQ))); double drelPxC = track.pt() * ((spm.uy * spm.qyC + spm.ux * spm.qxC) / std::sqrt(std::fabs(spm.corrQQ))); - meanPTMap->Fill(track.eta(), track.pt(), spm.wacc[kInclusive][kUnidentified] * spm.weff[kInclusive][kUnidentified] * spm.centWeight); - relPxA->Fill(track.eta(), drelPxA, spm.wacc[kInclusive][kUnidentified] * spm.weff[kInclusive][kUnidentified] * spm.centWeight); - relPxC->Fill(track.eta(), drelPxC, spm.wacc[kInclusive][kUnidentified] * spm.weff[kInclusive][kUnidentified] * spm.centWeight); + double weightIncl = spm.wacc[kInclusive][kUnidentified] * spm.weff[kInclusive][kUnidentified] * spm.centWeight; + double weightPos = spm.wacc[kPositive][kUnidentified] * spm.weff[kPositive][kUnidentified] * spm.centWeight; + double weightNeg = spm.wacc[kNegative][kUnidentified] * spm.weff[kNegative][kUnidentified] * spm.centWeight; + + sumPxAEvent += spm.meanPxA * weightIncl; + sumPxCEvent += spm.meanPxC * weightIncl; + meanPxEventCount += weightIncl; + + meanPTMap->Fill(track.eta(), track.pt(), weightIncl); + relPxA->Fill(track.eta(), drelPxA, weightIncl); + relPxC->Fill(track.eta(), drelPxC, weightIncl); if (spm.charge == kPositive) { - meanPTMapPos->Fill(track.eta(), track.pt(), spm.wacc[kPositive][kUnidentified] * spm.weff[kPositive][kUnidentified] * spm.centWeight); - relPxAPos->Fill(track.eta(), drelPxA, spm.wacc[kPositive][kUnidentified] * spm.weff[kPositive][kUnidentified] * spm.centWeight); - relPxCPos->Fill(track.eta(), drelPxC, spm.wacc[kPositive][kUnidentified] * spm.weff[kPositive][kUnidentified] * spm.centWeight); + meanPTMapPos->Fill(track.eta(), track.pt(), weightPos); + relPxAPos->Fill(track.eta(), drelPxA, weightPos); + relPxCPos->Fill(track.eta(), drelPxC, weightPos); } if (spm.charge == kNegative) { - meanPTMapNeg->Fill(track.eta(), track.pt(), spm.wacc[kNegative][kUnidentified] * spm.weff[kNegative][kUnidentified] * spm.centWeight); - relPxANeg->Fill(track.eta(), drelPxA, spm.wacc[kNegative][kUnidentified] * spm.weff[kNegative][kUnidentified] * spm.centWeight); - relPxCNeg->Fill(track.eta(), drelPxC, spm.wacc[kNegative][kUnidentified] * spm.weff[kNegative][kUnidentified] * spm.centWeight); + meanPTMapNeg->Fill(track.eta(), track.pt(), weightNeg); + relPxANeg->Fill(track.eta(), drelPxA, weightNeg); + relPxCNeg->Fill(track.eta(), drelPxC, weightNeg); } } // end of track loop + double meanPxAEvent = sumPxAEvent / meanPxEventCount; + double meanPxCEvent = sumPxCEvent / meanPxEventCount; + + registry.fill(HIST("incl/meanPT/meanPxA"), spm.centrality, spm.psiA - spm.psiC, meanPxAEvent); + registry.fill(HIST("incl/meanPT/meanPxC"), spm.centrality, spm.psiA - spm.psiC, meanPxCEvent); + // Now we want to fill the final relPt histogram // Loop over all eta and fill bins if (cfgFillMeanPT) { @@ -1556,11 +1551,14 @@ struct FlowSP { if (meanPt != 0) { registry.fill(HIST("incl/meanPT/meanRelPtA"), eta, spm.centrality, drelPxA / meanPt, spm.centWeight); - registry.fill(HIST("neg/meanPT/meanRelPtA"), eta, spm.centrality, drelPxANeg / meanPtNeg, spm.centWeight); - registry.fill(HIST("pos/meanPT/meanRelPtA"), eta, spm.centrality, drelPxAPos / meanPtPos, spm.centWeight); registry.fill(HIST("incl/meanPT/meanRelPtC"), eta, spm.centrality, drelPxC / meanPt, spm.centWeight); - registry.fill(HIST("neg/meanPT/meanRelPtC"), eta, spm.centrality, drelPxCNeg / meanPtNeg, spm.centWeight); - registry.fill(HIST("pos/meanPT/meanRelPtC"), eta, spm.centrality, drelPxCPos / meanPtPos, spm.centWeight); + + if (cfgFillChargeDependence) { + registry.fill(HIST("neg/meanPT/meanRelPtA"), eta, spm.centrality, drelPxANeg / meanPtNeg, spm.centWeight); + registry.fill(HIST("pos/meanPT/meanRelPtA"), eta, spm.centrality, drelPxAPos / meanPtPos, spm.centWeight); + registry.fill(HIST("neg/meanPT/meanRelPtC"), eta, spm.centrality, drelPxCNeg / meanPtNeg, spm.centWeight); + registry.fill(HIST("pos/meanPT/meanRelPtC"), eta, spm.centrality, drelPxCPos / meanPtPos, spm.centWeight); + } } } } @@ -1578,6 +1576,230 @@ struct FlowSP { PROCESS_SWITCH(FlowSP, processData, "Process analysis for non-derived data", true); + void processDataPID(ZDCCollisions::iterator const& collision, aod::BCsWithTimestamps const&, UsedTracksPID const& tracks) + { + + histos.fill(HIST("hEventCount"), evSel_FilteredEvent); + auto bc = collision.bc_as(); + int standardMagField = 99999; + auto field = (cfgMagField == standardMagField) ? getMagneticField(bc.timestamp()) : cfgMagField; + + if (bc.runNumber() != cfg.lastRunNumber) { + cfg.correctionsLoaded = false; + cfg.clCentrality = false; + cfg.lastRunNumber = bc.runNumber(); + cfg.mAcceptance.clear(); + LOGF(info, "Size of mAcceptance: %i (should be 0)", (int)cfg.mAcceptance.size()); + } + + if (cfgFillQABefore) + fillEventQA(collision, tracks); + + loadCorrections(bc.timestamp()); + + spm.centrality = collision.centFT0C(); + + if (cfgCentFT0Cvariant1) + spm.centrality = collision.centFT0CVariant1(); + if (cfgCentFT0M) + spm.centrality = collision.centFT0M(); + if (cfgCentFV0A) + spm.centrality = collision.centFV0A(); + if (cfgCentNGlobal) + spm.centrality = collision.centNGlobal(); + + if (!eventSelected(collision, tracks.size())) + return; + + if (!collision.isSelected()) // selected by ZDCQVectors task (checks signal in ZDC) --> only possible in data not MC + return; + histos.fill(HIST("hEventCount"), evSel_isSelectedZDC); + + // Always fill centrality histogram after event selections! + histos.fill(HIST("hCentrality"), spm.centrality); + + spm.qxA = collision.qxA(); + spm.qyA = collision.qyA(); + spm.qxC = collision.qxC(); + spm.qyC = collision.qyC(); + + spm.vz = collision.posZ(); + + spm.psiA = 1.0 * std::atan2(spm.qyA, spm.qxA); + spm.psiC = 1.0 * std::atan2(spm.qyC, spm.qxC); + + // https://twiki.cern.ch/twiki/pub/ALICE/DirectedFlowAnalysisNote/vn_ZDC_ALICE_INT_NOTE_version02.pdf + spm.psiFull = 1.0 * std::atan2(spm.qyA + spm.qyC, spm.qxA + spm.qxC); + + if (spm.centrality > cfgCentMax || spm.centrality < cfgCentMin) + return; + + // Load correlations and SP resolution needed for Scalar Product and event plane methods. + // Only load once! + // If not loaded set to 1 + + if (cfgCCDBdir_QQ.value.empty() == false) { + if (!cfg.clQQ) { + TList* hcorrList = ccdb->getForTimeStamp(cfgCCDBdir_QQ.value, bc.timestamp()); + cfg.hcorrQQ = reinterpret_cast(hcorrList->FindObject("qAqCXY")); + cfg.hcorrQQx = reinterpret_cast(hcorrList->FindObject("qAqCX")); + cfg.hcorrQQy = reinterpret_cast(hcorrList->FindObject("qAqCY")); + cfg.clQQ = true; + } + spm.corrQQ = cfg.hcorrQQ->GetBinContent(cfg.hcorrQQ->FindBin(spm.centrality)); + spm.corrQQx = cfg.hcorrQQx->GetBinContent(cfg.hcorrQQx->FindBin(spm.centrality)); + spm.corrQQy = cfg.hcorrQQy->GetBinContent(cfg.hcorrQQy->FindBin(spm.centrality)); + } + + double evPlaneRes = 1.; + if (cfgCCDBdir_SP.value.empty() == false) { + if (!cfg.clEvPlaneRes) { + cfg.hEvPlaneRes = ccdb->getForTimeStamp(cfgCCDBdir_SP.value, bc.timestamp()); + cfg.clEvPlaneRes = true; + } + evPlaneRes = cfg.hEvPlaneRes->GetBinContent(cfg.hEvPlaneRes->FindBin(spm.centrality)); + if (evPlaneRes < 0) + LOGF(fatal, " > 0 for centrality %.2f! Cannot determine resolution.. Change centrality ranges!!!", spm.centrality); + evPlaneRes = std::sqrt(evPlaneRes); + } + + spm.centWeight = 1.; + if (cfgCCDBdir_centrality.value.empty() == false) { + if (!cfg.clCentrality) { + cfg.hCentrality = ccdb->getForTimeStamp(cfgCCDBdir_centrality.value, bc.timestamp()); + cfg.clCentrality = true; + } + double centW = cfg.hCentrality->GetBinContent(cfg.hCentrality->FindBin(spm.centrality)); + if (centW < 0) { + spm.centWeight = 1. / centW; + } else { + LOGF(fatal, "Centrality weight cannot be negative .. setting to 0. for (%.2f)", spm.centrality); + spm.centWeight = 0.; + } + } + + fillEventQA(collision, tracks); + + for (const auto& track : tracks) { + + ParticleType trackPID = (cfgFillPID || cfgFillPIDQA) ? getTrackPID(track) : kUnidentified; + + histos.fill(HIST("hPIDcounts"), trackPID, track.pt()); + + if (track.sign() == 0) + continue; + + histos.fill(HIST("hTrackCount"), trackSel_ZeroCharge); + + spm.charge = ((track.sign() > 0)) ? kPositive : kNegative; + + if (cfgFillQABefore) { + switch (trackPID) { + case kPions: + fillAllQA(track); + break; + case kKaons: + fillAllQA(track); + break; + case kProtons: + fillAllQA(track); + break; + default: /* do nothing */ + break; + } + } + + if (!trackSelected(track, field)) + continue; + + // constrain angle to 0 -> [0,0+2pi] + auto phi = RecoDecay::constrainAngle(track.phi(), 0); + + switch (trackPID) { + case kPions: + fillAllQA(track); + break; + case kKaons: + fillAllQA(track); + break; + case kProtons: + fillAllQA(track); + break; + default: /* do nothing */ + break; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + spm.ux = std::cos(cfgHarm * phi); + spm.uy = std::sin(cfgHarm * phi); + + spm.uxMH = std::cos(cfgHarmMixed * phi); + spm.uyMH = std::sin(cfgHarmMixed * phi); + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + spm.vnA = std::cos(cfgHarm * (phi - spm.psiA)) / evPlaneRes; + spm.vnC = std::cos(cfgHarm * (phi - spm.psiC)) / evPlaneRes; + spm.vnFull = std::cos(cfgHarm * (phi - spm.psiFull)) / evPlaneRes; + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + fillHistograms(track); + + switch (trackPID) { + case kPions: + fillHistograms(track); + break; + case kKaons: + fillHistograms(track); + break; + case kProtons: + fillHistograms(track); + break; + default: /* do nothing */ + break; + } + + if (cfgFillChargeDependence) { + switch (spm.charge) { + case kPositive: { + switch (trackPID) { + case kPions: + fillHistograms(track); + break; + case kKaons: + fillHistograms(track); + break; + case kProtons: + fillHistograms(track); + break; + default: /* do nothing */ + break; + } + break; + } + case kNegative: { + switch (trackPID) { + case kPions: + fillHistograms(track); + break; + case kKaons: + fillHistograms(track); + break; + case kProtons: + fillHistograms(track); + break; + default: /* do nothing */ + break; + } + break; + } + } + } + } // end of track loop + } + + PROCESS_SWITCH(FlowSP, processDataPID, "Process analysis for non-derived data with PID", false); + void processMCReco(CC const& collision, aod::BCsWithTimestamps const&, TCs const& tracks, FilteredTCs const& filteredTracks, aod::McParticles const&) { auto bc = collision.template bc_as(); diff --git a/PWGCF/Flow/Tasks/flowZdcEnergy.cxx b/PWGCF/Flow/Tasks/flowZdcEnergy.cxx index fb868177af1..87f129a6b8f 100644 --- a/PWGCF/Flow/Tasks/flowZdcEnergy.cxx +++ b/PWGCF/Flow/Tasks/flowZdcEnergy.cxx @@ -52,6 +52,7 @@ struct flowZdcEnergy { ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality (%)"}; ConfigurableAxis axisMult{"axisMult", {100, 0, 100000}, "Multiplicity"}; + ConfigurableAxis axisMultDivided{"axisMultDivided", {30, 0, 15000}, "Multiplicity bins for ZN energy"}; ConfigurableAxis axisPt{"axisPt", {100, 0, 15}, "#P_{t}"}; ConfigurableAxis axisEta{"axisEta", {64, -1.6, 1.6}, "#eta"}; ConfigurableAxis axisEnergy{"axisEnergy", {300, 0, 300}, "Energy"}; @@ -120,6 +121,21 @@ struct flowZdcEnergy { registry.add("hEnergyWithCent_ZNA_SumSectors", "", {HistType::kTH2D, {axisEnergy, axisCent}}); registry.add("hEnergyWithCent_ZNC_SumSectors", "", {HistType::kTH2D, {axisEnergy, axisCent}}); registry.add("hEnergyWithCent_RescaledSumDiff", "", {HistType::kTH2D, {axisRescaledDiff, axisCent}}); + + registry.add("hEnergyWithMult_ZNA_Common", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_Common", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_RescaledDiff", "", {HistType::kTH2D, {axisRescaledDiff, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_1", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_2", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_3", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_4", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_1", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_2", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_3", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_4", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNA_SumSectors", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_ZNC_SumSectors", "", {HistType::kTH2D, {axisEnergy, axisMultDivided}}); + registry.add("hEnergyWithMult_RescaledSumDiff", "", {HistType::kTH2D, {axisRescaledDiff, axisMultDivided}}); } // Helper: event selection @@ -128,9 +144,6 @@ struct flowZdcEnergy { { if (!UseEvsel) { registry.fill(HIST("QA/hEventCount"), kAllEvents); - registry.fill(HIST("QA/hEventCount"), kSeln); - registry.fill(HIST("QA/hEventCount"), kZvtx); - registry.fill(HIST("QA/hEventCount"), kCentrality); } else { registry.fill(HIST("QA/hEventCount"), kAllEvents); if (runmode == 2 && !collision.sel7()) { @@ -154,7 +167,7 @@ struct flowZdcEnergy { // Helper: fill ZDC observables template - void fillZDCObservables(TCollision const& collision, float centrality) + void fillZDCObservables(TCollision const& collision, float centrality, float multiTPC) { const auto& foundBC = collision.template foundBC_as(); if (!foundBC.has_zdc()) { @@ -198,11 +211,26 @@ struct flowZdcEnergy { registry.fill(HIST("hEnergyWithCent_ZNA_SumSectors"), sumEnergyZNA, centrality); registry.fill(HIST("hEnergyWithCent_ZNC_SumSectors"), sumEnergyZNC, centrality); + registry.fill(HIST("hEnergyWithMult_ZNA_Common"), energyCommonZNA, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_Common"), energyCommonZNC, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_1"), energySectorZNA1, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_2"), energySectorZNA2, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_3"), energySectorZNA3, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_4"), energySectorZNA4, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_1"), energySectorZNC1, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_2"), energySectorZNC2, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_3"), energySectorZNC3, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_4"), energySectorZNC4, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNA_SumSectors"), sumEnergyZNA, multiTPC); + registry.fill(HIST("hEnergyWithMult_ZNC_SumSectors"), sumEnergyZNC, multiTPC); + if (commonDen > 1.e-6f) { registry.fill(HIST("hEnergyWithCent_RescaledDiff"), (energyCommonZNA - energyCommonZNC) / commonDen, centrality); + registry.fill(HIST("hEnergyWithMult_RescaledDiff"), (energyCommonZNA - energyCommonZNC) / commonDen, multiTPC); } if (sumDen > 1.e-6f) { registry.fill(HIST("hEnergyWithCent_RescaledSumDiff"), (sumEnergyZNA - sumEnergyZNC) / sumDen, centrality); + registry.fill(HIST("hEnergyWithMult_RescaledSumDiff"), (sumEnergyZNA - sumEnergyZNC) / sumDen, multiTPC); } } @@ -222,7 +250,7 @@ struct flowZdcEnergy { registry.fill(HIST("QA/hCentrality"), centrality); registry.fill(HIST("QA/hMultiplicity"), multi); registry.fill(HIST("QA/hMultiplicity_TPC"), multiTPC); - fillZDCObservables(collision, centrality); + fillZDCObservables(collision, centrality, multiTPC); for (const auto& track : tracks) { registry.fill(HIST("QA/hPt"), track.pt()); @@ -246,7 +274,7 @@ struct flowZdcEnergy { registry.fill(HIST("QA/hCentrality"), centrality); registry.fill(HIST("QA/hMultiplicity"), multi); registry.fill(HIST("QA/hMultiplicity_TPC"), multiTPC); - fillZDCObservables(collision, centrality); + fillZDCObservables(collision, centrality, multiTPC); for (const auto& track : tracks) { registry.fill(HIST("QA/hPt"), track.pt()); diff --git a/PWGCF/GenericFramework/Core/FlowContainer.cxx b/PWGCF/GenericFramework/Core/FlowContainer.cxx index 532eb35c80c..338c6de9cf1 100644 --- a/PWGCF/GenericFramework/Core/FlowContainer.cxx +++ b/PWGCF/GenericFramework/Core/FlowContainer.cxx @@ -422,7 +422,7 @@ TH1D* FlowContainer::GetCorrXXVsPt(const char* order, double lminmulti, double l TProfile* profY = rhProfSub->ProfileY("profY", minm, maxm); TH1D* histY = ProfToHist(profY); TH1D* hist = new TH1D("temphist", "temphist", fNbinsPt, fbinsPt); - for (int ibin = 1; ibin < hist->GetNbinsX(); ibin++) { + for (int ibin = 1; ibin <= hist->GetNbinsX(); ibin++) { TString bLabel = rhProfSub->GetYaxis()->GetBinLabel(ibin + ybn1 - 1); hist->GetXaxis()->SetBinLabel(ibin, bLabel.Data()); hist->SetBinContent(ibin, histY->GetBinContent(ibin + ybn1 - 1)); diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index c540448709a..854fa50e9ca 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -572,6 +572,7 @@ struct FlowGenericFramework { registry.add("K0/hK0Eta", "", {HistType::kTH1D, {etaAxis}}); registry.add("K0/hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, ptAxis, nchAxis}}}); registry.add("K0/hK0s", "", {HistType::kTH1D, {singleCount}}); + registry.add("K0/hK0s_corrected", "", {HistType::kTH1D, {singleCount}}); registry.add("K0/hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{10, 0.5, 10.5}}}); registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCandidate, "K0 candidates"); @@ -602,6 +603,7 @@ struct FlowGenericFramework { registry.add("Lambda/hAntiLambdaEta", "", {HistType::kTH1D, {etaAxis}}); registry.add("Lambda/hAntiLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, ptAxis, nchAxis}}}); registry.add("Lambda/hLambdas", "", {HistType::kTH1D, {singleCount}}); + registry.add("Lambda/hLambdas_corrected", "", {HistType::kTH1D, {singleCount}}); registry.add("Lambda/hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{10, 0.5, 10.5}}}); registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCandidate, "Lambda candidates"); @@ -855,7 +857,7 @@ struct FlowGenericFramework { } LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.mEfficiency); } else { - std::vector species = {"ch", "pi", "ka", "pr", "k0", "lambda"}; + std::vector species = {"ch", "pi", "ka", "pr"}; for (const auto& sp : species) { cfg.mPIDEfficiencies.push_back(ccdb->getForTimeStamp(cfgEfficiency.value + "/" + sp, timestamp)); if (cfg.mPIDEfficiencies.back() == nullptr) @@ -1203,13 +1205,14 @@ struct FlowGenericFramework { template void fillOutputContainers(const float& centmult, const double& rndm, AcceptedTracks acceptedtracks) { - for (auto container : fFCpts) { + for (auto& container : fFCpts) { container->calculateCorrelations(); container->fillPtProfiles(centmult, rndm); container->fillCMProfiles(centmult, rndm); - if (!cfgUseGapMethod) - container->fillVnPtStdProfiles(centmult, rndm); } + if (!cfgUseGapMethod) + fFCpts[0]->fillVnPtStdProfiles(centmult, rndm); + for (uint l_ind = 0; l_ind < corrconfigs.size(); ++l_ind) { if (!corrconfigs.at(l_ind).pTDif) { auto dnx = fGFW->Calculate(corrconfigs.at(l_ind), 0, kTRUE).real(); @@ -1219,9 +1222,7 @@ struct FlowGenericFramework { if (std::abs(val) < 1) { (dt == kGen) ? fFCgen->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm) : fFC->FillProfile(corrconfigs.at(l_ind).Head.c_str(), centmult, val, dnx, rndm); if (cfgUseGapMethod) { - for (auto container : fFCpts) { - container->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); - } + fFCpts[0]->fillVnPtProfiles(centmult, val, dnx, rndm, o2::analysis::gfw::configs.GetpTCorrMasks()[l_ind]); } } continue; @@ -1235,8 +1236,8 @@ struct FlowGenericFramework { (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigs.at(l_ind).Head.c_str(), i), centmult, val, dnx, rndm); } } - float chtotal = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.total_uncorr; + double chtotal = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.total_uncorr; // calculate fractions std::vector> inputs = {acceptedtracks.nch, acceptedtracks.npi, acceptedtracks.nka, acceptedtracks.npr}; std::vector> fractions; @@ -1246,9 +1247,9 @@ struct FlowGenericFramework { fractions.emplace_back(); fractions.back().reserve(vec.size()); - float total = chtotal; + double total = chtotal; if (cfgUsePIDTotal) - (pidcounter) ? acceptedtracks.pidtotal[pidcounter] : chtotal; + total = (pidcounter) ? acceptedtracks.pidtotal[pidcounter - 1] : chtotal; if (total == 0.) { ++pidcounter; @@ -1259,6 +1260,7 @@ struct FlowGenericFramework { [&](double x) { return x / total; }); ++pidcounter; } + for (std::size_t i = 0; i < fractions[0].size(); ++i) registry.fill(HIST("npt_ch"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[0][i]); for (std::size_t i = 0; i < fractions[1].size(); ++i) @@ -1267,6 +1269,10 @@ struct FlowGenericFramework { registry.fill(HIST("npt_ka"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[2][i]); for (std::size_t i = 0; i < fractions[3].size(); ++i) registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[3][i]); + + if (corrconfigsradial.size() < 4) + return; + for (uint l_ind = 0; l_ind < 4; ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); @@ -1349,51 +1355,50 @@ struct FlowGenericFramework { // Process V0s for (const auto& v0 : v0s) { if (resoSwitchVals[K0][kUseParticle]) { - if (selectK0(collision, v0, centrality)) { + double weff = 1; + if (selectK0(collision, v0, centrality, weff)) { int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { if (v0.mK0Short() < cfgPIDCuts.cfgK0SignalMin) - npt_resonances[0][ptBinIndex] += getEfficiency(v0); + npt_resonances[0][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; else if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMax) - npt_resonances[2][ptBinIndex] += getEfficiency(v0); + npt_resonances[2][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; else - npt_resonances[1][ptBinIndex] += getEfficiency(v0); - registry.fill(HIST("K0/hK0s"), 1); + npt_resonances[1][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } // Add lambdabar if (resoSwitchVals[LAMBDA][kUseParticle]) { - if (selectLambda(collision, v0, centrality)) { + double weff = 1.; + if (selectLambda(collision, v0, centrality, weff)) { int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { if (v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMin) - npt_resonances[3][ptBinIndex] += getEfficiency(v0); + npt_resonances[3][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; else if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMax) - npt_resonances[5][ptBinIndex] += getEfficiency(v0); + npt_resonances[5][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; else - npt_resonances[4][ptBinIndex] += getEfficiency(v0); - registry.fill(HIST("Lambda/hLambdas"), 1); + npt_resonances[4][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } } - float chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.total_uncorr; + double chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.total_uncorr; // calculate fractions std::vector> fractions_resonances = npt_resonances; int pidcounter = 0; - for (const auto& vec : fractions_resonances) { - float total = chtotal; + for (auto& vec : fractions_resonances) { + double total = chtotal; if (cfgUsePIDTotal) - (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0) : chtotal; + total = (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0.f) : chtotal; if (total == 0.) { ++pidcounter; continue; } - std::transform(vec.begin(), vec.end(), - std::back_inserter(fractions_resonances.back()), - [&](double x) { return x / total; }); + std::transform(vec.begin(), vec.end(), vec.begin(), + [&](float x) { return x / total; }); ++pidcounter; } for (std::size_t i = 0; i < fractions_resonances[0].size(); ++i) @@ -1408,6 +1413,7 @@ struct FlowGenericFramework { registry.fill(HIST("npt_Lambda_sb2"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[5][i]); for (std::size_t i = 0; i < fractions_resonances[4].size(); ++i) registry.fill(HIST("npt_Lambda_sig"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[4][i]); + for (uint l_ind = 4; l_ind < corrconfigsradial.size(); ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); @@ -1458,8 +1464,10 @@ struct FlowGenericFramework { if (!nchSelected(track)) return; + double weffCh = getEfficiency(track, 0); if (std::abs(track.eta()) < cfgEtaNch) { - acceptedTracks.total += getEfficiency(track, 0); + if (weffCh > 0) + acceptedTracks.total += weffCh; ++acceptedTracks.total_uncorr; } @@ -1477,18 +1485,21 @@ struct FlowGenericFramework { } if (std::abs(track.eta()) < cfgEtaNch) { - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track, pidIndex); + double weff = getEfficiency(track, pidIndex); + + if (pidIndex && weff > 0) + acceptedTracks.pidtotal[pidIndex - 1] += weff; int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, 0) : 1.0; - if (pidIndex == 1) - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; - if (pidIndex == 2) - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; - if (pidIndex == 3) - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (weffCh > 0) + acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; + if (pidIndex == 1 && weff > 0) + acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (pidIndex == 2 && weff > 0) + acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (pidIndex == 3 && weff > 0) + acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } @@ -1557,8 +1568,10 @@ struct FlowGenericFramework { if (!nchSelected(track)) return; + double weffCh = getEfficiency(track, 0); if (std::abs(track.eta()) < cfgEtaNch) { - acceptedTracks.total += getEfficiency(track, 0); + if (weffCh > 0) + acceptedTracks.total += (cfgUseNchCorrection) ? weffCh : 1.0; ++acceptedTracks.total_uncorr; } @@ -1569,23 +1582,23 @@ struct FlowGenericFramework { int pidIndex = getNsigmaPID(track); if (std::abs(track.eta()) < cfgEtaNch) { - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track, pidIndex); + double weff = getEfficiency(track, pidIndex); + if (pidIndex && weff > 0) + acceptedTracks.pidtotal[pidIndex - 1] += weff; - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += getEfficiency(track); int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, 0) : 1.0; - if (pidIndex == 1) { - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (weffCh > 0) + acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; + if (pidIndex == 1 && weff > 0) { + acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } - if (pidIndex == 2) { - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (pidIndex == 2 && weff > 0) { + acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } - if (pidIndex == 3) { - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? getEfficiency(track, pidIndex) : 1.0; + if (pidIndex == 3 && weff > 0) { + acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; } } } @@ -1636,7 +1649,7 @@ struct FlowGenericFramework { } template - bool selectK0(TCollision const& collision, TV0 const& v0, const double& centrality) + bool selectK0(TCollision const& collision, TV0 const& v0, const double& centrality, double& weff) { double mass_K0s = v0.mK0Short(); @@ -1686,11 +1699,20 @@ struct FlowGenericFramework { registry.fill(HIST("K0/PiMinusTPC_K0"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("K0/PiMinusTOF_K0"), negtrack.pt(), negtrack.tofNSigmaKa()); + registry.fill(HIST("K0/hK0s"), 1); + if (cfgUsePIDEfficiencies) { + double weff_d1 = getEfficiency(postrack, 1); + double weff_d2 = getEfficiency(negtrack, 1); + weff = weff_d1 * weff_d2; + if (weff > 0) + registry.fill(HIST("K0/hK0s_corrected"), weff); + } + return true; } template - bool selectLambda(TCollision const& collision, TV0 const& v0, const double& centrality) + bool selectLambda(TCollision const& collision, TV0 const& v0, const double& centrality, double& weff) { bool isL = false; // Is lambda candidate bool isAL = false; // Is anti-lambda candidate @@ -1764,6 +1786,15 @@ struct FlowGenericFramework { registry.fill(HIST("Lambda/PrPlusTOF_L"), postrack.pt(), postrack.tofNSigmaKa()); registry.fill(HIST("Lambda/PiMinusTPC_L"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("Lambda/PiMinusTOF_L"), negtrack.pt(), negtrack.tofNSigmaKa()); + + registry.fill(HIST("Lambda/hLambdas"), 1); + if (cfgUsePIDEfficiencies) { + double weff_d1 = getEfficiency(postrack, 3); + double weff_d2 = getEfficiency(negtrack, 1); + weff = weff_d1 * weff_d2; + if (weff > 0) + registry.fill(HIST("Lambda/hLambdas_corrected"), weff); + } } if (isAL) { registry.fill(HIST("Lambda/hAntiLambdaMass_sparse"), mantilambda, v0.pt(), centrality); @@ -1773,6 +1804,15 @@ struct FlowGenericFramework { registry.fill(HIST("Lambda/PiPlusTOF_AL"), postrack.pt(), postrack.tofNSigmaKa()); registry.fill(HIST("Lambda/PrMinusTPC_AL"), negtrack.pt(), negtrack.tpcNSigmaKa()); registry.fill(HIST("Lambda/PrMinusTOF_AL"), negtrack.pt(), negtrack.tofNSigmaKa()); + + registry.fill(HIST("Lambda/hLambdas"), 1); + if (cfgUsePIDEfficiencies) { + double weff_d1 = getEfficiency(postrack, 1); + double weff_d2 = getEfficiency(negtrack, 3); + weff = weff_d1 * weff_d2; + if (weff > 0) + registry.fill(HIST("Lambda/hLambdas_corrected"), weff); + } } return true; } @@ -1808,25 +1848,22 @@ struct FlowGenericFramework { bool withinPtNch = (track.pt() > ptmins[0] && track.pt() < ptmaxs[0]); if (!withinPtPOI && !withinPtRef) return; - double weff = (dt == kGen) ? 1. : getEfficiency(track, pid_index); - double weffInclusive = (dt == kGen) ? 1. : getEfficiency(track, 0); - if (weff < 0) - return; + double waccRef = (dt == kGen) ? 1. : getAcceptance(track, vtxz, 0); double waccPOI = (dt == kGen) ? 1. : withinPtPOI ? getAcceptance(track, vtxz, pid_index + 1) : getAcceptance(track, vtxz, 0); // if (withinPtRef && withinPtPOI && pid_index) waccRef = waccPOI; // if particle is both (then it's overlap), override ref with POI if (withinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccRef * weffInclusive, 1); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccRef, 1); if (withinPtPOI && pid_index) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff, (1 << (pid_index + 1))); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, (1 << (pid_index + 1))); if (withinPtNch) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff * weffInclusive, 2); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, 2); if (withinPtPOI && withinPtRef && pid_index) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff, (1 << (pid_index + 5))); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, (1 << (pid_index + 5))); if (withinPtNch && withinPtRef) - fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI * weff * weffInclusive, 32); + fGFW->Fill(track.eta(), fPtAxis->FindBin(track.pt()) - 1, track.phi(), waccPOI, 32); } else { // Analysing only integrated flow bool withinPtRef = (track.pt() > o2::analysis::gfw::ptreflow && track.pt() < o2::analysis::gfw::ptrefup); bool withinPtPOI = (track.pt() > o2::analysis::gfw::ptpoilow && track.pt() < o2::analysis::gfw::ptpoiup); diff --git a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx index 395cd59148b..34d145524cd 100644 --- a/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGfwV02.cxx @@ -158,11 +158,12 @@ struct FlowGfwV02 { } cfgTrackCuts; struct : ConfigurableGroup { - ConfigurableAxis cfgAxisPt{"cfgPIDHistograms_cfgAxisPt", {VARIABLE_WIDTH, 0.2f, 0.5f, 1.f, 1.5f, 2.f, 3.f, 4.f, 6.f, 10.f}, "pt axis for histograms"}; - ConfigurableAxis cfgAxisNsigmaTPC{"cfgPIDHistograms_cfgAxisNsigmaTPC", {80, -5.f, 5.f}, "nsigmaTPC axis"}; - ConfigurableAxis cfgAxisNsigmaTOF{"cfgPIDHistograms_cfgAxisNsigmaTOF", {80, -5.f, 5.f}, "nsigmaTOF axis"}; - ConfigurableAxis cfgAxisNsigmaITS{"cfgPIDHistograms_cfgAxisNsigmaITS", {80, -5.f, 5.f}, "nsigmaITS axis"}; - ConfigurableAxis cfgAxisTpcSignal{"cfgPIDHistograms_cfgAxisTpcSignal", {250, 0.f, 250.f}, "dEdx axis for TPC"}; + ConfigurableAxis cfgAxisPt{"cfgAxisPt", {VARIABLE_WIDTH, 0.2f, 0.5f, 1.f, 1.5f, 2.f, 3.f, 4.f, 6.f, 10.f}, "pt axis for histograms"}; + ConfigurableAxis cfgAxisNsigmaTPC{"cfgAxisNsigmaTPC", {80, -5.f, 5.f}, "nsigmaTPC axis"}; + ConfigurableAxis cfgAxisNsigmaTOF{"cfgAxisNsigmaTOF", {80, -5.f, 5.f}, "nsigmaTOF axis"}; + ConfigurableAxis cfgAxisNsigmaITS{"cfgAxisNsigmaITS", {80, -5.f, 5.f}, "nsigmaITS axis"}; + ConfigurableAxis cfgAxisTpcSignal{"cfgAxisTpcSignal", {250, 0.f, 250.f}, "dEdx axis for TPC"}; + ConfigurableAxis cfgAxisSigma{"cfgAxisSigma", {200, 0, 20}, "sigma axis for TPC"}; } cfgPIDHistograms; // GFW binning @@ -315,15 +316,15 @@ struct FlowGfwV02 { registry.add("QA_PID/before/TofTpcNsigma_protons", "", {HistType::kTHnSparseD, {cfgPIDHistograms.cfgAxisNsigmaTPC, cfgPIDHistograms.cfgAxisNsigmaTOF, cfgPIDHistograms.cfgAxisPt}}); } - registry.add("QA_PID/before/TpcdEdx_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpTpcdEdx_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpSigma_ptwise_pions", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/TpcdEdx_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpTpcdEdx_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpSigma_ptwise_kaons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/TpcdEdx_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpTpcdEdx_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); - registry.add("QA_PID/before/ExpSigma_ptwise_protons", "", {HistType::kTH2D, {cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisPt}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_pions", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_pions", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpSigma_ptwise_pions", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisSigma, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_kaons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_kaons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpSigma_ptwise_kaons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisSigma, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/TpcdEdx_ptwise_protons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpTpcdEdx_ptwise_protons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisTpcSignal, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); + registry.add("QA_PID/before/ExpSigma_ptwise_protons", "", {HistType::kTHnSparseD, {{cfgPIDHistograms.cfgAxisPt, cfgPIDHistograms.cfgAxisSigma, cfgPIDHistograms.cfgAxisNsigmaTOF}}}); registry.addClone("QA_PID/before/", "QA_PID/after/"); } @@ -1006,7 +1007,7 @@ struct FlowGfwV02 { if (!withinPtPOI && !withinPtRef) return; - double weff = getJTrackEfficiency(track); + double weff = getEfficiency(track, PidCharged); if (weff < 0) return; diff --git a/PWGCF/Tasks/correlations.cxx b/PWGCF/Tasks/correlations.cxx index 6044510a562..0460b80886f 100644 --- a/PWGCF/Tasks/correlations.cxx +++ b/PWGCF/Tasks/correlations.cxx @@ -109,6 +109,7 @@ struct CorrelationTask { O2_DEFINE_CONFIGURABLE(cfgPtDepMLbkg, std::vector, {}, "pT interval for ML training") O2_DEFINE_CONFIGURABLE(cfgPtCentDepMLbkgSel, std::vector, {}, "Bkg ML selection") + O2_DEFINE_CONFIGURABLE(cfgPtCentDepMLpromptSel, std::vector, {}, "Prompt ML selection") ConfigurableAxis axisVertex{"axisVertex", {7, -7, 7}, "vertex axis for histograms"}; ConfigurableAxis axisDeltaPhi{"axisDeltaPhi", {72, -PIHalf, PIHalf * 3}, "delta phi axis for histograms"}; @@ -174,8 +175,14 @@ struct CorrelationTask { void init(o2::framework::InitContext&) { - if ((doprocessSame2ProngDerivedML || doprocessSame2Prong2ProngML || doprocessMixed2ProngDerivedML || doprocessMixed2Prong2ProngML) && (cfgPtDepMLbkg->empty() || cfgPtCentDepMLbkgSel->empty())) - LOGF(fatal, "cfgPtDepMLbkg or cfgPtCentDepMLbkgSel can not be empty when ML 2-prong selections are used."); + if (doprocessSame2ProngDerivedML || doprocessSame2Prong2ProngML || doprocessMixed2ProngDerivedML || doprocessMixed2Prong2ProngML || doprocessMCEfficiency2ProngML || doprocessMCReflection2ProngML) { + if (cfgPtDepMLbkg->empty() || cfgPtCentDepMLbkgSel->empty()) + LOGF(fatal, "cfgPtDepMLbkg or cfgPtCentDepMLbkgSel can not be empty when ML 2-prong selections are used."); + if (cfgPtDepMLbkg->size() != cfgPtCentDepMLbkgSel->size()) + LOGF(fatal, "cfgPtDepMLbkg and cfgPtCentDepMLbkgSel must be same size."); + if (!cfgPtCentDepMLpromptSel->empty() && cfgPtCentDepMLpromptSel->size() != cfgPtDepMLbkg->size()) + LOGF(fatal, "cfgPtDepMLbkg and cfgPtCentDepMLpromptSel must be same size."); + } registry.add("yields", "multiplicity/centrality vs pT vs eta", {HistType::kTH3F, {{100, 0, 100, "/multiplicity/centrality"}, {40, 0, 20, "p_{T}"}, {100, -2, 2, "#eta"}}}); registry.add("etaphi", "multiplicity/centrality vs eta vs phi", {HistType::kTH3F, {{100, 0, 100, "multiplicity/centrality"}, {100, -2, 2, "#eta"}, {200, 0, o2::constants::math::TwoPI, "#varphi"}}}); if (doprocessSame2ProngDerived || doprocessSame2ProngDerivedML || doprocessSame2Prong2Prong || doprocessSame2Prong2ProngML || doprocessMCSameDerived2Prong) { @@ -326,7 +333,15 @@ struct CorrelationTask { { auto it = std::lower_bound(cfgPtDepMLbkg->begin(), cfgPtDepMLbkg->end(), track.pt()); int idx = std::distance(cfgPtDepMLbkg->begin(), it) - 1; - return !((track.decay() == 0 && track.mlProbD0()[0] > cfgPtCentDepMLbkgSel->at(idx)) || (track.decay() == 1 && track.mlProbD0bar()[0] > cfgPtCentDepMLbkgSel->at(idx))); + return (track.decay() != aod::cf2prongtrack::D0ToPiK || + (track.mlProbD0()[0] < cfgPtCentDepMLbkgSel->at(idx) && // not background + (cfgPtCentDepMLpromptSel->empty() || + track.mlProbD0()[1] > cfgPtCentDepMLpromptSel->at(idx)))) && // prompt + + ((track.decay() != aod::cf2prongtrack::D0barToKPi && track.decay() != aod::cf2prongtrack::D0barToKPiExclusive) || + (track.mlProbD0bar()[0] < cfgPtCentDepMLbkgSel->at(idx) && // not background + (cfgPtCentDepMLpromptSel->empty() || + track.mlProbD0bar()[1] > cfgPtCentDepMLpromptSel->at(idx)))); // prompt } template @@ -571,7 +586,7 @@ struct CorrelationTask { } if constexpr (std::experimental::is_detected::value) { - if (((track1.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (track1.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (track1.decay() & aod::cf2prongmcpart::Prompt) == 0) + if (((track1.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (track1.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (!cfgPtCentDepMLpromptSel->empty() && (track1.decay() & aod::cf2prongmcpart::Prompt) == 0)) continue; } else if constexpr (std::experimental::is_detected::value) { if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track1.decay()))) == 0u) { @@ -654,7 +669,7 @@ struct CorrelationTask { // If decay attributes are found for the second track/particle, we assume 2p-2p correlation if constexpr (std::experimental::is_detected::value) { - if ((((track2.mcDecay()) != aod::cf2prongtrack::D0ToPiK) && ((track2.mcDecay()) != aod::cf2prongtrack::D0barToKPiExclusive)) || (track2.decay() & aod::cf2prongmcpart::Prompt) == 0) + if ((((track2.mcDecay()) != aod::cf2prongtrack::D0ToPiK) && ((track2.mcDecay()) != aod::cf2prongtrack::D0barToKPiExclusive)) || (!cfgPtCentDepMLpromptSel->empty() && (track2.decay() & aod::cf2prongmcpart::Prompt) == 0)) continue; } else if constexpr (std::experimental::is_detected::value) { if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast(track2.decay()))) == 0u) { @@ -1196,8 +1211,12 @@ struct CorrelationTask { p2indexCache.clear(); for (const auto& mcParticle : mcParticles) { if (std::find(cfgMcTriggerPDGs->begin(), cfgMcTriggerPDGs->end(), mcParticle.pdgCode()) != cfgMcTriggerPDGs->end()) { - if (((mcParticle.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (mcParticle.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) || (mcParticle.decay() & aod::cf2prongmcpart::Prompt) == 0) + if ((mcParticle.mcDecay() != aod::cf2prongtrack::D0ToPiK) && (mcParticle.mcDecay() != aod::cf2prongtrack::D0barToKPiExclusive)) continue; // wrong decay channel + if constexpr (!reflectionSpec) { + if (!cfgPtCentDepMLpromptSel->empty() && (mcParticle.decay() & aod::cf2prongmcpart::Prompt) == 0) + continue; + } if (mcParticle.cfParticleDaugh0Id() < 0 && mcParticle.cfParticleDaugh1Id() < 0) continue; // daughters not found if constexpr (!reflectionSpec) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx index 6c6e7464216..1497bf7520e 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/corrSparse.cxx @@ -100,7 +100,7 @@ struct CorrSparse { O2_DEFINE_CONFIGURABLE(processFT0A, bool, true, "Process FT0A correlations") O2_DEFINE_CONFIGURABLE(processFT0C, bool, true, "Process FT0C correlations") O2_DEFINE_CONFIGURABLE(processMFT, bool, true, "Process MFT correlations") - O2_DEFINE_CONFIGURABLE(withGain, bool, true, "Use gain for FT0A and FT0C") + O2_DEFINE_CONFIGURABLE(withGain, bool, false, "Use gain for FT0A and FT0C") } cfgDetectorConfig; @@ -216,6 +216,7 @@ struct CorrSparse { ConfigurableAxis axisDeltaEtaMftFt0c{"axisDeltaEtaMFTFT0C", {48, -2.0, 0.6}, "delta eta axis for MFT-FT0C histograms"}; ConfigurableAxis axisDeltaEtaMftFt0a{"axisDeltaEtaMFTFT0A", {48, -8.5, -5.9}, "delta eta axis for MFT-FT0A histograms"}; ConfigurableAxis axisDeltaEtaMftFv0{"axisDeltaEtaMFTFV0", {48, -8.6, -4.7}, "delta eta axis for MFT-FV0 histograms"}; + ConfigurableAxis axisDeltaEtaFt0s{"axisDeltaEtaFT0S", {48, -8.6, 5.0}, "delta eta axis for FT0S histograms"}; ConfigurableAxis axisPtTrigger{"axisPtTrigger", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt trigger axis for histograms"}; ConfigurableAxis axisPtAssoc{"axisPtAssoc", {VARIABLE_WIDTH, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0, 10.0}, "pt associated axis for histograms"}; @@ -343,7 +344,7 @@ struct CorrSparse { LOGF(info, "Starting init"); // Event Counter - if ((doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || doprocessSameMftReassociated2DFIT) && cfgUseAdditionalEventCut) { + if ((doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) && cfgUseAdditionalEventCut) { registry.add("hEventCountSpecific", "Number of Event;; Count", {HistType::kTH1D, {{13, 0, 13}}}); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(1, "after sel8"); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(2, "kNoSameBunchPileup"); @@ -360,7 +361,7 @@ struct CorrSparse { registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(13, "cfgEvSelV0AT0ACut"); } - if (doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || doprocessSameMftReassociated2DFIT) { + if (doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT) { registry.add("hEventCountMftReassoc", "Number of Events;; Count", {HistType::kTH1D, {{4, 0, 4}}}); registry.get(HIST("hEventCountMftReassoc"))->GetXaxis()->SetBinLabel(1, "all MFT tracks"); registry.get(HIST("hEventCountMftReassoc"))->GetXaxis()->SetBinLabel(2, "MFT tracks after selection"); @@ -373,12 +374,12 @@ struct CorrSparse { } // Make histograms to check the distributions after cuts - if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D || doprocessSameMftReassociated2DFIT) { + if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameMFTFIT || doprocessSameTpcMftReassociated2D || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) { registry.add("Phi", "Phi", {HistType::kTH1D, {axisPhi}}); if (doprocessSameMFTFIT) { registry.add("Eta", "EtaMFT", {HistType::kTH1D, {axisEtaMft}}); } - if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D) { + if (doprocessSameTpcFIT || doprocessSameTpcMft || doprocessSameTPC || doprocessSameTpcMftReassociated2D) { registry.add("Eta", "Eta", {HistType::kTH1D, {axisEta}}); } registry.add("EtaCorrected", "EtaCorrected", {HistType::kTH1D, {axisEta}}); @@ -389,7 +390,7 @@ struct CorrSparse { registry.add("zVtx", "zVtx", {HistType::kTH1D, {axisVertex}}); registry.add("zVtx_used", "zVtx_used", {HistType::kTH1D, {axisVertex}}); - if (doprocessSameTpcFIT || doprocessSameMFTFIT || doprocessSameMftReassociated2DFIT) { + if (doprocessSameTpcFIT || doprocessSameMFTFIT || doprocessSameMftReassociated2DFIT || doprocessSameFT0s) { registry.add("FT0Amp", "", {HistType::kTH2F, {axisChID, axisFit}}); registry.add("FV0Amp", "", {HistType::kTH2F, {axisChID, axisFit}}); registry.add("FT0AmpCorrect", "", {HistType::kTH2F, {axisChID, axisFit}}); @@ -446,7 +447,7 @@ struct CorrSparse { } } - if (doprocessSameTpcMft || doprocessSameTpcMftReassociated2D || doprocessSameTpcMftReassociated3D) { + if (doprocessSameTpcMft || doprocessSameTpcMftReassociated2D) { registry.add("deltaEta_deltaPhi_same_TPC_MFT", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcMft}}); // check to see the delta eta and delta phi distribution registry.add("deltaEta_deltaPhi_mixed_TPC_MFT", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcMft}}); registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); @@ -458,6 +459,12 @@ struct CorrSparse { registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); } + if (doprocessSameFT0s) { + registry.add("deltaEta_deltaPhi_same_FT0A_FT0C", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaFt0s}}); // check to see the delta eta and delta phi distribution + registry.add("deltaEta_deltaPhi_mixed_FT0A_FT0C", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaFt0s}}); + registry.add("Trig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtTrigger}}}); + } + registry.add("eventcount", "bin", {HistType::kTH1F, {{4, 0, 4, "bin"}}}); // histogram to see how many events are in the same and mixed event LOGF(info, "Initializing correlation container"); @@ -528,6 +535,13 @@ struct CorrSparse { {axisDeltaPhi, "#Delta#varphi (rad)"}, {axisDeltaEtaMftFv0, "#Delta#eta"}}; + std::vector corrAxisFT0s = {{axisSample, "Sample"}, + {axisVertex, "z-vtx (cm)"}, + {axisPtTrigger, "p_{T} (GeV/c)"}, + {axisPtAssoc, "p_{T} (GeV/c)"}, + {axisDeltaPhi, "#Delta#varphi (rad)"}, + {axisDeltaEtaFt0s, "#Delta#eta"}}; + if (doprocessSameTpcFIT) { if (cfgDetectorConfig.processFT0A) { same.setObject(new CorrelationContainer("sameEvent_TPC_FT0A", "sameEvent_TPC_FT0A", corrAxisTpcFt0a, effAxis, userAxis)); @@ -588,9 +602,9 @@ struct CorrSparse { mixed.setObject(new CorrelationContainer("mixedEvent_TPC_MFT_Reassociated2D", "mixedEvent_TPC_MFT_Reassociated2D", corrAxisTpcMft, effAxis, userAxis)); } - if (doprocessSameTpcMftReassociated3D) { - same.setObject(new CorrelationContainer("sameEvent_TPC_MFT_Reassociated3D", "sameEvent_TPC_MFT_Reassociated3D", corrAxisTpcMft, effAxis, userAxis)); - mixed.setObject(new CorrelationContainer("mixedEvent_TPC_MFT_Reassociated3D", "mixedEvent_TPC_MFT_Reassociated3D", corrAxisTpcMft, effAxis, userAxis)); + if (doprocessSameFT0s) { + same.setObject(new CorrelationContainer("sameEvent_FT0A_FT0C", "sameEvent_FT0A_FT0C", corrAxisTpcFt0c, effAxis, userAxis)); + mixed.setObject(new CorrelationContainer("mixedEvent_FT0A_FT0C", "mixedEvent_FT0A_FT0C", corrAxisTpcFt0c, effAxis, userAxis)); } LOGF(info, "End of init"); } @@ -771,7 +785,7 @@ struct CorrSparse { auto theta = std::atan2(r, z); return -std::log(std::tan(0.5 * theta)); } - // checks if it is an accepted mft track + template bool isAcceptedMftTrack(TTrack const& mftTrack) { @@ -1493,6 +1507,64 @@ struct CorrSparse { } } + template + void fillCorrelationsFT0s(TFT0s const& ft01, TFT0s const& ft02, float posZ, int multiplicity, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + { + int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); + + if (cfgQaCheck) { + if (system == SameEvent) { + registry.fill(HIST("zVtx_used"), posZ); + registry.fill(HIST("Nch"), multiplicity); + registry.fill(HIST("Nch_used_ft0c"), ft02.channelC().size()); + registry.fill(HIST("Nch_used_ft0a"), ft01.channelA().size()); + } + } + + float triggerWeight = 1.0f; + std::size_t channelASize = ft01.channelA().size(); + std::size_t channelCSize = ft02.channelC().size(); + // loop over all tracks + for (std::size_t iChA = 0; iChA < channelASize; iChA++) { + + int chanelAid = 0; + float amplA = 0.; + if (cfgDetectorConfig.withGain) { + getChannelWithGain(ft01, iChA, chanelAid, amplA, kFT0A); + } else { + getChannelFT0(ft01, iChA, chanelAid, amplA, kFT0A); + } + auto phiA = getPhiFT0(chanelAid, kFT0A); + auto etaA = getEtaFT0(chanelAid, kFT0A); + + if (system == SameEvent) { + registry.fill(HIST("Trig_hist"), fSampleIndex, posZ, 0.5, eventWeight * amplA); + } + + for (std::size_t iChC = 0; iChC < channelCSize; iChC++) { + int chanelCid = 0; + float amplC = 0.; + if (cfgDetectorConfig.withGain) { + getChannelWithGain(ft02, iChC, chanelCid, amplC, kFT0C); + } else { + getChannelFT0(ft02, iChC, chanelCid, amplC, kFT0C); + } + auto phiC = getPhiFT0(chanelCid, kFT0C); + auto etaC = getEtaFT0(chanelCid, kFT0C); + float deltaPhi = RecoDecay::constrainAngle(phiA - phiC, -PIHalf); + float deltaEta = etaA - etaC; + + // fill the right sparse and histograms + if (system == SameEvent) { + registry.fill(HIST("deltaEta_deltaPhi_same_FT0A_FT0C"), deltaPhi, deltaEta, amplA * amplC * eventWeight * triggerWeight); + same->getPairHist()->Fill(step, fSampleIndex, posZ, 0.5, 0.5, deltaPhi, deltaEta, amplA * amplC * eventWeight * triggerWeight); + } else if (system == MixedEvent) { + registry.fill(HIST("deltaEta_deltaPhi_mixed_FT0A_FT0C"), deltaPhi, deltaEta, amplA * amplC * eventWeight * triggerWeight); + mixed->getPairHist()->Fill(step, fSampleIndex, posZ, 0.5, 0.5, deltaPhi, deltaEta, amplA * amplC * eventWeight * triggerWeight); + } + } + } + } ////////////////////////////////////// ////// Same event processing ///////// ////////////////////////////////////// @@ -1740,29 +1812,37 @@ struct CorrSparse { } PROCESS_SWITCH(CorrSparse, processSameTpcMftReassociated2D, "Process same event for TPC-MFT correlation with reassociated tracks", false); - void processSameTpcMftReassociated3D(AodCollisions::iterator const& collision, AodTracks const& tracks, - soa::SmallGroups const& reassociatedMftTracks, - aod::BCsWithTimestamps const&) + void processSameFT0s(AodCollisions::iterator const& collision, AodTracks const& tracks, aod::FT0s const&, aod::BCsWithTimestamps const&) { if (!collision.sel8()) return; + auto bc = collision.bc_as(); - if (cfgUseAdditionalEventCut && !eventSelected(collision, tracks.size(), true)) + if (cfgUseAdditionalEventCut && !eventSelected(collision, 0, true)) return; - registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin + if (!collision.has_foundFT0()) + return; + + loadAlignParam(bc.timestamp()); + if (cfgDetectorConfig.withGain) { + loadGain(bc); + } loadCorrection(bc.timestamp()); - fillYield(collision, tracks); - if (tracks.size() < cfgEventSelection.cfgMinMult || tracks.size() >= cfgEventSelection.cfgMaxMult) { + if ((tracks.size() < cfgEventSelection.cfgMinMult || tracks.size() >= cfgEventSelection.cfgMaxMult)) { return; } - fillCorrelationsMftReassociatedTracks(tracks, reassociatedMftTracks, tracks.size(), collision.posZ(), SameEvent, getMagneticField(bc.timestamp()), false); - } - PROCESS_SWITCH(CorrSparse, processSameTpcMftReassociated3D, "Process same event for TPC-MFT correlation with reassociated tracks", false); + registry.fill(HIST("eventcount"), SameEvent); // because its same event i put it in the 1 bin + + const auto& ft0s = collision.foundFT0(); + auto multiplicity = tracks.size(); + fillCorrelationsFT0s(ft0s, ft0s, collision.posZ(), multiplicity, SameEvent, 1.0f); + } + PROCESS_SWITCH(CorrSparse, processSameFT0s, "Process same event for FT0 correlation", false); //////////////////////////////////// ////// Mixed event processing ////// //////////////////////////////////// @@ -1983,6 +2063,57 @@ struct CorrSparse { } } PROCESS_SWITCH(CorrSparse, processMixedTpcMFT, "Process mixed events for TPC-MFT correlation", false); + + void processMixedFT0s(AodCollisions const& collisions, AodTracks const& tracks, aod::FT0s const&, aod::BCsWithTimestamps const&) + { + + auto getTracksSize = [&tracks, this](AodCollisions::iterator const& collision) { + auto associatedTracks = tracks.sliceByCached(o2::aod::track::collisionId, collision.globalIndex(), this->cache); + auto mult = associatedTracks.size(); + return mult; + }; + + using MixedBinning = FlexibleBinningPolicy, aod::collision::PosZ, decltype(getTracksSize)>; + + MixedBinning binningOnVtxAndMult{{getTracksSize}, {vtxMix, multMix}, true}; + + auto tracksTuple = std::make_tuple(tracks, tracks); + Pair pair{binningOnVtxAndMult, cfgMinMixEventNum, -1, collisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + + for (auto it = pair.begin(); it != pair.end(); it++) { + auto& [collision1, tracks1, collision2, tracks2] = *it; + + if (!collision1.sel8() || !collision2.sel8()) + continue; + + if (collision1.globalIndex() == collision2.globalIndex()) { + continue; + } + + if ((tracks1.size() < cfgEventSelection.cfgMinMult || tracks1.size() >= cfgEventSelection.cfgMaxMult)) + continue; + + if (cfgUseAdditionalEventCut && !eventSelected(collision1, tracks1.size(), false)) + continue; + if (cfgUseAdditionalEventCut && !eventSelected(collision2, tracks2.size(), false)) + continue; + + if (!(collision1.has_foundFT0() && collision2.has_foundFT0())) + continue; + + registry.fill(HIST("eventcount"), MixedEvent); // fill the mixed event in the 3 bin + auto bc = collision1.bc_as(); + loadAlignParam(bc.timestamp()); + loadCorrection(bc.timestamp()); + + auto multiplicity = tracks1.size(); + + const auto& ft0_1 = collision1.foundFT0(); + const auto& ft0_2 = collision2.foundFT0(); + fillCorrelationsFT0s(ft0_1, ft0_2, collision1.posZ(), multiplicity, MixedEvent, 1.0f); + } + } + PROCESS_SWITCH(CorrSparse, processMixedFT0s, "Process mixed events for FT0 correlation", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx index 89bb63cc0cd..692a6583f5c 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/flowDecorrelation.cxx @@ -100,13 +100,24 @@ struct FlowDecorrelation { O2_DEFINE_CONFIGURABLE(cfgLocalEfficiency, bool, false, "Use local efficiency object") O2_DEFINE_CONFIGURABLE(cfgUseEventWeights, bool, false, "Use event weights for mixed event") O2_DEFINE_CONFIGURABLE(cfgDrawEtaPhiDis, bool, false, "draw eta-phi distribution for detectors in used") - O2_DEFINE_CONFIGURABLE(nClustersMftTrack, int, 5, "Minimum number of clusters for MFT track") - O2_DEFINE_CONFIGURABLE(cfgCutChi2Mft, float, -1.0f, "max chi2 of MFT track") - O2_DEFINE_CONFIGURABLE(cfgCutTrackTimeMft, float, -1.0f, "max deviation of MFT track wrt. bc in ns") - O2_DEFINE_CONFIGURABLE(cfgRejectFT0AInside, bool, false, "Rejection of inner ring channels of the FT0A detector") - O2_DEFINE_CONFIGURABLE(cfgRejectFT0AOutside, bool, false, "Rejection of outer ring channels of the FT0A detector") - O2_DEFINE_CONFIGURABLE(cfgRejectFT0CInside, bool, false, "Rejection of inner ring channels of the FT0C detector") - O2_DEFINE_CONFIGURABLE(cfgRejectFT0COutside, bool, false, "Rejection of outer ring channels of the FT0C detector") + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(nClustersMftTrack, int, 5, "Minimum number of clusters for MFT track") + O2_DEFINE_CONFIGURABLE(cfgCutChi2Mft, float, -1.0f, "max chi2 of MFT track") + O2_DEFINE_CONFIGURABLE(cfgCutTrackTimeMft, float, -1.0f, "max deviation of MFT track wrt. bc in ns"); + } cfgMftCuts; + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(cfgRejectFT0AInside, bool, false, "Rejection of inner ring channels of the FT0A detector") + O2_DEFINE_CONFIGURABLE(cfgRejectFT0AOutside, bool, false, "Rejection of outer ring channels of the FT0A detector") + O2_DEFINE_CONFIGURABLE(cfgRejectFT0CInside, bool, false, "Rejection of inner ring channels of the FT0C detector") + O2_DEFINE_CONFIGURABLE(cfgRejectFT0COutside, bool, false, "Rejection of outer ring channels of the FT0C detector"); + } cfgFt0RingRejections; + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(cfgEtaTpcCut, float, 0.8f, "Eta cut of TPC MC particles") + O2_DEFINE_CONFIGURABLE(cfgMinEtaFt0cCut, float, -3.4f, "Min eta cut of FT0C MC particles") + O2_DEFINE_CONFIGURABLE(cfgMaxEtaFt0cCut, float, -2.0f, "Max eta cut of FT0C MC particles") + O2_DEFINE_CONFIGURABLE(cfgUseFt0cStructure, bool, true, "Use the true structure of FT0C in MC-true"); + O2_DEFINE_CONFIGURABLE(cfgUseCFStepAll, bool, true, "Use CFStepAll in addition to primry"); + } cfgMcTrue; struct : ConfigurableGroup { O2_DEFINE_CONFIGURABLE(cfgMultCentHighCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x + 10.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut"); O2_DEFINE_CONFIGURABLE(cfgMultCentLowCutFunction, std::string, "[0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x - 3.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)", "Functional for multiplicity correlation cut"); @@ -147,8 +158,8 @@ struct FlowDecorrelation { ConfigurableAxis axisDeltaEtaTpcFt0c{"axisDeltaEtaTpcFt0c", {32, 1.2, 4.2}, "delta eta axis, 1.2~4.2 for TPC-FT0C"}; ConfigurableAxis axisDeltaEtaFt0aFt0c{"axisDeltaEtaFt0aFt0c", {32, 4.2, 8.2}, "delta eta axis, 4.2~8.2 for FT0A-FT0C"}; ConfigurableAxis axisDeltaEtaTpcMft{"axisDeltaEtaTpcMft", {32, 1.3, 4.8}, "delta eta axis, 1.3~4.8 for TPC-MFT"}; - ConfigurableAxis axisDeltaEtaTpcFv0{"axisDeltaEtaTpcFv0", {32, -1.2, -6.1}, "delta eta axis for TPC-FV0 histograms"}; - ConfigurableAxis axisEtaTrigger{"axisEtaTrigger", {VARIABLE_WIDTH, -3.3, -2.1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 3.5, 4.9}, "eta trigger axis for histograms"}; + ConfigurableAxis axisDeltaEtaTpcFv0{"axisDeltaEtaTpcFv0", {32, -6.1, -1.2}, "delta eta axis for TPC-FV0 histograms"}; + ConfigurableAxis axisEtaTrigger{"axisEtaTrigger", {VARIABLE_WIDTH, -3.4, -2.0, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 3.5, 4.9}, "eta trigger axis for histograms"}; ConfigurableAxis axisEtaAssoc{"axisEtaAssoc", {VARIABLE_WIDTH, -3.3, -2.1, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 3.5, 4.9}, "eta associated axis for histograms"}; ConfigurableAxis axisVtxMix{"axisVtxMix", {VARIABLE_WIDTH, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, "vertex axis for mixed event histograms"}; ConfigurableAxis axisMultMix{"axisMultMix", {VARIABLE_WIDTH, 0, 10, 20, 40, 60, 80, 100, 120, 140, 160, 180, 200, 220, 240, 260}, "multiplicity / centrality axis for mixed event histograms"}; @@ -171,6 +182,17 @@ struct FlowDecorrelation { using FilteredCollisions = soa::Filtered>; using FilteredTracks = soa::Filtered>; + Filter particleFilter = (nabs(aod::mcparticle::eta) < cfgMcTrue.cfgEtaTpcCut || ((aod::mcparticle::eta > cfgMcTrue.cfgMinEtaFt0cCut) && (aod::mcparticle::eta < cfgMcTrue.cfgMaxEtaFt0cCut))) && (aod::mcparticle::pt > cfgCutPtMin) && (aod::mcparticle::pt < cfgCutPtMax); + using FilteredMcParticles = soa::Filtered; + + // Filter for MCcollisions + Filter mccollisionFilter = nabs(aod::mccollision::posZ) < cfgCutVtxZ; + using FilteredMcCollisions = soa::Filtered; + + using SmallGroupMcCollisions = soa::SmallGroups>; + + PresliceUnsorted collisionPerMCCollision = aod::mccollisionlabel::mcCollisionId; + // FT0 geometry o2::ft0::Geometry ft0Det; o2::fv0::Geometry* fv0Det{}; @@ -243,6 +265,7 @@ struct FlowDecorrelation { const AxisSpec axisPhi{72, 0.0, constants::math::TwoPI, "#varphi"}; const AxisSpec axisEta{40, -1., 1., "#eta"}; const AxisSpec axisEtaFull{90, -4., 5., "#eta"}; + const AxisSpec axisCentrality{20, 0., 100., "cent"}; ccdb->setURL("http://alice-ccdb.cern.ch"); ccdb->setCaching(true); @@ -268,7 +291,23 @@ struct FlowDecorrelation { registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(12, "MultCorrelation"); registry.get(HIST("hEventCountSpecific"))->GetXaxis()->SetBinLabel(13, "cfgEvSelV0AT0ACut"); } - + if (doprocessMcSameTpcFt0c) { + registry.add("MCTrue/MCeventcount", "MCeventcount", {HistType::kTH1F, {{5, 0, 5, "bin"}}}); // histogram to see how many events are in the same and mixed event + registry.get(HIST("MCTrue/MCeventcount"))->GetXaxis()->SetBinLabel(2, "same all"); + registry.get(HIST("MCTrue/MCeventcount"))->GetXaxis()->SetBinLabel(3, "same reco"); + registry.get(HIST("MCTrue/MCeventcount"))->GetXaxis()->SetBinLabel(4, "mixed all"); + registry.get(HIST("MCTrue/MCeventcount"))->GetXaxis()->SetBinLabel(5, "mixed reco"); + registry.add("MCTrue/MCCentrality", "cent", {HistType::kTH1D, {axisCentrality}}); + registry.add("MCTrue/MCNch", "N_{ch}", {HistType::kTH1D, {axisMultiplicity}}); + registry.add("MCTrue/MCzVtx", "MCzVtx", {HistType::kTH1D, {axisVertex}}); + registry.add("MCTrue/MCPhi", "MCPhi", {HistType::kTH1D, {axisPhi}}); + registry.add("MCTrue/MCEta", "MCEta", {HistType::kTH1D, {axisEtaFull}}); + registry.add("MCTrue/MCEtaTrueShape", "MCEta", {HistType::kTH1D, {axisEtaFull}}); + registry.add("MCTrue/MCpT", "MCpT", {HistType::kTH1D, {axisPtEfficiency}}); + registry.add("MCTrue/MCTrig_hist", "", {HistType::kTHnSparseF, {{axisSample, axisVertex, axisPtEfficiency}}}); + registry.add("MCTrue/MCdeltaEta_deltaPhi_same", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); // check to see the delta eta and delta phi distribution + registry.add("MCTrue/MCdeltaEta_deltaPhi_mixed", "", {HistType::kTH2D, {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); + } if (cfgEvSelMultCorrelation) { cfgFuncParas.multT0CCutPars = cfgFuncParas.cfgMultT0CCutPars; cfgFuncParas.multPVT0CCutPars = cfgFuncParas.cfgMultPVT0CCutPars; @@ -421,6 +460,10 @@ struct FlowDecorrelation { same.setObject(new CorrelationContainer("sameEvent_TPC_FV0", "sameEvent_TPC_FV0", corrAxisTpcFv0, effAxis, userAxis)); mixed.setObject(new CorrelationContainer("mixedEvent_TPC_FV0", "mixedEvent_TPC_FV0", corrAxisTpcFv0, effAxis, userAxis)); } + if (doprocessMcSameTpcFt0c) { + same.setObject(new CorrelationContainer("sameEvent_TPC_FV0", "sameEvent_TPC_FV0", corrAxisTpcFt0c, effAxis, userAxis)); + mixed.setObject(new CorrelationContainer("mixedEvent_TPC_FV0", "mixedEvent_TPC_FV0", corrAxisTpcFt0c, effAxis, userAxis)); + } LOGF(info, "End of init"); } @@ -428,13 +471,13 @@ struct FlowDecorrelation { bool isAcceptedMftTrack(TTrackAssoc const& mftTrack) { // cut on the number of clusters of the reconstructed MFT track - if (mftTrack.nClusters() < nClustersMftTrack) + if (mftTrack.nClusters() < cfgMftCuts.nClustersMftTrack) return false; - if (cfgCutChi2Mft > 0. && mftTrack.chi2() > cfgCutChi2Mft) + if (cfgMftCuts.cfgCutChi2Mft > 0. && mftTrack.chi2() > cfgMftCuts.cfgCutChi2Mft) return false; - if (cfgCutTrackTimeMft > 0. && std::abs(mftTrack.trackTime()) > cfgCutTrackTimeMft) + if (cfgMftCuts.cfgCutTrackTimeMft > 0. && std::abs(mftTrack.trackTime()) > cfgMftCuts.cfgCutTrackTimeMft) return false; return true; @@ -729,11 +772,11 @@ struct FlowDecorrelation { float ampl = 0.; getChannel(ft0, iCh, chanelid, ampl, corType); if (corType == kFT0C) { - if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) { + if ((cfgFt0RingRejections.cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax))) { continue; } } else if (corType == kFT0A) { - if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) { + if ((cfgFt0RingRejections.cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax))) { continue; } } @@ -786,7 +829,7 @@ struct FlowDecorrelation { int channelIdA = 0; float amplA = 0.f; getChannel(ft0Trig, iChA, channelIdA, amplA, kFT0A); - if ((cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax)) || (cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax))) { + if ((cfgFt0RingRejections.cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax))) { continue; } @@ -801,7 +844,7 @@ struct FlowDecorrelation { int channelIdC = 0; float amplC = 0.f; getChannel(ft0Assoc, iChC, channelIdC, amplC, kFT0C); - if ((cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax)) || (cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax))) { + if ((cfgFt0RingRejections.cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax)) || (cfgFt0RingRejections.cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax))) { continue; } @@ -983,6 +1026,24 @@ struct FlowDecorrelation { return 1; } + bool ft0cCollisionCourse(float eta, float phi, float vtxZ) + { + double theta = 2 * std::atan(std::exp(-eta)); + double vx = std::sin(theta) * std::cos(phi); // veloctiy component along x + double vy = std::sin(theta) * std::sin(phi); // veloctiy component along y + double vz = std::cos(theta); // veloctiy component along z + + double x = vx * ((-83.44 - vtxZ) / vz); // location of particle on x at FT0C distance from vertex + double y = vy * ((-83.44 - vtxZ) / vz); // location of particle on x at FT0C distance from vertex + + if (std::abs(x) < 24 && (std::abs(y) > 6.825 && std::abs(y) < 18.25)) + return true; + else if (std::abs(y) < 24 && (std::abs(x) > 6.675 && std::abs(x) < 18.175)) + return true; + else + return false; + } + void processSameTpcFt0a(FilteredCollisions::iterator const& collision, FilteredTracks const& tracks, aod::FT0s const&, aod::BCsWithTimestamps const&) { if (!collision.sel8()) @@ -1558,6 +1619,149 @@ struct FlowDecorrelation { } } PROCESS_SWITCH(FlowDecorrelation, processMixedTpcFv0, "Process mixed events for TPC-FV0 correlation", false); + + template + void fillMCCorrelations(TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms + { + int fSampleIndex = gRandom->Uniform(0, cfgSampleSize); + + float triggerWeight = 1.0f; + float associatedWeight = 1.0f; + // loop over all FT0C tracks + for (auto const& track1 : tracks1) { + + if (!cfgMcTrue.cfgUseFt0cStructure) { + if (std::abs(track1.eta()) < 0.9) + continue; + } else if (!ft0cCollisionCourse(track1.eta(), track1.phi(), posZ)) { + continue; + } + + if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && !track1.isPhysicalPrimary()) + continue; + + if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && system == SameEvent) + registry.fill(HIST("MCTrue/MCEtaTrueShape"), track1.eta()); + + if (system == SameEvent && doprocessMcSameTpcFt0c) + registry.fill(HIST("MCTrue/MCTrig_hist"), fSampleIndex, posZ, track1.pt(), eventWeight * triggerWeight); + + // loop over all TPC tracks + for (auto const& track2 : tracks2) { + + if (std::abs(track2.eta()) > 0.9) + continue; + + if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && !track2.isPhysicalPrimary()) + continue; + + if (track1.globalIndex() == track2.globalIndex()) + continue; // For pt-differential correlations, skip if the trigger and associate are the same track + + float deltaPhi = RecoDecay::constrainAngle(track2.phi() - track1.phi(), -PIHalf); + float deltaEta = track2.eta() - track1.eta(); + + // fill the right sparse and histograms + if (system == SameEvent) { + same->getPairHist()->Fill(step, fSampleIndex, posZ, track2.eta(), track1.eta(), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight); + registry.fill(HIST("MCTrue/MCdeltaEta_deltaPhi_same"), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight); + } else if (system == MixedEvent) { + mixed->getPairHist()->Fill(step, fSampleIndex, posZ, track2.eta(), track1.eta(), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight); + registry.fill(HIST("MCTrue/MCdeltaEta_deltaPhi_mixed"), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight); + } + } + } + } + + void processMcSameTpcFt0c(FilteredMcCollisions::iterator const& mcCollision, FilteredMcParticles const& mcParticles, SmallGroupMcCollisions const& collisions) + { + float cent = -1; + if (!cfgCentTableUnavailable) { + for (const auto& collision : collisions) { + cent = getCentrality(collision); + } + } + + if (cfgSelCollByNch && (mcParticles.size() < cfgCutMultMin || mcParticles.size() >= cfgCutMultMax)) { + return; + } + if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgCutCentMin || cent >= cfgCutCentMax)) { + return; + } + + registry.fill(HIST("MCTrue/MCeventcount"), SameEvent); // because its same event i put it in the 1 bin + if (!cfgCentTableUnavailable) + registry.fill(HIST("MCTrue/MCCentrality"), cent); + registry.fill(HIST("MCTrue/MCNch"), mcParticles.size()); + registry.fill(HIST("MCTrue/MCzVtx"), mcCollision.posZ()); + for (const auto& mcParticle : mcParticles) { + if (mcParticle.isPhysicalPrimary()) { + registry.fill(HIST("MCTrue/MCPhi"), mcParticle.phi()); + registry.fill(HIST("MCTrue/MCEta"), mcParticle.eta()); + registry.fill(HIST("MCTrue/MCpT"), mcParticle.pt()); + } + } + if (cfgMcTrue.cfgUseCFStepAll) { + same->fillEvent(mcParticles.size(), CorrelationContainer::kCFStepAll); + fillMCCorrelations(mcParticles, mcParticles, mcCollision.posZ(), SameEvent, 1.0f); + } + + registry.fill(HIST("MCTrue/MCeventcount"), 2.5); + same->fillEvent(mcParticles.size(), CorrelationContainer::kCFStepTrackedOnlyPrim); + fillMCCorrelations(mcParticles, mcParticles, mcCollision.posZ(), SameEvent, 1.0f); + } + PROCESS_SWITCH(FlowDecorrelation, processMcSameTpcFt0c, "Process MC same event", false); + + void processMcMixed(FilteredMcCollisions const& mcCollisions, FilteredMcParticles const& mcParticles, SmallGroupMcCollisions const& collisions) + { + auto getTracksSize = [&mcParticles, this](FilteredMcCollisions::iterator const& mcCollision) { + auto associatedTracks = mcParticles.sliceByCached(o2::aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), this->cache); + auto mult = associatedTracks.size(); + return mult; + }; + + using MixedBinning = FlexibleBinningPolicy, o2::aod::mccollision::PosZ, decltype(getTracksSize)>; + + MixedBinning binningOnVtxAndMult{{getTracksSize}, {axisVtxMix, axisMultMix}, true}; + + auto tracksTuple = std::make_tuple(mcParticles, mcParticles); + Pair pairs{binningOnVtxAndMult, cfgMixEventNumMin, -1, mcCollisions, tracksTuple, &cache}; // -1 is the number of the bin to skip + for (auto it = pairs.begin(); it != pairs.end(); it++) { + auto& [collision1, tracks1, collision2, tracks2] = *it; + + if (cfgSelCollByNch && (tracks1.size() < cfgCutMultMin || tracks1.size() >= cfgCutMultMax)) + continue; + + if (cfgSelCollByNch && (tracks2.size() < cfgCutMultMin || tracks2.size() >= cfgCutMultMax)) + continue; + + auto groupedCollisions = collisions.sliceBy(collisionPerMCCollision, collision1.globalIndex()); + + float cent = -1; + if (!cfgCentTableUnavailable) { + for (const auto& collision : groupedCollisions) { + cent = getCentrality(collision); + } + } + + if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgCutCentMin || cent >= cfgCutCentMax)) + continue; + + registry.fill(HIST("MCTrue/MCeventcount"), MixedEvent); // fill the mixed event in the 3 bin + float eventWeight = 1.0f; + if (cfgUseEventWeights) { + eventWeight = 1.0f / it.currentWindowNeighbours(); + } + + if (cfgMcTrue.cfgUseCFStepAll) { + fillMCCorrelations(tracks1, tracks2, collision1.posZ(), MixedEvent, eventWeight); + } + + registry.fill(HIST("MCTrue/MCeventcount"), 4.5); + fillMCCorrelations(tracks1, tracks2, collision1.posZ(), MixedEvent, eventWeight); + } + } + PROCESS_SWITCH(FlowDecorrelation, processMcMixed, "Process MC mixed events", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx index b95075d694e..93210a7968b 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longRangeDihadronCor.cxx @@ -17,6 +17,7 @@ #include "PWGCF/Core/CorrelationContainer.h" #include "PWGCF/Core/PairCuts.h" #include "PWGCF/DataModel/CorrelationsDerived.h" +#include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFW.h" #include "PWGCF/GenericFramework/Core/GFWCumulant.h" #include "PWGCF/GenericFramework/Core/GFWPowerArray.h" @@ -156,6 +157,19 @@ struct LongRangeDihadronCor { O2_DEFINE_CONFIGURABLE(cfgMirrorFT0CDeadChannels, bool, false, "If true, mirror FT0C channels 177->145, 176->144, 178->146, 179->147, 139->115") O2_DEFINE_CONFIGURABLE(cfgRunbyRunAmplitudeFT0, bool, false, "Produce run-by-run FT0 amplitude distribution"); } cfgFwdConfig; + struct : ConfigurableGroup { + O2_DEFINE_CONFIGURABLE(gfwOutput, bool, false, "produce cumulant results, off by default"); + O2_DEFINE_CONFIGURABLE(gfwNbootstrap, int, 30, "Number of subsamples") + O2_DEFINE_CONFIGURABLE(gfwAcceptance, std::string, "", "CCDB path to acceptance object") + O2_DEFINE_CONFIGURABLE(gfwUseNch, bool, false, "use multiplicity as x axis"); + ConfigurableAxis gfwAxisIndependent{"gfwAxisIndependent", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90}, "X axis for histograms"}; + Configurable> gfwCorr{"gfwCorr", std::vector{"TPC {2} FT0A {-2}"}, "User defined GFW CorrelatorConfig"}; + Configurable> gfwName{"gfwName", std::vector{"TpcFt0A22"}, "User defined GFW Name"}; + GFW* fGFW = new GFW(); + std::vector corrconfigs; + TAxis* fPtAxis; + TRandom3* fRndm = new TRandom3(0); + } cfgCumulantConfig; SliceCache cache; @@ -198,6 +212,7 @@ struct LongRangeDihadronCor { // Corrections TH3D* mEfficiency = nullptr; TH1D* mCentralityWeight = nullptr; + GFWWeights* mAcceptance = nullptr; bool correctionsLoaded = false; // Define the outputs @@ -208,6 +223,8 @@ struct LongRangeDihadronCor { OutputObj sameFt0aFt0c{"sameEvent_FT0A_FT0C"}; OutputObj mixedFt0aFt0c{"mixedEvent_FT0A_FT0C"}; HistogramRegistry registry{"registry"}; + OutputObj fFC{FlowContainer("FlowContainer")}; + OutputObj fFCgen{FlowContainer("FlowContainer_gen")}; // define global variables TRandom3* gRandom = new TRandom3(); @@ -266,6 +283,10 @@ struct LongRangeDihadronCor { kFT0CMirrorChannelEnd = 147, kFT0CMirrorChannelInnerRing = 115 }; + enum DataType { + kReco, + kGen + }; std::array tofNsigmaCut; std::array itsNsigmaCut; std::array tpcNsigmaCut; @@ -442,6 +463,69 @@ struct LongRangeDihadronCor { mixedFt0aFt0c.setObject(new CorrelationContainer("mixedEvent_FT0A_FT0C", "mixedEvent_FT0A_FT0C", corrAxisFt0aFt0c, effAxis, userAxis)); } + if (cfgCumulantConfig.gfwOutput && doprocessSameTpcFt0a && doprocessSameTpcFt0c) { + LOGF(fatal, "If you enable gfwOutput, you can only enable processSameTpcFt0a or processSameTpcFt0c, NOT both."); + } + if (cfgCumulantConfig.gfwOutput) { + o2::framework::AxisSpec axis = axisPt; + int nPtBins = axis.binEdges.size() - 1; + double* ptBins = &(axis.binEdges)[0]; + cfgCumulantConfig.fPtAxis = new TAxis(nPtBins, ptBins); + + std::vector userDefineGFWCorr = cfgCumulantConfig.gfwCorr; + std::vector userDefineGFWName = cfgCumulantConfig.gfwName; + TObjArray* oba = new TObjArray(); + if (userDefineGFWName.size() != userDefineGFWCorr.size()) { + LOGF(fatal, "The GFWConfig names you provided are NOT matching with configurations. userDefineGFWName.size(): %d, userDefineGFWCorr.size(): %d", userDefineGFWName.size(), userDefineGFWCorr.size()); + } + LOGF(info, "User adding FlowContainer Array:"); + if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { + for (uint i = 0; i < userDefineGFWName.size(); i++) { + if (userDefineGFWCorr.at(i).find("poi") != std::string::npos) { + LOGF(info, "%d: pT-diff array %s", i, userDefineGFWName.at(i).c_str()); + for (auto iPt = 0; iPt < cfgCumulantConfig.fPtAxis->GetNbins(); iPt++) + oba->Add(new TNamed(Form("%s_pt_%i", userDefineGFWName.at(i).c_str(), iPt + 1), Form("%s_pTDiff", userDefineGFWName.at(i).c_str()))); + } else { + LOGF(info, "%d: %s", i, userDefineGFWName.at(i).c_str()); + oba->Add(new TNamed(userDefineGFWName.at(i).c_str(), userDefineGFWName.at(i).c_str())); + } + } + } + fFC->SetName("FlowContainer"); + fFC->SetXAxis(cfgCumulantConfig.fPtAxis); + fFC->Initialize(oba, cfgCumulantConfig.gfwAxisIndependent, cfgCumulantConfig.gfwNbootstrap); + fFCgen->SetName("FlowContainer_gen"); + fFCgen->SetXAxis(cfgCumulantConfig.fPtAxis); + fFCgen->Initialize(oba, cfgCumulantConfig.gfwAxisIndependent, cfgCumulantConfig.gfwNbootstrap); + + cfgCumulantConfig.fGFW->AddRegion("TPC", -0.8, 0.8, 1, 1); + cfgCumulantConfig.fGFW->AddRegion("TPCpoi", -0.8, 0.8, 1 + cfgCumulantConfig.fPtAxis->GetNbins(), 2); + cfgCumulantConfig.fGFW->AddRegion("TPCol", -0.8, 0.8, 1 + cfgCumulantConfig.fPtAxis->GetNbins(), 4); + cfgCumulantConfig.fGFW->AddRegion("FT0A", 3.5, 4.9, 1, 1); + cfgCumulantConfig.fGFW->AddRegion("FT0C", -3.3, -2.1, 1, 1); + cfgCumulantConfig.fGFW->AddRegion("FV0", 2.2, 5.1, 1, 1); + + if (!userDefineGFWCorr.empty() && !userDefineGFWName.empty()) { + LOGF(info, "User adding GFW CorrelatorConfig:"); + // attentaion: here we follow the index of cfgUserDefineGFWCorr + for (uint i = 0; i < userDefineGFWCorr.size(); i++) { + if (i >= userDefineGFWName.size()) { + LOGF(fatal, "The names you provided are more than configurations. userDefineGFWName.size(): %d > userDefineGFWCorr.size(): %d", userDefineGFWName.size(), userDefineGFWCorr.size()); + break; + } + if (userDefineGFWCorr.at(i).find("poi") != std::string::npos) { + cfgCumulantConfig.corrconfigs.push_back(cfgCumulantConfig.fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kTRUE)); + LOGF(info, "corrconfigs.at(%d): enable pt-Diff for %s %s", cfgCumulantConfig.corrconfigs.size() - 1, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); + } else { + cfgCumulantConfig.corrconfigs.push_back(cfgCumulantConfig.fGFW->GetCorrelatorConfig(userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str(), kFALSE)); + LOGF(info, "corrconfigs.at(%d): %s %s", cfgCumulantConfig.corrconfigs.size() - 1, userDefineGFWCorr.at(i).c_str(), userDefineGFWName.at(i).c_str()); + } + } + } + + cfgCumulantConfig.fGFW->CreateRegions(); + } + LOGF(info, "End of init"); } @@ -627,6 +711,13 @@ struct LongRangeDihadronCor { } LOGF(info, "Loaded efficiency histogram from %s (%p)", cfgCentralityWeight.value.c_str(), (void*)mCentralityWeight); } + if (cfgCumulantConfig.gfwOutput && cfgCumulantConfig.gfwAcceptance.value.empty() == false) { + mAcceptance = ccdb->getForTimeStamp(cfgCumulantConfig.gfwAcceptance, timestamp); + if (mAcceptance) + LOGF(info, "Loaded acceptance weights from %s (%p)", cfgCumulantConfig.gfwAcceptance.value.c_str(), (void*)mAcceptance); + else + LOGF(warning, "Could not load acceptance weights from %s (%p)", cfgCumulantConfig.gfwAcceptance.value.c_str(), (void*)mAcceptance); + } correctionsLoaded = true; } @@ -660,6 +751,80 @@ struct LongRangeDihadronCor { return true; } + bool getAcceptanceWeight(float& weight_nua, float phi, float eta, float vtxz) + { + if (mAcceptance) + weight_nua = mAcceptance->getNUA(phi, eta, vtxz); + else + weight_nua = 1; + return true; + } + + template + void fillProfile(const GFW::CorrConfig& corrconf, const ConstStr& tarName, const double& cent) + { + double dnx, val; + dnx = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (dnx == 0) + return; + if (!corrconf.pTDif) { + val = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (std::fabs(val) < 1) + registry.fill(tarName, cent, val, dnx); + return; + } + return; + } + + template + void fillFC(const GFW::CorrConfig& corrconf, const double& cent, const double& rndm) + { + double dnx, val; + dnx = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kTRUE).real(); + if (!corrconf.pTDif) { + if (dnx == 0) + return; + val = cfgCumulantConfig.fGFW->Calculate(corrconf, 0, kFALSE).real() / dnx; + if (std::fabs(val) < 1) { + (dt == kGen) ? fFCgen->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm) : fFC->FillProfile(corrconf.Head.c_str(), cent, val, dnx, rndm); + } + return; + } + for (auto i = 1; i <= cfgCumulantConfig.fPtAxis->GetNbins(); i++) { + dnx = cfgCumulantConfig.fGFW->Calculate(corrconf, i - 1, kTRUE).real(); + if (dnx == 0) + continue; + val = cfgCumulantConfig.fGFW->Calculate(corrconf, i - 1, kFALSE).real() / dnx; + if (std::fabs(val) < 1) { + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconf.Head.c_str(), i), cent, val, dnx, rndm); + } + } + return; + } + + template + void fillGFWFT0(TFT0s const& ft0, int corType) + { + std::size_t channelSize = 0; + if (corType == kFT0C) { + channelSize = ft0.channelC().size(); + } else if (corType == kFT0A) { + channelSize = ft0.channelA().size(); + } else { + LOGF(fatal, "Cor Index %d out of range", corType); + } + for (std::size_t iCh = 0; iCh < channelSize; iCh++) { + int chanelid = 0; + float ampl = 0.; + getChannel(ft0, iCh, chanelid, ampl, corType, MixedEvent + 1); + auto phi = getPhiFT0(chanelid, corType); + auto eta = getEtaFT0(chanelid, corType); + for (float ihit = 0; ihit < ampl; ihit++) { + cfgCumulantConfig.fGFW->Fill(eta, 1, phi, 1., 1); + } + } + } + // fill multiple histograms template void fillYield(TCollision collision, TTracks tracks) // function to fill the yield and etaphi histograms. @@ -1021,6 +1186,40 @@ struct LongRangeDihadronCor { registry.fill(HIST("Nch"), tracks.size()); registry.fill(HIST("zVtx"), collision.posZ()); + if (cfgCumulantConfig.gfwOutput) { + cfgCumulantConfig.fGFW->Clear(); + float lRandom = cfgCumulantConfig.fRndm->Rndm(); + float weff = 1, wacc = 1; + float independent = cent; + if (cfgCumulantConfig.gfwUseNch) + independent = static_cast(tracks.size()); + + // fill TPC Q-vector + for (const auto& track : tracks) { + if (!trackSelected(track)) + continue; + bool withinPtPOI = (0.2 < track.pt()) && (track.pt() < 10.0); // o2-linter: disable=magic-number (within POI pT range) + bool withinPtRef = (0.2 < track.pt()) && (track.pt() < 3.0); // o2-linter: disable=magic-number (within RF pT range) + getAcceptanceWeight(wacc, track.phi(), track.eta(), collision.posZ()); + if (!getEfficiencyCorrection(weff, track.eta(), track.pt(), collision.posZ())) + continue; + if (withinPtRef) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1); + if (withinPtPOI) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 2); + if (withinPtPOI && withinPtRef) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 4); + } + // fill FT0 Q-vector + const auto& ft0 = collision.foundFT0(); + fillGFWFT0(ft0, kFT0A); + + // Filling Flow Container + for (uint l_ind = 0; l_ind < cfgCumulantConfig.corrconfigs.size(); l_ind++) { + fillFC(cfgCumulantConfig.corrconfigs.at(l_ind), independent, lRandom); + } + } + if (cfgSelCollByNch && (tracks.size() < cfgCutMultMin || tracks.size() >= cfgCutMultMax)) { return; } @@ -1141,6 +1340,40 @@ struct LongRangeDihadronCor { registry.fill(HIST("Nch"), tracks.size()); registry.fill(HIST("zVtx"), collision.posZ()); + if (cfgCumulantConfig.gfwOutput) { + cfgCumulantConfig.fGFW->Clear(); + float lRandom = cfgCumulantConfig.fRndm->Rndm(); + float weff = 1, wacc = 1; + float independent = cent; + if (cfgCumulantConfig.gfwUseNch) + independent = static_cast(tracks.size()); + + // fill TPC Q-vector + for (const auto& track : tracks) { + if (!trackSelected(track)) + continue; + bool withinPtPOI = (0.2 < track.pt()) && (track.pt() < 10.0); // o2-linter: disable=magic-number (within POI pT range) + bool withinPtRef = (0.2 < track.pt()) && (track.pt() < 3.0); // o2-linter: disable=magic-number (within RF pT range) + getAcceptanceWeight(wacc, track.phi(), track.eta(), collision.posZ()); + if (!getEfficiencyCorrection(weff, track.eta(), track.pt(), collision.posZ())) + continue; + if (withinPtRef) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 1); + if (withinPtPOI) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 2); + if (withinPtPOI && withinPtRef) + cfgCumulantConfig.fGFW->Fill(track.eta(), cfgCumulantConfig.fPtAxis->FindBin(track.pt()) - 1, track.phi(), wacc * weff, 4); + } + // fill FT0 Q-vector + const auto& ft0 = collision.foundFT0(); + fillGFWFT0(ft0, kFT0C); + + // Filling Flow Container + for (uint l_ind = 0; l_ind < cfgCumulantConfig.corrconfigs.size(); l_ind++) { + fillFC(cfgCumulantConfig.corrconfigs.at(l_ind), independent, lRandom); + } + } + if (cfgSelCollByNch && (tracks.size() < cfgCutMultMin || tracks.size() >= cfgCutMultMax)) { return; } diff --git a/PWGDQ/Core/AnalysisCompositeCut.cxx b/PWGDQ/Core/AnalysisCompositeCut.cxx index 5ab08001953..cbf0f328283 100644 --- a/PWGDQ/Core/AnalysisCompositeCut.cxx +++ b/PWGDQ/Core/AnalysisCompositeCut.cxx @@ -11,6 +11,12 @@ #include "PWGDQ/Core/AnalysisCompositeCut.h" +#include "AnalysisCut.h" + +#include + +#include + ClassImp(AnalysisCompositeCut) //____________________________________________________________________________ diff --git a/PWGDQ/Core/AnalysisCompositeCut.h b/PWGDQ/Core/AnalysisCompositeCut.h index f3d603909c4..a6b3f6afda4 100644 --- a/PWGDQ/Core/AnalysisCompositeCut.h +++ b/PWGDQ/Core/AnalysisCompositeCut.h @@ -14,10 +14,14 @@ // Cut class manipulating groups of cuts // -#ifndef AnalysisCompositeCut_H -#define AnalysisCompositeCut_H +#ifndef PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ +#define PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ #include "PWGDQ/Core/AnalysisCut.h" + +#include +#include + #include //_________________________________________________________________________ @@ -52,4 +56,4 @@ class AnalysisCompositeCut : public AnalysisCut ClassDef(AnalysisCompositeCut, 2); }; -#endif +#endif // PWGDQ_CORE_ANALYSISCOMPOSITECUT_H_ diff --git a/PWGDQ/Core/AnalysisCut.cxx b/PWGDQ/Core/AnalysisCut.cxx index ecb1ace04e6..a1dae4ce6b0 100644 --- a/PWGDQ/Core/AnalysisCut.cxx +++ b/PWGDQ/Core/AnalysisCut.cxx @@ -11,6 +11,10 @@ #include "PWGDQ/Core/AnalysisCut.h" +#include + +#include + #include #include diff --git a/PWGDQ/Core/AnalysisCut.h b/PWGDQ/Core/AnalysisCut.h index 6c7185b13ec..16f2916fe93 100644 --- a/PWGDQ/Core/AnalysisCut.h +++ b/PWGDQ/Core/AnalysisCut.h @@ -14,10 +14,14 @@ // Class for analysis cuts applied on the variables defined in the VarManager // -#ifndef AnalysisCut_H -#define AnalysisCut_H +#ifndef PWGDQ_CORE_ANALYSISCUT_H_ +#define PWGDQ_CORE_ANALYSISCUT_H_ #include +#include + +#include + #include //_________________________________________________________________________ @@ -176,4 +180,4 @@ inline bool AnalysisCut::IsSelected(float* values) return true; } -#endif +#endif // PWGDQ_CORE_ANALYSISCUT_H_ diff --git a/PWGDQ/Core/CutsLibrary.cxx b/PWGDQ/Core/CutsLibrary.cxx index cb9c124d418..09bb472266b 100644 --- a/PWGDQ/Core/CutsLibrary.cxx +++ b/PWGDQ/Core/CutsLibrary.cxx @@ -14,20 +14,27 @@ #include "PWGDQ/Core/CutsLibrary.h" #include "AnalysisCompositeCut.h" +#include "AnalysisCut.h" #include "VarManager.h" +#include +#include + #include +#include + +#include +#include #include +#include #include -#include +#include #include +#include #include -using std::cout; -using std::endl; - AnalysisCompositeCut* o2::aod::dqcuts::GetCompositeCut(const char* cutName) { // diff --git a/PWGDQ/Core/CutsLibrary.h b/PWGDQ/Core/CutsLibrary.h index b38577f3c2b..51508c3a929 100644 --- a/PWGDQ/Core/CutsLibrary.h +++ b/PWGDQ/Core/CutsLibrary.h @@ -17,9 +17,12 @@ #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/VarManager.h" + +#include #include +#include +#include #include // /////////////////////////////////////////////// @@ -98,8 +101,6 @@ // End of Cuts for CEFP // // /////////////////////////////////////////////// -#include "rapidjson/document.h" - namespace o2::aod { namespace dqcuts diff --git a/PWGDQ/Core/DQMlResponse.h b/PWGDQ/Core/DQMlResponse.h index 64bfe233cc7..9b72e1257b7 100644 --- a/PWGDQ/Core/DQMlResponse.h +++ b/PWGDQ/Core/DQMlResponse.h @@ -17,11 +17,16 @@ #ifndef PWGDQ_CORE_DQMLRESPONSE_H_ #define PWGDQ_CORE_DQMLRESPONSE_H_ +#include "PWGDQ/Core/VarManager.h" + #include "Tools/ML/MlResponse.h" +#include + +#include #include #include -#include +#include #include namespace o2::analysis diff --git a/PWGDQ/Core/HistogramManager.cxx b/PWGDQ/Core/HistogramManager.cxx index 4882b7d84f5..ae1c4be3022 100644 --- a/PWGDQ/Core/HistogramManager.cxx +++ b/PWGDQ/Core/HistogramManager.cxx @@ -11,28 +11,37 @@ #include "PWGDQ/Core/HistogramManager.h" +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include #include -#include -#include #include +#include #include -#include -#include "Framework/Logger.h" using namespace std; -#include -#include +#include #include -#include -#include -#include -#include -#include -#include #include #include #include -#include +#include +#include +#include +#include +#include ClassImp(HistogramManager); diff --git a/PWGDQ/Core/HistogramManager.h b/PWGDQ/Core/HistogramManager.h index 4b1393b2eb7..94aa3ecec00 100644 --- a/PWGDQ/Core/HistogramManager.h +++ b/PWGDQ/Core/HistogramManager.h @@ -17,17 +17,20 @@ #ifndef PWGDQ_CORE_HISTOGRAMMANAGER_H_ #define PWGDQ_CORE_HISTOGRAMMANAGER_H_ -#include -#include -#include -#include -#include #include +#include +#include +#include +#include -#include +#include +#include + +#include +#include #include +#include #include -#include class HistogramManager : public TNamed { @@ -103,10 +106,10 @@ class HistogramManager : public TNamed std::map>> fVariablesMap; //! map holding identifiers for all variables needed by histograms // various - bool fUseDefaultVariableNames; //! toggle the usage of default variable names and units - uint64_t fBinsAllocated; //! number of allocated bins - TString* fVariableNames; //! variable names - TString* fVariableUnits; //! variable units + bool fUseDefaultVariableNames; //! toggle the usage of default variable names and units + uint64_t fBinsAllocated; //! number of allocated bins + TString* fVariableNames; //! variable names + TString* fVariableUnits; //! variable units void MakeAxisLabels(TAxis* ax, const char* labels); diff --git a/PWGDQ/Core/HistogramsLibrary.cxx b/PWGDQ/Core/HistogramsLibrary.cxx index 9d12b892322..e198ea2d7af 100644 --- a/PWGDQ/Core/HistogramsLibrary.cxx +++ b/PWGDQ/Core/HistogramsLibrary.cxx @@ -13,11 +13,25 @@ // #include "PWGDQ/Core/HistogramsLibrary.h" +#include "HistogramManager.h" #include "VarManager.h" -#include "CommonConstants/MathConstants.h" +#include +#include + +#include +#include +#include + +#include +#include + +#include #include +#include +#include +#include #include void o2::aod::dqhistograms::DefineHistograms(HistogramManager* hm, const char* histClass, const char* groupName, const char* subGroupName) @@ -2537,7 +2551,7 @@ void o2::aod::dqhistograms::AddHistogramsFromJSON(HistogramManager* hm, const ch str += json[i]; } } - LOG(fatal) << "**** Parsing error is somewhere here: " << str.Data() << endl; + LOG(fatal) << "**** Parsing error is somewhere here: " << str.Data() << std::endl; return; } diff --git a/PWGDQ/Core/HistogramsLibrary.h b/PWGDQ/Core/HistogramsLibrary.h index 869fb3a85f3..99530b1cb6f 100644 --- a/PWGDQ/Core/HistogramsLibrary.h +++ b/PWGDQ/Core/HistogramsLibrary.h @@ -15,11 +15,7 @@ #ifndef PWGDQ_CORE_HISTOGRAMSLIBRARY_H_ #define PWGDQ_CORE_HISTOGRAMSLIBRARY_H_ -#include #include "PWGDQ/Core/HistogramManager.h" -#include "PWGDQ/Core/VarManager.h" -#include "CommonConstants/MathConstants.h" -#include "rapidjson/document.h" namespace o2::aod { @@ -29,7 +25,7 @@ void DefineHistograms(HistogramManager* hm, const char* histClass, const char* g template bool ValidateJSONHistogram(T hist); void AddHistogramsFromJSON(HistogramManager* hm, const char* json); -} +} // namespace dqhistograms } // namespace o2::aod #endif // PWGDQ_CORE_HISTOGRAMSLIBRARY_H_ diff --git a/PWGDQ/Core/MCProng.cxx b/PWGDQ/Core/MCProng.cxx index f2fffa9ba55..1e50a10fce2 100644 --- a/PWGDQ/Core/MCProng.cxx +++ b/PWGDQ/Core/MCProng.cxx @@ -11,10 +11,16 @@ #include "PWGDQ/Core/MCProng.h" -#include -#include +#include + +#include + #include +#include +#include #include +#include +#include ClassImp(MCProng); diff --git a/PWGDQ/Core/MCProng.h b/PWGDQ/Core/MCProng.h index cd42965d271..4677a995bc7 100644 --- a/PWGDQ/Core/MCProng.h +++ b/PWGDQ/Core/MCProng.h @@ -57,12 +57,13 @@ A few non-existent PYTHIA codes are used to select more than one PYTHIA code. #ifndef PWGDQ_CORE_MCPRONG_H_ #define PWGDQ_CORE_MCPRONG_H_ -#include "TNamed.h" -#include "TString.h" +#include -#include -#include +#include + +#include #include +#include class MCProng { diff --git a/PWGDQ/Core/MCSignal.cxx b/PWGDQ/Core/MCSignal.cxx index 7a234b65088..cb05a02b02c 100644 --- a/PWGDQ/Core/MCSignal.cxx +++ b/PWGDQ/Core/MCSignal.cxx @@ -9,11 +9,18 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include - #include "PWGDQ/Core/MCSignal.h" +#include "MCProng.h" + +#include + +#include + +#include +#include +#include + using std::cout; using std::endl; diff --git a/PWGDQ/Core/MCSignal.h b/PWGDQ/Core/MCSignal.h index 42fe0a0a050..f13f9657fbd 100644 --- a/PWGDQ/Core/MCSignal.h +++ b/PWGDQ/Core/MCSignal.h @@ -57,10 +57,11 @@ process(aod::McParticles const& mcTracks) { #define PWGDQ_CORE_MCSIGNAL_H_ #include "MCProng.h" -#include "TNamed.h" +#include + +#include #include -#include class MCSignal : public TNamed { diff --git a/PWGDQ/Core/MCSignalLibrary.cxx b/PWGDQ/Core/MCSignalLibrary.cxx index c1c2380c3a4..0bc89619d35 100644 --- a/PWGDQ/Core/MCSignalLibrary.cxx +++ b/PWGDQ/Core/MCSignalLibrary.cxx @@ -11,16 +11,24 @@ // // Contact: iarsene@cern.ch, i.c.arsene@fys.uio.no // -#include -#include -// #include - #include "PWGDQ/Core/MCSignalLibrary.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/Logger.h" +#include "MCProng.h" +#include "MCSignal.h" + +#include +#include #include +#include + +#include +#include + +#include +#include +#include +#include using namespace o2::constants::physics; // using std::cout; diff --git a/PWGDQ/Core/MCSignalLibrary.h b/PWGDQ/Core/MCSignalLibrary.h index f244c7cbbfc..5b34271a574 100644 --- a/PWGDQ/Core/MCSignalLibrary.h +++ b/PWGDQ/Core/MCSignalLibrary.h @@ -18,9 +18,6 @@ #include "PWGDQ/Core/MCProng.h" #include "PWGDQ/Core/MCSignal.h" -#include "rapidjson/document.h" - -#include #include namespace o2::aod diff --git a/PWGDQ/Core/MixingHandler.cxx b/PWGDQ/Core/MixingHandler.cxx index 532b91ea9ac..5fd601f67d0 100644 --- a/PWGDQ/Core/MixingHandler.cxx +++ b/PWGDQ/Core/MixingHandler.cxx @@ -10,15 +10,18 @@ // or submit itself to any jurisdiction. #include "PWGDQ/Core/MixingHandler.h" + #include "PWGDQ/Core/VarManager.h" -#include -#include -using namespace std; +#include +#include +#include -#include -#include -#include +#include +#include + +#include +using namespace std; ClassImp(MixingHandler); diff --git a/PWGDQ/Core/MixingHandler.h b/PWGDQ/Core/MixingHandler.h index 12b4b4dcc1a..f73d5632895 100644 --- a/PWGDQ/Core/MixingHandler.h +++ b/PWGDQ/Core/MixingHandler.h @@ -17,15 +17,12 @@ #ifndef PWGDQ_CORE_MIXINGHANDLER_H_ #define PWGDQ_CORE_MIXINGHANDLER_H_ -#include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/VarManager.h" #include -#include -#include -#include #include -#include + +#include #include diff --git a/PWGDQ/Core/MixingLibrary.cxx b/PWGDQ/Core/MixingLibrary.cxx index 90fd639464a..28e453b5479 100644 --- a/PWGDQ/Core/MixingLibrary.cxx +++ b/PWGDQ/Core/MixingLibrary.cxx @@ -13,6 +13,16 @@ // #include "PWGDQ/Core/MixingLibrary.h" +#include "PWGDQ/Core/MixingHandler.h" +#include "PWGDQ/Core/VarManager.h" + +#include + +#include + +#include +#include + #include #include diff --git a/PWGDQ/Core/MixingLibrary.h b/PWGDQ/Core/MixingLibrary.h index c6de5b9ecd3..2372c735cff 100644 --- a/PWGDQ/Core/MixingLibrary.h +++ b/PWGDQ/Core/MixingLibrary.h @@ -16,11 +16,6 @@ #define PWGDQ_CORE_MIXINGLIBRARY_H_ #include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/VarManager.h" - -#include - -#include "rapidjson/document.h" namespace o2::aod { diff --git a/PWGDQ/Core/MuonMatchingMlResponse.h b/PWGDQ/Core/MuonMatchingMlResponse.h index 236a4f48329..ee2f419a5f5 100644 --- a/PWGDQ/Core/MuonMatchingMlResponse.h +++ b/PWGDQ/Core/MuonMatchingMlResponse.h @@ -18,7 +18,9 @@ #include "Tools/ML/MlResponse.h" -#include +#include + +#include #include #include diff --git a/PWGDQ/Core/VarManager.cxx b/PWGDQ/Core/VarManager.cxx index ac2902c0f3a..bbe9f08f28b 100644 --- a/PWGDQ/Core/VarManager.cxx +++ b/PWGDQ/Core/VarManager.cxx @@ -8,17 +8,39 @@ // 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 "PWGDQ/Core/VarManager.h" #include "Tools/KFparticle/KFUtilities.h" +#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 -using std::cout; -using std::endl; using namespace o2::constants::physics; ClassImp(VarManager); diff --git a/PWGDQ/Core/VarManager.h b/PWGDQ/Core/VarManager.h index fa0f694d227..594317a5cd4 100644 --- a/PWGDQ/Core/VarManager.h +++ b/PWGDQ/Core/VarManager.h @@ -22,38 +22,45 @@ #endif #include "PWGUD/Core/UDHelpers.h" +#include "PWGUD/Core/UPCHelpers.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/CollisionTypeHelper.h" #include "Common/Core/EventPlaneHelper.h" -#include "Common/Core/PID/PIDTOFParamService.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/Core/trackUtilities.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include -#include -#include -#include -#include +#include +#include #include #include #include @@ -61,22 +68,21 @@ #include #include #include -#include -#include -#include +#include +#include +#include + +#include #include #include #include -#include #include #include #include #include -using std::complex; -using std::cout; -using std::endl; +#include using SMatrix55 = ROOT::Math::SMatrix>; using SMatrix5 = ROOT::Math::SVector; @@ -2772,10 +2778,10 @@ void VarManager::FillTrack(T const& track, float* values) if (fgUsedVars[kM11REFoverMpsingle]) { float m = o2::constants::physics::MassMuon; ROOT::Math::PtEtaPhiMVector v(track.pt(), track.eta(), track.phi(), m); - complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); - complex Q42(values[kQ42XA], values[kQ42YA]); - complex Q23(values[kQ23XA], values[kQ23YA]); - complex P2(TMath::Cos(2 * v.Phi()), TMath::Sin(2 * v.Phi())); + std::complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); + std::complex Q42(values[kQ42XA], values[kQ42YA]); + std::complex Q23(values[kQ23XA], values[kQ23YA]); + std::complex P2(TMath::Cos(2 * v.Phi()), TMath::Sin(2 * v.Phi())); values[kM11REFoverMpsingle] = values[kMultSingleMuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM11REF] / values[kMultSingleMuons] : 0; values[kM1111REFoverMpsingle] = values[kMultSingleMuons] > 0 && !(std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) || std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF])) ? values[kM1111REF] / values[kMultSingleMuons] : 0; values[kCORR2REFbysinglemu] = std::isnan(values[kM11REFoverMpsingle]) || std::isinf(values[kM11REFoverMpsingle]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REFoverMpsingle]) || std::isinf(values[kM1111REFoverMpsingle]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF]) ? 0 : values[kCORR2REF]; @@ -4032,10 +4038,10 @@ void VarManager::FillPairME(T1 const& t1, T2 const& t2, float* values) values[kWV24ME] = (std::isnan(V22ME) || std::isinf(V22ME) || std::isnan(V24ME) || std::isinf(V24ME)) ? 0. : 1.0; if constexpr ((fillMap & ReducedEventQvectorExtra) > 0) { - complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); - complex Q42(values[kQ42XA], values[kQ42YA]); - complex Q23(values[kQ23XA], values[kQ23YA]); - complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); + std::complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); + std::complex Q42(values[kQ42XA], values[kQ42YA]); + std::complex Q23(values[kQ23XA], values[kQ23YA]); + std::complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); values[kM01POIME] = values[kMultDimuonsME] * values[kS11A]; values[kM0111POIME] = values[kMultDimuonsME] * (values[kS31A] - 3. * values[kS11A] * values[kS12A] + 2. * values[kS13A]); values[kCORR2POIME] = (P2 * conj(Q21)).real() / values[kM01POIME]; @@ -5318,9 +5324,9 @@ void VarManager::FillQVectorFromGFW(C const& /*collision*/, A const& compA11, A values[kM11M1111REF] = values[kM11REF] * values[kM1111REF]; // For cumulants: A = Full TPC, B = Negative TPC, C = Positive TPC - complex QA(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); - complex QB(values[kQ2X0B] * S11B, values[kQ2Y0B] * S11B); - complex QC(values[kQ2X0C] * S11C, values[kQ2Y0C] * S11C); + std::complex QA(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); + std::complex QB(values[kQ2X0B] * S11B, values[kQ2Y0B] * S11B); + std::complex QC(values[kQ2X0C] * S11C, values[kQ2Y0C] * S11C); values[kM11REFetagap] = S11B * S11C; values[kCORR2REFetagap] = ((QB * conj(QC)).real()) / values[kM11REFetagap]; values[kCORR2REFetagap] = std::isnan(values[kM11REFetagap]) || std::isinf(values[kM11REFetagap]) || std::isnan(values[kCORR2REFetagap]) || std::isinf(values[kCORR2REFetagap]) ? 0 : values[kCORR2REFetagap]; @@ -5656,10 +5662,10 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) // kV4, kC4POI, kC4REF etc. if constexpr ((fillMap & ReducedEventQvectorExtra) > 0) { - complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); - complex Q42(values[kQ42XA], values[kQ42YA]); - complex Q23(values[kQ23XA], values[kQ23YA]); - complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); + std::complex Q21(values[kQ2X0A] * values[kS11A], values[kQ2Y0A] * values[kS11A]); + std::complex Q42(values[kQ42XA], values[kQ42YA]); + std::complex Q23(values[kQ23XA], values[kQ23YA]); + std::complex P2(TMath::Cos(2 * v12.Phi()), TMath::Sin(2 * v12.Phi())); values[kM01POI] = values[kMultDimuons] * values[kS11A]; values[kM0111POI] = values[kMultDimuons] * (values[kS31A] - 3. * values[kS11A] * values[kS12A] + 2. * values[kS13A]); values[kCORR2POI] = (P2 * conj(Q21)).real() / values[kM01POI]; @@ -5681,8 +5687,8 @@ void VarManager::FillPairVn(T1 const& t1, T2 const& t2, float* values) values[kM11M0111overMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kM0111POI]) || std::isinf(values[kM0111POI]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kCORR4POI]) || std::isinf(values[kCORR4POI])) ? (values[kM11REF] * values[kM0111POI]) / values[kMultDimuons] : 0; values[kM11M01overMp] = values[kMultDimuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kM01POI]) || std::isinf(values[kM01POI]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kCORR2POI]) || std::isinf(values[kCORR2POI])) ? (values[kM11REF] * values[kM01POI]) / values[kMultDimuons] : 0; - complex P2plus(TMath::Cos(2 * v1.Phi()), TMath::Sin(2 * v1.Phi())); - complex P2minus(TMath::Cos(2 * v2.Phi()), TMath::Sin(2 * v2.Phi())); + std::complex P2plus(TMath::Cos(2 * v1.Phi()), TMath::Sin(2 * v1.Phi())); + std::complex P2minus(TMath::Cos(2 * v2.Phi()), TMath::Sin(2 * v2.Phi())); values[kM11REFoverMpplus] = values[kMultAntiMuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM11REF] / values[kMultAntiMuons] : 0; values[kM1111REFoverMpplus] = values[kMultAntiMuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM1111REF] / values[kMultAntiMuons] : 0; values[kM11REFoverMpminus] = values[kMultMuons] > 0 && !(std::isnan(values[kM11REF]) || std::isinf(values[kM11REF]) || std::isnan(values[kCORR2REF]) || std::isinf(values[kCORR2REF]) || std::isnan(values[kM1111REF]) || std::isinf(values[kM1111REF]) || std::isnan(values[kCORR4REF]) || std::isinf(values[kCORR4REF])) ? values[kM11REF] / values[kMultMuons] : 0; diff --git a/PWGDQ/DataModel/MchTrkEffTables.h b/PWGDQ/DataModel/MchTrkEffTables.h index 3fbecfb619c..a7aa5d1e323 100644 --- a/PWGDQ/DataModel/MchTrkEffTables.h +++ b/PWGDQ/DataModel/MchTrkEffTables.h @@ -17,7 +17,9 @@ #ifndef PWGDQ_DATAMODEL_MCHTRKEFFTABLES_H_ #define PWGDQ_DATAMODEL_MCHTRKEFFTABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { diff --git a/PWGDQ/DataModel/ReducedInfoTables.h b/PWGDQ/DataModel/ReducedInfoTables.h index 94c22011d6e..71a15a1ddbd 100644 --- a/PWGDQ/DataModel/ReducedInfoTables.h +++ b/PWGDQ/DataModel/ReducedInfoTables.h @@ -20,13 +20,16 @@ #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/Qvectors.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "MathUtils/Utils.h" +#include +#include +#include #include +#include #include namespace o2::aod @@ -49,24 +52,24 @@ namespace reducedevent { // basic event information -DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! -DECLARE_SOA_BITMAP_COLUMN(Tag, tag, 64); //! Bit-field for storing event information (e.g. high level info, cut decisions) -DECLARE_SOA_COLUMN(MCPosX, mcPosX, float); //! MC event position X -DECLARE_SOA_COLUMN(MCPosY, mcPosY, float); //! MC event position Y -DECLARE_SOA_COLUMN(MCPosZ, mcPosZ, float); //! MC event position Z -DECLARE_SOA_COLUMN(NTPCoccupContribLongA, nTPCoccupContribLongA, int); //! TPC pileup occupancy on A side (long time range) -DECLARE_SOA_COLUMN(NTPCoccupContribLongC, nTPCoccupContribLongC, int); //! TPC pileup occupancy on C side (long time range) -DECLARE_SOA_COLUMN(NTPCoccupMeanTimeLongA, nTPCoccupMeanTimeLongA, float); //! TPC pileup mean time on A side (long time range) -DECLARE_SOA_COLUMN(NTPCoccupMeanTimeLongC, nTPCoccupMeanTimeLongC, float); //! TPC pileup mean time on C side (long time range) -DECLARE_SOA_COLUMN(NTPCoccupMedianTimeLongA, nTPCoccupMedianTimeLongA, float); //! TPC pileup median time on A side (long time range) -DECLARE_SOA_COLUMN(NTPCoccupMedianTimeLongC, nTPCoccupMedianTimeLongC, float); //! TPC pileup median time on C side (long time range) -DECLARE_SOA_COLUMN(NTPCoccupContribShortA, nTPCoccupContribShortA, int); //! TPC pileup occupancy on A side (short time range) -DECLARE_SOA_COLUMN(NTPCoccupContribShortC, nTPCoccupContribShortC, int); //! TPC pileup occupancy on C side (short time range) -DECLARE_SOA_COLUMN(NTPCoccupMeanTimeShortA, nTPCoccupMeanTimeShortA, float); //! TPC pileup mean time on A side (short time range) -DECLARE_SOA_COLUMN(NTPCoccupMeanTimeShortC, nTPCoccupMeanTimeShortC, float); //! TPC pileup mean time on C side (short time range) -DECLARE_SOA_COLUMN(NTPCoccupMedianTimeShortA, nTPCoccupMedianTimeShortA, float); //! TPC pileup median time on A side (short time range) -DECLARE_SOA_COLUMN(NTPCoccupMedianTimeShortC, nTPCoccupMedianTimeShortC, float); //! TPC pileup median time on C side (short time range) -DECLARE_SOA_COLUMN(DCAzBimodalityCoefficient, dcazBimodalityCoefficient, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event +DECLARE_SOA_INDEX_COLUMN(Collision, collision); //! +DECLARE_SOA_BITMAP_COLUMN(Tag, tag, 64); //! Bit-field for storing event information (e.g. high level info, cut decisions) +DECLARE_SOA_COLUMN(MCPosX, mcPosX, float); //! MC event position X +DECLARE_SOA_COLUMN(MCPosY, mcPosY, float); //! MC event position Y +DECLARE_SOA_COLUMN(MCPosZ, mcPosZ, float); //! MC event position Z +DECLARE_SOA_COLUMN(NTPCoccupContribLongA, nTPCoccupContribLongA, int); //! TPC pileup occupancy on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupContribLongC, nTPCoccupContribLongC, int); //! TPC pileup occupancy on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeLongA, nTPCoccupMeanTimeLongA, float); //! TPC pileup mean time on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeLongC, nTPCoccupMeanTimeLongC, float); //! TPC pileup mean time on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeLongA, nTPCoccupMedianTimeLongA, float); //! TPC pileup median time on A side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeLongC, nTPCoccupMedianTimeLongC, float); //! TPC pileup median time on C side (long time range) +DECLARE_SOA_COLUMN(NTPCoccupContribShortA, nTPCoccupContribShortA, int); //! TPC pileup occupancy on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupContribShortC, nTPCoccupContribShortC, int); //! TPC pileup occupancy on C side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeShortA, nTPCoccupMeanTimeShortA, float); //! TPC pileup mean time on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMeanTimeShortC, nTPCoccupMeanTimeShortC, float); //! TPC pileup mean time on C side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeShortA, nTPCoccupMedianTimeShortA, float); //! TPC pileup median time on A side (short time range) +DECLARE_SOA_COLUMN(NTPCoccupMedianTimeShortC, nTPCoccupMedianTimeShortC, float); //! TPC pileup median time on C side (short time range) +DECLARE_SOA_COLUMN(DCAzBimodalityCoefficient, dcazBimodalityCoefficient, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event DECLARE_SOA_COLUMN(DCAzBimodalityCoefficientBinned, dcazBimodalityCoefficientBinned, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event, binned DECLARE_SOA_COLUMN(DCAzBimodalityCoefficientBinnedTrimmed1, dcazBimodalityCoefficientBinnedTrimmed1, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event, binned and trimmed 1 DECLARE_SOA_COLUMN(DCAzBimodalityCoefficientBinnedTrimmed2, dcazBimodalityCoefficientBinnedTrimmed2, float); //! Bimodality coefficient of the DCAz distribution of the tracks in the event, binned and trimmed 2 @@ -699,8 +702,8 @@ DECLARE_SOA_COLUMN(Vy2, vy2, float); //! Y production vertex in cm DECLARE_SOA_COLUMN(Vz2, vz2, float); //! Z production vertex in cm DECLARE_SOA_COLUMN(Vt2, vt2, float); //! Production vertex time -DECLARE_SOA_COLUMN(IsAmbig1, isAmbig1, int); //! -DECLARE_SOA_COLUMN(IsAmbig2, isAmbig2, int); //! +DECLARE_SOA_COLUMN(IsAmbig1, isAmbig1, int); //! +DECLARE_SOA_COLUMN(IsAmbig2, isAmbig2, int); //! DECLARE_SOA_COLUMN(IsCorrectAssoc1, isCorrectAssoc1, bool); //! DECLARE_SOA_COLUMN(IsCorrectAssoc2, isCorrectAssoc2, bool); //! diff --git a/PWGDQ/DataModel/ReducedTablesAlice3.h b/PWGDQ/DataModel/ReducedTablesAlice3.h index e1cad38495b..787d7d38793 100644 --- a/PWGDQ/DataModel/ReducedTablesAlice3.h +++ b/PWGDQ/DataModel/ReducedTablesAlice3.h @@ -24,8 +24,12 @@ #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFTOF.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" +#include +#include +#include + +#include +#include namespace o2::aod { diff --git a/PWGDQ/Macros/dqFlowAccWeights.C b/PWGDQ/Macros/dqFlowAccWeights.C index 00cb5107d45..d4786089810 100644 --- a/PWGDQ/Macros/dqFlowAccWeights.C +++ b/PWGDQ/Macros/dqFlowAccWeights.C @@ -14,23 +14,25 @@ /// /// \author Chi ZHANG, CEA-Saclay, chi.zhang@cern.ch -#include -#include -#include -#include -#include -#include +#include "PWGCF/GenericFramework/Core/GFWWeights.h" + +#include +#include -#include #include -#include "Framework/Logger.h" -#include "CCDB/BasicCCDBManager.h" -#include "PWGCF/GenericFramework/Core/GFWWeights.h" +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace std; -void dqFlowAccWeights(int64 tmin = 1546300800000, int64 tmax = 1577833200000, std::string Period = "LHC23zzh_pass2", std::string SubDir = "d-q-event-qvector", std::string FileName = "AnalysisResults.root") +void dqFlowAccWeights(int64_t tmin = 1546300800000, int64_t tmax = 1577833200000, std::string Period = "LHC23zzh_pass2", std::string SubDir = "d-q-event-qvector", std::string FileName = "AnalysisResults.root") { if (tmax < tmin) { LOG(fatal) << "Wrong validity syntax!"; diff --git a/PWGDQ/Macros/evalMchTrackingEfficiency.cxx b/PWGDQ/Macros/evalMchTrackingEfficiency.cxx index 34610915850..c59afbb40b8 100644 --- a/PWGDQ/Macros/evalMchTrackingEfficiency.cxx +++ b/PWGDQ/Macros/evalMchTrackingEfficiency.cxx @@ -14,17 +14,20 @@ /// /// \author Zaida Conesa del Valle /// \author Andrea Tavira García -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include -#include "TFile.h" -#include "TDirectoryFile.h" -#include "THn.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TAxis.h" -#include "TCanvas.h" -#include "TStyle.h" -#include "TLegend.h" +#include double computeEfficiencyPerChamber(THnF* hnf, int iAxis, int iCh, double binLimits[2]); double computeEfficiencyPerChamber(THnF* hnf, const int iAxis[3], int iCh, double binLimits[3][2]); diff --git a/PWGDQ/Macros/fit_library/CB2Pdf.cxx b/PWGDQ/Macros/fit_library/CB2Pdf.cxx index 7f2501825e3..05d13210aaa 100644 --- a/PWGDQ/Macros/fit_library/CB2Pdf.cxx +++ b/PWGDQ/Macros/fit_library/CB2Pdf.cxx @@ -11,13 +11,17 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "CB2Pdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(CB2Pdf); diff --git a/PWGDQ/Macros/fit_library/CB2Pdf.h b/PWGDQ/Macros/fit_library/CB2Pdf.h index a9e3a87409e..23cb291dcdd 100644 --- a/PWGDQ/Macros/fit_library/CB2Pdf.h +++ b/PWGDQ/Macros/fit_library/CB2Pdf.h @@ -11,14 +11,16 @@ /// \author Luca Micheletti , CERN -#ifndef CB2PDF -#define CB2PDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include + +#include +#include class CB2Pdf : public RooAbsPdf { @@ -51,4 +53,4 @@ class CB2Pdf : public RooAbsPdf ClassDef(CB2Pdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_CB2PDF_H_ diff --git a/PWGDQ/Macros/fit_library/ExpPdf.cxx b/PWGDQ/Macros/fit_library/ExpPdf.cxx old mode 100755 new mode 100644 index 1841ccd7cbb..c4e0d0988c1 --- a/PWGDQ/Macros/fit_library/ExpPdf.cxx +++ b/PWGDQ/Macros/fit_library/ExpPdf.cxx @@ -11,13 +11,16 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "ExpPdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(ExpPdf); diff --git a/PWGDQ/Macros/fit_library/ExpPdf.h b/PWGDQ/Macros/fit_library/ExpPdf.h old mode 100755 new mode 100644 index 394c73c52e6..306b0aea210 --- a/PWGDQ/Macros/fit_library/ExpPdf.h +++ b/PWGDQ/Macros/fit_library/ExpPdf.h @@ -11,14 +11,16 @@ /// \author Luca Micheletti , CERN -#ifndef EXPPDF -#define EXPPDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include + +#include +#include class ExpPdf : public RooAbsPdf { @@ -43,4 +45,4 @@ class ExpPdf : public RooAbsPdf ClassDef(ExpPdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_EXPPDF_H_ diff --git a/PWGDQ/Macros/fit_library/GausPdf.cxx b/PWGDQ/Macros/fit_library/GausPdf.cxx old mode 100755 new mode 100644 index 84d303e3a2b..2ec58abc577 --- a/PWGDQ/Macros/fit_library/GausPdf.cxx +++ b/PWGDQ/Macros/fit_library/GausPdf.cxx @@ -11,13 +11,16 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "GausPdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(GausPdf); diff --git a/PWGDQ/Macros/fit_library/GausPdf.h b/PWGDQ/Macros/fit_library/GausPdf.h old mode 100755 new mode 100644 index 4edb19ff47c..80a1e956817 --- a/PWGDQ/Macros/fit_library/GausPdf.h +++ b/PWGDQ/Macros/fit_library/GausPdf.h @@ -11,14 +11,16 @@ /// \author Luca Micheletti , CERN -#ifndef GAUSPDF -#define GAUSPDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include + +#include +#include class GausPdf : public RooAbsPdf { @@ -43,4 +45,4 @@ class GausPdf : public RooAbsPdf ClassDef(GausPdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_GAUSPDF_H_ diff --git a/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx b/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx old mode 100755 new mode 100644 index 912406a3b0b..ff254cc02ae --- a/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx +++ b/PWGDQ/Macros/fit_library/Pol4ExpPdf.cxx @@ -11,13 +11,16 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "Pol4ExpPdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(Pol4ExpPdf); diff --git a/PWGDQ/Macros/fit_library/Pol4ExpPdf.h b/PWGDQ/Macros/fit_library/Pol4ExpPdf.h old mode 100755 new mode 100644 index 13cd8696c6c..67202dbe5ac --- a/PWGDQ/Macros/fit_library/Pol4ExpPdf.h +++ b/PWGDQ/Macros/fit_library/Pol4ExpPdf.h @@ -11,14 +11,17 @@ /// \author Luca Micheletti , CERN -#ifndef POL4EXPPDF -#define POL4EXPPDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include +#include + +#include +#include TString nameParameters[] = {"p0", "p1", "p2", "p3", "p4", "p5", "N_bkg", "N_sig", "mean", "width"}; @@ -53,4 +56,4 @@ class Pol4ExpPdf : public RooAbsPdf ClassDef(Pol4ExpPdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_POL4EXPPDF_H_ diff --git a/PWGDQ/Macros/fit_library/VWGPdf.cxx b/PWGDQ/Macros/fit_library/VWGPdf.cxx index 8cebc90b2f4..e935afb4150 100644 --- a/PWGDQ/Macros/fit_library/VWGPdf.cxx +++ b/PWGDQ/Macros/fit_library/VWGPdf.cxx @@ -11,13 +11,16 @@ /// \author Luca Micheletti , CERN -#include "Riostream.h" - #include "VWGPdf.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" + +#include +#include +#include + +#include +#include + #include -#include "TMath.h" ClassImp(VWGPdf); diff --git a/PWGDQ/Macros/fit_library/VWGPdf.h b/PWGDQ/Macros/fit_library/VWGPdf.h index 9077d43be71..3ed4f2f81e6 100644 --- a/PWGDQ/Macros/fit_library/VWGPdf.h +++ b/PWGDQ/Macros/fit_library/VWGPdf.h @@ -11,14 +11,16 @@ /// \author Luca Micheletti , CERN -#ifndef VWGPDF -#define VWGPDF +#ifndef PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ +#define PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ -#include "RooAbsPdf.h" -#include "RooRealProxy.h" -#include "RooCategoryProxy.h" -#include "RooAbsReal.h" -#include "RooAbsCategory.h" +#include +#include +#include +#include + +#include +#include class VWGPdf : public RooAbsPdf { @@ -45,4 +47,4 @@ class VWGPdf : public RooAbsPdf ClassDef(VWGPdf, 1) // Your description goes here... }; -#endif +#endif // PWGDQ_MACROS_FIT_LIBRARY_VWGPDF_H_ diff --git a/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx b/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx index 22d5d78e6f7..209af151241 100644 --- a/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx +++ b/PWGDQ/TableProducer/generatedQuarkoniaMC.cxx @@ -17,47 +17,40 @@ // when dealing with derived data. #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGLF/DataModel/EPCalibrationTables.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" - -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" + +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/McCollisionExtra.h" -#include "Common/DataModel/Qvectors.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.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/RunningWorkflowInfo.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include +#include "Common/DataModel/Multiplicity.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 using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; // simple bit checkers #define bitset(var, nbit) ((var) |= (1 << (nbit))) diff --git a/PWGDQ/TableProducer/tableMaker.cxx b/PWGDQ/TableProducer/tableMaker.cxx index 5eb39ddd4d4..f2938705e87 100644 --- a/PWGDQ/TableProducer/tableMaker.cxx +++ b/PWGDQ/TableProducer/tableMaker.cxx @@ -17,13 +17,7 @@ // The skimming can optionally produce just the barrel, muon, or both barrel and muon tracks // The event filtering (filterPP), centrality, and V0Bits (from v0-selector) can be switched on/off by selecting one // of the process functions -// C++ includes -#include -#include -#include -#include -#include -// other includes + #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" @@ -44,32 +38,37 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsGlobalTracking/RecoContainer.h" -#include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h" -#include "DataFormatsITSMFT/ROFRecord.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexerParams.h" -#include "DetectorsVertexing/VertexTrackMatcher.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Primitive2D.h" -#include "ReconstructionDataFormats/PrimaryVertex.h" -#include "ReconstructionDataFormats/VtxTrackIndex.h" -#include "ReconstructionDataFormats/VtxTrackRef.h" - -#include "TGeoGlobalMagField.h" - -using std::cout; -using std::endl; +#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; diff --git a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx index d5690ab7b78..c5569ae7e14 100644 --- a/PWGDQ/TableProducer/tableMakerJpsiHf.cxx +++ b/PWGDQ/TableProducer/tableMakerJpsiHf.cxx @@ -15,7 +15,6 @@ /// \author Fabrizio Grosa , CERN #include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/HistogramsLibrary.h" @@ -24,13 +23,29 @@ #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/EventSelection.h" +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include #include +#include #include #include diff --git a/PWGDQ/TableProducer/tableMakerMC.cxx b/PWGDQ/TableProducer/tableMakerMC.cxx index e2c529a5a7d..8a2d93f9f89 100644 --- a/PWGDQ/TableProducer/tableMakerMC.cxx +++ b/PWGDQ/TableProducer/tableMakerMC.cxx @@ -26,6 +26,7 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" @@ -35,22 +36,30 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include "TList.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 diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index bb0b08895c6..f9e22bd4308 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -27,7 +27,8 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" @@ -37,24 +38,34 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include "TList.h" +#include "Tools/ML/MlResponse.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 diff --git a/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx b/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx index 11634be2e0d..84d9a42bbbc 100644 --- a/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx +++ b/PWGDQ/TableProducer/tableMakerMuonMchTrkEfficiency.cxx @@ -19,34 +19,37 @@ /// \author Zaida Conesa del Valle /// -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "TDatabasePDG.h" -// -#include "Common/DataModel/TrackSelectionTables.h" -// -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" -// -#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/AnalysisCompositeCut.h" +#include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGDQ/DataModel/MchTrkEffTables.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#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::aod; diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 7993444ad80..25c81606e27 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -17,14 +17,7 @@ // The skimming can optionally produce just the barrel, muon, or both barrel and muon tracks // The event filtering, centrality, and V0Bits (from v0-selector) can be switched on/off by selecting one // of the process functions -// C++ includes -#include -#include -#include -#include -#include -#include -// other includes + #include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" #include "PWGDQ/Core/CutsLibrary.h" @@ -34,44 +27,63 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/Zorro.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/FwdTrackReAlignTables.h" -#include "Common/DataModel/MftmchMatchingML.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsGlobalTracking/RecoContainer.h" -#include "DataFormatsGlobalTracking/RecoContainerCreateTracksVariadic.h" -#include "DataFormatsITSMFT/ROFRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexerParams.h" -#include "DetectorsVertexing/VertexTrackMatcher.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Primitive2D.h" -#include "ReconstructionDataFormats/PrimaryVertex.h" -#include "ReconstructionDataFormats/VtxTrackIndex.h" -#include "ReconstructionDataFormats/VtxTrackRef.h" - -#include "TGeoGlobalMagField.h" +#include "Tools/ML/MlResponse.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 +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/Tasks/DalitzSelection.cxx b/PWGDQ/Tasks/DalitzSelection.cxx index 4312434c2e6..c3768b02918 100644 --- a/PWGDQ/Tasks/DalitzSelection.cxx +++ b/PWGDQ/Tasks/DalitzSelection.cxx @@ -21,22 +21,31 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.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 "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include +#include #include #include #include @@ -47,7 +56,6 @@ using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; using namespace o2::soa; -using std::array; using MyEvents = soa::Join; diff --git a/PWGDQ/Tasks/MIDefficiency.cxx b/PWGDQ/Tasks/MIDefficiency.cxx index 3dcbcc4d595..26bca045c2b 100644 --- a/PWGDQ/Tasks/MIDefficiency.cxx +++ b/PWGDQ/Tasks/MIDefficiency.cxx @@ -18,25 +18,25 @@ /// /// \author Luca Quaglia - -// O2 physics classes #include "PWGDQ/DataModel/ReducedInfoTables.h" -// O2 -#include "DataFormatsMID/Track.h" //MID track from O2 -#include "Framework/Variant.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/CompletionPolicyHelpers.h" - -#include "MIDEfficiency/Efficiency.h" -#include "MIDBase/DetectorParameters.h" -#include "MIDBase/Mapping.h" +#include //MID track from O2 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::aod; diff --git a/PWGDQ/Tasks/ModelConverterEventExtended.cxx b/PWGDQ/Tasks/ModelConverterEventExtended.cxx index ec0a6a0c4be..b73eb3ea581 100644 --- a/PWGDQ/Tasks/ModelConverterEventExtended.cxx +++ b/PWGDQ/Tasks/ModelConverterEventExtended.cxx @@ -14,18 +14,12 @@ // Task used to convert the data model from the old format to the new format. To avoid // the conflict with the old data model. -// other includes #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include -#include -#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/Tasks/ModelConverterMultPv.cxx b/PWGDQ/Tasks/ModelConverterMultPv.cxx index 088590435b8..e844a1bd104 100644 --- a/PWGDQ/Tasks/ModelConverterMultPv.cxx +++ b/PWGDQ/Tasks/ModelConverterMultPv.cxx @@ -14,17 +14,14 @@ // Task used to convert the data model from the old format to the new format. To avoid // the conflict with the old data model. -// other includes -#include -#include -#include -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx b/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx index f4e28daee31..634c291cf9e 100644 --- a/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx +++ b/PWGDQ/Tasks/ModelConverterReducedMCEvents.cxx @@ -14,18 +14,12 @@ // Task used to convert the data model from the old format to the new format. To avoid // the conflict with the old data model. -// other includes #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include -#include -#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGDQ/Tasks/TagAndProbe.cxx b/PWGDQ/Tasks/TagAndProbe.cxx index 2a35b33b87e..b637ec64aad 100644 --- a/PWGDQ/Tasks/TagAndProbe.cxx +++ b/PWGDQ/Tasks/TagAndProbe.cxx @@ -12,57 +12,41 @@ /// \file TagAndProbe.cxx /// \brief Task Tag-And-Probe matching efficiency studies -#include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/HistogramsLibrary.h" -#include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TableHelper.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.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 using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/dqCorrelation.cxx b/PWGDQ/Tasks/dqCorrelation.cxx index f6ba8f3bd39..890bdefe46b 100644 --- a/PWGDQ/Tasks/dqCorrelation.cxx +++ b/PWGDQ/Tasks/dqCorrelation.cxx @@ -13,48 +13,43 @@ // #include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFW.h" -#include "PWGCF/GenericFramework/Core/GFWCumulant.h" -#include "PWGCF/GenericFramework/Core/GFWPowerArray.h" #include "PWGCF/GenericFramework/Core/GFWWeights.h" -#include "PWGDQ/Core/AnalysisCompositeCut.h" #include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/CutsLibrary.h" -#include "PWGDQ/Core/HistogramManager.h" -#include "PWGDQ/Core/HistogramsLibrary.h" -#include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" -#include "TProfile.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 -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/dqEfficiency.cxx b/PWGDQ/Tasks/dqEfficiency.cxx index c044d031729..45e84b4c3e4 100644 --- a/PWGDQ/Tasks/dqEfficiency.cxx +++ b/PWGDQ/Tasks/dqEfficiency.cxx @@ -23,26 +23,29 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/GeometryManager.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include +#include + +#include #include -#include #include #include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx index daf203e0b29..62d9bc01b32 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc.cxx @@ -26,28 +26,39 @@ #include "Common/Core/TableHelper.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.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 @@ -62,6 +73,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; // Some definitions namespace o2::aod diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx index 2d36e5dd0db..745e0833de4 100644 --- a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx +++ b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx @@ -24,37 +24,47 @@ #include "Common/Core/PID/PIDTOFParamService.h" #include "Common/Core/TableHelper.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" + +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include "TGeoGlobalMagField.h" -#include -#include #include #include +#include #include #include -#include +#include + +#include +#include +#include +#include +#include #include +#include #include #include #include @@ -69,6 +79,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; // Some definitions namespace o2::aod diff --git a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx index eae943e6124..8815bfa32d9 100644 --- a/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx +++ b/PWGDQ/Tasks/dqEnergyCorrelator_direct.cxx @@ -20,49 +20,44 @@ #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" #include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/Core/PID/PIDTOFParamService.h" -#include "Common/Core/TableHelper.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.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 std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/dqFlow.cxx b/PWGDQ/Tasks/dqFlow.cxx index 52e3ca8c29c..547068bab36 100644 --- a/PWGDQ/Tasks/dqFlow.cxx +++ b/PWGDQ/Tasks/dqFlow.cxx @@ -16,42 +16,51 @@ /// o2-analysis-timestamp --aod-file AO2D.root -b | o2-analysis-event-selection -b | o2-analysis-multiplicity-table -b | o2-analysis-centrality-table -b | o2-analysis-fdd-converter -b | o2-analysis-trackselection -b | o2-analysis-trackextension -b | o2-analysis-pid-tpc-full -b | o2-analysis-pid-tof-full -b | o2-analysis-pid-tof-base -b | o2-analysis-pid-tof-beta -b | o2-analysis-dq-flow -b /// tested (June 2, 2022) on AO2D.root files from train production 242 -#include -#include -#include -#include -#include -#include -#include -#include -#include "CCDB/BasicCCDBManager.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/Core/HistogramManager.h" -#include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/HistogramsLibrary.h" -#include "PWGDQ/Core/CutsLibrary.h" -#include "PWGDQ/Core/MixingLibrary.h" +#include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFW.h" #include "PWGCF/GenericFramework/Core/GFWCumulant.h" -#include "PWGCF/GenericFramework/Core/FlowContainer.h" #include "PWGCF/GenericFramework/Core/GFWWeights.h" -#include "PWGCF/GenericFramework/Core/GFWConfig.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "PWGDQ/Core/AnalysisCompositeCut.h" +#include "PWGDQ/Core/AnalysisCut.h" +#include "PWGDQ/Core/CutsLibrary.h" +#include "PWGDQ/Core/HistogramManager.h" +#include "PWGDQ/Core/HistogramsLibrary.h" +#include "PWGDQ/Core/VarManager.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Qvectors.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include using std::complex; -using std::cout; -using std::endl; using std::pow; using std::string; @@ -59,7 +68,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; -using namespace o2::analysis; // Declarations of various short names using MyBcs = soa::Join; diff --git a/PWGDQ/Tasks/filterPP.cxx b/PWGDQ/Tasks/filterPP.cxx index 61065f3fc74..1bfa487594e 100644 --- a/PWGDQ/Tasks/filterPP.cxx +++ b/PWGDQ/Tasks/filterPP.cxx @@ -19,35 +19,35 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.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 "EventFiltering/filterTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include #include #include #include +#include + +#include +#include +#include #include -#include #include #include #include #include -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/filterPPwithAssociation.cxx b/PWGDQ/Tasks/filterPPwithAssociation.cxx index 850b5811d8a..5cce787ffd7 100644 --- a/PWGDQ/Tasks/filterPPwithAssociation.cxx +++ b/PWGDQ/Tasks/filterPPwithAssociation.cxx @@ -19,35 +19,33 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/Core/CollisionAssociation.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.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 "EventFiltering/filterTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" - -#include "TGeoGlobalMagField.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include +#include + +#include +#include +#include #include #include #include diff --git a/PWGDQ/Tasks/filterPbPb.cxx b/PWGDQ/Tasks/filterPbPb.cxx index f127a7f3c26..8132956aa5b 100644 --- a/PWGDQ/Tasks/filterPbPb.cxx +++ b/PWGDQ/Tasks/filterPbPb.cxx @@ -9,17 +9,27 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // + #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "PWGUD/Core/SGCutParHolder.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UDHelpers.h" +#include "PWGUD/Core/UPCHelpers.h" -#include "CommonConstants/LHCConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Vertex.h" -#include +#include "Common/DataModel/EventSelection.h" -#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include #include diff --git a/PWGDQ/Tasks/mchAlignRecord.cxx b/PWGDQ/Tasks/mchAlignRecord.cxx index c3dbce0865f..e2a9814bd20 100644 --- a/PWGDQ/Tasks/mchAlignRecord.cxx +++ b/PWGDQ/Tasks/mchAlignRecord.cxx @@ -16,58 +16,45 @@ #include "PWGDQ/Core/VarManager.h" -#include "Common/DataModel/EventSelection.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonUtils/NameConf.h" -#include "DataFormatsMCH/Cluster.h" -#include "DataFormatsMCH/TrackMCH.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GRPGeomHelper.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsCommonDataFormats/AlignParam.h" -#include "DetectorsCommonDataFormats/DetID.h" -#include "DetectorsCommonDataFormats/DetectorNameConf.h" -#include "Framework/AnalysisTask.h" -#include "Framework/CallbackService.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" -#include "MCHAlign/Aligner.h" -#include "MCHBase/TrackerParam.h" -#include "MCHGeometryTransformer/Transformations.h" -#include "MCHTracking/Track.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackFitter.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackMCHMID.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 -#include -#include +#include +#include + +#include +#include #include -#include -#include +#include +#include +#include +#include #include #include -#include #include using namespace o2; @@ -76,8 +63,6 @@ using namespace o2::framework::expressions; using namespace o2::aod; using namespace std; -using std::cout; -using std::endl; const int fgNCh = 10; const int fgNDetElemCh[fgNCh] = {4, 4, 4, 4, 18, 18, 26, 26, 26, 26}; diff --git a/PWGDQ/Tasks/mftMchMatcher.cxx b/PWGDQ/Tasks/mftMchMatcher.cxx index efabe3b2d51..321cacb238d 100644 --- a/PWGDQ/Tasks/mftMchMatcher.cxx +++ b/PWGDQ/Tasks/mftMchMatcher.cxx @@ -14,37 +14,41 @@ #include "PWGDQ/Core/VarManager.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FwdTrackReAlignTables.h" -#include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MFTTracking/Constants.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 diff --git a/PWGDQ/Tasks/muonDCA.cxx b/PWGDQ/Tasks/muonDCA.cxx index a607ad16b4b..bbb4b63db5e 100644 --- a/PWGDQ/Tasks/muonDCA.cxx +++ b/PWGDQ/Tasks/muonDCA.cxx @@ -16,13 +16,24 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include using namespace o2; diff --git a/PWGDQ/Tasks/muonGlobalAlignment.cxx b/PWGDQ/Tasks/muonGlobalAlignment.cxx index 7ffbc5f2c6c..968bb3842a3 100644 --- a/PWGDQ/Tasks/muonGlobalAlignment.cxx +++ b/PWGDQ/Tasks/muonGlobalAlignment.cxx @@ -16,30 +16,70 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/DataModel/EventSelection.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MFTTracking/Constants.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 "rapidjson/document.h" #include -#include +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include #include +#include + using namespace o2; using namespace o2::mch; using namespace o2::framework; @@ -114,6 +154,7 @@ struct muonGlobalAlignment { Configurable fChamberResolutionX{"cfgChamberResolutionX", 0.4, "Chamber resolution along X configuration for refit"}; // 0.4cm pp, 0.2cm PbPb Configurable fChamberResolutionY{"cfgChamberResolutionY", 0.4, "Chamber resolution along Y configuration for refit"}; // 0.4cm pp, 0.2cm PbPb Configurable fSigmaCutImprove{"cfgSigmaCutImprove", 6., "Sigma cut for track improvement"}; + Configurable fMCHRealignCorrections{"cfgMCHRealignCorrections", "", "MCH DE positions/angles corrections in JSON format"}; } configRealign; //// Variables for ccdb @@ -167,6 +208,13 @@ struct muonGlobalAlignment { TrackFitter trackFitter; // Track fitter from MCH tracking library double mImproveCutChi2; // Chi2 cut for track improvement. + struct AlignmentCorrections { + double x{0}; + double y{0}; + double z{0}; + }; + std::map mMchAlignmentCorrections; + Preslice perMuon = aod::fwdtrkcl::fwdtrackId; o2::aod::rctsel::RCTFlagsChecker rctChecker{"CBT_muon_glo", false, false, true}; @@ -361,6 +409,26 @@ struct muonGlobalAlignment { trackFitter.useChamberResolution(); mImproveCutChi2 = 2. * configRealign.fSigmaCutImprove * configRealign.fSigmaCutImprove; + // Fill table of MCH alignment corrections + rapidjson::Document document; + // Check that the json is parsed correctly + rapidjson::ParseResult jsonOk = document.Parse(configRealign.fMCHRealignCorrections.value.c_str()); + if (jsonOk) { + for (rapidjson::Value::ConstMemberIterator it = document.MemberBegin(); it != document.MemberEnd(); it++) { + LOG(info) << "DE" << it->name.GetString() << " alignment corrections:"; + LOG(info) << " x: " << it->value["x"].GetDouble(); + LOG(info) << " y: " << it->value["y"].GetDouble(); + LOG(info) << " z: " << it->value["z"].GetDouble(); + + mMchAlignmentCorrections[std::stoi(it->name.GetString())] = { + it->value["x"].GetDouble(), + it->value["y"].GetDouble(), + it->value["z"].GetDouble()}; + } + } else { + LOG(error) << "JSON parse error: " << rapidjson::GetParseErrorFunc(jsonOk.Code()) << " (" << jsonOk.Offset() << ")"; + } + float mftLadderWidth = 1.7; AxisSpec dcaxMFTAxis = {400, -0.5, 0.5, "DCA_{x} (cm)"}; AxisSpec dcayMFTAxis = {400, -0.5, 0.5, "DCA_{y} (cm)"}; @@ -375,6 +443,8 @@ struct muonGlobalAlignment { AxisSpec vyAxis = {400, -0.5, 0.5, "vtx_{y} (cm)"}; AxisSpec vzAxis = {1000, -10.0, 10.0, "vtx_{z} (cm)"}; AxisSpec phiAxis = {36, -180.0, 180.0, "#phi (degrees)"}; + AxisSpec sxAxis = {50, -0.25, 0.25, "x slope"}; + AxisSpec syAxis = {50, -0.25, 0.25, "y slope"}; AxisSpec momAxis = {500, 0, 100.0, "p (GeV/c)"}; AxisSpec nMftClustersAxis = {6, 5, 11, "# of clusters"}; AxisSpec mftTrackTypeAxis = {2, 0, 2, "track type"}; @@ -395,6 +465,11 @@ struct muonGlobalAlignment { if (fEnableVertexShiftAnalysis) { registry.add("DCA/MFT/DCA_x_vs_phi_vs_zshift", std::format("DCA(x) vs. #phi vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, phiAxis, dcaxMFTAxis}}); registry.add("DCA/MFT/DCA_y_vs_phi_vs_zshift", std::format("DCA(y) vs. #phi vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, phiAxis, dcayMFTAxis}}); + + registry.add("DCA/MFT/DCA_x_vs_slopex_vs_zshift", std::format("DCA(x) vs. x slope vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, sxAxis, dcaxMFTAxis}}); + registry.add("DCA/MFT/DCA_x_vs_slopey_vs_zshift", std::format("DCA(x) vs. y slope vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, syAxis, dcaxMFTAxis}}); + registry.add("DCA/MFT/DCA_y_vs_slopex_vs_zshift", std::format("DCA(y) vs. x slope vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, sxAxis, dcayMFTAxis}}); + registry.add("DCA/MFT/DCA_y_vs_slopey_vs_zshift", std::format("DCA(y) vs. y slope vs. z shift").c_str(), {HistType::kTH3F, {zshiftAxis, syAxis, dcayMFTAxis}}); } if (fEnableMftDcaAnalysis) { @@ -438,6 +513,9 @@ struct muonGlobalAlignment { registry.add("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom", std::format("DCA(x) vs. p, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {{20, 0, 100.0, "p (GeV/c)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcaxMCHAxis}}); registry.add("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom", std::format("DCA(y) vs. p, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {{20, 0, 100.0, "p (GeV/c)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcayMCHAxis}}); + registry.add("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom_corr", std::format("DCA(x) vs. p, quadrant, chargeSign (with corrections)").c_str(), {HistType::kTHnSparseF, {{20, 0, 100.0, "p (GeV/c)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcaxMCHAxis}}); + registry.add("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom_corr", std::format("DCA(y) vs. p, quadrant, chargeSign (with corrections)").c_str(), {HistType::kTHnSparseF, {{20, 0, 100.0, "p (GeV/c)"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcayMCHAxis}}); + registry.add("residuals/dx_vs_chamber", "Cluster x residual vs. chamber, quadrant, chargeSign", {HistType::kTHnSparseF, {{10, 1, 11, "chamber"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dxAxis}}); registry.add("residuals/dy_vs_chamber", "Cluster y residual vs. chamber, quadrant, chargeSign", @@ -448,6 +526,16 @@ struct muonGlobalAlignment { registry.add("residuals/dy_vs_de", "Cluster y residual vs. DE, quadrant, chargeSign, momentum", {HistType::kTHnSparseF, {dyAxis, {getNumDE(), 0, static_cast(getNumDE()), "DE"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("residuals/dx_vs_chamber_corr", "Cluster x residual vs. chamber, quadrant, chargeSign (with corrections)", + {HistType::kTHnSparseF, {{10, 1, 11, "chamber"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dxAxis}}); + registry.add("residuals/dy_vs_chamber_corr", "Cluster y residual vs. chamber, quadrant, chargeSign (with corrections)", + {HistType::kTHnSparseF, {{10, 1, 11, "chamber"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dyAxis}}); + + registry.add("residuals/dx_vs_de_corr", "Cluster x residual vs. DE, quadrant, chargeSign, momentum (with corrections)", + {HistType::kTHnSparseF, {dxAxis, {getNumDE(), 0, static_cast(getNumDE()), "DE"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + registry.add("residuals/dy_vs_de_corr", "Cluster y residual vs. DE, quadrant, chargeSign, momentum (with corrections)", + {HistType::kTHnSparseF, {dyAxis, {getNumDE(), 0, static_cast(getNumDE()), "DE"}, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, {20, 0, 100.0, "p (GeV/c)"}}}); + if (fEnableMftMchResidualsExtraPlots) { registry.add("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_vz", std::format("DCA(x) vs. vz, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {dcazAxis, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcaxMCHAxis}}); registry.add("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_vz", std::format("DCA(y) vs. vz, quadrant, chargeSign").c_str(), {HistType::kTHnSparseF, {dcazAxis, {4, 0, 4, "quadrant"}, {2, 0, 2, "sign"}, dcayMCHAxis}}); @@ -917,7 +1005,7 @@ struct muonGlobalAlignment { return fwdtrack; } - void TransformMFT(o2::mch::TrackParam& track) + void TransformMFTPar(o2::mch::TrackParam& track) { // double zCH10 = -1437.6; double z = track.getZ(); @@ -950,7 +1038,7 @@ struct muonGlobalAlignment { { auto mchTrack = FwdtoMCH(track); - TransformMFT(mchTrack); + TransformMFTPar(mchTrack); auto transformedTrack = sExtrap.MCHtoFwd(mchTrack); track.setParameters(transformedTrack.getParameters()); @@ -967,7 +1055,7 @@ struct muonGlobalAlignment { auto mchTrack = FwdtoMCH(track); - TransformMFT(mchTrack); + TransformMFTPar(mchTrack); auto transformedTrack = sExtrap.MCHtoFwd(mchTrack); fwdtrack.setParameters(transformedTrack.getParameters()); @@ -1217,11 +1305,11 @@ struct muonGlobalAlignment { return propmuon; } - template - o2::dataformats::GlobalFwdTrack PropagateMFTtoMCH(const TMFT& mftTrack, const TMCH& mchTrack, const double z) + template + o2::dataformats::GlobalFwdTrack PropagateMFTtoMCH(const TMFT& mftTrack, const o2::mch::TrackParam& mchTrackPar, const double z) { // extrapolation with MCH tools - auto mchTrackAtMFT = FwdtoMCH(FwdToTrackPar(mchTrack)); + auto mchTrackAtMFT = mchTrackPar; o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchTrackAtMFT, mftTrack.z()); auto mftTrackPar = FwdToTrackPar(mftTrack); @@ -1232,24 +1320,13 @@ struct muonGlobalAlignment { UpdateTrackMomentum(mftTrackProp, mchTrackAtMFT); if (z < -505.f) { o2::mch::TrackExtrap::extrapToZ(mftTrackProp, -466.f); - UpdateTrackMomentum(mftTrackProp, sExtrap.FwdtoMCH(FwdToTrackPar(mchTrack))); + UpdateTrackMomentum(mftTrackProp, mchTrackPar); } o2::mch::TrackExtrap::extrapToZ(mftTrackProp, z); return MCHtoFwd(mftTrackProp); } - template - o2::dataformats::GlobalFwdTrack PropagateMFTtoMCH_(const TMFT& mftTrack, const TMCH& mchTrack, const double z) - { - // extrapolation with MCH tools - auto mftTrackProp = sExtrap.FwdtoMCH(FwdToTrackPar(mftTrack)); - UpdateTrackMomentum(mftTrackProp, sExtrap.FwdtoMCH(FwdToTrackPar(mchTrack))); - o2::mch::TrackExtrap::extrapToZ(mftTrackProp, z); - - return sExtrap.MCHtoFwd(mftTrackProp); - } - void FillDCAPlots(MyEvents const& collisions, MyBCs const& bcs, MyMuonsWithCov const& muonTracks, @@ -1346,7 +1423,7 @@ struct muonGlobalAlignment { } if (fEnableVertexShiftAnalysis) { - if (mftTrack.chi2() <= fTrackChi2MftUp && std::fabs(collision.posZ()) < 1.f) { + if (mftTrack.chi2() <= fTrackChi2MftUp && std::fabs(collision.posZ()) < 1.f && mftNclusters >= 6) { float zshift[21] = {// in millimeters -5.0, -4.5, -4.0, -3.5, -3.0, -2.5, -2.0, -1.5, -1.0, -0.5, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0}; @@ -1356,6 +1433,14 @@ struct muonGlobalAlignment { double dcayShifted = mftTrackAtDCAshifted.getY() - collision.posY(); registry.get(HIST("DCA/MFT/DCA_x_vs_phi_vs_zshift"))->Fill(zshift[zi], phi, dcaxShifted); registry.get(HIST("DCA/MFT/DCA_y_vs_phi_vs_zshift"))->Fill(zshift[zi], phi, dcayShifted); + + auto mftTrackAtDCAshiftedPar = FwdtoMCH(mftTrackAtDCAshifted); + auto slopex = mftTrackAtDCAshiftedPar.getNonBendingSlope(); + auto slopey = mftTrackAtDCAshiftedPar.getBendingSlope(); + registry.get(HIST("DCA/MFT/DCA_x_vs_slopex_vs_zshift"))->Fill(zshift[zi], slopex, dcaxShifted); + registry.get(HIST("DCA/MFT/DCA_x_vs_slopey_vs_zshift"))->Fill(zshift[zi], slopey, dcaxShifted); + registry.get(HIST("DCA/MFT/DCA_y_vs_slopex_vs_zshift"))->Fill(zshift[zi], slopex, dcayShifted); + registry.get(HIST("DCA/MFT/DCA_y_vs_slopey_vs_zshift"))->Fill(zshift[zi], slopey, dcayShifted); } } } @@ -1386,7 +1471,7 @@ struct muonGlobalAlignment { continue; } - bool isGoodMFT = IsGoodMFT(mftTrack, 999.f, 5); + bool isGoodMFT = IsGoodMFT(mftTrack, fTrackChi2MftUp, 5); if (!isGoodMFT) { continue; } @@ -1409,6 +1494,68 @@ struct muonGlobalAlignment { } } + template + bool MchRealignTrack(const TMUON& mchTrack, const TCLUS& clusters, TrackRealigned& convertedTrack, bool applyCorrections) + { + // loop over attached clusters + int clIndex = -1; + auto clustersSliced = clusters.sliceBy(perMuon, mchTrack.globalIndex()); // Slice clusters by muon id + for (auto const& cluster : clustersSliced) { + clIndex += 1; + + int deId = cluster.deId(); + int chamber = deId / 100 - 1; + if (chamber < 0 || chamber > 9) { + continue; + } + + math_utils::Point3D local; + math_utils::Point3D master; + + master.SetXYZ(cluster.x(), cluster.y(), cluster.z()); + + if (configRealign.fEnableMCHRealign) { + // Transformation from reference geometry frame to new geometry frame + transformRef[cluster.deId()].MasterToLocal(master, local); + transformNew[cluster.deId()].LocalToMaster(local, master); + } + + if (applyCorrections) { + auto correctionsIt = mMchAlignmentCorrections.find(cluster.deId()); + if (correctionsIt != mMchAlignmentCorrections.end()) { + const auto& corrections = correctionsIt->second; + master.SetX(master.x() + corrections.x); + master.SetY(master.y() + corrections.y); + master.SetZ(master.z() + corrections.z); + } + } + + // realigned MCH cluster + mch::Cluster* clusterMCH = new mch::Cluster(); + clusterMCH->x = master.x(); + clusterMCH->y = master.y(); + clusterMCH->z = master.z(); + + uint32_t ClUId = mch::Cluster::buildUniqueId(static_cast(cluster.deId() / 100) - 1, cluster.deId(), clIndex); + clusterMCH->uid = ClUId; + clusterMCH->ex = cluster.isGoodX() ? 0.2 : 10.0; + clusterMCH->ey = cluster.isGoodY() ? 0.2 : 10.0; + + // Add transformed cluster into temporary variable + convertedTrack.createParamAtCluster(*clusterMCH); + } + + bool removable{false}; + // Refit the re-aligned track + if (convertedTrack.getNClusters() != 0) { + removable = RemoveTrack(convertedTrack); + } else { + LOGF(fatal, "Muon track %d has no associated clusters.", mchTrack.globalIndex()); + } + + return !removable; + } + void FillResidualsPlots(MyEvents const& collisions, MyBCs const& bcs, MyMuonsWithCov const& muonTracks, @@ -1445,13 +1592,23 @@ struct muonGlobalAlignment { if (!isGoodMFT) continue; + // refit MCH track if enabled TrackRealigned convertedTrack; + bool convertedTrackOk = false; + if (configRealign.fEnableMCHRealign) { + convertedTrackOk = MchRealignTrack(mchTrack, clusters, convertedTrack, false); + } + + // apply alignment corrections if available + TrackRealigned convertedTrackWithCorr; + bool convertedTrackWithCorrOk = false; + if (!mMchAlignmentCorrections.empty()) { + convertedTrackWithCorrOk = MchRealignTrack(mchTrack, clusters, convertedTrackWithCorr, true); + } + // loop over attached clusters - int clIndex = -1; auto clustersSliced = clusters.sliceBy(perMuon, mchTrack.globalIndex()); // Slice clusters by muon id for (auto const& cluster : clustersSliced) { - clIndex += 1; - int deId = cluster.deId(); int chamber = deId / 100 - 1; if (chamber < 0 || chamber > 9) @@ -1460,51 +1617,65 @@ struct muonGlobalAlignment { math_utils::Point3D local; math_utils::Point3D master; + math_utils::Point3D masterWithCorr; master.SetXYZ(cluster.x(), cluster.y(), cluster.z()); + masterWithCorr.SetXYZ(cluster.x(), cluster.y(), cluster.z()); + // apply realignment to MCH cluster if (configRealign.fEnableMCHRealign) { // Transformation from reference geometry frame to new geometry frame transformRef[cluster.deId()].MasterToLocal(master, local); transformNew[cluster.deId()].LocalToMaster(local, master); + transformNew[cluster.deId()].LocalToMaster(local, masterWithCorr); + } - mch::Cluster* clusterMCH = new mch::Cluster(); - clusterMCH->x = master.x(); - clusterMCH->y = master.y(); - clusterMCH->z = master.z(); + // apply alignment corrections to MCH cluster (if available) + if (!mMchAlignmentCorrections.empty()) { + auto correctionsIt = mMchAlignmentCorrections.find(cluster.deId()); + if (correctionsIt != mMchAlignmentCorrections.end()) { + const auto& corrections = correctionsIt->second; + masterWithCorr.SetX(masterWithCorr.x() + corrections.x); + masterWithCorr.SetY(masterWithCorr.y() + corrections.y); + masterWithCorr.SetZ(masterWithCorr.z() + corrections.z); + } + } - uint32_t ClUId = mch::Cluster::buildUniqueId(static_cast(cluster.deId() / 100) - 1, cluster.deId(), clIndex); - clusterMCH->uid = ClUId; - clusterMCH->ex = cluster.isGoodX() ? 0.2 : 10.0; - clusterMCH->ey = cluster.isGoodY() ? 0.2 : 10.0; + // MFT-MCH residuals (MCH cluster is realigned if enabled) + // if the realignment is enabled and successful, the MFT track is extrpolated + // by taking the momentum from the MCH track refitted with the new alignment + if (!configRealign.fEnableMCHRealign || convertedTrackOk) { + auto mftTrackAtCluster = configRealign.fEnableMCHRealign ? PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrack.first()), master.z()) : PropagateMFTtoMCH(mftTrack, FwdtoMCH(FwdToTrackPar(mchTrack)), master.z()); - // Add transformed cluster into temporary variable - convertedTrack.createParamAtCluster(*clusterMCH); - } + std::array xPos{master.x(), mftTrackAtCluster.getX()}; + std::array yPos{master.y(), mftTrackAtCluster.getY()}; - auto mftTrackAtCluster = PropagateMFTtoMCH(mftTrack, mchTrack, master.z()); + registry.get(HIST("residuals/dx_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); + registry.get(HIST("residuals/dy_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); - std::array xPos{master.x(), mftTrackAtCluster.getX()}; - std::array yPos{master.y(), mftTrackAtCluster.getY()}; + registry.get(HIST("residuals/dx_vs_de"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + registry.get(HIST("residuals/dy_vs_de"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + } - registry.get(HIST("residuals/dx_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); - registry.get(HIST("residuals/dy_vs_chamber"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); + // MFT-MCH residuals with realigned and/or corrected MCH clusters + // if the alignment corrections are available and the refitting is successful, the MFT track is extrpolated + // by taking the momentum from the MCH track refitted with the alignment corrections and the new + // alignment (if realignment is enabled) + if (convertedTrackWithCorrOk) { + auto mftTrackAtClusterWithCorr = PropagateMFTtoMCH(mftTrack, mch::TrackParam(convertedTrackWithCorr.first()), masterWithCorr.z()); - registry.get(HIST("residuals/dx_vs_de"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); - registry.get(HIST("residuals/dy_vs_de"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); - } + std::array xPos{masterWithCorr.x(), mftTrackAtClusterWithCorr.getX()}; + std::array yPos{masterWithCorr.y(), mftTrackAtClusterWithCorr.getY()}; - bool removable{false}; - if (configRealign.fEnableMCHRealign) { - // Refit the re-aligned track - if (convertedTrack.getNClusters() != 0) { - removable = RemoveTrack(convertedTrack); - } else { - LOGF(fatal, "Muon track %d has no associated clusters.", mchTrack.globalIndex()); + registry.get(HIST("residuals/dx_vs_chamber_corr"))->Fill(chamber + 1, quadrantMch, posNeg, xPos[0] - xPos[1]); + registry.get(HIST("residuals/dy_vs_chamber_corr"))->Fill(chamber + 1, quadrantMch, posNeg, yPos[0] - yPos[1]); + + registry.get(HIST("residuals/dx_vs_de_corr"))->Fill(xPos[0] - xPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); + registry.get(HIST("residuals/dy_vs_de_corr"))->Fill(yPos[0] - yPos[1], deIndex, quadrantMch, posNeg, mchTrack.p()); } } - if (!removable) { + if (!configRealign.fEnableMCHRealign || convertedTrackOk) { auto mchTrackAtDCA = configRealign.fEnableMCHRealign ? PropagateMCHRealigned(convertedTrack, collision.posZ()) : PropagateMCH(mchTrack, collision.posZ()); auto dcax = mchTrackAtDCA.getX() - collision.posX(); auto dcay = mchTrackAtDCA.getY() - collision.posY(); @@ -1521,6 +1692,15 @@ struct muonGlobalAlignment { registry.get(HIST("residuals/dphi_at_mft"))->Fill(deltaPhi, mftTrack.x(), mftTrack.y(), posNeg, mchTrackAtMFT.getP()); } } + + if (convertedTrackWithCorrOk) { + auto mchTrackAtDCA = PropagateMCHRealigned(convertedTrackWithCorr, collision.posZ()); + auto dcax = mchTrackAtDCA.getX() - collision.posX(); + auto dcay = mchTrackAtDCA.getY() - collision.posY(); + + registry.get(HIST("DCA/MCH/DCA_x_vs_sign_vs_quadrant_vs_mom_corr"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcax); + registry.get(HIST("DCA/MCH/DCA_y_vs_sign_vs_quadrant_vs_mom_corr"))->Fill(mchTrack.p(), quadrantMch, posNeg, dcay); + } } } } diff --git a/PWGDQ/Tasks/qaMatching.cxx b/PWGDQ/Tasks/qaMatching.cxx index ea18c0aa9d7..20277a78696 100644 --- a/PWGDQ/Tasks/qaMatching.cxx +++ b/PWGDQ/Tasks/qaMatching.cxx @@ -15,35 +15,146 @@ // #include "PWGDQ/Core/MuonMatchingMlResponse.h" #include "PWGDQ/Core/VarManager.h" -#include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/DataModel/EventSelection.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MFTTracking/Constants.h" - -#include +#include "Tools/ML/MlResponse.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 // 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 +#include #include #include #include #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::aod; +namespace qamatching +{ +DECLARE_SOA_COLUMN(P, p, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(Eta, eta, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(MatchLabel, matchLabel, int8_t); +DECLARE_SOA_COLUMN(TrackId, trackId, int64_t); +DECLARE_SOA_COLUMN(MatchType, matchType, int8_t); +DECLARE_SOA_COLUMN(MatchScore, matchScore, float); +DECLARE_SOA_COLUMN(MatchRanking, matchRanking, int32_t); +DECLARE_SOA_COLUMN(MftMultiplicity, mftMultiplicity, int32_t); +DECLARE_SOA_COLUMN(TrackType, trackType, int8_t); +DECLARE_SOA_COLUMN(MftMatchAttempts, mftMatchAttempts, int32_t); +DECLARE_SOA_COLUMN(XAtVtx, xAtVtx, float); +DECLARE_SOA_COLUMN(YAtVtx, yAtVtx, float); +DECLARE_SOA_COLUMN(ZAtVtx, zAtVtx, float); +DECLARE_SOA_COLUMN(PxAtVtx, pxAtVtx, float); +DECLARE_SOA_COLUMN(PyAtVtx, pyAtVtx, float); +DECLARE_SOA_COLUMN(PzAtVtx, pzAtVtx, float); +DECLARE_SOA_COLUMN(ColX, colX, float); +DECLARE_SOA_COLUMN(ColY, colY, float); +DECLARE_SOA_COLUMN(ColZ, colZ, float); +} // namespace qamatching + +namespace o2::aod +{ +DECLARE_SOA_TABLE(QaMatchingEvents, "AOD", "QAMEVT", + o2::soa::Index<>, + qamatching::MftMultiplicity, + qamatching::ColX, + qamatching::ColY, + qamatching::ColZ); +} // namespace o2::aod + +namespace qamatching +{ +DECLARE_SOA_INDEX_COLUMN_FULL(ReducedEvent, reducedEvent, int32_t, o2::aod::QaMatchingEvents, ""); +} // namespace qamatching + +namespace o2::aod +{ +DECLARE_SOA_TABLE(QaMatchingMCHTrack, "AOD", "QAMCHTRK", + qamatching::ReducedEventId, + qamatching::TrackId, + qamatching::TrackType, + qamatching::P, + qamatching::Pt, + qamatching::Eta, + qamatching::Phi, + qamatching::MftMatchAttempts, + qamatching::XAtVtx, + qamatching::YAtVtx, + qamatching::ZAtVtx, + qamatching::PxAtVtx, + qamatching::PyAtVtx, + qamatching::PzAtVtx); +DECLARE_SOA_TABLE(QaMatchingCandidates, "AOD", "QAMCAND", + qamatching::ReducedEventId, + qamatching::MatchLabel, + qamatching::TrackId, + qamatching::P, qamatching::Pt, qamatching::Eta, qamatching::Phi, + qamatching::MatchType, qamatching::MatchScore, qamatching::MatchRanking, + qamatching::XAtVtx, + qamatching::YAtVtx, + qamatching::ZAtVtx, + qamatching::PxAtVtx, + qamatching::PyAtVtx, + qamatching::PzAtVtx); +} // namespace o2::aod + using MyEvents = soa::Join; using MyMuons = soa::Join; using MyMuonsMC = soa::Join; @@ -57,20 +168,20 @@ using MyMFT = MyMFTs::iterator; using MyMFTCovariance = MyMFTCovariances::iterator; using SMatrix55 = ROOT::Math::SMatrix>; -using SMatrix5 = ROOT::Math::SVector; +using SMatrix5 = ROOT::Math::SVector; static float chi2ToScore(float chi2, int ndf, float chi2max) { - double p = -TMath::Log10(ROOT::Math::chisquared_cdf_c(chi2, ndf)); - double pnorm = -TMath::Log10(ROOT::Math::chisquared_cdf_c(chi2max, ndf)); + double p = -std::log10(ROOT::Math::chisquared_cdf_c(chi2, ndf)); + double pnorm = -std::log10(ROOT::Math::chisquared_cdf_c(chi2max, ndf)); double result = (1.f / (p / pnorm + 1.f)); return static_cast(result); } -struct qaMatching { +struct QaMatching { template - using matrix = std::array, nr>; + using Matrix = std::array, nr>; enum MuonMatchType { kMatchTypeTrueLeading = 0, @@ -84,6 +195,22 @@ struct qaMatching { kMatchTypeUndefined }; + static constexpr int GlobalTrackTypeMax = 2; + static constexpr int MchMidTrackType = 3; + static constexpr int FirstDecayMotherRank = 2; + static constexpr int MftTrackTypeStandard = 0; + static constexpr int MftTrackTypeCA = 1; + static constexpr int ThetaAbsBoundaryDeg = 3; + static constexpr double SlopeResolutionZ = 535.; + static constexpr int MatchingDegreesOfFreedom = 5; + static constexpr size_t MinCandidatesForDeltaChi2 = 2; + static constexpr float MatchingScoreChi2Max = 50.f; + static constexpr float InvalidDeltaChi2 = -1.f; + static constexpr int ExtrapolationMethodStandard = 0; + static constexpr int ExtrapolationMethodMftFirstPoint = 2; + static constexpr int ExtrapolationMethodVertex = 3; + static constexpr int ExtrapolationMethodMftDca = 4; + struct MatchingCandidate { int64_t collisionId{-1}; int64_t globalTrackId{-1}; @@ -100,170 +227,171 @@ struct qaMatching { }; //// Variables for selecting muon tracks - Configurable fPMchLow{"cfgPMchLow", 0.0f, ""}; - Configurable fPtMchLow{"cfgPtMchLow", 0.7f, ""}; - Configurable fEtaMchLow{"cfgEtaMchLow", -4.0f, ""}; - Configurable fEtaMchUp{"cfgEtaMchUp", -2.5f, ""}; - Configurable fRabsLow{"cfgRabsLow", 17.6f, ""}; - Configurable fRabsUp{"cfgRabsUp", 89.5f, ""}; - Configurable fSigmaPdcaUp{"cfgPdcaUp", 6.f, ""}; - Configurable fTrackChi2MchUp{"cfgTrackChi2MchUp", 5.f, ""}; - Configurable fMatchingChi2MchMidUp{"cfgMatchingChi2MchMidUp", 999.f, ""}; + Configurable cfgPMchLow{"cfgPMchLow", 0.0f, ""}; + Configurable cfgPtMchLow{"cfgPtMchLow", 0.7f, ""}; + Configurable cfgEtaMchLow{"cfgEtaMchLow", -4.0f, ""}; + Configurable cfgEtaMchUp{"cfgEtaMchUp", -2.5f, ""}; + Configurable cfgRabsLow{"cfgRabsLow", 17.6f, ""}; + Configurable cfgRabsUp{"cfgRabsUp", 89.5f, ""}; + Configurable cfgPdcaUp{"cfgPdcaUp", 6.f, ""}; + Configurable cfgTrackChi2MchUp{"cfgTrackChi2MchUp", 5.f, ""}; + Configurable cfgMatchingChi2MchMidUp{"cfgMatchingChi2MchMidUp", 999.f, ""}; //// Variables for selecting mft tracks - Configurable fEtaMftLow{"cfgEtaMftlow", -3.6f, ""}; - Configurable fEtaMftUp{"cfgEtaMftup", -2.5f, ""}; - Configurable fTrackNClustMftLow{"cfgTrackNClustMftLow", 7, ""}; - Configurable fTrackChi2MftUp{"cfgTrackChi2MftUp", 999.f, ""}; + Configurable cfgEtaMftLow{"cfgEtaMftLow", -3.6f, ""}; + Configurable cfgEtaMftUp{"cfgEtaMftUp", -2.5f, ""}; + Configurable cfgTrackNClustMftLow{"cfgTrackNClustMftLow", 7, ""}; + Configurable cfgTrackChi2MftUp{"cfgTrackChi2MftUp", 999.f, ""}; //// Variables for selecting global tracks - Configurable fMatchingChi2ScoreMftMchLow{"cfgMatchingChi2ScoreMftMchLow", chi2ToScore(50.f, 5, 50.f), ""}; + Configurable cfgMatchingChi2ScoreMftMchLow{"cfgMatchingChi2ScoreMftMchLow", chi2ToScore(50.f, 5, 50.f), ""}; //// Variables for selecting tagged muons - Configurable fMuonTaggingNCrossedMftPlanesLow{"cfgMuonTaggingNCrossedMftPlanesLow", 5, ""}; - Configurable fMuonTaggingTrackChi2MchUp{"cfgMuonTaggingTrackChi2MchUp", 5.f, ""}; - Configurable fMuonTaggingPMchLow{"cfgMuonTaggingPMchLow", 0.0f, ""}; - Configurable fMuonTaggingPtMchLow{"cfgMuonTaggingPtMchLow", 0.7f, ""}; - Configurable fMuonTaggingEtaMchLow{"cfgMuonTaggingEtaMchLow", -3.6f, ""}; - Configurable fMuonTaggingEtaMchUp{"cfgMuonTaggingEtaMchUp", -2.5f, ""}; - Configurable fMuonTaggingRabsLow{"cfgMuonTaggingRabsLow", 17.6f, ""}; - Configurable fMuonTaggingRabsUp{"cfgMuonTaggingRabsUp", 89.5f, ""}; - Configurable fMuonTaggingSigmaPdcaUp{"cfgMuonTaggingPdcaUp", 4.f, ""}; - Configurable fMuonTaggingChi2DiffLow{"cfgMuonTaggingChi2DiffLow", 100.f, ""}; + Configurable cfgMuonTaggingNCrossedMftPlanesLow{"cfgMuonTaggingNCrossedMftPlanesLow", 5, ""}; + Configurable cfgMuonTaggingTrackChi2MchUp{"cfgMuonTaggingTrackChi2MchUp", 5.f, ""}; + Configurable cfgMuonTaggingPMchLow{"cfgMuonTaggingPMchLow", 0.0f, ""}; + Configurable cfgMuonTaggingPtMchLow{"cfgMuonTaggingPtMchLow", 0.7f, ""}; + Configurable cfgMuonTaggingEtaMchLow{"cfgMuonTaggingEtaMchLow", -3.6f, ""}; + Configurable cfgMuonTaggingEtaMchUp{"cfgMuonTaggingEtaMchUp", -2.5f, ""}; + Configurable cfgMuonTaggingRabsLow{"cfgMuonTaggingRabsLow", 17.6f, ""}; + Configurable cfgMuonTaggingRabsUp{"cfgMuonTaggingRabsUp", 89.5f, ""}; + Configurable cfgMuonTaggingPdcaUp{"cfgMuonTaggingPdcaUp", 4.f, ""}; + Configurable cfgMuonTaggingChi2DiffLow{"cfgMuonTaggingChi2DiffLow", 100.f, ""}; //// Variables for ccdb - Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; - Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + Configurable grpMagPath{"grpMagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; // CCDB connection configurables struct : ConfigurableGroup { - Configurable fConfigCcdbUrl{"ccdb-url-", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - Configurable fConfigNoLaterThan{"ccdb-no-later-than-", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; - Configurable fConfigGrpPath{"grpPath-", "GLO/GRP/GRP", "Path of the grp file"}; - Configurable fConfigGeoPath{"geoPath-", "GLO/Config/GeometryAligned", "Path of the geometry file"}; - Configurable fConfigGrpMagPath{"grpmagPath-", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; - } fConfigCCDB; + Configurable cfgCcdbUrl{"cfgCcdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + Configurable cfgCcdbNoLaterThan{"cfgCcdbNoLaterThan", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "latest acceptable timestamp of creation for the object"}; + Configurable cfgGrpPath{"cfgGrpPath", "GLO/GRP/GRP", "Path of the grp file"}; + Configurable cfgGeoPath{"cfgGeoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + Configurable cfgGrpmagPath{"cfgGrpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + } configCcdb; struct : ConfigurableGroup { - Configurable fCreatePdgMomHistograms{"cfgCreatePdgMomHistograms", false, "create matching characteristics plots with particle mom PDG codes"}; - } fConfigQAs; + Configurable cfgCreatePdgMomHistograms{"cfgCreatePdgMomHistograms", false, "create matching characteristics plots with particle mom PDG codes"}; + } configQas; /// Variables for histograms configuration - Configurable fNCandidatesMax{"cfgNCandidatesMax", 5, "Number of matching candidates stored for each muon track"}; - Configurable fMftTrackMultiplicityMax{"cfgMftTrackMultiplicityMax", 1000, "Maximum number of MFT tracks per collision"}; + Configurable cfgNCandidatesMax{"cfgNCandidatesMax", 5, "Number of matching candidates stored for each muon track"}; + Configurable cfgMftTrackMultiplicityMax{"cfgMftTrackMultiplicityMax", 1000, "Maximum number of MFT tracks per collision"}; + Configurable cfgQaMatchingAodDebug{"cfgQaMatchingAodDebug", 0, "If >0, print AO2D filling debug (0=off, N=max collisions)"}; double mBzAtMftCenter{0}; o2::globaltracking::MatchGlobalFwd mExtrap; - using MatchingFunc_t = std::function(const o2::dataformats::GlobalFwdTrack& mchtrack, const o2::track::TrackParCovFwd& mfttrack)>; - std::map mMatchingFunctionMap; ///< MFT-MCH Matching function + using MatchingFunc = std::function(const o2::dataformats::GlobalFwdTrack& mchtrack, const o2::track::TrackParCovFwd& mfttrack)>; + std::map mMatchingFunctionMap; ///< MFT-MCH Matching function // Chi2 matching interface - static constexpr int sChi2FunctionsNum = 5; + static constexpr int Chi2FunctionsNum = 5; struct : ConfigurableGroup { - Configurable fFunctionLabel_1{"cfgChi2FunctionLabel_1", std::string{"ProdAll"}, "Text label identifying this chi2 matching method"}; - Configurable fFunctionLabel_2{"cfgChi2FunctionLabel_2", std::string{"MatchXYPhiTanlMom"}, "Text label identifying this chi2 matching method"}; - Configurable fFunctionLabel_3{"cfgChi2FunctionLabel_3", std::string{"MatchXYPhiTanl"}, "Text label identifying this chi2 matching method"}; - Configurable fFunctionLabel_4{"cfgChi2FunctionLabel_4", std::string{""}, "Text label identifying this chi2 matching method"}; - Configurable fFunctionLabel_5{"cfgChi2FunctionLabel_5", std::string{""}, "Text label identifying this chi2 matching method"}; - std::array*, sChi2FunctionsNum> fFunctionLabel{ - &fFunctionLabel_1, &fFunctionLabel_2, &fFunctionLabel_3, &fFunctionLabel_4, &fFunctionLabel_5}; - - Configurable fFunctionNames_1{"cfgChi2FunctionNames_1", std::string{"prod"}, "Name of the chi2 matching function"}; - Configurable fFunctionNames_2{"cfgChi2FunctionNames_2", std::string{"matchALL"}, "Name of the chi2 matching function"}; - Configurable fFunctionNames_3{"cfgChi2FunctionNames_3", std::string{"matchXYPhiTanl"}, "Name of the chi2 matching function"}; - Configurable fFunctionNames_4{"cfgChi2FunctionNames_4", std::string{""}, "Name of the chi2 matching function"}; - Configurable fFunctionNames_5{"cfgChi2FunctionNames_5", std::string{""}, "Name of the chi2 matching function"}; - std::array*, sChi2FunctionsNum> fFunctionName{ - &fFunctionNames_1, &fFunctionNames_2, &fFunctionNames_3, &fFunctionNames_4, &fFunctionNames_5}; - - Configurable fMatchingScoreCut_1{"cfgChi2FunctionMatchingScoreCut_1", 0.f, "Minimum score value for selecting good matches"}; - Configurable fMatchingScoreCut_2{"cfgChi2FunctionMatchingScoreCut_2", 0.5f, "Minimum score value for selecting good matches"}; - Configurable fMatchingScoreCut_3{"cfgChi2FunctionMatchingScoreCut_3", 0.5f, "Minimum score value for selecting good matches"}; - Configurable fMatchingScoreCut_4{"cfgChi2FunctionMatchingScoreCut_4", 0.5f, "Minimum score value for selecting good matches"}; - Configurable fMatchingScoreCut_5{"cfgChi2FunctionMatchingScoreCut_5", 0.5f, "Minimum score value for selecting good matches"}; - std::array*, sChi2FunctionsNum> fMatchingScoreCut{ - &fMatchingScoreCut_1, &fMatchingScoreCut_2, &fMatchingScoreCut_3, &fMatchingScoreCut_4, &fMatchingScoreCut_5}; - - Configurable fMatchingPlaneZ_1{"cfgChi2FunctionMatchingPlaneZ_1", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; - Configurable fMatchingPlaneZ_2{"cfgChi2FunctionMatchingPlaneZ_2", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; - Configurable fMatchingPlaneZ_3{"cfgChi2FunctionMatchingPlaneZ_3", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; - Configurable fMatchingPlaneZ_4{"cfgChi2FunctionMatchingPlaneZ_4", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; - Configurable fMatchingPlaneZ_5{"cfgChi2FunctionMatchingPlaneZ_5", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; - std::array*, sChi2FunctionsNum> fMatchingPlaneZ{ - &fMatchingPlaneZ_1, &fMatchingPlaneZ_2, &fMatchingPlaneZ_3, &fMatchingPlaneZ_4, &fMatchingPlaneZ_5}; - - Configurable fMatchingExtrapMethod_1{"cfgChi2MatchingExtrapMethod_1", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - Configurable fMatchingExtrapMethod_2{"cfgChi2MatchingExtrapMethod_2", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - Configurable fMatchingExtrapMethod_3{"cfgChi2MatchingExtrapMethod_3", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - Configurable fMatchingExtrapMethod_4{"cfgChi2MatchingExtrapMethod_4", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - Configurable fMatchingExtrapMethod_5{"cfgChi2MatchingExtrapMethod_5", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - std::array*, sChi2FunctionsNum> fMatchingExtrapMethod{ - &fMatchingExtrapMethod_1, &fMatchingExtrapMethod_2, &fMatchingExtrapMethod_3, &fMatchingExtrapMethod_4, &fMatchingExtrapMethod_5}; - } fConfigChi2MatchingOptions; + Configurable cfgChi2FunctionLabel1{"cfgChi2FunctionLabel1", std::string{"ProdAll"}, "Text label identifying this chi2 matching method"}; + Configurable cfgChi2FunctionLabel2{"cfgChi2FunctionLabel2", std::string{"MatchXYPhiTanlMom"}, "Text label identifying this chi2 matching method"}; + Configurable cfgChi2FunctionLabel3{"cfgChi2FunctionLabel3", std::string{"MatchXYPhiTanl"}, "Text label identifying this chi2 matching method"}; + Configurable cfgChi2FunctionLabel4{"cfgChi2FunctionLabel4", std::string{""}, "Text label identifying this chi2 matching method"}; + Configurable cfgChi2FunctionLabel5{"cfgChi2FunctionLabel5", std::string{""}, "Text label identifying this chi2 matching method"}; + std::array*, Chi2FunctionsNum> functionLabels{ + &cfgChi2FunctionLabel1, &cfgChi2FunctionLabel2, &cfgChi2FunctionLabel3, &cfgChi2FunctionLabel4, &cfgChi2FunctionLabel5}; + + Configurable cfgChi2FunctionName1{"cfgChi2FunctionName1", std::string{"prod"}, "Name of the chi2 matching function"}; + Configurable cfgChi2FunctionName2{"cfgChi2FunctionName2", std::string{"matchALL"}, "Name of the chi2 matching function"}; + Configurable cfgChi2FunctionName3{"cfgChi2FunctionName3", std::string{"matchXYPhiTanl"}, "Name of the chi2 matching function"}; + Configurable cfgChi2FunctionName4{"cfgChi2FunctionName4", std::string{""}, "Name of the chi2 matching function"}; + Configurable cfgChi2FunctionName5{"cfgChi2FunctionName5", std::string{""}, "Name of the chi2 matching function"}; + std::array*, Chi2FunctionsNum> functionNames{ + &cfgChi2FunctionName1, &cfgChi2FunctionName2, &cfgChi2FunctionName3, &cfgChi2FunctionName4, &cfgChi2FunctionName5}; + + Configurable cfgChi2FunctionMatchingScoreCut1{"cfgChi2FunctionMatchingScoreCut1", 0.f, "Minimum score value for selecting good matches"}; + Configurable cfgChi2FunctionMatchingScoreCut2{"cfgChi2FunctionMatchingScoreCut2", 0.5f, "Minimum score value for selecting good matches"}; + Configurable cfgChi2FunctionMatchingScoreCut3{"cfgChi2FunctionMatchingScoreCut3", 0.5f, "Minimum score value for selecting good matches"}; + Configurable cfgChi2FunctionMatchingScoreCut4{"cfgChi2FunctionMatchingScoreCut4", 0.5f, "Minimum score value for selecting good matches"}; + Configurable cfgChi2FunctionMatchingScoreCut5{"cfgChi2FunctionMatchingScoreCut5", 0.5f, "Minimum score value for selecting good matches"}; + std::array*, Chi2FunctionsNum> matchingScoreCuts{ + &cfgChi2FunctionMatchingScoreCut1, &cfgChi2FunctionMatchingScoreCut2, &cfgChi2FunctionMatchingScoreCut3, &cfgChi2FunctionMatchingScoreCut4, &cfgChi2FunctionMatchingScoreCut5}; + + Configurable cfgChi2FunctionMatchingPlaneZ1{"cfgChi2FunctionMatchingPlaneZ1", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; + Configurable cfgChi2FunctionMatchingPlaneZ2{"cfgChi2FunctionMatchingPlaneZ2", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; + Configurable cfgChi2FunctionMatchingPlaneZ3{"cfgChi2FunctionMatchingPlaneZ3", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; + Configurable cfgChi2FunctionMatchingPlaneZ4{"cfgChi2FunctionMatchingPlaneZ4", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; + Configurable cfgChi2FunctionMatchingPlaneZ5{"cfgChi2FunctionMatchingPlaneZ5", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; + std::array*, Chi2FunctionsNum> matchingPlaneZs{ + &cfgChi2FunctionMatchingPlaneZ1, &cfgChi2FunctionMatchingPlaneZ2, &cfgChi2FunctionMatchingPlaneZ3, &cfgChi2FunctionMatchingPlaneZ4, &cfgChi2FunctionMatchingPlaneZ5}; + + Configurable cfgChi2MatchingExtrapMethod1{"cfgChi2MatchingExtrapMethod1", 0, "Method for MCH track extrapolation to maching plane"}; + Configurable cfgChi2MatchingExtrapMethod2{"cfgChi2MatchingExtrapMethod2", 0, "Method for MCH track extrapolation to maching plane"}; + Configurable cfgChi2MatchingExtrapMethod3{"cfgChi2MatchingExtrapMethod3", 0, "Method for MCH track extrapolation to maching plane"}; + Configurable cfgChi2MatchingExtrapMethod4{"cfgChi2MatchingExtrapMethod4", 0, "Method for MCH track extrapolation to maching plane"}; + Configurable cfgChi2MatchingExtrapMethod5{"cfgChi2MatchingExtrapMethod5", 0, "Method for MCH track extrapolation to maching plane"}; + std::array*, Chi2FunctionsNum> matchingExtrapMethods{ + &cfgChi2MatchingExtrapMethod1, &cfgChi2MatchingExtrapMethod2, &cfgChi2MatchingExtrapMethod3, &cfgChi2MatchingExtrapMethod4, &cfgChi2MatchingExtrapMethod5}; + } configChi2MatchingOptions; // ML interface - static constexpr int sMLModelsNum = 5; + static constexpr int MlModelsNum = 5; struct : ConfigurableGroup { - Configurable fModelLabel_1{"cfgMLModelLabel_1", std::string{""}, "Text label identifying this group of ML models"}; - Configurable fModelLabel_2{"cfgMLModelLabel_2", std::string{""}, "Text label identifying this group of ML models"}; - Configurable fModelLabel_3{"cfgMLModelLabel_3", std::string{""}, "Text label identifying this group of ML models"}; - Configurable fModelLabel_4{"cfgMLModelLabel_4", std::string{""}, "Text label identifying this group of ML models"}; - Configurable fModelLabel_5{"cfgMLModelLabel_5", std::string{""}, "Text label identifying this group of ML models"}; - std::array*, sMLModelsNum> fModelLabel{ - &fModelLabel_1, &fModelLabel_2, &fModelLabel_3, &fModelLabel_4, &fModelLabel_5}; - - Configurable fModelPathCCDB_1{"cfgMLModelPathCCDB_1", "Users/m/mcoquet/MLTest", "Paths of models on CCDB"}; - Configurable fModelPathCCDB_2{"cfgMLModelPathsCCDB_2", std::string{""}, "Paths of models on CCDB"}; - Configurable fModelPathCCDB_3{"cfgMLModelPathsCCDB_3", std::string{""}, "Paths of models on CCDB"}; - Configurable fModelPathCCDB_4{"cfgMLModelPathsCCDB_4", std::string{""}, "Paths of models on CCDB"}; - Configurable fModelPathCCDB_5{"cfgMLModelPathsCCDB_5", std::string{""}, "Paths of models on CCDB"}; - std::array*, sMLModelsNum> fModelPathCCDB{ - &fModelPathCCDB_1, &fModelPathCCDB_2, &fModelPathCCDB_3, &fModelPathCCDB_4, &fModelPathCCDB_5}; - - Configurable fModelName_1{"cfgMLModelName_1", "model.onnx", "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable fModelName_2{"cfgMLModelNames_2", std::string{""}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable fModelName_3{"cfgMLModelNames_3", std::string{""}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable fModelName_4{"cfgMLModelNames_4", std::string{""}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - Configurable fModelName_5{"cfgMLModelNames_5", std::string{""}, "ONNX file names for each pT bin (if not from CCDB full path)"}; - std::array*, sMLModelsNum> fModelName{ - &fModelName_1, &fModelName_2, &fModelName_3, &fModelName_4, &fModelName_5}; - - Configurable fInputFeatures_1{"cfgMLInputFeatures_1", "chi2MCHMFT", "Names of ML model input features"}; - Configurable fInputFeatures_2{"cfgMLInputFeatures_2", std::string{""}, "Names of ML model input features"}; - Configurable fInputFeatures_3{"cfgMLInputFeatures_3", std::string{""}, "Names of ML model input features"}; - Configurable fInputFeatures_4{"cfgMLInputFeatures_4", std::string{""}, "Names of ML model input features"}; - Configurable fInputFeatures_5{"cfgMLInputFeatures_5", std::string{""}, "Names of ML model input features"}; - std::array*, sMLModelsNum> fInputFeatures{ - &fInputFeatures_1, &fInputFeatures_2, &fInputFeatures_3, &fInputFeatures_4, &fInputFeatures_5}; - - Configurable fMatchingScoreCut_1{"cfgMLModelMatchingScoreCut_1", 0.f, "Minimum score value for selecting good matches"}; - Configurable fMatchingScoreCut_2{"cfgMLModelMatchingScoreCut_2", 0.f, "Minimum score value for selecting good matches"}; - Configurable fMatchingScoreCut_3{"cfgMLModelMatchingScoreCut_3", 0.f, "Minimum score value for selecting good matches"}; - Configurable fMatchingScoreCut_4{"cfgMLModelMatchingScoreCut_4", 0.f, "Minimum score value for selecting good matches"}; - Configurable fMatchingScoreCut_5{"cfgMLModelMatchingScoreCut_5", 0.f, "Minimum score value for selecting good matches"}; - std::array*, sMLModelsNum> fMatchingScoreCut{ - &fMatchingScoreCut_1, &fMatchingScoreCut_2, &fMatchingScoreCut_3, &fMatchingScoreCut_4, &fMatchingScoreCut_5}; - - Configurable fMatchingPlaneZ_1{"cfgMLModelMatchingPlaneZ_1", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; - Configurable fMatchingPlaneZ_2{"cfgMLModelMatchingPlaneZ_2", 0.f, "Z position of the matching plane"}; - Configurable fMatchingPlaneZ_3{"cfgMLModelMatchingPlaneZ_3", 0.f, "Z position of the matching plane"}; - Configurable fMatchingPlaneZ_4{"cfgMLModelMatchingPlaneZ_4", 0.f, "Z position of the matching plane"}; - Configurable fMatchingPlaneZ_5{"cfgMLModelMatchingPlaneZ_5", 0.f, "Z position of the matching plane"}; - std::array*, sMLModelsNum> fMatchingPlaneZ{ - &fMatchingPlaneZ_1, &fMatchingPlaneZ_2, &fMatchingPlaneZ_3, &fMatchingPlaneZ_4, &fMatchingPlaneZ_5}; - - Configurable fMatchingExtrapMethod_1{"cfgMLMatchingExtrapMethod_1", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - Configurable fMatchingExtrapMethod_2{"cfgMLMatchingExtrapMethod_2", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - Configurable fMatchingExtrapMethod_3{"cfgMLMatchingExtrapMethod_3", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - Configurable fMatchingExtrapMethod_4{"cfgMLMatchingExtrapMethod_4", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - Configurable fMatchingExtrapMethod_5{"cfgMLMatchingExtrapMethod_5", static_cast(0), "Method for MCH track extrapolation to maching plane"}; - std::array*, sMLModelsNum> fMatchingExtrapMethod{ - &fMatchingExtrapMethod_1, &fMatchingExtrapMethod_2, &fMatchingExtrapMethod_3, &fMatchingExtrapMethod_4, &fMatchingExtrapMethod_5}; - } fConfigMlOptions; + Configurable cfgMlModelLabel1{"cfgMlModelLabel1", std::string{""}, "Text label identifying this group of ML models"}; + Configurable cfgMlModelLabel2{"cfgMlModelLabel2", std::string{""}, "Text label identifying this group of ML models"}; + Configurable cfgMlModelLabel3{"cfgMlModelLabel3", std::string{""}, "Text label identifying this group of ML models"}; + Configurable cfgMlModelLabel4{"cfgMlModelLabel4", std::string{""}, "Text label identifying this group of ML models"}; + Configurable cfgMlModelLabel5{"cfgMlModelLabel5", std::string{""}, "Text label identifying this group of ML models"}; + std::array*, MlModelsNum> modelLabels{ + &cfgMlModelLabel1, &cfgMlModelLabel2, &cfgMlModelLabel3, &cfgMlModelLabel4, &cfgMlModelLabel5}; + + Configurable cfgMlModelPathCcdb1{"cfgMlModelPathCcdb1", "Users/m/mcoquet/MLTest", "Paths of models on CCDB"}; + Configurable cfgMlModelPathCcdb2{"cfgMlModelPathCcdb2", std::string{""}, "Paths of models on CCDB"}; + Configurable cfgMlModelPathCcdb3{"cfgMlModelPathCcdb3", std::string{""}, "Paths of models on CCDB"}; + Configurable cfgMlModelPathCcdb4{"cfgMlModelPathCcdb4", std::string{""}, "Paths of models on CCDB"}; + Configurable cfgMlModelPathCcdb5{"cfgMlModelPathCcdb5", std::string{""}, "Paths of models on CCDB"}; + std::array*, MlModelsNum> modelPathCcds{ + &cfgMlModelPathCcdb1, &cfgMlModelPathCcdb2, &cfgMlModelPathCcdb3, &cfgMlModelPathCcdb4, &cfgMlModelPathCcdb5}; + + Configurable cfgMlModelName1{"cfgMlModelName1", "model.onnx", "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable cfgMlModelName2{"cfgMlModelName2", std::string{""}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable cfgMlModelName3{"cfgMlModelName3", std::string{""}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable cfgMlModelName4{"cfgMlModelName4", std::string{""}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + Configurable cfgMlModelName5{"cfgMlModelName5", std::string{""}, "ONNX file names for each pT bin (if not from CCDB full path)"}; + std::array*, MlModelsNum> modelNames{ + &cfgMlModelName1, &cfgMlModelName2, &cfgMlModelName3, &cfgMlModelName4, &cfgMlModelName5}; + + Configurable cfgMlInputFeatures1{"cfgMlInputFeatures1", "chi2MCHMFT", "Names of ML model input features"}; + Configurable cfgMlInputFeatures2{"cfgMlInputFeatures2", std::string{""}, "Names of ML model input features"}; + Configurable cfgMlInputFeatures3{"cfgMlInputFeatures3", std::string{""}, "Names of ML model input features"}; + Configurable cfgMlInputFeatures4{"cfgMlInputFeatures4", std::string{""}, "Names of ML model input features"}; + Configurable cfgMlInputFeatures5{"cfgMlInputFeatures5", std::string{""}, "Names of ML model input features"}; + std::array*, MlModelsNum> inputFeatures{ + &cfgMlInputFeatures1, &cfgMlInputFeatures2, &cfgMlInputFeatures3, &cfgMlInputFeatures4, &cfgMlInputFeatures5}; + + Configurable cfgMlModelMatchingScoreCut1{"cfgMlModelMatchingScoreCut1", 0.f, "Minimum score value for selecting good matches"}; + Configurable cfgMlModelMatchingScoreCut2{"cfgMlModelMatchingScoreCut2", 0.f, "Minimum score value for selecting good matches"}; + Configurable cfgMlModelMatchingScoreCut3{"cfgMlModelMatchingScoreCut3", 0.f, "Minimum score value for selecting good matches"}; + Configurable cfgMlModelMatchingScoreCut4{"cfgMlModelMatchingScoreCut4", 0.f, "Minimum score value for selecting good matches"}; + Configurable cfgMlModelMatchingScoreCut5{"cfgMlModelMatchingScoreCut5", 0.f, "Minimum score value for selecting good matches"}; + std::array*, MlModelsNum> matchingScoreCuts{ + &cfgMlModelMatchingScoreCut1, &cfgMlModelMatchingScoreCut2, &cfgMlModelMatchingScoreCut3, &cfgMlModelMatchingScoreCut4, &cfgMlModelMatchingScoreCut5}; + + Configurable cfgMlModelMatchingPlaneZ1{"cfgMlModelMatchingPlaneZ1", static_cast(o2::mft::constants::mft::LayerZCoordinate()[9]), "Z position of the matching plane"}; + Configurable cfgMlModelMatchingPlaneZ2{"cfgMlModelMatchingPlaneZ2", 0.f, "Z position of the matching plane"}; + Configurable cfgMlModelMatchingPlaneZ3{"cfgMlModelMatchingPlaneZ3", 0.f, "Z position of the matching plane"}; + Configurable cfgMlModelMatchingPlaneZ4{"cfgMlModelMatchingPlaneZ4", 0.f, "Z position of the matching plane"}; + Configurable cfgMlModelMatchingPlaneZ5{"cfgMlModelMatchingPlaneZ5", 0.f, "Z position of the matching plane"}; + std::array*, MlModelsNum> matchingPlaneZs{ + &cfgMlModelMatchingPlaneZ1, &cfgMlModelMatchingPlaneZ2, &cfgMlModelMatchingPlaneZ3, &cfgMlModelMatchingPlaneZ4, &cfgMlModelMatchingPlaneZ5}; + + Configurable cfgMlMatchingExtrapMethod1{"cfgMlMatchingExtrapMethod1", 0, "Method for MCH track extrapolation to maching plane"}; + Configurable cfgMlMatchingExtrapMethod2{"cfgMlMatchingExtrapMethod2", 0, "Method for MCH track extrapolation to maching plane"}; + Configurable cfgMlMatchingExtrapMethod3{"cfgMlMatchingExtrapMethod3", 0, "Method for MCH track extrapolation to maching plane"}; + Configurable cfgMlMatchingExtrapMethod4{"cfgMlMatchingExtrapMethod4", 0, "Method for MCH track extrapolation to maching plane"}; + Configurable cfgMlMatchingExtrapMethod5{"cfgMlMatchingExtrapMethod5", 0, "Method for MCH track extrapolation to maching plane"}; + std::array*, MlModelsNum> matchingExtrapMethods{ + &cfgMlMatchingExtrapMethod1, &cfgMlMatchingExtrapMethod2, &cfgMlMatchingExtrapMethod3, &cfgMlMatchingExtrapMethod4, &cfgMlMatchingExtrapMethod5}; + } configMlOptions; std::vector binsPtMl; std::array cutValues; @@ -341,25 +469,29 @@ struct qaMatching { HistogramRegistry registryDimuon{"registryDimuon", {}}; std::unordered_map matchingHistos; - matrix dimuonHistos; + Matrix dimuonHistos; + + Produces qaMatchingEvents; + Produces qaMatchingMCHTrack; + Produces qaMatchingCandidates; struct EfficiencyPlotter { - o2::framework::HistPtr p_num; - o2::framework::HistPtr p_den; - o2::framework::HistPtr p_pdg_num; - o2::framework::HistPtr p_pdg_den; - o2::framework::HistPtr pt_num; - o2::framework::HistPtr pt_den; - o2::framework::HistPtr pt_pdg_num; - o2::framework::HistPtr pt_pdg_den; - o2::framework::HistPtr phi_num; - o2::framework::HistPtr phi_den; - o2::framework::HistPtr phi_pdg_num; - o2::framework::HistPtr phi_pdg_den; - o2::framework::HistPtr eta_num; - o2::framework::HistPtr eta_den; - o2::framework::HistPtr eta_pdg_num; - o2::framework::HistPtr eta_pdg_den; + o2::framework::HistPtr pNum; + o2::framework::HistPtr pDen; + o2::framework::HistPtr pPdgNum; + o2::framework::HistPtr pPdgDen; + o2::framework::HistPtr ptNum; + o2::framework::HistPtr ptDen; + o2::framework::HistPtr ptPdgNum; + o2::framework::HistPtr ptPdgDen; + o2::framework::HistPtr phiNum; + o2::framework::HistPtr phiDen; + o2::framework::HistPtr phiPdgNum; + o2::framework::HistPtr phiPdgDen; + o2::framework::HistPtr etaNum; + o2::framework::HistPtr etaDen; + o2::framework::HistPtr etaPdgNum; + o2::framework::HistPtr etaPdgDen; EfficiencyPlotter(std::string path, std::string title, HistogramRegistry& registry, bool createPdgMomHistograms) @@ -376,112 +508,114 @@ struct qaMatching { // momentum dependence histName = path + "p_num"; histTitle = title + " vs. p - num"; - p_num = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {pAxis}}); + pNum = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {pAxis}}); histName = path + "p_den"; histTitle = title + " vs. p - den"; - p_den = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {pAxis}}); + pDen = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {pAxis}}); if (createPdgMomHistograms) { histName = path + "p_pdg_num"; histTitle = title + " vs. p vs pdg ID - num"; - p_pdg_num = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {pAxis, motherPDGAxis}}); + pPdgNum = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {pAxis, motherPDGAxis}}); histName = path + "p_pdg_den"; histTitle = title + " vs. p vs pdg ID - den"; - p_pdg_den = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {pAxis, motherPDGAxis}}); + pPdgDen = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {pAxis, motherPDGAxis}}); } // pT dependence histName = path + "pt_num"; histTitle = title + " vs. p_{T} - num"; - pt_num = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {pTAxis}}); + ptNum = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {pTAxis}}); histName = path + "pt_den"; histTitle = title + " vs. p_{T} - den"; - pt_den = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {pTAxis}}); + ptDen = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {pTAxis}}); if (createPdgMomHistograms) { histName = path + "pt_pdg_num"; histTitle = title + " vs. p_{T} vs pdg ID - num"; - pt_pdg_num = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {pTAxis, motherPDGAxis}}); + ptPdgNum = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {pTAxis, motherPDGAxis}}); histName = path + "pt_pdg_den"; histTitle = title + " vs. p_{T} vs pdg ID - den"; - pt_pdg_den = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {pTAxis, motherPDGAxis}}); + ptPdgDen = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {pTAxis, motherPDGAxis}}); } // eta dependence histName = path + "eta_num"; histTitle = title + " vs. #eta - num"; - eta_num = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {etaAxis}}); + etaNum = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {etaAxis}}); histName = path + "eta_den"; histTitle = title + " vs. #eta - den"; - eta_den = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {etaAxis}}); + etaDen = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {etaAxis}}); if (createPdgMomHistograms) { histName = path + "eta_pdg_num"; histTitle = title + " vs. #eta vs pdg ID - num"; - eta_pdg_num = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {etaAxis, motherPDGAxis}}); + etaPdgNum = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {etaAxis, motherPDGAxis}}); histName = path + "eta_pdg_den"; histTitle = title + " vs. #eta vs pdg ID - den"; - eta_pdg_den = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {etaAxis, motherPDGAxis}}); + etaPdgDen = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {etaAxis, motherPDGAxis}}); } // phi dependence histName = path + "phi_num"; histTitle = title + " vs. #phi - num"; - phi_num = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {phiAxis}}); + phiNum = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {phiAxis}}); histName = path + "phi_den"; histTitle = title + " vs. #phi - den"; - phi_den = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {phiAxis}}); + phiDen = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH1F, {phiAxis}}); if (createPdgMomHistograms) { histName = path + "phi_pdg_num"; histTitle = title + " vs. #phi vs pdg ID - num"; - phi_pdg_num = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {phiAxis, motherPDGAxis}}); + phiPdgNum = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {phiAxis, motherPDGAxis}}); histName = path + "phi_pdg_den"; histTitle = title + " vs. #phi vs pdg ID - den"; - phi_pdg_den = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {phiAxis, motherPDGAxis}}); + phiPdgDen = registry.add(histName.c_str(), histTitle.c_str(), {HistType::kTH2F, {phiAxis, motherPDGAxis}}); } } template - void Fill(const T& track, bool passed) + void fill(const T& track, bool passed) { - double phi = track.phi() * 180 / TMath::Pi(); - std::get>(p_den)->Fill(track.p()); - std::get>(pt_den)->Fill(track.pt()); - std::get>(eta_den)->Fill(track.eta()); - std::get>(phi_den)->Fill(phi); + constexpr double RadToDeg = 180. / o2::constants::math::PI; + double phi = track.phi() * RadToDeg; + std::get>(pDen)->Fill(track.p()); + std::get>(ptDen)->Fill(track.pt()); + std::get>(etaDen)->Fill(track.eta()); + std::get>(phiDen)->Fill(phi); if (passed) { - std::get>(p_num)->Fill(track.p()); - std::get>(pt_num)->Fill(track.pt()); - std::get>(eta_num)->Fill(track.eta()); - std::get>(phi_num)->Fill(phi); + std::get>(pNum)->Fill(track.p()); + std::get>(ptNum)->Fill(track.pt()); + std::get>(etaNum)->Fill(track.eta()); + std::get>(phiNum)->Fill(phi); } } // Study the PDG origin of particles and their effect on the purity score template - void Fill(const T& track, int pdgCode, bool passed) + void fill(const T& track, int pdgCode, bool passed) { - double phi = track.phi() * 180 / TMath::Pi(); - std::get>(p_pdg_den)->Fill(track.p(), pdgCode); - std::get>(pt_pdg_den)->Fill(track.pt(), pdgCode); - std::get>(eta_pdg_den)->Fill(track.eta(), pdgCode); - std::get>(phi_pdg_den)->Fill(phi, pdgCode); + constexpr double RadToDeg = 180. / o2::constants::math::PI; + double phi = track.phi() * RadToDeg; + std::get>(pPdgDen)->Fill(track.p(), pdgCode); + std::get>(ptPdgDen)->Fill(track.pt(), pdgCode); + std::get>(etaPdgDen)->Fill(track.eta(), pdgCode); + std::get>(phiPdgDen)->Fill(phi, pdgCode); if (passed) { - std::get>(p_pdg_num)->Fill(track.p(), pdgCode); - std::get>(pt_pdg_num)->Fill(track.pt(), pdgCode); - std::get>(eta_pdg_num)->Fill(track.eta(), pdgCode); - std::get>(phi_pdg_num)->Fill(phi, pdgCode); + std::get>(pPdgNum)->Fill(track.p(), pdgCode); + std::get>(ptPdgNum)->Fill(track.pt(), pdgCode); + std::get>(etaPdgNum)->Fill(track.eta(), pdgCode); + std::get>(phiPdgNum)->Fill(phi, pdgCode); } } }; @@ -767,7 +901,7 @@ struct qaMatching { CollisionInfos fCollisionInfos; template - void initCCDB(BC const& bc) + void initCcdb(BC const& bc) { if (mRunNumber == bc.runNumber()) return; @@ -776,7 +910,7 @@ struct qaMatching { std::map metadata; auto soreor = o2::ccdb::BasicCCDBManager::getRunDuration(fCCDBApi, mRunNumber); auto ts = soreor.first; - auto grpmag = fCCDBApi.retrieveFromTFileAny(grpmagPath, metadata, ts); + auto grpmag = fCCDBApi.retrieveFromTFileAny(grpMagPath, metadata, ts); o2::base::Propagator::initFieldFromGRP(grpmag); LOGF(info, "Set field for muons"); VarManager::SetupMuonMagField(); @@ -786,13 +920,13 @@ struct qaMatching { o2::mch::TrackExtrap::setField(); auto* fieldB = static_cast(TGeoGlobalMagField::Instance()->GetField()); if (fieldB) { - double centerMFT[3] = {0, 0, -61.4}; // Field at center of MFT - mBzAtMftCenter = fieldB->getBz(centerMFT); + double centerMft[3] = {0, 0, -61.4}; // Field at center of MFT + mBzAtMftCenter = fieldB->getBz(centerMft); // std::cout << "fieldB: " << (void*)fieldB << std::endl; } } - void CreateMatchingHistosMC() + void createMatchingHistosMc() { AxisSpec chi2Axis = {1000, 0, 1000, "chi^{2}"}; AxisSpec chi2AxisSmall = {200, 0, 100, "chi^{2}"}; @@ -802,30 +936,30 @@ struct qaMatching { AxisSpec phiAxis = {90, -180, 180, "#phi (degrees)"}; std::string histPath = "matching/MC/"; - AxisSpec trackPositionXAtMFTAxis = {100, -15, 15, "MFT x (cm)"}; - AxisSpec trackPositionYAtMFTAxis = {100, -15, 15, "MFT y (cm)"}; - registry.add((histPath + "pairedMCHTracksAtMFT").c_str(), "Paired MCH tracks position at MFT end", {HistType::kTH2F, {trackPositionXAtMFTAxis, trackPositionYAtMFTAxis}}); - registry.add((histPath + "pairedMFTTracksAtMFT").c_str(), "Paired MFT tracks position at MFT end", {HistType::kTH2F, {trackPositionXAtMFTAxis, trackPositionYAtMFTAxis}}); - registry.add((histPath + "selectedMCHTracksAtMFT").c_str(), "Selected MCH tracks position at MFT end", {HistType::kTH2F, {trackPositionXAtMFTAxis, trackPositionYAtMFTAxis}}); - registry.add((histPath + "selectedMCHTracksAtMFTTrue").c_str(), "Selected MCH tracks position at MFT end - true", {HistType::kTH2F, {trackPositionXAtMFTAxis, trackPositionYAtMFTAxis}}); - registry.add((histPath + "selectedMCHTracksAtMFTFake").c_str(), "Selected MCH tracks position at MFT end - fake", {HistType::kTH2F, {trackPositionXAtMFTAxis, trackPositionYAtMFTAxis}}); + AxisSpec trackPositionXAtMftAxis = {100, -15, 15, "MFT x (cm)"}; + AxisSpec trackPositionYAtMftAxis = {100, -15, 15, "MFT y (cm)"}; + registry.add((histPath + "pairedMCHTracksAtMFT").c_str(), "Paired MCH tracks position at MFT end", {HistType::kTH2F, {trackPositionXAtMftAxis, trackPositionYAtMftAxis}}); + registry.add((histPath + "pairedMFTTracksAtMFT").c_str(), "Paired MFT tracks position at MFT end", {HistType::kTH2F, {trackPositionXAtMftAxis, trackPositionYAtMftAxis}}); + registry.add((histPath + "selectedMCHTracksAtMFT").c_str(), "Selected MCH tracks position at MFT end", {HistType::kTH2F, {trackPositionXAtMftAxis, trackPositionYAtMftAxis}}); + registry.add((histPath + "selectedMCHTracksAtMFTTrue").c_str(), "Selected MCH tracks position at MFT end - true", {HistType::kTH2F, {trackPositionXAtMftAxis, trackPositionYAtMftAxis}}); + registry.add((histPath + "selectedMCHTracksAtMFTFake").c_str(), "Selected MCH tracks position at MFT end - fake", {HistType::kTH2F, {trackPositionXAtMftAxis, trackPositionYAtMftAxis}}); - fChi2MatchingPlotter = std::make_unique(histPath + "Prod/", ®istryMatching, fConfigQAs.fCreatePdgMomHistograms, fMftTrackMultiplicityMax, fNCandidatesMax); + fChi2MatchingPlotter = std::make_unique(histPath + "Prod/", ®istryMatching, configQas.cfgCreatePdgMomHistograms, cfgMftTrackMultiplicityMax, cfgNCandidatesMax); int registryIndex = 0; for (const auto& [label, func] : matchingChi2Functions) { - fMatchingPlotters[label] = std::make_unique(histPath + label + "/", registryMatchingVec[registryIndex], fConfigQAs.fCreatePdgMomHistograms, fMftTrackMultiplicityMax, fNCandidatesMax); + fMatchingPlotters[label] = std::make_unique(histPath + label + "/", registryMatchingVec[registryIndex], configQas.cfgCreatePdgMomHistograms, cfgMftTrackMultiplicityMax, cfgNCandidatesMax); registryIndex += 1; } for (const auto& [label, response] : matchingMlResponses) { - fMatchingPlotters[label] = std::make_unique(histPath + label + "/", (registryMatchingVec[registryIndex]), fConfigQAs.fCreatePdgMomHistograms, fMftTrackMultiplicityMax, fNCandidatesMax); + fMatchingPlotters[label] = std::make_unique(histPath + label + "/", (registryMatchingVec[registryIndex]), configQas.cfgCreatePdgMomHistograms, cfgMftTrackMultiplicityMax, cfgNCandidatesMax); registryIndex += 1; } - fTaggedMuonsMatchingPlotter = std::make_unique(histPath + "Tagged/", ®istryMatching, fConfigQAs.fCreatePdgMomHistograms, fMftTrackMultiplicityMax, fNCandidatesMax); - fSelectedMuonsMatchingPlotter = std::make_unique(histPath + "Selected/", ®istryMatching, fConfigQAs.fCreatePdgMomHistograms, fMftTrackMultiplicityMax, fNCandidatesMax); + fTaggedMuonsMatchingPlotter = std::make_unique(histPath + "Tagged/", ®istryMatching, configQas.cfgCreatePdgMomHistograms, cfgMftTrackMultiplicityMax, cfgNCandidatesMax); + fSelectedMuonsMatchingPlotter = std::make_unique(histPath + "Selected/", ®istryMatching, configQas.cfgCreatePdgMomHistograms, cfgMftTrackMultiplicityMax, cfgNCandidatesMax); } - void CreateDimuonHistos() + void createDimuonHistos() { AxisSpec invMassAxis = {400, 1, 5, "M_{#mu^{+}#mu^{-}} (GeV/c^{2})"}; AxisSpec invMassCorrelationAxis = {400, 0, 8, "M_{#mu^{+}#mu^{-}} (GeV/c^{2})"}; @@ -855,7 +989,7 @@ struct qaMatching { registryDimuon.add("dimuon/MC/invariantMass_ScaledMftKine_GlobalMuonCuts_GoodMatches_vs_match_type", "#mu^{+}#mu^{-} invariant mass vs. match tye (global muon cuts, rescaled MFT, good matches)", {HistType::kTH2F, {invMassAxis, matchTypeAxis}}); } - void InitMatchingFunctions() + void initMatchingFunctions() { using SMatrix55Std = ROOT::Math::SMatrix; using SMatrix55Sym = ROOT::Math::SMatrix>; @@ -874,31 +1008,31 @@ struct qaMatching { mMatchingFunctionMap["matchALL"] = [](const o2::dataformats::GlobalFwdTrack& mchTrack, const o2::track::TrackParCovFwd& mftTrack) -> std::tuple { // Match two tracks evaluating all parameters: X,Y, phi, tanl & q/pt - SMatrix55Sym H_k, V_k; - SVector5 m_k(mftTrack.getX(), mftTrack.getY(), mftTrack.getPhi(), - mftTrack.getTanl(), mftTrack.getInvQPt()), - r_k_kminus1; - SVector5 GlobalMuonTrackParameters = mchTrack.getParameters(); - SMatrix55Sym GlobalMuonTrackCovariances = mchTrack.getCovariances(); - V_k(0, 0) = mftTrack.getCovariances()(0, 0); - V_k(1, 1) = mftTrack.getCovariances()(1, 1); - V_k(2, 2) = mftTrack.getCovariances()(2, 2); - V_k(3, 3) = mftTrack.getCovariances()(3, 3); - V_k(4, 4) = mftTrack.getCovariances()(4, 4); - H_k(0, 0) = 1.0; - H_k(1, 1) = 1.0; - H_k(2, 2) = 1.0; - H_k(3, 3) = 1.0; - H_k(4, 4) = 1.0; + SMatrix55Sym hK, vK; + SVector5 mK(mftTrack.getX(), mftTrack.getY(), mftTrack.getPhi(), + mftTrack.getTanl(), mftTrack.getInvQPt()), + rKKminus1; + SVector5 globalMuonTrackParameters = mchTrack.getParameters(); + SMatrix55Sym globalMuonTrackCovariances = mchTrack.getCovariances(); + vK(0, 0) = mftTrack.getCovariances()(0, 0); + vK(1, 1) = mftTrack.getCovariances()(1, 1); + vK(2, 2) = mftTrack.getCovariances()(2, 2); + vK(3, 3) = mftTrack.getCovariances()(3, 3); + vK(4, 4) = mftTrack.getCovariances()(4, 4); + hK(0, 0) = 1.0; + hK(1, 1) = 1.0; + hK(2, 2) = 1.0; + hK(3, 3) = 1.0; + hK(4, 4) = 1.0; // Covariance of residuals - SMatrix55Std invResCov = (V_k + ROOT::Math::Similarity(H_k, GlobalMuonTrackCovariances)); + SMatrix55Std invResCov = (vK + ROOT::Math::Similarity(hK, globalMuonTrackCovariances)); invResCov.Invert(); // Update Parameters - r_k_kminus1 = m_k - H_k * GlobalMuonTrackParameters; // Residuals of prediction + rKKminus1 = mK - hK * globalMuonTrackParameters; // Residuals of prediction - auto matchChi2Track = ROOT::Math::Similarity(r_k_kminus1, invResCov); + auto matchChi2Track = ROOT::Math::Similarity(rKKminus1, invResCov); // return chi2 and NDF return {matchChi2Track, 5}; @@ -908,30 +1042,30 @@ struct qaMatching { mMatchingFunctionMap["matchXYPhiTanl"] = [](const o2::dataformats::GlobalFwdTrack& mchTrack, const o2::track::TrackParCovFwd& mftTrack) -> std::tuple { // Match two tracks evaluating positions & angles - SMatrix45 H_k; - SMatrix44 V_k; - SVector4 m_k(mftTrack.getX(), mftTrack.getY(), mftTrack.getPhi(), - mftTrack.getTanl()), - r_k_kminus1; - SVector5 GlobalMuonTrackParameters = mchTrack.getParameters(); - SMatrix55Sym GlobalMuonTrackCovariances = mchTrack.getCovariances(); - V_k(0, 0) = mftTrack.getCovariances()(0, 0); - V_k(1, 1) = mftTrack.getCovariances()(1, 1); - V_k(2, 2) = mftTrack.getCovariances()(2, 2); - V_k(3, 3) = mftTrack.getCovariances()(3, 3); - H_k(0, 0) = 1.0; - H_k(1, 1) = 1.0; - H_k(2, 2) = 1.0; - H_k(3, 3) = 1.0; + SMatrix45 hK; + SMatrix44 vK; + SVector4 mK(mftTrack.getX(), mftTrack.getY(), mftTrack.getPhi(), + mftTrack.getTanl()), + rKKminus1; + SVector5 globalMuonTrackParameters = mchTrack.getParameters(); + SMatrix55Sym globalMuonTrackCovariances = mchTrack.getCovariances(); + vK(0, 0) = mftTrack.getCovariances()(0, 0); + vK(1, 1) = mftTrack.getCovariances()(1, 1); + vK(2, 2) = mftTrack.getCovariances()(2, 2); + vK(3, 3) = mftTrack.getCovariances()(3, 3); + hK(0, 0) = 1.0; + hK(1, 1) = 1.0; + hK(2, 2) = 1.0; + hK(3, 3) = 1.0; // Covariance of residuals - SMatrix44 invResCov = (V_k + ROOT::Math::Similarity(H_k, GlobalMuonTrackCovariances)); + SMatrix44 invResCov = (vK + ROOT::Math::Similarity(hK, globalMuonTrackCovariances)); invResCov.Invert(); // Residuals of prediction - r_k_kminus1 = m_k - H_k * GlobalMuonTrackParameters; + rKKminus1 = mK - hK * globalMuonTrackParameters; - auto matchChi2Track = ROOT::Math::Similarity(r_k_kminus1, invResCov); + auto matchChi2Track = ROOT::Math::Similarity(rKKminus1, invResCov); // return chi2 and NDF return {matchChi2Track, 4}; @@ -941,23 +1075,23 @@ struct qaMatching { mMatchingFunctionMap["matchXY"] = [](const o2::dataformats::GlobalFwdTrack& mchTrack, const o2::track::TrackParCovFwd& mftTrack) -> std::tuple { // Calculate Matching Chi2 - X and Y positions - SMatrix25 H_k; - SMatrix22 V_k; - SVector2 m_k(mftTrack.getX(), mftTrack.getY()), r_k_kminus1; - SVector5 GlobalMuonTrackParameters = mchTrack.getParameters(); - SMatrix55Sym GlobalMuonTrackCovariances = mchTrack.getCovariances(); - V_k(0, 0) = mftTrack.getCovariances()(0, 0); - V_k(1, 1) = mftTrack.getCovariances()(1, 1); - H_k(0, 0) = 1.0; - H_k(1, 1) = 1.0; + SMatrix25 hK; + SMatrix22 vK; + SVector2 mK(mftTrack.getX(), mftTrack.getY()), rKKminus1; + SVector5 globalMuonTrackParameters = mchTrack.getParameters(); + SMatrix55Sym globalMuonTrackCovariances = mchTrack.getCovariances(); + vK(0, 0) = mftTrack.getCovariances()(0, 0); + vK(1, 1) = mftTrack.getCovariances()(1, 1); + hK(0, 0) = 1.0; + hK(1, 1) = 1.0; // Covariance of residuals - SMatrix22 invResCov = (V_k + ROOT::Math::Similarity(H_k, GlobalMuonTrackCovariances)); + SMatrix22 invResCov = (vK + ROOT::Math::Similarity(hK, globalMuonTrackCovariances)); invResCov.Invert(); // Residuals of prediction - r_k_kminus1 = m_k - H_k * GlobalMuonTrackParameters; - auto matchChi2Track = ROOT::Math::Similarity(r_k_kminus1, invResCov); + rKKminus1 = mK - hK * globalMuonTrackParameters; + auto matchChi2Track = ROOT::Math::Similarity(rKKminus1, invResCov); // return reduced chi2 return {matchChi2Track, 2}; @@ -967,10 +1101,10 @@ struct qaMatching { void init(o2::framework::InitContext&) { // Load geometry - ccdbManager->setURL(ccdburl); + ccdbManager->setURL(ccdbUrl); ccdbManager->setCaching(true); ccdbManager->setLocalObjectValidityChecking(); - fCCDBApi.init(ccdburl); + fCCDBApi.init(ccdbUrl); mRunNumber = 0; if (!o2::base::GeometryManager::isGeometryLoaded()) { @@ -979,13 +1113,13 @@ struct qaMatching { } // Matching functions - InitMatchingFunctions(); - for (size_t funcId = 0; funcId < sChi2FunctionsNum; funcId++) { - auto label = fConfigChi2MatchingOptions.fFunctionLabel[funcId]->value; - auto funcName = fConfigChi2MatchingOptions.fFunctionName[funcId]->value; - auto scoreMin = fConfigChi2MatchingOptions.fMatchingScoreCut[funcId]->value; - auto matchingPlaneZ = fConfigChi2MatchingOptions.fMatchingPlaneZ[funcId]->value; - auto extrapMethod = fConfigChi2MatchingOptions.fMatchingExtrapMethod[funcId]->value; + initMatchingFunctions(); + for (size_t funcId = 0; funcId < Chi2FunctionsNum; funcId++) { + auto label = configChi2MatchingOptions.functionLabels[funcId]->value; + auto funcName = configChi2MatchingOptions.functionNames[funcId]->value; + auto scoreMin = configChi2MatchingOptions.matchingScoreCuts[funcId]->value; + auto matchingPlaneZ = configChi2MatchingOptions.matchingPlaneZs[funcId]->value; + auto extrapMethod = configChi2MatchingOptions.matchingExtrapMethods[funcId]->value; if (label == "" || funcName == "") break; @@ -1004,20 +1138,20 @@ struct qaMatching { cutDirMl = {cuts_ml::CutNot}; o2::framework::LabeledArray mycutsMl(cutValues.data(), 1, 1, std::vector{"pT bin 0"}, std::vector{"score"}); - for (size_t modelId = 0; modelId < sMLModelsNum; modelId++) { - auto label = fConfigMlOptions.fModelLabel[modelId]->value; - auto modelPath = fConfigMlOptions.fModelPathCCDB[modelId]->value; - auto inputFeatures = fConfigMlOptions.fInputFeatures[modelId]->value; - auto modelName = fConfigMlOptions.fModelName[modelId]->value; - auto scoreMin = fConfigMlOptions.fMatchingScoreCut[modelId]->value; - auto matchingPlaneZ = fConfigMlOptions.fMatchingPlaneZ[modelId]->value; - auto extrapMethod = fConfigMlOptions.fMatchingExtrapMethod[modelId]->value; + for (size_t modelId = 0; modelId < MlModelsNum; modelId++) { + auto label = configMlOptions.modelLabels[modelId]->value; + auto modelPath = configMlOptions.modelPathCcds[modelId]->value; + auto inputFeatures = configMlOptions.inputFeatures[modelId]->value; + auto modelName = configMlOptions.modelNames[modelId]->value; + auto scoreMin = configMlOptions.matchingScoreCuts[modelId]->value; + auto matchingPlaneZ = configMlOptions.matchingPlaneZs[modelId]->value; + auto extrapMethod = configMlOptions.matchingExtrapMethods[modelId]->value; if (label == "" || modelPath == "" || inputFeatures == "" || modelName == "") break; matchingMlResponses[label].configure(binsPtMl, mycutsMl, cutDirMl, 1); - matchingMlResponses[label].setModelPathsCCDB(std::vector{modelName}, fCCDBApi, std::vector{modelPath}, fConfigCCDB.fConfigNoLaterThan.value); + matchingMlResponses[label].setModelPathsCCDB(std::vector{modelName}, fCCDBApi, std::vector{modelPath}, configCcdb.cfgCcdbNoLaterThan.value); matchingMlResponses[label].cacheInputFeaturesIndices(std::vector{inputFeatures}); matchingMlResponses[label].init(); @@ -1030,23 +1164,25 @@ struct qaMatching { AxisSpec trackTypeAxis = {static_cast(nTrackTypes), 0.0, static_cast(nTrackTypes), "track type"}; registry.add("nTracksPerType", "Number of tracks per type", {HistType::kTH1F, {trackTypeAxis}}); - AxisSpec tracksMultiplicityAxis = {fMftTrackMultiplicityMax, 0, static_cast(fMftTrackMultiplicityMax), "tracks multiplicity"}; + AxisSpec tracksMultiplicityAxis = {cfgMftTrackMultiplicityMax, 0, static_cast(cfgMftTrackMultiplicityMax), "tracks multiplicity"}; registry.add("tracksMultiplicityMFT", "MFT tracks multiplicity", {HistType::kTH1F, {tracksMultiplicityAxis}}); registry.add("tracksMultiplicityMCH", "MCH tracks multiplicity", {HistType::kTH1F, {tracksMultiplicityAxis}}); - CreateMatchingHistosMC(); - CreateDimuonHistos(); + createMatchingHistosMc(); + createDimuonHistos(); } template - bool pDCACut(const T& mchTrack, const C& collision, double nSigmaPDCA) + bool pDcaCut(const T& mchTrack, const C& collision, double nSigmaPDCA) { static const double sigmaPDCA23 = 80.; static const double sigmaPDCA310 = 54.; static const double relPRes = 0.0004; static const double slopeRes = 0.0005; - double thetaAbs = TMath::ATan(mchTrack.rAtAbsorberEnd() / 505.) * TMath::RadToDeg(); + constexpr double AbsorberEndZ = 505.; + constexpr double RadToDeg = 180. / o2::constants::math::PI; + double thetaAbs = std::atan(mchTrack.rAtAbsorberEnd() / AbsorberEndZ) * RadToDeg; // propagate muon track to vertex auto mchTrackAtVertex = VarManager::PropagateMuon(mchTrack, collision, VarManager::kToVertex); @@ -1055,11 +1191,11 @@ struct qaMatching { double p = mchTrackAtVertex.getP(); double pDCA = mchTrack.pDca(); - double sigmaPDCA = (thetaAbs < 3) ? sigmaPDCA23 : sigmaPDCA310; + double sigmaPDCA = (thetaAbs < ThetaAbsBoundaryDeg) ? sigmaPDCA23 : sigmaPDCA310; double nrp = nSigmaPDCA * relPRes * p; double pResEffect = sigmaPDCA / (1. - nrp / (1. + nrp)); - double slopeResEffect = 535. * slopeRes * p; - double sigmaPDCAWithRes = TMath::Sqrt(pResEffect * pResEffect + slopeResEffect * slopeResEffect); + double slopeResEffect = SlopeResolutionZ * slopeRes * p; + double sigmaPDCAWithRes = std::sqrt(pResEffect * pResEffect + slopeResEffect * slopeResEffect); if (pDCA > nSigmaPDCA * sigmaPDCAWithRes) { return false; } @@ -1068,7 +1204,7 @@ struct qaMatching { } template - bool IsGoodMuon(const T& mchTrack, const C& collision, + bool isGoodMuon(const T& mchTrack, const C& collision, double chi2Cut, double pCut, double pTCut, @@ -1103,7 +1239,7 @@ struct qaMatching { } // pDCA cut - if (!pDCACut(mchTrack, collision, nSigmaPdcaCut)) { + if (!pDcaCut(mchTrack, collision, nSigmaPdcaCut)) { return false; } @@ -1111,19 +1247,19 @@ struct qaMatching { } template - bool IsGoodMuon(const T& muonTrack, const C& collision) + bool isGoodMuon(const T& muonTrack, const C& collision) { - return IsGoodMuon(muonTrack, collision, fTrackChi2MchUp, fPMchLow, fPtMchLow, {fEtaMchLow, fEtaMchUp}, {fRabsLow, fRabsUp}, fSigmaPdcaUp); + return isGoodMuon(muonTrack, collision, cfgTrackChi2MchUp, cfgPMchLow, cfgPtMchLow, {cfgEtaMchLow, cfgEtaMchUp}, {cfgRabsLow, cfgRabsUp}, cfgPdcaUp); } template - bool IsGoodGlobalMuon(const T& muonTrack, const C& collision) + bool isGoodGlobalMuon(const T& muonTrack, const C& collision) { - return IsGoodMuon(muonTrack, collision, fTrackChi2MchUp, fPMchLow, fPtMchLow, {fEtaMftLow, fEtaMftUp}, {fRabsLow, fRabsUp}, fSigmaPdcaUp); + return isGoodMuon(muonTrack, collision, cfgTrackChi2MchUp, cfgPMchLow, cfgPtMchLow, {cfgEtaMftLow, cfgEtaMftUp}, {cfgRabsLow, cfgRabsUp}, cfgPdcaUp); } template - bool IsGoodMFT(const T& mftTrack, + bool isGoodMft(const T& mftTrack, double chi2Cut, int nClustersCut) { @@ -1142,17 +1278,17 @@ struct qaMatching { } template - bool IsGoodMFT(const T& mftTrack) + bool isGoodMft(const T& mftTrack) { - return IsGoodMFT(mftTrack, fTrackChi2MftUp, fTrackNClustMftLow); + return isGoodMft(mftTrack, cfgTrackChi2MftUp, cfgTrackNClustMftLow); } template - bool IsGoodGlobalMatching(const TMUON& muonTrack, + bool isGoodGlobalMatching(const TMUON& muonTrack, double matchingScore, double matchingScoreCut) { - if (static_cast(muonTrack.trackType()) > 2) + if (static_cast(muonTrack.trackType()) > GlobalTrackTypeMax) return false; // MFT-MCH matching score cut @@ -1163,15 +1299,15 @@ struct qaMatching { } template - bool IsGoodGlobalMatching(const TMUON& muonTrack, double matchingScore) + bool isGoodGlobalMatching(const TMUON& muonTrack, double matchingScore) { - return IsGoodGlobalMatching(muonTrack, matchingScore, fMatchingChi2ScoreMftMchLow); + return isGoodGlobalMatching(muonTrack, matchingScore, cfgMatchingChi2ScoreMftMchLow); } template - bool IsTrueGlobalMatching(const TMUON& muonTrack, const std::vector>& matchablePairs) + bool isTrueGlobalMatching(const TMUON& muonTrack, const std::vector>& matchablePairs) { - if (static_cast(muonTrack.trackType()) > 2) + if (static_cast(muonTrack.trackType()) > GlobalTrackTypeMax) return false; int64_t mchTrackId = static_cast(muonTrack.matchMCHTrackId()); @@ -1182,18 +1318,18 @@ struct qaMatching { return (std::find(matchablePairs.begin(), matchablePairs.end(), trackIndexes) != matchablePairs.end()); } - bool IsMatchableMCH(int64_t mchTrackId, const std::vector>& matchablePairs) + bool isMatchableMch(int64_t mchTrackId, const std::vector>& matchablePairs) { - for (auto [id1, id2] : matchablePairs) { + for (const auto& [id1, id2] : matchablePairs) { if (mchTrackId == id1) return true; } return false; } - std::optional> GetMatchablePairForMCH(int64_t mchTrackId, const std::vector>& matchablePairs) + std::optional> getMatchablePairForMch(int64_t mchTrackId, const std::vector>& matchablePairs) { - for (auto pair : matchablePairs) { + for (const auto& pair : matchablePairs) { if (mchTrackId == pair.first) return pair; } @@ -1201,7 +1337,7 @@ struct qaMatching { } template - o2::dataformats::GlobalFwdTrack FwdToTrackPar(const T& track) + o2::dataformats::GlobalFwdTrack fwdToTrackPar(const T& track) { double chi2 = track.chi2(); SMatrix5 tpars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt()); @@ -1218,7 +1354,7 @@ struct qaMatching { } template - o2::dataformats::GlobalFwdTrack FwdToTrackPar(const T& track, const C& cov) + o2::dataformats::GlobalFwdTrack fwdToTrackPar(const T& track, const C& cov) { double chi2 = track.chi2(); SMatrix5 tpars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt()); @@ -1234,7 +1370,7 @@ struct qaMatching { return fwdtrack; } - o2::dataformats::GlobalFwdTrack PropagateToZMCH(const o2::dataformats::GlobalFwdTrack& muon, const double z) + o2::dataformats::GlobalFwdTrack propagateToZMch(const o2::dataformats::GlobalFwdTrack& muon, const double z) { auto mchTrack = mExtrap.FwdtoMCH(muon); @@ -1259,7 +1395,7 @@ struct qaMatching { } template - o2::dataformats::GlobalFwdTrack PropagateToZMCH(const T& muon, const double z) + o2::dataformats::GlobalFwdTrack propagateToZMch(const T& muon, const double z) { double chi2 = muon.chi2(); SMatrix5 tpars(muon.x(), muon.y(), muon.phi(), muon.tgl(), muon.signed1Pt()); @@ -1273,10 +1409,10 @@ struct qaMatching { track.setZ(fwdtrack.getZ()); track.setCovariances(fwdtrack.getCovariances()); - return PropagateToZMCH(track, z); + return propagateToZMch(track, z); } - o2::dataformats::GlobalFwdTrack PropagateToZMFT(const o2::dataformats::GlobalFwdTrack& mftTrack, const double z) + o2::dataformats::GlobalFwdTrack propagateToZMft(const o2::dataformats::GlobalFwdTrack& mftTrack, const double z) { o2::dataformats::GlobalFwdTrack fwdtrack{mftTrack}; fwdtrack.propagateToZ(z, mBzAtMftCenter); @@ -1284,10 +1420,10 @@ struct qaMatching { } template - o2::dataformats::GlobalFwdTrack PropagateToZMFT(const TMFT& mftTrack, const CMFT& mftCov, const double z) + o2::dataformats::GlobalFwdTrack propagateToZMft(const TMFT& mftTrack, const CMFT& mftCov, const double z) { - o2::dataformats::GlobalFwdTrack fwdtrack = FwdToTrackPar(mftTrack, mftCov); - return PropagateToZMFT(fwdtrack, z); + o2::dataformats::GlobalFwdTrack fwdtrack = fwdToTrackPar(mftTrack, mftCov); + return propagateToZMft(fwdtrack, z); } // method 0: standard extrapolation @@ -1295,60 +1431,60 @@ struct qaMatching { // method 2: MCH track extrapolation constrained to the first MFT track point, MFT extrapolation using MCH momentum // method 3: MCH track extrapolation constrained to the collision point, MFT extrapolation using MCH momentum template - o2::dataformats::GlobalFwdTrack PropagateToMatchingPlaneMCH(const TMCH& mchTrack, const TMFT& mftTrack, const CMFT& mftTrackCov, const C& collision, const double z, int method) + o2::dataformats::GlobalFwdTrack propagateToMatchingPlaneMch(const TMCH& mchTrack, const TMFT& mftTrack, const CMFT& mftTrackCov, const C& collision, const double z, int method) { - if (method == 0 || method == 1) { + if (method == ExtrapolationMethodStandard || method == 1) { // simple extrapolation upstream through the absorber - return PropagateToZMCH(mchTrack, z); + return propagateToZMch(mchTrack, z); } - if (method == 2) { + if (method == ExtrapolationMethodMftFirstPoint) { // extrapolation to the first MFT point and then back to the matching plane - auto mftTrackPar = FwdToTrackPar(mftTrack, mftTrackCov); - // std::cout << std::format("[PropagateToMatchingPlaneMCH] extrapolating to MFT: x={:0.3f} y={:0.3f} z={:0.3f}", mftTrackPar.getX(), mftTrackPar.getY(), mftTrackPar.getZ()) << std::endl; - auto mchTrackAtMFT = PropagateToVertexMCH(FwdToTrackPar(mchTrack, mchTrack), + auto mftTrackPar = fwdToTrackPar(mftTrack, mftTrackCov); + // std::cout << std::format("[propagateToMatchingPlaneMch] extrapolating to MFT: x={:0.3f} y={:0.3f} z={:0.3f}", mftTrackPar.getX(), mftTrackPar.getY(), mftTrackPar.getZ()) << std::endl; + auto mchTrackAtMFT = propagateToVertexMch(fwdToTrackPar(mchTrack, mchTrack), mftTrackPar.getX(), mftTrackPar.getY(), mftTrackPar.getZ(), mftTrackPar.getSigma2X(), mftTrackPar.getSigma2Y()); - // std::cout << std::format("[PropagateToMatchingPlaneMCH] extrapolating to z={:0.3f}", z) << std::endl; - return PropagateToZMCH(mchTrackAtMFT, z); + // std::cout << std::format("[propagateToMatchingPlaneMch] extrapolating to z={:0.3f}", z) << std::endl; + return propagateToZMch(mchTrackAtMFT, z); } - if (method == 3) { + if (method == ExtrapolationMethodVertex) { // extrapolation to the vertex and then back to the matching plane auto mchTrackAtVertex = VarManager::PropagateMuon(mchTrack, collision, VarManager::kToVertex); - return PropagateToZMCH(mchTrackAtVertex, z); + return propagateToZMch(mchTrackAtVertex, z); } - if (method == 4) { + if (method == ExtrapolationMethodMftDca) { // extrapolation to the MFT DCA and then back to the matching plane - auto mftTrackDCA = PropagateToZMFT(FwdToTrackPar(mftTrack, mftTrackCov), collision.posZ()); - auto mchTrackAtDCA = PropagateToVertexMCH(FwdToTrackPar(mchTrack, mchTrack), + auto mftTrackDCA = propagateToZMft(fwdToTrackPar(mftTrack, mftTrackCov), collision.posZ()); + auto mchTrackAtDCA = propagateToVertexMch(fwdToTrackPar(mchTrack, mchTrack), mftTrackDCA.getX(), mftTrackDCA.getY(), mftTrackDCA.getZ(), mftTrackDCA.getSigma2X(), mftTrackDCA.getSigma2Y()); - return PropagateToZMCH(mchTrackAtDCA, z); + return propagateToZMch(mchTrackAtDCA, z); } return {}; } template - o2::dataformats::GlobalFwdTrack PropagateToMatchingPlaneMFT(const TMCH& mchTrack, const TMFT& mftTrack, const CMFT& mftTrackCov, const C& collision, const double z, int method) + o2::dataformats::GlobalFwdTrack propagateToMatchingPlaneMft(const TMCH& mchTrack, const TMFT& mftTrack, const CMFT& mftTrackCov, const C& collision, const double z, int method) { - if (method == 0) { + if (method == ExtrapolationMethodStandard) { // extrapolation with MFT tools - return PropagateToZMFT(mftTrack, mftTrackCov, z); + return propagateToZMft(mftTrack, mftTrackCov, z); } if (method > 0) { // extrapolation with MCH tools auto mchTrackAtVertex = VarManager::PropagateMuon(mchTrack, collision, VarManager::kToVertex); double pMCH = mchTrackAtVertex.getP(); - double px = pMCH * sin(M_PI / 2 - atan(mftTrack.tgl())) * cos(mftTrack.phi()); - double py = pMCH * sin(M_PI / 2 - atan(mftTrack.tgl())) * sin(mftTrack.phi()); - double pt = std::sqrt(std::pow(px, 2) + std::pow(py, 2)); + double px = pMCH * std::sin(o2::constants::math::PIHalf - std::atan(mftTrack.tgl())) * std::cos(mftTrack.phi()); + double py = pMCH * std::sin(o2::constants::math::PIHalf - std::atan(mftTrack.tgl())) * std::sin(mftTrack.phi()); + double pt = std::hypot(px, py); double sign = mchTrack.sign(); - o2::dataformats::GlobalFwdTrack track = FwdToTrackPar(mftTrack, mftTrackCov); + o2::dataformats::GlobalFwdTrack track = fwdToTrackPar(mftTrack, mftTrackCov); // update momentum in track parameters and errors auto newCov = track.getCovariances(); @@ -1371,7 +1507,7 @@ struct qaMatching { return {}; } - o2::dataformats::GlobalFwdTrack PropagateToVertexMCH(const o2::dataformats::GlobalFwdTrack& muon, + o2::dataformats::GlobalFwdTrack propagateToVertexMch(const o2::dataformats::GlobalFwdTrack& muon, const double vx, const double vy, const double vz, const double covVx, const double covVy) { @@ -1389,10 +1525,10 @@ struct qaMatching { } template - o2::dataformats::GlobalFwdTrack PropagateToVertexMCH(const TMCH& muon, + o2::dataformats::GlobalFwdTrack propagateToVertexMch(const TMCH& muon, const C& collision) { - return PropagateToVertexMCH(FwdToTrackPar(muon, muon), + return propagateToVertexMch(fwdToTrackPar(muon, muon), collision.posX(), collision.posY(), collision.posZ(), @@ -1400,7 +1536,7 @@ struct qaMatching { collision.covYY()); } - o2::dataformats::GlobalFwdTrack PropagateToVertexMFT(o2::dataformats::GlobalFwdTrack muon, + o2::dataformats::GlobalFwdTrack propagateToVertexMft(o2::dataformats::GlobalFwdTrack muon, const float vx, const float vy, const float vz, const float covVx, const float covVy) { @@ -1416,10 +1552,10 @@ struct qaMatching { } template - o2::dataformats::GlobalFwdTrack PropagateToVertexMFT(const TMFT& muon, + o2::dataformats::GlobalFwdTrack propagateToVertexMft(const TMFT& muon, const C& collision) { - return PropagateToVertexMFT(FwdToTrackPar(muon), + return propagateToVertexMft(fwdToTrackPar(muon), collision.posX(), collision.posY(), collision.posZ(), @@ -1428,15 +1564,15 @@ struct qaMatching { } template - o2::dataformats::GlobalFwdTrack PropagateToVertexMFT(const TMFT& muon, + o2::dataformats::GlobalFwdTrack propagateToVertexMft(const TMFT& muon, const TMCH& mchTrack, const C& collision) { // extrapolation with MCH tools - auto mchTrackAtMFT = mExtrap.FwdtoMCH(FwdToTrackPar(mchTrack)); + auto mchTrackAtMFT = mExtrap.FwdtoMCH(fwdToTrackPar(mchTrack)); o2::mch::TrackExtrap::extrapToVertexWithoutBranson(mchTrackAtMFT, muon.z()); - auto muonTrackProp = mExtrap.FwdtoMCH(FwdToTrackPar(muon)); + auto muonTrackProp = mExtrap.FwdtoMCH(fwdToTrackPar(muon)); // update global track momentum from the MCH track double pRatio = muonTrackProp.p() / mchTrackAtMFT.p(); @@ -1455,7 +1591,7 @@ struct qaMatching { } template - void GetMotherParticles(MCP const& mcParticle, std::vector>& motherParticlesVec) + void getMotherParticles(MCP const& mcParticle, std::vector>& motherParticlesVec) { const auto& motherParticles = mcParticle.template mothers_as(); if (motherParticles.empty()) { @@ -1464,11 +1600,11 @@ struct qaMatching { const auto& motherParticle = motherParticles[0]; motherParticlesVec.emplace_back(std::make_pair(static_cast(motherParticle.pdgCode()), static_cast(motherParticle.globalIndex()))); - GetMotherParticles(motherParticle, motherParticlesVec); + getMotherParticles(motherParticle, motherParticlesVec); } template - std::vector> GetMotherParticles(T const& track) + std::vector> getMotherParticles(T const& track) { std::vector> result; if (!track.has_mcParticle()) @@ -1477,15 +1613,15 @@ struct qaMatching { const auto& mcParticle = track.mcParticle(); result.emplace_back(std::make_pair(static_cast(mcParticle.pdgCode()), static_cast(mcParticle.globalIndex()))); - GetMotherParticles(mcParticle, result); + getMotherParticles(mcParticle, result); return result; } template - int GetDecayRanking(TMCH const& mchTrack, TMFTs const& mftTracks) + int getDecayRanking(TMCH const& mchTrack, TMFTs const& mftTracks) { - auto mchMotherParticles = GetMotherParticles(mchTrack); + auto mchMotherParticles = getMotherParticles(mchTrack); int decayRanking = 0; // search for an MFT track that is associated to one of the MCH mother particles @@ -1514,14 +1650,14 @@ struct qaMatching { } template - void FillMatchablePairs(CollisionInfo& collisionInfo, + void fillMatchablePairs(CollisionInfo& collisionInfo, TMUON const& muonTracks, TMFT const& mftTracks) { collisionInfo.matchablePairs.clear(); for (const auto& muonTrack : muonTracks) { // only consider MCH standalone or MCH-MID matches - if (static_cast(muonTrack.trackType()) <= 2) + if (static_cast(muonTrack.trackType()) <= GlobalTrackTypeMax) continue; // only consider tracks associated to the current collision @@ -1535,7 +1671,7 @@ struct qaMatching { continue; // get the index associated to the MC particle auto muonMcParticle = muonTrack.mcParticle(); - if (std::abs(muonMcParticle.pdgCode()) != 13) + if (std::abs(muonMcParticle.pdgCode()) != kMuonMinus) continue; int64_t muonMcTrackIndex = muonMcParticle.globalIndex(); @@ -1557,7 +1693,7 @@ struct qaMatching { } template - int GetTrueMatchIndex(TMUON const& muonTracks, + int getTrueMatchIndex(TMUON const& muonTracks, const std::vector& matchCandidatesVector, const std::vector>& matchablePairs) { @@ -1568,7 +1704,7 @@ struct qaMatching { for (size_t i = 0; i < matchCandidatesVector.size(); i++) { auto const& muonTrack = muonTracks.rawIteratorAt(matchCandidatesVector[i].globalTrackId); - if (IsTrueGlobalMatching(muonTrack, matchablePairs)) { + if (isTrueGlobalMatching(muonTrack, matchablePairs)) { trueMatchIndex = i + 1; break; } @@ -1576,92 +1712,43 @@ struct qaMatching { return trueMatchIndex; } - template - bool IsMuon(const TMCH& mchTrack, - const TMFT& mftTrack) - { - // skip tracks that do not have an associated MC particle - if (!mchTrack.has_mcParticle()) - return false; - if (!mftTrack.has_mcParticle()) - return false; - - // get the index associated to the MC particles - auto mchMcParticle = mchTrack.mcParticle(); - auto mftMcParticle = mftTrack.mcParticle(); - if (mchMcParticle.globalIndex() != mftMcParticle.globalIndex()) - return false; - - if (std::abs(mchMcParticle.pdgCode()) != 13) - return false; - - return true; - } - - template - bool IsMuon(const TMUON& muonTrack, - TMUONS const& /*muonTracks*/, - TMFTS const& /*mftTracks*/) - { - if (static_cast(muonTrack.trackType()) >= 2) - return false; - - auto const& mchTrack = muonTrack.template matchMCHTrack_as(); - auto const& mftTrack = muonTrack.template matchMFTTrack_as(); - - return IsMuon(mchTrack, mftTrack); - } - template - MuonMatchType GetMatchType(const TMUON& muonTrack, - TMUONS const& muonTracks, + MuonMatchType getMatchType(const TMUON& muonTrack, + TMUONS const& /*muonTracks*/, TMFTS const& mftTracks, const std::vector>& matchablePairs, int ranking) { - if (static_cast(muonTrack.trackType()) > 2) + if (static_cast(muonTrack.trackType()) > GlobalTrackTypeMax) return kMatchTypeUndefined; auto const& mchTrack = muonTrack.template matchMCHTrack_as(); - - bool isPaired = IsMatchableMCH(mchTrack.globalIndex(), matchablePairs); - bool isMuon = IsMuon(muonTrack, muonTracks, mftTracks); - int decayRanking = GetDecayRanking(mchTrack, mftTracks); + bool isPaired = isMatchableMch(mchTrack.globalIndex(), matchablePairs); + int decayRanking = getDecayRanking(mchTrack, mftTracks); MuonMatchType result{kMatchTypeUndefined}; if (isPaired) { - if (isMuon) { - result = (ranking == 1) ? kMatchTypeTrueLeading : kMatchTypeTrueNonLeading; - } else { - result = (ranking == 1) ? kMatchTypeWrongLeading : kMatchTypeWrongNonLeading; - } - } else if (decayRanking == 2) { + result = (ranking == 1) ? kMatchTypeTrueLeading : kMatchTypeTrueNonLeading; + } else if (decayRanking == FirstDecayMotherRank) { result = (ranking == 1) ? kMatchTypeDecayLeading : kMatchTypeDecayNonLeading; } else { result = (ranking == 1) ? kMatchTypeFakeLeading : kMatchTypeFakeNonLeading; } - - if (result == kMatchTypeUndefined) { - std::cout << std::format("[GetMatchType] isPaired={} isMuon={} decayRanking={} result={}", - isPaired, isMuon, decayRanking, static_cast(result)) - << std::endl; - } - return result; } // for each MCH standalone track, collect the associated matching candidates template - void GetSelectedMuons(const CollisionInfo& collisionInfo, + void getSelectedMuons(const CollisionInfo& collisionInfo, C const& collisions, TMUON const& muonTracks, std::vector& selectedMuons) { selectedMuons.clear(); - for (auto muonTrack : muonTracks) { + for (const auto& muonTrack : muonTracks) { // only consider MCH-MID matches - if (static_cast(muonTrack.trackType()) != 3) { + if (static_cast(muonTrack.trackType()) != MchMidTrackType) { continue; } @@ -1674,13 +1761,13 @@ struct qaMatching { const auto& collision = collisions.rawIteratorAt(muonTrack.collisionId()); // select MCH tracks with strict quality cuts - if (!IsGoodMuon(muonTrack, collision, - fMuonTaggingTrackChi2MchUp, - fMuonTaggingPMchLow, - fMuonTaggingPtMchLow, - {fMuonTaggingEtaMchLow, fMuonTaggingEtaMchUp}, - {fMuonTaggingRabsLow, fMuonTaggingRabsUp}, - fMuonTaggingSigmaPdcaUp)) { + if (!isGoodMuon(muonTrack, collision, + cfgMuonTaggingTrackChi2MchUp, + cfgMuonTaggingPMchLow, + cfgMuonTaggingPtMchLow, + {cfgMuonTaggingEtaMchLow, cfgMuonTaggingEtaMchUp}, + {cfgMuonTaggingRabsLow, cfgMuonTaggingRabsUp}, + cfgMuonTaggingPdcaUp)) { continue; } @@ -1688,7 +1775,7 @@ struct qaMatching { auto mchTrackAtVertex = VarManager::PropagateMuon(muonTrack, collision, VarManager::kToVertex); // propagate the track from the vertex to the first MFT plane - const auto& extrapToMFTfirst = PropagateToZMCH(mchTrackAtVertex, o2::mft::constants::mft::LayerZCoordinate()[0]); + const auto& extrapToMFTfirst = propagateToZMch(mchTrackAtVertex, o2::mft::constants::mft::LayerZCoordinate()[0]); double rFront = std::sqrt(extrapToMFTfirst.getX() * extrapToMFTfirst.getX() + extrapToMFTfirst.getY() * extrapToMFTfirst.getY()); double rMinFront = 3.f; double rMaxFront = 9.f; @@ -1696,7 +1783,7 @@ struct qaMatching { continue; // propagate the track from the vertex to the last MFT plane - const auto& extrapToMFTlast = PropagateToZMCH(mchTrackAtVertex, o2::mft::constants::mft::LayerZCoordinate()[9]); + const auto& extrapToMFTlast = propagateToZMch(mchTrackAtVertex, o2::mft::constants::mft::LayerZCoordinate()[9]); double rBack = std::sqrt(extrapToMFTlast.getX() * extrapToMFTlast.getX() + extrapToMFTlast.getY() * extrapToMFTlast.getY()); double rMinBack = 5.f; double rMaxBack = 12.f; @@ -1710,13 +1797,13 @@ struct qaMatching { // for each MCH standalone track, collect the associated matching candidates template - void GetTaggedMuons(const CollisionInfo& collisionInfo, + void getTaggedMuons(const CollisionInfo& collisionInfo, TMUON const& muonTracks, const std::vector& selectedMuons, std::vector& taggedMuons) { taggedMuons.clear(); - for (auto [mchIndex, globalTracksVector] : collisionInfo.matchingCandidates) { + for (const auto& [mchIndex, globalTracksVector] : collisionInfo.matchingCandidates) { // check if the current muon is selected if (std::find(selectedMuons.begin(), selectedMuons.end(), mchIndex) == selectedMuons.end()) @@ -1732,22 +1819,22 @@ struct qaMatching { auto const& muonTrack1 = muonTracks.rawIteratorAt(globalTracksVector[1].globalTrackId); double chi2diff = muonTrack1.chi2MatchMCHMFT() - muonTrack0.chi2MatchMCHMFT(); - if (chi2diff < fMuonTaggingChi2DiffLow) + if (chi2diff < cfgMuonTaggingChi2DiffLow) continue; taggedMuons.emplace_back(mchIndex); } } - void GetMuonPairs(const CollisionInfo& collisionInfo, + void getMuonPairs(const CollisionInfo& collisionInfo, std::vector& muonPairs, std::vector& globalMuonPairs) { // outer loop over muon tracks - for (auto mchIndex1 : collisionInfo.mchTracks) { + for (const auto& mchIndex1 : collisionInfo.mchTracks) { // inner loop over muon tracks - for (auto mchIndex2 : collisionInfo.mchTracks) { + for (const auto& mchIndex2 : collisionInfo.mchTracks) { // avoid double-counting of muon pairs if (mchIndex2 <= mchIndex1) continue; @@ -1758,10 +1845,10 @@ struct qaMatching { } // outer loop over global muon tracks - for (auto& [mchIndex1, matchingCandidates1] : collisionInfo.matchingCandidates) { + for (const auto& [mchIndex1, matchingCandidates1] : collisionInfo.matchingCandidates) { // inner loop over global muon tracks - for (auto& [mchIndex2, matchingCandidates2] : collisionInfo.matchingCandidates) { + for (const auto& [mchIndex2, matchingCandidates2] : collisionInfo.matchingCandidates) { // avoid double-counting of muon pairs if (mchIndex2 <= mchIndex1) continue; @@ -1772,7 +1859,7 @@ struct qaMatching { } } - double GetMuMuInvariantMass(const o2::mch::TrackParam& track1, const o2::mch::TrackParam& track2) + double getMuMuInvariantMass(const o2::mch::TrackParam& track1, const o2::mch::TrackParam& track2) { ROOT::Math::PxPyPzMVector muon1{ track1.px(), @@ -1791,7 +1878,7 @@ struct qaMatching { return dimuon.M(); } - double GetMuMuInvariantMass(const o2::dataformats::GlobalFwdTrack& track1, const o2::dataformats::GlobalFwdTrack& track2) + double getMuMuInvariantMass(const o2::dataformats::GlobalFwdTrack& track1, const o2::dataformats::GlobalFwdTrack& track2) { ROOT::Math::PxPyPzMVector muon1{ track1.getPx(), @@ -1811,7 +1898,7 @@ struct qaMatching { } template - int GetMftMchMatchAttempts(EVT const& collisions, + int getMftMchMatchAttempts(EVT const& collisions, BC const& bcs, TMUON const& mchTrack, TMFTS const& mftTracks) @@ -1846,7 +1933,7 @@ struct qaMatching { } template - void FillCollisions(EVT const& collisions, + void fillCollisions(EVT const& collisions, BC const& bcs, TMUON const& muonTracks, TMFT const& mftTracks, @@ -1867,19 +1954,8 @@ struct qaMatching { int64_t collisionIndex = collision.globalIndex(); auto bc = bcs.rawIteratorAt(collision.bcId()); - /*// require a minimum BC gap between the current conllision and the previous/next ones - const auto& collisionPrev = collisions.rawIteratorAt(collisionIds[cid-1]); - const auto& collisionNext = collisions.rawIteratorAt(collisionIds[cid+1]); - auto bcPrev = bcs.rawIteratorAt(collisionPrev.bcId()); - auto bcNext = bcs.rawIteratorAt(collisionNext.bcId()); - int64_t deltaPrev = bc.globalBC() - bcPrev.globalBC(); - int64_t deltaNext = bcNext.globalBC() - bc.globalBC(); - if (deltaPrev < 50 || deltaNext < 50) { - continue; - }*/ - // fill collision information for global muon tracks (MFT-MCH-MID matches) - for (auto muonTrack : muonTracks) { + for (const auto& muonTrack : muonTracks) { if (!muonTrack.has_collision()) continue; @@ -1893,18 +1969,18 @@ struct qaMatching { collisionInfo.zVertex = collision.posZ(); if (collisionInfo.matchablePairs.empty()) { - FillMatchablePairs(collisionInfo, muonTracks, mftTracks); + fillMatchablePairs(collisionInfo, muonTracks, mftTracks); } - if (static_cast(muonTrack.trackType()) > 2) { + if (static_cast(muonTrack.trackType()) > GlobalTrackTypeMax) { // standalone MCH or MCH-MID tracks int64_t mchTrackIndex = muonTrack.globalIndex(); collisionInfo.mchTracks.push_back(mchTrackIndex); } else { // global muon tracks (MFT-MCH or MFT-MCH-MID) int64_t muonTrackIndex = muonTrack.globalIndex(); - double matchChi2 = muonTrack.chi2MatchMCHMFT() / 5.f; - double matchScore = chi2ToScore(muonTrack.chi2MatchMCHMFT(), 5, 50.f); + double matchChi2 = muonTrack.chi2MatchMCHMFT() / MatchingDegreesOfFreedom; + double matchScore = chi2ToScore(muonTrack.chi2MatchMCHMFT(), MatchingDegreesOfFreedom, MatchingScoreChi2Max); auto const& mchTrack = muonTrack.template matchMCHTrack_as(); int64_t mchTrackIndex = mchTrack.globalIndex(); auto const& mftTrack = muonTrack.template matchMFTTrack_as(); @@ -1947,7 +2023,7 @@ struct qaMatching { } // fill collision information for MFT standalone tracks - for (auto mftTrack : mftTracks) { + for (const auto& mftTrack : mftTracks) { if (!mftTrack.has_collision()) continue; @@ -1971,19 +2047,23 @@ struct qaMatching { return (track1.matchScore > track2.matchScore); }; - for (auto& [collisionIndex, collisionInfo] : collisionInfos) { - for (auto& [mchIndex, globalTracksVector] : collisionInfo.matchingCandidates) { + for (auto collisionInfoIt = collisionInfos.begin(); collisionInfoIt != collisionInfos.end(); ++collisionInfoIt) { + auto& collisionInfo = collisionInfoIt->second; + for (auto matchingCandidatesIt = collisionInfo.matchingCandidates.begin(); matchingCandidatesIt != collisionInfo.matchingCandidates.end(); ++matchingCandidatesIt) { + auto& mchIndex = matchingCandidatesIt->first; + auto& globalTracksVector = matchingCandidatesIt->second; std::sort(globalTracksVector.begin(), globalTracksVector.end(), compareMatchingScore); const auto& mchTrack = muonTracks.rawIteratorAt(mchIndex); - auto mftMchMatchAttempts = GetMftMchMatchAttempts(collisions, bcs, mchTrack, mftTracks); + auto mftMchMatchAttempts = getMftMchMatchAttempts(collisions, bcs, mchTrack, mftTracks); int ranking = 1; - for (auto& candidate : globalTracksVector) { + for (auto candidateIt = globalTracksVector.begin(); candidateIt != globalTracksVector.end(); ++candidateIt) { + auto& candidate = *candidateIt; const auto& muonTrack = muonTracks.rawIteratorAt(candidate.globalTrackId); candidate.matchRanking = ranking; candidate.matchRankingProd = ranking; - candidate.matchType = GetMatchType(muonTrack, muonTracks, mftTracks, collisionInfo.matchablePairs, ranking); + candidate.matchType = getMatchType(muonTrack, muonTracks, mftTracks, collisionInfo.matchablePairs, ranking); candidate.mftMchMatchAttempts = mftMchMatchAttempts; ranking += 1; } @@ -1992,7 +2072,7 @@ struct qaMatching { } template - void FillMatchingPlotsMC(C const& collision, + void fillMatchingPlotsMc(C const& collision, const CollisionInfo& collisionInfo, TMUON const& muonTracks, TMFT const& mftTracks, @@ -2001,7 +2081,7 @@ struct qaMatching { const std::vector>& matchablePairs, double matchingScoreCut, MatchingPlotter* plotter, - bool verbose = false) + bool /*verbose*/ = false) { int mftTrackMult = collisionInfo.mftTracks.size(); @@ -2010,7 +2090,7 @@ struct qaMatching { for (const auto& [mchIndex, globalTracksVector] : matchingCandidates) { // check if the MCH track belongs to a matchable pair - bool isPairedMCH = IsMatchableMCH(static_cast(mchIndex), matchablePairs); + bool isPairedMCH = isMatchableMch(static_cast(mchIndex), matchablePairs); // get the standalone MCH track auto const& mchTrack = muonTracks.rawIteratorAt(mchIndex); @@ -2018,24 +2098,24 @@ struct qaMatching { double mchPt = mchTrack.pt(); // MCH track quality flag - bool isGoodMCH = IsGoodGlobalMuon(mchTrack, collision); + bool isGoodMCH = isGoodGlobalMuon(mchTrack, collision); - auto matchablePair = GetMatchablePairForMCH(static_cast(mchIndex), matchablePairs); + auto matchablePair = getMatchablePairForMch(static_cast(mchIndex), matchablePairs); bool hasMatchablePair = matchablePair.has_value(); int decayRanking = 0; int mftTrackType = -1; - float dchi2 = (globalTracksVector.size() >= 2) ? globalTracksVector[1].matchChi2 - globalTracksVector[0].matchChi2 : -1; + float dchi2 = (globalTracksVector.size() >= MinCandidatesForDeltaChi2) ? globalTracksVector[1].matchChi2 - globalTracksVector[0].matchChi2 : InvalidDeltaChi2; if (hasMatchablePair) { auto const& pairedMftTrack = mftTracks.rawIteratorAt(matchablePair.value().second); - mftTrackType = pairedMftTrack.isCA() ? 1 : 0; - decayRanking = GetDecayRanking(mchTrack, mftTracks); + mftTrackType = pairedMftTrack.isCA() ? MftTrackTypeCA : MftTrackTypeStandard; + decayRanking = getDecayRanking(mchTrack, mftTracks); } // find the index of the matching candidate that corresponds to the true match // index=1 corresponds to the leading candidate // index=0 means no candidate was found that corresponds to the true match - int trueMatchIndex = GetTrueMatchIndex(muonTracks, globalTracksVector, matchablePairs); - int trueMatchIndexProd = GetTrueMatchIndex(muonTracks, matchingCandidatesProd.at(mchIndex), matchablePairs); + int trueMatchIndex = getTrueMatchIndex(muonTracks, globalTracksVector, matchablePairs); + int trueMatchIndexProd = getTrueMatchIndex(muonTracks, matchingCandidatesProd.at(mchIndex), matchablePairs); float mcParticleDz = -1000; if (mchTrack.has_mcParticle()) { @@ -2148,7 +2228,7 @@ struct qaMatching { // ==================================== // Matching properties - for (auto [mchIndex, globalTracksVector] : matchingCandidates) { + for (const auto& [mchIndex, globalTracksVector] : matchingCandidates) { if (globalTracksVector.size() < 1) continue; @@ -2156,7 +2236,7 @@ struct qaMatching { auto const& mchTrack = muonTracks.rawIteratorAt(mchIndex); // skip global muon tracks that do not pass the MCH and MFT quality cuts - if (!IsGoodGlobalMuon(mchTrack, collision)) + if (!isGoodGlobalMuon(mchTrack, collision)) continue; double mchMom = mchTrack.p(); @@ -2179,11 +2259,11 @@ struct qaMatching { } } - for (auto [mchIndex, globalTracksVector] : matchingCandidates) { + for (const auto& [mchIndex, globalTracksVector] : matchingCandidates) { if (globalTracksVector.size() < 1) continue; - int trueMatchIndex = GetTrueMatchIndex(muonTracks, globalTracksVector, matchablePairs); + int trueMatchIndex = getTrueMatchIndex(muonTracks, globalTracksVector, matchablePairs); // loop over candidates int candidateIndex = 1; @@ -2210,9 +2290,7 @@ struct qaMatching { // ==================================== // Matching purity - if (verbose) - std::cout << std::format(" Filling matching purity plots with score cut {}", matchingScoreCut) << std::endl; - for (auto [mchIndex, globalTracksVector] : matchingCandidates) { + for (const auto& [mchIndex, globalTracksVector] : matchingCandidates) { if (globalTracksVector.size() < 1) continue; @@ -2225,37 +2303,28 @@ struct qaMatching { auto const& mftTrack = muonTrack.template matchMFTTrack_as(); // skip global muon tracks that do not pass the MCH and MFT quality cuts - if (!IsGoodGlobalMuon(mchTrack, collision)) + if (!isGoodGlobalMuon(mchTrack, collision)) continue; - if (!IsGoodMFT(mftTrack)) + if (!isGoodMft(mftTrack)) continue; // skip candidates that do not pass the matching quality cuts - if (!IsGoodGlobalMatching(muonTrack, matchingScore, matchingScoreCut)) + if (!isGoodGlobalMatching(muonTrack, matchingScore, matchingScoreCut)) continue; // check if the matching candidate is a true one - bool isTrueMatch = IsTrueGlobalMatching(muonTrack, matchablePairs); + bool isTrueMatch = isTrueGlobalMatching(muonTrack, matchablePairs); // ---- MC ancestry ---- - auto motherParticles = GetMotherParticles(muonTrack); + auto motherParticles = getMotherParticles(muonTrack); int motherPDG = 0; if (motherParticles.size() > 1) { motherPDG = motherParticles[1].first; } - - if (verbose) { - std::cout << std::format(" MCH track #{} -> Muon track #{}, isTrueMatch={}", mchIndex, globalTracksVector[0].globalTrackId, isTrueMatch) << std::endl; - std::cout << " MC ancestry (pdg): "; - for (auto const& [pdg, idx] : motherParticles) { - std::cout << "(" << pdg << ") "; - } - std::cout << std::endl; - } // fill matching purity plots - plotter->fMatchingPurityPlotter.Fill(mchTrack, isTrueMatch); - if (fConfigQAs.fCreatePdgMomHistograms) { - plotter->fMatchingPurityPlotter.Fill(mchTrack, motherPDG, isTrueMatch); + plotter->fMatchingPurityPlotter.fill(mchTrack, isTrueMatch); + if (configQas.cfgCreatePdgMomHistograms) { + plotter->fMatchingPurityPlotter.fill(mchTrack, motherPDG, isTrueMatch); } } @@ -2263,13 +2332,13 @@ struct qaMatching { // Matching efficiencies // outer loop on matchable pairs - for (auto [matchableMchIndex, matchableMftIndex] : matchablePairs) { + for (const auto& [matchableMchIndex, matchableMftIndex] : matchablePairs) { // get the standalone MCH track auto const& mchTrack = muonTracks.rawIteratorAt(matchableMchIndex); // skip track pairs that do not pass the MCH and MFT quality cuts // we only consider matchable pairs that fulfill the track quality requirements - if (!IsGoodGlobalMuon(mchTrack, collision)) + if (!isGoodGlobalMuon(mchTrack, collision)) continue; bool goodMatchFound = false; @@ -2287,44 +2356,47 @@ struct qaMatching { auto const& mftTrack = muonTrack.template matchMFTTrack_as(); auto mftIndex = mftTrack.globalIndex(); - goodMatchFound = IsGoodGlobalMatching(muonTrack, matchingScore, matchingScoreCut); + goodMatchFound = isGoodGlobalMatching(muonTrack, matchingScore, matchingScoreCut); isTrueMatch = (mftIndex == matchableMftIndex); } } + if (cfgQaMatchingAodDebug > 0 && goodMatchFound && isTrueMatch) { + LOGF(info, + "[good&true] mchId=%lld trackType=%d p=%.3f pt=%.3f eta=%.3f phi=%.3f", + static_cast(mchTrack.globalIndex()), + static_cast(mchTrack.trackType()), + mchTrack.p(), + mchTrack.pt(), + mchTrack.eta(), + mchTrack.phi()); + } + // ---- MC ancestry ---- - auto motherParticles = GetMotherParticles(mchTrack); + auto motherParticles = getMotherParticles(mchTrack); int motherPDG = 0; if (motherParticles.size() > 1) { motherPDG = motherParticles[1].first; } - if (verbose) { - std::cout << " MC ancestry (pdg): "; - for (auto const& [pdg, idx] : motherParticles) { - std::cout << "(" << pdg << ") "; - } - std::cout << std::endl; - } - // fill matching efficiency plots - plotter->fPairingEfficiencyPlotter.Fill(mchTrack, goodMatchFound); - if (fConfigQAs.fCreatePdgMomHistograms) { - plotter->fPairingEfficiencyPlotter.Fill(mchTrack, motherPDG, goodMatchFound); + plotter->fPairingEfficiencyPlotter.fill(mchTrack, goodMatchFound); + if (configQas.cfgCreatePdgMomHistograms) { + plotter->fPairingEfficiencyPlotter.fill(mchTrack, motherPDG, goodMatchFound); } - plotter->fMatchingEfficiencyPlotter.Fill(mchTrack, (goodMatchFound && isTrueMatch)); - if (fConfigQAs.fCreatePdgMomHistograms) { - plotter->fMatchingEfficiencyPlotter.Fill(mchTrack, motherPDG, (goodMatchFound && isTrueMatch)); + plotter->fMatchingEfficiencyPlotter.fill(mchTrack, (goodMatchFound && isTrueMatch)); + if (configQas.cfgCreatePdgMomHistograms) { + plotter->fMatchingEfficiencyPlotter.fill(mchTrack, motherPDG, (goodMatchFound && isTrueMatch)); } - plotter->fFakeMatchingEfficiencyPlotter.Fill(mchTrack, (goodMatchFound && !isTrueMatch)); - if (fConfigQAs.fCreatePdgMomHistograms) { - plotter->fFakeMatchingEfficiencyPlotter.Fill(mchTrack, motherPDG, (goodMatchFound && !isTrueMatch)); + plotter->fFakeMatchingEfficiencyPlotter.fill(mchTrack, (goodMatchFound && !isTrueMatch)); + if (configQas.cfgCreatePdgMomHistograms) { + plotter->fFakeMatchingEfficiencyPlotter.fill(mchTrack, motherPDG, (goodMatchFound && !isTrueMatch)); } } } template - void FillDimuonPlotsMC(const CollisionInfo& collisionInfo, + void fillDimuonPlotsMc(const CollisionInfo& collisionInfo, C const& collisions, TMUON const& muonTracks, TMFT const& /*mftTracks*/) @@ -2332,9 +2404,9 @@ struct qaMatching { std::vector muonPairs; std::vector globalMuonPairs; - GetMuonPairs(collisionInfo, muonPairs, globalMuonPairs); + getMuonPairs(collisionInfo, muonPairs, globalMuonPairs); - for (auto& [muon1, muon2] : muonPairs) { + for (const auto& [muon1, muon2] : muonPairs) { auto const& collision = collisions.rawIteratorAt(muon1.first); auto mchIndex1 = muon1.second; @@ -2348,16 +2420,16 @@ struct qaMatching { if ((sign1 * sign2) >= 0) continue; - bool goodMuonTracks = (IsGoodMuon(muonTrack1, collision) && IsGoodMuon(muonTrack2, collision)); + bool goodMuonTracks = (isGoodMuon(muonTrack1, collision) && isGoodMuon(muonTrack2, collision)); if (goodMuonTracks) { - double mass = GetMuMuInvariantMass(PropagateToVertexMCH(muonTrack1, collision), - PropagateToVertexMCH(muonTrack2, collision)); + double mass = getMuMuInvariantMass(propagateToVertexMch(muonTrack1, collision), + propagateToVertexMch(muonTrack2, collision)); registryDimuon.get(HIST("dimuon/invariantMass_MuonKine_MuonCuts"))->Fill(mass); } } - for (auto& [muon1, muon2] : globalMuonPairs) { + for (const auto& [muon1, muon2] : globalMuonPairs) { auto& candidates1 = muon1.second; auto& candidates2 = muon2.second; @@ -2385,17 +2457,17 @@ struct qaMatching { matchType = candidates2[0].matchType * 10 + candidates1[0].matchType; } - bool goodGlobalMuonTracks = (IsGoodGlobalMuon(mchTrack1, collision) && IsGoodGlobalMuon(mchTrack2, collision)); + bool goodGlobalMuonTracks = (isGoodGlobalMuon(mchTrack1, collision) && isGoodGlobalMuon(mchTrack2, collision)); if (!goodGlobalMuonTracks) { continue; } - bool goodGlobalMuonMatches = (IsGoodGlobalMatching(muonTrack1, matchScore1) && IsGoodGlobalMatching(muonTrack2, matchScore2)); + bool goodGlobalMuonMatches = (isGoodGlobalMatching(muonTrack1, matchScore1) && isGoodGlobalMatching(muonTrack2, matchScore2)); - double massMCH = GetMuMuInvariantMass(PropagateToVertexMCH(mchTrack1, collision), - PropagateToVertexMCH(mchTrack2, collision)); - double mass = GetMuMuInvariantMass(PropagateToVertexMCH(muonTrack1, collision), - PropagateToVertexMCH(muonTrack2, collision)); + double massMCH = getMuMuInvariantMass(propagateToVertexMch(mchTrack1, collision), + propagateToVertexMch(mchTrack2, collision)); + double mass = getMuMuInvariantMass(propagateToVertexMch(muonTrack1, collision), + propagateToVertexMch(muonTrack2, collision)); registryDimuon.get(HIST("dimuon/invariantMass_MuonKine_GlobalMuonCuts"))->Fill(massMCH); registryDimuon.get(HIST("dimuon/invariantMass_ScaledMftKine_GlobalMuonCuts"))->Fill(mass); registryDimuon.get(HIST("dimuon/MC/invariantMass_MuonKine_GlobalMuonCuts_vs_match_type"))->Fill(massMCH, matchType); @@ -2411,7 +2483,7 @@ struct qaMatching { } template - void RunChi2Matching(C const& collisions, + void runChi2Matching(C const& collisions, BC const& bcs, TMUON const& muonTracks, TMFT const& mftTracks, @@ -2434,7 +2506,7 @@ struct qaMatching { return; auto matchingFunc = mMatchingFunctionMap.at(funcName); - for (auto& [mchIndex, globalTracksVector] : matchingCandidates) { + for (const auto& [mchIndex, globalTracksVector] : matchingCandidates) { auto const& mchTrack = muonTracks.rawIteratorAt(mchIndex); for (const auto& candidate : globalTracksVector) { @@ -2454,12 +2526,12 @@ struct qaMatching { auto const& mftTrackCov = mftCovs.rawIteratorAt(mftTrackCovs[mftTrack.globalIndex()]); // get tracks parameters in O2 format - auto mftTrackProp = FwdToTrackPar(mftTrack, mftTrackCov); - auto mchTrackProp = FwdToTrackPar(mchTrack, mchTrack); + auto mftTrackProp = fwdToTrackPar(mftTrack, mftTrackCov); + auto mchTrackProp = fwdToTrackPar(mchTrack, mchTrack); if (matchingPlaneZ < 0.) { - mftTrackProp = PropagateToMatchingPlaneMFT(mchTrack, mftTrack, mftTrackCov, collision, matchingPlaneZ, extrapMethod); - mchTrackProp = PropagateToMatchingPlaneMCH(mchTrack, mftTrack, mftTrackCov, collision, matchingPlaneZ, extrapMethod); + mftTrackProp = propagateToMatchingPlaneMft(mchTrack, mftTrack, mftTrackCov, collision, matchingPlaneZ, extrapMethod); + mchTrackProp = propagateToMatchingPlaneMch(mchTrack, mftTrack, mftTrackCov, collision, matchingPlaneZ, extrapMethod); } // run the chi2 matching function @@ -2507,17 +2579,20 @@ struct qaMatching { return (track1.matchScore > track2.matchScore); }; - for (auto& [mchIndex, globalTracksVector] : newMatchingCandidates) { + for (auto matchingCandidatesIt = newMatchingCandidates.begin(); matchingCandidatesIt != newMatchingCandidates.end(); ++matchingCandidatesIt) { + auto& mchIndex = matchingCandidatesIt->first; + auto& globalTracksVector = matchingCandidatesIt->second; std::sort(globalTracksVector.begin(), globalTracksVector.end(), compareMatchingScore); const auto& mchTrack = muonTracks.rawIteratorAt(mchIndex); - auto mftMchMatchAttempts = GetMftMchMatchAttempts(collisions, bcs, mchTrack, mftTracks); + auto mftMchMatchAttempts = getMftMchMatchAttempts(collisions, bcs, mchTrack, mftTracks); int ranking = 1; - for (auto& candidate : globalTracksVector) { + for (auto candidateIt = globalTracksVector.begin(); candidateIt != globalTracksVector.end(); ++candidateIt) { + auto& candidate = *candidateIt; const auto& muonTrack = muonTracks.rawIteratorAt(candidate.globalTrackId); candidate.matchRanking = ranking; - candidate.matchType = GetMatchType(muonTrack, muonTracks, mftTracks, matchablePairs, ranking); + candidate.matchType = getMatchType(muonTrack, muonTracks, mftTracks, matchablePairs, ranking); candidate.mftMchMatchAttempts = mftMchMatchAttempts; ranking += 1; } @@ -2525,7 +2600,7 @@ struct qaMatching { } template - void RunChi2Matching(C const& collisions, + void runChi2Matching(C const& collisions, BC const& bcs, TMUON const& muonTracks, TMFT const& mftTracks, @@ -2555,11 +2630,11 @@ struct qaMatching { auto matchingPlaneZ = matchingPlanesZ[label]; auto extrapMethod = matchingExtrapMethod[label]; - RunChi2Matching(collisions, bcs, muonTracks, mftTracks, mftCovs, funcName, matchingPlaneZ, extrapMethod, matchablePairs, matchingCandidates, newMatchingCandidates); + runChi2Matching(collisions, bcs, muonTracks, mftTracks, mftCovs, funcName, matchingPlaneZ, extrapMethod, matchablePairs, matchingCandidates, newMatchingCandidates); } template - void RunMLMatching(C const& collisions, + void runMlMatching(C const& collisions, BC const& bcs, TMUON const& muonTracks, TMFT const& mftTracks, @@ -2575,7 +2650,7 @@ struct qaMatching { return; auto& mlResponse = mlIter->second; - for (auto& [mchIndex, globalTracksVector] : matchingCandidates) { + for (const auto& [mchIndex, globalTracksVector] : matchingCandidates) { auto const& mchTrack = muonTracks.rawIteratorAt(mchIndex); for (const auto& candidate : globalTracksVector) { auto const& muonTrack = muonTracks.rawIteratorAt(candidate.globalTrackId); @@ -2595,14 +2670,14 @@ struct qaMatching { // std::cout << fmt::format("Covariance matrix for MFT track #{} retrieved", mftTrack.globalIndex()) << std::endl; // get tracks parameters in O2 format - auto mftTrackProp = FwdToTrackPar(mftTrack, mftTrackCov); - auto mchTrackProp = FwdToTrackPar(mchTrack, mchTrack); + auto mftTrackProp = fwdToTrackPar(mftTrack, mftTrackCov); + auto mchTrackProp = fwdToTrackPar(mchTrack, mchTrack); // extrapolate to the matching plane auto matchingPlaneZ = matchingPlanesZ[label]; if (matchingPlaneZ < 0.) { - mftTrackProp = PropagateToZMFT(mftTrackProp, matchingPlaneZ); - mchTrackProp = PropagateToZMCH(mchTrackProp, matchingPlaneZ); + mftTrackProp = propagateToZMft(mftTrackProp, matchingPlaneZ); + mchTrackProp = propagateToZMch(mchTrackProp, matchingPlaneZ); } // run the ML model @@ -2610,8 +2685,8 @@ struct qaMatching { std::vector inputML = mlResponse.getInputFeaturesGlob(muonTrack, mchTrackProp, mftTrackProp, collision); mlResponse.isSelectedMl(inputML, 0, output); float matchScore = output[0]; - float matchChi2Prod = muonTrack.chi2MatchMCHMFT() / 5.f; - float matchScoreProd = chi2ToScore(muonTrack.chi2MatchMCHMFT(), 5, 50.f); + float matchChi2Prod = muonTrack.chi2MatchMCHMFT() / MatchingDegreesOfFreedom; + float matchScoreProd = chi2ToScore(muonTrack.chi2MatchMCHMFT(), MatchingDegreesOfFreedom, MatchingScoreChi2Max); // std::cout << std::format("Matching score: {}, Chi2: {}", matchingScore, muonTrack.chi2MatchMCHMFT()) << std::endl; // check if a vector of global muon candidates is already available for the current MCH index @@ -2652,17 +2727,20 @@ struct qaMatching { return (track1.matchScore > track2.matchScore); }; - for (auto& [mchIndex, globalTracksVector] : newMatchingCandidates) { + for (auto matchingCandidatesIt = newMatchingCandidates.begin(); matchingCandidatesIt != newMatchingCandidates.end(); ++matchingCandidatesIt) { + auto& mchIndex = matchingCandidatesIt->first; + auto& globalTracksVector = matchingCandidatesIt->second; std::sort(globalTracksVector.begin(), globalTracksVector.end(), compareMatchingScore); const auto& mchTrack = muonTracks.rawIteratorAt(mchIndex); - auto mftMchMatchAttempts = GetMftMchMatchAttempts(collisions, bcs, mchTrack, mftTracks); + auto mftMchMatchAttempts = getMftMchMatchAttempts(collisions, bcs, mchTrack, mftTracks); int ranking = 1; - for (auto& candidate : globalTracksVector) { + for (auto candidateIt = globalTracksVector.begin(); candidateIt != globalTracksVector.end(); ++candidateIt) { + auto& candidate = *candidateIt; const auto& muonTrack = muonTracks.rawIteratorAt(candidate.globalTrackId); candidate.matchRanking = ranking; - candidate.matchType = GetMatchType(muonTrack, muonTracks, mftTracks, matchablePairs, ranking); + candidate.matchType = getMatchType(muonTrack, muonTracks, mftTracks, matchablePairs, ranking); candidate.mftMchMatchAttempts = mftMchMatchAttempts; ranking += 1; } @@ -2670,7 +2748,7 @@ struct qaMatching { } template - void ProcessCollisionMC(const CollisionInfo& collisionInfo, + void processCollisionMc(const CollisionInfo& collisionInfo, C const& collisions, BC const& bcs, TMUON const& muonTracks, @@ -2683,30 +2761,30 @@ struct qaMatching { registry.get(HIST("tracksMultiplicityMCH"))->Fill(collisionInfo.mchTracks.size()); // Chi2-based matching analysis - FillMatchingPlotsMC(collision, collisionInfo, muonTracks, mftTracks, collisionInfo.matchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, fMatchingChi2ScoreMftMchLow, fChi2MatchingPlotter.get(), false); - for (auto& [label, func] : matchingChi2Functions) { + fillMatchingPlotsMc(collision, collisionInfo, muonTracks, mftTracks, collisionInfo.matchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, cfgMatchingChi2ScoreMftMchLow, fChi2MatchingPlotter.get(), false); + for (const auto& [label, func] : matchingChi2Functions) { MatchingCandidates matchingCandidates; - RunChi2Matching(collisions, bcs, muonTracks, mftTracks, mftCovs, label, collisionInfo.matchablePairs, collisionInfo.matchingCandidates, matchingCandidates); + runChi2Matching(collisions, bcs, muonTracks, mftTracks, mftCovs, label, collisionInfo.matchablePairs, collisionInfo.matchingCandidates, matchingCandidates); auto* plotter = fMatchingPlotters.at(label).get(); double matchingScoreCut = matchingScoreCuts.at(label); - FillMatchingPlotsMC(collision, collisionInfo, muonTracks, mftTracks, matchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, matchingScoreCut, plotter, false); + fillMatchingPlotsMc(collision, collisionInfo, muonTracks, mftTracks, matchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, matchingScoreCut, plotter, false); } // ML-based matching analysis - for (auto& [label, mlResponse] : matchingMlResponses) { + for (const auto& [label, mlResponse] : matchingMlResponses) { MatchingCandidates matchingCandidates; - RunMLMatching(collisions, bcs, muonTracks, mftTracks, mftCovs, label, collisionInfo.matchablePairs, collisionInfo.matchingCandidates, matchingCandidates); + runMlMatching(collisions, bcs, muonTracks, mftTracks, mftCovs, label, collisionInfo.matchablePairs, collisionInfo.matchingCandidates, matchingCandidates); auto* plotter = fMatchingPlotters.at(label).get(); double matchingScoreCut = matchingScoreCuts.at(label); - FillMatchingPlotsMC(collision, collisionInfo, muonTracks, mftTracks, matchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, matchingScoreCut, plotter); + fillMatchingPlotsMc(collision, collisionInfo, muonTracks, mftTracks, matchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, matchingScoreCut, plotter); } // Muons tagging - for (auto [mchIndex, mftIndex] : collisionInfo.matchablePairs) { + for (const auto& [mchIndex, mftIndex] : collisionInfo.matchablePairs) { auto const& mchTrack = muonTracks.rawIteratorAt(mchIndex); if (!mchTrack.has_collision()) continue; @@ -2722,37 +2800,141 @@ struct qaMatching { // extrapolate to the matching plane auto z = o2::mft::constants::mft::LayerZCoordinate()[9]; - auto mchTrackProp = PropagateToZMCH(mchTrackAtVertex, z); - auto mftTrackProp = PropagateToZMFT(FwdToTrackPar(mftTrack, mftTrackCov), z); + auto mchTrackProp = propagateToZMch(mchTrackAtVertex, z); + auto mftTrackProp = propagateToZMft(fwdToTrackPar(mftTrack, mftTrackCov), z); registry.get(HIST("matching/MC/pairedMCHTracksAtMFT"))->Fill(mchTrackProp.getX(), mchTrackProp.getY()); registry.get(HIST("matching/MC/pairedMFTTracksAtMFT"))->Fill(mftTrackProp.getX(), mftTrackProp.getY()); } std::vector selectedMuons; - GetSelectedMuons(collisionInfo, collisions, muonTracks, selectedMuons); + getSelectedMuons(collisionInfo, collisions, muonTracks, selectedMuons); MatchingCandidates selectedMatchingCandidates; - for (auto [mchIndex, globalTracksVector] : collisionInfo.matchingCandidates) { + for (const auto& [mchIndex, globalTracksVector] : collisionInfo.matchingCandidates) { if (std::find(selectedMuons.begin(), selectedMuons.end(), mchIndex) != selectedMuons.end()) { selectedMatchingCandidates[mchIndex] = globalTracksVector; } } - FillMatchingPlotsMC(collision, collisionInfo, muonTracks, mftTracks, selectedMatchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, fMatchingChi2ScoreMftMchLow, fSelectedMuonsMatchingPlotter.get()); + fillMatchingPlotsMc(collision, collisionInfo, muonTracks, mftTracks, selectedMatchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, cfgMatchingChi2ScoreMftMchLow, fSelectedMuonsMatchingPlotter.get()); std::vector taggedMuons; - GetTaggedMuons(collisionInfo, muonTracks, selectedMuons, taggedMuons); + getTaggedMuons(collisionInfo, muonTracks, selectedMuons, taggedMuons); MatchingCandidates taggedMatchingCandidates; - for (auto [mchIndex, globalTracksVector] : collisionInfo.matchingCandidates) { + for (const auto& [mchIndex, globalTracksVector] : collisionInfo.matchingCandidates) { if (std::find(taggedMuons.begin(), taggedMuons.end(), mchIndex) != taggedMuons.end()) { taggedMatchingCandidates[mchIndex] = globalTracksVector; } } - FillMatchingPlotsMC(collision, collisionInfo, muonTracks, mftTracks, taggedMatchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, fMatchingChi2ScoreMftMchLow, fTaggedMuonsMatchingPlotter.get()); + fillMatchingPlotsMc(collision, collisionInfo, muonTracks, mftTracks, taggedMatchingCandidates, collisionInfo.matchingCandidates, collisionInfo.matchablePairs, cfgMatchingChi2ScoreMftMchLow, fTaggedMuonsMatchingPlotter.get()); // Di-muon analysis - FillDimuonPlotsMC(collisionInfo, collisions, muonTracks, mftTracks); + fillDimuonPlotsMc(collisionInfo, collisions, muonTracks, mftTracks); + } + + template + void fillQaMatchingAodTablesForCollision(TCOLLISION const& collision, + TMUON const& muonTracks, + const MatchingCandidates& matchingCandidates, + int8_t matchLabel, + int32_t reducedEventId) + { + for (const auto& [mchIndex, candidates] : matchingCandidates) { + if (candidates.empty()) { + continue; + } + + const auto& mchTrack = muonTracks.rawIteratorAt(mchIndex); + if (!isGoodGlobalMuon(mchTrack, collision)) { + continue; + } + + for (const auto& candidate : candidates) { + const auto& candidateTrack = muonTracks.rawIteratorAt(candidate.globalTrackId); + auto candidateTrackAtVertex = VarManager::PropagateMuon(candidateTrack, collision, VarManager::kToVertex); + qaMatchingCandidates( + reducedEventId, + matchLabel, + mchIndex, + static_cast(candidateTrack.p()), + static_cast(candidateTrack.pt()), + static_cast(candidateTrack.eta()), + static_cast(candidateTrack.phi()), + static_cast(candidate.matchType), + static_cast(candidate.matchScore), + static_cast(candidate.matchRanking), + static_cast(candidateTrackAtVertex.getX()), + static_cast(candidateTrackAtVertex.getY()), + static_cast(candidateTrackAtVertex.getZ()), + static_cast(candidateTrackAtVertex.getPx()), + static_cast(candidateTrackAtVertex.getPy()), + static_cast(candidateTrackAtVertex.getPz())); + } + } + } + + template + void fillQaMatchingAodEventForCollision(const CollisionInfo& collisionInfo, + TCOLLISION const& collision, + int32_t reducedEventId, + int& debugCounter) + { + int32_t mftMultiplicity = static_cast(collisionInfo.mftTracks.size()); + qaMatchingEvents( + mftMultiplicity, + static_cast(collision.posX()), + static_cast(collision.posY()), + static_cast(collision.posZ())); + + if (cfgQaMatchingAodDebug > 0 && debugCounter < cfgQaMatchingAodDebug) { + LOGF(info, "[AO2D] reducedEvent=%", reducedEventId); + debugCounter += 1; + } + } + + template + void fillQaMatchingMchTracksForCollision(const CollisionInfo& collisionInfo, + TCOLLISIONS const& collisions, + TCOLLISION const& collision, + TMUON const& muonTracks, + TMFT const& mftTracks, + TBC const& bcs, + int32_t reducedEventId) + { + std::vector mchIds; + for (const auto& mchIndex : collisionInfo.mchTracks) { + if (std::find(mchIds.begin(), mchIds.end(), mchIndex) == mchIds.end()) { + mchIds.emplace_back(mchIndex); + } + } + for (const auto& [mchIndex, candidates] : collisionInfo.matchingCandidates) { + (void)candidates; + if (std::find(mchIds.begin(), mchIds.end(), mchIndex) == mchIds.end()) { + mchIds.emplace_back(mchIndex); + } + } + + for (const auto& mchIndex : mchIds) { + auto const& mchTrack = muonTracks.rawIteratorAt(mchIndex); + int mftMchMatchAttempts = getMftMchMatchAttempts(collisions, bcs, mchTrack, mftTracks); + auto mchTrackAtVertex = VarManager::PropagateMuon(mchTrack, collision, VarManager::kToVertex); + qaMatchingMCHTrack( + reducedEventId, + mchIndex, + static_cast(mchTrack.trackType()), + static_cast(mchTrack.p()), + static_cast(mchTrack.pt()), + static_cast(mchTrack.eta()), + static_cast(mchTrack.phi()), + static_cast(mftMchMatchAttempts), + static_cast(mchTrackAtVertex.getX()), + static_cast(mchTrackAtVertex.getY()), + static_cast(mchTrackAtVertex.getZ()), + static_cast(mchTrackAtVertex.getPx()), + static_cast(mchTrackAtVertex.getPy()), + static_cast(mchTrackAtVertex.getPz())); + } } void processQAMC(MyEvents const& collisions, @@ -2763,29 +2945,72 @@ struct qaMatching { aod::McParticles const& /*mcParticles*/) { auto bc = bcs.begin(); - initCCDB(bc); + initCcdb(bc); - for (auto& muon : muonTracks) { + for (const auto& muon : muonTracks) { registry.get(HIST("nTracksPerType"))->Fill(static_cast(muon.trackType())); } - FillCollisions(collisions, bcs, muonTracks, mftTracks, fCollisionInfos); + fillCollisions(collisions, bcs, muonTracks, mftTracks, fCollisionInfos); mftTrackCovs.clear(); - for (auto& mftTrackCov : mftCovs) { + for (const auto& mftTrackCov : mftCovs) { mftTrackCovs[mftTrackCov.matchMFTTrackId()] = mftTrackCov.globalIndex(); } + std::unordered_map reducedEventIds; + int32_t reducedEventCounter = 0; + for (auto const& [collisionIndex, collisionInfo] : fCollisionInfos) { + reducedEventIds.emplace(collisionInfo.index, reducedEventCounter); + reducedEventCounter += 1; + } + + int debugCounter = 0; + for (auto const& [collisionIndex, collisionInfo] : fCollisionInfos) { + auto it = reducedEventIds.find(collisionInfo.index); + if (it == reducedEventIds.end()) { + continue; + } + int32_t reducedEventId = it->second; + auto collision = collisions.rawIteratorAt(collisionInfo.index); + fillQaMatchingAodEventForCollision(collisionInfo, collision, reducedEventId, debugCounter); + fillQaMatchingMchTracksForCollision(collisionInfo, collisions, collision, muonTracks, mftTracks, bcs, reducedEventId); + } + + struct AodLabel { + const char* name; + int8_t id; + }; + std::array aodLabels{{{"ProdAll", 0}, {"MatchXYPhiTanl", 1}, {"MatchXYPhiTanlMom", 2}}}; + for (const auto& aodLabel : aodLabels) { + if (matchingChi2Functions.find(aodLabel.name) == matchingChi2Functions.end()) { + LOGF(warn, "[AO2D] Chi2 label not found: %s", aodLabel.name); + continue; + } + debugCounter = 0; + for (auto const& [collisionIndex, collisionInfo] : fCollisionInfos) { + auto it = reducedEventIds.find(collisionInfo.index); + if (it == reducedEventIds.end()) { + continue; + } + int32_t reducedEventId = it->second; + MatchingCandidates matchingCandidates; + runChi2Matching(collisions, bcs, muonTracks, mftTracks, mftCovs, aodLabel.name, collisionInfo.matchablePairs, collisionInfo.matchingCandidates, matchingCandidates); + auto collision = collisions.rawIteratorAt(collisionInfo.index); + fillQaMatchingAodTablesForCollision(collision, muonTracks, matchingCandidates, aodLabel.id, reducedEventId); + } + } + for (auto const& [collisionIndex, collisionInfo] : fCollisionInfos) { - ProcessCollisionMC(collisionInfo, collisions, bcs, muonTracks, mftTracks, mftCovs); + processCollisionMc(collisionInfo, collisions, bcs, muonTracks, mftTracks, mftCovs); } } - PROCESS_SWITCH(qaMatching, processQAMC, "processQAMC", true); + PROCESS_SWITCH(QaMatching, processQAMC, "processQAMC", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; }; diff --git a/PWGDQ/Tasks/quarkoniaToHyperons.cxx b/PWGDQ/Tasks/quarkoniaToHyperons.cxx index 77077aeeb75..d4601569e86 100644 --- a/PWGDQ/Tasks/quarkoniaToHyperons.cxx +++ b/PWGDQ/Tasks/quarkoniaToHyperons.cxx @@ -34,44 +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 diff --git a/PWGDQ/Tasks/tableReader.cxx b/PWGDQ/Tasks/tableReader.cxx index fdb1c4c0d6f..3c776e2a42d 100644 --- a/PWGDQ/Tasks/tableReader.cxx +++ b/PWGDQ/Tasks/tableReader.cxx @@ -22,36 +22,39 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/EventSelectionParams.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.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 -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGDQ/Tasks/tableReader_withAssoc.cxx b/PWGDQ/Tasks/tableReader_withAssoc.cxx index 5a71f06bbce..5cbc6a50c62 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc.cxx @@ -26,42 +26,48 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/TableHelper.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.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 -#include -#include #include #include +#include #include using std::cout; @@ -72,6 +78,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; // Some definitions namespace o2::aod @@ -1648,8 +1655,8 @@ struct AnalysisSameEventPairing { if (fEnableBarrelMixingHistos) { DefineHistograms(fHistMan, "PairingMEQA", "mixedevent-pairing"); // histograms for QA of the pairing }; - dqhistograms::AddHistogramsFromJSON(fHistMan, fConfigAddJSONHistograms.value.c_str()); // ad-hoc histograms via JSON - VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill + dqhistograms::AddHistogramsFromJSON(fHistMan, fConfigAddJSONHistograms.value.c_str()); // ad-hoc histograms via JSON + VarManager::SetUseVars(fHistMan->GetUsedVars()); // provide the list of required variables so that VarManager knows what to fill fOutputList.setObject(fHistMan->GetMainHistogramList()); } } diff --git a/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx b/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx index 1cdf8f65336..ecd087c6b16 100644 --- a/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx +++ b/PWGDQ/Tasks/tableReader_withAssoc_direct.cxx @@ -22,42 +22,49 @@ #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/CCDB/ctpRateFetcher.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/PID/PIDTOFParamService.h" #include "Common/Core/TableHelper.h" #include "Common/Core/Zorro.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" + +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include "TGeoGlobalMagField.h" -#include -#include +#include #include #include -#include +#include #include -#include +#include + +#include +#include +#include #include +#include #include #include #include @@ -72,6 +79,7 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; +using namespace o2::common::core; Zorro zorro; diff --git a/PWGDQ/Tasks/taskFwdTrackPid.cxx b/PWGDQ/Tasks/taskFwdTrackPid.cxx index 33b89b0e745..8f7febbbf28 100644 --- a/PWGDQ/Tasks/taskFwdTrackPid.cxx +++ b/PWGDQ/Tasks/taskFwdTrackPid.cxx @@ -13,41 +13,27 @@ /// \brief Task for the analysis of forward PID with MFT /// \author Luca Micheletti , INFN -#include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/AnalysisCut.h" -#include "PWGDQ/Core/CutsLibrary.h" #include "PWGDQ/Core/HistogramManager.h" #include "PWGDQ/Core/HistogramsLibrary.h" #include "PWGDQ/Core/MCSignal.h" #include "PWGDQ/Core/MCSignalLibrary.h" -#include "PWGDQ/Core/MixingHandler.h" -#include "PWGDQ/Core/MixingLibrary.h" #include "PWGDQ/Core/VarManager.h" #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "Common/CCDB/EventSelectionParams.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ITSMFTBase/DPLAlpideParam.h" - -#include "TGeoGlobalMagField.h" -#include -#include +#include +#include +#include +#include +#include +#include + #include -#include +#include #include -#include -#include +#include + +#include #include #include #include diff --git a/PWGDQ/Tasks/taskJpsiHf.cxx b/PWGDQ/Tasks/taskJpsiHf.cxx index fcc78628b20..b41950b4056 100644 --- a/PWGDQ/Tasks/taskJpsiHf.cxx +++ b/PWGDQ/Tasks/taskJpsiHf.cxx @@ -15,18 +15,26 @@ /// \author Fabrizio Grosa , CERN #include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGHF/Core/HfHelper.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/Utils/utilsAnalysis.h" #include "Common/Core/RecoDecay.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include #include #include #include diff --git a/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx b/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx index ff161fbafc1..999b46bd148 100644 --- a/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx +++ b/PWGDQ/Tasks/taskMuonMchTrkEfficiency.cxx @@ -21,10 +21,18 @@ #include "PWGDQ/DataModel/MchTrkEffTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include #include diff --git a/PWGDQ/Tasks/v0selector.cxx b/PWGDQ/Tasks/v0selector.cxx index 4a809dc9b86..f464459adf0 100644 --- a/PWGDQ/Tasks/v0selector.cxx +++ b/PWGDQ/Tasks/v0selector.cxx @@ -23,40 +23,37 @@ #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGLF/DataModel/LFStrangenessTables.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/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.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/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/Vector4D.h" - -#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 FullTracksExt = soa::Join; using FilteredMyMCElectron = FilteredMyMCElectrons::iterator; -using MyMCMuons = soa::Join; +using MyMCMuons = soa::Join; using MyMCMuon = MyMCMuons::iterator; using FilteredMyMCMuons = soa::Filtered; using FilteredMyMCMuon = FilteredMyMCMuons::iterator; diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h index 2e98a0396b5..99c5afdc61b 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h @@ -71,7 +71,7 @@ struct V0PhotonCandidate { eleTPCSignal = ele.tpcSignal(); eleITSClusterSizes = ele.itsClusterSizes(); - chi2ndf = v0DecayVtx.GetChi2() / v0DecayVtx.GetNDF(); + chi2ndf = v0PV.GetChi2() / v0PV.GetNDF(); pca = posDecayVtx.GetDistanceFromParticle(eleDecayVtx); eta = RecoDecay::eta(std::array{px, py, pz}); posEta = RecoDecay::eta(std::array{posPx, posPy, posPz}); diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index f35b926e50c..c7d269973be 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -233,9 +233,9 @@ struct PCMQCMC { const AxisSpec axis_rapidity{{0.0, +0.8, +0.9}, "rapidity |y_{#gamma}|"}; if (doprocessGen) { - fRegistry.add("Generated/hPt", "pT;p_{T} (GeV/c)", kTH1F, {axis_pt}, true); - fRegistry.add("Generated/hPtY", "Generated info", kTH2F, {axis_pt, axis_rapidity}, true); - fRegistry.add("Generated/hPt_ConversionPhoton", "converted photon pT;p_{T} (GeV/c)", kTH1F, {axis_pt}, true); + fRegistry.add("Generated/hPt", "pT;p_{T} (GeV/c)", kTH1D, {axis_pt}, true); + fRegistry.add("Generated/hPtY", "Generated info", kTH2D, {axis_pt, axis_rapidity}, true); + fRegistry.add("Generated/hPt_ConversionPhoton", "converted photon pT;p_{T} (GeV/c)", kTH1D, {axis_pt}, true); fRegistry.add("Generated/hY_ConversionPhoton", "converted photon y;rapidity y", kTH1F, {{40, -2.0f, 2.0f}}, true); fRegistry.add("Generated/hPhi_ConversionPhoton", "converted photon #varphi;#varphi (rad.)", kTH1F, {{180, 0, o2::constants::math::TwoPI}}, true); fRegistry.add("Generated/hXY", "conversion point in XY MC;V_{x} (cm);V_{y} (cm)", kTH2F, {{800, -100.0f, 100.0f}, {800, -100.0f, 100.0f}}, true); diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 40a6599bb71..70285fbf054 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -55,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -62,9 +63,9 @@ /// Single-photon track-type combo. enum class V0Combo : int { Inclusive = 0, - ItstpcItstpc = 1, ///< both legs ITS+TPC - ItstpcTpconly = 2, ///< one ITS+TPC leg, one TPC-only - TpconlyTpconly = 3, ///< both legs TPC-only + ItstpcItstpc = 1, + ItstpcTpconly = 2, + TpconlyTpconly = 3, }; /// Photon-pair track-type combo. @@ -85,8 +86,10 @@ using namespace o2::framework::expressions; using namespace o2::soa; using namespace o2::aod::pwgem::dilepton::utils; +// EMMCEventLabels needed for processMC truth-efficiency loop using MyCollisions = soa::Join; + aod::EMEventsCent_000, aod::EMEventsQvec_001, + aod::EMMCEventLabels>; using MyCollision = MyCollisions::iterator; using MyV0Photons = soa::Join; @@ -97,29 +100,25 @@ using MyMCV0Leg = MyMCV0Legs::iterator; // ─── MC truth classification types ──────────────────────────────────────────── -/// Per-photon MC truth information built from the two V0 legs. struct PhotonMCInfo { - bool hasMC = false; // both legs have a valid MC label - bool sameMother = false; // both legs share the same MC mother - bool isTruePhoton = false; // mother PDG == 22 - - int mcPosId = -1; // MC particle index of the positive leg - int mcNegId = -1; // MC particle index of the negative leg - int motherId = -1; // MC particle index of the common mother + bool hasMC = false; + bool sameMother = false; + bool isTruePhoton = false; + int mcPosId = -1; + int mcNegId = -1; + int motherId = -1; int motherPdg = 0; - bool isPhysicalPrimary = false; }; -/// Classification of a photon pair at the MC-truth level. enum class PairTruthType : uint8_t { Unknown = 0, - TrueTrueDistinct, // both photons are true, from different MC photons - TrueTrueSamePhoton, // both photons are true, same MC photon (clone/split) - SharedMcLeg, // different reco tracks but same MC-level leg - TrueFake, // one photon is true, one is fake - FakeFake, // both photons are fake - Pi0Daughters, // both photons come from the same MC pi0 + TrueTrueDistinct, + TrueTrueSamePhoton, + SharedMcLeg, + TrueFake, + FakeFake, + Pi0Daughters, }; struct photonhbt { @@ -155,33 +154,24 @@ struct photonhbt { return static_cast(kTable[lo][hi]); } - // ─── Configurables: histogram axis bins ─────────────────────────────────── + // ─── Configurables ──────────────────────────────────────────────────────── - // HBT physics ConfigurableAxis confQBins{"confQBins", {60, 0, +0.3f}, "q bins for output histograms"}; - ConfigurableAxis confKtBins{"confKtBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6}, "kT bins"}; - - // Single-photon QA + ConfigurableAxis confKtBins{"confKtBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75}, "kT bins"}; ConfigurableAxis confPtBins{"confPtBins", {100, 0.f, 2.f}, "pT bins (GeV/c)"}; ConfigurableAxis confEtaBins{"confEtaBins", {80, -0.8f, 0.8f}, "eta bins"}; - ConfigurableAxis confPhiBins{"confPhiBins", {90, 0.f, o2::constants::math::TwoPI}, "phi bins (rad) — O2 track phi is in [0, 2pi]"}; - - // Pair angular - ConfigurableAxis confDeltaEtaBins{"confDeltaEtaBins", {100, -0.9f, +0.9f}, "Delta-eta bins"}; - ConfigurableAxis confDeltaPhiBins{"confDeltaPhiBins", {100, -o2::constants::math::PI, o2::constants::math::PI}, "Delta-phi bins (rad)"}; + ConfigurableAxis confPhiBins{"confPhiBins", {90, 0.f, o2::constants::math::TwoPI}, "phi bins (rad)"}; + ConfigurableAxis confDeltaEtaBins{"confDeltaEtaBins", {180, -1.6f, +1.6f}, "Delta-eta bins"}; + ConfigurableAxis confDeltaPhiBins{"confDeltaPhiBins", {180, -o2::constants::math::PI, o2::constants::math::PI}, "Delta-phi bins (rad)"}; ConfigurableAxis confEllipseValBins{"confEllipseValBins", {200, 0.f, 10.f}, "ellipse value bins"}; ConfigurableAxis confCosThetaBins{"confCosThetaBins", {100, 0.f, 1.f}, "cos(theta*) bins"}; ConfigurableAxis confOpeningAngleBins{"confOpeningAngleBins", {100, 0.f, o2::constants::math::PI}, "opening angle bins (rad)"}; - - // Pair geometry ConfigurableAxis confRBins{"confRBins", {100, 0.f, 100.f}, "conversion radius bins (cm)"}; ConfigurableAxis confDeltaRBins{"confDeltaRBins", {120, 0.f, 30.f}, "|R1-R2| bins (cm)"}; ConfigurableAxis confDeltaR3DBins{"confDeltaR3DBins", {100, 0.f, 100.f}, "3D distance between conversion points (cm)"}; ConfigurableAxis confDeltaRxyBins{"confDeltaRxyBins", {100, 0.f, 100.f}, "xy distance between conversion points (cm)"}; ConfigurableAxis confZConvBins{"confZConvBins", {200, -100.f, 100.f}, "conversion z (cm)"}; - ConfigurableAxis confDeltaZBins{"confDeltaZBins", {200, -100.f, 100.f}, "#Deltaz bins (cm)"}; ///< FIX: was missing - - // Event QA + ConfigurableAxis confDeltaZBins{"confDeltaZBins", {200, -100.f, 100.f}, "#Deltaz bins (cm)"}; ConfigurableAxis confOccupancyQA{"confOccupancyQA", {100, 0.f, 50000.f}, "occupancy"}; ConfigurableAxis confCentQABins{"confCentQABins", {110, 0.f, 110.f}, "centrality (%)"}; @@ -206,7 +196,7 @@ struct photonhbt { const AxisSpec axisDeltaR3D{confDeltaR3DBins, "|#vec{r}_{1}-#vec{r}_{2}| (cm)"}; const AxisSpec axisDeltaRxy{confDeltaRxyBins, "#Delta r_{xy} (cm)"}; const AxisSpec axisZConv{confZConvBins, "z_{conv} (cm)"}; - const AxisSpec axisDeltaZ{confDeltaZBins, "#Delta z (cm)"}; ///< FIX: was missing + const AxisSpec axisDeltaZ{confDeltaZBins, "#Delta z (cm)"}; const AxisSpec axisOccupancy{confOccupancyQA, "occupancy"}; const AxisSpec axisCentQA{confCentQABins, "centrality (%)"}; @@ -216,33 +206,43 @@ struct photonhbt { std::string prefix = "qaflags_group"; Configurable doPairQa{"doPairQa", true, "fill pair QA histograms at each cut step"}; Configurable doSinglePhotonQa{"doSinglePhotonQa", true, "fill single-photon QA histograms (pT, eta, phi)"}; - Configurable cfgMaxQinvForQA{"cfgMaxQinvForQA", 0.1f, - "fill per-step pair QA histograms (hDeltaEta, hDeltaPhi, THnSparses, ...) " - "only when q_inv < this value (GeV/c). " - "Set to the HBT signal region, typically 0.1. " - "Set <= 0 to disable the gate. The CF is always filled regardless."}; - Configurable cfgMaxQinvForFullRange{"cfgMaxQinvForFullRange", 0.3f, - "fill full-range histograms (hDeltaRVsQinv, hSparseDeltaRDeltaZQinv, ...) " - "only when q_inv < this value (GeV/c). " - "Should match the upper edge of confQBins (default 0.3) — " - "fills beyond the axis range only go into the overflow bin. " - "Set <= 0 to disable the gate."}; + Configurable cfgMaxQinvForQA{"cfgMaxQinvForQA", 0.1f, "fill per-step pair QA histograms only when q_inv < this value. Set <= 0 to disable."}; + Configurable cfgMaxQinvForFullRange{"cfgMaxQinvForFullRange", 0.3f, "fill full-range histograms only when q_inv < this value. Set <= 0 to disable."}; + Configurable cfgMaxQinvForMCQA{"cfgMaxQinvForMCQA", 0.3f, + "fill MC truth 1D histograms (hQinv, hKt, hDeltaEta, ...) only when q_inv < this value. " + "hDEtaDPhi is always filled (needs full sample). Set <= 0 to disable. Default 0.6 cuts " + "most combinatorics while covering well beyond the CF range for systematics."}; } qaflags; - // ─── Configurables: HBT kind ─────────────────────────────────────────────── - Configurable cfgDo3D{"cfgDo3D", false, "enable 3D (qout,qside,qlong) analysis"}; Configurable cfgDo2D{"cfgDo2D", false, "enable 2D (qout,qinv) projection (requires cfgDo3D)"}; Configurable cfgUseLCMS{"cfgUseLCMS", true, "measure 1D relative momentum in LCMS"}; - // ─── Configurables: events ───────────────────────────────────────────────── - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + Configurable cfgMCMaxQinv{"cfgMCMaxQinv", 0.3f, + "max q_{inv}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; + Configurable cfgMCMinKt{"cfgMCMinKt", 0.0f, + "min k_{T}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; + Configurable cfgMCMaxKt{"cfgMCMaxKt", 0.7f, + "max k_{T}^{true} for MC truth efficiency pair loop (GeV/c); <=0 = no cut"}; + struct : ConfigurableGroup { + std::string prefix = "mctruth_sparse_group"; + Configurable cfgFillDEtaDPhiVsQinvTrueTrueDistinct{"cfgFillDEtaDPhiVsQinvTrueTrueDistinct", true, "fill hDEtaDPhiVsQinv for TrueTrueDistinct pairs"}; + Configurable cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton{"cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton", false, "fill hDEtaDPhiVsQinv for TrueTrueSamePhoton pairs"}; + Configurable cfgFillDEtaDPhiVsQinvSharedMcLeg{"cfgFillDEtaDPhiVsQinvSharedMcLeg", false, "fill hDEtaDPhiVsQinv for SharedMcLeg pairs"}; + Configurable cfgFillDEtaDPhiVsQinvTrueFake{"cfgFillDEtaDPhiVsQinvTrueFake", false, "fill hDEtaDPhiVsQinv for TrueFake pairs"}; + Configurable cfgFillDEtaDPhiVsQinvFakeFake{"cfgFillDEtaDPhiVsQinvFakeFake", true, "fill hDEtaDPhiVsQinv for FakeFake pairs"}; + Configurable cfgFillDEtaDPhiVsQinvPi0Daughters{"cfgFillDEtaDPhiVsQinvPi0Daughters", false, "fill hDEtaDPhiVsQinv for Pi0Daughters pairs"}; + Configurable cfgFillDRDZQinvTrueTrueDistinct{"cfgFillDRDZQinvTrueTrueDistinct", true, "fill hSparseDeltaRDeltaZQinv for TrueTrueDistinct pairs"}; + Configurable cfgFillDRDZQinvTrueTrueSamePhoton{"cfgFillDRDZQinvTrueTrueSamePhoton", false, "fill hSparseDeltaRDeltaZQinv for TrueTrueSamePhoton pairs"}; + Configurable cfgFillDRDZQinvSharedMcLeg{"cfgFillDRDZQinvSharedMcLeg", false, "fill hSparseDeltaRDeltaZQinv for SharedMcLeg pairs"}; + Configurable cfgFillDRDZQinvTrueFake{"cfgFillDRDZQinvTrueFake", false, "fill hSparseDeltaRDeltaZQinv for TrueFake pairs"}; + Configurable cfgFillDRDZQinvFakeFake{"cfgFillDRDZQinvFakeFake", true, "fill hSparseDeltaRDeltaZQinv for FakeFake pairs"}; + Configurable cfgFillDRDZQinvPi0Daughters{"cfgFillDRDZQinvPi0Daughters", false, "fill hSparseDeltaRDeltaZQinv for Pi0Daughters pairs"}; + } mcthruth_sparse; Configurable maxY{"maxY", 0.9, "maximum rapidity"}; - // ─── Configurables: mixed event ──────────────────────────────────────────── - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; Configurable ndepth{"ndepth", 100, "depth for event mixing"}; Configurable ndiffBCMix{"ndiffBCMix", 594, "difference in global BC required for mixed events"}; @@ -255,26 +255,19 @@ struct photonhbt { ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}, "Mixing bins - EP angle"}; ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - // ─── Configurables: pair cuts ────────────────────────────────────────────── - struct : ConfigurableGroup { std::string prefix = "ggpaircut_group"; - // dr/cosOA cut Configurable cfgMinDRCosOA{"cfgMinDRCosOA", -1.f, "min. dr/cosOA; <0 = disabled"}; - // R/Z geometry cuts Configurable cfgDoRCut{"cfgDoRCut", false, "apply |R1-R2| > cfgMinDeltaR cut"}; Configurable cfgMinDeltaR{"cfgMinDeltaR", 0.f, "minimum |R1-R2| (cm)"}; Configurable cfgDoZCut{"cfgDoZCut", false, "apply |DeltaZ| > cfgMinDeltaZ cut"}; Configurable cfgMinDeltaZ{"cfgMinDeltaZ", 0.f, "minimum |DeltaZ| (cm)"}; - // Ellipse cut in (DeltaEta, DeltaPhi) Configurable cfgDoEllipseCut{"cfgDoEllipseCut", false, "reject pairs inside ellipse in DeltaEta-DeltaPhi"}; Configurable cfgEllipseSigEta{"cfgEllipseSigEta", 0.02f, "sigma_eta for ellipse cut"}; Configurable cfgEllipseSigPhi{"cfgEllipseSigPhi", 0.02f, "sigma_phi for ellipse cut"}; Configurable cfgEllipseR2{"cfgEllipseR2", 1.0f, "R^2 threshold: reject if ellipse value < R^2"}; } ggpaircuts; - // ─── Event cut ───────────────────────────────────────────────────────────── - EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { std::string prefix = "eventcut_group"; @@ -301,8 +294,6 @@ struct photonhbt { Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "all ITS layers OK"}; } eventcuts; - // ─── PCM cut ─────────────────────────────────────────────────────────────── - V0PhotonCut fV0PhotonCut; struct : ConfigurableGroup { std::string prefix = "pcmcut_group"; @@ -341,6 +332,9 @@ struct photonhbt { } HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistryPairQA{"outputPairQA", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistryPairMC{"outputPairMC", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + HistogramRegistry fRegistryMC{"outputMC", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; std::mt19937 engine; @@ -352,11 +346,9 @@ struct photonhbt { std::vector epBinEgdes; std::vector occBinEdges; - // ─── Pair-cut helpers ────────────────────────────────────────────────────── - inline bool isInsideEllipse(float deta, float dphi) const { - if (!ggpaircuts.cfgDoEllipseCut.value) // .value needed: operator T() is non-const in O2 + if (!ggpaircuts.cfgDoEllipseCut.value) return false; const float sE = ggpaircuts.cfgEllipseSigEta.value; const float sP = ggpaircuts.cfgEllipseSigPhi.value; @@ -386,6 +378,12 @@ struct photonhbt { return (limit <= 0.f) || (qinv < limit); } + inline bool passQinvMCQAGate(float qinv) const + { + const float limit = qaflags.cfgMaxQinvForMCQA.value; + return (limit <= 0.f) || (qinv < limit); + } + static inline float computeCosTheta(const ROOT::Math::PtEtaPhiMVector& v1, const ROOT::Math::PtEtaPhiMVector& v2) { @@ -425,8 +423,6 @@ struct photonhbt { return clampBin(b, static_cast(edges.size()) - 2); } - /// ev_id : 0 = same-event, 1 = mixed-event - /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse template static constexpr const char* qaPrefix() { @@ -460,27 +456,30 @@ struct photonhbt { void init(InitContext& /*context*/) { mRunNumber = 0; - parseBins(ConfVtxBins, ztxBinEdges); parseBins(ConfCentBins, centBinEdges); parseBins(ConfEPBins, epBinEgdes); parseBins(ConfOccupancyBins, occBinEdges); - emh1 = new MyEMH(ndepth); emh2 = new MyEMH(ndepth); - o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); DefineEMEventCut(); DefinePCMCut(); addhistograms(); - std::random_device seedGen; engine = std::mt19937(seedGen()); dist01 = std::uniform_int_distribution(0, 1); - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current}-BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + + // Print histogram counts and memory estimates for all registries + // LOGF(info, "=== photonhbt histogram summary ==="); + // fRegistry.print(); + // fRegistryPairQA.print(); + // fRegistryPairMC.print(); + // fRegistryMC.print(); + // LOGF(info, "==================================="); } template @@ -491,61 +490,39 @@ struct photonhbt { mRunNumber = collision.runNumber(); } - // ─── PairQAObservables ───────────────────────────────────────────────────── - /// Plain data struct holding all observables computed from a photon pair. - /// Defined early so all histogram-booking and fill functions can use it. - struct PairQAObservables { - // photon four-vectors and pair kinematics - ROOT::Math::PtEtaPhiMVector v1; - ROOT::Math::PtEtaPhiMVector v2; - ROOT::Math::PtEtaPhiMVector k12; - // conversion-point coordinates - float x1 = 0.f, y1 = 0.f, z1 = 0.f; - float x2 = 0.f, y2 = 0.f, z2 = 0.f; - // conversion-point radii and distances - float r1 = 0.f, r2 = 0.f; - float dx = 0.f, dy = 0.f, dz = 0.f; - float deltaR = 0.f; ///< |R1-R2| - float deltaZ = 0.f; ///< z1-z2 - float deltaRxy = 0.f; ///< sqrt(dx^2+dy^2) - float deltaR3D = 0.f; ///< sqrt(dx^2+dy^2+dz^2) - // opening angle of conversion-point vectors - float opa = 0.f; - float cosOA = 0.f; - float drOverCosOA = 0.f; - float deta = 0.f, dphi = 0.f; - float pairEta = 0.f, pairPhi = 0.f; - float kt = 0.f, qinv = 0.f; - float cosTheta = 0.f; - float openingAngle = 0.f; - // validity flag + ROOT::Math::PtEtaPhiMVector v1, v2, k12; + float x1 = 0.f, y1 = 0.f, z1 = 0.f, x2 = 0.f, y2 = 0.f, z2 = 0.f; + float r1 = 0.f, r2 = 0.f, dx = 0.f, dy = 0.f, dz = 0.f; + float deltaR = 0.f, deltaZ = 0.f, deltaRxy = 0.f, deltaR3D = 0.f; + float opa = 0.f, cosOA = 0.f, drOverCosOA = 0.f; + float deta = 0.f, dphi = 0.f, pairEta = 0.f, pairPhi = 0.f; + float kt = 0.f, qinv = 0.f, cosTheta = 0.f, openingAngle = 0.f; bool valid = true; }; void addSinglePhotonQAHistogramsForStep(const std::string& path) { - fRegistry.add((path + "hPt").c_str(), "p_{T};p_{T} (GeV/c);counts", kTH1D, {axisPt}, true); - fRegistry.add((path + "hEta").c_str(), "#eta;#eta;counts", kTH1D, {axisEta}, true); - fRegistry.add((path + "hPhi").c_str(), "#phi;#phi (rad);counts", kTH1D, {axisPhi}, true); - fRegistry.add((path + "hEtaVsPhi").c_str(), "acceptance;#phi (rad);#eta", kTH2D, {axisPhi, axisEta}, true); - fRegistry.add((path + "hR").c_str(), "R_{conv};R_{conv} (cm);counts", kTH1D, {axisR}, true); - fRegistry.add((path + "hZConv").c_str(), "z_{conv};z_{conv} (cm);counts", kTH1D, {axisZConv}, true); - fRegistry.add((path + "hRVsZConv").c_str(), "R_{conv} vs z_{conv};z_{conv} (cm);R_{conv} (cm)", kTH2D, {axisZConv, axisR}, true); + fRegistryPairQA.add((path + "hPt").c_str(), "p_{T};p_{T} (GeV/c);counts", kTH1D, {axisPt}, true); + fRegistryPairQA.add((path + "hEta").c_str(), "#eta;#eta;counts", kTH1D, {axisEta}, true); + fRegistryPairQA.add((path + "hPhi").c_str(), "#phi;#phi (rad);counts", kTH1D, {axisPhi}, true); + fRegistryPairQA.add((path + "hEtaVsPhi").c_str(), "acceptance;#phi (rad);#eta", kTH2D, {axisPhi, axisEta}, true); + fRegistryPairQA.add((path + "hR").c_str(), "R_{conv};R_{conv} (cm);counts", kTH1D, {axisR}, true); + fRegistryPairQA.add((path + "hZConv").c_str(), "z_{conv};z_{conv} (cm);counts", kTH1D, {axisZConv}, true); + fRegistryPairQA.add((path + "hRVsZConv").c_str(), "R_{conv} vs z_{conv};z_{conv} (cm);R_{conv} (cm)", kTH2D, {axisZConv, axisR}, true); } void addFullRangeHistograms(const std::string& path) { - fRegistry.add((path + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv} (full range);q_{inv} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisQinv, axisDeltaR}, true); - fRegistry.add((path + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv} (full range);q_{inv} (GeV/c);#Delta z (cm)", kTH2D, {axisQinv, axisDeltaZ}, true); - fRegistry.add((path + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv} (full range);q_{inv} (GeV/c);#Delta r_{3D} (cm)", kTH2D, {axisQinv, axisDeltaR3D}, true); - fRegistry.add((path + "hQinvVsCent").c_str(), "q_{inv} vs centrality (full range);centrality (%);q_{inv} (GeV/c)", kTH2D, {axisCentQA, axisQinv}, true); - fRegistry.add((path + "hQinvVsOccupancy").c_str(), "q_{inv} vs occupancy (full range);occupancy;q_{inv} (GeV/c)", kTH2D, {axisOccupancy, axisQinv}, true); - fRegistry.add((path + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv} (full range)", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); + fRegistry.add((path + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv};q_{inv} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisQinv, axisDeltaR}, true); + fRegistry.add((path + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv};q_{inv} (GeV/c);#Delta z (cm)", kTH2D, {axisQinv, axisDeltaZ}, true); + fRegistry.add((path + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv};q_{inv} (GeV/c);#Delta r_{3D} (cm)", kTH2D, {axisQinv, axisDeltaR3D}, true); + fRegistry.add((path + "hQinvVsCent").c_str(), "q_{inv} vs centrality;centrality (%);q_{inv} (GeV/c)", kTH2D, {axisCentQA, axisQinv}, true); + fRegistry.add((path + "hQinvVsOccupancy").c_str(), "q_{inv} vs occupancy;occupancy;q_{inv} (GeV/c)", kTH2D, {axisOccupancy, axisQinv}, true); + fRegistry.add((path + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); fRegistry.add((path + "hDeltaRCosOAVsQinv").c_str(), "#Delta r/cos(#theta_{op}/2) vs q_{inv};q_{inv} (GeV/c);#Delta r/cos(#theta_{op}/2) (cm)", kTH2D, {axisQinv, {100, 0, 100}}, true); } - /// ev_id : 0 = same-event, 1 = mixed-event template inline void fillFullRangeQA(PairQAObservables const& obs, float cent, float occupancy) { @@ -555,8 +532,7 @@ struct photonhbt { fRegistry.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); fRegistry.fill(HIST(base) + HIST("hQinvVsCent"), cent, obs.qinv); fRegistry.fill(HIST(base) + HIST("hQinvVsOccupancy"), occupancy, obs.qinv); - fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), - obs.deltaR, obs.deltaZ, obs.qinv); + fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); } template @@ -568,66 +544,37 @@ struct photonhbt { void addQAHistogramsForStep(const std::string& path) { - // ── 1D: photon kinematics ──────────────────────────────────────────────── - fRegistry.add((path + "hPairEta").c_str(), "pair #eta;#eta_{pair};counts", kTH1D, {axisEta}, true); - fRegistry.add((path + "hPairPhi").c_str(), "pair #phi;#phi_{pair} (rad);counts", kTH1D, {axisPhi}, true); - fRegistry.add((path + "hPairKt").c_str(), "pair k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); - fRegistry.add((path + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); - - // ── 1D: angular ───────────────────────────────────────────────────────── - fRegistry.add((path + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); - fRegistry.add((path + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); - fRegistry.add((path + "hCosTheta").c_str(), "cos(#theta*) in pair rest frame;cos(#theta*);counts", kTH1D, {axisCosTheta}, true); - fRegistry.add((path + "hOpeningAngle").c_str(), "Opening angle;#alpha (rad);counts", kTH1D, {axisOpeningAngle}, true); - fRegistry.add((path + "hEllipseVal").c_str(), "(#Delta#eta/#sigma_{#eta})^{2}+(#Delta#phi/#sigma_{#phi})^{2};value;counts", kTH1D, {axisEllipseVal}, true); - - // ── 1D: geometry ──────────────────────────────────────────────────────── - fRegistry.add((path + "hR1").c_str(), "R_{conv,1};R_{1} (cm);counts", kTH1D, {axisR}, true); - fRegistry.add((path + "hR2").c_str(), "R_{conv,2};R_{2} (cm);counts", kTH1D, {axisR}, true); - fRegistry.add((path + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); - fRegistry.add((path + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); - fRegistry.add((path + "hDeltaRxy").c_str(), "#Delta r_{xy};#Delta r_{xy} (cm);counts", kTH1D, {axisDeltaRxy}, true); - fRegistry.add((path + "hDeltaR3D").c_str(), "|#vec{r}_{1}-#vec{r}_{2}|;#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); - - // ── 1D: event-level ───────────────────────────────────────────────────── - fRegistry.add((path + "hCent").c_str(), "centrality;centrality (%);counts", kTH1D, {axisCentQA}, true); - fRegistry.add((path + "hOccupancy").c_str(), "occupancy;occupancy;counts", kTH1D, {axisOccupancy}, true); - - // ── 2D: angular ───────────────────────────────────────────────────────── - fRegistry.add((path + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistry.add((path + "hDeltaEtaVsPairEta").c_str(), "#Delta#eta vs #LT#eta#GT_{pair};#LT#eta#GT_{pair};#Delta#eta", kTH2D, {axisEta, axisDeltaEta}, true); - - // ── 2D: geometry ──────────────────────────────────────────────────────── - fRegistry.add((path + "hR1VsR2").c_str(), "R_{1} vs R_{2};R_{1} (cm);R_{2} (cm)", kTH2D, {axisR, axisR}, true); - fRegistry.add((path + "hDeltaRVsDeltaZ").c_str(), "|R_{1}-R_{2}| vs #Delta z;|R_{1}-R_{2}| (cm);#Delta z (cm)", kTH2D, {axisDeltaR, axisDeltaZ}, true); - - // ── 2D: geometry vs kT ────────────────────────────────────────────────── - // Note: hDeltaRVsQinv, hDeltaZVsQinv live in FullRange/ (always filled, full q range) - fRegistry.add((path + "hDeltaRVsKt").c_str(), "|R_{1}-R_{2}| vs k_{T};k_{T} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisKt, axisDeltaR}, true); - fRegistry.add((path + "hDeltaZVsKt").c_str(), "#Delta z vs k_{T};k_{T} (GeV/c);#Delta z (cm)", kTH2D, {axisKt, axisDeltaZ}, true); - - // ── 2D: angular vs geometry ───────────────────────────────────────────── - fRegistry.add((path + "hDeltaPhiVsDeltaR").c_str(), "#Delta#phi vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#phi (rad)", kTH2D, {axisDeltaR, axisDeltaPhi}, true); - fRegistry.add((path + "hDeltaEtaVsDeltaR").c_str(), "#Delta#eta vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#eta", kTH2D, {axisDeltaR, axisDeltaEta}, true); - fRegistry.add((path + "hDeltaPhiVsDeltaZ").c_str(), "#Delta#phi vs #Delta z;#Delta z (cm);#Delta#phi (rad)", kTH2D, {axisDeltaZ, axisDeltaPhi}, true); - fRegistry.add((path + "hDeltaEtaVsDeltaZ").c_str(), "#Delta#eta vs #Delta z;#Delta z (cm);#Delta#eta", kTH2D, {axisDeltaZ, axisDeltaEta}, true); - - // ── 2D: vs event properties ───────────────────────────────────────────── - fRegistry.add((path + "hDeltaRVsCent").c_str(), "|R_{1}-R_{2}| vs centrality;centrality (%);|R_{1}-R_{2}| (cm)", kTH2D, {axisCentQA, axisDeltaR}, true); - fRegistry.add((path + "hDeltaRVsOccupancy").c_str(), "|R_{1}-R_{2}| vs occupancy;occupancy;|R_{1}-R_{2}| (cm)", kTH2D, {axisOccupancy, axisDeltaR}, true); - - fRegistry.add((path + "hSparseDEtaDPhiCent").c_str(), - "#Delta#eta,#Delta#phi,centrality", - kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisCentQA}, true); - fRegistry.add((path + "hSparseDEtaDPhiOcc").c_str(), - "#Delta#eta,#Delta#phi,occupancy", - kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisOccupancy}, true); - fRegistry.add((path + "hSparseDEtaDPhiKt").c_str(), - "#Delta#eta,#Delta#phi,k_{T}", - kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); - fRegistry.add((path + "hSparseDeltaRDeltaZKt").c_str(), - "|R_{1}-R_{2}|,#Delta z,k_{T}", - kTHnSparseD, {axisDeltaR, axisDeltaZ, axisKt}, true); + fRegistryPairQA.add((path + "hPairEta").c_str(), "pair #eta;#eta_{pair};counts", kTH1D, {axisEta}, true); + fRegistryPairQA.add((path + "hPairPhi").c_str(), "pair #phi;#phi_{pair} (rad);counts", kTH1D, {axisPhi}, true); + fRegistryPairQA.add((path + "hPairKt").c_str(), "pair k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + fRegistryPairQA.add((path + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + fRegistryPairQA.add((path + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); + fRegistryPairQA.add((path + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); + fRegistryPairQA.add((path + "hCosTheta").c_str(), "cos(#theta*);cos(#theta*);counts", kTH1D, {axisCosTheta}, true); + fRegistryPairQA.add((path + "hOpeningAngle").c_str(), "Opening angle;#alpha (rad);counts", kTH1D, {axisOpeningAngle}, true); + fRegistryPairQA.add((path + "hEllipseVal").c_str(), "(#Delta#eta/#sigma)^{2}+(#Delta#phi/#sigma)^{2};value;counts", kTH1D, {axisEllipseVal}, true); + fRegistryPairQA.add((path + "hR1").c_str(), "R_{conv,1};R_{1} (cm);counts", kTH1D, {axisR}, true); + fRegistryPairQA.add((path + "hR2").c_str(), "R_{conv,2};R_{2} (cm);counts", kTH1D, {axisR}, true); + fRegistryPairQA.add((path + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); + fRegistryPairQA.add((path + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); + fRegistryPairQA.add((path + "hDeltaRxy").c_str(), "#Delta r_{xy};#Delta r_{xy} (cm);counts", kTH1D, {axisDeltaRxy}, true); + fRegistryPairQA.add((path + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); + fRegistryPairQA.add((path + "hCent").c_str(), "centrality;centrality (%);counts", kTH1D, {axisCentQA}, true); + fRegistryPairQA.add((path + "hOccupancy").c_str(), "occupancy;occupancy;counts", kTH1D, {axisOccupancy}, true); + fRegistryPairQA.add((path + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi (rad)", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairQA.add((path + "hDeltaEtaVsPairEta").c_str(), "#Delta#eta vs #LT#eta#GT_{pair};#LT#eta#GT_{pair};#Delta#eta", kTH2D, {axisEta, axisDeltaEta}, true); + fRegistryPairQA.add((path + "hR1VsR2").c_str(), "R_{1} vs R_{2};R_{1} (cm);R_{2} (cm)", kTH2D, {axisR, axisR}, true); + fRegistryPairQA.add((path + "hDeltaRVsDeltaZ").c_str(), "|R_{1}-R_{2}| vs #Delta z;|R_{1}-R_{2}| (cm);#Delta z (cm)", kTH2D, {axisDeltaR, axisDeltaZ}, true); + fRegistryPairQA.add((path + "hDeltaRVsKt").c_str(), "|R_{1}-R_{2}| vs k_{T};k_{T} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisKt, axisDeltaR}, true); + fRegistryPairQA.add((path + "hDeltaZVsKt").c_str(), "#Delta z vs k_{T};k_{T} (GeV/c);#Delta z (cm)", kTH2D, {axisKt, axisDeltaZ}, true); + fRegistryPairQA.add((path + "hDeltaPhiVsDeltaR").c_str(), "#Delta#phi vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#phi (rad)", kTH2D, {axisDeltaR, axisDeltaPhi}, true); + fRegistryPairQA.add((path + "hDeltaEtaVsDeltaR").c_str(), "#Delta#eta vs |R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);#Delta#eta", kTH2D, {axisDeltaR, axisDeltaEta}, true); + fRegistryPairQA.add((path + "hDeltaPhiVsDeltaZ").c_str(), "#Delta#phi vs #Delta z;#Delta z (cm);#Delta#phi (rad)", kTH2D, {axisDeltaZ, axisDeltaPhi}, true); + fRegistryPairQA.add((path + "hDeltaEtaVsDeltaZ").c_str(), "#Delta#eta vs #Delta z;#Delta z (cm);#Delta#eta", kTH2D, {axisDeltaZ, axisDeltaEta}, true); + fRegistryPairQA.add((path + "hDeltaRVsCent").c_str(), "|R_{1}-R_{2}| vs centrality;centrality (%);|R_{1}-R_{2}| (cm)", kTH2D, {axisCentQA, axisDeltaR}, true); + fRegistryPairQA.add((path + "hDeltaRVsOccupancy").c_str(), "|R_{1}-R_{2}| vs occupancy;occupancy;|R_{1}-R_{2}| (cm)", kTH2D, {axisOccupancy, axisDeltaR}, true); + fRegistryPairQA.add((path + "hSparseDEtaDPhiKt").c_str(), "#Delta#eta,#Delta#phi,k_{T}", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryPairQA.add((path + "hSparseDeltaRDeltaZKt").c_str(), "|R_{1}-R_{2}|,#Delta z,k_{T}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisKt}, true); } void addhistograms() @@ -645,44 +592,33 @@ struct photonhbt { addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterRZ/"); addSinglePhotonQAHistogramsForStep("SinglePhoton/AfterEllipse/"); - // ── HBT correlation functions ───────────────────────────────────────────── if (cfgDo3D) { - fRegistry.add("Pair/same/CF_3D", "diphoton correlation 3D LCMS", - kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); - if (cfgDo2D) { - fRegistry.add("Pair/same/CF_2D", "diphoton correlation 2D (qout,qinv)", - kTHnSparseD, {axisQout, axisQinv, axisKt}, true); - } + fRegistry.add("Pair/same/CF_3D", "diphoton correlation 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (cfgDo2D) + fRegistry.add("Pair/same/CF_2D", "diphoton correlation 2D (qout,qinv)", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); } else { - if (cfgUseLCMS) { + if (cfgUseLCMS) fRegistry.add("Pair/same/CF_1D", "diphoton correlation 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); - } else { + else fRegistry.add("Pair/same/CF_1D", "diphoton correlation 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); - } } fRegistry.add("Pair/same/hDeltaRCosOA", "distance between 2 conversion points / cos(#theta_{op}/2);#Delta r / cos(#theta_{op}/2) (cm);counts", kTH1D, {{100, 0, 100}}, true); - // ── QA steps (same-event; mix-event cloned below) ───────────────────────── addQAHistogramsForStep("Pair/same/QA/Before/"); addQAHistogramsForStep("Pair/same/QA/AfterDRCosOA/"); addQAHistogramsForStep("Pair/same/QA/AfterRZ/"); addQAHistogramsForStep("Pair/same/QA/AfterEllipse/"); - // ── MC truth histograms (same-event; mix-event cloned below) ───────────── addMCHistograms(); - - // ── Full-range histograms: always filled, qinv as axis ─────────────────── + fRegistryPairQA.addClone("Pair/same/QA/", "Pair/mix/QA/"); + fRegistryPairMC.addClone("Pair/same/MC/", "Pair/mix/MC/"); addFullRangeHistograms("Pair/same/FullRange/"); - - // Clone all Pair/same/ histograms to Pair/mix/ fRegistry.addClone("Pair/same/", "Pair/mix/"); } - // ─── DefineEMEventCut ────────────────────────────────────────────────────── - void DefineEMEventCut() { fEMEventCut = EMPhotonEventCut("fEMEventCut", "fEMEventCut"); @@ -704,8 +640,6 @@ struct photonhbt { fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); } - // ─── DefinePCMCut ────────────────────────────────────────────────────────── - void DefinePCMCut() { fV0PhotonCut = V0PhotonCut("fV0PhotonCut", "fV0PhotonCut"); @@ -733,7 +667,6 @@ struct photonhbt { fV0PhotonCut.SetRequireTPConly(pcmcuts.cfgRequireV0WithTPCOnly); } - /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse template static constexpr const char* singlePhotonQAPrefix() { @@ -753,13 +686,13 @@ struct photonhbt { return; constexpr auto base = singlePhotonQAPrefix(); const float r = std::sqrt(g.vx() * g.vx() + g.vy() * g.vy()); - fRegistry.fill(HIST(base) + HIST("hPt"), g.pt()); - fRegistry.fill(HIST(base) + HIST("hEta"), g.eta()); - fRegistry.fill(HIST(base) + HIST("hPhi"), g.phi()); - fRegistry.fill(HIST(base) + HIST("hEtaVsPhi"), g.phi(), g.eta()); - fRegistry.fill(HIST(base) + HIST("hR"), r); - fRegistry.fill(HIST(base) + HIST("hZConv"), g.vz()); - fRegistry.fill(HIST(base) + HIST("hRVsZConv"), g.vz(), r); + fRegistryPairQA.fill(HIST(base) + HIST("hPt"), g.pt()); + fRegistryPairQA.fill(HIST(base) + HIST("hEta"), g.eta()); + fRegistryPairQA.fill(HIST(base) + HIST("hPhi"), g.phi()); + fRegistryPairQA.fill(HIST(base) + HIST("hEtaVsPhi"), g.phi(), g.eta()); + fRegistryPairQA.fill(HIST(base) + HIST("hR"), r); + fRegistryPairQA.fill(HIST(base) + HIST("hZConv"), g.vz()); + fRegistryPairQA.fill(HIST(base) + HIST("hRVsZConv"), g.vz(), r); } template @@ -772,11 +705,9 @@ struct photonhbt { auto k12 = 0.5 * (v1 + v2); float kt = k12.Pt(); float qinv = -(((v1 - v2) * rndm).M()); - ROOT::Math::XYZVector uv_out(k12.Px() / k12.Pt(), k12.Py() / k12.Pt(), 0); ROOT::Math::XYZVector uv_long(0, 0, 1); ROOT::Math::XYZVector uv_side = uv_out.Cross(uv_long); - ROOT::Math::PxPyPzEVector v1c(v1), v2c(v2); float beta_z = (v1 + v2).Beta() * std::cos((v1 + v2).Theta()); ROOT::Math::Boost bst_z(0, 0, -beta_z); @@ -786,14 +717,12 @@ struct photonhbt { float qout_lcms = q3_lcms.Dot(uv_out); float qside_lcms = q3_lcms.Dot(uv_side); float qlong_lcms = q3_lcms.Dot(uv_long); - if (cfgDo3D) { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_3D"), std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); - if (cfgDo2D) { + if (cfgDo2D) fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt, weight); - } } else { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt, weight); @@ -806,16 +735,13 @@ struct photonhbt { ROOT::Math::PtEtaPhiMVector v2, float weight = 1.f) { - float rndm = std::pow(-1, dist01(engine) % 2); auto k12 = 0.5 * (v1 + v2); float kt = k12.Pt(); float qinv = -(((v1 - v2) * rndm).M()); - ROOT::Math::XYZVector uv_out(k12.Px() / k12.Pt(), k12.Py() / k12.Pt(), 0); ROOT::Math::XYZVector uv_long(0, 0, 1); ROOT::Math::XYZVector uv_side = uv_out.Cross(uv_long); - ROOT::Math::PxPyPzEVector v1c(v1), v2c(v2); float beta_z = (v1 + v2).Beta() * std::cos((v1 + v2).Theta()); ROOT::Math::Boost bst_z(0, 0, -beta_z); @@ -825,7 +751,6 @@ struct photonhbt { float qout_lcms = q3_lcms.Dot(uv_out); float qside_lcms = q3_lcms.Dot(uv_side); float qlong_lcms = q3_lcms.Dot(uv_long); - constexpr auto mcDir = []() constexpr -> const char* { if constexpr (ev_id == 0) { if constexpr (TruthT == PairTruthType::TrueTrueDistinct) @@ -853,17 +778,13 @@ struct photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - if (cfgDo3D) { - fRegistry.fill(HIST(mcDir) + HIST("CF_3D"), - std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); - if (cfgDo2D) { - fRegistry.fill(HIST(mcDir) + HIST("CF_2D"), - std::fabs(qout_lcms), std::fabs(qinv), kt, weight); - } + fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_3D"), + std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); + if (cfgDo2D) + fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt, weight); } else { - fRegistry.fill(HIST(mcDir) + HIST("CF_1D"), - cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt, weight); } } @@ -871,30 +792,23 @@ struct photonhbt { PairQAObservables buildPairQAObservables(TG1 const& g1, TG2 const& g2) { PairQAObservables o{}; - o.x1 = g1.vx(); o.y1 = g1.vy(); o.z1 = g1.vz(); o.x2 = g2.vx(); o.y2 = g2.vy(); o.z2 = g2.vz(); - o.r1 = std::sqrt(o.x1 * o.x1 + o.y1 * o.y1); o.r2 = std::sqrt(o.x2 * o.x2 + o.y2 * o.y2); - o.dx = o.x1 - o.x2; o.dy = o.y1 - o.y2; o.dz = o.z1 - o.z2; - o.deltaR = std::fabs(o.r1 - o.r2); o.deltaZ = o.dz; o.deltaRxy = std::sqrt(o.dx * o.dx + o.dy * o.dy); o.deltaR3D = std::sqrt(o.dx * o.dx + o.dy * o.dy + o.dz * o.dz); - - ROOT::Math::XYZVector cp1(o.x1, o.y1, o.z1); - ROOT::Math::XYZVector cp2(o.x2, o.y2, o.z2); - const float mag1 = std::sqrt(cp1.Mag2()); - const float mag2 = std::sqrt(cp2.Mag2()); + ROOT::Math::XYZVector cp1(o.x1, o.y1, o.z1), cp2(o.x2, o.y2, o.z2); + const float mag1 = std::sqrt(cp1.Mag2()), mag2 = std::sqrt(cp2.Mag2()); if (mag1 < 1e-12f || mag2 < 1e-12f) { o.valid = false; return o; @@ -907,20 +821,17 @@ struct photonhbt { o.opa -= o2::constants::math::PI; o.cosOA = std::cos(o.opa / 2.f); o.drOverCosOA = (std::fabs(o.cosOA) < 1e-12f) ? 1e12f : (o.deltaR3D / o.cosOA); - o.v1 = ROOT::Math::PtEtaPhiMVector(g1.pt(), g1.eta(), g1.phi(), 0.f); o.v2 = ROOT::Math::PtEtaPhiMVector(g2.pt(), g2.eta(), g2.phi(), 0.f); o.k12 = 0.5f * (o.v1 + o.v2); - o.deta = g1.eta() - g2.eta(); - o.dphi = RecoDecay::constrainAngle(g1.phi() - g2.phi(), -o2::constants::math::PI); // dphi in [-pi, pi] + o.dphi = RecoDecay::constrainAngle(g1.phi() - g2.phi(), -o2::constants::math::PI); o.pairEta = 0.5f * (g1.eta() + g2.eta()); - o.pairPhi = RecoDecay::constrainAngle(o.k12.Phi(), 0.f); // pair phi in [0, 2pi] — matches axisPhi + o.pairPhi = RecoDecay::constrainAngle(o.k12.Phi(), 0.f); o.kt = o.k12.Pt(); o.qinv = std::fabs((o.v1 - o.v2).M()); o.cosTheta = std::fabs(computeCosTheta(o.v1, o.v2)); o.openingAngle = o.opa; - return o; } @@ -929,149 +840,98 @@ struct photonhbt { { if (!qaflags.doPairQa) return; - constexpr auto base = qaPrefix(); - - // 1D: kinematics - fRegistry.fill(HIST(base) + HIST("hPairEta"), o.pairEta); - fRegistry.fill(HIST(base) + HIST("hPairPhi"), o.pairPhi); - fRegistry.fill(HIST(base) + HIST("hPairKt"), o.kt); - fRegistry.fill(HIST(base) + HIST("hQinv"), o.qinv); - - // 1D: angular - fRegistry.fill(HIST(base) + HIST("hDeltaEta"), o.deta); - fRegistry.fill(HIST(base) + HIST("hDeltaPhi"), o.dphi); - fRegistry.fill(HIST(base) + HIST("hCosTheta"), o.cosTheta); - fRegistry.fill(HIST(base) + HIST("hOpeningAngle"), o.openingAngle); - - // 1D: geometry - fRegistry.fill(HIST(base) + HIST("hR1"), o.r1); - fRegistry.fill(HIST(base) + HIST("hR2"), o.r2); - fRegistry.fill(HIST(base) + HIST("hDeltaR"), o.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaZ"), o.deltaZ); - fRegistry.fill(HIST(base) + HIST("hDeltaRxy"), o.deltaRxy); - fRegistry.fill(HIST(base) + HIST("hDeltaR3D"), o.deltaR3D); - - // 1D: event - fRegistry.fill(HIST(base) + HIST("hCent"), cent); - fRegistry.fill(HIST(base) + HIST("hOccupancy"), occupancy); - - // 1D: ellipse value (diagnostic, conditional on cut being configured) - const float sE = ggpaircuts.cfgEllipseSigEta.value; - const float sP = ggpaircuts.cfgEllipseSigPhi.value; - if (sE > 1e-9f && sP > 1e-9f) { - const float ellipseVal = (o.deta / sE) * (o.deta / sE) + (o.dphi / sP) * (o.dphi / sP); - fRegistry.fill(HIST(base) + HIST("hEllipseVal"), ellipseVal); - } - - // 2D: angular - fRegistry.fill(HIST(base) + HIST("hDEtaDPhi"), o.deta, o.dphi); - fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsPairEta"), o.pairEta, o.deta); - - // 2D: geometry - fRegistry.fill(HIST(base) + HIST("hR1VsR2"), o.r1, o.r2); - fRegistry.fill(HIST(base) + HIST("hDeltaRVsDeltaZ"), o.deltaR, o.deltaZ); - - // 2D: geometry vs kT (qinv variants live in FullRange/) - fRegistry.fill(HIST(base) + HIST("hDeltaRVsKt"), o.kt, o.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaZVsKt"), o.kt, o.deltaZ); - - // 2D: angular vs geometry - fRegistry.fill(HIST(base) + HIST("hDeltaPhiVsDeltaR"), o.deltaR, o.dphi); - fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsDeltaR"), o.deltaR, o.deta); - fRegistry.fill(HIST(base) + HIST("hDeltaPhiVsDeltaZ"), o.deltaZ, o.dphi); - fRegistry.fill(HIST(base) + HIST("hDeltaEtaVsDeltaZ"), o.deltaZ, o.deta); - - // 2D: vs event properties (qinv variants live in FullRange/) - fRegistry.fill(HIST(base) + HIST("hDeltaRVsCent"), cent, o.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaRVsOccupancy"), occupancy, o.deltaR); - - // THnSparse (hSparseDeltaRDeltaZQinv lives in FullRange/) - fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiCent"), o.deta, o.dphi, cent); - fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiOcc"), o.deta, o.dphi, occupancy); - fRegistry.fill(HIST(base) + HIST("hSparseDEtaDPhiKt"), o.deta, o.dphi, o.kt); - fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZKt"), o.deltaR, o.deltaZ, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hPairEta"), o.pairEta); + fRegistryPairQA.fill(HIST(base) + HIST("hPairPhi"), o.pairPhi); + fRegistryPairQA.fill(HIST(base) + HIST("hPairKt"), o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hQinv"), o.qinv); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEta"), o.deta); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhi"), o.dphi); + fRegistryPairQA.fill(HIST(base) + HIST("hCosTheta"), o.cosTheta); + fRegistryPairQA.fill(HIST(base) + HIST("hOpeningAngle"), o.openingAngle); + fRegistryPairQA.fill(HIST(base) + HIST("hR1"), o.r1); + fRegistryPairQA.fill(HIST(base) + HIST("hR2"), o.r2); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaR"), o.deltaR); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaZ"), o.deltaZ); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRxy"), o.deltaRxy); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaR3D"), o.deltaR3D); + fRegistryPairQA.fill(HIST(base) + HIST("hCent"), cent); + fRegistryPairQA.fill(HIST(base) + HIST("hOccupancy"), occupancy); + const float sE = ggpaircuts.cfgEllipseSigEta.value, sP = ggpaircuts.cfgEllipseSigPhi.value; + if (sE > 1e-9f && sP > 1e-9f) + fRegistryPairQA.fill(HIST(base) + HIST("hEllipseVal"), (o.deta / sE) * (o.deta / sE) + (o.dphi / sP) * (o.dphi / sP)); + fRegistryPairQA.fill(HIST(base) + HIST("hDEtaDPhi"), o.deta, o.dphi); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsPairEta"), o.pairEta, o.deta); + fRegistryPairQA.fill(HIST(base) + HIST("hR1VsR2"), o.r1, o.r2); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsDeltaZ"), o.deltaR, o.deltaZ); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsKt"), o.kt, o.deltaR); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaZVsKt"), o.kt, o.deltaZ); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiVsDeltaR"), o.deltaR, o.dphi); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsDeltaR"), o.deltaR, o.deta); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiVsDeltaZ"), o.deltaZ, o.dphi); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaVsDeltaZ"), o.deltaZ, o.deta); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsCent"), cent, o.deltaR); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRVsOccupancy"), occupancy, o.deltaR); + fRegistryPairQA.fill(HIST(base) + HIST("hSparseDEtaDPhiKt"), o.deta, o.dphi, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hSparseDeltaRDeltaZKt"), o.deltaR, o.deltaZ, o.kt); } template - static PhotonMCInfo buildPhotonMCInfo(TPhoton const& g, - TMCParticles const& mcParticles) + static PhotonMCInfo buildPhotonMCInfo(TPhoton const& g, TMCParticles const& mcParticles) { PhotonMCInfo info{}; - const auto pos = g.template posTrack_as(); const auto neg = g.template negTrack_as(); - - // PWGEM uses emmcparticle, not the standard mcParticle accessor if (!pos.has_emmcparticle() || !neg.has_emmcparticle()) return info; - info.hasMC = true; info.mcPosId = pos.emmcparticleId(); info.mcNegId = neg.emmcparticleId(); - const auto mcPos = pos.template emmcparticle_as(); const auto mcNeg = neg.template emmcparticle_as(); - if (!mcPos.has_mothers() || !mcNeg.has_mothers()) return info; - - const int mothIdPos = mcPos.mothersIds()[0]; - const int mothIdNeg = mcNeg.mothersIds()[0]; + const int mothIdPos = mcPos.mothersIds()[0], mothIdNeg = mcNeg.mothersIds()[0]; if (mothIdPos != mothIdNeg) return info; - info.sameMother = true; info.motherId = mothIdPos; - const auto mother = mcParticles.iteratorAt(mothIdPos); info.motherPdg = mother.pdgCode(); info.isTruePhoton = (info.motherPdg == 22); info.isPhysicalPrimary = mother.isPhysicalPrimary(); - return info; } - static PairTruthType classifyPairTruth(PhotonMCInfo const& m1, - PhotonMCInfo const& m2) + static PairTruthType classifyPairTruth(PhotonMCInfo const& m1, PhotonMCInfo const& m2) { const bool t1 = m1.hasMC && m1.sameMother && m1.isTruePhoton; const bool t2 = m2.hasMC && m2.sameMother && m2.isTruePhoton; - if (m1.hasMC && m2.hasMC) { if ((m1.mcPosId >= 0 && (m1.mcPosId == m2.mcPosId || m1.mcPosId == m2.mcNegId)) || (m1.mcNegId >= 0 && (m1.mcNegId == m2.mcPosId || m1.mcNegId == m2.mcNegId))) return PairTruthType::SharedMcLeg; } - if (!t1 && !t2) return PairTruthType::FakeFake; if (t1 != t2) return PairTruthType::TrueFake; - - // Both are true photons — same or different MC photon? if (m1.motherId >= 0 && m1.motherId == m2.motherId) return PairTruthType::TrueTrueSamePhoton; - return PairTruthType::TrueTrueDistinct; } template - static bool isPi0DaughterPair(PhotonMCInfo const& m1, - PhotonMCInfo const& m2, + static bool isPi0DaughterPair(PhotonMCInfo const& m1, PhotonMCInfo const& m2, TMCParticles const& mcParticles) { - if (!m1.isTruePhoton || !m2.isTruePhoton) - return false; - if (m1.motherId < 0 || m2.motherId < 0) + if (!m1.isTruePhoton || !m2.isTruePhoton || m1.motherId < 0 || m2.motherId < 0) return false; - // The photons themselves must have the same grandmother = pi0 const auto ph1 = mcParticles.iteratorAt(m1.motherId); const auto ph2 = mcParticles.iteratorAt(m2.motherId); if (!ph1.has_mothers() || !ph2.has_mothers()) return false; - const int gm1 = ph1.mothersIds()[0]; - const int gm2 = ph2.mothersIds()[0]; + const int gm1 = ph1.mothersIds()[0], gm2 = ph2.mothersIds()[0]; if (gm1 != gm2) return false; return (std::abs(mcParticles.iteratorAt(gm1).pdgCode()) == 111); @@ -1099,53 +959,245 @@ struct photonhbt { void addMCHistograms() { - const AxisSpec axisTruthType{{0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5}, "truth type (1=TrueTrueDistinct,2=TrueTrueSamePhoton,3=SharedMcLeg,4=TrueFake,5=FakeFake,6=Pi0Daughters)"}; + const AxisSpec axisTruthType{{0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5}, + "truth type (1=TrueTrueDistinct,2=TrueTrueSamePhoton,3=SharedMcLeg,4=TrueFake,5=FakeFake,6=Pi0Daughters)"}; + const AxisSpec axisDeltaEtaMC{90, -1.6f, +1.6f, "#Delta#eta"}; + const AxisSpec axisDeltaPhiMC{90, -o2::constants::math::PI, +o2::constants::math::PI, "#Delta#phi (rad)"}; static constexpr std::array kTypes = { - "TrueTrueDistinct/", - "TrueTrueSamePhoton/", - "SharedMcLeg/", - "TrueFake/", - "FakeFake/", - "Pi0Daughters/"}; + "TrueTrueDistinct/", "TrueTrueSamePhoton/", "SharedMcLeg/", "TrueFake/", "FakeFake/", "Pi0Daughters/"}; for (const auto& label : kTypes) { const std::string base = std::string("Pair/same/MC/") + std::string(label); - if (cfgDo3D) { - fRegistry.add((base + "CF_3D").c_str(), "MC CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); - if (cfgDo2D) { - fRegistry.add((base + "CF_2D").c_str(), "MC CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); - } + fRegistryPairMC.add((base + "CF_3D").c_str(), "MC CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (cfgDo2D) + fRegistryPairMC.add((base + "CF_2D").c_str(), "MC CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); } else { - if (cfgUseLCMS) { - fRegistry.add((base + "CF_1D").c_str(), "MC CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); - } else { - fRegistry.add((base + "CF_1D").c_str(), "MC CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); - } + if (cfgUseLCMS) + fRegistryPairMC.add((base + "CF_1D").c_str(), "MC CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); + else + fRegistryPairMC.add((base + "CF_1D").c_str(), "MC CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); } + fRegistryPairMC.add((base + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + fRegistryPairMC.add((base + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); + fRegistryPairMC.add((base + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); + fRegistryPairMC.add((base + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add((base + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); + fRegistryPairMC.add((base + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); + fRegistryPairMC.add((base + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); + fRegistryPairMC.add((base + "hKt").c_str(), "k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + fRegistryPairMC.add((base + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv}", kTH2D, {axisQinv, axisDeltaR}, true); + fRegistryPairMC.add((base + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv}", kTH2D, {axisQinv, axisDeltaZ}, true); + fRegistryPairMC.add((base + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv}", kTH2D, {axisQinv, axisDeltaR3D}, true); + + const bool addDEtaDPhiVsQinv = + (label == "TrueTrueDistinct/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value : (label == "TrueTrueSamePhoton/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value + : (label == "SharedMcLeg/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value + : (label == "TrueFake/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueFake.value + : (label == "FakeFake/") ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvFakeFake.value + : mcthruth_sparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value; + if (addDEtaDPhiVsQinv) + fRegistryPairMC.add((base + "hDEtaDPhiVsQinv").c_str(), "#Delta#eta vs #Delta#phi vs q_{inv}", kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); + const bool addDRDZQinv = + (label == "TrueTrueDistinct/") ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueDistinct.value : (label == "TrueTrueSamePhoton/") ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueSamePhoton.value + : (label == "SharedMcLeg/") ? mcthruth_sparse.cfgFillDRDZQinvSharedMcLeg.value + : (label == "TrueFake/") ? mcthruth_sparse.cfgFillDRDZQinvTrueFake.value + : (label == "FakeFake/") ? mcthruth_sparse.cfgFillDRDZQinvFakeFake.value + : mcthruth_sparse.cfgFillDRDZQinvPi0Daughters.value; + if (addDRDZQinv) + fRegistryPairMC.add((base + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); + fRegistryPairMC.add((base + "hSparse_DEtaDPhi_kT").c_str(), + "#Delta#eta vs #Delta#phi vs k_{T};#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + } + fRegistryPairMC.add("Pair/same/MC/hTruthTypeVsQinv", "truth type vs q_{inv};q_{inv} (GeV/c);truth type", kTH2D, {axisQinv, axisTruthType}, true); + fRegistryPairMC.add("Pair/same/MC/hTruthTypeVsKt", "truth type vs k_{T};k_{T} (GeV/c);truth type", kTH2D, {axisKt, axisTruthType}, true); - fRegistry.add((base + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); - fRegistry.add((base + "hDeltaEta").c_str(), "#Delta#eta;#Delta#eta;counts", kTH1D, {axisDeltaEta}, true); - fRegistry.add((base + "hDeltaPhi").c_str(), "#Delta#phi;#Delta#phi (rad);counts", kTH1D, {axisDeltaPhi}, true); - fRegistry.add((base + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi;#Delta#eta;#Delta#phi", kTH2D, {axisDeltaEta, axisDeltaPhi}, true); - fRegistry.add((base + "hDeltaR").c_str(), "|R_{1}-R_{2}|;|R_{1}-R_{2}| (cm);counts", kTH1D, {axisDeltaR}, true); - fRegistry.add((base + "hDeltaZ").c_str(), "#Delta z;#Delta z (cm);counts", kTH1D, {axisDeltaZ}, true); - fRegistry.add((base + "hDeltaR3D").c_str(), "#Delta r_{3D};#Delta r_{3D} (cm);counts", kTH1D, {axisDeltaR3D}, true); - fRegistry.add((base + "hKt").c_str(), "k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); - fRegistry.add((base + "hDeltaRVsQinv").c_str(), "|R_{1}-R_{2}| vs q_{inv};q_{inv} (GeV/c);|R_{1}-R_{2}| (cm)", kTH2D, {axisQinv, axisDeltaR}, true); - fRegistry.add((base + "hDeltaZVsQinv").c_str(), "#Delta z vs q_{inv};q_{inv} (GeV/c);#Delta z (cm)", kTH2D, {axisQinv, axisDeltaZ}, true); - fRegistry.add((base + "hDeltaR3DVsQinv").c_str(), "#Delta r_{3D} vs q_{inv};q_{inv} (GeV/c);#Delta r_{3D} (cm)", kTH2D, {axisQinv, axisDeltaR3D}, true); - fRegistry.add((base + "hDEtaDPhiVsQinv").c_str(), "#Delta#eta vs #Delta#phi vs q_{inv};#Delta#eta;#Delta#phi;q_{inv}", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisQinv}, true); - fRegistry.add((base + "hSparseDeltaRDeltaZQinv").c_str(), "|R_{1}-R_{2}|,#Delta z,q_{inv};|R_{1}-R_{2}| (cm);#Delta z (cm);q_{inv} (GeV/c)", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisQinv}, true); + if (cfgDo3D) { + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_3D", "pairs with missing MC label — CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (cfgDo2D) + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_2D", "pairs with missing MC label — CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); + } else { + if (cfgUseLCMS) + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_1D", "pairs with missing MC label — CF 1D LCMS", kTH2D, {axisQabsLcms, axisKt}, true); + else + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_1D", "pairs with missing MC label — CF 1D (qinv)", kTH2D, {axisQinv, axisKt}, true); + } + fRegistryPairMC.add("Pair/same/MC/NoLabel/hDEtaDPhi", + "pairs with missing MC label: #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add("Pair/same/MC/NoLabel/hKt", "pairs with missing MC label: k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + fRegistryPairMC.add("Pair/same/MC/NoLabel/hQinv", "pairs with missing MC label: q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + + fRegistryPairMC.add("Pair/same/MC/hDEtaDPhi_truePairs", + "reco pairs where both photons are true (TrueTrueDistinct+SamePhoton+Pi0);" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add("Pair/same/MC/hDEtaDPhi_fakePairs", + "reco pairs with at least one fake photon (FakeFake+TrueFake+SharedMcLeg);" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_kT_truePairs", + "reco true pairs: #Delta#eta × #Delta#phi × k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_qinv_truePairs", + "reco true pairs: #Delta#eta × #Delta#phi × q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_kT_fakePairs", + "reco fake pairs: #Delta#eta × #Delta#phi × k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + fRegistryPairMC.add("Pair/same/MC/hSparse_DEtaDPhi_qinv_fakePairs", + "reco fake pairs: #Delta#eta × #Delta#phi × q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisQinv}, true); + + const AxisSpec axQinvMC{60, 0.f, 0.3f, "q_{inv}^{true} (GeV/c)"}; + + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_truthConverted", + "true converted pairs, denominator;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_all4LegsThisColl", + "all 4 legs found — #Delta#eta #Delta#phi q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsBuilt", + "both V0s built — #Delta#eta × #Delta#phi × q_{inv};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsSelected", + "both V0s pass cuts — numerator;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axQinvMC}, true); + + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_truthConverted", + "true converted pairs — denominator;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_all4LegsThisColl", + "all 4 legs found — #Delta#eta × #Delta#phi × k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsBuilt", + "both V0s built — #Delta#eta × #Delta#phi × k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsSelected", + "both V0s pass cuts — numerator;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_truthConverted", + "true converted pairs: q_{inv}^{true} vs k_{T};" + "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_all4LegsThisColl", + "all 4 legs found: q_{inv}^{true} vs k_{T};" + "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_bothPhotonsBuilt", + "both V0s built: q_{inv}^{true} vs k_{T};" + "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthAO2D/hQinvVsKt_bothPhotonsSelected", + "both V0s selected: q_{inv}^{true} vs k_{T};" + "k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + kTH2D, {axisKt, axQinvMC}, true); + + fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_truthConverted", + "true converted pairs — generator level #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_all4LegsThisColl", + "all 4 legs found — #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_bothPhotonsBuilt", + "both V0s built — #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryMC.add("MC/TruthAO2D/hDEtaDPhi_bothPhotonsSelected", + "both V0s selected — #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + + fRegistryMC.add("MC/TruthAO2D/hStage_vs_kT", + "pair reco stage vs k_{T} — integrated efficiency waterfall;" + "k_{T} (GeV/c);stage (0=converted,1=all4legs,2=bothBuilt,3=bothSel)", + kTH2D, {axisKt, AxisSpec{4, -0.5f, 3.5f, "stage"}}, true); + + fRegistryMC.add("MC/TruthAO2D/hStageConsistency", + "stage consistency check (expect all entries at 0);" + "N(V0 built but legs not found) per event;counts", + kTH1D, {AxisSpec{20, -0.5f, 19.5f, "N_{bad}"}}, true); + + { + const AxisSpec axRconv{180, 0.f, 90.f, "R_{conv}^{true} (cm)"}; + + fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_truthConverted", + "true pairs — denominator: R_{conv}(#gamma_{1}) vs R_{conv}(#gamma_{2});" + "R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", + kTH2D, {axRconv, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_bothPhotonsSelected", + "true pairs — numerator: R_{conv}(#gamma_{1}) vs R_{conv}(#gamma_{2});" + "R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", + kTH2D, {axRconv, axRconv}, true); + + fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_truthConverted", + "true pairs — denominator: min(R_{conv}) vs k_{T};" + "k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", + kTH2D, {axisKt, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_bothPhotonsSelected", + "true pairs — numerator: min(R_{conv}) vs k_{T};" + "k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", + kTH2D, {axisKt, axRconv}, true); + + fRegistryMC.add("MC/LegDiag/hRconv_legFound_vs_pt", + "single photon leg found in this collision: R_{conv}^{true} vs photon p_{T};" + "p_{T,#gamma}^{true} (GeV/c);R_{conv}^{true} (cm)", + kTH2D, {axisPt, axRconv}, true); + fRegistryMC.add("MC/LegDiag/hRconv_legMissing_vs_pt", + "single photon leg NOT found in this collision: R_{conv}^{true} vs photon p_{T};" + "p_{T,#gamma}^{true} (GeV/c);R_{conv}^{true} (cm)", + kTH2D, {axisPt, axRconv}, true); } - fRegistry.add("Pair/same/MC/hTruthTypeVsQinv", "truth type vs q_{inv};q_{inv} (GeV/c);truth type", kTH2D, {axisQinv, axisTruthType}, true); - fRegistry.add("Pair/same/MC/hTruthTypeVsKt", "truth type vs k_{T};k_{T} (GeV/c);truth type", kTH2D, {axisKt, axisTruthType}, true); + fRegistryMC.add("MC/PairCrossBuild/hSparse_DEtaDPhi_kT", + "pairs with cross-built V0 (legs from two different true photons);" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryMC.add("MC/PairCrossBuild/hStageOut_vs_kT", + "cross-built pairs: how many were correctly built despite the fake V0;" + "k_{T} (GeV/c);N photons correctly built (0/1/2)", + kTH2D, {axisKt, AxisSpec{3, -0.5f, 2.5f, "N photons correctly built"}}, true); + fRegistryMC.add("MC/LegDiag/hNLegsPair_vs_kT", + "N legs found per pair (collision-local) vs k_{T};" + "k_{T} (GeV/c);N_{legs found} (0-4)", + kTH2D, {axisKt, AxisSpec{5, -0.5f, 4.5f, "N_{legs found} (this collision)"}}, true); + fRegistryMC.add("MC/LegDiag/hMissingLegPt_vs_kT", + "p_{T}^{true} of missing V0 legs vs pair k_{T};" + "k_{T} (GeV/c);p_{T,leg}^{true} (GeV/c)", + kTH2D, {axisKt, AxisSpec{100, 0.f, 0.5f, "p_{T,leg}^{true} (GeV/c)"}}, true); + fRegistryMC.add("MC/LegDiag/hMissingLegRconv_vs_kT", + "parent R_{conv}^{true} of missing leg vs pair k_{T};" + "k_{T} (GeV/c);R_{conv}^{true} (cm)", + kTH2D, {axisKt, axisR}, true); + fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legFound", + "single photon: leg found — leg #Delta R^{true} vs photon p_{T};" + "p_{T,#gamma}^{true} (GeV/c);leg #Delta R^{true}", + kTH2D, {axisPt, AxisSpec{100, 0.f, 0.3f, "leg #Delta R^{true}"}}, true); + fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legMissing", + "single photon: leg NOT found — leg #Delta R^{true} vs photon p_{T};" + "p_{T,#gamma}^{true} (GeV/c);leg #Delta R^{true}", + kTH2D, {axisPt, AxisSpec{100, 0.f, 0.3f, "leg #Delta R^{true}"}}, true); } template - inline void fillMCPairQATyped(PairQAObservables const& obs) + inline void fillMCPairQATyped(PairQAObservables const& obs, bool doSparse, bool doMCQA) { constexpr auto base = []() constexpr -> const char* { if constexpr (!IsMix) { @@ -1174,43 +1226,46 @@ struct photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - - fRegistry.fill(HIST(base) + HIST("hQinv"), obs.qinv); - fRegistry.fill(HIST(base) + HIST("hDeltaEta"), obs.deta); - fRegistry.fill(HIST(base) + HIST("hDeltaPhi"), obs.dphi); - fRegistry.fill(HIST(base) + HIST("hDEtaDPhi"), obs.deta, obs.dphi); - fRegistry.fill(HIST(base) + HIST("hDeltaR"), obs.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaZ"), obs.deltaZ); - fRegistry.fill(HIST(base) + HIST("hDeltaR3D"), obs.deltaR3D); - fRegistry.fill(HIST(base) + HIST("hKt"), obs.kt); - + if (doMCQA) { + fRegistryPairMC.fill(HIST(base) + HIST("hDEtaDPhi"), obs.deta, obs.dphi); + fRegistryPairMC.fill(HIST(base) + HIST("hQinv"), obs.qinv); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaEta"), obs.deta); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaPhi"), obs.dphi); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR"), obs.deltaR); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaZ"), obs.deltaZ); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR3D"), obs.deltaR3D); + fRegistryPairMC.fill(HIST(base) + HIST("hKt"), obs.kt); + } + if (doSparse) + fRegistryPairMC.fill(HIST(base) + HIST("hSparse_DEtaDPhi_kT"), obs.deta, obs.dphi, obs.kt); constexpr auto summaryDir = IsMix ? "Pair/mix/MC/" : "Pair/same/MC/"; - const int typeIdx = static_cast(TruthT); - fRegistry.fill(HIST(summaryDir) + HIST("hTruthTypeVsQinv"), obs.qinv, typeIdx); - fRegistry.fill(HIST(summaryDir) + HIST("hTruthTypeVsKt"), obs.kt, typeIdx); + if (doMCQA) { + fRegistryPairMC.fill(HIST(summaryDir) + HIST("hTruthTypeVsQinv"), obs.qinv, static_cast(TruthT)); + fRegistryPairMC.fill(HIST(summaryDir) + HIST("hTruthTypeVsKt"), obs.kt, static_cast(TruthT)); + } } template - inline void fillMCPairQA(PairTruthType truthType, PairQAObservables const& obs) + inline void fillMCPairQA(PairTruthType truthType, PairQAObservables const& obs, bool doSparse, bool doMCQA) { switch (truthType) { case PairTruthType::TrueTrueDistinct: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::TrueTrueSamePhoton: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::SharedMcLeg: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::TrueFake: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::FakeFake: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; case PairTruthType::Pi0Daughters: - fillMCPairQATyped(obs); + fillMCPairQATyped(obs, doSparse, doMCQA); break; default: break; @@ -1247,12 +1302,23 @@ struct photonhbt { return "Pair/mix/MC/Pi0Daughters/"; } }(); - - fRegistry.fill(HIST(base) + HIST("hDeltaRVsQinv"), obs.qinv, obs.deltaR); - fRegistry.fill(HIST(base) + HIST("hDeltaZVsQinv"), obs.qinv, obs.deltaZ); - fRegistry.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); - fRegistry.fill(HIST(base) + HIST("hDEtaDPhiVsQinv"), obs.deta, obs.dphi, obs.qinv); - fRegistry.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaRVsQinv"), obs.qinv, obs.deltaR); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaZVsQinv"), obs.qinv, obs.deltaZ); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR3DVsQinv"), obs.qinv, obs.deltaR3D); + const bool fillDRDZ = ((TruthT == PairTruthType::TrueTrueDistinct) ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mcthruth_sparse.cfgFillDRDZQinvTrueTrueSamePhoton.value + : (TruthT == PairTruthType::SharedMcLeg) ? mcthruth_sparse.cfgFillDRDZQinvSharedMcLeg.value + : (TruthT == PairTruthType::TrueFake) ? mcthruth_sparse.cfgFillDRDZQinvTrueFake.value + : (TruthT == PairTruthType::FakeFake) ? mcthruth_sparse.cfgFillDRDZQinvFakeFake.value + : mcthruth_sparse.cfgFillDRDZQinvPi0Daughters.value); + if (fillDRDZ) + fRegistryPairMC.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); + const bool enabled = ((TruthT == PairTruthType::TrueTrueDistinct) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value + : (TruthT == PairTruthType::SharedMcLeg) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value + : (TruthT == PairTruthType::TrueFake) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvTrueFake.value + : (TruthT == PairTruthType::FakeFake) ? mcthruth_sparse.cfgFillDEtaDPhiVsQinvFakeFake.value + : mcthruth_sparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value); + if (enabled) + fRegistryPairMC.fill(HIST(base) + HIST("hDEtaDPhiVsQinv"), obs.deta, obs.dphi, obs.qinv); } template @@ -1281,6 +1347,36 @@ struct photonhbt { break; } } + template + void fillPairHistogramNoLabel(TCollision const& /*collision*/, + ROOT::Math::PtEtaPhiMVector v1, + ROOT::Math::PtEtaPhiMVector v2) + { + float rndm = std::pow(-1, dist01(engine) % 2); + auto k12 = 0.5 * (v1 + v2); + float kt = k12.Pt(); + float qinv = -(((v1 - v2) * rndm).M()); + ROOT::Math::XYZVector uv_out(k12.Px() / k12.Pt(), k12.Py() / k12.Pt(), 0); + ROOT::Math::XYZVector uv_long(0, 0, 1); + ROOT::Math::XYZVector uv_side = uv_out.Cross(uv_long); + ROOT::Math::PxPyPzEVector v1c(v1), v2c(v2); + float beta_z = (v1 + v2).Beta() * std::cos((v1 + v2).Theta()); + ROOT::Math::Boost bst_z(0, 0, -beta_z); + auto q12_lcms = bst_z((v1c - v2c) * rndm); + auto q3_lcms = q12_lcms.Vect(); + float qabs_lcms = q3_lcms.R(); + float qout_lcms = q3_lcms.Dot(uv_out); + float qside_lcms = q3_lcms.Dot(uv_side); + float qlong_lcms = q3_lcms.Dot(uv_long); + if (cfgDo3D) { + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_3D"), + std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt); + if (cfgDo2D) + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_2D"), std::fabs(qout_lcms), std::fabs(qinv), kt); + } else { + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_1D"), cfgUseLCMS ? qabs_lcms : qinv, kt); + } + } template epArr = { - collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), - collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; const float ep2 = epArr[cfgEP2EstimatorForMix]; - - // ── Event QA and event cut ──────────────────────────────────────────── fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) continue; o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); + fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - - // ── Event mixing bins ───────────────────────────────────────────────── const float occupancy = (cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange(); const float centForQA = cent[cfgCentEstimator]; - - const int zbin = binOf(ztxBinEdges, collision.posZ()); - const int centbin = binOf(centBinEdges, centForQA); - const int epbin = binOf(epBinEgdes, ep2); - const int occbin = binOf(occBinEdges, occupancy); - + const int zbin = binOf(ztxBinEdges, collision.posZ()), centbin = binOf(centBinEdges, centForQA); + const int epbin = binOf(epBinEgdes, ep2), occbin = binOf(occBinEdges, occupancy); auto keyBin = std::make_tuple(zbin, centbin, epbin, occbin); auto keyDFCollision = std::make_pair(ndf, collision.globalIndex()); - - // ── Slice photons for this collision ────────────────────────────────── auto photons1Coll = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2Coll = photons2.sliceBy(perCollision2, collision.globalIndex()); - - // ── Single-photon QA - if (qaflags.doSinglePhotonQa) { - for (const auto& g : photons1Coll) { - if (!cut1.template IsSelected(g)) - continue; - fillSinglePhotonQAStep<0>(g); - } - } - - std::unordered_set photonIdsAfterDRCosOA; - std::unordered_set photonIdsAfterRZ; - std::unordered_set photonIdsAfterEllipse; - - // ── Same-event pair loop ────────────────────────────────────────────── + if (qaflags.doSinglePhotonQa) + for (const auto& g : photons1Coll) + if (cut1.template IsSelected(g)) + fillSinglePhotonQAStep<0>(g); + std::unordered_set idsAfterDR, idsAfterRZ, idsAfterEllipse; for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photons1Coll, photons2Coll))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) continue; - - const auto pos1 = g1.template posTrack_as(); - const auto ele1 = g1.template negTrack_as(); - const auto pos2 = g2.template posTrack_as(); - const auto ele2 = g2.template negTrack_as(); - if (pos1.trackId() == pos2.trackId() || - pos1.trackId() == ele2.trackId() || - ele1.trackId() == pos2.trackId() || - ele1.trackId() == ele2.trackId()) + const auto pos1 = g1.template posTrack_as(), ele1 = g1.template negTrack_as(); + const auto pos2 = g2.template posTrack_as(), ele2 = g2.template negTrack_as(); + if (pos1.trackId() == pos2.trackId() || pos1.trackId() == ele2.trackId() || + ele1.trackId() == pos2.trackId() || ele1.trackId() == ele2.trackId()) continue; - auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - - const bool doQA = passQinvQAGate(obs.qinv); - const bool doFullRange = passQinvFullRangeGate(obs.qinv); - - // ── QA: Before any pair cut ─────────────────────────────────────── + const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<0, 0>(obs, centForQA, occupancy); - - // ── Cut 1: dr/cosOA ─────────────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeDeltaRCosOA<0>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/same/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) continue; - - photonIdsAfterDRCosOA.insert(g1.globalIndex()); - photonIdsAfterDRCosOA.insert(g2.globalIndex()); - - // ── QA: After dr/cosOA cut ──────────────────────────────────────── + idsAfterDR.insert(g1.globalIndex()); + idsAfterDR.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 1>(obs, centForQA, occupancy); - - // ── Cut 2: R/Z geometry ─────────────────────────────────────────── if (!passRZCut(obs.deltaR, obs.deltaZ)) continue; - - photonIdsAfterRZ.insert(g1.globalIndex()); - photonIdsAfterRZ.insert(g2.globalIndex()); - - // ── QA: After R/Z cut ───────────────────────────────────────────── + idsAfterRZ.insert(g1.globalIndex()); + idsAfterRZ.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 2>(obs, centForQA, occupancy); - - // ── Cut 3: Ellipse in (DeltaEta, DeltaPhi) ──────────────────────── if (isInsideEllipse(obs.deta, obs.dphi)) continue; - - photonIdsAfterEllipse.insert(g1.globalIndex()); - photonIdsAfterEllipse.insert(g2.globalIndex()); - - // ── QA: After ellipse cut = final accepted pairs ────────────────── + idsAfterEllipse.insert(g1.globalIndex()); + idsAfterEllipse.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 3>(obs, centForQA, occupancy); - - if (doFullRange) + if (doFR) fillFullRangeQA<0>(obs, centForQA, occupancy); - fillPairHistogram<0>(collision, obs.v1, obs.v2, 1.f); ndiphoton++; - auto addToPool = [&](auto const& g) { if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { - EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); - gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); - emh1->AddTrackToEventPool(keyDFCollision, gtmp); - } - }; + EMPair gtmp(g.pt(),g.eta(),g.phi(),0.f); gtmp.setConversionPointXYZ(g.vx(),g.vy(),g.vz()); + emh1->AddTrackToEventPool(keyDFCollision,gtmp); + } }; addToPool(g1); addToPool(g2); - } // end same-event pair loop - - if (qaflags.doSinglePhotonQa) { - for (const auto& g : photons1Coll) { - if (!cut1.template IsSelected(g)) - continue; - const int gid = g.globalIndex(); - if (photonIdsAfterDRCosOA.count(gid)) - fillSinglePhotonQAStep<1>(g); - if (photonIdsAfterRZ.count(gid)) - fillSinglePhotonQAStep<2>(g); - if (photonIdsAfterEllipse.count(gid)) - fillSinglePhotonQAStep<3>(g); - } } - + if (qaflags.doSinglePhotonQa) + for (const auto& g : photons1Coll) + if (cut1.template IsSelected(g)) { + const int gid = g.globalIndex(); + if (idsAfterDR.count(gid)) + fillSinglePhotonQAStep<1>(g); + if (idsAfterRZ.count(gid)) + fillSinglePhotonQAStep<2>(g); + if (idsAfterEllipse.count(gid)) + fillSinglePhotonQAStep<3>(g); + } usedPhotonIdsPerCol.clear(); - if (!cfgDoMix || ndiphoton == 0) continue; - auto selectedPhotons = emh1->GetTracksPerCollision(keyDFCollision); auto poolIDs = emh1->GetCollisionIdsFromEventPool(keyBin); - for (const auto& mixID : poolIDs) { - // skip same event if (mixID.second == collision.globalIndex() && mixID.first == ndf) continue; - const uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; - const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - - std::min(collision.globalBC(), bcMix); + const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - std::min(collision.globalBC(), bcMix); fRegistry.fill(HIST("Pair/mix/hDiffBC"), diffBC); if (diffBC < ndiffBCMix) continue; - auto poolPhotons = emh1->GetTracksPerCollision(mixID); - - for (const auto& g1 : selectedPhotons) { + for (const auto& g1 : selectedPhotons) for (const auto& g2 : poolPhotons) { - auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - - const bool doQA = passQinvQAGate(obs.qinv); - const bool doFullRange = passQinvFullRangeGate(obs.qinv); - - // ── QA: Before any pair cut ───────────────────────────────── + const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<1, 0>(obs, centForQA, occupancy); - - // ── Cut 1: dr/cosOA ───────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeDeltaRCosOA<1>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/mix/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) continue; - - // ── QA: After dr/cosOA cut ────────────────────────────────── if (doQA) fillPairQAStep<1, 1>(obs, centForQA, occupancy); - - // ── Cut 2: R/Z geometry ───────────────────────────────────── if (!passRZCut(obs.deltaR, obs.deltaZ)) continue; - - // ── QA: After R/Z cut ─────────────────────────────────────── if (doQA) fillPairQAStep<1, 2>(obs, centForQA, occupancy); - - // ── Cut 3: Ellipse ────────────────────────────────────────── if (isInsideEllipse(obs.deta, obs.dphi)) continue; - - // ── QA: After ellipse cut ─────────────────────────────────── if (doQA) fillPairQAStep<1, 3>(obs, centForQA, occupancy); - - // ── Full-range fills ──────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeQA<1>(obs, centForQA, occupancy); - - // ── Fill CF histogram — always ────────────────────────────── fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); } - } - } // end mixed-event loop - + } if (ndiphoton > 0) { emh1->AddCollisionIdAtLast(keyBin, keyDFCollision); emh2->AddCollisionIdAtLast(keyBin, keyDFCollision); mapMixedEventIdToGlobalBC[keyDFCollision] = collision.globalBC(); } - } // end collision loop - } - - using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler< - std::tuple, - std::pair, - EMPair>; - - MyEMH* emh1 = nullptr; - MyEMH* emh2 = nullptr; - - std::unordered_set usedPhotonIdsPerCol; - std::map, uint64_t> mapMixedEventIdToGlobalBC; - - SliceCache cache; - Preslice perCollisionPCM = aod::v0photonkf::pmeventId; - - Filter collisionFilterCentrality = - (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || - (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || - (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); - Filter collisionFilterOccupancyTrack = - eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && - o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilterOccupancyFT0c = - eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && - o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - - using FilteredMyCollisions = soa::Filtered; - - int ndf = 0; - - void processAnalysis(FilteredMyCollisions const& collisions, - MyV0Photons const& v0photons, - aod::V0Legs const& v0legs) - { - runPairing(collisions, - v0photons, v0photons, - v0legs, v0legs, - perCollisionPCM, perCollisionPCM, - fV0PhotonCut, fV0PhotonCut); - ndf++; + } } - PROCESS_SWITCH(photonhbt, processAnalysis, "pairing for analysis", true); - - template - void runPairingMC(TCollisions const& collisions, - TPhotons const& photons, - TLegs const& /*legs*/, - TMCParticles const& mcParticles, - TPreslice const& perCollision, - TCut const& cut) + template + void runPairingMC(TCollisions const& collisions, TPhotons const& photons, + TLegs const& /*legs*/, TMCParticles const& mcParticles, + TPreslice const& perCollision, TCut const& cut) { for (const auto& collision : collisions) { initCCDB(collision); int ndiphoton = 0; - const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) continue; - - const std::array epArr = { - collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), - collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; const float ep2 = epArr[cfgEP2EstimatorForMix]; - fRegistry.fill(HIST("Event/before/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<0>(&fRegistry, collision, 1.f); if (!fEMEventCut.IsSelected(collision)) continue; - o2::aod::pwgem::photonmeson::utils::eventhistogram::fillEventInfo<1>(&fRegistry, collision, 1.f); - fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); // accepted - fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); // accepted + fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0); + fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0); fRegistry.fill(HIST("Event/after/hEP2_CentFT0C_forMix"), collision.centFT0C(), ep2); - const float occupancy = (cfgOccupancyEstimator == 1) ? static_cast(collision.trackOccupancyInTimeRange()) : collision.ft0cOccupancyInTimeRange(); const float centForQA = cent[cfgCentEstimator]; - - const int zbin = binOf(ztxBinEdges, collision.posZ()); - const int centbin = binOf(centBinEdges, centForQA); - const int epbin = binOf(epBinEgdes, ep2); - const int occbin = binOf(occBinEdges, occupancy); - + const int zbin = binOf(ztxBinEdges, collision.posZ()), centbin = binOf(centBinEdges, centForQA); + const int epbin = binOf(epBinEgdes, ep2), occbin = binOf(occBinEdges, occupancy); auto keyBin = std::make_tuple(zbin, centbin, epbin, occbin); auto keyDFCollision = std::make_pair(ndf, collision.globalIndex()); - auto photonsColl = photons.sliceBy(perCollision, collision.globalIndex()); - - if (qaflags.doSinglePhotonQa) { - for (const auto& g : photonsColl) { - if (!cut.template IsSelected(g)) - continue; - fillSinglePhotonQAStep<0>(g); - } - } - - std::unordered_set photonIdsAfterDRCosOA; - std::unordered_set photonIdsAfterRZ; - std::unordered_set photonIdsAfterEllipse; - - // ── Same-event pair loop ────────────────────────────────────────────── + if (qaflags.doSinglePhotonQa) + for (const auto& g : photonsColl) + if (cut.template IsSelected(g)) + fillSinglePhotonQAStep<0>(g); + std::unordered_set idsAfterDR, idsAfterRZ, idsAfterEllipse; for (const auto& [g1, g2] : combinations(CombinationsStrictlyUpperIndexPolicy(photonsColl, photonsColl))) { - if (!cut.template IsSelected(g1) || - !cut.template IsSelected(g2)) + if (!cut.template IsSelected(g1) || !cut.template IsSelected(g2)) continue; - - const auto pos1 = g1.template posTrack_as(); - const auto ele1 = g1.template negTrack_as(); - const auto pos2 = g2.template posTrack_as(); - const auto ele2 = g2.template negTrack_as(); - if (pos1.trackId() == pos2.trackId() || - pos1.trackId() == ele2.trackId() || - ele1.trackId() == pos2.trackId() || - ele1.trackId() == ele2.trackId()) + const auto pos1 = g1.template posTrack_as(), ele1 = g1.template negTrack_as(); + const auto pos2 = g2.template posTrack_as(), ele2 = g2.template negTrack_as(); + if (pos1.trackId() == pos2.trackId() || pos1.trackId() == ele2.trackId() || + ele1.trackId() == pos2.trackId() || ele1.trackId() == ele2.trackId()) continue; - - // ── MC truth classification ─────────────────────────────────────── const auto mc1 = buildPhotonMCInfo(g1, mcParticles); const auto mc2 = buildPhotonMCInfo(g2, mcParticles); auto truthType = classifyPairTruth(mc1, mc2); - if (truthType == PairTruthType::TrueTrueDistinct && - isPi0DaughterPair(mc1, mc2, mcParticles)) + if (truthType == PairTruthType::TrueTrueDistinct && isPi0DaughterPair(mc1, mc2, mcParticles)) truthType = PairTruthType::Pi0Daughters; - auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - - const bool doQA = passQinvQAGate(obs.qinv); - const bool doFullRange = passQinvFullRangeGate(obs.qinv); - - // ── Pair QA: Before ─────────────────────────────────────────────── + const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<0, 0>(obs, centForQA, occupancy); - - // ── Cut 1: dr/cosOA ─────────────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeDeltaRCosOA<0>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/same/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) continue; - - photonIdsAfterDRCosOA.insert(g1.globalIndex()); - photonIdsAfterDRCosOA.insert(g2.globalIndex()); + idsAfterDR.insert(g1.globalIndex()); + idsAfterDR.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 1>(obs, centForQA, occupancy); - - // ── Cut 2: R/Z geometry ─────────────────────────────────────────── if (!passRZCut(obs.deltaR, obs.deltaZ)) continue; - - photonIdsAfterRZ.insert(g1.globalIndex()); - photonIdsAfterRZ.insert(g2.globalIndex()); + idsAfterRZ.insert(g1.globalIndex()); + idsAfterRZ.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 2>(obs, centForQA, occupancy); - - // ── Cut 3: Ellipse ──────────────────────────────────────────────── if (isInsideEllipse(obs.deta, obs.dphi)) continue; - - photonIdsAfterEllipse.insert(g1.globalIndex()); - photonIdsAfterEllipse.insert(g2.globalIndex()); + idsAfterEllipse.insert(g1.globalIndex()); + idsAfterEllipse.insert(g2.globalIndex()); if (doQA) fillPairQAStep<0, 3>(obs, centForQA, occupancy); - - // ── Full-range fills ────────────────────────────────────────────── - if (doFullRange) + if (doFR) fillFullRangeQA<0>(obs, centForQA, occupancy); - - // ── Fill inclusive CF — always ──────────────────────────────────── fillPairHistogram<0>(collision, obs.v1, obs.v2, 1.f); ndiphoton++; + if (!mc1.hasMC || !mc2.hasMC) { + fillPairHistogramNoLabel(collision, obs.v1, obs.v2); + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/hDEtaDPhi"), obs.deta, obs.dphi); + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/hKt"), obs.kt); + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/hQinv"), obs.qinv); + } else { + const bool doMCQA = passQinvMCQAGate(obs.qinv); + fillMCPairQA(truthType, obs, doQA, doMCQA); + if (doFR) + fillMCPairQAFullRange(truthType, obs); + const bool isTruePair = (truthType == PairTruthType::TrueTrueDistinct || + truthType == PairTruthType::TrueTrueSamePhoton || + truthType == PairTruthType::Pi0Daughters); + if (isTruePair) { + fRegistryPairMC.fill(HIST("Pair/same/MC/hDEtaDPhi_truePairs"), obs.deta, obs.dphi); + if (doMCQA) { + fRegistryPairMC.fill(HIST("Pair/same/MC/hSparse_DEtaDPhi_kT_truePairs"), obs.deta, obs.dphi, obs.kt); + fRegistryPairMC.fill(HIST("Pair/same/MC/hSparse_DEtaDPhi_qinv_truePairs"), obs.deta, obs.dphi, obs.qinv); + } + } else { + fRegistryPairMC.fill(HIST("Pair/same/MC/hDEtaDPhi_fakePairs"), obs.deta, obs.dphi); + if (doMCQA) { + fRegistryPairMC.fill(HIST("Pair/same/MC/hSparse_DEtaDPhi_kT_fakePairs"), obs.deta, obs.dphi, obs.kt); + fRegistryPairMC.fill(HIST("Pair/same/MC/hSparse_DEtaDPhi_qinv_fakePairs"), obs.deta, obs.dphi, obs.qinv); + } + } - if (doQA) - fillMCPairQA(truthType, obs); - if (doFullRange) - fillMCPairQAFullRange(truthType, obs); - switch (truthType) { - case PairTruthType::TrueTrueDistinct: - fillPairHistogramMC<0, PairTruthType::TrueTrueDistinct>(collision, obs.v1, obs.v2); - break; - case PairTruthType::TrueTrueSamePhoton: - fillPairHistogramMC<0, PairTruthType::TrueTrueSamePhoton>(collision, obs.v1, obs.v2); - break; - case PairTruthType::SharedMcLeg: - fillPairHistogramMC<0, PairTruthType::SharedMcLeg>(collision, obs.v1, obs.v2); - break; - case PairTruthType::TrueFake: - fillPairHistogramMC<0, PairTruthType::TrueFake>(collision, obs.v1, obs.v2); - break; - case PairTruthType::FakeFake: - fillPairHistogramMC<0, PairTruthType::FakeFake>(collision, obs.v1, obs.v2); - break; - case PairTruthType::Pi0Daughters: - fillPairHistogramMC<0, PairTruthType::Pi0Daughters>(collision, obs.v1, obs.v2); - break; - default: - break; + switch (truthType) { + case PairTruthType::TrueTrueDistinct: + fillPairHistogramMC<0, PairTruthType::TrueTrueDistinct>(collision, obs.v1, obs.v2); + break; + case PairTruthType::TrueTrueSamePhoton: + fillPairHistogramMC<0, PairTruthType::TrueTrueSamePhoton>(collision, obs.v1, obs.v2); + break; + case PairTruthType::SharedMcLeg: + fillPairHistogramMC<0, PairTruthType::SharedMcLeg>(collision, obs.v1, obs.v2); + break; + case PairTruthType::TrueFake: + fillPairHistogramMC<0, PairTruthType::TrueFake>(collision, obs.v1, obs.v2); + break; + case PairTruthType::FakeFake: + fillPairHistogramMC<0, PairTruthType::FakeFake>(collision, obs.v1, obs.v2); + break; + case PairTruthType::Pi0Daughters: + fillPairHistogramMC<0, PairTruthType::Pi0Daughters>(collision, obs.v1, obs.v2); + break; + default: + break; + } } auto addToPool = [&](auto const& g) { if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { - EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); - gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); - emh1->AddTrackToEventPool(keyDFCollision, gtmp); - } - }; + EMPair gtmp(g.pt(),g.eta(),g.phi(),0.f); gtmp.setConversionPointXYZ(g.vx(),g.vy(),g.vz()); + emh1->AddTrackToEventPool(keyDFCollision,gtmp); + } }; addToPool(g1); addToPool(g2); - } // end same-event pair loop - - if (qaflags.doSinglePhotonQa) { - for (const auto& g : photonsColl) { - if (!cut.template IsSelected(g)) - continue; - const int gid = g.globalIndex(); - if (photonIdsAfterDRCosOA.count(gid)) - fillSinglePhotonQAStep<1>(g); - if (photonIdsAfterRZ.count(gid)) - fillSinglePhotonQAStep<2>(g); - if (photonIdsAfterEllipse.count(gid)) - fillSinglePhotonQAStep<3>(g); - } } - + if (qaflags.doSinglePhotonQa) + for (const auto& g : photonsColl) + if (cut.template IsSelected(g)) { + const int gid = g.globalIndex(); + if (idsAfterDR.count(gid)) + fillSinglePhotonQAStep<1>(g); + if (idsAfterRZ.count(gid)) + fillSinglePhotonQAStep<2>(g); + if (idsAfterEllipse.count(gid)) + fillSinglePhotonQAStep<3>(g); + } usedPhotonIdsPerCol.clear(); - if (!cfgDoMix || ndiphoton == 0) continue; - auto selectedPhotons = emh1->GetTracksPerCollision(keyDFCollision); auto poolIDs = emh1->GetCollisionIdsFromEventPool(keyBin); - for (const auto& mixID : poolIDs) { if (mixID.second == collision.globalIndex() && mixID.first == ndf) continue; const uint64_t bcMix = mapMixedEventIdToGlobalBC[mixID]; - const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - - std::min(collision.globalBC(), bcMix); + const uint64_t diffBC = std::max(collision.globalBC(), bcMix) - std::min(collision.globalBC(), bcMix); fRegistry.fill(HIST("Pair/mix/hDiffBC"), diffBC); if (diffBC < ndiffBCMix) continue; - auto poolPhotons = emh1->GetTracksPerCollision(mixID); - for (const auto& g1 : selectedPhotons) { + for (const auto& g1 : selectedPhotons) for (const auto& g2 : poolPhotons) { auto obs = buildPairQAObservables(g1, g2); if (!obs.valid) continue; - const bool doQA = passQinvQAGate(obs.qinv); - const bool doFullRange = passQinvFullRangeGate(obs.qinv); + const bool doQA = passQinvQAGate(obs.qinv), doFR = passQinvFullRangeGate(obs.qinv); if (doQA) fillPairQAStep<1, 0>(obs, centForQA, occupancy); - if (doFullRange) + if (doFR) fillFullRangeDeltaRCosOA<1>(obs.qinv, obs.drOverCosOA); fRegistry.fill(HIST("Pair/mix/hDeltaRCosOA"), obs.drOverCosOA); if (obs.drOverCosOA < ggpaircuts.cfgMinDRCosOA) @@ -1797,36 +1719,336 @@ struct photonhbt { continue; if (doQA) fillPairQAStep<1, 3>(obs, centForQA, occupancy); - if (doFullRange) + if (doFR) fillFullRangeQA<1>(obs, centForQA, occupancy); fillPairHistogram<1>(collision, obs.v1, obs.v2, 1.f); } - } } - if (ndiphoton > 0) { emh1->AddCollisionIdAtLast(keyBin, keyDFCollision); emh2->AddCollisionIdAtLast(keyBin, keyDFCollision); mapMixedEventIdToGlobalBC[keyDFCollision] = collision.globalBC(); } - } // end collision loop + } + } + template + void runTruthEfficiency(TCollisions const& collisions, + TPhotons const& v0photons, + TLegs const& v0legs, + TMCParticles const& emmcParticles, + TMCEvents const& /*mcEvents*/, + TPresliceMCParts const& perMCCollision, + TPresliceLegs const& perCollisionLegs, + TCut const& cut) + { + auto wrapPhi = [](float dphi) -> float { + return RecoDecay::constrainAngle(dphi, -o2::constants::math::PI); + }; + + std::unordered_set mcIdsWithAnyV0Leg; + mcIdsWithAnyV0Leg.reserve(v0legs.size() * 2); + for (const auto& leg : v0legs) { + if (leg.has_emmcparticle()) + mcIdsWithAnyV0Leg.insert(leg.emmcparticleId()); + } + + for (const auto& collision : collisions) { + if (!fEMEventCut.IsSelected(collision)) + continue; + const float cent[3] = {collision.centFT0M(), collision.centFT0A(), collision.centFT0C()}; + if (cent[cfgCentEstimator] < cfgCentMin || cfgCentMax < cent[cfgCentEstimator]) + continue; + if (!collision.has_emmcevent()) + continue; + + const int64_t thisCollisionId = collision.globalIndex(); + const int mcEventId = collision.template emmcevent_as().globalIndex(); + + auto recoPhotonsColl = v0photons.sliceBy(perCollisionPCM, thisCollisionId); + auto emmcPartsColl = emmcParticles.sliceBy(perMCCollision, mcEventId); + auto legsColl = v0legs.sliceBy(perCollisionLegs, thisCollisionId); + + std::unordered_set legIdsThisCollision; + legIdsThisCollision.reserve(legsColl.size()); + for (const auto& leg : legsColl) { + if (leg.has_emmcparticle()) + legIdsThisCollision.insert(leg.emmcparticleId()); + } + + std::unordered_map> crossBuildMap; + + struct PhotonRecoInfo { + bool hasV0 = false, passesCut = false; + }; + std::unordered_map gammaRecoMap; + gammaRecoMap.reserve(recoPhotonsColl.size()); + + for (const auto& g : recoPhotonsColl) { + const auto pos = g.template posTrack_as(); + const auto neg = g.template negTrack_as(); + const bool wrongEvt = (pos.collisionId() != thisCollisionId || neg.collisionId() != thisCollisionId); + if (wrongEvt) + continue; + if (!pos.has_emmcparticle() || !neg.has_emmcparticle()) + continue; + const auto mcPos = pos.template emmcparticle_as(); + const auto mcNeg = neg.template emmcparticle_as(); + if (!mcPos.has_mothers() || !mcNeg.has_mothers()) + continue; + const int posMotherId = mcPos.mothersIds()[0], negMotherId = mcNeg.mothersIds()[0]; + if (posMotherId != negMotherId) { + const auto posMother = emmcParticles.iteratorAt(posMotherId); + const auto negMother = emmcParticles.iteratorAt(negMotherId); + if (posMother.pdgCode() == 22 && negMother.pdgCode() == 22) { + crossBuildMap[posMotherId].insert(negMotherId); + crossBuildMap[negMotherId].insert(posMotherId); + } + continue; + } + const int gammaId = posMotherId; + if (emmcParticles.iteratorAt(gammaId).pdgCode() != 22) + continue; + const bool passes = cut.template IsSelected, TLegs>(g); + auto& info = gammaRecoMap[gammaId]; + info.hasV0 = true; + info.passesCut = info.passesCut || passes; + } + + struct TruthGamma { + int id = -1, posId = -1, negId = -1; + float eta = 0.f, phi = 0.f, pt = 0.f, rTrue = -1.f, legDRtrue = -1.f; + }; + std::vector trueGammas; + trueGammas.reserve(32); + + for (const auto& g : emmcPartsColl) { + if (g.pdgCode() != 22) + continue; + if (!g.isPhysicalPrimary() && !g.producedByGenerator()) + continue; + if (std::fabs(g.eta()) > pcmcuts.cfgMaxEtaV0.value) + continue; + if (g.pt() < pcmcuts.cfgMinPtV0.value) + continue; + if (!g.has_daughters()) + continue; + int posId = -1, negId = -1; + float rTrue = -1.f; + for (const int dId : g.daughtersIds()) { + if (dId < 0) + continue; + const auto d = emmcParticles.iteratorAt(dId); + if (d.pdgCode() == -11) { + posId = dId; + rTrue = std::sqrt(d.vx() * d.vx() + d.vy() * d.vy()); + } else if (d.pdgCode() == 11) + negId = dId; + } + if (posId < 0 || negId < 0) + continue; + const auto mcPosE = emmcParticles.iteratorAt(posId); + const auto mcNegE = emmcParticles.iteratorAt(negId); + const float deTrE = static_cast(mcPosE.eta() - mcNegE.eta()); + const float dpTrE = wrapPhi(static_cast(mcPosE.phi() - mcNegE.phi())); + const float legDRt = std::sqrt(deTrE * deTrE + dpTrE * dpTrE); + trueGammas.push_back({static_cast(g.globalIndex()), posId, negId, + static_cast(g.eta()), static_cast(g.phi()), + static_cast(g.pt()), rTrue, legDRt}); + } + + { + int nBad = 0; + for (const auto& tg : trueGammas) { + const auto it = gammaRecoMap.find(tg.id); + if (it != gammaRecoMap.end() && it->second.hasV0 && + (mcIdsWithAnyV0Leg.count(tg.posId) == 0 || mcIdsWithAnyV0Leg.count(tg.negId) == 0)) + ++nBad; + } + fRegistryMC.fill(HIST("MC/TruthAO2D/hStageConsistency"), static_cast(nBad)); + } + + for (const auto& tg : trueGammas) { + const bool posFound = legIdsThisCollision.count(tg.posId) > 0; + const bool negFound = legIdsThisCollision.count(tg.negId) > 0; + for (const auto& [legId, legFound] : + std::initializer_list>{{tg.posId, posFound}, {tg.negId, negFound}}) { + if (legId < 0) + continue; + if (legFound) { + fRegistryMC.fill(HIST("MC/LegDiag/hLegDRtrue_vs_pt_legFound"), tg.pt, tg.legDRtrue); + if (tg.rTrue >= 0.f) + fRegistryMC.fill(HIST("MC/LegDiag/hRconv_legFound_vs_pt"), tg.pt, tg.rTrue); + } else { + fRegistryMC.fill(HIST("MC/LegDiag/hLegDRtrue_vs_pt_legMissing"), tg.pt, tg.legDRtrue); + if (tg.rTrue >= 0.f) + fRegistryMC.fill(HIST("MC/LegDiag/hRconv_legMissing_vs_pt"), tg.pt, tg.rTrue); + } + } + } + + for (size_t i = 0; i < trueGammas.size(); ++i) { + for (size_t j = i + 1; j < trueGammas.size(); ++j) { + const auto& g1 = trueGammas[i]; + const auto& g2 = trueGammas[j]; + const float deta = g1.eta - g2.eta; + const float dphi = wrapPhi(g1.phi - g2.phi); + const float px1 = g1.pt * std::cos(g1.phi), py1 = g1.pt * std::sin(g1.phi); + const float px2 = g2.pt * std::cos(g2.phi), py2 = g2.pt * std::sin(g2.phi); + const float kt = 0.5f * std::sqrt((px1 + px2) * (px1 + px2) + (py1 + py2) * (py1 + py2)); + + if (cfgMCMinKt > 0.f && kt < cfgMCMinKt) + continue; + if (cfgMCMaxKt > 0.f && kt > cfgMCMaxKt) + continue; + + const float e1 = g1.pt * std::cosh(g1.eta), e2 = g2.pt * std::cosh(g2.eta); + const float dot = e1 * e2 - (px1 * px2 + py1 * py2 + g1.pt * std::sinh(g1.eta) * g2.pt * std::sinh(g2.eta)); + const float qinv_true = std::sqrt(std::max(0.f, 2.f * dot)); + + if (cfgMCMaxQinv > 0.f && qinv_true > cfgMCMaxQinv) + continue; + + auto it1 = gammaRecoMap.find(g1.id), it2 = gammaRecoMap.find(g2.id); + const bool g1Built = (it1 != gammaRecoMap.end()) && it1->second.hasV0; + const bool g2Built = (it2 != gammaRecoMap.end()) && it2->second.hasV0; + const bool g1Sel = (it1 != gammaRecoMap.end()) && it1->second.passesCut; + const bool g2Sel = (it2 != gammaRecoMap.end()) && it2->second.passesCut; + + const bool pairAll4LegsThisColl = + legIdsThisCollision.count(g1.posId) > 0 && legIdsThisCollision.count(g1.negId) > 0 && + legIdsThisCollision.count(g2.posId) > 0 && legIdsThisCollision.count(g2.negId) > 0; + + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_truthConverted"), deta, dphi, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_truthConverted"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_truthConverted"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_truthConverted"), deta, dphi); + if (pairAll4LegsThisColl) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_all4LegsThisColl"), deta, dphi, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_all4LegsThisColl"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_all4LegsThisColl"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_all4LegsThisColl"), deta, dphi); + } + if (g1Built && g2Built) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsBuilt"), deta, dphi, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsBuilt"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_bothPhotonsBuilt"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_bothPhotonsBuilt"), deta, dphi); + } + if (g1Sel && g2Sel) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_qinv_bothPhotonsSelected"), deta, dphi, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hSparse_DEtaDPhi_kT_bothPhotonsSelected"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/TruthAO2D/hQinvVsKt_bothPhotonsSelected"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthAO2D/hDEtaDPhi_bothPhotonsSelected"), deta, dphi); + } + + if (g1.rTrue >= 0.f && g2.rTrue >= 0.f) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hRconv1_vs_Rconv2_truthConverted"), g1.rTrue, g2.rTrue); + if (g1Sel && g2Sel) + fRegistryMC.fill(HIST("MC/TruthAO2D/hRconv1_vs_Rconv2_bothPhotonsSelected"), g1.rTrue, g2.rTrue); + } + const float minRconv = (g1.rTrue >= 0.f && g2.rTrue >= 0.f) ? std::min(g1.rTrue, g2.rTrue) + : (g1.rTrue >= 0.f ? g1.rTrue : g2.rTrue); + if (minRconv >= 0.f) { + fRegistryMC.fill(HIST("MC/TruthAO2D/hMinRconv_vs_kT_truthConverted"), kt, minRconv); + if (g1Sel && g2Sel) + fRegistryMC.fill(HIST("MC/TruthAO2D/hMinRconv_vs_kT_bothPhotonsSelected"), kt, minRconv); + } + + fRegistryMC.fill(HIST("MC/TruthAO2D/hStage_vs_kT"), kt, 0.f); + if (pairAll4LegsThisColl) + fRegistryMC.fill(HIST("MC/TruthAO2D/hStage_vs_kT"), kt, 1.f); + if (g1Built && g2Built) + fRegistryMC.fill(HIST("MC/TruthAO2D/hStage_vs_kT"), kt, 2.f); + if (g1Sel && g2Sel) + fRegistryMC.fill(HIST("MC/TruthAO2D/hStage_vs_kT"), kt, 3.f); + + const auto itCB = crossBuildMap.find(g1.id); + if (itCB != crossBuildMap.end() && itCB->second.count(g2.id) > 0) { + fRegistryMC.fill(HIST("MC/PairCrossBuild/hSparse_DEtaDPhi_kT"), deta, dphi, kt); + fRegistryMC.fill(HIST("MC/PairCrossBuild/hStageOut_vs_kT"), + kt, static_cast((g1Built ? 1 : 0) + (g2Built ? 1 : 0))); + } + + const int nLegsThisColl = + (legIdsThisCollision.count(g1.posId) > 0 ? 1 : 0) + + (legIdsThisCollision.count(g1.negId) > 0 ? 1 : 0) + + (legIdsThisCollision.count(g2.posId) > 0 ? 1 : 0) + + (legIdsThisCollision.count(g2.negId) > 0 ? 1 : 0); + fRegistryMC.fill(HIST("MC/LegDiag/hNLegsPair_vs_kT"), kt, static_cast(nLegsThisColl)); + + for (const auto& [tgRef, legId] : + std::initializer_list, int>>{ + {std::cref(g1), g1.posId}, {std::cref(g1), g1.negId}, {std::cref(g2), g2.posId}, {std::cref(g2), g2.negId}}) { + if (legId < 0 || legIdsThisCollision.count(legId) > 0) + continue; + const auto& tg_parent = tgRef.get(); + const float legPtTrue = static_cast(emmcParticles.iteratorAt(legId).pt()); + fRegistryMC.fill(HIST("MC/LegDiag/hMissingLegPt_vs_kT"), kt, legPtTrue); + if (tg_parent.rTrue >= 0.f) + fRegistryMC.fill(HIST("MC/LegDiag/hMissingLegRconv_vs_kT"), kt, tg_parent.rTrue); + } + } + } + } } + using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler< + std::tuple, std::pair, EMPair>; + + MyEMH* emh1 = nullptr; + MyEMH* emh2 = nullptr; + std::unordered_set usedPhotonIdsPerCol; + std::map, uint64_t> mapMixedEventIdToGlobalBC; + + SliceCache cache; + Preslice perCollisionPCM = aod::v0photonkf::pmeventId; + PresliceUnsorted perCollisionV0Legs = aod::v0leg::collisionId; + PresliceUnsorted perMCCollisionEMMCParts = aod::emmcparticle::emmceventId; + + Filter collisionFilterCentrality = + (cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < cfgCentMax) || + (cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < cfgCentMax) || + (cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < cfgCentMax); + Filter collisionFilterOccupancyTrack = + eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && + o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + Filter collisionFilterOccupancyFT0c = + eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && + o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + + using FilteredMyCollisions = soa::Filtered; + int ndf = 0; + + void processAnalysis(FilteredMyCollisions const& collisions, + MyV0Photons const& v0photons, + aod::V0Legs const& v0legs) + { + runPairing(collisions, v0photons, v0photons, v0legs, v0legs, + perCollisionPCM, perCollisionPCM, fV0PhotonCut, fV0PhotonCut); + ndf++; + } + PROCESS_SWITCH(photonhbt, processAnalysis, "pairing for analysis", true); + void processMC(FilteredMyCollisions const& collisions, MyV0Photons const& v0photons, MyMCV0Legs const& v0legs, aod::EMMCParticles const& mcParticles, - aod::EMMCEvents const& /*mcEvents*/) + aod::EMMCEvents const& mcEvents) { + runPairingMC(collisions, v0photons, v0legs, mcParticles, perCollisionPCM, fV0PhotonCut); + runTruthEfficiency(collisions, v0photons, v0legs, mcParticles, mcEvents, + perMCCollisionEMMCParts, perCollisionV0Legs, fV0PhotonCut); + ndf++; } - - PROCESS_SWITCH(photonhbt, processMC, "pairing with MC truth classification", false); + PROCESS_SWITCH(photonhbt, processMC, "MC CF + truth efficiency maps for CF correction", false); }; -// ============================================================================ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc, TaskName{"photonhbt"})}; diff --git a/PWGEM/PhotonMeson/Utils/EventHistograms.h b/PWGEM/PhotonMeson/Utils/EventHistograms.h index e45409dda9e..249e56d516b 100644 --- a/PWGEM/PhotonMeson/Utils/EventHistograms.h +++ b/PWGEM/PhotonMeson/Utils/EventHistograms.h @@ -28,10 +28,10 @@ namespace o2::aod::pwgem::photonmeson::utils::eventhistogram { -inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) +inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry, bool useWeight = false) { // event info - auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::kTH1D, {{12, 0.5, 12.5}}, false); + auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::kTH1D, {{12, 0.5, 12.5}}, useWeight); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "No TF border"); hCollisionCounter->GetXaxis()->SetBinLabel(3, "No ITS ROF border"); @@ -66,16 +66,16 @@ inline void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110}, "centrality FT0C (%)"}; - fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::kTH1D, {{100, -50, +50}}, false); - fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, false); - fRegistry->add("Event/before/hMultNTracksPVeta1", "hMultNTracksPVeta1; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, false); - fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::kTH2F, {{200, 0, 200000}, {60, 0, 60000}}, false); - fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::kTH1F, {{axis_cent_ft0a}}, false); - fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::kTH1F, {{axis_cent_ft0c}}, false); - fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::kTH1F, {{axis_cent_ft0m}}, false); - fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::kTH2F, {{110, 0, 110}, {500, 0, 5000}}, false); - fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::kTH2F, {{60, 0, 60000}, {500, 0, 5000}}, false); - fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::kTH2F, {{60, 0, 60000}, {2000, 0, 20000}}, false); + fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", o2::framework::kTH1D, {{220, -11, +11}}, useWeight); + fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); + fRegistry->add("Event/before/hMultNTracksPVeta1", "hMultNTracksPVeta1; N_{track} to PV", o2::framework::kTH1F, {{6001, -0.5, 6000.5}}, useWeight); + fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::kTH2F, {{200, 0, 200000}, {60, 0, 60000}}, useWeight); + fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::kTH1F, {{axis_cent_ft0a}}, useWeight); + fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::kTH1F, {{axis_cent_ft0c}}, useWeight); + fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::kTH1F, {{axis_cent_ft0m}}, useWeight); + fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::kTH2F, {{110, 0, 110}, {500, 0, 5000}}, useWeight); + fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::kTH2F, {{60, 0, 60000}, {500, 0, 5000}}, useWeight); + fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::kTH2F, {{60, 0, 60000}, {500, 0, 10000}}, useWeight); fRegistry->addClone("Event/before/", "Event/after/"); } @@ -83,49 +83,49 @@ template void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, float weight = 1.) { const float maxZ = 10.f; - static constexpr std::string_view kEventTypes[2] = {"before/", "after/"}; - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 1.0, weight); + static constexpr std::string_view EventTypes[2] = {"before/", "after/"}; + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 1.0, weight); if (collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 2.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 2.0, weight); } if (collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 3.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 3.0, weight); } if (collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 4.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 4.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 5.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 5.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 6.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 6.0, weight); } if (collision.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 7.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 7.0, weight); } if (collision.sel8()) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 8.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 8.0, weight); } if (std::abs(collision.posZ()) < maxZ) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 9.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 9.0, weight); } - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hZvtx"), collision.posZ(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hZvtx"), collision.posZ(), weight); if (collision.alias_bit(kTVXinEMC)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 10.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 10.0, weight); } if (collision.alias_bit(kEMC7) || collision.alias_bit(kDMC7)) { - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCollisionCounter"), 11.0, weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCollisionCounter"), 11.0, weight); } - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultNTracksPV"), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultNTracksPVeta1"), collision.multNTracksPVeta1(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultFT0"), collision.multFT0A(), collision.multFT0C(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCentFT0A"), collision.centFT0A(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCentFT0C"), collision.centFT0C(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCentFT0M"), collision.centFT0M(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hCentFT0CvsMultNTracksPV"), collision.centFT0C(), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultFT0CvsMultNTracksPV"), collision.multFT0C(), collision.multNTracksPV(), weight); - fRegistry->fill(HIST("Event/") + HIST(kEventTypes[ev_id]) + HIST("hMultFT0CvsOccupancy"), collision.multFT0C(), collision.trackOccupancyInTimeRange(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultNTracksPV"), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultNTracksPVeta1"), collision.multNTracksPVeta1(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0"), collision.multFT0A(), collision.multFT0C(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0A"), collision.centFT0A(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0C"), collision.centFT0C(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0M"), collision.centFT0M(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hCentFT0CvsMultNTracksPV"), collision.centFT0C(), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0CvsMultNTracksPV"), collision.multFT0C(), collision.multNTracksPV(), weight); + fRegistry->fill(HIST("Event/") + HIST(EventTypes[ev_id]) + HIST("hMultFT0CvsOccupancy"), collision.multFT0C(), collision.trackOccupancyInTimeRange(), weight); } } // namespace o2::aod::pwgem::photonmeson::utils::eventhistogram diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx index 117fc633098..b03c9bf6952 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorChic.cxx @@ -22,11 +22,11 @@ #include "ALICE3/DataModel/ECAL.h" #include "Common/Core/trackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/V0.h" +#include +#include +#include +#include +#include #include #include @@ -44,7 +44,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// Reconstruction of Chic candidates struct HfCandidateCreatorChic { diff --git a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx index ee6317aaa27..f0dfb8d761c 100644 --- a/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateCreatorX.cxx @@ -22,11 +22,11 @@ #include "Common/Core/trackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/V0.h" +#include +#include +#include +#include +#include #include #include @@ -44,7 +44,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// Reconstruction of X candidates struct HfCandidateCreatorX { diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx index fab70fd5eb5..0c4b37e21c4 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorChicToJpsiGamma.cxx @@ -20,9 +20,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx index 0de3e010c44..5fb93e341f5 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Barrel.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx index 00ef9b7d673..ab2e05c16e8 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0Alice3Forward.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx index 7a8d6111ee0..474d0eda059 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorD0ParametrizedPid.cxx @@ -21,9 +21,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx index 5ca50181673..40f8aee3e01 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorJpsi.cxx @@ -24,8 +24,8 @@ #include "ALICE3/DataModel/RICH.h" #include "Common/Core/TrackSelectorPID.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" +#include +#include #include @@ -59,7 +59,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(isAlice3); } -#include "Framework/runDataProcessing.h" +#include /// Struct for applying J/ψ → e+ e−, μ+ μ− selection cuts struct HfCandidateSelectorJpsi { diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx index 509ba9bb813..1844f315f28 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcAlice3.cxx @@ -22,9 +22,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx index 6bcc7fc438c..5fbde221894 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorLcParametrizedPid.cxx @@ -22,9 +22,9 @@ #include "ALICE3/DataModel/RICH.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx index 222d8261259..69ef001ab57 100644 --- a/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx +++ b/PWGHF/ALICE3/TableProducer/candidateSelectorXToJpsiPiPi.cxx @@ -21,9 +21,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx index 33af9544284..589d889fdcb 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorChicToJpsiGamma.cxx @@ -22,9 +22,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx index b4ebf84eac2..2a9c9c49faf 100644 --- a/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx +++ b/PWGHF/ALICE3/TableProducer/treeCreatorXToJpsiPiPi.cxx @@ -21,8 +21,8 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGHF/ALICE3/Tasks/taskChic.cxx b/PWGHF/ALICE3/Tasks/taskChic.cxx index f7331b7d417..f6ed3fbabe0 100644 --- a/PWGHF/ALICE3/Tasks/taskChic.cxx +++ b/PWGHF/ALICE3/Tasks/taskChic.cxx @@ -20,9 +20,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include @@ -38,7 +38,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// chi_c1(1P) analysis task struct HfTaskChic { diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx index 546d7946394..a6a79fa2e23 100644 --- a/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0Alice3Barrel.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx index a43dc94d436..ac528208830 100644 --- a/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0Alice3Forward.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx index 46387f053a6..23d160348d8 100644 --- a/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx +++ b/PWGHF/ALICE3/Tasks/taskD0ParametrizedPid.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskJpsi.cxx b/PWGHF/ALICE3/Tasks/taskJpsi.cxx index 9a20f6f42e9..9390751b7ee 100644 --- a/PWGHF/ALICE3/Tasks/taskJpsi.cxx +++ b/PWGHF/ALICE3/Tasks/taskJpsi.cxx @@ -20,9 +20,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include @@ -37,7 +37,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// jpsitoee analysis task struct HfTaskJpsi { diff --git a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx index ec32c52976c..703ba304092 100644 --- a/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx +++ b/PWGHF/ALICE3/Tasks/taskLcAlice3.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx index b22c531e621..ff8e2aad4a4 100644 --- a/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx +++ b/PWGHF/ALICE3/Tasks/taskLcParametrizedPid.cxx @@ -19,10 +19,10 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx b/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx index 1f3cfb9d345..fe8c1a066f8 100644 --- a/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx +++ b/PWGHF/ALICE3/Tasks/taskQaPidRejection.cxx @@ -74,7 +74,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" +#include /// Task to QA the efficiency of a particular particle defined by particlePDG template diff --git a/PWGHF/ALICE3/Tasks/taskX.cxx b/PWGHF/ALICE3/Tasks/taskX.cxx index 2be307e0f92..2391634f8ce 100644 --- a/PWGHF/ALICE3/Tasks/taskX.cxx +++ b/PWGHF/ALICE3/Tasks/taskX.cxx @@ -21,9 +21,9 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include @@ -39,7 +39,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(optionDoMC); } -#include "Framework/runDataProcessing.h" +#include /// X(3872) analysis task struct HfTaskX { diff --git a/PWGHF/Core/HfMlResponseB0ToDPi.h b/PWGHF/Core/HfMlResponseB0ToDPi.h index 4874b56543b..354d295f7a6 100644 --- a/PWGHF/Core/HfMlResponseB0ToDPi.h +++ b/PWGHF/Core/HfMlResponseB0ToDPi.h @@ -22,6 +22,8 @@ #include "Tools/ML/MlResponse.h" +#include + #include #include diff --git a/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h b/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h index ed78d100b07..d3afc762d83 100644 --- a/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h +++ b/PWGHF/Core/HfMlResponseOmegacToOmegaPi.h @@ -16,7 +16,6 @@ #ifndef PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPI_H_ #define PWGHF_CORE_HFMLRESPONSEOMEGACTOOMEGAPI_H_ -#include "PWGHF/Core/HfHelper.h" #include "PWGHF/Core/HfMlResponse.h" #include "Tools/ML/MlResponse.h" diff --git a/PWGHF/D2H/Core/DataCreationCharmReso.h b/PWGHF/D2H/Core/DataCreationCharmReso.h index fb44dce3b42..475a5ecdbae 100644 --- a/PWGHF/D2H/Core/DataCreationCharmReso.h +++ b/PWGHF/D2H/Core/DataCreationCharmReso.h @@ -22,15 +22,16 @@ #define HomogeneousField // needed for KFParticle::SetField(magneticField); #endif -#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" -#include "PWGEM/PhotonMeson/Utils/TrackSelection.h" #include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/Utils/utilsEvSelHf.h" #include "PWGHF/Utils/utilsMcMatching.h" +// +#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" +#include "PWGEM/PhotonMeson/Utils/TrackSelection.h" + #include "Common/Core/RecoDecay.h" #include "Common/Core/TPCVDriftManager.h" #include "Common/Core/trackUtilities.h" @@ -43,7 +44,9 @@ #include #include #include +#include #include +#include #include #include @@ -60,8 +63,6 @@ #include #include #include -#include -#include #include namespace o2::analysis @@ -197,9 +198,13 @@ struct HfResoConfigSingleTrackCuts : o2::framework::ConfigurableGroup { o2::framework::Configurable setTrackSelections{"setTrackSelections", 2, "flag to apply track selections: 0=none; 1=global track w/o DCA selection; 2=global track; 3=only ITS quality"}; o2::framework::Configurable maxEta{"maxEta", 0.8, "maximum pseudorapidity for single tracks to be paired with D mesons"}; o2::framework::Configurable minPt{"minPt", 0.1, "minimum pT for single tracks to be paired with D mesons"}; + o2::framework::Configurable forceTOF{"forceTOF", false, "force TOF for single tracks to be paired with D mesons"}; o2::framework::Configurable maxNsigmaTpcPi{"maxNsigmaTpcPi", -1., "maximum pion NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"}; o2::framework::Configurable maxNsigmaTpcKa{"maxNsigmaTpcKa", -1., "maximum kaon NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"}; o2::framework::Configurable maxNsigmaTpcPr{"maxNsigmaTpcPr", 3., "maximum proton NSigma in TPC for single tracks to be paired with D mesons; set negative to reject"}; + o2::framework::Configurable maxNsigmaTofPi{"maxNsigmaTofPi", -1., "maximum pion NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"}; + o2::framework::Configurable maxNsigmaTofKa{"maxNsigmaTofKa", -1., "maximum kaon NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"}; + o2::framework::Configurable maxNsigmaTofPr{"maxNsigmaTofPr", -1., "maximum proton NSigma in TOF for single tracks to be paired with D mesons; set negative to reject"}; }; struct HfResoConfigQaPlots : o2::framework::ConfigurableGroup { @@ -727,9 +732,22 @@ bool isTrackSelected(const Tr& track, const std::array& dDaughtersIds, c if (!track.hasTPC()) { return false; } - bool const isPion = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi.value; - bool const isKaon = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa.value; - bool const isProton = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr.value; + // --- TPC PID --- + bool isPionTPC = std::abs(track.tpcNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTpcPi.value; + bool isKaonTPC = std::abs(track.tpcNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTpcKa.value; + bool isProtonTPC = std::abs(track.tpcNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTpcPr.value; + + // --- TOF PID --- + bool hasTOF = track.hasTOF(); + bool isPionTOF = hasTOF ? std::abs(track.tofNSigmaPi()) < cfgSingleTrackCuts.maxNsigmaTofPi.value : false; + bool isKaonTOF = hasTOF ? std::abs(track.tofNSigmaKa()) < cfgSingleTrackCuts.maxNsigmaTofKa.value : false; + bool isProtonTOF = hasTOF ? std::abs(track.tofNSigmaPr()) < cfgSingleTrackCuts.maxNsigmaTofPr.value : false; + + // --- Combined logic --- + bool isPion = isPionTPC && (!cfgSingleTrackCuts.forceTOF.value || isPionTOF); + bool isKaon = isKaonTPC && (!cfgSingleTrackCuts.forceTOF.value || isKaonTOF); + bool isProton = isProtonTPC && (!cfgSingleTrackCuts.forceTOF.value || isProtonTOF); + return (isPion || isKaon || isProton); // we keep the track if is it compatible with at least one of the PID hypotheses selected } diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index e879ba57c9a..03da2e17f43 100644 --- a/PWGHF/D2H/Tasks/taskD0.cxx +++ b/PWGHF/D2H/Tasks/taskD0.cxx @@ -94,6 +94,8 @@ struct HfTaskD0 { Configurable storeCentrality{"storeCentrality", false, "Flag to store centrality information"}; Configurable storeOccupancyAndIR{"storeOccupancyAndIR", false, "Flag to store occupancy information and interaction rate"}; Configurable storeTrackQuality{"storeTrackQuality", false, "Flag to store track quality information"}; + Configurable storeZdcEnergy{"storeZdcEnergy", false, "Flag to store ZDC energy info"}; + Configurable storeZdcTime{"storeZdcTime", true, "Flag to store ZDC time info"}; // ML inference Configurable applyMl{"applyMl", false, "Flag to apply ML selections"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; @@ -121,6 +123,7 @@ struct HfTaskD0 { using CollisionsWithMcLabels = soa::Join; using CollisionsWithMcLabelsCent = soa::Join; using TracksSelQuality = soa::Join; + using TracksWPid = soa::Join; Filter filterD0Flag = (o2::aod::hf_track_index::hfflag & static_cast(BIT(aod::hf_cand_2prong::DecayType::D0ToPiK))) != static_cast(0); @@ -161,6 +164,7 @@ struct HfTaskD0 { ConfigurableAxis thnConfigAxisFV0A{"thnConfigAxisFV0A", {2001, -1.5, 1999.5}, "axis for FV0-A amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisFDD{"thnConfigAxisFDD", {200, 0., 4000.}, "axis for FDD amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisZN{"thnConfigAxisZN", {510, -1.5, 49.5}, "axis for ZN energy (a.u.)"}; + ConfigurableAxis thnConfigAxisTimeZN{"thnConfigAxisTimeZN", {700, -35., 35.}, "axis for ZN energy (a.u.)"}; HistogramRegistry registry{ "registry", @@ -248,7 +252,10 @@ struct HfTaskD0 { LOGP(fatal, "DCAFitterN and KFParticle can not be enabled at a time."); } if ((storeCentrality || storeOccupancyAndIR) && !(doprocessDataWithDCAFitterNCent || doprocessMcWithDCAFitterNCent || doprocessDataWithDCAFitterNMlCent || doprocessMcWithDCAFitterNMlCent || doprocessDataWithDCAFitterNWithUpc || doprocessDataWithDCAFitterNMlWithUpc)) { - LOGP(fatal, "Can't enable the storeCentrality and storeOccupancu without cent process or UPC process"); + LOGP(fatal, "Can't enable the storeCentrality and storeOccupancy without cent process or UPC process"); + } + if ((storeZdcEnergy || storeZdcTime) && !(doprocessDataWithDCAFitterNWithUpc || doprocessDataWithDCAFitterNMlWithUpc)) { + LOGP(fatal, "Can't enable the storeZdcEnergy and storeZdcTime without UPC process"); } auto vbins = (std::vector)binsPt; registry.add("hMass", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {{500, 0., 5.}, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); @@ -309,8 +316,10 @@ struct HfTaskD0 { const AxisSpec thnAxisFV0A{thnConfigAxisFV0A, "FV0-A amplitude"}; const AxisSpec thnAxisFDDA{thnConfigAxisFDD, "FDD-A amplitude"}; const AxisSpec thnAxisFDDC{thnConfigAxisFDD, "FDD-C amplitude"}; - const AxisSpec thnAxisZNA{thnConfigAxisZN, "ZNA energy"}; - const AxisSpec thnAxisZNC{thnConfigAxisZN, "ZNC energy"}; + const AxisSpec thnAxisEnergyZNA{thnConfigAxisZN, "ZNA energy"}; + const AxisSpec thnAxisEnergyZNC{thnConfigAxisZN, "ZNC energy"}; + const AxisSpec thnAxisTimeZNA{thnConfigAxisTimeZN, "ZNA Time"}; + const AxisSpec thnAxisTimeZNC{thnConfigAxisTimeZN, "ZNC Time"}; if (doprocessMcWithDCAFitterN || doprocessMcWithDCAFitterNCent || doprocessMcWithKFParticle || doprocessMcWithDCAFitterNMl || doprocessMcWithDCAFitterNMlCent || doprocessMcWithKFParticleMl) { std::vector axesAcc = {thnAxisGenPtD, thnAxisGenPtB, thnAxisY, thnAxisOrigin, thnAxisNumPvContr}; @@ -367,9 +376,15 @@ struct HfTaskD0 { axes.push_back(thnAxisFV0A); axes.push_back(thnAxisFDDA); axes.push_back(thnAxisFDDC); - axes.push_back(thnAxisZNA); - axes.push_back(thnAxisZNC); axes.push_back(thnAxisNumPvContr); + if (storeZdcEnergy) { + axes.push_back(thnAxisEnergyZNA); + axes.push_back(thnAxisEnergyZNC); + } + if (storeZdcTime) { + axes.push_back(thnAxisTimeZNA); + axes.push_back(thnAxisTimeZNC); + } } if (applyMl) { @@ -381,9 +396,39 @@ struct HfTaskD0 { } registry.add("Data/fitInfo/ampFT0A_vs_ampFT0C", "FT0-A vs FT0-C amplitude;FT0-A amplitude (a.u.);FT0-C amplitude (a.u.)", {HistType::kTH2F, {{2500, 0., 250}, {2500, 0., 250}}}); - registry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 20}, {200, 0., 20}}}); + registry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{200, 0., 200}, {1000, 0., 2000}}}); + registry.add("Data/zdc/timeZNA_vs_timeZNC", "ZNA vs ZNC time;ZNA Time;ZNC time", {HistType::kTH2F, {{700, -35., 35.}, {700, -35., 35.}}}); registry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap type;Counts", {HistType::kTH1F, {{7, -1.5, 5.5}}}); - registry.add("Data/hGapVsEta", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); + registry.add("Data/hGapVsEtaTrack0", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); + registry.add("Data/hGapVsEtaTrack1", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); + + registry.add("Data/hTPCnSigProng0Pion_GapA", "Gap A Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng1Kaon_GapA", "Gap A Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng0Kaon_GapA", "Gap A Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng1Pion_GapA", "Gap A Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng0Pion_GapC", "Gap C Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng1Kaon_GapC", "Gap C Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng0Kaon_GapC", "Gap C Prong 0;P (GeV/c) ;TPC nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTPCnSigProng1Pion_GapC", "Gap C Prong 1;P (GeV/c) ;TPC nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + + registry.add("Data/hTOFnSigProng0Pion_GapA", "Gap A Prong 0;P (GeV/c) ;TOF nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng1Kaon_GapA", "Gap A Prong 1;P (GeV/c) ;TOF nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng0Kaon_GapA", "Gap A Prong 0;P (GeV/c) ;TOF nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng1Pion_GapA", "Gap A Prong 1;P (GeV/c) ;TOF nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng0Pion_GapC", "Gap C Prong 0;P (GeV/c) ;TOF nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng1Kaon_GapC", "Gap C Prong 1;P (GeV/c) ;TOF nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng0Kaon_GapC", "Gap C Prong 0;P (GeV/c) ;TOF nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + registry.add("Data/hTOFnSigProng1Pion_GapC", "Gap C Prong 1;P (GeV/c) ;TOF nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {120, -6., 6.}}}); + + registry.add("Data/hTpcTofnSigProng0Pion_GapA", "Gap A Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng1Kaon_GapA", "Gap A Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng0Kaon_GapA", "Gap A Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng1Pion_GapA", "Gap A Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng0Pion_GapC", "Gap C Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng1Kaon_GapC", "Gap C Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng0Kaon_GapC", "Gap C Prong 0;P (GeV/c) ;TpcTof nSigma Pion", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hTpcTofnSigProng1Pion_GapC", "Gap C Prong 1;P (GeV/c) ;TpcTof nSigma Kaon", {HistType::kTH2F, {{100, 0, 50}, {50, 0., 10.}}}); + registry.add("Data/hGapVsRap", "UPC gap vs Eta;Gap type;Eta", {HistType::kTH2F, {{7, -1.5, 5.5}, {50, -1., 1.}}}); hfEvSel.addHistograms(registry); @@ -579,7 +624,8 @@ struct HfTaskD0 { BCsType const& bcs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, - aod::FDDs const& fdds) + aod::FDDs const& fdds, + TracksWPid const&) { for (const auto& collision : collisions) { float centrality{-1.f}; @@ -599,7 +645,6 @@ struct HfTaskD0 { if (gapResult.bc) { bcForUPC = *(gapResult.bc); } - // Get FIT information from the UPC BC upchelpers::FITInfo fitInfo{}; udhelpers::getFITinfo(fitInfo, bcForUPC, bcs, ft0s, fv0as, fdds); @@ -608,13 +653,18 @@ struct HfTaskD0 { const bool hasZdc = bcForUPC.has_zdc(); float zdcEnergyZNA = -1.f; float zdcEnergyZNC = -1.f; + float zdcTimeZNA = -999.f; + float zdcTimeZNC = -999.f; + if (hasZdc) { const auto& zdc = bcForUPC.zdc(); zdcEnergyZNA = zdc.energyCommonZNA(); zdcEnergyZNC = zdc.energyCommonZNC(); + zdcTimeZNA = zdc.timeZNA(); + zdcTimeZNC = zdc.timeZNC(); registry.fill(HIST("Data/zdc/energyZNA_vs_energyZNC"), zdcEnergyZNA, zdcEnergyZNC); + registry.fill(HIST("Data/zdc/timeZNA_vs_timeZNC"), zdcTimeZNA, zdcTimeZNC); } - registry.fill(HIST("Data/fitInfo/ampFT0A_vs_ampFT0C"), fitInfo.ampFT0A, fitInfo.ampFT0C); registry.fill(HIST("Data/hUpcGapAfterSelection"), gap); @@ -637,9 +687,50 @@ struct HfTaskD0 { const float massD0 = HfHelper::invMassD0ToPiK(candidate); const float massD0bar = HfHelper::invMassD0barToKPi(candidate); const auto ptCandidate = candidate.pt(); - registry.fill(HIST("Data/hGapVsEta"), gap, candidate.eta()); + + auto track0 = candidate.template prong0_as(); + auto track1 = candidate.template prong1_as(); + + registry.fill(HIST("Data/hGapVsEtaTrack0"), gap, track0.eta()); + registry.fill(HIST("Data/hGapVsEtaTrack1"), gap, track1.eta()); registry.fill(HIST("Data/hGapVsRap"), gap, HfHelper::yD0(candidate)); + if (gap == 0 && candidate.isSelD0() >= selectionFlagD0) { // A side // D0 --> K-Pi+ + registry.fill(HIST("Data/hTPCnSigProng0Pion_GapA"), track0.p(), track0.tpcNSigmaPi()); + registry.fill(HIST("Data/hTPCnSigProng1Kaon_GapA"), track1.p(), track1.tpcNSigmaKa()); + registry.fill(HIST("Data/hTOFnSigProng0Pion_GapA"), track0.p(), track0.tofNSigmaPi()); + registry.fill(HIST("Data/hTOFnSigProng1Kaon_GapA"), track1.p(), track1.tofNSigmaKa()); + registry.fill(HIST("Data/hTpcTofnSigProng0Pion_GapA"), track0.p(), track0.tpcTofNSigmaPi()); + registry.fill(HIST("Data/hTpcTofnSigProng1Kaon_GapA"), track1.p(), track1.tpcTofNSigmaKa()); + } + + if (gap == 0 && candidate.isSelD0bar() >= selectionFlagD0) { // A side // D0-bar --> K+Pi- + registry.fill(HIST("Data/hTPCnSigProng0Kaon_GapA"), track0.p(), track0.tpcNSigmaKa()); + registry.fill(HIST("Data/hTPCnSigProng1Pion_GapA"), track1.p(), track1.tpcNSigmaPi()); + registry.fill(HIST("Data/hTOFnSigProng0Kaon_GapA"), track0.p(), track0.tofNSigmaKa()); + registry.fill(HIST("Data/hTOFnSigProng1Pion_GapA"), track1.p(), track1.tofNSigmaPi()); + registry.fill(HIST("Data/hTpcTofnSigProng0Kaon_GapA"), track0.p(), track0.tpcTofNSigmaKa()); + registry.fill(HIST("Data/hTpcTofnSigProng1Pion_GapA"), track1.p(), track1.tpcTofNSigmaPi()); + } + + if (gap == 1 && candidate.isSelD0() >= selectionFlagD0) { // C side // D0 --> K-Pi+ + registry.fill(HIST("Data/hTPCnSigProng0Pion_GapC"), track0.p(), track0.tpcNSigmaPi()); + registry.fill(HIST("Data/hTPCnSigProng1Kaon_GapC"), track1.p(), track1.tpcNSigmaKa()); + registry.fill(HIST("Data/hTOFnSigProng0Pion_GapC"), track0.p(), track0.tofNSigmaPi()); + registry.fill(HIST("Data/hTOFnSigProng1Kaon_GapC"), track1.p(), track1.tofNSigmaKa()); + registry.fill(HIST("Data/hTpcTofnSigProng0Pion_GapC"), track0.p(), track0.tpcTofNSigmaPi()); + registry.fill(HIST("Data/hTpcTofnSigProng1Kaon_GapC"), track1.p(), track1.tpcTofNSigmaKa()); + } + + if (gap == 1 && candidate.isSelD0bar() >= selectionFlagD0) { // C side // D0-bar --> K+Pi- + registry.fill(HIST("Data/hTPCnSigProng0Kaon_GapC"), track0.p(), track0.tpcNSigmaKa()); + registry.fill(HIST("Data/hTPCnSigProng1Pion_GapC"), track1.p(), track1.tpcNSigmaPi()); + registry.fill(HIST("Data/hTOFnSigProng0Kaon_GapC"), track0.p(), track0.tofNSigmaKa()); + registry.fill(HIST("Data/hTOFnSigProng1Pion_GapC"), track1.p(), track1.tofNSigmaPi()); + registry.fill(HIST("Data/hTpcTofnSigProng0Kaon_GapC"), track0.p(), track0.tpcTofNSigmaKa()); + registry.fill(HIST("Data/hTpcTofnSigProng1Pion_GapC"), track1.p(), track1.tpcTofNSigmaPi()); + } + if (candidate.isSelD0() >= selectionFlagD0) { registry.fill(HIST("hMass"), massD0, ptCandidate); registry.fill(HIST("hMassFinerBinning"), massD0, ptCandidate); @@ -654,11 +745,13 @@ struct HfTaskD0 { // Fill THnSparse with structure matching histogram axes: [mass, pt, (mlScores if FillMl), rapidity, d0Type, (cent if storeCentrality), (occ, ir if storeOccupancyAndIR), gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC] auto fillTHnData = [&](float mass, int d0Type) { // Pre-calculate vector size to avoid reallocations - constexpr int NAxesBase = 13; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC, nPVcontr + constexpr int NAxesBase = 11; // mass, pt, rapidity, d0Type, gapType, FT0A, FT0C, FV0A, FDDA, FDDC, ZNA, ZNC, nPVcontr constexpr int NAxesMl = FillMl ? 3 : 0; // 3 ML scores if FillMl int const nAxesCent = storeCentrality ? 1 : 0; // centrality if storeCentrality int const nAxesOccIR = storeOccupancyAndIR ? 2 : 0; // occupancy and IR if storeOccupancyAndIR - int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR; + int const nAxesZdcEnergy = storeZdcEnergy ? 2 : 0; // ZDC energy if storeZdcEnergy + int const nAxesZdcTime = storeZdcTime ? 2 : 0; // ZDC time if storeZdctime + int const nAxesTotal = NAxesBase + NAxesMl + nAxesCent + nAxesOccIR + nAxesZdcEnergy + nAxesZdcTime; std::vector valuesToFill; valuesToFill.reserve(nAxesTotal); @@ -689,10 +782,15 @@ struct HfTaskD0 { valuesToFill.push_back(static_cast(fitInfo.ampFV0A)); valuesToFill.push_back(static_cast(fitInfo.ampFDDA)); valuesToFill.push_back(static_cast(fitInfo.ampFDDC)); - valuesToFill.push_back(static_cast(zdcEnergyZNA)); - valuesToFill.push_back(static_cast(zdcEnergyZNC)); valuesToFill.push_back(static_cast(numPvContributors)); - + if (storeZdcEnergy) { + valuesToFill.push_back(static_cast(zdcEnergyZNA)); + valuesToFill.push_back(static_cast(zdcEnergyZNC)); + } + if (storeZdcTime) { + valuesToFill.push_back(static_cast(zdcTimeZNA)); + valuesToFill.push_back(static_cast(zdcTimeZNC)); + } if constexpr (FillMl) { registry.get(HIST("hBdtScoreVsMassVsPtVsPtBVsYVsOriginVsD0Type"))->Fill(valuesToFill.data()); } else { @@ -1181,9 +1279,11 @@ struct HfTaskD0 { aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, - aod::Zdcs const& /*zdcs*/) + TracksWPid const& tracks, + aod::Zdcs const& /*zdcs*/ + ) { - runAnalysisPerCollisionDataWithUpc(collisions, selectedD0Candidates, bcs, ft0s, fv0as, fdds); + runAnalysisPerCollisionDataWithUpc(collisions, selectedD0Candidates, bcs, ft0s, fv0as, fdds, tracks); } PROCESS_SWITCH(HfTaskD0, processDataWithDCAFitterNWithUpc, "Process real data with DCAFitterN w/o ML with UPC", false); @@ -1194,9 +1294,10 @@ struct HfTaskD0 { aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds, + TracksWPid const& tracks, aod::Zdcs const& /*zdcs*/) { - runAnalysisPerCollisionDataWithUpc(collisions, selectedD0CandidatesMl, bcs, ft0s, fv0as, fdds); + runAnalysisPerCollisionDataWithUpc(collisions, selectedD0CandidatesMl, bcs, ft0s, fv0as, fdds, tracks); } PROCESS_SWITCH(HfTaskD0, processDataWithDCAFitterNMlWithUpc, "Process real data with DCAFitterN and ML with UPC", false); }; diff --git a/PWGHF/DataModel/DerivedTables.h b/PWGHF/DataModel/DerivedTables.h index 3d15683b218..359a2320b3a 100644 --- a/PWGHF/DataModel/DerivedTables.h +++ b/PWGHF/DataModel/DerivedTables.h @@ -18,6 +18,8 @@ #include "PWGHF/DataModel/CandidateReconstructionTables.h" #include "PWGHF/DataModel/TrackIndexSkimmingTables.h" +// +#include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" @@ -977,8 +979,11 @@ DECLARE_SOA_TABLE_STAGED(HfDplusDaugs, "HFDPDAUG", //! Table to study daughter p hf_cand::PyProng2, hf_cand::PzProng2, hf_cand_par::NSigTpcTofPi0, - hf_cand_par::NSigTpcTofKa1, + hf_cand_par::NSigTpcTofPi1, hf_cand_par::NSigTpcTofPi2, + hf_cand_par::NSigTpcTofKa0, + hf_cand_par::NSigTpcTofKa1, + hf_cand_par::NSigTpcTofKa2, o2::soa::Marker); DECLARE_SOA_TABLE_STAGED(HfDplusMls, "HFDPML", //! Table with candidate selection ML scores diff --git a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx index 9ffe580fcf5..5636a0b8fa6 100644 --- a/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx +++ b/PWGHF/HFC/TableProducer/derivedDataCreatorCorrelationsReduced.cxx @@ -46,6 +46,7 @@ #include #include +#include #include #include #include diff --git a/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx b/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx index 9884ff920e3..eb197529980 100644 --- a/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx +++ b/PWGHF/HFC/TableProducer/producerCharmHadronsTrackFemtoDream.cxx @@ -60,6 +60,7 @@ #include #include +#include #include #include diff --git a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx index d870eb6731d..9b15c6f7233 100644 --- a/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx +++ b/PWGHF/HFC/Tasks/taskCorrelationDstarHadrons.cxx @@ -18,6 +18,7 @@ #include "PWGHF/HFC/DataModel/CorrelationTables.h" #include "PWGHF/Utils/utilsAnalysis.h" +#include #include #include #include @@ -27,8 +28,11 @@ #include #include +#include +#include #include +#include #include #include #include diff --git a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx index 8acebbbe14d..e3a571d3bdd 100644 --- a/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx +++ b/PWGHF/HFL/TableProducer/electronSelectionWithTpcEmcal.cxx @@ -189,14 +189,20 @@ struct HfElectronSelectionWithTpcEmcal { registry.add("hZvertex", "z vertex", {HistType::kTH1D, {axisPosZ}}); registry.add("hNeventsAfterPassEmcal", "No of events pass the Emcal", {HistType::kTH1D, {{3, 1, 4}}}); registry.add("hNevents", "No of events", {HistType::kTH1D, {{3, 1, 4}}}); - registry.add("hLikeMass", "Like mass", {HistType::kTH1D, {{axisMass}}}); - registry.add("hUnLikeMass", "unLike mass", {HistType::kTH1D, {{axisMass}}}); - registry.add("hLikeSignPt", "Like sign Momentum ", {HistType::kTH1D, {{axisPt}}}); - registry.add("hUnLikeSignPt", "UnLike sign Momentum", {HistType::kTH1D, {{axisPt}}}); + registry.add("hLikeMass_EMCAL", "Like mass Emcal", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass_EMCAL", "unLike mass Emcal", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt_EMCAL", "Like sign Momentum Emcal ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt_EMCAL", "UnLike sign Momentum Emcal", {HistType::kTH1D, {{axisPt}}}); + registry.add("hLikeMass_NoEMCAL", "Like mass NoEMCAL", {HistType::kTH1D, {{axisMass}}}); + registry.add("hUnLikeMass_NoEMCAL", "unLike mass NoEMCAL", {HistType::kTH1D, {{axisMass}}}); + registry.add("hLikeSignPt_NoEMCAL", "Like sign Momentum NoEMCAL ", {HistType::kTH1D, {{axisPt}}}); + registry.add("hUnLikeSignPt_NoEMCAL", "UnLike sign Momentum NoEMCAL", {HistType::kTH1D, {{axisPt}}}); + registry.add("hMcgenInElectron", "Mc Gen Inclusive Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcRecInElectron", "Mc Rec Inclusive Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcRecwithoutEMCalInElectron", "Mc Rec Inclusive Electron without Emcal", {HistType::kTH1D, {{axisPt}}}); - + registry.add("hphiElectron", "hphiElectron", {HistType::kTH1D, {axisPhi}}); + registry.add("hphiElectronPassEmcal", "hphiElectron pass Emcal", {HistType::kTH1D, {axisPhi}}); registry.add("hMcgenAllNonHfeElectron", "Mc Gen All NonHf Electron", {HistType::kTH1D, {{axisPt}}}); registry.add("hMcgenNonHfeElectron", "Mc Gen NonHf Electron with mother", {HistType::kTH1D, {{axisPt}}}); registry.add("hPi0eEmbTrkPt", "Mc Gen Pi0 mother NonHf Electron", {HistType::kTH1D, {{axisPt}}}); @@ -353,7 +359,9 @@ struct HfElectronSelectionWithTpcEmcal { vecLSMass.push_back(massLike); isLSElectron = true; if (isEMcal) { - registry.fill(HIST("hLikeMass"), massLike); + registry.fill(HIST("hLikeMass_EMCAL"), massLike); + } else { + registry.fill(HIST("hLikeMass_NoEMCAL"), massLike); } } // for unlike charge @@ -362,7 +370,9 @@ struct HfElectronSelectionWithTpcEmcal { vecULSMass.push_back(massUnLike); isULSElectron = true; if (isEMcal) { - registry.fill(HIST("hUnLikeMass"), massUnLike); + registry.fill(HIST("hUnLikeMass_EMCAL"), massUnLike); + } else { + registry.fill(HIST("hUnLikeMass_NoEMCAL"), massUnLike); } } @@ -371,7 +381,9 @@ struct HfElectronSelectionWithTpcEmcal { massLike = invMassElectron; ++nElPairsLS; if (isEMcal) { - registry.fill(HIST("hLikeSignPt"), electron.pt()); + registry.fill(HIST("hLikeSignPt_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hLikeSignPt_NoEMCAL"), electron.pt()); } } // for unlike charge @@ -379,7 +391,9 @@ struct HfElectronSelectionWithTpcEmcal { massUnLike = invMassElectron; ++nElPairsUS; if (isEMcal) { - registry.fill(HIST("hUnLikeSignPt"), electron.pt()); + registry.fill(HIST("hUnLikeSignPt_EMCAL"), electron.pt()); + } else { + registry.fill(HIST("hUnLikeSignPt_NoEMCAL"), electron.pt()); } } } @@ -445,7 +459,7 @@ struct HfElectronSelectionWithTpcEmcal { } if (fillTrackInfo) { - registry.fill(HIST("hTrackEtaPhi"), etaTrack, phiTrack, passEMCal); // track etaphi infor after filter bit + // track etaphi infor after filter bit registry.fill(HIST("hTrackEnergyLossVsP"), track.tpcSignal(), pTrack, passEMCal); // track etaphi infor after filter bit registry.fill(HIST("hTrackEnergyLossVsPt"), track.tpcSignal(), ptTrack, passEMCal); // track etaphi infor after filter bit registry.fill(HIST("hTracknSigmaVsP"), tpcNsigmaTrack, pTrack, passEMCal); // track etaphi infor after filter bit @@ -530,7 +544,7 @@ struct HfElectronSelectionWithTpcEmcal { if (eop < eopElectronMin || eop > eopElectronMax) { continue; } - + registry.fill(HIST("hphiElectronPassEmcal"), track.phi()); ///////////////// NonHf electron Selection with Emcal //////////////////////// if constexpr (IsMc) { if (matchTrack.has_mcParticle()) { @@ -648,6 +662,7 @@ struct HfElectronSelectionWithTpcEmcal { if ((track.tpcNSigmaEl() < tpcNsigmaElectronMin || track.tpcNSigmaEl() > tpcNsigmaElectronMax)) { continue; } + registry.fill(HIST("hphiElectron"), track.phi()); if constexpr (IsMc) { if (track.has_mcParticle()) { auto mcParticle = track.template mcParticle_as(); diff --git a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx index a8f03743e4c..a172f752afc 100644 --- a/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx +++ b/PWGHF/HFL/Tasks/taskElectronWeakBoson.cxx @@ -52,6 +52,7 @@ #include #include +#include #include #include #include diff --git a/PWGHF/HFL/Tasks/taskSingleElectron.cxx b/PWGHF/HFL/Tasks/taskSingleElectron.cxx index b7bb9d7c4be..c519765e688 100644 --- a/PWGHF/HFL/Tasks/taskSingleElectron.cxx +++ b/PWGHF/HFL/Tasks/taskSingleElectron.cxx @@ -27,7 +27,6 @@ #include #include #include -#include #include #include diff --git a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx index 5fea587b563..0be6fe96bc5 100644 --- a/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx +++ b/PWGHF/TableProducer/candidateCreatorXic0Omegac0Qa.cxx @@ -19,44 +19,59 @@ #define HomogeneousField // o2-linter: disable=name/macro (required by KFParticle) #endif +#include "PWGHF/Core/CentralityEstimation.h" #include "PWGHF/Core/DecayChannelsLegacy.h" #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGHF/DataModel/TrackIndexSkimmingTables.h" #include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGHF/Utils/utilsEvSelHf.h" -#include "PWGHF/Utils/utilsTrkCandHf.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/mcCentrality.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" // -> Added to test removal of strangeness builder workflow +#include "Common/Core/RecoDecay.h" #include "Common/Core/ZorroSummary.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Tools/KFparticle/KFUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.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 using namespace o2; diff --git a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx index e1e32120543..b00b7001a31 100644 --- a/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx +++ b/PWGHF/TableProducer/candidateSelectorOmegac0Xic0ToOmegaKa.cxx @@ -14,6 +14,12 @@ /// \author Federica Zanone , Heidelberg University /// \author Ruiqi Yin , Fudan University +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/AliasTables.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/DataModel/CandidateSelectionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" + #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelectorPID.h" @@ -38,12 +44,6 @@ #include #include #include -// #include "PWGHF/Core/HfMlResponseOmegaKaToOmegaKa.h" -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/DataModel/AliasTables.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" -#include "PWGHF/Utils/utilsAnalysis.h" using namespace o2; using namespace o2::aod; diff --git a/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx b/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx index 55f5e2adae3..b6b40705557 100644 --- a/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx +++ b/PWGHF/TableProducer/candidateSelectorToXiPiQa.cxx @@ -26,11 +26,13 @@ #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelectorPID.h" +#include #include #include #include #include #include +#include #include #include #include diff --git a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx index a7a90b507c5..ddc56bfaebc 100644 --- a/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorDplusToPiKPi.cxx @@ -208,8 +208,11 @@ struct HfDerivedDataCreatorDplusToPiKPi { candidate.pyProng2(), candidate.pzProng2(), candidate.tpcTofNSigmaPi0(), + candidate.tpcTofNSigmaPi1(), + candidate.tpcTofNSigmaPi2(), + candidate.tpcTofNSigmaKa0(), candidate.tpcTofNSigmaKa1(), - candidate.tpcTofNSigmaPi2()); + candidate.tpcTofNSigmaKa2()); } if (fillCandidateMl) { rowCandidateMl( diff --git a/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx b/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx index 0386d6afba6..371b9ab9c4c 100644 --- a/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx +++ b/PWGHF/TableProducer/derivedDataCreatorLcToK0sP.cxx @@ -16,7 +16,6 @@ /// \author Luigi Dello Stritto , Marietta-Blau Institute /// \author Vít Kučera , Inha University -#include "PWGHF/Core/DecayChannels.h" #include "PWGHF/Core/HfHelper.h" #include "PWGHF/DataModel/AliasTables.h" #include "PWGHF/DataModel/CandidateReconstructionTables.h" diff --git a/PWGHF/TableProducer/mcPidTof.cxx b/PWGHF/TableProducer/mcPidTof.cxx index 89dfc8530f9..c0c6217607c 100644 --- a/PWGHF/TableProducer/mcPidTof.cxx +++ b/PWGHF/TableProducer/mcPidTof.cxx @@ -65,6 +65,7 @@ using namespace o2::framework; using namespace o2::pid; using namespace o2::framework::expressions; using namespace o2::track; +using namespace o2::common::core; o2::common::core::MetadataHelper metadataInfo; diff --git a/PWGHF/TableProducer/pidCreator.cxx b/PWGHF/TableProducer/pidCreator.cxx index d108a443539..f483d10d001 100644 --- a/PWGHF/TableProducer/pidCreator.cxx +++ b/PWGHF/TableProducer/pidCreator.cxx @@ -61,7 +61,7 @@ struct HfPidCreator { template void checkTableSwitch(InitContext& initContext, const std::string& table, TFlag& doprocess) { - auto isNeeded = isTableRequiredInWorkflow(initContext, table); + auto isNeeded = o2::common::core::isTableRequiredInWorkflow(initContext, table); if (isNeeded && !doprocess.value) { LOGF(fatal, "Table %s is needed but not requested. Enable the corresponding process function!", table); } diff --git a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx index 5fb90429589..8a952cbea49 100644 --- a/PWGHF/TableProducer/treeCreatorOmegacSt.cxx +++ b/PWGHF/TableProducer/treeCreatorOmegacSt.cxx @@ -16,7 +16,6 @@ /// \author Tiantian Cheng #include "PWGHF/Core/DecayChannelsLegacy.h" -#include "PWGHF/DataModel/TrackIndexSkimmingTables.h" #include "PWGHF/Utils/utilsTrkCandHf.h" #include "PWGLF/DataModel/LFStrangenessTables.h" diff --git a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx index 98fbc5f13c3..0b92effcdba 100644 --- a/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx +++ b/PWGHF/TableProducer/treeCreatorSigmacCorrBkg.cxx @@ -41,6 +41,7 @@ #include #include +#include using namespace o2; using namespace o2::framework; // for Produces, Configuable diff --git a/PWGJE/Core/FastJetUtilities.h b/PWGJE/Core/FastJetUtilities.h index 2f54f92122b..506036c222f 100644 --- a/PWGJE/Core/FastJetUtilities.h +++ b/PWGJE/Core/FastJetUtilities.h @@ -40,7 +40,7 @@ namespace fastjetutilities class fastjet_user_info : public fastjet::PseudoJet::UserInfoBase { JetConstituentStatus status; // the status of each particle (Options are: TrueParticle (final state particles in generator event which arent special), HFParticle (heavy-flavour particle of interest in generator event), ThermalParticle (particles belonging to the thermal backgound), DecaySisterParticle (other particles poduced in the decay resulting in a non-prompt heavy-flavour particle of interest)) - int index; // a number unique to each particle in the event + int index; // a number unique to each particle in the event public: fastjet_user_info() diff --git a/PWGJE/Core/JetBkgSubUtils.cxx b/PWGJE/Core/JetBkgSubUtils.cxx index 45f79a9fe97..91254ddf7a8 100644 --- a/PWGJE/Core/JetBkgSubUtils.cxx +++ b/PWGJE/Core/JetBkgSubUtils.cxx @@ -15,8 +15,6 @@ #include "PWGJE/Core/JetBkgSubUtils.h" -#include "Common/Core/RecoDecay.h" - #include #include @@ -29,6 +27,7 @@ #include #include +#include #include #include diff --git a/PWGJE/Core/JetFindingUtilities.h b/PWGJE/Core/JetFindingUtilities.h index 26f00e0e38c..37ca4eddaa5 100644 --- a/PWGJE/Core/JetFindingUtilities.h +++ b/PWGJE/Core/JetFindingUtilities.h @@ -30,7 +30,6 @@ #include #include -#include #include #include @@ -97,12 +96,12 @@ bool isTrackSelected(T const& track, int trackSelection, const U* candidate = nu if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { return false; } - if (candidate != nullptr) { - if (jetcandidateutilities::isDaughterTrack(track, *candidate)) { - return false; - } + if (candidate != nullptr) { + if (jetcandidateutilities::isDaughterTrack(track, *candidate)) { + return false; } - return true; + } + return true; } /** diff --git a/PWGJE/Core/JetMatchingUtilities.h b/PWGJE/Core/JetMatchingUtilities.h index 38c5bc29774..2285d40b53b 100644 --- a/PWGJE/Core/JetMatchingUtilities.h +++ b/PWGJE/Core/JetMatchingUtilities.h @@ -24,6 +24,8 @@ #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "Common/Core/RecoDecay.h" + #include #include diff --git a/PWGJE/Core/JetUtilities.h b/PWGJE/Core/JetUtilities.h index eeb18938dba..c2f555689ce 100644 --- a/PWGJE/Core/JetUtilities.h +++ b/PWGJE/Core/JetUtilities.h @@ -20,15 +20,10 @@ #include "Common/Core/RecoDecay.h" -#include +#include -#include #include -#include -#include -#include #include -#include #include diff --git a/PWGJE/Core/MlResponseHfTagging.h b/PWGJE/Core/MlResponseHfTagging.h index be16b0cd450..4740a087a79 100644 --- a/PWGJE/Core/MlResponseHfTagging.h +++ b/PWGJE/Core/MlResponseHfTagging.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/PWGJE/Core/emcalCrossTalkEmulation.cxx b/PWGJE/Core/emcalCrossTalkEmulation.cxx index 32b08cd13dc..ebd6fa0922a 100644 --- a/PWGJE/Core/emcalCrossTalkEmulation.cxx +++ b/PWGJE/Core/emcalCrossTalkEmulation.cxx @@ -20,12 +20,15 @@ #include #include #include -#include #include +#include + +#include #include // std::find_if #include #include // size_t +#include #include // std::abs #include // setw #include // left and right @@ -34,13 +37,6 @@ #include #include #include -// #include "Framework/OutputObjHeader.h" - -// #include "Common/CCDB/EventSelectionParams.h" -#include -#include - -#include using namespace o2; using namespace o2::emccrosstalk; diff --git a/PWGJE/Core/emcalCrossTalkEmulation.h b/PWGJE/Core/emcalCrossTalkEmulation.h index fb84ec7c1ad..e597ebba4b0 100644 --- a/PWGJE/Core/emcalCrossTalkEmulation.h +++ b/PWGJE/Core/emcalCrossTalkEmulation.h @@ -21,9 +21,8 @@ #include #include #include -#include +#include -#include #include #include diff --git a/PWGJE/DataModel/EMCALClusters.h b/PWGJE/DataModel/EMCALClusters.h index e28931982b5..9384ef1a9b6 100644 --- a/PWGJE/DataModel/EMCALClusters.h +++ b/PWGJE/DataModel/EMCALClusters.h @@ -49,11 +49,12 @@ const EMCALClusterDefinition kV3SmallestTimeDiff(ClusterAlgorithm_t::kV3, 42, 1, const EMCALClusterDefinition kV3MostSplitSmallTimeDiff(ClusterAlgorithm_t::kV3, 43, 1, "kV3MostSplitSmallTimeDiff", 0.5, 0.1, -10000, 10000, 500, true, 0., false); const EMCALClusterDefinition kV3MostSplitSmallerTimeDiff(ClusterAlgorithm_t::kV3, 44, 1, "kV3MostSplitSmallerTimeDiff", 0.5, 0.1, -10000, 10000, 100, true, 0., false); const EMCALClusterDefinition kV3MostSplitSmallestTimeDiff(ClusterAlgorithm_t::kV3, 45, 1, "kV3MostSplitSmallestTimeDiff", 0.5, 0.1, -10000, 10000, 50, true, 0., false); +const EMCALClusterDefinition kV3MostSplitSmallestTimeDiffLowestSeed(ClusterAlgorithm_t::kV3, 50, 1, "kV3MostSplitSmallestTimeDiffLowestSeed", 0.1, 0.1, -10000, 10000, 50, true, 0., false); /// \brief function returns EMCALClusterDefinition for the given name /// \param name name of the cluster definition /// \return EMCALClusterDefinition for the given name -const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& clusterDefinitionName) +inline const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& clusterDefinitionName) { if (clusterDefinitionName == "kV3NoSplit") { return kV3NoSplit; @@ -89,6 +90,8 @@ const EMCALClusterDefinition getClusterDefinitionFromString(const std::string& c return kV3MostSplitSmallerTimeDiff; } else if (clusterDefinitionName == "kV3MostSplitSmallestTimeDiff") { return kV3MostSplitSmallestTimeDiff; + } else if (clusterDefinitionName == "kV3MostSplitSmallestTimeDiffLowestSeed") { + return kV3MostSplitSmallestTimeDiffLowestSeed; } else { throw std::invalid_argument("Cluster definition name not recognized"); } diff --git a/PWGJE/DataModel/GammaJetAnalysisTree.h b/PWGJE/DataModel/GammaJetAnalysisTree.h index 8b679097c4f..1f527ff8137 100644 --- a/PWGJE/DataModel/GammaJetAnalysisTree.h +++ b/PWGJE/DataModel/GammaJetAnalysisTree.h @@ -17,11 +17,12 @@ #ifndef PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_ #define PWGJE_DATAMODEL_GAMMAJETANALYSISTREE_H_ -#include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/DataModel/EMCALClusters.h" -#include "PWGJE/DataModel/Jet.h" +#include -#include "Framework/AnalysisDataModel.h" +#include + +#include +#include namespace o2::aod::gjanalysis { diff --git a/PWGJE/DataModel/JetReducedData.h b/PWGJE/DataModel/JetReducedData.h index 039a1ec46de..1cd94a96d03 100644 --- a/PWGJE/DataModel/JetReducedData.h +++ b/PWGJE/DataModel/JetReducedData.h @@ -22,6 +22,8 @@ #include #include // IWYU pragma: keep +#include +#include #include #include diff --git a/PWGJE/DataModel/JetReducedDataDQ.h b/PWGJE/DataModel/JetReducedDataDQ.h index d8e633cf036..1249263a71f 100644 --- a/PWGJE/DataModel/JetReducedDataDQ.h +++ b/PWGJE/DataModel/JetReducedDataDQ.h @@ -22,6 +22,8 @@ #include #include // IWYU pragma: keep +#include +#include #include #include diff --git a/PWGJE/DataModel/JetReducedDataV0.h b/PWGJE/DataModel/JetReducedDataV0.h index ec460d5b186..e9d4e4040c2 100644 --- a/PWGJE/DataModel/JetReducedDataV0.h +++ b/PWGJE/DataModel/JetReducedDataV0.h @@ -21,6 +21,8 @@ #include #include // IWYU pragma: keep +#include +#include #include #include diff --git a/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h b/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h index 8cd65eedcb5..9b3eef803a8 100644 --- a/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h +++ b/PWGJE/DataModel/PhotonChargedTriggerCorrelation.h @@ -19,11 +19,10 @@ #define PWGJE_DATAMODEL_PHOTONCHARGEDTRIGGERCORRELATION_H_ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" -#include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { diff --git a/PWGJE/JetFinders/jetFinder.h b/PWGJE/JetFinders/jetFinder.h index d664e5781da..d45cfa15506 100644 --- a/PWGJE/JetFinders/jetFinder.h +++ b/PWGJE/JetFinders/jetFinder.h @@ -21,8 +21,6 @@ #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetFinder.h" #include "PWGJE/Core/JetFindingUtilities.h" -#include "PWGJE/DataModel/EMCALClusterDefinition.h" -#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" @@ -32,7 +30,6 @@ #include #include #include -#include #include #include // IWYU pragma: export @@ -46,6 +43,8 @@ #include #include +#include + template struct JetFinderTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderHF.h b/PWGJE/JetFinders/jetFinderHF.h index b5e9a531ff3..3016cdb5265 100644 --- a/PWGJE/JetFinders/jetFinderHF.h +++ b/PWGJE/JetFinders/jetFinderHF.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include // IWYU pragma: export @@ -45,6 +44,8 @@ #include #include +#include + template struct JetFinderHFTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderHFHFBar.h b/PWGJE/JetFinders/jetFinderHFHFBar.h index 77635798346..ec4cfa9d94c 100644 --- a/PWGJE/JetFinders/jetFinderHFHFBar.h +++ b/PWGJE/JetFinders/jetFinderHFHFBar.h @@ -32,7 +32,6 @@ #include #include #include -#include #include #include // IWYU pragma: export @@ -45,6 +44,8 @@ #include #include +#include + template struct JetFinderHFHFBarTask { o2::framework::Produces jetsTable; diff --git a/PWGJE/JetFinders/jetFinderV0.h b/PWGJE/JetFinders/jetFinderV0.h index 2b9b1d76dbd..14c2f977ada 100644 --- a/PWGJE/JetFinders/jetFinderV0.h +++ b/PWGJE/JetFinders/jetFinderV0.h @@ -28,7 +28,6 @@ #include #include #include -#include #include #include // IWYU pragma: export @@ -41,6 +40,8 @@ #include #include +#include + template struct JetFinderV0Task { diff --git a/PWGJE/TableProducer/Matching/jetMatchingMC.h b/PWGJE/TableProducer/Matching/jetMatchingMC.h index a78c48a2800..95aceb4f6ed 100644 --- a/PWGJE/TableProducer/Matching/jetMatchingMC.h +++ b/PWGJE/TableProducer/Matching/jetMatchingMC.h @@ -28,6 +28,7 @@ #include #include #include +#include #include diff --git a/PWGJE/TableProducer/derivedDataProducer.cxx b/PWGJE/TableProducer/derivedDataProducer.cxx index 7182fbcec05..6a482f981df 100644 --- a/PWGJE/TableProducer/derivedDataProducer.cxx +++ b/PWGJE/TableProducer/derivedDataProducer.cxx @@ -13,9 +13,6 @@ // /// \author Nima Zardoshti -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGHF/DataModel/DerivedTables.h" -#include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGJE/Core/JetDQUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetV0Utilities.h" @@ -25,10 +22,15 @@ #include "PWGJE/DataModel/JetReducedDataDQ.h" #include "PWGJE/DataModel/JetReducedDataHF.h" #include "PWGJE/DataModel/JetReducedDataV0.h" +// +#include "PWGDQ/DataModel/ReducedInfoTables.h" +#include "PWGHF/DataModel/DerivedTables.h" +#include "PWGHF/Utils/utilsBfieldCCDB.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/mcCentrality.h" #include "PWGUD/Core/SGCutParHolder.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" @@ -40,25 +42,26 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "ReconstructionDataFormats/Vertex.h" +#include #include #include +#include +#include +#include #include +#include #include #include +#include #include #include +#include #include #include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/derivedDataSelector.cxx b/PWGJE/TableProducer/derivedDataSelector.cxx index 371dbc73f34..c9a0ca6ca32 100644 --- a/PWGJE/TableProducer/derivedDataSelector.cxx +++ b/PWGJE/TableProducer/derivedDataSelector.cxx @@ -22,9 +22,9 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetReducedDataSelector.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/derivedDataTriggerProducer.cxx b/PWGJE/TableProducer/derivedDataTriggerProducer.cxx index b90495d0bb6..2c80e811464 100644 --- a/PWGJE/TableProducer/derivedDataTriggerProducer.cxx +++ b/PWGJE/TableProducer/derivedDataTriggerProducer.cxx @@ -18,10 +18,10 @@ #include "EventFiltering/filterTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/derivedDataWriter.cxx b/PWGJE/TableProducer/derivedDataWriter.cxx index e5676af0d58..41f4d80d227 100644 --- a/PWGJE/TableProducer/derivedDataWriter.cxx +++ b/PWGJE/TableProducer/derivedDataWriter.cxx @@ -28,9 +28,9 @@ #include "PWGJE/DataModel/JetReducedDataHF.h" #include "PWGJE/DataModel/JetReducedDataSelector.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx b/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx index 8de689c2ee7..7f9e9dfe7dc 100644 --- a/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalClusterHadronicCorrectionTask.cxx @@ -12,21 +12,18 @@ // **Hadronic Correction in the EMCAL framework: to avoid the double counting of the charged particles' contribution in jets** /// \author Archita Rani Dash -#include "PWGJE/DataModel/EMCALClusterDefinition.h" -#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include #include +#include #include +#include #include #include #include -#include "TVector2.h" #include #include diff --git a/PWGJE/TableProducer/emcalCorrectionTask.cxx b/PWGJE/TableProducer/emcalCorrectionTask.cxx index 3b7c919b7e2..037f793a0d1 100644 --- a/PWGJE/TableProducer/emcalCorrectionTask.cxx +++ b/PWGJE/TableProducer/emcalCorrectionTask.cxx @@ -50,13 +50,12 @@ #include #include #include +#include #include #include #include -#include - #include #include diff --git a/PWGJE/TableProducer/emcalMatchedTracksTask.cxx b/PWGJE/TableProducer/emcalMatchedTracksTask.cxx index 55781eb6bc4..14f8cc8b92a 100644 --- a/PWGJE/TableProducer/emcalMatchedTracksTask.cxx +++ b/PWGJE/TableProducer/emcalMatchedTracksTask.cxx @@ -18,14 +18,14 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "EMCALBase/Geometry.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include #include +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx index 33cafe0db0c..d60275c6fac 100644 --- a/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx +++ b/PWGJE/TableProducer/eventwiseConstituentSubtractor.cxx @@ -20,18 +20,19 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include #include +#include #include #include #include -#include +#include #include +#include #include +#include #include #include diff --git a/PWGJE/TableProducer/heavyFlavourDefinition.cxx b/PWGJE/TableProducer/heavyFlavourDefinition.cxx index a9f52f96a35..57027ad8b13 100644 --- a/PWGJE/TableProducer/heavyFlavourDefinition.cxx +++ b/PWGJE/TableProducer/heavyFlavourDefinition.cxx @@ -18,9 +18,9 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetTagging.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/jetEventWeightMCD.cxx b/PWGJE/TableProducer/jetEventWeightMCD.cxx index ddb518e1bba..f294adc0511 100644 --- a/PWGJE/TableProducer/jetEventWeightMCD.cxx +++ b/PWGJE/TableProducer/jetEventWeightMCD.cxx @@ -16,9 +16,9 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/jetEventWeightMCP.cxx b/PWGJE/TableProducer/jetEventWeightMCP.cxx index 7f262e998ea..0bc5728a0e0 100644 --- a/PWGJE/TableProducer/jetEventWeightMCP.cxx +++ b/PWGJE/TableProducer/jetEventWeightMCP.cxx @@ -15,8 +15,8 @@ #include "PWGJE/DataModel/Jet.h" -#include "Framework/AnalysisTask.h" #include +#include #include #include #include diff --git a/PWGJE/TableProducer/jetTaggerHF.cxx b/PWGJE/TableProducer/jetTaggerHF.cxx index 6878544163a..10cbcef6286 100644 --- a/PWGJE/TableProducer/jetTaggerHF.cxx +++ b/PWGJE/TableProducer/jetTaggerHF.cxx @@ -16,8 +16,6 @@ /// \author Hanseo Park /// \author Hadi Hassan , University of Jyväskylä -#include "MlResponse.h" - #include "PWGJE/Core/JetTaggingUtilities.h" #include "PWGJE/Core/MlResponseHfTagging.h" #include "PWGJE/DataModel/Jet.h" @@ -25,12 +23,13 @@ #include "PWGJE/DataModel/JetTagging.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Tools/ML/MlResponse.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" #include +#include +#include #include +#include #include #include #include @@ -42,6 +41,7 @@ #include #include +#include #include diff --git a/PWGJE/TableProducer/jetTrackDerived.cxx b/PWGJE/TableProducer/jetTrackDerived.cxx index 9111ae36c3c..db9a7f5325b 100644 --- a/PWGJE/TableProducer/jetTrackDerived.cxx +++ b/PWGJE/TableProducer/jetTrackDerived.cxx @@ -16,7 +16,6 @@ /// \brief Header for the trackJetQa task for the analysis of the tracks for jets.. /// -// O2 includes #include "PWGJE/DataModel/TrackJetQa.h" #include "Common/Core/TrackSelection.h" @@ -26,12 +25,12 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include #include +#include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/luminosityCalculator.cxx b/PWGJE/TableProducer/luminosityCalculator.cxx index 93a97aea92d..c4e9faafc94 100644 --- a/PWGJE/TableProducer/luminosityCalculator.cxx +++ b/PWGJE/TableProducer/luminosityCalculator.cxx @@ -16,11 +16,11 @@ #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include #include +#include #include #include #include diff --git a/PWGJE/TableProducer/luminosityProducer.cxx b/PWGJE/TableProducer/luminosityProducer.cxx index cafac8d6d2a..31823c7ebb7 100644 --- a/PWGJE/TableProducer/luminosityProducer.cxx +++ b/PWGJE/TableProducer/luminosityProducer.cxx @@ -21,17 +21,15 @@ #include "Common/CCDB/EventSelectionParams.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include #include -#include #include -#include #include #include diff --git a/PWGJE/TableProducer/mcOutlierRejector.cxx b/PWGJE/TableProducer/mcOutlierRejector.cxx index 3cdb38aa1c6..32fed7ebbb3 100644 --- a/PWGJE/TableProducer/mcOutlierRejector.cxx +++ b/PWGJE/TableProducer/mcOutlierRejector.cxx @@ -13,17 +13,21 @@ // /// \author Nima Zardoshti +#include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include #include +#include #include -#include #include +#include +#include +#include +#include +#include #include using namespace o2; diff --git a/PWGJE/TableProducer/rhoEstimator.cxx b/PWGJE/TableProducer/rhoEstimator.cxx index 71c183e9e83..c7f11e99b0c 100644 --- a/PWGJE/TableProducer/rhoEstimator.cxx +++ b/PWGJE/TableProducer/rhoEstimator.cxx @@ -20,15 +20,15 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include #include +#include #include #include -#include +#include #include +#include #include #include diff --git a/PWGJE/TableProducer/secondaryVertexReconstruction.cxx b/PWGJE/TableProducer/secondaryVertexReconstruction.cxx index 8bab0ea0c05..e2f2246b21b 100644 --- a/PWGJE/TableProducer/secondaryVertexReconstruction.cxx +++ b/PWGJE/TableProducer/secondaryVertexReconstruction.cxx @@ -22,22 +22,22 @@ #include "Common/Core/trackUtilities.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/DCA.h" #include +#include +#include #include #include +#include +#include #include +#include #include #include #include #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/bjetCentMult.cxx b/PWGJE/Tasks/bjetCentMult.cxx index d2a17c4708b..576afeb4ac0 100644 --- a/PWGJE/Tasks/bjetCentMult.cxx +++ b/PWGJE/Tasks/bjetCentMult.cxx @@ -19,14 +19,13 @@ #include "PWGJE/Core/JetTaggingUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "PWGJE/DataModel/JetTagging.h" -#include "Common/DataModel/Multiplicity.h" - -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" #include +#include +#include +#include #include #include #include @@ -35,9 +34,8 @@ #include #include -#include -#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/bjetTaggingGnn.cxx b/PWGJE/Tasks/bjetTaggingGnn.cxx index be7ec455b65..8a48eab4af5 100644 --- a/PWGJE/Tasks/bjetTaggingGnn.cxx +++ b/PWGJE/Tasks/bjetTaggingGnn.cxx @@ -15,35 +15,40 @@ /// \author Changhwan Choi , Pusan National University #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/Core/JetTaggingUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetTagging.h" -#include "Common/CCDB/TriggerAliases.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" #include "Common/DataModel/EventSelection.h" - -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#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; diff --git a/PWGJE/Tasks/bjetTaggingML.cxx b/PWGJE/Tasks/bjetTaggingML.cxx index 6e1b135b745..002f3b4bf02 100644 --- a/PWGJE/Tasks/bjetTaggingML.cxx +++ b/PWGJE/Tasks/bjetTaggingML.cxx @@ -23,10 +23,10 @@ #include "Common/Core/RecoDecay.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/bjetTreeCreator.cxx b/PWGJE/Tasks/bjetTreeCreator.cxx index 4065a6cf334..a5c85560f26 100644 --- a/PWGJE/Tasks/bjetTreeCreator.cxx +++ b/PWGJE/Tasks/bjetTreeCreator.cxx @@ -25,13 +25,13 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include #include +#include #include +#include #include #include #include @@ -49,6 +49,8 @@ #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGJE/Tasks/chargedJetHadron.cxx b/PWGJE/Tasks/chargedJetHadron.cxx index e938a5d8bff..fd4b5831977 100644 --- a/PWGJE/Tasks/chargedJetHadron.cxx +++ b/PWGJE/Tasks/chargedJetHadron.cxx @@ -21,14 +21,14 @@ #include "Common/Core/RecoDecay.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include +#include #include #include #include diff --git a/PWGJE/Tasks/dijetFinderQA.cxx b/PWGJE/Tasks/dijetFinderQA.cxx index 5c9f39f1a84..defb8a6c926 100644 --- a/PWGJE/Tasks/dijetFinderQA.cxx +++ b/PWGJE/Tasks/dijetFinderQA.cxx @@ -18,10 +18,10 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/emcCellMonitor.cxx b/PWGJE/Tasks/emcCellMonitor.cxx index 880ce14e490..0df39215cb2 100644 --- a/PWGJE/Tasks/emcCellMonitor.cxx +++ b/PWGJE/Tasks/emcCellMonitor.cxx @@ -9,15 +9,15 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsEMCAL/Constants.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/emcClusterMonitor.cxx b/PWGJE/Tasks/emcClusterMonitor.cxx index fbb8885c5be..b014ffae8fb 100644 --- a/PWGJE/Tasks/emcClusterMonitor.cxx +++ b/PWGJE/Tasks/emcClusterMonitor.cxx @@ -14,14 +14,14 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "EMCALBase/Geometry.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/emcEventSelectionQA.cxx b/PWGJE/Tasks/emcEventSelectionQA.cxx index 8ba3f5168c8..ff39021dce6 100644 --- a/PWGJE/Tasks/emcEventSelectionQA.cxx +++ b/PWGJE/Tasks/emcEventSelectionQA.cxx @@ -19,10 +19,10 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include #include #include #include diff --git a/PWGJE/Tasks/emcVertexSelectionQA.cxx b/PWGJE/Tasks/emcVertexSelectionQA.cxx index eb579326966..da45a313015 100644 --- a/PWGJE/Tasks/emcVertexSelectionQA.cxx +++ b/PWGJE/Tasks/emcVertexSelectionQA.cxx @@ -18,11 +18,11 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/emcalGammaGammaBcWise.cxx b/PWGJE/Tasks/emcalGammaGammaBcWise.cxx index d9674888aed..aa5e99fb70b 100644 --- a/PWGJE/Tasks/emcalGammaGammaBcWise.cxx +++ b/PWGJE/Tasks/emcalGammaGammaBcWise.cxx @@ -22,20 +22,20 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "EMCALBase/Geometry.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include #include #include #include +#include #include +#include #include #include #include -#include "TLorentzVector.h" -#include "TVector3.h" +#include +#include #include #include diff --git a/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx b/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx index 273907b8056..61bff6d13e1 100644 --- a/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx +++ b/PWGJE/Tasks/emcalPi0EnergyScaleCalib.cxx @@ -15,22 +15,22 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "EMCALBase/Geometry.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include #include +#include #include #include #include #include -#include "TLorentzVector.h" -#include "TVector3.h" #include #include +#include #include +#include #include #include diff --git a/PWGJE/Tasks/fullJetSpectra.cxx b/PWGJE/Tasks/fullJetSpectra.cxx index 2c999e26100..0af05f60cac 100644 --- a/PWGJE/Tasks/fullJetSpectra.cxx +++ b/PWGJE/Tasks/fullJetSpectra.cxx @@ -23,20 +23,22 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" +#include "Common/DataModel/EventSelection.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include +#include +#include +#include #include +#include #include +#include #include #include +#include #include #include @@ -1298,7 +1300,7 @@ struct FullJetSpectra { registry.fill(HIST("hDetTrigcollisionCounter"), 2.5); // DetTrigCollWithVertexZ if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits) || !jetderiveddatautilities::selectTrigger(collision, triggerMaskBits)) { // applyRCTSelections doesn't work here - registry.fill(HIST("hDetTrigcollisionCounter"), 3.5); // EventsNotSatisfyingEvent+TriggerSelection + registry.fill(HIST("hDetTrigcollisionCounter"), 3.5); // EventsNotSatisfyingEvent+TriggerSelection return; } //- should this kTVX HW trigger be still in place? - Removing it for now; probably not needed if we are only interested in SW triggers diff --git a/PWGJE/Tasks/fullJetTriggerQATask.cxx b/PWGJE/Tasks/fullJetTriggerQATask.cxx index 88255a2dda7..4aff2f9ec2e 100644 --- a/PWGJE/Tasks/fullJetTriggerQATask.cxx +++ b/PWGJE/Tasks/fullJetTriggerQATask.cxx @@ -22,23 +22,22 @@ #include "Common/CCDB/TriggerAliases.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" #include +#include +#include #include #include #include #include #include -#include "TTree.h" #include #include #include #include +#include #include -#include #include #include diff --git a/PWGJE/Tasks/gammaJetTreeProducer.cxx b/PWGJE/Tasks/gammaJetTreeProducer.cxx index 656f8233b8d..de043149abe 100644 --- a/PWGJE/Tasks/gammaJetTreeProducer.cxx +++ b/PWGJE/Tasks/gammaJetTreeProducer.cxx @@ -14,44 +14,49 @@ /// \author Florian Jonas , UC Berkeley/LBNL /// \since 02.08.2024 -// C++ system headers first -#include - -#include -#include -#include - -// Framework and other headers after #include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetFinder.h" -#include "PWGJE/Core/JetFindingUtilities.h" -#include "PWGJE/Core/JetSubstructureUtilities.h" -#include "PWGJE/Core/JetUtilities.h" -#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/GammaJetAnalysisTree.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "EventFiltering/filterTables.h" - -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsEMCAL/AnalysisCluster.h" -#include "DataFormatsEMCAL/Cell.h" -#include "DataFormatsEMCAL/Constants.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" - -#include "TVector2.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 // \struct GammaJetTreeProducer /// \brief Task to produce a tree for gamma-jet analysis, including photons (and information of isolation) and charged and full jets @@ -65,8 +70,6 @@ using namespace o2::framework::expressions; using emcClusters = o2::soa::Join; using emcMCClusters = o2::soa::Join; -#include "Framework/runDataProcessing.h" - struct GammaJetTreeProducer { // analysis tree // charged jets diff --git a/PWGJE/Tasks/hadronPhotonCorrelation.cxx b/PWGJE/Tasks/hadronPhotonCorrelation.cxx index f84d69d621e..7040898d6d1 100644 --- a/PWGJE/Tasks/hadronPhotonCorrelation.cxx +++ b/PWGJE/Tasks/hadronPhotonCorrelation.cxx @@ -26,24 +26,22 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" -#include "Framework/InitContext.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include -// #include // o2-linter: disable= root/lorentz-vector (TLorentzVector is needed for TPythia8Decayer) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include -// #include -// #include #include #include diff --git a/PWGJE/Tasks/hfDebug.cxx b/PWGJE/Tasks/hfDebug.cxx index 4efaf6ce7c9..f5c96c13337 100644 --- a/PWGJE/Tasks/hfDebug.cxx +++ b/PWGJE/Tasks/hfDebug.cxx @@ -14,28 +14,32 @@ /// \author Nima Zardoshti // -#include "PWGHF/Utils/utilsMcGen.h" -#include "PWGJE/Core/FastJetUtilities.h" -#include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetSubtraction.h" +// +#include "PWGHF/Core/DecayChannels.h" +#include "PWGHF/DataModel/DerivedTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#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; -#include "Framework/runDataProcessing.h" - struct HFDebugTask { HistogramRegistry registry{"registry", {{"h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, diff --git a/PWGJE/Tasks/hfFragmentationFunction.cxx b/PWGJE/Tasks/hfFragmentationFunction.cxx index e07dca07775..abcdcdb28b9 100644 --- a/PWGJE/Tasks/hfFragmentationFunction.cxx +++ b/PWGJE/Tasks/hfFragmentationFunction.cxx @@ -26,20 +26,20 @@ #include "Common/Core/RecoDecay.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include #include +#include #include +#include #include #include #include #include -#include "TVector3.h" #include +#include #include @@ -278,7 +278,7 @@ struct HfFragmentationFunction { // filling table distJetTable(axisDistance, - jet.pt(), jet.eta(), jet.phi(), jet.template tracks_as().size(), + jet.pt(), jet.eta(), jet.phi(), jet.template tracks_as().size() + jet.template candidates_as().size(), candidate.pt(), candidate.eta(), candidate.phi(), candidate.m(), candidate.y(), candidate.mlScores()[0], candidate.mlScores()[1], candidate.mlScores()[2]); break; // get out of candidates' loop after first HF particle is found in jet @@ -319,7 +319,7 @@ struct HfFragmentationFunction { registry.fill(HIST("h_collision_counter"), 0.0); // skip collisions outside of |z| < vertexZCut - if (std::abs(mccollision.posZ()) > vertexZCut) { + if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)) { continue; } registry.fill(HIST("h_collision_counter"), 1.0); @@ -366,7 +366,7 @@ struct HfFragmentationFunction { // store data in MC detector level table mcddistJetTable(jetutilities::deltaR(mcdjet, mcdd0cand), - mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.tracks_as().size(), // detector level jet + mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.tracks_as().size() + mcdjet.candidates_as().size(), // detector level jet mcdd0cand.pt(), mcdd0cand.eta(), mcdd0cand.phi(), mcdd0cand.m(), mcdd0cand.y(), (mcdd0cand.originMcRec() == RecoDecay::OriginType::Prompt), // detector level D0 candidate mcdjet.has_matchedJetCand(), mcdd0cand.mlScores()[0], mcdd0cand.mlScores()[1], mcdd0cand.mlScores()[2], // // Machine Learning PID scores: background, prompt, non-prompt matchedFrom, selectedAs); // D0 = +1, D0bar = -1, neither = 0 @@ -388,8 +388,8 @@ struct HfFragmentationFunction { // store data in MC detector level table (calculate angular distance in eta-phi plane on the fly) mcpdistJetTable(jetutilities::deltaR(mcpjet, mcpd0cand), - mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.tracks_as().size(), // particle level jet - mcpd0cand.pt(), mcpd0cand.eta(), mcpd0cand.phi(), mcpd0cand.y(), (mcpd0cand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level D0 + mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.tracks_as().size() + mcpjet.candidates_as().size(), // particle level jet + mcpd0cand.pt(), mcpd0cand.eta(), mcpd0cand.phi(), mcpd0cand.y(), (mcpd0cand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level D0 mcpjet.has_matchedJetCand()); } } @@ -410,7 +410,7 @@ struct HfFragmentationFunction { for (const auto& mccollision : mccollisions) { registry.fill(HIST("h_collision_counter"), 0.0); // skip collisions outside of |z| < vertexZCut - if (std::abs(mccollision.posZ()) > vertexZCut) { + if (!jetderiveddatautilities::selectCollision(mccollision, eventSelectionBits) || !(std::abs(mccollision.posZ()) < vertexZCut)) { continue; } registry.fill(HIST("h_collision_counter"), 1.0); @@ -465,21 +465,21 @@ struct HfFragmentationFunction { } // store matched particle and detector level data in one single table (calculate angular distance in eta-phi plane on the fly) - matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as().size(), // particle level jet - mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF - jetutilities::deltaR(mcdjet, mcdcand), mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.template tracks_as().size(), // detector level jet - mcdcand.pt(), mcdcand.eta(), mcdcand.phi(), mcdcand.m(), mcdcand.y(), (mcdcand.originMcRec() == RecoDecay::OriginType::Prompt), // detector level HF - mcdcand.mlScores()[0], mcdcand.mlScores()[1], mcdcand.mlScores()[2], // Machine Learning PID scores: background, prompt, non-prompt - matchedFrom, selectedAs); // HF = +1, HFbar = -1, neither = 0 + matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as().size() + mcpjet.template candidates_as().size(), // particle level jet + mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF + jetutilities::deltaR(mcdjet, mcdcand), mcdjet.pt(), mcdjet.eta(), mcdjet.phi(), mcdjet.template tracks_as().size() + +mcdjet.template candidates_as().size(), // detector level jet + mcdcand.pt(), mcdcand.eta(), mcdcand.phi(), mcdcand.m(), mcdcand.y(), (mcdcand.originMcRec() == RecoDecay::OriginType::Prompt), // detector level HF + mcdcand.mlScores()[0], mcdcand.mlScores()[1], mcdcand.mlScores()[2], // Machine Learning PID scores: background, prompt, non-prompt + matchedFrom, selectedAs); // HF = +1, HFbar = -1, neither = 0 } } else { // store matched particle and detector level data in one single table (calculate angular distance in eta-phi plane on the fly) - matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as().size(), // particle level jet - mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF - -2, -2, -2, -2, -2, // detector level jet - -2, -2, -2, -2, -2, -2, // detector level HF - -2, -2, -2, // Machine Learning PID scores: background, prompt, non-prompt - -2, -2); // HF = +1, HFbar = -1, neither = 0 + matchJetTable(jetutilities::deltaR(mcpjet, mcpcand), mcpjet.pt(), mcpjet.eta(), mcpjet.phi(), mcpjet.template tracks_as().size() + +mcpjet.template candidates_as().size(), // particle level jet + mcpcand.pt(), mcpcand.eta(), mcpcand.phi(), mcpcand.y(), (mcpcand.originMcGen() == RecoDecay::OriginType::Prompt), // particle level HF + -2, -2, -2, -2, -2, // detector level jet + -2, -2, -2, -2, -2, -2, // detector level HF + -2, -2, -2, // Machine Learning PID scores: background, prompt, non-prompt + -2, -2); // HF = +1, HFbar = -1, neither = 0 } } // end of mcpjets loop } // end of mccollisions loop diff --git a/PWGJE/Tasks/jetBackgroundAnalysis.cxx b/PWGJE/Tasks/jetBackgroundAnalysis.cxx index 84925d2dafe..f7a0c56c7ac 100644 --- a/PWGJE/Tasks/jetBackgroundAnalysis.cxx +++ b/PWGJE/Tasks/jetBackgroundAnalysis.cxx @@ -22,6 +22,7 @@ #include "Common/Core/RecoDecay.h" +#include #include #include #include @@ -30,7 +31,6 @@ #include #include -#include #include #include diff --git a/PWGJE/Tasks/jetChCorr.cxx b/PWGJE/Tasks/jetChCorr.cxx index 070d4194223..be4fcf59b0b 100644 --- a/PWGJE/Tasks/jetChCorr.cxx +++ b/PWGJE/Tasks/jetChCorr.cxx @@ -19,36 +19,32 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include "fastjet/ClusterSequenceArea.hh" -#include "fastjet/PseudoJet.hh" +#include #include +#include #include #include #include -// #include "PWGLF/DataModel/LFResonanceTables.h" - -#include -#include -#include -#include -#include - using namespace std; using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; int trackSelection = -1; int trackL = -1; diff --git a/PWGJE/Tasks/jetChargedV2.cxx b/PWGJE/Tasks/jetChargedV2.cxx index f33874ca55d..2dbdb7e5206 100644 --- a/PWGJE/Tasks/jetChargedV2.cxx +++ b/PWGJE/Tasks/jetChargedV2.cxx @@ -13,44 +13,39 @@ /// \file jetChargedV2.cxx /// \brief This file contains the implementation for the Charged Jet v2 analysis in the ALICE experiment -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetFinder.h" #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "Common/Core/EventPlaneHelper.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/Qvectors.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "EventFiltering/filterTables.h" - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.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 using namespace o2; diff --git a/PWGJE/Tasks/jetCorrelationD0.cxx b/PWGJE/Tasks/jetCorrelationD0.cxx index 22c08b9b272..44a912e7221 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -13,24 +13,31 @@ /// \brief Task for analysing D0 triggered jet events. /// \author Matthew Ockleton matthew.ockleton@cern.ch, University of Liverpool -#include "PWGHF/Core/DecayChannels.h" -#include "PWGHF/DataModel/AliasTables.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" #include "Common/Core/RecoDecay.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" - +#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; diff --git a/PWGJE/Tasks/jetCrossSectionEfficiency.cxx b/PWGJE/Tasks/jetCrossSectionEfficiency.cxx index 8f1c9858a5b..240fb3e7a20 100644 --- a/PWGJE/Tasks/jetCrossSectionEfficiency.cxx +++ b/PWGJE/Tasks/jetCrossSectionEfficiency.cxx @@ -17,17 +17,24 @@ #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include +#include #include #include #include +#include +#include + #include #include +#include #include +#include +#include #include using namespace o2; diff --git a/PWGJE/Tasks/jetD0AngSubstructure.cxx b/PWGJE/Tasks/jetD0AngSubstructure.cxx index 05c1923dd96..9650d7ea4bb 100644 --- a/PWGJE/Tasks/jetD0AngSubstructure.cxx +++ b/PWGJE/Tasks/jetD0AngSubstructure.cxx @@ -16,29 +16,22 @@ // \inherited from D0 fragmentation and Ds // \P. Dhankher -#include "PWGHF/Core/DecayChannels.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetSubtraction.h" -#include "Common/Core/RecoDecay.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include +#include +#include +#include #include #include #include -#include +#include #include #include #include -#include "TVector3.h" +#include #include #include diff --git a/PWGJE/Tasks/jetDebug.cxx b/PWGJE/Tasks/jetDebug.cxx index be4a84f1a38..53b440e8ea8 100644 --- a/PWGJE/Tasks/jetDebug.cxx +++ b/PWGJE/Tasks/jetDebug.cxx @@ -14,27 +14,35 @@ /// \author Nima Zardoshti // -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#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; -#include "Framework/runDataProcessing.h" - struct JetDebugTask { HistogramRegistry registry{"registry", {{"h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, -0.5, 3.5}}}}, diff --git a/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx b/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx index 3e2e12d378a..629ba2f75f3 100644 --- a/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx +++ b/PWGJE/Tasks/jetDsSpectrumAndSubstructure.cxx @@ -17,28 +17,23 @@ /// \author Monalisa Melo // -#include "PWGHF/Core/DecayChannels.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetSubtraction.h" -#include "Common/Core/RecoDecay.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include #include #include -#include +#include #include #include #include -#include "TVector3.h" +#include #include #include diff --git a/PWGJE/Tasks/jetFinderFullQA.cxx b/PWGJE/Tasks/jetFinderFullQA.cxx index 6dc665fe07d..69b18b6e4af 100644 --- a/PWGJE/Tasks/jetFinderFullQA.cxx +++ b/PWGJE/Tasks/jetFinderFullQA.cxx @@ -20,12 +20,12 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include #include +#include #include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetFinderV0QA.cxx b/PWGJE/Tasks/jetFinderV0QA.cxx index a80ee0eea25..55036241730 100644 --- a/PWGJE/Tasks/jetFinderV0QA.cxx +++ b/PWGJE/Tasks/jetFinderV0QA.cxx @@ -18,11 +18,11 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetFormationTimeReclustering.cxx b/PWGJE/Tasks/jetFormationTimeReclustering.cxx index 3040175b9bc..b411fdddbe9 100644 --- a/PWGJE/Tasks/jetFormationTimeReclustering.cxx +++ b/PWGJE/Tasks/jetFormationTimeReclustering.cxx @@ -23,12 +23,10 @@ #ifndef PWGJE_TASKS_JETFORMATIONTIMERECLUSTERING_H_ #define PWGJE_TASKS_JETFORMATIONTIMERECLUSTERING_H_ -#include "PWGDQ/DataModel/ReducedInfoTables.h" -#include "PWGHF/DataModel/DerivedTables.h" #include "PWGJE/DataModel/Jet.h" // IWYU pragma: keep #include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetReducedDataDQ.h" #include "PWGJE/DataModel/JetSubstructure.h" // new +#include "PWGJE/DataModel/JetSubtraction.h" #include @@ -77,24 +75,22 @@ DECLARE_SOA_TABLE(CEWSJetTFSSs, "AOD", "CEWSJETTFSS", jetTFsubstructure::JetPt, #include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetFinder.h" -#include "PWGJE/Core/JetSubstructureUtilities.h" -#include "PWGJE/Core/JetUtilities.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include #include +#include #include +#include #include #include +#include #include #include -#include "fastjet/ClusterSequenceArea.hh" -#include "fastjet/PseudoJet.hh" +#include #include +#include #include #include diff --git a/PWGJE/Tasks/jetFragmentation.cxx b/PWGJE/Tasks/jetFragmentation.cxx index 0d3fe2965ed..f919d1f3ec3 100644 --- a/PWGJE/Tasks/jetFragmentation.cxx +++ b/PWGJE/Tasks/jetFragmentation.cxx @@ -23,7 +23,6 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/TrackSelectionTables.h" #include #include diff --git a/PWGJE/Tasks/jetHadronRecoil.cxx b/PWGJE/Tasks/jetHadronRecoil.cxx index a16770e19f1..0cfbcd2ea8d 100644 --- a/PWGJE/Tasks/jetHadronRecoil.cxx +++ b/PWGJE/Tasks/jetHadronRecoil.cxx @@ -23,19 +23,18 @@ #include "Common/Core/RecoDecay.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include #include +#include #include +#include #include #include -#include +#include #include -#include "TRandom3.h" +#include #include #include @@ -71,6 +70,7 @@ struct JetHadronRecoil { Configurable centralityMin{"centralityMin", -999.0, "minimum centrality"}; Configurable centralityMax{"centralityMax", 999.0, "maximum centrality"}; Configurable vertexZCut{"vertexZCut", 10.0f, "Accepted z-vertex range"}; + Configurable trackOccupancyInTimeRangeMax{"trackOccupancyInTimeRangeMax", 999999, "maximum track occupancy in time range"}; Configurable ptTTrefMin{"ptTTrefMin", 5, "reference minimum trigger track pt"}; Configurable ptTTrefMax{"ptTTrefMax", 7, "reference maximum trigger track pt"}; Configurable ptTTsigMin{"ptTTsigMin", 20, "signal minimum trigger track pt"}; @@ -94,7 +94,7 @@ struct JetHadronRecoil { Filter jetCuts = aod::jet::r == nround(jetR.node() * 100.0f); Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); Filter particleCuts = (aod::jmcparticle::pt >= trackPtMin && aod::jmcparticle::pt < trackPtMax && aod::jmcparticle::eta > trackEtaMin && aod::jmcparticle::eta < trackEtaMax); - Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centFT0M >= centralityMin && aod::jcollision::centFT0M < centralityMax); + Filter eventCuts = (nabs(aod::jcollision::posZ) < vertexZCut && aod::jcollision::centFT0M >= centralityMin && aod::jcollision::centFT0M < centralityMax && aod::jcollision::trackOccupancyInTimeRange < trackOccupancyInTimeRangeMax); std::vector ptBinningPart = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0, 50.0, 55.0, 60.0, @@ -148,8 +148,11 @@ struct JetHadronRecoil { jetReclusterer.recombScheme = fastjet::WTA_pt_scheme; registry.add("hZvtxSelected", "Z vertex position;Z_{vtx};entries", {HistType::kTH1F, {{80, -20, 20}}}, doSumw); + registry.add("hCentOccupancy", "centrality vs track occupancy;centrality (%);track occupancy", {HistType::kTH2F, {{100, 0, 100}, {200, 0, 10000}}}, doSumw); + registry.add("hCentRho", "centrality vs rho;centrality (%);#rho", {HistType::kTH2F, {{100, 0, 100}, {125, 0, 250}}}, doSumw); if (doprocessData || doprocessDataWithRhoSubtraction || doprocessMCD || doprocessMCDWithRhoSubtraction || doprocessMCDWeighted || doprocessMCDWeightedWithRhoSubtraction || doprocessMCP || doprocessMCPWeighted || doprocessMCPOnTheFly || doprocessMCPOnTheFlyWeighted) { + registry.add("hNtracksRho", "track multiplicity vs #rho;N_{tracks};#rho", {HistType::kTH2F, {{125, 0, 5000}, {125, 0, 250}}}, doSumw); registry.add("hNtrig", "number of triggers;trigger type;entries", {HistType::kTH1F, {{2, 0, 2}}}, doSumw); registry.add("hSignalTriggersPtHard", "Signal triggers vs PtHard", {HistType::kTH1F, {pThatAxis}}, doSumw); registry.add("hReferenceTriggersPtHard", "Reference triggers vs PtHard", {HistType::kTH1F, {pThatAxis}}, doSumw); @@ -169,6 +172,7 @@ struct JetHadronRecoil { registry.add("hJetEta", "jet #eta;#eta_{jet};entries", {HistType::kTH1F, {{100, -1.0, 1.0}}}, doSumw); registry.add("hJetPhi", "jet #phi;#phi_{jet};entries", {HistType::kTH1F, {{100, 0.0, o2::constants::math::TwoPI}}}, doSumw); registry.add("hJet3D", "3D jet distribution;p_{T};#eta;#phi", {HistType::kTH3F, {{500, -100, 400}, {100, -1.0, 1.0}, {100, 0.0, o2::constants::math::TwoPI}}}, doSumw); + registry.add("hJetPtArea", "jet p_{T}vs area;jet p_{T};A_{jet}", {HistType::kTH2F, {{500, -100, 400}, {100, 0, 2}}}, doSumw); } if (doprocessData || doprocessDataWithRhoSubtraction || doprocessMCD || doprocessMCDWithRhoSubtraction || doprocessMCDWeighted || doprocessMCDWeightedWithRhoSubtraction) { @@ -254,6 +258,7 @@ struct JetHadronRecoil { double phiTT = 0; double ptTT = 0; int nTT = 0; + int nTracks = 0; double leadingPT = 0; double leadingTrackPt = 0; double leadingJetPt = 0; @@ -296,7 +301,9 @@ struct JetHadronRecoil { registry.fill(HIST("hPhiTrack"), track.phi(), weight); registry.fill(HIST("hTrack3D"), track.pt(), track.eta(), track.phi(), weight); registry.fill(HIST("hPtTrackPtHard"), track.pt() / pTHat, track.pt(), weight); + nTracks++; } + registry.fill(HIST("hNtracksRho"), nTracks, rho); if (nTT > 0) { int trigNumber = rand->Integer(nTT); phiTT = phiTTAr[trigNumber]; @@ -341,6 +348,7 @@ struct JetHadronRecoil { registry.fill(HIST("hJetEta"), jet.eta(), weight); registry.fill(HIST("hJetPhi"), jet.phi(), weight); registry.fill(HIST("hJet3D"), jet.pt() - (rho * jet.area()), jet.eta(), jet.phi(), weight); + registry.fill(HIST("hJetPtArea"), jet.pt(), jet.area(), weight); if (nTT > 0) { float dphi = RecoDecay::constrainAngle(jet.phi() - phiTT); @@ -389,6 +397,7 @@ struct JetHadronRecoil { double phiTT = 0; double ptTT = 0; int nTT = 0; + int nTracks = 0; double leadingPT = 0; double leadingTrackPt = 0; double leadingJetPt = 0; @@ -431,7 +440,9 @@ struct JetHadronRecoil { registry.fill(HIST("hPhiTrack"), track.phi(), weight); registry.fill(HIST("hTrack3D"), track.pt(), track.eta(), track.phi(), weight); registry.fill(HIST("hPtTrackPtHard"), track.pt() / pTHat, track.pt(), weight); + nTracks++; } + registry.fill(HIST("hNtracksRho"), nTracks, rho); if (nTT > 0) { int trigNumber = rand->Integer(nTT); phiTT = phiTTAr[trigNumber]; @@ -642,7 +653,6 @@ struct JetHadronRecoil { const auto jetsTagColl = jetsTag.sliceBy(perColJetMC, collisionID); for (const auto& jetTag : jetsTagColl) { - if (jetTag.pt() > pTHatMaxMCP * pTHat) { if (outlierRejectEvent) { return; @@ -860,6 +870,8 @@ struct JetHadronRecoil { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); + registry.fill(HIST("hCentOccupancy"), collision.centFT0M(), collision.trackOccupancyInTimeRange()); + registry.fill(HIST("hCentRho"), collision.centFT0M(), collision.rho()); fillHistograms(jets, tracks, 1.0, collision.rho()); } PROCESS_SWITCH(JetHadronRecoil, processDataWithRhoSubtraction, "process data with rho subtraction", false); @@ -904,6 +916,8 @@ struct JetHadronRecoil { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ()); + registry.fill(HIST("hCentOccupancy"), collision.centFT0M(), collision.trackOccupancyInTimeRange()); + registry.fill(HIST("hCentRho"), collision.centFT0M(), collision.rho()); fillHistogramsMCD(jets, tracks, 1.0, collision.rho(), collision.mcCollision().ptHard()); } PROCESS_SWITCH(JetHadronRecoil, processMCDWithRhoSubtraction, "process MC detector level with rho subtraction", false); @@ -948,6 +962,8 @@ struct JetHadronRecoil { return; } registry.fill(HIST("hZvtxSelected"), collision.posZ(), collision.mcCollision().weight()); + registry.fill(HIST("hCentOccupancy"), collision.centFT0M(), collision.trackOccupancyInTimeRange(), collision.mcCollision().weight()); + registry.fill(HIST("hCentRho"), collision.centFT0M(), collision.rho()); fillHistogramsMCD(jets, tracks, collision.mcCollision().weight(), collision.rho(), collision.mcCollision().ptHard()); } PROCESS_SWITCH(JetHadronRecoil, processMCDWeightedWithRhoSubtraction, "process MC detector level with event weights and rho subtraction", false); diff --git a/PWGJE/Tasks/jetLundReclustering.cxx b/PWGJE/Tasks/jetLundReclustering.cxx index b78c6f2b6ef..95b5b027931 100644 --- a/PWGJE/Tasks/jetLundReclustering.cxx +++ b/PWGJE/Tasks/jetLundReclustering.cxx @@ -23,17 +23,17 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include -#include "fastjet/ClusterSequenceArea.hh" -#include "fastjet/PseudoJet.hh" +#include #include +#include #include #include diff --git a/PWGJE/Tasks/jetMatchingQA.cxx b/PWGJE/Tasks/jetMatchingQA.cxx index 6770d42e47e..eac3b3cf4bf 100644 --- a/PWGJE/Tasks/jetMatchingQA.cxx +++ b/PWGJE/Tasks/jetMatchingQA.cxx @@ -17,8 +17,8 @@ #include "PWGJE/DataModel/Jet.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include +#include #include #include #include diff --git a/PWGJE/Tasks/jetOutlierQA.cxx b/PWGJE/Tasks/jetOutlierQA.cxx index 89daf7111ce..d0d802a95a8 100644 --- a/PWGJE/Tasks/jetOutlierQA.cxx +++ b/PWGJE/Tasks/jetOutlierQA.cxx @@ -17,11 +17,9 @@ #include "PWGJE/Core/JetFindingUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "PWGJE/DataModel/JetSubtraction.h" - -#include "Common/Core/RecoDecay.h" #include +#include #include #include #include @@ -29,17 +27,14 @@ #include #include -#include #include -#include -#include #include -#include +#include +#include #include #include #include -#include #include #include diff --git a/PWGJE/Tasks/jetPlanarFlow.cxx b/PWGJE/Tasks/jetPlanarFlow.cxx index 2b93d9b1255..480dcc69a53 100644 --- a/PWGJE/Tasks/jetPlanarFlow.cxx +++ b/PWGJE/Tasks/jetPlanarFlow.cxx @@ -24,18 +24,21 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include +#include +#include #include #include #include #include -#include "fastjet/contrib/AxesDefinition.hh" +#include +#include #include #include #include diff --git a/PWGJE/Tasks/jetShape.cxx b/PWGJE/Tasks/jetShape.cxx index a02940bd9a2..c48fad2f35c 100644 --- a/PWGJE/Tasks/jetShape.cxx +++ b/PWGJE/Tasks/jetShape.cxx @@ -13,27 +13,30 @@ /// \author Yuto Nishida /// \brief Task for measuring the dependence of the jet shape function rho(r) on the distance r from the jet axis. -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetUtilities.h" #include "PWGJE/DataModel/Jet.h" -#include "PWGLF/DataModel/mcCentrality.h" +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include #include #include diff --git a/PWGJE/Tasks/jetSpectraCharged.cxx b/PWGJE/Tasks/jetSpectraCharged.cxx index 09e02d67d4e..0d2644ef287 100644 --- a/PWGJE/Tasks/jetSpectraCharged.cxx +++ b/PWGJE/Tasks/jetSpectraCharged.cxx @@ -19,15 +19,16 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include #include +#include #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/jetSpectraEseTask.cxx b/PWGJE/Tasks/jetSpectraEseTask.cxx index 54dbc47901a..b0b2b638fb4 100644 --- a/PWGJE/Tasks/jetSpectraEseTask.cxx +++ b/PWGJE/Tasks/jetSpectraEseTask.cxx @@ -24,22 +24,28 @@ #include "Common/DataModel/EseTable.h" #include "Common/DataModel/Qvectors.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include +#include #include +#include +#include #include #include #include +#include #include #include #include #include +#include #include #include +#include + #include #include #include @@ -48,11 +54,13 @@ #include #include #include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; struct JetSpectraEseTask { + Configurable cfgEfficiency{"cfgEfficiency", "", "CCDB path to efficiency"}; Configurable jetPtMin{"jetPtMin", 5.0, "minimum jet pT cut"}; Configurable jetR{"jetR", 0.2, "jet resolution parameter"}; Configurable randomConeR{"randomConeR", 0.4, "size of random Cone for estimating background fluctuations"}; @@ -133,6 +141,12 @@ struct JetSpectraEseTask { static constexpr float Acceptance = 0.9f; static constexpr float LowFT0Cut = 1e-8; + Service ccdb; + struct Efficiency { + TH1D* hEff = nullptr; + bool isLoaded = false; + } cfg; + Filter trackCuts = (aod::jtrack::pt >= trackPtMin && aod::jtrack::pt < trackPtMax && aod::jtrack::eta > trackEtaMin && aod::jtrack::eta < trackEtaMax); Filter jetCuts = aod::jet::pt > jetPtMin&& aod::jet::r == nround(jetR.node() * Scaler) && nabs(aod::jet::eta) < Acceptance - jetR; Filter colFilter = nabs(aod::jcollision::posZ) < vertexZCut; @@ -140,10 +154,13 @@ struct JetSpectraEseTask { using ChargedMCDJets = soa::Filtered>; Preslice mcdjetsPerJCollision = o2::aod::jet::collisionId; Preslice tracksPerJCollision = o2::aod::jtrack::collisionId; + Preslice mcdTracksPerJCollision = o2::aod::jtrack::collisionId; + Preslice particlesPerJMcCollision = o2::aod::jmcparticle::mcCollisionId; SliceCache cache; using BinningType = ColumnBinningPolicy; BinningType corrBinning{{binsZVtx, binsCentrality}, true}; + Service pdg; enum class DetID { FT0C, FT0A, @@ -389,6 +406,47 @@ struct JetSpectraEseTask { registry.add("hOccupancy", "Occupancy;Occupancy;entries", {HistType::kTH1F, {{occAxis}}}); registry.add("hPsiOccupancy", "Occupancy;#Psi_{2};entries", {HistType::kTH3F, {{centAxis}, {150, -2.5, 2.5}, {occAxis}}}); } + if (doprocessMCGenTrack) { + LOGF(info, "JetSpectraEseTask::init() - MCGen track"); + registry.add("hTrackPtGen", "", {HistType::kTH1F, {{assocTrackPt}}}); + registry.add("hTrackEtaGen", "", {HistType::kTH1F, {{etaAxis}}}); + registry.add("hTrackPhiGen", "", {HistType::kTH1F, {{phiAxis}}}); + } + if (doprocessMCRecoTrack) { + LOGF(info, "JetSpectraEseTask::init() - MCRec track"); + registry.add("hTrackPtReco", "", {HistType::kTH1F, {{assocTrackPt}}}); + registry.add("hTrackEtaReco", "", {HistType::kTH1F, {{etaAxis}}}); + registry.add("hTrackPhiReco", "", {HistType::kTH1F, {{phiAxis}}}); + } + } + + void loadEfficiency(aod::BCsWithTimestamps::iterator const& bc) + { + uint64_t timestamp = bc.timestamp(); + if (cfg.isLoaded) { + return; + } + if (!cfgEfficiency.value.empty()) { + cfg.hEff = ccdb->getForTimeStamp(cfgEfficiency, timestamp); + if (cfg.hEff == nullptr) { + LOGF(fatal, "Could not load track efficiency from %s", cfgEfficiency.value.c_str()); + } + LOGF(info, "Loaded tracking efficiency from %s (%p)", cfgEfficiency.value.c_str(), (void*)cfg.hEff); + } + cfg.isLoaded = true; + return; + } + + template + double getEfficiency(TTrack track) + { + double eff{1.0}; + if (cfg.hEff) + eff = cfg.hEff->GetBinContent(cfg.hEff->FindBin(track.pt())); + if (eff == 0) + return -1.; + else + return 1. / eff; } template @@ -463,19 +521,25 @@ struct JetSpectraEseTask { for (const auto& track : tracks) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) continue; + double weff = getEfficiency(track); + if (weff < 0) + continue; auto deta = track.eta() - jet.eta(); auto dphi = RecoDecay::constrainAngle(track.phi() - jet.phi(), -o2::constants::math::PIHalf); - registry.fill(HIST("thn_jethad_corr_same"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0]); - hSameSub[lRndInd]->Fill(centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0]); + registry.fill(HIST("thn_jethad_corr_same"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0], weff); + hSameSub[lRndInd]->Fill(centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0], weff); } } for (const auto& track : tracks) { - registry.fill(HIST("trackQA/before/hTrackPt"), centrality, track.pt()); + double weff = getEfficiency(track); + if (weff < 0) + continue; + registry.fill(HIST("trackQA/before/hTrackPt"), centrality, track.pt(), weff); registry.fill(HIST("trackQA/before/hTrackEta"), centrality, track.eta()); registry.fill(HIST("trackQA/before/hTrackPhi"), centrality, track.phi()); if (!jetderiveddatautilities::selectTrack(track, trackSelection)) continue; - registry.fill(HIST("trackQA/after/hTrackPt"), centrality, track.pt()); + registry.fill(HIST("trackQA/after/hTrackPt"), centrality, track.pt(), weff); registry.fill(HIST("trackQA/after/hTrackEta"), centrality, track.eta()); registry.fill(HIST("trackQA/after/hTrackPhi"), centrality, track.phi()); registry.fill(HIST("h3CenttrPhiPsi2"), centrality, RecoDecay::constrainAngle(track.phi() - psi.psi2, -o2::constants::math::PI), qPerc[0]); @@ -489,7 +553,10 @@ struct JetSpectraEseTask { { auto tracksTuple = std::make_tuple(jets, tracks); Pair pairData{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; + for (const auto& [c1, jets1, c2, tracks2] : pairData) { + auto bc = c2.template bc_as(); + loadEfficiency(bc); auto c1Tracks = tracks.sliceBy(tracksPerJCollision, c1.globalIndex()); registry.fill(HIST("eventQA/before/hVtxZMixed"), c1.posZ()); registry.fill(HIST("eventQA/before/hVtxZMixed2"), c2.posZ()); @@ -548,23 +615,29 @@ struct JetSpectraEseTask { auto vCorrL = cfgrhoPhi ? corrL(jet) : vCorr; float dPhi{RecoDecay::constrainAngle(jet.phi() - psi.psi2, -o2::constants::math::PI)}; + registry.fill(HIST("hNtrigMixed"), centrality, vCorrL, dPhi, qPerc[0]); for (const auto& track : tracks2) { if (!jetderiveddatautilities::selectTrack(track, trackSelection)) continue; + double weff = getEfficiency(track); + if (weff < 0) + continue; auto deta = track.eta() - jet.eta(); auto dphi = RecoDecay::constrainAngle(track.phi() - jet.phi(), -o2::constants::math::PIHalf); - registry.fill(HIST("hNtrigMixed"), centrality, vCorrL, dPhi, qPerc[0]); - registry.fill(HIST("thn_jethad_corr_mixed"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0]); + registry.fill(HIST("thn_jethad_corr_mixed"), centrality, vCorrL, track.pt(), deta, dphi, dPhi, qPerc[0], weff); } } for (const auto& track : tracks2) { - registry.fill(HIST("trackQA/before/hTrackPtMixed"), centrality, track.pt()); + double weff = getEfficiency(track); + if (weff < 0) + continue; + registry.fill(HIST("trackQA/before/hTrackPtMixed"), centrality, track.pt(), weff); registry.fill(HIST("trackQA/before/hTrackEtaMixed"), centrality, track.eta()); registry.fill(HIST("trackQA/before/hTrackPhiMixed"), centrality, track.phi()); if (!jetderiveddatautilities::selectTrack(track, trackSelection)) continue; - registry.fill(HIST("trackQA/after/hTrackPtMixed"), centrality, track.pt()); + registry.fill(HIST("trackQA/after/hTrackPtMixed"), centrality, track.pt(), weff); registry.fill(HIST("trackQA/after/hTrackEtaMixed"), centrality, track.eta()); registry.fill(HIST("trackQA/after/hTrackPhiMixed"), centrality, track.phi()); } @@ -573,7 +646,7 @@ struct JetSpectraEseTask { void processESEDataCharged(soa::Join::iterator const& collision, soa::Filtered> const& jets, - aod::JetTracks const& tracks) + aod::JetTracks const& tracks, aod::BCsWithTimestamps const&) { registry.fill(HIST("eventQA/hEventCounter"), kFilteredInputEv); registry.fill(HIST("eventQA/before/hVtxZ"), collision.posZ()); @@ -585,13 +658,15 @@ struct JetSpectraEseTask { return; registry.fill(HIST("eventQA/hEventCounter"), kOccupancyCut); + auto bc = collision.bc_as(); + loadEfficiency(bc); jetSpectra(collision, jets, tracks); } PROCESS_SWITCH(JetSpectraEseTask, processESEDataCharged, "process ese collisions", true); void processESEDataChargedMixed(soa::Join const& collisions, soa::Filtered> const& jets, - aod::JetTracks const& tracks) + aod::JetTracks const& tracks, aod::BCsWithTimestamps const&) { jetMixed(collisions, jets, tracks); } @@ -768,6 +843,132 @@ struct JetSpectraEseTask { } PROCESS_SWITCH(JetSpectraEseTask, processMCChargedMatched, "jet MC process: geometrically matched MCP and MCD for response matrix and efficiency", false); + // process for gen/reco tracks for pT efficiency + bool isChargedParticle(int pdgCode) + { + auto pdgParticle = pdg->GetParticle(pdgCode); + return pdgParticle && pdgParticle->Charge() != 0.0; + } + + void processMCGenTrack(soa::Filtered>::iterator const& mcCollision, + soa::SmallGroups const& collisions, + aod::JetTracksMCD const&, + aod::JetParticles const& particles) + { + if (mcCollision.size() < 1) { + return; + } + if (collisions.size() != 1) { + return; + } + if (!(std::abs(mcCollision.posZ()) < vertexZCut)) { + return; + } + + auto collision = collisions.begin(); + if (!(std::abs(collision.posZ()) < vertexZCut)) { + return; + } + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { + return; + } + if (cfgEvSelOccupancy && !isOccupancyAccepted(collision)) { + return; + } + + auto centrality = cfgisPbPb ? collision.centFT0M() : -1.0f; + if (cfgSelCentrality && cfgisPbPb && !isCentralitySelected(centrality)) { + return; + } + + auto particlesInCollision = particles.sliceBy(particlesPerJMcCollision, mcCollision.globalIndex()); + for (const auto& particle : particlesInCollision) { + if (!isChargedParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (particle.pt() < trackPtMin || particle.pt() >= trackPtMax) { + continue; + } + if (particle.eta() <= trackEtaMin || particle.eta() >= trackEtaMax) { + continue; + } + + registry.fill(HIST("hTrackPtGen"), particle.pt()); + registry.fill(HIST("hTrackEtaGen"), particle.eta()); + registry.fill(HIST("hTrackPhiGen"), particle.phi()); + } + } + PROCESS_SWITCH(JetSpectraEseTask, processMCGenTrack, "jet MC process: Generated track", false); + void processMCRecoTrack(soa::Filtered>::iterator const& mcCollision, + soa::SmallGroups const& collisions, + aod::JetTracksMCD const& tracks, + aod::JetParticles const&) + { + if (mcCollision.size() < 1) { + return; + } + if (collisions.size() < 1) { + return; + } + if (!(std::abs(mcCollision.posZ()) < vertexZCut)) { + return; + } + + std::vector seenMcParticles; + for (const auto& collision : collisions) { + if (!(std::abs(collision.posZ()) < vertexZCut)) { + continue; + } + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits)) { + continue; + } + if (cfgEvSelOccupancy && !isOccupancyAccepted(collision)) { + continue; + } + + auto centrality = cfgisPbPb ? collision.centFT0M() : -1.0f; + if (cfgSelCentrality && cfgisPbPb && !isCentralitySelected(centrality)) { + continue; + } + + auto tracksInCollision = tracks.sliceBy(mcdTracksPerJCollision, collision.globalIndex()); + for (const auto& track : tracksInCollision) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } + if (!track.has_mcParticle()) { + continue; + } + + auto particle = track.mcParticle_as(); + if (!isChargedParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (particle.pt() < trackPtMin || particle.pt() >= trackPtMax) { + continue; + } + if (particle.eta() <= trackEtaMin || particle.eta() >= trackEtaMax) { + continue; + } + if (std::find(seenMcParticles.begin(), seenMcParticles.end(), particle.globalIndex()) != seenMcParticles.end()) { + continue; + } + seenMcParticles.push_back(particle.globalIndex()); + + registry.fill(HIST("hTrackPtReco"), track.pt()); + registry.fill(HIST("hTrackEtaReco"), track.eta()); + registry.fill(HIST("hTrackPhiReco"), track.phi()); + } + } + } + PROCESS_SWITCH(JetSpectraEseTask, processMCRecoTrack, "jet MC process: Reconstructed track", false); + static constexpr float InvalidValue = 999.; // template diff --git a/PWGJE/Tasks/jetSubstructure.cxx b/PWGJE/Tasks/jetSubstructure.cxx index 65e2953a8c3..fe568b6c2a6 100644 --- a/PWGJE/Tasks/jetSubstructure.cxx +++ b/PWGJE/Tasks/jetSubstructure.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/jetSubstructureHF.h b/PWGJE/Tasks/jetSubstructureHF.h index d0734e071ea..0dbe9aa6e3f 100644 --- a/PWGJE/Tasks/jetSubstructureHF.h +++ b/PWGJE/Tasks/jetSubstructureHF.h @@ -52,8 +52,6 @@ #include -// NB: runDataProcessing.h must be included after customize! - template struct JetSubstructureHFTask { o2::framework::Produces jetSubstructureDataTable; diff --git a/PWGJE/Tasks/jetSubstructureHFOutput.h b/PWGJE/Tasks/jetSubstructureHFOutput.h index afabd8b1d65..2eb799a6708 100644 --- a/PWGJE/Tasks/jetSubstructureHFOutput.h +++ b/PWGJE/Tasks/jetSubstructureHFOutput.h @@ -36,8 +36,6 @@ #include #include -// NB: runDataProcessing.h must be included after customize! - template struct JetSubstructureHFOutputTask { diff --git a/PWGJE/Tasks/jetSubstructureOutput.cxx b/PWGJE/Tasks/jetSubstructureOutput.cxx index cb849700592..954214c7226 100644 --- a/PWGJE/Tasks/jetSubstructureOutput.cxx +++ b/PWGJE/Tasks/jetSubstructureOutput.cxx @@ -19,9 +19,9 @@ #include "PWGJE/DataModel/JetSubstructure.h" #include "PWGJE/DataModel/JetSubtraction.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include #include +#include #include #include #include @@ -38,8 +38,6 @@ using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -// NB: runDataProcessing.h must be included after customize! - struct JetSubstructureOutputTask { Produces collisionOutputTableData; diff --git a/PWGJE/Tasks/jetTaggerHFQA.cxx b/PWGJE/Tasks/jetTaggerHFQA.cxx index d64b664b98b..1dd147c0ff7 100644 --- a/PWGJE/Tasks/jetTaggerHFQA.cxx +++ b/PWGJE/Tasks/jetTaggerHFQA.cxx @@ -21,10 +21,10 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetTagging.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" #include +#include +#include +#include #include #include #include @@ -34,8 +34,8 @@ #include #include -#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetTriggerChargedQa.cxx b/PWGJE/Tasks/jetTriggerChargedQa.cxx index d8b795aa1d6..22ee5b8306d 100644 --- a/PWGJE/Tasks/jetTriggerChargedQa.cxx +++ b/PWGJE/Tasks/jetTriggerChargedQa.cxx @@ -18,15 +18,12 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/DataModel/EventSelection.h" - -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetTutorial.cxx b/PWGJE/Tasks/jetTutorial.cxx index 48742399bf7..828a23a86ce 100644 --- a/PWGJE/Tasks/jetTutorial.cxx +++ b/PWGJE/Tasks/jetTutorial.cxx @@ -23,12 +23,12 @@ #include "Common/Core/RecoDecay.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetTutorialSkeleton.cxx b/PWGJE/Tasks/jetTutorialSkeleton.cxx index eeccd409d26..763f2dc4c0e 100644 --- a/PWGJE/Tasks/jetTutorialSkeleton.cxx +++ b/PWGJE/Tasks/jetTutorialSkeleton.cxx @@ -18,10 +18,10 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/jetValidationQA.cxx b/PWGJE/Tasks/jetValidationQA.cxx index 4ccd260f47e..999a1feeaef 100644 --- a/PWGJE/Tasks/jetValidationQA.cxx +++ b/PWGJE/Tasks/jetValidationQA.cxx @@ -18,11 +18,11 @@ #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/mcGeneratorStudies.cxx b/PWGJE/Tasks/mcGeneratorStudies.cxx index 8310b03c25a..1fd61f64bfc 100644 --- a/PWGJE/Tasks/mcGeneratorStudies.cxx +++ b/PWGJE/Tasks/mcGeneratorStudies.cxx @@ -19,18 +19,18 @@ #include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include "EMCALBase/Geometry.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include #include +#include +#include +#include #include +#include #include #include #include -#include "TDatabasePDG.h" +#include #include #include diff --git a/PWGJE/Tasks/nsubjettiness.cxx b/PWGJE/Tasks/nsubjettiness.cxx index 133e1e6323b..e09bff37b17 100644 --- a/PWGJE/Tasks/nsubjettiness.cxx +++ b/PWGJE/Tasks/nsubjettiness.cxx @@ -20,11 +20,11 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include #include +#include #include +#include #include #include #include @@ -32,8 +32,8 @@ #include #include -#include "fastjet/contrib/AxesDefinition.hh" #include +#include #include diff --git a/PWGJE/Tasks/nucleiInJets.cxx b/PWGJE/Tasks/nucleiInJets.cxx index 0953cb87500..f6a419992b8 100644 --- a/PWGJE/Tasks/nucleiInJets.cxx +++ b/PWGJE/Tasks/nucleiInJets.cxx @@ -14,36 +14,39 @@ #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" +// #include "PWGLF/DataModel/LFParticleIdentification.h" #include "PWGLF/Utils/inelGt.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.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 "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include #include +#include #include +#include #include #include #include +#include #include #include -#include "TDatabasePDG.h" #include #include #include -#include +#include +#include #include #include diff --git a/PWGJE/Tasks/phiInJets.cxx b/PWGJE/Tasks/phiInJets.cxx index 8571b76b880..085da029904 100644 --- a/PWGJE/Tasks/phiInJets.cxx +++ b/PWGJE/Tasks/phiInJets.cxx @@ -25,22 +25,22 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include +#include #include +#include #include #include #include #include -#include "TRandom.h" #include #include #include +#include #include #include diff --git a/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx b/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx index 0f4dbf82e41..81cd439194e 100644 --- a/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx +++ b/PWGJE/Tasks/photonChargedTriggerCorrelation.cxx @@ -20,31 +20,43 @@ #include "PWGJE/DataModel/PhotonChargedTriggerCorrelation.h" -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" +// +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/TableHelper.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 "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "Math/Vector4D.h" -#include "TMath.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 #include #include #include +#include +#include #include -#include +#include +#include #include #include #include @@ -716,7 +728,7 @@ struct PhotonChargedTriggerCorrelation { // init analysis variables // get variables from other tasks - getTaskOptionValue(initContext, "photon-charged-trigger-producer", "etaMax", etaMax, false); + o2::common::core::getTaskOptionValue(initContext, "photon-charged-trigger-producer", "etaMax", etaMax, false); // histograms from ccdb initCcdbHistograms(); diff --git a/PWGJE/Tasks/photonChargedTriggerProducer.cxx b/PWGJE/Tasks/photonChargedTriggerProducer.cxx index d600ca43c03..4ffc372ad67 100644 --- a/PWGJE/Tasks/photonChargedTriggerProducer.cxx +++ b/PWGJE/Tasks/photonChargedTriggerProducer.cxx @@ -15,35 +15,30 @@ /// /// Table producer for photon-jet angular correlation analysis (see photonChargedTriggerCorrelation.cxx) -#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" +#include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/PhotonChargedTriggerCorrelation.h" +// +#include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Common/Core/TableHelper.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "Math/Vector4D.h" -#include "TMath.h" +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include -#include -#include #include -#include -#include -#include #include #include diff --git a/PWGJE/Tasks/photonIsolationQA.cxx b/PWGJE/Tasks/photonIsolationQA.cxx index 1738fef952f..4f31995b218 100644 --- a/PWGJE/Tasks/photonIsolationQA.cxx +++ b/PWGJE/Tasks/photonIsolationQA.cxx @@ -15,13 +15,13 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/recoilJets.cxx b/PWGJE/Tasks/recoilJets.cxx index 08271300538..bb141c84a86 100644 --- a/PWGJE/Tasks/recoilJets.cxx +++ b/PWGJE/Tasks/recoilJets.cxx @@ -18,32 +18,37 @@ #include "PWGJE/DataModel/JetReducedData.h" #include "PWGJE/DataModel/JetSubtraction.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include #include +#include #include +#include #include #include #include +#include #include -#include "TRandom3.h" #include +#include +#include +#include #include #include #include +#include #include #include #include #include -#include #include #include diff --git a/PWGJE/Tasks/statPromptPhoton.cxx b/PWGJE/Tasks/statPromptPhoton.cxx index 4e13332dcfe..b7d6fce2dff 100644 --- a/PWGJE/Tasks/statPromptPhoton.cxx +++ b/PWGJE/Tasks/statPromptPhoton.cxx @@ -15,40 +15,30 @@ /// /// \author Adrian Fereydon Nassirpour -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsEMCAL/AnalysisCluster.h" -#include "DataFormatsEMCAL/Cell.h" -#include "DataFormatsEMCAL/Constants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/Propagator.h" -#include "EMCALBase/Geometry.h" -#include "EMCALCalib/BadChannelMap.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.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 diff --git a/PWGJE/Tasks/substructureDebug.cxx b/PWGJE/Tasks/substructureDebug.cxx index c6830c3a038..0243cce3c1a 100644 --- a/PWGJE/Tasks/substructureDebug.cxx +++ b/PWGJE/Tasks/substructureDebug.cxx @@ -14,28 +14,26 @@ /// \author Nima Zardoshti // -#include "PWGJE/Core/FastJetUtilities.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetSubstructure.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -#include "Framework/runDataProcessing.h" - struct SubstructureDebugTask { HistogramRegistry registry{"registry", {{"h_collisions_posZ", "event posZ;posZ;entries", {HistType::kTH1F, {{20, -10.0, 10.0}}}}, diff --git a/PWGJE/Tasks/trackEfficiency.cxx b/PWGJE/Tasks/trackEfficiency.cxx index 1228de53867..6c3fb2460f3 100644 --- a/PWGJE/Tasks/trackEfficiency.cxx +++ b/PWGJE/Tasks/trackEfficiency.cxx @@ -19,16 +19,18 @@ #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include #include +#include #include +#include #include #include #include +#include #include #include @@ -435,7 +437,7 @@ struct TrackEfficiency { bool hasSel8Coll = false; bool centralityCheck = false; bool occupancyCheck = false; - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -621,7 +623,7 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -683,7 +685,7 @@ struct TrackEfficiency { registry.fill(HIST("h3_particle_pt_high_particle_eta_particle_phi_mcpartofinterest"), jMcParticle.pt(), jMcParticle.eta(), jMcParticle.phi(), mcCollEventWeight); - if ((std::abs(jMcParticle.eta()) < trackEtaAcceptanceCountQA)) { // removed from actual cuts for now because all the histograms have an eta axis + if ((std::abs(jMcParticle.eta()) < trackEtaAcceptanceCountQA)) { // removed from actual cuts for now because all the histograms have an eta axis registry.fill(HIST("hMcPartCutsCounts"), 3.5, mcCollision.weight()); // etaAccept // not actually applied here but it will give an idea of what will be done in the post processing } } @@ -879,7 +881,7 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -942,7 +944,7 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -1086,8 +1088,8 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (collisions.size() > 1) { // remove and move the if block below under if (collisions.size() < 1) { when mccoll.centFt0C has been fixed - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (collisions.size() > 1) { // remove and move the if block below under if (collisions.size() < 1) { when mccoll.centFt0C has been fixed + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } @@ -1159,8 +1161,8 @@ struct TrackEfficiency { float centrality = -1; bool hasSel8Coll = false; bool centralityCheck = false; - if (collisions.size() > 1) { // remove and move the if block below under if (collisions.size() < 1) { when mccoll.centFt0C has been fixed - if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) + if (collisions.size() > 1) { // remove and move the if block below under if (collisions.size() < 1) { when mccoll.centFt0C has been fixed + if (acceptSplitCollisions == SplitOkCheckFirstAssocCollOnly || acceptSplitCollisions == NonSplitOnly) { // check only that the first reconstructed collision passes the check (for the NonSplitOnly case, there's only one associated collision) if (jetderiveddatautilities::selectCollision(collisions.begin(), eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // Skipping MC events that have their first associated collision not reconstructed hasSel8Coll = true; } diff --git a/PWGJE/Tasks/trackJetQA.cxx b/PWGJE/Tasks/trackJetQA.cxx index 60c099bf7a3..3b7eafded61 100644 --- a/PWGJE/Tasks/trackJetQA.cxx +++ b/PWGJE/Tasks/trackJetQA.cxx @@ -24,11 +24,11 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/triggerCorrelations.cxx b/PWGJE/Tasks/triggerCorrelations.cxx index c0c272d39c7..2a32add9252 100644 --- a/PWGJE/Tasks/triggerCorrelations.cxx +++ b/PWGJE/Tasks/triggerCorrelations.cxx @@ -16,10 +16,10 @@ #include "PWGJE/Core/JetDerivedDataUtilities.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" +#include +#include #include +#include #include #include #include diff --git a/PWGJE/Tasks/v0JetSpectra.cxx b/PWGJE/Tasks/v0JetSpectra.cxx index 95081bad725..d17078958f9 100644 --- a/PWGJE/Tasks/v0JetSpectra.cxx +++ b/PWGJE/Tasks/v0JetSpectra.cxx @@ -19,8 +19,8 @@ #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisTask.h" +#include +#include #include #include #include diff --git a/PWGJE/Tasks/v0QA.cxx b/PWGJE/Tasks/v0QA.cxx index 353869e4644..e32d56bc590 100644 --- a/PWGJE/Tasks/v0QA.cxx +++ b/PWGJE/Tasks/v0QA.cxx @@ -24,10 +24,10 @@ #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" #include +#include +#include +#include #include #include #include @@ -35,6 +35,7 @@ #include #include +#include #include #include diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index bc7fd7d3aaa..6303ac2351e 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -274,6 +274,16 @@ 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(StraEvSelsRun2, "AOD", "STRAEVSELSRUN2", //! debug information evsel::Sel8, evsel::Sel7, evsel::Selection, //! event selection: sel8 mult::MultFT0A, mult::MultFT0C, // FIT detectors diff --git a/PWGLF/TableProducer/Common/zdcvector.cxx b/PWGLF/TableProducer/Common/zdcvector.cxx index 19fc5e65393..6ce044dac61 100644 --- a/PWGLF/TableProducer/Common/zdcvector.cxx +++ b/PWGLF/TableProducer/Common/zdcvector.cxx @@ -85,6 +85,7 @@ struct zdcvector { Configurable cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Centrality cut Min"}; Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; Configurable usemem{"usemem", true, "usemem"}; + Configurable usecfactor{"usecfactor", false, "use c factor"}; struct : ConfigurableGroup { Configurable vzFineNbins{"vzFineNbins", 20, "Number of bins in Vz fine histograms"}; @@ -119,6 +120,7 @@ struct zdcvector { AxisSpec vzfineAxis = {configbins.vzFineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"}; AxisSpec centfineAxis = {configbins.centFineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"}; AxisSpec VxyAxis = {2, 0, 2, "Vxy"}; + // AxisSpec EAxis = {500, 0, 1000, "Eaxis"}; histos.add("htpcnsigmapi", "htpcnsigmapi", kTH1F, {{50, -10, 10.0}}); histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{10, 0, 10.0}}); @@ -128,6 +130,14 @@ struct zdcvector { histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis}); histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis}); histos.add("AvgVxy", "AvgVxy", kTProfile, {VxyAxis}); + /*histos.add("hZNA0", "hZNA0", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNA1", "hZNA1", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNA2", "hZNA2", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNA3", "hZNA3", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNC0", "hZNC0", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNC1", "hZNC1", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNC2", "hZNC2", kTH2D, {{centfineAxis}, {EAxis}}, true); + histos.add("hZNC3", "hZNC3", kTH2D, {{centfineAxis}, {EAxis}}, true);*/ ccdb->setURL(cfgCcdbParam.cfgURL); ccdbApi.init("http://alice-ccdb.cern.ch"); @@ -141,6 +151,11 @@ struct zdcvector { TH2D* gainprofile; TProfile* gainprofilevxy; + // int lastRunNumberTimeRec = -999; + // for time since start of run + // int runForStartTime = -999; + // uint64_t runStartTime = 0; + using MyCollisions = soa::Join; using AllTrackCandidates = soa::Join; @@ -180,6 +195,14 @@ struct zdcvector { return; } + // -------- define time since run start -------- + /*uint64_t ts = bc.timestamp(); + if (currentRunNumber != runForStartTime) { + runStartTime = ts; + runForStartTime = currentRunNumber; + } + double tsec = 1.e-3 * static_cast(ts - runStartTime); + */ histos.fill(HIST("hEvtSelInfo"), 1.5); auto zdc = bc.zdc(); @@ -187,6 +210,7 @@ struct zdcvector { auto znaEnergy = zdc.energySectorZNA(); auto zncEnergycommon = zdc.energyCommonZNC(); auto znaEnergycommon = zdc.energyCommonZNA(); + auto beamEne = 5.36 * 0.5; if (znaEnergycommon <= 0.0 || zncEnergycommon <= 0.0) { triggerevent = false; @@ -222,6 +246,14 @@ struct zdcvector { } histos.fill(HIST("hEvtSelInfo"), 5.5); + /*histos.fill(HIST("hZNA0"), centrality, znaEnergy[0]); + histos.fill(HIST("hZNA1"), centrality, znaEnergy[1]); + histos.fill(HIST("hZNA2"), centrality, znaEnergy[2]); + histos.fill(HIST("hZNA3"), centrality, znaEnergy[3]); + histos.fill(HIST("hZNC0"), centrality, zncEnergy[0]); + histos.fill(HIST("hZNC1"), centrality, zncEnergy[1]); + histos.fill(HIST("hZNC2"), centrality, zncEnergy[2]); + histos.fill(HIST("hZNC3"), centrality, zncEnergy[3]);*/ if (additionalEvSel && (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { triggerevent = false; @@ -244,6 +276,8 @@ struct zdcvector { auto alphaZDC = 0.395; constexpr double x[4] = {-1.75, 1.75, -1.75, 1.75}; constexpr double y[4] = {-1.75, -1.75, 1.75, 1.75}; + double zncEnergycommonsum = 0.0; + double znaEnergycommonsum = 0.0; histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); @@ -252,6 +286,7 @@ struct zdcvector { constexpr std::size_t ntow = 8; for (std::size_t iChA = 0; iChA < ntow; iChA++) { auto chanelid = iChA; + gainequal = 1.0; if (useGainCallib && gainprofile) { gainequal = gainprofile->GetBinContent(gainprofile->FindBin(vz + 0.00001, chanelid + 0.5)); } @@ -264,6 +299,7 @@ struct zdcvector { return; } else { double ampl = gainequal * znaEnergy[iChA]; + znaEnergycommonsum += ampl; if (followpub) { ampl = std::pow(ampl, alphaZDC); } @@ -280,6 +316,7 @@ struct zdcvector { return; } else { double ampl = gainequal * zncEnergy[iChA - 4]; + zncEnergycommonsum += ampl; if (followpub) { ampl = std::pow(ampl, alphaZDC); } @@ -291,13 +328,26 @@ struct zdcvector { } } + auto cZNC = 1.0; + auto cZNA = 1.0; + if (sumA > 0) { - qxZDCA = qxZDCA / sumA; - qyZDCA = qyZDCA / sumA; + float nSpecnA = znaEnergycommonsum / beamEne; + if (usecfactor) + cZNA = 1.89358 - 0.71262 / (nSpecnA + 0.71789); + else + cZNA = 1.0; + qxZDCA = cZNA * (qxZDCA / sumA); + qyZDCA = cZNA * (qyZDCA / sumA); } if (sumC > 0) { - qxZDCC = qxZDCC / sumC; - qyZDCC = qyZDCC / sumC; + float nSpecnC = zncEnergycommonsum / beamEne; + if (usecfactor) + cZNC = 1.89358 - 0.71262 / (nSpecnC + 0.71789); + else + cZNC = 1.0; + qxZDCC = cZNC * (qxZDCC / sumC); + qyZDCC = cZNC * (qyZDCC / sumC); } if (sumA <= 1e-4 || sumC <= 1e-4) { @@ -322,6 +372,8 @@ struct zdcvector { gainprofilevxy = ccdb->getForTimeStamp(confGainPathVxy.value, bc.timestamp()); } + // LOG(info)<<"*****time stamp is:"<GetBinContent(1); vy = vy - gainprofilevxy->GetBinContent(2); diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index a68b06b4b79..499514add65 100644 --- a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx +++ b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx @@ -78,20 +78,21 @@ struct strangederivedbuilder { struct : ProducesGroup { //__________________________________________________ // fundamental building blocks of derived data - Produces strangeColl; // characterises collisions - Produces strangeCollLabels; // characterises collisions - Produces strangeMCColl; // characterises collisions / MC - Produces strangeMCMults; // characterises collisions / MC mults - Produces strangeCents; // characterises collisions / centrality in Run 3 - Produces strangeCentsRun2; // characterises collisions / centrality in Run 2 - Produces strangeEvSels; // characterises collisions / centrality / sel8 selection in Run 3 - Produces strangeEvSelsRun2; // characterises collisions / centrality / sel8 selection in Run 2 - Produces strangeStamps; // provides timestamps, run numbers - Produces straEvTimes; // provides event times (FT0, TOF) - Produces v0collref; // references collisions from V0s - Produces casccollref; // references collisions from cascades - Produces kfcasccollref; // references collisions from KF cascades - Produces tracasccollref; // references collisions from tracked cascades + Produces strangeColl; // characterises collisions + Produces strangeCollLabels; // characterises collisions + Produces strangeMCColl; // characterises collisions / MC + Produces strangeMCMults; // characterises collisions / MC mults + Produces strangeCents; // characterises collisions / centrality in Run 3 + Produces strangeCentsRun2; // characterises collisions / centrality in Run 2 + Produces strangeEvSels; // characterises collisions / centrality / sel8 selection in Run 3 + Produces strangeEvSelExtras; // extra event selection variables in Run 3 + Produces strangeEvSelsRun2; // characterises collisions / centrality / sel8 selection in Run 2 + Produces strangeStamps; // provides timestamps, run numbers + Produces straEvTimes; // provides event times (FT0, TOF) + Produces v0collref; // references collisions from V0s + Produces casccollref; // references collisions from cascades + Produces kfcasccollref; // references collisions from KF cascades + Produces tracasccollref; // references collisions from tracked cascades //__________________________________________________ // track extra references @@ -207,6 +208,8 @@ struct strangederivedbuilder { ConfigurableAxis axisFDDC{"FDDCamplitude", {100, 0.0f, 2000.0f}, "FDDCamplitude"}; ConfigurableAxis axisZNA{"ZNAamplitude", {100, 0.0f, 250.0f}, "ZNAamplitude"}; ConfigurableAxis axisZNC{"ZNCamplitude", {100, 0.0f, 250.0f}, "ZNCamplitude"}; + ConfigurableAxis axisZNAtime{"ZNAtime", {100, -999.f, 999.0f}, "ZNAtime"}; + ConfigurableAxis axisZNCtime{"ZNCtime", {100, -999.f, 999.0f}, "ZNCtime"}; } axisDetectors; // For manual sliceBy @@ -404,6 +407,8 @@ struct strangederivedbuilder { auto hFDDCMultVsFDDCUD = histos.add("hFDDCMultVsFDDCUD", "hFDDCMultVsFDDCUD; FDD-C Mult; FDD-C UD", kTH2F, {axisDetectors.axisFDDC, axisDetectors.axisFDDC}); auto hZNAMultVsZNAUD = histos.add("hZNAMultVsZNAUD", "hZNAMultVsZNAUD; ZNA Mult; ZNA UD", kTH2F, {axisDetectors.axisZNA, axisDetectors.axisZNA}); auto hZNCMultVsZNCUD = histos.add("hZNCMultVsZNCUD", "hZNCMultVsZNCUD; ZNC Mult; ZNC UD", kTH2F, {axisDetectors.axisZNC, axisDetectors.axisZNC}); + auto hZNATimeVsZNAUD = histos.add("hZNATimeVsZNAUD", "hZNAMultVsZNAUD; ZNA time; ZNA UD", kTH2F, {axisDetectors.axisZNAtime, axisDetectors.axisZNAtime}); + auto hZNCTimeVsZNCUD = histos.add("hZNCTimeVsZNCUD", "hZNCMultVsZNCUD; ZNC time; ZNC UD", kTH2F, {axisDetectors.axisZNCtime, axisDetectors.axisZNCtime}); for (int ii = 1; ii < 101; ii++) { float value = 100.5f - static_cast(ii); @@ -458,6 +463,14 @@ struct strangederivedbuilder { float totalFDDAmplitudeC = -999; float energyCommonZNA = -999; float energyCommonZNC = -999; + float timeZNA = -999; + float timeZNC = -999; + float timeFV0A = -999; + float timeFT0A = -999; + float timeFT0C = -999; + float timeFDDA = -999; + float timeFDDC = -999; + uint8_t ft0TriggerMask = 0; // +-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+ // set UD information in case present at this stage @@ -474,6 +487,14 @@ struct strangederivedbuilder { totalFDDAmplitudeC = udColl.totalFDDAmplitudeC(); energyCommonZNA = udColl.energyCommonZNA(); energyCommonZNC = udColl.energyCommonZNC(); + timeZNA = udColl.timeZNA(); + timeZNC = udColl.timeZNC(); + timeFDDA = udColl.timeFDDA(); + timeFDDC = udColl.timeFDDC(); + timeFV0A = udColl.timeFV0A(); + timeFT0A = udColl.timeFT0A(); + timeFT0C = udColl.timeFT0C(); + ft0TriggerMask = udColl.triggerMaskFT0(); histos.fill(HIST("hFT0AMultVsFT0AUD"), collision.multFT0A(), udColl.totalFT0AmplitudeA()); histos.fill(HIST("hFT0CMultVsFT0CUD"), collision.multFT0C(), udColl.totalFT0AmplitudeC()); @@ -482,6 +503,14 @@ struct strangederivedbuilder { histos.fill(HIST("hFDDCMultVsFDDCUD"), collision.multFDDC(), udColl.totalFDDAmplitudeC()); histos.fill(HIST("hZNAMultVsZNAUD"), collision.multZNA(), udColl.energyCommonZNA()); histos.fill(HIST("hZNCMultVsZNCUD"), collision.multZNC(), udColl.energyCommonZNC()); + if (bc.has_zdc()) { + auto zdc = bc.zdc(); + histos.fill(HIST("hZNATimeVsZNAUD"), zdc.timeZNA(), udColl.timeZNA()); + histos.fill(HIST("hZNCTimeVsZNCUD"), zdc.timeZNC(), udColl.timeZNC()); + } else { + histos.fill(HIST("hZNATimeVsZNAUD"), -999., udColl.timeZNA()); + histos.fill(HIST("hZNCTimeVsZNCUD"), -999., udColl.timeZNC()); + } } } } @@ -502,6 +531,29 @@ struct strangederivedbuilder { centrality = hRawCentrality->GetBinContent(hRawCentrality->FindBin(collision.multFT0C())); } + if (gapSide < 0) { // if UD collision is not found, store the timing information from collision instead + if (bc.has_zdc()) { + auto zdc = bc.zdc(); + timeZNA = zdc.timeZNA(); + timeZNC = zdc.timeZNC(); + } + if (collision.has_foundFDD()) { // Analysis is fully based on FT0 presence + const auto& fdd = collision.foundFDD(); + timeFDDA = fdd.timeA(); + timeFDDC = fdd.timeC(); + } + if (collision.has_foundFV0()) { // Analysis is fully based on FV0 presence + const auto& fv0a = collision.foundFV0(); + timeFV0A = fv0a.time(); + } + if (collision.has_foundFT0()) { // Analysis is fully based on FT0 presence + const auto& ft0 = collision.foundFT0(); + timeFT0A = ft0.timeA(); + timeFT0C = ft0.timeC(); + ft0TriggerMask = ft0.triggerMask(); + } + } + products.strangeCents(collision.centFT0M(), collision.centFT0A(), centrality, collision.centFV0A(), collision.centFT0CVariant1(), collision.centMFT(), collision.centNGlobal()); @@ -534,6 +586,10 @@ struct strangederivedbuilder { 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 } else { // We are in Run 2 products.strangeCentsRun2(collision.centRun2V0M(), collision.centRun2V0A(), collision.centRun2SPDTracklets(), collision.centRun2SPDClusters()); @@ -651,23 +707,23 @@ struct strangederivedbuilder { } } - void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const& bcs) + void processCollisionsRun3(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&) { populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const& bcs, UDCollisionsFull const& udCollisions) + void processCollisionsRun3WithUD(soa::Join const& collisions, aod::V0Datas const& V0s, aod::CascDatas const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions) { populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const& bcs, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, collisions, V0s, Cascades, KFCascades, TraCascades, bcs); } - void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, aod::BCsWithTimestamps const& bcs, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) + void processCollisionsRun3WithUDWithMC(soa::Join const& collisions, soa::Join const& V0s, soa::Join const& /*V0MCCores*/, soa::Join const& Cascades, aod::KFCascDatas const& KFCascades, aod::TraCascDatas const& TraCascades, soa::Join const& bcs, aod::FT0s const&, aod::Zdcs const&, UDCollisionsFull const& udCollisions, soa::Join const& mcCollisions, aod::McParticles const& mcParticles) { populateMCCollisionTable(mcCollisions, mcParticles); populateCollisionTables(collisions, udCollisions, V0s, Cascades, KFCascades, TraCascades, bcs); diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index e7ddece6c1f..d3af036e6d2 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -94,7 +94,6 @@ static constexpr int PDGs[] = {11, 13, 211, 321, 2212}; static constexpr int PidSgn[NpartChrg] = {11, 13, 211, 321, 2212, -11, -13, -211, -321, -2212}; static constexpr const char* Pid[Npart] = {"el", "mu", "pi", "ka", "pr"}; static constexpr const char* PidChrg[NpartChrg] = {"e^{-}", "#mu^{-}", "#pi^{+}", "K^{+}", "p", "e^{+}", "#mu^{+}", "#pi^{-}", "K^{-}", "#bar{p}"}; -static constexpr std::string_view Cspecies[NpartChrg] = {"Elminus", "Muplus", "PiPlus", "KaPlus", "Pr", "ElPlus", "MuMinus", "PiMinus", "KaMinus", "PrBar"}; static constexpr std::string_view CspeciesAll[Npart] = {"El", "Mu", "Pi", "Ka", "Pr"}; // histogram naming static constexpr std::string_view PidDir[] = {"el/", "pi/", "pr/"}; @@ -106,6 +105,8 @@ static constexpr std::string_view CprefixCleanV0 = "Tracks/CleanV0/"; static constexpr std::string_view CprefixV0qa = "Tracks/V0qa/"; static constexpr std::string_view Cstatus[] = {"preSel/", "postSel/"}; static constexpr std::string_view CstatCalib[] = {"preCalib/", "postCalib/"}; +static constexpr std::string_view CdEdxMcRecPrim = "/CdEdxMcRecPrim"; +static constexpr std::string_view CdEdxMcRecPrimF = "Tracks/{}/CdEdxMcRecPrim"; static constexpr std::string_view CpTvsDCAxy = "/hPtVsDCAxy"; static constexpr std::string_view CpTvsDCAxyF = "Tracks/{}/hPtVsDCAxy"; static constexpr std::string_view CpTvsDCAxyAll = "/hPtVsDCAxyAll"; @@ -122,12 +123,6 @@ static constexpr std::string_view CpTgenPrimSgnINEL = "/hPtGenPrimSgnINEL"; static constexpr std::string_view CpTgenPrimSgnINELF = "Tracks/{}/hPtGenPrimSgnINEL"; static constexpr std::string_view CpTrecCollPrimSgn = "/hPtRecCollPrimSgn"; static constexpr std::string_view CpTrecCollPrimSgnF = "Tracks/{}/hPtRecCollPrimSgn"; -static constexpr std::string_view CpTrecCollPrimSgnINEL = "/hPtRecCollPrimSgnINEL"; -static constexpr std::string_view CpTrecCollPrimSgnINELF = "Tracks/{}/hPtRecCollPrimSgnINEL"; -static constexpr std::string_view CpTGenRecCollPrimSgn = "/hPtGenRecCollPrimSgn"; -static constexpr std::string_view CpTGenRecCollPrimSgnF = "Tracks/{}/hPtGenRecCollPrimSgn"; -static constexpr std::string_view CpTGenRecCollPrimSgnINEL = "/hPtGenRecCollPrimSgnINEL"; -static constexpr std::string_view CpTGenRecCollPrimSgnINELF = "Tracks/{}/hPtGenRecCollPrimSgnINEL"; static constexpr std::string_view CpTmcClosurePrim = "/hPtMCclosurePrim"; static constexpr std::string_view CpTmcClosurePrimF = "Tracks/{}/hPtMCclosurePrim"; @@ -209,8 +204,8 @@ std::array, NpartChrg> hPtEffRecWeak{}; std::array, NpartChrg> hPtEffRecMat{}; std::array, NpartChrg> hPtEffRec{}; std::array, NpartChrg> hPtEffGen{}; -std::array, NpartChrg> hPtGenRecEvt{}; -std::array, NpartChrg> hPtGenPrimRecEvt{}; +std::array, NpartChrg> hPtGenRecEvt{}; +std::array, NpartChrg> hPtGenPrimRecEvt{}; std::array, NpartChrg> hPtEffGenPrim{}; std::array, NpartChrg> hPtEffGenWeak{}; std::array, NpartChrg> hPtEffGenMat{}; @@ -239,6 +234,7 @@ struct FlattenictyPikp { Configurable applyCalibDeDx{"applyCalibDeDx", false, "calibration of dedx signal"}; Configurable applyCalibDeDxFromCCDB{"applyCalibDeDxFromCCDB", false, "use CCDB-based calibration of dedx signal"}; Configurable cfgFillTrackQaHist{"cfgFillTrackQaHist", false, "fill track QA histograms"}; + Configurable cfgFillNclVsPhiCutQaHist{"cfgFillNclVsPhiCutQaHist", false, "fill TPC cluster vs geometrical cut QA histograms"}; Configurable cfgFilldEdxCalibHist{"cfgFilldEdxCalibHist", false, "fill dEdx calibration histograms"}; Configurable cfgFilldEdxQaHist{"cfgFilldEdxQaHist", false, "fill dEdx QA histograms"}; Configurable cfgFillDCAxyHist{"cfgFillDCAxyHist", false, "fill nsigma QA histograms"}; @@ -284,7 +280,7 @@ struct FlattenictyPikp { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT binning"}; ConfigurableAxis axisPtV0s{"axisPtV0s", {VARIABLE_WIDTH, 0, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.5, 3.0, 3.5, 4, 5, 7, 9, 12, 15, 20}, "pT V0s binning"}; ConfigurableAxis axisFlatPerc{"axisFlatPerc", {102, -0.01, 1.01}, "Flattenicity percentiles binning"}; - ConfigurableAxis axisMultPerc{"axisMultPerc", {20, 0, 100}, "Multiplicity percentiles binning"}; + ConfigurableAxis axisMultPerc{"axisMultPerc", {VARIABLE_WIDTH, 0., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100.}, "T0 percentiles binning"}; ConfigurableAxis axisVertexZ{"axisVertexZ", {80, -20., 20.}, "Vertex z binning"}; ConfigurableAxis axisMult{"axisMult", {301, -0.5, 300.5}, "Multiplicity binning"}; ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -5., 5.}, "DCAxy binning"}; @@ -523,6 +519,7 @@ struct FlattenictyPikp { const AxisSpec dEdxAxis{binOpt.axisDedx, "TPC dEdx (a.u.)"}; const AxisSpec vtxzAxis{binOpt.axisVertexZ, "Z_{vtx} (cm)"}; const AxisSpec flatAxis{binOpt.axisFlatPerc, "Flat FV0"}; + const AxisSpec nChAxis{binOpt.axisMult, "Nch, |eta|<0.8"}; const AxisSpec etaAxis{binOpt.axisEta, "#eta"}; const AxisSpec rapidityAxis{binOpt.axisRapidity, "#it{y}"}; const AxisSpec phiAxis{binOpt.axisPhi, "#varphi"}; @@ -598,33 +595,30 @@ struct FlattenictyPikp { flatchrg.add("Events/hVtxZ", "Measured vertex z position", kTH1F, {vtxzAxis}); flatchrg.add("Events/hFlatVsMultEst", "hFlatVsMultEst", kTH2F, {flatAxis, multAxis}); flatchrg.add("Tracks/postSel/hPVsPtEta", "; #it{p} (GeV/#it{c}); #it{p}_{T} (GeV/#it{c}); #eta;", {kTH3F, {pAxis, ptAxis, etaAxis}}); - if (cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { - if (cfgFillTrackQaHist) { + if (cfgFillNclVsPhiCutQaHist || cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { + if (cfgFillNclVsPhiCutQaHist) { flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); - flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); - flatchrg.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); - flatchrg.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); - flatchrg.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/postSel/hDCAZvsPt", "", kTH2F, {ptAxis, dcaZAxis}); - // tpc - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - } else { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - } + flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); + } + if (cfgFillTrackQaHist) { flatchrg.add("Tracks/postSel/hShTpcClvsPt", "", {kTH2F, {ptAxis, shCluserAxis}}); flatchrg.add("Tracks/postSel/hNclTPCFoundvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNClTPCPidvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNclTPCFoundvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNClTPCPidvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hTPCCluster", "N_{cluster}", kTH1F, {clTpcAxis}); + flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); + flatchrg.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); + flatchrg.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); + flatchrg.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); + flatchrg.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); + flatchrg.add("Tracks/postSel/hDCAZvsPt", "", kTH2F, {ptAxis, dcaZAxis}); + // tpc flatchrg.add("Tracks/postSel/hTPCnClsShared", " ; # shared TPC clusters TPC", kTH1F, {{165, -0.5, 164.5}}); flatchrg.add("Tracks/postSel/hTPCcrossedRows", " ; # crossed TPC rows", kTH1F, {{165, -0.5, 164.5}}); flatchrg.add("Tracks/postSel/hTPCcrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", kTH1F, {{60, 0.7, 1.3}}); @@ -633,11 +627,7 @@ struct FlattenictyPikp { flatchrg.add("Tracks/postSel/hChi2ITSTrkSegment", "chi2ITS", kTH1F, {{100, -0.5, 99.5}}); // tof flatchrg.add("Tracks/postSel/hTOFPvsBeta", "Beta from TOF; #it{p} (GeV/#it{c}); #beta", {kTH2F, {pAxis, {120, 0.0, 1.2}}}); - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); - } else { - flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}); - } + flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); } if (cfgFilldEdxQaHist) { if (cfgStoreThnSparse) { @@ -735,15 +725,10 @@ struct FlattenictyPikp { flatchrg.add("Events/hVtxZRec", "MC Rec vertex z position", kTH1F, {vtxzAxis}); flatchrg.add("Events/hVtxZGen", "Generated vertex z position", kTH1F, {vtxzAxis}); - if (cfgFillTrackQaHist) { + if (cfgFillNclVsPhiCutQaHist) { flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - } else { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - } + flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); @@ -753,31 +738,32 @@ struct FlattenictyPikp { for (int i = 0; i < NpartChrg; i++) { const std::string strID = Form("/%s/%s", (i < Npart) ? "pos" : "neg", Pid[i % Npart]); - hPtGenRecEvt[i] = flatchrg.add("Tracks/hPtGenRecEvt" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtGenPrimRecEvt[i] = flatchrg.add("Tracks/hPtGenPrimRecEvt" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtEffGenPrim[i] = flatchrg.add("Tracks/hPtEffGenPrim" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenWeak[i] = flatchrg.add("Tracks/hPtEffGenWeak" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenMat[i] = flatchrg.add("Tracks/hPtEffGenMat" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecPrim[i] = flatchrg.add("Tracks/hPtEffRecPrim" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecWeak[i] = flatchrg.add("Tracks/hPtEffRecWeak" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecMat[i] = flatchrg.add("Tracks/hPtEffRecMat" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hDCAxyBadCollPrim[i] = flatchrg.add("Tracks/hDCAxyBadCollPrim" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hDCAxyBadCollWeak[i] = flatchrg.add("Tracks/hDCAxyBadCollWeak" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hDCAxyBadCollMat[i] = flatchrg.add("Tracks/hDCAxyBadCollMat" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyPrim[i] = flatchrg.add("Tracks/hPtVsDCAxyPrim" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyWeak[i] = flatchrg.add("Tracks/hPtVsDCAxyWeak" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyMat[i] = flatchrg.add("Tracks/hPtVsDCAxyMat" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); + hPtGenRecEvt[i] = flatchrg.add("Tracks/hPtGenRecEvt" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtGenPrimRecEvt[i] = flatchrg.add("Tracks/hPtGenPrimRecEvt" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenPrim[i] = flatchrg.add("Tracks/hPtEffGenPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenWeak[i] = flatchrg.add("Tracks/hPtEffGenWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenMat[i] = flatchrg.add("Tracks/hPtEffGenMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecPrim[i] = flatchrg.add("Tracks/hPtEffRecPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecWeak[i] = flatchrg.add("Tracks/hPtEffRecWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecMat[i] = flatchrg.add("Tracks/hPtEffRecMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hDCAxyBadCollPrim[i] = flatchrg.add("Tracks/hDCAxyBadCollPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyBadCollWeak[i] = flatchrg.add("Tracks/hDCAxyBadCollWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyBadCollMat[i] = flatchrg.add("Tracks/hDCAxyBadCollMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyPrim[i] = flatchrg.add("Tracks/hPtVsDCAxyPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyWeak[i] = flatchrg.add("Tracks/hPtVsDCAxyWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyMat[i] = flatchrg.add("Tracks/hPtVsDCAxyMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); } for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CdEdxMcRecPrimF.data(), CspeciesAll[i]).c_str(), "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); } - flatchrg.add({"hPtOutNoEtaCut", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add({"PtOutFakes", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); + flatchrg.add({"hPtOutNoEtaCut", " ; #it{p}_{T} (GeV/#it{c})", {kTH1F, {ptAxis}}}); + flatchrg.add({"PtOutFakes", " ; #it{p}_{T} (GeV/#it{c})", {kTH1F, {ptAxis}}}); flatchrg.add({"ResponseGen", " ; N_{part}; F_{FV0};", {kTHnSparseF, {multAxis, flatAxis}}}); flatchrg.add("h1flatencityFV0MCGen", "", kTH1F, {{102, -0.01, 1.01, "1-flatencityFV0"}}); @@ -795,7 +781,7 @@ struct FlattenictyPikp { if (doprocessMCclosure) { for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTmcClosurePrimF.data(), CspeciesAll[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTmcClosurePrimF.data(), CspeciesAll[i]).c_str(), " ; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {multAxis, flatAxis, ptAxis}}}); } } @@ -811,19 +797,20 @@ struct FlattenictyPikp { flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(1, "all"); flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(2, "evt sel"); flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(3, "INELgt0"); - flatchrg.add("hEvtMcGenRecColl", "hEvtMcGenRecColl", {kTH1F, {{2, 0.f, 2.f}}}); - flatchrg.get(HIST("hEvtMcGenRecColl"))->GetXaxis()->SetBinLabel(1, "INEL"); - flatchrg.get(HIST("hEvtMcGenRecColl"))->GetXaxis()->SetBinLabel(2, "INELgt0"); - - flatchrg.add("hFlatGenINELgt0", "hFlatGenINELgt0", {kTH1F, {flatAxis}}); - for (int i = 0; i < NpartChrg; ++i) { - flatchrg.add({fmt::format(CpTgenPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTgenPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTrecCollPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTrecCollPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTGenRecCollPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTGenRecCollPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); + flatchrg.add("hNchVsCent", "Gen Nch vs Cent;;Gen Nch (|#eta|<0.8)", {kTH2F, {multAxis, nChAxis}}); + // Event loss + flatchrg.add("hNchVsFlatGenINELgt0", "Gen Nch w/o Evt sel;;", {kTH2F, {nChAxis, flatAxis}}); + flatchrg.add("hNchVsFlatRecGt0INELgt0", "Gen Nch w/ Nrec > 0 + Evt. sel;;", {kTH2F, {nChAxis, flatAxis}}); + // Event split + flatchrg.add("hCentVsFlatRecINELgt0", "Gen evt w/o Evt sel;;", {kTH2F, {multAxis, flatAxis}}); + flatchrg.add("hCentVsFlatRecGt0INELgt0", "Gen evt w/ Nrec > 0 + Evt. sel;;", {kTH2F, {multAxis, flatAxis}}); + flatchrg.add("hCentVsFlatRecGt0", "Gen evt w/ Nrec > 0 w/o Evt sel;;", {kTH2F, {multAxis, flatAxis}}); + // Signal loss + for (int i = 0; i < Npart; ++i) { + flatchrg.add({fmt::format(CpTgenPrimSgnF.data(), CspeciesAll[i]).c_str(), "Gen evt w/o Evt sel;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTgenPrimSgnINELF.data(), CspeciesAll[i]).c_str(), "Gen evt w INELgt0 sel;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTrecCollPrimSgnF.data(), CspeciesAll[i]).c_str(), " ;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); } } @@ -977,7 +964,9 @@ struct FlattenictyPikp { if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { continue; } - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { + float phiModn = track.phi(); + phiMod(phiModn, magField, track.sign()); + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phiModn < fPhiCutHigh->Eval(track.pt()) && phiModn > fPhiCutLow->Eval(track.pt()))) { continue; } if (!isDCAxyWoCut(track)) { @@ -1291,63 +1280,54 @@ struct FlattenictyPikp { return std::abs(charge) >= CminCharge; } - template - bool phiCut(T const& track, float mag, TF1* fphiCutLow, TF1* fphiCutHigh) + template + int countPart(P const& particles) + { + auto nCharged = 0; + for (auto const& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + nCharged++; + } + return nCharged; + } + + void phiMod(float& phimodn, const int& mag, const int& charge) { - if (track.pt() < trkSelOpt.cfgPhiCutPtMin) - return true; - // cut to remove tracks at TPC boundaries - double phimodn = track.phi(); if (mag < Cnull) // for negative polarity field phimodn = o2::constants::math::TwoPI - phimodn; - if (track.sign() < Cnull) // for negative charge + if (charge < Cnull) // for negative charge phimodn = o2::constants::math::TwoPI - phimodn; if (phimodn < Cnull) LOGF(warning, "phi < Cnull: %g", phimodn); phimodn += o2::constants::math::PI / 18.0f; // to center gap in the middle phimodn = std::fmod(phimodn, o2::constants::math::PI / 9.0f); + } - if (cfgFillTrackQaHist) { - flatchrg.fill(HIST("Tracks/preSel/hPtPhi"), track.pt(), phimodn); - if (track.hasTPC() && track.hasITS()) { - if (cfgStoreThnSparse) { - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - } else { - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/preSel/hPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/pPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/preSel/pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - } - } - } - if (phimodn < fphiCutHigh->Eval(track.pt()) && phimodn > fphiCutLow->Eval(track.pt())) { - return false; - } - if (cfgFillTrackQaHist) { - flatchrg.fill(HIST("Tracks/postSel/hPtPhi"), track.pt(), phimodn); - if (track.hasTPC() && track.hasITS()) { - if (cfgStoreThnSparse) { - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - } else { - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/postSel/hPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/pPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/postSel/pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - } - } + template + inline void fillNclVsPhiCutQaHist(T const& track, const float phimodn) + { + if (cfgFillNclVsPhiCutQaHist) { + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhi"), track.pt(), phimodn); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclPIDTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsPID()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclTPC"), track.pt(), track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclTPC"), track.pt(), track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); } - return true; } template - bool isGoodTrack(T const& track, int const magfield) + bool isGoodTrack(T const& track, const int magfield) { flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelAll); if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { @@ -1375,9 +1355,18 @@ struct FlattenictyPikp { return false; } flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magfield, fPhiCutLow, fPhiCutHigh)) { + + float phimodn = track.phi(); + phiMod(phimodn, magfield, track.sign()); + if (cfgFillNclVsPhiCutQaHist) { + fillNclVsPhiCutQaHist(track, phimodn); + } + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt()))) { return false; } + if (cfgFillNclVsPhiCutQaHist) { + fillNclVsPhiCutQaHist(track, phimodn); + } flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); return true; } @@ -1485,7 +1474,7 @@ struct FlattenictyPikp { } template - bool isGoodV0Track(T1 const& v0, T2 const& /*track*/, int const magfield) + bool isGoodV0Track(T1 const& v0, T2 const& /*track*/, const int magfield) { const auto& posTrack = v0.template posTrack_as(); const auto& negTrack = v0.template negTrack_as(); @@ -1495,8 +1484,13 @@ struct FlattenictyPikp { return false; } flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectSameSign); + + float posTrackPhiModn = posTrack.phi(); + float negTrackPhiModn = negTrack.phi(); + phiMod(posTrackPhiModn, magfield, posTrack.sign()); + phiMod(negTrackPhiModn, magfield, negTrack.sign()); if (v0SelOpt.cfgRejectV0sAtTPCSector) { - if (!(phiCut(posTrack, magfield, fPhiCutLow, fPhiCutHigh) && phiCut(negTrack, magfield, fPhiCutLow, fPhiCutHigh))) { + if ((posTrack.pt() >= trkSelOpt.cfgPhiCutPtMin && posTrackPhiModn < fPhiCutHigh->Eval(posTrack.pt()) && posTrackPhiModn > fPhiCutLow->Eval(posTrack.pt())) && (negTrack.pt() >= trkSelOpt.cfgPhiCutPtMin && negTrackPhiModn < fPhiCutHigh->Eval(negTrack.pt()) && negTrackPhiModn > fPhiCutLow->Eval(negTrack.pt()))) { return false; } } @@ -2020,8 +2014,8 @@ struct FlattenictyPikp { float maxPhi = 0; float dPhi = 0; - double etaMinFV0bins[CmaxRingsFV0] = {0.0}; - double etaMaxFV0bins[CmaxRingsFV0] = {0.0}; + float etaMinFV0bins[CmaxRingsFV0] = {0.0}; + float etaMaxFV0bins[CmaxRingsFV0] = {0.0}; for (int i = 0; i < CmaxRingsFV0; ++i) { etaMaxFV0bins[i] = CmaxEtaFV0 - i * CdEtaFV0; if (i < CmaxRingsFV0 - 1) { @@ -2082,8 +2076,8 @@ struct FlattenictyPikp { constexpr int ChistIdx = id + pidSgn * Npart; auto idx = static_cast(id); const std::string strID = Form("/%s/%s", (pidSgn == CnullInt && id < Npart) ? "pos" : "neg", Pid[idx]); - hPtEffRec[ChistIdx] = flatchrg.add("Tracks/hPtEffRec" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtEffGen[ChistIdx] = flatchrg.add("Tracks/hPtEffGen" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); + hPtEffRec[ChistIdx] = flatchrg.add("Tracks/hPtEffRec" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + hPtEffGen[ChistIdx] = flatchrg.add("Tracks/hPtEffGen" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); } template @@ -2188,6 +2182,15 @@ struct FlattenictyPikp { } } } + + if (!isDCAxyCut(track)) { + return; + } + if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { + if (mcParticle.isPhysicalPrimary()) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CdEdxMcRecPrim), track.eta(), mult, flat, track.p(), track.tpcSignal()); + } + } } template @@ -2201,9 +2204,9 @@ struct FlattenictyPikp { } if constexpr (recoEvt) { - hPtGenRecEvt[ChistIdx]->Fill(mcParticle.pt()); + hPtGenRecEvt[ChistIdx]->Fill(mult, flat, mcParticle.pt()); if (mcParticle.isPhysicalPrimary()) { - hPtGenPrimRecEvt[ChistIdx]->Fill(mcParticle.pt()); + hPtGenPrimRecEvt[ChistIdx]->Fill(mult, flat, mcParticle.pt()); } return; } @@ -2225,27 +2228,22 @@ struct FlattenictyPikp { aod::FV0As const& /*fv0s*/, aod::McParticles const& particles) { - float flat; - float mult; + float flat = 999.0; if (flatSelOpt.useFlatData) { float flatRec = 999.0; - float multRec = 999.0; for (const auto& collision : collisions) { - multRec = getMult(collision); flatRec = fillFlat(collision); } flat = flatRec; - mult = multRec; flatchrg.fill(HIST("hFlatMCGenRecColl"), flatRec); } else { float flatGen = fillFlatMC(particles); flat = flatGen; flatchrg.fill(HIST("hFlatMCGen"), flatGen); - float multGen = getMultMC(mcCollision); - mult = multGen; } - // Evt loss den + const float nCh08 = countPart(particles); // use generated Nch in ∣eta∣ < 0.8 + flatchrg.fill(HIST("hEvtMcGen"), 0.5); if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { return; @@ -2256,90 +2254,98 @@ struct FlattenictyPikp { if (pwglf::isINELgtNmc(particles, 0, pdg)) { isINELgt0mc = true; flatchrg.fill(HIST("hEvtMcGen"), 2.5); - flatchrg.fill(HIST("hFlatGenINELgt0"), flat); + flatchrg.fill(HIST("hNchVsFlatGenINELgt0"), nCh08, flat); // Evt loss den } - // Sgn loss den for (const auto& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } if (!particle.isPhysicalPrimary()) { continue; } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (particle.pt() < trkSelOpt.cfgTrkPtMin) { continue; } - static_for<0, 5>([&](auto i) { + static_for<0, 4>([&](auto i) { constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTgenPrimSgn), mult, flat, particle.pt()); + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgn), nCh08, flat, particle.pt()); if (isINELgt0mc) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTgenPrimSgnINEL), mult, flat, particle.pt()); + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgnINEL), nCh08, flat, particle.pt()); // Sgn loss den } } }); } - int nRecCollINEL = 0; - int nRecCollINELgt0 = 0; - for (const auto& collision : collisions) { - // Evt split num - flatchrg.fill(HIST("hEvtMCRec"), 0.5); - if (!isGoodEvent(collision)) { - continue; + const auto& nRecoColls = collisions.size(); + // Generated evets with >= 1 reco collisions + if (nRecoColls > CnullInt) { + auto maxNcontributors = -1; + auto bestCollIndex = -1; + auto multRecGt1 = -1; + for (auto const& collision : collisions) { + flatchrg.fill(HIST("hEvtMCRec"), 0.5); + if (!isGoodEvent(collision)) { + continue; + } + flatchrg.fill(HIST("hEvtMCRec"), 1.5); + if (collision.isInelGt0() && isINELgt0mc) { + flatchrg.fill(HIST("hEvtMCRec"), 2.5); + } + if (!collision.has_mcCollision()) { + continue; + } + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + multRecGt1 = getMultMC(mcCollision); // using McCentFT0Ms + } + flatchrg.fill(HIST("hCentVsFlatRecINELgt0"), multRecGt1, flat); // Evt split den } - flatchrg.fill(HIST("hEvtMCRec"), 1.5); - - nRecCollINEL++; - if (collision.isInelGt0() && isINELgt0mc) { - flatchrg.fill(HIST("hEvtMCRec"), 2.5); - nRecCollINELgt0++; - } - // Sgn split num - for (const auto& particle : particles) { - if (!particle.isPhysicalPrimary()) { + for (const auto& collision : collisions) { + // Select collisions with the largest number of contributors + if (bestCollIndex != collision.globalIndex()) { continue; } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { + if (!collision.has_mcCollision()) { continue; } - static_for<0, 5>([&](auto i) { - constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTrecCollPrimSgn), mult, flat, particle.pt()); - if (nRecCollINELgt0) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTrecCollPrimSgnINEL), mult, flat, particle.pt()); - } - } - }); - } - } + const float multNpvMax = getMultMC(mcCollision); // using McCentFT0Ms - if (nRecCollINEL < 1) { - return; - } - // Evt loss num - flatchrg.fill(HIST("hEvtMcGenRecColl"), 0.5); - if (nRecCollINELgt0 > Cnull) { - flatchrg.fill(HIST("hEvtMcGenRecColl"), 1.5); - } + flatchrg.fill(HIST("hCentVsFlatRecGt0"), multNpvMax, flat); // Evt split num, w/ Nrec > 0 + if (!isGoodEvent(collision)) { + continue; + } + flatchrg.fill(HIST("hCentVsFlatRecGt0INELgt0"), multNpvMax, flat); // Evt split num, w/ Nrec > 0 + Evt. sel + flatchrg.fill(HIST("hNchVsCent"), multNpvMax, nCh08); + flatchrg.fill(HIST("hNchVsFlatRecGt0INELgt0"), nCh08, flat); // Evt loss num, w/ Nrec > 0 + Evt. sel - // Sgn loss num - for (const auto& particle : particles) { - if (!particle.isPhysicalPrimary()) { - continue; - } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { - continue; - } - static_for<0, 5>([&](auto i) { - constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTGenRecCollPrimSgn), mult, flat, particle.pt()); - if (nRecCollINELgt0) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTGenRecCollPrimSgnINEL), mult, flat, particle.pt()); + for (const auto& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; } + if (particle.pt() < trkSelOpt.cfgTrkPtMin) { + continue; + } + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTrecCollPrimSgn), nCh08, flat, particle.pt()); // Sgn loss num + } + }); } - }); + } } } PROCESS_SWITCH(FlattenictyPikp, processSgnLoss, "process to calcuate signal/event lossses", false); @@ -2435,7 +2441,7 @@ struct FlattenictyPikp { flatchrg.fill(HIST("hEvtMcGenColls"), 2); for (const auto& collision : groupedColls) { flatchrg.fill(HIST("hEvtMcGenColls"), 3); - if (!isGoodEvent(collision)) { + if (!isGoodEvent(collision)) { continue; } // Select collisions with the largest number of contributors @@ -2462,7 +2468,9 @@ struct FlattenictyPikp { if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { continue; } - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { + float phiModn = track.phi(); + phiMod(phiModn, magField, track.sign()); + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phiModn < fPhiCutHigh->Eval(track.pt()) && phiModn > fPhiCutLow->Eval(track.pt()))) { continue; } if (!isDCAxyWoCut(track)) { diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index d6f8a6df09f..f24f2a28763 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -467,7 +467,7 @@ struct HeavyionMultiplicity { if (isApplyCentFT0C) { cent = col.multMCFT0C(); } else if (isApplyCentFT0M) { - cent = (col.multMCFT0C() + col.multMCFT0A()) / 2.; + cent = col.multMCFT0C() + col.multMCFT0A(); } else if (isApplyCentFV0A) { cent = col.multMCFV0A(); } diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index cab9f30cb9a..30025ca9103 100644 --- a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx @@ -129,7 +129,7 @@ struct StudyPnch { x->SetBinLabel(6, "INEL > 0"); x->SetBinLabel(7, "|vz| < 10"); - if (doprocessData || doprocessCorrelation || doprocessMonteCarlo) { + if (doprocessData || doprocessCorrelation || doprocessMonteCarlo || doprocessModifiedMonteCarlo) { histos.add("PhiVsEtaHist", "PhiVsEtaHist", kTH2F, {axisPhi, axisEta}, false); } if (doprocessData) { @@ -148,6 +148,12 @@ struct StudyPnch { histos.add("hResponseMatrix", "hResponseMatrix", kTH2F, {axisMult, axisMult}, true); histos.add("hCountNTracks", "hCountNTracks", kTH1F, {axisCountNumberTracks}, true); } + if (doprocessModifiedMonteCarlo) { + histos.add("hMultiplicityMCrecMod", "hMultiplicityMCrecMod", kTH1F, {axisMult}, true); + histos.add("hMultiplicityMCgenMod", "hMultiplicityMCgenMod", kTH1F, {axisMult}, true); + histos.add("hResponseMatrixMod", "hResponseMatrixMod", kTH2F, {axisMult, axisMult}, true); + histos.add("hCountNTracksMod", "hCountNTracksMod", kTH1F, {axisCountNumberTracks}, true); + } if (doprocessEvtLossSigLossMC) { histos.add("MCEventHist", "MCEventHist", kTH1F, {axisEvent}, false); auto hstat = histos.get(HIST("MCEventHist")); @@ -163,7 +169,7 @@ struct StudyPnch { bool isEventSelected(CheckCol const& col) { histos.fill(HIST("EventHist"), 1); - if (isApplyTVX && !col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { + if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { return false; } histos.fill(HIST("EventHist"), 2); @@ -343,6 +349,28 @@ struct StudyPnch { } } + void processModifiedMonteCarlo(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + { + for (const auto& RecCol : RecCols) { + if (!isEventSelected(RecCol)) { + continue; + } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); + auto multrec = countNTracksMcCol(recTracksPart, RecCol); + if (multrec > 0) { + histos.fill(HIST("hMultiplicityMCrec"), multrec); + } + auto multgen = countGenTracks(GenParticles, mcCollision); + if (multgen > 0 && multrec > 0) { + histos.fill(HIST("hMultiplicityMCgen"), multgen); + histos.fill(HIST("hResponseMatrix"), multrec, multgen); + } + } + } + void processEvtLossSigLossMC(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles) { if (isApplyInelgt0 && !mcCollision.isInelGt0()) { @@ -387,6 +415,7 @@ struct StudyPnch { PROCESS_SWITCH(StudyPnch, processData, "process data CentFT0C", false); PROCESS_SWITCH(StudyPnch, processCorrelation, "do correlation study in data", false); PROCESS_SWITCH(StudyPnch, processMonteCarlo, "process MC CentFT0C", false); + PROCESS_SWITCH(StudyPnch, processModifiedMonteCarlo, "process MC CentFT0C", false); PROCESS_SWITCH(StudyPnch, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); }; diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index 8cc49c394a4..0609b38835e 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -166,9 +166,9 @@ o2physics_add_dpl_workflow(he3-lambda-derived-analysis COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(dedx-pid-analysis - SOURCES dedxPidAnalysis.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES dedxPidAnalysis.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(pikp-raa-analysis SOURCES piKpRAA.cxx @@ -181,9 +181,9 @@ o2physics_add_dpl_workflow(chargedparticle-raa COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(multiplicity-pt - SOURCES MultiplicityPt.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore - COMPONENT_NAME Analysis) + SOURCES multiplicityPt.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(deuteron-in-jets-trg-pt SOURCES DeuteronInJetsTrgPt.cxx diff --git a/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx b/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx deleted file mode 100644 index 6d30693af1b..00000000000 --- a/PWGLF/Tasks/Nuspex/MultiplicityPt.cxx +++ /dev/null @@ -1,1481 +0,0 @@ -// 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/LFParticleIdentification.h" -#include "PWGLF/DataModel/spectraTOF.h" -#include "PWGLF/Utils/inelGt.h" - -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/McCollisionExtra.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "TPDGCode.h" -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; - -using BCsRun3 = soa::Join; - -struct MultiplicityPt { - - // Service - Service pdg; - - // Add CCDB service for magnetic field - Service ccdb; - - Configurable isRun3{"isRun3", true, "is Run3 dataset"}; - Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; - Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; - Configurable askForCustomTVX{"askForCustomTVX", false, "Ask for custom TVX rather than sel8"}; - Configurable removeITSROFrameBorder{"removeITSROFrameBorder", false, "Remove ITS Read-Out Frame border"}; - Configurable removeNoSameBunchPileup{"removeNoSameBunchPileup", false, "Remove no same bunch pileup"}; - Configurable requireIsGoodZvtxFT0vsPV{"requireIsGoodZvtxFT0vsPV", false, "Require good Z vertex FT0 vs PV"}; - Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "Require vertex ITSTPC"}; - Configurable removeNoTimeFrameBorder{"removeNoTimeFrameBorder", false, "Remove no time frame border"}; - Configurable cfgCutEtaMax{"cfgCutEtaMax", 0.8f, "Max eta range for tracks"}; - Configurable cfgCutEtaMin{"cfgCutEtaMin", -0.8f, "Min eta range for tracks"}; - Configurable cfgCutY{"cfgCutY", 0.5f, "Y range for tracks"}; - Configurable cfgCutNsigma{"cfgCutNsigma", 3.0f, "nsigma cut range for tracks"}; - Configurable lastRequiredTrdCluster{"lastRequiredTrdCluster", -1, "Last cluster to require in TRD"}; - Configurable requireTrdOnly{"requireTrdOnly", false, "Require only tracks from TRD"}; - Configurable requireNoTrd{"requireNoTrd", false, "Require tracks without TRD"}; - Configurable multiplicityEstimator{"multiplicityEstimator", 6, - "Multiplicity estimator: 0=NoMult, 1=MultFV0M, 2=MultFT0M, 3=MultFDDM, 4=MultTracklets, 5=MultTPC, 6=MultNTracksPV, 7=MultNTracksPVeta1, 8=CentFT0C, 9=CentFT0M, 10=CentFV0A"}; - - // Analysis switches - Configurable enableDCAHistograms{"enableDCAHistograms", false, "Enable DCA histograms"}; - Configurable enablePIDHistograms{"enablePIDHistograms", true, "Enable PID histograms"}; - Configurable useCustomTrackCuts{"useCustomTrackCuts", true, "Flag to use custom track cuts"}; - Configurable itsPattern{"itsPattern", 0, "0 = Run3ITSibAny, 1 = Run3ITSallAny, 2 = Run3ITSall7Layers, 3 = Run3ITSibTwo"}; - Configurable requireITS{"requireITS", true, "Additional cut on the ITS requirement"}; - Configurable requireTPC{"requireTPC", true, "Additional cut on the TPC requirement"}; - Configurable requireGoldenChi2{"requireGoldenChi2", true, "Additional cut on the GoldenChi2"}; - Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 70.f, "Additional cut on the minimum number of crossed rows in the TPC"}; - Configurable minNCrossedRowsOverFindableClustersTPC{"minNCrossedRowsOverFindableClustersTPC", 0.8f, "Additional cut on the minimum value of the ratio between crossed rows and findable clusters in the TPC"}; - Configurable maxChi2PerClusterTPC{"maxChi2PerClusterTPC", 4.f, "Additional cut on the maximum value of the chi2 per cluster in the TPC"}; - Configurable minChi2PerClusterTPC{"minChi2PerClusterTPC", 0.5f, "Additional cut on the minimum value of the chi2 per cluster in the TPC"}; - Configurable maxChi2PerClusterITS{"maxChi2PerClusterITS", 36.f, "Additional cut on the maximum value of the chi2 per cluster in the ITS"}; - Configurable maxDcaXYFactor{"maxDcaXYFactor", 1.f, "Additional cut on the maximum value of the DCA xy (multiplicative factor)"}; - Configurable maxDcaZ{"maxDcaZ", 0.1f, "Additional cut on the maximum value of the DCA z"}; - Configurable minTPCNClsFound{"minTPCNClsFound", 70.f, "Additional cut on the minimum value of the number of found clusters in the TPC"}; - Configurable min_ITS_nClusters{"min_ITS_nClusters", 5, "minimum number of found ITS clusters"}; - - // Phi cut parameters - Configurable applyPhiCut{"applyPhiCut", true, "Apply phi sector cut to remove problematic TPC regions"}; - Configurable pTthresholdPhiCut{"pTthresholdPhiCut", 2.0f, "pT threshold above which to apply phi cut"}; - Configurable phiCutLowParam1{"phiCutLowParam1", 0.119297, "First parameter for low phi cut"}; - Configurable phiCutLowParam2{"phiCutLowParam2", 0.000379693, "Second parameter for low phi cut"}; - Configurable phiCutHighParam1{"phiCutHighParam1", 0.16685, "First parameter for high phi cut"}; - Configurable phiCutHighParam2{"phiCutHighParam2", 0.00981942, "Second parameter for high phi cut"}; - - // Basic track cuts - Configurable cfgTrkEtaCut{"cfgTrkEtaCut", 0.8f, "Eta range for tracks"}; - Configurable cfgTrkLowPtCut{"cfgTrkLowPtCut", 0.15f, "Minimum constituent pT"}; - - // Custom track cuts matching spectraTOF - TrackSelection customTrackCuts; - - // TF1 pointers for phi cuts - TF1* fphiCutLow = nullptr; - TF1* fphiCutHigh = nullptr; - - // Histogram Registry - HistogramRegistry ue; - - // ======================================================================== - // CENTRALITY/MULTIPLICITY CLASSES - Using same bins as before for consistency - // ======================================================================== - static constexpr int kCentralityClasses = 10; - static constexpr double CentClasses[kCentralityClasses + 1] = {0.0, 1.0, 5.0, 10.0, 15.0, 20.0, 30.0, 40.0, 50.0, 70.0, 100.0}; - - // Multiplicity percentile boundaries (computed on first pass) - std::vector multPercentileboundaries; - bool percentilesComputed = false; - - // Storage for multiplicity distribution (for percentile calculation) - std::vector multiplicityValues; - - // Table definitions - NO McCentFT0Ms dependency - using CollisionTableData = soa::Join; - using CollisionTableMC = soa::Join; - - // Track tables - TPC PID only - using TrackTableData = soa::Join; - using TrackTableMC = soa::Join; - - // MC tables - NO McCentFT0Ms - using CollisionTableMCTrue = aod::McCollisions; - using ParticleTableMC = aod::McParticles; - - // Preslice for MC particles - Preslice perMCCol = aod::mcparticle::mcCollisionId; - - // Multiplicity estimator enum - enum MultCodes : int { - kNoMultiplicity = 0, - kMultFV0M = 1, - kMultFT0M = 2, - kMultFDDM = 3, - kMultTracklets = 4, - kMultTPC = 5, - kMultNTracksPV = 6, - kMultNTracksPVeta1 = 7, - kCentralityFT0C = 8, - kCentralityFT0M = 9, - kCentralityFV0A = 10 - }; - - // Particle species enum - enum ParticleSpecies : int { - kPion = 0, - kKaon = 1, - kProton = 2, - kNSpecies = 3 - }; - - // PDG codes - static constexpr int PDGPion = 211; - static constexpr int PDGKaon = 321; - static constexpr int PDGProton = 2212; - - void processData(CollisionTableData::iterator const& collision, - TrackTableData const& tracks, - BCsRun3 const& bcs); - PROCESS_SWITCH(MultiplicityPt, processData, "process data", false); - - // MC processing - First pass to build percentiles - void processPercentileCalibration(CollisionTableMCTrue const& mcCollisions, - ParticleTableMC const& particles); - PROCESS_SWITCH(MultiplicityPt, processPercentileCalibration, "Build multiplicity percentile calibration (run first)", false); - - // MC processing - Main analysis - void processMC(TrackTableMC const& tracks, - aod::McParticles const& particles, - CollisionTableMCTrue const& mcCollisions, - CollisionTableMC const& collisions, - BCsRun3 const& bcs); - PROCESS_SWITCH(MultiplicityPt, processMC, "process MC", true); - - // True MC processing - void processTrue(CollisionTableMCTrue const& mcCollisions, - ParticleTableMC const& particles); - PROCESS_SWITCH(MultiplicityPt, processTrue, "process true MC", true); - - // ======================================================================== - // MULTIPLICITY GETTER FUNCTIONS - Using raw charged particle count - // ======================================================================== - - // Count charged primaries in |eta| < 1.0 - template - int countChargedPrimaries(const MCCollisionType& mcCollision, const ParticleTableMC& particles) const - { - int nCharged = 0; - auto particlesInColl = particles.sliceBy(perMCCol, mcCollision.globalIndex()); - for (const auto& p : particlesInColl) { - if (!p.isPhysicalPrimary()) - continue; - auto pdgParticle = pdg->GetParticle(p.pdgCode()); - if (!pdgParticle || pdgParticle->Charge() == 0.) - continue; - if (std::abs(p.eta()) < 1.0) - nCharged++; - } - return nCharged; - } - - // For reconstructed collisions - template - float getMultiplicity(const CollisionType& collision) const - { - switch (multiplicityEstimator.value) { - case kNoMultiplicity: - return 50.f; - case kMultFV0M: - return collision.multZeqFV0A(); - case kMultFT0M: - return collision.multZeqFT0A() + collision.multZeqFT0C(); - case kMultFDDM: - return collision.multZeqFDDA() + collision.multZeqFDDC(); - case kMultTracklets: - return 0.f; - case kMultTPC: - return collision.multTPC(); - case kMultNTracksPV: - return collision.multZeqNTracksPV(); - case kMultNTracksPVeta1: - return collision.multNTracksPVeta1(); - case kCentralityFT0C: - case kCentralityFT0M: - case kCentralityFV0A: - return collision.multZeqNTracksPV(); - default: - return 0.f; - } - } - - // For MC collisions - returns RAW multiplicity - template - float getMultiplicityMC(const MCCollisionType& mcCollision, const ParticleTableMC& particles) const - { - return static_cast(countChargedPrimaries(mcCollision, particles)); - } - - // Convert raw multiplicity to percentile - float multiplicityToPercentile(float rawMult) const - { - if (!percentilesComputed || multPercentileboundaries.empty()) { - // If percentiles not computed, return raw multiplicity - return rawMult; - } - - // Find which percentile bin this multiplicity falls into - for (size_t i = 0; i < multPercentileboundaries.size() - 1; ++i) { - if (rawMult >= multPercentileboundaries[i] && rawMult < multPercentileboundaries[i + 1]) { - // Return the CENTER of the percentile bin - return CentClasses[i] + (CentClasses[i + 1] - CentClasses[i]) / 2.0; - } - } - - // Handle edge cases - if (rawMult < multPercentileboundaries[0]) { - return CentClasses[0]; - } - return CentClasses[kCentralityClasses]; - } - - // Get centrality class index from raw multiplicity - int getCentralityClass(float rawMult) const - { - if (!percentilesComputed || multPercentileboundaries.empty()) { - // Fallback: divide into equal bins - float maxMult = 150.0f; // Assumed maximum - int bin = static_cast((rawMult / maxMult) * kCentralityClasses); - return std::min(bin, kCentralityClasses - 1); - } - - // Use computed percentiles - for (int i = 0; i < kCentralityClasses; ++i) { - if (rawMult >= multPercentileboundaries[i] && rawMult < multPercentileboundaries[i + 1]) { - return i; - } - } - - // Outside range - if (rawMult < multPercentileboundaries[0]) - return 0; - return kCentralityClasses - 1; - } - - // ======================================================================== - // COMPUTE PERCENTILE BOUNDARIES - // ======================================================================== - void computePercentileBoundaries() - { - if (multiplicityValues.empty()) { - LOG(warning) << "No multiplicity values to compute percentiles from!"; - return; - } - - // Sort multiplicity values - std::sort(multiplicityValues.begin(), multiplicityValues.end()); - - LOG(info) << "Computing percentile boundaries from " << multiplicityValues.size() << " events"; - - // Compute percentile boundaries - multPercentileboundaries.clear(); - multPercentileboundaries.reserve(kCentralityClasses + 1); - - for (int i = 0; i <= kCentralityClasses; ++i) { - float percentile = CentClasses[i]; - size_t index = static_cast(percentile / 100.0 * multiplicityValues.size()); - if (index >= multiplicityValues.size()) { - index = multiplicityValues.size() - 1; - } - float boundary = multiplicityValues[index]; - multPercentileboundaries.push_back(boundary); - LOG(info) << "Percentile " << percentile << "% -> Multiplicity >= " << boundary; - } - - percentilesComputed = true; - - LOG(info) << "=== Percentile Boundaries Computed ==="; - for (int i = 0; i < kCentralityClasses; ++i) { - LOG(info) << "Class " << i << ": [" << CentClasses[i] << "%-" << CentClasses[i + 1] - << "%] = Mult [" << multPercentileboundaries[i] << "-" << multPercentileboundaries[i + 1] << ")"; - } - } - - // ======================================================================== - // MAGNETIC FIELD FUNCTION - // ======================================================================== - int getMagneticField(uint64_t timestamp) - { - static o2::parameters::GRPMagField* grpo = nullptr; - if (grpo == nullptr) { - grpo = ccdb->getForTimeStamp("GLO/Config/GRPMagField", timestamp); - if (grpo == nullptr) { - LOGF(fatal, "GRP object not found for timestamp %llu", timestamp); - return 0; - } - LOGF(info, "Retrieved GRP for timestamp %llu with magnetic field of %d kG", timestamp, grpo->getNominalL3Field()); - } - return grpo->getNominalL3Field(); - } - - // ======================================================================== - // PHI CUT FUNCTION - // ======================================================================== - template - bool passedPhiCut(const TrackType& track, float magField) const - { - if (!applyPhiCut.value) { - return true; - } - - if (track.pt() < pTthresholdPhiCut.value) { - return true; - } - - float pt = track.pt(); - float phi = track.phi(); - int charge = track.sign(); - - if (magField < 0) { - phi = o2::constants::math::TwoPI - phi; - } - if (charge < 0) { - phi = o2::constants::math::TwoPI - phi; - } - - phi += o2::constants::math::PI / 18.0f; - phi = std::fmod(phi, o2::constants::math::PI / 9.0f); - - if (phi < fphiCutHigh->Eval(pt) && phi > fphiCutLow->Eval(pt)) { - return false; - } - - return true; - } - - float getTransformedPhi(const float phi, const int charge, const float magField) const - { - float transformedPhi = phi; - if (magField < 0) { - transformedPhi = o2::constants::math::TwoPI - transformedPhi; - } - if (charge < 0) { - transformedPhi = o2::constants::math::TwoPI - transformedPhi; - } - transformedPhi += o2::constants::math::PI / 18.0f; - transformedPhi = std::fmod(transformedPhi, o2::constants::math::PI / 9.0f); - return transformedPhi; - } - - // ======================================================================== - // TRACK SELECTION FUNCTIONS - // ======================================================================== - - template - bool passesCutWoDCA(TrackType const& track) const - { - if (useCustomTrackCuts.value) { - for (int i = 0; i < static_cast(TrackSelection::TrackCuts::kNCuts); i++) { - if (i == static_cast(TrackSelection::TrackCuts::kDCAxy) || - i == static_cast(TrackSelection::TrackCuts::kDCAz)) { - continue; - } - if (!customTrackCuts.IsSelected(track, static_cast(i))) { - return false; - } - } - return true; - } - return track.isGlobalTrackWoDCA(); - } - - template - bool passesDCAxyCut(TrackType const& track) const - { - if (useCustomTrackCuts.value) { - if (!passesCutWoDCA(track)) { - return false; - } - constexpr float dcaXYConst = 0.0105f; - constexpr float dcaXYPtScale = 0.0350f; - constexpr float dcaXYPtPower = 1.1f; - const float maxDcaXY = maxDcaXYFactor.value * (dcaXYConst + dcaXYPtScale / std::pow(track.pt(), dcaXYPtPower)); - if (std::abs(track.dcaXY()) > maxDcaXY) { - return false; - } - return true; - } - return track.isGlobalTrack(); - } - - template - bool passesTrackSelection(TrackType const& track, float magField = 0) const - { - if (track.eta() < cfgCutEtaMin.value || track.eta() > cfgCutEtaMax.value) - return false; - - if (track.tpcChi2NCl() < minChi2PerClusterTPC.value || track.tpcChi2NCl() > maxChi2PerClusterTPC.value) - return false; - - if (!passesCutWoDCA(track)) - return false; - - if (applyPhiCut.value && !passedPhiCut(track, magField)) - return false; - - return passesDCAxyCut(track); - } - - // ======================================================================== - // PID SELECTION FUNCTIONS - // ======================================================================== - - template - bool passesPIDSelection(TrackType const& track) const - { - float nsigmaTPC = 0.f; - - if constexpr (species == kPion) { - nsigmaTPC = track.tpcNSigmaPi(); - } else if constexpr (species == kKaon) { - nsigmaTPC = track.tpcNSigmaKa(); - } else if constexpr (species == kProton) { - nsigmaTPC = track.tpcNSigmaPr(); - } - - return (std::abs(nsigmaTPC) < cfgCutNsigma.value); - } - - template - int getBestPIDHypothesis(TrackType const& track) const - { - float nsigmaPi = std::abs(track.tpcNSigmaPi()); - float nsigmaKa = std::abs(track.tpcNSigmaKa()); - float nsigmaPr = std::abs(track.tpcNSigmaPr()); - - constexpr float largeNSigmaValue = 999.0f; - float minNSigma = largeNSigmaValue; - int bestSpecies = -1; - - if (nsigmaPi < cfgCutNsigma.value && nsigmaPi < minNSigma) { - minNSigma = nsigmaPi; - bestSpecies = kPion; - } - if (nsigmaKa < cfgCutNsigma.value && nsigmaKa < minNSigma) { - minNSigma = nsigmaKa; - bestSpecies = kKaon; - } - if (nsigmaPr < cfgCutNsigma.value && nsigmaPr < minNSigma) { - minNSigma = nsigmaPr; - bestSpecies = kProton; - } - - return bestSpecies; - } - - // ======================================================================== - // EVENT SELECTION FUNCTION - // ======================================================================== - - template - bool isEventSelected(CollisionType const& collision) - { - if constexpr (fillHistograms) { - ue.fill(HIST("evsel"), 1.f); - if (collision.isInelGt0()) - ue.fill(HIST("evsel"), 2.f); - if (collision.isInelGt1()) - ue.fill(HIST("evsel"), 3.f); - } - - if (askForCustomTVX.value) { - if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) - return false; - } else { - if (!collision.sel8()) - return false; - } - - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 4.f); - - if (removeITSROFrameBorder.value && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 5.f); - - if (removeNoSameBunchPileup.value && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 6.f); - - if (requireIsGoodZvtxFT0vsPV.value && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 7.f); - - if (requireIsVertexITSTPC.value && !collision.selection_bit(aod::evsel::kIsVertexITSTPC)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 8.f); - - if (removeNoTimeFrameBorder.value && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) - return false; - if constexpr (fillHistograms) - ue.fill(HIST("evsel"), 9.f); - - if (std::abs(collision.posZ()) > cfgCutVertex.value) - return false; - - if constexpr (fillHistograms) { - ue.fill(HIST("evsel"), 13.f); - if (collision.isInelGt0()) - ue.fill(HIST("evsel"), 14.f); - if (collision.isInelGt1()) - ue.fill(HIST("evsel"), 15.f); - } - - if (cfgINELCut.value == 1 && !collision.isInelGt0()) - return false; - if (cfgINELCut.value == 2 && !collision.isInelGt1()) - return false; - - return true; - } - - // ======================================================================== - // PRIMARY SELECTION - // ======================================================================== - - template - bool isGoodPrimary(ParticleType const& particle) const - { - auto pdgParticle = pdg->GetParticle(particle.pdgCode()); - if (!pdgParticle || pdgParticle->Charge() == 0.) - return false; - - if (!particle.isPhysicalPrimary()) - return false; - - if (std::abs(particle.eta()) >= cfgCutEtaMax.value) - return false; - if (particle.pt() < cfgTrkLowPtCut.value) - return false; - - if (std::abs(particle.y()) > cfgCutY.value) - return false; - - return true; - } - - template - bool isGoodPrimarySpecies(ParticleType const& particle) const - { - int pdgCode = std::abs(particle.pdgCode()); - int expectedPDG = 0; - - if constexpr (species == kPion) - expectedPDG = PDGPion; - else if constexpr (species == kKaon) - expectedPDG = PDGKaon; - else if constexpr (species == kProton) - expectedPDG = PDGProton; - - if (pdgCode != expectedPDG) - return false; - - return isGoodPrimary(particle); - } - - void init(InitContext const&); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} - -void MultiplicityPt::init(InitContext const&) -{ - // ======================================================================== - // CUSTOM TRACK CUTS INITIALIZATION - // ======================================================================== - - if (useCustomTrackCuts.value) { - LOG(info) << "Using custom track cuts matching spectraTOF approach"; - customTrackCuts = getGlobalTrackSelectionRun3ITSMatch(itsPattern.value); - - customTrackCuts.SetRequireITSRefit(requireITS.value); - customTrackCuts.SetRequireTPCRefit(requireTPC.value); - customTrackCuts.SetMinNClustersITS(min_ITS_nClusters.value); - customTrackCuts.SetRequireGoldenChi2(requireGoldenChi2.value); - customTrackCuts.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value); - customTrackCuts.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value); - customTrackCuts.SetMinNCrossedRowsTPC(minNCrossedRowsTPC.value); - customTrackCuts.SetMinNClustersTPC(minTPCNClsFound.value); - customTrackCuts.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC.value); - customTrackCuts.SetMaxDcaXYPtDep([](float /*pt*/) { return 10000.f; }); - customTrackCuts.SetMaxDcaZ(maxDcaZ.value); - - customTrackCuts.print(); - } - - // ======================================================================== - // PHI CUT INITIALIZATION - // ======================================================================== - - if (applyPhiCut.value) { - fphiCutLow = new TF1("StandardPhiCutLow", - Form("%f/x/x+pi/18.0-%f", - phiCutLowParam1.value, phiCutLowParam2.value), - 0, 50); - fphiCutHigh = new TF1("StandardPhiCutHigh", - Form("%f/x+pi/18.0+%f", - phiCutHighParam1.value, phiCutHighParam2.value), - 0, 50); - - LOGF(info, "=== Phi Cut Parameters ==="); - LOGF(info, "Low cut: %.6f/x² + pi/18 - %.6f", - phiCutLowParam1.value, phiCutLowParam2.value); - LOGF(info, "High cut: %.6f/x + pi/18 + %.6f", - phiCutHighParam1.value, phiCutHighParam2.value); - LOGF(info, "Applied for pT > %.1f GeV/c", pTthresholdPhiCut.value); - } - - // ======================================================================== - // AXIS DEFINITIONS - // ======================================================================== - - ConfigurableAxis ptBinning{ - "ptBinning", - {0.0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, - 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, - 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.2, 2.4, 2.6, 2.8, - 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, - 12.0, 14.0, 16.0, 18.0, 20.0, 25.0, 30.0, 40.0, 50.0}, - "pT bin limits"}; - AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; - - // Multiplicity axis - initially raw multiplicity, will represent percentiles after calibration - std::vector centBins(CentClasses, CentClasses + kCentralityClasses + 1); - AxisSpec multAxis = {centBins, "Centrality/Multiplicity Class (%)"}; - - // Raw multiplicity axis for calibration - AxisSpec rawMultAxis = {150, 0, 150, "N_{ch} (|#eta| < 1.0)"}; - - // ======================================================================== - // HISTOGRAM REGISTRY - // ======================================================================== - - // Multiplicity distribution for percentile calibration - ue.add("Calibration/hRawMultiplicity", "Raw multiplicity distribution;N_{ch};Events", - HistType::kTH1D, {rawMultAxis}); - - // Event counting - ue.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", HistType::kTH1D, {{10, 0.5, 10.5}}); - auto hColl = ue.get(HIST("MC/GenRecoCollisions")); - hColl->GetXaxis()->SetBinLabel(1, "Collisions generated"); - hColl->GetXaxis()->SetBinLabel(2, "Collisions reconstructed"); - - // Event loss histograms - ue.add("MC/EventLoss/MultGenerated", "Generated events vs multiplicity", - HistType::kTH1D, {multAxis}); - ue.add("MC/EventLoss/MultBadVertex", "Events with bad vertex vs multiplicity", - HistType::kTH1D, {multAxis}); - ue.add("MC/EventLoss/MultPhysicsSelected", "Physics-selected events vs multiplicity", - HistType::kTH1D, {multAxis}); - ue.add("MC/EventLoss/MultReconstructed", "Reconstructed events vs multiplicity", - HistType::kTH1D, {multAxis}); - ue.add("MC/EventLoss/MultRecoSelected", "Reconstructed+selected events vs multiplicity", - HistType::kTH1D, {multAxis}); - - ue.add("hEventLossBreakdown", "Event loss breakdown", HistType::kTH1D, {{4, 0.5, 4.5}}); - auto hLoss = ue.get(HIST("hEventLossBreakdown")); - hLoss->GetXaxis()->SetBinLabel(1, "Physics selected"); - hLoss->GetXaxis()->SetBinLabel(2, "Reconstructed"); - hLoss->GetXaxis()->SetBinLabel(3, "Selected"); - hLoss->GetXaxis()->SetBinLabel(4, "Final efficiency"); - - // ======================================================================== - // INCLUSIVE CHARGED PARTICLE HISTOGRAMS - // ======================================================================== - - ue.add("Inclusive/hPtPrimGenAll", "All generated primaries (no cuts);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGenAllVsMult", "All generated primaries vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimBadVertex", "Generated primaries (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimBadVertexVsMult", "Generated primaries (bad vertex) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimGen", "Generated primaries (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGenVsMult", "Generated primaries (after phys sel) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimRecoEv", "Generated primaries (reco events);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimRecoEvVsMult", "Generated primaries (reco events) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimGoodEv", "Generated primaries (good events);#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimGoodEvVsMult", "Generated primaries (good events) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtNumEff", "Tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtNumEffVsMult", "Tracking efficiency numerator vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtDenEff", "Tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtDenEffVsMult", "Tracking efficiency denominator vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtAllReco", "All reconstructed tracks;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtAllRecoVsMult", "All reconstructed tracks vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtPrimReco", "Reconstructed primaries;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtPrimRecoVsMult", "Reconstructed primaries vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtSecReco", "Reconstructed secondaries;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtSecRecoVsMult", "Reconstructed secondaries vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add("Inclusive/hPtMeasured", "All measured tracks;#it{p}_{T} (GeV/#it{c});Counts", - HistType::kTH1D, {ptAxis}); - ue.add("Inclusive/hPtMeasuredVsMult", "All measured tracks vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%)", - HistType::kTH2D, {ptAxis, multAxis}); - - // ======================================================================== - // PARTICLE-SPECIFIC HISTOGRAMS - // ======================================================================== - - const std::array particleNames = {"Pion", "Kaon", "Proton"}; - const std::array particleSymbols = {"#pi^{#pm}", "K^{#pm}", "p+#bar{p}"}; - - for (int iSpecies = 0; iSpecies < kNSpecies; ++iSpecies) { - const auto& name = particleNames[iSpecies]; - const auto& symbol = particleSymbols[iSpecies]; - - // 1D versions - ue.add(Form("%s/hPtPrimGenAll", name.c_str()), - Form("All generated %s (no cuts);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtPrimBadVertex", name.c_str()), - Form("Generated %s (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtPrimGen", name.c_str()), - Form("Generated %s (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtPrimRecoEv", name.c_str()), - Form("Generated %s (reco events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - ue.add(Form("%s/hPtPrimGoodEv", name.c_str()), - Form("Generated %s (good events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - - // 2D versions (vs multiplicity class) - ue.add(Form("%s/hPtPrimGenAllVsMult", name.c_str()), - Form("All generated %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimBadVertexVsMult", name.c_str()), - Form("Generated %s (bad vertex) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimGenVsMult", name.c_str()), - Form("Generated %s (after phys sel) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimRecoEvVsMult", name.c_str()), - Form("Generated %s (reco events) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimGoodEvVsMult", name.c_str()), - Form("Generated %s (good events) vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - // Tracking efficiency - ue.add(Form("%s/hPtNumEff", name.c_str()), - Form("%s tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtNumEffVsMult", name.c_str()), - Form("%s tracking eff numerator vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtDenEff", name.c_str()), - Form("%s tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtDenEffVsMult", name.c_str()), - Form("%s tracking eff denominator vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - // Primary fraction - ue.add(Form("%s/hPtAllReco", name.c_str()), - Form("All reconstructed %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtAllRecoVsMult", name.c_str()), - Form("All reconstructed %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtPrimReco", name.c_str()), - Form("Reconstructed primary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtPrimRecoVsMult", name.c_str()), - Form("Reconstructed primary %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - ue.add(Form("%s/hPtSecReco", name.c_str()), - Form("Reconstructed secondary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtSecRecoVsMult", name.c_str()), - Form("Reconstructed secondary %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - // Measured spectra - ue.add(Form("%s/hPtMeasured", name.c_str()), - Form("Measured %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), - HistType::kTH1D, {ptAxis}); - ue.add(Form("%s/hPtMeasuredVsMult", name.c_str()), - Form("Measured %s vs mult;#it{p}_{T} (GeV/#it{c});Mult Class (%%)", symbol.c_str()), - HistType::kTH2D, {ptAxis, multAxis}); - - // PID quality - if (enablePIDHistograms) { - ue.add(Form("%s/hNsigmaTPC", name.c_str()), - Form("TPC n#sigma %s;#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", symbol.c_str()), - HistType::kTH2D, {ptAxis, {200, -10, 10}}); - } - } - - // ======================================================================== - // PHI CUT MONITORING - // ======================================================================== - - if (applyPhiCut.value) { - ue.add("PhiCut/hPtVsPhiPrimeBefore", "pT vs φ' before cut;p_{T} (GeV/c);φ'", - HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); - ue.add("PhiCut/hPtVsPhiPrimeAfter", "pT vs φ' after cut;p_{T} (GeV/c);φ'", - HistType::kTH2F, {{100, 0, 10}, {100, 0, 0.4}}); - ue.add("PhiCut/hRejectionRate", "Track rejection rate by phi cut;p_{T} (GeV/c);Rejection Rate", - HistType::kTProfile, {{100, 0, 10}}); - } - - // ======================================================================== - // EVENT SELECTION HISTOGRAM - // ======================================================================== - - constexpr int nEvSelBins = 20; - constexpr float evSelMin = 0.5f; - constexpr float evSelMax = 20.5f; - ue.add("evsel", "Event selection", HistType::kTH1D, {{nEvSelBins, evSelMin, evSelMax}}); - auto h = ue.get(HIST("evsel")); - h->GetXaxis()->SetBinLabel(1, "Events read"); - h->GetXaxis()->SetBinLabel(2, "INEL>0"); - h->GetXaxis()->SetBinLabel(3, "INEL>1"); - h->GetXaxis()->SetBinLabel(4, "Trigger passed"); - h->GetXaxis()->SetBinLabel(5, "NoITSROFrameBorder"); - h->GetXaxis()->SetBinLabel(6, "NoSameBunchPileup"); - h->GetXaxis()->SetBinLabel(7, "IsGoodZvtxFT0vsPV"); - h->GetXaxis()->SetBinLabel(8, "IsVertexITSTPC"); - h->GetXaxis()->SetBinLabel(9, "NoTimeFrameBorder"); - h->GetXaxis()->SetBinLabel(13, "posZ passed"); - h->GetXaxis()->SetBinLabel(14, "INEL>0 (final)"); - h->GetXaxis()->SetBinLabel(15, "INEL>1 (final)"); - - ue.add("hEta", "Track eta;#eta;Counts", HistType::kTH1D, {{20, -0.8, 0.8}}); - ue.add("hPhi", "Track phi;#varphi (rad);Counts", HistType::kTH1D, {{64, 0, 2.0 * M_PI}}); - ue.add("hvtxZ", "Vertex Z (data);Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); - ue.add("hvtxZmc", "MC vertex Z;Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); - - LOG(info) << "=== Initialized MultiplicityPt task with ON-THE-FLY PERCENTILE COMPUTATION ==="; - LOG(info) << "Centrality classes: " << kCentralityClasses; - LOG(info) << "Multiplicity estimator: " << multiplicityEstimator.value; - LOG(info) << "IMPORTANT: Run processPercentileCalibration FIRST to build percentile boundaries!"; - if (applyPhiCut.value) { - LOG(info) << "Phi cut ENABLED for pT > " << pTthresholdPhiCut.value << " GeV/c"; - } -} - -// ======================================================================== -// PERCENTILE CALIBRATION PASS -// ======================================================================== -void MultiplicityPt::processPercentileCalibration(CollisionTableMCTrue const& mcCollisions, - ParticleTableMC const& particles) -{ - LOG(info) << "=== PERCENTILE CALIBRATION PASS ==="; - LOG(info) << "Processing " << mcCollisions.size() << " MC collisions"; - - multiplicityValues.clear(); - multiplicityValues.reserve(mcCollisions.size()); - - for (const auto& mcCollision : mcCollisions) { - // Apply basic cuts - if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) - continue; - - auto particlesInCollision = particles.sliceBy(perMCCol, mcCollision.globalIndex()); - - // Apply INEL cuts - if (cfgINELCut.value == 1 && !o2::pwglf::isINELgt0mc(particlesInCollision, pdg)) - continue; - if (cfgINELCut.value == 2 && !o2::pwglf::isINELgt1mc(particlesInCollision, pdg)) - continue; - - // Calculate multiplicity - float mcMult = getMultiplicityMC(mcCollision, particles); - multiplicityValues.push_back(mcMult); - - ue.fill(HIST("Calibration/hRawMultiplicity"), mcMult); - } - - // Compute percentile boundaries - computePercentileBoundaries(); - - LOG(info) << "=== PERCENTILE CALIBRATION COMPLETE ==="; - LOG(info) << "Processed " << multiplicityValues.size() << " events"; - LOG(info) << "Now run processMC and processTrue with these percentiles"; -} - -// ======================================================================== -// DATA PROCESSING -// ======================================================================== -void MultiplicityPt::processData(CollisionTableData::iterator const& collision, - TrackTableData const& tracks, - BCsRun3 const& /*bcs*/) -{ - if (!isEventSelected(collision)) { - return; - } - ue.fill(HIST("hvtxZ"), collision.posZ()); - - float magField = 0; - if (applyPhiCut.value) { - const auto& bc = collision.bc_as(); - magField = getMagneticField(bc.timestamp()); - } - - for (const auto& track : tracks) { - if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { - float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); - ue.fill(HIST("PhiCut/hPtVsPhiPrimeBefore"), track.pt(), phiPrime); - } - - if (!passesTrackSelection(track, magField)) { - continue; - } - - if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { - float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); - ue.fill(HIST("PhiCut/hPtVsPhiPrimeAfter"), track.pt(), phiPrime); - } - - ue.fill(HIST("Inclusive/hPtMeasured"), track.pt()); - ue.fill(HIST("hEta"), track.eta()); - ue.fill(HIST("hPhi"), track.phi()); - - int bestSpecies = getBestPIDHypothesis(track); - - if (bestSpecies == kPion) { - ue.fill(HIST("Pion/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); - } - } else if (bestSpecies == kKaon) { - ue.fill(HIST("Kaon/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); - } - } else if (bestSpecies == kProton) { - ue.fill(HIST("Proton/hPtMeasured"), track.pt()); - if (enablePIDHistograms) { - ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); - } - } - } -} - -// ======================================================================== -// MC PROCESSING - Using computed percentiles -// ======================================================================== -void MultiplicityPt::processMC(TrackTableMC const& tracks, - aod::McParticles const& particles, - CollisionTableMCTrue const& mcCollisions, - CollisionTableMC const& collisions, - BCsRun3 const& /*bcs*/) -{ - if (!percentilesComputed) { - LOG(warning) << "Percentiles not computed yet! Run processPercentileCalibration first!"; - LOG(warning) << "Using fallback linear binning for now..."; - } - - LOG(info) << "=== DEBUG processMC START ==="; - LOG(info) << "MC collisions: " << mcCollisions.size(); - LOG(info) << "Reconstructed collisions: " << collisions.size(); - - ue.fill(HIST("MC/GenRecoCollisions"), 1.f, mcCollisions.size()); - ue.fill(HIST("MC/GenRecoCollisions"), 2.f, collisions.size()); - - std::set physicsSelectedMCCollisions; - std::set reconstructedMCCollisions; - std::set selectedMCCollisions; - - std::map mcCollisionMultiplicity; - std::map mcCollisionPercentile; - - // First pass: classify MC collisions - for (const auto& mcCollision : mcCollisions) { - int64_t mcCollId = mcCollision.globalIndex(); - - float mcMult = getMultiplicityMC(mcCollision, particles); - mcCollisionMultiplicity[mcCollId] = mcMult; - - // Convert to percentile - float percentile = multiplicityToPercentile(mcMult); - mcCollisionPercentile[mcCollId] = percentile; - - ue.fill(HIST("MC/EventLoss/MultGenerated"), percentile); - - auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); - - if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { - ue.fill(HIST("MC/EventLoss/MultBadVertex"), percentile); - continue; - } - - if (cfgINELCut.value == 1 && !o2::pwglf::isINELgt0mc(particlesInCollision, pdg)) { - continue; - } - if (cfgINELCut.value == 2 && !o2::pwglf::isINELgt1mc(particlesInCollision, pdg)) { - continue; - } - - physicsSelectedMCCollisions.insert(mcCollId); - ue.fill(HIST("MC/EventLoss/MultPhysicsSelected"), percentile); - } - - LOG(info) << "Physics-selected MC collisions: " << physicsSelectedMCCollisions.size(); - - // Second pass: track reconstructed events - std::set selectedCollisionIndices; - - for (const auto& collision : collisions) { - if (!collision.has_mcCollision()) { - continue; - } - - const auto& mcCollision = collision.mcCollision_as(); - int64_t mcCollId = mcCollision.globalIndex(); - - if (physicsSelectedMCCollisions.find(mcCollId) == physicsSelectedMCCollisions.end()) { - continue; - } - - float percentile = mcCollisionPercentile[mcCollId]; - - if (reconstructedMCCollisions.find(mcCollId) == reconstructedMCCollisions.end()) { - reconstructedMCCollisions.insert(mcCollId); - ue.fill(HIST("MC/EventLoss/MultReconstructed"), percentile); - } - - if (isEventSelected(collision)) { - if (selectedMCCollisions.find(mcCollId) == selectedMCCollisions.end()) { - selectedMCCollisions.insert(mcCollId); - ue.fill(HIST("MC/EventLoss/MultRecoSelected"), percentile); - } - selectedCollisionIndices.insert(collision.globalIndex()); - ue.fill(HIST("hvtxZ"), collision.posZ()); - } - } - - LOG(info) << "Reconstructed MC collisions: " << reconstructedMCCollisions.size(); - LOG(info) << "Selected MC collisions: " << selectedMCCollisions.size(); - - int nPhysicsSelected = physicsSelectedMCCollisions.size(); - int nReconstructed = reconstructedMCCollisions.size(); - int nSelected = selectedMCCollisions.size(); - - if (nPhysicsSelected > 0) { - ue.fill(HIST("hEventLossBreakdown"), 1, nPhysicsSelected); - ue.fill(HIST("hEventLossBreakdown"), 2, nReconstructed); - ue.fill(HIST("hEventLossBreakdown"), 3, nSelected); - ue.fill(HIST("hEventLossBreakdown"), 4, (nSelected * 100.0 / nPhysicsSelected)); - } - - // Process tracks - int totalTracksProcessed = 0; - int tracksFromSelectedEvents = 0; - int tracksPassingSelection = 0; - - std::array particleTracksIdentified = {0}; - std::array particleTracksPrimary = {0}; - std::array particleTracksSecondary = {0}; - - for (const auto& track : tracks) { - totalTracksProcessed++; - - if (!track.has_collision()) - continue; - - const auto& collision = track.collision_as(); - - if (selectedCollisionIndices.find(collision.globalIndex()) == selectedCollisionIndices.end()) { - continue; - } - tracksFromSelectedEvents++; - - if (!collision.has_mcCollision()) - continue; - - const auto& mcCollision = collision.mcCollision_as(); - float percentile = mcCollisionPercentile[mcCollision.globalIndex()]; - - float magField = 0; - if (applyPhiCut.value) { - const auto& bc = collision.bc_as(); - magField = getMagneticField(bc.timestamp()); - } - - if (!passesTrackSelection(track, magField)) { - continue; - } - tracksPassingSelection++; - - // Inclusive charged particle - ue.fill(HIST("Inclusive/hPtMeasured"), track.pt()); - ue.fill(HIST("Inclusive/hPtMeasuredVsMult"), track.pt(), percentile); - ue.fill(HIST("Inclusive/hPtAllReco"), track.pt()); - ue.fill(HIST("Inclusive/hPtAllRecoVsMult"), track.pt(), percentile); - ue.fill(HIST("hEta"), track.eta()); - ue.fill(HIST("hPhi"), track.phi()); - - // Efficiency numerator - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - int pdgCode = std::abs(particle.pdgCode()); - - if (particle.isPhysicalPrimary()) { - ue.fill(HIST("Inclusive/hPtNumEff"), particle.pt()); - ue.fill(HIST("Inclusive/hPtNumEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); - ue.fill(HIST("Inclusive/hPtPrimRecoVsMult"), track.pt(), percentile); - - if (pdgCode == PDGPion) { - ue.fill(HIST("Pion/hPtNumEff"), particle.pt()); - ue.fill(HIST("Pion/hPtNumEffVsMult"), particle.pt(), percentile); - } - if (pdgCode == PDGKaon) { - ue.fill(HIST("Kaon/hPtNumEff"), particle.pt()); - ue.fill(HIST("Kaon/hPtNumEffVsMult"), particle.pt(), percentile); - } - if (pdgCode == PDGProton) { - ue.fill(HIST("Proton/hPtNumEff"), particle.pt()); - ue.fill(HIST("Proton/hPtNumEffVsMult"), particle.pt(), percentile); - } - } else { - ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); - ue.fill(HIST("Inclusive/hPtSecRecoVsMult"), track.pt(), percentile); - } - } - - // Identified particle analysis - int bestSpecies = getBestPIDHypothesis(track); - - if (bestSpecies == kPion) { - ue.fill(HIST("Pion/hPtMeasured"), track.pt()); - ue.fill(HIST("Pion/hPtMeasuredVsMult"), track.pt(), percentile); - ue.fill(HIST("Pion/hPtAllReco"), track.pt()); - ue.fill(HIST("Pion/hPtAllRecoVsMult"), track.pt(), percentile); - particleTracksIdentified[kPion]++; - - if (enablePIDHistograms) { - ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); - } - - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - if (particle.isPhysicalPrimary()) { - ue.fill(HIST("Pion/hPtPrimReco"), track.pt()); - ue.fill(HIST("Pion/hPtPrimRecoVsMult"), track.pt(), percentile); - particleTracksPrimary[kPion]++; - } else { - ue.fill(HIST("Pion/hPtSecReco"), track.pt()); - ue.fill(HIST("Pion/hPtSecRecoVsMult"), track.pt(), percentile); - particleTracksSecondary[kPion]++; - } - } - - } else if (bestSpecies == kKaon) { - ue.fill(HIST("Kaon/hPtMeasured"), track.pt()); - ue.fill(HIST("Kaon/hPtMeasuredVsMult"), track.pt(), percentile); - ue.fill(HIST("Kaon/hPtAllReco"), track.pt()); - ue.fill(HIST("Kaon/hPtAllRecoVsMult"), track.pt(), percentile); - particleTracksIdentified[kKaon]++; - - if (enablePIDHistograms) { - ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); - } - - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - if (particle.isPhysicalPrimary()) { - ue.fill(HIST("Kaon/hPtPrimReco"), track.pt()); - ue.fill(HIST("Kaon/hPtPrimRecoVsMult"), track.pt(), percentile); - particleTracksPrimary[kKaon]++; - } else { - ue.fill(HIST("Kaon/hPtSecReco"), track.pt()); - ue.fill(HIST("Kaon/hPtSecRecoVsMult"), track.pt(), percentile); - particleTracksSecondary[kKaon]++; - } - } - - } else if (bestSpecies == kProton) { - ue.fill(HIST("Proton/hPtMeasured"), track.pt()); - ue.fill(HIST("Proton/hPtMeasuredVsMult"), track.pt(), percentile); - ue.fill(HIST("Proton/hPtAllReco"), track.pt()); - ue.fill(HIST("Proton/hPtAllRecoVsMult"), track.pt(), percentile); - particleTracksIdentified[kProton]++; - - if (enablePIDHistograms) { - ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); - } - - if (track.has_mcParticle()) { - const auto& particle = track.mcParticle(); - if (particle.isPhysicalPrimary()) { - ue.fill(HIST("Proton/hPtPrimReco"), track.pt()); - ue.fill(HIST("Proton/hPtPrimRecoVsMult"), track.pt(), percentile); - particleTracksPrimary[kProton]++; - } else { - ue.fill(HIST("Proton/hPtSecReco"), track.pt()); - ue.fill(HIST("Proton/hPtSecRecoVsMult"), track.pt(), percentile); - particleTracksSecondary[kProton]++; - } - } - } - } - - LOG(info) << "=== DEBUG TRACK COUNTING ==="; - LOG(info) << "Total tracks processed: " << totalTracksProcessed; - LOG(info) << "Tracks from selected events: " << tracksFromSelectedEvents; - LOG(info) << "Tracks passing selection: " << tracksPassingSelection; - - LOG(info) << "Pions identified: " << particleTracksIdentified[kPion] - << ", primary: " << particleTracksPrimary[kPion] - << ", secondary: " << particleTracksSecondary[kPion]; - LOG(info) << "Kaons identified: " << particleTracksIdentified[kKaon] - << ", primary: " << particleTracksPrimary[kKaon] - << ", secondary: " << particleTracksSecondary[kKaon]; - LOG(info) << "Protons identified: " << particleTracksIdentified[kProton] - << ", primary: " << particleTracksPrimary[kProton] - << ", secondary: " << particleTracksSecondary[kProton]; - - LOG(info) << "=== DEBUG processMC END ==="; -} - -// ======================================================================== -// TRUE MC PROCESSING - Using computed percentiles -// ======================================================================== -void MultiplicityPt::processTrue(CollisionTableMCTrue const& mcCollisions, - ParticleTableMC const& particles) -{ - if (!percentilesComputed) { - LOG(warning) << "Percentiles not computed yet! Run processPercentileCalibration first!"; - } - - LOG(info) << "=== DEBUG processTrue START ==="; - LOG(info) << "Number of MC collisions: " << mcCollisions.size(); - - int nAllGenerated = 0; - int nBadVertex = 0; - int nPhysicsSelected = 0; - - std::array particleCountAll = {0}; - std::array particleCountBadVertex = {0}; - std::array particleCountAfterPS = {0}; - - for (const auto& mcCollision : mcCollisions) { - nAllGenerated++; - - float mcMult = getMultiplicityMC(mcCollision, particles); - float percentile = multiplicityToPercentile(mcMult); - - ue.fill(HIST("hvtxZmc"), mcCollision.posZ()); - auto particlesInCollision = particles.sliceBy(perMCCol, mcCollision.globalIndex()); - - // Fill ALL generated primaries BEFORE any cuts - for (const auto& particle : particlesInCollision) { - if (isGoodPrimary(particle)) { - ue.fill(HIST("Inclusive/hPtPrimGenAll"), particle.pt()); - ue.fill(HIST("Inclusive/hPtPrimGenAllVsMult"), particle.pt(), percentile); - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Pion/hPtPrimGenAll"), particle.pt()); - ue.fill(HIST("Pion/hPtPrimGenAllVsMult"), particle.pt(), percentile); - particleCountAll[kPion]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Kaon/hPtPrimGenAll"), particle.pt()); - ue.fill(HIST("Kaon/hPtPrimGenAllVsMult"), particle.pt(), percentile); - particleCountAll[kKaon]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Proton/hPtPrimGenAll"), particle.pt()); - ue.fill(HIST("Proton/hPtPrimGenAllVsMult"), particle.pt(), percentile); - particleCountAll[kProton]++; - } - } - - // Apply vertex cut - if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { - nBadVertex++; - - for (const auto& particle : particlesInCollision) { - if (isGoodPrimary(particle)) { - ue.fill(HIST("Inclusive/hPtPrimBadVertex"), particle.pt()); - ue.fill(HIST("Inclusive/hPtPrimBadVertexVsMult"), particle.pt(), percentile); - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Pion/hPtPrimBadVertex"), particle.pt()); - ue.fill(HIST("Pion/hPtPrimBadVertexVsMult"), particle.pt(), percentile); - particleCountBadVertex[kPion]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Kaon/hPtPrimBadVertex"), particle.pt()); - ue.fill(HIST("Kaon/hPtPrimBadVertexVsMult"), particle.pt(), percentile); - particleCountBadVertex[kKaon]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Proton/hPtPrimBadVertex"), particle.pt()); - ue.fill(HIST("Proton/hPtPrimBadVertexVsMult"), particle.pt(), percentile); - particleCountBadVertex[kProton]++; - } - } - continue; - } - - // Apply INEL cuts - if (cfgINELCut.value == 1 && !o2::pwglf::isINELgt0mc(particlesInCollision, pdg)) - continue; - if (cfgINELCut.value == 2 && !o2::pwglf::isINELgt1mc(particlesInCollision, pdg)) - continue; - - nPhysicsSelected++; - - // Fill primaries AFTER physics selection (denominator for efficiency) - for (const auto& particle : particlesInCollision) { - if (isGoodPrimary(particle)) { - ue.fill(HIST("Inclusive/hPtDenEff"), particle.pt()); - ue.fill(HIST("Inclusive/hPtDenEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Inclusive/hPtPrimGen"), particle.pt()); - ue.fill(HIST("Inclusive/hPtPrimGenVsMult"), particle.pt(), percentile); - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Pion/hPtDenEff"), particle.pt()); - ue.fill(HIST("Pion/hPtDenEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Pion/hPtPrimGen"), particle.pt()); - ue.fill(HIST("Pion/hPtPrimGenVsMult"), particle.pt(), percentile); - particleCountAfterPS[kPion]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Kaon/hPtDenEff"), particle.pt()); - ue.fill(HIST("Kaon/hPtDenEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Kaon/hPtPrimGen"), particle.pt()); - ue.fill(HIST("Kaon/hPtPrimGenVsMult"), particle.pt(), percentile); - particleCountAfterPS[kKaon]++; - } - - if (isGoodPrimarySpecies(particle)) { - ue.fill(HIST("Proton/hPtDenEff"), particle.pt()); - ue.fill(HIST("Proton/hPtDenEffVsMult"), particle.pt(), percentile); - ue.fill(HIST("Proton/hPtPrimGen"), particle.pt()); - ue.fill(HIST("Proton/hPtPrimGenVsMult"), particle.pt(), percentile); - particleCountAfterPS[kProton]++; - } - } - } - - LOG(info) << "=== DEBUG processTrue END ==="; - LOG(info) << "All generated events: " << nAllGenerated; - LOG(info) << "Events with bad vertex: " << nBadVertex; - LOG(info) << "Passing physics selection: " << nPhysicsSelected; - - LOG(info) << "=== PARTICLE-SPECIFIC STATISTICS ==="; - LOG(info) << "Pions - All: " << particleCountAll[kPion] - << ", Bad vertex: " << particleCountBadVertex[kPion] - << ", After PS: " << particleCountAfterPS[kPion]; - LOG(info) << "Kaons - All: " << particleCountAll[kKaon] - << ", Bad vertex: " << particleCountBadVertex[kKaon] - << ", After PS: " << particleCountAfterPS[kKaon]; - LOG(info) << "Protons - All: " << particleCountAll[kProton] - << ", Bad vertex: " << particleCountBadVertex[kProton] - << ", After PS: " << particleCountAfterPS[kProton]; -} diff --git a/PWGLF/Tasks/Nuspex/multiplicityPt.cxx b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx new file mode 100644 index 00000000000..59e06791e8f --- /dev/null +++ b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx @@ -0,0 +1,1134 @@ +// 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. + +/// \author Dushmanta Sahu (dushmanta.sahu@cern.ch) +/// \file multiplicityPt.cxx +/// \brief Analysis to do PID with MC + +#include "PWGLF/DataModel/LFParticleIdentification.h" +#include "PWGLF/DataModel/mcCentrality.h" // For McCentFT0Ms +#include "PWGLF/DataModel/spectraTOF.h" +#include "PWGLF/Utils/inelGt.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/McCollisionExtra.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/Logger.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/StaticFor.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "TPDGCode.h" +#include +#include +#include +#include + +#include +#include +#include +#include // For std::accumulate +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::constants::math; +using namespace constants::physics; + +using BCsRun3 = soa::Join; + +//============================================================================= +// Main Analysis Struct +//============================================================================= +struct MultiplicityPt { + + // Service + Service pdg; + static constexpr int CentBinMax = 100; + static constexpr int MultBinMax = 200; + static constexpr int RecMultBinMax = 100; + static constexpr int DebugCountMax = 20; + static constexpr int CentMultClasses = 10; + + enum INELCutSelection : int { + INEL = 0, + INELgt0 = 1, + INELgt1 = 2 + + }; + + //=========================================================================== + // Configurable Parameters + //=========================================================================== + Configurable isRun3{"isRun3", true, "is Run3 dataset"}; + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + Configurable cfgINELCut{"cfgINELCut", 0, "INEL event selection: 0 no sel, 1 INEL>0, 2 INEL>1"}; + Configurable askForCustomTVX{"askForCustomTVX", false, "Ask for custom TVX rather than sel8"}; + Configurable removeITSROFrameBorder{"removeITSROFrameBorder", false, "Remove ITS Read-Out Frame border"}; + Configurable removeNoSameBunchPileup{"removeNoSameBunchPileup", false, "Remove no same bunch pileup"}; + Configurable requireIsGoodZvtxFT0vsPV{"requireIsGoodZvtxFT0vsPV", false, "Require good Z vertex FT0 vs PV"}; + Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "Require vertex ITSTPC"}; + Configurable removeNoTimeFrameBorder{"removeNoTimeFrameBorder", false, "Remove no time frame border"}; + Configurable cfgCutEtaMax{"cfgCutEtaMax", 0.8f, "Max eta range for tracks"}; + Configurable cfgCutEtaMin{"cfgCutEtaMin", -0.8f, "Min eta range for tracks"}; + Configurable cfgCutY{"cfgCutY", 0.5f, "Y range for tracks"}; + Configurable cfgCutNsigma{"cfgCutNsigma", 3.0f, "nsigma cut range for tracks"}; + Configurable lastRequiredTrdCluster{"lastRequiredTrdCluster", -1, "Last cluster to require in TRD"}; + Configurable requireTrdOnly{"requireTrdOnly", false, "Require only tracks from TRD"}; + Configurable requireNoTrd{"requireNoTrd", false, "Require tracks without TRD"}; + + // Analysis switches + Configurable enableDCAHistograms{"enableDCAHistograms", false, "Enable DCA histograms"}; + Configurable enablePIDHistograms{"enablePIDHistograms", true, "Enable PID histograms"}; + Configurable useCustomTrackCuts{"useCustomTrackCuts", true, "Flag to use custom track cuts"}; + Configurable itsPattern{"itsPattern", 0, "0 = Run3ITSibAny, 1 = Run3ITSallAny, 2 = Run3ITSall7Layers, 3 = Run3ITSibTwo"}; + Configurable requireITS{"requireITS", true, "Additional cut on the ITS requirement"}; + Configurable requireTPC{"requireTPC", true, "Additional cut on the TPC requirement"}; + Configurable requireGoldenChi2{"requireGoldenChi2", true, "Additional cut on the GoldenChi2"}; + Configurable minNCrossedRowsTPC{"minNCrossedRowsTPC", 70.f, "Additional cut on the minimum number of crossed rows in the TPC"}; + Configurable minNCrossedRowsOverFindableClustersTPC{"minNCrossedRowsOverFindableClustersTPC", 0.8f, "Additional cut on the minimum value of the ratio between crossed rows and findable clusters in the TPC"}; + Configurable maxChi2PerClusterTPC{"maxChi2PerClusterTPC", 4.f, "Additional cut on the maximum value of the chi2 per cluster in the TPC"}; + Configurable minChi2PerClusterTPC{"minChi2PerClusterTPC", 0.5f, "Additional cut on the minimum value of the chi2 per cluster in the TPC"}; + Configurable maxChi2PerClusterITS{"maxChi2PerClusterITS", 36.f, "Additional cut on the maximum value of the chi2 per cluster in the ITS"}; + Configurable maxDcaXYFactor{"maxDcaXYFactor", 1.f, "Additional cut on the maximum value of the DCA xy (multiplicative factor)"}; + Configurable maxDcaZ{"maxDcaZ", 0.1f, "Additional cut on the maximum value of the DCA z"}; + Configurable minTPCNClsFound{"minTPCNClsFound", 70.0f, "min number of found TPC clusters"}; + Configurable minTPCNClsPID{"minTPCNClsPID", 130.0f, "min number of PID TPC clusters"}; + Configurable nClTPCFoundCut{"nClTPCFoundCut", false, "Apply TPC found clusters cut"}; + Configurable nClTPCPIDCut{"nClTPCPIDCut", true, "Apply TPC clusters for PID cut"}; + + // Phi cut parameters + Configurable applyPhiCut{"applyPhiCut", false, "Apply phi sector cut"}; + + // Basic track cuts + Configurable cfgTrkEtaCut{"cfgTrkEtaCut", 0.8f, "Eta range for tracks"}; + Configurable cfgTrkLowPtCut{"cfgTrkLowPtCut", 0.15f, "Minimum constituent pT"}; + + // PID selection - make them configurable per particle + Configurable cfgCutNsigmaPi{"cfgCutNsigmaPi", 3.0f, "nsigma cut for pions"}; + Configurable cfgCutNsigmaKa{"cfgCutNsigmaKa", 2.5f, "nsigma cut for kaons"}; + Configurable cfgCutNsigmaPr{"cfgCutNsigmaPr", 2.5f, "nsigma cut for protons"}; + + // Custom track cuts matching spectraTOF + TrackSelection customTrackCuts; + + // Histogram Registry + HistogramRegistry ue; + + //=========================================================================== + // Table Definitions - Using individual tables, not joined for MC + //=========================================================================== + + // Data collisions (not used but kept for completeness) + using CollisionTableData = soa::Join; + + // Track tables + using TrackTableData = soa::Join; + using TrackTableMC = soa::Join; + + // MC particles table + using ParticlesMC = aod::McParticles; + + // MC collisions table + using McCollisions = aod::McCollisions; + + // Reconstructed collisions (without joins that cause size mismatch) + using RecoCollisions = aod::Collisions; + + // Preslice for MC particles + Preslice perMCCol = aod::mcparticle::mcCollisionId; + + //=========================================================================== + // Constants + //=========================================================================== + enum ParticleSpecies : int { + kPion = 0, + kKaon = 1, + kProton = 2, + kNSpecies = 3 + }; + + static constexpr int PDGPion = kPiPlus; + static constexpr int PDGKaon = kKPlus; + static constexpr int PDGProton = kProton; + + //=========================================================================== + // Helper Functions + //=========================================================================== + + template + int countGeneratedChargedPrimaries(const ParticleContainer& particles, float etaMax, float ptMin) const + { + int count = 0; + for (const auto& particle : particles) { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) + continue; + + if (!particle.isPhysicalPrimary()) + continue; + + if (std::abs(particle.eta()) > etaMax) + continue; + + if (particle.pt() < ptMin) + continue; + + count++; + } + return count; + } + + template + bool passedNClTPCFoundCut(const T& trk) const + { + if (!nClTPCFoundCut.value) + return true; + return trk.tpcNClsFound() >= minTPCNClsFound.value; + } + + template + bool passedNClTPCPIDCut(const T& trk) const + { + if (!nClTPCPIDCut.value) + return true; + return trk.tpcNClsPID() >= minTPCNClsPID.value; + } + + template + bool passesCutWoDCA(TrackType const& track) const + { + if (useCustomTrackCuts.value) { + for (int i = 0; i < static_cast(TrackSelection::TrackCuts::kNCuts); i++) { + if (i == static_cast(TrackSelection::TrackCuts::kDCAxy) || + i == static_cast(TrackSelection::TrackCuts::kDCAz)) { + continue; + } + if (!customTrackCuts.IsSelected(track, static_cast(i))) { + return false; + } + } + return true; + } + return track.isGlobalTrackWoDCA(); + } + + template + bool passesDCAxyCut(TrackType const& track) const + { + if (useCustomTrackCuts.value) { + if (!passesCutWoDCA(track)) { + return false; + } + constexpr float DcaXYConst = 0.0105f; + constexpr float DcaXYPtScale = 0.0350f; + constexpr float DcaXYPtPower = 1.1f; + const float maxDcaXY = maxDcaXYFactor.value * (DcaXYConst + DcaXYPtScale / std::pow(track.pt(), DcaXYPtPower)); + return std::abs(track.dcaXY()) <= maxDcaXY; + } + return track.isGlobalTrack(); + } + + template + bool passesTrackSelection(TrackType const& track) const + { + if (track.eta() < cfgCutEtaMin.value || track.eta() > cfgCutEtaMax.value) + return false; + + if (track.tpcChi2NCl() < minChi2PerClusterTPC.value || track.tpcChi2NCl() > maxChi2PerClusterTPC.value) + return false; + + if (!passesCutWoDCA(track)) + return false; + + if (!passesDCAxyCut(track)) + return false; + + if (!passedNClTPCFoundCut(track)) + return false; + + if (!passedNClTPCPIDCut(track)) + return false; + + return true; + } + + template + bool passesPIDSelection(TrackType const& track) const + { + float nsigmaTPC = 0.f; + + if constexpr (species == kPion) { + nsigmaTPC = track.tpcNSigmaPi(); + } else if constexpr (species == kKaon) { + nsigmaTPC = track.tpcNSigmaKa(); + } else if constexpr (species == kProton) { + nsigmaTPC = track.tpcNSigmaPr(); + } + + float cutValue = cfgCutNsigma.value; + if constexpr (species == kPion) + cutValue = cfgCutNsigmaPi.value; + if constexpr (species == kKaon) + cutValue = cfgCutNsigmaKa.value; + if constexpr (species == kProton) + cutValue = cfgCutNsigmaPr.value; + + return (std::abs(nsigmaTPC) < cutValue); + } + + template + int getBestPIDHypothesis(TrackType const& track) const + { + float nsigmaPi = std::abs(track.tpcNSigmaPi()); + float nsigmaKa = std::abs(track.tpcNSigmaKa()); + float nsigmaPr = std::abs(track.tpcNSigmaPr()); + + float minNSigma = 999.0f; + int bestSpecies = -1; + + if (nsigmaPi < cfgCutNsigmaPi.value && nsigmaPi < minNSigma) { + minNSigma = nsigmaPi; + bestSpecies = kPion; + } + if (nsigmaKa < cfgCutNsigmaKa.value && nsigmaKa < minNSigma) { + minNSigma = nsigmaKa; + bestSpecies = kKaon; + } + if (nsigmaPr < cfgCutNsigmaPr.value && nsigmaPr < minNSigma) { + minNSigma = nsigmaPr; + bestSpecies = kProton; + } + + return bestSpecies; + } + + template + bool isGoodPrimary(ParticleType const& particle) const + { + auto pdgParticle = pdg->GetParticle(particle.pdgCode()); + if (!pdgParticle || pdgParticle->Charge() == 0.) + return false; + + if (!particle.isPhysicalPrimary()) + return false; + + if (std::abs(particle.eta()) >= cfgCutEtaMax.value) + return false; + if (particle.pt() < cfgTrkLowPtCut.value) + return false; + + return true; + } + + //=========================================================================== + // Process Switches + //=========================================================================== + void processData(CollisionTableData::iterator const& collision, + TrackTableData const& tracks, + BCsRun3 const& bcs); + PROCESS_SWITCH(MultiplicityPt, processData, "process data", false); + + void processMC(TrackTableMC const& tracks, + aod::McParticles const& particles, + aod::McCollisions const& mcCollisions, + RecoCollisions const& collisions, + aod::McCollisionLabels const& labels, + aod::McCentFT0Ms const& centTable, + BCsRun3 const& bcs); + PROCESS_SWITCH(MultiplicityPt, processMC, "process MC", true); + + //=========================================================================== + // Standard Framework Functions + //=========================================================================== + void init(InitContext const&); + + void endOfStream(EndOfStreamContext& /*eos*/) + { + LOG(info) << "\n=== END OF STREAM: Writing histograms to output ==="; + auto hGenMult = ue.get(HIST("MC/EventLoss/GenMultVsCent")); + if (hGenMult) { + LOG(info) << "GenMultVsCent: Entries=" << hGenMult->GetEntries() + << ", Integral=" << hGenMult->Integral(); + } + LOG(info) << "=== END OF STREAM COMPLETE ==="; + } +}; + +//============================================================================= +// Workflow Definition +//============================================================================= +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} + +//============================================================================= +// Implementation of Member Functions +//============================================================================= + +void MultiplicityPt::init(InitContext const&) +{ + LOG(info) << "=================================================="; + LOG(info) << "Initializing MultiplicityPt task with full centrality diagnostics"; + LOG(info) << "=================================================="; + + if (useCustomTrackCuts.value) { + LOG(info) << "Using custom track cuts matching spectraTOF approach"; + customTrackCuts = getGlobalTrackSelectionRun3ITSMatch(itsPattern.value); + + customTrackCuts.SetRequireITSRefit(requireITS.value); + customTrackCuts.SetRequireTPCRefit(requireTPC.value); + customTrackCuts.SetRequireGoldenChi2(requireGoldenChi2.value); + customTrackCuts.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value); + customTrackCuts.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value); + customTrackCuts.SetMinNCrossedRowsTPC(minNCrossedRowsTPC.value); + customTrackCuts.SetMinNClustersTPC(minTPCNClsFound.value); + customTrackCuts.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC.value); + customTrackCuts.SetMaxDcaXYPtDep([](float /*pt*/) { return 10000.f; }); + customTrackCuts.SetMaxDcaZ(maxDcaZ.value); + + customTrackCuts.print(); + } + + // Axis definitions + ConfigurableAxis ptBinning{"ptBinning", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT bin limits"}; + + AxisSpec ptAxis = {ptBinning, "#it{p}_{T} (GeV/#it{c})"}; + + std::vector centBinningStd = {0., 1., 5., 10., 15., 20., 30., 40., 50., 60., 70., 80., 90., 100.}; + + // Fine centrality binning for diagnostics (100 bins, guaranteed increasing) + std::vector centBinningFine; + for (int i = 0; i <= CentBinMax; i++) { + centBinningFine.push_back(static_cast(i)); + } + + AxisSpec centAxis = {centBinningStd, "FT0M Centrality (%)"}; + AxisSpec centFineAxis = {centBinningFine, "FT0M Centrality (%)"}; + + // Multiplicity axes - properly defined + std::vector multBins; + for (int i = 0; i <= MultBinMax; i++) { + multBins.push_back(static_cast(i)); + } + AxisSpec multAxis = {multBins, "N_{ch}^{gen} (|#eta|<0.8)"}; + + // Reconstructed multiplicity axis - properly defined with explicit bin edges + std::vector recoMultBins; + for (int i = 0; i <= RecMultBinMax; i++) { + recoMultBins.push_back(static_cast(i)); + } + AxisSpec recoMultAxis = {recoMultBins, "N_{ch}^{reco}"}; + + //=========================================================================== + // Comprehensive Histogram Registration + //=========================================================================== + + // Centrality diagnostic histograms - USE FINE BINNING + ue.add("Centrality/hCentRaw", "Raw FT0M Centrality (no cuts);Centrality (%);Counts", + HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterVtx", "Centrality after vertex cut;Centrality (%);Counts", + HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterINEL", "Centrality after INEL cut;Centrality (%);Counts", + HistType::kTH1D, {centFineAxis}); + ue.add("Centrality/hCentAfterAll", "Centrality after all cuts;Centrality (%);Counts", + HistType::kTH1D, {centFineAxis}); + + // 2D correlations - USE FINE BINNING FOR DIAGNOSTICS + ue.add("Centrality/hCentVsMult", "Centrality vs Generated Multiplicity;Centrality (%);N_{ch}^{gen}", + HistType::kTH2D, {centFineAxis, multAxis}); + ue.add("Centrality/hMultVsCent", "Generated Multiplicity vs Centrality;N_{ch}^{gen};Centrality (%)", + HistType::kTH2D, {multAxis, centFineAxis}); + ue.add("Centrality/hCentVsVz", "Centrality vs Vertex Z;Centrality (%);V_{z} (cm)", + HistType::kTH2D, {centFineAxis, {40, -20, 20}}); + ue.add("Centrality/hRecoMultVsCent", "Reconstructed Track Multiplicity vs Centrality;Centrality (%);N_{tracks}^{reco}", + HistType::kTH2D, {centFineAxis, recoMultAxis}); + ue.add("Centrality/hGenMultPerCent", "Generated Multiplicity Distribution per Centrality Bin;Centrality (%);", + HistType::kTH2D, {centFineAxis, multAxis}); + + // Vertex resolution vs centrality + ue.add("Centrality/hVertexResVsCent", "Vertex Resolution vs Centrality;Centrality (%);V_{z} resolution (cm)", + HistType::kTH2D, {centFineAxis, {100, -1, 1}}); + + // INEL class distributions + ue.add("INEL/hINELClass", "INEL Class for MC Collisions;INEL Class;Counts", + HistType::kTH1D, {{3, 0.5, 3.5}}); + auto hINEL = ue.get(HIST("INEL/hINELClass")); + hINEL->GetXaxis()->SetBinLabel(1, "INEL0"); + hINEL->GetXaxis()->SetBinLabel(2, "INEL>0"); + hINEL->GetXaxis()->SetBinLabel(3, "INEL>1"); + + ue.add("INEL/hINELVsCent", "INEL Class vs Centrality;Centrality (%);INEL Class", + HistType::kTH2D, {centFineAxis, {3, 0.5, 3.5}}); + + // Cut flow + ue.add("CutFlow/hCutStats", "Cut Statistics;Cut Stage;Counts", + HistType::kTH1D, {{6, 0.5, 6.5}}); + auto hCut = ue.get(HIST("CutFlow/hCutStats")); + hCut->GetXaxis()->SetBinLabel(1, "All reco events"); + hCut->GetXaxis()->SetBinLabel(2, "Has MC match"); + hCut->GetXaxis()->SetBinLabel(3, "Has centrality"); + hCut->GetXaxis()->SetBinLabel(4, "Pass vertex"); + hCut->GetXaxis()->SetBinLabel(5, "Pass INEL"); + hCut->GetXaxis()->SetBinLabel(6, "Selected"); + + ue.add("CutFlow/hCentPerCut", "Centrality Distribution at Each Cut;Cut Stage;Centrality (%)", + HistType::kTH2D, {{6, 0.5, 6.5}, centFineAxis}); + + ue.add("MC/GenRecoCollisions", "Generated and Reconstructed MC Collisions", + HistType::kTH1D, {{10, 0.5, 10.5}}); + auto hColl = ue.get(HIST("MC/GenRecoCollisions")); + hColl->GetXaxis()->SetBinLabel(1, "Collisions generated"); + hColl->GetXaxis()->SetBinLabel(2, "Collisions reconstructed"); + hColl->GetXaxis()->SetBinLabel(3, "INEL>0"); + hColl->GetXaxis()->SetBinLabel(4, "INEL>1"); + + ue.add("hEventLossBreakdown", "Event loss breakdown", + HistType::kTH1D, {{4, 0.5, 4.5}}); + auto hLoss = ue.get(HIST("hEventLossBreakdown")); + hLoss->GetXaxis()->SetBinLabel(1, "Physics selected"); + hLoss->GetXaxis()->SetBinLabel(2, "Reconstructed"); + hLoss->GetXaxis()->SetBinLabel(3, "Selected"); + hLoss->GetXaxis()->SetBinLabel(4, "Final efficiency"); + + // Multiplicity histograms + ue.add("MC/EventLoss/NchGenerated", "Generated charged multiplicity;N_{ch}^{gen} (|#eta|<0.8);Counts", + HistType::kTH1D, {{200, 0, 200}}); + ue.add("MC/EventLoss/NchGenerated_PhysicsSelected", "Generated charged multiplicity (physics selected);N_{ch}^{gen} (|#eta|<0.8);Counts", + HistType::kTH1D, {{200, 0, 200}}); + ue.add("MC/EventLoss/NchGenerated_Reconstructed", "Generated charged multiplicity (reconstructed);N_{ch}^{gen} (|#eta|<0.8);Counts", + HistType::kTH1D, {{200, 0, 200}}); + + // pT vs Multiplicity + ue.add("MC/GenPtVsNch", "Generated pT vs Multiplicity;#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", + HistType::kTH2D, {ptAxis, {200, 0, 200}}); + ue.add("MC/GenPtVsNch_PhysicsSelected", "Generated pT vs Multiplicity (physics selected);#it{p}_{T} (GeV/#it{c});N_{ch}^{gen}", + HistType::kTH2D, {ptAxis, {200, 0, 200}}); + + // Centrality vs Multiplicity correlations - USE STANDARD BINNING FOR THESE + ue.add("MC/EventLoss/GenMultVsCent", "Generated charged particles vs FT0M centrality;FT0M Centrality (%);N_{ch}^{gen} (|#eta|<0.8)", + HistType::kTH2D, {centAxis, multAxis}); + ue.add("MC/EventLoss/GenMultVsCent_Selected", "Generated vs FT0M centrality (selected events);FT0M Centrality (%);N_{ch}^{gen}", + HistType::kTH2D, {centAxis, multAxis}); + ue.add("MC/EventLoss/GenMultVsCent_Rejected", "Generated vs FT0M centrality (rejected events);FT0M Centrality (%);N_{ch}^{gen}", + HistType::kTH2D, {centAxis, multAxis}); + + // TPC cluster histograms + ue.add("hNclFoundTPC", "Number of TPC found clusters", + HistType::kTH1D, {{200, 0, 200, "N_{cl, found}"}}); + ue.add("hNclPIDTPC", "Number of TPC PID clusters", + HistType::kTH1D, {{200, 0, 200, "N_{cl, PID}"}}); + ue.add("hNclFoundTPCvsPt", "TPC found clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,found}", + HistType::kTH2D, {ptAxis, {200, 0., 200.}}); + ue.add("hNclPIDTPCvsPt", "TPC PID clusters vs pT;#it{p}_{T} (GeV/#it{c});N_{cl,PID}", + HistType::kTH2D, {ptAxis, {200, 0., 200.}}); + + // Inclusive histograms + ue.add("Inclusive/hPtPrimGenAll", "All generated primaries (no cuts);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimBadVertex", "Generated primaries (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimGen", "Generated primaries (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimRecoEv", "Generated primaries (reco events);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimGoodEv", "Generated primaries (good events);#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + + ue.add("Inclusive/hPtNumEff", "Tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtDenEff", "Tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + + ue.add("Inclusive/hPtAllReco", "All reconstructed tracks;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtPrimReco", "Reconstructed primaries;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + ue.add("Inclusive/hPtSecReco", "Reconstructed secondaries;#it{p}_{T} (GeV/#it{c});Counts", + HistType::kTH1D, {ptAxis}); + + ue.add("Inclusive/hPtMeasuredVsCent", "All measured tracks (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%)", + HistType::kTH2D, {ptAxis, centAxis}); + + // Particle-specific histograms + const std::array particleNames = {"Pion", "Kaon", "Proton"}; + const std::array particleSymbols = {"#pi^{#pm}", "K^{#pm}", "p+#bar{p}"}; + + for (int iSpecies = 0; iSpecies < kNSpecies; ++iSpecies) { + const auto& name = particleNames[iSpecies]; + const auto& symbol = particleSymbols[iSpecies]; + + ue.add(Form("%s/hPtPrimGenAll", name.c_str()), + Form("All generated %s (no cuts);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimBadVertex", name.c_str()), + Form("Generated %s (bad vertex);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimGen", name.c_str()), + Form("Generated %s (after physics selection);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimRecoEv", name.c_str()), + Form("Generated %s (reco events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimGoodEv", name.c_str()), + Form("Generated %s (good events);#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + + ue.add(Form("%s/hPtNumEff", name.c_str()), + Form("%s tracking efficiency numerator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtDenEff", name.c_str()), + Form("%s tracking efficiency denominator;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + + ue.add(Form("%s/hPtAllReco", name.c_str()), + Form("All reconstructed %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtPrimReco", name.c_str()), + Form("Reconstructed primary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + ue.add(Form("%s/hPtSecReco", name.c_str()), + Form("Reconstructed secondary %s;#it{p}_{T} (GeV/#it{c});Counts", symbol.c_str()), + HistType::kTH1D, {ptAxis}); + + ue.add(Form("%s/hPtMeasuredVsCent", name.c_str()), + Form("Measured %s (PID) vs centrality;#it{p}_{T} (GeV/#it{c});FT0M Centrality (%%)", symbol.c_str()), + HistType::kTH2D, {ptAxis, centAxis}); + + if (enablePIDHistograms) { + ue.add(Form("%s/hNsigmaTPC", name.c_str()), + Form("TPC n#sigma %s;#it{p}_{T} (GeV/#it{c});n#sigma_{TPC}", symbol.c_str()), + HistType::kTH2D, {ptAxis, {200, -10, 10}}); + } + } + + // Event selection histogram + constexpr int NEvSelBins = 20; + constexpr float EvSelMin = 0.5f; + constexpr float EvSelMax = 20.5f; + ue.add("evsel", "Event selection", HistType::kTH1D, {{NEvSelBins, EvSelMin, EvSelMax}}); + auto h = ue.get(HIST("evsel")); + h->GetXaxis()->SetBinLabel(1, "Events read"); + h->GetXaxis()->SetBinLabel(4, "Trigger passed"); + h->GetXaxis()->SetBinLabel(5, "NoITSROFrameBorder"); + h->GetXaxis()->SetBinLabel(6, "NoSameBunchPileup"); + h->GetXaxis()->SetBinLabel(7, "IsGoodZvtxFT0vsPV"); + h->GetXaxis()->SetBinLabel(8, "IsVertexITSTPC"); + h->GetXaxis()->SetBinLabel(9, "NoTimeFrameBorder"); + h->GetXaxis()->SetBinLabel(13, "posZ passed"); + + // Basic tracking histograms + ue.add("hEta", "Track eta;#eta;Counts", HistType::kTH1D, {{20, -0.8, 0.8}}); + ue.add("hPhi", "Track phi;#varphi (rad);Counts", HistType::kTH1D, {{64, 0, TwoPI}}); + ue.add("hvtxZ", "Vertex Z (data);Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); + ue.add("hvtxZmc", "MC vertex Z;Vertex Z (cm);Events", HistType::kTH1F, {{40, -20.0, 20.0}}); + + LOG(info) << "=== Initialized MultiplicityPt task with full centrality diagnostics ==="; + LOG(info) << "Standard centrality binning: " << centBinningStd.size() - 1 << " bins (0-100%)"; + LOG(info) << "Fine centrality binning: " << centBinningFine.size() - 1 << " bins (0-100%)"; +} + +//============================================================================= +// Process Functions +//============================================================================= + +void MultiplicityPt::processData(CollisionTableData::iterator const& /*collision*/, + TrackTableData const& /*tracks*/, + BCsRun3 const& /*bcs*/) +{ + // Intentionally empty - data processing disabled +} + +void MultiplicityPt::processMC(TrackTableMC const& tracks, + aod::McParticles const& particles, + aod::McCollisions const& mcCollisions, + RecoCollisions const& collisions, + aod::McCollisionLabels const& labels, + aod::McCentFT0Ms const& centTable, + BCsRun3 const& /*bcs*/) +{ + LOG(info) << "\n=== processMC START ==="; + LOG(info) << "Total MC collisions (generated): " << mcCollisions.size(); + LOG(info) << "Total reconstructed collisions: " << collisions.size(); + LOG(info) << "Total collision labels: " << labels.size(); + LOG(info) << "Total centrality entries: " << centTable.size(); + + //=========================================================================== + // DEBUG: Print raw centrality information first + //=========================================================================== + LOG(info) << "\n=== CENTRALITY DEBUG - RAW DATA ==="; + LOG(info) << "First 20 centrality values from centTable:"; + int debugCount = 0; + float minCent = 999.0f, maxCent = -999.0f; + std::map centDistribution; + + for (const auto& cent : centTable) { + float c = cent.centFT0M(); + if (debugCount < DebugCountMax) { + LOG(info) << " Cent entry " << debugCount << ": " << c; + } + minCent = std::min(minCent, c); + maxCent = std::max(maxCent, c); + + int bin10 = static_cast(c / 10) * 10; + centDistribution[bin10]++; + debugCount++; + } + + LOG(info) << "Centrality range: [" << minCent << ", " << maxCent << "]"; + LOG(info) << "Distribution by 10% bins:"; + for (int i = 0; i < CentBinMax; i += 10) { + LOG(info) << " " << i << "-" << i + 10 << "%: " << centDistribution[i]; + } + + // Check if centrality is inverted (0 = peripheral, 100 = central) + // If minCent is near 0 and maxCent near 100, check correlation with multiplicity + LOG(info) << "Checking if centrality might be inverted..."; + LOG(info) << "Will check correlation with multiplicity in the next step."; + + //=========================================================================== + // FIRST PASS: Build maps of MC collision ID to generated particle counts + //=========================================================================== + std::map mcCollisionToNch; + std::map mcCollisionVz; + std::set physicsSelectedMCCollisions; + std::map mcCollisionToINELClass; // 0=INEL0, 1=INEL>0, 2=INEL>1 + + ue.fill(HIST("MC/GenRecoCollisions"), 1.f, mcCollisions.size()); + ue.fill(HIST("MC/GenRecoCollisions"), 2.f, collisions.size()); + + LOG(info) << "\n--- FIRST PASS: Building MC collision maps ---"; + + int mcWithParticles = 0; + int mcINELgt0 = 0, mcINELgt1 = 0; + + for (const auto& mcCollision : mcCollisions) { + int64_t mcCollId = mcCollision.globalIndex(); + auto particlesInCollision = particles.sliceBy(perMCCol, mcCollId); + + int nGenCharged = countGeneratedChargedPrimaries(particlesInCollision, cfgCutEtaMax.value, cfgTrkLowPtCut.value); + + mcCollisionToNch[mcCollId] = nGenCharged; + mcCollisionVz[mcCollId] = mcCollision.posZ(); + + // Determine INEL class + bool inel0 = o2::pwglf::isINELgt0mc(particlesInCollision, pdg); + bool inel1 = o2::pwglf::isINELgt1mc(particlesInCollision, pdg); + + int inelClass = 0; + if (inel1) + inelClass = 2; + else if (inel0) + inelClass = 1; + mcCollisionToINELClass[mcCollId] = inelClass; + + ue.fill(HIST("INEL/hINELClass"), inelClass); + + if (inel0) + mcINELgt0++; + if (inel1) + mcINELgt1++; + if (nGenCharged > 0) + mcWithParticles++; + + ue.fill(HIST("MC/EventLoss/NchGenerated"), nGenCharged); + + // Physics selection based on vertex and INEL cuts + bool physicsSelected = true; + + if (std::abs(mcCollision.posZ()) > cfgCutVertex.value) { + physicsSelected = false; + } + + // Apply INEL cut based on configuration + if (cfgINELCut.value == INELgt0 && !inel0) { + physicsSelected = false; + } + if (cfgINELCut.value == INELgt1 && !inel1) { + physicsSelected = false; + } + + if (physicsSelected) { + physicsSelectedMCCollisions.insert(mcCollId); + ue.fill(HIST("MC/EventLoss/NchGenerated_PhysicsSelected"), nGenCharged); + + if (inel0) { + ue.fill(HIST("MC/GenRecoCollisions"), 3.f); + } + if (inel1) { + ue.fill(HIST("MC/GenRecoCollisions"), 4.f); + } + } + } + + LOG(info) << "\n--- FIRST PASS SUMMARY ---"; + LOG(info) << "Total MC collisions processed: " << mcCollisions.size(); + LOG(info) << "MC collisions with particles: " << mcWithParticles; + LOG(info) << "INEL0: " << (mcCollisions.size() - mcINELgt0); + LOG(info) << "INEL>0: " << mcINELgt0; + LOG(info) << "INEL>1: " << mcINELgt1; + LOG(info) << "Physics-selected MC collisions: " << physicsSelectedMCCollisions.size(); + + //=========================================================================== + // Build maps for labels and centrality + //=========================================================================== + std::map recoToMcMap; + std::map recoToCentMap; + + size_t nCollisions = collisions.size(); + + // Associate labels with collisions by index + size_t iLabel = 0; + for (const auto& label : labels) { + if (iLabel < nCollisions) { + const auto& collision = collisions.iteratorAt(iLabel); + int64_t recoCollId = collision.globalIndex(); + int64_t mcCollId = label.mcCollisionId(); + recoToMcMap[recoCollId] = mcCollId; + } + iLabel++; + } + + // Associate centrality with collisions by index + size_t iCent = 0; + for (const auto& cent : centTable) { + if (iCent < nCollisions) { + const auto& collision = collisions.iteratorAt(iCent); + int64_t recoCollId = collision.globalIndex(); + float centValue = cent.centFT0M(); + + // Fill raw centrality histogram + ue.fill(HIST("Centrality/hCentRaw"), centValue); + + recoToCentMap[recoCollId] = centValue; + } + iCent++; + } + + LOG(info) << "\n--- MAP SIZES ---"; + LOG(info) << "recoToMcMap size: " << recoToMcMap.size(); + LOG(info) << "recoToCentMap size: " << recoToCentMap.size(); + + //=========================================================================== + // DEBUG: Check correlation between centrality and multiplicity + //=========================================================================== + LOG(info) << "\n=== CENTRALITY VS MULTIPLICITY DEBUG ==="; + + // Create temporary vectors to check correlation + std::vector> centMultPairs; + for (const auto& collision : collisions) { + int64_t collId = collision.globalIndex(); + + auto mcIt = recoToMcMap.find(collId); + if (mcIt == recoToMcMap.end()) + continue; + + auto centIt = recoToCentMap.find(collId); + if (centIt == recoToCentMap.end()) + continue; + + auto nchIt = mcCollisionToNch.find(mcIt->second); + if (nchIt == mcCollisionToNch.end()) + continue; + + centMultPairs.push_back({centIt->second, nchIt->second}); + } + + // Sort by centrality + std::sort(centMultPairs.begin(), centMultPairs.end()); + + LOG(info) << "Correlation between centrality and multiplicity:"; + LOG(info) << " If centrality is normal (0=central, 100=peripheral), multiplicity should decrease with centrality"; + LOG(info) << " If inverted (0=peripheral, 100=central), multiplicity should increase with centrality"; + + // Print a few samples across the range + if (centMultPairs.size() > CentMultClasses) { + for (size_t i = 0; i < centMultPairs.size(); i += centMultPairs.size() / 10) { + LOG(info) << " Cent: " << centMultPairs[i].first + << "%, Mult: " << centMultPairs[i].second; + } + } + + //=========================================================================== + // SECOND PASS: Process reconstructed collisions with detailed cut accounting + //=========================================================================== + + LOG(info) << "\n--- SECOND PASS: Processing reconstructed collisions ---"; + + std::set reconstructedMCCollisions; + std::set selectedMCCollisions; + + int nRecoCollisions = 0; + int nSelectedEvents = 0; + int nRejectedEvents = 0; + int nNoMCMatch = 0; + int nNoCent = 0; + int nInvalidCent = 0; + + // Cut counters + int nPassVertex = 0; + int nPassINEL = 0; + int nPassAll = 0; + + // For mean calculations + std::vector centAll, centVertex, centINEL, centSelected; + + for (const auto& collision : collisions) { + nRecoCollisions++; + + int64_t collId = collision.globalIndex(); + + // Fill cut flow + ue.fill(HIST("CutFlow/hCutStats"), 1); + + // Get MC collision ID from labels map + auto mcIt = recoToMcMap.find(collId); + if (mcIt == recoToMcMap.end()) { + nNoMCMatch++; + continue; + } + ue.fill(HIST("CutFlow/hCutStats"), 2); + + int64_t mcCollId = mcIt->second; + + // Get generated multiplicity for this MC collision + auto nchIt = mcCollisionToNch.find(mcCollId); + if (nchIt == mcCollisionToNch.end()) { + continue; + } + + int nGenCharged = nchIt->second; + + // Get INEL class + auto inelIt = mcCollisionToINELClass.find(mcCollId); + int inelClass = (inelIt != mcCollisionToINELClass.end()) ? inelIt->second : 0; + + // Get centrality from cent map + auto centIt = recoToCentMap.find(collId); + if (centIt == recoToCentMap.end()) { + nNoCent++; + continue; + } + ue.fill(HIST("CutFlow/hCutStats"), 3); + + float cent = centIt->second; + if (cent < 0 || cent > CentBinMax) { + nInvalidCent++; + continue; + } + + // Store all events with valid info + centAll.push_back(cent); + ue.fill(HIST("Centrality/hCentVsMult"), cent, nGenCharged); + ue.fill(HIST("Centrality/hMultVsCent"), nGenCharged, cent); + ue.fill(HIST("Centrality/hCentVsVz"), cent, collision.posZ()); + ue.fill(HIST("INEL/hINELVsCent"), cent, inelClass); + + // Track cuts progressively + bool passVertex = std::abs(collision.posZ()) <= cfgCutVertex.value; + if (passVertex) { + centVertex.push_back(cent); + ue.fill(HIST("Centrality/hCentAfterVtx"), cent); + ue.fill(HIST("CutFlow/hCutStats"), 4); + ue.fill(HIST("CutFlow/hCentPerCut"), 4, cent); + nPassVertex++; + } + + // Check INEL selection at generator level + bool passINEL = true; + if (cfgINELCut.value == INELgt0 && inelClass < INELgt0) + passINEL = false; + if (cfgINELCut.value == INELgt1 && inelClass < INELgt1) + passINEL = false; + + if (passINEL) { + centINEL.push_back(cent); + ue.fill(HIST("Centrality/hCentAfterINEL"), cent); + ue.fill(HIST("CutFlow/hCutStats"), 5); + ue.fill(HIST("CutFlow/hCentPerCut"), 5, cent); + nPassINEL++; + } + + // Fill GenMultVsCent for all reconstructed events + ue.fill(HIST("MC/EventLoss/GenMultVsCent"), cent, nGenCharged); + ue.fill(HIST("MC/EventLoss/NchGenerated_Reconstructed"), nGenCharged); + + reconstructedMCCollisions.insert(mcCollId); + + // Apply all cuts + bool passedAll = passVertex && passINEL; + + if (!passedAll) { + ue.fill(HIST("MC/EventLoss/GenMultVsCent_Rejected"), cent, nGenCharged); + nRejectedEvents++; + continue; + } + + // Event passed all selections + centSelected.push_back(cent); + ue.fill(HIST("Centrality/hCentAfterAll"), cent); + ue.fill(HIST("CutFlow/hCutStats"), 6); + ue.fill(HIST("CutFlow/hCentPerCut"), 6, cent); + ue.fill(HIST("MC/EventLoss/GenMultVsCent_Selected"), cent, nGenCharged); + ue.fill(HIST("hvtxZ"), collision.posZ()); + selectedMCCollisions.insert(mcCollId); + nSelectedEvents++; + nPassAll++; + + // Process tracks in selected events + int nTracksInEvent = 0; + for (const auto& track : tracks) { + if (!track.has_collision()) + continue; + if (track.collisionId() != collId) + continue; + + if (!passesTrackSelection(track)) { + continue; + } + nTracksInEvent++; + + // Fill TPC cluster histograms + ue.fill(HIST("hNclFoundTPC"), track.tpcNClsFound()); + ue.fill(HIST("hNclPIDTPC"), track.tpcNClsPID()); + ue.fill(HIST("hNclFoundTPCvsPt"), track.pt(), track.tpcNClsFound()); + ue.fill(HIST("hNclPIDTPCvsPt"), track.pt(), track.tpcNClsPID()); + + ue.fill(HIST("Inclusive/hPtAllReco"), track.pt()); + ue.fill(HIST("Inclusive/hPtMeasuredVsCent"), track.pt(), cent); + ue.fill(HIST("hEta"), track.eta()); + ue.fill(HIST("hPhi"), track.phi()); + + if (track.has_mcParticle()) { + const auto& particle = track.mcParticle(); + int pdgCode = std::abs(particle.pdgCode()); + + if (particle.isPhysicalPrimary()) { + ue.fill(HIST("Inclusive/hPtNumEff"), particle.pt()); + ue.fill(HIST("Inclusive/hPtPrimReco"), track.pt()); + + if (pdgCode == PDGPion) { + ue.fill(HIST("Pion/hPtNumEff"), particle.pt()); + ue.fill(HIST("Pion/hPtPrimReco"), track.pt()); + } else if (pdgCode == PDGKaon) { + ue.fill(HIST("Kaon/hPtNumEff"), particle.pt()); + ue.fill(HIST("Kaon/hPtPrimReco"), track.pt()); + } else if (pdgCode == PDGProton) { + ue.fill(HIST("Proton/hPtNumEff"), particle.pt()); + ue.fill(HIST("Proton/hPtPrimReco"), track.pt()); + } + } else { + ue.fill(HIST("Inclusive/hPtSecReco"), track.pt()); + + if (pdgCode == PDGPion) { + ue.fill(HIST("Pion/hPtSecReco"), track.pt()); + } else if (pdgCode == PDGKaon) { + ue.fill(HIST("Kaon/hPtSecReco"), track.pt()); + } else if (pdgCode == PDGProton) { + ue.fill(HIST("Proton/hPtSecReco"), track.pt()); + } + } + } + + int bestSpecies = getBestPIDHypothesis(track); + + if (bestSpecies == kPion) { + ue.fill(HIST("Pion/hPtMeasuredVsCent"), track.pt(), cent); + ue.fill(HIST("Pion/hPtAllReco"), track.pt()); + + if (enablePIDHistograms) { + ue.fill(HIST("Pion/hNsigmaTPC"), track.pt(), track.tpcNSigmaPi()); + } + } else if (bestSpecies == kKaon) { + ue.fill(HIST("Kaon/hPtMeasuredVsCent"), track.pt(), cent); + ue.fill(HIST("Kaon/hPtAllReco"), track.pt()); + + if (enablePIDHistograms) { + ue.fill(HIST("Kaon/hNsigmaTPC"), track.pt(), track.tpcNSigmaKa()); + } + } else if (bestSpecies == kProton) { + ue.fill(HIST("Proton/hPtMeasuredVsCent"), track.pt(), cent); + ue.fill(HIST("Proton/hPtAllReco"), track.pt()); + + if (enablePIDHistograms) { + ue.fill(HIST("Proton/hNsigmaTPC"), track.pt(), track.tpcNSigmaPr()); + } + } + } + + // Fill event-level track multiplicity + ue.fill(HIST("Centrality/hRecoMultVsCent"), cent, nTracksInEvent); + } + + // Calculate and display cut statistics + LOG(info) << "\n=== CUT STATISTICS ==="; + LOG(info) << "Total collisions with valid info: " << centAll.size(); + LOG(info) << "Pass vertex cut: " << nPassVertex << " (" + << (centAll.size() > 0 ? 100.0 * nPassVertex / centAll.size() : 0.0) << "%)"; + LOG(info) << "Pass INEL cut: " << nPassINEL << " (" + << (centAll.size() > 0 ? 100.0 * nPassINEL / centAll.size() : 0.0) << "%)"; + LOG(info) << "Pass all cuts: " << nPassAll << " (" + << (centAll.size() > 0 ? 100.0 * nPassAll / centAll.size() : 0.0) << "%)"; + LOG(info) << "Reco collisions: " << nRecoCollisions; + LOG(info) << "Selected Events: " << nSelectedEvents; + LOG(info) << "Rejected Events: " << nRejectedEvents; + LOG(info) << "No Match: " << nNoMCMatch; + LOG(info) << "No Cent: " << nNoCent; + LOG(info) << "Invalid Cent: " << nInvalidCent; + + // Calculate mean centrality at each stage + if (!centAll.empty()) { + float meanAll = std::accumulate(centAll.begin(), centAll.end(), 0.0) / centAll.size(); + float meanVertex = centVertex.empty() ? 0 : std::accumulate(centVertex.begin(), centVertex.end(), 0.0) / centVertex.size(); + float meanINEL = centINEL.empty() ? 0 : std::accumulate(centINEL.begin(), centINEL.end(), 0.0) / centINEL.size(); + float meanSelected = centSelected.empty() ? 0 : std::accumulate(centSelected.begin(), centSelected.end(), 0.0) / centSelected.size(); + + LOG(info) << "\n=== CENTRALITY MEANS ==="; + LOG(info) << "Mean centrality (all): " << meanAll; + LOG(info) << "Mean centrality (after vertex): " << meanVertex; + LOG(info) << "Mean centrality (after INEL): " << meanINEL; + LOG(info) << "Mean centrality (selected): " << meanSelected; + } + + ue.fill(HIST("hEventLossBreakdown"), 1.f, physicsSelectedMCCollisions.size()); + ue.fill(HIST("hEventLossBreakdown"), 2.f, reconstructedMCCollisions.size()); + ue.fill(HIST("hEventLossBreakdown"), 3.f, selectedMCCollisions.size()); + + float efficiency = physicsSelectedMCCollisions.size() > 0 ? 100.f * selectedMCCollisions.size() / physicsSelectedMCCollisions.size() : 0; + ue.fill(HIST("hEventLossBreakdown"), 4.f, efficiency); + + LOG(info) << "\n=== FINAL EFFICIENCY ==="; + LOG(info) << "Physics selected: " << physicsSelectedMCCollisions.size(); + LOG(info) << "Reconstructed: " << reconstructedMCCollisions.size(); + LOG(info) << "Selected: " << selectedMCCollisions.size(); + LOG(info) << "Efficiency: " << efficiency << "%"; + LOG(info) << "=== processMC END ==="; +} diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index 770ea3a38a7..71eaafc4209 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -185,6 +185,7 @@ struct Chargedkstaranalysis { Configurable confincludeCentralityMC{"confincludeCentralityMC", false, "Include centrality in MC"}; Configurable confEvtCollInTimeRangeStandard{"confEvtCollInTimeRangeStandard", true, "Evt sel: apply NoCollInTimeRangeStandard"}; Configurable confEvtCollInTimeRangeNarrow{"confEvtCollInTimeRangeNarrow", false, "Evt sel: apply NoCollInTimeRangeNarrow"}; + Configurable confEvtCollInTimeRangeStrict{"confEvtCollInTimeRangeStrict", false, "Evt sel: apply NoCollInTimeRangeStrict"}; Configurable confEvtNoCollInRofStandard{"confEvtNoCollInRofStandard", false, "Evt sel: apply NoCollInRofStandard"}; Configurable confEvtNoCollInRofStrict{"confEvtNoCollInRofStrict", false, "Evt sel: apply NoCollInRofStrict"}; @@ -295,9 +296,7 @@ struct Chargedkstaranalysis { { centrality = -999; - rctCut.rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); - - colCuts.setCuts(eventCutCfgs.confEvtZvtx, eventCutCfgs.confEvtTriggerCheck, eventCutCfgs.confEvtOfflineCheck, /*checkRun3*/ true, /*triggerTVXsel*/ false, eventCutCfgs.confEvtOccupancyInTimeRangeMax, eventCutCfgs.confEvtOccupancyInTimeRangeMin); + colCuts.setCuts(eventCutCfgs.confEvtZvtx, eventCutCfgs.confEvtTriggerCheck, eventCutCfgs.confEvtOfflineCheck, /*checkRun3*/ true, eventCutCfgs.confEvtTriggerTVXSel, eventCutCfgs.confEvtOccupancyInTimeRangeMax, eventCutCfgs.confEvtOccupancyInTimeRangeMin); colCuts.init(&histos); colCuts.setTriggerTVX(eventCutCfgs.confEvtTriggerTVXSel); colCuts.setApplyTFBorderCut(eventCutCfgs.confEvtTFBorderCut); @@ -318,6 +317,8 @@ struct Chargedkstaranalysis { colCuts.setApplyBBT0A(eventCutCfgs.confEvtBBT0A); colCuts.setApplyBBT0C(eventCutCfgs.confEvtBBT0C); + rctCut.rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); + AxisSpec centAxis = {axisCfgs.cfgBinsCent, "T0M (%)"}; AxisSpec vtxzAxis = {axisCfgs.cfgBinsVtxZ, "Z Vertex (cm)"}; AxisSpec ptAxis = {axisCfgs.cfgBinsPt, "#it{p}_{T} (GeV/#it{c})"}; @@ -329,7 +330,7 @@ struct Chargedkstaranalysis { AxisSpec dcaxyAxis = {200, 0, 2, "DCA_{#it{xy}} (cm)"}; AxisSpec dcazAxis = {200, 0, 2, "DCA_{#it{z}} (cm)"}; AxisSpec yAxis = {100, -1, 1, "Rapidity"}; - AxisSpec invMassAxisK0s = {400 / cNbinsDiv, 0.3, 0.7, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 + AxisSpec invMassAxisK0s = {800 / cNbinsDiv, 0.46, 0.54, "Invariant Mass (GeV/#it{c}^2)"}; // K0s ~497.611 AxisSpec invMassAxisReso = {900 / cNbinsDiv, 0.5f, 1.4f, "Invariant Mass (GeV/#it{c}^2)"}; // chK(892) ~892 AxisSpec invMassAxisScan = {150, 0, 1.5, "Invariant Mass (GeV/#it{c}^2)"}; // For selection AxisSpec pidQAAxis = {130, -6.5, 6.5}; @@ -702,13 +703,13 @@ struct Chargedkstaranalysis { bool selectionK0s(CollisionType const& collision, K0sType const& candidate) { int ibin = 1; - auto dauDCA = candidate.dcaV0daughters(); - auto dauPosDCAtoPV = candidate.dcapostopv(); - auto dauNegDCAtoPV = candidate.dcanegtopv(); + auto dauDCA = std::fabs(candidate.dcaV0daughters()); + auto dauPosDCAtoPV = std::fabs(candidate.dcapostopv()); + auto dauNegDCAtoPV = std::fabs(candidate.dcanegtopv()); auto pT = candidate.pt(); auto rapidity = candidate.yK0Short(); auto v0Radius = candidate.v0radius(); - auto dcaToPV = candidate.dcav0topv(); + auto dcaToPV = std::fabs(candidate.dcav0topv()); auto cosPA = candidate.v0cosPA(); auto propTauK0s = candidate.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massK0s; auto mK0s = candidate.mK0Short(); @@ -717,20 +718,20 @@ struct Chargedkstaranalysis { bool returnFlag = true; histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (dauDCA > secondaryCutsCfgs.cSecondaryDauDCAMax) { + if (std::fabs(dauDCA) > secondaryCutsCfgs.cSecondaryDauDCAMax) { returnFlag = false; } ibin++; if (returnFlag == true) histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (dauPosDCAtoPV < secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin) { + if (std::fabs(dauPosDCAtoPV) < secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin) { returnFlag = false; } ibin++; if (returnFlag == true) histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (dauNegDCAtoPV < secondaryCutsCfgs.cSecondaryDauNegDCAtoPVMin) { + if (std::fabs(dauNegDCAtoPV) < secondaryCutsCfgs.cSecondaryDauNegDCAtoPVMin) { returnFlag = false; } ibin++; diff --git a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx index 6af3bde09f8..bd0964bbea5 100644 --- a/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520_PbPb.cxx @@ -17,9 +17,6 @@ #include "PWGLF/DataModel/LFResonanceTables.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" - #include "CommonConstants/PhysicsConstants.h" #include "Framework/ASoAHelpers.h" #include "Framework/AnalysisTask.h" @@ -41,18 +38,25 @@ struct lambdaAnalysis_pb { Preslice perRCol = aod::resodaughter::resoCollisionId; Preslice perCollision = aod::track::collisionId; // Configurables. - + aod::ResoMCParents const* mResoParents = nullptr; Configurable ConfEvtOccupancyInTimeRange{"ConfEvtOccupancyInTimeRange", false, "occupancy selection true or false"}; Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histogram"}; Configurable nBinsInvM{"nBinsInvM", 120, "N bins in InvMass histogram"}; Configurable lambda1520id{"lambda1520id", 3124, "pdg"}; Configurable doRotate{"doRotate", true, "rotated inv mass spectra"}; - // Tracks Configurable cPtMin{"cPtMin", 0.15, "Minimum Track pT"}; Configurable cPMin{"cPMin", 0., "Minimum Track p"}; Configurable cEtaCut{"cEtaCut", 0.8, "Pseudorapidity cut"}; Configurable cDcaz{"cDcazMin", 1., "Minimum DCAz"}; + Configurable cfgRapidityShift{"cfgRapidityShift", 0., " rapidity shift"}; + Configurable cfgRapidityCut{"cfgRapidityCut", 0.5, "Rapidity window"}; + // TPC crossed rows (absolute) + Configurable cfgMinCrossedRows{"cfgMinCrossedRows", 70, "min TPC crossed rows"}; + Configurable cfgUseCrossedRows{"cfgUseCrossedRows", false, "apply crossed rows cut"}; + + Configurable cfgMinTPCcls{"cfgMinTPCcls", 70, "min TPC clusters found"}; + Configurable cfgUseTPCcls{"cfgUseTPCcls", false, "apply TPC clusters cut"}; Configurable> cDcaPtBinsPr{"cDcaPtBinsPr", {0.0f, 0.5f, 1.0f, 2.0f, 3.0f, 5.0f, 1000.0f}, "Proton pT bin edges for DCAxy cut"}; @@ -141,7 +145,7 @@ struct lambdaAnalysis_pb { const AxisSpec axisdEdx(380, 10, 200, {"#frac{dE}{dx}"}); const AxisSpec axisVz(120, -12, 12, {"vz"}); const AxisSpec axisEP(120, -3.14, 3.14, {"#theta"}); - const AxisSpec axisInvM(nBinsInvM, 1.2, 1.8, {"M_{inv} (GeV/c^{2})"}); + const AxisSpec axisInvM(nBinsInvM, 1.4, 2.0, {"M_{inv} (GeV/c^{2})"}); AxisSpec axisOccupancy = {occupancy_bins, "Occupancy [-40,100]"}; AxisSpec axisDCAz = {cDCAzBins, "DCA_{z} (cm)"}; @@ -150,7 +154,11 @@ struct lambdaAnalysis_pb { if (doprocessMix || doprocessMixDF || doprocessMixepDF) { histos.add("Event/mixing_vzVsmultpercentile", "FT0(%)", kTH3F, {axisCent, axisVz, axisEP}); } - // QA Before + // QA Beforei + histos.add("QAbefore/hEta_rec", "Reco dN/d#eta; #eta; dN/d#eta", kTH1F, {{50, -1.0, 1.0}}); + histos.add("QAbefore/hPt_rec", "Reco pT; p_{T} (GeV/c); Tracks", kTH1F, {axisP_pid}); + histos.add("QAbefore/hPhi_rec", "Reco #varphi; #varphi (rad); Tracks", kTH1F, {{72, 0, 6.2832}}); + histos.add("QAbefore/hEtaPhi_rec", "Reco #eta vs #varphi; #eta; #varphi", kTH2F, {axisEta, {72, 0, 6.2832}}); histos.add("QAbefore/Proton/h2d_pr_nsigma_tpc_p", "n#sigma^{TPC} Protons", kTH2F, {axisP_pid, axisTPCNsigma}); histos.add("QAbefore/Proton/h2d_pr_nsigma_tof_p", "n#sigma^{TOF} Protons", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAbefore/Proton/h2d_pr_nsigma_tof_vs_tpc", "n#sigma^{TPC} vs n#sigma^{TOF} Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); @@ -172,6 +180,8 @@ struct lambdaAnalysis_pb { histos.add("QAafter/Proton/h2d_Prpi_nsigma_tof_p", " Protons pion", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Proton/h2d_Prka_nsigma_tof_p", " Protons kaon", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Proton/h2d_pr_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); + histos.add("QAafter/Proton/hTPCNClsCrossedRowsVsPt", "TPC Crossed Rows vs pT;p_{T} (GeV/c);N_{cls,crossed};Counts", kTH2F, {axisPt_pid, {200, 0, 200}}); + histos.add("QAafter/Proton/hTPCNClsFoundVsPt", "TPC Found Clusters vs pT;p_{T} (GeV/c);N_{cls,found};Counts", kTH2F, {axisPt_pid, {200, 0, 200}}); histos.add("QAafter/Kaon/hd_ka_pt", "p_{T}-spectra Kaons", kTH2F, {axisPt_pid, axisCent}); histos.add("QAafter/Kaon/h2d_ka_dca_z", "dca_{z} Kaons", kTH2F, {axisPt_pid, axisDCAz}); histos.add("QAafter/Kaon/h2d_ka_dca_xy", "dca_{xy} Kaons", kTH2F, {axisPt_pid, axisDCAxy}); @@ -185,7 +195,8 @@ struct lambdaAnalysis_pb { histos.add("QAafter/Kaon/h2d_Kapi_nsigma_tof_p", " Kaons pion", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Kaon/h2d_Kapr_nsigma_tof_p", " Kaons proton", kTH2F, {axisP_pid, axisTOFNsigma}); histos.add("QAafter/Kaon/h2d_ka_nsigma_tof_vs_tpc", "n#sigma(TOF) vs n#sigma(TPC) Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); - + histos.add("QAafter/Kaon/hTPCNClsCrossedRowsVsPt", "TPC Crossed Rows vs pT;p_{T} (GeV/c);N_{cls,crossed};Counts", kTH2F, {axisPt_pid, {200, 0, 200}}); + histos.add("QAafter/Kaon/hTPCNClsFoundVsPt", "TPC Found Clusters vs pT;p_{T} (GeV/c);N_{cls,found};Counts", kTH2F, {axisPt_pid, {200, 0, 200}}); // Analysis // Lambda Invariant Mass if (!doprocessMC) { @@ -193,7 +204,8 @@ struct lambdaAnalysis_pb { histos.add("Analysis/h4d_lstar_invm_US_MP", "THn #bar #Lambda(1520)", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_PP", "THn Like Signs p K^{+}", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_MM", "THn Like Signs #bar{p} K^{-}", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); - histos.add("Analysis/h4d_lstar_invm_rot", "THn Rotated", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); + histos.add("Analysis/h4d_lstar_invm_rot_PM", "THn Rotated", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); + histos.add("Analysis/h4d_lstar_invm_rot_MP", "THn Rotated", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_US_PM_mix", "THn Mixed Events", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_US_MP_mix", "THn anti Mixed Events", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); histos.add("Analysis/h4d_lstar_invm_LS_PP_mix", "THn Mixed Events PP", kTHnSparseF, {axisInvM, axisPt, axisCent, axisOccupancy}); @@ -201,7 +213,7 @@ struct lambdaAnalysis_pb { } // MC if (doprocessMC) { - + histos.add("Event/hMCEventCutflow", "MC Event Cutflow", kTH1F, {{7, 0, 7}}); histos.add("QAChecks/h1d_pr_rec_pt", "Reconstructed p_{T}-spectra Protons", kTH1F, {axisPt_pid}); histos.add("QAChecks/h1d_ka_rec_pt", "Recondstucted p_{T}-spectra Kaons", kTH1F, {axisPt_pid}); histos.add("QAChecks/h1d_pr_gen_pt", "Generated p_{T}-spectra Protons", kTH1F, {axisPt_pid}); @@ -211,13 +223,14 @@ struct lambdaAnalysis_pb { histos.add("Analysis/h3d_gen_lstar_MP", "Generated #bar{#Lambda}(1520) p_{T}", kTHnSparseF, {axisInvM, axisPt, axisCent}); histos.add("Analysis/h3d_rec_lstar_PM", "Reconstructed #Lambda(1520) p_{T}", kTHnSparseF, {axisInvM, axisPt, axisCent}); histos.add("Analysis/h3d_rec_lstar_MP", "Reconstructed #bar{#Lambda}(1520) p_{T}", kTHnSparseF, {axisInvM, axisPt, axisCent}); + histos.add("Analysis/h3d_reso_lstar_PM", "Resolution #Lambda(1520) p_{T}", kTHnSparseF, {{200, -0.05, 0.05}, axisPt, axisCent}); + histos.add("Analysis/h3d_reso_lstar_MP", "Resolution #bar{#Lambda}(1520) p_{T}", kTHnSparseF, {{200, -0.05, 0.05}, axisPt, axisCent}); } } template bool selTracks(T const& track) { - if (track.pt() < cPtMin) return false; @@ -233,9 +246,15 @@ struct lambdaAnalysis_pb { if (cPVContributor && !track.isPVContributor()) return false; + if (cfgUseCrossedRows && track.tpcNClsCrossedRows() < cfgMinCrossedRows) + return false; + + if (cfgUseTPCcls && track.tpcNClsFound() < cfgMinTPCcls) + return false; + return true; } - // ── Proton DCA Selection ────────────────────────────────────────────────── + template bool dcaSelectionProton(T const& track, float p) { @@ -342,6 +361,7 @@ struct lambdaAnalysis_pb { } } if (tpcPIDPassed && tofPIDPassed) { + return true; } return false; @@ -408,6 +428,7 @@ struct lambdaAnalysis_pb { } } if (tpcPIDPassed && tofPIDPassed) { + return true; } return false; @@ -420,14 +441,13 @@ struct lambdaAnalysis_pb { float p_ptot = 0., k_ptot = 0.; for (auto const& [trkPr, trkKa] : soa::combinations(soa::CombinationsFullIndexPolicy(trk1, trk2))) { - // Do not analyse same index tracks. - if (trkPr.index() == trkKa.index() && !mix) + if (trkPr.index() == trkKa.index()) // && !mix) continue; - // pT, DCA, Global Tracks and PVcontrib selection. if (!selTracks(trkPr) || !selTracks(trkKa)) continue; + // LOGF(info, "eork 4 %d, %d %d ",trkPr.index(),trk1.size(),trkPr.size()); auto _pxPr = trkPr.px(); auto _pyPr = trkPr.py(); @@ -442,7 +462,6 @@ struct lambdaAnalysis_pb { // Fill QA before track selection. if (!mix) { auto _tpcnsigmaPr = trkPr.tpcNSigmaPr(); - histos.fill(HIST("QAbefore/Proton/h2d_pr_nsigma_tpc_p"), p_ptot, _tpcnsigmaPr); if (trkPr.hasTOF()) { auto _tofnsigmaPr = trkPr.tofNSigmaPr(); @@ -485,6 +504,9 @@ struct lambdaAnalysis_pb { histos.fill(HIST("QAafter/Proton/h2d_Prka_nsigma_tpc_p"), p_ptot, trkPr.tpcNSigmaKa()); histos.fill(HIST("QAafter/Proton/h2d_pr_nsigma_tpc_p"), p_ptot, _tpcnsigmaPr); histos.fill(HIST("QAafter/Proton/h2d_pr_nsigma_tpc_pt"), _ptPr, _tpcnsigmaPr); + histos.fill(HIST("QAafter/Proton/hTPCNClsCrossedRowsVsPt"), _ptPr, trkPr.tpcNClsCrossedRows()); + histos.fill(HIST("QAafter/Proton/hTPCNClsFoundVsPt"), _ptPr, trkPr.tpcNClsFound()); + if (!cUseTpcOnly && trkPr.hasTOF()) { auto _tofnsigmaPr = trkPr.tofNSigmaPr(); histos.fill(HIST("QAafter/Proton/h2d_pr_nsigma_tof_p"), p_ptot, _tofnsigmaPr); @@ -505,6 +527,9 @@ struct lambdaAnalysis_pb { histos.fill(HIST("QAafter/Kaon/h2d_Kapr_nsigma_tpc_p"), k_ptot, trkKa.tpcNSigmaPr()); histos.fill(HIST("QAafter/Kaon/h2d_ka_nsigma_tpc_p"), k_ptot, _tpcnsigmaKa); histos.fill(HIST("QAafter/Kaon/h2d_ka_nsigma_tpc_pt"), _ptKa, _tpcnsigmaKa); + histos.fill(HIST("QAafter/Kaon/hTPCNClsCrossedRowsVsPt"), _ptKa, trkKa.tpcNClsCrossedRows()); + histos.fill(HIST("QAafter/Kaon/hTPCNClsFoundVsPt"), _ptKa, trkKa.tpcNClsFound()); + if (!cUseTpcOnly && trkKa.hasTOF()) { auto _tofnsigmaKa = trkKa.tofNSigmaKa(); histos.fill(HIST("QAafter/Kaon/h2d_ka_nsigma_tof_p"), k_ptot, _tofnsigmaKa); @@ -525,9 +550,12 @@ struct lambdaAnalysis_pb { float _M = RecoDecay::m(arrMomrec, std::array{MassProton, MassKaonCharged}); float _pt = RecoDecay::pt(std::array{_pxPr + _pxKa, _pyPr + _pyKa}); - if (std::abs(RecoDecay::y(std::array{_pxPr + _pxKa, _pyPr + _pyKa, _pzPr + _pzKa}, MassLambda1520)) > 0.5) - continue; + float _y = std::abs(RecoDecay::y(std::array{_pxPr + _pxKa, _pyPr + _pyKa, _pzPr + _pzKa}, _M)); + float _yshift = _y - cfgRapidityShift; + + if (std::abs(_yshift) > cfgRapidityCut) + continue; // Apply kinematic cuts. // Fill Invariant Mass Histograms. @@ -543,7 +571,14 @@ struct lambdaAnalysis_pb { for (int i = 0; i < cNofRotations; i++) { float delta = o2::constants::math::PI / rotationalcut; - float theta2 = (o2::constants::math::PI - delta) + i * (2.f * delta / (cNofRotations - 1)); + float theta2; + if (cNofRotations == 1) { + // Single rotation — just rotate by exactly PI + theta2 = o2::constants::math::PI; + } else { + theta2 = (o2::constants::math::PI - delta) + + i * (2.f * delta / (cNofRotations - 1)); + } float phiRot = trkKa.phi() + theta2; if (phiRot > o2::constants::math::TwoPI) @@ -561,12 +596,19 @@ struct lambdaAnalysis_pb { float _Mrot = RecoDecay::m(arrMomRot, std::array{MassProton, MassKaonCharged}); float _ptRot = RecoDecay::pt(std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot}); - if (std::abs(RecoDecay::y( - std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot, _pzPr + _pzKa}, - MassLambda1520)) > 0.5f) + float _yrot = std::abs(RecoDecay::y(std::array{_pxPr + _pxKaRot, _pyPr + _pyKaRot, _pzPr + _pzKa}, MassLambda1520)); + + float _yshiftrot = _yrot - cfgRapidityShift; + + if (std::abs(_yshiftrot) > cfgRapidityCut) continue; - histos.fill(HIST("Analysis/h4d_lstar_invm_rot"), _Mrot, _ptRot, mult, occup); + if (trkPr.sign() * trkKa.sign() < 0) { + if (trkPr.sign() > 0) + histos.fill(HIST("Analysis/h4d_lstar_invm_rot_PM"), _Mrot, _ptRot, mult, occup); + else + histos.fill(HIST("Analysis/h4d_lstar_invm_rot_MP"), _Mrot, _ptRot, mult, occup); + } } } } else { @@ -591,7 +633,6 @@ struct lambdaAnalysis_pb { histos.fill(HIST("Analysis/h4d_lstar_invm_LS_MM_mix"), _M, _pt, mult, occup); } } - if constexpr (mc) { if (trkPr.sign() * trkKa.sign() < 0) { if (std::abs(trkPr.pdgCode()) != 2212 || std::abs(trkKa.pdgCode()) != 321) @@ -599,15 +640,34 @@ struct lambdaAnalysis_pb { if (trkPr.motherId() != trkKa.motherId()) continue; + if (trkPr.motherPDG() != trkKa.motherPDG()) + continue; + + if (trkPr.pdgCode() == 0 || trkKa.pdgCode() == 0) + continue; + + if (trkPr.motherPDG() == -1 || trkKa.motherPDG() == -1) + continue; if (std::abs(trkPr.motherPDG()) != lambda1520id) // L* pdg_code = 3124 continue; - // MC histograms + float massParent = 0.; + for (auto const& _part : *mResoParents) { + if (_part.mcParticleId() == trkPr.motherId()) { + std::array pvecParent = {_part.px(), _part.py(), _part.pz()}; + massParent = RecoDecay::m(pvecParent, _part.e()); + break; + } + } + + float _MRes = _M - massParent; if (trkPr.motherPDG() > 0) { histos.fill(HIST("Analysis/h3d_rec_lstar_PM"), _M, _pt, mult); + histos.fill(HIST("Analysis/h3d_reso_lstar_PM"), _MRes, _pt, mult); } else { histos.fill(HIST("Analysis/h3d_rec_lstar_MP"), _M, _pt, mult); + histos.fill(HIST("Analysis/h3d_reso_lstar_MP"), _MRes, _pt, mult); } } } @@ -621,7 +681,6 @@ struct lambdaAnalysis_pb { void processData(resoCols::iterator const& collision, resoTracks const& tracks) { - // LOGF(info, " collisions: Index = %d %d", collision.globalIndex(),tracks.size()); histos.fill(HIST("Event/h1d_ft0_mult_percentile"), collision.cent(), 100); histos.fill(HIST("Event/h_ft0_vz"), collision.posZ()); @@ -634,54 +693,74 @@ struct lambdaAnalysis_pb { void processMC(resoMCCols::iterator const& collision, soa::Join const& tracks, aod::ResoMCParents const& resoParents) { - if (cEvtMCAfterAllCuts && !collision.isInAfterAllCuts()) + histos.fill(HIST("Event/hMCEventCutflow"), 0); // All collisions + + if (cEvtMCTriggerTVX && !collision.isTriggerTVX()) return; + histos.fill(HIST("Event/hMCEventCutflow"), 1); // After TriggerTVX + + if (cEvtMCVtxIn10 && !collision.isVtxIn10()) + return; + histos.fill(HIST("Event/hMCEventCutflow"), 2); // After VtxIn10 + if (cEvtMCINELgt0 && !collision.isINELgt0()) return; + histos.fill(HIST("Event/hMCEventCutflow"), 3); // After INELgt0 + if (cEvtMCSel8 && !collision.isInSel8()) return; - if (cEvtMCVtxIn10 && !collision.isVtxIn10()) - return; - if (cEvtMCTriggerTVX && !collision.isTriggerTVX()) - return; + histos.fill(HIST("Event/hMCEventCutflow"), 4); // After Sel8 + if (cEvtMCRecINELgt0 && !collision.isRecINELgt0()) return; + histos.fill(HIST("Event/hMCEventCutflow"), 5); // After RecINELgt0 + + if (cEvtMCAfterAllCuts && !collision.isInAfterAllCuts()) + return; + histos.fill(HIST("Event/hMCEventCutflow"), 6); // After AfterAllCuts auto mult = collision.cent(); auto mult = collision.cent(); histos.fill(HIST("Event/h1d_ft0_mult_percentile"), mult, 100); histos.fill(HIST("Event/h_ft0_vz"), collision.posZ()); + mResoParents = &resoParents; fillDataHistos(tracks, tracks, mult); // get MC pT-spectra for (auto const& track : tracks) { + histos.fill(HIST("QAbefore/hEta_rec"), track.eta()); + histos.fill(HIST("QAbefore/hPt_rec"), track.pt()); + histos.fill(HIST("QAbefore/hPhi_rec"), track.phi()); + histos.fill(HIST("QAbefore/hEtaPhi_rec"), track.eta(), track.phi()); // get the generated level pT spectra of protons and kaons if (std::abs(track.pdgCode()) == 321) histos.fill(HIST("QAChecks/h1d_ka_gen_pt"), track.pt()); - if (std::abs(track.pdgCode()) == 2212) histos.fill(HIST("QAChecks/h1d_pr_gen_pt"), track.pt()); - // get the reconstructed level pT spectra of protons and kaons if (!selTracks(track)) continue; float p = TMath::Sqrt(track.px() * track.px() + track.py() * track.py() + track.pz() * track.pz()); - if (selectionPIDKaon(track, p) && std::abs(track.pdgCode()) == 321) { - histos.fill(HIST("QAChecks/h1d_ka_rec_pt"), track.pt()); + if (selectionPIDKaon(track, p)) { + if (std::abs(track.pdgCode()) == 321) { + histos.fill(HIST("QAChecks/h1d_ka_rec_pt"), track.pt()); + } } - if (selectionPIDProton(track, p) && std::abs(track.pdgCode()) == 2212) { - histos.fill(HIST("QAChecks/h1d_pr_rec_pt"), track.pt()); + if (selectionPIDProton(track, p)) { + if (std::abs(track.pdgCode()) == 2212) { + histos.fill(HIST("QAChecks/h1d_pr_rec_pt"), track.pt()); + } } } for (auto const& part : resoParents) { if (std::abs(part.pdgCode()) != lambda1520id) // // L* pdg_code = 3124 continue; - if (std::abs(part.y()) > 0.5) { // rapidity cut - continue; - } + // if (std::abs(part.y()) > 0.5) { // rapidity cut + // continue; + // } bool pass1 = false; bool pass2 = false; @@ -696,9 +775,7 @@ struct lambdaAnalysis_pb { if (!pass1 || !pass2) // If we have both decay products continue; std::array pvec = {part.px(), part.py(), part.pz()}; - float mass = RecoDecay::m(pvec, part.e()); - if (part.pdgCode() > 0) histos.fill(HIST("Analysis/h3d_gen_lstar_PM"), mass, part.pt(), mult); else @@ -711,7 +788,6 @@ struct lambdaAnalysis_pb { void processMix(resoCols& collisions, resoTracks const& tracks) { - LOGF(debug, "Event Mixing Started"); BinningType2 binningPositions2{{cMixVtxBins, cMixMultBins}, true}; diff --git a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx index 50c891f43f2..c181e4293c0 100644 --- a/PWGLF/Tasks/Strangeness/lambdapolsp.cxx +++ b/PWGLF/Tasks/Strangeness/lambdapolsp.cxx @@ -90,6 +90,7 @@ struct lambdapolsp { TH1D* hwgtAL; TH1D* heffL; TH1D* heffAL; + TH1D* hwgtRESO; // fill output struct : ConfigurableGroup { Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; @@ -154,13 +155,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"}; @@ -213,12 +217,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"}; @@ -230,6 +235,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; @@ -436,7 +443,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); @@ -459,6 +466,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); @@ -499,8 +513,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); - heffL = ccdb->getForTimeStamp(ConfEffWgtPathL.value, cfgCcdbParam.nolaterthan.value); - heffAL = ccdb->getForTimeStamp(ConfEffWgtPathAL.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 @@ -733,7 +751,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); @@ -761,6 +779,11 @@ struct lambdapolsp { // 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; @@ -985,7 +1008,10 @@ 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); + } if (cqvas) { modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA); modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA); @@ -999,6 +1025,7 @@ struct lambdapolsp { } auto psiZDC = TMath::ATan2((modqyZDCC - modqyZDCA), (modqxZDCC - modqxZDCA)); // full event plane*/ + /*if (useonlypsis) { psiZDC = psiZDCC - psiZDCA; }*/ @@ -1043,6 +1070,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) { @@ -1262,7 +1298,7 @@ struct lambdapolsp { 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("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()); @@ -1272,9 +1308,16 @@ struct lambdapolsp { histos.fill(HIST("htpcposlambda"), postrack.tpcNSigmaPr()); histos.fill(HIST("htpcneglambda"), negtrack.tpcNSigmaPi()); histos.fill(HIST("hptposlambda"), Proton.Pt()); - histos.fill(HIST("hptneglambda"), AntiPion.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); + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); } tagb = aLambdaTag; @@ -1289,7 +1332,7 @@ struct lambdapolsp { 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("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()); @@ -1299,9 +1342,16 @@ struct lambdapolsp { histos.fill(HIST("htpcposantilambda"), postrack.tpcNSigmaPi()); histos.fill(HIST("htpcnegantilambda"), negtrack.tpcNSigmaPr()); histos.fill(HIST("hptposantilambda"), Pion.Pt()); - histos.fill(HIST("hptnegantilambda"), AntiProton.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); + fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue, resowgt); } } } @@ -1374,7 +1424,10 @@ 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); + } if (cqvas) { modqxZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Cos(psiZDCA); modqyZDCA = TMath::Sqrt((qxZDCA * qxZDCA) + (qyZDCA * qyZDCA)) * TMath::Sin(psiZDCA); @@ -1451,6 +1504,14 @@ struct lambdapolsp { } } + 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) { @@ -1509,7 +1570,7 @@ struct lambdapolsp { 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); + fillHistograms(tagc, 0, K0s, Pion, psiZDCC, psiZDCA, psiZDC, centrality, v0.mK0Short(), v0.pt(), v0.eta(), acvalue, 1.0, resowgt); } int binxwgt; @@ -1544,8 +1605,18 @@ struct lambdapolsp { } 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. / effwgtvalueL)); + + 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()); + } + + fillHistograms(taga, tagb, Lambda, Proton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mLambda(), v0.pt(), v0.eta(), acvalue, (1. / effwgtvalueL), resowgt); } tagb = aLambdaTag; @@ -1560,7 +1631,18 @@ struct lambdapolsp { } else { acvalue = 1.0; } - fillHistograms(taga, tagb, AntiLambda, AntiProton, psiZDCC, psiZDCA, psiZDC, centrality, v0.mAntiLambda(), v0.pt(), v0.eta(), acvalue, wgtvalue * (1. / effwgtvalueAL)); + + 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; diff --git a/PWGUD/AQC/FITtest.cxx b/PWGUD/AQC/FITtest.cxx index 8cada664d74..e1f2ac5a19a 100644 --- a/PWGUD/AQC/FITtest.cxx +++ b/PWGUD/AQC/FITtest.cxx @@ -14,20 +14,24 @@ /// \since 04.08.2023 #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/BCRange.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/AQC/udQC.cxx b/PWGUD/AQC/udQC.cxx index 3da67d1f683..0edcdc28117 100644 --- a/PWGUD/AQC/udQC.cxx +++ b/PWGUD/AQC/udQC.cxx @@ -14,17 +14,38 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 04.05.2023 -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "ReconstructionDataFormats/BCRange.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Common/DataModel/FT0Corrected.h" +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" -#include "Framework/StaticFor.h" -#include "TLorentzVector.h" -#include "TMath.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#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; diff --git a/PWGUD/AQC/udQCmidRap.cxx b/PWGUD/AQC/udQCmidRap.cxx index acb35f21f57..6a2ea533d4c 100644 --- a/PWGUD/AQC/udQCmidRap.cxx +++ b/PWGUD/AQC/udQCmidRap.cxx @@ -14,16 +14,31 @@ /// \author Paul Buehler /// \since 17.01.2023 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "ReconstructionDataFormats/BCRange.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Common/DataModel/FT0Corrected.h" +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" -#include "Framework/StaticFor.h" -#include "TLorentzVector.h" -#include "TMath.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/AQC/udQcMuon.cxx b/PWGUD/AQC/udQcMuon.cxx index eaa5f59bc8b..9f09ee2d2c9 100644 --- a/PWGUD/AQC/udQcMuon.cxx +++ b/PWGUD/AQC/udQcMuon.cxx @@ -16,18 +16,37 @@ /// \author Sara Haidlova, sara.haidlova@cern.ch /// \since 28.09.2025 +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" #include "Common/Core/RecoDecay.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/FT0Corrected.h" - -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/BCRange.h" - +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include #include using namespace o2; diff --git a/PWGUD/Core/DGCutparHolder.cxx b/PWGUD/Core/DGCutparHolder.cxx index 5775a7dd47e..ee003684f5a 100644 --- a/PWGUD/Core/DGCutparHolder.cxx +++ b/PWGUD/Core/DGCutparHolder.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "DGCutparHolder.h" +#include "PWGUD/Core/DGCutparHolder.h" #include diff --git a/PWGUD/Core/DGCutparHolder.h b/PWGUD/Core/DGCutparHolder.h index 8312d72ac32..a67aefc4080 100644 --- a/PWGUD/Core/DGCutparHolder.h +++ b/PWGUD/Core/DGCutparHolder.h @@ -13,6 +13,7 @@ #define PWGUD_CORE_DGCUTPARHOLDER_H_ #include + #include // object to hold customizable cut values diff --git a/PWGUD/Core/DGPIDSelector.cxx b/PWGUD/Core/DGPIDSelector.cxx index 04dab87ef7a..7e0de287e48 100644 --- a/PWGUD/Core/DGPIDSelector.cxx +++ b/PWGUD/Core/DGPIDSelector.cxx @@ -8,11 +8,22 @@ // 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 -#include -#include "CommonConstants/PhysicsConstants.h" #include "DGPIDSelector.h" +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + // ----------------------------------------------------------------------------- float particleMass(TDatabasePDG* pdg, int pid) { diff --git a/PWGUD/Core/DGPIDSelector.h b/PWGUD/Core/DGPIDSelector.h index 74ad6b54a58..de825ab3568 100644 --- a/PWGUD/Core/DGPIDSelector.h +++ b/PWGUD/Core/DGPIDSelector.h @@ -12,12 +12,16 @@ #ifndef PWGUD_CORE_DGPIDSELECTOR_H_ #define PWGUD_CORE_DGPIDSELECTOR_H_ -#include -#include +#include + +#include +#include #include -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "Framework/Logger.h" + +#include +#include +#include +#include const int numDGPIDCutParameters = 9; float particleMass(TDatabasePDG* pdg, int pid); diff --git a/PWGUD/Core/DGSelector.h b/PWGUD/Core/DGSelector.h index c9349da9247..5c9afa99d00 100644 --- a/PWGUD/Core/DGSelector.h +++ b/PWGUD/Core/DGSelector.h @@ -12,14 +12,19 @@ #ifndef PWGUD_CORE_DGSELECTOR_H_ #define PWGUD_CORE_DGSELECTOR_H_ -#include - -#include "TDatabasePDG.h" -#include "TLorentzVector.h" -#include "Framework/Logger.h" -#include "Framework/AnalysisTask.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/DGCutparHolder.h" +#include "PWGUD/Core/UDHelpers.h" + +#include + +#include +#include +#include + +#include + +#include +#include // ----------------------------------------------------------------------------- // add here Selectors for different types of diffractive events diff --git a/PWGUD/Core/SGCutParHolder.cxx b/PWGUD/Core/SGCutParHolder.cxx index d171bd45a61..ba180a97280 100644 --- a/PWGUD/Core/SGCutParHolder.cxx +++ b/PWGUD/Core/SGCutParHolder.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "SGCutParHolder.h" +#include "PWGUD/Core/SGCutParHolder.h" #include diff --git a/PWGUD/Core/SGCutParHolder.h b/PWGUD/Core/SGCutParHolder.h index 753e9f0c96f..fcee2d79703 100644 --- a/PWGUD/Core/SGCutParHolder.h +++ b/PWGUD/Core/SGCutParHolder.h @@ -13,6 +13,7 @@ #define PWGUD_CORE_SGCUTPARHOLDER_H_ #include + #include // object to hold customizable cut values diff --git a/PWGUD/Core/SGSelector.h b/PWGUD/Core/SGSelector.h index 881cfb603bb..4e2cef35a85 100644 --- a/PWGUD/Core/SGSelector.h +++ b/PWGUD/Core/SGSelector.h @@ -24,16 +24,17 @@ #include "Common/CCDB/RCTSelectionFlags.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" +#include +#include #include +#include #include #include template struct SelectionResult { - int value; // The original integer return value + int value; // The original integer return value std::shared_ptr bc; // Pointer to the BC object }; diff --git a/PWGUD/Core/SGTrackSelector.h b/PWGUD/Core/SGTrackSelector.h index 455eaf24ac1..b571faf07f7 100644 --- a/PWGUD/Core/SGTrackSelector.h +++ b/PWGUD/Core/SGTrackSelector.h @@ -16,18 +16,10 @@ #ifndef PWGUD_CORE_SGTRACKSELECTOR_H_ #define PWGUD_CORE_SGTRACKSELECTOR_H_ -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/DataModel/UDTables.h" +#include -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include "TVector3.h" -#include - -#include +#include +#include #include template diff --git a/PWGUD/Core/UDFSParser.cxx b/PWGUD/Core/UDFSParser.cxx index 08c6b947ab2..961412106c8 100644 --- a/PWGUD/Core/UDFSParser.cxx +++ b/PWGUD/Core/UDFSParser.cxx @@ -11,13 +11,18 @@ #include "UDFSParser.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonDataFormat/BunchFilling.h" -#include "Framework/Logger.h" +#include +#include +#include +#include +#include +#include #include #include +#include + // ----------------------------------------------------------------------------- UDFSParser::UDFSParser(const char* filename) { diff --git a/PWGUD/Core/UDFSParser.h b/PWGUD/Core/UDFSParser.h index 6ceddafa5df..a48fb9f8a4f 100644 --- a/PWGUD/Core/UDFSParser.h +++ b/PWGUD/Core/UDFSParser.h @@ -12,7 +12,6 @@ #ifndef PWGUD_CORE_UDFSPARSER_H_ #define PWGUD_CORE_UDFSPARSER_H_ -// #include #include #include diff --git a/PWGUD/Core/UDGoodRunSelector.cxx b/PWGUD/Core/UDGoodRunSelector.cxx index c9c7d317ec7..c8203a7a569 100644 --- a/PWGUD/Core/UDGoodRunSelector.cxx +++ b/PWGUD/Core/UDGoodRunSelector.cxx @@ -11,10 +11,10 @@ #include "PWGUD/Core/UDGoodRunSelector.h" -#include "Framework/Logger.h" +#include -#include "rapidjson/document.h" -#include "rapidjson/filereadstream.h" +#include +#include #include #include diff --git a/PWGUD/Core/UDGoodRunSelector.h b/PWGUD/Core/UDGoodRunSelector.h index 4cf49330698..1b73f2c3ac4 100644 --- a/PWGUD/Core/UDGoodRunSelector.h +++ b/PWGUD/Core/UDGoodRunSelector.h @@ -12,8 +12,8 @@ #ifndef PWGUD_CORE_UDGOODRUNSELECTOR_H_ #define PWGUD_CORE_UDGOODRUNSELECTOR_H_ -#include #include +#include #include // A class to select good runs diff --git a/PWGUD/Core/UDHelpers.h b/PWGUD/Core/UDHelpers.h index 73a3efcd775..94d356501a7 100644 --- a/PWGUD/Core/UDHelpers.h +++ b/PWGUD/Core/UDHelpers.h @@ -19,19 +19,25 @@ #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsFT0/Digit.h" -#include "Framework/Logger.h" +#include +#include +#include +#include +#include -#include "TLorentzVector.h" +#include + +#include #include -#include +#include +#include +#include +#include +#include #include // namespace with helpers for UD framework diff --git a/PWGUD/Core/UPCHelpers.h b/PWGUD/Core/UPCHelpers.h index 9dfa5fe3776..8495f9c5adc 100644 --- a/PWGUD/Core/UPCHelpers.h +++ b/PWGUD/Core/UPCHelpers.h @@ -14,13 +14,14 @@ #include "UPCCutparHolder.h" -#include "PWGUD/DataModel/UDTables.h" - -#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include -#include "CommonConstants/LHCConstants.h" -#include "Framework/AnalysisDataModel.h" +#include using BCsWithBcSels = o2::soa::Join; diff --git a/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h b/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h index 2a53f2f41f8..83a3eed9053 100644 --- a/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h +++ b/PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h @@ -16,9 +16,17 @@ #ifndef PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ #define PWGUD_CORE_UPCJPSICENTRALBARRELCORRHELPER_H_ -#include "CommonConstants/MathConstants.h" +#include + +#include + +#include #include +#include +#include +#include +#include #include #include diff --git a/PWGUD/Core/UPCPairCuts.h b/PWGUD/Core/UPCPairCuts.h index f53b419ffda..817e4a86cfd 100644 --- a/PWGUD/Core/UPCPairCuts.h +++ b/PWGUD/Core/UPCPairCuts.h @@ -18,10 +18,13 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" +#include +#include +#include +#include +#include + +#include #include diff --git a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h index 41af7ec5d78..ea4652b9b77 100644 --- a/PWGUD/Core/UPCTauCentralBarrelHelperRL.h +++ b/PWGUD/Core/UPCTauCentralBarrelHelperRL.h @@ -18,11 +18,14 @@ #ifndef PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_ #define PWGUD_CORE_UPCTAUCENTRALBARRELHELPERRL_H_ -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +#include #include +#include +#include #include enum MyParticle { diff --git a/PWGUD/Core/decayTree.cxx b/PWGUD/Core/decayTree.cxx index ed05772364e..ded7c2fa329 100644 --- a/PWGUD/Core/decayTree.cxx +++ b/PWGUD/Core/decayTree.cxx @@ -11,10 +11,20 @@ #include "decayTree.h" +#include +#include + +#include + #include #include +#include +#include +#include #include +#include +#include #include #include #include diff --git a/PWGUD/Core/decayTree.h b/PWGUD/Core/decayTree.h index 59421098605..162a1859181 100644 --- a/PWGUD/Core/decayTree.h +++ b/PWGUD/Core/decayTree.h @@ -12,15 +12,19 @@ #ifndef PWGUD_CORE_DECAYTREE_H_ #define PWGUD_CORE_DECAYTREE_H_ -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include -#include "TDatabasePDG.h" -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include #include +#include #include #include #include diff --git a/PWGUD/DataModel/McPIDTable.h b/PWGUD/DataModel/McPIDTable.h index 3e2bf256db9..7f9cf4ea875 100644 --- a/PWGUD/DataModel/McPIDTable.h +++ b/PWGUD/DataModel/McPIDTable.h @@ -8,10 +8,11 @@ // 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. -#ifndef O2_ANALYSIS_UDDIFFMCSCAN_H -#define O2_ANALYSIS_UDDIFFMCSCAN_H -#include "Framework/AnalysisDataModel.h" +#ifndef PWGUD_DATAMODEL_MCPIDTABLE_H_ +#define PWGUD_DATAMODEL_MCPIDTABLE_H_ + +#include namespace o2::aod { @@ -33,4 +34,4 @@ DECLARE_SOA_TABLE(UDnSigmas, "AOD", "UDNSIGMAS", //! MCTruth of particle PID and } // namespace o2::aod -#endif // O2_ANALYSIS_UDDIFFMCSCAN_H +#endif // PWGUD_DATAMODEL_MCPIDTABLE_H_ diff --git a/PWGUD/DataModel/SGTables.h b/PWGUD/DataModel/SGTables.h index ddca7abf0fd..4e959cf886f 100644 --- a/PWGUD/DataModel/SGTables.h +++ b/PWGUD/DataModel/SGTables.h @@ -12,15 +12,11 @@ #ifndef PWGUD_DATAMODEL_SGTABLES_H_ #define PWGUD_DATAMODEL_SGTABLES_H_ -#include "Common/DataModel/TrackSelectionTables.h" - -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/DataTypes.h" -#include "MathUtils/Utils.h" +#include +#include #include -#include +#include namespace o2::aod { diff --git a/PWGUD/DataModel/TauEventTables.h b/PWGUD/DataModel/TauEventTables.h index f508cbc2c4d..ae0fd33496e 100644 --- a/PWGUD/DataModel/TauEventTables.h +++ b/PWGUD/DataModel/TauEventTables.h @@ -16,10 +16,12 @@ /// \brief A table to store information about events preselected to be candidates for UPC gammagamma->tautau /// -#ifndef ALISW_TAUEVENTTABLES_H -#define ALISW_TAUEVENTTABLES_H +#ifndef PWGUD_DATAMODEL_TAUEVENTTABLES_H_ +#define PWGUD_DATAMODEL_TAUEVENTTABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { @@ -221,4 +223,4 @@ DECLARE_SOA_TABLE(TrueTauTwoTracks, "AOD", "TRUETAUTWOTRACK", } // namespace o2::aod -#endif // ALISW_TAUEVENTTABLES_H +#endif // PWGUD_DATAMODEL_TAUEVENTTABLES_H_ diff --git a/PWGUD/DataModel/TauThreeProngEventTables.h b/PWGUD/DataModel/TauThreeProngEventTables.h index 61cc184cbdb..bd7da95f14c 100644 --- a/PWGUD/DataModel/TauThreeProngEventTables.h +++ b/PWGUD/DataModel/TauThreeProngEventTables.h @@ -19,7 +19,9 @@ #ifndef PWGUD_DATAMODEL_TAUTHREEPRONGEVENTTABLES_H_ #define PWGUD_DATAMODEL_TAUTHREEPRONGEVENTTABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include // derived tables for tautau->4 (=1+3) tracks namespace o2::aod { diff --git a/PWGUD/DataModel/TwoTracksEventTables.h b/PWGUD/DataModel/TwoTracksEventTables.h index 5eb2640f431..0f50fe2f493 100644 --- a/PWGUD/DataModel/TwoTracksEventTables.h +++ b/PWGUD/DataModel/TwoTracksEventTables.h @@ -21,7 +21,9 @@ #ifndef PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_ #define PWGUD_DATAMODEL_TWOTRACKSEVENTTABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { diff --git a/PWGUD/DataModel/UDIndex.h b/PWGUD/DataModel/UDIndex.h index 8a4a236c5af..16a7ed3a5ed 100644 --- a/PWGUD/DataModel/UDIndex.h +++ b/PWGUD/DataModel/UDIndex.h @@ -19,9 +19,10 @@ #ifndef PWGUD_DATAMODEL_UDINDEX_H_ #define PWGUD_DATAMODEL_UDINDEX_H_ -#include "UDTables.h" +#include "PWGUD/DataModel/UDTables.h" // IWYU pragma: keep + +#include -#include "Framework/AnalysisDataModel.h" namespace o2::aod { namespace udidx @@ -32,4 +33,5 @@ DECLARE_SOA_ARRAY_INDEX_COLUMN(UDCollision, udcollisions); DECLARE_SOA_TABLE(UDMcParticlesToUDTracks, "AOD", "UDP2UDT", udidx::UDTrackIds); DECLARE_SOA_TABLE(UDMcCollisionsToUDCollisions, "AOD", "UDMCC2UDC", udidx::UDCollisionIds); } // namespace o2::aod + #endif // PWGUD_DATAMODEL_UDINDEX_H_ diff --git a/PWGUD/DataModel/UDTables.h b/PWGUD/DataModel/UDTables.h index 774bb31751a..afb7728a5ab 100644 --- a/PWGUD/DataModel/UDTables.h +++ b/PWGUD/DataModel/UDTables.h @@ -25,12 +25,13 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/DataTypes.h" -#include "MathUtils/Utils.h" +#include +#include + +#include #include +#include #include namespace o2::aod diff --git a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx index 1fa1882e7d5..38ecb5abeb3 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasConverter.cxx @@ -20,11 +20,13 @@ /// \author Sasha Bylinkin -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx index b10b467ec4d..d2b4d6408b4 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV002Converter.cxx @@ -13,11 +13,15 @@ /// \brief Converts UDCollisionSelExtras table from version 000 to 002 and 001 to 002 /// \author Roman Lavicka -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx index a41b2c4efa6..e52b6fce784 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionSelExtrasV003Converter.cxx @@ -15,9 +15,12 @@ #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx b/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx index 8be7bce717b..99de6088fb4 100644 --- a/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDCollisionsConverter.cxx @@ -20,11 +20,13 @@ /// \author Sasha Bylinkin -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx b/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx index f9b1f2d0d22..4806232f490 100644 --- a/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx +++ b/PWGUD/TableProducer/Converters/UDFwdTracksExtraConverter.cxx @@ -21,11 +21,13 @@ /// \author Andrea Giovanni Riffero -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/DGBCCandProducer.cxx b/PWGUD/TableProducer/DGBCCandProducer.cxx index 97b60c42c9e..eb272397af3 100644 --- a/PWGUD/TableProducer/DGBCCandProducer.cxx +++ b/PWGUD/TableProducer/DGBCCandProducer.cxx @@ -14,15 +14,45 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 30.09.2022 -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "ReconstructionDataFormats/Vertex.h" -#include "PWGUD/DataModel/UDTables.h" +#include "DGBCCandProducer.h" + +#include "PWGUD/Core/DGCutparHolder.h" +#include "PWGUD/Core/DGSelector.h" #include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCHelpers.h" -#include "PWGUD/Core/DGSelector.h" -#include "DGBCCandProducer.h" +#include "PWGUD/DataModel/UDTables.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#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; diff --git a/PWGUD/TableProducer/DGBCCandProducer.h b/PWGUD/TableProducer/DGBCCandProducer.h index 5bdc09498c6..64d30453dbf 100644 --- a/PWGUD/TableProducer/DGBCCandProducer.h +++ b/PWGUD/TableProducer/DGBCCandProducer.h @@ -16,13 +16,10 @@ #ifndef PWGUD_TABLEPRODUCER_DGBCCANDPRODUCER_H_ #define PWGUD_TABLEPRODUCER_DGBCCANDPRODUCER_H_ -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/DataTypes.h" -#include "MathUtils/Utils.h" +#include +#include -#include -#include +#include namespace o2::aod { diff --git a/PWGUD/TableProducer/SGCandProducer.cxx b/PWGUD/TableProducer/SGCandProducer.cxx index b2702b54546..a45493d792e 100644 --- a/PWGUD/TableProducer/SGCandProducer.cxx +++ b/PWGUD/TableProducer/SGCandProducer.cxx @@ -19,32 +19,42 @@ // #include "PWGUD/Core/FITCutParHolder.h" +#include "PWGUD/Core/SGCutParHolder.h" #include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/DataModel/EventSelection.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Vertex.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include #include +#include #include +#include #include #include diff --git a/PWGUD/TableProducer/UPCCandidateProducer.cxx b/PWGUD/TableProducer/UPCCandidateProducer.cxx index 2208060bd59..ac0058c11dd 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -18,17 +18,36 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" - -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsITSMFT/ROFRecord.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.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 diff --git a/PWGUD/TableProducer/dgCandProducer.cxx b/PWGUD/TableProducer/dgCandProducer.cxx index d47093843fb..6c075229fb1 100644 --- a/PWGUD/TableProducer/dgCandProducer.cxx +++ b/PWGUD/TableProducer/dgCandProducer.cxx @@ -12,21 +12,46 @@ // \brief Saves relevant information of DG candidates // \author Paul Buehler, paul.buehler@oeaw.ac.at +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/DGSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" - -#include "CCDB/BasicCCDBManager.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Vertex.h" - +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.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 diff --git a/PWGUD/TableProducer/fwdTrackPropagation.cxx b/PWGUD/TableProducer/fwdTrackPropagation.cxx index 64099fac4ed..655e78535a1 100644 --- a/PWGUD/TableProducer/fwdTrackPropagation.cxx +++ b/PWGUD/TableProducer/fwdTrackPropagation.cxx @@ -17,21 +17,30 @@ #include "PWGUD/DataModel/UDTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.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 diff --git a/PWGUD/TableProducer/tauEventTableProducer.cxx b/PWGUD/TableProducer/tauEventTableProducer.cxx index ec08a426f35..d91c5dffe8d 100644 --- a/PWGUD/TableProducer/tauEventTableProducer.cxx +++ b/PWGUD/TableProducer/tauEventTableProducer.cxx @@ -16,32 +16,29 @@ /// \since 09.04.2025 // -// C++ headers -#include -#include -#include -#include -#include - -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/TauEventTables.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -52,7 +49,7 @@ struct TauEventTableProducer { Produces tauTwoTracks; Produces trueTauTwoTracks; - // Global varialbes + // Global variables Service pdg; SGSelector sgSelector; diff --git a/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx b/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx index 1900e1a1232..87878b7b364 100644 --- a/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx +++ b/PWGUD/TableProducer/tauThreeProngEventTableProducer.cxx @@ -23,40 +23,38 @@ // oopts="--aod-writer-json saveDerivedConfigData.json" // o2-analysis-ud-tau-three-prong-event-table-producer $copts $oopts > output.log -//// C++ headers -#include "Math/Vector4D.h" - -#include -#include -#include -#include -#include -// -//// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -// #include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -// -//// O2Physics headers -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/TrackSelectionTables.h" -// #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -#include "PWGUD/Core/DGPIDSelector.h" #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/TauThreeProngEventTables.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/Core/RecoDecay.h" -#include "TPDGCode.h" +#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; diff --git a/PWGUD/TableProducer/twoTracksEventTableProducer.cxx b/PWGUD/TableProducer/twoTracksEventTableProducer.cxx index 3af6a964021..36c5c44112f 100644 --- a/PWGUD/TableProducer/twoTracksEventTableProducer.cxx +++ b/PWGUD/TableProducer/twoTracksEventTableProducer.cxx @@ -16,35 +16,33 @@ /// \since 20.06.2025 // -// C++ headers -#include -#include -#include -#include -#include - -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/TwoTracksEventTables.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include -// ROOT -#include "Math/Vector4D.h" +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx b/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx index cea35fb70ea..f97fe33a3f3 100644 --- a/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx +++ b/PWGUD/TableProducer/udMcCollisions2udCollisions.cxx @@ -16,13 +16,17 @@ /// \brief A task to create a reverse index from UDMcCollisions to UDCollisions /// -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "PWGUD/DataModel/UDTables.h" #include "PWGUD/DataModel/UDIndex.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/udMcParticles2udTracks.cxx b/PWGUD/TableProducer/udMcParticles2udTracks.cxx index 4a876a72fb3..e4f18bc20d9 100644 --- a/PWGUD/TableProducer/udMcParticles2udTracks.cxx +++ b/PWGUD/TableProducer/udMcParticles2udTracks.cxx @@ -16,13 +16,17 @@ /// \brief A task to create a reverse index from UDMcParticles to UDTracks /// -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "PWGUD/DataModel/UDTables.h" #include "PWGUD/DataModel/UDIndex.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx index c97704fe2ce..76c0a8b3e05 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -16,27 +16,44 @@ #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" +#include "PWGUD/DataModel/UDTables.h" #include "Common/Core/fwdtrackUtilities.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/GeomConstants.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.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 diff --git a/PWGUD/TableProducer/upcCandProducerMuon.cxx b/PWGUD/TableProducer/upcCandProducerMuon.cxx index 329a83b432c..0ac8458d60f 100644 --- a/PWGUD/TableProducer/upcCandProducerMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerMuon.cxx @@ -16,24 +16,37 @@ #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.h" - -#include +#include "PWGUD/DataModel/UDTables.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 diff --git a/PWGUD/Tasks/FwdMuonsUPC.cxx b/PWGUD/Tasks/FwdMuonsUPC.cxx index 0c4b3d81e3b..b3351965727 100644 --- a/PWGUD/Tasks/FwdMuonsUPC.cxx +++ b/PWGUD/Tasks/FwdMuonsUPC.cxx @@ -16,22 +16,28 @@ /// \author Andrea Giovanni Riffero -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" #include "PWGUD/DataModel/UDTables.h" -#include "TLorentzVector.h" -#include "TSystem.h" -#include "TMath.h" -#include "TRandom3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include // table for saving tree with info on data namespace dimu diff --git a/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx b/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx index 4347871377a..26d8c91c0e0 100644 --- a/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx +++ b/PWGUD/Tasks/analysisMCDPMJetSGv3.cxx @@ -13,18 +13,28 @@ /// /// \author Simone Ragoni -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -// #include "TDatabasePDG.h" -#include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" -// #include "TLorentzVector.h" -// #include "TVector3.h" -#include "Math/LorentzVector.h" // ROOT::Math::LorentzVector -#include "Math/PxPyPzM4D.h" // ROOT::Math::PxPyPzM4D -#include "TMath.h" + +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/decayTreeAnalyzer.cxx b/PWGUD/Tasks/decayTreeAnalyzer.cxx index c725a2ca72a..5a46ed7c8cb 100644 --- a/PWGUD/Tasks/decayTreeAnalyzer.cxx +++ b/PWGUD/Tasks/decayTreeAnalyzer.cxx @@ -13,18 +13,27 @@ // \author Paul Buehler, paul.buehler@oeaw.ac.at // \since 01.03.2024 -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "CommonConstants/LHCConstants.h" -#include "PWGUD/DataModel/UDTables.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UDGoodRunSelector.h" +#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/decayTree.h" +#include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/dgCandAnalyzer.cxx b/PWGUD/Tasks/dgCandAnalyzer.cxx index d7283115434..79b5b6c5f02 100644 --- a/PWGUD/Tasks/dgCandAnalyzer.cxx +++ b/PWGUD/Tasks/dgCandAnalyzer.cxx @@ -18,12 +18,31 @@ #include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.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 diff --git a/PWGUD/Tasks/diffMCDataScanner.cxx b/PWGUD/Tasks/diffMCDataScanner.cxx index 8ad8d7ae853..06fa70f5220 100644 --- a/PWGUD/Tasks/diffMCDataScanner.cxx +++ b/PWGUD/Tasks/diffMCDataScanner.cxx @@ -13,9 +13,32 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 01.10.2021 -#include "Framework/AnalysisTask.h" -#include "PWGUD/DataModel/McPIDTable.h" #include "PWGUD/Core/UDHelpers.h" +#include "PWGUD/DataModel/McPIDTable.h" + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; @@ -25,7 +48,7 @@ void customize(std::vector& workflowOptions) workflowOptions.push_back(ConfigParamSpec{"runCase", VariantType::Int, 0, {"runCase: 0 - histos, 1 - mcTruth, 2 - mc only, else - tree"}}); } -#include "Framework/runDataProcessing.h" +#include using namespace o2::framework::expressions; diff --git a/PWGUD/Tasks/diffMCQA.cxx b/PWGUD/Tasks/diffMCQA.cxx index 19bf3016a97..c6b1f650db2 100644 --- a/PWGUD/Tasks/diffMCQA.cxx +++ b/PWGUD/Tasks/diffMCQA.cxx @@ -13,13 +13,35 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 01.10.2021 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "TLorentzVector.h" -#include "ReconstructionDataFormats/BCRange.h" -#include "CommonConstants/PhysicsConstants.h" +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#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; diff --git a/PWGUD/Tasks/diffQA.cxx b/PWGUD/Tasks/diffQA.cxx index a1e9ec34185..59bdd9a67eb 100644 --- a/PWGUD/Tasks/diffQA.cxx +++ b/PWGUD/Tasks/diffQA.cxx @@ -13,14 +13,38 @@ /// \author Paul Buehler, paul.buehler@oeaw.ac.at /// \since 20.05.2022 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "TLorentzVector.h" -#include "CommonConstants/LHCConstants.h" -#include "ReconstructionDataFormats/BCRange.h" -#include "CommonConstants/PhysicsConstants.h" +#include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/UDHelpers.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#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; diff --git a/PWGUD/Tasks/eventByevent.cxx b/PWGUD/Tasks/eventByevent.cxx index 072ae2d961c..913319bd785 100644 --- a/PWGUD/Tasks/eventByevent.cxx +++ b/PWGUD/Tasks/eventByevent.cxx @@ -10,16 +10,27 @@ // or submit itself to any jurisdiction. // -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include #include -#include "TLorentzVector.h" -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/SGTrackSelector.h" + +#include +#include using namespace std; using namespace o2; diff --git a/PWGUD/Tasks/exclusivePentaquark.cxx b/PWGUD/Tasks/exclusivePentaquark.cxx index eb5170bb400..8f21b5f333f 100644 --- a/PWGUD/Tasks/exclusivePentaquark.cxx +++ b/PWGUD/Tasks/exclusivePentaquark.cxx @@ -11,15 +11,25 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include -using std::array; +#include +#include +#include + using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusivePhi.cxx b/PWGUD/Tasks/exclusivePhi.cxx index c0850b4b84d..499f8e1046f 100644 --- a/PWGUD/Tasks/exclusivePhi.cxx +++ b/PWGUD/Tasks/exclusivePhi.cxx @@ -11,17 +11,27 @@ // #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include + +#include -#include +#include +#include #include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusivePhiLeptons.cxx b/PWGUD/Tasks/exclusivePhiLeptons.cxx index cb2d8834862..ae4e80c31ed 100644 --- a/PWGUD/Tasks/exclusivePhiLeptons.cxx +++ b/PWGUD/Tasks/exclusivePhiLeptons.cxx @@ -11,16 +11,27 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include -#include +#include +#include +#include #include -using std::array; + using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx b/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx index ecc65174f26..577f25e63c6 100644 --- a/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx +++ b/PWGUD/Tasks/exclusivePhiLeptonsTrees.cxx @@ -8,19 +8,30 @@ // 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 "PWGUD/Core/SGSelector.h" + #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" +#include +#include +#include #include -#include +#include +#include +#include #include -using std::array; + using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx index 8cefae2262c..c295a40df6e 100644 --- a/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx +++ b/PWGUD/Tasks/exclusiveRhoTo4Pi.cxx @@ -14,26 +14,33 @@ /// \author Anantha Padmanabhan M Nair #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "TPDGCode.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 +#include #include #include +#include +#include +#include #include #include diff --git a/PWGUD/Tasks/exclusiveTwoProtons.cxx b/PWGUD/Tasks/exclusiveTwoProtons.cxx index d22c92cccbc..bc3c4783aba 100644 --- a/PWGUD/Tasks/exclusiveTwoProtons.cxx +++ b/PWGUD/Tasks/exclusiveTwoProtons.cxx @@ -11,15 +11,28 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include + +#include + +#include +#include +#include -#include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx b/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx index 521096634e9..7d8e3ed9326 100644 --- a/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx +++ b/PWGUD/Tasks/exclusiveTwoProtonsSG.cxx @@ -11,15 +11,28 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include + +#include + +#include +#include +#include -#include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/flowCorrelationsUpc.cxx b/PWGUD/Tasks/flowCorrelationsUpc.cxx index b1b70fb5db9..061eda25566 100644 --- a/PWGUD/Tasks/flowCorrelationsUpc.cxx +++ b/PWGUD/Tasks/flowCorrelationsUpc.cxx @@ -15,30 +15,30 @@ /// copied from Thor Jensen (thor.kjaersgaard.jensen@cern.ch) and Debojit Sarkar (debojit.sarkar@cern.ch) #include "PWGCF/Core/CorrelationContainer.h" -#include "PWGCF/Core/PairCuts.h" -#include "PWGCF/DataModel/CorrelationsDerived.h" #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/DataModel/SGTables.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/Core/RecoDecay.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/MathConstants.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" - -#include "TRandom3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include #include namespace o2::aod @@ -56,6 +56,7 @@ DECLARE_SOA_TABLE(Truegapside, "AOD", "TRUEGAPSIDE", flowcorrupc::Truegapside); using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; +using namespace o2::constants::math; // define the filtered collisions and tracks #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; diff --git a/PWGUD/Tasks/flowCumulantsUpc.cxx b/PWGUD/Tasks/flowCumulantsUpc.cxx index 98006bbde6a..ad75ae1a3c3 100644 --- a/PWGUD/Tasks/flowCumulantsUpc.cxx +++ b/PWGUD/Tasks/flowCumulantsUpc.cxx @@ -14,41 +14,51 @@ /// \since Mar/2025 /// \brief jira: , task to measure flow observables with cumulant method -#include "FlowContainer.h" -#include "GFW.h" -#include "GFWCumulant.h" -#include "GFWPowerArray.h" -#include "GFWWeights.h" - #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/DataModel/SGTables.h" #include "PWGUD/DataModel/UDTables.h" +// +#include "PWGCF/GenericFramework/Core/FlowContainer.h" +#include "PWGCF/GenericFramework/Core/GFW.h" +#include "PWGCF/GenericFramework/Core/GFWWeights.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.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 "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include -#include "TList.h" -#include "TVector3.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 diff --git a/PWGUD/Tasks/polarisationRho.cxx b/PWGUD/Tasks/polarisationRho.cxx index c10e86baad6..386bd5de510 100644 --- a/PWGUD/Tasks/polarisationRho.cxx +++ b/PWGUD/Tasks/polarisationRho.cxx @@ -8,13 +8,26 @@ // 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 "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include #include "PWGUD/DataModel/UDTables.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include "TLorentzVector.h" +#include + +#include + +#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgD0Analyzer.cxx b/PWGUD/Tasks/sgD0Analyzer.cxx index 7e4c2019434..149683c1c40 100644 --- a/PWGUD/Tasks/sgD0Analyzer.cxx +++ b/PWGUD/Tasks/sgD0Analyzer.cxx @@ -17,15 +17,21 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" -#include +#include -#include +#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgExcUniverse.cxx b/PWGUD/Tasks/sgExcUniverse.cxx index 6178d4cb0b0..a02a30b621d 100644 --- a/PWGUD/Tasks/sgExcUniverse.cxx +++ b/PWGUD/Tasks/sgExcUniverse.cxx @@ -15,15 +15,21 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgExclOmega.cxx b/PWGUD/Tasks/sgExclOmega.cxx index 858b0499caa..cb8c298ce0f 100644 --- a/PWGUD/Tasks/sgExclOmega.cxx +++ b/PWGUD/Tasks/sgExclOmega.cxx @@ -17,20 +17,28 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" -#include +#include + +#include +#include -#include using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; + struct SGExclOmega { SGSelector sgSelector; Service pdg; diff --git a/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx b/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx index b0b2058a27d..73d2d5884a5 100644 --- a/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx +++ b/PWGUD/Tasks/sgExclusiveJpsiMidrapidity.cxx @@ -17,12 +17,21 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TMath.h" +#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 diff --git a/PWGUD/Tasks/sgExclusivePhi.cxx b/PWGUD/Tasks/sgExclusivePhi.cxx index c4bed3d1456..a68d9ba8cdb 100644 --- a/PWGUD/Tasks/sgExclusivePhi.cxx +++ b/PWGUD/Tasks/sgExclusivePhi.cxx @@ -12,17 +12,29 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include +#include + +#include -#include +#include +#include +#include #include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgExclusivePhiITSselections.cxx b/PWGUD/Tasks/sgExclusivePhiITSselections.cxx index 1e3fe149e59..d3d8a580b4b 100644 --- a/PWGUD/Tasks/sgExclusivePhiITSselections.cxx +++ b/PWGUD/Tasks/sgExclusivePhiITSselections.cxx @@ -12,17 +12,26 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include -#include +#include +#include +#include #include -using std::array; using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgFITAnalyzer.cxx b/PWGUD/Tasks/sgFITAnalyzer.cxx index 60464ed6cf4..f3369b3a7cb 100644 --- a/PWGUD/Tasks/sgFITAnalyzer.cxx +++ b/PWGUD/Tasks/sgFITAnalyzer.cxx @@ -15,18 +15,29 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/PIDResponseTOF.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" +#include + +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgFourPiAnalyzer.cxx b/PWGUD/Tasks/sgFourPiAnalyzer.cxx index 13979d87c38..ef6f1b17a0b 100644 --- a/PWGUD/Tasks/sgFourPiAnalyzer.cxx +++ b/PWGUD/Tasks/sgFourPiAnalyzer.cxx @@ -17,25 +17,27 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" +#include +#include -#include "TLorentzVector.h" -#include +#include -#include using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; + struct SGFourPiAnalyzer { SGSelector sgSelector; Service pdg; diff --git a/PWGUD/Tasks/sgInclJpsi.cxx b/PWGUD/Tasks/sgInclJpsi.cxx index eba36e3845c..4ead557224a 100644 --- a/PWGUD/Tasks/sgInclJpsi.cxx +++ b/PWGUD/Tasks/sgInclJpsi.cxx @@ -17,20 +17,27 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "TLorentzVector.h" -#include +#include + +#include -#include using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; + struct SGInclJpsi { SGSelector sgSelector; Service pdg; diff --git a/PWGUD/Tasks/sgPIDAnalyzer.cxx b/PWGUD/Tasks/sgPIDAnalyzer.cxx index c3038cee058..f68d3b0ddf9 100644 --- a/PWGUD/Tasks/sgPIDAnalyzer.cxx +++ b/PWGUD/Tasks/sgPIDAnalyzer.cxx @@ -13,19 +13,16 @@ // \author Sasha Bylinkin, alexander.bylinkin@gmail.com // \since April 2023 -#include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/SGTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" -#include -#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgPIDSpectra.cxx b/PWGUD/Tasks/sgPIDSpectra.cxx index 2792dee4be2..706c34a1150 100644 --- a/PWGUD/Tasks/sgPIDSpectra.cxx +++ b/PWGUD/Tasks/sgPIDSpectra.cxx @@ -15,15 +15,21 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/sgPIDSpectraTable.cxx b/PWGUD/Tasks/sgPIDSpectraTable.cxx index bd781969afc..75b81336c3d 100644 --- a/PWGUD/Tasks/sgPIDSpectraTable.cxx +++ b/PWGUD/Tasks/sgPIDSpectraTable.cxx @@ -12,18 +12,21 @@ // \Single Gap Event Analyzer // \author Sasha Bylinkin, alexander.bylinkin@gmail.com // \since April 2023 + #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/SGTables.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include -#include "TFile.h" -#include "TTree.h" -#include "TVector3.h" +#include #include diff --git a/PWGUD/Tasks/sgSixPiAnalyzer.cxx b/PWGUD/Tasks/sgSixPiAnalyzer.cxx index 1a3ed6604e2..ff288249dc2 100644 --- a/PWGUD/Tasks/sgSixPiAnalyzer.cxx +++ b/PWGUD/Tasks/sgSixPiAnalyzer.cxx @@ -17,20 +17,20 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" +#include +#include -#include "TLorentzVector.h" -#include - -#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sgSpectraAnalyzer.cxx b/PWGUD/Tasks/sgSpectraAnalyzer.cxx index 1d73df42642..b17c699970f 100644 --- a/PWGUD/Tasks/sgSpectraAnalyzer.cxx +++ b/PWGUD/Tasks/sgSpectraAnalyzer.cxx @@ -17,20 +17,31 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include -// #include "PWGUD/Core/RLhelper.h" -#include "TLorentzVector.h" -#include +#include +#include + using namespace std; using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; + namespace excl_fs { DECLARE_SOA_COLUMN(GS, gs, int); diff --git a/PWGUD/Tasks/sgTwoPiAnalyzer.cxx b/PWGUD/Tasks/sgTwoPiAnalyzer.cxx index 7a2c8aefc3c..77c6e4f2d94 100644 --- a/PWGUD/Tasks/sgTwoPiAnalyzer.cxx +++ b/PWGUD/Tasks/sgTwoPiAnalyzer.cxx @@ -17,20 +17,21 @@ #include "PWGUD/Core/SGTrackSelector.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" +#include +#include -#include "TLorentzVector.h" -#include - -#include +#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx index ea7c42308a2..a67bd2bd325 100644 --- a/PWGUD/Tasks/sginclusivePhiKstarSD.cxx +++ b/PWGUD/Tasks/sginclusivePhiKstarSD.cxx @@ -16,24 +16,35 @@ #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" -#include "PWGUD/Core/UPCHelpers.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Vertex.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" -#include "TPDGCode.h" -#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 diff --git a/PWGUD/Tasks/testMcStdTabsRl.cxx b/PWGUD/Tasks/testMcStdTabsRl.cxx index 9748b28784f..7651b5e5c2a 100644 --- a/PWGUD/Tasks/testMcStdTabsRl.cxx +++ b/PWGUD/Tasks/testMcStdTabsRl.cxx @@ -16,24 +16,25 @@ /// \since 12.02.2025 // -// C++ headers -#include -#include -#include -#include - -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" -// ROOT headers -#include "Math/Vector4D.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcAnalysis.cxx b/PWGUD/Tasks/upcAnalysis.cxx index 74a007314e0..f6dc8ba1323 100644 --- a/PWGUD/Tasks/upcAnalysis.cxx +++ b/PWGUD/Tasks/upcAnalysis.cxx @@ -9,16 +9,22 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" - -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include + +#include +#include +#include -#include -#include -#include "TLorentzVector.h" +#include +#include using namespace o2; using namespace o2::aod::evsel; diff --git a/PWGUD/Tasks/upcCandidateAnalyzer.cxx b/PWGUD/Tasks/upcCandidateAnalyzer.cxx index 568ecacb872..dcf23797803 100644 --- a/PWGUD/Tasks/upcCandidateAnalyzer.cxx +++ b/PWGUD/Tasks/upcCandidateAnalyzer.cxx @@ -9,12 +9,23 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" #include "PWGUD/DataModel/UDTables.h" -#include "TLorentzVector.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcEventITSROFcounter.cxx b/PWGUD/Tasks/upcEventITSROFcounter.cxx index 51241be5d69..c33c17ecfe4 100644 --- a/PWGUD/Tasks/upcEventITSROFcounter.cxx +++ b/PWGUD/Tasks/upcEventITSROFcounter.cxx @@ -15,23 +15,32 @@ /// \author Roman Lavicka , Austrian Academy of Sciences & SMI /// \since 09.08.2024 -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "ITSMFTBase/DPLAlpideParam.h" -#include "CCDB/BasicCCDBManager.h" -#include "ReconstructionDataFormats/Vertex.h" +#include "PWGUD/Core/SGSelector.h" +#include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" -#include "PWGUD/DataModel/UDTables.h" -#include "PWGUD/Core/SGSelector.h" - -#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; diff --git a/PWGUD/Tasks/upcForward.cxx b/PWGUD/Tasks/upcForward.cxx index bebcf0b2be2..49325f3e0db 100644 --- a/PWGUD/Tasks/upcForward.cxx +++ b/PWGUD/Tasks/upcForward.cxx @@ -14,16 +14,26 @@ o2-analysis-timestamp| o2-analysis-upc-forward | o2-analysis-event-selection -- for now AO2D.root I am using is alien:///alice/data/2015/LHC15o/000246392/pass5_lowIR/PWGZZ/Run3_Conversion/148_20210304-0829_child_1/AOD/001/AO2D.root */ -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/DataModel/EventSelection.h" -#include -#include -#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include -#include "TLorentzVector.h" -#include "Common/CCDB/TriggerAliases.h" + +#include + +#include using namespace std; using namespace o2; diff --git a/PWGUD/Tasks/upcJpsiCorr.cxx b/PWGUD/Tasks/upcJpsiCorr.cxx index ad0145dae34..1732869e0d6 100644 --- a/PWGUD/Tasks/upcJpsiCorr.cxx +++ b/PWGUD/Tasks/upcJpsiCorr.cxx @@ -15,25 +15,33 @@ /// \author Sara Haidlova, sara.haidlova@cern.ch /// \since March 2024 -#include -#include - -// O2 headers -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/Core/UPCJpsiCentralBarrelCorrHelper.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/Core/RecoDecay.h" -// ROOT headers -#include "TLorentzVector.h" +#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; diff --git a/PWGUD/Tasks/upcMft.cxx b/PWGUD/Tasks/upcMft.cxx index a3ae2b03287..6349589e6b4 100644 --- a/PWGUD/Tasks/upcMft.cxx +++ b/PWGUD/Tasks/upcMft.cxx @@ -9,31 +9,35 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -// c++ headers -#include - -// root headers -#include -#include -#include "TMath.h" -#include "TLorentzVector.h" - -// framework headers -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" - -// for track propagation -#include "ReconstructionDataFormats/TrackFwd.h" -#include "Math/MatrixFunctions.h" -#include "Math/SMatrix.h" -#include "MathUtils/Utils.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "TGeoGlobalMagField.h" -#include "Field/MagneticField.h" -#include "DataFormatsMFT/TrackMFT.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 // define namespaces using namespace o2; diff --git a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx index 68f9c1698e1..0ae2035f93a 100644 --- a/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx +++ b/PWGUD/Tasks/upcPhotonuclearAnalysisJMG.cxx @@ -18,25 +18,25 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" -#include "DataFormatsParameters/GRPObject.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include #include using namespace o2; diff --git a/PWGUD/Tasks/upcPionAnalysis.cxx b/PWGUD/Tasks/upcPionAnalysis.cxx index fc215ea1822..470281f0a77 100644 --- a/PWGUD/Tasks/upcPionAnalysis.cxx +++ b/PWGUD/Tasks/upcPionAnalysis.cxx @@ -9,18 +9,35 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include -#include "PWGUD/DataModel/UDTables.h" -#include -#include -#include "TLorentzVector.h" #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/SGTrackSelector.h" +#include "PWGUD/DataModel/UDTables.h" + #include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include using namespace std; using namespace o2; using namespace o2::aod; diff --git a/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx b/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx index 88d8f36d18d..d026d6ce962 100644 --- a/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx +++ b/PWGUD/Tasks/upcPolarisationJpsiIncoh.cxx @@ -19,19 +19,25 @@ #include "Common/Core/RecoDecay.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TMath.h" -#include "TRandom3.h" -#include "TSystem.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include #include #include diff --git a/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx b/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx index 8baf7f42206..b87d5f3eb29 100644 --- a/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx +++ b/PWGUD/Tasks/upcQuarkoniaCentralBarrel.cxx @@ -31,36 +31,31 @@ // #include "PWGUD/Core/SGSelector.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 "PWGUD/DataModel/UDTables.h" + +#include "Common/Core/RecoDecay.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include #include #include +#include #include -#include #include #include diff --git a/PWGUD/Tasks/upcRhoAnalysis.cxx b/PWGUD/Tasks/upcRhoAnalysis.cxx index 2b5d7405fca..18c3eb5f08a 100644 --- a/PWGUD/Tasks/upcRhoAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoAnalysis.cxx @@ -19,13 +19,31 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TPDGCode.h" - +#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 @@ -799,7 +817,7 @@ struct UpcRhoAnalysis { if (selectRuns && getRunIndex(collision.runNumber(), selectedRuns) == 0) return; - fillCollisionQcHistos<0>(collision); // fill QC histograms before cuts + fillCollisionQcHistos<0>(collision); // fill QC histograms before cuts if (!collisionPassesCuts(collision, runIndex)) // apply collision cuts return; diff --git a/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx b/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx index f8f03970ff0..703f0989283 100644 --- a/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx +++ b/PWGUD/Tasks/upcRhoPrimeAnalysis.cxx @@ -15,16 +15,25 @@ #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TH1F.h" -#include "TH2F.h" - -#include "random" -#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 diff --git a/PWGUD/Tasks/upcTauRl.cxx b/PWGUD/Tasks/upcTauRl.cxx index 78e9f7b48ae..264dae05eb8 100644 --- a/PWGUD/Tasks/upcTauRl.cxx +++ b/PWGUD/Tasks/upcTauRl.cxx @@ -16,35 +16,35 @@ /// \since 12.07.2022 // -// C++ headers -#include -#include -#include -#include -#include - -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include -// ROOT headers -#include "Math/Vector4D.h" -#include "TPDGCode.h" +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcTauTau13topo.cxx b/PWGUD/Tasks/upcTauTau13topo.cxx index d2dd61ade0c..a14ebd9cb35 100644 --- a/PWGUD/Tasks/upcTauTau13topo.cxx +++ b/PWGUD/Tasks/upcTauTau13topo.cxx @@ -17,27 +17,35 @@ // copts="--configuration json://tautauConfig.json -b" // o2-analysis-ud-tautau13topo $copts > output.log -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -// #include "TDatabasePDG.h" // not recommended in o2 -#include "Framework/O2DatabasePDGPlugin.h" - -// #include "TLorentzVector.h" -#include "Math/Vector4D.h" -// #include "Common/DataModel/EventSelection.h" -// #include "Common/DataModel/TrackSelectionTables.h" - -#include "PWGUD/Core/DGPIDSelector.h" #include "PWGUD/Core/SGSelector.h" -#include "PWGUD/Core/UDHelpers.h" #include "PWGUD/DataModel/UDTables.h" #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/PIDResponseTPC.h" -// #include -#include "TPDGCode.h" + +#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; diff --git a/PWGUD/Tasks/upcTestFITBitMapping.cxx b/PWGUD/Tasks/upcTestFITBitMapping.cxx index 8456c46dc85..eefd4f0aa83 100644 --- a/PWGUD/Tasks/upcTestFITBitMapping.cxx +++ b/PWGUD/Tasks/upcTestFITBitMapping.cxx @@ -16,13 +16,19 @@ #include "PWGUD/Core/UDHelpers.h" // udhelpers::Bits256, makeBits256, testBit, getPhiEtaFromFitBit #include "PWGUD/DataModel/UDTables.h" // aod::UDCollisionFITBits -#include "FT0Base/Geometry.h" // o2::ft0::Geometry -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include // o2::ft0::Geometry +#include +#include +#include +#include +#include +#include #include #include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGUD/Tasks/upcTestRctTables.cxx b/PWGUD/Tasks/upcTestRctTables.cxx index 5f6d1bd8db1..2e70f5c2a1a 100644 --- a/PWGUD/Tasks/upcTestRctTables.cxx +++ b/PWGUD/Tasks/upcTestRctTables.cxx @@ -16,18 +16,21 @@ /// \since 27.06.2025 // -// O2 headers -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -// O2Physics headers #include "PWGUD/Core/SGSelector.h" #include "PWGUD/Core/UPCTauCentralBarrelHelperRL.h" #include "PWGUD/DataModel/UDTables.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGUD/Tasks/upcVetoAnalysis.cxx b/PWGUD/Tasks/upcVetoAnalysis.cxx index 45b3844ed51..fab4246a0f7 100644 --- a/PWGUD/Tasks/upcVetoAnalysis.cxx +++ b/PWGUD/Tasks/upcVetoAnalysis.cxx @@ -8,21 +8,40 @@ // 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 +#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 "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" using namespace o2::framework; using namespace o2::framework::expressions;