diff --git a/.github/workflows/o2-linter.yml b/.github/workflows/o2-linter.yml index 0ab7211d487..f5a1b39a950 100644 --- a/.github/workflows/o2-linter.yml +++ b/.github/workflows/o2-linter.yml @@ -2,7 +2,7 @@ # Find issues in O2 code name: O2 linter -#"on": [pull_request_target, push] +"on": [pull_request_target, push] permissions: {} env: BRANCH_MAIN: master @@ -20,12 +20,12 @@ jobs: steps: - name: Set branches run: | - if [[ "${{ github.event_name }}" == "push" ]]; then + if [[ "${{ github.event_name }}" == "push" || "${{ github.event_name }}" == "pull_request" ]]; then branch_head="${{ github.ref }}" - branch_base="${{ env.BRANCH_MAIN }}" + branch_base="origin/${{ env.BRANCH_MAIN }}" else branch_head="refs/pull/${{ github.event.pull_request.number }}/merge" - branch_base="${{ github.event.pull_request.base.ref }}" + branch_base="origin/${{ github.event.pull_request.base.ref }}" fi echo BRANCH_HEAD="$branch_head" >> "$GITHUB_ENV" echo BRANCH_BASE="$branch_base" >> "$GITHUB_ENV" @@ -37,9 +37,10 @@ jobs: - name: Run tests id: linter run: | + git log -n 1 --pretty='format:%ci %h %s %d%n' # Diff against the common ancestor of the source (head) branch and the target (base) branch. echo "Diffing ${{ env.BRANCH_HEAD }} against ${{ env.BRANCH_BASE }}." - readarray -t files < <(git diff --diff-filter d --name-only origin/${{ env.BRANCH_BASE }}...) + readarray -t files < <(git diff --diff-filter d --name-only ${{ env.BRANCH_BASE }}...) if [ ${#files[@]} -eq 0 ]; then echo "::notice::No files to lint." echo "linter_ran=0" >> "$GITHUB_OUTPUT" 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..cf24e2e7691 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 { @@ -35,16 +34,22 @@ DECLARE_SOA_COLUMN(Y, y, float); DECLARE_SOA_COLUMN(IsAlive, isAlive, bool); DECLARE_SOA_COLUMN(IsPrimary, isPrimary, bool); +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Mother0, mother0, int, "McPartsWithDau_Mother0"); //! Track index of the first mother +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Mother1, mother1, int, "McPartsWithDau_Mother1"); //! Track index of the last mother +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Daughter0, daughter0, int, "McPartsWithDau_Daughter0"); //! Track index of the first daugther +DECLARE_SOA_SELF_INDEX_COLUMN_FULL(Daughter1, daughter1, int, "McPartsWithDau_Daughter1"); //! Track index of the last daugther +DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Mothers, mothers); //! Mother tracks (possible empty) array. Iterate over mcParticle.mothers_as()) +DECLARE_SOA_SELF_SLICE_INDEX_COLUMN(Daughters, daughters); //! Daughter tracks (possibly empty) slice. Check for non-zero with mcParticle.has_daughters(). Iterate over mcParticle.daughters_as()) } // namespace otfmcparticle -DECLARE_SOA_TABLE_FULL(McPartsWithDau, "McPartsWithDau", "AOD", "MCPARTSWITHDAU", +DECLARE_SOA_TABLE_FULL(McPartWithDaus, "McPartWithDaus", "AOD", "MCPARTSWITHDAU", o2::soa::Index<>, mcparticle::McCollisionId, mcparticle::PdgCode, mcparticle::StatusCode, mcparticle::Flags, - mcparticle::MothersIds, - mcparticle::DaughtersIdSlice, + otfmcparticle::MothersIds, + otfmcparticle::DaughtersIdSlice, mcparticle::Weight, mcparticle::Px, mcparticle::Py, @@ -69,7 +74,18 @@ DECLARE_SOA_TABLE_FULL(McPartsWithDau, "McPartsWithDau", "AOD", "MCPARTSWITHDAU" mcparticle::GetProcess, mcparticle::IsPhysicalPrimary); -using McPartWithDau = McPartsWithDau::iterator; +using McPartWithDau = McPartWithDaus::iterator; + +namespace otfmctracklable +{ +DECLARE_SOA_INDEX_COLUMN(McPartWithDau, mcPartWithDau); //! MC particle +DECLARE_SOA_COLUMN(McMask, mcMask, uint16_t); //! Bit mask to indicate detector mismatches (bit ON means mismatch). Bit 0-6: mismatch at ITS layer. Bit 12: ITSAB tracklet mismatch. Bit 13: ITS-TPC mismatch. Bit 14: isNoise == True (global track), Bit 15: isFake == True (global track) +} // namespace otfmctracklable + +DECLARE_SOA_TABLE(McTrackWithDauLabels, "AOD", "MCTRACKWithDAULABEL", //! Table joined to the track table containing the MC index + otfmctracklable::McPartWithDauId, otfmctracklable::McMask); + +using McTrackWithDauLabel = McTrackWithDauLabels::iterator; } // 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/drawFastTracker.C b/ALICE3/Macros/drawFastTracker.C index f15ebaacc68..71f44970d37 100644 --- a/ALICE3/Macros/drawFastTracker.C +++ b/ALICE3/Macros/drawFastTracker.C @@ -75,7 +75,7 @@ void drawFastTracker(float magneticField = 5.f, // in units of kGauss fastTracker.AddLayer("B11", 100., 250, x0OB, xrhoOB, resRPhiOB, resZOB, eff, 1); } else { std::vector pixelRes{0.025, 0.025, 0.01, 0.01}; - fastTracker.AddSiliconALICE3v4(pixelRes); + // fastTracker.AddSiliconALICE3v4(pixelRes); // FIXME } fastTracker.Print(); diff --git a/ALICE3/Macros/testFastTracker.C b/ALICE3/Macros/testFastTracker.C index f9ec72e0765..68d416295a8 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") { @@ -28,7 +27,7 @@ void testFastTracker(std::string geometryFile = "a3geo.ini") // auto& ccdb = o2::ccdb::BasicCCDBManager::instance(); // ccdb.setURL("http://alice-ccdb.cern.ch"); o2::fastsim::FastTracker fastTracker; - fastTracker.AddGenericDetector(geometryFile); + // fastTracker.AddGenericDetector(geometryFile); // FIXME // fastTracker.AddGenericDetector(geometryFile, &ccdb); fastTracker.Print(); } diff --git a/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx b/ALICE3/TableProducer/OTF/onTheFlyDecayer.cxx index 366ffb6a290..da4988d5648 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 @@ -59,7 +72,7 @@ static const std::vector pdgCodes{kK0Short, kOmegaPlusBar}; struct OnTheFlyDecayer { - Produces tableMcParticlesWithDau; + Produces tableMcParticlesWithDau; o2::upgrade::Decayer decayer; Service pdgDB; 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..0be208dbdb7 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; @@ -86,6 +124,7 @@ struct OnTheFlyTracker { Produces tableStoredTracksCov; Produces tableTracksCovExtension; Produces tableMcTrackLabels; + Produces tableMcTrackWithDauLabels; Produces tableTracksDCA; Produces tableTracksDCACov; Produces tableCollisionsAlice3; @@ -1833,7 +1872,7 @@ struct OnTheFlyTracker { } } - void processConfigurationDev(aod::McCollision const& mcCollision, aod::McPartsWithDau const& mcParticles, const int icfg) + void processConfigurationDev(aod::McCollision const& mcCollision, aod::McPartWithDaus const& mcParticles, const int icfg) { // const int lastTrackIndex = tableStoredTracksCov.lastIndex() + 1; // bookkeep the last added track const std::string histPath = "Configuration_" + std::to_string(icfg) + "/"; @@ -2027,7 +2066,7 @@ struct OnTheFlyTracker { trackParCov.getSigmaSnpZ(), trackParCov.getSigmaSnp2(), trackParCov.getSigmaTglY(), trackParCov.getSigmaTglZ(), trackParCov.getSigmaTglSnp(), trackParCov.getSigmaTgl2(), trackParCov.getSigma1PtY(), trackParCov.getSigma1PtZ(), trackParCov.getSigma1PtSnp(), trackParCov.getSigma1PtTgl(), trackParCov.getSigma1Pt2()); - tableMcTrackLabels(trackParCov.mcLabel, 0); + tableMcTrackWithDauLabels(trackParCov.mcLabel, 0); tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits); // populate extra tables if required to do so @@ -2073,7 +2112,7 @@ struct OnTheFlyTracker { trackParCov.getSigmaSnpZ(), trackParCov.getSigmaSnp2(), trackParCov.getSigmaTglY(), trackParCov.getSigmaTglZ(), trackParCov.getSigmaTglSnp(), trackParCov.getSigmaTgl2(), trackParCov.getSigma1PtY(), trackParCov.getSigma1PtZ(), trackParCov.getSigma1PtSnp(), trackParCov.getSigma1PtTgl(), trackParCov.getSigma1Pt2()); - tableMcTrackLabels(trackParCov.mcLabel, 0); + tableMcTrackWithDauLabels(trackParCov.mcLabel, 0); tableTracksExtraA3(trackParCov.nSiliconHits, trackParCov.nTPCHits); // populate extra tables if required to do so @@ -2091,7 +2130,7 @@ struct OnTheFlyTracker { } } - void processDecayer(aod::McCollision const& mcCollision, aod::McPartsWithDau const& mcParticles) + void processDecayer(aod::McCollision const& mcCollision, aod::McPartWithDaus const& mcParticles) { for (size_t icfg = 0; icfg < mSmearer.size(); ++icfg) { processConfigurationDev(mcCollision, mcParticles, static_cast(icfg)); 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..e96db585c25 100644 --- a/ALICE3/TableProducer/alice3strangenessFinder.cxx +++ b/ALICE3/TableProducer/alice3strangenessFinder.cxx @@ -22,6 +22,7 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "ALICE3/Core/TrackUtilities.h" +#include "ALICE3/DataModel/OTFMCParticle.h" #include "ALICE3/DataModel/OTFPIDTrk.h" #include "ALICE3/DataModel/OTFRICH.h" #include "ALICE3/DataModel/OTFStrangeness.h" @@ -31,18 +32,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 @@ -52,8 +65,10 @@ using namespace o2::framework; using namespace o2::constants::physics; using Alice3TracksWPid = soa::Join; -using Alice3Tracks = soa::Join; +using Alice3TracksACTS = soa::Join; +using Alice3TracksOTF = soa::Join; using Alice3MCParticles = soa::Join; + struct Alice3strangenessFinder { SliceCache cache; @@ -69,6 +84,13 @@ struct Alice3strangenessFinder { Configurable nSigmaTOF{"nSigmaTOF", 5.0f, "Nsigma for TOF PID (if enabled)"}; Configurable dcaXYconstant{"dcaXYconstant", -1.0f, "[0] in |DCAxy| > [0]+[1]/pT"}; Configurable dcaXYpTdep{"dcaXYpTdep", 0.0, "[1] in |DCAxy| > [0]+[1]/pT"}; + + ConfigurableAxis axisK0Mass{"axisK0Mass", {200, 0.4f, 0.6f}, "K0 mass axis"}; + ConfigurableAxis axisLambdaMass{"axisLambdaMass", {200, 1.101f, 1.131f}, "Lambda mass axis"}; + ConfigurableAxis axisXiMass{"axisXiMass", {200, 1.22f, 1.42f}, "Xi mass axis"}; + ConfigurableAxis axisMassOmega{"axisMassOmega", {200, 1.57f, 1.77f}, "Omega mass axis"}; + + ConfigurableAxis axisEta{"axisEta", {80, -4.f, 4.f}, "Eta axis"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.025f, 0.05f, 0.075f, 0.1f, 0.125f, 0.15f, 0.175f, 0.2f, 0.225f, 0.25f, 0.275f, 0.3f, 0.325f, 0.35f, 0.375f, 0.4f, 0.425f, 0.45f, 0.475f, 0.5f, 0.525f, 0.55f, 0.575f, 0.6f, 0.625f, 0.65f, 0.675f, 0.7f, 0.725f, 0.75f, 0.775f, 0.8f, 0.82f, 0.85f, 0.875f, 0.9f, 0.925f, 0.95f, 0.975f, 1.0f, 1.05f, 1.1f}, "pt axis for QA histograms"}; Configurable bachMinConstDCAxy{"bachMinConstDCAxy", -1.0f, "[0] in |DCAxy| > [0]+[1]/pT"}; @@ -76,26 +98,36 @@ struct Alice3strangenessFinder { Configurable bachMinConstDCAz{"bachMinConstDCAz", -1.0f, "[0] in |DCAz| > [0]+[1]/pT"}; Configurable bachMinPtDepDCAz{"bachMinPtDepDCAz", 0.0, "[1] in |DCAz| > [0]+[1]/pT"}; - // Vertexing - Configurable propagateToPCA{"propagateToPCA", false, "create tracks version propagated to PCA"}; - Configurable useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"}; - Configurable useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; - Configurable maxR{"maxR", 150., "reject PCA's above this radius"}; - Configurable maxDZIni{"maxDZIni", 5, "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; - Configurable maxDXYIni{"maxDXYIni", 4, "reject (if>0) PCA candidate if tracks DXY exceeds threshold"}; - Configurable maxVtxChi2{"maxVtxChi2", 10, "reject (if>0) vtx. chi2 above this value"}; - Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any X is smaller than this"}; - Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; + Configurable v0MaxDauDCA{"v0MaxDauDCA", 0.005f, "DCA between v0 daughters (cm)"}; + Configurable cascMaxDauDCA{"cascMaxDauDCA", 0.005f, "DCA between cascade daughters (cm)"}; + + // DCA Fitter + struct : ConfigurableGroup { + std::string prefix = "cfgFitter"; + + // Vertexing + Configurable propagateToPCA{"propagateToPCA", false, "create tracks version propagated to PCA"}; + Configurable useAbsDCA{"useAbsDCA", true, "Minimise abs. distance rather than chi2"}; + Configurable useWeightedFinalPCA{"useWeightedFinalPCA", false, "Recalculate vertex position using track covariances, effective only if useAbsDCA is true"}; + Configurable maxR{"maxR", 150., "reject PCA's above this radius"}; + Configurable maxDZIni{"maxDZIni", 5, "reject (if>0) PCA candidate if tracks DZ exceeds threshold"}; + Configurable maxDXYIni{"maxDXYIni", 4, "reject (if>0) PCA candidate if tracks DXY exceeds threshold"}; + Configurable maxVtxChi2{"maxVtxChi2", 10, "reject (if>0) vtx. chi2 above this value"}; + Configurable minParamChange{"minParamChange", 1.e-3, "stop iterations if largest change of any X is smaller than this"}; + Configurable minRelChi2Change{"minRelChi2Change", 0.9, "stop iterations is chi2/chi2old > this"}; + + // propagation options + Configurable usePropagator{"usePropagator", false, "use external propagator"}; + Configurable refitWithMatCorr{"refitWithMatCorr", false, "refit V0 applying material corrections"}; + Configurable useCollinearV0{"useCollinearV0", true, "use collinear approximation for V0 fitting"}; + Configurable maxIter{"maxIter", 30, "maximum number of iterations for vertex fitter"}; + } cfgFitter; + Configurable acceptedLambdaMassWindow{"acceptedLambdaMassWindow", 0.2f, "accepted Lambda mass window around PDG mass"}; // Operation Configurable magneticField{"magneticField", 20.0f, "Magnetic field (in kilogauss)"}; Configurable mcSameMotherCheck{"mcSameMotherCheck", true, "check if tracks come from the same MC mother"}; - // propagation options - Configurable usePropagator{"usePropagator", false, "use external propagator"}; - Configurable refitWithMatCorr{"refitWithMatCorr", false, "refit V0 applying material corrections"}; - Configurable useCollinearV0{"useCollinearV0", true, "use collinear approximation for V0 fitting"}; - Configurable maxIter{"maxIter", 30, "maximum number of iterations for vertex fitter"}; // for the ACTS study Configurable isK0Gun{"isK0Gun", false, "is K0s Monte Carlo gun used"}; @@ -108,15 +140,32 @@ struct Alice3strangenessFinder { Service pdgDB; - // partitions for D mesons - Partition positiveSecondaryTracks = + // partitions for v0/casc dau tracks + Partition positiveSecondaryTracksACTS = aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition negativeSecondaryTracks = + Partition negativeSecondaryTracksACTS = aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); - Partition bachelorTracks = + Partition bachelorTracksACTS = nabs(aod::track::dcaXY) > bachMinConstDCAxy + bachMinPtDepDCAxy* nabs(aod::track::signed1Pt) && nabs(aod::track::dcaZ) > bachMinConstDCAz + bachMinPtDepDCAz* nabs(aod::track::signed1Pt); + + Partition positiveSecondaryTracksOTF = + aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); + Partition negativeSecondaryTracksOTF = + aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); + Partition bachelorTracksOTF = + nabs(aod::track::dcaXY) > bachMinConstDCAxy + bachMinPtDepDCAxy* nabs(aod::track::signed1Pt) && nabs(aod::track::dcaZ) > bachMinConstDCAz + bachMinPtDepDCAz* nabs(aod::track::signed1Pt); + Partition positiveMCParticles = aod::mcparticle_alice3::charge > 0.0f; Partition negativeMCParticles = aod::mcparticle_alice3::charge < 0.0f; + + Partition trueK0s = aod::mcparticle::pdgCode == static_cast(PDG_t::kK0Short); + Partition trueLambda = aod::mcparticle::pdgCode == static_cast(PDG_t::kLambda0); + Partition trueAntiLambda = aod::mcparticle::pdgCode == static_cast(PDG_t::kLambda0Bar); + Partition trueXi = aod::mcparticle::pdgCode == static_cast(PDG_t::kXiMinus); + Partition trueAntiXi = aod::mcparticle::pdgCode == static_cast(PDG_t::kXiPlusBar); + Partition trueOmega = aod::mcparticle::pdgCode == static_cast(PDG_t::kOmegaMinus); + Partition trueAntiOmega = aod::mcparticle::pdgCode == static_cast(PDG_t::kOmegaPlusBar); + // Partition negativeSecondaryPions = nabs(aod::upgrade_tof::nSigmaPionInnerTOF) < nSigmaTOF && nabs(aod::upgrade_tof::nSigmaPionOuterTOF) < nSigmaTOF && aod::track::signed1Pt < 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); // Partition positiveSecondaryPions = nabs(aod::upgrade_tof::nSigmaPionInnerTOF) < nSigmaTOF && nabs(aod::upgrade_tof::nSigmaPionOuterTOF) < nSigmaTOF && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); // Partition secondaryProtons = nabs(aod::upgrade_tof::nSigmaProtonInnerTOF) < nSigmaTOF && nabs(aod::upgrade_tof::nSigmaProtonOuterTOF) < nSigmaTOF && aod::track::signed1Pt > 0.0f && nabs(aod::track::dcaXY) > dcaXYconstant + dcaXYpTdep* nabs(aod::track::signed1Pt); @@ -139,18 +188,18 @@ struct Alice3strangenessFinder { { // Initialization code here fitter.setBz(magneticField); - fitter.setUseAbsDCA(useAbsDCA); - fitter.setPropagateToPCA(propagateToPCA); - fitter.setMaxR(maxR); - fitter.setMinParamChange(minParamChange); - fitter.setMinRelChi2Change(minRelChi2Change); - fitter.setMaxDZIni(maxDZIni); - fitter.setMaxDXYIni(maxDXYIni); - fitter.setMaxChi2(maxVtxChi2); - fitter.setUsePropagator(usePropagator); - fitter.setRefitWithMatCorr(refitWithMatCorr); - fitter.setCollinear(useCollinearV0); - fitter.setMaxIter(maxIter); + fitter.setUseAbsDCA(cfgFitter.useAbsDCA); + fitter.setPropagateToPCA(cfgFitter.propagateToPCA); + fitter.setMaxR(cfgFitter.maxR); + fitter.setMinParamChange(cfgFitter.minParamChange); + fitter.setMinRelChi2Change(cfgFitter.minRelChi2Change); + fitter.setMaxDZIni(cfgFitter.maxDZIni); + fitter.setMaxDXYIni(cfgFitter.maxDXYIni); + fitter.setMaxChi2(cfgFitter.maxVtxChi2); + fitter.setUsePropagator(cfgFitter.usePropagator); + fitter.setRefitWithMatCorr(cfgFitter.refitWithMatCorr); + fitter.setCollinear(cfgFitter.useCollinearV0); + fitter.setMaxIter(cfgFitter.maxIter); fitter.setMatCorrType(o2::base::Propagator::MatCorrType::USEMatCorrNONE); histos.add("hFitterQA", "", kTH1D, {{10, 0, 10}}); // For QA reasons, counting found candidates at different stages @@ -186,14 +235,29 @@ struct Alice3strangenessFinder { hV0Counter->GetXaxis()->SetBinLabel(3, "AntiLambda"); hV0Counter->GetXaxis()->SetBinLabel(4, "Misidentified"); - auto hCascadeCounter = histos.add("hCascadeCounter", "hCascadeCounter", kTH1D, {{5, 0, 5}}); - hCascadeCounter->GetXaxis()->SetBinLabel(1, "Xi"); - hCascadeCounter->GetXaxis()->SetBinLabel(2, "AntiXi"); - hCascadeCounter->GetXaxis()->SetBinLabel(3, "Omega"); - hCascadeCounter->GetXaxis()->SetBinLabel(4, "AntiOmega"); - hCascadeCounter->GetXaxis()->SetBinLabel(5, "Misidentified"); histos.add("hRadiusVsHitsNeg", "", kTH2D, {{400, 0, 400}, {12, 0.5, 12.5}}); // radius vs hist for MC studies histos.add("hRadiusVsHitsPos", "", kTH2D, {{400, 0, 400}, {12, 0.5, 12.5}}); // radius vs hist for MC studies + + auto hV0Building = histos.add("hV0Building", "hV0Building", kTH1D, {{10, 0.5, 10.5}}); + hV0Building->GetXaxis()->SetBinLabel(1, "Pair"); + hV0Building->GetXaxis()->SetBinLabel(2, "Pdg check"); + hV0Building->GetXaxis()->SetBinLabel(3, "DCA Fitter"); + + auto hCascadeBuilding = histos.add("hCascadeBuilding", "hCascadeBuilding", kTH1D, {{10, 0.5, 10.5}}); + hCascadeBuilding->GetXaxis()->SetBinLabel(1, "Attempts"); + hCascadeBuilding->GetXaxis()->SetBinLabel(2, "La mass window"); + hCascadeBuilding->GetXaxis()->SetBinLabel(3, "DCA Fitter"); + + if (doprocessGenerated) { + histos.add("hGeneratedK0s", "hGeneratedK0s", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedLambda", "hGeneratedLambda", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedAntiLambda", "hGeneratedAntiLambda", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedXi", "hGeneratedXi", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedAntiXi", "hGeneratedAntiXi", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedOmega", "hGeneratedOmega", kTH2D, {{axisPt}, {axisEta}}); + histos.add("hGeneratedAntiOmega", "hGeneratedAntiOmega", kTH2D, {{axisPt}, {axisEta}}); + } + histos.print(); } @@ -206,22 +270,34 @@ struct Alice3strangenessFinder { template bool checkSameMother(TTrackType const& track1, TTrackType const& track2) { - bool returnValue = false; - // Association check - if (track1.has_mcParticle() && track2.has_mcParticle()) { - auto mcParticle1 = track1.template mcParticle_as(); - auto mcParticle2 = track2.template mcParticle_as(); - if (mcParticle1.has_mothers() && mcParticle2.has_mothers()) { - for (const auto& mcParticleMother1 : mcParticle1.template mothers_as()) { - for (const auto& mcParticleMother2 : mcParticle2.template mothers_as()) { - if (mcParticleMother1.globalIndex() == mcParticleMother2.globalIndex()) { - returnValue = true; + // MC label points to McPartWithDaus + if constexpr (requires { track1.has_mcPartWithDau(); }) { + if (!track1.has_mcPartWithDau() || !track2.has_mcPartWithDau()) { + return false; + } + auto mcParticle1 = track1.template mcPartWithDau_as(); + auto mcParticle2 = track2.template mcPartWithDau_as(); + if (mcParticle1.mothersIds().empty() || mcParticle2.mothersIds().empty()) { + return false; + } + return mcParticle1.mothersIds()[0] == mcParticle2.mothersIds()[0]; + } else { // MC label points directly to aod::McParticles + bool returnValue = false; + if (track1.has_mcParticle() && track2.has_mcParticle()) { + auto mcParticle1 = track1.template mcParticle_as(); + auto mcParticle2 = track2.template mcParticle_as(); + if (mcParticle1.has_mothers() && mcParticle2.has_mothers()) { + for (const auto& m1 : mcParticle1.template mothers_as()) { + for (const auto& m2 : mcParticle2.template mothers_as()) { + if (m1.globalIndex() == m2.globalIndex()) { + returnValue = true; + } } } } } - } // end association check - return returnValue; + return returnValue; + } } template @@ -247,13 +323,13 @@ struct Alice3strangenessFinder { histos.fill(HIST("hFitterStatusCode"), fitterStatusCode); histos.fill(HIST("hFitterQA"), 1.5); if (nCand == 0) { - LOG(info) << "0 candidates found by fitter"; + LOG(debug) << "0 candidates found by fitter"; return false; } histos.fill(HIST("hFitterQA"), 2.5); //}-{}-{}-{}-{}-{}-{}-{}-{}-{} if (!fitter.isPropagateTracksToVertexDone() && !fitter.propagateTracksToVertex()) { - LOG(info) << "RejProp failed"; + LOG(debug) << "RejProp failed"; return false; } histos.fill(HIST("hFitterQA"), 3.5); @@ -330,40 +406,88 @@ struct Alice3strangenessFinder { } } - void processFindV0CandidateNoPid(aod::Collision const& collision, Alice3Tracks const&, aod::McParticles const&) + void processGenerated(aod::McParticles const&) { - auto negativeSecondaryTracksGrouped = negativeSecondaryTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - auto positiveSecondaryTracksGrouped = positiveSecondaryTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - auto bachelorTracksGrouped = bachelorTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); - const std::array vtx = {collision.posX(), collision.posY(), collision.posZ()}; + for (const auto& mcParticle : trueK0s) { + histos.fill(HIST("hGeneratedK0s"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueLambda) { + histos.fill(HIST("hGeneratedLambda"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueAntiLambda) { + histos.fill(HIST("hGeneratedAntiLambda"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueXi) { + histos.fill(HIST("hGeneratedXi"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueAntiXi) { + histos.fill(HIST("hGeneratedAntiXi"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueOmega) { + histos.fill(HIST("hGeneratedOmega"), mcParticle.pt(), mcParticle.eta()); + } + for (const auto& mcParticle : trueAntiOmega) { + histos.fill(HIST("hGeneratedAntiOmega"), mcParticle.pt(), mcParticle.eta()); + } + } + template + void processFindV0CandidateNoPid(TCollision collision, TTracksGrouped negTracksGrouped, TTracksGrouped posTracksGrouped, TTracksGrouped bachTracksGrouped) + { + const std::array vtx = {collision.posX(), collision.posY(), collision.posZ()}; histos.fill(HIST("hEventCounter"), 1.0); - for (auto const& posTrack : positiveSecondaryTracksGrouped) { + for (auto const& posTrack : posTracksGrouped) { if (!posTrack.isReconstructed()) { continue; // no ghost tracks } o2::track::TrackParCov pos = getTrackParCov(posTrack); - for (auto const& negTrack : negativeSecondaryTracksGrouped) { + for (auto const& negTrack : negTracksGrouped) { if (!negTrack.isReconstructed()) { continue; // no ghost tracks } + histos.fill(HIST("hV0Building"), 1.0); if (mcSameMotherCheck && !checkSameMother(posTrack, negTrack)) { continue; // keep only if same mother } - if ((posTrack.pdgCode() != kPiPlus && negTrack.pdgCode() != kPiMinus) && isK0Gun) - continue; - if ((posTrack.pdgCode() != kProton && negTrack.pdgCode() != kPiMinus) && isLambdaGun) - continue; + + // ACTS: pdg code attached to track + if constexpr (requires { posTrack.pdgCode(); }) { + if ((posTrack.pdgCode() != kPiPlus && negTrack.pdgCode() != kPiMinus) && isK0Gun) { + continue; + } + if ((posTrack.pdgCode() != kProton && negTrack.pdgCode() != kPiMinus) && isLambdaGun) { + continue; + } + } + + // OTF: pdg code from mcParticle table + if constexpr (requires { posTrack.has_mcPartWithDau(); }) { + if (!posTrack.has_mcPartWithDau() && !negTrack.has_mcPartWithDau()) { + continue; + } + auto mcParticlePos = posTrack.template mcPartWithDau_as(); + auto mcParticleNeg = negTrack.template mcPartWithDau_as(); + if ((mcParticlePos.pdgCode() != kPiPlus && mcParticleNeg.pdgCode() != kPiMinus) && isK0Gun) { + continue; + } + if ((mcParticlePos.pdgCode() != kProton && mcParticleNeg.pdgCode() != kPiMinus) && isLambdaGun) { + continue; + } + } + + histos.fill(HIST("hV0Building"), 2.0); o2::track::TrackParCov neg = getTrackParCov(negTrack); Candidate v0cand; if (!buildDecayCandidateTwoBody(pos, neg, vtx, v0cand)) { continue; // failed at building candidate } + histos.fill(HIST("hV0Building"), 3.0); + // TODO: not all ACTS tracks have MC association, so this check is not possible for all candidates, fix is needed // auto mcParticle1 = posTrack.template mcParticle_as(); // if (mcParticle1.pdgCode() == kK0Short) { @@ -396,19 +520,22 @@ struct Alice3strangenessFinder { std::array{v0cand.pDau1[0], v0cand.pDau1[1], v0cand.pDau1[2]}}, std::array{o2::constants::physics::MassPionCharged, o2::constants::physics::MassProton}); - const bool inLambdaMassWindow = std::abs(lambdaMassHypothesis - o2::constants::physics::MassLambda0) < acceptedLambdaMassWindow; - const bool inAntiLambdaMassWindow = std::abs(antiLambdaMassHypothesis - o2::constants::physics::MassLambda0) < acceptedLambdaMassWindow; if (!buildCascade) { continue; // not building cascades, so skip the rest } + + const bool inLambdaMassWindow = std::abs(lambdaMassHypothesis - o2::constants::physics::MassLambda0) < acceptedLambdaMassWindow; + const bool inAntiLambdaMassWindow = std::abs(antiLambdaMassHypothesis - o2::constants::physics::MassLambda0) < acceptedLambdaMassWindow; if (!inLambdaMassWindow && !inAntiLambdaMassWindow) { continue; // Likely not a lambda, should not be considered for cascade building } - for (const auto& bachTrack : bachelorTracksGrouped) { + + for (const auto& bachTrack : bachTracksGrouped) { if (bachTrack.globalIndex() == posTrack.globalIndex() || bachTrack.globalIndex() == negTrack.globalIndex()) { continue; // avoid using any track that was already used } + histos.fill(HIST("hCascadeBuilding"), 1.0); if (inLambdaMassWindow && bachTrack.sign() > 0) { continue; // only consider lambda and neg bach track } @@ -417,6 +544,8 @@ struct Alice3strangenessFinder { continue; // only consider anti-lambda and pos bach track } + histos.fill(HIST("hCascadeBuilding"), 2.0); + // TODO mc same mother check Candidate cascCand; @@ -424,6 +553,7 @@ struct Alice3strangenessFinder { if (!buildDecayCandidateTwoBody(v0, bach, vtx, cascCand)) { continue; // failed at building candidate } + histos.fill(HIST("hCascadeBuilding"), 3.0); const float massXi = RecoDecay::m(std::array{std::array{cascCand.pDau0[0], cascCand.pDau0[1], cascCand.pDau0[2]}, std::array{cascCand.pDau1[0], cascCand.pDau1[1], cascCand.pDau1[2]}}, @@ -433,12 +563,6 @@ struct Alice3strangenessFinder { std::array{cascCand.pDau1[0], cascCand.pDau1[1], cascCand.pDau1[2]}}, std::array{o2::constants::physics::MassLambda, o2::constants::physics::MassKaonCharged}); - tableCascadeIndices(0, // cascade index, dummy value - posTrack.globalIndex(), - negTrack.globalIndex(), - bachTrack.globalIndex(), - collision.globalIndex()); - const float dcaPosToPV = calculateDCAStraightToPV(posTrack.x(), posTrack.y(), posTrack.z(), posTrack.px(), posTrack.py(), posTrack.pz(), vtx[0], vtx[1], vtx[2]); @@ -451,6 +575,12 @@ struct Alice3strangenessFinder { bachTrack.px(), bachTrack.py(), bachTrack.pz(), vtx[0], vtx[1], vtx[2]); + tableCascadeIndices(0, // cascade index, dummy value + posTrack.globalIndex(), + negTrack.globalIndex(), + bachTrack.globalIndex(), + collision.globalIndex()); + tableCascadeCores(bachTrack.sign(), massXi, massOm, cascCand.posSV[0], cascCand.posSV[1], cascCand.posSV[2], v0cand.posSV[0], v0cand.posSV[1], v0cand.posSV[2], @@ -461,23 +591,11 @@ struct Alice3strangenessFinder { v0cand.dcaDau, cascCand.dcaDau, dcaPosToPV, dcaNegToPV, dcaBachToPV, cascCand.dcaToPV, cascCand.dcaToPV); - - auto mcParticle2 = bachTrack.template mcParticle_as(); - if (mcParticle2.pdgCode() == PDG_t::kXiMinus) { - histos.fill(HIST("hCascadeCounter"), 0.5); - } else if (mcParticle2.pdgCode() == PDG_t::kXiPlusBar) { - histos.fill(HIST("hCascadeCounter"), 1.5); - } else if (mcParticle2.pdgCode() == PDG_t::kOmegaMinus) { - histos.fill(HIST("hCascadeCounter"), 2.5); - } else if (mcParticle2.pdgCode() == PDG_t::kOmegaPlusBar) { - histos.fill(HIST("hCascadeCounter"), 3.5); - } else { - histos.fill(HIST("hCascadeCounter"), 4.5); - } } // end bachTrack } // end negTrack } // end posTrack } + void processMCTrueFromACTS(aod::McCollision const& collision, Alice3MCParticles const&) { @@ -555,13 +673,31 @@ struct Alice3strangenessFinder { // auto secondaryProtonsGrouped = secondaryProtons->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); // auto secondaryAntiProtonsGrouped = secondaryAntiProtons->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); // } - PROCESS_SWITCH(Alice3strangenessFinder, processFindV0CandidateNoPid, "find V0 without PID", true); + + void processFindV0CandidateACTS(aod::Collision const& collision, Alice3TracksACTS const&, aod::McParticles const&) + { + auto negTracksGrouped = negativeSecondaryTracksACTS->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto posTracksGrouped = positiveSecondaryTracksACTS->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto bachTracksGrouped = bachelorTracksACTS->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + processFindV0CandidateNoPid(collision, negTracksGrouped, posTracksGrouped, bachTracksGrouped); + } + + void processFindV0CandidateOTF(aod::Collision const& collision, Alice3TracksOTF const&, aod::McPartWithDaus const&) + { + auto negTracksGrouped = negativeSecondaryTracksOTF->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto posTracksGrouped = positiveSecondaryTracksOTF->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto bachTracksGrouped = bachelorTracksOTF->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + processFindV0CandidateNoPid(collision, negTracksGrouped, posTracksGrouped, bachTracksGrouped); + } + + PROCESS_SWITCH(Alice3strangenessFinder, processGenerated, "process generated information", true); + PROCESS_SWITCH(Alice3strangenessFinder, processFindV0CandidateACTS, "find V0 without PID from ACTS reconstruction", true); + PROCESS_SWITCH(Alice3strangenessFinder, processFindV0CandidateOTF, "find V0 without PID from OTF simulations", false); PROCESS_SWITCH(Alice3strangenessFinder, processMCTrueFromACTS, "process MC truth from ACTS", false); // PROCESS_SWITCH(alice3strangenessFinder, processFindV0CandidateWithPid, "find V0 with PID", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } 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..cf1c369d17f 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; @@ -60,11 +62,11 @@ struct Alice3DecayerQA { Partition trueKa = aod::mcparticle::pdgCode == static_cast(kKMinus); Partition truePr = aod::mcparticle::pdgCode == static_cast(kProton); - Partition trueElWithDau = aod::mcparticle::pdgCode == static_cast(kElectron); - Partition trueMuWithDau = aod::mcparticle::pdgCode == static_cast(kMuonMinus); - Partition truePiWithDau = aod::mcparticle::pdgCode == static_cast(kPiPlus); - Partition trueKaWithDau = aod::mcparticle::pdgCode == static_cast(kKMinus); - Partition truePrWithDau = aod::mcparticle::pdgCode == static_cast(kProton); + Partition trueElWithDau = aod::mcparticle::pdgCode == static_cast(kElectron); + Partition trueMuWithDau = aod::mcparticle::pdgCode == static_cast(kMuonMinus); + Partition truePiWithDau = aod::mcparticle::pdgCode == static_cast(kPiPlus); + Partition trueKaWithDau = aod::mcparticle::pdgCode == static_cast(kKMinus); + Partition truePrWithDau = aod::mcparticle::pdgCode == static_cast(kProton); void init(o2::framework::InitContext&) { @@ -123,7 +125,7 @@ struct Alice3DecayerQA { } } - void processMCWithDau(const aod::McCollision&, const aod::McPartsWithDau& particles) + void processMCWithDau(const aod::McCollision&, const aod::McPartWithDaus& particles) { for (const auto& particle : trueElWithDau) { histos.fill(HIST("MCWithDau/hElPt"), particle.pt()); 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..7527db49495 100644 --- a/ALICE3/Tasks/alice3Strangeness.cxx +++ b/ALICE3/Tasks/alice3Strangeness.cxx @@ -20,44 +20,37 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "ALICE3/DataModel/OTFCollision.h" +#include "ALICE3/DataModel/OTFMCParticle.h" #include "ALICE3/DataModel/OTFStrangeness.h" #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; using namespace o2::framework; using namespace o2::constants::math; -using Alice3Tracks = soa::Join; +using Alice3Tracks = soa::Join; using FullV0Candidates = soa::Join; using FullCascadeCandidates = soa::Join; using FullCollisions = soa::Join; 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/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx b/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx index c87fd48bc99..444406a6c42 100644 --- a/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx +++ b/DPG/Tasks/AOTEvent/dEdxVsOccupancyWithTrackQAinfo.cxx @@ -14,30 +14,29 @@ /// /// \author Igor Altsybeev -#include -#include - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/HistogramRegistry.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/Centrality.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TH3.h" +#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/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx b/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx index 3fc293c7e84..a79bd82a5c3 100644 --- a/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/detectorOccupancyQa.cxx @@ -16,27 +16,32 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.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 "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "TH1F.h" -#include "TH2F.h" -#include "TH3.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/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx b/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx index e87ca9c73f3..b85b1d3b42c 100644 --- a/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx +++ b/DPG/Tasks/AOTEvent/lightIonsEvSelQa.cxx @@ -15,30 +15,28 @@ /// \author Igor Altsybeev #include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -// #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsFT0/RecPoints.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "TH1F.h" -#include "TH2F.h" -#include "TH3.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include #include #include diff --git a/DPG/Tasks/AOTEvent/lumiQa.cxx b/DPG/Tasks/AOTEvent/lumiQa.cxx index 35ef282650b..f03419fff52 100644 --- a/DPG/Tasks/AOTEvent/lumiQa.cxx +++ b/DPG/Tasks/AOTEvent/lumiQa.cxx @@ -9,17 +9,31 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include #include - -#include "TH1.h" -#include "TList.h" +#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/DPG/Tasks/AOTEvent/matchingQa.cxx b/DPG/Tasks/AOTEvent/matchingQa.cxx index 3b266f047e9..62bece530f7 100644 --- a/DPG/Tasks/AOTEvent/matchingQa.cxx +++ b/DPG/Tasks/AOTEvent/matchingQa.cxx @@ -9,14 +9,34 @@ // 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 "Framework/HistogramRegistry.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "MetadataHelper.h" +#include "Common/Core/MetadataHelper.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/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx index cbc8d7d56d1..af9e0697922 100644 --- a/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx +++ b/DPG/Tasks/AOTEvent/rofOccupancyQa.cxx @@ -14,20 +14,27 @@ /// /// \author Igor Altsybeev -#include - -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/EventSelection.h" #include "Common/CCDB/EventSelectionParams.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "Framework/HistogramRegistry.h" -// #include "DataFormatsParameters/GRPLHCIFData.h" -#include "ITSMFTBase/DPLAlpideParam.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" +#include "Common/DataModel/EventSelection.h" + +#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/DPG/Tasks/AOTTrack/D0CalibTables.h b/DPG/Tasks/AOTTrack/D0CalibTables.h index 973582d8ba2..81e16201b63 100644 --- a/DPG/Tasks/AOTTrack/D0CalibTables.h +++ b/DPG/Tasks/AOTTrack/D0CalibTables.h @@ -16,16 +16,14 @@ #ifndef DPG_TASKS_AOTTRACK_D0CALIBTABLES_H_ #define DPG_TASKS_AOTTRACK_D0CALIBTABLES_H_ -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include #include -#include - +#include +#include #include -#include #include #include diff --git a/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx b/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx index b8fb6679b1c..648c1258127 100644 --- a/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx +++ b/DPG/Tasks/AOTTrack/MonitorFilterBit.cxx @@ -15,12 +15,29 @@ /// \brief Task performing basic checks on filter-bit selections. /// -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/Core/RecoDecay.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/ASoA.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#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/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx b/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx index 9b1d4f9c692..8ff792a860b 100644 --- a/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx +++ b/DPG/Tasks/AOTTrack/PID/Combined/qaPIDWithV0s.cxx @@ -18,19 +18,21 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.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/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx index 98ea08f7add..27451cff7e3 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidDeuteron.cxx @@ -12,10 +12,17 @@ #include "tableHMPID.h" #include +#include +#include +#include +#include +#include #include #include -#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx index 5a1f821cda2..50059151aab 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidQa.cxx @@ -11,31 +11,29 @@ #include "tableHMPID.h" -#include "Common/Core/PID/PIDTOF.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.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; diff --git a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx index f2865d65be9..e7cb03e25be 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx +++ b/DPG/Tasks/AOTTrack/PID/HMPID/hmpidTableProducer.cxx @@ -11,32 +11,26 @@ #include "tableHMPID.h" -#include "Common/Core/PID/PIDTOF.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.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/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h b/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h index dff3a00ed4f..6844da6c519 100644 --- a/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h +++ b/DPG/Tasks/AOTTrack/PID/HMPID/tableHMPID.h @@ -12,8 +12,8 @@ #ifndef DPG_TASKS_AOTTRACK_PID_HMPID_TABLEHMPID_H_ #define DPG_TASKS_AOTTRACK_PID_HMPID_TABLEHMPID_H_ -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" +#include +#include namespace o2::aod { diff --git a/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx b/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx index 8b74a7beb77..03dfe30779b 100644 --- a/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx +++ b/DPG/Tasks/AOTTrack/PID/ITS/qaPIDITS.cxx @@ -20,11 +20,30 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.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 diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx index 95f9016d388..bbe18f83730 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOF.cxx @@ -16,15 +16,27 @@ /// #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.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 using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx index a1461cb0509..2a9d59a71b0 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBeta.cxx @@ -16,15 +16,24 @@ /// #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx index 2bcccc5a67b..8a83649dbc7 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFBetaImp.cxx @@ -16,16 +16,26 @@ /// #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/TableProducer/PID/pidTOFBase.h" +#include +#include +#include #include +#include +#include #include -#include +#include +#include +#include #include +#include +#include + +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx index b9ead03b14f..c0b4e628fe2 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFEvTime.cxx @@ -21,15 +21,25 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Common/TableProducer/PID/pidTOFBase.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFT0/Digit.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" - -#include "TEfficiency.h" -#include "THashList.h" +#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/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx index 3a0f2de652f..d9ef9cd278b 100644 --- a/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TOF/qaPIDTOFMC.cxx @@ -18,10 +18,29 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.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/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx index 53c03e6c338..cbc4084e922 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPC.cxx @@ -20,10 +20,25 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.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 using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx index e05023b4b3a..8ff86797176 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCMC.cxx @@ -15,13 +15,24 @@ /// \brief Task to produce QA output of the PID with TPC running on the MC. /// -// O2 includes #include "Common/DataModel/PIDResponseTPC.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.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/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx index bf8492b8036..2c0501963b5 100644 --- a/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx +++ b/DPG/Tasks/AOTTrack/PID/TPC/qaPIDTPCSignal.cxx @@ -16,12 +16,29 @@ /// \brief Implementation for QA tasks of the TPC signal (lite task, refer to qaPIDTPC.cxx for full TPC QA for PID) /// -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Common/DataModel/TrackSelectionTables.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 using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx b/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx index 1ab36ad9f71..aa2f13ba744 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/perfK0sResolution.cxx @@ -20,10 +20,12 @@ #include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" @@ -37,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -44,15 +47,13 @@ #include #include #include -#include #include #include #include +#include #include -#include - #include #include #include diff --git a/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx b/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx index 2513ad92a91..be37adc3943 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaCascades.cxx @@ -18,21 +18,17 @@ #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/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/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx b/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx index a728b252007..ff6236ec9a9 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaEfficiencyV0s.cxx @@ -17,23 +17,26 @@ /// The efficiency for particles is computed according to the PDG code (sign included and not charge) /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/TrackSelection.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -// ROOT includes -#include "TPDGCode.h" -#include "TEfficiency.h" -#include "THashList.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include using namespace o2::framework; static constexpr int nSpecies = 2; // One per PDG diff --git a/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx b/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx index 64b84711d90..2765e7e87d9 100644 --- a/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx +++ b/DPG/Tasks/AOTTrack/V0Cascades/qaK0sTrackingEfficiency.cxx @@ -11,19 +11,24 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.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/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx b/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx index 04db9d2fd1c..33a4a2a9ed7 100644 --- a/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx +++ b/DPG/Tasks/AOTTrack/derivedDataCreatorD0Calibration.cxx @@ -25,18 +25,26 @@ #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/OccupancyTables.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/ML/MlResponse.h" -#include "CommonDataFormat/InteractionRecord.h" +#include +#include #include +#include #include +#include +#include +#include +#include #include -#include +#include +#include +#include #include #include #include @@ -46,12 +54,12 @@ #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/DPG/Tasks/AOTTrack/qaDcaMC.cxx b/DPG/Tasks/AOTTrack/qaDcaMC.cxx index 4054c59b33a..28b65bfa304 100644 --- a/DPG/Tasks/AOTTrack/qaDcaMC.cxx +++ b/DPG/Tasks/AOTTrack/qaDcaMC.cxx @@ -15,23 +15,29 @@ /// \brief Task to analyse the DCA distributions in the MC according to PDG code and status /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/TrackSelection.h" #include "Common/DataModel/EventSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" -// ROOT includes -#include "TPDGCode.h" -#include "TEfficiency.h" -#include "THashList.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/qaEventTrack.h b/DPG/Tasks/AOTTrack/qaEventTrack.h index 42cbe5455ca..edd9512c5ec 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrack.h +++ b/DPG/Tasks/AOTTrack/qaEventTrack.h @@ -17,10 +17,14 @@ /// \brief Header file for QA tasks for the track and the event properties. /// +#ifndef DPG_TASKS_AOTTRACK_QAEVENTTRACK_H_ +#define DPG_TASKS_AOTTRACK_QAEVENTTRACK_H_ + #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" +#include + +#include // Output table declaration namespace o2::aod @@ -165,3 +169,5 @@ DECLARE_SOA_TABLE(DPGNonRecoParticles, "AOD", "DPGNonRecoPart", //! Table of the dpgparticles::IsFromMaterial, mcparticle::Vx, mcparticle::Vy, mcparticle::Vz); } // namespace o2::aod + +#endif // DPG_TASKS_AOTTRACK_QAEVENTTRACK_H_ diff --git a/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx b/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx index f6812f35a8e..61938e1d348 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx +++ b/DPG/Tasks/AOTTrack/qaEventTrackLite.cxx @@ -20,25 +20,34 @@ #include "qaEventTrack.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "ReconstructionDataFormats/DCA.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "MathUtils/BetheBlochAleph.h" -#include "ReconstructionDataFormats/PID.h" - -#include "TF1.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; -using namespace o2::dataformats; // Lite version of the QA task to run on skimmed dataset struct qaEventTrackLite { diff --git a/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx b/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx index 2c2ab18a49d..8e41e7a24cc 100644 --- a/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx +++ b/DPG/Tasks/AOTTrack/qaEventTrackLiteProducer.cxx @@ -19,29 +19,27 @@ #include "qaEventTrack.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" +#include +#include +#include +#include +#include +#include -#include "TRandom.h" +#include +#include #include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; -using namespace o2::dataformats; struct QaEventTrackLiteProducer { // Tables to produce diff --git a/DPG/Tasks/AOTTrack/qaFakeHits.cxx b/DPG/Tasks/AOTTrack/qaFakeHits.cxx index 4005b0834c9..b0dc3c553cc 100644 --- a/DPG/Tasks/AOTTrack/qaFakeHits.cxx +++ b/DPG/Tasks/AOTTrack/qaFakeHits.cxx @@ -16,19 +16,26 @@ /// \brief Task to analyze the fraction of the true and fake hits depending on where the fake hits are picked /// -#include "PWGLF/DataModel/LFParticleIdentification.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 #include -#include -#include +#include + +#include +#include + +#include +#include +#include using namespace o2::framework; // Particle information diff --git a/DPG/Tasks/AOTTrack/qaMatchEff.cxx b/DPG/Tasks/AOTTrack/qaMatchEff.cxx index 4b6d3e87d13..d34c897ac55 100644 --- a/DPG/Tasks/AOTTrack/qaMatchEff.cxx +++ b/DPG/Tasks/AOTTrack/qaMatchEff.cxx @@ -80,7 +80,6 @@ using namespace o2; using namespace o2::constants::math; using namespace o2::framework; using namespace o2::framework::expressions; -using std::array; using namespace extConfPar; using o2::constants::math::PI; using o2::constants::math::TwoPI; diff --git a/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx b/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx index dd66692a4e2..2c1d251b710 100644 --- a/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx +++ b/DPG/Tasks/AOTTrack/qaPrimVtxVsTime.cxx @@ -10,18 +10,21 @@ // or submit itself to any jurisdiction. /// \author Mattia Faggin , Padova University and INFN -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/HistogramRegistry.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "TH1F.h" -#include "TH2F.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include using namespace o2::framework; using namespace o2; diff --git a/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx b/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx index e40dd0e76e9..1de78d081a2 100644 --- a/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx +++ b/DPG/Tasks/AOTTrack/qaSignChargeMC.cxx @@ -16,11 +16,19 @@ /// \since 08/05/2024 /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2::framework; diff --git a/DPG/Tasks/AOTTrack/qaTrackSelection.cxx b/DPG/Tasks/AOTTrack/qaTrackSelection.cxx index f7ea3dd2f53..6cb389b8608 100644 --- a/DPG/Tasks/AOTTrack/qaTrackSelection.cxx +++ b/DPG/Tasks/AOTTrack/qaTrackSelection.cxx @@ -16,15 +16,27 @@ /// \brief Task to check how many tracks pass the cuts /// -// O2 includes -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" #include "Common/Core/TrackSelection.h" -#include "Common/DataModel/EventSelection.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 +#include + +#include + +#include +#include + using namespace o2::framework; struct QaTrackCuts { diff --git a/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx b/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx index 3125f1e7c03..680cb819b34 100644 --- a/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx +++ b/DPG/Tasks/AOTTrack/qaTrackSplitting.cxx @@ -15,13 +15,28 @@ /// \brief Task to analyse the numbers of particles reconstructed more than once /// -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" -#include "Common/DataModel/EventSelection.h" +#include "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 +#include + +#include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx b/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx index dd5a969e458..842f167d7d2 100644 --- a/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx +++ b/DPG/Tasks/AOTTrack/tagAndProbeDmesons.cxx @@ -16,6 +16,7 @@ #include "PWGHF/Utils/utilsAnalysis.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" @@ -26,17 +27,39 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/ML/MlResponse.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.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 diff --git a/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx b/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx index a5e6016d9fb..b5f44d9c311 100644 --- a/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx +++ b/DPG/Tasks/AOTTrack/unitTestForReconstruction.cxx @@ -15,21 +15,17 @@ /// \author Alberto Caliva (alberto.caliva@cern.ch), Catalin-Lucian Ristea (catalin.ristea@cern.ch) /// \since September 9, 2025 -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Logger.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include -#include #include #include #include diff --git a/DPG/Tasks/FDD/qaFDD.cxx b/DPG/Tasks/FDD/qaFDD.cxx index c985d7dbb9d..96f4d31dcab 100644 --- a/DPG/Tasks/FDD/qaFDD.cxx +++ b/DPG/Tasks/FDD/qaFDD.cxx @@ -9,21 +9,35 @@ // 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/EventSelection.h" -#include "DataFormatsFDD/Digit.h" -#include "DataFormatsFIT/Triggers.h" #include "Common/DataModel/FT0Corrected.h" -#include "CCDB/CcdbApi.h" -#include "CommonDataFormat/BunchFilling.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "TH1F.h" -#include "TH2F.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/DPG/Tasks/FT0/qaFT0TrgBased.cxx b/DPG/Tasks/FT0/qaFT0TrgBased.cxx index 35a2c2cc884..c42b839087a 100644 --- a/DPG/Tasks/FT0/qaFT0TrgBased.cxx +++ b/DPG/Tasks/FT0/qaFT0TrgBased.cxx @@ -13,27 +13,29 @@ /// \author Uliana Dmitrieva uliana.dmitrieva@cern.ch /// \brief FT0 QA +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + #include #include -#include +#include #include #include #include -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" -#include "Common/DataModel/Multiplicity.h" -#include "DataFormatsFT0/Digit.h" - -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" -#include "Framework/InitContext.h" -#include "Framework/runDataProcessing.h" - using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/FV0/qaFV0.cxx b/DPG/Tasks/FV0/qaFV0.cxx index 295f981b0b7..1e21e679f1a 100644 --- a/DPG/Tasks/FV0/qaFV0.cxx +++ b/DPG/Tasks/FV0/qaFV0.cxx @@ -13,28 +13,27 @@ /// \author Andreas Molander andreas.molander@cern.ch /// \brief FV0 QA +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + #include #include -#include -#include #include +#include #include -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" - -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsFIT/Triggers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/InitContext.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" -#include "Framework/runDataProcessing.h" - -#include "TH1F.h" -#include "TH2F.h" - using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/ITS/filterTracks.cxx b/DPG/Tasks/ITS/filterTracks.cxx index 446a792e3f4..6a9ee148142 100644 --- a/DPG/Tasks/ITS/filterTracks.cxx +++ b/DPG/Tasks/ITS/filterTracks.cxx @@ -14,22 +14,26 @@ /// /// \author Andrea Rossi +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" -#include "Common/DataModel/CollisionAssociationTables.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/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include using namespace o2; diff --git a/DPG/Tasks/MFT/aQCMFTTracks.cxx b/DPG/Tasks/MFT/aQCMFTTracks.cxx index 5b5f4a71aa4..be34d97fe69 100644 --- a/DPG/Tasks/MFT/aQCMFTTracks.cxx +++ b/DPG/Tasks/MFT/aQCMFTTracks.cxx @@ -16,24 +16,17 @@ /// \author David Grund /// \since -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsITSMFT/ROFRecord.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/TimingInfo.h" -#include "Framework/runDataProcessing.h" - -#include -#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx b/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx index 5f285fcc2b4..fc38e305938 100644 --- a/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx +++ b/DPG/Tasks/Monitor/MC/taskMcSimpleQC.cxx @@ -12,13 +12,16 @@ /// \brief Simple QC task to run /// \author Fabrizio Grosa, fabrizio.grosa@cern.ch (CERN) -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" #include "Common/DataModel/TrackSelectionTables.h" +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; @@ -36,7 +39,7 @@ struct mcSimpleQc { {"histNumGlobalTracks", ";#it{N}_{global tracks};entries", {HistType::kTH1F, {{200, -0.5, 200.}}}}, // {"histNumPvContributors", ";#it{N}_{PV contributors};entries", {HistType::kTH1F, {{200, -0.5, 200.}}}}, // {"histFracAmbiguousTracks", ";#it{N}_{ambiguous tracks} / #it{N}_{tracks};entries", {HistType::kTH1F, {{100, 0., 1.}}}} // - } // + } // }; using CollisionsWithMCLabels = soa::Join; @@ -84,4 +87,4 @@ struct mcSimpleQc { WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} diff --git a/DPG/Tasks/TOF/tofOfflineCalib.cxx b/DPG/Tasks/TOF/tofOfflineCalib.cxx index 950efc83e07..f3b6aed8ab8 100644 --- a/DPG/Tasks/TOF/tofOfflineCalib.cxx +++ b/DPG/Tasks/TOF/tofOfflineCalib.cxx @@ -24,9 +24,33 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/TableProducer/PID/pidTOFBase.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 using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/TOF/tofSkimsTableCreator.cxx b/DPG/Tasks/TOF/tofSkimsTableCreator.cxx index c61a3336982..4fcdc3fb7cb 100644 --- a/DPG/Tasks/TOF/tofSkimsTableCreator.cxx +++ b/DPG/Tasks/TOF/tofSkimsTableCreator.cxx @@ -20,12 +20,24 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/FT0Corrected.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/DPG/Tasks/TOF/tofSkimsTableCreator.h b/DPG/Tasks/TOF/tofSkimsTableCreator.h index f1dd4ccfb3e..f3a6f63bb9b 100644 --- a/DPG/Tasks/TOF/tofSkimsTableCreator.h +++ b/DPG/Tasks/TOF/tofSkimsTableCreator.h @@ -23,7 +23,9 @@ #include "Common/DataModel/PIDResponseTOF.h" #include "Common/TableProducer/PID/pidTOFBase.h" -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx index c91afe4734f..85607d41636 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.cxx @@ -45,6 +45,7 @@ #include #include +#include #include #include diff --git a/DPG/Tasks/TPC/tpcSkimsTableCreator.h b/DPG/Tasks/TPC/tpcSkimsTableCreator.h index 0d05ce33348..61017c27d1c 100644 --- a/DPG/Tasks/TPC/tpcSkimsTableCreator.h +++ b/DPG/Tasks/TPC/tpcSkimsTableCreator.h @@ -20,7 +20,6 @@ #ifndef DPG_TASKS_TPC_TPCSKIMSTABLECREATOR_H_ #define DPG_TASKS_TPC_TPCSKIMSTABLECREATOR_H_ -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/OccupancyTables.h" #include diff --git a/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx b/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx index a0871336051..7d9ae11ea1b 100644 --- a/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx +++ b/DPG/Tasks/TPC/tpcTreeCreatorLight.cxx @@ -18,28 +18,27 @@ #include "tpcTreeCreatorLight.h" -#include - -#include -/// ROOT -#include "TRandom3.h" -/// O2 -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -/// O2Physics -#include "Common/Core/trackUtilities.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 +#include +#include +#include +#include +#include +#include + +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::track; -using namespace o2::dataformats; struct TreeWriterTPCTOF { using Trks = soa::Join; diff --git a/DPG/Tasks/TPC/tpcTreeCreatorLight.h b/DPG/Tasks/TPC/tpcTreeCreatorLight.h index 2af95cf2256..a9b7af27966 100644 --- a/DPG/Tasks/TPC/tpcTreeCreatorLight.h +++ b/DPG/Tasks/TPC/tpcTreeCreatorLight.h @@ -17,10 +17,9 @@ #ifndef DPG_TASKS_TPC_TPCTREECREATORLIGHT_H_ #define DPG_TASKS_TPC_TPCTREECREATORLIGHT_H_ -#include "Common/Core/trackUtilities.h" +#include -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" +#include enum ParticleSpecies { kPionTrack = BIT(0), diff --git a/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h b/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h index e32cee320fc..32c27233067 100644 --- a/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h +++ b/DPG/Tasks/TPC/utilsTpcSkimsTableCreator.h @@ -24,6 +24,8 @@ #include "Common/DataModel/OccupancyTables.h" +#include + #include #include diff --git a/EventFiltering/PWGCF/CFFilterAll.cxx b/EventFiltering/PWGCF/CFFilterAll.cxx index 8e0bfe2e119..3f2540f27b0 100644 --- a/EventFiltering/PWGCF/CFFilterAll.cxx +++ b/EventFiltering/PWGCF/CFFilterAll.cxx @@ -18,7 +18,9 @@ #include "PWGLF/Utils/strangenessBuilderHelper.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" +#include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseITS.h" @@ -26,22 +28,35 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector4D.h" -#include "TMath.h" - -#include "fairlogger/Logger.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include +#include +#include +#include #include #include diff --git a/EventFiltering/PWGEM/EMPhotonFilter.cxx b/EventFiltering/PWGEM/EMPhotonFilter.cxx index 3e88524a89b..7a78c6485b1 100644 --- a/EventFiltering/PWGEM/EMPhotonFilter.cxx +++ b/EventFiltering/PWGEM/EMPhotonFilter.cxx @@ -14,17 +14,29 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/CaloClusters.h" +#include "Common/DataModel/EventSelection.h" #include "EventFiltering/filterTables.h" -#include "DataFormatsPHOS/TriggerRecord.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.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 using namespace o2; using namespace o2::soa; diff --git a/EventFiltering/PWGEM/EMPhotonFilterQC.cxx b/EventFiltering/PWGEM/EMPhotonFilterQC.cxx index de4d59f00da..d805ac673cf 100644 --- a/EventFiltering/PWGEM/EMPhotonFilterQC.cxx +++ b/EventFiltering/PWGEM/EMPhotonFilterQC.cxx @@ -12,18 +12,31 @@ // \brief Quick QC task for CEFP for EM photon // \author daiki.sekihata@cern.ch -#include "Math/Vector4D.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Common/DataModel/CaloClusters.h" -#include "DataFormatsPHOS/TriggerRecord.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" -#include "PWGEM/PhotonMeson/Core/CutsLibrary.h" + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/EventSelection.h" #include "EventFiltering/filterTables.h" -#include "Framework/HistogramRegistry.h" + +#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 using namespace o2; using namespace o2::soa; diff --git a/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx b/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx index ff6a7f9e833..763b3a70bb2 100644 --- a/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx +++ b/EventFiltering/PWGEM/HeavyNeutralMesonFilter.cxx @@ -14,6 +14,7 @@ /// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt; Maximilian Korwieser (maximilian.korwieser@cern.ch) - Technical University Munich /// +#include "Common/CCDB/EventSelectionParams.h" #include "EventFiltering/filterTables.h" // #include "PWGEM/PhotonMeson/Utils/HNMUtilities.h" @@ -44,7 +45,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/EventFiltering/PWGEM/globalDimuonFilter.cxx b/EventFiltering/PWGEM/globalDimuonFilter.cxx index d58faa6fc3f..be71fc72cd6 100644 --- a/EventFiltering/PWGEM/globalDimuonFilter.cxx +++ b/EventFiltering/PWGEM/globalDimuonFilter.cxx @@ -12,37 +12,51 @@ // \brief software trigger for global dimuons // \author daiki.sekihata@cern.ch -#include "Common/Core/TableHelper.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "EventFiltering/filterTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.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/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include #include +#include #include +#include #include #include #include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::aod; diff --git a/EventFiltering/PWGHF/H2fromLbFilter.cxx b/EventFiltering/PWGHF/H2fromLbFilter.cxx index f99e0f3cde7..85fc65df1fa 100644 --- a/EventFiltering/PWGHF/H2fromLbFilter.cxx +++ b/EventFiltering/PWGHF/H2fromLbFilter.cxx @@ -16,8 +16,7 @@ #include "../filterTables.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" @@ -26,20 +25,23 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" -#include "ReconstructionDataFormats/TrackParametrization.h" - -#include "TVector3.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include #include struct H2fromLbFilter { diff --git a/EventFiltering/PWGHF/HFFilter.cxx b/EventFiltering/PWGHF/HFFilter.cxx index f13d9b685ff..aedd6d3c7ce 100644 --- a/EventFiltering/PWGHF/HFFilter.cxx +++ b/EventFiltering/PWGHF/HFFilter.cxx @@ -19,6 +19,7 @@ /// \author Federica Zanone , Heidelberg University /// \author Antonio Palasciano , INFN Bari +#include "Common/CCDB/EventSelectionParams.h" #include "EventFiltering/PWGHF/HFFilterHelpers.h" #include "EventFiltering/filterTables.h" // @@ -301,7 +302,7 @@ struct HfFilter { // Main struct for HF triggers helper.setPtRangeSoftPiSigmaC(ptCuts->get(0u, 4u), ptCuts->get(1u, 4u)); helper.setPtDeltaMassRangeSigmaC(cutsPtDeltaMassCharmReso->get(0u, 6u), cutsPtDeltaMassCharmReso->get(1u, 6u), cutsPtDeltaMassCharmReso->get(0u, 7u), cutsPtDeltaMassCharmReso->get(1u, 7u), cutsPtDeltaMassCharmReso->get(0u, 8u), cutsPtDeltaMassCharmReso->get(1u, 8u), cutsPtDeltaMassCharmReso->get(0u, 9u), cutsPtDeltaMassCharmReso->get(1u, 9u), cutsPtDeltaMassCharmReso->get(2u, 6u), cutsPtDeltaMassCharmReso->get(2u, 7u), cutsPtDeltaMassCharmReso->get(2u, 8u), cutsPtDeltaMassCharmReso->get(2u, 9u)); helper.setPtRangeSoftKaonXicResoToSigmaC(ptCuts->get(0u, 5u), ptCuts->get(1u, 5u)); - helper.setVtxConfiguration(dfStrangeness, true); // (DCAFitterN, useAbsDCA) + helper.setVtxConfiguration(dfStrangeness, true); // (DCAFitterN, useAbsDCA) helper.setVtxConfiguration(dfStrangeness3, true); // (DCAFitterN, useAbsDCA) helper.setParSigmaCPr( cutsPtDeltaMassCharmReso->get(0u, 13u), // min ΔM @@ -481,6 +482,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 +531,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..d215fb0df8d 100644 --- a/EventFiltering/PWGHF/HFFilterHelpers.h +++ b/EventFiltering/PWGHF/HFFilterHelpers.h @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ #include #include #include +#include #include #include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.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/EventFiltering/PWGJE/fullJetFilter.cxx b/EventFiltering/PWGJE/fullJetFilter.cxx index 25096b7bb7a..b47b9354eb3 100644 --- a/EventFiltering/PWGJE/fullJetFilter.cxx +++ b/EventFiltering/PWGJE/fullJetFilter.cxx @@ -12,35 +12,50 @@ // Full Jet Filter // Author: Gijs van Weelden -#include -#include -#include -#include -#include +#include "../filterTables.h" -#include +#include "PWGJE/DataModel/EMCALClusterDefinition.h" +#include "PWGJE/DataModel/EMCALClusters.h" +#include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCTP/Configuration.h" -#include "EMCALBase/Geometry.h" -#include "ReconstructionDataFormats/Track.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" - -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/CCDB/TriggerAliases.h" -#include "PWGJE/DataModel/Jet.h" -#include "PWGJE/DataModel/EMCALClusters.h" -#include "PWGJE/Core/JetFinder.h" -#include "PWGJE/Core/FastJetUtilities.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include -#include "../filterTables.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/EventFiltering/PWGJE/jetFilter.cxx b/EventFiltering/PWGJE/jetFilter.cxx index 47761d62c1e..d9f9f153333 100644 --- a/EventFiltering/PWGJE/jetFilter.cxx +++ b/EventFiltering/PWGJE/jetFilter.cxx @@ -13,26 +13,23 @@ #include "../filterTables.h" -#include "PWGJE/Core/FastJetUtilities.h" -#include "PWGJE/Core/JetBkgSubUtils.h" #include "PWGJE/Core/JetDerivedDataUtilities.h" -#include "PWGJE/Core/JetFinder.h" -#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGJE/DataModel/Jet.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/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - +#include "PWGJE/DataModel/JetReducedData.h" +#include "PWGJE/DataModel/JetSubtraction.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include #include #include diff --git a/EventFiltering/PWGJE/jetHFFilter.cxx b/EventFiltering/PWGJE/jetHFFilter.cxx index 6657e785751..f5a3aebdf40 100644 --- a/EventFiltering/PWGJE/jetHFFilter.cxx +++ b/EventFiltering/PWGJE/jetHFFilter.cxx @@ -11,31 +11,24 @@ // Author: Nima Zardoshti -#include -#include -#include +#include "../filterTables.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include "PWGJE/DataModel/Jet.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "PWGJE/Core/JetFinder.h" -#include "PWGJE/Core/FastJetUtilities.h" -#include "PWGJE/Core/JetBkgSubUtils.h" -#include "PWGJE/DataModel/EMCALClusters.h" -#include "PWGJE/DataModel/Jet.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "../filterTables.h" - -#include "Framework/HistogramRegistry.h" +#include +#include using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGLF/filterdoublephi.cxx b/EventFiltering/PWGLF/filterdoublephi.cxx index 7671402b5c5..ac4b0fe5327 100644 --- a/EventFiltering/PWGLF/filterdoublephi.cxx +++ b/EventFiltering/PWGLF/filterdoublephi.cxx @@ -16,36 +16,30 @@ #include "../filterTables.h" -#include "PWGLF/DataModel/ReducedDoublePhiTables.h" - -#include "Common/Core/TrackSelection.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 "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/BetheBlochAleph.h" +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include -#include -#include -#include //FIXME +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include -#include // FIXME - -#include -#include +#include #include #include #include diff --git a/EventFiltering/PWGLF/filterf1proton.cxx b/EventFiltering/PWGLF/filterf1proton.cxx index 64fe2761e18..9d345cc9194 100644 --- a/EventFiltering/PWGLF/filterf1proton.cxx +++ b/EventFiltering/PWGLF/filterf1proton.cxx @@ -16,44 +16,43 @@ #include "../filterTables.h" -#include "PWGLF/DataModel/LFParticleIdentification.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.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 "CCDB/CcdbApi.h" -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "MathUtils/BetheBlochAleph.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" -#include "ReconstructionDataFormats/TrackParametrization.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include -#include -#include - -#include +#include +#include +#include #include +#include #include #include diff --git a/EventFiltering/PWGLF/nucleiFilter.cxx b/EventFiltering/PWGLF/nucleiFilter.cxx index c336bf381c6..0a50f17cd0a 100644 --- a/EventFiltering/PWGLF/nucleiFilter.cxx +++ b/EventFiltering/PWGLF/nucleiFilter.cxx @@ -8,41 +8,54 @@ // 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. -// O2 includes #include "../filterTables.h" #include "PWGLF/DataModel/LFPIDTOFGenericTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/Vtx3BodyTables.h" #include "PWGLF/Utils/pidTOFGeneric.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/MetadataHelper.h" #include "Common/Core/PID/PIDTOF.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.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 "DataFormatsTOF/ParameterContainers.h" -#include "MathUtils/BetheBlochAleph.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - -#include "Math/GenVector/Boost.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include +#include + +#include #include +#include +#include #include #include #include diff --git a/EventFiltering/PWGLF/strangenessFilter.cxx b/EventFiltering/PWGLF/strangenessFilter.cxx index 07e36121586..dde0d18f4c8 100644 --- a/EventFiltering/PWGLF/strangenessFilter.cxx +++ b/EventFiltering/PWGLF/strangenessFilter.cxx @@ -21,33 +21,48 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/Utils/strangenessBuilderHelper.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.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 "ReconstructionDataFormats/TrackParametrization.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 using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGMM/multFilter.cxx b/EventFiltering/PWGMM/multFilter.cxx index fe641438a43..7ab341b4591 100644 --- a/EventFiltering/PWGMM/multFilter.cxx +++ b/EventFiltering/PWGMM/multFilter.cxx @@ -8,23 +8,42 @@ // 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 "Common/CCDB/EventSelectionParams.h" #include "Common/Core/TrackSelection.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include "EventFiltering/filterTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "DataFormatsFT0/Digit.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include #include +#include +#include +#include #include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGUD/diffractionBCFilter.cxx b/EventFiltering/PWGUD/diffractionBCFilter.cxx index c6ce85ec845..a2c8f8c2ed9 100644 --- a/EventFiltering/PWGUD/diffractionBCFilter.cxx +++ b/EventFiltering/PWGUD/diffractionBCFilter.cxx @@ -8,19 +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. -// O2 includes // // \brief A filter task for diffractive BCs // \author P. Buehler, paul.buehler@oeaw.ac.at // \since December, 2022 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "PWGUD/TableProducer/DGBCCandProducer.h" +#include "../filterTables.h" + #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/DGSelector.h" #include "PWGUD/Core/UDHelpers.h" -#include "../filterTables.h" +#include "PWGUD/TableProducer/DGBCCandProducer.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 using namespace o2; using namespace o2::framework; diff --git a/EventFiltering/PWGUD/diffractionFilter.cxx b/EventFiltering/PWGUD/diffractionFilter.cxx index c5adfcf90c5..946f95026e0 100644 --- a/EventFiltering/PWGUD/diffractionFilter.cxx +++ b/EventFiltering/PWGUD/diffractionFilter.cxx @@ -8,20 +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. -// O2 includes // // \brief A filter task for diffractive events // \author P. Buehler, paul.buehler@oeaw.ac.at // \since June 1, 2021 -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/StaticFor.h" -#include "Common/DataModel/EventSelection.h" +#include "../filterTables.h" + #include "PWGUD/Core/DGCutparHolder.h" #include "PWGUD/Core/DGSelector.h" #include "PWGUD/Core/UDHelpers.h" -#include "../filterTables.h" + +#include "Common/CCDB/EventSelectionParams.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; diff --git a/EventFiltering/cefpTask.cxx b/EventFiltering/cefpTask.cxx index 64cf4435b85..eb64a60db54 100644 --- a/EventFiltering/cefpTask.cxx +++ b/EventFiltering/cefpTask.cxx @@ -8,31 +8,47 @@ // 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. -// O2 includes -#include +#include "filterTables.h" + +#include "Common/DataModel/EventSelection.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 "filterTables.h" - -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsCTP/Scalers.h" +#include // we need to add workflow options before including Framework/runDataProcessing void customize(std::vector& workflowOptions) @@ -43,7 +59,7 @@ void customize(std::vector& workflowOptions) std::swap(workflowOptions, options); } -#include "Framework/runDataProcessing.h" +#include using namespace o2; using namespace o2::aod; diff --git a/EventFiltering/filterTables.h b/EventFiltering/filterTables.h index c814c5d871f..cd4ad719297 100644 --- a/EventFiltering/filterTables.h +++ b/EventFiltering/filterTables.h @@ -8,14 +8,19 @@ // 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 EVENTFILTERING_FILTERTABLES_H_ #define EVENTFILTERING_FILTERTABLES_H_ +#include + #include -#include +#include +#include #include +#include +#include #include -#include namespace o2::aod { @@ -23,8 +28,6 @@ template struct Hash; } -#include "Framework/ASoA.h" - namespace o2::soa { template diff --git a/EventFiltering/macros/cefpOutputChecker.C b/EventFiltering/macros/cefpOutputChecker.C index d053cedf866..48295a1746e 100644 --- a/EventFiltering/macros/cefpOutputChecker.C +++ b/EventFiltering/macros/cefpOutputChecker.C @@ -8,11 +8,16 @@ // 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. -// O2 includes #include +#include +#include #include +#include + +#include + void cefpOutputChecker(std::string histoFile = "AnalysisResults.root", std::string treeFile = "AO2D.root") { TFile referenceFile(histoFile.data()); diff --git a/EventFiltering/macros/checkBCRange.C b/EventFiltering/macros/checkBCRange.C index 9bcc14981f4..413e223bdff 100644 --- a/EventFiltering/macros/checkBCRange.C +++ b/EventFiltering/macros/checkBCRange.C @@ -8,14 +8,21 @@ // 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. -// O2 includes -#include +#include +#include + +#include #include +#include +#include #include -#include "CommonDataFormat/InteractionRecord.h" -#include "CommonDataFormat/IRFrame.h" +#include + +#include +#include +#include using o2::InteractionRecord; using o2::dataformats::IRFrame; diff --git a/EventFiltering/macros/checkBCrangesSkimming.C b/EventFiltering/macros/checkBCrangesSkimming.C index f71212238c3..db58d7d9848 100644 --- a/EventFiltering/macros/checkBCrangesSkimming.C +++ b/EventFiltering/macros/checkBCrangesSkimming.C @@ -8,18 +8,25 @@ // 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. -// O2 includes -#include -#include -#include -#include +#include +#include + #include #include #include #include -#include "CommonDataFormat/InteractionRecord.h" -#include "CommonDataFormat/IRFrame.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include using o2::InteractionRecord; using o2::dataformats::IRFrame; @@ -187,7 +194,7 @@ std::string getRunNumber(std::string fileName) } // Detailed checks for specific trigger, not enabled by default -void checkBCForSelectedTrg(std::vector& originalFrames, std::vector& skimmedFrames, string runNumber, string triggerLabel) +void checkBCForSelectedTrg(std::vector& originalFrames, std::vector& skimmedFrames, std::string runNumber, std::string triggerLabel) { TH1D hTriggerCounter("hTriggerCounter", (runNumber + " " + triggerLabel + ";;Total number of trigger").data(), 2, -0.5, 1.5); @@ -328,7 +335,7 @@ void checkBCForSelectedTrg(std::vector& originalFrames, std::vec void checkBCForSelectedTrg(std::string AnaFileName = "AnalysisResults.root", std::string originalFileName = "bcRanges_fullrun.root", std::string skimmedFileName = "bcRanges_fullrun_skimmed.root", int triggerID = 1, bool useAlien = true) { - string runNumber = getRunNumber(originalFileName); + std::string runNumber = getRunNumber(originalFileName); if (useAlien) { TGrid::Connect("alien://"); AnaFileName = "alien://" + AnaFileName; @@ -365,7 +372,7 @@ void checkBCForSelectedTrg(std::string AnaFileName = "AnalysisResults.root", std void checkBCrangesSkimming(std::string AnaFileName = "AnalysisResults.root", std::string originalFileName = "bcRanges_fullrun.root", std::string skimmedFileName = "bcRanges_fullrun_skimmed.root", bool useAlien = true) { - string runNumber = getRunNumber(originalFileName); + std::string runNumber = getRunNumber(originalFileName); if (useAlien) { TGrid::Connect("alien://"); AnaFileName = "alien://" + AnaFileName; diff --git a/EventFiltering/macros/checkSkimming.C b/EventFiltering/macros/checkSkimming.C index 5496f303873..a69f9d5d129 100644 --- a/EventFiltering/macros/checkSkimming.C +++ b/EventFiltering/macros/checkSkimming.C @@ -10,15 +10,17 @@ // or submit itself to any jurisdiction. #include -#include +#include #include +#include #include +#include #include #include -#include -#include #include +#include +#include void checkSkimming(std::string original_path = "AnalysisResults.root", std::string skimmed_path = "AnalysisResults_skimmed.root", TFile* outputFile = nullptr, bool skipDownscaled = true) { @@ -129,4 +131,4 @@ void checkSkimming(std::string listName = "period.txt", bool skipDownscaled = tr counter++; } outputFile->Close(); -} \ No newline at end of file +} diff --git a/EventFiltering/macros/getMenu.C b/EventFiltering/macros/getMenu.C index 02386a68870..f1674d14539 100644 --- a/EventFiltering/macros/getMenu.C +++ b/EventFiltering/macros/getMenu.C @@ -9,17 +9,20 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "CCDB/BasicCCDBManager.h" +#include #include #include #include #include +#include #include +#include +#include #include +#include #include -#include #include #include #include diff --git a/EventFiltering/macros/selectivityPlot.C b/EventFiltering/macros/selectivityPlot.C index 56215bcd3e6..344101a0984 100644 --- a/EventFiltering/macros/selectivityPlot.C +++ b/EventFiltering/macros/selectivityPlot.C @@ -9,6 +9,20 @@ // 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 + void selectivityPlot(int runNumber = 550781, TString inputfile = "AnalysisResults_550781.root", TString outputfolder = "") { TCanvas* Canvas_1 = new TCanvas("Canvas_1", "Canvas_1", 928, 592); diff --git a/EventFiltering/macros/splitFile.C b/EventFiltering/macros/splitFile.C index b38149dca42..b3c182e3c82 100644 --- a/EventFiltering/macros/splitFile.C +++ b/EventFiltering/macros/splitFile.C @@ -8,13 +8,14 @@ // 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. -// O2 includes + +#include +#include +#include +#include +#include #include -#include -#include "TFile.h" -#include "TDirectory.h" -#include "TTree.h" void splitFile(const char* inputFileName = "bcSelection.root", const char* outputFileName1 = "bcRanges.root") { diff --git a/EventFiltering/macros/uploadOTSobjects.C b/EventFiltering/macros/uploadOTSobjects.C index ec60c44ec0a..b1703a6ba45 100644 --- a/EventFiltering/macros/uploadOTSobjects.C +++ b/EventFiltering/macros/uploadOTSobjects.C @@ -12,22 +12,29 @@ #include "Common/Core/ZorroHelper.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" +#include +#include +#include -#include "TFile.h" -#include "TGrid.h" -#include "TH1.h" -#include "TKey.h" -#include "TSystem.h" -#include "TTree.h" +#include +#include +#include +#include +#include +#include +#include -#include +#include + +#include #include +#include #include #include #include +#include #include +#include #include constexpr uint32_t chunkSize = 1000000; diff --git a/EventFiltering/selectBCRange.cxx b/EventFiltering/selectBCRange.cxx index 8a2d200e8e6..a52127fe32e 100644 --- a/EventFiltering/selectBCRange.cxx +++ b/EventFiltering/selectBCRange.cxx @@ -9,15 +9,28 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "filterTables.h" + #include "Common/DataModel/EventSelection.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "CommonDataFormat/IRFrame.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" -#include "filterTables.h" +#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/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/nchCumulantsId.cxx b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx index 3f683b99589..3cfea59e573 100644 --- a/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx +++ b/PWGCF/EbyEFluctuations/Tasks/nchCumulantsId.cxx @@ -20,6 +20,7 @@ #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" @@ -28,7 +29,10 @@ #include "Framework/O2DatabasePDGPlugin.h" #include "Framework/runDataProcessing.h" +#include + #include +#include #include using namespace o2; @@ -37,9 +41,59 @@ using namespace o2::framework::expressions; using namespace o2::constants::physics; // for constants using namespace std; +#define ID_BIT_PI 0 // Identificationi bits for PID checks +#define ID_BIT_KA 1 +#define ID_BIT_PR 2 +#define ID_BIT_EL 3 +#define ID_BIT_DE 4 + +#define BITSET(mask, ithBit) ((mask) |= (1 << (ithBit))) // avoid name bitset as std::bitset is already there +#define BITCHECK(mask, ithBit) ((mask) & (1 << (ithBit))) // bit check will return int value, not bool, use BITCHECK != 0 in Analysi + +enum PidEnum { + kCh = 0, + kPi, // dont use kPion, kKaon, as these enumeration + kKa, // are already defined in $ROOTSYS/root/include/TPDGCode.h + kPr, + kEl, + kDe +}; + +enum ChargeEnum { + kPos = 0, + kNeg = 1 +}; + +static constexpr std::string_view PidDire[] = { + "Ch/", + "Pi/", + "Ka/", + "Pr/", + "El/", + "De/"}; + +static constexpr std::string_view ChargeDire[] = { + "Pos/", + "Neg/"}; + +std::string getModifiedStr(const std::string& myString) +{ + size_t pos = myString.rfind('/'); + if (pos != std::string::npos) { + std::string subString = myString.substr(0, pos); // remove "/" from end of the string + return subString; + } else { + return myString; + } +} + struct NchCumulantsId { HistogramRegistry hist{"hist", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry recoTracks{"recoTracks", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry genAnalysis{"genAnalysis", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry recoAnalysis{"recoAnalysis", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry purityAnalysis{"purityAnalysis", {}, OutputObjHandlingPolicy::AnalysisObject}; // PDG data base Service pdgDB; @@ -50,6 +104,17 @@ struct NchCumulantsId { Configurable cfgCutEta{"cfgCutEta", 0.8, "cut for eta"}; Configurable cfgCutPtMax{"cfgCutPtMax", 3.0, "max cut for pT"}; Configurable cfgCutPtMin{"cfgCutPtMin", 0.15, "min cut for pT"}; + Configurable netChBin{"netChBin", 160, "bins for netch"}; + Configurable netChMax{"netChMax", 80.0, "max for netch"}; + Configurable netChMin{"netChMin", -80.0, "min for netch"}; + Configurable chBins{"chBins", 501, "bins for ch"}; + Configurable chMax{"chMax", 500.0, "max for ch"}; + Configurable chMin{"chMin", -1.0, "min for ch"}; + Configurable midRapMax{"midRapMax", 1000.0, "max for midrapmult"}; + Configurable midRapBins{"midRapBins", 1001, "bins for midrapmult"}; + + Configurable checkCollPosZMc{"checkCollPosZMc", false, "checkCollPosZMc"}; + Configurable flagUnusedVariableError{"flagUnusedVariableError", false, "flagUnusedVariableError"}; // Configurables for particle Identification Configurable cfgId01CheckVetoCut{"cfgId01CheckVetoCut", false, "cfgId01CheckVetoCut"}; @@ -101,12 +166,60 @@ struct NchCumulantsId { Configurable cfgVetoId10DeTOF{"cfgVetoId10DeTOF", 3.0, "cfgVetoId10DeTOF"}; } cfgVetoIdCut; + struct : ConfigurableGroup { + Configurable cfgCCDB01URL{"cfgCCDB01URL", "http://ccdb-test.cern.ch:8080", "cfgCCDB01URL"}; + Configurable cfgCCDB02Path{"cfgCCDB02Path", "Users/p/ppanigra/NchCumulants/correctionWeights/", "cfgCCDB02Path"}; + Configurable cfgCCDB03SOR{"cfgCCDB03SOR", 1, "cfgCCDB03SOR"}; + Configurable cfgCCDB04StrHistP{"cfgCCDB04StrHistP", "h01_p", "cfgCCDB04StrHistP"}; + Configurable cfgCCDB05StrHistPt{"cfgCCDB05StrHistPt", "h02_pt", "cfgCCDB05StrHistPt"}; + Configurable cfgCCDB06StrHistPtEta{"cfgCCDB06StrHistPtEta", "h20_pt_eta", "cfgCCDB06StrHistPtEta"}; + } cfgCCDB; + + struct : ConfigurableGroup { + Configurable printDebugMessages{"printDebugMessages", false, "printDebugMessages"}; + Configurable resetHistograms{"resetHistograms", false, "resetHistograms"}; + } cfgDebug; + + // Efficieny containing Histograms. + TH2F* hPtEtaForBinSearch = nullptr; + std::vector> hPtEtaForEffCorrection{kDe + 1, std::array{}}; + void init(InitContext const&) { + auto& mgr = o2::ccdb::BasicCCDBManager::instance(); + mgr.setURL(cfgCCDB.cfgCCDB01URL); + mgr.setCaching(true); + auto ccdbObj = mgr.getForTimeStamp(cfgCCDB.cfgCCDB02Path, cfgCCDB.cfgCCDB03SOR); + if (!ccdbObj) { + if (cfgDebug.printDebugMessages) + LOG(info) << "DEBUG :: CCDB OBJECT NOT FOUND"; + } else { + if (cfgDebug.printDebugMessages) + LOG(info) << "DEBUG :: CCDB OBJECT FOUND"; + } + + ccdbObj->Print(); + + hPtEtaForBinSearch = reinterpret_cast(ccdbObj->FindObject("hPtEta")); + if (cfgDebug.printDebugMessages) + LOG(info) << "DEBUG :: Obj Name = " << hPtEtaForBinSearch->GetName() << " :: entries = " << hPtEtaForBinSearch->GetEntries(); + std::string name = ""; + for (int i = 0; i <= kDe; i++) { + for (int j = 0; j < (kNeg + 1); j++) { + name = "hPtEta" + getModifiedStr(static_cast(PidDire[i])) + getModifiedStr(static_cast(ChargeDire[j])); + hPtEtaForEffCorrection[i][j] = reinterpret_cast(ccdbObj->FindObject(name.c_str())); + if (cfgDebug.printDebugMessages) + LOG(info) << "DEBUG :: Obj Name = " << hPtEtaForEffCorrection[i][j]->GetName() << " :: entries = " << hPtEtaForBinSearch->GetEntries(); + } + } + + mgr.setURL("http://alice-ccdb.cern.ch"); // RESET the URL otherwise the other process functions which contains ccdb lookups will fail + // QA check axes const AxisSpec axisEvents{1, 0, 1, "Counts"}; const AxisSpec axisEta{100, -1., +1., "#eta"}; - const AxisSpec axisPt{100, 0., 3., "p_{T} (GeV/c)"}; + const AxisSpec axisRapidity{200, -5, 5, "Rapidity (y)"}; + const AxisSpec axisPt{100, 0., 5., "p_{T} (GeV/c)"}; const AxisSpec axisP{100, 0., 5., "p (GeV/c)"}; const AxisSpec axisTPCInnerParam{100, 0, 3, "P_innerParam_Gev"}; const AxisSpec axisdEdx(100, 20, 500, {"#frac{dE}{dx}"}); @@ -123,16 +236,16 @@ struct NchCumulantsId { const AxisSpec axisTOFNSigma = {200, -10.0, 10.0, "n#sigma_{TOF}"}; const AxisSpec axisTOFExpMom = {200, 0.0f, 10.0f, "#it{p}_{tofExpMom} (GeV/#it{c})"}; - const AxisSpec axisNch(100, -50, 50, "Net_charge_dN"); - const AxisSpec axisPosCh(1001, -1, 1000, "Pos_charge"); - const AxisSpec axisNegCh(1001, -1, 1000, "Neg_charge"); - const AxisSpec axisNt(5001, -1, 5000, "Mult_midRap_Nch"); - const AxisSpec axisPrCh(101, -1, 100, "Pr_charge"); - const AxisSpec axisAPrCh(101, -1, 100, "APr_charge"); - const AxisSpec axisKaCh(101, -1, 100, "Ka_charge"); - const AxisSpec axisAKaCh(101, -1, 100, "AKa_charge"); - const AxisSpec axisPiCh(1001, -1, 1000, "Pion_Positive"); - const AxisSpec axisAPiCh(1001, -1, 1000, "Pion_Negative"); + const AxisSpec axisNch(netChBin, netChMin, netChMax, "Net_charge_dN"); + const AxisSpec axisPosCh(chBins, chMin, chMax, "Pos_charge"); + const AxisSpec axisNegCh(chBins, chMin, chMax, "Neg_charge"); + const AxisSpec axisNt(midRapBins, chMin, midRapMax, "Mult_midRap_Nch"); + const AxisSpec axisPrCh(chBins, chMin, chMax, "Pr_charge"); + const AxisSpec axisAPrCh(chBins, chMin, chMax, "APr_charge"); + const AxisSpec axisKaCh(chBins, chMin, chMax, "Ka_charge"); + const AxisSpec axisAKaCh(chBins, chMin, chMax, "AKa_charge"); + const AxisSpec axisPiCh(chBins, chMin, chMax, "Pion_Positive"); + const AxisSpec axisAPiCh(chBins, chMin, chMax, "Pion_Negative"); HistogramConfigSpec qnHist1({HistType::kTHnSparseD, {axisNch, axisPosCh, axisNegCh, axisPrCh, axisAPrCh, axisKaCh, axisAKaCh, axisNt, axisCent}}); HistogramConfigSpec qnHist2({HistType::kTHnSparseD, {axisNch, axisPosCh, axisNegCh, axisPiCh, axisAPiCh, axisKaCh, axisAKaCh, axisNt, axisCent}}); @@ -153,6 +266,8 @@ struct NchCumulantsId { HistogramConfigSpec histTofExpMomTofNSigma({HistType::kTH2F, {axisTOFExpMom, axisTOFNSigma}}); HistogramConfigSpec histTpcNSigmaTofNSigma({HistType::kTH2F, {axisTPCNSigma, axisTOFNSigma}}); + HistogramConfigSpec histPtMc({HistType::kTH1F, {axisPt}}); + // QA check histos hist.add("QA/events/preSel/h_VtxZ", "V_{Z}", kTH1D, {axisVtxZ}); @@ -222,8 +337,137 @@ struct NchCumulantsId { hist.add("sparse1", "sparse1", qnHist1); hist.add("sparse2", "sparse2", qnHist2); + + hist.add("sim/gen/sparse1", "sparse1", qnHist1); + hist.add("sim/gen/sparse2", "sparse2", qnHist2); + + hist.add("sim/reco/sparse1", "sparse1", qnHist1); + hist.add("sim/reco/sparse2", "sparse2", qnHist2); + + hist.add("sim/purity/sparse1", "sparse1", qnHist1); + hist.add("sim/purity/sparse2", "sparse2", qnHist2); + + recoAnalysis.add("recoAnalysis/Pi/Pos/h12_p", "p", kTH1F, {axisP}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h13_pt", "pt", kTH1F, {axisPt}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h14_eta", "eta", kTH1F, {axisEta}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + recoAnalysis.add("recoAnalysis/Pi/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h12_p", "p", kTH1F, {axisP}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h13_pt", "pt", kTH1F, {axisPt}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h14_eta", "eta", kTH1F, {axisEta}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + recoAnalysis.add("recoAnalysis/Pi/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + recoAnalysis.addClone("recoAnalysis/Pi/", "recoAnalysis/Ka/"); + recoAnalysis.addClone("recoAnalysis/Pi/", "recoAnalysis/Pr/"); + // recoAnalysis.addClone("recoAnalysis/Pi/", "recoAnalysis/El/"); + // recoAnalysis.addClone("recoAnalysis/Pi/", "recoAnalysis/De/"); + recoAnalysis.add("recoAnalysis/Charge/Pos/h12_p", "p", kTH1F, {axisP}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h13_pt", "pt", kTH1F, {axisPt}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h14_eta", "eta", kTH1F, {axisEta}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + recoAnalysis.add("recoAnalysis/Charge/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h12_p", "p", kTH1F, {axisP}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h13_pt", "pt", kTH1F, {axisPt}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h14_eta", "eta", kTH1F, {axisEta}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + recoAnalysis.add("recoAnalysis/Charge/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + genAnalysis.add("genAnalysis/Pi/Pos/h12_p", "p", kTH1F, {axisP}); + genAnalysis.add("genAnalysis/Pi/Pos/h13_pt", "pt", kTH1F, {axisPt}); + genAnalysis.add("genAnalysis/Pi/Pos/h14_eta", "eta", kTH1F, {axisEta}); + genAnalysis.add("genAnalysis/Pi/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + genAnalysis.add("genAnalysis/Pi/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + genAnalysis.add("genAnalysis/Pi/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + genAnalysis.add("genAnalysis/Pi/Neg/h12_p", "p", kTH1F, {axisP}); + genAnalysis.add("genAnalysis/Pi/Neg/h13_pt", "pt", kTH1F, {axisPt}); + genAnalysis.add("genAnalysis/Pi/Neg/h14_eta", "eta", kTH1F, {axisEta}); + genAnalysis.add("genAnalysis/Pi/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + genAnalysis.add("genAnalysis/Pi/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + genAnalysis.add("genAnalysis/Pi/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + genAnalysis.addClone("genAnalysis/Pi/", "genAnalysis/Ka/"); + genAnalysis.addClone("genAnalysis/Pi/", "genAnalysis/Pr/"); + // genAnalysis.addClone("genAnalysis/Pi/", "genAnalysis/El/"); + // genAnalysis.addClone("genAnalysis/Pi/", "genAnalysis/De/"); + + genAnalysis.add("genAnalysis/Charge/Pos/h12_p", "p", kTH1F, {axisP}); + genAnalysis.add("genAnalysis/Charge/Pos/h13_pt", "pt", kTH1F, {axisPt}); + genAnalysis.add("genAnalysis/Charge/Pos/h14_eta", "eta", kTH1F, {axisEta}); + genAnalysis.add("genAnalysis/Charge/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + genAnalysis.add("genAnalysis/Charge/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + genAnalysis.add("genAnalysis/Charge/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + genAnalysis.add("genAnalysis/Charge/Neg/h12_p", "p", kTH1F, {axisP}); + genAnalysis.add("genAnalysis/Charge/Neg/h13_pt", "pt", kTH1F, {axisPt}); + genAnalysis.add("genAnalysis/Charge/Neg/h14_eta", "eta", kTH1F, {axisEta}); + genAnalysis.add("genAnalysis/Charge/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + genAnalysis.add("genAnalysis/Charge/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + genAnalysis.add("genAnalysis/Charge/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + purityAnalysis.add("purityAnalysis/Charge/Pos/h12_p", "p", kTH1F, {axisP}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h13_pt", "pt", kTH1F, {axisPt}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h14_eta", "eta", kTH1F, {axisEta}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + purityAnalysis.add("purityAnalysis/Charge/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h12_p", "p", kTH1F, {axisP}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h13_pt", "pt", kTH1F, {axisPt}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h14_eta", "eta", kTH1F, {axisEta}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + purityAnalysis.add("purityAnalysis/Charge/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + purityAnalysis.add("purityAnalysis/Pi/Pos/h12_p", "p", kTH1F, {axisP}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h13_pt", "pt", kTH1F, {axisPt}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h14_eta", "eta", kTH1F, {axisEta}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h15_phi", "phi", kTH1F, {axisPhi}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + purityAnalysis.add("purityAnalysis/Pi/Pos/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h12_p", "p", kTH1F, {axisP}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h13_pt", "pt", kTH1F, {axisPt}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h14_eta", "eta", kTH1F, {axisEta}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h15_phi", "phi", kTH1F, {axisPhi}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h16_rapidity", "rapidity", kTH1F, {axisRapidity}); + purityAnalysis.add("purityAnalysis/Pi/Neg/h20_pt_eta", "pt_eta", kTH2F, {axisPt, axisEta}); + + purityAnalysis.addClone("purityAnalysis/Pi/", "purityAnalysis/Ka/"); + purityAnalysis.addClone("purityAnalysis/Pi/", "purityAnalysis/Pr/"); + // purityAnalysis.addClone("purityAnalysis/Pi/", "purityAnalysis/El/"); + // purityAnalysis.addClone("purityAnalysis/Pi/", "purityAnalysis/De/"); + } // init ends + static constexpr std::string_view HistRegDire2[] = { + "v0Table/Full/", + "v0Table/postK0sCheck/", + "v0Table/postMassCut/", + "v0Table/postSelectionCut/", + "recoK0s/PreSel/", + "recoK0s/PostSel/", + "recoTracks/PreSel/", + "recoTracks/PostSel/", + "recoAnalysis/", + "genAnalysis/", + "purityAnalysis/"}; + + enum HistRegEnum2 { + v0Full = 0, + v0PostK0sCheck, + v0PostMassCut, + v0PostSelectionCut, + recoK0sPreSel, + recoK0sPostSel, + recoTracksPreSel, + recoTracksPostSel, + recoAnalysisDir, + genAnalysisDir, + purityAnalysisDir + }; + enum IdentificationType { kTPCidentified = 0, kTOFidentified, @@ -255,7 +499,7 @@ struct NchCumulantsId { qaEventPostSel, qaTracksPreSel, qaTracksPostSel, - qaTracksIdfd + qaTracksIdfd, }; static constexpr std::string_view HistRegDire[] = { @@ -265,21 +509,14 @@ struct NchCumulantsId { "QA/tracks/postSel/", "QA/tracks/Idfd/"}; - enum PidEnum { - kPi = 0, // dont use kPion, kKaon, as these enumeration - kKa, // are already defined in $ROOTSYS/root/include/TPDGCode.h - kPr, - kEl, - kDe + enum ProcessTypeEnum { + doDataProcessing = 0, + doRecoProcessing, + doPurityProcessing, + doGenProcessing, + doSimProcessing }; - static constexpr std::string_view PidDire[] = { - "Pi/", - "Ka/", - "Pr/", - "El/", - "De/"}; - // particle identifications // tpc Selections @@ -648,10 +885,145 @@ struct NchCumulantsId { fillIdentificationQA(hist, track); // Look at Proton } - using MyAllTracks = soa::Join; + template + void fillGenTrackQA(HistogramRegistry& r, const TrackType& t) + { + auto base = + HIST(HistRegDire2[DIR]) + + HIST(PidDire[P]) + + HIST(ChargeDire[C]); + r.fill(base + HIST("h12_p"), t.p()); + r.fill(base + HIST("h13_pt"), t.pt()); + r.fill(base + HIST("h14_eta"), t.eta()); + r.fill(base + HIST("h15_phi"), t.phi()); + r.fill(base + HIST("h16_rapidity"), t.y()); + r.fill(base + HIST("h20_pt_eta"), t.pt(), t.eta()); + } + + template + void fillRecoTrackQA(HistogramRegistry& r, const TrackType& t) + { + auto base = + HIST(HistRegDire2[DIR]) + + HIST(PidDire[P]) + + HIST(ChargeDire[C]); + r.fill(base + HIST("h12_p"), t.p()); + r.fill(base + HIST("h13_pt"), t.pt()); + r.fill(base + HIST("h14_eta"), t.eta()); + r.fill(base + HIST("h15_phi"), t.phi()); + r.fill(base + HIST("h16_rapidity"), t.y()); + r.fill(base + HIST("h20_pt_eta"), t.pt(), t.eta()); + } + + template + void fillPurityTrackQA(HistogramRegistry& r, const TrackType& t) + { + auto base = + HIST(HistRegDire2[DIR]) + + HIST(PidDire[P]) + + HIST(ChargeDire[C]); + r.fill(base + HIST("h12_p"), t.p()); + r.fill(base + HIST("h13_pt"), t.pt()); + r.fill(base + HIST("h14_eta"), t.eta()); + r.fill(base + HIST("h15_phi"), t.phi()); + r.fill(base + HIST("h16_rapidity"), t.y()); + r.fill(base + HIST("h20_pt_eta"), t.pt(), t.eta()); + } + + template + void executeTrackAnalysisPart(const T& track, const int& trackIdTag, float& nP, float& nM, + const int& idMethodPi, const bool& trackIsPion, float& nAPi, float& nPi, + const int& idMethodKa, const bool& trackIsKaon, float& nAKa, float& nKa, + const int& idMethodPr, const bool& trackIsProton, float& nPr, float& nAPr, H& recoAnalysis) + { + if (flagUnusedVariableError) + LOG(info) << trackIdTag << idMethodPi << ":" << idMethodKa << ":" << idMethodPr; + if (track.sign() > 0) { + // fillRecoTrackQA(recoAnalysis, track); + nP++; + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h12_p"), track.p()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h13_pt"), track.pt()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h14_eta"), track.eta()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h15_phi"), track.phi()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h16_rapidity"), track.y()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h20_pt_eta"), track.pt(), track.eta()); + } + if (track.sign() < 0) { + // fillRecoTrackQA(recoAnalysis, track); + nM++; + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h12_p"), track.p()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h13_pt"), track.pt()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h14_eta"), track.eta()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h15_phi"), track.phi()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h16_rapidity"), track.y()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h20_pt_eta"), track.pt(), track.eta()); + } + + if (trackIsPion) { + // if (idMethodPi == kTPCidentified) { + // fillIdentificationQA(hist, track); // set hist as recoAnalysis after tpcId etc add true + // } else if (idMethodPi == kTPCTOFidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodPi == kUnidentified) { + // fillIdentificationQA(hist, track); + // } + if (track.sign() > 0) { + nPi++; + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAPi++; + fillRecoTrackQA(recoAnalysis, track); + } + // fillRecoTrackQA(recoAnalysis, track); + } + if (trackIsKaon) { + // if (idMethodKa == kTPCidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodKa == kTPCTOFidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodKa == kUnidentified) { + // fillIdentificationQA(hist, track); + // } + if (track.sign() > 0) { + nKa++; + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAKa++; + fillRecoTrackQA(recoAnalysis, track); + } + // fillRecoTrackQA(recoAnalysis, track); + } + if (trackIsProton) { + // if (idMethodPr == kTPCidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodPr == kTPCTOFidentified) { + // fillIdentificationQA(hist, track); + // } else if (idMethodPr == kUnidentified) { + // fillIdentificationQA(hist, track); + // } + if (track.sign() > 0) { + nPr++; + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAPr++; + fillRecoTrackQA(recoAnalysis, track); + } + // fillRecoTrackQA(recoAnalysis, track); + } + + // recoAnalysis.fill(HIST("recoAnalysis/SelectedTrack_IdentificationTag"), trackIdTag); + } + + using MyAllTracks = soa::Join; using MyCollisions = soa::Join; + + using MyTracksWithMclabels = soa::Join; + using MyCollisionsWithMcLabels = soa::Join; + // tracks and collision filters Filter col = aod::evsel::sel8 == true; Filter colFilter = nabs(aod::collision::posZ) < cfgCutPosZ; @@ -664,94 +1036,639 @@ struct NchCumulantsId { using MyFilteredCol = soa::Filtered; using MyFilteredTracks = soa::Filtered; + using MyFilteredColsWithMcLabels = soa::Filtered; + using MyFilteredTracksWithMcLabels = soa::Filtered; + // manual sliceby SliceCache cache; + Preslice tracksPerCollisionPreslice = o2::aod::track::collisionId; + Preslice mctracksPerCollisionPreslice = o2::aod::track::collisionId; - void process(MyFilteredCol const& collisions, MyFilteredTracks const& tracks) + template + void executeAnalysis(const C& collisions, const T& tracks) { - for (const auto& col : collisions) { - - int nP = 0; - int nM = 0; - int nCh = 0; - int nT = 0; - int nPr = 0; - int nAPr = 0; - int nKa = 0; - int nAKa = 0; - int nPi = 0; - int nAPi = 0; - // group tracks manually with corresponding collision using col id; - const uint64_t collIdx = col.globalIndex(); - const auto tracksTablePerColl = tracks.sliceBy(tracksPerCollisionPreslice, collIdx); - - for (const auto& track : tracksTablePerColl) { - - fillTrackQA(track); - - if (track.sign() == 1) { - nP++; - } - if (track.sign() == -1) { - nM++; - } + float nP = 0; + float nM = 0; + float nCh = 0; + float nT = 0; + float nPr = 0; + float nAPr = 0; + float nKa = 0; + float nAKa = 0; + float nPi = 0; + float nAPi = 0; + + bool trackIsPion = false; + bool trackIsKaon = false; + bool trackIsProton = false; + + int trackIdTag = 0; + int idMethodPi = kUnidentified; + int idMethodKa = kUnidentified; + int idMethodPr = kUnidentified; + + int ptEtaBin = -1; + + if constexpr (analysisType == doDataProcessing) { + for (const auto& col : collisions) { + nP = 0; + nM = 0; + nCh = 0; + nT = 0; + nPr = 0; + nAPr = 0; + nKa = 0; + nAKa = 0; + nPi = 0; + nAPi = 0; + + // group tracks manually with corresponding collision using col id; + const uint64_t collIdx = col.globalIndex(); + const auto tracksTablePerColl = tracks.sliceBy(tracksPerCollisionPreslice, collIdx); + + for (const auto& track : tracksTablePerColl) { + + ptEtaBin = hPtEtaForBinSearch->FindBin(track.pt(), track.eta()); // Find Track Bin for efficiency correction + + fillTrackQA(track); - int idMethod; - // pion - if (selPion(track, idMethod)) { if (track.sign() == 1) { - nPi++; + // nP++; + nP += hPtEtaForEffCorrection[kCh][kPos]->GetBinContent(ptEtaBin); } if (track.sign() == -1) { - nAPi++; + nM += hPtEtaForEffCorrection[kCh][kNeg]->GetBinContent(ptEtaBin); } - if (idMethod == kTPCidentified) - fillIdentificationQA(hist, track); - if (idMethod == kTPCTOFidentified) - fillIdentificationQA(hist, track); - } - // kaon - if (selKaon(track, idMethod)) { - if (track.sign() == 1) { - nKa++; + int idMethod; + // pion + if (selPion(track, idMethod)) { + if (track.sign() == 1) { + nPi += hPtEtaForEffCorrection[kPi][kPos]->GetBinContent(ptEtaBin); + } + if (track.sign() == -1) { + nAPi += hPtEtaForEffCorrection[kPi][kNeg]->GetBinContent(ptEtaBin); + } + + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); } - if (track.sign() == -1) { - nAKa++; + // kaon + if (selKaon(track, idMethod)) { + if (track.sign() == 1) { + nKa += hPtEtaForEffCorrection[kKa][kPos]->GetBinContent(ptEtaBin); + } + if (track.sign() == -1) { + nAKa += hPtEtaForEffCorrection[kKa][kNeg]->GetBinContent(ptEtaBin); + } + + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); } + // proton + if (selProton(track, idMethod)) { + if (track.sign() == 1) { + nPr += hPtEtaForEffCorrection[kPr][kPos]->GetBinContent(ptEtaBin); + } + if (track.sign() == -1) { + nAPr += hPtEtaForEffCorrection[kPr][kNeg]->GetBinContent(ptEtaBin); + } + + if (idMethod == kTPCidentified) + fillIdentificationQA(hist, track); + if (idMethod == kTPCTOFidentified) + fillIdentificationQA(hist, track); + } + } // track loop ends + nCh = nP - nM; + nT = nP + nM; + + fillCollQA(col, nCh, nT); - if (idMethod == kTPCidentified) - fillIdentificationQA(hist, track); - if (idMethod == kTPCTOFidentified) - fillIdentificationQA(hist, track); + hist.fill(HIST("sparse1"), nCh, nP, nM, nPr, nAPr, nKa, nAKa, nT, col.centFT0M()); + hist.fill(HIST("sparse2"), nCh, nP, nM, nPi, nAPi, nKa, nAKa, nT, col.centFT0M()); + + } // collision loop ends + } else if constexpr (analysisType == doRecoProcessing || analysisType == doPurityProcessing) { + + for (const auto& col : collisions) { + + if (!col.has_mcCollision()) { + LOG(warning) << "No MC collision for this collision, skip..."; + continue; } - // proton - if (selProton(track, idMethod)) { - if (track.sign() == 1) { - nPr++; + float nP = 0; + float nM = 0; + float nCh = 0; + float nT = 0; + float nPr = 0; + float nAPr = 0; + float nKa = 0; + float nAKa = 0; + float nPi = 0; + float nAPi = 0; + // group tracks manually with corresponding collision using col id; + const uint64_t collIdx = col.globalIndex(); + const auto tracksTablePerColl = tracks.sliceBy(mctracksPerCollisionPreslice, collIdx); + + for (const auto& track : tracksTablePerColl) { + + if (!track.has_mcParticle()) { + LOG(warning) << "No MC Particle for this track, skip..."; + continue; } - if (track.sign() == -1) { - nAPr++; + + auto mcPart = track.mcParticle(); + + fillTrackQA(track); + + // Do Proper Track Identification + trackIsPion = false; + trackIsKaon = false; + trackIsProton = false; + + trackIdTag = 0; + idMethodPi = kUnidentified; + idMethodKa = kUnidentified; + idMethodPr = kUnidentified; + + if (selPion(track, idMethodPi)) { + trackIsPion = true; + BITSET(trackIdTag, ID_BIT_PI); } + if (selKaon(track, idMethodKa)) { + trackIsKaon = true; + BITSET(trackIdTag, ID_BIT_KA); + } + if (selProton(track, idMethodPr)) { + trackIsProton = true; + BITSET(trackIdTag, ID_BIT_PR); + } + + if constexpr (analysisType == doPurityProcessing) { + if (trackIsPion) { + if (track.sign() > 0 && mcPart.pdgCode() != kPiPlus) { + trackIsPion = false; + } + if (track.sign() < 0 && mcPart.pdgCode() != kPiMinus) { + trackIsPion = false; + } + } + if (trackIsKaon) { + if (track.sign() > 0 && mcPart.pdgCode() != kKPlus) { + trackIsKaon = false; + } + if (track.sign() < 0 && mcPart.pdgCode() != kKMinus) { + trackIsKaon = false; + } + } + if (trackIsProton) { + if (track.sign() > 0 && mcPart.pdgCode() != kProton) { + trackIsProton = false; + } + if (track.sign() < 0 && mcPart.pdgCode() != kProtonBar) { + trackIsProton = false; + } + } + } + + executeTrackAnalysisPart(track, trackIdTag, nP, nM, + idMethodPi, trackIsPion, nAPi, nPi, + idMethodKa, trackIsKaon, nAKa, nKa, + idMethodPr, trackIsProton, nPr, nAPr, recoAnalysis); - if (idMethod == kTPCidentified) - fillIdentificationQA(hist, track); - if (idMethod == kTPCTOFidentified) - fillIdentificationQA(hist, track); + } // track itteration ends + + nCh = nP - nM; + nT = nP + nM; + + fillCollQA(col, nCh, nT); + + hist.fill(HIST("sparse1"), nCh, nP, nM, nPr, nAPr, nKa, nAKa, nT, col.centFT0M()); + hist.fill(HIST("sparse2"), nCh, nP, nM, nPi, nAPi, nKa, nAKa, nT, col.centFT0M()); + + } // collision ends + } + } + + void processRun3(MyFilteredCol const& collisions, MyFilteredTracks const& tracks) + { + executeAnalysis(collisions, tracks); + } + PROCESS_SWITCH(NchCumulantsId, processRun3, "Process for Run-3", false); + + void processMcRecco(MyFilteredColsWithMcLabels const& collisions, MyFilteredTracksWithMcLabels const& tracks, aod::McParticles const&) + { + executeAnalysis(collisions, tracks); + } + PROCESS_SWITCH(NchCumulantsId, processMcRecco, "Process for MC Recco", false); + + void processPurity(MyFilteredColsWithMcLabels const& collisions, MyFilteredTracksWithMcLabels const& tracks, aod::McParticles const&) + { + executeAnalysis(collisions, tracks); + } + PROCESS_SWITCH(NchCumulantsId, processPurity, "Process for MC generated purity", false); + // process fun is over + + // process for truth and response matrix starts now + + Preslice mcTracksPerMcCollisionPreslice = o2::aod::mcparticle::mcCollisionId; + + using MyMcCollisions = aod::McCollisions; + + void processGen(MyMcCollisions const&, MyFilteredColsWithMcLabels const& collisions, aod::McParticles const& mcParticles) + { + for (const auto& col : collisions) { + if (!col.has_mcCollision()) { + LOG(warning) << "No MC collision for this event, skip..."; + continue; + } + const auto& mcColl = col.mcCollision(); + + // ---- apply same Vz cut as data/reco ---- + if (std::abs(mcColl.posZ()) > cfgCutPosZ) { + continue; // reject GEN events outside acceptance + } + // slice MCParticles for this MC collision + const auto mcTracksTablePerMcColl = mcParticles.sliceBy(mcTracksPerMcCollisionPreslice, mcColl.globalIndex()); + + float nP = 0; + float nM = 0; + float nCh = 0; + float nT = 0; + float nPr = 0; + float nAPr = 0; + float nKa = 0; + float nAKa = 0; + float nPi = 0; + float nAPi = 0; + for (const auto& mcTrack : mcTracksTablePerMcColl) { + if (!mcTrack.isPhysicalPrimary()) { + continue; + } + // pt / eta acceptance (same as RECO acceptance) + if (mcTrack.pt() <= cfgCutPtMin || + mcTrack.pt() >= cfgCutPtMax || + std::abs(mcTrack.eta()) >= cfgCutEta) { + continue; } - } // track itteration ends + int pdg = mcTrack.pdgCode(); + + if (pdg == kPiPlus || pdg == kKPlus || pdg == kProton || pdg == kPositron || pdg == kMuonPlus || pdg == kDeuteron) { + nP++; + + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h12_p"), mcTrack.p()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h13_pt"), mcTrack.pt()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h14_eta"), mcTrack.eta()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h15_phi"), mcTrack.phi()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h16_rapidity"), mcTrack.y()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + } else if (pdg == kPiMinus || pdg == kKMinus || pdg == kProtonBar || pdg == kElectron || pdg == kMuonMinus || pdg == -kDeuteron) { + nM++; + + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h12_p"), mcTrack.p()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h13_pt"), mcTrack.pt()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h14_eta"), mcTrack.eta()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h15_phi"), mcTrack.phi()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h16_rapidity"), mcTrack.y()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + } + // ----- Pions ----- + if (pdg == kPiPlus) { + nPi++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kPiMinus) { + nAPi++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kKPlus) { + nKa++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kKMinus) { + nAKa++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kProton) { + nPr++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kProtonBar) { + nAPr++; + fillGenTrackQA(genAnalysis, mcTrack); + } + } nCh = nP - nM; nT = nP + nM; - fillCollQA(col, nCh, nT); - hist.fill(HIST("sparse1"), nCh, nP, nM, nPr, nAPr, nKa, nAKa, nT, col.centFT0M()); hist.fill(HIST("sparse2"), nCh, nP, nM, nPi, nAPi, nKa, nAKa, nT, col.centFT0M()); - } // collision ends - } // process ends + } + PROCESS_SWITCH(NchCumulantsId, processGen, "Process for MC generated or truth", false); + + void processSim(MyFilteredColsWithMcLabels const& collisions, MyFilteredTracksWithMcLabels const& tracks, aod::McCollisions const& mcCollisions, aod::McParticles const& mcParticles) + { + if (flagUnusedVariableError) + LOG(info) << mcCollisions.size(); + bool trackIsPion = false; + bool trackIsKaon = false; + bool trackIsProton = false; + + int trackIdTag = 0; + int idMethodPi = kUnidentified; + int idMethodKa = kUnidentified; + int idMethodPr = kUnidentified; + + int ptEtaBin = -1; + + for (auto const& col : collisions) { + + if (!col.has_mcCollision()) { + LOG(warning) << "No MC collision for this collision, skip..."; + continue; + } + auto mcCollision = col.mcCollision(); + + if (checkCollPosZMc && std::abs(mcCollision.posZ()) > cfgCutPosZ) + continue; + + // slice reco tracks to this collision + const uint64_t collIdx = col.globalIndex(); + const auto tracksTablePerColl = tracks.sliceBy(mctracksPerCollisionPreslice, collIdx); + + // slice mc particles to mc collisions + const auto mcTracksTablePerMcColl = mcParticles.sliceBy(mcTracksPerMcCollisionPreslice, mcCollision.globalIndex()); + + // Denominator -- Generator level(truth) + + float nPGen = 0, nMGen = 0, nChGen = 0, nTGen = 0; + float nPrGen = 0, nAPrGen = 0; + float nKaGen = 0, nAKaGen = 0; + float nPiGen = 0, nAPiGen = 0; + + for (const auto& mcTrack : mcTracksTablePerMcColl) { + if (!mcTrack.isPhysicalPrimary()) + continue; + if (mcTrack.pt() <= cfgCutPtMin || + mcTrack.pt() >= cfgCutPtMax || + std::abs(mcTrack.eta()) >= cfgCutEta) + continue; + + int pdg = mcTrack.pdgCode(); + + if (pdg == kPiPlus || pdg == kKPlus || pdg == kProton || pdg == kPositron || pdg == kMuonPlus || pdg == kDeuteron) { + nPGen++; + + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h12_p"), mcTrack.p()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h13_pt"), mcTrack.pt()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h14_eta"), mcTrack.eta()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h15_phi"), mcTrack.phi()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h16_rapidity"), mcTrack.y()); + genAnalysis.fill(HIST("genAnalysis/Charge/Pos/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + } else if (pdg == kPiMinus || pdg == kKMinus || pdg == kProtonBar || pdg == kElectron || pdg == kMuonMinus || pdg == -kDeuteron) { + nMGen++; + + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h12_p"), mcTrack.p()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h13_pt"), mcTrack.pt()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h14_eta"), mcTrack.eta()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h15_phi"), mcTrack.phi()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h16_rapidity"), mcTrack.y()); + genAnalysis.fill(HIST("genAnalysis/Charge/Neg/h20_pt_eta"), mcTrack.pt(), mcTrack.eta()); + } + + if (pdg == kPiPlus) { + nPiGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kPiMinus) { + nAPiGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kKPlus) { + nKaGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kKMinus) { + nAKaGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kProton) { + nPrGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } else if (pdg == kProtonBar) { + nAPrGen++; + fillGenTrackQA(genAnalysis, mcTrack); + } + + } // particle/track loop for gen ends + nChGen = nPGen - nMGen; + nTGen = nPGen + nMGen; + + // ── Fill GEN sparse (denominator) ──────────────────────── + hist.fill(HIST("sim/gen/sparse1"), nChGen, nPGen, nMGen, + nPrGen, nAPrGen, nKaGen, nAKaGen, nTGen, + col.centFT0M()); + hist.fill(HIST("sim/gen/sparse2"), nChGen, nPGen, nMGen, + nPiGen, nAPiGen, nKaGen, nAKaGen, nTGen, + col.centFT0M()); + // + // Numerator - Reconstructed + truth matched + // reco->selFunc passed, no pdg + // purity -> selFunc matched with pdg matched + // + float nPRec = 0, nMRec = 0, nChRec = 0, nTRec = 0; + float nPrRec = 0, nAPrRec = 0; + float nKaRec = 0, nAKaRec = 0; + float nPiRec = 0, nAPiRec = 0; + + // purity counters — separate from reco + float nPPur = 0, nMPur = 0, nChPur = 0, nTPur = 0; + float nPrPur = 0, nAPrPur = 0; + float nKaPur = 0, nAKaPur = 0; + float nPiPur = 0, nAPiPur = 0; + + for (const auto& track : tracksTablePerColl) { + + if (!track.has_mcParticle()) { + LOG(warning) << "No MC Particle for this track, skip..."; + continue; + } + auto mcPart = track.mcParticle(); + if (!mcPart.isPhysicalPrimary()) + continue; + int pdg = mcPart.pdgCode(); + + fillTrackQA(track); + + trackIsPion = false; + trackIsKaon = false; + trackIsProton = false; + trackIdTag = 0; + idMethodPi = kUnidentified; + idMethodKa = kUnidentified; + idMethodPr = kUnidentified; + + if (selPion(track, idMethodPi)) { + trackIsPion = true; + BITSET(trackIdTag, ID_BIT_PI); + } + if (selKaon(track, idMethodKa)) { + trackIsKaon = true; + BITSET(trackIdTag, ID_BIT_KA); + } + if (selProton(track, idMethodPr)) { + trackIsProton = true; + BITSET(trackIdTag, ID_BIT_PR); + } + + // bool isKnownCharged = (std::abs(pdg) == kPiPlus || + // std::abs(pdg) == kKPlus || + // std::abs(pdg) == kProton || + // std::abs(pdg) == kElectron || + // std::abs(pdg) == kMuonMinus || + // std::abs(pdg) == kDeuteron); + + ptEtaBin = hPtEtaForBinSearch->FindBin(track.pt(), track.eta()); // Find Track Bin for efficiency correction + + if (track.sign() > 0) { + nPRec += hPtEtaForEffCorrection[kCh][kPos]->GetBinContent(ptEtaBin); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h12_p"), track.p()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h13_pt"), track.pt()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h14_eta"), track.eta()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h15_phi"), track.phi()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h16_rapidity"), track.y()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Pos/h20_pt_eta"), track.pt(), track.eta()); + } else if (track.sign() < 0) { + nMRec += hPtEtaForEffCorrection[kCh][kNeg]->GetBinContent(ptEtaBin); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h12_p"), track.p()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h13_pt"), track.pt()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h14_eta"), track.eta()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h15_phi"), track.phi()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h16_rapidity"), track.y()); + recoAnalysis.fill(HIST("recoAnalysis/Charge/Neg/h20_pt_eta"), track.pt(), track.eta()); + } + + // species reco — sel passes, PDG not checked (raw reco) + if (trackIsPion) { + if (track.sign() > 0) { + nPiRec += hPtEtaForEffCorrection[kPi][kPos]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAPiRec += hPtEtaForEffCorrection[kPi][kNeg]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } + } else if (trackIsKaon) { + if (track.sign() > 0) { + nKaRec += hPtEtaForEffCorrection[kKa][kPos]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAKaRec += hPtEtaForEffCorrection[kKa][kNeg]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } + } else if (trackIsProton) { + if (track.sign() > 0) { + nPrRec += hPtEtaForEffCorrection[kPr][kPos]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } else if (track.sign() < 0) { + nAPrRec += hPtEtaForEffCorrection[kPr][kNeg]->GetBinContent(ptEtaBin); + fillRecoTrackQA(recoAnalysis, track); + } + } + // purity check - check pdg aginst sign + bool purityPion = false; + if (trackIsPion) { + if (track.sign() > 0 && pdg == kPiPlus) + purityPion = true; + if (track.sign() < 0 && pdg == kPiMinus) + purityPion = true; + } + + bool purityKaon = false; + if (trackIsKaon) { + if (track.sign() > 0 && pdg == kKPlus) + purityKaon = true; + if (track.sign() < 0 && pdg == kKMinus) + purityKaon = true; + } + + bool purityProton = false; + if (trackIsProton) { + if (track.sign() > 0 && pdg == kProton) + purityProton = true; + if (track.sign() < 0 && pdg == kProtonBar) + purityProton = true; + } + + // charge purity — track.sign() + isKnownCharged + PDG sign consistency + bool pdgPositive = (pdg == kPiPlus || pdg == kKPlus || pdg == kProton || + pdg == kPositron || pdg == kMuonPlus || pdg == kDeuteron); + bool pdgNegative = (pdg == kPiMinus || pdg == kKMinus || pdg == kProtonBar || + pdg == kElectron || pdg == kMuonMinus || pdg == -kDeuteron); + + if (track.sign() > 0 && pdgPositive) { + nPPur++; + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h12_p"), track.p()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h13_pt"), track.pt()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h14_eta"), track.eta()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h15_phi"), track.phi()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h16_rapidity"), track.y()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Pos/h20_pt_eta"), track.pt(), track.eta()); + } else if (track.sign() < 0 && pdgNegative) { + nMPur++; + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h12_p"), track.p()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h13_pt"), track.pt()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h14_eta"), track.eta()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h15_phi"), track.phi()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h16_rapidity"), track.y()); + purityAnalysis.fill(HIST("purityAnalysis/Charge/Neg/h20_pt_eta"), track.pt(), track.eta()); + } + + // species purity fill + if (purityPion) { + if (track.sign() > 0) { + nPiPur++; + fillPurityTrackQA(purityAnalysis, track); + } else { + nAPiPur++; + fillPurityTrackQA(purityAnalysis, track); + } + } else if (purityKaon) { + if (track.sign() > 0) { + nKaPur++; + fillPurityTrackQA(purityAnalysis, track); + } else { + nAKaPur++; + fillPurityTrackQA(purityAnalysis, track); + } + } else if (purityProton) { + if (track.sign() > 0) { + nPrPur++; + fillPurityTrackQA(purityAnalysis, track); + } else { + nAPrPur++; + fillPurityTrackQA(purityAnalysis, track); + } + } + } + nChRec = nPRec - nMRec; + nTRec = nPRec + nMRec; + nChPur = nPPur - nMPur; + nTPur = nPPur + nMPur; + + // ── fill reco histos ───────────────────────────────────── + hist.fill(HIST("sim/reco/sparse1"), nChRec, nPRec, nMRec, + nPrRec, nAPrRec, nKaRec, nAKaRec, nTRec, col.centFT0M()); + hist.fill(HIST("sim/reco/sparse2"), nChRec, nPRec, nMRec, + nPiRec, nAPiRec, nKaRec, nAKaRec, nTRec, col.centFT0M()); + + // ── fill purity histos ─────────────────────────────────── + hist.fill(HIST("sim/purity/sparse1"), nChPur, nPPur, nMPur, + nPrPur, nAPrPur, nKaPur, nAKaPur, nTPur, col.centFT0M()); + hist.fill(HIST("sim/purity/sparse2"), nChPur, nPPur, nMPur, + nPiPur, nAPiPur, nKaPur, nAKaPur, nTPur, col.centFT0M()); + + } // common collision loop ends + } // process sim ends + PROCESS_SWITCH(NchCumulantsId, processSim, "Process Sim: Gen + Reco + Purity", true); }; // structure ends WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) 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/Femto/Core/baseSelection.h b/PWGCF/Femto/Core/baseSelection.h index fcce0c11c13..5bc9a598c1f 100644 --- a/PWGCF/Femto/Core/baseSelection.h +++ b/PWGCF/Femto/Core/baseSelection.h @@ -18,9 +18,11 @@ #include "PWGCF/Femto/Core/selectionContainer.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include -#include "fairlogger/Logger.h" +#include #include #include diff --git a/PWGCF/Femto/Core/cascadeBuilder.h b/PWGCF/Femto/Core/cascadeBuilder.h index f787543f945..2de7099ee6f 100644 --- a/PWGCF/Femto/Core/cascadeBuilder.h +++ b/PWGCF/Femto/Core/cascadeBuilder.h @@ -23,11 +23,11 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/cascadeHistManager.h b/PWGCF/Femto/Core/cascadeHistManager.h index 3944dcd761a..d1218ec4e8e 100644 --- a/PWGCF/Femto/Core/cascadeHistManager.h +++ b/PWGCF/Femto/Core/cascadeHistManager.h @@ -20,12 +20,17 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include + +#include +#include #include +#include #include #include #include diff --git a/PWGCF/Femto/Core/closePairRejection.h b/PWGCF/Femto/Core/closePairRejection.h index 63a707f9ad8..3edc198aba9 100644 --- a/PWGCF/Femto/Core/closePairRejection.h +++ b/PWGCF/Femto/Core/closePairRejection.h @@ -16,20 +16,24 @@ #ifndef PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_ #define PWGCF_FEMTO_CORE_CLOSEPAIRREJECTION_H_ -#include "RecoDecay.h" - #include "PWGCF/Femto/Core/histManager.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include + +#include +#include +#include +#include +#include #include #include #include #include +#include #include #include +#include #include #include #include diff --git a/PWGCF/Femto/Core/closeTripletRejection.h b/PWGCF/Femto/Core/closeTripletRejection.h index 5bb006e04ab..dd1bd0182c0 100644 --- a/PWGCF/Femto/Core/closeTripletRejection.h +++ b/PWGCF/Femto/Core/closeTripletRejection.h @@ -18,8 +18,8 @@ #include "PWGCF/Femto/Core/closePairRejection.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include #include #include diff --git a/PWGCF/Femto/Core/collisionBuilder.h b/PWGCF/Femto/Core/collisionBuilder.h index 2d0aa6b532d..e6b77102023 100644 --- a/PWGCF/Femto/Core/collisionBuilder.h +++ b/PWGCF/Femto/Core/collisionBuilder.h @@ -23,15 +23,15 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/Zorro.h" - -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include + +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/collisionHistManager.h b/PWGCF/Femto/Core/collisionHistManager.h index 5233c4799e0..a4bbda81b6f 100644 --- a/PWGCF/Femto/Core/collisionHistManager.h +++ b/PWGCF/Femto/Core/collisionHistManager.h @@ -19,11 +19,13 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include #include +#include +#include #include #include #include diff --git a/PWGCF/Femto/Core/femtoUtils.h b/PWGCF/Femto/Core/femtoUtils.h index 26e7649776d..1da7fde8635 100644 --- a/PWGCF/Femto/Core/femtoUtils.h +++ b/PWGCF/Femto/Core/femtoUtils.h @@ -16,22 +16,19 @@ #ifndef PWGCF_FEMTO_CORE_FEMTOUTILS_H_ #define PWGCF_FEMTO_CORE_FEMTOUTILS_H_ -#include "Common/Core/TableHelper.h" +#include -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/InitContext.h" +#include +#include +#include -#include "TPDGCode.h" - -#include "fairlogger/Logger.h" +#include #include +#include #include -#include #include #include -#include namespace o2::analysis::femto { @@ -66,7 +63,7 @@ float itsSignal(T const& track) return static_cast(signal); }; -inline double getMass(int pdgCode) +inline double getPdgMass(int pdgCode) { // use this function instead of TDatabasePDG to return masses defined in the PhysicsConstants.h header // this approach saves a lot of memory and important partilces like deuteron are missing in TDatabasePDG anyway @@ -122,7 +119,7 @@ inline double getMass(int pdgCode) mass = o2::constants::physics::MassOmegaMinus; break; default: - LOG(fatal) << "PDG code is not suppored"; + LOG(warn) << "PDG code is not suppored. Return 0..."; } return mass; } @@ -209,11 +206,16 @@ inline bool enableTable(const char* tableName, int userSetting, o2::framework::I return required; } -template -using HasMass = decltype(std::declval().mass()); +// template +// using HasMass = decltype(std::declval().mass()); +// +// template +// using HasSign = decltype(std::declval().sign()); template -using HasSign = decltype(std::declval().sign()); +concept HasMass = requires(T t) { + { t.mass() } -> std::convertible_to; // or double, whatever mass() returns +}; template inline int signum(T x) diff --git a/PWGCF/Femto/Core/histManager.h b/PWGCF/Femto/Core/histManager.h index 19b1b0ce502..ceadf18f38a 100644 --- a/PWGCF/Femto/Core/histManager.h +++ b/PWGCF/Femto/Core/histManager.h @@ -16,7 +16,7 @@ #ifndef PWGCF_FEMTO_CORE_HISTMANAGER_H_ #define PWGCF_FEMTO_CORE_HISTMANAGER_H_ -#include "Framework/HistogramSpec.h" +#include #include #include diff --git a/PWGCF/Femto/Core/kinkBuilder.h b/PWGCF/Femto/Core/kinkBuilder.h index acf74690337..728197f049f 100644 --- a/PWGCF/Femto/Core/kinkBuilder.h +++ b/PWGCF/Femto/Core/kinkBuilder.h @@ -24,13 +24,13 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Common/Core/RecoDecay.h" +#include -#include "CommonConstants/MathConstants.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/kinkHistManager.h b/PWGCF/Femto/Core/kinkHistManager.h index f6c672c3200..b3f27e3f4e0 100644 --- a/PWGCF/Femto/Core/kinkHistManager.h +++ b/PWGCF/Femto/Core/kinkHistManager.h @@ -21,12 +21,17 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include + +#include +#include #include +#include #include #include #include diff --git a/PWGCF/Femto/Core/mcBuilder.h b/PWGCF/Femto/Core/mcBuilder.h index 038ad432df8..30f6210c027 100644 --- a/PWGCF/Femto/Core/mcBuilder.h +++ b/PWGCF/Femto/Core/mcBuilder.h @@ -21,10 +21,11 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" +#include +#include +#include -#include "fairlogger/Logger.h" +#include #include #include diff --git a/PWGCF/Femto/Core/modes.h b/PWGCF/Femto/Core/modes.h index bf337fab232..45c0db54f63 100644 --- a/PWGCF/Femto/Core/modes.h +++ b/PWGCF/Femto/Core/modes.h @@ -118,20 +118,6 @@ constexpr const char* mcOriginToString(McOrigin origin) } } -constexpr bool - hasMass(Particle p) -{ - switch (p) { - case Particle::kV0: - case Particle::kTwoTrackResonance: - case Particle::kKink: - case Particle::kCascade: - return true; - default: - return false; - } -} - enum class Track : o2::aod::femtodatatypes::TrackType { kTrack, kV0Daughter, diff --git a/PWGCF/Femto/Core/pairBuilder.h b/PWGCF/Femto/Core/pairBuilder.h index 34c360f4943..af6e9aa51bb 100644 --- a/PWGCF/Femto/Core/pairBuilder.h +++ b/PWGCF/Femto/Core/pairBuilder.h @@ -30,10 +30,11 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include -#include "fairlogger/Logger.h" +#include #include #include @@ -596,13 +597,28 @@ class PairTrackV0Builder mTrackCleaner.init(confTrackCleaner); mV0Cleaner.init(confV0Cleaner); + int pdgCodePosDau = 0; + int pdgCodeNegDau = 0; + if (modes::isEqual(v0Type, modes::V0::kK0short)) { + pdgCodeNegDau = kPiPlus; + pdgCodeNegDau = kPiMinus; + } else if (modes::isEqual(v0Type, modes::V0::kLambda) || modes::isEqual(v0Type, modes::V0::kAntiLambda)) { + if (confV0Selection.sign.value > 0) { + pdgCodeNegDau = kProton; + pdgCodeNegDau = kPiMinus; + } else { + pdgCodeNegDau = kProtonBar; + pdgCodeNegDau = kPiPlus; + } + } + mPairHistManagerSe.template init(registry, pairHistSpec, confPairBinning, confPairCuts); - mPairHistManagerSe.setMass(confTrackSelection.pdgCodeAbs.value, confV0Selection.pdgCodeAbs.value); + mPairHistManagerSe.setMass(confTrackSelection.pdgCodeAbs.value, 0, 0, confV0Selection.pdgCodeAbs.value, pdgCodePosDau, pdgCodeNegDau); mPairHistManagerSe.setCharge(confTrackSelection.chargeAbs.value, 1); mCprSe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); mPairHistManagerMe.template init(registry, pairHistSpec, confPairBinning, confPairCuts); - mPairHistManagerMe.setMass(confTrackSelection.pdgCodeAbs.value, confV0Selection.pdgCodeAbs.value); + mPairHistManagerMe.setMass(confTrackSelection.pdgCodeAbs.value, 0, 0, confV0Selection.pdgCodeAbs.value, pdgCodePosDau, pdgCodeNegDau); mPairHistManagerMe.setCharge(confTrackSelection.chargeAbs.value, 1); mCprMe.init(registry, cprHistSpec, confCpr, confTrackSelection.chargeAbs.value); mPc.template init(confPairCuts); diff --git a/PWGCF/Femto/Core/pairCleaner.h b/PWGCF/Femto/Core/pairCleaner.h index 506a9dbc9a4..0d66be6721f 100644 --- a/PWGCF/Femto/Core/pairCleaner.h +++ b/PWGCF/Femto/Core/pairCleaner.h @@ -18,7 +18,7 @@ #include "PWGCF/Femto/Core/modes.h" -#include "fairlogger/Logger.h" +#include namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/pairHistManager.h b/PWGCF/Femto/Core/pairHistManager.h index 30c0916b67e..31efc4779a4 100644 --- a/PWGCF/Femto/Core/pairHistManager.h +++ b/PWGCF/Femto/Core/pairHistManager.h @@ -20,12 +20,14 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include #include #include @@ -75,6 +77,8 @@ enum PairHist { kKstarVsMtVsMass1VsMass2VsPt1VsPt2, kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, + // dalitz plots + kDalitz, // between a track and pos/neg daughter of another particle // mc kTrueKstarVsKstar, kTrueKtVsKt, @@ -106,6 +110,7 @@ struct ConfMixing : o2::framework::ConfigurableGroup { struct ConfPairBinning : o2::framework::ConfigurableGroup { std::string prefix = std::string("PairBinning"); + o2::framework::Configurable usePdgMass{"usePdgMass", true, "Use PDF masses for 4-vectors. If false, use reconstructed mass (if available)"}; o2::framework::Configurable plot1D{"plot1D", true, "Enable 1D histograms"}; o2::framework::Configurable plot2D{"plot2D", true, "Enable 2D histograms"}; o2::framework::Configurable plotKstarVsMtVsMult{"plotKstarVsMtVsMult", false, "Enable 3D histogram (Kstar Vs Mt Vs Mult)"}; @@ -119,6 +124,7 @@ struct ConfPairBinning : o2::framework::ConfigurableGroup { o2::framework::Configurable plotKstarVsMtVsMass1VsMass2VsPt1VsPt2{"plotKstarVsMtVsMass1VsMass2VsPt1VsPt2", false, "Enable 6D histogram (Kstar Vs Mt Vs Pt1 Vs Pt2 Vs Mass1 Vs Mass2)"}; o2::framework::Configurable plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult{"plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult", false, "Enable 7D histogram (Kstar Vs Mt Vs Pt1 Vs Pt2 Vs Mass1 Vs Mass2 Vs Mult)"}; o2::framework::Configurable plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent{"plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent", false, "Enable 8D histogram (Kstar Vs Mt Vs Pt1 Vs Pt2 Vs Mass1 Vs Mass2 Vs Mult Vs Cent)"}; + o2::framework::Configurable plotDalitz{"plotDalitz", false, "Enable dalitz plot"}; o2::framework::ConfigurableAxis kstar{"kstar", {{600, 0, 6}}, "kstar"}; o2::framework::ConfigurableAxis kt{"kt", {{600, 0, 6}}, "kt"}; o2::framework::ConfigurableAxis mt{"mt", {{500, 0.8, 5.8}}, "mt"}; @@ -126,8 +132,11 @@ struct ConfPairBinning : o2::framework::ConfigurableGroup { o2::framework::ConfigurableAxis centrality{"centrality", {{10, 0, 100}}, "centrality (mult. percentile)"}; o2::framework::ConfigurableAxis pt1{"pt1", {{100, 0, 6}}, "Pt binning for particle 1"}; o2::framework::ConfigurableAxis pt2{"pt2", {{100, 0, 6}}, "Pt binning for particle 2"}; - o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter)"}; - o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter)"}; + o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter, otherwise PDG mass)"}; + o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter, otherwise PDG mass)"}; + o2::framework::ConfigurableAxis dalitzMtot{"dalitzMtot", {{100, 0, 10}}, "Total invariant mass squared binning in darlitz plot"}; + o2::framework::ConfigurableAxis dalitzM12{"dalitzM12", {{100, 0, 10}}, "Mass12 binning of darlitz plot"}; + o2::framework::ConfigurableAxis dalitzM13{"dalitzM13", {{100, 0, 10}}, "Mass13 binning of darlitz plot"}; o2::framework::Configurable transverseMassType{"transverseMassType", static_cast(modes::TransverseMassType::kAveragePdgMass), "Type of transverse mass (0-> Average Pdg Mass, 1-> Reduced Pdg Mass, 2-> Mt from combined 4 vector)"}; }; @@ -168,20 +177,21 @@ constexpr std::array, kPairHistogramLast> {kKstarVsMass2, o2::framework::kTH2F, "hKstarVsMass2", "k* vs m_{2}; k* (GeV/#it{c}); m_{2} (GeV/#it{c}^{2})"}, {kMass1VsMass2, o2::framework::kTH2F, "hMass1VsMass2", "m_{1} vs m_{2}; m_{1} (GeV/#it{c}^{2}); m_{2} (GeV/#it{c}^{2})"}, // n-D - {kKstarVsMtVsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMult", "k* vs m_{T} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); Multiplicity"}, - {kKstarVsMtVsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMultVsCent", "k* vs m_{T} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); Multiplicity; Centrality (%)"}, + {kKstarVsMtVsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMult", "k* vs m_{T} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); Multiplicity;"}, + {kKstarVsMtVsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMultVsCent", "k* vs m_{T} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); Multiplicity; Centrality (%);"}, // n-D with pt - {kKstarVsMtVsPt1VsPt2, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2", "k* vs m_{T} vs p_{T,1} vs p_{T,2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c})"}, - {kKstarVsMtVsPt1VsPt2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2VsMult", "k* vs m_{T} vs p_{T,1} vs p_{T,2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity"}, - {kKstarVsMtVsPt1VsPt2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2VsMultVsCent", "k* vs m_{T} vs p_{T,1} vs p_{T,2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity; Centrality"}, + {kKstarVsMtVsPt1VsPt2, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2", "k* vs m_{T} vs p_{T,1} vs p_{T,2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c});"}, + {kKstarVsMtVsPt1VsPt2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2VsMult", "k* vs m_{T} vs p_{T,1} vs p_{T,2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity;"}, + {kKstarVsMtVsPt1VsPt2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsPt1VsPt2VsMultVsCent", "k* vs m_{T} vs p_{T,1} vs p_{T,2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity; Centrality;"}, // n-D with mass - {kKstarVsMtVsMass1VsMass2, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2", "k* vs m_{T} vs m_{1} vs m_{2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2})"}, - {kKstarVsMtVsMass1VsMass2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsMult", "k* vs m_{T} vs m_{1} vs m_{2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); Multiplicity"}, - {kKstarVsMtVsMass1VsMass2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsMultVsCent", "k* vs m_{T} vs m_{1} vs m_{2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); Multiplicity; Centrality (%)"}, + {kKstarVsMtVsMass1VsMass2, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2", "k* vs m_{T} vs m_{1} vs m_{2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2});"}, + {kKstarVsMtVsMass1VsMass2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsMult", "k* vs m_{T} vs m_{1} vs m_{2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); Multiplicity;"}, + {kKstarVsMtVsMass1VsMass2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsMultVsCent", "k* vs m_{T} vs m_{1} vs m_{2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); Multiplicity; Centrality (%);"}, // n-D with pt and mass - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c})"}, - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity"}, - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity; Centrality (%)"}, + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2}; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c});"}, + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2} vs multiplicity; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity;"}, + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, o2::framework::kTHnSparseF, "hKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent", "k* vs m_{T} vs m_{1} vs m_{2} vs p_{T,1} vs p_{T,2} vs multiplicity vs centrality; k* (GeV/#it{c}); m_{T} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); m_{1} (GeV/#it{c}^{2}); p_{T,1} (GeV/#it{c}); p_{T,2} (GeV/#it{c}); Multiplicity; Centrality (%);"}, + {kDalitz, o2::framework::kTHnSparseF, "hDalitz", "Dalitz plot; k* (GeV/#it{c}); m^{2}_{123} (GeV/#it{c}^{2})^{2}; m^{2}_{12} (GeV/#it{c}^{2})^{2}; m^{2}_{13} (GeV/#it{c}^{2})^{2};"}, {kTrueKstarVsKstar, o2::framework::kTH2F, "hTrueKstarVsKstar", "k*_{True} vs k*; k*_{True} (GeV/#it{c}); k* (GeV/#it{c})"}, {kTrueKtVsKt, o2::framework::kTH2F, "hTrueKtVsKt", "k_{T,True} vs k_{T}; k_{T,True} (GeV/#it{c}); k_{T} (GeV/#it{c})"}, {kTrueMtVsMt, o2::framework::kTH2F, "hTrueMtVsMt", "m_{T,True} vs m_{T}; m_{T,True} (GeV/#it{c}^{2}); m_{T} (GeV/#it{c}^{2})"}, @@ -189,35 +199,36 @@ constexpr std::array, kPairHistogramLast> {kTrueCentVsCent, o2::framework::kTH2F, "hTrueCentVsCent", "Centrality_{True} vs Centrality; Centrality_{True} (%); Centrality (%)"}, }}; -#define PAIR_HIST_ANALYSIS_MAP(conf) \ - {kKstar, {conf.kstar}}, \ - {kKt, {conf.kt}}, \ - {kMt, {conf.mt}}, \ - {kPt1VsPt2, {conf.pt1, conf.pt2}}, \ - {kPt1VsKstar, {conf.pt1, conf.kstar}}, \ - {kPt2VsKstar, {conf.pt2, conf.kstar}}, \ - {kPt1VsKt, {conf.pt1, conf.kt}}, \ - {kPt2VsKt, {conf.pt2, conf.kt}}, \ - {kPt1VsMt, {conf.pt1, conf.mt}}, \ - {kPt2VsMt, {conf.pt2, conf.mt}}, \ - {kKstarVsKt, {conf.kstar, conf.kt}}, \ - {kKstarVsMt, {conf.kstar, conf.mt}}, \ - {kKstarVsMult, {conf.kstar, conf.multiplicity}}, \ - {kKstarVsCent, {conf.kstar, conf.centrality}}, \ - {kKstarVsMass1, {conf.kstar, conf.mass1}}, \ - {kKstarVsMass2, {conf.kstar, conf.mass2}}, \ - {kMass1VsMass2, {conf.mass1, conf.mass2}}, \ - {kKstarVsMtVsMult, {conf.kstar, conf.mt, conf.multiplicity}}, \ - {kKstarVsMtVsMultVsCent, {conf.kstar, conf.mt, conf.multiplicity, conf.centrality}}, \ - {kKstarVsMtVsPt1VsPt2, {conf.kstar, conf.mt, conf.pt1, conf.pt2}}, \ - {kKstarVsMtVsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity}}, \ - {kKstarVsMtVsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, \ - {kKstarVsMtVsMass1VsMass2, {conf.kstar, conf.mt, conf.mass1, conf.mass2}}, \ - {kKstarVsMtVsMass1VsMass2VsMult, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.multiplicity}}, \ - {kKstarVsMtVsMass1VsMass2VsMultVsCent, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.multiplicity, conf.centrality}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2, conf.multiplicity}}, \ - {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, +#define PAIR_HIST_ANALYSIS_MAP(conf) \ + {kKstar, {conf.kstar}}, \ + {kKt, {conf.kt}}, \ + {kMt, {conf.mt}}, \ + {kPt1VsPt2, {conf.pt1, conf.pt2}}, \ + {kPt1VsKstar, {conf.pt1, conf.kstar}}, \ + {kPt2VsKstar, {conf.pt2, conf.kstar}}, \ + {kPt1VsKt, {conf.pt1, conf.kt}}, \ + {kPt2VsKt, {conf.pt2, conf.kt}}, \ + {kPt1VsMt, {conf.pt1, conf.mt}}, \ + {kPt2VsMt, {conf.pt2, conf.mt}}, \ + {kKstarVsKt, {conf.kstar, conf.kt}}, \ + {kKstarVsMt, {conf.kstar, conf.mt}}, \ + {kKstarVsMult, {conf.kstar, conf.multiplicity}}, \ + {kKstarVsCent, {conf.kstar, conf.centrality}}, \ + {kKstarVsMass1, {conf.kstar, conf.mass1}}, \ + {kKstarVsMass2, {conf.kstar, conf.mass2}}, \ + {kMass1VsMass2, {conf.mass1, conf.mass2}}, \ + {kKstarVsMtVsMult, {conf.kstar, conf.mt, conf.multiplicity}}, \ + {kKstarVsMtVsMultVsCent, {conf.kstar, conf.mt, conf.multiplicity, conf.centrality}}, \ + {kKstarVsMtVsPt1VsPt2, {conf.kstar, conf.mt, conf.pt1, conf.pt2}}, \ + {kKstarVsMtVsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity}}, \ + {kKstarVsMtVsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, \ + {kKstarVsMtVsMass1VsMass2, {conf.kstar, conf.mt, conf.mass1, conf.mass2}}, \ + {kKstarVsMtVsMass1VsMass2VsMult, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.multiplicity}}, \ + {kKstarVsMtVsMass1VsMass2VsMultVsCent, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.multiplicity, conf.centrality}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2, conf.multiplicity}}, \ + {kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, {conf.kstar, conf.mt, conf.mass1, conf.mass2, conf.pt1, conf.pt2, conf.multiplicity, conf.centrality}}, \ + {kDalitz, {conf.kstar, conf.dalitzMtot, conf.dalitzM12, conf.dalitzM13}}, #define PAIR_HIST_MC_MAP(conf) \ {kTrueKstarVsKstar, {conf.kstar, conf.kstar}}, \ @@ -283,6 +294,8 @@ class PairHistManager { mHistogramRegistry = registry; + mUsePdgMass = ConfPairBinning.usePdgMass.value; + // flags for histograms mPlot1d = ConfPairBinning.plot1D.value; mPlot2d = ConfPairBinning.plot2D.value; @@ -301,6 +314,8 @@ class PairHistManager mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult = ConfPairBinning.plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult.value; mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent = ConfPairBinning.plotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent.value; + mPlotDalitz = ConfPairBinning.plotDalitz.value; + // transverse mass type mMtType = static_cast(ConfPairBinning.transverseMassType.value); @@ -323,8 +338,18 @@ class PairHistManager void setMass(int PdgParticle1, int PdgParticle2) { - mPdgMass1 = o2::analysis::femto::utils::getMass(PdgParticle1); - mPdgMass2 = o2::analysis::femto::utils::getMass(PdgParticle2); + mPdgMass1 = utils::getPdgMass(PdgParticle1); + mPdgMass2 = utils::getPdgMass(PdgParticle2); + } + + void setMass(int PdgParticle1, int PdgPosDauParticle1, int PdgNegDauParticle1, int PdgParticle2, int PdgPosDauParticle2, int PdgNegDauParticle2) + { + mPdgMass1 = utils::getPdgMass(PdgParticle1); + mPdgMassPosDau1 = utils::getPdgMass(PdgPosDauParticle1); + mPdgMassNegDau1 = utils::getPdgMass(PdgNegDauParticle1); + mPdgMass2 = utils::getPdgMass(PdgParticle2); + mPdgMassPosDau2 = utils::getPdgMass(PdgPosDauParticle2); + mPdgMassNegDau2 = utils::getPdgMass(PdgNegDauParticle2); } void setCharge(int chargeAbsParticle1, int chargeAbsParticle2) { @@ -333,13 +358,37 @@ class PairHistManager mAbsCharge2 = std::abs(chargeAbsParticle2); } - template - void setPair(const T1& particle1, const T2& particle2) + template + void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable) { + // if one of the particles has a mass getter (like lambda), we cache the value for the filling later + // otherwise set it to the pdg mass + if constexpr (utils::HasMass) { + mRecoMass1 = particle1.mass(); + } else { + mRecoMass1 = mPdgMass1; + } + if constexpr (utils::HasMass) { + mRecoMass2 = particle2.mass(); + } else { + mRecoMass2 = mPdgMass2; + } + + // get mass for 4-vectors + double mass1 = 0.f; + double mass2 = 0.f; + if (mUsePdgMass) { + mass1 = mPdgMass1; + mass2 = mPdgMass2; + } else { + mass1 = mRecoMass1; + mass2 = mRecoMass2; + } + // pt in track table is calculated from 1/signedPt from the original track table // in case of He with Z=2, we have to rescale the pt with the absolute charge - mParticle1 = ROOT::Math::PtEtaPhiMVector(mAbsCharge1 * particle1.pt(), particle1.eta(), particle1.phi(), mPdgMass1); - mParticle2 = ROOT::Math::PtEtaPhiMVector(mAbsCharge2 * particle2.pt(), particle2.eta(), particle2.phi(), mPdgMass2); + mParticle1 = ROOT::Math::PtEtaPhiMVector(mAbsCharge1 * particle1.pt(), particle1.eta(), particle1.phi(), mass1); + mParticle2 = ROOT::Math::PtEtaPhiMVector(mAbsCharge2 * particle2.pt(), particle2.eta(), particle2.phi(), mass2); // set kT mKt = getKt(mParticle1, mParticle2); @@ -350,36 +399,37 @@ class PairHistManager // set kstar mKstar = getKstar(mParticle1, mParticle2); - // if one of the particles has a mass getter (like lambda), we cache the value for the filling later - // otherwise we continue to use the pdg mass - mMass1 = mPdgMass1; - if constexpr (modes::hasMass(particleType1)) { - mMass1 = particle1.mass(); - } - mMass2 = mPdgMass2; - if constexpr (modes::hasMass(particleType2)) { - mMass2 = particle2.mass(); + if (mPlotDalitz) { + if constexpr (modes::isEqual(particleType1, modes::Particle::kTrack) && modes::isEqual(particleType2, modes::Particle::kV0)) { + auto posDaughter = trackTable.rawIteratorAt(particle2.posDauId() - trackTable.offset()); + auto negDaughter = trackTable.rawIteratorAt(particle2.negDauId() - trackTable.offset()); + ROOT::Math::PtEtaPhiMVector posDau4v = ROOT::Math::PtEtaPhiMVector(posDaughter.pt(), posDaughter.eta(), posDaughter.phi(), mPdgMassPosDau2); + ROOT::Math::PtEtaPhiMVector negDau4v = ROOT::Math::PtEtaPhiMVector(negDaughter.pt(), negDaughter.eta(), negDaughter.phi(), mPdgMassNegDau2); + mMassTot2 = (mParticle1 + posDau4v + negDau4v).M2(); + mMass12 = (mParticle1 + posDau4v).M2(); + mMass13 = (mParticle1 + negDau4v).M2(); + } } } - template - void setPair(const T1& particle1, const T2& particle2, const T3& col) + template + void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& col) { - setPair(particle1, particle2); + setPair(particle1, particle2, trackTable); mMult = col.mult(); mCent = col.cent(); } - template - void setPair(const T1& particle1, const T2& particle2, const T3& col1, const T4& col2) + template + void setPair(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& col1, T5 const& col2) { - setPair(particle1, particle2); + setPair(particle1, particle2, trackTable); mMult = 0.5f * (col1.mult() + col2.mult()); // if mixing with multiplicity, should be in the same mixing bin mCent = 0.5f * (col1.cent() + col2.cent()); // if mixing with centrality, should be in the same mixing bin } template - void setPairMc(const T1& particle1, const T2& particle2, const T3& /*mcParticles*/) + void setPairMc(T1 const& particle1, T2 const& particle2, const T3& /*mcParticles*/) { if (!particle1.has_fMcParticle() || !particle2.has_fMcParticle()) { mHasMcPair = false; @@ -402,33 +452,33 @@ class PairHistManager mTrueKstar = getKstar(mTrueParticle1, mTrueParticle2); } - template - void setPairMc(const T1& particle1, const T2& particle2, const T3& mcParticles, const T4& col, const T5& /*mcCols*/) + template + void setPairMc(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& mcParticles, T5 const& col, T6 const& /*mcCols*/) { - setPair(particle1, particle2, col); + setPair(particle1, particle2, trackTable, col); setPairMc(particle1, particle2, mcParticles); if (!col.has_fMcCol()) { mHasMcCol = false; return; } mHasMcCol = true; - auto mcCol = col.template fMcCol_as(); + auto mcCol = col.template fMcCol_as(); mTrueMult = mcCol.mult(); mTrueCent = mcCol.cent(); } - template - void setPairMc(const T1& particle1, const T2& particle2, const T3& mcParticles, const T4& col1, const T5& col2, const T6& /*mcCols*/) + template + void setPairMc(T1 const& particle1, T2 const& particle2, T3 const& trackTable, T4 const& mcParticles, T5 const& col1, T6 const& col2, T7 const& /*mcCols*/) { - setPair(particle1, particle2, col1, col2); + setPair(particle1, particle2, trackTable, col1, col2); setPairMc(particle1, particle2, mcParticles); if (!col1.has_fMcCol() || !col2.has_fMcCol()) { mHasMcCol = false; return; } mHasMcCol = true; - auto mcCol1 = col1.template fMcCol_as(); - auto mcCol2 = col2.template fMcCol_as(); + auto mcCol1 = col1.template fMcCol_as(); + auto mcCol2 = col2.template fMcCol_as(); mTrueMult = 0.5f * (mcCol1.mult() + mcCol2.mult()); mTrueCent = 0.5f * (mcCol1.cent() + mcCol2.cent()); } @@ -478,17 +528,9 @@ class PairHistManager mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMt, HistTable), getHistDesc(kKstarVsMt, HistTable), getHistType(kKstarVsMt, HistTable), {Specs.at(kKstarVsMt)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMult, HistTable), getHistDesc(kKstarVsMult, HistTable), getHistType(kKstarVsMult, HistTable), {Specs.at(kKstarVsMult)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsCent, HistTable), getHistDesc(kKstarVsCent, HistTable), getHistType(kKstarVsCent, HistTable), {Specs.at(kKstarVsCent)}); - - // special care for mass plots since not all particles have "mass" - if constexpr (modes::hasMass(particleType1)) { - mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMass1, HistTable), getHistDesc(kKstarVsMass1, HistTable), getHistType(kKstarVsMass1, HistTable), {Specs.at(kKstarVsMass1)}); - } - if constexpr (modes::hasMass(particleType2)) { - mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMass2, HistTable), getHistDesc(kKstarVsMass2, HistTable), getHistType(kKstarVsMass2, HistTable), {Specs.at(kKstarVsMass2)}); - } - if constexpr (modes::hasMass(particleType1) && modes::hasMass(particleType2)) { - mHistogramRegistry->add(analysisDir + getHistNameV2(kMass1VsMass2, HistTable), getHistDesc(kMass1VsMass2, HistTable), getHistType(kMass1VsMass2, HistTable), {Specs.at(kMass1VsMass2)}); - } + mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMass1, HistTable), getHistDesc(kKstarVsMass1, HistTable), getHistType(kKstarVsMass1, HistTable), {Specs.at(kKstarVsMass1)}); + mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMass2, HistTable), getHistDesc(kKstarVsMass2, HistTable), getHistType(kKstarVsMass2, HistTable), {Specs.at(kKstarVsMass2)}); + mHistogramRegistry->add(analysisDir + getHistNameV2(kMass1VsMass2, HistTable), getHistDesc(kMass1VsMass2, HistTable), getHistType(kMass1VsMass2, HistTable), {Specs.at(kMass1VsMass2)}); } // higher dimensional histograms @@ -527,6 +569,9 @@ class PairHistManager if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent) { mHistogramRegistry->add(analysisDir + getHistNameV2(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable), getHistDesc(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable), getHistType(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable), {Specs.at(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent)}); } + if (mPlotDalitz) { + mHistogramRegistry->add(analysisDir + getHistNameV2(kDalitz, HistTable), getHistDesc(kDalitz, HistTable), getHistType(kDalitz, HistTable), {Specs.at(kDalitz)}); + } } void initMc(std::map> const& Specs) @@ -559,16 +604,9 @@ class PairHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMult, HistTable)), mKstar, mMult); mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsCent, HistTable)), mKstar, mCent); - // // special care for mass plots since not all particles have "mass" - if constexpr (modes::hasMass(particleType1)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass1, HistTable)), mKstar, mMass1); - } - if constexpr (modes::hasMass(particleType2)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass2, HistTable)), mKstar, mMass2); - } - if constexpr (modes::hasMass(particleType1) && modes::hasMass(particleType2)) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass1VsMass2, HistTable)), mMass1, mMass2); - } + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass1, HistTable)), mKstar, mRecoMass1); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMass2, HistTable)), mKstar, mRecoMass2); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass1VsMass2, HistTable)), mRecoMass1, mRecoMass2); } // n-D histograms are only filled if enabled @@ -590,22 +628,25 @@ class PairHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsPt1VsPt2VsMultVsCent, HistTable)), mKstar, mMt, mParticle1.Pt(), mParticle2.Pt(), mMult, mCent); } if (mPlotKstarVsMtVsMass1VsMass2) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2, HistTable)), mKstar, mMt, mMass1, mMass2); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2); } if (mPlotKstarVsMtVsMass1VsMass2VsMult) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMult, HistTable)), mKstar, mMt, mMass1, mMass2, mMult); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMult, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mMult); } if (mPlotKstarVsMtVsMass1VsMass2VsMultVsCent) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMultVsCent, HistTable)), mKstar, mMt, mMass1, mMass2, mMult, mCent); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsMultVsCent, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mMult, mCent); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt()); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mParticle1.Pt(), mParticle2.Pt()); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt(), mMult); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mParticle1.Pt(), mParticle2.Pt(), mMult); } if (mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent) { - mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable)), mKstar, mMt, mMass1, mMass2, mParticle1.Pt(), mParticle2.Pt(), mMult, mCent); + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent, HistTable)), mKstar, mMt, mRecoMass1, mRecoMass2, mParticle1.Pt(), mParticle2.Pt(), mMult, mCent); + } + if (mPlotDalitz) { + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kDalitz, HistTable)), mKstar, mMassTot2, mMass12, mMass13); } } @@ -659,7 +700,7 @@ class PairHistManager auto sum = part1 + part2; // Boost particle 1 to the pair rest frame (Prf) and calculate k* (would be equivalent using particle 2) // make a copy of particle 1 - auto particle1Prf = ROOT::Math::PtEtaPhiMVector(mParticle1); + auto particle1Prf = ROOT::Math::PtEtaPhiMVector(part1); // get lorentz boost into pair rest frame ROOT::Math::Boost boostPrf(sum.BoostToCM()); // boost particle 1 into pair rest frame and calculate its momentum, which has the same value as k* @@ -667,8 +708,13 @@ class PairHistManager } o2::framework::HistogramRegistry* mHistogramRegistry = nullptr; + bool mUsePdgMass = true; double mPdgMass1 = 0.; + double mPdgMassPosDau1 = 0; + double mPdgMassNegDau1 = 0; double mPdgMass2 = 0.; + double mPdgMassPosDau2 = 0; + double mPdgMassNegDau2 = 0; modes::TransverseMassType mMtType = modes::TransverseMassType::kAveragePdgMass; @@ -676,13 +722,16 @@ class PairHistManager int mAbsCharge2 = 1; ROOT::Math::PtEtaPhiMVector mParticle1{}; ROOT::Math::PtEtaPhiMVector mParticle2{}; - float mMass1 = 0.f; - float mMass2 = 0.f; + float mRecoMass1 = 0.f; + float mRecoMass2 = 0.f; float mKstar = 0.f; float mKt = 0.f; float mMt = 0.f; float mMult = 0.f; float mCent = 0.f; + double mMass12 = 0.; + double mMass13 = 0.; + double mMassTot2 = 0.; // mc ROOT::Math::PtEtaPhiMVector mTrueParticle1{}; @@ -721,6 +770,8 @@ class PairHistManager bool mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2 = false; bool mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMult = false; bool mPlotKstarVsMtVsMass1VsMass2VsPt1VsPt2VsMultVsCent = false; + + bool mPlotDalitz = false; }; }; // namespace pairhistmanager diff --git a/PWGCF/Femto/Core/pairProcessHelpers.h b/PWGCF/Femto/Core/pairProcessHelpers.h index 8a70283e9c6..9279921b00b 100644 --- a/PWGCF/Femto/Core/pairProcessHelpers.h +++ b/PWGCF/Femto/Core/pairProcessHelpers.h @@ -19,7 +19,9 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoAHelpers.h" +#include + +#include namespace o2::analysis::femto { @@ -65,13 +67,13 @@ void processSameEvent(T1 const& SliceParticle, // Randomize pair order if enabled switch (pairOrder) { case kOrder12: - PairHistManager.setPair(p1, p2, Collision); + PairHistManager.setPair(p1, p2, TrackTable, Collision); break; case kOrder21: - PairHistManager.setPair(p2, p1, Collision); + PairHistManager.setPair(p2, p1, TrackTable, Collision); break; default: - PairHistManager.setPair(p1, p2, Collision); + PairHistManager.setPair(p1, p2, TrackTable, Collision); } // fill deta-dphi histograms with kstar cutoff CprManager.fill(PairHistManager.getKstar()); @@ -134,13 +136,13 @@ void processSameEvent(T1 const& SliceParticle, // Randomize pair order if enabled switch (pairOrder) { case kOrder12: - PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); break; case kOrder21: - PairHistManager.setPairMc(p2, p1, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p2, p1, TrackTable, mcParticles, Collision, mcCollisions); break; default: - PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); } // fill deta-dphi histograms with kstar cutoff CprManager.fill(PairHistManager.getKstar()); @@ -189,7 +191,7 @@ void processSameEvent(T1 const& SliceParticle1, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPair(p1, p2, Collision); + PairHistManager.setPair(p1, p2, TrackTable, Collision); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -258,7 +260,7 @@ void processSameEvent(T1 const& SliceParticle1, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPairMc(p1, p2, mcParticles, Collision, mcCollisions); + PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, Collision, mcCollisions); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -309,7 +311,7 @@ void processMixedEvent(T1 const& Collisions, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPair(p1, p2, collision1, collision2); + PairHistManager.setPair(p1, p2, TrackTable, collision1, collision2); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); @@ -378,7 +380,7 @@ void processMixedEvent(T1 const& Collisions, if (CprManager.isClosePair()) { continue; } - PairHistManager.setPairMc(p1, p2, mcParticles, collision1, collision2, mcCollisions); + PairHistManager.setPairMc(p1, p2, TrackTable, mcParticles, collision1, collision2, mcCollisions); CprManager.fill(PairHistManager.getKstar()); if (PairHistManager.checkPairCuts()) { PairHistManager.template fill(); diff --git a/PWGCF/Femto/Core/particleCleaner.h b/PWGCF/Femto/Core/particleCleaner.h index 8c158198192..045f3dea785 100644 --- a/PWGCF/Femto/Core/particleCleaner.h +++ b/PWGCF/Femto/Core/particleCleaner.h @@ -16,7 +16,7 @@ #ifndef PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ #define PWGCF_FEMTO_CORE_PARTICLECLEANER_H_ -#include "Framework/Configurable.h" +#include #include #include diff --git a/PWGCF/Femto/Core/partitions.h b/PWGCF/Femto/Core/partitions.h index ae2ee46a3f9..52f2d7bb135 100644 --- a/PWGCF/Femto/Core/partitions.h +++ b/PWGCF/Femto/Core/partitions.h @@ -44,6 +44,12 @@ ncheckbit(o2::aod::femtotracks::mask, selection.maskHighMomentum) && \ (o2::aod::femtotracks::mask & selection.rejectionMaskHighMomentum) == static_cast(0)) +// track partition with optional mass cut +#define MAKE_TRACK_PARTITION_WITH_MASS(selection) \ + MAKE_TRACK_PARTITION(selection) && \ + (o2::aod::femtobase::stored::mass > selection.massMin) && \ + (o2::aod::femtobase::stored::mass < selection.massMax) + // partition for phis and rhos, i.e. resonance that are their own antiparticle #define MAKE_RESONANCE_0_PARTITON(selection) \ (o2::aod::femtobase::stored::pt > selection.ptMin) && \ diff --git a/PWGCF/Femto/Core/selectionContainer.h b/PWGCF/Femto/Core/selectionContainer.h index d67819b6f8d..fe5616f8302 100644 --- a/PWGCF/Femto/Core/selectionContainer.h +++ b/PWGCF/Femto/Core/selectionContainer.h @@ -16,11 +16,10 @@ #ifndef PWGCF_FEMTO_CORE_SELECTIONCONTAINER_H_ #define PWGCF_FEMTO_CORE_SELECTIONCONTAINER_H_ -#include "CommonConstants/MathConstants.h" +#include +#include -#include "TF1.h" - -#include "fairlogger/Logger.h" +#include #include #include @@ -28,6 +27,7 @@ #include #include #include +#include #include #include #include diff --git a/PWGCF/Femto/Core/trackBuilder.h b/PWGCF/Femto/Core/trackBuilder.h index ffb5df80c37..7971c7fe34e 100644 --- a/PWGCF/Femto/Core/trackBuilder.h +++ b/PWGCF/Femto/Core/trackBuilder.h @@ -23,11 +23,11 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include #include #include @@ -143,6 +143,8 @@ struct ConfTrackSelection : public o2::framework::ConfigurableGroup { o2::framework::Configurable etaMax{"etaMax", 0.9f, "Maximum eta"}; o2::framework::Configurable phiMin{"phiMin", 0.f, "Minimum phi"}; o2::framework::Configurable phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; + o2::framework::Configurable massMin{"massMin", 0.f, "Minimum TOF mass (only used if enabled)"}; + o2::framework::Configurable massMax{"massMax", 2.f, "Maximum TOF mass (only used if enabled)"}; // track selection masks o2::framework::Configurable maskLowMomentum{"maskLowMomentum", 1ul, "Bitmask for selections below momentum threshold"}; o2::framework::Configurable maskHighMomentum{"maskHighMomentum", 2ul, "Bitmask for selections above momentum threshold"}; @@ -460,6 +462,7 @@ class TrackSelection : public BaseSelection producedTracks; + o2::framework::Produces producedTrackMass; o2::framework::Produces producedTrackMasks; o2::framework::Produces producedTrackDcas; o2::framework::Produces producedTrackExtras; @@ -476,6 +479,7 @@ struct ConfTrackTables : o2::framework::ConfigurableGroup { std::string prefix = std::string("TrackTables"); o2::framework::Configurable produceTracks{"produceTracks", -1, "Produce Tracks (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceTrackMasks{"produceTrackMasks", -1, "Produce TrackMasks (-1: auto; 0 off; 1 on)"}; + o2::framework::Configurable produceTrackMass{"produceTrackMass", -1, "Produce TrackMass (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceTrackDcas{"produceTrackDcas", -1, "Produce TrackDcas (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceTrackExtras{"produceTrackExtras", -1, "Produce TrackExtras (-1: auto; 0 off; 1 on)"}; o2::framework::Configurable produceElectronPids{"produceElectronPids", -1, "Produce ElectronPids (-1: auto; 0 off; 1 on)"}; @@ -501,6 +505,7 @@ class TrackBuilder mProduceTracks = utils::enableTable("FTracks_001", table.produceTracks.value, initContext); mProduceTrackMasks = utils::enableTable("FTrackMasks_001", table.produceTrackMasks.value, initContext); + mProduceTrackMass = utils::enableTable("FTrackMass_001", table.produceTrackMass.value, initContext); mProduceTrackDcas = utils::enableTable("FTrackDcas_001", table.produceTrackDcas.value, initContext); mProduceTrackExtras = utils::enableTable("FTrackExtras_001", table.produceTrackExtras.value, initContext); mProduceElectronPids = utils::enableTable("FElectronPids_001", table.produceElectronPids.value, initContext); @@ -511,7 +516,7 @@ class TrackBuilder mProduceTritonPids = utils::enableTable("FTritonPids_001", table.produceTritonPids.value, initContext); mProduceHeliumPids = utils::enableTable("FHeliumPids_001", table.produceHeliumPids.value, initContext); - if (mProduceTracks || mProduceTrackMasks || mProduceTrackDcas || mProduceTrackExtras || mProduceElectronPids || mProducePionPids || mProduceKaonPids || mProduceProtonPids || mProduceDeuteronPids || mProduceTritonPids || mProduceHeliumPids) { + if (mProduceTracks || mProduceTrackMasks || mProduceTrackMass || mProduceTrackDcas || mProduceTrackExtras || mProduceElectronPids || mProducePionPids || mProduceKaonPids || mProduceProtonPids || mProduceDeuteronPids || mProduceTritonPids || mProduceHeliumPids) { mFillAnyTable = true; } else { LOG(info) << "No tables configured, Selection object will not be configured..."; @@ -560,6 +565,9 @@ class TrackBuilder trackProducts.producedTrackMasks(static_cast(0u)); } } + if (mProduceTrackMass) { + trackProducts.producedTrackMass(track.mass()); + } if (mProduceTrackDcas) { trackProducts.producedTrackDcas(track.dcaXY(), track.dcaZ()); } @@ -574,8 +582,7 @@ class TrackBuilder track.tpcNClsFound(), track.tpcNClsCrossedRows(), track.tpcNClsShared(), - track.beta(), - track.mass()); + track.beta()); } if (mProduceElectronPids) { trackProducts.producedElectronPids(track.itsNSigmaEl(), track.tpcNSigmaEl(), track.tofNSigmaEl()); @@ -670,6 +677,7 @@ class TrackBuilder bool mFillAnyTable = false; bool mProduceTracks = false; bool mProduceTrackMasks = false; + bool mProduceTrackMass = false; bool mProduceTrackDcas = false; bool mProduceTrackExtras = false; bool mProduceElectronPids = false; diff --git a/PWGCF/Femto/Core/trackHistManager.h b/PWGCF/Femto/Core/trackHistManager.h index a0eb858e07a..dbff8bb2dd1 100644 --- a/PWGCF/Femto/Core/trackHistManager.h +++ b/PWGCF/Femto/Core/trackHistManager.h @@ -20,14 +20,16 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include -#include "TH1.h" +#include #include +#include #include #include #include @@ -45,6 +47,7 @@ enum TrackHist { kEta, kPhi, kSign, + kMass, // qa variables kPAtPv, kPTpc, @@ -145,6 +148,7 @@ struct ConfTrackBinning : o2::framework::ConfigurableGroup { o2::framework::ConfigurableAxis eta{"eta", {{300, -1.5, 1.5}}, "Eta"}; o2::framework::ConfigurableAxis phi{"phi", {{720, 0, 1.f * o2::constants::math::TwoPI}}, "Phi"}; o2::framework::ConfigurableAxis sign{"sign", {{3, -1.5, 1.5}}, "Sign"}; + o2::framework::ConfigurableAxis mass{"mass", {{200, 0.f, 2.f}}, "Mass (if enabled, plot TOF mass, otherwise PDG mass)"}; o2::framework::ConfigurableAxis pdgCodes{"pdgCodes", {{8001, -4000.5, 4000.5}}, "MC ONLY: PDG codes of selected tracks"}; }; @@ -268,7 +272,8 @@ constexpr std::array, kTrackHistLast> {kPt, o2::framework::kTH1F, "hPt", "Transverse Momentum; p_{T} (GeV/#it{c}); Entries"}, {kEta, o2::framework::kTH1F, "hEta", "Pseudorapidity; #eta; Entries"}, {kPhi, o2::framework::kTH1F, "hPhi", "Azimuthal angle; #varphi; Entries"}, - {kSign, o2::framework::kTH1F, "hSign", "Sign of charge ; Sign; Entries"}, + {kSign, o2::framework::kTH1F, "hSign", "Sign of charge; Sign; Entries"}, + {kMass, o2::framework::kTH1F, "hMass", "Mass; m (GeV/#it{c}^{2}); Entries"}, {kPAtPv, o2::framework::kTH1F, "hPAtPv", "Momentum at Primary vertex; p_{vertex}; Entries"}, {kPTpc, o2::framework::kTH1F, "hPTpc", "Momentum at inner wall of TPC; p_{TPC}; Entries"}, {kItsCluster, o2::framework::kTH1F, "hItsCluster", "ITS cluster; ITS cluster; Entries"}, @@ -353,7 +358,8 @@ constexpr std::array, kTrackHistLast> {kPt, {conf.pt}}, \ {kEta, {conf.eta}}, \ {kPhi, {conf.phi}}, \ - {kSign, {conf.sign}}, + {kSign, {conf.sign}}, \ + {kMass, {conf.mass}}, #define TRACK_HIST_QA_MAP(confAnalysis, confQa) \ {kPAtPv, {confQa.p}}, \ @@ -637,6 +643,7 @@ class TrackHistManager mHistogramRegistry->add(analysisDir + getHistNameV2(kEta, HistTable), getHistDesc(kEta, HistTable), getHistType(kEta, HistTable), {Specs.at(kEta)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kPhi, HistTable), getHistDesc(kPhi, HistTable), getHistType(kPhi, HistTable), {Specs.at(kPhi)}); mHistogramRegistry->add(analysisDir + getHistNameV2(kSign, HistTable), getHistDesc(kSign, HistTable), getHistType(kSign, HistTable), {Specs.at(kSign)}); + mHistogramRegistry->add(analysisDir + getHistNameV2(kMass, HistTable), getHistDesc(kMass, HistTable), getHistType(kMass, HistTable), {Specs.at(kMass)}); } void initQa(std::map> const& Specs) @@ -784,6 +791,11 @@ class TrackHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kEta, HistTable)), track.eta()); mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kPhi, HistTable)), track.phi()); mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kSign, HistTable)), track.sign()); + if constexpr (utils::HasMass) { + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), track.mass()); + } else { + mHistogramRegistry->fill(HIST(prefix) + HIST(AnalysisDir) + HIST(getHistName(kMass, HistTable)), utils::getPdgMass(mPdgCode)); + } } template @@ -831,7 +843,7 @@ class TrackHistManager mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kItsSignal, HistTable)), momentum, o2::analysis::femto::utils::itsSignal(track)); mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTpcSignal, HistTable)), momentum, track.tpcSignal()); mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTofBeta, HistTable)), momentum, track.tofBeta()); - mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTofMass, HistTable)), momentum, track.tofMass()); + mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kTofMass, HistTable)), momentum, track.mass()); if (mPlotElectronPid) { mHistogramRegistry->fill(HIST(prefix) + HIST(PidDir) + HIST(getHistName(kItsElectron, HistTable)), momentum, track.itsNSigmaEl()); diff --git a/PWGCF/Femto/Core/tripletBuilder.h b/PWGCF/Femto/Core/tripletBuilder.h index 26b618441f9..1857f6a3996 100644 --- a/PWGCF/Femto/Core/tripletBuilder.h +++ b/PWGCF/Femto/Core/tripletBuilder.h @@ -19,16 +19,17 @@ #include "PWGCF/Femto/Core/closeTripletRejection.h" #include "PWGCF/Femto/Core/collisionHistManager.h" #include "PWGCF/Femto/Core/modes.h" +#include "PWGCF/Femto/Core/pairHistManager.h" #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/Core/tripletCleaner.h" #include "PWGCF/Femto/Core/tripletHistManager.h" #include "PWGCF/Femto/Core/tripletProcessHelpers.h" +#include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" - -#include "fairlogger/Logger.h" +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/tripletCleaner.h b/PWGCF/Femto/Core/tripletCleaner.h index 690c9d526b7..d6f38c78709 100644 --- a/PWGCF/Femto/Core/tripletCleaner.h +++ b/PWGCF/Femto/Core/tripletCleaner.h @@ -16,7 +16,7 @@ #ifndef PWGCF_FEMTO_CORE_TRIPLETCLEANER_H_ #define PWGCF_FEMTO_CORE_TRIPLETCLEANER_H_ -#include "PWGCF/Femto/Core/pairBuilder.h" +#include "PWGCF/Femto/Core/pairCleaner.h" namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/tripletHistManager.h b/PWGCF/Femto/Core/tripletHistManager.h index 1af18cd8783..672e9f68055 100644 --- a/PWGCF/Femto/Core/tripletHistManager.h +++ b/PWGCF/Femto/Core/tripletHistManager.h @@ -20,14 +20,14 @@ #include "PWGCF/Femto/Core/histManager.h" #include "PWGCF/Femto/Core/modes.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include -#include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include -#include #include #include #include @@ -109,9 +109,9 @@ struct ConfTripletBinning : o2::framework::ConfigurableGroup { o2::framework::ConfigurableAxis pt1{"pt1", {{100, 0, 6}}, "Pt binning for particle 1"}; o2::framework::ConfigurableAxis pt2{"pt2", {{100, 0, 6}}, "Pt binning for particle 2"}; o2::framework::ConfigurableAxis pt3{"pt3", {{100, 0, 6}}, "Pt binning for particle 3"}; - o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter)"}; - o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter)"}; - o2::framework::ConfigurableAxis mass3{"mass3", {{100, 0, 2}}, "Mass binning for particle 3 (if particle has mass getter)"}; + o2::framework::ConfigurableAxis mass1{"mass1", {{100, 0, 2}}, "Mass binning for particle 1 (if particle has mass getter, otherwise PDG mass)"}; + o2::framework::ConfigurableAxis mass2{"mass2", {{100, 0, 2}}, "Mass binning for particle 2 (if particle has mass getter, otherwise PDG mass)"}; + o2::framework::ConfigurableAxis mass3{"mass3", {{100, 0, 2}}, "Mass binning for particle 3 (if particle has mass getter, otherwise PDG mass)"}; o2::framework::Configurable transverseMassType{"transverseMassType", static_cast(modes::TransverseMassType::kAveragePdgMass), "Type of transverse mass (0-> Average Pdg Mass, 1-> Reduced Pdg Mass, 2-> Mt from combined 4 vector)"}; }; @@ -252,9 +252,9 @@ class TripletHistManager void setMass(int PdgParticle1, int PdgParticle2, int PdgParticle3) { - mPdgMass1 = o2::analysis::femto::utils::getMass(PdgParticle1); - mPdgMass2 = o2::analysis::femto::utils::getMass(PdgParticle2); - mPdgMass3 = o2::analysis::femto::utils::getMass(PdgParticle3); + mPdgMass1 = utils::getPdgMass(PdgParticle1); + mPdgMass2 = utils::getPdgMass(PdgParticle2); + mPdgMass3 = utils::getPdgMass(PdgParticle3); } void setCharge(int chargeAbsParticle1, int chargeAbsParticle2, int chargeAbsParticle3) { @@ -279,13 +279,13 @@ class TripletHistManager mQ3 = getQ3(mParticle1, mParticle2, mParticle3); // if one of the particles has a mass getter, we cache the value for the filling later - if constexpr (modes::hasMass(particleType1)) { + if constexpr (utils::HasMass) { mMass1 = particle1.mass(); } - if constexpr (modes::hasMass(particleType2)) { + if constexpr (utils::HasMass) { mMass2 = particle2.mass(); } - if constexpr (modes::hasMass(particleType3)) { + if constexpr (utils::HasMass) { mMass3 = particle3.mass(); } } diff --git a/PWGCF/Femto/Core/tripletProcessHelpers.h b/PWGCF/Femto/Core/tripletProcessHelpers.h index fc52c62da0e..75538ae024d 100644 --- a/PWGCF/Femto/Core/tripletProcessHelpers.h +++ b/PWGCF/Femto/Core/tripletProcessHelpers.h @@ -19,7 +19,9 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoAHelpers.h" +#include + +#include namespace o2::analysis::femto { diff --git a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h index 9183527b890..3a5aca2c5e6 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceBuilder.h +++ b/PWGCF/Femto/Core/twoTrackResonanceBuilder.h @@ -16,8 +16,6 @@ #ifndef PWGCF_FEMTO_CORE_TWOTRACKRESONANCEBUILDER_H_ #define PWGCF_FEMTO_CORE_TWOTRACKRESONANCEBUILDER_H_ -#include "RecoDecay.h" - #include "PWGCF/Femto/Core/baseSelection.h" #include "PWGCF/Femto/Core/dataTypes.h" #include "PWGCF/Femto/Core/femtoUtils.h" @@ -25,15 +23,18 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" +#include -#include +#include +#include +#include +#include +#include +#include +#include -#include "fairlogger/Logger.h" +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include #include #include diff --git a/PWGCF/Femto/Core/twoTrackResonanceHistManager.h b/PWGCF/Femto/Core/twoTrackResonanceHistManager.h index 7de7d7c3c04..de5317ff34c 100644 --- a/PWGCF/Femto/Core/twoTrackResonanceHistManager.h +++ b/PWGCF/Femto/Core/twoTrackResonanceHistManager.h @@ -20,10 +20,14 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include +#include + +#include #include #include diff --git a/PWGCF/Femto/Core/v0Builder.h b/PWGCF/Femto/Core/v0Builder.h index 16de0ea04cc..91465cb99ab 100644 --- a/PWGCF/Femto/Core/v0Builder.h +++ b/PWGCF/Femto/Core/v0Builder.h @@ -23,11 +23,11 @@ #include "PWGCF/Femto/Core/selectionContainer.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/Configurable.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Core/v0HistManager.h b/PWGCF/Femto/Core/v0HistManager.h index 1fd7eba0b5c..b6cb832579f 100644 --- a/PWGCF/Femto/Core/v0HistManager.h +++ b/PWGCF/Femto/Core/v0HistManager.h @@ -20,12 +20,17 @@ #include "PWGCF/Femto/Core/modes.h" #include "PWGCF/Femto/Core/trackHistManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/HistogramSpec.h" +#include +#include +#include +#include +#include + +#include +#include #include +#include #include #include #include diff --git a/PWGCF/Femto/DataModel/FemtoTables.h b/PWGCF/Femto/DataModel/FemtoTables.h index 4c890bdb4e6..080e014ba30 100644 --- a/PWGCF/Femto/DataModel/FemtoTables.h +++ b/PWGCF/Femto/DataModel/FemtoTables.h @@ -18,13 +18,13 @@ #include "PWGCF/Femto/Core/dataTypes.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" +#include +#include +#include -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/Expressions.h" +#include +#include +#include #include #include @@ -58,7 +58,7 @@ using FCol = FCols::iterator; using StoredFCols = StoredFCols_001; // table for collisions selections -DECLARE_SOA_TABLE_STAGED_VERSIONED(FColMasks_001, "FCOLMASK", 1, //! track masks +DECLARE_SOA_TABLE_STAGED_VERSIONED(FColMasks_001, "FCOLMASK", 1, //! collision masks femtocollisions::Mask); using FColMasks = FColMasks_001; using StoredFColMasks = StoredFColMasks_001; @@ -106,7 +106,6 @@ DECLARE_SOA_COLUMN(Pt, pt, float); //! pt DECLARE_SOA_COLUMN(Eta, eta, float); //! eta DECLARE_SOA_COLUMN(Phi, phi, float); //! phi DECLARE_SOA_COLUMN(Mass, mass, float); //! mass of particle -DECLARE_SOA_COLUMN(MassAnti, massAnti, float); //! mass of antiparticle } // namespace stored namespace dynamic @@ -175,7 +174,7 @@ DECLARE_SOA_COLUMN(TpcChi2NCl, tpcChi2NCl, float); //! Tpc chi2 // tof related information DECLARE_SOA_COLUMN(TofBeta, tofBeta, float); //! Tof beta -DECLARE_SOA_COLUMN(TofMass, tofMass, float); //! Tof mass +// tof mass will be stored in mass column // PID information // ITS PID information @@ -247,6 +246,11 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FTrackMasks_001, "FTRACKMASK", 1, //! track m using FTrackMasks = FTrackMasks_001; using StoredFTrackMasks = StoredFTrackMasks_001; +// table for track mass (using tof mass +DECLARE_SOA_TABLE_STAGED_VERSIONED(FTrackMass_001, "FTRACKMASS", 1, //! track mass + femtobase::stored::Mass); +using FTrackMass = FTrackMass_001; + // table for track DCA DECLARE_SOA_TABLE_STAGED_VERSIONED(FTrackDcas_001, "FTRACKDCAS", 1, //! track dcas femtotracks::DcaXY, @@ -267,7 +271,6 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FTrackExtras_001, "FTRACKEXTRA", 1, //! track femtotracks::TpcNClsCrossedRows, femtotracks::TpcNClsShared, femtotracks::TofBeta, - femtotracks::TofMass, femtotracks::TpcCrossedRowsOverFound, femtotracks::TpcSharedOverFound); using FTrackExtras = FTrackExtras_001; @@ -401,9 +404,10 @@ namespace femtov0s DECLARE_SOA_COLUMN(Mask, mask, femtodatatypes::V0MaskType); //! Bitmask for v0 selections // columns for debug information -DECLARE_SOA_COLUMN(MassLambda, massLambda, float); //! Mass of Lambda -DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Mass of AntiLambda -DECLARE_SOA_COLUMN(MassK0short, massK0short, float); //! Mass of K0short +DECLARE_SOA_COLUMN(MassAnti, massAnti, float); //! mass of particle using antiparticle hypothesis (for Lambda/AntiLambda extra table) +DECLARE_SOA_COLUMN(MassLambda, massLambda, float); //! Mass of Lambda (for k0short table) +DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Mass of AntiLambda (for k0short table) +DECLARE_SOA_COLUMN(MassK0short, massK0short, float); //! Mass of K0short (for lambda/antitlambda table) DECLARE_SOA_COLUMN(CosPa, cosPa, float); //! Lambda daughter DCA at decay vertex DECLARE_SOA_COLUMN(DauDca, dauDca, float); //! Lambda daughter DCA at decay vertex DECLARE_SOA_COLUMN(TransRadius, transRadius, float); //! Lambda transvers radius @@ -447,7 +451,7 @@ using FLambdaMasks = FLambdaMasks_001; using StoredFLambdaMasks = StoredFLambdaMasks_001; DECLARE_SOA_TABLE_STAGED_VERSIONED(FLambdaExtras_001, "FLAMBDAEXTRA", 1, //! lambda extra information - femtobase::stored::MassAnti, // put mass of antiparticle, i.e. antilambda mass for lambdas and vice versa + femtov0s::MassAnti, // put mass of antiparticle, i.e. antilambda mass for lambdas and vice versa femtov0s::MassK0short, femtov0s::CosPa, femtov0s::DauDca, diff --git a/PWGCF/Femto/TableProducer/femtoProducer.cxx b/PWGCF/Femto/TableProducer/femtoProducer.cxx index 2bfe13acdbf..8d47b4a3730 100644 --- a/PWGCF/Femto/TableProducer/femtoProducer.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducer.cxx @@ -24,25 +24,24 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "PWGLF/DataModel/mcCentrality.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 "CCDB/BasicCCDBManager.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" - -#include "fairlogger/Logger.h" +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx index 42fd008417c..64a3ede4696 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx @@ -20,13 +20,13 @@ #include "PWGCF/Femto/Core/v0Builder.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/InitContext.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include using namespace o2::analysis::femto; diff --git a/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx b/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx index e8642fe53a4..f710e4ac194 100644 --- a/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx +++ b/PWGCF/Femto/TableProducer/femtoProducerKinkPtConverter.cxx @@ -16,11 +16,20 @@ #include "PWGCF/Femto/Core/femtoUtils.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include using namespace o2::analysis::femto; diff --git a/PWGCF/Femto/Tasks/femtoCascadeQa.cxx b/PWGCF/Femto/Tasks/femtoCascadeQa.cxx index 74bedd879d7..ea60ae07ab2 100644 --- a/PWGCF/Femto/Tasks/femtoCascadeQa.cxx +++ b/PWGCF/Femto/Tasks/femtoCascadeQa.cxx @@ -23,15 +23,16 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -50,7 +51,7 @@ struct FemtoCascadeQa { using FemtoXis = o2::soa::Join; using FemtoOmegas = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; using FemtoXisWithLabel = o2::soa::Join; using FemtoOmegasWithLabel = o2::soa::Join; diff --git a/PWGCF/Femto/Tasks/femtoKinkQa.cxx b/PWGCF/Femto/Tasks/femtoKinkQa.cxx index fa1c977c494..82ba5c380c8 100644 --- a/PWGCF/Femto/Tasks/femtoKinkQa.cxx +++ b/PWGCF/Femto/Tasks/femtoKinkQa.cxx @@ -25,15 +25,16 @@ #include "PWGCF/Femto/DataModel/FemtoTables.h" #include "PWGLF/DataModel/LFKinkDecayTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -54,7 +55,7 @@ struct FemtoKinkQa { // Define kink/sigma tables (joining tables for comprehensive information) using FemtoSigmas = o2::soa::Join; using FemtoSigmaPlus = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; using FemtoSigmasWithLabel = o2::soa::Join; using FemtoSigmaPlusWithLabel = o2::soa::Join; diff --git a/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx b/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx index 9181a00d20d..9430fa71eef 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackCascade.cxx @@ -27,16 +27,17 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx b/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx index df79897eefc..2132de4073e 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackKink.cxx @@ -28,16 +28,17 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx b/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx index 48c4fed92aa..deb7c1164d8 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackTrack.cxx @@ -25,16 +25,17 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -54,7 +55,10 @@ struct FemtoPairTrackTrack { using FemtoTracks = o2::soa::Join; - using FemtoTracksWithLabel = o2::soa::Join; + // for analysis which require particles at high pt, add tof mass so sidebands can be used + using FemtoTracksWithMass = o2::soa::Join; + + using FemtoTracksWithLabel = o2::soa::Join; o2::framework::SliceCache cache; @@ -76,8 +80,12 @@ struct FemtoPairTrackTrack { o2::framework::Partition trackPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2); o2::framework::Preslice perColtracks = o2::aod::femtobase::stored::fColId; - o2::framework::Partition trackWithLabelPartition1 = MAKE_TRACK_PARTITION(confTrackSelections1); - o2::framework::Partition trackWithLabelPartition2 = MAKE_TRACK_PARTITION(confTrackSelections2); + o2::framework::Partition trackWithMassPartition1 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections1); + o2::framework::Partition trackWithMassPartition2 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections2); + o2::framework::Preslice perColtracksWithMass = o2::aod::femtobase::stored::fColId; + + o2::framework::Partition trackWithLabelPartition1 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections1); + o2::framework::Partition trackWithLabelPartition2 = MAKE_TRACK_PARTITION_WITH_MASS(confTrackSelections2); o2::framework::Preslice perColtracksWithLabel = o2::aod::femtobase::stored::fColId; // setup pairs @@ -108,10 +116,10 @@ struct FemtoPairTrackTrack { void init(o2::framework::InitContext&) { - if ((doprocessSameEvent + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventMc) > 1) { + if ((doprocessSameEvent + doprocessSameEventWithMass + doprocessSameEventMc) > 1 || (doprocessMixedEvent + doprocessMixedEventWithMass + doprocessMixedEventMc) > 1) { LOG(fatal) << "More than 1 same or mixed event process function is activated. Breaking..."; } - bool processData = doprocessSameEvent || doprocessMixedEvent; + bool processData = doprocessSameEvent || doprocessMixedEvent || doprocessSameEventWithMass || doprocessMixedEventWithMass; bool processMc = doprocessSameEventMc || doprocessMixedEventMc; if (processData && processMc) { LOG(fatal) << "Both data and mc processing is activated. Breaking..."; @@ -152,6 +160,12 @@ struct FemtoPairTrackTrack { } PROCESS_SWITCH(FemtoPairTrackTrack, processSameEvent, "Enable processing same event processing", true); + void processSameEventWithMass(FilteredFemtoCollision const& col, FemtoTracksWithMass const& tracks) + { + pairTrackTrackBuilder.processSameEvent(col, tracks, trackWithMassPartition1, trackWithMassPartition2, cache); + } + PROCESS_SWITCH(FemtoPairTrackTrack, processSameEventWithMass, "Enable processing same event processing (with track masses)", false); + void processSameEventMc(FilteredFemtoCollisionWithLabel const& col, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, o2::aod::FMcParticles const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers) { pairTrackTrackBuilder.processSameEvent(col, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, mcParticles, mcMothers, mcPartonicMothers, cache); @@ -164,6 +178,12 @@ struct FemtoPairTrackTrack { } PROCESS_SWITCH(FemtoPairTrackTrack, processMixedEvent, "Enable processing mixed event processing", true); + void processMixedEventWithMass(FilteredFemtoCollisions const& cols, FemtoTracksWithMass const& tracks) + { + pairTrackTrackBuilder.processMixedEvent(cols, tracks, trackWithMassPartition1, trackWithMassPartition2, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); + } + PROCESS_SWITCH(FemtoPairTrackTrack, processMixedEventWithMass, "Enable processing mixed event processing (with track masses)", false); + void processMixedEventMc(FilteredFemtoCollisionsWithLabel const& cols, o2::aod::FMcCols const& mcCols, FemtoTracksWithLabel const& tracks, o2::aod::FMcParticles const& mcParticles, o2::aod::FMcMothers const& mcMothers, o2::aod::FMcPartMoths const& mcPartonicMothers) { pairTrackTrackBuilder.processMixedEvent(cols, mcCols, tracks, trackWithLabelPartition1, trackWithLabelPartition2, mcParticles, mcMothers, mcPartonicMothers, cache, mixBinsVtxMult, mixBinsVtxCent, mixBinsVtxMultCent); diff --git a/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx b/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx index 1bf895ffb4f..db7e18ba53b 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackTwoTrackResonance.cxx @@ -26,16 +26,16 @@ #include "PWGCF/Femto/Core/twoTrackResonanceHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx b/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx index f6891b3b670..f112f60b973 100644 --- a/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoPairTrackV0.cxx @@ -27,16 +27,17 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoPairV0V0.cxx b/PWGCF/Femto/Tasks/femtoPairV0V0.cxx index d1783be7075..1cf6ffaf677 100644 --- a/PWGCF/Femto/Tasks/femtoPairV0V0.cxx +++ b/PWGCF/Femto/Tasks/femtoPairV0V0.cxx @@ -26,16 +26,17 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoTrackQa.cxx b/PWGCF/Femto/Tasks/femtoTrackQa.cxx index ca196b85185..25916affb95 100644 --- a/PWGCF/Femto/Tasks/femtoTrackQa.cxx +++ b/PWGCF/Femto/Tasks/femtoTrackQa.cxx @@ -22,14 +22,16 @@ #include "PWGCF/Femto/Core/trackHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -47,7 +49,7 @@ struct FemtoTrackQa { using FilteredFemtoCollisionsWithLabel = o2::soa::Filtered; using FilteredFemtoCollisionWithLabel = FilteredFemtoCollisionsWithLabel::iterator; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; using FemtoTracksWithLabel = o2::soa::Join; diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx index 8ab8dc46d2d..05dcdd5b153 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackTrack.cxx @@ -13,6 +13,7 @@ /// \brief Tasks that computes correlation between three tracks /// \author Anton Riedel, TU München, anton.riedel@cern.ch +#include "PWGCF/Femto/Core/closePairRejection.h" #include "PWGCF/Femto/Core/closeTripletRejection.h" #include "PWGCF/Femto/Core/collisionBuilder.h" #include "PWGCF/Femto/Core/collisionHistManager.h" @@ -24,16 +25,17 @@ #include "PWGCF/Femto/Core/tripletHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include diff --git a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx index ccbe794f3c1..370cee244a3 100644 --- a/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx +++ b/PWGCF/Femto/Tasks/femtoTripletTrackTrackV0.cxx @@ -13,6 +13,7 @@ /// \brief Tasks that computes correlation between two tracks /// \author Anton Riedel, TU München, anton.riedel@cern.ch +#include "PWGCF/Femto/Core/closePairRejection.h" #include "PWGCF/Femto/Core/closeTripletRejection.h" #include "PWGCF/Femto/Core/collisionBuilder.h" #include "PWGCF/Femto/Core/collisionHistManager.h" @@ -26,16 +27,17 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/BinningPolicy.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -90,7 +92,6 @@ struct FemtoTripletTrackTrackV0 { // setup lambdas v0builder::ConfLambdaSelection1 confLambdaSelection; v0histmanager::ConfLambdaBinning1 confLambdaBinning; - particlecleaner::ConfLambdaCleaner1 confLambdaCleaner; o2::framework::Partition lambdaPartition = MAKE_LAMBDA_PARTITION(confLambdaSelection); o2::framework::Preslice perColLambdas = o2::aod::femtobase::stored::fColId; diff --git a/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx b/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx index 7faff356fd2..5d2e3348c16 100644 --- a/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx +++ b/PWGCF/Femto/Tasks/femtoTwotrackresonanceQa.cxx @@ -22,17 +22,16 @@ #include "PWGCF/Femto/Core/twoTrackResonanceHistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" - -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include @@ -53,7 +52,7 @@ struct FemtoTwotrackresonanceQa { using FemtoPhis = o2::soa::Join; using FemtoRho0s = o2::soa::Join; using FemtoKstar0s = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; SliceCache cache; diff --git a/PWGCF/Femto/Tasks/femtoV0Qa.cxx b/PWGCF/Femto/Tasks/femtoV0Qa.cxx index a3587aaca95..5ed29d305ba 100644 --- a/PWGCF/Femto/Tasks/femtoV0Qa.cxx +++ b/PWGCF/Femto/Tasks/femtoV0Qa.cxx @@ -23,15 +23,16 @@ #include "PWGCF/Femto/Core/v0HistManager.h" #include "PWGCF/Femto/DataModel/FemtoTables.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/Expressions.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/InitContext.h" -#include "Framework/OutputObjHeader.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -51,7 +52,7 @@ struct FemtoV0Qa { using FemtoLambdas = o2::soa::Join; using FemtoK0shorts = o2::soa::Join; - using FemtoTracks = o2::soa::Join; + using FemtoTracks = o2::soa::Join; using FemtoLambdasWithLabel = o2::soa::Join; using FemtoK0shortsWithLabel = o2::soa::Join; diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h index 3a7738b2cc1..05e0cfb5682 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseDetaDphiStar.h @@ -66,31 +66,31 @@ class FemtoUniverseDetaDphiStar if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kTrack) { std::string dirName = static_cast(DirNames[0]); - histdetadpisame[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[0][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[0][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][0])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); - histdetadpiqlcmssame = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpiqlcmsmixed = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiqlcmssame = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpiqlcmsmixed = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][7])).c_str(), "; #it{q}_{LCMS}; #Delta #eta; #Delta #phi", kTH3F, {{100, 0.0, 0.5}, {100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int i = 0; i < 9; i++) { - histdetadpiRadii[0][i] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[0][i] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kV0) { for (int i = 0; i < 2; i++) { std::string dirName = static_cast(DirNames[1]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -99,13 +99,13 @@ class FemtoUniverseDetaDphiStar /// V0-V0 combination for (int k = 0; k < 2; k++) { std::string dirName = static_cast(DirNames[2]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -114,13 +114,13 @@ class FemtoUniverseDetaDphiStar /// Cascade-Cascade combination for (int k = 0; k < 7; k++) { std::string dirName = static_cast(DirNames[5]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -129,13 +129,13 @@ class FemtoUniverseDetaDphiStar /// Track-Cascade combination for (int k = 0; k < 3; k++) { std::string dirName = static_cast(DirNames[6]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -144,13 +144,13 @@ class FemtoUniverseDetaDphiStar /// V0-Cascade combination for (int k = 0; k < 3; k++) { std::string dirName = static_cast(DirNames[7]); - histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[k][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][k])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int l = 0; l < 9; l++) { - histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[k][l] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[k][l])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -165,7 +165,7 @@ class FemtoUniverseDetaDphiStar if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #varphi*", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -173,14 +173,14 @@ class FemtoUniverseDetaDphiStar if constexpr (kPartOneType == o2::aod::femtouniverseparticle::ParticleType::kTrack && kPartTwoType == o2::aod::femtouniverseparticle::ParticleType::kD0) { for (int i = 0; i < 2; i++) { std::string dirName = static_cast(DirNames[4]); - histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); - histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpisame[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpisame[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesSame[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][0] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[0][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); + histdetadpimixed[i][1] = mHistogramRegistry->add((dirName + static_cast(HistNamesMixed[1][i])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); if (plotForEveryRadii) { for (int j = 0; j < 9; j++) { - histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{200, -0.3, 0.3}, {200, -0.3, 0.3}}); + histdetadpiRadii[i][j] = mHistogramRegistryQA->add((dirName + static_cast(HistNamesRadii[i][j])).c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -207,7 +207,7 @@ class FemtoUniverseDetaDphiStar 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}}); + histdetadphimixedafterkT[j] = mHistogramRegistry->add((dirName + histFolderkT + "detadphidetadphiAfterMixed").c_str(), "; #Delta #eta; #Delta #phi", kTH2F, {{100, -0.15, 0.15}, {100, -0.15, 0.15}}); } } } @@ -643,7 +643,7 @@ class FemtoUniverseDetaDphiStar /// Check if pair is close or not template - bool isClosePairkT(Part const& part1, Part const& part2, uint8_t ChosenEventType, float ktval, bool CircCut) + bool isClosePairkT(Part const& part1, Part const& part2, uint8_t ChosenEventType, float ktval, bool CircCut, bool IsDphiAvgOrDist, float lmagfield, float DistMax, float FracMax) { /// Track-Track combination // check if provided particles are in agreement with the class instantiation @@ -663,8 +663,11 @@ class FemtoUniverseDetaDphiStar ktbinval = 4; } + magfield = lmagfield; + auto deta = part1.eta() - part2.eta(); auto dphiAvg = averagePhiStar(part1, part2, 0); + auto distfrac = averagePhiStarFrac(part1, part2, DistMax); auto DeltaPhiStarMax = static_cast(cutDeltaPhiStarMaxVector[ktbinval]); auto DeltaPhiStarMin = static_cast(cutDeltaPhiStarMinVector[ktbinval]); auto DeltaEtaMax = static_cast(cutDeltaEtaMaxVector[ktbinval]); @@ -678,19 +681,35 @@ class FemtoUniverseDetaDphiStar LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; } - if (CircCut && (std::pow(dphiAvg, 2) / std::pow(DeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(DeltaEtaMax, 2) < 1.)) { - return true; - } else if (!CircCut && (dphiAvg > DeltaPhiStarMin) && (dphiAvg < DeltaPhiStarMax) && (deta > DeltaEtaMin) && (deta < DeltaEtaMax)) { - return true; + if (IsDphiAvgOrDist) { + if (CircCut && (std::pow(dphiAvg, 2) / std::pow(DeltaPhiStarMax, 2) + std::pow(deta, 2) / std::pow(DeltaEtaMax, 2) < 1.)) { + // std::cout<<"1 "< DeltaPhiStarMin) && (dphiAvg < DeltaPhiStarMax) && (deta > DeltaEtaMin) && (deta < DeltaEtaMax)) { + return true; + } else { + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadphisameafterkT[ktbinval]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadphimixedafterkT[ktbinval]->Fill(deta, dphiAvg); + } else { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + } + return false; + } } else { - if (ChosenEventType == femto_universe_container::EventType::same) { - histdetadphisameafterkT[ktbinval]->Fill(deta, dphiAvg); - } else if (ChosenEventType == femto_universe_container::EventType::mixed) { - histdetadphimixedafterkT[ktbinval]->Fill(deta, dphiAvg); + if (((deta > DeltaEtaMin) && (deta < DeltaEtaMax)) && (distfrac > FracMax)) { + return true; } else { - LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + if (ChosenEventType == femto_universe_container::EventType::same) { + histdetadphisameafterkT[ktbinval]->Fill(deta, dphiAvg); + } else if (ChosenEventType == femto_universe_container::EventType::mixed) { + histdetadphimixedafterkT[ktbinval]->Fill(deta, dphiAvg); + } else { + LOG(fatal) << "FemtoUniverseDetaDphiStar: passed arguments don't agree with FemtoUniverseDetaDphiStar's type of events! Please provide same or mixed."; + } + return false; } - return false; } } @@ -877,7 +896,7 @@ class FemtoUniverseDetaDphiStar badpoints++; } } - return badpoints / entries; + return (static_cast(badpoints) / static_cast(entries)); } // Get particle charge from mask diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h index 8a48e540c74..508cb8994c4 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h @@ -70,7 +70,7 @@ class FemtoUniverseParticleHisto // comment template - void init_debug(std::string folderName, T& tempFitVarpTAxis) // o2-linter: disable=name/function-variable + void init_debug(std::string folderName, T& tempFitVarMomAxis) // o2-linter: disable=name/function-variable { std::string folderSuffix = static_cast(o2::aod::femtouniverse_mc_particle::MCTypeName[mc]).c_str(); if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kTrack || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0Child || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kCascadeBachelor || mParticleType == o2::aod::femtouniverseparticle::ParticleType::kMCTruthTrack) { @@ -86,22 +86,22 @@ class FemtoUniverseParticleHisto mHistogramRegistry->add((folderName + folderSuffix + "/hITSclustersIB").c_str(), "; ITS clusters in IB; Entries", kTH1F, {{10, -0.5, 9.5}}); mHistogramRegistry->add((folderName + folderSuffix + "/hDCAz").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA_{z} (cm)", kTH2F, {{100, 0, 10}, {500, -5, 5}}); mHistogramRegistry->add((folderName + folderSuffix + "/hDCA").c_str(), "; #it{p}_{T} (GeV/#it{c}); DCA (cm)", kTH2F, {{100, 0, 10}, {301, 0., 1.5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/hTPCdEdX").c_str(), "; #it{p} (GeV/#it{c}); TPC Signal", kTH2F, {{tempFitVarpTAxis}, {1000, 0, 1000}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{e}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{#pi}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{K}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{p}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{d}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{e}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{#pi}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{K}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{p}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{d}", kTH2F, {{tempFitVarpTAxis}, {200, -4.975, 5.025}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{e}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{#pi}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{K}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{p}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); - mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{d}", kTH2F, {{tempFitVarpTAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/hTPCdEdX").c_str(), "; #it{p} (GeV/#it{c}); TPC Signal", kTH2F, {{tempFitVarMomAxis}, {1000, 0, 1000}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{e}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{#pi}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{K}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{p}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTPC_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TPC}^{d}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{e}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{#pi}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{K}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{p}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaTOF_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{TOF}^{d}", kTH2F, {{tempFitVarMomAxis}, {200, -4.975, 5.025}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_el").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{e}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_pi").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{#pi}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_K").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{K}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_p").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{p}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); + mHistogramRegistry->add((folderName + folderSuffix + "/nSigmaComb_d").c_str(), "; #it{p} (GeV/#it{c}); n#sigma_{comb}^{d}", kTH2F, {{tempFitVarMomAxis}, {100, 0, 5}}); } else if constexpr (mParticleType == o2::aod::femtouniverseparticle::ParticleType::kV0) { mHistogramRegistry->add((folderName + folderSuffix + "/hDaughDCA").c_str(), "; DCA^{daugh} (cm); Entries", kTH1F, {{1000, 0, 10}}); mHistogramRegistry->add((folderName + folderSuffix + "/hTransRadius").c_str(), "; #it{r}_{xy} (cm); Entries", kTH1F, {{1500, 0, 150}}); @@ -238,6 +238,7 @@ class FemtoUniverseParticleHisto } framework::AxisSpec tempFitVarpTAxis = {tempFitVarpTBins, "#it{p}_{T} (GeV/#it{c})"}; // the pT binning may vary + framework::AxisSpec tempFitVarMomAxis = {tempFitVarpTBins, "#it{p} (GeV/#it{c})"}; // the p binning framework::AxisSpec tempFitVarAxis = {tempFitVarBins, tempFitVarAxisTitle}; // std::string folderName = (static_cast(o2::aod::femtouniverseparticle::ParticleTypeName[mParticleType]).c_str() + static_cast(mFolderSuffix[mFolderSuffixType])).c_str(); @@ -246,7 +247,7 @@ class FemtoUniverseParticleHisto // Fill here the actual histogramms by calling init_base and init_MC init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); if (isDebug) { - init_debug(folderName, tempFitVarpTAxis); + init_debug(folderName, tempFitVarMomAxis); } if (isMC) { init_base(folderName, tempFitVarAxisTitle, tempFitVarpTAxis, tempFitVarAxis); diff --git a/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h b/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h index 63d9646cdde..5bee5c8940b 100644 --- a/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h +++ b/PWGCF/FemtoUniverse/Core/FemtoUniverseSelection.h @@ -101,7 +101,7 @@ class FemtoUniverseSelection /// \param cutContainer Bit-wise container for the systematic variations /// \param counter Position in the bit-wise container for the systematic variations to be modified template - void checkSelectionSetBit(selValDataType observable, T& cutContainer, size_t& counter) + void checkSelectionSetBit(selValDataType observable, T& cutContainer, std::size_t& counter) { /// If the selection is fulfilled the bit at the specified position (counter) within the bit-wise container is set to 1 if (isSelected(observable)) { diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index c4186b34d83..d73fc6794e5 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -341,7 +341,7 @@ struct FemtoUniverseProducerTask { Configurable trackD0pTGenMax{"trackD0pTGenMax", 24.0, "MC Truth, max. pT for tracks and D0/D0bar cand."}; Configurable useYCutD0Cand{"useYCutD0Cand", true, "True - apply cut on y of D0 cand./false - apply cut on eta"}; Configurable storeD0D0barDoubleMassHypo{"storeD0D0barDoubleMassHypo", false, "Store D0/D0bar cand. which pass selection criteria for both, D0 and D0bar"}; - Configurable> classMlD0D0bar{"classMlD0D0bar", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."}; + Configurable fillCorrBkgsD0{"fillCorrBkgsD0", false, "Flag to fill derived tables with correlated background candidates"}; } ConfD0Selection; // PID bitmask configurables @@ -1835,8 +1835,10 @@ struct FemtoUniverseProducerTask { for (const auto& hfCand : hfCands) { - if (!(hfCand.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { - continue; + if (!ConfD0Selection.fillCorrBkgsD0) { + if (!(hfCand.hfflag() & 1 << aod::hf_cand_2prong::DecayType::D0ToPiK)) { + continue; + } } if (ConfD0Selection.useYCutD0Cand && std::abs(hfHelper.yD0(hfCand)) > ConfD0Selection.yD0CandMax) { @@ -1853,11 +1855,11 @@ struct FemtoUniverseProducerTask { auto arrayDaughters = std::array{postrack, negtrack}; indexMcRec = RecoDecay::getMatchedMCRec(mcParticles, arrayDaughters, Pdg::kD0, std::array{+kPiPlus, -kKPlus}, true, &sign); - if (!(indexMcRec > -1)) { + if (!ConfD0Selection.fillCorrBkgsD0 && !(indexMcRec > -1)) { continue; } - if (std::abs(hfCand.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) { + if ((std::abs(hfCand.flagMcMatchRec()) == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiK) || (ConfD0Selection.fillCorrBkgsD0 && hfCand.flagMcMatchRec() != 0)) { int postrackID = hfCand.prong0Id(); // Index to first prong int rowInPrimaryTrackTablePos = -1; rowInPrimaryTrackTablePos = getRowDaughters(postrackID, tmpIDtrack); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index 638e410df62..865e4db500d 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -42,6 +42,8 @@ struct FemtoUniverseEfficiencyBase { Configurable confIsMCReco{"confIsMCReco", false, "Enable QA histograms for MC Reco"}; Configurable confDoPartNsigmaRejection{"confDoPartNsigmaRejection", false, "Enable particle nSigma rejection"}; + Configurable forceTof{"forceTof", false, "Enable to reject tracks without TOF for PID, set to false for processes with V0"}; + Configurable checkIfTofAvailable{"checkIfTofAvailable", false, "Enable to check if TOF is available for PID, set to false for processes with V0"}; // Collisions Configurable confZVertex{"confZVertex", 10.f, "Event sel: Maximum z-Vertex (cm)"}; @@ -70,9 +72,16 @@ struct FemtoUniverseEfficiencyBase { Configurable confNsigmaPiRejectKaNsigma{"confNsigmaPiRejectKaNsigma", 2.0, "Reject if a pion could be a kaon within a givien nSigma value"}; Configurable confNsigmaPiRejectPrNsigma{"confNsigmaPiRejectPrNsigma", 2.0, "Reject if a pion could be a proton within a givien nSigma value"}; Configurable confPDGCheckMCReco{"confPDGCheckMCReco", true, "Check PDG code of MC reco paricles"}; - } ConfBothTracks; + struct : o2::framework::ConfigurableGroup { + Configurable> trkPIDspecies{"trkPIDspecies", std::vector{o2::track::PID::Proton, o2::track::PID::Pion, o2::track::PID::Kaon}, "Trk sel: Particles species for PID, proton, pion, kaon"}; + Configurable> trkPidTPCMax{"trkPidTPCMax", std::vector{2., 3., 2.}, "maximum nSigma TPC"}; + Configurable> trkPidTOFMax{"trkPidTOFMax", std::vector{2., 3., 2.}, "maximum nSigma TOF"}; + Configurable trkPidTofPtThreshold{"trkPidTofPtThreshold", 0.6, "minimum pT after which TOF PID is applicable"}; + Configurable trkUsePassPIDSelection{"trkUsePassPIDSelection", false, "Set to true to use passPIDSelection function, if false then use isParticleNSigma"}; + } ConfTracksPid; + /// Lambda cuts Configurable confV0InvMassLowLimit{"confV0InvMassLowLimit", 1.10, "Lower limit of the V0 invariant mass"}; Configurable confV0InvMassUpLimit{"confV0InvMassUpLimit", 1.13, "Upper limit of the V0 invariant mass"}; @@ -84,10 +93,10 @@ struct FemtoUniverseEfficiencyBase { // Momentum thresholds for Run2 and Run3 Configurable confMomKaonRun2{"confMomKaonRun2", 0.4, "Momentum threshold for kaon identification using ToF (Run2)"}; Configurable confMomKaonRun3{"confMomKaonRun3", 0.3, "Momentum threshold for kaon identification using ToF (Run3)"}; - Configurable confMomKaon045{"confMomKaon045", 0.45, "Momentum threshold for kaon identification pT = 0.45 GeV/c"}; - Configurable confMomKaon055{"confMomKaon055", 0.55, "Momentum threshold for kaon identification pT = 0.55 GeV/c"}; - Configurable confMomKaon08{"confMomKaon08", 0.8, "Momentum threshold for kaon identification pT = 0.8 GeV/c"}; - Configurable confMomKaon15{"confMomKaon15", 1.5, "Momentum threshold for kaon identification pT = 1.5 GeV/c"}; + Configurable confMomKaon045{"confMomKaon045", 0.45, "Momentum threshold for kaon identification p = 0.45 GeV/c"}; + Configurable confMomKaon055{"confMomKaon055", 0.55, "Momentum threshold for kaon identification p = 0.55 GeV/c"}; + Configurable confMomKaon08{"confMomKaon08", 0.8, "Momentum threshold for kaon identification p = 0.8 GeV/c"}; + Configurable confMomKaon15{"confMomKaon15", 1.5, "Momentum threshold for kaon identification p = 1.5 GeV/c"}; // n sigma cuts for Run 2 Configurable confKaonNsigmaTPCbelow04Run2{"confKaonNsigmaTPCbelow04Run2", 2.0, "Reject kaons with pT below 0.4 if TPC n sigma is above this value."}; Configurable confKaonNsigmaTPCfrom04to045Run2{"confKaonNsigmaTPCfrom04to045Run2", 1.0, "Reject kaons within pT from 0.4 to 0.45 if TPC n sigma is above this value."}; @@ -122,7 +131,7 @@ struct FemtoUniverseEfficiencyBase { /// Particle 1 Configurable confPDGCodePartOne{"confPDGCodePartOne", 2212, "Particle 1 - PDG code"}; - Configurable confParticleTypePartOne{"confParticleTypePartOne", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 1 - particle type: 0 - track, 2 - V0, 6 - phi"}; + Configurable confParticleTypePartOne{"confParticleTypePartOne", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 1 - particle type: 0 - track, 2 - V0, 6 - phi"}; Configurable confNoPDGPartOne{"confNoPDGPartOne", false, "0: selecting part one by PDG, 1: no PID selection"}; Configurable confPtLowPart1{"confPtLowPart1", 0.2, "Lower limit for Pt for the first particle"}; Configurable confPtHighPart1{"confPtHighPart1", 2.5, "Higher limit for Pt for the first particle"}; @@ -143,7 +152,7 @@ struct FemtoUniverseEfficiencyBase { /// Particle 2 Configurable confIsSame{"confIsSame", false, "Pairs of the same particle"}; Configurable confPDGCodePartTwo{"confPDGCodePartTwo", 333, "Particle 2 - PDG code"}; - Configurable confParticleTypePartTwo{"confParticleTypePartTwo", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 2 - particle type: 0 - track, 2 - V0, 6 - phi"}; + Configurable confParticleTypePartTwo{"confParticleTypePartTwo", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 2 - particle type: 0 - track, 2 - V0, 6 - phi"}; Configurable confNoPDGPartTwo{"confNoPDGPartTwo", false, "0: selecting part two by PDG, 1: no PID selection"}; Configurable confPtLowPart2{"confPtLowPart2", 0.2, "Lower limit for Pt for the second particle"}; Configurable confPtHighPart2{"confPtHighPart2", 2.5, "Higher limit for Pt for the second particle"}; @@ -211,37 +220,51 @@ struct FemtoUniverseEfficiencyBase { } } - bool isProtonNSigma(float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx + bool isProtonNSigma(bool partHasTof, float mom, float nsigmaTPCPr, float nsigmaTOFPr) // previous version from: https://github.com/alisw/AliPhysics/blob/master/PWGCF/FEMTOSCOPY/AliFemtoUser/AliFemtoMJTrackCut.cxx { - if (mom < ConfBothTracks.confMomProton) { + if (forceTof && !partHasTof) { + return false; + } + + if (mom <= ConfBothTracks.confMomProton) { if (std::abs(nsigmaTPCPr) < ConfBothTracks.confNsigmaTPCProton) { return true; } else { return false; } - } else { - if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confNsigmaCombinedProton) { - return true; + } + if (mom > ConfBothTracks.confMomProton) { + if (checkIfTofAvailable && !partHasTof) { + return std::abs(nsigmaTPCPr) < ConfBothTracks.confNsigmaTPCProton; + } else if (checkIfTofAvailable && partHasTof) { + return std::sqrt(std::pow(nsigmaTPCPr, 2) + std::pow(nsigmaTOFPr, 2)) < ConfBothTracks.confNsigmaCombinedProton; } else { - return false; + return std::sqrt(std::pow(nsigmaTPCPr, 2) + std::pow(nsigmaTOFPr, 2)) < ConfBothTracks.confNsigmaCombinedProton; } } return false; } - bool isProtonNSigmaRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCKa, float nsigmaTOFKa) + bool isProtonNSigmaRejected(bool partHasTof, float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCKa, float nsigmaTOFKa) { - if (mom < ConfBothTracks.confMomProton) { + if (forceTof && !partHasTof) { + return true; + } + + // if (mom <= ConfBothTracks.confMomProton || !partHasTof) { + if (mom <= ConfBothTracks.confMomProton || !partHasTof) { if (std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaPrRejectPiNsigma) { return true; } else if (std::abs(nsigmaTPCKa) < ConfBothTracks.confNsigmaPrRejectKaNsigma) { return true; + } else { + return false; } } - if (mom > ConfBothTracks.confMomProton) { - if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confNsigmaPrRejectPiNsigma) { + if (mom > ConfBothTracks.confMomProton && partHasTof) { + if (std::sqrt(std::pow(nsigmaTPCPi, 2) + std::pow(nsigmaTOFPi, 2)) < ConfBothTracks.confNsigmaPrRejectPiNsigma) { return true; - } else if (std::hypot(nsigmaTOFKa, nsigmaTPCKa) < ConfBothTracks.confNsigmaPrRejectKaNsigma) { + } else if (std::sqrt(std::pow(nsigmaTPCKa, 2) + std::pow(nsigmaTOFKa, 2)) < ConfBothTracks.confNsigmaPrRejectKaNsigma) { return true; } else { return false; @@ -304,38 +327,48 @@ struct FemtoUniverseEfficiencyBase { } } - bool isKaonNSigmaLF(float mom, float nsigmaTPCK, float nsigmaTOFK) + bool isKaonNSigmaLF(bool partHasTof, float mom, float nsigmaTPCK, float nsigmaTOFK) { - if (mom < ConfKaonSelection.confMomKaonLF) { + if (forceTof && !partHasTof) { + return false; + } + + if (mom <= ConfKaonSelection.confMomKaonLF) { if (std::abs(nsigmaTPCK) < ConfKaonSelection.confNSigmaTPCKaonLF) { return true; } else { return false; } } else if (mom > ConfKaonSelection.confMomKaonLF) { - if (std::hypot(nsigmaTOFK, nsigmaTPCK) < ConfKaonSelection.confNSigmaCombKaonLF) { - return true; + if (checkIfTofAvailable && !partHasTof) { + return std::abs(nsigmaTPCK) < ConfKaonSelection.confNSigmaTPCKaonLF; + } else if (checkIfTofAvailable && partHasTof) { + return std::sqrt(std::pow(nsigmaTPCK, 2) + std::pow(nsigmaTOFK, 2)) < ConfKaonSelection.confNSigmaCombKaonLF; } else { - return false; + return std::sqrt(std::pow(nsigmaTPCK, 2) + std::pow(nsigmaTOFK, 2)) < ConfKaonSelection.confNSigmaCombKaonLF; } } else { return false; } } - bool isKaonNSigmaLFRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCPr, float nsigmaTOFPr) + bool isKaonNSigmaLFRejected(bool partHasTof, float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCPr, float nsigmaTOFPr) { - if (mom < ConfKaonSelection.confMomKaonLF) { + if (forceTof && !partHasTof) { + return true; + } + + if (mom <= ConfKaonSelection.confMomKaonLF || !partHasTof) { if (std::abs(nsigmaTPCPi) < ConfKaonSelection.confNsigmaKaRejectPiNsigma) { return true; } else if (std::abs(nsigmaTPCPr) < ConfKaonSelection.confNsigmaKaRejectPrNsigma) { return true; } } - if (mom > ConfKaonSelection.confMomKaonLF) { - if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfKaonSelection.confNsigmaKaRejectPiNsigma) { + if (mom > ConfKaonSelection.confMomKaonLF && partHasTof) { + if (std::sqrt(std::pow(nsigmaTPCPi, 2) + std::pow(nsigmaTOFPi, 2)) < ConfKaonSelection.confNsigmaKaRejectPiNsigma) { return true; - } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfKaonSelection.confNsigmaKaRejectPrNsigma) { + } else if (std::sqrt(std::pow(nsigmaTPCPr, 2) + std::pow(nsigmaTOFPr, 2)) < ConfKaonSelection.confNsigmaKaRejectPrNsigma) { return true; } else { return false; @@ -345,37 +378,48 @@ struct FemtoUniverseEfficiencyBase { } } - bool isPionNSigma(float mom, float nsigmaTPCPi, float nsigmaTOFPi) + bool isPionNSigma(bool partHasTof, float mom, float nsigmaTPCPi, float nsigmaTOFPi) { - if (mom < ConfBothTracks.confMomPion) { + if (forceTof && !partHasTof) { + return false; + } + + if (mom <= ConfBothTracks.confMomPion) { if (std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaTPCPion) { return true; } else { return false; } - } else { - if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfBothTracks.confNsigmaCombinedPion) { - return true; + } else if (mom > ConfBothTracks.confMomPion) { + if (checkIfTofAvailable && !partHasTof) { + return std::abs(nsigmaTPCPi) < ConfBothTracks.confNsigmaTPCPion; + } else if (checkIfTofAvailable && partHasTof) { + return std::sqrt(std::pow(nsigmaTPCPi, 2) + std::pow(nsigmaTOFPi, 2)) < ConfBothTracks.confNsigmaCombinedPion; } else { - return false; + return std::sqrt(std::pow(nsigmaTPCPi, 2) + std::pow(nsigmaTOFPi, 2)) < ConfBothTracks.confNsigmaCombinedPion; } + } else { + return false; } - return false; } - bool isPionNSigmaRejected(float mom, float nsigmaTPCKa, float nsigmaTOFKa, float nsigmaTPCPr, float nsigmaTOFPr) + bool isPionNSigmaRejected(bool partHasTof, float mom, float nsigmaTPCKa, float nsigmaTOFKa, float nsigmaTPCPr, float nsigmaTOFPr) { - if (mom < ConfBothTracks.confMomPion) { + if (forceTof && !partHasTof) { + return true; + } + + if (mom <= ConfBothTracks.confMomPion || !partHasTof) { if (std::abs(nsigmaTPCKa) < ConfBothTracks.confNsigmaPiRejectKaNsigma) { return true; } else if (std::abs(nsigmaTPCPr) < ConfBothTracks.confNsigmaPiRejectPrNsigma) { return true; } } - if (mom > ConfBothTracks.confMomPion) { - if (std::hypot(nsigmaTOFKa, nsigmaTPCKa) < ConfBothTracks.confNsigmaPiRejectKaNsigma) { + if (mom > ConfBothTracks.confMomPion && partHasTof) { + if (std::sqrt(std::pow(nsigmaTPCKa, 2) + std::pow(nsigmaTOFKa, 2)) < ConfBothTracks.confNsigmaPiRejectKaNsigma) { return true; - } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfBothTracks.confNsigmaPiRejectPrNsigma) { + } else if (std::sqrt(std::pow(nsigmaTPCPr, 2) + std::pow(nsigmaTOFPr, 2)) < ConfBothTracks.confNsigmaPiRejectPrNsigma) { return true; } else { return false; @@ -398,21 +442,21 @@ struct FemtoUniverseEfficiencyBase { } } - bool isParticleNSigma(int pdgCode, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe) + bool isParticleNSigma(int pdgCode, bool partHasTof, float mom, float nsigmaTPCPr, float nsigmaTOFPr, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCK, float nsigmaTOFK, float nsigmaTPCDe, float nsigmaTOFDe) { switch (pdgCode) { case 2212: // Proton case -2212: // anty Proton - return isProtonNSigma(mom, nsigmaTPCPr, nsigmaTOFPr); + return isProtonNSigma(partHasTof, mom, nsigmaTPCPr, nsigmaTOFPr); break; case 211: // Pion case -211: // Pion- - return isPionNSigma(mom, nsigmaTPCPi, nsigmaTOFPi); + return isPionNSigma(partHasTof, mom, nsigmaTPCPi, nsigmaTOFPi); break; case 321: // Kaon+ case -321: // Kaon- if (isKaonLF) { - return isKaonNSigmaLF(mom, nsigmaTPCK, nsigmaTOFK); + return isKaonNSigmaLF(partHasTof, mom, nsigmaTPCK, nsigmaTOFK); } else { return isKaonNSigma(mom, nsigmaTPCK, nsigmaTOFK); } @@ -426,21 +470,21 @@ struct FemtoUniverseEfficiencyBase { } } - bool isParticleNSigmaRejected(int pdgCode, float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCKa, float nsigmaTOFKa, float nsigmaTPCPr, float nsigmaTOFPr) + bool isParticleNSigmaRejected(int pdgCode, bool partHasTof, float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCKa, float nsigmaTOFKa, float nsigmaTPCPr, float nsigmaTOFPr) { switch (pdgCode) { case 2212: // Proton case -2212: // anty Proton - return isProtonNSigmaRejected(mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCKa, nsigmaTOFKa); + return isProtonNSigmaRejected(partHasTof, mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCKa, nsigmaTOFKa); break; case 211: // Pion case -211: // Pion- - return isPionNSigmaRejected(mom, nsigmaTPCKa, nsigmaTOFKa, nsigmaTPCPr, nsigmaTOFPr); + return isPionNSigmaRejected(partHasTof, mom, nsigmaTPCKa, nsigmaTOFKa, nsigmaTPCPr, nsigmaTOFPr); break; case 321: // Kaon+ case -321: // Kaon- if (isKaonLF) { - return isKaonNSigmaLFRejected(mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCPr, nsigmaTOFPr); + return isKaonNSigmaLFRejected(partHasTof, mom, nsigmaTPCPi, nsigmaTOFPi, nsigmaTPCPr, nsigmaTOFPr); } else { return false; // in case of non LF kaon selecion } @@ -450,6 +494,50 @@ struct FemtoUniverseEfficiencyBase { } } + template + bool passPIDSelection(Atrack const& track, SpeciesContainer const mPIDspecies, + T1 const maxTPC, T2 const maxTOF, double ptThreshold = 0.75, bool tofForced = false, bool partHasTof = false) + { + // Ensure size consistency + if (mPIDspecies.value.size() != maxTPC.value.size() || mPIDspecies.value.size() != maxTOF.value.size()) { + LOGF(error, "Size of particle species and corresponding nSigma selection arrays should be the same"); + return false; // Early exit on error + } + + for (size_t speciesIndex = 0; speciesIndex < mPIDspecies.value.size(); ++speciesIndex) { + auto const& pid = mPIDspecies->at(speciesIndex); + auto nSigmaTPC = o2::aod::pidutils::tpcNSigma(pid, track); + + if (tofForced && !partHasTof) { + return false; + } + + if (speciesIndex == 0) { // First species logic + if (std::abs(nSigmaTPC) > maxTPC->at(speciesIndex)) { + return false; // TPC check failed + } + if (tofForced || (track.pt() > ptThreshold && partHasTof)) { + auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track); + if (std::abs(nSigmaTOF) > maxTOF->at(speciesIndex)) { + return false; // TOF check failed + } + } + } else { // Other species logic + if (std::abs(nSigmaTPC) < maxTPC->at(speciesIndex)) { // Check TPC nSigma first + if (partHasTof) { + auto nSigmaTOF = o2::aod::pidutils::tofNSigma(pid, track); + if (std::abs(nSigmaTOF) < maxTOF->at(speciesIndex)) { + return false; // Reject if both TPC and TOF are within thresholds + } + } else { + return false; // Reject if only TPC is within threshold and TOF is unavailable + } + } + } + } + return true; // Passed all checks + } + bool invMLambda(float invMassLambda, float invMassAntiLambda) { if ((invMassLambda < confV0InvMassLowLimit || invMassLambda > confV0InvMassUpLimit) && (invMassAntiLambda < confV0InvMassLowLimit || invMassAntiLambda > confV0InvMassUpLimit)) { @@ -515,13 +603,19 @@ struct FemtoUniverseEfficiencyBase { } registryCuts.fill(HIST("part1/cutsVspT"), part.pt(), 2); - if (!isParticleNSigma(confPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { - continue; + if (!ConfTracksPid.trkUsePassPIDSelection) { + if (!isParticleNSigma(confPDGCodePartOne, static_cast(part.mLambda()), part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { + continue; + } + if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartOne, static_cast(part.mLambda()), part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { + continue; + } + } else { + if (!passPIDSelection(part, ConfTracksPid.trkPIDspecies, ConfTracksPid.trkPidTPCMax, ConfTracksPid.trkPidTOFMax, ConfTracksPid.trkPidTofPtThreshold, forceTof, static_cast(part.mLambda()))) { + continue; + } } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { - continue; - } registryCuts.fill(HIST("part1/cutsVspT"), part.pt(), 3); if (!part.has_fdMCParticle()) { @@ -568,12 +662,19 @@ struct FemtoUniverseEfficiencyBase { } registryCuts.fill(HIST("part2/cutsVspT"), part.pt(), 2); - if (!isParticleNSigma(confPDGCodePartTwo, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { - continue; - } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartTwo, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { - continue; + if (!ConfTracksPid.trkUsePassPIDSelection) { + if (!isParticleNSigma(confPDGCodePartTwo, static_cast(part.mLambda()), part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { + continue; + } + if (confDoPartNsigmaRejection && isParticleNSigmaRejected(confPDGCodePartTwo, static_cast(part.mLambda()), part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton))) { + continue; + } + } else { + if (!passPIDSelection(part, ConfTracksPid.trkPIDspecies, ConfTracksPid.trkPidTPCMax, ConfTracksPid.trkPidTOFMax, ConfTracksPid.trkPidTofPtThreshold, forceTof, static_cast(part.mLambda()))) { + continue; + } } + registryCuts.fill(HIST("part2/cutsVspT"), part.pt(), 3); if (!part.has_fdMCParticle()) { @@ -618,7 +719,7 @@ struct FemtoUniverseEfficiencyBase { { // part1 is track and part2 is Phi for (const auto& part : grouppartsOneMCRec) { - if (part.partType() != confParticleTypePartOne || part.sign() != confChargePart1 || !isParticleNSigma(confPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { + if (part.partType() != confParticleTypePartOne || part.sign() != confChargePart1 || !isParticleNSigma(confPDGCodePartOne, static_cast(part.mLambda()), part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { continue; } trackHistoPartOneRec.fillQA(part); @@ -672,10 +773,10 @@ struct FemtoUniverseEfficiencyBase { const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); - if (confPDGCodePartOne > 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartOne > 0 && (!isProtonNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } - if (confPDGCodePartOne < 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartOne < 0 && (!isProtonNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } @@ -706,10 +807,10 @@ struct FemtoUniverseEfficiencyBase { const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); - if (confPDGCodePartTwo > 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartTwo > 0 && (!isProtonNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } - if (confPDGCodePartTwo < 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartTwo < 0 && (!isProtonNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } @@ -746,7 +847,7 @@ struct FemtoUniverseEfficiencyBase { /// Histogramming same event for (const auto& part : grouppartsOneMCRec) { - if (part.partType() != confParticleTypePartOne || part.sign() != confChargePart1 || !isParticleNSigma(confPDGCodePartOne, part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { + if (part.partType() != confParticleTypePartOne || part.sign() != confChargePart1 || !isParticleNSigma(confPDGCodePartOne, static_cast(part.mLambda()), part.p(), trackCuts.getNsigmaTPC(part, o2::track::PID::Proton), trackCuts.getNsigmaTOF(part, o2::track::PID::Proton), trackCuts.getNsigmaTPC(part, o2::track::PID::Pion), trackCuts.getNsigmaTOF(part, o2::track::PID::Pion), trackCuts.getNsigmaTPC(part, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(part, o2::track::PID::Deuteron), trackCuts.getNsigmaTOF(part, o2::track::PID::Deuteron))) { continue; } @@ -768,10 +869,10 @@ struct FemtoUniverseEfficiencyBase { const auto& posChild = parts.iteratorAt(part.index() - 2); const auto& negChild = parts.iteratorAt(part.index() - 1); - if (confPDGCodePartTwo > 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartTwo > 0 && (!isProtonNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(posChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } - if (confPDGCodePartTwo < 0 && (!isProtonNSigma(0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF + if (confPDGCodePartTwo < 0 && (!isProtonNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(negChild, o2::track::PID::Proton), trackCuts.getNsigmaTOF(negChild, o2::track::PID::Proton)) || !isPionNSigma(static_cast(negChild.mLambda()), 0, trackCuts.getNsigmaTPC(posChild, o2::track::PID::Pion), trackCuts.getNsigmaTOF(posChild, o2::track::PID::Pion)))) { // give momentum as 0 to only check TPC nSigma, not combined with TOF continue; } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx index 6417529d529..715a3c1380a 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackCascadeExtended.cxx @@ -58,10 +58,6 @@ struct femtoUniversePairTaskTrackCascadeExtended { Configurable confCascInvMassLowLimit{"confCascInvMassLowLimit", 1.315, "Lower limit of the Casc invariant mass"}; Configurable confCascInvMassUpLimit{"confCascInvMassUpLimit", 1.325, "Upper limit of the Casc invariant mass"}; - // TODO: Add seperate selection for daughter particles - // Configurable confNSigmaTPCPion{"confNSigmaTPCPion", 4, "NSigmaTPCPion"}; - // Configurable confNSigmaTPCProton{"confNSigmaTPCProton", 4, "NSigmaTPCProton"}; - /// applying narrow cut Configurable confZVertexCut{"confZVertexCut", 10.f, "Event sel: Maximum z-Vertex (cm)"}; Configurable confEta{"confEta", 0.8, "Eta cut for the global track"}; @@ -200,10 +196,24 @@ struct femtoUniversePairTaskTrackCascadeExtended { bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle, bool hasTOF) { - if (mom <= confmom || hasTOF == 0) { + if (mom <= confmom) { return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle); - } else { + } else if (hasTOF == 1) { return (TMath::Hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle); + } else { + return false; + } + } + + template + bool isNSigmaCombinedBitmask(float mom, const T& part) + { + if (mom <= confmom) { + return ((part.pidCut() & (1u << confTrackChoicePartOne)) != 0); + } else if ((part.pidCut() & 512u) != 0) { + return ((part.pidCut() & (64u << confTrackChoicePartOne)) != 0); + } else { + return false; } } @@ -481,10 +491,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { trackHistoPartOneNeg.fillQA(part); } } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & (64u << confTrackChoicePartOne)) == 0) - continue; - } else if ((part.pidCut() & (1u << confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) { continue; } if (part.mAntiLambda() > 0) { @@ -504,10 +511,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; } else { - if ((p1.pidCut() & 512u) != 0) { - if ((p1.pidCut() & (64u << confTrackChoicePartOne)) == 0) - continue; - } else if ((p1.pidCut() & (1u << confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(p1.p(), p1)) { continue; } } @@ -751,10 +755,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isParticleCombined(p1, confTrackChoicePartOne)) continue; } else { - if ((p1.pidCut() & 512u) != 0) { - if ((p1.pidCut() & (64u << confTrackChoicePartOne)) == 0) - continue; - } else if ((p1.pidCut() & (1u << confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(p1.p(), p1)) { continue; } } @@ -1168,10 +1169,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), (part.pidCut() & 512u) != 0)) continue; } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & 64u) == 0) - continue; - } else if ((part.pidCut() & 1u) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) { continue; } } @@ -1185,10 +1183,7 @@ struct femtoUniversePairTaskTrackCascadeExtended { if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), (part.pidCut() & 512u) != 0)) continue; } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & 64u) == 0) - continue; - } else if ((part.pidCut() & 1u) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) { continue; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx index 65538ecd6f0..8cde231fecb 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackD0.cxx @@ -109,7 +109,7 @@ struct FemtoUniversePairTaskTrackD0 { // Particle identification Configurable minMomPidTpcTofProton{"minMomPidTpcTofProton", 0.8, "Momentum threshold for change of the PID method (from using TPC to TPC and TOF)."}; Configurable minMomPidTpcTofPion{"minMomPidTpcTofPion", 0.7, "Momentum threshold for change of the PID method (from using TPC to TPC and TOF)."}; - Configurable minMomPidTpcTofKaonLF{"minMomPidTpcTofKaonLF", 0.5, "Momentum threshold for change of the PID method (from using TPC to TPC and TOF)."}; + Configurable minMomPidTpcTofKaon{"minMomPidTpcTofKaon", 0.5, "Momentum threshold for change of the PID method (from using TPC to TPC and TOF)."}; // Configurables with nSigma values for particle selection Configurable confNsigmaCombinedProton{"confNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined)"}; Configurable confNsigmaTPCProton{"confNsigmaTPCProton", 3.0, "TPC Proton Sigma"}; @@ -124,6 +124,8 @@ struct FemtoUniversePairTaskTrackD0 { Configurable confNsigmaKaRejectPrNsigma{"confNsigmaKaRejectPrNsigma", 2.0, "Reject if kaon could be a proton within a givien nSigma value"}; Configurable confNsigmaPiRejectKaNsigma{"confNsigmaPiRejectKaNsigma", 2.0, "Reject if pion could be a kaon within a givien nSigma value"}; Configurable confNsigmaPiRejectPrNsigma{"confNsigmaPiRejectPrNsigma", 2.0, "Reject if pion could be a proton within a givien nSigma value"}; + // Configurable to enable particle rejection + Configurable confDoPartNsigmaRejection{"confDoPartNsigmaRejection", false, "Enable particle nSigma rejection"}; } ConfTrack; /// Particle 2 --- D0/D0bar meson @@ -157,11 +159,11 @@ struct FemtoUniversePairTaskTrackD0 { Configurable> binsPt{"binsPt", std::vector{hf_cuts_d0_to_pi_k::vecBinsPt}, "pT bin limits"}; Configurable confChooseD0trackCorr{"confChooseD0trackCorr", 0, "If 0 correlations with D0s, if 1 with D0bars"}; + // Correlated background for D0/D0bar candidates + Configurable fillCorrBkgs{"fillCorrBkgs", false, "Fill histograms with correlated background candidates"}; // Efficiency Configurable doEfficiencyCorr{"doEfficiencyCorr", false, "Apply efficiency corrections"}; - // Particle rejection - Configurable confDoPartNsigmaRejection{"confDoPartNsigmaRejection", false, "Enable particle nSigma rejection"}; /// Partitions for particle 1 Partition partsTrack = (aod::femtouniverseparticle::partType == uint8_t(aod::femtouniverseparticle::ParticleType::kTrack)) && (aod::femtouniverseparticle::sign == int8_t(ConfTrack.confTrackSign)) && (aod::femtouniverseparticle::pt > ConfTrack.confTrackLowPtCut) && (aod::femtouniverseparticle::pt < ConfTrack.confTrackHighPtCut) && (nabs(aod::femtouniverseparticle::eta) < ConfTrack.confTrackEtaMax); @@ -324,13 +326,13 @@ struct FemtoUniversePairTaskTrackD0 { bool isKaonNSigmaLF(float mom, float nsigmaTPCKa, float nsigmaTOFKa) { - if (mom < ConfTrack.minMomPidTpcTofKaonLF) { + if (mom < ConfTrack.minMomPidTpcTofKaon) { if (std::abs(nsigmaTPCKa) < ConfTrack.confNsigmaTPCKaon) { return true; } else { return false; } - } else if (mom > ConfTrack.minMomPidTpcTofKaonLF) { + } else if (mom > ConfTrack.minMomPidTpcTofKaon) { if (std::hypot(nsigmaTOFKa, nsigmaTPCKa) < ConfTrack.confNsigmaCombinedKaon) { return true; } else { @@ -343,14 +345,14 @@ struct FemtoUniversePairTaskTrackD0 { bool isKaonNSigmaLFRejected(float mom, float nsigmaTPCPi, float nsigmaTOFPi, float nsigmaTPCPr, float nsigmaTOFPr) { - if (mom < ConfTrack.minMomPidTpcTofKaonLF) { + if (mom < ConfTrack.minMomPidTpcTofKaon) { if (std::abs(nsigmaTPCPi) < ConfTrack.confNsigmaKaRejectPiNsigma) { return true; } else if (std::abs(nsigmaTPCPr) < ConfTrack.confNsigmaKaRejectPrNsigma) { return true; } } - if (mom > ConfTrack.minMomPidTpcTofKaonLF) { + if (mom > ConfTrack.minMomPidTpcTofKaon) { if (std::hypot(nsigmaTOFPi, nsigmaTPCPi) < ConfTrack.confNsigmaKaRejectPiNsigma) { return true; } else if (std::hypot(nsigmaTOFPr, nsigmaTPCPr) < ConfTrack.confNsigmaKaRejectPrNsigma) { @@ -554,6 +556,17 @@ struct FemtoUniversePairTaskTrackD0 { mcRecoRegistry.add("hMassVsPtD0barBkg", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); mcRecoRegistry.add("hMassVsPtD0barPrompt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); mcRecoRegistry.add("hMassVsPtD0barNonPrompt", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + // Histograms for D0/D0bar correlated backgrounds + if (fillCorrBkgs) { + mcRecoRegistry.add("hMassVsPtD0ToPiKaPi", "2-prong candidates;inv. mass (#pi^{+} K^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0ToPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0ToPiPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0ToKaKa", "2-prong candidates;inv. mass (K^{+} K^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0barToPiKaPi", "2-prong candidates;inv. mass (#pi^{+} K^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0barToPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0barToPiPiPi", "2-prong candidates;inv. mass (#pi^{+} #pi^{-} #pi^{0}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + mcRecoRegistry.add("hMassVsPtD0barToKaKa", "2-prong candidates;inv. mass (K^{+} K^{-}) (GeV/#it{c}^{2});entries", {HistType::kTH2F, {confInvMassBins, {vbins, "#it{p}_{T} (GeV/#it{c})"}}}); + } // Histograms for identified hadrons mcRecoRegistry.add("hMcRecKpPt", "MC Reco K+;#it{p}_{T} (GeV/c); counts", {HistType::kTH1F, {{500, 0, 5}}}); mcRecoRegistry.add("hMcRecKpPtGenEtaGen", "MC Reco K+;#it{p}_{T} (GeV/c); #eta", {HistType::kTH2F, {{500, 0, 5}, {400, -1.0, 1.0}}}); @@ -898,7 +911,7 @@ struct FemtoUniversePairTaskTrackD0 { if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { + if (ConfTrack.confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { continue; } } @@ -928,7 +941,7 @@ struct FemtoUniversePairTaskTrackD0 { if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { + if (ConfTrack.confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { continue; } } @@ -1128,7 +1141,7 @@ struct FemtoUniversePairTaskTrackD0 { if (!isParticleNSigma(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon))) { continue; } - if (confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { + if (ConfTrack.confDoPartNsigmaRejection && isParticleNSigmaRejected(track.p(), trackCuts.getNsigmaTPC(track, o2::track::PID::Pion), trackCuts.getNsigmaTOF(track, o2::track::PID::Pion), trackCuts.getNsigmaTPC(track, o2::track::PID::Kaon), trackCuts.getNsigmaTOF(track, o2::track::PID::Kaon), trackCuts.getNsigmaTPC(track, o2::track::PID::Proton), trackCuts.getNsigmaTOF(track, o2::track::PID::Proton))) { continue; } } @@ -1486,6 +1499,17 @@ struct FemtoUniversePairTaskTrackD0 { } else { mcRecoRegistry.fill(HIST("hMassVsPtD0Bkg"), part.mLambda(), part.pt(), weight); } + if (fillCorrBkgs) { + if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0) { // D0 -> pi+K-pi0 + mcRecoRegistry.fill(HIST("hMassVsPtD0ToPiKaPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPi) { // D0 -> pi+pi- + mcRecoRegistry.fill(HIST("hMassVsPtD0ToPiPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPiPi0) { // D0 -> pi+pi-pi0 + mcRecoRegistry.fill(HIST("hMassVsPtD0ToPiPiPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToKK) { // D0 -> K+K- + mcRecoRegistry.fill(HIST("hMassVsPtD0ToKaKa"), part.mLambda(), part.pt(), weight); + } + } if (part.tpcNClsFound() == 0) { // prompt candidates mcRecoRegistry.fill(HIST("hMassVsPtD0Prompt"), part.mLambda(), part.pt(), weight); } else if (part.tpcNClsFound() == 1) { // non-prompt candidates @@ -1499,6 +1523,17 @@ struct FemtoUniversePairTaskTrackD0 { } else { mcRecoRegistry.fill(HIST("hMassVsPtD0barBkg"), part.mAntiLambda(), part.pt(), weight); } + if (fillCorrBkgs) { + if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiKPi0) { // D0 -> pi+K-pi0 + mcRecoRegistry.fill(HIST("hMassVsPtD0barToPiKaPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPi) { // D0 -> pi+pi- + mcRecoRegistry.fill(HIST("hMassVsPtD0barToPiPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToPiPiPi0) { // D0 -> pi+pi-pi0 + mcRecoRegistry.fill(HIST("hMassVsPtD0barToPiPiPi"), part.mLambda(), part.pt(), weight); + } else if (part.sign() == -o2::hf_decay::hf_cand_2prong::DecayChannelMain::D0ToKK) { // D0 -> K+K- + mcRecoRegistry.fill(HIST("hMassVsPtD0barToKaKa"), part.mLambda(), part.pt(), weight); + } + } if (part.tpcNClsFound() == 0) { // prompt candidates mcRecoRegistry.fill(HIST("hMassVsPtD0barPrompt"), part.mAntiLambda(), part.pt(), weight); } else if (part.tpcNClsFound() == 1) { // non-prompt candidates diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx index f5a4409a2e7..023a355abc6 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackSpherHarMultKtExtended.cxx @@ -86,6 +86,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable confPhiBins{"confPhiBins", 29, "Number of phi bins in deta dphi"}; Configurable confEtaBins{"confEtaBins", 29, "Number of eta bins in deta dphi"}; Configurable confIsCPR{"confIsCPR", true, "Close Pair Rejection"}; + Configurable confIsCPRatITS{"confIsCPRatITS", false, "Close Pair check at ITS"}; Configurable confCPRPlotPerRadii{"confCPRPlotPerRadii", false, "Plot CPR per radii"}; Configurable confCPRdeltaPhiCutMax{"confCPRdeltaPhiCutMax", 0.0, "Delta Phi max cut for Close Pair Rejection"}; Configurable confCPRdeltaPhiCutMin{"confCPRdeltaPhiCutMin", 0., "Delta Phi min cut for Close Pair Rejection"}; @@ -96,6 +97,15 @@ 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 confPairFracSharedTPCclsMin{"confPairFracSharedTPCclsMin", 0.0, "Min. fraction of TPC shared clusters between two closed tracks"}; + Configurable confPairFracSharedTPCclsMax{"confPairFracSharedTPCclsMax", 1.0, "Miax. 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"}; @@ -105,6 +115,7 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { Configurable confCPRDistMax{"confCPRDistMax", 0.0, "Max. radial seperation between two closed-pairs"}; Configurable confCPRFracMax{"confCPRFracMax", 0.0, "Max. allowed fraction bad to all TPC points of radial seperation between two closed-pairs"}; Configurable confCPRDphiAvgOrDist{"confCPRDphiAvgOrDist", true, "Close Pair Rejection by radial or angular seperation"}; + Configurable confIsCircularCut{"confIsCircularCut", true, "Close Pair Rejection within circular area"}; Configurable confIs1D{"confIs1D", true, "Filling 1D 2k* dist. in MC truth"}; Configurable confisIdenLCMS{"confisIdenLCMS", true, "Choosing identical or non-identical pairs in LCMS"}; Configurable confIsWeight{"confIsWeight", true, "Fill quantum weight"}; @@ -113,7 +124,14 @@ 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 >= static_cast(twotracksconfigs.confTrkTPCcRowsMin)) && + (aod::femtouniverseparticle::tpcFractionSharedCls <= twotracksconfigs.confTrkTPCfracsClsMax) && + (aod::femtouniverseparticle::tpcNClsFound >= static_cast(twotracksconfigs.confTrkTPCnClsMin)) && + (aod::track::tpcNClsShared <= static_cast(twotracksconfigs.confTrkTPCsClsMax))); + using FilteredFemtoFullParticles = soa::Filtered; // using FilteredFemtoFullParticles = FemtoFullParticles; //if no filtering is applied uncomment this optionconfIsCPRkT using FemtoRecoParticles = soa::Join; @@ -542,19 +560,23 @@ 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.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { + continue; + } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(p1, p2, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } } else { - if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairFrac(p1, p2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { continue; } } @@ -585,6 +607,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.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { + continue; + } + double rand; rand = randgen->Rndm(); @@ -597,17 +624,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(part1, part2, magFieldTesla, femto_universe_container::EventType::same)) { continue; } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(part1, part2, femto_universe_container::EventType::same, kT, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::same, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } } else { - if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::same, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { continue; } } @@ -943,6 +970,12 @@ 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.confPairFracSharedTPCclsMin.value || pairFractionTPCsCls >= twotracksconfigs.confPairFracSharedTPCclsMax.value) { + continue; + } + double rand; rand = randgen->Rndm(); auto part1 = p1; @@ -954,17 +987,17 @@ struct femtoUniversePairTaskTrackTrackSpherHarMultKtExtended { } if (twotracksconfigs.confIsCPR.value) { - if (twotracksconfigs.confCPRFracMax.value) { + if (twotracksconfigs.confIsCPRatITS && twotracksconfigs.confCPRFracMax.value) { if (pairCloseRejection.isClosePairAtITS(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed)) { continue; } } else { if (twotracksconfigs.confIsCPRkT) { - if (pairCloseRejection.isClosePairkT(part1, part2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairkT(p1, p2, femto_universe_container::EventType::mixed, kT, twotracksconfigs.confIsCircularCut, twotracksconfigs.confCPRDphiAvgOrDist, magFieldTesla, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax)) { continue; } } else { - if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confCPRDphiAvgOrDist)) { + if (pairCloseRejection.isClosePairFrac(part1, part2, magFieldTesla, femto_universe_container::EventType::mixed, twotracksconfigs.confCPRDphiAvgOrDist, twotracksconfigs.confCPRDistMax, twotracksconfigs.confCPRFracMax, twotracksconfigs.confIsCircularCut)) { continue; } } diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx index 283f9b463d0..c317199d716 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Extended.cxx @@ -210,10 +210,24 @@ struct FemtoUniversePairTaskTrackV0Extended { bool isNSigmaCombined(float mom, float nsigmaTPCParticle, float nsigmaTOFParticle, bool hasTOF) { - if (mom <= confmom || hasTOF == 0) { + if (mom <= confmom) { return (std::abs(nsigmaTPCParticle) < confNsigmaTPCParticle); - } else { + } else if (hasTOF == 1) { return (std::hypot(nsigmaTOFParticle, nsigmaTPCParticle) < confNsigmaCombinedParticle); + } else { + return false; + } + } + + template + bool isNSigmaCombinedBitmask(float mom, const T& part) + { + if (mom <= confmom) { + return ((part.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) != 0); + } else if ((part.pidCut() & 512u) != 0) { + return ((part.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) != 0); + } else { + return false; } } @@ -488,12 +502,8 @@ struct FemtoUniversePairTaskTrackV0Extended { trackHistoPartOneNeg.fillQA(part); } } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) - continue; - } else if ((part.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) continue; - } if (ConfTrkSelection.confChargePart1 > 0) trackHistoPartOnePos.fillQA(part); if (ConfTrkSelection.confChargePart1 < 0) @@ -511,12 +521,8 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isParticleCombined(p1, ConfTrkSelection.confTrackChoicePartOne)) continue; } else { - if ((p1.pidCut() & 512u) != 0) { - if ((p1.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) - continue; - } else if ((p1.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(p1.p(), p1)) continue; - } } // track cleaning if (!pairCleaner.isCleanPair(p1, p2, parts)) { @@ -986,12 +992,8 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isParticleCombined(p1, ConfTrkSelection.confTrackChoicePartOne)) continue; } else { - if ((p1.pidCut() & 512u) != 0) { - if ((p1.pidCut() & (64u << ConfTrkSelection.confTrackChoicePartOne)) == 0) - continue; - } else if ((p1.pidCut() & (1u << ConfTrkSelection.confTrackChoicePartOne)) == 0) { + if (!isNSigmaCombinedBitmask(p1.p(), p1)) continue; - } } const auto& posChild = parts.iteratorAt(p2.globalIndex() - 2 - parts.begin().globalIndex()); @@ -1684,12 +1686,8 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), (part.pidCut() & 512u) != 0)) continue; } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & 64u) == 0) // 64 for proton combined - continue; - } else if ((part.pidCut() & 1u) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) continue; - } } registryMCreco.fill(HIST("plus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("plus/MCrecoPrPt"), mcpart.pt()); @@ -1715,12 +1713,8 @@ struct FemtoUniversePairTaskTrackV0Extended { if (!isNSigmaCombined(part.p(), aod::pidtpc_tiny::binning::unPackInTable(part.tpcNSigmaStorePr()), aod::pidtof_tiny::binning::unPackInTable(part.tofNSigmaStorePr()), (part.pidCut() & 512u) != 0)) continue; } else { - if ((part.pidCut() & 512u) != 0) { - if ((part.pidCut() & 64u) == 0) // 64 for proton combined - continue; - } else if ((part.pidCut() & 1u) == 0) { + if (!isNSigmaCombinedBitmask(part.p(), part)) continue; - } } registryMCreco.fill(HIST("minus/MCrecoPr"), mcpart.pt(), mcpart.eta()); registryMCreco.fill(HIST("minus/MCrecoPrPt"), mcpart.pt()); diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackV0Helicity.cxx index afee000d7d6..cd31dc73b55 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,14 @@ 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"}; + ConfigurableAxis confInvMassMotherBinsHel{"confInvMassMotherBinsHel", {1000, 0.8, 1.4}, "InvMassMother binning in the pT vs. InvMassMother plot for helicity"}; /// Efficiency Configurable confLocalEfficiency{"confLocalEfficiency", "", "Local path to efficiency .root file"}; @@ -218,10 +221,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 +297,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} (GeV/#it{c}); M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, confInvMassMotherBinsHel}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel2", " ; p_{T} (GeV/#it{c}); M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, confInvMassMotherBinsHel}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel3", " ; p_{T} (GeV/#it{c}); M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, confInvMassMotherBinsHel}); + thetaRegistry.add("Theta/Mother/hInvMassMotherHel4", " ; p_{T} (GeV/#it{c}); M_{#Lambda};", kTH2F, {confInvMassMotherpTBinsHel, confInvMassMotherBinsHel}); /// 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 +441,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 +467,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 +499,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 +540,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 +615,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 +636,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 +796,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 +838,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 +930,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..2880cd75b7b 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -127,8 +127,9 @@ struct FlowSP { // Additional track Selections O2_DEFINE_CONFIGURABLE(cfgTrackSelsUseAdditionalTrackCut, bool, false, "Bool to enable Additional Track Cut"); O2_DEFINE_CONFIGURABLE(cfgTrackSelsDoDCApt, bool, false, "Apply Pt dependent DCAz cut"); - O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt1, float, 0.1, "DcaZ < a * b / pt^1.1 -> this sets a"); - O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt2, float, 0.035, "DcaZ < a * b / pt^1.1 -> this sets b"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt1, float, 0.1, "DcaZ < const + (a * b) / pt^1.1 -> this sets a"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt2, float, 0.035, "DcaZ < const + (a * b) / pt^1.1 -> this sets b"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCAptConsMin, float, 0.1, "DcaZ < const + (a * b) / pt^1.1 -> this sets const"); O2_DEFINE_CONFIGURABLE(cfgTrackSelsPIDNsigma, float, 2.0, "nSigma cut for PID"); O2_DEFINE_CONFIGURABLE(cfgTrackSelDoTrackQAvsCent, bool, true, "Do track selection QA plots as function of centrality"); // harmonics for v coefficients @@ -154,9 +155,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 +233,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 +346,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 +431,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 +439,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 +466,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 +506,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 +525,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 +536,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 +550,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 +593,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}}); @@ -961,12 +1001,12 @@ struct FlowSP { if (track.dcaZ() > cfgTrackSelsDCAz) return false; - if (cfgTrackSelsDoDCApt && std::fabs(track.dcaZ()) > (cfgTrackSelsDCApt1 * cfgTrackSelsDCApt2) / (std::pow(track.pt(), 1.1))) + if (cfgTrackSelsDoDCApt && std::fabs(track.dcaZ()) > (cfgTrackSelsDCAptConsMin + (cfgTrackSelsDCApt1 * cfgTrackSelsDCApt2) / (std::pow(track.pt(), 1.1)))) return false; histos.fill(HIST("hTrackCount"), trackSel_DCAz); - if (track.tpcNClsFound() < cfgTrackSelsNcls) + if (track.tpcNClsCrossedRows() < cfgTrackSelsNcls) return false; histos.fill(HIST("hTrackCount"), trackSel_NCls); @@ -1039,6 +1079,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 +1089,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 +1128,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 +1166,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 +1401,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 +1416,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 +1465,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 +1480,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 +1496,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 +1552,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 +1577,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..eeb2c4965f8 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -89,7 +89,8 @@ std::vector centbinning(90); int nBootstrap = 10; GFWRegions regions; GFWCorrConfigs configs; -GFWCorrConfigs configsradial; +GFWCorrConfigs configsV02; +GFWCorrConfigs configsV0; std::vector multGlobalCorrCutPars; std::vector multPVCorrCutPars; std::vector multGlobalPVCorrCutPars; @@ -203,17 +204,26 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgUseStrictPID, bool, true, "Use strict PID cuts for TPC") O2_DEFINE_CONFIGURABLE(cfgTofPtCut, float, 0.5, "pt cut on TOF for PID"); O2_DEFINE_CONFIGURABLE(cfgUseItsPID, bool, true, "Use ITS PID for particle identification") - O2_DEFINE_CONFIGURABLE(cfgK0SignalMin, float, 0.48, "Minimum cut on K0 mT signal (upper limit of left sideband)"); - O2_DEFINE_CONFIGURABLE(cfgK0SignalMax, float, 0.51, "Minimum cut on K0 mT signal (lower limit of right sideband)"); - O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMin, float, 1.1, "Minimum cut on Lambda mT signal (upper limit of left sideband)"); - O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMax, float, 1.3, "Minimum cut on Lambda mT signal (lower limit of right sideband)"); + O2_DEFINE_CONFIGURABLE(cfgK0SignalMin, float, 0.48, "Minimum cut on K0 mT signal"); + O2_DEFINE_CONFIGURABLE(cfgK0SignalMax, float, 0.51, "Maximum cut on K0 mT signal"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMin, float, 1.1, "Minimum cut on Lambda mT signal"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSignalMax, float, 1.3, "Maximum cut on Lambda mT signal"); + O2_DEFINE_CONFIGURABLE(cfgK0SideBand1Min, float, 0.44, "Minimum cut on K0 side band 1"); + O2_DEFINE_CONFIGURABLE(cfgK0SideBand1Max, float, 0.47, "Maximum cut on K0 side band 1"); + O2_DEFINE_CONFIGURABLE(cfgK0SideBand2Min, float, 0.52, "Minimum cut on K0 side band 2"); + O2_DEFINE_CONFIGURABLE(cfgK0SideBand2Max, float, 0.56, "Maximum cut on K0 side band 2"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand1Min, float, 1.0, "Minimum cut on Lambda side band 1"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand1Max, float, 1.05, "Maximum cut on Lambda side band 1"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand2Min, float, 1.4, "Minimum cut on Lambda side band 2"); + O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand2Max, float, 1.6, "Maximum cut on Lambda side band 2"); } cfgPIDCuts; Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 3.0, {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 10}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}, "Configuration for binning"}; Configurable cfgRegions{"cfgRegions", {{"refN", "refP", "refFull"}, {-0.8, 0.4, -0.8}, {-0.4, 0.8, 0.8}, {0, 0, 0}, {1, 1, 1}}, "Configurations for GFW regions"}; Configurable cfgCorrConfig{"cfgCorrConfig", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}", "refFull {2 -2}", "refFull {2 2 -2 -2}"}, {"ChGap22", "ChGap32", "ChGap42", "ChFull22", "ChFull24"}, {0, 0, 0, 0, 0}, {15, 1, 1, 0, 0}}, "Configurations for each correlation to calculate"}; - Configurable cfgCorrConfigRadial{"cfgCorrConfigRadial", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; + Configurable cfgCorrConfigV02{"cfgCorrConfigV02", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; + Configurable cfgCorrConfigV0{"cfgCorrConfigV0", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {80, -5, 5}, "nsigmaTPC axis"}; ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {80, -5, 5}, "nsigmaTOF axis"}; @@ -365,7 +375,8 @@ struct FlowGenericFramework { GFW* fGFW = new GFW(); std::vector corrconfigs; - std::vector corrconfigsradial; + std::vector corrconfigsV02; + std::vector corrconfigsV0; TRandom3* fRndm = new TRandom3(0); TAxis* fPtAxis; @@ -418,11 +429,16 @@ struct FlowGenericFramework { o2::analysis::gfw::configs.SetpTCorrMasks(cfgCorrConfig->GetpTCorrMasks()); o2::analysis::gfw::regions.Print(); o2::analysis::gfw::configs.Print(); - o2::analysis::gfw::configsradial.SetCorrs(cfgCorrConfigRadial->GetCorrs()); - o2::analysis::gfw::configsradial.SetHeads(cfgCorrConfigRadial->GetHeads()); - o2::analysis::gfw::configsradial.SetpTDifs(cfgCorrConfigRadial->GetpTDifs()); - o2::analysis::gfw::configsradial.SetpTCorrMasks(cfgCorrConfigRadial->GetpTCorrMasks()); - o2::analysis::gfw::configsradial.Print(); + o2::analysis::gfw::configsV02.SetCorrs(cfgCorrConfigV02->GetCorrs()); + o2::analysis::gfw::configsV02.SetHeads(cfgCorrConfigV02->GetHeads()); + o2::analysis::gfw::configsV02.SetpTDifs(cfgCorrConfigV02->GetpTDifs()); + o2::analysis::gfw::configsV02.SetpTCorrMasks(cfgCorrConfigV02->GetpTCorrMasks()); + o2::analysis::gfw::configsV02.Print(); + o2::analysis::gfw::configsV0.SetCorrs(cfgCorrConfigV0->GetCorrs()); + o2::analysis::gfw::configsV0.SetHeads(cfgCorrConfigV0->GetHeads()); + o2::analysis::gfw::configsV0.SetpTDifs(cfgCorrConfigV0->GetpTDifs()); + o2::analysis::gfw::configsV0.SetpTCorrMasks(cfgCorrConfigV0->GetpTCorrMasks()); + o2::analysis::gfw::configsV0.Print(); o2::analysis::gfw::ptbinning = cfgGFWBinning->GetPtBinning(); o2::analysis::gfw::ptpoilow = cfgGFWBinning->GetPtPOImin(); o2::analysis::gfw::ptpoiup = cfgGFWBinning->GetPtPOImax(); @@ -572,6 +588,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 +619,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"); @@ -629,16 +647,22 @@ struct FlowGenericFramework { LOGF(error, "Configuration contains vectors of different size - check the GFWCorrConfig configurable"); // Radial flow configs - for (auto i = 0; i < o2::analysis::gfw::configsradial.GetSize(); ++i) { - corrconfigsradial.push_back(fGFW->GetCorrelatorConfig(o2::analysis::gfw::configsradial.GetCorrs()[i], o2::analysis::gfw::configsradial.GetHeads()[i], o2::analysis::gfw::configsradial.GetpTDifs()[i])); + for (auto i = 0; i < o2::analysis::gfw::configsV02.GetSize(); ++i) { + corrconfigsV02.push_back(fGFW->GetCorrelatorConfig(o2::analysis::gfw::configsV02.GetCorrs()[i], o2::analysis::gfw::configsV02.GetHeads()[i], o2::analysis::gfw::configsV02.GetpTDifs()[i])); } - if (corrconfigsradial.empty()) - LOGF(error, "Radial configuration contains vectors of different size - check the GFWCorrConfig configurable"); + if (corrconfigsV02.empty()) + LOGF(error, "Radial (V02) configuration contains vectors of different size - check the GFWCorrConfig configurable"); + for (auto i = 0; i < o2::analysis::gfw::configsV0.GetSize(); ++i) { + corrconfigsV0.push_back(fGFW->GetCorrelatorConfig(o2::analysis::gfw::configsV0.GetCorrs()[i], o2::analysis::gfw::configsV0.GetHeads()[i], o2::analysis::gfw::configsV0.GetpTDifs()[i])); + } + if (corrconfigsV0.empty()) + LOGF(error, "Radial (V0) configuration contains vectors of different size - check the GFWCorrConfig configurable"); fGFW->CreateRegions(); TObjArray* oba = new TObjArray(); addConfigObjectsToObjArray(oba, corrconfigs); - addConfigObjectsToObjArray(oba, corrconfigsradial); + addConfigObjectsToObjArray(oba, corrconfigsV02); + addConfigObjectsToObjArray(oba, corrconfigsV0); if (doprocessData || doprocessRun2 || doprocessMCReco) { fFC->SetName("FlowContainer"); @@ -855,7 +879,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 +1227,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 +1244,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 +1258,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 +1269,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 +1282,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,14 +1291,31 @@ 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 (corrconfigsV02.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(); + auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; - auto val = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kFALSE).real() / dnx; + auto val = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kFALSE).real() / dnx; if (std::abs(val) < 1) - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm); + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, val * fractions[l_ind][i - 1], dnx, rndm); + } + } + + if (corrconfigsV0.size() < 4) + return; + + if (fFCpts[0]->corrDen[0] == 0.) + return; + + for (uint l_ind = 0; l_ind < 4; ++l_ind) { + double mpt = fFCpts[0]->corrNum[1] / fFCpts[0]->corrDen[1]; + for (int i = 1; i <= fPtAxis->GetNbins(); i++) { + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, mpt * fractions[l_ind][i - 1], 1., rndm); } } return; @@ -1349,51 +1390,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); - else if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMax) - npt_resonances[2][ptBinIndex] += getEfficiency(v0); - else - npt_resonances[1][ptBinIndex] += getEfficiency(v0); - registry.fill(HIST("K0/hK0s"), 1); + if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand1Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand1Max) + npt_resonances[0][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMin && v0.mK0Short() < cfgPIDCuts.cfgK0SignalMax) + npt_resonances[1][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand2Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand2Max) + npt_resonances[2][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); - else if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMax) - npt_resonances[5][ptBinIndex] += getEfficiency(v0); - else - npt_resonances[4][ptBinIndex] += getEfficiency(v0); - registry.fill(HIST("Lambda/hLambdas"), 1); + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand1Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand1Max) + npt_resonances[3][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMin && v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMax) + npt_resonances[4][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand2Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand2Max) + npt_resonances[5][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,16 +1448,25 @@ 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 (uint l_ind = 4; l_ind < corrconfigsV02.size(); ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { - auto dnx = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kTRUE).real(); + auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; - auto val = fGFW->Calculate(corrconfigsradial.at(l_ind), i - 1, kFALSE).real() / dnx; + auto val = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kFALSE).real() / dnx; if (std::abs(val) < 1) - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsradial.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom); + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * fractions_resonances[l_ind - 4][i - 1], dnx, lRandom); + } + } + + for (uint l_ind = 4; l_ind < corrconfigsV0.size(); ++l_ind) { + double mpt = fFCpts[0]->corrNum[1] / fFCpts[0]->corrDen[1]; + for (int i = 1; i <= fPtAxis->GetNbins(); i++) { + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * fractions_resonances[l_ind - 4][i - 1], 1.0, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * fractions_resonances[l_ind - 4][i - 1], 1.0, lRandom); } } + int multiplicity = 0; switch (cfgUseNchCorrection) { case 0: @@ -1458,8 +1507,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; } @@ -1477,18 +1528,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 +1611,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 +1625,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 +1692,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 +1742,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 +1829,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 +1847,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 +1891,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..b921074a4f8 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; @@ -1015,13 +1016,13 @@ struct FlowGfwV02 { // Fill cumulants for different particles // ***Need to add proper weights for each particle!*** if (withinPtRef) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 0); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, 1); if (withinPtPOI && pidInd == PidPions) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidPions); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidPions + 1); if (withinPtPOI && pidInd == PidKaons) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidKaons); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidKaons + 1); if (withinPtPOI && pidInd == PidProtons) - fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidProtons); + fGFW->Fill(track.eta(), fSecondAxis->FindBin(track.pt()) - 1, track.phi(), weff * wacc, PidProtons + 1); 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/DataModel/LongRangeDerived.h b/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h index f9b79242ac0..8dd31e82aa1 100644 --- a/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h +++ b/PWGCF/TwoParticleCorrelations/DataModel/LongRangeDerived.h @@ -34,16 +34,16 @@ DECLARE_SOA_COLUMN(TotalFV0AmplitudeA, totalFV0AmplitudeA, float); //! sum of am DECLARE_SOA_COLUMN(GapSide, gapSide, uint8_t); // 0 for side A, 1 for side C, 2 for both sides } // namespace lrcorrcolltable -DECLARE_SOA_TABLE(CollLRTables, "AOD", "COLLLRTABLE", +DECLARE_SOA_TABLE(LRCollisions, "AOD", "LRCOLLISION", o2::soa::Index<>, bc::RunNumber, lrcorrcolltable::Zvtx, lrcorrcolltable::Multiplicity, lrcorrcolltable::Centrality, timestamp::Timestamp); -using CollLRTable = CollLRTables::iterator; +using LRCollision = LRCollisions::iterator; -DECLARE_SOA_TABLE(UpcCollLRTables, "AOD", "UPCCOLLLRTABLE", +DECLARE_SOA_TABLE(UpcLRCollisions, "AOD", "UPCLRCOLLISION", o2::soa::Index<>, bc::GlobalBC, bc::RunNumber, @@ -52,30 +52,30 @@ DECLARE_SOA_TABLE(UpcCollLRTables, "AOD", "UPCCOLLLRTABLE", lrcorrcolltable::TotalFT0AmplitudeA, lrcorrcolltable::TotalFT0AmplitudeC, lrcorrcolltable::TotalFV0AmplitudeA); -using UpcCollLRTable = UpcCollLRTables::iterator; +using UpcLRCollision = UpcLRCollisions::iterator; -DECLARE_SOA_TABLE(UpcSgCollLRTables, "AOD", "UPCSGCOLLLRTABLE", +DECLARE_SOA_TABLE(UpcSgLRCollisions, "AOD", "UPCSGLRCOLLISION", lrcorrcolltable::GapSide); -using UpcSgCollLRTable = UpcSgCollLRTables::iterator; +using UpcSgLRCollision = UpcSgLRCollisions::iterator; namespace lrcorrzdctable { -DECLARE_SOA_INDEX_COLUMN(UpcCollLRTable, upcCollLRTable); +DECLARE_SOA_INDEX_COLUMN(UpcLRCollision, upcLRCollision); DECLARE_SOA_COLUMN(EnergyCommonZNA, energyCommonZNA, float); DECLARE_SOA_COLUMN(EnergyCommonZNC, energyCommonZNC, float); } // namespace lrcorrzdctable -DECLARE_SOA_TABLE(ZdcLRTables, "AOD", "ZDCLRTABLE", +DECLARE_SOA_TABLE(LRZdcs, "AOD", "LRZDC", o2::soa::Index<>, - lrcorrzdctable::UpcCollLRTableId, + lrcorrzdctable::UpcLRCollisionId, lrcorrzdctable::EnergyCommonZNA, lrcorrzdctable::EnergyCommonZNC); -using ZdcLRTable = ZdcLRTables::iterator; +using LRZdc = LRZdcs::iterator; namespace lrcorrtrktable { -DECLARE_SOA_INDEX_COLUMN(CollLRTable, collLRTable); -DECLARE_SOA_INDEX_COLUMN(UpcCollLRTable, upcCollLRTable); +DECLARE_SOA_INDEX_COLUMN(LRCollision, lrCollision); +DECLARE_SOA_INDEX_COLUMN(UpcLRCollision, upcLRCollision); DECLARE_SOA_COLUMN(Pt, pt, float); DECLARE_SOA_COLUMN(Eta, eta, float); DECLARE_SOA_COLUMN(Phi, phi, float); @@ -99,36 +99,36 @@ enum V0TrackPid { }; } // namespace lrcorrtrktable -DECLARE_SOA_TABLE(TrkLRTables, "AOD", "TRKLRTABLE", +DECLARE_SOA_TABLE(LRMidTracks, "AOD", "LRMIDTRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi, lrcorrtrktable::TrackType); -using TrkLRTable = TrkLRTables::iterator; +using LRMidTrack = LRMidTracks::iterator; -DECLARE_SOA_TABLE(Ft0aLRTables, "AOD", "FT0ALRTABLE", +DECLARE_SOA_TABLE(LRFt0aTracks, "AOD", "LRFT0ATRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using Ft0aLRTable = Ft0aLRTables::iterator; +using LRFt0aTrack = LRFt0aTracks::iterator; -DECLARE_SOA_TABLE(Ft0cLRTables, "AOD", "FT0CLRTABLE", +DECLARE_SOA_TABLE(LRFt0cTracks, "AOD", "LRFT0CTRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using Ft0cLRTable = Ft0cLRTables::iterator; +using LRFt0cTrack = LRFt0cTracks::iterator; -DECLARE_SOA_TABLE(V0TrkLRTables, "AOD", "V0TRKLRTABLE", +DECLARE_SOA_TABLE(LRV0Tracks, "AOD", "LRV0TRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::IdPos, lrcorrtrktable::IdNeg, lrcorrtrktable::Pt, @@ -136,54 +136,54 @@ DECLARE_SOA_TABLE(V0TrkLRTables, "AOD", "V0TRKLRTABLE", lrcorrtrktable::Phi, lrcorrtrktable::InvMass, lrcorrtrktable::V0Type); -using V0TrkLRTable = V0TrkLRTables::iterator; +using LRV0Track = LRV0Tracks::iterator; -DECLARE_SOA_TABLE(MftTrkLRTables, "AOD", "MFTTRKLRTABLE", +DECLARE_SOA_TABLE(LRMftTracks, "AOD", "LRMFTTRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using MftTrkLRTable = MftTrkLRTables::iterator; +using LRMftTrack = LRMftTracks::iterator; -DECLARE_SOA_TABLE(MftBestTrkLRTables, "AOD", "MFTBESTTRKLRTABLE", +DECLARE_SOA_TABLE(LRMftBestTracks, "AOD", "LRMFTBESTTRACK", o2::soa::Index<>, - lrcorrtrktable::CollLRTableId, + lrcorrtrktable::LRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using MftBestTrkLRTable = MftBestTrkLRTables::iterator; +using LRMftBestTrack = LRMftBestTracks::iterator; -DECLARE_SOA_TABLE(TrkLRUpcTables, "AOD", "TRKLRUPCTABLE", +DECLARE_SOA_TABLE(UpcLRMidTracks, "AOD", "UPCLRMIDTRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi, lrcorrtrktable::TrackType); -using TrkLRUpcTable = TrkLRUpcTables::iterator; +using UpcLRMidTrack = UpcLRMidTracks::iterator; -DECLARE_SOA_TABLE(Ft0aLRUpcTables, "AOD", "FT0ALRUpcTABLE", +DECLARE_SOA_TABLE(UpcLRFt0aTracks, "AOD", "UPCLRFT0ATRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using Ft0aLRUpcTable = Ft0aLRUpcTables::iterator; +using UpcLRFt0aTrack = UpcLRFt0aTracks::iterator; -DECLARE_SOA_TABLE(Ft0cLRUpcTables, "AOD", "FT0CLRUpcTABLE", +DECLARE_SOA_TABLE(UpcLRFt0cTracks, "AOD", "UPCLRFT0CTRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::ChannelID, lrcorrtrktable::Amplitude, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using Ft0cLRUpcTable = Ft0cLRUpcTables::iterator; +using UpcLRFt0cTrack = UpcLRFt0cTracks::iterator; -DECLARE_SOA_TABLE(V0TrkLRUpcTables, "AOD", "V0TRKLRUPCTABLE", +DECLARE_SOA_TABLE(UpcLRV0Tracks, "AOD", "UPCLRV0TRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::IdPos, lrcorrtrktable::IdNeg, lrcorrtrktable::Pt, @@ -191,23 +191,23 @@ DECLARE_SOA_TABLE(V0TrkLRUpcTables, "AOD", "V0TRKLRUPCTABLE", lrcorrtrktable::Phi, lrcorrtrktable::InvMass, lrcorrtrktable::V0Type); -using V0TrkLRUpcTable = V0TrkLRUpcTables::iterator; +using UpcLRV0Track = UpcLRV0Tracks::iterator; -DECLARE_SOA_TABLE(MftTrkLRUpcTables, "AOD", "MFTTRKLRUPCTABLE", +DECLARE_SOA_TABLE(UpcLRMftTracks, "AOD", "UPCLRMFTTRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using MftTrkLRUpcTable = MftTrkLRUpcTables::iterator; +using UpcLRMftTrack = UpcLRMftTracks::iterator; -DECLARE_SOA_TABLE(MftBestTrkLRUpcTables, "AOD", "MFTBESTTRKLRUPCTABLE", +DECLARE_SOA_TABLE(UpcLRMftBestTracks, "AOD", "UPCLRMFTBESTTRACK", o2::soa::Index<>, - lrcorrtrktable::UpcCollLRTableId, + lrcorrtrktable::UpcLRCollisionId, lrcorrtrktable::Pt, lrcorrtrktable::Eta, lrcorrtrktable::Phi); -using MftBestTrkLRUpcTable = MftBestTrkLRUpcTables::iterator; +using UpcLRMftBestTrack = UpcLRMftBestTracks::iterator; } // namespace o2::aod diff --git a/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx b/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx index a7d90746265..816eb4da038 100644 --- a/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx +++ b/PWGCF/TwoParticleCorrelations/TableProducer/longrangeMaker.cxx @@ -233,24 +233,24 @@ struct LongrangeMaker { cfgSgCuts = (SGCutParHolder)sgCuts; } - Produces collisionLRTable; - Produces tracksLRTable; - Produces ft0aLRTable; - Produces ft0cLRTable; - Produces mftLRTable; - Produces mftbestLRTable; - Produces v0LRTable; - - Produces outupccol; - Produces outsgupccol; - Produces outzdctable; - - Produces tracksLRUpcTable; - Produces ft0aLRUpcTable; - Produces ft0cLRUpcTable; - Produces mftLRUpcTable; - Produces mftbestLRUpcTable; - Produces v0LRUpcTable; + Produces lrcollision; + Produces lrmidtracks; + Produces lrft0atracks; + Produces lrft0ctracks; + Produces lrmfttracks; + Produces lrmftbesttracks; + Produces lrv0tracks; + + Produces upclrcollision; + Produces upcsglrcollision; + Produces lrzdcs; + + Produces upclrmidtracks; + Produces upclrft0atracks; + Produces upclrft0ctracks; + Produces upclrmfttracks; + Produces upclrmftbesttracks; + Produces upclrv0tracks; Filter fTracksEta = nabs(aod::track::eta) < cfgtrksel.cfgEtaCut; Filter fTracksPt = (aod::track::pt > cfgtrksel.cfgPtCutMin) && (aod::track::pt < cfgtrksel.cfgPtCutMax); @@ -273,7 +273,7 @@ struct LongrangeMaker { auto centrality = selColCent(col); auto bc = col.bc_as(); - collisionLRTable(bc.runNumber(), col.posZ(), multiplicity, centrality, bc.timestamp()); + lrcollision(bc.runNumber(), col.posZ(), multiplicity, centrality, bc.timestamp()); // track loop for (const auto& track : tracks) { @@ -281,13 +281,13 @@ struct LongrangeMaker { continue; if (!myTrackFilter.IsSelected(track)) continue; - tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); + lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); if (getTrackPID(track) == PionTrackN) - tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); + lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); if (getTrackPID(track) == KaonTrackN) - tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); + lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); if (getTrackPID(track) == ProtonTrackN) - tracksLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); + lrmidtracks(lrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); } // ft0 loop @@ -298,14 +298,14 @@ struct LongrangeMaker { float ampl = ft0.amplitudeA()[iCh]; auto phi = getPhiFT0(chanelid, 0); auto eta = getEtaFT0(chanelid, 0); - ft0aLRTable(collisionLRTable.lastIndex(), chanelid, ampl, eta, phi); + lrft0atracks(lrcollision.lastIndex(), chanelid, ampl, eta, phi); } for (std::size_t iCh = 0; iCh < ft0.channelC().size(); iCh++) { auto chanelid = ft0.channelC()[iCh]; float ampl = ft0.amplitudeC()[iCh]; auto phi = getPhiFT0(chanelid, 1); auto eta = getEtaFT0(chanelid, 1); - ft0cLRTable(collisionLRTable.lastIndex(), chanelid, ampl, eta, phi); + lrft0ctracks(lrcollision.lastIndex(), chanelid, ampl, eta, phi); } } @@ -315,7 +315,7 @@ struct LongrangeMaker { continue; auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - mftLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), phi); + lrmfttracks(lrcollision.lastIndex(), track.pt(), track.eta(), phi); } if (retracks.size() > 0) { @@ -329,7 +329,7 @@ struct LongrangeMaker { } auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - mftbestLRTable(collisionLRTable.lastIndex(), track.pt(), track.eta(), phi); + lrmftbesttracks(lrcollision.lastIndex(), track.pt(), track.eta(), phi); } } @@ -344,8 +344,8 @@ struct LongrangeMaker { // K0short if (isSelectK0s(col, v0)) { // candidate is K0s - v0LRTable(collisionLRTable.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); + lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); } // Lambda and Anti-Lambda @@ -355,13 +355,13 @@ struct LongrangeMaker { // Note: candidate compatible with Lambda and Anti-Lambda hypothesis are counted twice (once for each hypothesis) if (lambdaTag) { // candidate is Lambda massV0 = v0.mLambda(); - v0LRTable(collisionLRTable.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); + lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); } if (antilambdaTag) { // candidate is Anti-lambda massV0 = v0.mAntiLambda(); - v0LRTable(collisionLRTable.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); + lrv0tracks(lrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); } // end of Lambda and Anti-Lambda processing } } // process function @@ -398,13 +398,13 @@ struct LongrangeMaker { upchelpers::FITInfo fitInfo{}; udhelpers::getFITinfo(fitInfo, newbc, bcs, ft0s, fv0as, fdds); auto multiplicity = countNTracks(tracks); - outupccol(bc.globalBC(), bc.runNumber(), col.posZ(), multiplicity, fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFV0A); - outsgupccol(issgevent); + upclrcollision(bc.globalBC(), bc.runNumber(), col.posZ(), multiplicity, fitInfo.ampFT0A, fitInfo.ampFT0C, fitInfo.timeFV0A); + upcsglrcollision(issgevent); if (newbc.has_zdc()) { auto zdc = newbc.zdc(); - outzdctable(outupccol.lastIndex(), zdc.energyCommonZNA(), zdc.energyCommonZNC()); + lrzdcs(upclrcollision.lastIndex(), zdc.energyCommonZNA(), zdc.energyCommonZNC()); } else { - outzdctable(outupccol.lastIndex(), -999, -999); + lrzdcs(upclrcollision.lastIndex(), -999, -999); } // track loop @@ -413,13 +413,13 @@ struct LongrangeMaker { continue; if (!myTrackFilter.IsSelected(track)) continue; - tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); + upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpCharge); if (getTrackPID(track) == PionTrackN) - tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); + upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpPion); if (getTrackPID(track) == KaonTrackN) - tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); + upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpKaon); if (getTrackPID(track) == ProtonTrackN) - tracksLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); + upclrmidtracks(upclrcollision.lastIndex(), track.pt(), track.eta(), track.phi(), aod::lrcorrtrktable::kSpProton); } // ft0 loop @@ -430,14 +430,14 @@ struct LongrangeMaker { float ampl = ft0.amplitudeA()[iCh]; auto phi = getPhiFT0(chanelid, 0); auto eta = getEtaFT0(chanelid, 0); - ft0aLRUpcTable(outupccol.lastIndex(), chanelid, ampl, eta, phi); + upclrft0atracks(upclrcollision.lastIndex(), chanelid, ampl, eta, phi); } for (std::size_t iCh = 0; iCh < ft0.channelC().size(); iCh++) { auto chanelid = ft0.channelC()[iCh]; float ampl = ft0.amplitudeC()[iCh]; auto phi = getPhiFT0(chanelid, 1); auto eta = getEtaFT0(chanelid, 1); - ft0cLRUpcTable(outupccol.lastIndex(), chanelid, ampl, eta, phi); + upclrft0ctracks(upclrcollision.lastIndex(), chanelid, ampl, eta, phi); } } @@ -447,7 +447,7 @@ struct LongrangeMaker { continue; auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - mftLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), phi); + upclrmfttracks(upclrcollision.lastIndex(), track.pt(), track.eta(), phi); } if (retracks.size() > 0) { @@ -461,7 +461,7 @@ struct LongrangeMaker { } auto phi = track.phi(); o2::math_utils::bringTo02Pi(phi); - mftbestLRUpcTable(outupccol.lastIndex(), track.pt(), track.eta(), phi); + upclrmftbesttracks(upclrcollision.lastIndex(), track.pt(), track.eta(), phi); } } @@ -476,8 +476,8 @@ struct LongrangeMaker { // K0short if (isSelectK0s(col, v0)) { // candidate is K0s - v0LRUpcTable(outupccol.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); + upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), v0.mK0Short(), aod::lrcorrtrktable::kSpK0short); } // Lambda and Anti-Lambda @@ -487,13 +487,13 @@ struct LongrangeMaker { // Note: candidate compatible with Lambda and Anti-Lambda hypothesis are counted twice (once for each hypothesis) if (lambdaTag) { // candidate is Lambda massV0 = v0.mLambda(); - v0LRUpcTable(outupccol.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); + upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpLambda); } if (antilambdaTag) { // candidate is Anti-lambda massV0 = v0.mAntiLambda(); - v0LRUpcTable(outupccol.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), - v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); + upclrv0tracks(upclrcollision.lastIndex(), posTrack.globalIndex(), negTrack.globalIndex(), + v0.pt(), v0.eta(), v0.phi(), massV0, aod::lrcorrtrktable::kSpALambda); } // end of Lambda and Anti-Lambda processing } } // SG events diff --git a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt index 7584e824e6a..49b1a9573a4 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt +++ b/PWGCF/TwoParticleCorrelations/Tasks/CMakeLists.txt @@ -96,4 +96,11 @@ o2physics_add_dpl_workflow(eta-dihadron o2physics_add_dpl_workflow(nuclei-balance SOURCES nucleibalance.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::PWGCFCore - COMPONENT_NAME Analysis) \ No newline at end of file + COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(lambdacascadecorrelation + SOURCES Lambdacascadecorrelation.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB + COMPONENT_NAME Analysis) + + diff --git a/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx b/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx new file mode 100644 index 00000000000..dfcb3182d43 --- /dev/null +++ b/PWGCF/TwoParticleCorrelations/Tasks/Lambdacascadecorrelation.cxx @@ -0,0 +1,3704 @@ +// 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 Lambdacascadecorrelation.cxx +/// \brief Correlation-balance functions of multistrange baryons +/// \author Oveis Sheibani + +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/Utils/inelGt.h" + +#include "Common/Core/RecoDecay.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/CollisionAssociationTables.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "CCDB/BasicCCDBManager.h" +#include "CommonConstants/PhysicsConstants.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/Track.h" + +#include "TDatabasePDG.h" +#include "TPDGCode.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::constants::physics; +using namespace o2::constants::math; +using namespace o2::soa; + +// use parameters + cov mat non-propagated, aux info + (extension propagated) +using FullTracksExt = soa::Join; +using FullTracksExtIU = soa::Join; +using FullTracksExtWithPID = soa::Join; +using FullTracksExtIUWithPID = soa::Join; + +namespace o2::aod +{ +namespace cascadeflags +{ +DECLARE_SOA_COLUMN(IsSelected, isSelected, int); //~! +} // namespace cascadeflags +DECLARE_SOA_TABLE(CascadeFlags, "AOD", "CASCADEFLAGS", //! + cascadeflags::IsSelected); +using CascDataExtSelected = soa::Join; +} // namespace o2::aod + +using MyCollisions = soa::Join; +using MyCollisionsMult = soa::Join; +using MyCascades = soa::Filtered; +using LabeledCascades = soa::Join; + +namespace o2::aod +{ +namespace lambdacollision +{ +DECLARE_SOA_COLUMN(Cent, cent, float); +DECLARE_SOA_COLUMN(Mult, mult, float); +DECLARE_SOA_COLUMN(RefCollId, refCollId, int64_t); // <--- 1. Add this line +} // namespace lambdacollision +DECLARE_SOA_TABLE(LambdaCollisions, "AOD", "LAMBDACOLS", o2::soa::Index<>, + lambdacollision::Cent, + lambdacollision::Mult, + lambdacollision::RefCollId, // <--- 2. Add this line + aod::collision::PosX, + aod::collision::PosY, + aod::collision::PosZ); +using LambdaCollision = LambdaCollisions::iterator; + +namespace lambdamcgencollision +{ +DECLARE_SOA_COLUMN(RefMcCollId, refMcCollId, int64_t); // original McCollision global index +} +DECLARE_SOA_TABLE(LambdaMcGenCollisions, "AOD", "LMCGENCOLS", o2::soa::Index<>, + lambdacollision::Cent, + lambdacollision::Mult, + lambdamcgencollision::RefMcCollId, + o2::aod::mccollision::PosX, + o2::aod::mccollision::PosY, + o2::aod::mccollision::PosZ); +using LambdaMcGenCollision = LambdaMcGenCollisions::iterator; + +namespace lambdatrack +{ +DECLARE_SOA_INDEX_COLUMN(LambdaCollision, lambdaCollision); +DECLARE_SOA_COLUMN(Px, px, float); +DECLARE_SOA_COLUMN(Py, py, float); +DECLARE_SOA_COLUMN(Pz, pz, float); +DECLARE_SOA_COLUMN(Pt, pt, float); +DECLARE_SOA_COLUMN(Eta, eta, float); +DECLARE_SOA_COLUMN(Phi, phi, float); +DECLARE_SOA_COLUMN(Rap, rap, float); +DECLARE_SOA_COLUMN(Mass, mass, float); +DECLARE_SOA_COLUMN(PosTrackId, posTrackId, int64_t); +DECLARE_SOA_COLUMN(NegTrackId, negTrackId, int64_t); +DECLARE_SOA_COLUMN(CosPA, cosPA, float); +DECLARE_SOA_COLUMN(DcaDau, dcaDau, float); +DECLARE_SOA_COLUMN(V0Type, v0Type, int8_t); +DECLARE_SOA_COLUMN(V0PrmScd, v0PrmScd, int8_t); +DECLARE_SOA_COLUMN(CorrFact, corrFact, float); +} // namespace lambdatrack +DECLARE_SOA_TABLE(LambdaTracks, "AOD", "LAMBDATRACKS", o2::soa::Index<>, + lambdatrack::LambdaCollisionId, + lambdatrack::Px, + lambdatrack::Py, + lambdatrack::Pz, + lambdatrack::Pt, + lambdatrack::Eta, + lambdatrack::Phi, + lambdatrack::Rap, + lambdatrack::Mass, + lambdatrack::PosTrackId, + lambdatrack::NegTrackId, + lambdatrack::CosPA, + lambdatrack::DcaDau, + lambdatrack::V0Type, + lambdatrack::V0PrmScd, + lambdatrack::CorrFact); +using LambdaTrack = LambdaTracks::iterator; + +namespace lambdatrackext +{ +DECLARE_SOA_COLUMN(LambdaSharingDaughter, lambdaSharingDaughter, bool); +DECLARE_SOA_COLUMN(LambdaSharingDauIds, lambdaSharingDauIds, std::vector); +DECLARE_SOA_COLUMN(TrueLambdaFlag, trueLambdaFlag, bool); +} // namespace lambdatrackext +DECLARE_SOA_TABLE(LambdaTracksExt, "AOD", "LAMBDATRACKSEXT", + lambdatrackext::LambdaSharingDaughter, + lambdatrackext::LambdaSharingDauIds, + lambdatrackext::TrueLambdaFlag); + +using LambdaTrackExt = LambdaTracksExt::iterator; + +namespace lambdamcgentrack +{ +DECLARE_SOA_INDEX_COLUMN(LambdaMcGenCollision, lambdaMcGenCollision); +} +DECLARE_SOA_TABLE(LambdaMcGenTracks, "AOD", "LMCGENTRACKS", o2::soa::Index<>, + lambdamcgentrack::LambdaMcGenCollisionId, + o2::aod::mcparticle::Px, + o2::aod::mcparticle::Py, + o2::aod::mcparticle::Pz, + lambdatrack::Pt, + lambdatrack::Eta, + lambdatrack::Phi, + lambdatrack::Rap, + lambdatrack::Mass, + lambdatrack::PosTrackId, + lambdatrack::NegTrackId, + lambdatrack::V0Type, + lambdatrack::CosPA, + lambdatrack::DcaDau, + lambdatrack::V0PrmScd, + lambdatrack::CorrFact); +using LambdaMcGenTrack = LambdaMcGenTracks::iterator; + +} // namespace o2::aod + +enum CollisionLabels { + kTotColBeforeHasMcCollision = 1, + kTotCol, + kPassSelCol +}; + +enum TrackLabels { + kTracksBeforeHasMcParticle = 1, + kAllV0Tracks, + kV0KShortMassRej, + kNotLambdaNotAntiLambda, + kV0IsBothLambdaAntiLambda, + kNotLambdaAfterSel, + kV0IsLambdaOrAntiLambda, + kPassV0DauTrackSel, + kPassV0KinCuts, + kPassV0TopoSel, + kAllSelPassed, + kPrimaryLambda, + kSecondaryLambda, + kLambdaDauNotMcParticle, + kLambdaNotPrPiMinus, + kAntiLambdaNotAntiPrPiPlus, + kPassTrueLambdaSel, + kEffCorrPtCent, + kEffCorrPtRapCent, + kNoEffCorr, + kPFCorrPtCent, + kPFCorrPtRapCent, + kNoPFCorr, + kGenTotAccLambda, + kGenLambdaNoDau, + kGenLambdaToPrPi +}; + +enum CentEstType { + kCentFT0M = 0, + kCentFV0A +}; + +enum RunType { + kRun3 = 0, + kRun2 +}; + +enum ParticleType { + kLambda = 0, + kAntiLambda +}; + +enum ParticlePairType { + kLambdaAntiLambda = 0, + kLambdaLambda, + kAntiLambdaAntiLambda +}; + +enum ShareDauLambda { + kUniqueLambda = 0, + kLambdaShareDau +}; + +enum RecGenType { + kRec = 0, + kGen +}; + +enum DMCType { + kData = 0, + kMC +}; + +enum CorrHistDim { + OneDimCorr = 1, + TwoDimCorr, + ThreeDimCorr +}; + +enum PrmScdType { + kPrimary = 0, + kSecondary +}; + +enum PrmScdPairType { + kPP = 0, + kPS, + kSP, + kSS +}; + +struct LambdaTableProducer { + + Produces lambdaCollisionTable; + Produces lambdaTrackTable; + Produces lambdaMCGenCollisionTable; + Produces lambdaMCGenTrackTable; + + // Collisions + Configurable cCentEstimator{"cCentEstimator", 0, "Centrality Estimator : 0-FT0M, 1-FV0A"}; + Configurable cMinZVtx{"cMinZVtx", -10.0, "Min VtxZ cut"}; + Configurable cMaxZVtx{"cMaxZVtx", 10.0, "Max VtxZ cut"}; + Configurable cMinMult{"cMinMult", 0., "Minumum Multiplicity"}; + Configurable cMaxMult{"cMaxMult", 100.0, "Maximum Multiplicity"}; + Configurable cSel8Trig{"cSel8Trig", true, "Sel8 (T0A + T0C) Selection Run3"}; + Configurable cInt7Trig{"cInt7Trig", false, "kINT7 MB Trigger"}; + Configurable cSel7Trig{"cSel7Trig", false, "Sel7 (V0A + V0C) Selection Run2"}; + Configurable cTriggerTvxSel{"cTriggerTvxSel", false, "Trigger Time and Vertex Selection"}; + Configurable cTFBorder{"cTFBorder", false, "Timeframe Border Selection"}; + Configurable cNoItsROBorder{"cNoItsROBorder", false, "No ITSRO Border Cut"}; + Configurable cItsTpcVtx{"cItsTpcVtx", false, "ITS+TPC Vertex Selection"}; + Configurable cPileupReject{"cPileupReject", false, "Pileup rejection"}; + Configurable cZVtxTimeDiff{"cZVtxTimeDiff", false, "z-vtx time diff selection"}; + Configurable cIsGoodITSLayers{"cIsGoodITSLayers", false, "Good ITS Layers All"}; + + // Tracks + Configurable cTrackMinPt{"cTrackMinPt", 0.15, "p_{T} minimum"}; + Configurable cTrackMaxPt{"cTrackMaxPt", 999.0, "p_{T} maximum"}; + Configurable cTrackEtaCut{"cTrackEtaCut", 0.8, "Pseudorapidity cut"}; + Configurable cMinTpcCrossedRows{"cMinTpcCrossedRows", 70, "TPC Min Crossed Rows"}; + Configurable cMinTpcCROverCls{"cMinTpcCROverCls", 0.8, "Tpc Min Crossed Rows Over Findable Clusters"}; + Configurable cMaxTpcSharedClusters{"cMaxTpcSharedClusters", 0.4, "Tpc Max Shared Clusters"}; + Configurable cMaxChi2Tpc{"cMaxChi2Tpc", 4, "Max Chi2 Tpc"}; + Configurable cTpcNsigmaCut{"cTpcNsigmaCut", 3.0, "TPC NSigma Selection Cut"}; + Configurable cRemoveAmbiguousTracks{"cRemoveAmbiguousTracks", false, "Remove Ambiguous Tracks"}; + + // V0s + Configurable cMinDcaProtonToPV{"cMinDcaProtonToPV", 0.02, "Minimum Proton DCAr to PV"}; + Configurable cMinDcaPionToPV{"cMinDcaPionToPV", 0.06, "Minimum Pion DCAr to PV"}; + Configurable cMinV0DcaDaughters{"cMinV0DcaDaughters", 0., "Minimum DCA between V0 daughters"}; + Configurable cMaxV0DcaDaughters{"cMaxV0DcaDaughters", 1., "Maximum DCA between V0 daughters"}; + Configurable cMinDcaV0ToPV{"cMinDcaV0ToPV", 0.0, "Minimum DCA V0 to PV"}; + Configurable cMaxDcaV0ToPV{"cMaxDcaV0ToPV", 999.0, "Maximum DCA V0 to PV"}; + Configurable cMinV0TransRadius{"cMinV0TransRadius", 0.5, "Minimum V0 radius from PV"}; + Configurable cMaxV0TransRadius{"cMaxV0TransRadius", 999.0, "Maximum V0 radius from PV"}; + Configurable cMinV0CTau{"cMinV0CTau", 0.0, "Minimum ctau"}; + Configurable cMaxV0CTau{"cMaxV0CTau", 30.0, "Maximum ctau"}; + Configurable cMinV0CosPA{"cMinV0CosPA", 0.995, "Minimum V0 CosPA to PV"}; + Configurable cKshortRejMassWindow{"cKshortRejMassWindow", 0.01, "Reject K0Short Candidates"}; + Configurable cKshortRejFlag{"cKshortRejFlag", true, "K0short Mass Rej Flag"}; + + // V0s kinmatic acceptance + Configurable cMinV0Mass{"cMinV0Mass", 1.10, "V0 Mass Min"}; + Configurable cMaxV0Mass{"cMaxV0Mass", 1.12, "V0 Mass Min"}; + Configurable cMinV0Pt{"cMinV0Pt", 0.8, "Minimum V0 pT"}; + Configurable cMaxV0Pt{"cMaxV0Pt", 4.2, "Minimum V0 pT"}; + Configurable cMaxV0Rap{"cMaxV0Rap", 0.5, "|rap| cut"}; + Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Do Eta Analysis"}; + Configurable cV0TypeSelFlag{"cV0TypeSelFlag", false, "V0 Type Selection Flag"}; + Configurable cV0TypeSelection{"cV0TypeSelection", 1, "V0 Type Selection"}; + + // V0s MC + Configurable cHasMcFlag{"cHasMcFlag", true, "Has Mc Tag"}; + Configurable cSelectTrueLambda{"cSelectTrueLambda", true, "Select True Lambda"}; + Configurable cSelMCPSV0{"cSelMCPSV0", true, "Select Primary/Secondary V0"}; + Configurable cCheckRecoDauFlag{"cCheckRecoDauFlag", true, "Check for reco daughter PID"}; + Configurable cGenPrimaryLambda{"cGenPrimaryLambda", true, "Primary Generated Lambda"}; + Configurable cGenSecondaryLambda{"cGenSecondaryLambda", false, "Secondary Generated Lambda"}; + Configurable cGenDecayChannel{"cGenDecayChannel", true, "Gen Level Decay Channel Flag"}; + Configurable cRecoMomResoFlag{"cRecoMomResoFlag", false, "Check effect of momentum space smearing on balance function"}; + + // Efficiency Correction + Configurable cCorrectionFlag{"cCorrectionFlag", false, "Correction Flag"}; + Configurable cGetEffFact{"cGetEffFact", false, "Get Efficiency Factor Flag"}; + Configurable cGetPrimFrac{"cGetPrimFrac", false, "Get Primary Fraction Flag"}; + Configurable cCorrFactHist{"cCorrFactHist", 0, "Efficiency Factor Histogram"}; + Configurable cPrimFracHist{"cPrimFracHist", 0, "Primary Fraction Histogram"}; + + // CCDB + Configurable cUrlCCDB{"cUrlCCDB", "http://ccdb-test.cern.ch:8080", "url of ccdb"}; + Configurable cPathCCDB{"cPathCCDB", "Users/y/ypatley/lambda_corr_fact", "Path for ccdb-object"}; + + // Initialize CCDB Service + Service ccdb; + + // Histogram Registry. + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // initialize corr_factor objects + std::vector> vCorrFactStrings = {{"hEffVsPtCentLambda", "hEffVsPtCentAntiLambda"}, + {"hEffVsPtYCentLambda", "hEffVsPtYCentAntiLambda"}, + {"hEffVsPtEtaCentLambda", "hEffVsPtEtaCentAntiLambda"}}; + + // initialize corr_factor objects + std::vector> vPrimFracStrings = {{"hPrimFracVsPtCentLambda", "hPrimFracVsPtCentAntiLambda"}, + {"hPrimFracVsPtYCentLambda", "hPrimFracVsPtYCentAntiLambda"}, + {"hPrimFracVsPtEtaCentLambda", "hPrimFracVsPtEtaCentAntiLambda"}}; + + // Initialize Global Variables + float cent = 0., mult = 0.; + float pt = 0., eta = 0., rap = 0., phi = 0.; + + void init(InitContext const&) + { + // Set CCDB url + ccdb->setURL(cUrlCCDB.value); + ccdb->setCaching(true); + + // initialize axis specifications + const AxisSpec axisCols(5, 0.5, 5.5, ""); + const AxisSpec axisTrks(30, 0.5, 30.5, ""); + const AxisSpec axisCent(100, 0, 100, "FT0M (%)"); + const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); + const AxisSpec axisVz(220, -11, 11, "V_{z} (cm)"); + const AxisSpec axisPID(8000, -4000, 4000, "PdgCode"); + + const AxisSpec axisV0Mass(140, 1.08, 1.15, "M_{p#pi} (GeV/#it{c}^{2})"); + const AxisSpec axisV0Pt(100., 0., 10., "p_{T} (GeV/#it{c})"); + const AxisSpec axisV0Rap(48, -1.2, 1.2, "y"); + const AxisSpec axisV0Eta(48, -1.2, 1.2, "#eta"); + const AxisSpec axisV0Phi(36, 0., TwoPI, "#phi (rad)"); + + const AxisSpec axisRadius(2000, 0, 200, "r(cm)"); + const AxisSpec axisCosPA(300, 0.97, 1.0, "cos(#theta_{PA})"); + const AxisSpec axisDcaV0PV(1000, 0., 10., "dca (cm)"); + const AxisSpec axisDcaProngPV(5000, -50., 50., "dca (cm)"); + const AxisSpec axisDcaDau(75, 0., 1.5, "Daug DCA (#sigma)"); + const AxisSpec axisCTau(2000, 0, 200, "c#tau (cm)"); + const AxisSpec axisGCTau(2000, 0, 200, "#gammac#tau (cm)"); + const AxisSpec axisAlpha(40, -1, 1, "#alpha"); + const AxisSpec axisQtarm(40, 0, 0.4, "q_{T}"); + + const AxisSpec axisTrackPt(40, 0, 4, "p_{T} (GeV/#it{c})"); + const AxisSpec axisTrackDCA(200, -1, 1, "dca_{XY} (cm)"); + const AxisSpec axisMomPID(80, 0, 4, "p (GeV/#it{c})"); + const AxisSpec axisNsigma(401, -10.025, 10.025, {"n#sigma"}); + const AxisSpec axisdEdx(360, 20, 200, "#frac{dE}{dx}"); + + // Create Histograms. + // Event histograms + histos.add("Events/h1f_collisions_info", "# of Collisions", kTH1F, {axisCols}); + histos.add("Events/h1f_collision_posZ", "V_{z}-distribution", kTH1F, {axisVz}); + + // QA + histos.add("Tracks/h1f_tracks_info", "# of tracks", kTH1F, {axisTrks}); + histos.add("Tracks/h2f_armpod_before_sel", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("Tracks/h2f_armpod_after_sel", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("Tracks/h1f_lambda_pt_vs_invm", "p_{T} vs M_{#Lambda}", kTH2F, {axisV0Mass, axisV0Pt}); + histos.add("Tracks/h1f_antilambda_pt_vs_invm", "p_{T} vs M_{#bar{#Lambda}}", kTH2F, {axisV0Mass, axisV0Pt}); + + // QA Lambda + histos.add("QA/Lambda/h2f_qt_vs_alpha", "Armentros-Podolanski Plot", kTH2F, {axisAlpha, axisQtarm}); + histos.add("QA/Lambda/h1f_dca_V0_daughters", "DCA between V0 daughters", kTH1F, {axisDcaDau}); + histos.add("QA/Lambda/h1f_dca_pos_to_PV", "DCA positive prong to PV", kTH1F, {axisDcaProngPV}); + histos.add("QA/Lambda/h1f_dca_neg_to_PV", "DCA negative prong to PV", kTH1F, {axisDcaProngPV}); + histos.add("QA/Lambda/h1f_dca_V0_to_PV", "DCA V0 to PV", kTH1F, {axisDcaV0PV}); + histos.add("QA/Lambda/h1f_V0_cospa", "cos(#theta_{PA})", kTH1F, {axisCosPA}); + histos.add("QA/Lambda/h1f_V0_radius", "V_{0} Decay Radius in XY plane", kTH1F, {axisRadius}); + histos.add("QA/Lambda/h1f_V0_ctau", "V_{0} c#tau", kTH1F, {axisCTau}); + histos.add("QA/Lambda/h1f_V0_gctau", "V_{0} #gammac#tau", kTH1F, {axisGCTau}); + + histos.add("QA/Lambda/h1f_pos_prong_pt", "Pos-Prong p_{T}", kTH1F, {axisTrackPt}); + histos.add("QA/Lambda/h1f_neg_prong_pt", "Neg-Prong p_{T}", kTH1F, {axisTrackPt}); + histos.add("QA/Lambda/h1f_pos_prong_eta", "Pos-Prong #eta-distribution", kTH1F, {axisV0Eta}); + histos.add("QA/Lambda/h1f_neg_prong_eta", "Neg-Prong #eta-distribution", kTH1F, {axisV0Eta}); + histos.add("QA/Lambda/h1f_pos_prong_phi", "Pos-Prong #phi-distribution", kTH1F, {axisV0Phi}); + histos.add("QA/Lambda/h1f_neg_prong_phi", "Neg-Prong #phi-distribution", kTH1F, {axisV0Phi}); + + histos.add("QA/Lambda/h2f_pos_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); + histos.add("QA/Lambda/h2f_neg_prong_dcaXY_vs_pt", "DCA vs p_{T}", kTH2F, {axisTrackPt, axisTrackDCA}); + histos.add("QA/Lambda/h2f_pos_prong_dEdx_vs_p", "TPC Signal Pos-Prong", kTH2F, {axisMomPID, axisdEdx}); + histos.add("QA/Lambda/h2f_neg_prong_dEdx_vs_p", "TPC Signal Neg-Prong", kTH2F, {axisMomPID, axisdEdx}); + histos.add("QA/Lambda/h2f_pos_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_neg_prong_tpc_nsigma_pr_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_pos_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Pos Prong", kTH2F, {axisMomPID, axisNsigma}); + histos.add("QA/Lambda/h2f_neg_prong_tpc_nsigma_pi_vs_p", "TPC n#sigma Neg Prong", kTH2F, {axisMomPID, axisNsigma}); + + // Kinematic Histograms + histos.add("McRec/Lambda/hPt", "Transverse Momentum", kTH1F, {axisV0Pt}); + histos.add("McRec/Lambda/hEta", "Pseudorapidity", kTH1F, {axisV0Eta}); + histos.add("McRec/Lambda/hRap", "Rapidity", kTH1F, {axisV0Rap}); + histos.add("McRec/Lambda/hPhi", "Azimuthal Angle", kTH1F, {axisV0Phi}); + + // QA Anti-Lambda + histos.addClone("QA/Lambda/", "QA/AntiLambda/"); + histos.addClone("McRec/Lambda/", "McRec/AntiLambda/"); + + // MC Generated Histograms + if (doprocessMCRun3 || doprocessMCRun2 || doprocessMCRecoRun3 || doprocessMCRecoRun2) { + // McReco Histos + histos.add("Tracks/h2f_tracks_pid_before_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_tracks_pid_after_sel", "PIDs", kTH2F, {axisPID, axisV0Pt}); + histos.add("Tracks/h2f_lambda_mothers_pdg", "PIDs", kTH2F, {axisPID, axisV0Pt}); + + // McGen Histos + histos.add("McGen/h1f_collision_recgen", "# of Reco Collision Associated to One Mc Generator Collision", kTH1F, {axisMult}); + histos.add("McGen/h1f_collisions_info", "# of collisions", kTH1F, {axisCols}); + histos.add("McGen/h2f_collision_posZ", "V_{z}-distribution", kTH2F, {axisVz, axisVz}); + histos.add("McGen/h2f_collision_cent", "FT0M Centrality", kTH2F, {axisCent, axisCent}); + histos.add("McGen/h1f_lambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); + histos.add("McGen/h1f_antilambda_daughter_PDG", "PDG Daughters", kTH1F, {axisPID}); + + histos.addClone("McRec/", "McGen/"); + + histos.add("McGen/Lambda/Proton/hPt", "Proton p_{T}", kTH1F, {axisTrackPt}); + histos.add("McGen/Lambda/Proton/hEta", "Proton #eta", kTH1F, {axisV0Eta}); + histos.add("McGen/Lambda/Proton/hRap", "Proton y", kTH1F, {axisV0Rap}); + histos.add("McGen/Lambda/Proton/hPhi", "Proton #phi", kTH1F, {axisV0Phi}); + + histos.addClone("McGen/Lambda/Proton/", "McGen/Lambda/Pion/"); + histos.addClone("McGen/Lambda/Proton/", "McGen/AntiLambda/Proton/"); + histos.addClone("McGen/Lambda/Pion/", "McGen/AntiLambda/Pion/"); + + // set bin lables specific to MC + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotColBeforeHasMcCollision, "kTotColBeforeHasMcCollision"); + histos.get(HIST("McGen/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotCol, "kTotCol"); + histos.get(HIST("McGen/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kPassSelCol, "kPassSelCol"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kTracksBeforeHasMcParticle, "kTracksBeforeHasMcParticle"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPrimaryLambda, "kPrimaryLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kSecondaryLambda, "kSecondaryLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kLambdaDauNotMcParticle, "kLambdaDauNotMcParticle"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kLambdaNotPrPiMinus, "kLambdaNotPrPiMinus"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAntiLambdaNotAntiPrPiPlus, "kAntiLambdaNotAntiPrPiPlus"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassTrueLambdaSel, "kPassTrueLambdaSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenTotAccLambda, "kGenTotAccLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenLambdaNoDau, "kGenLambdaNoDau"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kGenLambdaToPrPi, "kGenLambdaToPrPi"); + } + + // set bin labels + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kTotCol, "kTotCol"); + histos.get(HIST("Events/h1f_collisions_info"))->GetXaxis()->SetBinLabel(CollisionLabels::kPassSelCol, "kPassSelCol"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAllV0Tracks, "kAllV0Tracks"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kV0KShortMassRej, "kV0KShortMassRej"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotLambdaNotAntiLambda, "kNotLambdaNotAntiLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kV0IsBothLambdaAntiLambda, "kV0IsBothLambdaAntiLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNotLambdaAfterSel, "kNotLambdaAfterSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kV0IsLambdaOrAntiLambda, "kV0IsLambdaOrAntiLambda"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0DauTrackSel, "kPassV0DauTrackSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0KinCuts, "kPassV0KinCuts"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPassV0TopoSel, "kPassV0TopoSel"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kAllSelPassed, "kAllSelPassed"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kEffCorrPtCent, "kEffCorrPtCent"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kEffCorrPtRapCent, "kEffCorrPtRapCent"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNoEffCorr, "kNoEffCorr"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPFCorrPtCent, "kPFCorrPtCent"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kPFCorrPtRapCent, "kPFCorrPtRapCent"); + histos.get(HIST("Tracks/h1f_tracks_info"))->GetXaxis()->SetBinLabel(TrackLabels::kNoPFCorr, "kNoPFCorr"); + } + + template + bool selCollision(C const& col) + { + // VtxZ Selection + if (col.posZ() <= cMinZVtx || col.posZ() >= cMaxZVtx) { + return false; + } + + if constexpr (run == kRun3) { // Run3 Min-Bias Trigger + // select centrality estimator + if (cCentEstimator == kCentFT0M) { + cent = col.centFT0M(); + } else if (cCentEstimator == kCentFV0A) { + cent = col.centFV0A(); + } + if (cSel8Trig && !col.sel8()) { + return false; + } + } else { // Run2 Min-Bias Trigger + cent = col.centRun2V0M(); + if (cInt7Trig && !col.alias_bit(kINT7)) { + return false; + } + if (cSel7Trig && !col.sel7()) { + return false; + } + } + + if (cent <= cMinMult || cent >= cMaxMult) { // select centrality percentile class + return false; + } + + if (cTriggerTvxSel && !col.selection_bit(aod::evsel::kIsTriggerTVX)) { + return false; + } + + if (cTFBorder && !col.selection_bit(aod::evsel::kNoTimeFrameBorder)) { + return false; + } + + if (cNoItsROBorder && !col.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return false; + } + + if (cItsTpcVtx && !col.selection_bit(aod::evsel::kIsVertexITSTPC)) { + return false; + } + + if (cPileupReject && !col.selection_bit(aod::evsel::kNoSameBunchPileup)) { + return false; + } + + if (cZVtxTimeDiff && !col.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + + if (cIsGoodITSLayers && !col.selection_bit(aod::evsel::kIsGoodITSLayersAll)) { + return false; + } + + // Set Multiplicity + mult = col.multNTracksPV(); + + return true; + } + + // Kinematic Selection + bool kinCutSelection(float const& pt, float const& rap, float const& ptMin, float const& ptMax, float const& rapMax) + { + if (pt <= ptMin || pt >= ptMax || rap >= rapMax) { + return false; + } + + return true; + } + + // Track Selection + template + bool selTrack(T const& track) + { + if (!kinCutSelection(track.pt(), std::abs(track.eta()), cTrackMinPt, cTrackMaxPt, cTrackEtaCut)) { + return false; + } + + if (track.tpcNClsCrossedRows() <= cMinTpcCrossedRows) { + return false; + } + + if (track.tpcCrossedRowsOverFindableCls() < cMinTpcCROverCls) { + return false; + } + + if (track.tpcNClsShared() > cMaxTpcSharedClusters) { + return false; + } + + if (track.tpcChi2NCl() > cMaxChi2Tpc) { + return false; + } + + return true; + } + + // Daughter Track Selection + template + bool selDaughterTracks(V const& v0, T const&, ParticleType const& v0Type) + { + auto posTrack = v0.template posTrack_as(); + auto negTrack = v0.template negTrack_as(); + + if (!selTrack(posTrack) || !selTrack(negTrack)) { + return false; + } + + // Apply DCA Selection on Daughter Tracks Based on Lambda/AntiLambda daughters + float dcaProton = 0., dcaPion = 0.; + if (v0Type == kLambda) { + dcaProton = std::abs(v0.dcapostopv()); + dcaPion = std::abs(v0.dcanegtopv()); + } else if (v0Type == kAntiLambda) { + dcaPion = std::abs(v0.dcapostopv()); + dcaProton = std::abs(v0.dcanegtopv()); + } + + if (dcaProton < cMinDcaProtonToPV || dcaPion < cMinDcaPionToPV) { + return false; + } + + return true; + } + + template + bool topoCutSelection(C const& col, V const& v0, T const&) + { + // DCA + if (v0.dcaV0daughters() <= cMinV0DcaDaughters || v0.dcaV0daughters() >= cMaxV0DcaDaughters) { + return false; + } + + if (v0.dcav0topv() <= cMinDcaV0ToPV || v0.dcav0topv() >= cMaxDcaV0ToPV) { + return false; + } + + if (v0.v0radius() <= cMinV0TransRadius || v0.v0radius() >= cMaxV0TransRadius) { + return false; + } + + // ctau + float ctau = v0.distovertotmom(col.posX(), col.posY(), col.posZ()) * MassLambda0; + if (ctau <= cMinV0CTau || ctau >= cMaxV0CTau) { + return false; + } + + // cosine of pointing angle + if (v0.v0cosPA() <= cMinV0CosPA) { + return false; + } + + // all selection criterion passed (Return True) + return true; + } + + template + bool selLambdaDauWithTpcPid(T const& postrack, T const& negtrack) + { + bool returnFlag = false; + float tpcNSigmaPr = 0., tpcNSigmaPi = 0.; + + switch (part) { + // postrack = Proton, negtrack = Pion + case kLambda: + tpcNSigmaPr = postrack.tpcNSigmaPr(); + tpcNSigmaPi = negtrack.tpcNSigmaPi(); + break; + + // negtrack = Proton, postrack = Pion + case kAntiLambda: + tpcNSigmaPr = negtrack.tpcNSigmaPr(); + tpcNSigmaPi = postrack.tpcNSigmaPi(); + break; + } + + if (std::abs(tpcNSigmaPr) < cTpcNsigmaCut && std::abs(tpcNSigmaPi) < cTpcNsigmaCut) { + returnFlag = true; + } + + return returnFlag; + } + + template + bool selLambdaMassWindow(V const& v0, T const&, ParticleType& v0type) + { + // Kshort mass rejection hypothesis + if (cKshortRejFlag && (std::abs(v0.mK0Short() - MassK0Short) <= cKshortRejMassWindow)) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kV0KShortMassRej); + return false; + } + + // initialize daughter tracks + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + + // initialize selection flags + bool lambdaFlag = false, antiLambdaFlag = false; + + // get v0 track as lambda + if ((v0.mLambda() > cMinV0Mass && v0.mLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + lambdaFlag = true; + v0type = kLambda; + } + + // get v0 track as anti-lambda + if ((v0.mAntiLambda() > cMinV0Mass && v0.mAntiLambda() < cMaxV0Mass) && (selLambdaDauWithTpcPid(postrack, negtrack))) { + antiLambdaFlag = true; + v0type = kAntiLambda; + } + + if (!lambdaFlag && !antiLambdaFlag) { // neither Lambda nor Anti-Lambda + histos.fill(HIST("Tracks/h1f_tracks_info"), kNotLambdaNotAntiLambda); + return false; + } else if (lambdaFlag && antiLambdaFlag) { // check if the track is identified as lambda and anti-lambda both (DISCARD THIS TRACK) + histos.fill(HIST("Tracks/h1f_tracks_info"), kV0IsBothLambdaAntiLambda); + return false; + } + + if (lambdaFlag || antiLambdaFlag) { + return true; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kNotLambdaAfterSel); + + return false; + } + + template + bool selV0Particle(C const& col, V const& v0, T const& tracks, ParticleType& v0Type) + { + // Apply Lambda Mass Hypothesis + if (!selLambdaMassWindow(v0, tracks, v0Type)) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kV0IsLambdaOrAntiLambda); + + // Apply Daughter Track Selection + if (!selDaughterTracks(v0, tracks, v0Type)) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0DauTrackSel); + + // Apply Kinematic Selection + float rap = 0.; + if (!cDoEtaAnalysis) { + rap = std::abs(v0.yLambda()); + } else { + rap = std::abs(v0.eta()); + } + + if (!kinCutSelection(v0.pt(), rap, cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0KinCuts); + + // Apply Topological Selection + if (!topoCutSelection(col, v0, tracks)) { + return false; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassV0TopoSel); + + // All Selection Criterion Passed + return true; + } + + template + bool hasAmbiguousDaughters(V const& v0, T const&) + { + auto posTrack = v0.template posTrack_as(); + auto negTrack = v0.template negTrack_as(); + + auto posTrackCompCols = posTrack.compatibleCollIds(); + auto negTrackCompCols = negTrack.compatibleCollIds(); + + // Check if daughter tracks belongs to more than one collision (Ambiguous Tracks) + if (posTrackCompCols.size() > 1 || negTrackCompCols.size() > 1) { + return true; + } + + // Check if compatible collision index matches the track collision index + if (((posTrackCompCols.size() != 0) && (posTrackCompCols[0] != posTrack.collisionId())) || + ((negTrackCompCols.size() != 0) && (negTrackCompCols[0] != negTrack.collisionId()))) { + return true; + } + + // Pass as not ambiguous + return false; + } + + template + PrmScdType isPrimaryV0(V const& v0) + { + auto mcpart = v0.template mcParticle_as(); + + // check for secondary lambda + if (!mcpart.isPhysicalPrimary()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kSecondaryLambda); + return kSecondary; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPrimaryLambda); + return kPrimary; + } + + template + bool selTrueMcRecLambda(V const& v0, T const&) + { + auto mcpart = v0.template mcParticle_as(); + + // check if Lambda/AntiLambda + if (std::abs(mcpart.pdgCode()) != kLambda0) { + return false; + } + + // Check for daughters + if (cCheckRecoDauFlag) { + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + + // check if the daughters have corresponding mcparticle + if (!postrack.has_mcParticle() || !negtrack.has_mcParticle()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kLambdaDauNotMcParticle); + return false; + } + + auto mcpostrack = postrack.template mcParticle_as(); + auto mcnegtrack = negtrack.template mcParticle_as(); + + if (mcpart.pdgCode() == kLambda0) { + if (mcpostrack.pdgCode() != kProton || mcnegtrack.pdgCode() != kPiMinus) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kLambdaNotPrPiMinus); + return false; + } + } else if (mcpart.pdgCode() == kLambda0Bar) { + if (mcpostrack.pdgCode() != kPiPlus || mcnegtrack.pdgCode() != kProtonBar) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kAntiLambdaNotAntiPrPiPlus); + return false; + } + } + } + + return true; + } + + template + float getCorrectionFactors(V const& v0) + { + // Check for efficiency correction flag + if (!cCorrectionFlag) { + return 1.; + } + + // Get from CCDB + auto ccdbObj = ccdb->getForTimeStamp(cPathCCDB.value, -1); + + // Check CCDB Object + if (!ccdbObj) { + LOGF(warning, "CCDB OBJECT NOT FOUND"); + return 1.; + } + + // initialize efficiency factor and primary fraction values + float effCorrFact = 1., primFrac = 1.; + float rap = (cDoEtaAnalysis) ? v0.eta() : v0.yLambda(); + + // Get Efficiency Factor + if (cGetEffFact) { + TObject* objEff = reinterpret_cast(ccdbObj->FindObject(Form("%s", vCorrFactStrings[cCorrFactHist][part].c_str()))); + TH1F* histEff = reinterpret_cast(objEff->Clone()); + if (histEff->GetDimension() == TwoDimCorr) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kEffCorrPtCent); + effCorrFact = histEff->GetBinContent(histEff->FindBin(cent, v0.pt())); + } else if (histEff->GetDimension() == ThreeDimCorr) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kEffCorrPtRapCent); + effCorrFact = histEff->GetBinContent(histEff->FindBin(cent, v0.pt(), rap)); + } else { + histos.fill(HIST("Tracks/h1f_tracks_info"), kNoEffCorr); + LOGF(warning, "CCDB OBJECT IS NOT A HISTOGRAM !!!"); + effCorrFact = 1.; + } + delete histEff; + } + + // Get Primary Fraction + // (The dimension of this could be different than efficiency because of large errors !!!) + if (cGetPrimFrac) { + TObject* objPrm = reinterpret_cast(ccdbObj->FindObject(Form("%s", vPrimFracStrings[cPrimFracHist][part].c_str()))); + TH1F* histPrm = reinterpret_cast(objPrm->Clone()); + if (histPrm->GetDimension() == TwoDimCorr) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kPFCorrPtCent); + primFrac = histPrm->GetBinContent(histPrm->FindBin(cent, v0.pt())); + } else if (histPrm->GetDimension() == ThreeDimCorr) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kPFCorrPtRapCent); + primFrac = histPrm->GetBinContent(histPrm->FindBin(cent, v0.pt(), rap)); + } else { + histos.fill(HIST("Tracks/h1f_tracks_info"), kNoPFCorr); + LOGF(warning, "CCDB OBJECT IS NOT A HISTOGRAM !!!"); + primFrac = 1.; + } + delete histPrm; + } + + return primFrac * effCorrFact; + } + + template + void fillLambdaMothers(V const& v0, T const&) + { + auto mcpart = v0.template mcParticle_as(); + auto lambdaMothers = mcpart.template mothers_as(); + histos.fill(HIST("Tracks/h2f_lambda_mothers_pdg"), lambdaMothers[0].pdgCode(), v0.pt()); + } + + template + void fillLambdaQAHistos(C const& col, V const& v0, T const&) + { + static constexpr std::string_view SubDir[] = {"QA/Lambda/", "QA/AntiLambda/"}; + + // daugthers + auto postrack = v0.template posTrack_as(); + auto negtrack = v0.template negTrack_as(); + float mass = 0.; + + if constexpr (part == kLambda) { + mass = v0.mLambda(); + } else { + mass = v0.mAntiLambda(); + } + + // ctau + float e = RecoDecay::e(v0.px(), v0.py(), v0.pz(), mass); + float gamma = e / mass; + float ctau = v0.distovertotmom(col.posX(), col.posY(), col.posZ()) * MassLambda0; + float gctau = ctau * gamma; + + histos.fill(HIST(SubDir[part]) + HIST("h2f_qt_vs_alpha"), v0.alpha(), v0.qtarm()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_V0_daughters"), v0.dcaV0daughters()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_pos_to_PV"), v0.dcapostopv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_neg_to_PV"), v0.dcanegtopv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_dca_V0_to_PV"), v0.dcav0topv()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_cospa"), v0.v0cosPA()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_radius"), v0.v0radius()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_ctau"), ctau); + histos.fill(HIST(SubDir[part]) + HIST("h1f_V0_gctau"), gctau); + + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_pt"), postrack.pt()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_eta"), postrack.eta()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_pos_prong_phi"), postrack.phi()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_pt"), negtrack.pt()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_eta"), negtrack.eta()); + histos.fill(HIST(SubDir[part]) + HIST("h1f_neg_prong_phi"), negtrack.phi()); + + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_dcaXY_vs_pt"), postrack.pt(), postrack.dcaXY()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_dcaXY_vs_pt"), negtrack.pt(), negtrack.dcaXY()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_dEdx_vs_p"), postrack.tpcInnerParam(), postrack.tpcSignal()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_dEdx_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcSignal()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_tpc_nsigma_pr_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPr()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_tpc_nsigma_pr_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPr()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_pos_prong_tpc_nsigma_pi_vs_p"), postrack.tpcInnerParam(), postrack.tpcNSigmaPi()); + histos.fill(HIST(SubDir[part]) + HIST("h2f_neg_prong_tpc_nsigma_pi_vs_p"), negtrack.tpcInnerParam(), negtrack.tpcNSigmaPi()); + } + + // Fill Lambda Kinematic Histograms + template + void fillKinematicHists(float const& pt, float const& eta, float const& y, float const& phi) + { + static constexpr std::string_view SubDirRG[] = {"McRec/", "McGen/"}; + static constexpr std::string_view SubDirPart[] = {"Lambda/", "AntiLambda/"}; + + histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hPt"), pt); + histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hEta"), eta); + histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hRap"), y); + histos.fill(HIST(SubDirRG[rg]) + HIST(SubDirPart[part]) + HIST("hPhi"), phi); + } + + // Reconstructed Level Tables + template + void fillLambdaRecoTables(C const& collision, V const& v0tracks, T const& tracks) + { + // Total Collisions + histos.fill(HIST("Events/h1f_collisions_info"), kTotCol); + + // Select Collision (Only for Data... McRec has been selected already !!!) + if constexpr (dmc == kData) { + if (!selCollision(collision)) { + return; + } + } + + histos.fill(HIST("Events/h1f_collisions_info"), kPassSelCol); + histos.fill(HIST("Events/h1f_collision_posZ"), collision.posZ()); + + // Fill Collision Table + // lambdaCollisionTable(cent, mult, collision.posX(), collision.posY(), collision.posZ()); + lambdaCollisionTable(cent, mult, collision.globalIndex(), collision.posX(), collision.posY(), collision.posZ()); + + // initialize v0track objects + ParticleType v0Type = kLambda; + PrmScdType v0PrmScdType = kPrimary; + float mass = 0., corr_fact = 1.; + + for (auto const& v0 : v0tracks) { + // check for corresponding MCGen Particle + if constexpr (dmc == kMC) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kTracksBeforeHasMcParticle); + if (!v0.has_mcParticle()) { + continue; + } + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kAllV0Tracks); + histos.fill(HIST("Tracks/h2f_armpod_before_sel"), v0.alpha(), v0.qtarm()); + + // Select V0 Particle as Lambda/AntiLambda + if (!selV0Particle(collision, v0, tracks, v0Type)) { + continue; + } + + // Select V0 Type Selection + if (cV0TypeSelFlag && v0.v0Type() != cV0TypeSelection) { + continue; + } + + // we have v0 as lambda + histos.fill(HIST("Tracks/h1f_tracks_info"), kAllSelPassed); + + // Remove lambda with ambiguous daughters (Only for run3) + if constexpr (run == kRun3) { + if (cRemoveAmbiguousTracks && hasAmbiguousDaughters(v0, tracks)) { + continue; + } + } + + // Get Lambda mass and kinematic variables + mass = (v0Type == kLambda) ? v0.mLambda() : v0.mAntiLambda(); + pt = v0.pt(); + eta = v0.eta(); + rap = v0.yLambda(); + phi = v0.phi(); + + // do MC analysis + if constexpr (dmc == kMC) { + histos.fill(HIST("Tracks/h2f_tracks_pid_before_sel"), v0.mcParticle().pdgCode(), v0.pt()); + + // Get Primary/Secondary Lambda + if (cSelMCPSV0) { + v0PrmScdType = isPrimaryV0(v0); + } + + // check for true Lambda/Anti-Lambda + if (cSelectTrueLambda && !selTrueMcRecLambda(v0, tracks)) { + continue; + } + + // get mothers information + if (v0PrmScdType == kSecondary) { + fillLambdaMothers(v0, tracks); + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kPassTrueLambdaSel); + histos.fill(HIST("Tracks/h2f_tracks_pid_after_sel"), v0.mcParticle().pdgCode(), v0.pt()); + + if (cRecoMomResoFlag) { + auto mc = v0.template mcParticle_as(); + pt = mc.pt(); + eta = mc.eta(); + rap = mc.y(); + phi = mc.phi(); + float y = (cDoEtaAnalysis) ? eta : rap; + // apply kinematic selection (On Truth) + if (!kinCutSelection(pt, std::abs(y), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { + continue; + } + } + } + + histos.fill(HIST("Tracks/h2f_armpod_after_sel"), v0.alpha(), v0.qtarm()); + + // get correction factors + corr_fact = (v0Type == kLambda) ? getCorrectionFactors(v0) : getCorrectionFactors(v0); + + // fill lambda qa + if (v0Type == kLambda) { + histos.fill(HIST("Tracks/h1f_lambda_pt_vs_invm"), mass, v0.pt()); + fillLambdaQAHistos(collision, v0, tracks); + fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); + } else { + histos.fill(HIST("Tracks/h1f_antilambda_pt_vs_invm"), mass, v0.pt()); + fillLambdaQAHistos(collision, v0, tracks); + fillKinematicHists(v0.pt(), v0.eta(), v0.yLambda(), v0.phi()); + } + + // Fill Lambda/AntiLambda Table + lambdaTrackTable(lambdaCollisionTable.lastIndex(), v0.px(), v0.py(), v0.pz(), + pt, eta, phi, rap, mass, v0.template posTrack_as().index(), v0.template negTrack_as().index(), + v0.v0cosPA(), v0.dcaV0daughters(), (int8_t)v0Type, v0PrmScdType, corr_fact); + } + } + + // MC Generater Level Tables + template + void fillLambdaMcGenTables(C const& mcCollision, M const& mcParticles) + { + // Fill McGen Collision Table + lambdaMCGenCollisionTable(cent, mult, mcCollision.globalIndex(), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); + + // initialize track objects + ParticleType v0Type = kLambda; + PrmScdType v0PrmScdType = kPrimary; + float rap = 0.; + + for (auto const& mcpart : mcParticles) { + // check for Lambda first + if (mcpart.pdgCode() == kLambda0) { + v0Type = kLambda; + } else if (mcpart.pdgCode() == kLambda0Bar) { + v0Type = kAntiLambda; + } else { + continue; + } + + // check for Primary Lambda/AntiLambda + if (mcpart.isPhysicalPrimary()) { + v0PrmScdType = kPrimary; + } else { + v0PrmScdType = kSecondary; + } + + // Decide Eta/Rap + if (!cDoEtaAnalysis) { + rap = mcpart.y(); + } else { + rap = mcpart.eta(); + } + + // Apply Kinematic Acceptance + if (!kinCutSelection(mcpart.pt(), std::abs(rap), cMinV0Pt, cMaxV0Pt, cMaxV0Rap)) { + continue; + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenTotAccLambda); + + // get daughter track info and check for decay channel flag + if (!mcpart.has_daughters()) { + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaNoDau); + continue; + } + auto dautracks = mcpart.template daughters_as(); + std::vector daughterPDGs, daughterIDs; + std::vector vDauPt, vDauEta, vDauRap, vDauPhi; + for (auto const& dautrack : dautracks) { + daughterPDGs.push_back(dautrack.pdgCode()); + daughterIDs.push_back(dautrack.globalIndex()); + vDauPt.push_back(dautrack.pt()); + vDauEta.push_back(dautrack.eta()); + vDauRap.push_back(dautrack.y()); + vDauPhi.push_back(dautrack.phi()); + } + if (cGenDecayChannel) { // check decay channel + if (v0Type == kLambda) { + if (daughterPDGs[0] != kProton || daughterPDGs[1] != kPiMinus) { + continue; + } + } else if (v0Type == kAntiLambda) { + if (daughterPDGs[0] != kProtonBar || daughterPDGs[1] != kPiPlus) { + continue; + } + } + } + + histos.fill(HIST("Tracks/h1f_tracks_info"), kGenLambdaToPrPi); + + if (v0Type == kLambda) { + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[0]); + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), daughterPDGs[1]); + histos.fill(HIST("McGen/h1f_lambda_daughter_PDG"), mcpart.pdgCode()); + histos.fill(HIST("McGen/Lambda/Proton/hPt"), vDauPt[0]); + histos.fill(HIST("McGen/Lambda/Proton/hEta"), vDauEta[0]); + histos.fill(HIST("McGen/Lambda/Proton/hRap"), vDauRap[0]); + histos.fill(HIST("McGen/Lambda/Proton/hPhi"), vDauPhi[0]); + histos.fill(HIST("McGen/Lambda/Pion/hPt"), vDauPt[1]); + histos.fill(HIST("McGen/Lambda/Pion/hEta"), vDauEta[1]); + histos.fill(HIST("McGen/Lambda/Pion/hRap"), vDauRap[1]); + histos.fill(HIST("McGen/Lambda/Pion/hPhi"), vDauPhi[1]); + fillKinematicHists(mcpart.pt(), mcpart.eta(), mcpart.y(), mcpart.phi()); + } else { + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[0]); + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), daughterPDGs[1]); + histos.fill(HIST("McGen/h1f_antilambda_daughter_PDG"), mcpart.pdgCode()); + histos.fill(HIST("McGen/AntiLambda/Pion/hPt"), vDauPt[0]); + histos.fill(HIST("McGen/AntiLambda/Pion/hEta"), vDauEta[0]); + histos.fill(HIST("McGen/AntiLambda/Pion/hRap"), vDauRap[0]); + histos.fill(HIST("McGen/AntiLambda/Pion/hPhi"), vDauPhi[0]); + histos.fill(HIST("McGen/AntiLambda/Proton/hPt"), vDauPt[1]); + histos.fill(HIST("McGen/AntiLambda/Proton/hEta"), vDauEta[1]); + histos.fill(HIST("McGen/AntiLambda/Proton/hRap"), vDauRap[1]); + histos.fill(HIST("McGen/AntiLambda/Proton/hPhi"), vDauPhi[1]); + fillKinematicHists(mcpart.pt(), mcpart.eta(), mcpart.y(), mcpart.phi()); + } + + // Fill Lambda McGen Table + lambdaMCGenTrackTable(lambdaMCGenCollisionTable.lastIndex(), mcpart.px(), mcpart.py(), mcpart.pz(), + mcpart.pt(), mcpart.eta(), mcpart.phi(), mcpart.y(), RecoDecay::m(mcpart.p(), mcpart.e()), + daughterIDs[0], daughterIDs[1], (int8_t)v0Type, -999., -999., v0PrmScdType, 1.); + } + } + + template + void analyzeMcRecoGen(M const& mcCollision, C const& collisions, V const& V0s, T const& tracks, P const& mcParticles) + { + // Number of Rec Collisions Associated to the McGen Collision + int nRecCols = collisions.size(); + if (nRecCols != 0) { + histos.fill(HIST("McGen/h1f_collision_recgen"), nRecCols); + } + + // Always fill gen tables so processMCGenXi/Omega has entries. + // selCollision sets cent/mult as a side-effect — works for both Run2 and Run3. + cent = 0.f; + mult = 0.f; + if (nRecCols >= 1 && + collisions.begin().has_mcCollision() && + collisions.begin().mcCollisionId() == mcCollision.globalIndex()) { + selCollision(collisions.begin()); // sets cent and mult + } + fillLambdaMcGenTables(mcCollision, mcParticles); + + // Reco tables only for clean 1-to-1 matched collisions + if (nRecCols != 1) { + return; + } + histos.fill(HIST("McGen/h1f_collisions_info"), kTotCol); + if (!collisions.begin().has_mcCollision() || !selCollision(collisions.begin()) || collisions.begin().mcCollisionId() != mcCollision.globalIndex()) { + return; + } + histos.fill(HIST("McGen/h1f_collisions_info"), kPassSelCol); + histos.fill(HIST("McGen/h2f_collision_posZ"), mcCollision.posZ(), collisions.begin().posZ()); + auto v0Tracks = V0s.sliceBy(perCollision, collisions.begin().globalIndex()); + fillLambdaRecoTables(collisions.begin(), v0Tracks, tracks); + } + + SliceCache cache; + Preslice> perCollision = aod::v0data::collisionId; + + using CollisionsRun3 = soa::Join; + using CollisionsRun2 = soa::Join; + using Tracks = soa::Join; + using TracksRun2 = soa::Join; + using TracksMC = soa::Join; + using TracksMCRun2 = soa::Join; + using McV0Tracks = soa::Join; + + void processDataRun3(CollisionsRun3::iterator const& collision, aod::V0Datas const& V0s, Tracks const& tracks) + { + fillLambdaRecoTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processDataRun3, "Process for Run3 DATA", true); + + void processDataRun2(CollisionsRun2::iterator const& collision, aod::V0Datas const& V0s, TracksRun2 const& tracks) + { + fillLambdaRecoTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processDataRun2, "Process for Run2 DATA", false); + + void processMCRecoRun3(soa::Join::iterator const& collision, aod::McCollisions const&, + McV0Tracks const& V0s, TracksMC const& tracks, aod::McParticles const&) + { + // check collision + if (!selCollision(collision)) { + return; + } + fillLambdaRecoTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun3, "Process for Run3 McReco DATA", false); + + void processMCRecoRun2(soa::Join::iterator const& collision, aod::McCollisions const&, + McV0Tracks const& V0s, TracksMCRun2 const& tracks, aod::McParticles const&) + { + // check collision + if (!selCollision(collision)) { + return; + } + fillLambdaRecoTables(collision, V0s, tracks); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCRecoRun2, "Process for Run2 McReco DATA", false); + + void processMCRun3(aod::McCollisions::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + McV0Tracks const& V0s, TracksMC const& tracks, + aod::McParticles const& mcParticles) + { + analyzeMcRecoGen(mcCollision, collisions, V0s, tracks, mcParticles); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCRun3, "Process for Run3 MC RecoGen", false); + + void processMCRun2(aod::McCollisions::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + McV0Tracks const& V0s, TracksMCRun2 const& tracks, + aod::McParticles const& mcParticles) + { + analyzeMcRecoGen(mcCollision, collisions, V0s, tracks, mcParticles); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCRun2, "Process for Run2 MC RecoGen", false); + + // Gen-only: fills LambdaMcGenCollisions + LambdaMcGenTracks without touching reco tables. + // Use alongside processMCRecoRun3 (which fills reco tables only). + void processMCGenOnlyRun3(aod::McCollisions::iterator const& mcCollision, + soa::SmallGroups> const& collisions, + aod::McParticles const& mcParticles) + { + // Try to obtain centrality from a matched reco collision + cent = 0.f; + mult = 0.f; + if (collisions.size() >= 1) { + auto firstReco = collisions.begin(); + if (firstReco.has_mcCollision() && + firstReco.mcCollisionId() == mcCollision.globalIndex()) { + selCollision(firstReco); // sets cent and mult + } + } + fillLambdaMcGenTables(mcCollision, mcParticles); + } + + PROCESS_SWITCH(LambdaTableProducer, processMCGenOnlyRun3, "Gen-only Run3 (no reco tables)", false); +}; + +struct LambdaTracksExtProducer { + + Produces lambdaTrackExtTable; + + // Configurables + Configurable cAcceptAllLambda{"cAcceptAllLambda", false, "Accept all Lambda"}; + Configurable cRejAllLambdaShaDau{"cRejAllLambdaShaDau", true, "Reject all Lambda sharing daughters"}; + Configurable cSelLambdaMassPdg{"cSelLambdaMassPdg", false, "Select Lambda closest to Pdg Mass"}; + Configurable cSelLambdaTScore{"cSelLambdaTScore", false, "Select Lambda based on t-score"}; + Configurable cA{"cA", 0.6, "a * |lambdaMass - lambdaPdgMass|"}; + Configurable cB{"cB", 0.6, "b * DcaPrPi"}; + Configurable cC{"cC", 0.6, "c * Cos(theta_{PA})"}; + + // Histogram Registry. + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + void init(InitContext const&) + { + // Axis Specifications + const AxisSpec axisMult(10, 0, 10); + const AxisSpec axisMass(100, 1.06, 1.16, "Inv Mass (GeV/#it{c}^{2})"); + const AxisSpec axisCPA(100, 0.995, 1.0, "cos(#theta_{PA})"); + const AxisSpec axisDcaDau(75, 0., 1.5, "Daug DCA (#sigma)"); + const AxisSpec axisDEta(320, -1.6, 1.6, "#Delta#eta"); + const AxisSpec axisDPhi(640, -PIHalf, 3. * PIHalf, "#Delta#varphi"); + + // Histograms Booking + histos.add("h1i_totlambda_mult", "Multiplicity", kTH1I, {axisMult}); + histos.add("h1i_totantilambda_mult", "Multiplicity", kTH1I, {axisMult}); + histos.add("h1i_lambda_mult", "Multiplicity", kTH1I, {axisMult}); + histos.add("h1i_antilambda_mult", "Multiplicity", kTH1I, {axisMult}); + histos.add("h2d_n2_etaphi_LaP_LaM", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); + histos.add("h2d_n2_etaphi_LaP_LaP", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); + histos.add("h2d_n2_etaphi_LaM_LaM", "#rho_{2}^{SharePair}", kTH2D, {axisDEta, axisDPhi}); + + // InvMass, DcaDau and CosPA + histos.add("Reco/h1f_lambda_invmass", "M_{p#pi}", kTH1F, {axisMass}); + histos.add("Reco/h1f_lambda_cospa", "cos(#theta_{PA})", kTH1F, {axisCPA}); + histos.add("Reco/h1f_lambda_dcadau", "DCA_{p#pi} at V0 Decay Vertex", kTH1F, {axisDcaDau}); + histos.add("Reco/h1f_antilambda_invmass", "M_{p#pi}", kTH1F, {axisMass}); + histos.add("Reco/h1f_antilambda_cospa", "cos(#theta_{PA})", kTH1F, {axisCPA}); + histos.add("Reco/h1f_antilambda_dcadau", "DCA_{p#pi} at V0 Decay Vertex", kTH1F, {axisDcaDau}); + + histos.addClone("Reco/", "SharingDau/"); + } + + template + void fillHistos(T const& track) + { + static constexpr std::string_view SubDir[] = {"Reco/", "SharingDau/"}; + + if (track.v0Type() == kLambda) { + histos.fill(HIST(SubDir[sd]) + HIST("h1f_lambda_invmass"), track.mass()); + histos.fill(HIST(SubDir[sd]) + HIST("h1f_lambda_dcadau"), track.dcaDau()); + histos.fill(HIST(SubDir[sd]) + HIST("h1f_lambda_cospa"), track.cosPA()); + } else { + histos.fill(HIST(SubDir[sd]) + HIST("h1f_antilambda_invmass"), track.mass()); + histos.fill(HIST(SubDir[sd]) + HIST("h1f_antilambda_dcadau"), track.dcaDau()); + histos.fill(HIST(SubDir[sd]) + HIST("h1f_antilambda_cospa"), track.cosPA()); + } + } + + void process(aod::LambdaCollisions::iterator const&, aod::LambdaTracks const& tracks) + { + + int nTotLambda = 0, nTotAntiLambda = 0, nSelLambda = 0, nSelAntiLambda = 0; + + for (auto const& lambda : tracks) { + bool lambdaMinDeltaMassFlag = true, lambdaMinTScoreFlag = true; + bool lambdaSharingDauFlag = false, trueLambdaFlag = false; + std::vector vSharedDauLambdaIndex; + float tLambda = 0., tTrack = 0.; + + if (lambda.v0Type() == kLambda) { + ++nTotLambda; + } else if (lambda.v0Type() == kAntiLambda) { + ++nTotAntiLambda; + } + + tLambda = (cA * std::abs(lambda.mass() - MassLambda0)) + (cB * lambda.dcaDau()) + (cC * std::abs(lambda.cosPA() - 1.)); + + for (auto const& track : tracks) { + // check lambda index (don't analyze same lambda track !!!) + if (lambda.index() == track.index()) { + continue; + } + + // check if lambda shares daughters with any other track + if (lambda.posTrackId() == track.posTrackId() || lambda.negTrackId() == track.negTrackId()) { + vSharedDauLambdaIndex.push_back(track.index()); + lambdaSharingDauFlag = true; + + // Fill DEta-DPhi Histogram + if ((lambda.v0Type() == kLambda && track.v0Type() == kAntiLambda) || (lambda.v0Type() == kAntiLambda && track.v0Type() == kLambda)) { + histos.fill(HIST("h2d_n2_etaphi_LaP_LaM"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } else if (lambda.v0Type() == kLambda && track.v0Type() == kLambda) { + histos.fill(HIST("h2d_n2_etaphi_LaP_LaP"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } else if (lambda.v0Type() == kAntiLambda && track.v0Type() == kAntiLambda) { + histos.fill(HIST("h2d_n2_etaphi_LaM_LaM"), lambda.eta() - track.eta(), RecoDecay::constrainAngle((lambda.phi() - track.phi()), -PIHalf)); + } + + // decision based on mass closest to PdgMass of Lambda + if (std::abs(lambda.mass() - MassLambda0) > std::abs(track.mass() - MassLambda0)) { + lambdaMinDeltaMassFlag = false; + } + + // decisions based on t-score + tTrack = (cA * std::abs(track.mass() - MassLambda0)) + (cB * track.dcaDau()) + (cC * std::abs(track.cosPA() - 1.)); + if (tLambda > tTrack) { + lambdaMinTScoreFlag = false; + } + } + } + + // fill QA histograms + if (lambdaSharingDauFlag) { + fillHistos(lambda); + } else { + fillHistos(lambda); + } + + if (cAcceptAllLambda) { // Accept all lambda + trueLambdaFlag = true; + } else if (cRejAllLambdaShaDau && !lambdaSharingDauFlag) { // Reject all lambda sharing daughter + trueLambdaFlag = true; + } else if (cSelLambdaMassPdg && lambdaMinDeltaMassFlag) { // Select lambda closest to pdg mass + trueLambdaFlag = true; + } else if (cSelLambdaTScore && lambdaMinTScoreFlag) { // Select lambda based on t-score + trueLambdaFlag = true; + } + + // Multiplicity of selected lambda + if (trueLambdaFlag) { + if (lambda.v0Type() == kLambda) { + ++nSelLambda; + } else if (lambda.v0Type() == kAntiLambda) { + ++nSelAntiLambda; + } + } + + // fill LambdaTrackExt table + lambdaTrackExtTable(lambdaSharingDauFlag, vSharedDauLambdaIndex, trueLambdaFlag); + } + + // fill multiplicity histograms + if (nTotLambda != 0) { + histos.fill(HIST("h1i_totlambda_mult"), nTotLambda); + } + + if (nTotAntiLambda != 0) { + histos.fill(HIST("h1i_totantilambda_mult"), nTotAntiLambda); + } + + if (nSelLambda != 0) { + histos.fill(HIST("h1i_lambda_mult"), nSelLambda); + } + + if (nSelAntiLambda != 0) { + histos.fill(HIST("h1i_antilambda_mult"), nSelAntiLambda); + } + } +}; + +struct LambdaR2Correlation { + // Global Configurables + Configurable cNPtBins{"cNPtBins", 34, "N pT Bins"}; + Configurable cMinPt{"cMinPt", 0.8, "pT Min"}; + Configurable cMaxPt{"cMaxPt", 4.2, "pT Max"}; + Configurable cNRapBins{"cNRapBins", 20, "N Rapidity Bins"}; + Configurable cMinRap{"cMinRap", -0.5, "Minimum Rapidity"}; + Configurable cMaxRap{"cMaxRap", 0.5, "Maximum Rapidity"}; + Configurable cNPhiBins{"cNPhiBins", 36, "N Phi Bins"}; + Configurable cAnaSecondaries{"cAnaSecondaries", false, "Analysze Secondaries"}; + Configurable cAnaPairs{"cAnaPairs", false, "Analyze Pairs Flag"}; + Configurable cAnaSecondaryPairs{"cAnaSecondaryPairs", false, "Analyze Secondary Pairs Flag"}; + + // Eta/Rap Analysis + Configurable cDoEtaAnalysis{"cDoEtaAnalysis", false, "Eta/Rap Analysis Flag"}; + + // Centrality Axis + ConfigurableAxis cMultBins{"cMultBins", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.f, 80.0f, 100.f}, "Variable Mult-Bins"}; + + // Histogram Registry. + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Initialize global variables + float nrapbins = 0.; + float kminrap = 0.; + float kmaxrap = 0.; + float nphibins = 0.; + float kminphi = 0.; + float kmaxphi = TwoPI; + float rapbinwidth = 0.; + float phibinwidth = 0.; + float q = 0., e = 0., qinv = 0.; + float cent = 0.; + + void init(InitContext const&) + { + // Set Density Histogram Attributes + nrapbins = static_cast(cNRapBins); + kminrap = static_cast(cMinRap); + kmaxrap = static_cast(cMaxRap); + nphibins = static_cast(cNPhiBins); + + rapbinwidth = (kmaxrap - kminrap) / nrapbins; + phibinwidth = (kmaxphi - kminphi) / nphibins; + + int knrapphibins = static_cast(cNRapBins) * static_cast(cNPhiBins); + float kminrapphi = 0.; + float kmaxrapphi = knrapphibins; + + const AxisSpec axisCheck(1, 0, 1, ""); + const AxisSpec axisPosZ(220, -11, 11, "V_{z} (cm)"); + const AxisSpec axisCent(cMultBins, "FT0M (%)"); + const AxisSpec axisChMult(200, 0, 200, "N_{ch}"); + const AxisSpec axisMult(10, 0, 10, "N_{#Lambda}"); + const AxisSpec axisMass(100, 1.06, 1.16, "M_{#Lambda} (GeV/#it{c}^{2})"); + const AxisSpec axisPt(cNPtBins, cMinPt, cMaxPt, "p_{T} (GeV/#it{c})"); + const AxisSpec axisEta(cNRapBins, cMinRap, cMaxRap, "#eta"); + const AxisSpec axisRap(cNRapBins, cMinRap, cMaxRap, "y"); + const AxisSpec axisPhi(cNPhiBins, 0., TwoPI, "#varphi (rad)"); + const AxisSpec axisRapPhi(knrapphibins, kminrapphi, kmaxrapphi, "y #varphi"); + const AxisSpec axisQinv(100, 0, 10, "q_{inv} (GeV/#it{c})"); + + // Create Histograms. + // Event + histos.add("Event/Reco/h1f_collision_posz", "V_{Z} Distribution", kTH1F, {axisPosZ}); + histos.add("Event/Reco/h1f_ft0m_mult_percentile", "FT0M (%)", kTH1F, {axisCent}); + histos.add("Event/Reco/h2f_Mult_vs_Centrality", "N_{ch} vs FT0M(%)", kTH2F, {axisCent, axisChMult}); + histos.add("Event/Reco/h2f_lambda_mult", "#Lambda - Multiplicity", kTH2F, {axisCent, axisMult}); + histos.add("Event/Reco/h2f_antilambda_mult", "#bar{#Lambda} - Multiplicity", kTH2F, {axisCent, axisMult}); + + // Efficiency Histograms + // Single Particle Efficiencies + histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/Efficiency/h2f_n1_centpt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centpteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisRap}); + histos.add("Reco/Primary/Efficiency/h3f_n1_centptrap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisRap}); + + // Single and Two Particle Densities + // 1D Histograms + histos.add("Reco/Primary/h3f_n1_centmasspt_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisMass, axisPt}); + histos.add("Reco/Primary/h3f_n1_centmasspt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisMass, axisPt}); + histos.add("Reco/Primary/h2f_n1_pt_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/h2f_n1_pt_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPt}); + histos.add("Reco/Primary/h2f_n1_eta_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisEta}); + histos.add("Reco/Primary/h2f_n1_eta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisEta}); + histos.add("Reco/Primary/h2f_n1_rap_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisRap}); + histos.add("Reco/Primary/h2f_n1_rap_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisRap}); + histos.add("Reco/Primary/h2f_n1_phi_LaP", "#rho_{1}^{#Lambda}", kTH2F, {axisCent, axisPhi}); + histos.add("Reco/Primary/h2f_n1_phi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH2F, {axisCent, axisPhi}); + + // rho1 for R2 RapPhi + histos.add("Reco/Primary/h3f_n1_rapphi_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisRap, axisPhi}); + histos.add("Reco/Primary/h3f_n1_rapphi_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisPhi}); + + // rho1 for Q_{inv} + histos.add("Reco/Primary/h3f_n1_pteta_LaP", "#rho_{1}^{#Lambda}", kTH3F, {axisCent, axisPt, axisEta}); + histos.add("Reco/Primary/h3f_n1_pteta_LaM", "#rho_{1}^{#bar{#Lambda}}", kTH3F, {axisCent, axisPt, axisEta}); + + // Clone Singles Primary/Secondary Histogram + if (cAnaSecondaries) { + histos.addClone("Reco/Primary/", "Reco/Secondary/"); + } + + if (cAnaPairs) { + // rho2 for numerator of R2 + histos.add("Reco/PP/h3f_n2_raprap_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisRap}); + histos.add("Reco/PP/h3f_n2_raprap_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH3F, {axisCent, axisRap, axisRap}); + histos.add("Reco/PP/h3f_n2_raprap_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisRap, axisRap}); + histos.add("Reco/PP/h3f_n2_phiphi_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH3F, {axisCent, axisPhi, axisPhi}); + histos.add("Reco/PP/h3f_n2_phiphi_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH3F, {axisCent, axisPhi, axisPhi}); + histos.add("Reco/PP/h3f_n2_phiphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisPhi, axisPhi}); + + // rho2 for R2 Rap1Phi1Rap2Phi2 + histos.add("Reco/PP/h3f_n2_rapphi_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); + histos.add("Reco/PP/h3f_n2_rapphi_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); + histos.add("Reco/PP/h3f_n2_rapphi_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH3F, {axisCent, axisRapPhi, axisRapPhi}); + + // rho2 for R2 Qinv + histos.add("Reco/PP/h2f_n2_qinv_LaP_LaM", "#rho_{2}^{#Lambda#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); + histos.add("Reco/PP/h2f_n2_qinv_LaP_LaP", "#rho_{2}^{#Lambda#Lambda}", kTH2F, {axisCent, axisQinv}); + histos.add("Reco/PP/h2f_n2_qinv_LaM_LaM", "#rho_{2}^{#bar{#Lambda}#bar{#Lambda}}", kTH2F, {axisCent, axisQinv}); + + // Clone Pairs Histograms + if (cAnaSecondaryPairs) { + histos.addClone("Reco/PP/", "Reco/PS/"); + histos.addClone("Reco/PP/", "Reco/SP/"); + histos.addClone("Reco/PP/", "Reco/SS/"); + } + } + + // MCGen + if (doprocessMCGen) { + histos.addClone("Event/Reco/", "Event/McGen/"); + histos.addClone("Reco/", "McGen/"); + } + } + + template + void fillPairHistos(U& p1, U& p2) + { + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirPrmScd[] = {"PP/", "PS/", "SP/", "SS/"}; + static constexpr std::string_view SubDirHist[] = {"LaP_LaM", "LaP_LaP", "LaM_LaM"}; + + float rap1 = (cDoEtaAnalysis) ? p1.eta() : p1.rap(); + float rap2 = (cDoEtaAnalysis) ? p2.eta() : p2.rap(); + + int rapbin1 = static_cast((rap1 - kminrap) / rapbinwidth); + int rapbin2 = static_cast((rap2 - kminrap) / rapbinwidth); + + int phibin1 = static_cast(p1.phi() / phibinwidth); + int phibin2 = static_cast(p2.phi() / phibinwidth); + + float corfac = p1.corrFact() * p2.corrFact(); + + // fill rho2 histograms + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_raprap_") + HIST(SubDirHist[part_pair]), cent, rap1, rap2, corfac); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_phiphi_") + HIST(SubDirHist[part_pair]), cent, p1.phi(), p2.phi(), corfac); + + if (rapbin1 >= 0 && rapbin2 >= 0 && phibin1 >= 0 && phibin2 >= 0 && rapbin1 < nrapbins && rapbin2 < nrapbins && phibin1 < nphibins && phibin2 < nphibins) { + + int rapphix = rapbin1 * nphibins + phibin1; + int rapphiy = rapbin2 * nphibins + phibin2; + + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h3f_n2_rapphi_") + HIST(SubDirHist[part_pair]), cent, rapphix + 0.5, rapphiy + 0.5, corfac); + } + + // qinv histograms + q = RecoDecay::p((p1.px() - p2.px()), (p1.py() - p2.py()), (p1.pz() - p2.pz())); + e = RecoDecay::e(p1.px(), p1.py(), p1.pz(), MassLambda0) - RecoDecay::e(p2.px(), p2.py(), p2.pz(), MassLambda0); + qinv = std::sqrt(-RecoDecay::m2(q, e)); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[psp]) + HIST("h2f_n2_qinv_") + HIST(SubDirHist[part_pair]), cent, qinv, corfac); + } + + template + void analyzeSingles(T const& tracks) + { + static constexpr std::string_view SubDirRecGen[] = {"Reco/", "McGen/"}; + static constexpr std::string_view SubDirPrmScd[] = {"Primary/", "Secondary/"}; + static constexpr std::string_view SubDirHist[] = {"LaP", "LaM"}; + + int ntrk = 0; + + for (auto const& track : tracks) { + // count tracks + ++ntrk; + + // Efficiency Plots + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h2f_n1_centpt_") + HIST(SubDirHist[part]), cent, track.pt()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centpteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("Efficiency/h3f_n1_centptrap_") + HIST(SubDirHist[part]), cent, track.pt(), track.rap()); + + // QA Plots + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_centmasspt_") + HIST(SubDirHist[part]), cent, track.mass(), track.pt()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_pt_") + HIST(SubDirHist[part]), cent, track.pt(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_eta_") + HIST(SubDirHist[part]), cent, track.eta(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_phi_") + HIST(SubDirHist[part]), cent, track.phi(), track.corrFact()); + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h2f_n1_rap_") + HIST(SubDirHist[part]), cent, track.rap(), track.corrFact()); + + // Rho1 for N1RapPhi + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_rapphi_") + HIST(SubDirHist[part]), cent, track.rap(), track.phi(), track.corrFact()); + + // Rho1 for Q_{inv} Bkg Estimation + histos.fill(HIST(SubDirRecGen[rec_gen]) + HIST(SubDirPrmScd[pst]) + HIST("h3f_n1_pteta_") + HIST(SubDirHist[part]), cent, track.pt(), track.eta(), track.corrFact()); + } + + // fill multiplicity histograms + if (ntrk != 0) { + if (part == kLambda) { + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h2f_lambda_mult"), cent, ntrk); + } else { + histos.fill(HIST("Event/") + HIST(SubDirRecGen[rec_gen]) + HIST("h2f_antilambda_mult"), cent, ntrk); + } + } + } + + template + void analyzePairs(T const& trks_1, T const& trks_2) + { + for (auto const& trk_1 : trks_1) { + for (auto const& trk_2 : trks_2) { + // check for same index for Lambda-Lambda / AntiLambda-AntiLambda + if (samelambda && ((trk_1.index() == trk_2.index()))) { + continue; + } + fillPairHistos(trk_1, trk_2); + } + } + } + + using LambdaCollisions = aod::LambdaCollisions; + using LambdaTracks = soa::Join; + + // using MyCascades = aod::CascDataExt; // ← NOT CascDatas. NEVER CascDatas. + using MyCascades = soa::Filtered; + + SliceCache cache; + Partition partPrimLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partPrimAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partSecdLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + Partition partSecdAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrackext::trueLambdaFlag == true) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + + void processDataReco(LambdaCollisions::iterator const& collision, LambdaTracks const&) + { + histos.fill(HIST("Event/Reco/h1f_collision_posz"), collision.posZ()); + histos.fill(HIST("Event/Reco/h1f_ft0m_mult_percentile"), collision.cent()); + histos.fill(HIST("Event/Reco/h2f_Mult_vs_Centrality"), collision.cent(), collision.mult()); + + cent = collision.cent(); + + auto lambdaPrimTracks = partPrimLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto antiLambdaPrimTracks = partPrimAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto lambdaSecdTracks = partSecdLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + auto antiLambdaSecdTracks = partSecdAntiLambdaTracks->sliceByCached(aod::lambdatrack::lambdaCollisionId, collision.globalIndex(), cache); + + analyzeSingles(lambdaPrimTracks); + analyzeSingles(antiLambdaPrimTracks); + + if (cAnaSecondaries) { + analyzeSingles(lambdaSecdTracks); + analyzeSingles(antiLambdaSecdTracks); + } + + if (cAnaPairs) { + // Primary Pairs Only + analyzePairs(lambdaPrimTracks, antiLambdaPrimTracks); + analyzePairs(lambdaPrimTracks, lambdaPrimTracks); + analyzePairs(antiLambdaPrimTracks, antiLambdaPrimTracks); + + // Secondary Pairs + if (cAnaSecondaryPairs) { + analyzePairs(lambdaPrimTracks, antiLambdaSecdTracks); + analyzePairs(lambdaPrimTracks, lambdaSecdTracks); + analyzePairs(antiLambdaPrimTracks, antiLambdaSecdTracks); + analyzePairs(lambdaSecdTracks, antiLambdaPrimTracks); + analyzePairs(lambdaSecdTracks, lambdaPrimTracks); + analyzePairs(antiLambdaSecdTracks, antiLambdaPrimTracks); + analyzePairs(lambdaSecdTracks, antiLambdaSecdTracks); + analyzePairs(lambdaSecdTracks, lambdaSecdTracks); + analyzePairs(antiLambdaSecdTracks, antiLambdaSecdTracks); + } + } + } + + PROCESS_SWITCH(LambdaR2Correlation, processDataReco, "Process for Data and MCReco", true); + + using LambdaMcGenCollisions = aod::LambdaMcGenCollisions; + using LambdaMcGenTracks = aod::LambdaMcGenTracks; + + SliceCache cachemc; + Partition partMcPrimLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partMcPrimAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrack::v0PrmScd == (int8_t)kPrimary); + Partition partMcSecdLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kLambda) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + Partition partMcSecdAntiLambdaTracks = (aod::lambdatrack::v0Type == (int8_t)kAntiLambda) && (aod::lambdatrack::v0PrmScd == (int8_t)kSecondary); + + void processMCGen(LambdaMcGenCollisions::iterator const& mcgencol, LambdaMcGenTracks const&) + { + histos.fill(HIST("Event/McGen/h1f_collision_posz"), mcgencol.posZ()); + histos.fill(HIST("Event/McGen/h1f_ft0m_mult_percentile"), mcgencol.cent()); + histos.fill(HIST("Event/McGen/h2f_Mult_vs_Centrality"), mcgencol.cent(), mcgencol.mult()); + + cent = mcgencol.cent(); + + auto lambdaPrimTracks = partMcPrimLambdaTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto antiLambdaPrimTracks = partMcPrimAntiLambdaTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto lambdaSecdTracks = partMcSecdLambdaTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + auto antiLambdaSecdTracks = partMcSecdAntiLambdaTracks->sliceByCached(aod::lambdamcgentrack::lambdaMcGenCollisionId, mcgencol.globalIndex(), cachemc); + + analyzeSingles(lambdaPrimTracks); + analyzeSingles(antiLambdaPrimTracks); + + if (cAnaSecondaries) { + analyzeSingles(lambdaSecdTracks); + analyzeSingles(antiLambdaSecdTracks); + } + + if (cAnaPairs) { + // Primary Pairs Only + analyzePairs(lambdaPrimTracks, antiLambdaPrimTracks); + analyzePairs(lambdaPrimTracks, lambdaPrimTracks); + analyzePairs(antiLambdaPrimTracks, antiLambdaPrimTracks); + + // Secondary Pairs + if (cAnaSecondaryPairs) { + analyzePairs(lambdaPrimTracks, antiLambdaSecdTracks); + analyzePairs(lambdaPrimTracks, lambdaSecdTracks); + analyzePairs(antiLambdaPrimTracks, antiLambdaSecdTracks); + analyzePairs(lambdaSecdTracks, antiLambdaPrimTracks); + analyzePairs(lambdaSecdTracks, lambdaPrimTracks); + analyzePairs(antiLambdaSecdTracks, antiLambdaPrimTracks); + analyzePairs(lambdaSecdTracks, antiLambdaSecdTracks); + analyzePairs(lambdaSecdTracks, lambdaSecdTracks); + analyzePairs(antiLambdaSecdTracks, antiLambdaSecdTracks); + } + } + } + + PROCESS_SWITCH(LambdaR2Correlation, processMCGen, "Process for MC Generated", false); +}; + +struct CascadeSelector { + + Service ccdb; + Service pdgDB; + + Produces cascflags; + + // Configurables + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "CCDB url"}; + Configurable useTrigger{"useTrigger", false, "Use trigger selection on skimmed data"}; + Configurable triggerList{"triggerList", "fDoubleXi, fDoubleOmega, fOmegaXi", "List of triggers used to select events"}; + Configurable doTFBorderCut{"doTFBorderCut", true, "Switch to apply TimeframeBorderCut event selection"}; + Configurable doSel8{"doSel8", true, "Switch to apply sel8 event selection"}; + Configurable doNoSameBunchPileUp{"doNoSameBunchPileUp", true, "Switch to apply NoSameBunchPileUp event selection"}; + Configurable INEL{"INEL", 0, "Number of charged tracks within |eta| < 1 has to be greater than value"}; + Configurable maxVertexZ{"maxVertexZ", 10., "Maximum value of z coordinate of PV"}; + Configurable etaCascades{"etaCascades", 0.8, "min/max of eta for cascades"}; + Configurable doCompetingMassCut{"doCompetingMassCut", true, "Switch to apply a competing mass cut for the Omega's"}; + Configurable competingMassWindow{"competingMassWindow", 0.01, "Mass window for the competing mass cut"}; + + // Tracklevel + Configurable tpcNsigmaBachelor{"tpcNsigmaBachelor", 3, "TPC NSigma bachelor"}; + Configurable tpcNsigmaProton{"tpcNsigmaProton", 3, "TPC NSigma proton <- lambda"}; + Configurable tpcNsigmaPion{"tpcNsigmaPion", 3, "TPC NSigma pion <- lambda"}; + Configurable minTPCCrossedRows{"minTPCCrossedRows", 80, "min N TPC crossed rows"}; // TODO: finetune! 80 > 159/2, so no split tracks? + Configurable minITSClusters{"minITSClusters", 4, "minimum number of ITS clusters"}; + Configurable etaTracks{"etaTracks", 1.0, "min/max of eta for tracks"}; + Configurable tpcChi2{"tpcChi2", 4, "TPC Chi2"}; + Configurable itsChi2{"itsChi2", 36, "ITS Chi2"}; + + // Selection criteria - compatible with core wagon autodetect - copied from cascadeanalysis.cxx + //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* + Configurable v0setting_cospa{"v0setting_cospa", 0.995, "v0setting_cospa"}; + Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1.0, "v0setting_dcav0dau"}; + Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.1, "v0setting_dcapostopv"}; + Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.1, "v0setting_dcanegtopv"}; + Configurable v0setting_radius{"v0setting_radius", 0.9, "v0setting_radius"}; + Configurable cascadesetting_cospa{"cascadesetting_cospa", 0.95, "cascadesetting_cospa"}; + Configurable cascadesetting_dcacascdau{"cascadesetting_dcacascdau", 1.0, "cascadesetting_dcacascdau"}; + Configurable cascadesetting_dcabachtopv{"cascadesetting_dcabachtopv", 0.05, "cascadesetting_dcabachtopv"}; + Configurable cascadesetting_cascradius{"cascadesetting_cascradius", 0.9, "cascadesetting_cascradius"}; + Configurable cascadesetting_v0masswindow{"cascadesetting_v0masswindow", 0.01, "cascadesetting_v0masswindow"}; + Configurable cascadesetting_mindcav0topv{"cascadesetting_mindcav0topv", 0.01, "cascadesetting_mindcav0topv"}; + //*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+*+-+* + + // TODO: variables as function of Omega mass, only do Xi for now + ConfigurableAxis radiusAxis = {"radiusAxis", {100, 0.0f, 50.0f}, "cm"}; + ConfigurableAxis cpaAxis = {"cpaAxis", {100, 0.95f, 1.0f}, "CPA"}; + ConfigurableAxis vertexAxis = {"vertexAxis", {100, -10.0f, 10.0f}, "cm"}; + ConfigurableAxis dcaAxis = {"dcaAxis", {100, 0.0f, 2.0f}, "cm"}; + ConfigurableAxis invXiMassAxis = {"invXiMassAxis", {100, 1.28f, 1.38f}, "Inv. Mass (GeV/c^{2})"}; + ConfigurableAxis invOmegaMassAxis = {"invOmegaMassAxis", {100, 1.62f, 1.72f}, "Inv. Mass (GeV/c^{2})"}; + ConfigurableAxis ptAxis = {"ptAxis", {150, 0, 15}, "#it{p}_{T}"}; + ConfigurableAxis rapidityAxis{"rapidityAxis", {100, -1.f, 1.f}, "y"}; + ConfigurableAxis invLambdaMassAxis{"invLambdaMassAxis", {100, 1.07f, 1.17f}, "Inv. Mass (GeV/c^{2})"}; + AxisSpec itsClustersAxis{8, -0.5, 7.5, "number of ITS clusters"}; + AxisSpec tpcRowsAxis{160, -0.5, 159.5, "TPC crossed rows"}; + HistogramRegistry registry{ + "registry", + { + // basic selection variables + {"hV0Radius", "hV0Radius", {HistType::kTH3F, {radiusAxis, invXiMassAxis, ptAxis}}}, + {"hCascRadius", "hCascRadius", {HistType::kTH3F, {radiusAxis, invXiMassAxis, ptAxis}}}, + {"hV0CosPA", "hV0CosPA", {HistType::kTH3F, {cpaAxis, invXiMassAxis, ptAxis}}}, + {"hCascCosPA", "hCascCosPA", {HistType::kTH3F, {cpaAxis, invXiMassAxis, ptAxis}}}, + {"hDCAPosToPV", "hDCAPosToPV", {HistType::kTH3F, {vertexAxis, invXiMassAxis, ptAxis}}}, + {"hDCANegToPV", "hDCANegToPV", {HistType::kTH3F, {vertexAxis, invXiMassAxis, ptAxis}}}, + {"hDCABachToPV", "hDCABachToPV", {HistType::kTH3F, {vertexAxis, invXiMassAxis, ptAxis}}}, + {"hDCAV0ToPV", "hDCAV0ToPV", {HistType::kTH3F, {vertexAxis, invXiMassAxis, ptAxis}}}, + {"hDCAV0Dau", "hDCAV0Dau", {HistType::kTH3F, {dcaAxis, invXiMassAxis, ptAxis}}}, + {"hDCACascDau", "hDCACascDau", {HistType::kTH3F, {dcaAxis, invXiMassAxis, ptAxis}}}, + {"hLambdaMass", "hLambdaMass", {HistType::kTH3F, {invLambdaMassAxis, invXiMassAxis, ptAxis}}}, + + {"hMassXiMinus", "hMassXiMinus", {HistType::kTH3F, {invXiMassAxis, ptAxis, rapidityAxis}}}, + {"hMassXiPlus", "hMassXiPlus", {HistType::kTH3F, {invXiMassAxis, ptAxis, rapidityAxis}}}, + {"hMassOmegaMinus", "hMassOmegaMinus", {HistType::kTH3F, {invOmegaMassAxis, ptAxis, rapidityAxis}}}, + {"hMassOmegaPlus", "hMassOmegaPlus", {HistType::kTH3F, {invOmegaMassAxis, ptAxis, rapidityAxis}}}, + + // // invariant mass per cut, start with Xi + // {"hMassXi0", "Xi inv mass before selections", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi1", "Xi inv mass after TPCnCrossedRows cut", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi2", "Xi inv mass after ITSnClusters cut", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi3", "Xi inv mass after topo cuts", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi4", "Xi inv mass after V0 daughters PID cut", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + // {"hMassXi5", "Xi inv mass after bachelor PID cut", {HistType::kTH2F, {invMassAxis, ptAxis}}}, + + // ITS & TPC clusters, with Xi inv mass + {"hTPCnCrossedRowsPos", "hTPCnCrossedRowsPos", {HistType::kTH3F, {tpcRowsAxis, invXiMassAxis, ptAxis}}}, + {"hTPCnCrossedRowsNeg", "hTPCnCrossedRowsNeg", {HistType::kTH3F, {tpcRowsAxis, invXiMassAxis, ptAxis}}}, + {"hTPCnCrossedRowsBach", "hTPCnCrossedRowsBach", {HistType::kTH3F, {tpcRowsAxis, invXiMassAxis, ptAxis}}}, + {"hITSnClustersPos", "hITSnClustersPos", {HistType::kTH3F, {itsClustersAxis, invXiMassAxis, ptAxis}}}, + {"hITSnClustersNeg", "hITSnClustersNeg", {HistType::kTH3F, {itsClustersAxis, invXiMassAxis, ptAxis}}}, + {"hITSnClustersBach", "hITSnClustersBach", {HistType::kTH3F, {itsClustersAxis, invXiMassAxis, ptAxis}}}, + {"hTPCChi2Pos", "hTPCChi2Pos", {HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Pos"}}}}, + {"hTPCChi2Neg", "hTPCChi2Neg", {HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Neg"}}}}, + {"hTPCChi2Bach", "hTPCChi2Bach", {HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Bach"}}}}, + {"hITSChi2Pos", "hITSChi2Pos", {HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Pos"}}}}, + {"hITSChi2Neg", "hITSChi2Neg", {HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Neg"}}}}, + {"hITSChi2Bach", "hITSChi2Bach", {HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Bach"}}}}, + + {"hTriggerQA", "hTriggerQA", {HistType::kTH1F, {{2, -0.5, 1.5, "Trigger y/n"}}}}, + }, + }; + + // Keep track of which selections the candidates pass + void init(InitContext const&) + { + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + + auto h = registry.add("hSelectionStatus", "hSelectionStatus", HistType::kTH1I, {{10, 0, 10, "status"}}); + h->GetXaxis()->SetBinLabel(1, "All"); + h->GetXaxis()->SetBinLabel(2, "nTPC OK"); + h->GetXaxis()->SetBinLabel(3, "nITS OK"); + h->GetXaxis()->SetBinLabel(4, "track Chi2 OK"); + h->GetXaxis()->SetBinLabel(5, "Topo OK"); + h->GetXaxis()->SetBinLabel(6, "Track eta OK"); + h->GetXaxis()->SetBinLabel(7, "Cascade eta OK"); + h->GetXaxis()->SetBinLabel(8, "V0 PID OK"); + h->GetXaxis()->SetBinLabel(9, "Bach PID OK"); + + auto hEventSel = registry.add("hEventSel", "hEventSel", HistType::kTH1I, {{10, 0, 10, "selection criteria"}}); + hEventSel->GetXaxis()->SetBinLabel(1, "All"); + hEventSel->GetXaxis()->SetBinLabel(2, "sel8"); + hEventSel->GetXaxis()->SetBinLabel(3, "INEL0"); + hEventSel->GetXaxis()->SetBinLabel(4, "V_z"); + hEventSel->GetXaxis()->SetBinLabel(5, "NoSameBunchPileUp"); + hEventSel->GetXaxis()->SetBinLabel(6, "Selected events"); + + if (doprocessRecMC) { + // only create the rec matched to gen histograms if relevant + registry.add("truerec/hV0Radius", "hV0Radius", HistType::kTH1F, {radiusAxis}); + registry.add("truerec/hCascRadius", "hCascRadius", HistType::kTH1F, {radiusAxis}); + registry.add("truerec/hV0CosPA", "hV0CosPA", HistType::kTH1F, {cpaAxis}); + registry.add("truerec/hCascCosPA", "hCascCosPA", HistType::kTH1F, {cpaAxis}); + registry.add("truerec/hDCAPosToPV", "hDCAPosToPV", HistType::kTH1F, {vertexAxis}); + registry.add("truerec/hDCANegToPV", "hDCANegToPV", HistType::kTH1F, {vertexAxis}); + registry.add("truerec/hDCABachToPV", "hDCABachToPV", HistType::kTH1F, {vertexAxis}); + registry.add("truerec/hDCAV0ToPV", "hDCAV0ToPV", HistType::kTH1F, {vertexAxis}); + registry.add("truerec/hDCAV0Dau", "hDCAV0Dau", HistType::kTH1F, {dcaAxis}); + registry.add("truerec/hDCACascDau", "hDCACascDau", HistType::kTH1F, {dcaAxis}); + registry.add("truerec/hLambdaMass", "hLambdaMass", HistType::kTH1F, {invLambdaMassAxis}); + registry.add("truerec/hTPCnCrossedRowsPos", "hTPCnCrossedRowsPos", HistType::kTH1F, {tpcRowsAxis}); + registry.add("truerec/hTPCnCrossedRowsNeg", "hTPCnCrossedRowsNeg", HistType::kTH1F, {tpcRowsAxis}); + registry.add("truerec/hTPCnCrossedRowsBach", "hTPCnCrossedRowsBach", HistType::kTH1F, {tpcRowsAxis}); + registry.add("truerec/hITSnClustersPos", "hITSnClustersPos", HistType::kTH1F, {itsClustersAxis}); + registry.add("truerec/hITSnClustersNeg", "hITSnClustersNeg", HistType::kTH1F, {itsClustersAxis}); + registry.add("truerec/hITSnClustersBach", "hITSnClustersBach", HistType::kTH1F, {itsClustersAxis}); + registry.add("truerec/hTPCChi2Pos", "hTPCChi2Pos", HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Pos"}}); + registry.add("truerec/hTPCChi2Neg", "hTPCChi2Neg", HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Neg"}}); + registry.add("truerec/hTPCChi2Bach", "hTPCChi2Bach", HistType::kTH1F, {{100, 0, 10, "TPC Chi2 Bach"}}); + registry.add("truerec/hITSChi2Pos", "hITSChi2Pos", HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Pos"}}); + registry.add("truerec/hITSChi2Neg", "hITSChi2Neg", HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Neg"}}); + registry.add("truerec/hITSChi2Bach", "hITSChi2Bach", HistType::kTH1F, {{100, 0, 100, "ITS Chi2 Bach"}}); + registry.add("truerec/hXiMinus", "hXiMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("truerec/hXiPlus", "hXiPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("truerec/hOmegaMinus", "hOmegaMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("truerec/hOmegaPlus", "hOmegaPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + } + + if (doprocessGenMC) { + // only create the MC gen histograms if relevant + registry.add("gen/hXiMinus", "hXiMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("gen/hXiPlus", "hXiPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("gen/hOmegaMinus", "hOmegaMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("gen/hOmegaPlus", "hOmegaPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + + registry.add("genwithrec/hXiMinus", "hXiMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("genwithrec/hXiPlus", "hXiPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("genwithrec/hOmegaMinus", "hOmegaMinus", HistType::kTH2F, {ptAxis, rapidityAxis}); + registry.add("genwithrec/hOmegaPlus", "hOmegaPlus", HistType::kTH2F, {ptAxis, rapidityAxis}); + + registry.add("genwithrec/hNevents", "hNevents", HistType::kTH1F, {{1, 0, 1, "N generated events with reconstructed event"}}); + registry.add("gen/hNevents", "hNevents", HistType::kTH1F, {{1, 0, 1, "N generated events"}}); + } + } + + template + bool eventSelection(TCollision const& collision, bool fillHistos) + { + + if (fillHistos) + registry.fill(HIST("hEventSel"), 0); + if (doSel8 && !collision.sel8()) { + if (fillHistos) + registry.fill(HIST("hEventSel"), 1); + return false; + } else if (collision.multNTracksPVeta1() <= INEL) { + if (fillHistos) + registry.fill(HIST("hEventSel"), 2); + return false; + } else if (std::abs(collision.posZ()) > maxVertexZ) { + if (fillHistos) + registry.fill(HIST("hEventSel"), 3); + return false; + } else if (doNoSameBunchPileUp && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { + if (fillHistos) + registry.fill(HIST("hEventSel"), 4); + return false; + } + // passes all selections + if (fillHistos) + registry.fill(HIST("hEventSel"), 5); + return true; + } + + template + void fillMatchedHistos(LabeledCascades::iterator rec, int flag, TCollision collision) + { + if (flag == 0) + return; + if (!rec.has_mcParticle()) + return; + auto gen = rec.mcParticle(); + if (!gen.isPhysicalPrimary()) + return; + int genpdg = gen.pdgCode(); + if ((flag < 3 && std::abs(genpdg) == 3312) || (flag > 1 && std::abs(genpdg) == 3334)) { + // if casc is consistent with Xi and has matched gen Xi OR cand is consistent with Omega and has matched gen omega + // have to do this in case we reco true Xi with only Omega hypothesis (or vice versa) (very unlikely) + registry.fill(HIST("truerec/hV0Radius"), rec.v0radius()); + registry.fill(HIST("truerec/hCascRadius"), rec.cascradius()); + registry.fill(HIST("truerec/hV0CosPA"), rec.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("truerec/hCascCosPA"), rec.casccosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("truerec/hDCAPosToPV"), rec.dcapostopv()); + registry.fill(HIST("truerec/hDCANegToPV"), rec.dcanegtopv()); + registry.fill(HIST("truerec/hDCABachToPV"), rec.dcabachtopv()); + registry.fill(HIST("truerec/hDCAV0ToPV"), rec.dcav0topv(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("truerec/hDCAV0Dau"), rec.dcaV0daughters()); + registry.fill(HIST("truerec/hDCACascDau"), rec.dcacascdaughters()); + registry.fill(HIST("truerec/hLambdaMass"), rec.mLambda()); + registry.fill(HIST("truerec/hITSnClustersPos"), rec.posTrack_as().itsNCls()); + registry.fill(HIST("truerec/hITSnClustersNeg"), rec.negTrack_as().itsNCls()); + registry.fill(HIST("truerec/hITSnClustersBach"), rec.bachelor_as().itsNCls()); + registry.fill(HIST("truerec/hTPCnCrossedRowsPos"), rec.posTrack_as().tpcNClsCrossedRows()); + registry.fill(HIST("truerec/hTPCnCrossedRowsNeg"), rec.negTrack_as().tpcNClsCrossedRows()); + registry.fill(HIST("truerec/hTPCnCrossedRowsBach"), rec.bachelor_as().tpcNClsCrossedRows()); + registry.fill(HIST("truerec/hITSChi2Pos"), rec.posTrack_as().itsChi2NCl()); + registry.fill(HIST("truerec/hITSChi2Neg"), rec.negTrack_as().itsChi2NCl()); + registry.fill(HIST("truerec/hITSChi2Bach"), rec.bachelor_as().itsChi2NCl()); + registry.fill(HIST("truerec/hTPCChi2Pos"), rec.posTrack_as().tpcChi2NCl()); + registry.fill(HIST("truerec/hTPCChi2Neg"), rec.negTrack_as().tpcChi2NCl()); + registry.fill(HIST("truerec/hTPCChi2Bach"), rec.bachelor_as().tpcChi2NCl()); + switch (genpdg) { // is matched so we can use genpdg + case 3312: + registry.fill(HIST("truerec/hXiMinus"), rec.pt(), rec.yXi()); + break; + case -3312: + registry.fill(HIST("truerec/hXiPlus"), rec.pt(), rec.yXi()); + break; + case 3334: + registry.fill(HIST("truerec/hOmegaMinus"), rec.pt(), rec.yOmega()); + break; + case -3334: + registry.fill(HIST("truerec/hOmegaPlus"), rec.pt(), rec.yOmega()); + break; + } + } + } + + template + int processCandidate(TCascade const& casc, TCollision const& collision) + { + // these are the tracks: + auto bachTrack = casc.template bachelor_as(); + auto posTrack = casc.template posTrack_as(); + auto negTrack = casc.template negTrack_as(); + + // topo variables before cuts: + registry.fill(HIST("hV0Radius"), casc.v0radius(), casc.mXi(), casc.pt()); + registry.fill(HIST("hCascRadius"), casc.cascradius(), casc.mXi(), casc.pt()); + registry.fill(HIST("hV0CosPA"), casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()), casc.mXi(), casc.pt()); + registry.fill(HIST("hCascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCAPosToPV"), casc.dcapostopv(), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCANegToPV"), casc.dcanegtopv(), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCABachToPV"), casc.dcabachtopv(), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCAV0ToPV"), casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCAV0Dau"), casc.dcaV0daughters(), casc.mXi(), casc.pt()); + registry.fill(HIST("hDCACascDau"), casc.dcacascdaughters(), casc.mXi(), casc.pt()); + registry.fill(HIST("hLambdaMass"), casc.mLambda(), casc.mXi(), casc.pt()); + + registry.fill(HIST("hITSnClustersPos"), posTrack.itsNCls(), casc.mXi(), casc.pt()); + registry.fill(HIST("hITSnClustersNeg"), negTrack.itsNCls(), casc.mXi(), casc.pt()); + registry.fill(HIST("hITSnClustersBach"), bachTrack.itsNCls(), casc.mXi(), casc.pt()); + registry.fill(HIST("hTPCnCrossedRowsPos"), posTrack.tpcNClsCrossedRows(), casc.mXi(), casc.pt()); + registry.fill(HIST("hTPCnCrossedRowsNeg"), negTrack.tpcNClsCrossedRows(), casc.mXi(), casc.pt()); + registry.fill(HIST("hTPCnCrossedRowsBach"), bachTrack.tpcNClsCrossedRows(), casc.mXi(), casc.pt()); + registry.fill(HIST("hITSChi2Pos"), posTrack.itsChi2NCl()); + registry.fill(HIST("hITSChi2Neg"), negTrack.itsChi2NCl()); + registry.fill(HIST("hITSChi2Bach"), bachTrack.itsChi2NCl()); + registry.fill(HIST("hTPCChi2Pos"), posTrack.tpcChi2NCl()); + registry.fill(HIST("hTPCChi2Neg"), negTrack.tpcChi2NCl()); + registry.fill(HIST("hTPCChi2Bach"), bachTrack.tpcChi2NCl()); + + registry.fill(HIST("hSelectionStatus"), 0); // all the cascade before selections + // registry.fill(HIST("hMassXi0"), casc.mXi(), casc.pt()); + + // TPC N crossed rows todo: check if minTPCCrossedRows > 50 + if (posTrack.tpcNClsCrossedRows() < minTPCCrossedRows || negTrack.tpcNClsCrossedRows() < minTPCCrossedRows || bachTrack.tpcNClsCrossedRows() < minTPCCrossedRows) + return 0; + + registry.fill(HIST("hSelectionStatus"), 1); // passes nTPC crossed rows + // registry.fill(HIST("hMassXi1"), casc.mXi(), casc.pt()); + + // ITS N clusters todo: check if minITSClusters > 0 + if (posTrack.itsNCls() < minITSClusters || negTrack.itsNCls() < minITSClusters || bachTrack.itsNCls() < minITSClusters) + return 0; + + registry.fill(HIST("hSelectionStatus"), 2); // passes nITS clusters + // registry.fill(HIST("hMassXi2"), casc.mXi(), casc.pt()); + + // Chi2 cuts + if (posTrack.itsChi2NCl() > itsChi2 || negTrack.itsChi2NCl() > itsChi2 || bachTrack.itsChi2NCl() > itsChi2) + return 0; + if (posTrack.tpcChi2NCl() > tpcChi2 || negTrack.tpcChi2NCl() > tpcChi2 || bachTrack.tpcChi2NCl() > tpcChi2) + return 0; + + registry.fill(HIST("hSelectionStatus"), 3); // passes Chi2 cuts + + //// TOPO CUTS //// TODO: improve! + double pvx = collision.posX(); + double pvy = collision.posY(); + double pvz = collision.posZ(); + if (casc.v0radius() < v0setting_radius || + casc.cascradius() < cascadesetting_cascradius || + casc.v0cosPA(pvx, pvy, pvz) < v0setting_cospa || + casc.casccosPA(pvx, pvy, pvz) < cascadesetting_cospa || + casc.dcav0topv(pvx, pvy, pvz) < cascadesetting_mindcav0topv || + std::abs(casc.mLambda() - 1.115683) > cascadesetting_v0masswindow) + return 0; // It failed at least one topo selection + + registry.fill(HIST("hSelectionStatus"), 4); // passes topo + // registry.fill(HIST("hMassXi3"), casc.mXi(), casc.pt()); + + if (std::abs(posTrack.eta()) > etaTracks || std::abs(negTrack.eta()) > etaTracks || std::abs(bachTrack.eta()) > etaTracks) + return 0; + + registry.fill(HIST("hSelectionStatus"), 5); // passes track eta + + if (std::abs(casc.eta()) > etaCascades) + return 0; + + registry.fill(HIST("hSelectionStatus"), 6); // passes candidate eta + + // TODO: TOF (for pT > 2 GeV per track?) + + //// TPC PID //// + // Lambda check + if (casc.sign() < 0) { + // Proton check: + if (std::abs(posTrack.tpcNSigmaPr()) > tpcNsigmaProton) + return 0; + // Pion check: + if (std::abs(negTrack.tpcNSigmaPi()) > tpcNsigmaPion) + return 0; + } else { + // Proton check: + if (std::abs(negTrack.tpcNSigmaPr()) > tpcNsigmaProton) + return 0; + // Pion check: + if (std::abs(posTrack.tpcNSigmaPi()) > tpcNsigmaPion) + return 0; + } + registry.fill(HIST("hSelectionStatus"), 7); // passes V0 daughters PID + // registry.fill(HIST("hMassXi4"), casc.mXi(), casc.pt()); + + // setting selection flag based on bachelor PID (and competing mass cut for omega's) + int flag = 0; + if (std::abs(bachTrack.tpcNSigmaPi()) < tpcNsigmaBachelor) + flag = 1; + if (std::abs(bachTrack.tpcNSigmaKa()) < tpcNsigmaBachelor && (!doCompetingMassCut || std::abs(pdgDB->Mass(3312) - casc.mXi()) > competingMassWindow)) + flag = 3 - flag; // 3 if only consistent with omega, 2 if consistent with both + + switch (flag) { + case 1: // only Xi + registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID + if (casc.sign() < 0) { + registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi()); + } else { + registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi()); + } + break; + case 2: // Xi or Omega + registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID + if (casc.sign() < 0) { + registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi()); + registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega()); + } else { + registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi()); + registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega()); + } + break; + case 3: // only Omega + registry.fill(HIST("hSelectionStatus"), 8); // passes bach PID + if (casc.sign() < 0) { + registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega()); + } else { + registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega()); + } + break; + } + + return flag; + + } // processCandidate + + void processGenMC(aod::McCollision const& mcCollision, soa::SmallGroups> const& collisions, aod::McParticles const& mcParticles) + { + // evsel + if (INEL >= 0 && !pwglf::isINELgtNmc(mcParticles, INEL, pdgDB)) + return; + if (std::abs(mcCollision.posZ()) > maxVertexZ) + return; + + registry.fill(HIST("gen/hNevents"), 0); + + for (auto const& mcPart : mcParticles) { + if (!mcPart.isPhysicalPrimary()) + continue; + if (std::abs(mcPart.eta()) > etaCascades) + continue; + + switch (mcPart.pdgCode()) { + case 3312: + registry.fill(HIST("gen/hXiMinus"), mcPart.pt(), mcPart.y()); + break; + case -3312: + registry.fill(HIST("gen/hXiPlus"), mcPart.pt(), mcPart.y()); + break; + case 3334: + registry.fill(HIST("gen/hOmegaMinus"), mcPart.pt(), mcPart.y()); + break; + case -3334: + registry.fill(HIST("gen/hOmegaPlus"), mcPart.pt(), mcPart.y()); + break; + } + } + + // Do the same thing, but now making sure there is at least one matched reconstructed event: + if (collisions.size() < 1) { + return; + } else { + bool evSel = false; // will be true if at least one rec. collision passes evsel + for (auto const& collision : collisions) { + // can be more than 1 rec. collisions due to event splitting + evSel = eventSelection(collision, false); + if (evSel) // exit loop if we find 1 rec. event that passes evsel + break; + } + if (evSel) { + // N gen events with a reconstructed event + registry.fill(HIST("genwithrec/hNevents"), 0); + + for (auto const& mcPart : mcParticles) { + if (!mcPart.isPhysicalPrimary()) + continue; + if (std::abs(mcPart.eta()) > etaCascades) + continue; + + switch (mcPart.pdgCode()) { + case 3312: + registry.fill(HIST("genwithrec/hXiMinus"), mcPart.pt(), mcPart.y()); + break; + case -3312: + registry.fill(HIST("genwithrec/hXiPlus"), mcPart.pt(), mcPart.y()); + break; + case 3334: + registry.fill(HIST("genwithrec/hOmegaMinus"), mcPart.pt(), mcPart.y()); + break; + case -3334: + registry.fill(HIST("genwithrec/hOmegaPlus"), mcPart.pt(), mcPart.y()); + break; + } + } + } + } + } // processGen + + // wrappers for data/MC processes on reco level + void processRecData(MyCollisions::iterator const& collision, aod::CascDataExt const& Cascades, FullTracksExtIUWithPID const&, aod::BCsWithTimestamps const&) + { + bool evSel = eventSelection(collision, true); + // do not skip the collision if event selection fails - this will lead to the cascadeFlag table having less entries than the Cascade table, and therefor not joinable. + for (auto const& casc : Cascades) { + if (!evSel) { + cascflags(0); + continue; + } + int flag = processCandidate(casc, collision); + cascflags(flag); + } + } + + void processRecMC(MyCollisions::iterator const& collision, LabeledCascades const& Cascades, FullTracksExtIUWithPID const&, aod::BCsWithTimestamps const&, aod::McParticles const&) + { + bool evSel = eventSelection(collision, true); + // do not skip the collision if event selection fails - this will lead to the cascadeFlag table having less entries than the Cascade table, and therefor not joinable. + for (auto const& casc : Cascades) { + if (!evSel) { + cascflags(0); + continue; + } + int flag = processCandidate(casc, collision); + cascflags(flag); + // do mc matching here + fillMatchedHistos(casc, flag, collision); // if sign < 0 then pdg > 0 + } + } + + PROCESS_SWITCH(CascadeSelector, processRecData, "Process rec data", true); + PROCESS_SWITCH(CascadeSelector, processRecMC, "Process rec MC", false); + PROCESS_SWITCH(CascadeSelector, processGenMC, "Process gen MC", false); +}; // struct + +struct CascadeCorrelations { + Service ccdb; + + // Configurables + Configurable maxRapidity{"maxRapidity", 0.5, "|y| < maxRapidity"}; + Configurable zVertexCut{"zVertexCut", 10, "Cut on PV position"}; + Configurable nMixedEvents{"nMixedEvents", 10, "Number of events to be mixed"}; + Configurable doEfficiencyCorrection{"doEfficiencyCorrection", true, "flag to do efficiency corrections"}; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "CCDB url"}; + Configurable useTrigger{"useTrigger", false, "Use trigger selection on skimmed data"}; + Configurable triggerList{"triggerList", "fDoubleXi, fDoubleOmega, fOmegaXi", "List of triggers used to select events"}; + Configurable efficiencyCCDBPath{"efficiencyCCDBPath", "Users/r/rspijker/test/EffTest", "Path of the efficiency corrections"}; + Configurable doTFBorderCut{"doTFBorderCut", true, "Switch to apply TimeframeBorderCut event selection"}; + Configurable doSel8{"doSel8", true, "Switch to apply sel8 event selection"}; + + ConfigurableAxis radiusAxis = {"radiusAxis", {100, 0.0f, 50.0f}, "cm"}; + ConfigurableAxis cpaAxis = {"cpaAxis", {100, 0.95f, 1.0f}, "CPA"}; + ConfigurableAxis invMassAxis = {"invMassAxis", {1000, 1.0f, 2.0f}, "Inv. Mass (GeV/c^{2})"}; + ConfigurableAxis deltaPhiAxis = {"deltaPhiAxis", {180, -PIHalf, 3 * PIHalf}, "#Delta#varphi"}; // 180 is divisible by 18 (tpc sectors) and 20 (run 2 binning) + ConfigurableAxis ptAxis = {"ptAxis", {150, 0, 15}, "#it{p}_{T}"}; + ConfigurableAxis vertexAxis = {"vertexAxis", {200, -10.0f, 10.0f}, "cm"}; + ConfigurableAxis dcaAxis = {"dcaAxis", {100, 0.0f, 2.0f}, "cm"}; + ConfigurableAxis multiplicityAxis{"multiplicityAxis", {100, 0, 100}, "Multiplicity (centFT0M?)"}; + ConfigurableAxis invLambdaMassAxis{"invLambdaMassAxis", {100, 1.07f, 1.17f}, "Inv. Mass (GeV/c^{2})"}; + AxisSpec signAxis{3, -1.5, 1.5, "sign of cascade"}; + AxisSpec deltaYAxis{40, -2.f, 2.f, "#Delta y"}; + AxisSpec rapidityAxis{100, -1.f, 1.f, "y"}; + AxisSpec selectionFlagAxis{4, -0.5f, 3.5f, "Selection flag of casc candidate"}; + AxisSpec itsClustersAxis{8, -0.5, 7.5, "number of ITS clusters"}; + AxisSpec tpcRowsAxis{160, -0.5, 159.5, "TPC crossed rows"}; + + // initialize efficiency maps + TH1D* hEffXiMin; + TH1D* hEffXiPlus; + TH1D* hEffOmegaMin; + TH1D* hEffOmegaPlus; + + // used in MC closure test + Service pdgDB; + o2::pwglf::ParticleCounter mCounter; + + void init(InitContext const&) + { + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + if (doEfficiencyCorrection) { + TList* effList = ccdb->getForTimeStamp(efficiencyCCDBPath, 1); + if (!effList) { + LOGF(fatal, "null ptr in efficiency list!"); + } + hEffXiMin = static_cast(effList->FindObject("hXiMinEff")); + hEffXiPlus = static_cast(effList->FindObject("hXiPlusEff")); + hEffOmegaMin = static_cast(effList->FindObject("hOmegaMinEff")); + hEffOmegaPlus = static_cast(effList->FindObject("hOmegaPlusEff")); + } + + mCounter.mPdgDatabase = pdgDB.service; + mCounter.mSelectPrimaries = true; + } + + double getEfficiency(TH1* h, double pT, double y = 0) + { + // This function returns 1 / eff + double eff = h->GetBinContent(h->FindFixBin(pT, y)); + if (eff == 0) + return 0; + else + return 1. / eff; + } + + bool autoCorrelation(std::array triggerTracks, std::array assocTracks) + { + // function that loops over 2 arrays of track indices, checking for common elements + for (int triggerTrack : triggerTracks) { + for (int assocTrack : assocTracks) { + if (triggerTrack == assocTrack) + return true; + } + } + return false; + } + + HistogramRegistry registry{ + "registry", + { + // inv mass + {"hMassXiMinus", "hMassXiMinus", {HistType::kTH3F, {{200, 1.24, 1.44, "Inv. Mass (GeV/c^{2})"}, ptAxis, rapidityAxis}}}, + {"hMassXiPlus", "hMassXiPlus", {HistType::kTH3F, {{200, 1.24, 1.44, "Inv. Mass (GeV/c^{2})"}, ptAxis, rapidityAxis}}}, + {"hMassOmegaMinus", "hMassOmegaMinus", {HistType::kTH3F, {{200, 1.6, 1.8, "Inv. Mass (GeV/c^{2})"}, ptAxis, rapidityAxis}}}, + {"hMassOmegaPlus", "hMassOmegaPlus", {HistType::kTH3F, {{200, 1.6, 1.8, "Inv. Mass (GeV/c^{2})"}, ptAxis, rapidityAxis}}}, + // efficiency corrected inv mass + {"hMassXiEffCorrected", "hMassXiEffCorrected", {HistType::kTHnSparseF, {invMassAxis, signAxis, ptAxis, rapidityAxis, vertexAxis, multiplicityAxis}}, true}, + {"hMassOmegaEffCorrected", "hMassOmegaEffCorrected", {HistType::kTHnSparseF, {invMassAxis, signAxis, ptAxis, rapidityAxis, vertexAxis, multiplicityAxis}}, true}, + + // trigger QA + {"hTriggerQA", "hTriggerQA", {HistType::kTH1F, {{2, -0.5, 1.5, "Trigger y/n"}}}}, + + // basic selection variables (after cuts) + {"hV0Radius", "hV0Radius", {HistType::kTH1F, {radiusAxis}}}, + {"hCascRadius", "hCascRadius", {HistType::kTH1F, {radiusAxis}}}, + {"hV0CosPA", "hV0CosPA", {HistType::kTH1F, {cpaAxis}}}, + {"hCascCosPA", "hCascCosPA", {HistType::kTH1F, {cpaAxis}}}, + {"hDCAPosToPV", "hDCAPosToPV", {HistType::kTH1F, {vertexAxis}}}, + {"hDCANegToPV", "hDCANegToPV", {HistType::kTH1F, {vertexAxis}}}, + {"hDCABachToPV", "hDCABachToPV", {HistType::kTH1F, {vertexAxis}}}, + {"hDCAV0ToPV", "hDCAV0ToPV", {HistType::kTH1F, {vertexAxis}}}, + {"hDCAV0Dau", "hDCAV0Dau", {HistType::kTH1F, {dcaAxis}}}, + {"hDCACascDau", "hDCACascDau", {HistType::kTH1F, {dcaAxis}}}, + {"hLambdaMass", "hLambdaMass", {HistType::kTH1F, {invLambdaMassAxis}}}, + {"hTPCnCrossedRowsPos", "hTPCnCrossedRowsPos", {HistType::kTH1F, {tpcRowsAxis}}}, + {"hTPCnCrossedRowsNeg", "hTPCnCrossedRowsNeg", {HistType::kTH1F, {tpcRowsAxis}}}, + {"hTPCnCrossedRowsBach", "hTPCnCrossedRowsBach", {HistType::kTH1F, {tpcRowsAxis}}}, + {"hITSnClustersPos", "hITSnClustersPos", {HistType::kTH1F, {itsClustersAxis}}}, + {"hITSnClustersNeg", "hITSnClustersNeg", {HistType::kTH1F, {itsClustersAxis}}}, + {"hITSnClustersBach", "hITSnClustersBach", {HistType::kTH1F, {itsClustersAxis}}}, + + {"hSelectionFlag", "hSelectionFlag", {HistType::kTH1I, {selectionFlagAxis}}}, + {"hAutoCorrelation", "hAutoCorrelation", {HistType::kTH1I, {{4, -0.5f, 3.5f, "Types of SS autocorrelation"}}}}, + {"hAutoCorrelationOS", "hAutoCorrelationOS", {HistType::kTH1I, {{2, -1.f, 1.f, "Charge of OS autocorrelated track"}}}}, + {"hPhi", "hPhi", {HistType::kTH1F, {{180, 0, TwoPI, "#varphi"}}}}, + {"hEta", "hEta", {HistType::kTH1F, {{100, -2, 2, "#eta"}}}}, + {"hRapidityXi", "hRapidityXi", {HistType::kTH1F, {rapidityAxis}}}, + {"hRapidityOmega", "hRapidityOmega", {HistType::kTH1F, {rapidityAxis}}}, + + // correlation histos + {"hDeltaPhiSS", "hDeltaPhiSS", {HistType::kTH1F, {deltaPhiAxis}}}, + {"hDeltaPhiOS", "hDeltaPhiOS", {HistType::kTH1F, {deltaPhiAxis}}}, + + {"hXiXi", "hXiXi", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + {"hXiOm", "hXiOm", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + {"hOmOm", "hOmOm", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + + // Mixed events + {"MixedEvents/hMEVz1", "hMEVz1", {HistType::kTH1F, {vertexAxis}}}, + {"MixedEvents/hMEVz2", "hMEVz2", {HistType::kTH1F, {vertexAxis}}}, + {"MixedEvents/hMEDeltaPhiSS", "hMEDeltaPhiSS", {HistType::kTH1F, {deltaPhiAxis}}}, + {"MixedEvents/hMEDeltaPhiOS", "hMEDeltaPhiOS", {HistType::kTH1F, {deltaPhiAxis}}}, + {"MixedEvents/hMEQA", "hMEQA", {HistType::kTH1I, {{2, 0, 2, "QA for exceptions in ME (this histogram should have 0 entries!)"}}}}, + {"MixedEvents/hMEAutoCorrelation", "hMEAutoCorrelation", {HistType::kTH1I, {{4, -0.5f, 3.5f, "Types of SS autocorrelation"}}}}, + {"MixedEvents/hMEAutoCorrelationOS", "hMEAutoCorrelationOS", {HistType::kTH1I, {{2, -1.f, 1.f, "Charge of OS autocorrelated track"}}}}, + + {"MixedEvents/hMEXiXi", "hMEXiXi", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + {"MixedEvents/hMEXiOm", "hMEXiOm", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + {"MixedEvents/hMEOmOm", "hMEOmOm", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, signAxis, signAxis, ptAxis, ptAxis, invMassAxis, invMassAxis, vertexAxis, multiplicityAxis}}, true}, + + // MC closure + {"MC/hMCPlusMinus", "hMCPlusMinus", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, vertexAxis, multiplicityAxis}}, true}, + {"MC/hMCPlusPlus", "hMCPlusPlus", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, vertexAxis, multiplicityAxis}}, true}, + {"MC/hMCMinusPlus", "hMCMinusPlus", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, vertexAxis, multiplicityAxis}}, true}, + {"MC/hMCMinusMinus", "hMCMinusMinus", {HistType::kTHnSparseF, {deltaPhiAxis, deltaYAxis, ptAxis, ptAxis, vertexAxis, multiplicityAxis}}, true}, + + {"MC/hGenMultNoReco", "hGenMultNoReco", {HistType::kTH1I, {{100, 0, 100, "Number of generated charged primaries"}}}}, + {"MC/hGenMultOneReco", "hGenMultOneReco", {HistType::kTH1I, {{100, 0, 100, "Number of generated charged primaries"}}}}, + {"MC/hSplitEvents", "hSplitEvents", {HistType::kTH1I, {{10, 0, 10, "Number of rec. events per gen event"}}}}, + + // debug + {"MC/hPhi", "hPhi", {HistType::kTH1F, {{180, 0, TwoPI}}}}, + {"MC/hEta", "hEta", {HistType::kTH1F, {{100, -2, 2}}}}, + {"MC/hRapidity", "hRapidity", {HistType::kTH1F, {{100, -2, 2}}}}, + }, + }; + + // cascade filter + Filter cascadeSelector = aod::cascadeflags::isSelected > 0; + + // Warning: it is not possible to use this axis as configurable due to a bug - however, default values are sensible. + SliceCache cache; + ConfigurableAxis axisVtxZ{"axisVtxZ", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + // ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0, 5, 10, 20, 30, 40, 50, 100, 1000}, "Mixing bins - multiplicity"}; + // using BinningType = ColumnBinningPolicy; + // BinningType colBinning{{axisVtxZ, axisMult}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + using BinningType = ColumnBinningPolicy; + BinningType colBinning{{axisVtxZ}, true}; // true is for 'ignore overflows' (true by default). Underflows and overflows will have bin -1. + + void processSameEvent(MyCollisionsMult::iterator const& collision, MyCascades const& Cascades, FullTracksExtIU const&, aod::BCsWithTimestamps const&) + { + + double weight; + // Some QA on the cascades + for (auto const& casc : Cascades) { + if (casc.isSelected() <= 2) { // not exclusively an Omega --> consistent with Xi or both + if (casc.sign() < 0) { + registry.fill(HIST("hMassXiMinus"), casc.mXi(), casc.pt(), casc.yXi()); + weight = getEfficiency(hEffXiMin, casc.pt(), casc.yXi()); + } else { + registry.fill(HIST("hMassXiPlus"), casc.mXi(), casc.pt(), casc.yXi()); + weight = getEfficiency(hEffXiPlus, casc.pt(), casc.yXi()); + } + // LOGF(info, "casc pt %f, weight %f", casc.pt(), weight); + registry.fill(HIST("hMassXiEffCorrected"), casc.mXi(), casc.sign(), casc.pt(), casc.yXi(), collision.posZ(), collision.centFT0M(), weight); + registry.fill(HIST("hRapidityXi"), casc.yXi()); + } + if (casc.isSelected() >= 2) { // consistent with Omega or both + if (casc.sign() < 0) { + registry.fill(HIST("hMassOmegaMinus"), casc.mOmega(), casc.pt(), casc.yOmega()); + weight = getEfficiency(hEffOmegaMin, casc.pt(), casc.yOmega()); + } else { + registry.fill(HIST("hMassOmegaPlus"), casc.mOmega(), casc.pt(), casc.yOmega()); + weight = getEfficiency(hEffOmegaPlus, casc.pt(), casc.yOmega()); + } + registry.fill(HIST("hMassOmegaEffCorrected"), casc.mOmega(), casc.sign(), casc.pt(), casc.yOmega(), collision.posZ(), collision.centFT0M(), weight); + registry.fill(HIST("hRapidityOmega"), casc.yOmega()); + } + registry.fill(HIST("hV0Radius"), casc.v0radius()); + registry.fill(HIST("hCascRadius"), casc.cascradius()); + registry.fill(HIST("hV0CosPA"), casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("hCascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("hDCAPosToPV"), casc.dcapostopv()); + registry.fill(HIST("hDCANegToPV"), casc.dcanegtopv()); + registry.fill(HIST("hDCABachToPV"), casc.dcabachtopv()); + registry.fill(HIST("hDCAV0ToPV"), casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ())); + registry.fill(HIST("hDCAV0Dau"), casc.dcaV0daughters()); + registry.fill(HIST("hDCACascDau"), casc.dcacascdaughters()); + registry.fill(HIST("hLambdaMass"), casc.mLambda()); + registry.fill(HIST("hITSnClustersPos"), casc.posTrack_as().itsNCls()); + registry.fill(HIST("hITSnClustersNeg"), casc.negTrack_as().itsNCls()); + registry.fill(HIST("hITSnClustersBach"), casc.bachelor_as().itsNCls()); + registry.fill(HIST("hTPCnCrossedRowsPos"), casc.posTrack_as().tpcNClsCrossedRows()); + registry.fill(HIST("hTPCnCrossedRowsNeg"), casc.negTrack_as().tpcNClsCrossedRows()); + registry.fill(HIST("hTPCnCrossedRowsBach"), casc.bachelor_as().tpcNClsCrossedRows()); + + registry.fill(HIST("hSelectionFlag"), casc.isSelected()); + registry.fill(HIST("hPhi"), casc.phi()); + registry.fill(HIST("hEta"), casc.eta()); + } // casc loop + + for (auto& [c0, c1] : combinations(Cascades, Cascades)) { // combinations automatically applies strictly upper in case of 2 identical tables + // Define the trigger as the particle with the highest pT. As we can't swap the cascade tables themselves, we swap the addresses and later dereference them + auto* triggerAddress = &c0; + auto* assocAddress = &c1; + if (assocAddress->pt() > triggerAddress->pt()) { + std::swap(triggerAddress, assocAddress); + } + auto trigger = *triggerAddress; + auto assoc = *assocAddress; + + // autocorrelation check + std::array triggerTracks = {trigger.posTrackId(), trigger.negTrackId(), trigger.bachelorId()}; + std::array assocTracks = {assoc.posTrackId(), assoc.negTrackId(), assoc.bachelorId()}; + if (autoCorrelation(triggerTracks, assocTracks)) + continue; + + // calculate angular correlations + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); + + double invMassXiTrigg = trigger.mXi(); + double invMassOmTrigg = trigger.mOmega(); + double invMassXiAssoc = assoc.mXi(); + double invMassOmAssoc = assoc.mOmega(); + + double weightTrigg = 1.; + double weightAssoc = 1.; + + if (trigger.isSelected() <= 2 && std::abs(trigger.yXi()) < maxRapidity) { // trigger Xi + if (doEfficiencyCorrection) + weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffXiMin, trigger.pt()) : getEfficiency(hEffXiPlus, trigger.pt()); + if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt()); + registry.fill(HIST("hXiXi"), dphi, trigger.yXi() - assoc.yXi(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, collision.posZ(), collision.centFT0M(), weightTrigg * weightAssoc); + } + if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt()); + registry.fill(HIST("hXiOm"), dphi, trigger.yXi() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, collision.posZ(), collision.centFT0M(), weightTrigg * weightAssoc); + } + } + if (trigger.isSelected() >= 2 && std::abs(trigger.yOmega()) < maxRapidity) { // trigger Omega + if (doEfficiencyCorrection) + weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffOmegaMin, trigger.pt()) : getEfficiency(hEffOmegaPlus, trigger.pt()); + if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt()); + // if Omega-Xi, fill the Xi-Omega histogram (flip the trigger/assoc and dphy,dy signs) + registry.fill(HIST("hXiOm"), RecoDecay::constrainAngle(assoc.phi() - trigger.phi(), -PIHalf), -(trigger.yOmega() - assoc.yXi()), assoc.sign(), trigger.sign(), assoc.pt(), trigger.pt(), invMassXiAssoc, invMassOmTrigg, collision.posZ(), collision.centFT0M(), weightTrigg * weightAssoc); + } + if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt()); + registry.fill(HIST("hOmOm"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, collision.posZ(), collision.centFT0M(), weightTrigg * weightAssoc); + } + } + + // QA plots + if (trigger.sign() * assoc.sign() < 0) { + registry.fill(HIST("hDeltaPhiOS"), dphi); + } else { + registry.fill(HIST("hDeltaPhiSS"), dphi); + } + } // correlations + } // process same event + + void processMixedEvent(MyCollisionsMult const& collisions, MyCascades const& Cascades, FullTracksExtIU const&) + { + auto cascadesTuple = std::make_tuple(Cascades); + SameKindPair pair{colBinning, nMixedEvents, -1, collisions, cascadesTuple, &cache}; + + for (auto const& [col1, cascades1, col2, cascades2] : pair) { + if (!col1.sel8() || !col2.sel8()) + continue; + if (std::abs(col1.posZ()) > zVertexCut || std::abs(col2.posZ()) > zVertexCut) + continue; + if (col1.globalIndex() == col2.globalIndex()) { + registry.fill(HIST("hMEQA"), 0.5); + continue; + } + registry.fill(HIST("MixedEvents/hMEVz1"), col1.posZ()); + registry.fill(HIST("MixedEvents/hMEVz2"), col2.posZ()); + + for (auto& [casc1, casc2] : combinations(CombinationsFullIndexPolicy(cascades1, cascades2))) { + // specify FullIndexPolicy since the cascades are from different collisions + auto* triggerAddress = &casc1; + auto* assocAddress = &casc2; + if (assocAddress->pt() > triggerAddress->pt()) { + std::swap(triggerAddress, assocAddress); + } + auto trigger = *triggerAddress; + auto assoc = *assocAddress; + + if (trigger.collisionId() == assoc.collisionId()) { + registry.fill(HIST("hMEQA"), 1.5); + continue; + } + + std::array triggerTracks = {trigger.posTrackId(), trigger.negTrackId(), trigger.bachelorId()}; + std::array assocTracks = {assoc.posTrackId(), assoc.negTrackId(), assoc.bachelorId()}; + if (autoCorrelation(triggerTracks, assocTracks)) + continue; + + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); + + double invMassXiTrigg = trigger.mXi(); + double invMassOmTrigg = trigger.mOmega(); + double invMassXiAssoc = assoc.mXi(); + double invMassOmAssoc = assoc.mOmega(); + + double weightTrigg = 1.; + double weightAssoc = 1.; + + if (trigger.isSelected() <= 2 && std::abs(trigger.yXi()) < maxRapidity) { // trigger Xi + if (doEfficiencyCorrection) + weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffXiMin, trigger.pt()) : getEfficiency(hEffXiPlus, trigger.pt()); + if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt()); + registry.fill(HIST("MixedEvents/hMEXiXi"), dphi, trigger.yXi() - assoc.yXi(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassXiAssoc, col1.posZ(), col1.centFT0M(), weightTrigg * weightAssoc); + } + if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt()); + registry.fill(HIST("MixedEvents/hMEXiOm"), dphi, trigger.yXi() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassXiTrigg, invMassOmAssoc, col1.posZ(), col1.centFT0M(), weightTrigg * weightAssoc); + } + } + if (trigger.isSelected() >= 2 && std::abs(trigger.yOmega()) < maxRapidity) { // trigger Omega + if (doEfficiencyCorrection) + weightTrigg = trigger.sign() < 0 ? getEfficiency(hEffOmegaMin, trigger.pt()) : getEfficiency(hEffOmegaPlus, trigger.pt()); + if (assoc.isSelected() <= 2 && std::abs(assoc.yXi()) < maxRapidity) { // assoc Xi + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffXiMin, assoc.pt()) : getEfficiency(hEffXiPlus, assoc.pt()); + // if Omega-Xi, fill the Xi-Omega histogram (flip the trigger/assoc and dphy,dy signs) + registry.fill(HIST("MixedEvents/hMEXiOm"), RecoDecay::constrainAngle(assoc.phi() - trigger.phi(), -PIHalf), -(trigger.yOmega() - assoc.yXi()), assoc.sign(), trigger.sign(), assoc.pt(), trigger.pt(), invMassXiAssoc, invMassOmTrigg, col1.posZ(), col1.centFT0M(), weightTrigg * weightAssoc); + } + if (assoc.isSelected() >= 2 && std::abs(assoc.yOmega()) < maxRapidity) { // assoc Omega + if (doEfficiencyCorrection) + weightAssoc = assoc.sign() < 0 ? getEfficiency(hEffOmegaMin, assoc.pt()) : getEfficiency(hEffOmegaPlus, assoc.pt()); + registry.fill(HIST("MixedEvents/hMEOmOm"), dphi, trigger.yOmega() - assoc.yOmega(), trigger.sign(), assoc.sign(), trigger.pt(), assoc.pt(), invMassOmTrigg, invMassOmAssoc, col1.posZ(), col1.centFT0M(), weightTrigg * weightAssoc); + } + } + + // QA plots + if (trigger.sign() * assoc.sign() < 0) { + registry.fill(HIST("MixedEvents/hMEDeltaPhiOS"), dphi); + } else { + registry.fill(HIST("MixedEvents/hMEDeltaPhiSS"), dphi); + } + } // correlations + } // collisions + } // process mixed events + + Configurable etaGenCascades{"etaGenCascades", 0.8, "min/max of eta for generated cascades"}; + Filter genCascadesFilter = nabs(aod::mcparticle::pdgCode) == 3312; + + void processMC(aod::McCollision const&, soa::SmallGroups> const& collisions, soa::Filtered const& genCascades, aod::McParticles const& mcParticles) + { + // Let's do some logic on matched reconstructed collisions - if there less or more than one, fill some QA and skip the rest + double FT0mult = -1; // non-sensible default value just in case + double vtxz = -999.; // non-sensible default value just in case + if (collisions.size() < 1) { + registry.fill(HIST("MC/hSplitEvents"), 0); + registry.fill(HIST("MC/hGenMultNoReco"), mCounter.countFT0A(mcParticles) + mCounter.countFT0C(mcParticles)); + return; + } else if (collisions.size() == 1) { + registry.fill(HIST("MC/hSplitEvents"), 1); + registry.fill(HIST("MC/hGenMultOneReco"), mCounter.countFT0A(mcParticles) + mCounter.countFT0C(mcParticles)); + for (auto const& collision : collisions) { // not really a loop, as there is only one collision + FT0mult = collision.centFT0M(); + vtxz = collision.posZ(); + } + } else if (collisions.size() > 1) { + registry.fill(HIST("MC/hSplitEvents"), collisions.size()); + return; + } + + // QA + for (auto& casc : genCascades) { + if (!casc.isPhysicalPrimary()) + continue; + registry.fill(HIST("MC/hPhi"), casc.phi()); + registry.fill(HIST("MC/hEta"), casc.eta()); + registry.fill(HIST("MC/hRapidity"), casc.y()); + } + + for (auto& [c0, c1] : combinations(genCascades, genCascades)) { // combinations automatically applies strictly upper in case of 2 identical tables + // Define the trigger as the particle with the highest pT. As we can't swap the cascade tables themselves, we swap the addresses and later dereference them + auto* triggerAddress = &c0; + auto* assocAddress = &c1; + if (assocAddress->pt() > triggerAddress->pt()) { + std::swap(triggerAddress, assocAddress); + } + auto trigger = *triggerAddress; + auto assoc = *assocAddress; + + if (!trigger.isPhysicalPrimary() || !assoc.isPhysicalPrimary()) + continue; // require the cascades to be primaries + if (std::abs(trigger.eta()) > etaGenCascades) + continue; // only apply eta cut to trigger - trigger normalization still valid without introducing 2-particle-acceptance effects + + double dphi = RecoDecay::constrainAngle(trigger.phi() - assoc.phi(), -PIHalf); + + if (trigger.pdgCode() < 0) { // anti-trigg --> Plus + if (assoc.pdgCode() < 0) { // anti-assoc --> Plus + registry.fill(HIST("MC/hMCPlusPlus"), dphi, trigger.y() - assoc.y(), trigger.pt(), assoc.pt(), vtxz, FT0mult); + } else { // assoc --> Minus + registry.fill(HIST("MC/hMCPlusMinus"), dphi, trigger.y() - assoc.y(), trigger.pt(), assoc.pt(), vtxz, FT0mult); + } + } else { // trig --> Minus + if (assoc.pdgCode() < 0) { // anti-assoc --> Plus + registry.fill(HIST("MC/hMCMinusPlus"), dphi, trigger.y() - assoc.y(), trigger.pt(), assoc.pt(), vtxz, FT0mult); + } else { + registry.fill(HIST("MC/hMCMinusMinus"), dphi, trigger.y() - assoc.y(), trigger.pt(), assoc.pt(), vtxz, FT0mult); + } + } + } + } + + PROCESS_SWITCH(CascadeCorrelations, processSameEvent, "Process same events", true); + PROCESS_SWITCH(CascadeCorrelations, processMixedEvent, "Process mixed events", true); + PROCESS_SWITCH(CascadeCorrelations, processMC, "Process MC", false); + +}; // struct + +// Branch data structs for TTree filling — plain POD, no O2 framework types. +// Stored via a single raw pointer (1 StructToTuple slot) from the task struct. +namespace lxicorr +{ +struct CascBranches { + float pt, rap, mass; + int sign; + float cascCosPA, v0CosPA; + float cascRadius, v0Radius; + float dcaV0Dau, dcaCascDau; + float dcaV0ToPV, dcaPosToPV, dcaNegToPV, dcaBachToPV; + float cent, pvZ; + // MC truth-matching (filled only in MC mode; default = no match) + int pdgCode{0}; // PDG of matched McParticle (0 = no match = background) + bool isPhysPrim{false}; +}; + +// Holds branch data for both Xi and Omega — one raw pointer covers both. +// Gen-level branches — kinematics + truth only, no topology +struct GenBranches { + float pt, rap, cent, pvZ; + int pdgCode; + bool isPhysPrim; +}; + +// Single pointer covers all four branch sets — 1 StructToTuple slot +struct BranchPair { + CascBranches xi{}; + CascBranches om{}; + GenBranches xiGen{}; + GenBranches omGen{}; +}; + +inline void connectBranches(TTree* t, CascBranches* b) +{ + t->Branch("pt", &b->pt); + t->Branch("rap", &b->rap); + t->Branch("mass", &b->mass); + t->Branch("sign", &b->sign); + t->Branch("cascCosPA", &b->cascCosPA); + t->Branch("v0CosPA", &b->v0CosPA); + t->Branch("cascRadius", &b->cascRadius); + t->Branch("v0Radius", &b->v0Radius); + t->Branch("dcaV0Dau", &b->dcaV0Dau); + t->Branch("dcaCascDau", &b->dcaCascDau); + t->Branch("dcaV0ToPV", &b->dcaV0ToPV); + t->Branch("dcaPosToPV", &b->dcaPosToPV); + t->Branch("dcaNegToPV", &b->dcaNegToPV); + t->Branch("dcaBachToPV", &b->dcaBachToPV); + t->Branch("cent", &b->cent); + t->Branch("pvZ", &b->pvZ); + t->Branch("pdgCode", &b->pdgCode); + t->Branch("isPhysPrim", &b->isPhysPrim); +} + +inline void connectGenBranches(TTree* t, GenBranches* b) +{ + t->Branch("pt", &b->pt); + t->Branch("rap", &b->rap); + t->Branch("pdgCode", &b->pdgCode); + t->Branch("isPhysPrim", &b->isPhysPrim); + t->Branch("cent", &b->cent); + t->Branch("pvZ", &b->pvZ); +} +} // namespace lxicorr + +struct LambdaXiCorrelation { + + // --- Configurables --- + Configurable maxY{"maxY", 0.5, "Max |y| for Lambda, Xi and Omega"}; + Configurable useEff{"useEff", false, "Apply Lambda efficiency correction"}; + // Omega bachelor kaon PID cut (kept separate from Xi pion cut for physics correctness) + Configurable tpcNsigmaBachKaon{"tpcNsigmaBachKaon", 3.0f, "TPC NSigma bachelor kaon (Omega selection)"}; + // FT0M centrality bins — same variable-width defaults as LambdaR2Correlation + ConfigurableAxis centAxis{"centAxis", {VARIABLE_WIDTH, 0.0f, 10.0f, 30.0f, 50.0f, 80.0f, 100.0f}, "FT0M centrality (%)"}; + Configurable saveCascTree{"saveCascTree", false, "Save TTree of cascade topological variables into AnalysisResults.root"}; + + // --- Outputs --- + HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + // Direct OutputObj members → framework registers and writes these into + // AnalysisResults.root under the "CascadeTrees" folder automatically. + // setObject() is called in init() when saveCascTree is true. + OutputObj treeXi{"XiCandidates", OutputObjHandlingPolicy::AnalysisObject}; + OutputObj treeOmega{"OmegaCandidates", OutputObjHandlingPolicy::AnalysisObject}; + OutputObj treeXiGen{"XiCandidatesGen", OutputObjHandlingPolicy::AnalysisObject}; + OutputObj treeOmegaGen{"OmegaCandidatesGen", OutputObjHandlingPolicy::AnalysisObject}; + // Single raw pointer covers all four branch sets — 1 StructToTuple slot + lxicorr::BranchPair* bp{nullptr}; + + // --- Data Slicing Definitions --- + using GoodLambdas = soa::Join; + Partition goodLambda = aod::lambdatrackext::trueLambdaFlag == true; + + Preslice lambdasPerCollision = aod::lambdatrack::lambdaCollisionId; + Preslice cascadesPerCollision = aod::cascdata::collisionId; + Preslice labeledCascPerCollision = aod::cascdata::collisionId; + // Gen-level lambda slicing: use HashBy (unsorted-safe) via o2::framework::expressions + // Simple approach: iterate all and match by collision index inline (no cache needed) + + using LambdaCollisionsExt = aod::LambdaCollisions; + + // Gen Xi/Omega: PDG filtering is done inline inside each process function. + // (Two Filter declarations on the same table within one struct are AND-ed, + // so |pdg|==3312 AND |pdg|==3334 would always be false.) + Preslice mcParticlesPerMcCollision = aod::mcparticle::mcCollisionId; + + // --- R2 Calculation Helper --- + // R2 = (N_events * Pair_Yield) / (Single_Yield_1 * Single_Yield_2) - 1 + static TH2* calculateR2(TH2* hPairs, TH1* hSinglesTrig, TH1* hSinglesAssoc, double nEvents) + { + if (!hPairs || !hSinglesTrig || !hSinglesAssoc || nEvents <= 0) + return nullptr; + + TH2* hR2 = reinterpret_cast(hPairs->Clone(Form("%s_R2", hPairs->GetName()))); + hR2->Reset(); + + double nS1 = hSinglesTrig->Integral(); + double nS2 = hSinglesAssoc->Integral(); + + if (nS1 > 0 && nS2 > 0) { + hR2->Add(hPairs); + hR2->Scale(nEvents / (nS1 * nS2)); + + for (int i = 1; i <= hR2->GetNbinsX(); i++) { + for (int j = 1; j <= hR2->GetNbinsY(); j++) { + double content = hR2->GetBinContent(i, j); + hR2->SetBinContent(i, j, content - 1.0); + } + } + } + return hR2; + } + + void init(InitContext const&) + { + // --- 1. Axis Definitions --- + const AxisSpec dphi{72, -PIHalf, 3 * PIHalf, "#Delta#varphi"}; + const AxisSpec dy{40, -2.0f, 2.0f, "#Delta y"}; + const AxisSpec cent{centAxis, "FT0M (%)"}; + const AxisSpec pt{100, 0, 10, "p_{T} (GeV/c)"}; + const AxisSpec rap{100, -1.0, 1.0, "y"}; + const AxisSpec massLam{100, 1.09, 1.14, "M_{p#pi} (GeV/c^{2})"}; + const AxisSpec massXi{100, 1.28, 1.36, "M_{#Lambda#pi} (GeV/c^{2})"}; + const AxisSpec massOm{100, 1.62, 1.72, "M_{#LambdaK} (GeV/c^{2})"}; + const AxisSpec radius{100, 0, 100, "Radius (cm)"}; + const AxisSpec cpa{100, 0.9, 1.0, "Cos(PA)"}; + const AxisSpec dca{100, 0.0, 5.0, "DCA (cm)"}; + const AxisSpec pvDca{100, -10.0, 10.0, "DCA to PV (cm)"}; + // Fixed AxisSpec (not ConfigurableAxis) so bin edges cannot be misconfigured at runtime + const AxisSpec tpcRows{160, -0.5, 159.5, "TPC crossed rows"}; + + // --- 2. Histograms --- + histos.add("Event/hEventCount", "Event Counter", kTH1F, {{1, 0, 1, "Count"}}); + + // Singles: Lambda + histos.add("Singles/Lambda/hPt", "Lambda p_{T}", kTH1F, {pt}); + histos.add("Singles/AntiLambda/hPt", "AntiLambda p_{T}", kTH1F, {pt}); + + histos.add("Singles/Lambda/hPtVsMass", "Lambda p_{T} vs Mass", kTH2F, {massLam, pt}); + histos.add("Singles/AntiLambda/hPtVsMass", "AntiLambda p_{T} vs Mass", kTH2F, {massLam, pt}); + + // Singles: Xi & QA + histos.add("QA/Xi/hRadius", "Xi Radius", kTH1F, {radius}); + histos.add("QA/Xi/hCosPA", "Xi CosPA", kTH1F, {cpa}); + histos.add("QA/Xi/hDCAV0Dau", "DCA V0 Daughters", kTH1F, {dca}); + histos.add("QA/Xi/hDCACascDau", "DCA Casc Daughters", kTH1F, {dca}); + histos.add("QA/Xi/hDCAV0ToPV", "DCA V0 to PV", kTH1F, {pvDca}); + histos.add("QA/Xi/hDCAPosToPV", "DCA Pos to PV", kTH1F, {pvDca}); + histos.add("QA/Xi/hDCANegToPV", "DCA Neg to PV", kTH1F, {pvDca}); + histos.add("QA/Xi/hDCABachToPV", "DCA Bach to PV", kTH1F, {pvDca}); + + // Cascade track QA — TPC crossed rows per daughter (fixed AxisSpec, immune to config override) + histos.add("QA/Casc/hTPCRowsPos", "TPC crossed rows (pos)", kTH1F, {tpcRows}); + histos.add("QA/Casc/hTPCRowsNeg", "TPC crossed rows (neg)", kTH1F, {tpcRows}); + histos.add("QA/Casc/hTPCRowsBach", "TPC crossed rows (bach)", kTH1F, {tpcRows}); + + histos.add("Singles/XiMinus/hPtVsMass", "Xi^{-} p_{T} vs Mass", kTH2F, {massXi, pt}); + histos.add("Singles/XiPlus/hPtVsMass", "Xi^{+} p_{T} vs Mass", kTH2F, {massXi, pt}); + histos.add("Singles/XiMinus/hRap", "Xi^{-} Rapidity", kTH1F, {rap}); + histos.add("Singles/XiPlus/hRap", "Xi^{+} Rapidity", kTH1F, {rap}); + + // --- Omega QA --- + histos.add("QA/Om/hRadius", "Omega Radius", kTH1F, {radius}); + histos.add("QA/Om/hCosPA", "Omega CosPA", kTH1F, {cpa}); + histos.add("QA/Om/hDCAV0Dau", "DCA V0 Daughters", kTH1F, {dca}); + histos.add("QA/Om/hDCACascDau", "DCA Casc Daughters", kTH1F, {dca}); + histos.add("QA/Om/hDCAV0ToPV", "DCA V0 to PV", kTH1F, {pvDca}); + histos.add("QA/Om/hDCAPosToPV", "DCA Pos to PV", kTH1F, {pvDca}); + histos.add("QA/Om/hDCANegToPV", "DCA Neg to PV", kTH1F, {pvDca}); + histos.add("QA/Om/hDCABachToPV", "DCA Bach to PV", kTH1F, {pvDca}); + + // Singles: Omega + histos.add("Singles/OmegaMinus/hPtVsMass", "Omega^{-} p_{T} vs Mass", kTH2F, {massOm, pt}); + histos.add("Singles/OmegaPlus/hPtVsMass", "Omega^{+} p_{T} vs Mass", kTH2F, {massOm, pt}); + histos.add("Singles/OmegaMinus/hRap", "Omega^{-} Rapidity", kTH1F, {rap}); + histos.add("Singles/OmegaPlus/hRap", "Omega^{+} Rapidity", kTH1F, {rap}); + + // Pairs: Xi (R2 inputs) + histos.add("Pairs/Lam_XiM/hDeltaPhiDeltaY", "L-Xi-", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/Lam_XiP/hDeltaPhiDeltaY", "L-Xi+", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/AntiLam_XiM/hDeltaPhiDeltaY", "AL-Xi-", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/AntiLam_XiP/hDeltaPhiDeltaY", "AL-Xi+", kTH3F, {cent, dphi, dy}); + + // Pairs: Omega (R2 inputs) + histos.add("Pairs/Lam_OmM/hDeltaPhiDeltaY", "L-Om-", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/Lam_OmP/hDeltaPhiDeltaY", "L-Om+", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/AntiLam_OmM/hDeltaPhiDeltaY", "AL-Om-", kTH3F, {cent, dphi, dy}); + histos.add("Pairs/AntiLam_OmP/hDeltaPhiDeltaY", "AL-Om+", kTH3F, {cent, dphi, dy}); + + // --- MC Gen-level histograms (mirror reco under McGen/) --- + // Singles: gen Lambda + histos.add("McGen/Singles/Lambda/hPt", "Gen #Lambda p_{T}", kTH1F, {pt}); + histos.add("McGen/Singles/AntiLambda/hPt", "Gen #bar{#Lambda} p_{T}", kTH1F, {pt}); + + // Singles: gen Xi + histos.add("McGen/Singles/XiMinus/hPtVsRap", "Gen #Xi^{-} p_{T} vs y", kTH2F, {rap, pt}); + histos.add("McGen/Singles/XiPlus/hPtVsRap", "Gen #Xi^{+} p_{T} vs y", kTH2F, {rap, pt}); + + // Singles: gen Omega + histos.add("McGen/Singles/OmegaMinus/hPtVsRap", "Gen #Omega^{-} p_{T} vs y", kTH2F, {rap, pt}); + histos.add("McGen/Singles/OmegaPlus/hPtVsRap", "Gen #Omega^{+} p_{T} vs y", kTH2F, {rap, pt}); + + // Pairs: gen Lam-Xi + histos.add("McGen/Pairs/Lam_XiM/hDeltaPhiDeltaY", "Gen L-Xi-", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/Lam_XiP/hDeltaPhiDeltaY", "Gen L-Xi+", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/AntiLam_XiM/hDeltaPhiDeltaY", "Gen AL-Xi-", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/AntiLam_XiP/hDeltaPhiDeltaY", "Gen AL-Xi+", kTH3F, {cent, dphi, dy}); + + // Pairs: gen Lam-Omega + histos.add("McGen/Pairs/Lam_OmM/hDeltaPhiDeltaY", "Gen L-Om-", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/Lam_OmP/hDeltaPhiDeltaY", "Gen L-Om+", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/AntiLam_OmM/hDeltaPhiDeltaY", "Gen AL-Om-", kTH3F, {cent, dphi, dy}); + histos.add("McGen/Pairs/AntiLam_OmP/hDeltaPhiDeltaY", "Gen AL-Om+", kTH3F, {cent, dphi, dy}); + + // --- 3. Efficiency map production histograms --- + // Axis definitions for efficiency maps (coarser binning to avoid empty bins) + const AxisSpec effCent{cent}; + const AxisSpec effPt{50, 0, 10, "p_{T} (GeV/c)"}; + const AxisSpec effRap{20, -1.0, 1.0, "y"}; + + // Generator-level denominator: all physical-primary Xi/Omega in acceptance + histos.add("Eff/Gen/XiMinus/hCentPtRap", "Gen #Xi^{-}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Gen/XiPlus/hCentPtRap", "Gen #Xi^{+}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Gen/OmegaMinus/hCentPtRap", "Gen #Omega^{-}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Gen/OmegaPlus/hCentPtRap", "Gen #Omega^{+}", kTH3F, {effCent, effPt, effRap}); + // Reco-level numerator: truth-matched reco Xi/Omega (physical-primary) + histos.add("Eff/Reco/XiMinus/hCentPtRap", "Reco #Xi^{-}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Reco/XiPlus/hCentPtRap", "Reco #Xi^{+}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Reco/OmegaMinus/hCentPtRap", "Reco #Omega^{-}", kTH3F, {effCent, effPt, effRap}); + histos.add("Eff/Reco/OmegaPlus/hCentPtRap", "Reco #Omega^{+}", kTH3F, {effCent, effPt, effRap}); + + // TTree setup — only allocates when saveCascTree is enabled. + // OutputObj are direct task members, so the framework automatically + // writes them into AnalysisResults.root under their own folder. + if (saveCascTree) { + bp = new lxicorr::BranchPair{}; + treeXi.setObject(new TTree("XiCandidates", "Xi topological variables")); + treeOmega.setObject(new TTree("OmegaCandidates", "Omega topological variables")); + lxicorr::connectBranches(treeXi.object.get(), &bp->xi); + lxicorr::connectBranches(treeOmega.object.get(), &bp->om); + treeXiGen.setObject(new TTree("XiCandidatesGen", "Xi gen-level kinematics")); + treeOmegaGen.setObject(new TTree("OmegaCandidatesGen", "Omega gen-level kinematics")); + lxicorr::connectGenBranches(treeXiGen.object.get(), &bp->xiGen); + lxicorr::connectGenBranches(treeOmegaGen.object.get(), &bp->omGen); + } + } + + // --- Analysis Functions --- + + template + void analyzeSinglesLambda(T const& tracks) + { + for (const auto& track : tracks) { + if (std::abs(track.rap()) > maxY) + continue; + + float w = useEff ? track.corrFact() : 1.0f; + bool isAnti = (track.v0Type() == 1); + + if (!isAnti) { + histos.fill(HIST("Singles/Lambda/hPt"), track.pt(), w); + histos.fill(HIST("Singles/Lambda/hPtVsMass"), track.mass(), track.pt(), w); + } else { + histos.fill(HIST("Singles/AntiLambda/hPt"), track.pt(), w); + histos.fill(HIST("Singles/AntiLambda/hPtVsMass"), track.mass(), track.pt(), w); + } + } + } + + template + void analyzeSinglesXi(T const& cascades, F const& flagsStart, float pvX, float pvY, float pvZ, float centVal) + { + for (const auto& casc : cascades) { + if ((flagsStart + casc.globalIndex()).isSelected() == 0) + continue; + + float xiY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, MassXi0); + if (std::abs(xiY) > maxY) + continue; + + // QA Filling + histos.fill(HIST("QA/Xi/hRadius"), casc.cascradius()); + histos.fill(HIST("QA/Xi/hCosPA"), casc.casccosPA(pvX, pvY, pvZ)); + histos.fill(HIST("QA/Xi/hDCAV0Dau"), casc.dcaV0daughters()); + histos.fill(HIST("QA/Xi/hDCACascDau"), casc.dcacascdaughters()); + histos.fill(HIST("QA/Xi/hDCAV0ToPV"), casc.dcav0topv(pvX, pvY, pvZ)); + histos.fill(HIST("QA/Xi/hDCAPosToPV"), casc.dcapostopv()); + histos.fill(HIST("QA/Xi/hDCANegToPV"), casc.dcanegtopv()); + histos.fill(HIST("QA/Xi/hDCABachToPV"), casc.dcabachtopv()); + + if (casc.sign() < 0) { + histos.fill(HIST("Singles/XiMinus/hPtVsMass"), casc.mXi(), casc.pt()); + histos.fill(HIST("Singles/XiMinus/hRap"), xiY); + } else { + histos.fill(HIST("Singles/XiPlus/hPtVsMass"), casc.mXi(), casc.pt()); + histos.fill(HIST("Singles/XiPlus/hRap"), xiY); + } + + // MC: fill efficiency numerator for truth-matched primary Xi + if constexpr (IsMC) { + if (casc.has_mcParticle()) { + auto mcpart = casc.mcParticle(); + if (std::abs(mcpart.pdgCode()) == 3312 && mcpart.isPhysicalPrimary()) { + if (mcpart.pdgCode() == 3312) + histos.fill(HIST("Eff/Reco/XiMinus/hCentPtRap"), centVal, casc.pt(), xiY); + else + histos.fill(HIST("Eff/Reco/XiPlus/hCentPtRap"), centVal, casc.pt(), xiY); + } + } + } + + if (bp) { + auto& b = bp->xi; + b.pt = casc.pt(); + b.rap = xiY; + b.mass = casc.mXi(); + b.sign = casc.sign(); + b.cascCosPA = casc.casccosPA(pvX, pvY, pvZ); + b.v0CosPA = casc.v0cosPA(pvX, pvY, pvZ); + b.cascRadius = casc.cascradius(); + b.v0Radius = casc.v0radius(); + b.dcaV0Dau = casc.dcaV0daughters(); + b.dcaCascDau = casc.dcacascdaughters(); + b.dcaV0ToPV = casc.dcav0topv(pvX, pvY, pvZ); + b.dcaPosToPV = casc.dcapostopv(); + b.dcaNegToPV = casc.dcanegtopv(); + b.dcaBachToPV = casc.dcabachtopv(); + b.cent = centVal; + b.pvZ = pvZ; + // MC truth matching + if constexpr (IsMC) { + if (casc.has_mcParticle()) { + auto mcpart = casc.mcParticle(); + b.pdgCode = mcpart.pdgCode(); + b.isPhysPrim = mcpart.isPhysicalPrimary(); + } else { + b.pdgCode = 0; + b.isPhysPrim = false; + } + } else { + b.pdgCode = 0; + b.isPhysPrim = false; + } + treeXi->Fill(); + } + } + } + + // Omega singles: kaon bachelor PID cut distinguishes Omega from Xi + template + void analyzeSinglesOmega(T const& cascades, F const& flagsStart, float pvX, float pvY, float pvZ, float centVal) + { + for (const auto& casc : cascades) { + if ((flagsStart + casc.globalIndex()).isSelected() == 0) + continue; + + float omY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, MassOmegaMinus); + if (std::abs(omY) > maxY) + continue; + + // Require kaon bachelor PID — NSigma lives on the track, not the cascade row + auto bachTrack = casc.template bachelor_as(); + if (std::abs(bachTrack.tpcNSigmaKa()) > tpcNsigmaBachKaon) + continue; + + // QA Filling (mirrors Xi QA under QA/Om/) + histos.fill(HIST("QA/Om/hRadius"), casc.cascradius()); + histos.fill(HIST("QA/Om/hCosPA"), casc.casccosPA(pvX, pvY, pvZ)); + histos.fill(HIST("QA/Om/hDCAV0Dau"), casc.dcaV0daughters()); + histos.fill(HIST("QA/Om/hDCACascDau"), casc.dcacascdaughters()); + histos.fill(HIST("QA/Om/hDCAV0ToPV"), casc.dcav0topv(pvX, pvY, pvZ)); + histos.fill(HIST("QA/Om/hDCAPosToPV"), casc.dcapostopv()); + histos.fill(HIST("QA/Om/hDCANegToPV"), casc.dcanegtopv()); + histos.fill(HIST("QA/Om/hDCABachToPV"), casc.dcabachtopv()); + + if (casc.sign() < 0) { + histos.fill(HIST("Singles/OmegaMinus/hPtVsMass"), casc.mOmega(), casc.pt()); + histos.fill(HIST("Singles/OmegaMinus/hRap"), omY); + } else { + histos.fill(HIST("Singles/OmegaPlus/hPtVsMass"), casc.mOmega(), casc.pt()); + histos.fill(HIST("Singles/OmegaPlus/hRap"), omY); + } + + // MC: fill efficiency numerator for truth-matched primary Omega + if constexpr (IsMC) { + if (casc.has_mcParticle()) { + auto mcpart = casc.mcParticle(); + if (std::abs(mcpart.pdgCode()) == 3334 && mcpart.isPhysicalPrimary()) { + if (mcpart.pdgCode() == 3334) + histos.fill(HIST("Eff/Reco/OmegaMinus/hCentPtRap"), centVal, casc.pt(), omY); + else + histos.fill(HIST("Eff/Reco/OmegaPlus/hCentPtRap"), centVal, casc.pt(), omY); + } + } + } + + if (bp) { + auto& b = bp->om; + b.pt = casc.pt(); + b.rap = omY; + b.mass = casc.mOmega(); + b.sign = casc.sign(); + b.cascCosPA = casc.casccosPA(pvX, pvY, pvZ); + b.v0CosPA = casc.v0cosPA(pvX, pvY, pvZ); + b.cascRadius = casc.cascradius(); + b.v0Radius = casc.v0radius(); + b.dcaV0Dau = casc.dcaV0daughters(); + b.dcaCascDau = casc.dcacascdaughters(); + b.dcaV0ToPV = casc.dcav0topv(pvX, pvY, pvZ); + b.dcaPosToPV = casc.dcapostopv(); + b.dcaNegToPV = casc.dcanegtopv(); + b.dcaBachToPV = casc.dcabachtopv(); + b.cent = centVal; + b.pvZ = pvZ; + // MC truth matching + if constexpr (IsMC) { + if (casc.has_mcParticle()) { + auto mcpart = casc.mcParticle(); + b.pdgCode = mcpart.pdgCode(); + b.isPhysPrim = mcpart.isPhysicalPrimary(); + } else { + b.pdgCode = 0; + b.isPhysPrim = false; + } + } else { + b.pdgCode = 0; + b.isPhysPrim = false; + } + treeOmega->Fill(); + } + } + } + + template + void analyzePairs(L const& lambdas, C const& cascades, F const& flagsStart, float centVal) + { + for (const auto& lam : lambdas) { + if (std::abs(lam.rap()) > maxY) + continue; + float wLam = useEff ? lam.corrFact() : 1.0f; + bool isAntiLam = (lam.v0Type() == 1); + + for (const auto& casc : cascades) { + if ((flagsStart + casc.globalIndex()).isSelected() == 0) + continue; + + float xiY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, MassXi0); + if (std::abs(xiY) > maxY) + continue; + + float dphi = RecoDecay::constrainAngle(casc.phi() - lam.phi(), -PIHalf); + float dy = xiY - lam.rap(); + + bool isXiPlus = (casc.sign() > 0); + + if (!isAntiLam && !isXiPlus) + histos.fill(HIST("Pairs/Lam_XiM/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (!isAntiLam && isXiPlus) + histos.fill(HIST("Pairs/Lam_XiP/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (isAntiLam && !isXiPlus) + histos.fill(HIST("Pairs/AntiLam_XiM/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (isAntiLam && isXiPlus) + histos.fill(HIST("Pairs/AntiLam_XiP/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + } + } + } + + // Omega pair loop: same structure as Xi pairs but uses Omega mass for rapidity + kaon PID + template + void analyzeOmegaPairs(L const& lambdas, C const& cascades, F const& flagsStart, float centVal) + { + for (const auto& lam : lambdas) { + if (std::abs(lam.rap()) > maxY) + continue; + float wLam = useEff ? lam.corrFact() : 1.0f; + bool isAntiLam = (lam.v0Type() == 1); + + for (const auto& casc : cascades) { + if ((flagsStart + casc.globalIndex()).isSelected() == 0) + continue; + + auto bachTrack = casc.template bachelor_as(); + if (std::abs(bachTrack.tpcNSigmaKa()) > tpcNsigmaBachKaon) + continue; + + float omY = RecoDecay::y(std::array{casc.px(), casc.py(), casc.pz()}, MassOmegaMinus); + if (std::abs(omY) > maxY) + continue; + + float dphi = RecoDecay::constrainAngle(casc.phi() - lam.phi(), -PIHalf); + float dy = omY - lam.rap(); + + bool isOmPlus = (casc.sign() > 0); + + if (!isAntiLam && !isOmPlus) + histos.fill(HIST("Pairs/Lam_OmM/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (!isAntiLam && isOmPlus) + histos.fill(HIST("Pairs/Lam_OmP/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (isAntiLam && !isOmPlus) + histos.fill(HIST("Pairs/AntiLam_OmM/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + else if (isAntiLam && isOmPlus) + histos.fill(HIST("Pairs/AntiLam_OmP/hDeltaPhiDeltaY"), centVal, dphi, dy, wLam); + } + } + } + + void processXi(LambdaCollisionsExt::iterator const& lambdacoll, + GoodLambdas const& /*lambdas*/, + aod::CascDataExt const& cascades, + aod::CascadeFlags const& cascflags) + { + histos.fill(HIST("Event/hEventCount"), 0.5); + + auto lambdasInThisEvent = goodLambda->sliceBy(lambdasPerCollision, lambdacoll.globalIndex()); + const int64_t refCollisionIndex = lambdacoll.refCollId(); + auto cascadesInThisEvent = cascades.sliceBy(cascadesPerCollision, refCollisionIndex); + + float pvX = lambdacoll.posX(); + float pvY = lambdacoll.posY(); + float pvZ = lambdacoll.posZ(); + + auto flagsStart = cascflags.begin(); + + analyzeSinglesLambda(lambdasInThisEvent); + float centVal = lambdacoll.cent(); + analyzeSinglesXi(cascadesInThisEvent, flagsStart, pvX, pvY, pvZ, centVal); + analyzePairs(lambdasInThisEvent, cascadesInThisEvent, flagsStart, centVal); + } + PROCESS_SWITCH(LambdaXiCorrelation, processXi, "Λ–Ξ correlation", true); + + void processOmega(LambdaCollisionsExt::iterator const& lambdacoll, + GoodLambdas const& /*lambdas*/, + aod::CascDataExt const& cascades, + aod::CascadeFlags const& cascflags, + FullTracksExtIUWithPID const& /*tracks*/) + { + histos.fill(HIST("Event/hEventCount"), 0.5); + + auto lambdasInThisEvent = goodLambda->sliceBy(lambdasPerCollision, lambdacoll.globalIndex()); + const int64_t refCollisionIndex = lambdacoll.refCollId(); + auto cascadesInThisEvent = cascades.sliceBy(cascadesPerCollision, refCollisionIndex); + + float pvX = lambdacoll.posX(); + float pvY = lambdacoll.posY(); + float pvZ = lambdacoll.posZ(); + + auto flagsStart = cascflags.begin(); + + analyzeSinglesLambda(lambdasInThisEvent); + float centVal = lambdacoll.cent(); + analyzeSinglesOmega(cascadesInThisEvent, flagsStart, pvX, pvY, pvZ, centVal); + analyzeOmegaPairs(lambdasInThisEvent, cascadesInThisEvent, flagsStart, centVal); + } + PROCESS_SWITCH(LambdaXiCorrelation, processOmega, "Λ–Ω correlation", false); + + // --------------------------------------------------------------------------- + // MC Reco-level with truth matching: Λ–Ξ + // Same as processXi but cascades carry McCascLabels → tree gets pdgCode/isPhysPrim. + // --------------------------------------------------------------------------- + void processMCRecoXi(LambdaCollisionsExt::iterator const& lambdacoll, + GoodLambdas const& /*lambdas*/, + LabeledCascades const& cascades, + aod::CascadeFlags const& cascflags, + aod::McParticles const& /*mcparts*/) + { + histos.fill(HIST("Event/hEventCount"), 0.5); + + auto lambdasInThisEvent = goodLambda->sliceBy(lambdasPerCollision, lambdacoll.globalIndex()); + const int64_t refCollisionIndex = lambdacoll.refCollId(); + auto cascadesInThisEvent = cascades.sliceBy(labeledCascPerCollision, refCollisionIndex); + + float pvX = lambdacoll.posX(); + float pvY = lambdacoll.posY(); + float pvZ = lambdacoll.posZ(); + + auto flagsStart = cascflags.begin(); + + analyzeSinglesLambda(lambdasInThisEvent); + float centVal = lambdacoll.cent(); + analyzeSinglesXi(cascadesInThisEvent, flagsStart, pvX, pvY, pvZ, centVal); + analyzePairs(lambdasInThisEvent, cascadesInThisEvent, flagsStart, centVal); + } + PROCESS_SWITCH(LambdaXiCorrelation, processMCRecoXi, "MC reco Λ–Ξ (truth-tagged tree)", false); + + // --------------------------------------------------------------------------- + // MC Reco-level with truth matching: Λ–Ω + // Same as processOmega but cascades carry McCascLabels → tree gets pdgCode/isPhysPrim. + // --------------------------------------------------------------------------- + void processMCRecoOmega(LambdaCollisionsExt::iterator const& lambdacoll, + GoodLambdas const& /*lambdas*/, + LabeledCascades const& cascades, + aod::CascadeFlags const& cascflags, + FullTracksExtIUWithPID const& /*tracks*/, + aod::McParticles const& /*mcparts*/) + { + histos.fill(HIST("Event/hEventCount"), 0.5); + + auto lambdasInThisEvent = goodLambda->sliceBy(lambdasPerCollision, lambdacoll.globalIndex()); + const int64_t refCollisionIndex = lambdacoll.refCollId(); + auto cascadesInThisEvent = cascades.sliceBy(labeledCascPerCollision, refCollisionIndex); + + float pvX = lambdacoll.posX(); + float pvY = lambdacoll.posY(); + float pvZ = lambdacoll.posZ(); + + auto flagsStart = cascflags.begin(); + + analyzeSinglesLambda(lambdasInThisEvent); + float centVal = lambdacoll.cent(); + analyzeSinglesOmega(cascadesInThisEvent, flagsStart, pvX, pvY, pvZ, centVal); + analyzeOmegaPairs(lambdasInThisEvent, cascadesInThisEvent, flagsStart, centVal); + } + PROCESS_SWITCH(LambdaXiCorrelation, processMCRecoOmega, "MC reco Λ–Ω (truth-tagged tree)", false); + + // --------------------------------------------------------------------------- + // MC Gen-level: Λ–Ξ truth correlation (closure test) + // Loops over generator-level primary Λ from LambdaMcGenTracks and + // generator-level Ξ from McParticles (inline PDG == ±3312 check). + // McParticles are sliced per McCollision using the stored refMcCollId. + // No reconstruction, no PID cuts — pure truth-level R2. + // --------------------------------------------------------------------------- + void processMCGenXi(aod::LambdaMcGenCollisions::iterator const& mcgencol, + aod::LambdaMcGenTracks const& genLambdasAll, + aod::McParticles const& allMcParts) + { + int32_t thisColId = mcgencol.globalIndex(); + histos.fill(HIST("Event/hEventCount"), 0.5); + float centVal = mcgencol.cent(); + + // Slice McParticles to only those belonging to this McCollision + int64_t mcCollId = mcgencol.refMcCollId(); + auto genXis = allMcParts.sliceBy(mcParticlesPerMcCollision, mcCollId); + + // Fill gen Lambda singles — filter by collision ID inline + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != (int8_t)kLambda || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + histos.fill(HIST("McGen/Singles/Lambda/hPt"), lam.pt()); + } + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != (int8_t)kAntiLambda || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + histos.fill(HIST("McGen/Singles/AntiLambda/hPt"), lam.pt()); + } + + // Fill gen Xi singles (inline PDG filter) + for (const auto& xi : genXis) { + if (std::abs(xi.pdgCode()) != 3312) + continue; // inline PDG filter + if (!xi.isPhysicalPrimary()) + continue; + float xiY = RecoDecay::y(std::array{xi.px(), xi.py(), xi.pz()}, MassXi0); + if (std::abs(xiY) > maxY) + continue; + if (xi.pdgCode() == 3312) + histos.fill(HIST("McGen/Singles/XiMinus/hPtVsRap"), xiY, xi.pt()); + else if (xi.pdgCode() == -3312) + histos.fill(HIST("McGen/Singles/XiPlus/hPtVsRap"), xiY, xi.pt()); + + // Efficiency denominator: all physical-primary gen Xi in acceptance + if (xi.pdgCode() == 3312) + histos.fill(HIST("Eff/Gen/XiMinus/hCentPtRap"), centVal, xi.pt(), xiY); + else + histos.fill(HIST("Eff/Gen/XiPlus/hCentPtRap"), centVal, xi.pt(), xiY); + + if (bp) { + auto& b = bp->xiGen; + b.pt = xi.pt(); + b.rap = xiY; + b.pdgCode = xi.pdgCode(); + b.isPhysPrim = xi.isPhysicalPrimary(); + b.cent = centVal; + b.pvZ = mcgencol.posZ(); + treeXiGen->Fill(); + } + } + + // Fill gen Lam-Xi pairs + auto fillGenXiPairs = [&](bool isAntiLam) { + int8_t wantType = isAntiLam ? (int8_t)kAntiLambda : (int8_t)kLambda; + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != wantType || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + for (const auto& xi : genXis) { + if (std::abs(xi.pdgCode()) != 3312) + continue; // inline PDG filter + if (!xi.isPhysicalPrimary()) + continue; + float xiY = RecoDecay::y(std::array{xi.px(), xi.py(), xi.pz()}, MassXi0); + if (std::abs(xiY) > maxY) + continue; + float dphi = RecoDecay::constrainAngle(xi.phi() - lam.phi(), -PIHalf); + float dy = xiY - lam.rap(); + bool isXiPlus = (xi.pdgCode() == -3312); + if (!isAntiLam && !isXiPlus) + histos.fill(HIST("McGen/Pairs/Lam_XiM/hDeltaPhiDeltaY"), centVal, dphi, dy); + else if (!isAntiLam && isXiPlus) + histos.fill(HIST("McGen/Pairs/Lam_XiP/hDeltaPhiDeltaY"), centVal, dphi, dy); + else if (isAntiLam && !isXiPlus) + histos.fill(HIST("McGen/Pairs/AntiLam_XiM/hDeltaPhiDeltaY"), centVal, dphi, dy); + else + histos.fill(HIST("McGen/Pairs/AntiLam_XiP/hDeltaPhiDeltaY"), centVal, dphi, dy); + } + } + }; + fillGenXiPairs(false); + fillGenXiPairs(true); + } + PROCESS_SWITCH(LambdaXiCorrelation, processMCGenXi, "MC gen-level Λ–Ξ closure", false); + + // --------------------------------------------------------------------------- + // MC Gen-level: Λ–Ω truth correlation (closure test) + // Same structure as processMCGenXi but uses |PDG| == 3334 (Omega). + // No kaon PID cut needed — truth level. + // --------------------------------------------------------------------------- + void processMCGenOmega(aod::LambdaMcGenCollisions::iterator const& mcgencol, + aod::LambdaMcGenTracks const& genLambdasAll, + aod::McParticles const& allMcParts) + { + int32_t thisColId = mcgencol.globalIndex(); + histos.fill(HIST("Event/hEventCount"), 0.5); + float centVal = mcgencol.cent(); + + // Slice McParticles to only those belonging to this McCollision + int64_t mcCollId = mcgencol.refMcCollId(); + auto genOmegas = allMcParts.sliceBy(mcParticlesPerMcCollision, mcCollId); + + // Fill gen Lambda singles — filter by collision ID inline + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != (int8_t)kLambda || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + histos.fill(HIST("McGen/Singles/Lambda/hPt"), lam.pt()); + } + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != (int8_t)kAntiLambda || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + histos.fill(HIST("McGen/Singles/AntiLambda/hPt"), lam.pt()); + } + + // Fill gen Omega singles (inline PDG filter) + for (const auto& om : genOmegas) { + if (std::abs(om.pdgCode()) != 3334) + continue; // inline PDG filter + if (!om.isPhysicalPrimary()) + continue; + float omY = RecoDecay::y(std::array{om.px(), om.py(), om.pz()}, MassOmegaMinus); + if (std::abs(omY) > maxY) + continue; + if (om.pdgCode() == 3334) + histos.fill(HIST("McGen/Singles/OmegaMinus/hPtVsRap"), omY, om.pt()); + else if (om.pdgCode() == -3334) + histos.fill(HIST("McGen/Singles/OmegaPlus/hPtVsRap"), omY, om.pt()); + + // Efficiency denominator: all physical-primary gen Omega in acceptance + if (om.pdgCode() == 3334) + histos.fill(HIST("Eff/Gen/OmegaMinus/hCentPtRap"), centVal, om.pt(), omY); + else + histos.fill(HIST("Eff/Gen/OmegaPlus/hCentPtRap"), centVal, om.pt(), omY); + + if (bp) { + auto& b = bp->omGen; + b.pt = om.pt(); + b.rap = omY; + b.pdgCode = om.pdgCode(); + b.isPhysPrim = om.isPhysicalPrimary(); + b.cent = centVal; + b.pvZ = mcgencol.posZ(); + treeOmegaGen->Fill(); + } + } + + // Fill gen Lam-Omega pairs + auto fillGenOmPairs = [&](bool isAntiLam) { + int8_t wantType = isAntiLam ? (int8_t)kAntiLambda : (int8_t)kLambda; + for (const auto& lam : genLambdasAll) { + if (lam.lambdaMcGenCollisionId() != thisColId) + continue; + if (lam.v0Type() != wantType || lam.v0PrmScd() != (int8_t)kPrimary) + continue; + if (std::abs(lam.rap()) > maxY) + continue; + for (const auto& om : genOmegas) { + if (std::abs(om.pdgCode()) != 3334) + continue; // inline PDG filter + if (!om.isPhysicalPrimary()) + continue; + float omY = RecoDecay::y(std::array{om.px(), om.py(), om.pz()}, MassOmegaMinus); + if (std::abs(omY) > maxY) + continue; + float dphi = RecoDecay::constrainAngle(om.phi() - lam.phi(), -PIHalf); + float dy = omY - lam.rap(); + bool isOmPlus = (om.pdgCode() == -3334); + if (!isAntiLam && !isOmPlus) + histos.fill(HIST("McGen/Pairs/Lam_OmM/hDeltaPhiDeltaY"), centVal, dphi, dy); + else if (!isAntiLam && isOmPlus) + histos.fill(HIST("McGen/Pairs/Lam_OmP/hDeltaPhiDeltaY"), centVal, dphi, dy); + else if (isAntiLam && !isOmPlus) + histos.fill(HIST("McGen/Pairs/AntiLam_OmM/hDeltaPhiDeltaY"), centVal, dphi, dy); + else + histos.fill(HIST("McGen/Pairs/AntiLam_OmP/hDeltaPhiDeltaY"), centVal, dphi, dy); + } + } + }; + fillGenOmPairs(false); + fillGenOmPairs(true); + } + PROCESS_SWITCH(LambdaXiCorrelation, processMCGenOmega, "MC gen-level Λ–Ω closure", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + + adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + // adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc), + // adaptAnalysisTask(cfgc), + adaptAnalysisTask(cfgc) + + }; +} 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/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx index 977f534729a..9d759b1695a 100644 --- a/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx +++ b/PWGCF/TwoParticleCorrelations/Tasks/longrangecorrDerived.cxx @@ -117,35 +117,35 @@ struct LongrangecorrDerived { OutputObj same{"sameEvent"}; OutputObj mixed{"mixedEvent"}; - using CollsTable = aod::CollLRTables; - using TrksTable = aod::TrkLRTables; - using MftTrksTable = aod::MftTrkLRTables; - using Ft0aTrksTable = aod::Ft0aLRTables; - using Ft0cTrksTable = aod::Ft0cLRTables; - using MftbestTrksTable = aod::MftBestTrkLRTables; - using V0TrksTable = aod::V0TrkLRTables; - - using UpcCollsTable = soa::Join; - using TrksUpcTable = aod::TrkLRUpcTables; - using MftTrksUpcTable = aod::MftTrkLRUpcTables; - using Ft0aTrksUpcTable = aod::Ft0aLRUpcTables; - using Ft0cTrksUpcTable = aod::Ft0cLRUpcTables; - using MftbestTrksUpcTable = aod::MftBestTrkLRUpcTables; - using V0TrksUpcTable = aod::V0TrkLRUpcTables; - - Preslice perColTpc = aod::lrcorrtrktable::collLRTableId; - Preslice perColMft = aod::lrcorrtrktable::collLRTableId; - Preslice perColMftbest = aod::lrcorrtrktable::collLRTableId; - Preslice perColFt0a = aod::lrcorrtrktable::collLRTableId; - Preslice perColFt0c = aod::lrcorrtrktable::collLRTableId; - Preslice perColV0 = aod::lrcorrtrktable::collLRTableId; - - Preslice perUpcColTpc = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColMft = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColMftbest = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColFt0a = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColFt0c = aod::lrcorrtrktable::upcCollLRTableId; - Preslice perUpcColV0 = aod::lrcorrtrktable::upcCollLRTableId; + using CollsTable = aod::LRCollisions; + using TrksTable = aod::LRMidTracks; + using MftTrksTable = aod::LRMftTracks; + using Ft0aTrksTable = aod::LRFt0aTracks; + using Ft0cTrksTable = aod::LRFt0cTracks; + using MftbestTrksTable = aod::LRMftBestTracks; + using V0TrksTable = aod::LRV0Tracks; + + using UpcCollsTable = soa::Join; + using TrksUpcTable = aod::UpcLRMidTracks; + using MftTrksUpcTable = aod::UpcLRMftTracks; + using Ft0aTrksUpcTable = aod::UpcLRFt0aTracks; + using Ft0cTrksUpcTable = aod::UpcLRFt0cTracks; + using MftbestTrksUpcTable = aod::UpcLRMftBestTracks; + using V0TrksUpcTable = aod::UpcLRV0Tracks; + + Preslice perColTpc = aod::lrcorrtrktable::lrCollisionId; + Preslice perColMft = aod::lrcorrtrktable::lrCollisionId; + Preslice perColMftbest = aod::lrcorrtrktable::lrCollisionId; + Preslice perColFt0a = aod::lrcorrtrktable::lrCollisionId; + Preslice perColFt0c = aod::lrcorrtrktable::lrCollisionId; + Preslice perColV0 = aod::lrcorrtrktable::lrCollisionId; + + Preslice perUpcColTpc = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColMft = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColMftbest = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColFt0a = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColFt0c = aod::lrcorrtrktable::upcLRCollisionId; + Preslice perUpcColV0 = aod::lrcorrtrktable::upcLRCollisionId; void init(InitContext const&) { 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..39cee24788c 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 @@ -183,6 +194,7 @@ struct TableMakerMC { // RCT selection struct : ConfigurableGroup { Configurable fConfigUseRCT{"cfgUseRCT", false, "Enable event selection with RCT flags"}; + Configurable fCheckZDC{"cfgCheckZDC", false, "Check ZDC quality in the RCT flag checker"}; Configurable fConfigRCTLabel{"cfgRCTLabel", "CBT", "RCT flag labels : CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo"}; } fConfigRCT; @@ -443,7 +455,7 @@ struct TableMakerMC { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel); + rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); } } 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..3a32c5ca24a 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; @@ -209,6 +221,7 @@ struct TableMaker { // RCT selection struct : ConfigurableGroup { Configurable fConfigUseRCT{"cfgUseRCT", false, "Enable event selection with RCT flags"}; + Configurable fCheckZDC{"cfgCheckZDC", false, "Check ZDC quality in the RCT flag checker"}; Configurable fConfigRCTLabel{"cfgRCTLabel", "CBT", "RCT flag labels : CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo"}; } fConfigRCT; @@ -512,7 +525,7 @@ struct TableMaker { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel); + rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); } } 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 9fe021663bd..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 @@ -1711,11 +1723,14 @@ struct AnalysisSameEventPairing { } else if (sig->GetNProngs() == 2) { histNames += Form("MCTruthGenPair_%s;", sig->GetName()); histNames += Form("MCTruthGenPairSel_%s;", sig->GetName()); + histNames += Form("MCTruthGenPseudoPolPair_%s;", sig->GetName()); + histNames += Form("MCTruthGenPseudoPolPairSel_%s;", sig->GetName()); fHasTwoProngGenMCsignals = true; // for these pair level signals, also add histograms for each MCgenAcc cut if specified if (fUseMCGenAccCut) { for (auto& cut : fMCGenAccCuts) { histNames += Form("MCTruthGenPairSel_%s_%s;", sig->GetName(), cut->GetName()); + histNames += Form("MCTruthGenPseudoPolPairSel_%s_%s;", sig->GetName(), cut->GetName()); } } } @@ -2262,11 +2277,13 @@ struct AnalysisSameEventPairing { VarManager::FillPairMC(t1_raw, t2_raw); // cout << " Filled VarManager for the pair." << endl; fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s", sig->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s", sig->GetName()), VarManager::fgValues); // Fill also acceptance cut histograms if requested if (fUseMCGenAccCut) { for (auto& cut : fMCGenAccCuts) { if (cut->IsSelected(VarManager::fgValues)) { fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s_%s", sig->GetName(), cut->GetName()), VarManager::fgValues); } } } @@ -4668,7 +4685,9 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char if (classStr.Contains("MCTruthGenPair")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_pair", histName); } - + if (classStr.Contains("MCTruthGenPseudoPolPair")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-pseudoproper-gen", histName); + } if (classStr.Contains("MCTruthGenSelBR")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_triple"); } else if (classStr.Contains("MCTruthGen")) { diff --git a/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx b/PWGDQ/Tasks/dqEfficiency_withAssoc_direct.cxx index 4585a894098..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 @@ -1458,6 +1469,7 @@ struct AnalysisSameEventPairing { histNames += Form("MCTruthGenSel_%s;", sig->GetName()); } else if (sig->GetNProngs() == 2) { histNames += Form("MCTruthGenPairSel_%s;", sig->GetName()); + histNames += Form("MCTruthGenPseudoPolPairSel_%s;", sig->GetName()); fHasTwoProngGenMCsignals = true; } } @@ -2070,6 +2082,7 @@ struct AnalysisSameEventPairing { } } fHistMan->FillHistClass(Form("MCTruthGenPairSel_%s", sig->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruthGenPseudoPolPairSel_%s", sig->GetName()), VarManager::fgValues); if (fConfigOptions.fConfigMiniTree) { // WARNING! To be checked dileptonMiniTreeGen(mcDecision, -999, t1_raw.pt(), t1_raw.eta(), t1_raw.phi(), t2_raw.pt(), t2_raw.eta(), t2_raw.phi()); @@ -3056,6 +3069,9 @@ void DefineHistograms(HistogramManager* histMan, TString histClasses, const char if (classStr.Contains("MCTruthGenPair")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_pair", histName); } + if (classStr.Contains("MCTruthGenPseudoPolPair")) { + dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "polarization-pseudoproper-gen", histName); + } if (classStr.Contains("MCTruthGenSelBR")) { dqhistograms::DefineHistograms(histMan, objArray->At(iclass)->GetName(), "mctruth_triple"); 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..9611f690500 100644 --- a/PWGDQ/Tasks/qaMatching.cxx +++ b/PWGDQ/Tasks/qaMatching.cxx @@ -15,31 +15,72 @@ // #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; 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..3fa16a5d80d 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; @@ -273,6 +281,7 @@ struct AnalysisEventSelection { // RCT selection struct : ConfigurableGroup { Configurable fConfigUseRCT{"cfgUseRCT", false, "Enable event selection with RCT flags"}; + Configurable fCheckZDC{"cfgCheckZDC", false, "Check ZDC quality in the RCT flag checker"}; Configurable fConfigRCTLabel{"cfgRCTLabel", "CBT", "RCT flag labels : CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo"}; } fConfigRCT; @@ -396,7 +405,7 @@ struct AnalysisEventSelection { } if (fConfigRCT.fConfigUseRCT.value) { - rctChecker.init(fConfigRCT.fConfigRCTLabel); + rctChecker.init(fConfigRCT.fConfigRCTLabel, fConfigRCT.fCheckZDC.value); } cout << "AnalysisEventSelection::init() completed" << endl; 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 +#include + +#include +#include #include #include diff --git a/PWGEM/Dilepton/Core/DielectronCut.h b/PWGEM/Dilepton/Core/DielectronCut.h index b9179122279..feba64b0410 100644 --- a/PWGEM/Dilepton/Core/DielectronCut.h +++ b/PWGEM/Dilepton/Core/DielectronCut.h @@ -19,21 +19,27 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/DataTypes.h" -#include "Framework/Logger.h" +#include "Common/Core/RecoDecay.h" -#include "Math/Vector4D.h" -#include "TNamed.h" +#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 -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; +#include class DielectronCut : public TNamed { @@ -108,9 +114,9 @@ class DielectronCut : public TNamed ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassElectron); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - float dca_ee_3d = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); - float phiv = getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz); - float opAng = getOpeningAngle(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz()); + float dca_ee_3d = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); + float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), bz); + float opAng = o2::aod::pwgem::dilepton::utils::pairutil::getOpeningAngle(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz()); if (v12.M() < mMinMee || mMaxMee < v12.M()) { return false; @@ -457,7 +463,7 @@ class DielectronCut : public TNamed return mMinChi2PerClusterTPC < track.tpcChi2NCl() && track.tpcChi2NCl() < mMaxChi2PerClusterTPC; case DielectronCuts::kDCA3Dsigma: - return mMinDca3D < dca3DinSigma(track) && dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg + return mMinDca3D < o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) && o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg case DielectronCuts::kDCAxy: return std::fabs(track.dcaXY()) < ((mMaxDcaXYPtDep) ? mMaxDcaXYPtDep(track.pt()) : mMaxDcaXY); diff --git a/PWGEM/Dilepton/Core/Dilepton.h b/PWGEM/Dilepton/Core/Dilepton.h index 5238c549445..b5ba7dad68e 100644 --- a/PWGEM/Dilepton/Core/Dilepton.h +++ b/PWGEM/Dilepton/Core/Dilepton.h @@ -31,273 +31,292 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.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 +#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 -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = soa::Join; +using MyElectrons = o2::soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = soa::Filtered; +using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = soa::Filtered; +using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; -using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; -using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMFwdTrack>; +using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; +using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMFwdTrack>; template struct Dilepton { // Configurables - Configurable ccdburl{"ccdb-url", "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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - Configurable cfgApplySPresolution{"cfgApplySPresolution", false, "flag to apply resolution correction for flow analysis"}; - Configurable spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path to SP resolution file"}; - Configurable spresoHistName{"spresoHistName", "h1_R2_FT0M_BPos_BNeg", "histogram name of SP resolution file"}; - - Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kHFll:5"}; - Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; - Configurable cfgQvecEstimator{"cfgQvecEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; - Configurable ndepth{"ndepth", 1000, "depth for event mixing"}; - Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; - Configurable cfgUseSignedDCA{"cfgUseSignedDCA", false, "flag to use signs in the DCA calculation"}; - Configurable cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; - - ConfigurableAxis ConfMllBins{"ConfMllBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; - ConfigurableAxis ConfPtllBins{"ConfPtllBins", {VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; - ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; - ConfigurableAxis ConfYllBins{"ConYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity - - // ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {VARIABLE_WIDTH, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page. - - ConfigurableAxis ConfSPBins{"ConfSPBins", {200, -5, 5}, "SP bins for flow analysis"}; - ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {20, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; - ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; - ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {15, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + o2::framework::Configurable cfgApplySPresolution{"cfgApplySPresolution", false, "flag to apply resolution correction for flow analysis"}; + o2::framework::Configurable spresoPath{"spresoPath", "Users/d/dsekihat/PWGEM/dilepton/Qvector/resolution/LHC23zzh/pass3/test", "Path to SP resolution file"}; + o2::framework::Configurable spresoHistName{"spresoHistName", "h1_R2_FT0M_BPos_BNeg", "histogram name of SP resolution file"}; + + o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC), "kQC:0, kUPC:1, kFlowV2:2, kFlowV3:3, kPolarization:4, kHFll:5, kBootstrapv2:6"}; + o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; + o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 2, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; + o2::framework::Configurable ndepth{"ndepth", 1000, "depth for event mixing"}; + o2::framework::Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; + o2::framework::ConfigurableAxis ConfVtxBins{"ConfVtxBins", {o2::framework::VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + o2::framework::ConfigurableAxis ConfCentBins{"ConfCentBins", {o2::framework::VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"}; + o2::framework::ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; + o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgUseSignedDCA{"cfgUseSignedDCA", false, "flag to use signs in the DCA calculation"}; + o2::framework::Configurable cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; + + o2::framework::ConfigurableAxis ConfMllBins{"ConfMllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPtllBins{"ConfPtllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {o2::framework::VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfYllBins{"ConYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity + + // o2::framework::ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {o2::framework::VARIABLE_WIDTH, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page. + + o2::framework::ConfigurableAxis ConfSPBins{"ConfSPBins", {200, -5, 5}, "SP bins for flow analysis"}; + o2::framework::ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {20, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; + o2::framework::ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; + o2::framework::ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {15, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> + + o2::framework::Configurable cfgNumBootstrapSamples{"cfgNumBootstrapSamples", 1, "Number of Bootstrap Samples"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; - Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; - Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; - Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; - // Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; - - Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - // Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - // Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + o2::framework::Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + o2::framework::Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; + o2::framework::Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; + // o2::framework::Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; + o2::framework::Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + // o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + // o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; - Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "zorroGroup"; - Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task + o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; - Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; Zorro zorro; @@ -307,11 +326,11 @@ struct Dilepton { o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; @@ -333,7 +352,7 @@ struct Dilepton { float beamP2 = 0.f; // beam momentum TH2D* h2sp_resolution = nullptr; - void init(InitContext& /*context*/) + void init(o2::framework::InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -347,11 +366,11 @@ struct Dilepton { ccdb->setFatalWhenNull(false); rctChecker.init(eventcuts.cfgRCTLabel.value, eventcuts.cfgCheckZDC.value, eventcuts.cfgTreatLimitedAcceptanceAsBad.value); - if (ConfVtxBins.value[0] == VARIABLE_WIDTH) { + if (ConfVtxBins.value[0] == o2::framework::VARIABLE_WIDTH) { zvtx_bin_edges = std::vector(ConfVtxBins.value.begin(), ConfVtxBins.value.end()); zvtx_bin_edges.erase(zvtx_bin_edges.begin()); for (const auto& edge : zvtx_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfVtxBins.value[0]); @@ -364,11 +383,11 @@ struct Dilepton { } } - if (ConfCentBins.value[0] == VARIABLE_WIDTH) { + if (ConfCentBins.value[0] == o2::framework::VARIABLE_WIDTH) { cent_bin_edges = std::vector(ConfCentBins.value.begin(), ConfCentBins.value.end()); cent_bin_edges.erase(cent_bin_edges.begin()); for (const auto& edge : cent_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: cent_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: cent_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfCentBins.value[0]); @@ -381,11 +400,11 @@ struct Dilepton { } } - if (ConfEPBins.value[0] == VARIABLE_WIDTH) { + if (ConfEPBins.value[0] == o2::framework::VARIABLE_WIDTH) { ep_bin_edges = std::vector(ConfEPBins.value.begin(), ConfEPBins.value.end()); ep_bin_edges.erase(ep_bin_edges.begin()); for (const auto& edge : ep_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: ep_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: ep_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfEPBins.value[0]); @@ -399,11 +418,11 @@ struct Dilepton { } LOGF(info, "cfgOccupancyEstimator = %d", cfgOccupancyEstimator.value); - if (ConfOccupancyBins.value[0] == VARIABLE_WIDTH) { + if (ConfOccupancyBins.value[0] == o2::framework::VARIABLE_WIDTH) { occ_bin_edges = std::vector(ConfOccupancyBins.value.begin(), ConfOccupancyBins.value.end()); occ_bin_edges.erase(occ_bin_edges.begin()); for (const auto& edge : occ_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: occ_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: occ_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfOccupancyBins.value[0]); @@ -431,23 +450,23 @@ struct Dilepton { leptonM2 = o2::constants::physics::MassMuon; } - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); if (doprocessTriggerAnalysis) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value.data()); - fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 } if (doprocessNorm) { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); - fRegistry.add("Event/norm/hZvtx", "hZvtx;Z_{vtx} (cm)", kTH1D, {{100, -50, +50}}, false); + fRegistry.add("Event/norm/hZvtx", "hZvtx;Z_{vtx} (cm)", o2::framework::kTH1D, {{100, -50, +50}}, false); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -580,27 +599,27 @@ struct Dilepton { } // pair info - const AxisSpec axis_mass{ConfMllBins, mass_axis_title}; - const AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; - const AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; - const AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; + const o2::framework::AxisSpec axis_mass{ConfMllBins, mass_axis_title}; + const o2::framework::AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; + const o2::framework::AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; + const o2::framework::AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); - fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", kTH2D, {{180, -M_PI, M_PI}, {400, -2, +2}}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/same/uls/hDeltaEtaDeltaPhi", "#Delta#eta-#Delta#varphi between 2 tracks;#Delta#varphi (rad.);#Delta#eta;", o2::framework::kTH2D, {{180, -M_PI, M_PI}, {400, -2, +2}}, true); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron - fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", kTH2D, {{200, -10, 10.0}, {200, -10, 10}}, true); + fRegistry.add("Pair/same/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi_{V} (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); // phiv is only for dielectron + fRegistry.add("Pair/same/uls/hMvsOpAng", "m_{ee} vs. angle between 2 tracks;#omega (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2D, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/same/uls/hDCA1vsDCA2", "DCA of leg1 vs. DCA of leg2;DCA1(#sigma);DCA2 (#sigma)", o2::framework::kTH2D, {{200, -10, 10.0}, {200, -10, 10}}, true); } fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kUPC)) { - const AxisSpec axis_aco{10, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; - const AxisSpec axis_asym_pt{10, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; - const AxisSpec axis_dphi_e_ee{18, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; + const o2::framework::AxisSpec axis_aco{10, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; + const o2::framework::AxisSpec axis_asym_pt{10, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; + const o2::framework::AxisSpec axis_dphi_e_ee{18, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; std::string frameName = "CS"; if (cfgPolarizationFrame == 0) { @@ -610,8 +629,8 @@ struct Dilepton { } else { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } - const AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_cos_theta}, true); + const o2::framework::AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_cos_theta}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -622,13 +641,13 @@ struct Dilepton { nmod = 3; } - const AxisSpec axis_sp{ConfSPBins, Form("#vec{u}_{%d,ll} #upoint #vec{Q}_{%d}^{%s}", nmod, nmod, qvec_det_names[cfgQvecEstimator].data())}; + const o2::framework::AxisSpec axis_sp{ConfSPBins, Form("#vec{u}_{%d,ll} #upoint #vec{Q}_{%d}^{%s}", nmod, nmod, qvec_det_names[cfgQvecEstimator].data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); - fRegistry.add("Pair/mix/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); @@ -642,23 +661,34 @@ struct Dilepton { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } - const AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; - const AxisSpec axis_phi{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; - const AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_cos_theta, axis_phi, axis_quadmom}, true); + const o2::framework::AxisSpec axis_cos_theta{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; + const o2::framework::AxisSpec axis_phi{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; + const o2::framework::AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_cos_theta, axis_phi, axis_quadmom}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kHFll)) { - const AxisSpec axis_dphi_ee{36, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll - const AxisSpec axis_deta_ee{40, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_dphi_ee, axis_deta_ee}, true); + const o2::framework::AxisSpec axis_dphi_ee{36, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll + const o2::framework::AxisSpec axis_deta_ee{40, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_dphi_ee, axis_deta_ee}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kBootstrapv2)) { + nmod = 2; + const o2::framework::AxisSpec axis_sp{ConfSPBins, Form("#vec{u}_{%d,ll} #upoint #vec{Q}_{%d}^{%s}", nmod, nmod, qvec_det_names[cfgQvecEstimator].data())}; + const o2::framework::AxisSpec axis_bootstrap{cfgNumBootstrapSamples, 0.5, static_cast(cfgNumBootstrapSamples) + 0.5, "sample"}; // for bootstrap samples + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_sp, axis_bootstrap}, true); + fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); + fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); + fRegistry.add("Pair/mix/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lspp/"); + fRegistry.addClone("Pair/mix/uls/", "Pair/mix/lsmm/"); + o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistogramsBootstrap(&fRegistry, cfgNumBootstrapSamples); } else { // same as kQC to avoid seg. fault - fRegistry.add("Pair/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Pair/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Pair/same/uls/", "Pair/same/lspp/"); fRegistry.addClone("Pair/same/uls/", "Pair/same/lsmm/"); fRegistry.addClone("Pair/same/", "Pair/mix/"); @@ -672,8 +702,8 @@ struct Dilepton { } else { o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); } - fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); - fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); } void DefineEMEventCut() @@ -828,7 +858,7 @@ struct Dilepton { } template - bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&) + bool fillPairInfo(TCollision const& collision, TTrack1 const& t1, TTrack2 const& t2, TCut const& cut, TAllTracks const&, const std::vector weightvector) { if constexpr (ev_id == 0) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -883,25 +913,25 @@ struct Dilepton { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (cfgUseSignedDCA) { - pair_dca = pairDCASignQuadSum(dca3DinSigma(t1), dca3DinSigma(t2), t1.sign(), t2.sign()); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCASignQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2), t1.sign(), t2.sign()); } else { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); } if (cfgDCAType == 1) { if (cfgUseSignedDCA) { - pair_dca = pairDCASignQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2), t1.sign(), t2.sign()); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCASignQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), t1.sign(), t2.sign()); } else { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2)); } } else if (cfgDCAType == 2) { if (cfgUseSignedDCA) { - pair_dca = pairDCASignQuadSum(dcaZinSigma(t1), dcaZinSigma(t2), t1.sign(), t2.sign()); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCASignQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2), t1.sign(), t2.sign()); } else { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2)); } if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kQC)) { @@ -919,9 +949,9 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsPhiV"), phiv, v12.M(), weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hMvsOpAng"), opAng, v12.M(), weight); if (cfgDCAType == 1) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2), weight); } } } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ @@ -931,9 +961,9 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsPhiV"), phiv, v12.M(), weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hMvsOpAng"), opAng, v12.M(), weight); if (cfgDCAType == 1) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2), weight); } } } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- @@ -943,9 +973,9 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsPhiV"), phiv, v12.M(), weight); fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hMvsOpAng"), opAng, v12.M(), weight); if (cfgDCAType == 1) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), dcaXYinSigma(t1), dcaXYinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2), weight); } else if (cfgDCAType == 2) { - fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), dcaZinSigma(t1), dcaZinSigma(t2), weight); + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hDCA1vsDCA2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2), weight); } } } @@ -1041,7 +1071,6 @@ struct Dilepton { } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), cos_thetaPol, phiPol, quadmom, weight); } - } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kHFll)) { float dphi = v1.Phi() - v2.Phi(); dphi = RecoDecay::constrainAngle(dphi, -o2::constants::math::PIHalf); @@ -1055,6 +1084,51 @@ struct Dilepton { fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), dphi, deta, weight); } + } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kBootstrapv2)) { + std::array q2ft0m = {collision.q2xft0m(), collision.q2yft0m()}; + std::array q2ft0a = {collision.q2xft0a(), collision.q2yft0a()}; + std::array q2ft0c = {collision.q2xft0c(), collision.q2yft0c()}; + std::array q2btot = {collision.q2xbtot(), collision.q2ybtot()}; + std::array q2bpos = {collision.q2xbpos(), collision.q2ybpos()}; + std::array q2bneg = {collision.q2xbneg(), collision.q2ybneg()}; + std::array q2fv0a = {collision.q2xfv0a(), collision.q2yfv0a()}; + std::array q3ft0m = {collision.q3xft0m(), collision.q3yft0m()}; + std::array q3ft0a = {collision.q3xft0a(), collision.q3yft0a()}; + std::array q3ft0c = {collision.q3xft0c(), collision.q3yft0c()}; + std::array q3btot = {collision.q3xbtot(), collision.q3ybtot()}; + std::array q3bpos = {collision.q3xbpos(), collision.q3ybpos()}; + std::array q3bneg = {collision.q3xbneg(), collision.q3ybneg()}; + std::array q3fv0a = {collision.q3xfv0a(), collision.q3yfv0a()}; + + std::vector>> qvectors = { + {{999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}}, // 0th harmonics + {{999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}, {999.f, 999.f}}, // 1st harmonics + {q2ft0m, q2ft0a, q2ft0c, q2btot, q2bpos, q2bneg, q2fv0a}, // 2nd harmonics + {q3ft0m, q3ft0a, q3ft0c, q3btot, q3bpos, q3bneg, q3fv0a}, // 3rd harmonics + }; + + if constexpr (ev_id == 0) { + // LOGF(info, "collision.centFT0C() = %f, collision.trackOccupancyInTimeRange() = %d, getSPresolution = %f", collision.centFT0C(), collision.trackOccupancyInTimeRange(), getSPresolution(collision.centFT0C(), collision.trackOccupancyInTimeRange())); + + float sp = RecoDecay::dotProd(std::array{static_cast(std::cos(nmod * v12.Phi())), static_cast(std::sin(nmod * v12.Phi()))}, qvectors[nmod][cfgQvecEstimator]) / getSPresolution(collision.centFT0C(), collision.trackOccupancyInTimeRange()); + for (int i = 0; i < cfgNumBootstrapSamples; i++) { + if (t1.sign() * t2.sign() < 0) { // ULS + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), sp, i + 0.5, weightvector.at(i)); + } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), sp, i + 0.5, weightvector.at(i)); + } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), sp, i + 0.5, weightvector.at(i)); + } + } + } else if constexpr (ev_id == 1) { + if (t1.sign() * t2.sign() < 0) { // ULS + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lspp/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- + fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("lsmm/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); + } + } } else { // same as kQC to avoid seg. fault if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/") + HIST(event_pair_types[ev_id]) + HIST("uls/hs"), v12.M(), v12.Pt(), pair_dca, v12.Rapidity(), weight); @@ -1074,9 +1148,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); } } } @@ -1084,9 +1158,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); } } } @@ -1095,9 +1169,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); } } } @@ -1105,9 +1179,9 @@ struct Dilepton { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); } } } @@ -1116,48 +1190,48 @@ struct Dilepton { return true; } - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; - - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; - Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); - - Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfb >= static_cast(0)); - - Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); - Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); - - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimarymuon::pfbderived >= static_cast(0)); - - Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); - Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; + + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); + + o2::framework::expressions::Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfb >= static_cast(0)); + + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); + + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimarymuon::pfbderived >= static_cast(0)); + + o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); + o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); TEMH* emh_pos = nullptr; TEMH* emh_neg = nullptr; @@ -1250,6 +1324,20 @@ struct Dilepton { } } + std::vector bootstrapweights = {}; + if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonAnalysisType::kBootstrapv2)) { // bootstrapping for accepted events + int randomSeed = static_cast(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + TRandom3 randomNumber(randomSeed); + for (int i = 0; i < cfgNumBootstrapSamples; i++) { + float poissonweight = 0.; + poissonweight = static_cast(randomNumber.PoissonD(1.0)); + bootstrapweights.push_back(poissonweight); + o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfoBootstrap(&fRegistry, collision, i, poissonweight); + } + } else { + bootstrapweights.push_back(1.0); // to pass as non-empyt dummy to use + } + if (nmod == 2) { o2::aod::pwgem::dilepton::utils::eventhistogram::fillEventInfo<1, 2>(&fRegistry, collision); } else if (nmod == 3) { @@ -1269,20 +1357,20 @@ struct Dilepton { used_trackIds_per_col.reserve(posTracks_per_coll.size() + negTracks_per_coll.size()); int nuls = 0, nlspp = 0, nlsmm = 0; - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS - bool is_pair_ok = fillPairInfo<0>(collision, pos, neg, cut, tracks); + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + bool is_pair_ok = fillPairInfo<0>(collision, pos, neg, cut, tracks, bootstrapweights); if (is_pair_ok) { nuls++; } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ - bool is_pair_ok = fillPairInfo<0>(collision, pos1, pos2, cut, tracks); + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + bool is_pair_ok = fillPairInfo<0>(collision, pos1, pos2, cut, tracks, bootstrapweights); if (is_pair_ok) { nlspp++; } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- - bool is_pair_ok = fillPairInfo<0>(collision, neg1, neg2, cut, tracks); + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + bool is_pair_ok = fillPairInfo<0>(collision, neg1, neg2, cut, tracks, bootstrapweights); if (is_pair_ok) { nlsmm++; } @@ -1364,25 +1452,25 @@ struct Dilepton { for (const auto& pos : selected_posTracks_in_this_event) { // ULS mix for (const auto& neg : negTracks_from_event_pool) { - fillPairInfo<1>(collision, pos, neg, cut, nullptr); + fillPairInfo<1>(collision, pos, neg, cut, nullptr, bootstrapweights); } } for (const auto& neg : selected_negTracks_in_this_event) { // ULS mix for (const auto& pos : posTracks_from_event_pool) { - fillPairInfo<1>(collision, neg, pos, cut, nullptr); + fillPairInfo<1>(collision, neg, pos, cut, nullptr, bootstrapweights); } } for (const auto& pos1 : selected_posTracks_in_this_event) { // LS++ mix for (const auto& pos2 : posTracks_from_event_pool) { - fillPairInfo<1>(collision, pos1, pos2, cut, nullptr); + fillPairInfo<1>(collision, pos1, pos2, cut, nullptr, bootstrapweights); } } for (const auto& neg1 : selected_negTracks_in_this_event) { // LS-- mix for (const auto& neg2 : negTracks_from_event_pool) { - fillPairInfo<1>(collision, neg1, neg2, cut, nullptr); + fillPairInfo<1>(collision, neg1, neg2, cut, nullptr, bootstrapweights); } } } // end of loop over mixed event pool @@ -1494,17 +1582,17 @@ struct Dilepton { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS if (isPairOK(pos, neg, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ if (isPairOK(pos1, pos2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- if (isPairOK(neg1, neg2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } @@ -1556,7 +1644,7 @@ struct Dilepton { runPairing(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1578,7 +1666,7 @@ struct Dilepton { runPairing(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, electrons); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1590,7 +1678,7 @@ struct Dilepton { } PROCESS_SWITCH(Dilepton, processTriggerAnalysis, "run dilepton analysis on triggered data", false); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { if (collision.centFT0C() < eventcuts.cfgCentMin || eventcuts.cfgCentMax < collision.centFT0C()) { @@ -1664,7 +1752,7 @@ struct Dilepton { } PROCESS_SWITCH(Dilepton, processNorm, "process normalization info", false); - void processBC(aod::EMBCs const& bcs) + void processBC(o2::aod::EMBCs const& bcs) { for (const auto& bc : bcs) { if (bc.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { diff --git a/PWGEM/Dilepton/Core/DileptonHadronMPC.h b/PWGEM/Dilepton/Core/DileptonHadronMPC.h index e6d7eb0960e..d93d829ecdb 100644 --- a/PWGEM/Dilepton/Core/DileptonHadronMPC.h +++ b/PWGEM/Dilepton/Core/DileptonHadronMPC.h @@ -32,281 +32,291 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.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 + +#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 -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = soa::Join; +using MyElectrons = o2::soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = soa::Filtered; +using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = soa::Filtered; +using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; -using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; -using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMFwdTrack>; -using MyEMH_track = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; // for charged track +using MyEMH_electron = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; +using MyEMH_muon = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMFwdTrack>; +using MyEMH_track = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; // for charged track template struct DileptonHadronMPC { // Configurables - Configurable ccdburl{"ccdb-url", "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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation), "kAzimuthalCorrelation:0, kCumulant:1"}; - Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing between 2 leptons (i.e. R factor)"}; - Configurable ndepth_lepton{"ndepth_lepton", 100, "depth for event mixing between lepton-lepton"}; - Configurable ndepth_hadron{"ndepth_hadron", 10, "depth for event mixing between hadron-hadron"}; - Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgAnalysisType{"cfgAnalysisType", static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation), "kAzimuthalCorrelation:0, kCumulant:1"}; + o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5, FV0A:6"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing between 2 leptons (i.e. R factor)"}; + o2::framework::Configurable ndepth_lepton{"ndepth_lepton", 100, "depth for event mixing between lepton-lepton"}; + o2::framework::Configurable ndepth_hadron{"ndepth_hadron", 10, "depth for event mixing between hadron-hadron"}; + o2::framework::Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; + o2::framework::ConfigurableAxis ConfVtxBins{"ConfVtxBins", {o2::framework::VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + o2::framework::ConfigurableAxis ConfCentBins{"ConfCentBins", {o2::framework::VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"}; + o2::framework::ConfigurableAxis ConfEPBins{"ConfEPBins", {16, -M_PI / 2, +M_PI / 2}, "Mixing bins - event plane angle"}; + o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; // Configurable cfgNtracksPV08Min{"cfgNtracksPV08Min", -1, "min. multNTracksPV"}; // Configurable cfgNtracksPV08Max{"cfgNtracksPV08Max", static_cast(1e+9), "max. multNTracksPV"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; - ConfigurableAxis ConfMllBins{"ConfMllBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; - ConfigurableAxis ConfPtllBins{"ConfPtllBins", {VARIABLE_WIDTH, 0.00, 0.15, 0.50, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; - ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {VARIABLE_WIDTH, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfMllBins{"ConfMllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPtllBins{"ConfPtllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.15, 0.50, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {o2::framework::VARIABLE_WIDTH, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; - ConfigurableAxis ConfPtHadronBins{"ConfPtHadronBins", {50, 0, 5}, "pT,h bins for output histograms"}; - ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity - ConfigurableAxis ConfDEtaBins{"ConfDEtaBins", {120, -6, 6}, "deta bins for output histograms"}; - Configurable cfgNbinsDPhi{"cfgNbinsDPhi", 36, "nbins in dphi for output histograms"}; - Configurable cfgNbinsCosNDPhi{"cfgNbinsCosNDPhi", 200, "nbins in cos(n(dphi)) for output histograms"}; - Configurable cfgNmod{"cfgNmod", 2, "n-th harmonics"}; + o2::framework::ConfigurableAxis ConfPtHadronBins{"ConfPtHadronBins", {50, 0, 5}, "pT,h bins for output histograms"}; + o2::framework::ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, 1.f}, "yll bins for output histograms"}; // pair rapidity + o2::framework::ConfigurableAxis ConfDEtaBins{"ConfDEtaBins", {120, -6, 6}, "deta bins for output histograms"}; + o2::framework::Configurable cfgNbinsDPhi{"cfgNbinsDPhi", 36, "nbins in dphi for output histograms"}; + o2::framework::Configurable cfgNbinsCosNDPhi{"cfgNbinsCosNDPhi", 200, "nbins in cos(n(dphi)) for output histograms"}; + o2::framework::Configurable cfgNmod{"cfgNmod", 2, "n-th harmonics"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; - Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; - Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; - Configurable cfg_apply_detadphiposition{"cfg_apply_detadphiposition", false, "flag to apply deta-dphi elliptic cut at certain radius"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply pair cut same as prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfgRefR{"cfgRefR", 0.5, "reference R (in m) for extrapolation"}; // https://cds.cern.ch/record/1419204 - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", false, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + o2::framework::Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + o2::framework::Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; + o2::framework::Configurable cfg_apply_detadphiposition{"cfg_apply_detadphiposition", false, "flag to apply deta-dphi elliptic cut at certain radius"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; + o2::framework::Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply pair cut same as prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.5, "reference R (in m) for extrapolation"}; // https://cds.cern.ch/record/1419204 + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", false, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; - Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", false, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", false, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; EMTrackCut fEMTrackCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "trackcut_group"; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for ref. track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 3.0, "max pT for ref. track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for ref. track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for ref. track"}; - // Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.0, "min phi for ref. track"}; - // Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for ref. track"}; - Configurable cfg_track_bits{"cfg_track_bits", 0, "required track bits"}; - Configurable cfg_reftrack_type{"cfg_reftrack_type", 0, "ref. track type for 2PC. 0:kCB, 1:kMFTsa"}; // this is unique in the derived data. Check which track type you store as aod::EMPrimaryTracks. + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for ref. track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 3.0, "max pT for ref. track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for ref. track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for ref. track"}; + // o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.0, "min phi for ref. track"}; + // o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for ref. track"}; + o2::framework::Configurable cfg_track_bits{"cfg_track_bits", 0, "required track bits"}; + o2::framework::Configurable cfg_reftrack_type{"cfg_reftrack_type", 0, "ref. track type for 2PC. 0:kCB, 1:kMFTsa"}; // this is unique in the derived data. Check which track type you store as aod::EMPrimaryTracks. } trackcuts; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "zorroGroup"; - Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name"}; // 1 trigger per 1 task + o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name"}; // 1 trigger per 1 task o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; - Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; Zorro zorro; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; @@ -317,7 +327,7 @@ struct DileptonHadronMPC { float leptonM1 = 0.f; float leptonM2 = 0.f; - void init(InitContext& /*context*/) + void init(o2::framework::InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -328,11 +338,11 @@ struct DileptonHadronMPC { ccdb->setFatalWhenNull(false); rctChecker.init(eventcuts.cfgRCTLabel.value, eventcuts.cfgCheckZDC.value, eventcuts.cfgTreatLimitedAcceptanceAsBad.value); - if (ConfVtxBins.value[0] == VARIABLE_WIDTH) { + if (ConfVtxBins.value[0] == o2::framework::VARIABLE_WIDTH) { zvtx_bin_edges = std::vector(ConfVtxBins.value.begin(), ConfVtxBins.value.end()); zvtx_bin_edges.erase(zvtx_bin_edges.begin()); for (const auto& edge : zvtx_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: zvtx_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfVtxBins.value[0]); @@ -345,11 +355,11 @@ struct DileptonHadronMPC { } } - if (ConfCentBins.value[0] == VARIABLE_WIDTH) { + if (ConfCentBins.value[0] == o2::framework::VARIABLE_WIDTH) { cent_bin_edges = std::vector(ConfCentBins.value.begin(), ConfCentBins.value.end()); cent_bin_edges.erase(cent_bin_edges.begin()); for (const auto& edge : cent_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: cent_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: cent_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfCentBins.value[0]); @@ -362,11 +372,11 @@ struct DileptonHadronMPC { } } - if (ConfEPBins.value[0] == VARIABLE_WIDTH) { + if (ConfEPBins.value[0] == o2::framework::VARIABLE_WIDTH) { ep_bin_edges = std::vector(ConfEPBins.value.begin(), ConfEPBins.value.end()); ep_bin_edges.erase(ep_bin_edges.begin()); for (const auto& edge : ep_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: ep_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: ep_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfEPBins.value[0]); @@ -380,11 +390,11 @@ struct DileptonHadronMPC { } LOGF(info, "cfgOccupancyEstimator = %d", cfgOccupancyEstimator.value); - if (ConfOccupancyBins.value[0] == VARIABLE_WIDTH) { + if (ConfOccupancyBins.value[0] == o2::framework::VARIABLE_WIDTH) { occ_bin_edges = std::vector(ConfOccupancyBins.value.begin(), ConfOccupancyBins.value.end()); occ_bin_edges.erase(occ_bin_edges.begin()); for (const auto& edge : occ_bin_edges) { - LOGF(info, "VARIABLE_WIDTH: occ_bin_edges = %f", edge); + LOGF(info, "o2::framework::VARIABLE_WIDTH: occ_bin_edges = %f", edge); } } else { int nbins = static_cast(ConfOccupancyBins.value[0]); @@ -416,10 +426,10 @@ struct DileptonHadronMPC { if (doprocessTriggerAnalysis) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value); - fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", kTProfile, {{80000, 520000.5, 600000.5}}, true); - auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", zorroGroup.cfg_swt_name.value.data()), kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); + fRegistry.add("NormTrigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); + fRegistry.add("NormTrigger/hScalers", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); + fRegistry.add("NormTrigger/hSelections", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{80000, 520000.5, 600000.5}}, true); + auto hTriggerCounter = fRegistry.add("NormTrigger/hTriggerCounter", Form("trigger counter of %s;run number;", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH2D, {{80000, 520000.5, 600000.5}, {2, -0.5, 1.5}}, false); hTriggerCounter->GetYaxis()->SetBinLabel(1, "Analyzed Trigger"); hTriggerCounter->GetYaxis()->SetBinLabel(2, "Analyzed TOI"); } @@ -494,7 +504,7 @@ struct DileptonHadronMPC { static constexpr std::string_view qvec_det_names[7] = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg", "FV0A"}; // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); - fRegistry.add("Event/after/hMultNTracksPV_RefTracks", "Track mult. correlation;N_{track}^{PV};N_{track} for ref. flow", kTH2D, {{501, -0.5, 500.5}, {501, -0.5, 500.5}}, false); + fRegistry.add("Event/after/hMultNTracksPV_RefTracks", "Track mult. correlation;N_{track}^{PV};N_{track} for ref. flow", o2::framework::kTH2D, {{501, -0.5, 500.5}, {501, -0.5, 500.5}}, false); std::string mass_axis_title = "m_{ll} (GeV/c^{2})"; std::string pair_pt_axis_title = "p_{T,ll} (GeV/c)"; @@ -528,59 +538,59 @@ struct DileptonHadronMPC { } // dilepton info - const AxisSpec axis_mass{ConfMllBins, mass_axis_title}; - const AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; - const AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; - const AxisSpec axis_y{ConfYllBins, pair_rapidity_axis_title}; + const o2::framework::AxisSpec axis_mass{ConfMllBins, mass_axis_title}; + const o2::framework::AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; + const o2::framework::AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; + const o2::framework::AxisSpec axis_y{ConfYllBins, pair_rapidity_axis_title}; // dilepton-hadron info - const AxisSpec axis_deta{ConfDEtaBins, deta_axis_title}; + const o2::framework::AxisSpec axis_deta{ConfDEtaBins, deta_axis_title}; // hadron-hadron info - const AxisSpec axis_deta_hh{40, -2, +2, "#Delta#eta = #eta_{h}^{ref1} - #eta_{h}^{ref2}"}; + const o2::framework::AxisSpec axis_deta_hh{40, -2, +2, "#Delta#eta = #eta_{h}^{ref1} - #eta_{h}^{ref2}"}; - const AxisSpec axis_pt_trg{ConfPtHadronBins, "p_{T,h} (GeV/c)"}; - const AxisSpec axis_eta_trg{40, -2, +2, "#eta_{h}"}; - const AxisSpec axis_phi_trg{36, 0, 2 * M_PI, "#varphi_{h} (rad.)"}; - fRegistry.add("Hadron/hs", "hadron", kTHnSparseD, {axis_pt_trg, axis_eta_trg, axis_phi_trg}, false); - fRegistry.add("Hadron/hTrackBit", "track bit", kTH1D, {{65536, -0.5, 65535.5}}, false); + const o2::framework::AxisSpec axis_pt_trg{ConfPtHadronBins, "p_{T,h} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta_trg{40, -2, +2, "#eta_{h}"}; + const o2::framework::AxisSpec axis_phi_trg{36, 0, 2 * M_PI, "#varphi_{h} (rad.)"}; + fRegistry.add("Hadron/hs", "hadron", o2::framework::kTHnSparseD, {axis_pt_trg, axis_eta_trg, axis_phi_trg}, false); + fRegistry.add("Hadron/hTrackBit", "track bit", o2::framework::kTH1D, {{65536, -0.5, 65535.5}}, false); - fRegistry.add("Dilepton/same/uls/hs", "dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); + fRegistry.add("Dilepton/same/uls/hs", "dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y}, true); fRegistry.addClone("Dilepton/same/uls/", "Dilepton/same/lspp/"); fRegistry.addClone("Dilepton/same/uls/", "Dilepton/same/lsmm/"); fRegistry.addClone("Dilepton/same/", "Dilepton/mix/"); if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { - const AxisSpec axis_dphi{cfgNbinsDPhi, -M_PI / 2, 3 * M_PI / 2, dphi_axis_title}; + const o2::framework::AxisSpec axis_dphi{cfgNbinsDPhi, -M_PI / 2, 3 * M_PI / 2, dphi_axis_title}; // dilepton-hadron - fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_dphi}, true); + fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_dphi}, true); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lspp/"); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lsmm/"); fRegistry.addClone("DileptonHadron/same/", "DileptonHadron/mix/"); - fRegistry.add("DileptonHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("DileptonHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); // hadron-hadron - const AxisSpec axis_dphi_hh{90, -M_PI / 2, 3 * M_PI / 2, "#Delta#varphi = #varphi_{h}^{ref1} - #varphi_{h}^{ref2} (rad.)"}; - fRegistry.add("HadronHadron/same/hDEtaDPhi", "hadron-hadron 2PC", kTH2D, {axis_dphi_hh, axis_deta_hh}, true); + const o2::framework::AxisSpec axis_dphi_hh{90, -M_PI / 2, 3 * M_PI / 2, "#Delta#varphi = #varphi_{h}^{ref1} - #varphi_{h}^{ref2} (rad.)"}; + fRegistry.add("HadronHadron/same/hDEtaDPhi", "hadron-hadron 2PC", o2::framework::kTH2D, {axis_dphi_hh, axis_deta_hh}, true); fRegistry.addClone("HadronHadron/same/", "HadronHadron/mix/"); - fRegistry.add("HadronHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("HadronHadron/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); } else if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kCumulant)) { - const AxisSpec axis_cos_ndphi{cfgNbinsCosNDPhi, -1, +1, cosndphi_axis_title}; + const o2::framework::AxisSpec axis_cos_ndphi{cfgNbinsCosNDPhi, -1, +1, cosndphi_axis_title}; // dilepton-hadron - fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_cos_ndphi}, true); + fRegistry.add("DileptonHadron/same/uls/hs", "dilepton-hadron 2PC", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_dca, axis_y, axis_deta, axis_cos_ndphi}, true); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lspp/"); fRegistry.addClone("DileptonHadron/same/uls/", "DileptonHadron/same/lsmm/"); fRegistry.addClone("DileptonHadron/same/", "DileptonHadron/mix/"); // hadron-hadron - const AxisSpec axis_cosndphi_hh{cfgNbinsCosNDPhi, -1, +1, std::format("cos({0:d}(#varphi_{{h}}^{{ref1}} - #varphi_{{h}}^{{ref2}}))", cfgNmod.value)}; - fRegistry.add("HadronHadron/same/hDEtaCosNDPhi", "hadron-hadron 2PC", kTH2D, {axis_cosndphi_hh, axis_deta_hh}, true); + const o2::framework::AxisSpec axis_cosndphi_hh{cfgNbinsCosNDPhi, -1, +1, std::format("cos({0:d}(#varphi_{{h}}^{{ref1}} - #varphi_{{h}}^{{ref2}}))", cfgNmod.value)}; + fRegistry.add("HadronHadron/same/hDEtaCosNDPhi", "hadron-hadron 2PC", o2::framework::kTH2D, {axis_cosndphi_hh, axis_deta_hh}, true); } - fRegistry.add("Dilepton/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Dilepton/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); - fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); - fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/before/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); + fRegistry.add("Event/after/hEP2_CentFT0C_forMix", Form("2nd harmonics event plane for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", qvec_det_names[cfgEP2Estimator_for_Mix].data()), o2::framework::kTH2F, {{110, 0, 110}, {180, -M_PI_2, +M_PI_2}}, false); } void DefineEMEventCut() @@ -762,14 +772,14 @@ struct DileptonHadronMPC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); if (cfgDCAType == 1) { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2)); } if (t1.sign() * t2.sign() < 0) { // ULS @@ -789,9 +799,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.dcaXY(), t1.dcaZ(), t1.cYY(), t1.cZY(), t1.cZZ())); } } } @@ -799,9 +809,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.dcaXY(), t2.dcaZ(), t2.cYY(), t2.cZY(), t2.cZZ())); } } } @@ -810,9 +820,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t1.globalIndex()); if (cfgDoMix) { if (t1.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t1.pt(), t1.eta(), t1.phi(), leptonM1, t1.sign(), t1.fwdDcaX(), t1.fwdDcaY(), t1.cXX(), t1.cXY(), t1.cYY())); } } } @@ -820,9 +830,9 @@ struct DileptonHadronMPC { used_trackIds_per_col.emplace_back(t2.globalIndex()); if (cfgDoMix) { if (t2.sign() > 0) { - emh_pos->AddTrackToEventPool(key_df_collision, EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); + emh_pos->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); } else { - emh_neg->AddTrackToEventPool(key_df_collision, EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); + emh_neg->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMFwdTrack(t2.pt(), t2.eta(), t2.phi(), leptonM2, t2.sign(), t2.fwdDcaX(), t2.fwdDcaY(), t2.cXX(), t2.cXY(), t2.cYY())); } } } @@ -902,14 +912,14 @@ struct DileptonHadronMPC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); if (cfgDCAType == 1) { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2)); } if (cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { @@ -995,53 +1005,53 @@ struct DileptonHadronMPC { return true; } - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; - - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); - - Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfb >= static_cast(0)); - - Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); - Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); - - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimarymuon::pfbderived >= static_cast(0)); - - Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); - Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); - - using RefTracks = soa::Join; + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; + + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); + + o2::framework::expressions::Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfb >= static_cast(0)); + + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); + + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimarymuon::pfbderived >= static_cast(0)); + + o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); + o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); + + using RefTracks = o2::soa::Join; using RefTrack = RefTracks::iterator; - Preslice perCollision_track = aod::emprimarytrack::emeventId; - Filter refTrackFilter = trackcuts.cfg_min_pt_track < 1 / nabs(o2::aod::emprimarytrack::signed1Pt) && 1 / nabs(o2::aod::emprimarytrack::signed1Pt) < trackcuts.cfg_max_pt_track && trackcuts.cfg_min_eta_track < o2::aod::emprimarytrack::eta && o2::aod::emprimarytrack::eta < trackcuts.cfg_max_eta_track; - using FilteredRefTracks = soa::Filtered; + o2::framework::Preslice perCollision_track = o2::aod::emprimarytrack::emeventId; + o2::framework::expressions::Filter refTrackFilter = trackcuts.cfg_min_pt_track < 1 / nabs(o2::aod::emprimarytrack::signed1Pt) && 1 / nabs(o2::aod::emprimarytrack::signed1Pt) < trackcuts.cfg_max_pt_track && trackcuts.cfg_min_eta_track < o2::aod::emprimarytrack::eta && o2::aod::emprimarytrack::eta < trackcuts.cfg_max_eta_track; + using FilteredRefTracks = o2::soa::Filtered; using FilteredRefTrack = FilteredRefTracks::iterator; TEMH* emh_pos = nullptr; @@ -1096,7 +1106,7 @@ struct DileptonHadronMPC { used_trackIds_per_col.reserve(posTracks_per_coll.size() + negTracks_per_coll.size()); int nuls = 0, nlspp = 0, nlsmm = 0; - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS bool is_pair_ok = fillDilepton<0>(collision, pos, neg, cut); if (is_pair_ok) { nuls++; @@ -1105,7 +1115,7 @@ struct DileptonHadronMPC { } } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ bool is_pair_ok = fillDilepton<0>(collision, pos1, pos2, cut); if (is_pair_ok) { nlspp++; @@ -1114,7 +1124,7 @@ struct DileptonHadronMPC { } } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- bool is_pair_ok = fillDilepton<0>(collision, neg1, neg2, cut); if (is_pair_ok) { nlsmm++; @@ -1137,13 +1147,13 @@ struct DileptonHadronMPC { // store ref tracks for mixed event in case of kAzimuthalCorrelation if (cfgDoMix && cfgAnalysisType == static_cast(o2::aod::pwgem::dilepton::utils::pairutil::DileptonHadronAnalysisType::kAzimuthalCorrelation)) { - emh_ref->AddTrackToEventPool(key_df_collision, EMTrack(track.pt(), track.eta(), track.phi(), 0.139)); + emh_ref->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(track.pt(), track.eta(), track.phi(), 0.139)); } // store ref tracks } } // LOGF(info, "collision.globalIndex() = %d, collision.centFT0M() = %f, refTracks_per_coll.size() = %d", collision.globalIndex(), collision.centFT0M(), refTracks_per_coll.size()); - for (const auto& [ref1, ref2] : combinations(CombinationsStrictlyUpperIndexPolicy(refTracks_per_coll, refTracks_per_coll))) { + for (const auto& [ref1, ref2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(refTracks_per_coll, refTracks_per_coll))) { // TODO: remove lepton candidates from reference track sample in case of kCB. fillHadronHadron<0>(ref1, ref2, posTracks_per_coll, negTracks_per_coll, cut); } @@ -1437,17 +1447,17 @@ struct DileptonHadronMPC { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS if (isPairOK(pos, neg, cut)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ if (isPairOK(pos1, pos2, cut)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- if (isPairOK(neg1, neg2, cut)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } @@ -1501,7 +1511,7 @@ struct DileptonHadronMPC { run2PC(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, refTracks); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } @@ -1523,7 +1533,7 @@ struct DileptonHadronMPC { run2PC(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, refTracks); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, muons); } diff --git a/PWGEM/Dilepton/Core/DileptonMC.h b/PWGEM/Dilepton/Core/DileptonMC.h index 0c00de8bec5..83a56821628 100644 --- a/PWGEM/Dilepton/Core/DileptonMC.h +++ b/PWGEM/Dilepton/Core/DileptonMC.h @@ -28,60 +28,78 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.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 +#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 -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils::mcutil; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyMCCollisions = soa::Join; +using MyMCCollisions = o2::soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyMCElectrons = soa::Join; +using MyMCElectrons = o2::soa::Join; using MyMCElectron = MyMCElectrons::iterator; -using FilteredMyMCElectrons = soa::Filtered; +using FilteredMyMCElectrons = o2::soa::Filtered; using FilteredMyMCElectron = FilteredMyMCElectrons::iterator; -using MyMCMuons = soa::Join; +using MyMCMuons = o2::soa::Join; using MyMCMuon = MyMCMuons::iterator; -using FilteredMyMCMuons = soa::Filtered; +using FilteredMyMCMuons = o2::soa::Filtered; using FilteredMyMCMuon = FilteredMyMCMuons::iterator; -using MySmearedElectrons = soa::Join; +using MySmearedElectrons = o2::soa::Join; using MySmearedElectron = MySmearedElectrons::iterator; -using MySmearedMuons = soa::Join; +using MySmearedMuons = o2::soa::Join; using MySmearedMuon = MySmearedMuons::iterator; // template @@ -89,230 +107,230 @@ template ccdburl{"ccdb-url", "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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; - Configurable cfgFillUnfolding{"cfgFillUnfolding", false, "flag to fill histograms for unfolding"}; - Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; - Configurable cfgFillSeparateCharmHadronPairs{"cfgFillSeparateCharmHadronPairs", false, "flag to fill different ccbar pairs separately"}; - - ConfigurableAxis ConfMllBins{"ConfMllBins", {VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; - ConfigurableAxis ConfPtllBins{"ConfPtllBins", {VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; - ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; - - ConfigurableAxis ConfDPtBins{"ConfDPtBins", {220, -1.0, +10.0}, "dpt bins for output histograms"}; - ConfigurableAxis ConfDCAllNarrowBins{"ConfDCAllNarrowBins", {200, 0.0, 10.0}, "narrow DCAll bins for output histograms"}; - ConfigurableAxis ConfTrackDCA{"ConfTrackDCA", {VARIABLE_WIDTH, -10, -9, -8, -7, -6, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.5, 3, 3.5, 4, 4.5, 5, 6, 7, 8, 9, 10}, "DCA binning for single tacks"}; - - ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, +1.f}, "yll bins for output histograms"}; - - // ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {VARIABLE_WIDTH, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page. - - Configurable cfg_nbin_dphi_ee{"cfg_nbin_dphi_ee", 1, "number of bins for dphi_ee"}; // 36 - Configurable cfg_nbin_deta_ee{"cfg_nbin_deta_ee", 1, "number of bins for deta_ee"}; // 40 - // Configurable cfg_nbin_cos_theta_cs{"cfg_nbin_cos_theta_cs", 1, "number of bins for cos theta cs"}; // 10 - // Configurable cfg_nbin_phi_cs{"cfg_nbin_phi_cs", 1, "number of bins for phi cs"}; // 10 - Configurable cfg_nbin_aco{"cfg_nbin_aco", 1, "number of bins for acoplanarity"}; // 10 - Configurable cfg_nbin_asym_pt{"cfg_nbin_asym_pt", 1, "number of bins for pt asymmetry"}; // 10 - Configurable cfg_nbin_dphi_e_ee{"cfg_nbin_dphi_e_ee", 1, "number of bins for dphi_ee_e"}; // 18 - ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {1, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; - ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; - Configurable cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; - ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {1, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgFillUnfolding{"cfgFillUnfolding", false, "flag to fill histograms for unfolding"}; + o2::framework::Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; + o2::framework::Configurable cfgFillSeparateCharmHadronPairs{"cfgFillSeparateCharmHadronPairs", false, "flag to fill different ccbar pairs separately"}; + + o2::framework::ConfigurableAxis ConfMllBins{"ConfMllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00}, "mll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPtllBins{"ConfPtllBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.10, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAllBins{"ConfDCAllBins", {o2::framework::VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}, "DCAll bins for output histograms"}; + + o2::framework::ConfigurableAxis ConfDPtBins{"ConfDPtBins", {220, -1.0, +10.0}, "dpt bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAllNarrowBins{"ConfDCAllNarrowBins", {200, 0.0, 10.0}, "narrow DCAll bins for output histograms"}; + o2::framework::ConfigurableAxis ConfTrackDCA{"ConfTrackDCA", {o2::framework::VARIABLE_WIDTH, -10, -9, -8, -7, -6, -5, -4.5, -4, -3.5, -3, -2.5, -2, -1.9, -1.8, -1.7, -1.6, -1.5, -1.4, -1.3, -1.2, -1.1, -1, -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2, 2.5, 3, 3.5, 4, 4.5, 5, 6, 7, 8, 9, 10}, "DCA binning for single tacks"}; + + o2::framework::ConfigurableAxis ConfYllBins{"ConfYllBins", {1, -1.f, +1.f}, "yll bins for output histograms"}; + + // o2::framework::ConfigurableAxis ConfMmumuBins{"ConfMmumuBins", {o2::framework::VARIABLE_WIDTH, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.30, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.40, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.50, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57, 0.58, 0.59, 0.60, 0.61, 0.62, 0.63, 0.64, 0.65, 0.66, 0.67, 0.68, 0.69, 0.70, 0.71, 0.72, 0.73, 0.74, 0.75, 0.76, 0.77, 0.78, 0.79, 0.80, 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87, 0.88, 0.89, 0.90, 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.99, 1.00, 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09, 1.10, 1.11,1.12,1.13,1.14,1.15,1.16,1.17,1.18,1.19, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.10, 2.20, 2.30, 2.40, 2.50, 2.60, 2.70, 2.75, 2.80, 2.85, 2.90, 2.95, 3.00, 3.05, 3.10, 3.15, 3.20, 3.25, 3.30, 3.35, 3.40, 3.45, 3.50, 3.55, 3.60, 3.65, 3.70, 3.75, 3.80, 3.85, 3.90, 3.95, 4.00, 4.10, 4.20, 4.30, 4.40, 4.50, 4.60, 4.70, 4.80, 4.90, 5.00, 5.10, 5.20, 5.30, 5.40, 5.50, 5.60, 5.70, 5.80, 5.90, 6.00, 6.10, 6.20, 6.30, 6.40, 6.50, 6.60, 6.70, 6.80, 6.90, 7.00, 7.10, 7.20, 7.30, 7.40, 7.50, 7.60, 7.70, 7.80, 7.90, 8.00, 8.10, 8.20, 8.30, 8.40, 8.50, 8.60, 8.70, 8.80, 8.90, 9.00, 9.10, 9.20, 9.30, 9.40, 9.50, 9.60, 9.70, 9.80, 9.90, 10.00, 10.10, 10.20, 10.30, 10.40, 10.50, 10.60, 10.70, 10.80, 10.90, 11.00, 11.50, 12.00}, "mmumu bins for output histograms"}; // for dimuon. one can copy bins here to hyperloop page. + + o2::framework::Configurable cfg_nbin_dphi_ee{"cfg_nbin_dphi_ee", 1, "number of bins for dphi_ee"}; // 36 + o2::framework::Configurable cfg_nbin_deta_ee{"cfg_nbin_deta_ee", 1, "number of bins for deta_ee"}; // 40 + // o2::framework::Configurable cfg_nbin_cos_theta_cs{"cfg_nbin_cos_theta_cs", 1, "number of bins for cos theta cs"}; // 10 + // o2::framework::Configurable cfg_nbin_phi_cs{"cfg_nbin_phi_cs", 1, "number of bins for phi cs"}; // 10 + o2::framework::Configurable cfg_nbin_aco{"cfg_nbin_aco", 1, "number of bins for acoplanarity"}; // 10 + o2::framework::Configurable cfg_nbin_asym_pt{"cfg_nbin_asym_pt", 1, "number of bins for pt asymmetry"}; // 10 + o2::framework::Configurable cfg_nbin_dphi_e_ee{"cfg_nbin_dphi_e_ee", 1, "number of bins for dphi_ee_e"}; // 18 + o2::framework::ConfigurableAxis ConfPolarizationCosThetaBins{"ConfPolarizationCosThetaBins", {1, -1.f, 1.f}, "cos(theta) bins for polarization analysis"}; + o2::framework::ConfigurableAxis ConfPolarizationPhiBins{"ConfPolarizationPhiBins", {1, -M_PI, M_PI}, "phi bins for polarization analysis"}; + o2::framework::Configurable cfgPolarizationFrame{"cfgPolarizationFrame", 0, "frame of polarization. 0:CS, 1:HX, else:FATAL"}; + o2::framework::ConfigurableAxis ConfPolarizationQuadMomBins{"ConfPolarizationQuadMomBins", {1, -0.5, 1}, "quadrupole moment bins for polarization analysis"}; // quardrupole moment <(3 x cos^2(theta) -1)/2> EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; - Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; - Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; - Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; - // Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; - - Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply phiv cut inherited from prefilter"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - // Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - // Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + o2::framework::Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + o2::framework::Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; + o2::framework::Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; + // o2::framework::Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; + o2::framework::Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply phiv cut inherited from prefilter"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1.0, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 1.0, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + // o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + // o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; - Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; - Configurable acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. - Configurable acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. + o2::framework::Configurable acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; o2::base::Propagator::MatCorrType matCorr = o2::base::Propagator::MatCorrType::USEMatCorrNONE; int mRunNumber; float d_bz; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "mctrackcut_group"; - Configurable min_mcPt{"min_mcPt", 0.1, "min. MC pT for generated single lepton"}; - Configurable max_mcPt{"max_mcPt", 1e+10, "max. MC pT for generated single lepton"}; - Configurable min_mcEta{"min_mcEta", -0.8, "max. MC eta for generated single lepton"}; - Configurable max_mcEta{"max_mcEta", +0.8, "max. MC eta for generated single lepton"}; + o2::framework::Configurable min_mcPt{"min_mcPt", 0.1, "min. MC pT for generated single lepton"}; + o2::framework::Configurable max_mcPt{"max_mcPt", 1e+10, "max. MC pT for generated single lepton"}; + o2::framework::Configurable min_mcEta{"min_mcEta", -0.8, "max. MC eta for generated single lepton"}; + o2::framework::Configurable max_mcEta{"max_mcEta", +0.8, "max. MC eta for generated single lepton"}; } mctrackcuts; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view pair_sign_types[3] = {"uls/", "lspp/", "lsmm/"}; static constexpr std::string_view dilepton_source_types[20] = { @@ -345,8 +363,8 @@ struct DileptonMC { { // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms(&fRegistry); - fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); - fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); fRegistry.addClone("MCEvent/before/", "MCEvent/after/"); std::string mass_axis_title = "m_{ll} (GeV/c^{2})"; @@ -371,17 +389,17 @@ struct DileptonMC { } // pair info - const AxisSpec axis_mass{ConfMllBins, mass_axis_title}; - const AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; - const AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; - const AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; - const AxisSpec axis_pt_meson{ConfPtllBins, "p_{T}^{VM} (GeV/c)"}; // for omega, phi meson pT spectra - const AxisSpec axis_y_meson{ConfYllBins, "y^{VM}"}; // for omega, phi meson pT spectra - - const AxisSpec axis_dca_narrow{ConfDCAllNarrowBins, pair_dca_axis_title}; - const AxisSpec axis_dpt{ConfDPtBins, "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} (GeV/c)"}; - const AxisSpec axis_dca_track1{ConfTrackDCA, "DCA_{e,1}^{Z} (#sigma)"}; - const AxisSpec axis_dca_track2{ConfTrackDCA, "DCA_{e,2}^{Z} (#sigma)"}; + const o2::framework::AxisSpec axis_mass{ConfMllBins, mass_axis_title}; + const o2::framework::AxisSpec axis_pt{ConfPtllBins, pair_pt_axis_title}; + const o2::framework::AxisSpec axis_y{ConfYllBins, pair_y_axis_title}; + const o2::framework::AxisSpec axis_dca{ConfDCAllBins, pair_dca_axis_title}; + const o2::framework::AxisSpec axis_pt_meson{ConfPtllBins, "p_{T}^{VM} (GeV/c)"}; // for omega, phi meson pT spectra + const o2::framework::AxisSpec axis_y_meson{ConfYllBins, "y^{VM}"}; // for omega, phi meson pT spectra + + const o2::framework::AxisSpec axis_dca_narrow{ConfDCAllNarrowBins, pair_dca_axis_title}; + const o2::framework::AxisSpec axis_dpt{ConfDPtBins, "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} (GeV/c)"}; + const o2::framework::AxisSpec axis_dca_track1{ConfTrackDCA, "DCA_{e,1}^{Z} (#sigma)"}; + const o2::framework::AxisSpec axis_dca_track2{ConfTrackDCA, "DCA_{e,2}^{Z} (#sigma)"}; std::string frameName = "CS"; if (cfgPolarizationFrame == 0) { @@ -392,17 +410,17 @@ struct DileptonMC { LOG(fatal) << "set 0 or 1 to cfgPolarizationFrame!"; } - const AxisSpec axis_dphi_ee{cfg_nbin_dphi_ee, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll - const AxisSpec axis_deta_ee{cfg_nbin_deta_ee, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; // for kHFll - const AxisSpec axis_cos_theta_pol{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; // for kPolarization, kUPC - const AxisSpec axis_phi_pol{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; // for kPolarization - const AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; // for kPolarization - const AxisSpec axis_aco{cfg_nbin_aco, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; // for kUPC - const AxisSpec axis_asym_pt{cfg_nbin_asym_pt, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; // for kUPC - const AxisSpec axis_dphi_e_ee{cfg_nbin_dphi_e_ee, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; // for kUPC + const o2::framework::AxisSpec axis_dphi_ee{cfg_nbin_dphi_ee, -M_PI / 2., 3. / 2. * M_PI, "#Delta#varphi = #varphi_{l1} - #varphi_{l2} (rad.)"}; // for kHFll + const o2::framework::AxisSpec axis_deta_ee{cfg_nbin_deta_ee, -2., 2., "#Delta#eta = #eta_{l1} - #eta_{l2}"}; // for kHFll + const o2::framework::AxisSpec axis_cos_theta_pol{ConfPolarizationCosThetaBins, Form("cos(#theta^{%s})", frameName.data())}; // for kPolarization, kUPC + const o2::framework::AxisSpec axis_phi_pol{ConfPolarizationPhiBins, Form("#varphi^{%s} (rad.)", frameName.data())}; // for kPolarization + const o2::framework::AxisSpec axis_quadmom{ConfPolarizationQuadMomBins, Form("#frac{3 cos^{2}(#theta^{%s}) -1}{2}", frameName.data())}; // for kPolarization + const o2::framework::AxisSpec axis_aco{cfg_nbin_aco, 0, 1.f, "#alpha = 1 - #frac{|#varphi_{l^{+}} - #varphi_{l^{-}}|}{#pi}"}; // for kUPC + const o2::framework::AxisSpec axis_asym_pt{cfg_nbin_asym_pt, 0, 1.f, "A = #frac{|p_{T,l^{+}} - p_{T,l^{-}}|}{|p_{T,l^{+}} + p_{T,l^{-}}|}"}; // for kUPC + const o2::framework::AxisSpec axis_dphi_e_ee{cfg_nbin_dphi_e_ee, 0, M_PI, "#Delta#varphi = #varphi_{l} - #varphi_{ll} (rad.)"}; // for kUPC // generated info - fRegistry.add("Generated/sm/PromptPi0/uls/hs", "gen. dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); + fRegistry.add("Generated/sm/PromptPi0/uls/hs", "gen. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); fRegistry.addClone("Generated/sm/PromptPi0/uls/", "Generated/sm/PromptPi0/lspp/"); fRegistry.addClone("Generated/sm/PromptPi0/uls/", "Generated/sm/PromptPi0/lsmm/"); @@ -422,7 +440,7 @@ struct DileptonMC { // fRegistry.addClone("Generated/sm/PromptPi0/", "Generated/sm/Upsilon2S/"); // fRegistry.addClone("Generated/sm/PromptPi0/", "Generated/sm/Upsilon3S/"); - fRegistry.add("Generated/ccbar/c2l_c2l/uls/hs", "generated dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); + fRegistry.add("Generated/ccbar/c2l_c2l/uls/hs", "generated dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee}, true); fRegistry.addClone("Generated/ccbar/c2l_c2l/uls/", "Generated/ccbar/c2l_c2l/lspp/"); fRegistry.addClone("Generated/ccbar/c2l_c2l/uls/", "Generated/ccbar/c2l_c2l/lsmm/"); @@ -466,7 +484,7 @@ struct DileptonMC { } // evaluate acceptance for polarization - fRegistry.add("Generated/VM/All/Phi/hs", "gen. VM #rightarrow ll", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_cos_theta_pol, axis_phi_pol, axis_quadmom}, true); + fRegistry.add("Generated/VM/All/Phi/hs", "gen. VM #rightarrow ll", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_cos_theta_pol, axis_phi_pol, axis_quadmom}, true); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/Rho/"); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/Omega/"); fRegistry.addClone("Generated/VM/All/Phi/", "Generated/VM/All/PromptJPsi/"); @@ -474,7 +492,7 @@ struct DileptonMC { fRegistry.addClone("Generated/VM/All/", "Generated/VM/Acc/"); // reconstructed pair info - fRegistry.add("Pair/sm/Photon/uls/hs", "rec. dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/sm/Photon/uls/hs", "rec. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/sm/Photon/uls/", "Pair/sm/Photon/lspp/"); fRegistry.addClone("Pair/sm/Photon/uls/", "Pair/sm/Photon/lsmm/"); @@ -496,25 +514,25 @@ struct DileptonMC { // fRegistry.addClone("Pair/sm/Photon/", "Pair/sm/Upsilon3S/"); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - fRegistry.add("Pair/sm/Photon/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add("Pair/sm/Photon/uls/hMvsRxy", "m_{ee} vs. r_{xy};r_{xy}^{true} (cm);m_{ee} (GeV/c^{2})", kTH2F, {{100, 0, 100}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/sm/Photon/uls/hMvsPhiV", "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add("Pair/sm/Photon/uls/hMvsRxy", "m_{ee} vs. r_{xy};r_{xy}^{true} (cm);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1.0f}}, true); for (const auto& strSign : pair_sign_types) { - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/PromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hMvsPhiV", strSign), "m_{ee} vs. #varphi_{V};#varphi (rad.);m_{ee} (GeV/c^{2})", o2::framework::kTH2F, {{90, 0, M_PI}, {100, 0.0f, 1.0f}}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/NonPromptPi0/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", kTH2F, {axis_dca_track1, axis_dca_track2}, true); - fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", kTH2F, {axis_dca_narrow, axis_dpt}, true); - fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/PromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); + fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDeltaPtvsDCA", strSign), "#Delta p_{T,1}^{gen-rec} + #Delta p_{T,2}^{gen-rec} vs. DCA_{ee}", o2::framework::kTH2F, {axis_dca_narrow, axis_dpt}, true); + fRegistry.add(std::format("Pair/sm/NonPromptJPsi/{0}hDCAz1vsDCAz2", strSign), "DCA_{z,1} vs DCA_{z,2}", o2::framework::kTH2F, {axis_dca_track1, axis_dca_track2}, true); } } - fRegistry.add("Pair/ccbar/c2l_c2l/uls/hs", "rec. dilepton", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/ccbar/c2l_c2l/uls/hs", "rec. dilepton", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lspp/"); fRegistry.addClone("Pair/ccbar/c2l_c2l/uls/", "Pair/ccbar/c2l_c2l/lsmm/"); @@ -548,26 +566,26 @@ struct DileptonMC { } // for correlated bkg due to mis-identified hadrons, and true combinatorial bkg - fRegistry.add("Pair/corr_bkg_lh/uls/hs", "rec. bkg", kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); + fRegistry.add("Pair/corr_bkg_lh/uls/hs", "rec. bkg", o2::framework::kTHnSparseD, {axis_mass, axis_pt, axis_y, axis_dphi_ee, axis_deta_ee, axis_cos_theta_pol, axis_phi_pol, axis_quadmom, axis_aco, axis_asym_pt, axis_dphi_e_ee, axis_dca}, true); fRegistry.addClone("Pair/corr_bkg_lh/uls/", "Pair/corr_bkg_lh/lspp/"); fRegistry.addClone("Pair/corr_bkg_lh/uls/", "Pair/corr_bkg_lh/lsmm/"); fRegistry.addClone("Pair/corr_bkg_lh/", "Pair/corr_bkg_hh/"); fRegistry.addClone("Pair/corr_bkg_lh/", "Pair/comb_bkg/"); if (doprocessGen_VM) { - fRegistry.add("Generated/VM/Omega/hPtY", "pT vs. y of #omega", kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum - fRegistry.add("Generated/VM/Phi/hPtY", "pT vs. y of #phi", kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum + fRegistry.add("Generated/VM/Omega/hPtY", "pT vs. y of #omega", o2::framework::kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum + fRegistry.add("Generated/VM/Phi/hPtY", "pT vs. y of #phi", o2::framework::kTH2D, {axis_y_meson, axis_pt_meson}, true); // for pT spectrum } if (cfgFillUnfolding) { // for 2D unfolding - const AxisSpec axis_mass_gen{ConfMllBins, "m_{ll}^{gen} (GeV/c^{2})"}; - const AxisSpec axis_pt_gen{ConfPtllBins, "p_{T,ll}^{gen} (GeV/c)"}; - const AxisSpec axis_mass_rec{ConfMllBins, "m_{ll}^{rec} (GeV/c^{2})"}; - const AxisSpec axis_pt_rec{ConfPtllBins, "p_{T,ll}^{rec} (GeV/c)"}; - fRegistry.add("Unfold/sm/uls/hsRM", "response matrix", kTHnSparseD, {axis_mass_gen, axis_pt_gen, axis_mass_rec, axis_pt_rec}, true); - fRegistry.add("Unfold/sm/uls/hMiss", "missing dilepton", kTH2D, {axis_mass_gen, axis_pt_gen}, true); // e.g. true eta is in acceptance, but reconstructed eta is out of acceptance. - fRegistry.add("Unfold/sm/uls/hFake", "fake dilepton", kTH2D, {axis_mass_rec, axis_pt_rec}, true); // e.g. true eta is out of acceptance, but reconstructed eta is in acceptance. + const o2::framework::AxisSpec axis_mass_gen{ConfMllBins, "m_{ll}^{gen} (GeV/c^{2})"}; + const o2::framework::AxisSpec axis_pt_gen{ConfPtllBins, "p_{T,ll}^{gen} (GeV/c)"}; + const o2::framework::AxisSpec axis_mass_rec{ConfMllBins, "m_{ll}^{rec} (GeV/c^{2})"}; + const o2::framework::AxisSpec axis_pt_rec{ConfPtllBins, "p_{T,ll}^{rec} (GeV/c)"}; + fRegistry.add("Unfold/sm/uls/hsRM", "response matrix", o2::framework::kTHnSparseD, {axis_mass_gen, axis_pt_gen, axis_mass_rec, axis_pt_rec}, true); + fRegistry.add("Unfold/sm/uls/hMiss", "missing dilepton", o2::framework::kTH2D, {axis_mass_gen, axis_pt_gen}, true); // e.g. true eta is in acceptance, but reconstructed eta is out of acceptance. + fRegistry.add("Unfold/sm/uls/hFake", "fake dilepton", o2::framework::kTH2D, {axis_mass_rec, axis_pt_rec}, true); // e.g. true eta is out of acceptance, but reconstructed eta is in acceptance. fRegistry.addClone("Unfold/sm/uls/", "Unfold/sm/lspp/"); fRegistry.addClone("Unfold/sm/uls/", "Unfold/sm/lsmm/"); fRegistry.addClone("Unfold/sm/", "Unfold/ccbar/"); @@ -585,7 +603,7 @@ struct DileptonMC { float leptonM1 = 0.f; float leptonM2 = 0.f; int pdg_lepton = 0; - void init(InitContext&) + void init(o2::framework::InitContext&) { if (doprocessAnalysis && doprocessAnalysis_Smeared) { LOGF(fatal, "Cannot enable doprocessAnalysis and doprocessAnalysis_Smeared at the same time. Please choose one."); @@ -618,7 +636,7 @@ struct DileptonMC { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -801,18 +819,18 @@ struct DileptonMC { int FindSMULS(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 22, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 111, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 221, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 331, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 113, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 223, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 333, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 443, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100443, mcparticles) - // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 553, mcparticles), - // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100553, mcparticles), - // FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 200553, mcparticles) + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 22, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 111, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 221, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 331, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 113, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 223, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 333, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 443, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100443, mcparticles) + // o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 553, mcparticles), + // o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 100553, mcparticles), + // o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, pdg_lepton, 200553, mcparticles) }; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); @@ -823,12 +841,12 @@ struct DileptonMC { int FindSMLSPP(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 111, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 221, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 331, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 113, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 223, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 333, mcparticles)}; + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 111, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 221, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 331, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 113, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 223, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, -pdg_lepton, -pdg_lepton, 333, mcparticles)}; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); return max; @@ -838,12 +856,12 @@ struct DileptonMC { int FindSMLSMM(TTrack const& t1mc, TTrack const& t2mc, TMCParticles const& mcparticles) { int arr[] = { - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 111, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 221, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 331, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 113, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 223, mcparticles), - FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 333, mcparticles)}; + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 111, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 221, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 331, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 113, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 223, mcparticles), + o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(t1mc, t2mc, pdg_lepton, pdg_lepton, 333, mcparticles)}; int size = sizeof(arr) / sizeof(*arr); int max = *std::max_element(arr, arr + size); return max; @@ -1508,14 +1526,14 @@ struct DileptonMC { float pair_dca = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - pair_dca = pairDCAQuadSum(dca3DinSigma(t1), dca3DinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2)); if (cfgDCAType == 1) { - pair_dca = pairDCAQuadSum(dcaXYinSigma(t1), dcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2)); } else if (cfgDCAType == 2) { - pair_dca = pairDCAQuadSum(dcaZinSigma(t1), dcaZinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - pair_dca = pairDCAQuadSum(fwdDcaXYinSigma(t1), fwdDcaXYinSigma(t2)); + pair_dca = o2::aod::pwgem::dilepton::utils::pairutil::pairDCAQuadSum(o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2)); } float phiv = o2::aod::pwgem::dilepton::utils::pairutil::getPhivPair(t1.px(), t1.py(), t1.pz(), t2.px(), t2.py(), t2.pz(), t1.sign(), t2.sign(), d_bz); @@ -1540,10 +1558,10 @@ struct DileptonMC { o2::math_utils::bringToPMPi(phiPol); float quadmom = (3.f * std::pow(cos_thetaPol, 2) - 1.f) / 2.f; - if ((FindCommonMotherFrom2ProngsWithoutPDG(t1mc, t2mc) > 0 || IsHF(t1mc, t2mc, mcparticles) > 0) && is_pair_from_same_mcevent) { // for bkg study - if (std::abs(t1mc.pdgCode()) != pdg_lepton || std::abs(t2mc.pdgCode()) != pdg_lepton) { // hh or lh correlated bkg - if (std::abs(t1mc.pdgCode()) != pdg_lepton && std::abs(t2mc.pdgCode()) != pdg_lepton) { // hh correlated bkg - if (t1.sign() * t2.sign() < 0) { // ULS + if ((o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2ProngsWithoutPDG(t1mc, t2mc) > 0 || o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1mc, t2mc, mcparticles) > 0) && is_pair_from_same_mcevent) { // for bkg study + if (std::abs(t1mc.pdgCode()) != pdg_lepton || std::abs(t2mc.pdgCode()) != pdg_lepton) { // hh or lh correlated bkg + if (std::abs(t1mc.pdgCode()) != pdg_lepton && std::abs(t2mc.pdgCode()) != pdg_lepton) { // hh correlated bkg + if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/corr_bkg_hh/uls/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/corr_bkg_hh/lspp/hs"), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); @@ -1581,7 +1599,7 @@ struct DileptonMC { return false; } int mother_id = std::max({FindSMULS(t1mc, t2mc, mcparticles), FindSMULS(t2mc, t1mc, mcparticles), FindSMLSPP(t1mc, t2mc, mcparticles), FindSMLSMM(t1mc, t2mc, mcparticles)}); - int hfee_type = IsHF(t1mc, t2mc, mcparticles); + int hfee_type = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1mc, t2mc, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -1594,21 +1612,21 @@ struct DileptonMC { float deltaPt2 = t2mc.pt() - t2.pt(); switch (std::abs(mcmother.pdgCode())) { case 111: - if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 fillRecHistograms<1>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // prompt pi0 if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/uls/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/lspp/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptPi0/lsmm/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } else { // non-prompt pi0 @@ -1617,15 +1635,15 @@ struct DileptonMC { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/uls/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lspp/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hMvsPhiV"), phiv, v12.M()); fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptPi0/lsmm/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } @@ -1656,18 +1674,18 @@ struct DileptonMC { } break; case 443: - if (IsFromBeauty(mcmother, mcparticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillRecHistograms<9>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // non-prompt J/psi if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/uls/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/uls/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lspp/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lspp/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lsmm/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/NonPromptJPsi/lsmm/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } else { @@ -1675,19 +1693,19 @@ struct DileptonMC { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (t1.sign() * t2.sign() < 0) { // ULS fRegistry.fill(HIST("Pair/sm/PromptJPsi/uls/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptJPsi/uls/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/uls/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() > 0 && t2.sign() > 0) { // LS++ fRegistry.fill(HIST("Pair/sm/PromptJPsi/lspp/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptJPsi/lspp/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/lspp/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } else if (t1.sign() < 0 && t2.sign() < 0) { // LS-- fRegistry.fill(HIST("Pair/sm/PromptJPsi/lsmm/hDeltaPtvsDCA"), pair_dca, deltaPt1 + deltaPt2); - fRegistry.fill(HIST("Pair/sm/PromptJPsi/lsmm/hDCAz1vsDCAz2"), dcaZinSigma(t1), dcaZinSigma(t2)); + fRegistry.fill(HIST("Pair/sm/PromptJPsi/lsmm/hDCAz1vsDCAz2"), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1), o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2)); } } } break; case 100443: - if (IsFromBeauty(mcmother, mcparticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillRecHistograms<11>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // non-prompt psi2S } else { fillRecHistograms<10>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // prompt psi2S @@ -1716,19 +1734,19 @@ struct DileptonMC { auto mp1 = mcparticles.iteratorAt(t1mc.mothersIds()[0]); auto mp2 = mcparticles.iteratorAt(t2mc.mothersIds()[0]); switch (hfee_type) { - case static_cast(EM_HFeeType::kCe_Ce): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): fillRecHistograms<15>(t1.sign(), t2.sign(), mp1.pdgCode(), mp2.pdgCode(), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // c2l_c2l break; - case static_cast(EM_HFeeType::kBe_Be): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): fillRecHistograms<16>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2l_b2l break; - case static_cast(EM_HFeeType::kBCe_BCe): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): fillRecHistograms<17>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2c2l break; - case static_cast(EM_HFeeType::kBCe_Be_SameB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): fillRecHistograms<18>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2l_sameb break; - case static_cast(EM_HFeeType::kBCe_Be_DiffB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): fillRecHistograms<19>(t1.sign(), t2.sign(), 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), pair_dca, weight); // b2c2l_b2l_diffb break; default: @@ -1750,7 +1768,7 @@ struct DileptonMC { } int mother_id = std::max({FindSMULS(t1, t2, mcparticles), FindSMULS(t2, t1, mcparticles), FindSMLSPP(t1, t2, mcparticles), FindSMLSMM(t1, t2, mcparticles)}); - int hfee_type = IsHF(t1, t2, mcparticles); + int hfee_type = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1, t2, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -1851,10 +1869,10 @@ struct DileptonMC { if (mcmother.isPhysicalPrimary() || mcmother.producedByGenerator()) { switch (std::abs(mcmother.pdgCode())) { case 111: - if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 - fillGenHistograms<1>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt pi0 - } else { // non-prompt pi0 - fillGenHistograms<2>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt pi0 + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { // prompt pi0 + fillGenHistograms<1>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt pi0 + } else { // non-prompt pi0 + fillGenHistograms<2>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt pi0 } break; case 221: @@ -1879,14 +1897,14 @@ struct DileptonMC { } break; case 443: - if (IsFromBeauty(mcmother, mcparticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillGenHistograms<9>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt J/psi } else { fillGenHistograms<8>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt J/psi } break; case 100443: - if (IsFromBeauty(mcmother, mcparticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillGenHistograms<11>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // non-prompt psi2S } else { fillGenHistograms<10>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // prompt psi2S @@ -1900,19 +1918,19 @@ struct DileptonMC { auto mp1 = mcparticles.iteratorAt(t1.mothersIds()[0]); auto mp2 = mcparticles.iteratorAt(t2.mothersIds()[0]); switch (hfee_type) { - case static_cast(EM_HFeeType::kCe_Ce): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): fillGenHistograms<15>(sign1, sign2, mp1.pdgCode(), mp2.pdgCode(), v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // c2l_c2l break; - case static_cast(EM_HFeeType::kBe_Be): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): fillGenHistograms<16>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2l_b2l break; - case static_cast(EM_HFeeType::kBCe_BCe): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): fillGenHistograms<17>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2c2l break; - case static_cast(EM_HFeeType::kBCe_Be_SameB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): fillGenHistograms<18>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2l_sameb break; - case static_cast(EM_HFeeType::kBCe_Be_DiffB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): fillGenHistograms<19>(sign1, sign2, 0, 0, v12.M(), v12.Pt(), v12.Rapidity(), dphi, deta, cos_thetaPol, phiPol, quadmom, aco, asym, std::fabs(dphi_e_ee), weight); // b2c2l_b2l_diffb break; default: @@ -2008,7 +2026,7 @@ struct DileptonMC { } break; case 443: - if (IsFromBeauty(mcParticle, mcParticles) > 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcParticle, mcParticles) > 0) { fRegistry.fill(HIST("Generated/VM/All/NonPromptJPsi/hs"), v12.M(), mcParticle.pt(), mcParticle.y(), cos_thetaPol, phiPol, quadmom, weight); if (isInAcceptance(v1.Pt(), v1.Eta()) && isInAcceptance(v2.Pt(), v2.Eta())) { fRegistry.fill(HIST("Generated/VM/Acc/NonPromptJPsi/hs"), v12.M(), mcParticle.pt(), mcParticle.y(), cos_thetaPol, phiPol, quadmom, weight); @@ -2054,15 +2072,15 @@ struct DileptonMC { auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); // LOGF(info, "centrality = %f , posTracks_per_coll.size() = %d, negTracks_per_coll.size() = %d", centralities[cfgCentEstimator], posTracks_per_coll.size(), negTracks_per_coll.size()); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS fillTruePairInfo(collision, mccollisions, pos, neg, cut, tracks, mcparticles); } // end of ULS pair loop - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ fillTruePairInfo(collision, mccollisions, pos1, pos2, cut, tracks, mcparticles); } // end of LS++ pair loop - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillTruePairInfo(collision, mccollisions, neg1, neg2, cut, tracks, mcparticles); } // end of LS-- pair loop @@ -2095,18 +2113,18 @@ struct DileptonMC { } fRegistry.fill(HIST("MCEvent/after/hZvtx"), mccollision.posZ()); - auto posTracks_per_coll = posTracksMC.sliceByCachedUnsorted(aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); - auto negTracks_per_coll = negTracksMC.sliceByCachedUnsorted(aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); + auto posTracks_per_coll = posTracksMC.sliceByCachedUnsorted(o2::aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); + auto negTracks_per_coll = negTracksMC.sliceByCachedUnsorted(o2::aod::emmcparticle::emmceventId, mccollision.globalIndex(), cache); - for (const auto& [t1, t2] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [t1, t2] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS fillGenPairInfo(t1, t2, mcparticles); } // end of true ULS pair loop - for (const auto& [t1, t2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [t1, t2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ fillGenPairInfo(t1, t2, mcparticles); } // end of true LS++ pair loop - for (const auto& [t1, t2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [t1, t2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillGenPairInfo(t1, t2, mcparticles); } // end of true LS-- pair loop @@ -2193,7 +2211,7 @@ struct DileptonMC { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS auto mcpos = mcparticles.iteratorAt(pos.emmcparticleId()); auto mccollision_from_pos = mcpos.template emmcevent_as(); if (cfgEventGeneratorType >= 0 && mccollision_from_pos.getSubGeneratorId() != cfgEventGeneratorType) { @@ -2209,7 +2227,7 @@ struct DileptonMC { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ auto mcpos1 = mcparticles.iteratorAt(pos1.emmcparticleId()); auto mccollision_from_pos1 = mcpos1.template emmcevent_as(); if (cfgEventGeneratorType >= 0 && mccollision_from_pos1.getSubGeneratorId() != cfgEventGeneratorType) { @@ -2225,7 +2243,7 @@ struct DileptonMC { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- auto mcneg1 = mcparticles.iteratorAt(neg1.emmcparticleId()); auto mccollision_from_neg1 = mcneg1.template emmcevent_as(); if (cfgEventGeneratorType >= 0 && mccollision_from_neg1.getSubGeneratorId() != cfgEventGeneratorType) { @@ -2383,7 +2401,7 @@ struct DileptonMC { return false; } int mother_id = std::max({FindSMULS(t1mc, t2mc, mcparticles), FindSMULS(t2mc, t1mc, mcparticles), FindSMLSPP(t1mc, t2mc, mcparticles), FindSMLSMM(t1mc, t2mc, mcparticles)}); - int hfee_type = IsHF(t1mc, t2mc, mcparticles); + int hfee_type = o2::aod::pwgem::dilepton::utils::mcutil::IsHF(t1mc, t2mc, mcparticles); if (mother_id < 0 && hfee_type < 0) { return false; } @@ -2421,19 +2439,19 @@ struct DileptonMC { } } else if (hfee_type > -1) { switch (hfee_type) { - case static_cast(EM_HFeeType::kCe_Ce): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kCe_Ce): fillHistogramsUnfolding<1>(t1, t2, mcparticles); break; - case static_cast(EM_HFeeType::kBe_Be): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBe_Be): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(EM_HFeeType::kBCe_BCe): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_BCe): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(EM_HFeeType::kBCe_Be_SameB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_SameB): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; - case static_cast(EM_HFeeType::kBCe_Be_DiffB): + case static_cast(o2::aod::pwgem::dilepton::utils::mcutil::EM_HFeeType::kBCe_Be_DiffB): fillHistogramsUnfolding<2>(t1, t2, mcparticles); break; default: @@ -2463,13 +2481,13 @@ struct DileptonMC { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); // reconstructed pos tracks auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); // reconstructed neg tracks - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS fillPairUnfolding(pos, neg, tracks, cut, mcCollisions, mcparticles); } // end of ULS pairing - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ fillPairUnfolding(pos1, pos2, tracks, cut, mcCollisions, mcparticles); } // end of LS++ pairing - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- fillPairUnfolding(neg1, neg2, tracks, cut, mcCollisions, mcparticles); } // end of LS-- pairing } // end of collision loop @@ -2477,57 +2495,57 @@ struct DileptonMC { std::unordered_map map_best_match_globalmuon; - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; - Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); - - Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfb >= static_cast(0)); - - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimarymuon::pfbderived >= static_cast(0)); - - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; - - Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); // reconstructed tracks - Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); // reconstructed tracks - Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); // reconstructed tracks - Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); // reconstructed tracks - - Partition positive_electronsMC = o2::aod::mcparticle::pdgCode == -11; // e+ - Partition negative_electronsMC = o2::aod::mcparticle::pdgCode == 11; // e- - Partition positive_muonsMC = o2::aod::mcparticle::pdgCode == -13; // mu+ - Partition negative_muonsMC = o2::aod::mcparticle::pdgCode == 13; // mu- - PresliceUnsorted perMcCollision = aod::emmcparticle::emmceventId; - PresliceUnsorted perMcCollision_vm = aod::emmcgenvectormeson::emmceventId; - // PresliceUnsorted recColperMcCollision = aod::emmceventlabel::emmceventId; - - void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, TLeptons const& leptons) + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); + + o2::framework::expressions::Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfb >= static_cast(0)); + + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimarymuon::pfbderived >= static_cast(0)); + + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; + + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); // reconstructed tracks + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); // reconstructed tracks + o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); // reconstructed tracks + o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); // reconstructed tracks + + o2::framework::Partition positive_electronsMC = o2::aod::mcparticle::pdgCode == -11; // e+ + o2::framework::Partition negative_electronsMC = o2::aod::mcparticle::pdgCode == 11; // e- + o2::framework::Partition positive_muonsMC = o2::aod::mcparticle::pdgCode == -13; // mu+ + o2::framework::Partition negative_muonsMC = o2::aod::mcparticle::pdgCode == 13; // mu- + o2::framework::PresliceUnsorted perMcCollision = o2::aod::emmcparticle::emmceventId; + o2::framework::PresliceUnsorted perMcCollision_vm = o2::aod::emmcgenvectormeson::emmceventId; + // o2::framework::PresliceUnsorted recColperMcCollision = o2::aod::emmceventlabel::emmceventId; + + void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, TLeptons const& leptons) { // LOGF(info, "collisions.size() = %d, mccollisions.size() = %d, mcparticles.size() = %d", collisions.size(), mccollisions.size(), mcparticles.size()); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { @@ -2540,7 +2558,7 @@ struct DileptonMC { fillUnfolding(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, leptons, mccollisions, mcparticles); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - map_best_match_globalmuon = findBestMatchMap(leptons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(leptons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, leptons, mccollisions, mcparticles); } @@ -2555,10 +2573,10 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processAnalysis, "run dilepton mc analysis", true); - Partition positive_electronsMC_smeared = o2::aod::mcparticle::pdgCode == -11; // e+ - Partition negative_electronsMC_smeared = o2::aod::mcparticle::pdgCode == 11; // e- - Partition positive_muonsMC_smeared = o2::aod::mcparticle::pdgCode == -13; // mu+ - Partition negative_muonsMC_smeared = o2::aod::mcparticle::pdgCode == 13; // mu- + o2::framework::Partition positive_electronsMC_smeared = o2::aod::mcparticle::pdgCode == -11; // e+ + o2::framework::Partition negative_electronsMC_smeared = o2::aod::mcparticle::pdgCode == 11; // e- + o2::framework::Partition positive_muonsMC_smeared = o2::aod::mcparticle::pdgCode == -13; // mu+ + o2::framework::Partition negative_muonsMC_smeared = o2::aod::mcparticle::pdgCode == 13; // mu- void processAnalysis_Smeared(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, TLeptons const& leptons, TSmeardMCParitlces const& mcparticles_smeared) { @@ -2573,7 +2591,7 @@ struct DileptonMC { fillUnfolding(collisions, positive_electrons, negative_electrons, o2::aod::emprimaryelectron::emeventId, fDielectronCut, leptons, mccollisions, mcparticles_smeared); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - map_best_match_globalmuon = findBestMatchMap(leptons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(leptons, fDimuonCut); if (cfgApplyWeightTTCA) { fillPairWeightMap(collisions, positive_muons, negative_muons, o2::aod::emprimarymuon::emeventId, fDimuonCut, leptons, mccollisions, mcparticles_smeared); } @@ -2588,7 +2606,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processAnalysis_Smeared, "run dilepton mc analysis with smearing", false); - void processGen_VM(FilteredMyCollisions const& collisions, MyMCCollisions const&, aod::EMMCGenVectorMesons const& mcparticles) + void processGen_VM(FilteredMyCollisions const& collisions, MyMCCollisions const&, o2::aod::EMMCGenVectorMesons const& mcparticles) { // for oemga, phi efficiency for (const auto& collision : collisions) { @@ -2640,7 +2658,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processGen_VM, "process generated info for vector mesons", false); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -2709,7 +2727,7 @@ struct DileptonMC { } PROCESS_SWITCH(DileptonMC, processNorm, "process normalization info", false); - void processBC(aod::EMBCs const& bcs) + void processBC(o2::aod::EMBCs const& bcs) { for (const auto& bc : bcs) { if (bc.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { diff --git a/PWGEM/Dilepton/Core/DileptonProducer.h b/PWGEM/Dilepton/Core/DileptonProducer.h index 69327c1b068..fd4eb783f89 100644 --- a/PWGEM/Dilepton/Core/DileptonProducer.h +++ b/PWGEM/Dilepton/Core/DileptonProducer.h @@ -21,266 +21,262 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "PWGEM/Dilepton/Utils/EMFwdTrack.h" -#include "PWGEM/Dilepton/Utils/EMTrack.h" #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" -#include "PWGEM/Dilepton/Utils/EventHistograms.h" #include "PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/trackUtilities.h" -#include "Tools/ML/MlResponse.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.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 // 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 namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils::pairutil; - -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = soa::Join; +using MyElectrons = o2::soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = soa::Filtered; +using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = soa::Filtered; +using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; template struct DileptonProducer { - Produces eventTable; - Produces normTable; - Produces dileptonTable; + o2::framework::Produces eventTable; + o2::framework::Produces normTable; + o2::framework::Produces dileptonTable; // Configurables - Configurable ccdburl{"ccdb-url", "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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; - Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; - Configurable cfgStoreULS{"cfgStoreULS", true, "flag to store ULS pairs"}; - Configurable cfgStoreLS{"cfgStoreLS", true, "flag to store LS pairs"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgEP2Estimator_for_Mix{"cfgEP2Estimator_for_Mix", 3, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; + o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2, BTot:3, BPos:4, BNeg:5"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgDCAType{"cfgDCAType", 0, "type of DCA for output. 0:3D, 1:XY, 2:Z, else:3D"}; + o2::framework::Configurable cfgStoreULS{"cfgStoreULS", true, "flag to store ULS pairs"}; + o2::framework::Configurable cfgStoreLS{"cfgStoreLS", true, "flag to store LS pairs"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; - Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; - Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; - Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; - Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; - // Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; - - Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; - Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply pair cut same as prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - // Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - // Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pT"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pT"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -0.8, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", +0.8, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dca3d{"cfg_min_pair_dca3d", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dca3d{"cfg_max_pair_dca3d", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + o2::framework::Configurable cfg_min_phiv{"cfg_min_phiv", 0.0, "min phiv (constant)"}; + o2::framework::Configurable cfg_max_phiv{"cfg_max_phiv", 3.2, "max phiv (constant)"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut at PV"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.2, "min dphi between 2 electrons (elliptic cut)"}; + o2::framework::Configurable cfg_min_opang{"cfg_min_opang", 0.0, "min opening angle"}; + o2::framework::Configurable cfg_max_opang{"cfg_max_opang", 6.4, "max opening angle"}; + // o2::framework::Configurable cfg_require_diff_sides{"cfg_require_diff_sides", false, "flag to require 2 tracks are from different sides."}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter{"cfg_apply_cuts_from_prefilter", false, "flag to apply prefilter set when producing derived data"}; + o2::framework::Configurable cfg_prefilter_bits{"cfg_prefilter_bits", 0, "prefilter bits [kNone : 0, kElFromPC : 1, kElFromPi0_20MeV : 2, kElFromPi0_40MeV : 4, kElFromPi0_60MeV : 8, kElFromPi0_80MeV : 16, kElFromPi0_100MeV : 32, kElFromPi0_120MeV : 64, kElFromPi0_140MeV : 128] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply pair cut same as prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kMee : 1, kPhiV : 2, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + // o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + // o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif : 4, kPIDML : 5, kTPChadrejORTOFreq_woTOFif : 6]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; - Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; - Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; - Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; - Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; - Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; - Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; - Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; - Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; - Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; - - Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; - Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h - - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 1e+10, "max mass"}; + o2::framework::Configurable cfg_min_pair_pt{"cfg_min_pair_pt", 0.0, "min pair pt"}; + o2::framework::Configurable cfg_max_pair_pt{"cfg_max_pair_pt", 1e+10, "max pair pt"}; + o2::framework::Configurable cfg_min_pair_y{"cfg_min_pair_y", -4.0, "min pair rapidity"}; + o2::framework::Configurable cfg_max_pair_y{"cfg_max_pair_y", -2.5, "max pair rapidity"}; + o2::framework::Configurable cfg_min_pair_dcaxy{"cfg_min_pair_dcaxy", 0.0, "min pair dca3d in sigma"}; + o2::framework::Configurable cfg_max_pair_dcaxy{"cfg_max_pair_dcaxy", 1e+10, "max pair dca3d in sigma"}; + o2::framework::Configurable cfg_apply_detadphi{"cfg_apply_detadphi", false, "flag to apply deta-dphi elliptic cut"}; + o2::framework::Configurable cfg_min_deta{"cfg_min_deta", 0.02, "min deta between 2 muons (elliptic cut)"}; + o2::framework::Configurable cfg_min_dphi{"cfg_min_dphi", 0.02, "min dphi between 2 muons (elliptic cut)"}; + + o2::framework::Configurable cfg_apply_cuts_from_prefilter_derived{"cfg_apply_cuts_from_prefilter_derived", false, "flag to apply prefilter set in derived data"}; + o2::framework::Configurable cfg_prefilter_bits_derived{"cfg_prefilter_bits_derived", 0, "prefilter bits [kNone : 0, kSplitOrMergedTrackLS : 4, kSplitOrMergedTrackULS : 8] Please consider logical-OR among them."}; // see PairUtilities.h + + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; std::mt19937 engine; float leptonM1 = 0.f; float leptonM2 = 0.f; - void init(InitContext& /*context*/) + void init(o2::framework::InitContext& /*context*/) { mRunNumber = 0; d_bz = 0; @@ -516,18 +512,18 @@ struct DileptonProducer { float dca1 = 999.f, dca2 = 999.f; if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - dca1 = dca3DinSigma(t1); - dca2 = dca3DinSigma(t2); + dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t1); + dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(t2); if (cfgDCAType == 1) { - dca1 = dcaXYinSigma(t1); - dca2 = dcaXYinSigma(t2); + dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t1); + dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(t2); } else if (cfgDCAType == 2) { - dca1 = dcaZinSigma(t1); - dca2 = dcaZinSigma(t2); + dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t1); + dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(t2); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - dca1 = fwdDcaXYinSigma(t1); - dca2 = fwdDcaXYinSigma(t2); + dca1 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1); + dca2 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2); } // fill table here @@ -539,46 +535,46 @@ struct DileptonProducer { return true; } - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; - - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); - - Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && - ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), - o2::aod::emprimaryelectron::pfb >= static_cast(0)); - - Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); - Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); - - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), o2::aod::emprimarymuon::isAssociatedToMPC == true || o2::aod::emprimarymuon::isAssociatedToMPC == false, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && - ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), - o2::aod::emprimarymuon::pfbderived >= static_cast(0)); - Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); - Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; + + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), o2::aod::emprimaryelectron::isAssociatedToMPC == true || o2::aod::emprimaryelectron::isAssociatedToMPC == false, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter_derived.node() && dielectroncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kMee))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kPhiV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimaryelectron::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfbderived >= static_cast(0)); + + o2::framework::expressions::Filter prefilter_electron = ifnode(dielectroncuts.cfg_apply_cuts_from_prefilter.node() && dielectroncuts.cfg_prefilter_bits.node() >= static_cast(1), + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPC))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_20MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_40MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_60MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_80MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_100MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_120MeV))) <= static_cast(0), true) && + ifnode((dielectroncuts.cfg_prefilter_bits.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) > static_cast(0), (o2::aod::emprimaryelectron::pfb & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBit::kElFromPi0_140MeV))) <= static_cast(0), true), + o2::aod::emprimaryelectron::pfb >= static_cast(0)); + + o2::framework::Partition positive_electrons = o2::aod::emprimaryelectron::sign > int8_t(0); + o2::framework::Partition negative_electrons = o2::aod::emprimaryelectron::sign < int8_t(0); + + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), o2::aod::emprimarymuon::isAssociatedToMPC == true || o2::aod::emprimarymuon::isAssociatedToMPC == false, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::expressions::Filter prefilter_derived_muon = ifnode(dimuoncuts.cfg_apply_cuts_from_prefilter_derived.node() && dimuoncuts.cfg_prefilter_bits_derived.node() >= static_cast(1), + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackLS))) <= static_cast(0), true) && + ifnode((dimuoncuts.cfg_prefilter_bits_derived.node() & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) > static_cast(0), (o2::aod::emprimarymuon::pfbderived & static_cast(1 << int(o2::aod::pwgem::dilepton::utils::pairutil::DileptonPrefilterBitDerived::kSplitOrMergedTrackULS))) <= static_cast(0), true), + o2::aod::emprimarymuon::pfbderived >= static_cast(0)); + o2::framework::Partition positive_muons = o2::aod::emprimarymuon::sign > int8_t(0); + o2::framework::Partition negative_muons = o2::aod::emprimarymuon::sign < int8_t(0); int ndf = 0; template @@ -608,7 +604,7 @@ struct DileptonProducer { int nuls = 0, nlspp = 0, nlsmm = 0; if (cfgStoreULS) { - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS bool is_pair_ok = fillPairInfo(collision, pos, neg, cut, tracks); if (is_pair_ok) { nuls++; @@ -616,13 +612,13 @@ struct DileptonProducer { } } if (cfgStoreLS) { - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ bool is_pair_ok = fillPairInfo(collision, pos1, pos2, cut, tracks); if (is_pair_ok) { nlspp++; } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- bool is_pair_ok = fillPairInfo(collision, neg1, neg2, cut, tracks); if (is_pair_ok) { nlsmm++; @@ -698,17 +694,17 @@ struct DileptonProducer { auto posTracks_per_coll = posTracks.sliceByCached(perCollision, collision.globalIndex(), cache); auto negTracks_per_coll = negTracks.sliceByCached(perCollision, collision.globalIndex(), cache); - for (const auto& [pos, neg] : combinations(CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS + for (const auto& [pos, neg] : combinations(o2::soa::CombinationsFullIndexPolicy(posTracks_per_coll, negTracks_per_coll))) { // ULS if (isPairOK(pos, neg, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos.globalIndex(), neg.globalIndex())); } } - for (const auto& [pos1, pos2] : combinations(CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ + for (const auto& [pos1, pos2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(posTracks_per_coll, posTracks_per_coll))) { // LS++ if (isPairOK(pos1, pos2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(pos1.globalIndex(), pos2.globalIndex())); } } - for (const auto& [neg1, neg2] : combinations(CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- + for (const auto& [neg1, neg2] : combinations(o2::soa::CombinationsStrictlyUpperIndexPolicy(negTracks_per_coll, negTracks_per_coll))) { // LS-- if (isPairOK(neg1, neg2, cut, tracks)) { passed_pairIds.emplace_back(std::make_pair(neg1.globalIndex(), neg2.globalIndex())); } @@ -771,7 +767,7 @@ struct DileptonProducer { } PROCESS_SWITCH(DileptonProducer, processAnalysis, "run dilepton analysis", true); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { if (collision.centFT0C() < eventcuts.cfgCentMin || eventcuts.cfgCentMax < collision.centFT0C()) { diff --git a/PWGEM/Dilepton/Core/DimuonCut.cxx b/PWGEM/Dilepton/Core/DimuonCut.cxx index c5e9743bf10..f3a67d06d4a 100644 --- a/PWGEM/Dilepton/Core/DimuonCut.cxx +++ b/PWGEM/Dilepton/Core/DimuonCut.cxx @@ -15,8 +15,11 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" -#include "Framework/Logger.h" +#include +#include + +#include #include ClassImp(DimuonCut); diff --git a/PWGEM/Dilepton/Core/DimuonCut.h b/PWGEM/Dilepton/Core/DimuonCut.h index dd10561196d..4f009b456db 100644 --- a/PWGEM/Dilepton/Core/DimuonCut.h +++ b/PWGEM/Dilepton/Core/DimuonCut.h @@ -18,21 +18,22 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/DataTypes.h" -#include "Framework/Logger.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" -#include "TNamed.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 -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; +#include class DimuonCut : public TNamed { @@ -92,8 +93,8 @@ class DimuonCut : public TNamed ROOT::Math::PtEtaPhiMVector v2(t2.pt(), t2.eta(), t2.phi(), o2::constants::physics::MassMuon); ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; - float dca_xy_t1 = fwdDcaXYinSigma(t1); - float dca_xy_t2 = fwdDcaXYinSigma(t2); + float dca_xy_t1 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t1); + float dca_xy_t2 = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(t2); float pair_dca_xy = std::sqrt((dca_xy_t1 * dca_xy_t1 + dca_xy_t2 * dca_xy_t2) / 2.); if (v12.M() < mMinMass || mMaxMass < v12.M()) { @@ -228,7 +229,7 @@ class DimuonCut : public TNamed return mEnableTTCA ? true : track.isAssociatedToMPC(); case DimuonCuts::kMFTHitMap: { - std::vector mftHitMap{checkMFTHitMap<0, 1>(track), checkMFTHitMap<2, 3>(track), checkMFTHitMap<4, 5>(track), checkMFTHitMap<6, 7>(track), checkMFTHitMap<8, 9>(track)}; + std::vector mftHitMap{o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<0, 1>(track), o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<2, 3>(track), o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<4, 5>(track), o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<6, 7>(track), o2::aod::pwgem::dilepton::utils::emtrackutil::checkMFTHitMap<8, 9>(track)}; for (const auto& iDisk : mRequiredMFTDisks) { if (!mftHitMap[iDisk]) { return false; diff --git a/PWGEM/Dilepton/Core/EMEventCut.cxx b/PWGEM/Dilepton/Core/EMEventCut.cxx index 58e3c5be4e8..fd418c45abb 100644 --- a/PWGEM/Dilepton/Core/EMEventCut.cxx +++ b/PWGEM/Dilepton/Core/EMEventCut.cxx @@ -15,7 +15,9 @@ #include "PWGEM/Dilepton/Core/EMEventCut.h" -#include "Framework/Logger.h" +#include + +#include ClassImp(EMEventCut); diff --git a/PWGEM/Dilepton/Core/EMEventCut.h b/PWGEM/Dilepton/Core/EMEventCut.h index 3cc785e80a8..b0450f5b575 100644 --- a/PWGEM/Dilepton/Core/EMEventCut.h +++ b/PWGEM/Dilepton/Core/EMEventCut.h @@ -18,12 +18,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" +#include -#include "TNamed.h" - -using namespace std; +#include class EMEventCut : public TNamed { diff --git a/PWGEM/Dilepton/Core/EMTrackCut.cxx b/PWGEM/Dilepton/Core/EMTrackCut.cxx index cd995e08836..fda35ac925f 100644 --- a/PWGEM/Dilepton/Core/EMTrackCut.cxx +++ b/PWGEM/Dilepton/Core/EMTrackCut.cxx @@ -15,7 +15,11 @@ #include "PWGEM/Dilepton/Core/EMTrackCut.h" -#include "Framework/Logger.h" +#include + +#include + +#include ClassImp(EMTrackCut); diff --git a/PWGEM/Dilepton/Core/EMTrackCut.h b/PWGEM/Dilepton/Core/EMTrackCut.h index 118c462cbf7..e338aaa2140 100644 --- a/PWGEM/Dilepton/Core/EMTrackCut.h +++ b/PWGEM/Dilepton/Core/EMTrackCut.h @@ -16,9 +16,11 @@ #ifndef PWGEM_DILEPTON_CORE_EMTRACKCUT_H_ #define PWGEM_DILEPTON_CORE_EMTRACKCUT_H_ -#include "Framework/Logger.h" +#include -#include "TNamed.h" +#include + +#include class EMTrackCut : public TNamed { diff --git a/PWGEM/Dilepton/Core/SingleTrackQC.h b/PWGEM/Dilepton/Core/SingleTrackQC.h index 3aeb5f44893..fc716d7798e 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQC.h @@ -21,200 +21,215 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/EventHistograms.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/Zorro.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - -#include +#include "Common/DataModel/Centrality.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 +#include +#include +#include +#include + +#include +#include + +#include +#include +#include #include +#include #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyElectrons = soa::Join; +using MyElectrons = o2::soa::Join; using MyElectron = MyElectrons::iterator; -using FilteredMyElectrons = soa::Filtered; +using FilteredMyElectrons = o2::soa::Filtered; using FilteredMyElectron = FilteredMyElectrons::iterator; -using MyMuons = soa::Join; +using MyMuons = o2::soa::Join; using MyMuon = MyMuons::iterator; -using FilteredMyMuons = soa::Filtered; +using FilteredMyMuons = o2::soa::Filtered; using FilteredMyMuon = FilteredMyMuons::iterator; template struct SingleTrackQC { // Configurables - Configurable ccdburl{"ccdb-url", "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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - - ConfigurableAxis ConfPtlBins{"ConfPtlBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"}; - ConfigurableAxis ConfEtaBins{"ConfEtaBins", {20, -1, 1}, "eta bins for output histograms"}; - ConfigurableAxis ConfPhiBins{"ConfPhiBins", {36, 0, 2 * M_PI}, "phi bins for output histograms"}; - ConfigurableAxis ConfDCA3DBins{"ConfDCA3DBins", {VARIABLE_WIDTH, 0.0, 10.0}, "DCA3d bins in sigma for output histograms"}; - ConfigurableAxis ConfDCAXYBins{"ConfDCAXYBins", {VARIABLE_WIDTH, -10.0, 10.0}, "DCAxy bins in sigma for output histograms"}; - ConfigurableAxis ConfDCAZBins{"ConfDCAZBins", {VARIABLE_WIDTH, -10.0, 10.0}, "DCAz bins in sigma for output histograms"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + + o2::framework::ConfigurableAxis ConfPtlBins{"ConfPtlBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"}; + o2::framework::ConfigurableAxis ConfEtaBins{"ConfEtaBins", {20, -1, 1}, "eta bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPhiBins{"ConfPhiBins", {36, 0, 2 * M_PI}, "phi bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCA3DBins{"ConfDCA3DBins", {o2::framework::VARIABLE_WIDTH, 0.0, 10.0}, "DCA3d bins in sigma for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAXYBins{"ConfDCAXYBins", {o2::framework::VARIABLE_WIDTH, -10.0, 10.0}, "DCAxy bins in sigma for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAZBins{"ConfDCAZBins", {o2::framework::VARIABLE_WIDTH, -10.0, 10.0}, "DCAz bins in sigma for output histograms"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", true, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", true, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", true, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "min pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "min pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; } dimuoncuts; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "zorroGroup"; - Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task + o2::framework::Configurable cfg_swt_name{"cfg_swt_name", "fLMeeIMR", "desired software trigger name. 1 trigger per 1 task."}; // 1 trigger per 1 task o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "EventFiltering/Zorro/", "ccdb path for ZORRO objects"}; - Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; + o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; } zorroGroup; Zorro zorro; @@ -224,11 +239,11 @@ struct SingleTrackQC { o2::aod::rctsel::RCTFlagsChecker rctChecker; // o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber = 0; float d_bz = 0; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 HistogramRegistry can keep up to 512 histograms + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 o2::framework::HistogramRegistry can keep up to 512 histograms static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; ~SingleTrackQC() {} @@ -239,91 +254,91 @@ struct SingleTrackQC { o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - const AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"}; - const AxisSpec axis_eta{ConfEtaBins, "#eta_{e}"}; - const AxisSpec axis_phi{ConfPhiBins, "#varphi_{e} (rad.)"}; - const AxisSpec axis_phiposition{36, 0.0, 2 * M_PI, "#varphi_{e}^{*} (rad.)"}; - const AxisSpec axis_dca3D{ConfDCA3DBins, "DCA_{e}^{3D} (#sigma)"}; - const AxisSpec axis_dcaXY{ConfDCAXYBins, "DCA_{e}^{XY} (#sigma)"}; - const AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; + const o2::framework::AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta{ConfEtaBins, "#eta_{e}"}; + const o2::framework::AxisSpec axis_phi{ConfPhiBins, "#varphi_{e} (rad.)"}; + const o2::framework::AxisSpec axis_phiposition{36, 0.0, 2 * M_PI, "#varphi_{e}^{*} (rad.)"}; + const o2::framework::AxisSpec axis_dca3D{ConfDCA3DBins, "DCA_{e}^{3D} (#sigma)"}; + const o2::framework::AxisSpec axis_dcaXY{ConfDCAXYBins, "DCA_{e}^{XY} (#sigma)"}; + const o2::framework::AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; // track info - fRegistry.add("Track/positive/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ}, true); - fRegistry.add("Track/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), kTH1F, {axis_phiposition}, false); - fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{4000, -20, 20}}, false); - fRegistry.add("Track/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); - fRegistry.add("Track/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); - fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); - fRegistry.add("Track/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", kTH1F, {{8, -0.5, 7.5}}, false); - fRegistry.add("Track/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/positive/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("Track/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); - - fRegistry.add("Track/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); - fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - - fRegistry.add("Track/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); - fRegistry.add("Track/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - - fRegistry.add("Track/positive/hPIDForTracking", "PID for trackng", kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h - fRegistry.add("Track/positive/hProbElBDT", "probability to be e from BDT;p_{in} (GeV/c);BDT score;", kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hs", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ}, true); + fRegistry.add("Track/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), o2::framework::kTH1F, {axis_phiposition}, false); + fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{4000, -20, 20}}, false); + fRegistry.add("Track/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); + fRegistry.add("Track/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); + fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", o2::framework::kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); + fRegistry.add("Track/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", o2::framework::kTH1F, {{8, -0.5, 7.5}}, false); + fRegistry.add("Track/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/positive/hITSClusterMap", "ITS cluster map", o2::framework::kTH1F, {{128, -0.5, 127.5}}, false); + fRegistry.add("Track/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); + + fRegistry.add("Track/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + + fRegistry.add("Track/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", o2::framework::kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); + fRegistry.add("Track/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaMu", "TOF n sigma mu;p_{pv} (GeV/c);n #sigma_{#mu}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaPi", "TOF n sigma pi;p_{pv} (GeV/c);n #sigma_{#pi}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaKa", "TOF n sigma ka;p_{pv} (GeV/c);n #sigma_{K}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/positive/hTOFNsigmaPr", "TOF n sigma pr;p_{pv} (GeV/c);n #sigma_{p}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + + fRegistry.add("Track/positive/hPIDForTracking", "PID for trackng", o2::framework::kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h + fRegistry.add("Track/positive/hProbElBDT", "probability to be e from BDT;p_{in} (GeV/c);BDT score;", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda);", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - const AxisSpec axis_pt{ConfPtlBins, "p_{T,#mu} (GeV/c)"}; - const AxisSpec axis_eta{ConfEtaBins, "#eta_{#mu}"}; - const AxisSpec axis_phi{ConfPhiBins, "#varphi_{#mu} (rad.)"}; - const AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; + const o2::framework::AxisSpec axis_pt{ConfPtlBins, "p_{T,#mu} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta{ConfEtaBins, "#eta_{#mu}"}; + const o2::framework::AxisSpec axis_phi{ConfPhiBins, "#varphi_{#mu} (rad.)"}; + const o2::framework::AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; // track info - fRegistry.add("Track/positive/hs", "rec. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca}, true); - fRegistry.add("Track/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); - fRegistry.add("Track/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); - fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -5, 5}}, false); - fRegistry.add("Track/positive/hTrackType", "track type", kTH1F, {{6, -0.5f, 5.5}}, false); - fRegistry.add("Track/positive/hDCAxy", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); - fRegistry.add("Track/positive/hDCAxySigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); - fRegistry.add("Track/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/positive/hDCAx_PosZ", "DCAx vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAy_PosZ", "DCAy vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/positive/hNclsMCH", "number of MCH clusters", kTH1F, {{21, -0.5, 20.5}}, false); - fRegistry.add("Track/positive/hNclsMFT", "number of MFT clusters", kTH1F, {{11, -0.5, 10.5}}, false); - fRegistry.add("Track/positive/hPDCA", "pDCA;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); - fRegistry.add("Track/positive/hMFTClusterMap", "MFT cluster map", kTH1F, {{1024, -0.5, 1023.5}}, false); - fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); + fRegistry.add("Track/positive/hs", "rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca}, true); + fRegistry.add("Track/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); + fRegistry.add("Track/positive/hsDelta", "diff. between GL and associated SA;p_{T}^{gl} (GeV/c);(p_{T}^{sa} - p_{T}^{gl})/p_{T}^{gl};#Delta#eta;#Delta#varphi (rad.);", o2::framework::kTHnSparseF, {axis_pt, {100, -0.5, +0.5}, {100, -0.5, +0.5}, {90, -M_PI / 4, M_PI / 4}}, false); + fRegistry.add("Track/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{1000, -5, 5}}, false); + fRegistry.add("Track/positive/hTrackType", "track type", o2::framework::kTH1F, {{6, -0.5f, 5.5}}, false); + fRegistry.add("Track/positive/hDCAxy", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); + fRegistry.add("Track/positive/hDCAxySigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", o2::framework::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); + fRegistry.add("Track/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/positive/hDCAx_PosZ", "DCAx vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", o2::framework::kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAy_PosZ", "DCAy vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -10, +10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/positive/hNclsMCH", "number of MCH clusters", o2::framework::kTH1F, {{21, -0.5, 20.5}}, false); + fRegistry.add("Track/positive/hNclsMFT", "number of MFT clusters", o2::framework::kTH1F, {{11, -0.5, 10.5}}, false); + fRegistry.add("Track/positive/hPDCA", "pDCA;R at absorber end (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); + fRegistry.add("Track/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); + fRegistry.add("Track/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); + fRegistry.add("Track/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); + fRegistry.add("Track/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); fRegistry.addClone("Track/positive/", "Track/negative/"); } } - void init(InitContext&) + void init(o2::framework::InitContext&) { ccdb->setURL(ccdburl); ccdb->setCaching(true); @@ -343,18 +358,18 @@ struct SingleTrackQC { if (doprocessQC_TriggeredData) { LOGF(info, "Trigger analysis is enabled. Desired trigger name = %s", zorroGroup.cfg_swt_name.value.data()); - fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 - fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hInspectedTVX", "inspected TVX;run number;N_{TVX}", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hScaler", "trigger counter before DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hSelection", "trigger counter after DS;run number;counter", o2::framework::kTProfile, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedTrigger", Form("analysed trigger %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 + fRegistry.add("Event/trigger/hAnalysedToI", Form("analysed ToI %s;run number;counter", zorroGroup.cfg_swt_name.value.data()), o2::framework::kTH1D, {{100000, 500000.5, 600000.5}}, true); // extend X range in Run 4/5 } if (doprocessNorm) { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -526,9 +541,9 @@ struct SingleTrackQC { weight = map_weight[track.globalIndex()]; } - float dca3D = dca3DinSigma(track); - float dcaXY = dcaXYinSigma(track); - float dcaZ = dcaZinSigma(track); + float dca3D = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track); + float dcaXY = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(track); + float dcaZ = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(track); float phiPosition = track.phi() + std::asin(-0.30282 * track.sign() * (d_bz * 0.1) * dielectroncuts.cfgRefR / (2.f * track.pt())); o2::math_utils::bringTo02Pi(phiPosition); @@ -538,9 +553,9 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/positive/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/positive/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("Track/positive/hDCAxyzSigma"), dcaXY, dcaZ); - fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/positive/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/positive/hDCA3dRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaDca3D(track) * 1e+4); // convert cm to um fRegistry.fill(HIST("Track/positive/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("Track/positive/hNclsTPC_Pt"), track.pt(), track.tpcNClsFound()); fRegistry.fill(HIST("Track/positive/hNcrTPC_Pt"), track.pt(), track.tpcNClsCrossedRows()); @@ -578,9 +593,9 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/negative/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/negative/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("Track/negative/hDCAxyzSigma"), dcaXY, dcaZ); - fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/negative/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/negative/hDCA3dRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaDca3D(track) * 1e+4); // convert cm to um fRegistry.fill(HIST("Track/negative/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("Track/negative/hNclsTPC_Pt"), track.pt(), track.tpcNClsFound()); fRegistry.fill(HIST("Track/negative/hNcrTPC_Pt"), track.pt(), track.tpcNClsCrossedRows()); @@ -622,7 +637,7 @@ struct SingleTrackQC { if (cfgApplyWeightTTCA) { weight = map_weight[track.globalIndex()]; } - float dca_xy = fwdDcaXYinSigma(track); + float dca_xy = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(track); float reldpt = (track.ptMatchedMCHMID() - track.pt()) / track.pt(); float deta = track.etaMatchedMCHMID() - track.eta(); @@ -639,7 +654,7 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/positive/hDCAxySigma"), track.fwdDcaX() / std::sqrt(track.cXX()), track.fwdDcaY() / std::sqrt(track.cYY())); fRegistry.fill(HIST("Track/positive/hDCAxRes_Pt"), track.pt(), std::sqrt(track.cXX()) * 1e+4); fRegistry.fill(HIST("Track/positive/hDCAyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); - fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/positive/hDCAxyRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); fRegistry.fill(HIST("Track/positive/hDCAx_PosZ"), collision.posZ(), track.fwdDcaX()); fRegistry.fill(HIST("Track/positive/hDCAy_PosZ"), collision.posZ(), track.fwdDcaY()); fRegistry.fill(HIST("Track/positive/hDCAx_Phi"), track.phi(), track.fwdDcaX()); @@ -663,7 +678,7 @@ struct SingleTrackQC { fRegistry.fill(HIST("Track/negative/hDCAxySigma"), track.fwdDcaX() / std::sqrt(track.cXX()), track.fwdDcaY() / std::sqrt(track.cYY())); fRegistry.fill(HIST("Track/negative/hDCAxRes_Pt"), track.pt(), std::sqrt(track.cXX()) * 1e+4); fRegistry.fill(HIST("Track/negative/hDCAyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); - fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/negative/hDCAxyRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); fRegistry.fill(HIST("Track/negative/hDCAx_PosZ"), collision.posZ(), track.fwdDcaX()); fRegistry.fill(HIST("Track/negative/hDCAy_PosZ"), collision.posZ(), track.fwdDcaY()); fRegistry.fill(HIST("Track/negative/hDCAx_Phi"), track.phi(), track.fwdDcaX()); @@ -847,21 +862,21 @@ struct SingleTrackQC { std::unordered_map map_best_match_globalmuon; - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; - Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = dielectroncuts.cfg_min_pt_track < o2::aod::track::pt && dielectroncuts.cfg_min_eta_track < o2::aod::track::eta && o2::aod::track::eta < dielectroncuts.cfg_max_eta_track && o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_pt_track < o2::aod::fwdtrack::pt && o2::aod::fwdtrack::pt < dimuoncuts.cfg_max_pt_track && dimuoncuts.cfg_min_eta_track < o2::aod::fwdtrack::eta && o2::aod::fwdtrack::eta < dimuoncuts.cfg_max_eta_track && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; void processQC(FilteredMyCollisions const& collisions, Types const&... args) { @@ -873,7 +888,7 @@ struct SingleTrackQC { runQC(collisions, electrons, perCollision_electron, fDielectronCut); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, muons, perCollision_muon, fDimuonCut); } @@ -894,7 +909,7 @@ struct SingleTrackQC { runQC(collisions, electrons, perCollision_electron, fDielectronCut); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { auto muons = std::get<0>(std::tie(args...)); - map_best_match_globalmuon = findBestMatchMap(muons, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(muons, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, muons, perCollision_muon, fDimuonCut); } @@ -905,7 +920,7 @@ struct SingleTrackQC { } PROCESS_SWITCH(SingleTrackQC, processQC_TriggeredData, "run single track QC on triggered data", false); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -974,7 +989,7 @@ struct SingleTrackQC { } PROCESS_SWITCH(SingleTrackQC, processNorm, "process normalization info", false); - void processBC(aod::EMBCs const& bcs) + void processBC(o2::aod::EMBCs const& bcs) { for (const auto& bc : bcs) { if (bc.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { diff --git a/PWGEM/Dilepton/Core/SingleTrackQCMC.h b/PWGEM/Dilepton/Core/SingleTrackQCMC.h index b000ee4ba28..f202e0b94e5 100644 --- a/PWGEM/Dilepton/Core/SingleTrackQCMC.h +++ b/PWGEM/Dilepton/Core/SingleTrackQCMC.h @@ -21,221 +21,234 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/EventHistograms.h" #include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - -#include +#include "Common/DataModel/Centrality.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 +#include +#include +#include +#include + +#include +#include + +#include +#include +#include #include +#include #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils::mcutil; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; +#include -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyMCCollisions = soa::Join; +using MyMCCollisions = o2::soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyMCElectrons = soa::Join; +using MyMCElectrons = o2::soa::Join; using MyMCElectron = MyMCElectrons::iterator; -using FilteredMyMCElectrons = soa::Filtered; +using FilteredMyMCElectrons = o2::soa::Filtered; -using MyMCMuons = soa::Join; +using MyMCMuons = o2::soa::Join; using MyMCMuon = MyMCMuons::iterator; -using FilteredMyMCMuons = soa::Filtered; +using FilteredMyMCMuons = o2::soa::Filtered; -using MySmearedElectrons = soa::Join; +using MySmearedElectrons = o2::soa::Join; using MySmearedElectron = MySmearedElectrons::iterator; -using MySmearedMuons = soa::Join; +using MySmearedMuons = o2::soa::Join; using MySmearedMuon = MySmearedMuons::iterator; template struct SingleTrackQCMC { // Configurables - Configurable ccdburl{"ccdb-url", "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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgFillQA{"cfgFillQA", false, "flag to fill QA histograms"}; - Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; - Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; - - ConfigurableAxis ConfPtlBins{"ConfPtlBins", {VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"}; - ConfigurableAxis ConfEtaBins{"ConfEtaBins", {20, -1, 1}, "eta bins for output histograms"}; - ConfigurableAxis ConfPhiBins{"ConfPhiBins", {36, 0, 2 * M_PI}, "phi bins for output histograms"}; - ConfigurableAxis ConfDCA3DBins{"ConfDCA3DBins", {VARIABLE_WIDTH, 0.0, 10.0}, "DCA3d bins in sigma for output histograms"}; - ConfigurableAxis ConfDCAXYBins{"ConfDCAXYBins", {VARIABLE_WIDTH, -10.0, 10.0}, "DCAxy bins in sigma for output histograms"}; - ConfigurableAxis ConfDCAZBins{"ConfDCAZBins", {VARIABLE_WIDTH, -10.0, 10.0}, "DCAz bins in sigma for output histograms"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgEventGeneratorType{"cfgEventGeneratorType", -1, "if positive, select event generator type. i.e. gap or signal"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgFillQA{"cfgFillQA", false, "flag to fill QA histograms"}; + o2::framework::Configurable cfgApplyWeightTTCA{"cfgApplyWeightTTCA", false, "flag to apply weighting by 1/N"}; + o2::framework::Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; + + o2::framework::ConfigurableAxis ConfPtlBins{"ConfPtlBins", {o2::framework::VARIABLE_WIDTH, 0.00, 0.05, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 0.60, 0.70, 0.80, 0.90, 1.00, 1.10, 1.20, 1.30, 1.40, 1.50, 1.60, 1.70, 1.80, 1.90, 2.00, 2.50, 3.00, 3.50, 4.00, 4.50, 5.00, 6.00, 7.00, 8.00, 9.00, 10.00}, "pTl bins for output histograms"}; + o2::framework::ConfigurableAxis ConfEtaBins{"ConfEtaBins", {20, -1, 1}, "eta bins for output histograms"}; + o2::framework::ConfigurableAxis ConfPhiBins{"ConfPhiBins", {36, 0, 2 * M_PI}, "phi bins for output histograms"}; + o2::framework::ConfigurableAxis ConfDCA3DBins{"ConfDCA3DBins", {o2::framework::VARIABLE_WIDTH, 0.0, 10.0}, "DCA3d bins in sigma for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAXYBins{"ConfDCAXYBins", {o2::framework::VARIABLE_WIDTH, -10.0, 10.0}, "DCAxy bins in sigma for output histograms"}; + o2::framework::ConfigurableAxis ConfDCAZBins{"ConfDCAZBins", {o2::framework::VARIABLE_WIDTH, -10.0, 10.0}, "DCAz bins in sigma for output histograms"}; EMEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; - Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; - Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; - Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; - Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; - Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", +10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", false, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireVertexTOFmatched{"cfgRequireVertexTOFmatched", false, "require Vertex TOFmatched in event cut"}; // ITS-TPC-TOF matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStandard{"cfgRequireNoCollInTimeRangeStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInTimeRangeStrict{"cfgRequireNoCollInTimeRangeStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStandard{"cfgRequireNoCollInITSROFStandard", false, "require no collision in time range standard"}; + o2::framework::Configurable cfgRequireNoCollInITSROFStrict{"cfgRequireNoCollInITSROFStrict", false, "require no collision in time range strict"}; + o2::framework::Configurable cfgRequireNoHighMultCollInPrevRof{"cfgRequireNoHighMultCollInPrevRof", false, "require no HM collision in previous ITS ROF"}; + o2::framework::Configurable cfgRequireGoodITSLayer3{"cfgRequireGoodITSLayer3", false, "number of inactive chips on ITS layer 3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayer0123{"cfgRequireGoodITSLayer0123", false, "number of inactive chips on ITS layers 0-3 are below threshold "}; + o2::framework::Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "number of inactive chips on all ITS layers are below threshold "}; // for RCT - Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; - Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; - Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; - Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; - - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; - Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; - Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; + o2::framework::Configurable cfgRequireGoodRCT{"cfgRequireGoodRCT", false, "require good detector flag in run condtion table"}; + o2::framework::Configurable cfgRCTLabel{"cfgRCTLabel", "CBT_hadronPID", "select 1 [CBT, CBT_hadronPID, CBT_muon_glo] see O2Physics/Common/CCDB/RCTSelectionFlags.h"}; + o2::framework::Configurable cfgCheckZDC{"cfgCheckZDC", false, "set ZDC flag for PbPb"}; + o2::framework::Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999.f, "max. centrality"}; + o2::framework::Configurable cfgNumContribMin{"cfgNumContribMin", 0, "min. numContrib"}; + o2::framework::Configurable cfgNumContribMax{"cfgNumContribMax", 65000, "max. numContrib"}; } eventcuts; DielectronCut fDielectronCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dielectroncut_group"; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; - Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; - Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; - Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; - Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; - Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. - Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; - Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - // Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; - // Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; - Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; - Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; - Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; - Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; - Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable includeITSsa{"includeITSsa", false, "Flag to include ITSsa tracks only for MC. switch ON only if needed."}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -0.8, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", +0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "min phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_mirror_phi_track{"cfg_mirror_phi_track", false, "mirror the phi cut around Pi, min and max Phi should be in 0-Pi"}; + o2::framework::Configurable cfg_reject_phi_track{"cfg_reject_phi_track", false, "reject the phi interval"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 100, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_chi2tof{"cfg_max_chi2tof", 1e+10, "max chi2 TOF"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.2, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.2, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_min_its_cluster_size{"cfg_min_its_cluster_size", 0.f, "min ITS cluster size"}; + o2::framework::Configurable cfg_max_its_cluster_size{"cfg_max_its_cluster_size", 16.f, "max ITS cluster size"}; + o2::framework::Configurable cfg_min_rel_diff_pin{"cfg_min_rel_diff_pin", -1e+10, "min rel. diff. between pin and ppv"}; + o2::framework::Configurable cfg_max_rel_diff_pin{"cfg_max_rel_diff_pin", +1e+10, "max rel. diff. between pin and ppv"}; + o2::framework::Configurable cfgRefR{"cfgRefR", 0.50, "ref. radius (m) for calculating phi position"}; // 0.50 +/- 0.06 can be syst. unc. + o2::framework::Configurable cfg_min_phiposition_track{"cfg_min_phiposition_track", 0.f, "min phi position for single track at certain radius"}; + o2::framework::Configurable cfg_max_phiposition_track{"cfg_max_phiposition_track", 6.3, "max phi position for single track at certain radius"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DielectronCut::PIDSchemes::kTPChadrejORTOFreq), "pid scheme [kTOFreq : 0, kTPChadrej : 1, kTPChadrejORTOFreq : 2, kTPConly : 3, kTOFif = 4, kPIDML = 5]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + // o2::framework::Configurable cfg_min_TPCNsigmaMu{"cfg_min_TPCNsigmaMu", -0.0, "min. TPC n sigma for muon exclusion"}; + // o2::framework::Configurable cfg_max_TPCNsigmaMu{"cfg_max_TPCNsigmaMu", +0.0, "max. TPC n sigma for muon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -1e+10, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +3.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaKa{"cfg_min_TPCNsigmaKa", -3.0, "min. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaKa{"cfg_max_TPCNsigmaKa", +3.0, "max. TPC n sigma for kaon exclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPr{"cfg_min_TPCNsigmaPr", -3.0, "min. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPr{"cfg_max_TPCNsigmaPr", +3.0, "max. TPC n sigma for proton exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_pin_pirejTPC{"cfg_min_pin_pirejTPC", 0.f, "min. pin for pion rejection in TPC"}; + o2::framework::Configurable cfg_max_pin_pirejTPC{"cfg_max_pin_pirejTPC", 1e+10, "max. pin for pion rejection in TPC"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable includeITSsa{"includeITSsa", false, "Flag to include ITSsa tracks only for MC. switch ON only if needed."}; // configuration for PID ML - Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; - Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; - Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; - Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; - Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; - Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; - Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; - Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; - Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; + o2::framework::Configurable> onnxFileNames{"onnxFileNames", std::vector{"filename"}, "ONNX file names for each bin (if not from CCDB full path)"}; + o2::framework::Configurable> onnxPathsCCDB{"onnxPathsCCDB", std::vector{"path"}, "Paths of models on CCDB"}; + o2::framework::Configurable> binsMl{"binsMl", std::vector{0.1, 0.15, 0.2, 0.25, 0.4, 0.8, 1.6, 2.0, 20.f}, "Bin limits for ML application"}; + o2::framework::Configurable> cutsMl{"cutsMl", std::vector{0.98, 0.98, 0.9, 0.9, 0.95, 0.95, 0.8, 0.8}, "ML cuts per bin"}; + o2::framework::Configurable> namesInputFeatures{"namesInputFeatures", std::vector{"feature"}, "Names of ML model input features"}; + o2::framework::Configurable nameBinningFeature{"nameBinningFeature", "pt", "Names of ML model binning feature"}; + o2::framework::Configurable timestampCCDB{"timestampCCDB", -1, "timestamp of the ONNX file for ML model used to query in CCDB. Exceptions: > 0 for the specific timestamp, 0 gets the run dependent timestamp"}; + o2::framework::Configurable loadModelsFromCCDB{"loadModelsFromCCDB", false, "Flag to enable or disable the loading of models from CCDB"}; + o2::framework::Configurable enableOptimizations{"enableOptimizations", false, "Enables the ONNX extended model-optimization: sessionOptions.SetGraphOptimizationLevel(GraphOptimizationLevel::ORT_ENABLE_EXTENDED)"}; } dielectroncuts; DimuonCut fDimuonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dimuoncut_group"; - Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; - Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; - Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; - Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; - Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; - Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; - Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; - Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; - Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; - // Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; - Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; - Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; - Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; - Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; - Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; - Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; - Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; - Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; - Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; - Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; - Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; - Configurable acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. - Configurable acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. + o2::framework::Configurable cfg_track_type{"cfg_track_type", 3, "muon track type [0: MFT-MCH-MID, 3: MCH-MID]"}; + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.2, "min pT for single track"}; + o2::framework::Configurable cfg_max_pt_track{"cfg_max_pt_track", 1e+10, "max pT for single track"}; + o2::framework::Configurable cfg_min_eta_track{"cfg_min_eta_track", -4.0, "min eta for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", -2.5, "max eta for single track"}; + o2::framework::Configurable cfg_min_phi_track{"cfg_min_phi_track", 0.f, "max phi for single track"}; + o2::framework::Configurable cfg_max_phi_track{"cfg_max_phi_track", 6.3, "max phi for single track"}; + o2::framework::Configurable cfg_min_ncluster_mft{"cfg_min_ncluster_mft", 5, "min ncluster MFT"}; + o2::framework::Configurable cfg_min_ncluster_mch{"cfg_min_ncluster_mch", 5, "min ncluster MCH"}; + o2::framework::Configurable cfg_max_chi2{"cfg_max_chi2", 1e+6, "max chi2/ndf"}; + o2::framework::Configurable cfg_max_chi2mft{"cfg_max_chi2mft", 1e+6, "max chi2/ndf"}; + // o2::framework::Configurable cfg_max_matching_chi2_mftmch{"cfg_max_matching_chi2_mftmch", 40, "max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_border_pt_for_chi2mchmft{"cfg_border_pt_for_chi2mchmft", 0, "border pt for different max chi2 for MFT-MCH matching"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_lowPt{"cfg_max_matching_chi2_mftmch_lowPt", 8, "max chi2 for MFT-MCH matching for low pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mftmch_highPt{"cfg_max_matching_chi2_mftmch_highPt", 40, "max chi2 for MFT-MCH matching for high pT"}; + o2::framework::Configurable cfg_max_matching_chi2_mchmid{"cfg_max_matching_chi2_mchmid", 1e+10, "max chi2 for MCH-MID matching"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 1e+10, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_min_rabs{"cfg_min_rabs", 17.6, "min Radius at the absorber end"}; + o2::framework::Configurable cfg_max_rabs{"cfg_max_rabs", 89.5, "max Radius at the absorber end"}; + o2::framework::Configurable enableTTCA{"enableTTCA", true, "Flag to enable or disable TTCA"}; + o2::framework::Configurable cfg_max_relDPt_wrt_matchedMCHMID{"cfg_max_relDPt_wrt_matchedMCHMID", 1e+10f, "max. relative dpt between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DEta_wrt_matchedMCHMID{"cfg_max_DEta_wrt_matchedMCHMID", 1e+10f, "max. deta between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable cfg_max_DPhi_wrt_matchedMCHMID{"cfg_max_DPhi_wrt_matchedMCHMID", 1e+10f, "max. dphi between MFT-MCH-MID and MCH-MID"}; + o2::framework::Configurable requireMFTHitMap{"requireMFTHitMap", false, "flag to apply MFT hit map"}; + o2::framework::Configurable> requiredMFTDisks{"requiredMFTDisks", std::vector{0}, "hit map on MFT disks [0,1,2,3,4]. logical-OR of each double-sided disk"}; + o2::framework::Configurable acceptOnlyCorrectMatch{"acceptOnlyCorrectMatch", false, "flag to accept only correct match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. + o2::framework::Configurable acceptOnlyWrongMatch{"acceptOnlyWrongMatch", false, "flag to accept only wrong match between MFT and MCH-MID"}; // this is only for MC study, as we don't know correct match in data. } dimuoncuts; o2::aod::rctsel::RCTFlagsChecker rctChecker; o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "mctrackcut_group"; - Configurable min_mcPt{"min_mcPt", 0.2, "min. MC pT for generated single lepton"}; - Configurable max_mcPt{"max_mcPt", 1e+10, "max. MC pT single lepton"}; - Configurable min_mcEta{"min_mcEta", -0.8, "max. MC eta single lepton"}; - Configurable max_mcEta{"max_mcEta", +0.8, "max. MC eta single lepton"}; + o2::framework::Configurable min_mcPt{"min_mcPt", 0.2, "min. MC pT for generated single lepton"}; + o2::framework::Configurable max_mcPt{"max_mcPt", 1e+10, "max. MC pT single lepton"}; + o2::framework::Configurable min_mcEta{"min_mcEta", -0.8, "max. MC eta single lepton"}; + o2::framework::Configurable max_mcEta{"max_mcEta", +0.8, "max. MC eta single lepton"}; } mctrackcuts; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 HistogramRegistry can keep up to 512 histograms + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; // 1 o2::framework::HistogramRegistry can keep up to 512 histograms static constexpr std::string_view event_cut_types[2] = {"before/", "after/"}; static constexpr std::string_view lepton_source_types[8] = {"PromptLF/", "NonPromptLF/", "Photon/", "PromptJPsi/", "NonPromptJPsi/", "c2l/", "b2l/", "b2c2l/"}; @@ -245,22 +258,22 @@ struct SingleTrackQCMC { { // event info o2::aod::pwgem::dilepton::utils::eventhistogram::addEventHistograms<-1>(&fRegistry); - fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); - fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx", "mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); + fRegistry.add("MCEvent/before/hZvtx_rec", "rec. mc vertex z; Z_{vtx} (cm)", o2::framework::kTH1F, {{100, -50, +50}}, false); fRegistry.addClone("MCEvent/before/", "MCEvent/after/"); if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { - const AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"}; - const AxisSpec axis_eta{ConfEtaBins, "#eta_{e}"}; - const AxisSpec axis_phi{ConfPhiBins, "#varphi_{e} (rad.)"}; - const AxisSpec axis_phiposition{36, 0.0, 2 * M_PI, "#varphi_{e}^{*} (rad.)"}; - const AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; - const AxisSpec axis_dca3D{ConfDCA3DBins, "DCA_{e}^{3D} (#sigma)"}; - const AxisSpec axis_dcaXY{ConfDCAXYBins, "DCA_{e}^{XY} (#sigma)"}; - const AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; + const o2::framework::AxisSpec axis_pt{ConfPtlBins, "p_{T,e} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta{ConfEtaBins, "#eta_{e}"}; + const o2::framework::AxisSpec axis_phi{ConfPhiBins, "#varphi_{e} (rad.)"}; + const o2::framework::AxisSpec axis_phiposition{36, 0.0, 2 * M_PI, "#varphi_{e}^{*} (rad.)"}; + const o2::framework::AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; + const o2::framework::AxisSpec axis_dca3D{ConfDCA3DBins, "DCA_{e}^{3D} (#sigma)"}; + const o2::framework::AxisSpec axis_dcaXY{ConfDCAXYBins, "DCA_{e}^{XY} (#sigma)"}; + const o2::framework::AxisSpec axis_dcaZ{ConfDCAZBins, "DCA_{e}^{Z} (#sigma)"}; // generated info - fRegistry.add("Generated/PromptLF/hs", "gen. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); + fRegistry.add("Generated/PromptLF/hs", "gen. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptLF/"); fRegistry.addClone("Generated/PromptLF/", "Generated/PromptJPsi/"); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptJPsi/"); @@ -269,33 +282,33 @@ struct SingleTrackQCMC { fRegistry.addClone("Generated/PromptLF/", "Generated/b2c2l/"); // track info - fRegistry.add("Track/PromptLF/positive/hs", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hs", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); if (fillGenValuesForRec) { - fRegistry.add("Track/PromptLF/positive/hsGenRec", "rec. single electron", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hsGenRec", "rec. single electron", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca3D, axis_dcaXY, axis_dcaZ, axis_charge_gen}, true); } if (cfgFillQA) { - fRegistry.add("Track/PromptLF/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), kTH1F, {axis_phiposition}, false); - fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{4000, -20, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/PromptLF/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", kTH1F, {{200, 0, 2}}, false); - fRegistry.add("Track/PromptLF/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", kTH1F, {{8, -0.5, 7.5}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", kTH1F, {{100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hITSClusterMap", "ITS cluster map", kTH1F, {{128, -0.5, 127.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPIDForTracking", "PID for trackng", kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPhiPosition", Form("phi position at r_{xy} = %3.2f m", dielectroncuts.cfgRefR.value), o2::framework::kTH1F, {axis_phiposition}, false); + fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{4000, -20, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyz", "DCA xy vs. z;DCA_{xy} (cm);DCA_{z} (cm)", o2::framework::kTH2F, {{200, -1.0f, 1.0f}, {200, -1.f, 1.f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyzSigma", "DCA xy vs. z;DCA_{xy} (#sigma);DCA_{z} (#sigma)", o2::framework::kTH2F, {{400, -20.0f, 20.0f}, {400, -20.0f, 20.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAzRes_Pt", "DCA_{z} resolution vs. pT;p_{T} (GeV/c);DCA_{z} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCA3dRes_Pt", "DCA_{3D} resolution vs. pT;p_{T} (GeV/c);DCA_{3D} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0., 500}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsTPC_Pt", "number of TPC clusters;p_{T,e} (GeV/c);TPC N_{cls}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/PromptLF/positive/hNcrTPC_Pt", "number of TPC crossed rows;p_{T,e} (GeV/c);TPC N_{CR}", o2::framework::kTH2F, {axis_pt, {161, -0.5, 160.5}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2TPC", "chi2/number of TPC clusters;TPC #chi^{2}/N_{CR}", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNcr2Nf", "TPC Ncr/Nfindable;TPC N_{CR}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNcls2Nf", "TPC Ncls/Nfindable;TPC N_{cls}/N_{cls}^{findable}", o2::framework::kTH1F, {{200, 0, 2}}, false); + fRegistry.add("Track/PromptLF/positive/hTPCNclsShared", "TPC Ncls shared/Ncls;p_{T} (GeV/c);N_{cls}^{shared}/N_{cls} in TPC", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 1}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsITS", "number of ITS clusters;ITS N_{cls}", o2::framework::kTH1F, {{8, -0.5, 7.5}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2ITS", "chi2/number of ITS clusters;ITS #chi^{2}/N_{cls}", o2::framework::kTH1F, {{100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hDeltaPin", "p_{in} vs. p_{pv};p_{in} (GeV/c);(p_{pv} - p_{in})/p_{in}", o2::framework::kTH2F, {{1000, 0, 10}, {200, -1, +1}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2TOF", "TOF Chi2;p_{pv} (GeV/c);TOF #chi^{2}", o2::framework::kTH2F, {{1000, 0, 10}, {100, 0, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hITSClusterMap", "ITS cluster map", o2::framework::kTH1F, {{128, -0.5, 127.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPIDForTracking", "PID for trackng", o2::framework::kTH1F, {{9, -0.5, 8.5}}, false); // see numbering in O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "electron p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "electron #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "electron #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); } fRegistry.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -305,32 +318,32 @@ struct SingleTrackQCMC { fRegistry.addClone("Track/PromptLF/", "Track/c2l/"); fRegistry.addClone("Track/PromptLF/", "Track/b2l/"); fRegistry.addClone("Track/PromptLF/", "Track/b2c2l/"); - fRegistry.add("Track/Photon/positive/hProdVtx", "production vertex of e from #gamma;p_{T,e}^{rec} (GeV/c);r_{xy}^{gen} (cm);", kTH2F, {axis_pt, {100, 0, 100}}, false); + fRegistry.add("Track/Photon/positive/hProdVtx", "production vertex of e from #gamma;p_{T,e}^{rec} (GeV/c);r_{xy}^{gen} (cm);", o2::framework::kTH2F, {axis_pt, {100, 0, 100}}, false); fRegistry.addClone("Track/Photon/positive/hProdVtx", "Track/Photon/negative/hProdVtx"); if (cfgFillQA) { - fRegistry.add("Track/PID/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - // fRegistry.add("Track/PID/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); - fRegistry.add("Track/PID/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); - fRegistry.add("Track/PID/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hTPCdEdx", "TPC dE/dx;p_{in} (GeV/c);TPC dE/dx (a.u.)", o2::framework::kTH2F, {{1000, 0, 10}, {200, 0, 200}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaEl", "TPC n sigma el;p_{in} (GeV/c);n #sigma_{e}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + // fRegistry.add("Track/PID/positive/hTPCNsigmaMu", "TPC n sigma mu;p_{in} (GeV/c);n #sigma_{#mu}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaPi", "TPC n sigma pi;p_{in} (GeV/c);n #sigma_{#pi}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaKa", "TPC n sigma ka;p_{in} (GeV/c);n #sigma_{K}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTPCNsigmaPr", "TPC n sigma pr;p_{in} (GeV/c);n #sigma_{p}^{TPC}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hTOFbeta", "TOF #beta;p_{pv} (GeV/c);#beta", o2::framework::kTH2F, {{1000, 0, 10}, {240, 0, 1.2}}, false); + fRegistry.add("Track/PID/positive/hTOFNsigmaEl", "TOF n sigma el;p_{pv} (GeV/c);n #sigma_{e}^{TOF}", o2::framework::kTH2F, {{1000, 0, 10}, {100, -5, +5}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITS", "mean cluster size ITS;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITSib", "mean cluster size ITS inner barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); + fRegistry.add("Track/PID/positive/hMeanClusterSizeITSob", "mean cluster size ITS outer barrel;p_{pv} (GeV/c); on ITS #times cos(#lambda)", o2::framework::kTH2F, {{1000, 0.f, 10.f}, {150, 0, 15}}, false); fRegistry.addClone("Track/PID/positive/", "Track/PID/negative/"); } } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - const AxisSpec axis_pt{ConfPtlBins, "p_{T,#mu} (GeV/c)"}; - const AxisSpec axis_eta{ConfEtaBins, "#eta_{#mu}"}; - const AxisSpec axis_phi{ConfPhiBins, "#varphi_{#mu} (rad.)"}; - const AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; - const AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; + const o2::framework::AxisSpec axis_pt{ConfPtlBins, "p_{T,#mu} (GeV/c)"}; + const o2::framework::AxisSpec axis_eta{ConfEtaBins, "#eta_{#mu}"}; + const o2::framework::AxisSpec axis_phi{ConfPhiBins, "#varphi_{#mu} (rad.)"}; + const o2::framework::AxisSpec axis_dca{ConfDCAXYBins, "DCA_{#mu}^{XY} (#sigma)"}; + const o2::framework::AxisSpec axis_charge_gen{3, -1.5, +1.5, "true charge"}; // generated info - fRegistry.add("Generated/PromptLF/hs", "gen. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); + fRegistry.add("Generated/PromptLF/hs", "gen. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_charge_gen}, true); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptLF/"); fRegistry.addClone("Generated/PromptLF/", "Generated/PromptJPsi/"); fRegistry.addClone("Generated/PromptLF/", "Generated/NonPromptJPsi/"); @@ -339,37 +352,37 @@ struct SingleTrackQCMC { fRegistry.addClone("Generated/PromptLF/", "Generated/b2c2l/"); // track info - fRegistry.add("Track/PromptLF/positive/hs", "rec. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hs", "rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); if (fillGenValuesForRec) { - fRegistry.add("Track/PromptLF/positive/hsGenRec", "gen. info of rec. single muon", kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); + fRegistry.add("Track/PromptLF/positive/hsGenRec", "gen. info of rec. single muon", o2::framework::kTHnSparseD, {axis_pt, axis_eta, axis_phi, axis_dca, axis_charge_gen}, true); } if (cfgFillQA) { - fRegistry.add("Track/PromptLF/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); - fRegistry.add("Track/PromptLF/positive/hdEtadPhi", "#Delta#eta vs. #Delta#varphi between MFT-MCH-MID and MCH-MID;#varphi_{sa} - #varphi_{gl} (rad.);#eta_{sa} - #eta_{gl}", kTH2F, {{90, -M_PI / 4, M_PI / 4}, {100, -0.5, +0.5}}, false); - fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", kTH1F, {{1000, -5, 5}}, false); - fRegistry.add("Track/PromptLF/positive/hTrackType", "track type", kTH1F, {{6, -0.5f, 5.5}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy", "DCAxy;DCA_{xy} (cm)", kTH1F, {{100, 0.f, 1.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxy2DinSigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAx_PosZ", "DCA_{x} vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAy_PosZ", "DCA_{y} vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsMCH", "number of MCH clusters", kTH1F, {{21, -0.5, 20.5}}, false); - fRegistry.add("Track/PromptLF/positive/hNclsMFT", "number of MFT clusters", kTH1F, {{11, -0.5, 10.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPDCA", "pDCA;R at absorber (cm);p #times DCA (GeV/c #upoint cm)", kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); - fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); - fRegistry.add("Track/PromptLF/positive/hMFTClusterMap", "MFT cluster map", kTH1F, {{1024, -0.5, 1023.5}}, false); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "muon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "muon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "muon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); - fRegistry.add("Track/PromptLF/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); + fRegistry.add("Track/PromptLF/positive/hEtaPhi_MatchMCHMID", "#eta vs. #varphi of matched MCHMID", o2::framework::kTH2F, {{180, 0, 2.f * M_PI}, {80, -4, -2}}, false); + fRegistry.add("Track/PromptLF/positive/hdEtadPhi", "#Delta#eta vs. #Delta#varphi between MFT-MCH-MID and MCH-MID;#varphi_{sa} - #varphi_{gl} (rad.);#eta_{sa} - #eta_{gl}", o2::framework::kTH2F, {{90, -M_PI / 4, M_PI / 4}, {100, -0.5, +0.5}}, false); + fRegistry.add("Track/PromptLF/positive/hQoverPt", "q/pT;q/p_{T} (GeV/c)^{-1}", o2::framework::kTH1F, {{1000, -5, 5}}, false); + fRegistry.add("Track/PromptLF/positive/hTrackType", "track type", o2::framework::kTH1F, {{6, -0.5f, 5.5}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy", "DCAxy;DCA_{xy} (cm)", o2::framework::kTH1F, {{100, 0.f, 1.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy2D", "DCA x vs. y;DCA_{x} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -0.5f, 0.5f}, {200, -0.5f, 0.5f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxy2DinSigma", "DCA x vs. y;DCA_{x} (#sigma);DCA_{y} (#sigma)", o2::framework::kTH2F, {{200, -10.0f, 10.0f}, {200, -10.0f, 10.0f}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxRes_Pt", "DCA_{x} resolution vs. pT;p_{T} (GeV/c);DCA_{x} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAyRes_Pt", "DCA_{y} resolution vs. pT;p_{T} (GeV/c);DCA_{y} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAxyRes_Pt", "DCA_{xy} resolution vs. pT;p_{T} (GeV/c);DCA_{xy} resolution (#mum)", o2::framework::kTH2F, {{200, 0, 10}, {500, 0, 500}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAx_PosZ", "DCA_{x} vs. posZ;Z_{vtx} (cm);DCA_{x} (cm)", o2::framework::kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAy_PosZ", "DCA_{y} vs. posZ;Z_{vtx} (cm);DCA_{y} (cm)", o2::framework::kTH2F, {{200, -10, 10}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAx_Phi", "DCAx vs. #varphi;#varphi (rad.);DCA_{x} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hDCAy_Phi", "DCAy vs. #varphi;#varphi (rad.);DCA_{y} (cm)", o2::framework::kTH2F, {{90, 0, 2 * M_PI}, {400, -0.2, +0.2}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsMCH", "number of MCH clusters", o2::framework::kTH1F, {{21, -0.5, 20.5}}, false); + fRegistry.add("Track/PromptLF/positive/hNclsMFT", "number of MFT clusters", o2::framework::kTH1F, {{11, -0.5, 10.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPDCA", "pDCA;R at absorber (cm);p #times DCA (GeV/c #upoint cm)", o2::framework::kTH2F, {{100, 0, 100}, {100, 0.0f, 1000}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2_Pt", "chi2;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MFT_Pt", "chi2MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 10}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMID_Pt", "chi2 match MCH-MID;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {200, 0.0f, 20}}, false); + fRegistry.add("Track/PromptLF/positive/hChi2MatchMCHMFT_Pt", "chi2 match MCH-MFT;p_{T,#mu} (GeV/c);chi2/ndf", o2::framework::kTH2F, {{100, 0, 10}, {100, 0.0f, 50}}, false); + fRegistry.add("Track/PromptLF/positive/hMFTClusterMap", "MFT cluster map", o2::framework::kTH1F, {{1024, -0.5, 1023.5}}, false); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPtOverPtGen", "muon p_{T} resolution;p_{T}^{gen} (GeV/c);(p_{T}^{rec} - p_{T}^{gen})/p_{T}^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {200, -1.0f, 1.0f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaEta", "muon #eta resolution;p_{T}^{gen} (GeV/c);#eta^{rec} - #eta^{gen}", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hPtGen_DeltaPhi", "muon #varphi resolution;p_{T}^{gen} (GeV/c);#varphi^{rec} - #varphi^{gen} (rad.)", o2::framework::kTH2F, {{200, 0, 10}, {100, -0.05f, 0.05f}}, true); + fRegistry.add("Track/PromptLF/positive/hdR_Chi2MatchMCHMFT", "dr vs. matching chi2 MCH-MFT;chi2 match MCH-MFT;#DeltaR;", o2::framework::kTH2F, {{200, 0, 50}, {200, 0, 0.5}}, false); } fRegistry.addClone("Track/PromptLF/positive/", "Track/PromptLF/negative/"); fRegistry.addClone("Track/PromptLF/", "Track/NonPromptLF/"); @@ -384,7 +397,7 @@ struct SingleTrackQCMC { bool fillGenValuesForRec = false; int pdg_lepton = 0; - void init(InitContext&) + void init(o2::framework::InitContext&) { if (doprocessQCMC && doprocessQCMC_Smeared) { LOGF(fatal, "Cannot enable processQCMC and processQCMC_Smeared at the same time. Please choose one."); @@ -416,7 +429,7 @@ struct SingleTrackQCMC { fRegistry.addClone("Event/before/hCollisionCounter", "Event/norm/hCollisionCounter"); } if (doprocessBC) { - auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", kTH1D, {{6, -0.5f, 5.5f}}); + auto hTVXCounter = fRegistry.add("BC/hTVXCounter", "TVX counter", o2::framework::kTH1D, {{6, -0.5f, 5.5f}}); hTVXCounter->GetXaxis()->SetBinLabel(1, "TVX"); hTVXCounter->GetXaxis()->SetBinLabel(2, "TVX && NoTFB"); hTVXCounter->GetXaxis()->SetBinLabel(3, "TVX && NoITSROFB"); @@ -613,9 +626,9 @@ struct SingleTrackQCMC { void fillElectronInfo(TTrack const& track) { auto mctrack = track.template emmcparticle_as(); - float dca3D = dca3DinSigma(track); - float dcaXY = dcaXYinSigma(track); - float dcaZ = dcaZinSigma(track); + float dca3D = o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track); + float dcaXY = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaXYinSigma(track); + float dcaZ = o2::aod::pwgem::dilepton::utils::emtrackutil::dcaZinSigma(track); float phiPosition = track.phi() + std::asin(-0.30282 * track.sign() * (d_bz * 0.1) * dielectroncuts.cfgRefR / (2.f * track.pt())); o2::math_utils::bringTo02Pi(phiPosition); @@ -639,9 +652,9 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyzSigma"), dcaXY, dcaZ); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCA3dRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaDca3D(track) * 1e+4); // convert cm to um fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hNclsTPC_Pt"), track.pt(), track.tpcNClsFound()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hNcrTPC_Pt"), track.pt(), track.tpcNClsCrossedRows()); @@ -685,9 +698,9 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hQoverPt"), track.sign() / track.pt()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyz"), track.dcaXY(), track.dcaZ()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyzSigma"), dcaXY, dcaZ); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCA3dRes_Pt"), track.pt(), sigmaDca3D(track) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAzRes_Pt"), track.pt(), std::sqrt(track.cZZ()) * 1e+4); // convert cm to um + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCA3dRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaDca3D(track) * 1e+4); // convert cm to um fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hNclsITS"), track.itsNCls()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hNclsTPC_Pt"), track.pt(), track.tpcNClsFound()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hNcrTPC_Pt"), track.pt(), track.tpcNClsCrossedRows()); @@ -725,7 +738,7 @@ struct SingleTrackQCMC { void fillMuonInfo(TTrack const& track, TCollision const& collision) { auto mctrack = track.template emmcparticle_as(); - float dca_xy = fwdDcaXYinSigma(track); + float dca_xy = o2::aod::pwgem::dilepton::utils::emtrackutil::fwdDcaXYinSigma(track); float deta = track.etaMatchedMCHMID() - track.eta(); float dphi = track.phiMatchedMCHMID() - track.phi(); o2::math_utils::bringToPMPi(dphi); @@ -751,7 +764,7 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxy2DinSigma"), track.fwdDcaX() / std::sqrt(track.cXX()), track.fwdDcaY() / std::sqrt(track.cYY())); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxRes_Pt"), track.pt(), std::sqrt(track.cXX()) * 1e+4); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAxyRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAx_PosZ"), collision.posZ(), track.fwdDcaX()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAy_PosZ"), collision.posZ(), track.fwdDcaY()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("positive/hDCAx_Phi"), track.phi(), track.fwdDcaX()); @@ -784,7 +797,7 @@ struct SingleTrackQCMC { fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxy2DinSigma"), track.fwdDcaX() / std::sqrt(track.cXX()), track.fwdDcaY() / std::sqrt(track.cYY())); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxRes_Pt"), track.pt(), std::sqrt(track.cXX()) * 1e+4); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAyRes_Pt"), track.pt(), std::sqrt(track.cYY()) * 1e+4); - fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), sigmaFwdDcaXY(track) * 1e+4); + fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAxyRes_Pt"), track.pt(), o2::aod::pwgem::dilepton::utils::emtrackutil::sigmaFwdDcaXY(track) * 1e+4); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAx_PosZ"), collision.posZ(), track.fwdDcaX()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAy_PosZ"), collision.posZ(), track.fwdDcaY()); fRegistry.fill(HIST("Track/") + HIST(lepton_source_types[lepton_source_id]) + HIST("negative/hDCAx_Phi"), track.phi(), track.fwdDcaX()); @@ -883,21 +896,21 @@ struct SingleTrackQCMC { if (mctrack.isPhysicalPrimary() || mctrack.producedByGenerator()) { if (pdg_mother == 111 || pdg_mother == 221 || pdg_mother == 331 || pdg_mother == 113 || pdg_mother == 223 || pdg_mother == 333) { - if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { fillTrackInfo<0, TMCParticles>(track, collision); // PromptLF } else { fillTrackInfo<1, TMCParticles>(track, collision); // NonPromptLF } } else if (pdg_mother == 443) { - if (IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. fillTrackInfo<4, TMCParticles>(track, collision); } else { fillTrackInfo<3, TMCParticles>(track, collision); } - } else if (isWeakDecayFromBeautyHadron(mctrack, mcparticles)) { // hb->l is found in full decay chain. + } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromBeautyHadron(mctrack, mcparticles)) { // hb->l is found in full decay chain. fillTrackInfo<6, TMCParticles>(track, collision); - } else if (isWeakDecayFromCharmHadron(mctrack, mcparticles)) { // hc->l is found in full decay chain. - if (IsFromBeauty(mcmother, mcparticles) > 0) { + } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromCharmHadron(mctrack, mcparticles)) { // hc->l is found in full decay chain. + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fillTrackInfo<7, TMCParticles>(track, collision); // hb->hc->l is fond. } else { fillTrackInfo<5, TMCParticles>(track, collision); // prompt hc->l is found. @@ -983,21 +996,21 @@ struct SingleTrackQCMC { } if (pdg_mother == 111 || pdg_mother == 221 || pdg_mother == 331 || pdg_mother == 113 || pdg_mother == 223 || pdg_mother == 333) { - if (IsFromCharm(mcmother, mcparticles) < 0 && IsFromBeauty(mcmother, mcparticles) < 0) { + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromCharm(mcmother, mcparticles) < 0 && o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) < 0) { fRegistry.fill(HIST("Generated/PromptLF/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); } else { fRegistry.fill(HIST("Generated/NonPromptLF/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); } } else if (pdg_mother == 443) { - if (IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { // b is found in full decay chain. fRegistry.fill(HIST("Generated/NonPromptJPsi/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); } else { fRegistry.fill(HIST("Generated/PromptJPsi/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); } - } else if (isWeakDecayFromBeautyHadron(lepton, mcparticles)) { // hb->l is found + } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromBeautyHadron(lepton, mcparticles)) { // hb->l is found fRegistry.fill(HIST("Generated/b2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); - } else if (isWeakDecayFromCharmHadron(lepton, mcparticles)) { // hc->l is found in full decay chain. - if (IsFromBeauty(mcmother, mcparticles) > 0) { + } else if (o2::aod::pwgem::dilepton::utils::mcutil::isWeakDecayFromCharmHadron(lepton, mcparticles)) { // hc->l is found in full decay chain. + if (o2::aod::pwgem::dilepton::utils::mcutil::IsFromBeauty(mcmother, mcparticles) > 0) { fRegistry.fill(HIST("Generated/b2c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); // hb->hc->l is found in full decay chain. } else { fRegistry.fill(HIST("Generated/c2l/hs"), pt, eta, phi, -lepton.pdgCode() / pdg_lepton); // prompt hc->l is found in full decay chain. @@ -1106,29 +1119,29 @@ struct SingleTrackQCMC { } std::unordered_map map_best_match_globalmuon; - SliceCache cache; - Preslice perCollision_electron = aod::emprimaryelectron::emeventId; - Filter trackFilter_electron = o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; - Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; - Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectron::emeventId; + o2::framework::expressions::Filter trackFilter_electron = o2::aod::track::tpcChi2NCl < dielectroncuts.cfg_max_chi2tpc && o2::aod::track::itsChi2NCl < dielectroncuts.cfg_max_chi2its && nabs(o2::aod::track::dcaXY) < dielectroncuts.cfg_max_dcaxy && nabs(o2::aod::track::dcaZ) < dielectroncuts.cfg_max_dcaz; + o2::framework::expressions::Filter pidFilter_electron = dielectroncuts.cfg_min_TPCNsigmaEl < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < dielectroncuts.cfg_max_TPCNsigmaEl; + o2::framework::expressions::Filter ttcaFilter_electron = ifnode(dielectroncuts.enableTTCA.node(), true, o2::aod::emprimaryelectron::isAssociatedToMPC == true); - Preslice perCollision_muon = aod::emprimarymuon::emeventId; - Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; - Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); + o2::framework::Preslice perCollision_muon = o2::aod::emprimarymuon::emeventId; + o2::framework::expressions::Filter trackFilter_muon = o2::aod::fwdtrack::trackType == dimuoncuts.cfg_track_type && dimuoncuts.cfg_min_phi_track < o2::aod::fwdtrack::phi && o2::aod::fwdtrack::phi < dimuoncuts.cfg_max_phi_track; + o2::framework::expressions::Filter ttcaFilter_muon = ifnode(dimuoncuts.enableTTCA.node(), true, o2::aod::emprimarymuon::isAssociatedToMPC == true); - Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); - Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - using FilteredMyCollisions = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_centrality = (eventcuts.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < eventcuts.cfgCentMax) || (eventcuts.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < eventcuts.cfgCentMax); + o2::framework::expressions::Filter collisionFilter_numContrib = eventcuts.cfgNumContribMin <= o2::aod::collision::numContrib && o2::aod::collision::numContrib < eventcuts.cfgNumContribMax; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + using FilteredMyCollisions = o2::soa::Filtered; - Partition electronsMC = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- - Partition muonsMC = nabs(o2::aod::mcparticle::pdgCode) == 13; // mu+, mu- - PresliceUnsorted perMcCollision = aod::emmcparticle::emmceventId; + o2::framework::Partition electronsMC = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- + o2::framework::Partition muonsMC = nabs(o2::aod::mcparticle::pdgCode) == 13; // mu+, mu- + o2::framework::PresliceUnsorted perMcCollision = o2::aod::emmcparticle::emmceventId; - // PresliceUnsorted recColperMcCollision = aod::emmceventlabel::emmceventId; + // o2::framework::PresliceUnsorted recColperMcCollision = o2::aod::emmceventlabel::emmceventId; - void processQCMC(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, TLeptons const& tracks) + void processQCMC(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, TLeptons const& tracks) { if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDielectron) { if (cfgApplyWeightTTCA) { @@ -1137,7 +1150,7 @@ struct SingleTrackQCMC { runQCMC(collisions, tracks, perCollision_electron, fDielectronCut, mccollisions, mcparticles); runGenInfo(collisions, electronsMC, mccollisions, mcparticles); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - map_best_match_globalmuon = findBestMatchMap(tracks, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(tracks, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, tracks, perCollision_muon, fDimuonCut, mccollisions, mcparticles); } @@ -1149,8 +1162,8 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processQCMC, "run single track QC MC", true); - Partition electronsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- - Partition muonsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 13; // mu+, mu- + o2::framework::Partition electronsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 11; // e+, e- + o2::framework::Partition muonsMC_smeared = nabs(o2::aod::mcparticle::pdgCode) == 13; // mu+, mu- void processQCMC_Smeared(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, TLeptons const& tracks, TSmearedMCParticles const& mcparticles_smeared) { @@ -1161,7 +1174,7 @@ struct SingleTrackQCMC { runQCMC(collisions, tracks, perCollision_electron, fDielectronCut, mccollisions, mcparticles_smeared); runGenInfo(collisions, electronsMC_smeared, mccollisions, mcparticles_smeared); } else if constexpr (pairtype == o2::aod::pwgem::dilepton::utils::pairutil::DileptonPairType::kDimuon) { - map_best_match_globalmuon = findBestMatchMap(tracks, fDimuonCut); + map_best_match_globalmuon = o2::aod::pwgem::dilepton::utils::emtrackutil::findBestMatchMap(tracks, fDimuonCut); if (cfgApplyWeightTTCA) { fillTrackWeightMap(collisions, tracks, perCollision_muon, fDimuonCut, mccollisions, mcparticles_smeared); } @@ -1173,7 +1186,7 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processQCMC_Smeared, "run single track QC MC with smearing", false); - void processNorm(aod::EMEventNormInfos const& collisions) + void processNorm(o2::aod::EMEventNormInfos const& collisions) { for (const auto& collision : collisions) { fRegistry.fill(HIST("Event/norm/hCollisionCounter"), 1.0); @@ -1242,7 +1255,7 @@ struct SingleTrackQCMC { } PROCESS_SWITCH(SingleTrackQCMC, processNorm, "process normalization info", false); - void processBC(aod::EMBCs const& bcs) + void processBC(o2::aod::EMBCs const& bcs) { for (const auto& bc : bcs) { if (bc.selection_bit(o2::aod::emevsel::kIsTriggerTVX)) { diff --git a/PWGEM/Dilepton/DataModel/dileptonTables.h b/PWGEM/Dilepton/DataModel/dileptonTables.h index 882f714188e..7768db5327c 100644 --- a/PWGEM/Dilepton/DataModel/dileptonTables.h +++ b/PWGEM/Dilepton/DataModel/dileptonTables.h @@ -16,7 +16,6 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" -#include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" #include @@ -96,7 +95,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(Sel8, sel8, [](uint32_t selection_bit) -> bool { retu template uint32_t reduceSelectionBit(TBC const& bc) { - // input should be aod::BcSels or aod::EvSels. + // input should be o2::aod::BcSels or o2::aod::EvSels. uint32_t bitMap = 0; if (bc.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { SETBIT(bitMap, o2::aod::emevsel::kIsTriggerTVX); @@ -157,8 +156,8 @@ uint32_t reduceSelectionBit(TBC const& bc) namespace emevent { DECLARE_SOA_COLUMN(CollisionId, collisionId, int); -DECLARE_SOA_BITMAP_COLUMN(SWTAliasTmp, swtaliastmp, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to aod::Collisions for skimming -DECLARE_SOA_BITMAP_COLUMN(SWTAlias, swtalias, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to aod::EMEvents for analysis +DECLARE_SOA_BITMAP_COLUMN(SWTAliasTmp, swtaliastmp, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to o2::aod::Collisions for skimming +DECLARE_SOA_BITMAP_COLUMN(SWTAlias, swtalias, 16); //! Bitmask of fired trigger aliases (see above for definitions) to be join to o2::aod::EMEvents for analysis DECLARE_SOA_COLUMN(NInspectedTVX, nInspectedTVX, uint64_t); //! the number of inspected TVX bcs per run DECLARE_SOA_COLUMN(NScalars, nScalers, std::vector); //! the number of triggered bcs before down scaling per run DECLARE_SOA_COLUMN(NSelections, nSelections, std::vector); //! the number of triggered bcs after down scaling per run @@ -364,7 +363,7 @@ using EMEventCent = EMEventsCent::iterator; // using EMEventsCentBase = EMEventsCentBase_001; // using EMEventCentBase = EMEventsCentBase::iterator; // -// // Extended table with expression columns that can be used for Filter. +// // Extended table with expression columns that can be used for o2::framework::expressions::Filter. // DECLARE_SOA_EXTENDED_TABLE_USER(EMEventsCent, EMEventsCentBase, "EMCENTEXT", // emcent::CentFT0M, emcent::CentFT0A, emcent::CentFT0C, emcent::CentNTPV, emcent::CentNGlobal); // @@ -461,7 +460,7 @@ using EMSWTriggerATCounter = EMSWTriggerATCounters::iterator; DECLARE_SOA_TABLE(EMSWTriggerTOICounters, "AOD", "EMSWTTOI", emevent::IsAnalyzedToI, o2::soa::Marker<1>); //! independent table. Don't join anything. using EMSWTriggerTOICounter = EMSWTriggerTOICounters::iterator; -DECLARE_SOA_TABLE(EMSWTriggerBitsTMP, "AOD", "EMSWTBITTMP", emevent::SWTAliasTmp, o2::soa::Marker<2>); //! joinable to aod::Collisions +DECLARE_SOA_TABLE(EMSWTriggerBitsTMP, "AOD", "EMSWTBITTMP", emevent::SWTAliasTmp, o2::soa::Marker<2>); //! joinable to o2::aod::Collisions using EMSWTriggerBitTMP = EMSWTriggerBitsTMP::iterator; DECLARE_SOA_TABLE(EMSWTriggerInfosTMP, "AOD", "EMSWTINFOTMP", bc::RunNumber, emevent::NInspectedTVX, emevent::NScalars, emevent::NSelections, o2::soa::Marker<2>); @@ -477,14 +476,14 @@ DECLARE_SOA_TABLE(EMEventsProperty, "AOD", "EMEVENTPROP", //! joinable to EMEven emevent::SpherocityPtWeighted, emevent::SpherocityPtUnWeighted, emevent::NtrackSpherocity); using EMEventProperty = EMEventsProperty::iterator; -DECLARE_SOA_TABLE(EMEventsNee, "AOD", "EMEVENTNEE", emevent::NeeULS, emevent::NeeLSpp, emevent::NeeLSmm); // joinable to EMEvents or aod::Collisions +DECLARE_SOA_TABLE(EMEventsNee, "AOD", "EMEVENTNEE", emevent::NeeULS, emevent::NeeLSpp, emevent::NeeLSmm); // joinable to EMEvents or o2::aod::Collisions using EMEventNee = EMEventsNee::iterator; -DECLARE_SOA_TABLE(EMEvSels, "AOD", "EMEVSEL", //! joinable to aod::Collisions +DECLARE_SOA_TABLE(EMEvSels, "AOD", "EMEVSEL", //! joinable to o2::aod::Collisions emevent::IsSelected); using EMEvSel = EMEvSels::iterator; -DECLARE_SOA_TABLE(EMEoIs, "AOD", "EMEOI", //! joinable to aod::Collisions in createEMEventDilepton.cxx +DECLARE_SOA_TABLE(EMEoIs, "AOD", "EMEOI", //! joinable to o2::aod::Collisions in createEMEventDilepton.cxx emevent::IsEoI); using EMEoI = EMEoIs::iterator; @@ -536,8 +535,8 @@ using EMMCEventLabel = EMMCEventLabels::iterator; namespace emmcparticle { DECLARE_SOA_INDEX_COLUMN(EMMCEvent, emmcevent); -DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Mothers, mothers); //! Mother tracks (possible empty) array. Iterate over mcParticle.mothers_as()) -DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Daughters, daughters); //! Daughter tracks (possibly empty) array. Check for non-zero with mcParticle.has_daughters(). Iterate over mcParticle.daughters_as()) +DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Mothers, mothers); //! Mother tracks (possible empty) array. Iterate over mcParticle.mothers_as()) +DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(Daughters, daughters); //! Daughter tracks (possibly empty) array. Check for non-zero with mcParticle.has_daughters(). Iterate over mcParticle.daughters_as()) DECLARE_SOA_DYNAMIC_COLUMN(Pt, pt, [](float px, float py) -> float { return RecoDecay::sqrtSumOfSquares(px, py); }); DECLARE_SOA_DYNAMIC_COLUMN(Eta, eta, [](float px, float py, float pz) -> float { return RecoDecay::eta(std::array{px, py, pz}); }); DECLARE_SOA_DYNAMIC_COLUMN(Phi, phi, [](float px, float py) -> float { return RecoDecay::phi(px, py); }); @@ -638,11 +637,11 @@ DECLARE_SOA_COLUMN(EfficiencyGLMuon, efficiency_gl_muon, float); DECLARE_SOA_COLUMN(DCAGLMuon, dca_gl_muon, float); } // namespace smearedtrack -DECLARE_SOA_TABLE(SmearedElectrons, "AOD", "SMEAREDEL", // usage Join +DECLARE_SOA_TABLE(SmearedElectrons, "AOD", "SMEAREDEL", // usage Join smearedtrack::PtSmeared, smearedtrack::EtaSmeared, smearedtrack::PhiSmeared, smearedtrack::Efficiency, smearedtrack::DCA); using SmearedElectron = SmearedElectrons::iterator; -DECLARE_SOA_TABLE(SmearedMuons, "AOD", "SMEAREDMU", // usage Join +DECLARE_SOA_TABLE(SmearedMuons, "AOD", "SMEAREDMU", // usage Join smearedtrack::PtSmearedSAMuon, smearedtrack::EtaSmearedSAMuon, smearedtrack::PhiSmearedSAMuon, smearedtrack::EfficiencySAMuon, smearedtrack::DCASAMuon, smearedtrack::PtSmearedGLMuon, smearedtrack::EtaSmearedGLMuon, smearedtrack::PhiSmearedGLMuon, smearedtrack::EfficiencyGLMuon, smearedtrack::DCAGLMuon); using SmearedMuon = SmearedMuons::iterator; @@ -849,7 +848,7 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectrons_004, "AOD", "EMPRIMARYEL", 4, //! o2::soa::Index<>, emprimaryelectron::CollisionId, emprimaryelectron::TrackId, emprimaryelectron::Sign, track::Pt, track::Eta, track::Phi, - track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, aod::track::CZZ, + track::DcaXY, track::DcaZ, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, track::TPCChi2NCl, track::TPCInnerParam, track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, @@ -881,7 +880,7 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectrons_005, "AOD", "EMPRIMARYEL", 5, //! o2::soa::Index<>, emprimaryelectron::CollisionId, emprimaryelectron::TrackId, emprimaryelectron::Sign, track::Pt, track::Eta, track::Phi, - track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, aod::track::CZZ, + track::DcaXY, track::DcaZ, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusPID, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, track::TPCChi2NCl, track::TPCInnerParam, track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, @@ -914,7 +913,7 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectrons_006, "AOD", "EMPRIMARYEL", 6, //! o2::soa::Index<>, emprimaryelectron::CollisionId, emprimaryelectron::TrackId, emprimaryelectron::Sign, track::Pt, track::Eta, track::Phi, - track::DcaXY, track::DcaZ, aod::track::CYY, aod::track::CZY, aod::track::CZZ, + track::DcaXY, track::DcaZ, o2::aod::track::CYY, o2::aod::track::CZY, o2::aod::track::CZZ, track::TPCNClsFindable, track::TPCNClsFindableMinusFound, track::TPCNClsFindableMinusPID, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsShared, track::TPCChi2NCl, track::TPCInnerParam, track::TPCSignal, pidtpc::TPCNSigmaEl, pidtpc::TPCNSigmaPi, pidtpc::TPCNSigmaKa, pidtpc::TPCNSigmaPr, @@ -950,40 +949,40 @@ using EMPrimaryElectrons = EMPrimaryElectrons_006; using EMPrimaryElectron = EMPrimaryElectrons::iterator; DECLARE_SOA_TABLE(EMPrimaryElectronsCov_000, "AOD", "EMPRIMARYELCOV", //! - aod::track::CYY, - aod::track::CZY, - aod::track::CZZ, - aod::track::CSnpY, - aod::track::CSnpZ, - aod::track::CSnpSnp, - aod::track::CTglY, - aod::track::CTglZ, - aod::track::CTglSnp, - aod::track::CTglTgl, - aod::track::C1PtY, - aod::track::C1PtZ, - aod::track::C1PtSnp, - aod::track::C1PtTgl, - aod::track::C1Pt21Pt2, o2::soa::Marker<1>); + o2::aod::track::CYY, + o2::aod::track::CZY, + o2::aod::track::CZZ, + o2::aod::track::CSnpY, + o2::aod::track::CSnpZ, + o2::aod::track::CSnpSnp, + o2::aod::track::CTglY, + o2::aod::track::CTglZ, + o2::aod::track::CTglSnp, + o2::aod::track::CTglTgl, + o2::aod::track::C1PtY, + o2::aod::track::C1PtZ, + o2::aod::track::C1PtSnp, + o2::aod::track::C1PtTgl, + o2::aod::track::C1Pt21Pt2, o2::soa::Marker<1>); DECLARE_SOA_TABLE_VERSIONED(EMPrimaryElectronsCov_001, "AOD", "EMPRIMARYELCOV", 1, //! - aod::track::X, - aod::track::Alpha, - aod::track::Y, - aod::track::Z, - aod::track::Snp, - aod::track::CSnpY, - aod::track::CSnpZ, - aod::track::CSnpSnp, - aod::track::CTglY, - aod::track::CTglZ, - aod::track::CTglSnp, - aod::track::CTglTgl, - aod::track::C1PtY, - aod::track::C1PtZ, - aod::track::C1PtSnp, - aod::track::C1PtTgl, - aod::track::C1Pt21Pt2); // CYY, CZY, CZZ, Tgl are in the main electron table. + o2::aod::track::X, + o2::aod::track::Alpha, + o2::aod::track::Y, + o2::aod::track::Z, + o2::aod::track::Snp, + o2::aod::track::CSnpY, + o2::aod::track::CSnpZ, + o2::aod::track::CSnpSnp, + o2::aod::track::CTglY, + o2::aod::track::CTglZ, + o2::aod::track::CTglSnp, + o2::aod::track::CTglTgl, + o2::aod::track::C1PtY, + o2::aod::track::C1PtZ, + o2::aod::track::C1PtSnp, + o2::aod::track::C1PtTgl, + o2::aod::track::C1Pt21Pt2); // CYY, CZY, CZZ, Tgl are in the main electron table. using EMPrimaryElectronsCov = EMPrimaryElectronsCov_001; // iterators @@ -1012,13 +1011,13 @@ using EMPrimaryElectronPrefilterBitDerived = EMPrimaryElectronsPrefilterBitDeriv namespace emprimarymuon { -DECLARE_SOA_INDEX_COLUMN(EMEvent, emevent); //! -DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //! -DECLARE_SOA_COLUMN(FwdTrackId, fwdtrackId, int); //! -DECLARE_SOA_COLUMN(MFTTrackId, mfttrackId, int); //! -DECLARE_SOA_COLUMN(MCHTrackId, mchtrackId, int); //! +DECLARE_SOA_INDEX_COLUMN(EMEvent, emevent); //! +DECLARE_SOA_COLUMN(CollisionId, collisionId, int); //! +DECLARE_SOA_COLUMN(FwdTrackId, fwdtrackId, int); //! +DECLARE_SOA_COLUMN(MFTTrackId, mfttrackId, int); //! +DECLARE_SOA_COLUMN(MCHTrackId, mchtrackId, int); //! DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(GlobalMuonsWithSameMCHMID, globalMuonsWithSameMCHMID); //! self indices to global muons that have the same MCHTrackId -DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(GlobalMuonsWithSameMFT, globalMuonsWithSameMFT); //! self indices to global muons that have the same MFTTrackId +DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(GlobalMuonsWithSameMFT, globalMuonsWithSameMFT); //! self indices to global muons that have the same MFTTrackId DECLARE_SOA_SELF_ARRAY_INDEX_COLUMN(AmbiguousMuons, ambiguousMuons); DECLARE_SOA_COLUMN(CXXatDCA, cXXatDCA, float); //! DCAx resolution squared at DCA DECLARE_SOA_COLUMN(CYYatDCA, cYYatDCA, float); //! DCAy resolution squared at DCA @@ -1113,7 +1112,7 @@ DECLARE_SOA_TABLE_VERSIONED(EMPrimaryMuons_002, "AOD", "EMPRIMARYMU", 2, //! o2::soa::Index<>, emprimarymuon::CollisionId, emprimarymuon::FwdTrackId, emprimarymuon::MFTTrackId, emprimarymuon::MCHTrackId, fwdtrack::TrackType, fwdtrack::Pt, fwdtrack::Eta, fwdtrack::Phi, emprimarymuon::Sign, - fwdtrack::FwdDcaX, fwdtrack::FwdDcaY, aod::fwdtrack::CXX, aod::fwdtrack::CYY, aod::fwdtrack::CXY, + fwdtrack::FwdDcaX, fwdtrack::FwdDcaY, o2::aod::fwdtrack::CXX, o2::aod::fwdtrack::CYY, o2::aod::fwdtrack::CXY, emprimarymuon::PtMatchedMCHMID, emprimarymuon::EtaMatchedMCHMID, emprimarymuon::PhiMatchedMCHMID, // emprimarymuon::EtaMatchedMCHMIDatMP, emprimarymuon::PhiMatchedMCHMIDatMP, // emprimarymuon::EtaMatchedMFTatMP, emprimarymuon::PhiMatchedMFTatMP, @@ -1140,21 +1139,21 @@ using EMPrimaryMuon = EMPrimaryMuons::iterator; DECLARE_SOA_TABLE_VERSIONED(EMPrimaryMuonsCov_002, "AOD", "EMPRIMARYMUCOV", 2, //! fwdtrack::X, fwdtrack::Y, fwdtrack::Z, // at PV. Signed1Pt, Tgl and Phi are in EMPrimaryMuons table. - // aod::fwdtrack::CXX, - // aod::fwdtrack::CXY, - // aod::fwdtrack::CYY, - aod::fwdtrack::CPhiX, - aod::fwdtrack::CPhiY, - aod::fwdtrack::CPhiPhi, - aod::fwdtrack::CTglX, - aod::fwdtrack::CTglY, - aod::fwdtrack::CTglPhi, - aod::fwdtrack::CTglTgl, - aod::fwdtrack::C1PtX, - aod::fwdtrack::C1PtY, - aod::fwdtrack::C1PtPhi, - aod::fwdtrack::C1PtTgl, - aod::fwdtrack::C1Pt21Pt2); + // o2::aod::fwdtrack::CXX, + // o2::aod::fwdtrack::CXY, + // o2::aod::fwdtrack::CYY, + o2::aod::fwdtrack::CPhiX, + o2::aod::fwdtrack::CPhiY, + o2::aod::fwdtrack::CPhiPhi, + o2::aod::fwdtrack::CTglX, + o2::aod::fwdtrack::CTglY, + o2::aod::fwdtrack::CTglPhi, + o2::aod::fwdtrack::CTglTgl, + o2::aod::fwdtrack::C1PtX, + o2::aod::fwdtrack::C1PtY, + o2::aod::fwdtrack::C1PtPhi, + o2::aod::fwdtrack::C1PtTgl, + o2::aod::fwdtrack::C1Pt21Pt2); using EMPrimaryMuonsCov = EMPrimaryMuonsCov_002; // iterators using EMPrimaryMuonCov = EMPrimaryMuonsCov::iterator; diff --git a/PWGEM/Dilepton/DataModel/lmeeMLTables.h b/PWGEM/Dilepton/DataModel/lmeeMLTables.h index ebc5309fe00..6d877783a38 100644 --- a/PWGEM/Dilepton/DataModel/lmeeMLTables.h +++ b/PWGEM/Dilepton/DataModel/lmeeMLTables.h @@ -9,16 +9,14 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#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 "Framework/AnalysisDataModel.h" +#include -#include +#include #ifndef PWGEM_DILEPTON_DATAMODEL_LMEEMLTABLES_H_ #define PWGEM_DILEPTON_DATAMODEL_LMEEMLTABLES_H_ diff --git a/PWGEM/Dilepton/TableProducer/Converters/bcConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/bcConverter1.cxx index 43c3cf43e24..33aed751377 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/bcConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/bcConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx index 4a3af5c4313..86ed8dde8bd 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter2.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx index 87e49f9fb5e..c543037fbd1 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter3.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx index dcca6b5edc1..e9bc1fd78b2 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter4.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx index 60ea4f0db2e..5367e71f597 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter5.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx b/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx index 4f4550cccc9..7506fe10688 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/electronConverter6.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx index 559c871dd1a..ed040916f03 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventCentConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx index 791876beb15..414241dea5c 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter2.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx index 77f3e070980..894d3d2984c 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter3.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx index 848c24a5c69..ff12b6a1405 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter4.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx index 59227518b1a..f4298c119c6 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventConverter5.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx index 0682d607675..c1c8cd61a2a 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventMultConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx index 2965c836239..f51122a77a2 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter1.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include + +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx index c782ef2cd4f..79dc86b136c 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/eventNormConverter2.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include + +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx index 5f219f459ca..92df1709c3d 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/mcParticleConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include #include diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx index 527faf7c723..d0f5596f445 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/muonConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx index aea074131e3..7bc2a63916b 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/muonConverter2.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx index abbbe47695a..031c853b12d 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/muonSelfIdConverter1.cxx @@ -16,9 +16,11 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include + +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx b/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx index 21342c4468b..340b74077c9 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/qvec2Converter0.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx b/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx index cc35b94bec3..2775c7275f7 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/qvec3Converter0.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx b/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx index 7ae8f3d47da..bcdce816813 100644 --- a/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx +++ b/PWGEM/Dilepton/TableProducer/Converters/trackConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx b/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx index 86c8fff432a..2e95f21f5c2 100644 --- a/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/associateMCinfoDilepton.cxx @@ -16,14 +16,21 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/Core/TableHelper.h" +#include "Common/DataModel/EventSelection.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include #include #include #include diff --git a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx index d35815b69f3..f268cdb066f 100644 --- a/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx +++ b/PWGEM/Dilepton/TableProducer/createEMEventDilepton.cxx @@ -28,13 +28,12 @@ #include #include #include +#include #include #include -#include #include -#include #include #include diff --git a/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx b/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx index ed9b5047afc..945ac2853c9 100644 --- a/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx +++ b/PWGEM/Dilepton/TableProducer/dielectronProducer.cxx @@ -15,10 +15,12 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonProducer.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx b/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx index 32cd1bafa72..ed298d39c39 100644 --- a/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx +++ b/PWGEM/Dilepton/TableProducer/dimuonProducer.cxx @@ -15,10 +15,12 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonProducer.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/TableProducer/eventSelection.cxx b/PWGEM/Dilepton/TableProducer/eventSelection.cxx index 89acb23000c..7c857fd6743 100644 --- a/PWGEM/Dilepton/TableProducer/eventSelection.cxx +++ b/PWGEM/Dilepton/TableProducer/eventSelection.cxx @@ -14,13 +14,24 @@ // This code produces event selection table for PWG-EM. // Please write to: daiki.sekihata@cern.ch -#include -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Common/CCDB/RCTSelectionFlags.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +// +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" + +#include +#include +#include +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/filterEoI.cxx b/PWGEM/Dilepton/TableProducer/filterEoI.cxx index 2300cbfb458..31bf18c40a3 100644 --- a/PWGEM/Dilepton/TableProducer/filterEoI.cxx +++ b/PWGEM/Dilepton/TableProducer/filterEoI.cxx @@ -17,15 +17,26 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include "Common/Core/TableHelper.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; +using namespace o2::common::core; struct filterEoI { enum SubSystem { diff --git a/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx b/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx index d965dde3061..aa8ab7bdc85 100644 --- a/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx +++ b/PWGEM/Dilepton/TableProducer/prefilterDimuon.cxx @@ -17,19 +17,38 @@ #include "PWGEM/Dilepton/Core/DimuonCut.h" #include "PWGEM/Dilepton/Core/EMEventCut.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#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 + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx b/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx index 260c6233e79..3c892ed0e1a 100644 --- a/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVector2DummyOTF.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx b/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx index 864c4605462..67f6d5f810c 100644 --- a/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVector3DummyOTF.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx b/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx index 31dc12982d5..bfac1ecf3f3 100644 --- a/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx +++ b/PWGEM/Dilepton/TableProducer/qVectorDummyOTF.cxx @@ -16,9 +16,10 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx index d1836d97ad0..0dcca6318c1 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerOTS.cxx @@ -16,15 +16,23 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/Zorro.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.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 diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx index 34c20624a9f..e9fe1653412 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectron.cxx @@ -19,35 +19,58 @@ #include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" -#include "Common/DataModel/PIDResponseITS.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Tools/ML/MlResponse.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.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 +#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 + using namespace o2; using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; +using namespace o2::common::core; using MyCollisions = soa::Join; using MyCollisionsWithSWT = soa::Join; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx index b50a0df8bab..3815e0bc335 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryElectronQC.cxx @@ -16,28 +16,48 @@ #include "PWGEM/Dilepton/Utils/MlResponseO2Track.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Tools/ML/MlResponse.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.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 +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include +#include +#include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx index ad27348ba7d..1cf936a061f 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMFTTrack.cxx @@ -16,28 +16,42 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - +#include "Common/DataModel/EventSelection.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::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx index a64ae751244..382dc4a90df 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuon.cxx @@ -14,36 +14,47 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.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 "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "Math/Vector4D.h" -#include "TGeoGlobalMagField.h" - -#include +#include "Common/DataModel/EventSelection.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; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx index 3ad5171301c..d5f410eafaa 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryMuonQC.cxx @@ -14,30 +14,39 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.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 "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/SMatrix.h" -#include "Math/Vector4D.h" -#include "TGeoGlobalMagField.h" - -#include +#include "Common/DataModel/EventSelection.h" + +#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 diff --git a/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx b/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx index b7c6b98824f..bc8402d6e7a 100644 --- a/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx +++ b/PWGEM/Dilepton/TableProducer/skimmerPrimaryTrack.cxx @@ -16,28 +16,37 @@ #include "PWGEM/Dilepton/Utils/EMTrackUtilities.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" - +#include "Common/DataModel/EventSelection.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::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx index f0aa4f1e9aa..63d41fe1424 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronML.cxx @@ -18,8 +18,6 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -27,21 +25,33 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.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/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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include + +#include +#include +#include +#include #include #include #include diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx index 622888f29ae..7e04ba0aa5e 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorElectronMLDDA.cxx @@ -17,35 +17,47 @@ #include "PWGEM/Dilepton/DataModel/lmeeMLTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" +#include "Common/Core/CollisionTypeHelper.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/Zorro.h" #include "Common/Core/trackUtilities.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 "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPLHCIFData.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/PID.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 diff --git a/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx b/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx index ed35f705f3a..9ece7b19407 100644 --- a/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx +++ b/PWGEM/Dilepton/TableProducer/treeCreatorMuonML.cxx @@ -16,37 +16,48 @@ #include "PWGEM/Dilepton/DataModel/lmeeMLTables.h" -#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/CollisionTypeHelper.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" -#include "DataFormatsParameters/GRPLHCIFData.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 "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.h" - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include #include #include #include +#include #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/MCtemplates.cxx b/PWGEM/Dilepton/Tasks/MCtemplates.cxx index 3288bd2745e..d44dd156c62 100644 --- a/PWGEM/Dilepton/Tasks/MCtemplates.cxx +++ b/PWGEM/Dilepton/Tasks/MCtemplates.cxx @@ -13,29 +13,39 @@ // // Analysis task to generate Monte Carlo templates of different heavy-flavour dielectron sources // -#include -#include -#include -#include -#include -#include -#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/AnalysisCut.h" #include "PWGDQ/Core/AnalysisCompositeCut.h" -#include "PWGDQ/Core/HistogramsLibrary.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/VarManager.h" +#include "PWGDQ/DataModel/ReducedInfoTables.h" + +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -using std::cout; -using std::endl; +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include + using std::string; using namespace o2; @@ -480,8 +490,8 @@ struct AnalysisSameEventPairing { } fBarrelHistNamesMCmatched.emplace_back(mcSigClasses); } // end loop over cuts - } // end if(cutNames.IsNull()) - } // end if processBarrel + } // end if(cutNames.IsNull()) + } // end if processBarrel // Add histogram classes for each specified MCsignal at the generator level // TODO: create a std::vector of hist classes to be used at Fill time, to avoid using Form in the process function @@ -577,7 +587,7 @@ struct AnalysisSameEventPairing { } } } // end loop over barrel track pairs - } // end runPairing + } // end runPairing template void runMCGenPair(TTracksMC const& groupedMCTracks) @@ -609,7 +619,7 @@ struct AnalysisSameEventPairing { } } } // end of true pairing loop - } // end runMCGen + } // end runMCGen // skimmed PresliceUnsorted perReducedMcEvent = aod::reducedtrackMC::reducedMCeventId; diff --git a/PWGEM/Dilepton/Tasks/associateMCcollision.cxx b/PWGEM/Dilepton/Tasks/associateMCcollision.cxx index eb0e7d3bf5c..9d66de55cd5 100644 --- a/PWGEM/Dilepton/Tasks/associateMCcollision.cxx +++ b/PWGEM/Dilepton/Tasks/associateMCcollision.cxx @@ -14,11 +14,21 @@ // This code produces a table with an index between mc collision and rec. collision. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx index 83777d2dbc1..91ec19cdacd 100644 --- a/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx +++ b/PWGEM/Dilepton/Tasks/checkMCPairTemplate.cxx @@ -24,31 +24,56 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.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 +#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 + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx b/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx index 8d77e81d15f..ad299df81f7 100644 --- a/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx +++ b/PWGEM/Dilepton/Tasks/checkMCTemplate.cxx @@ -15,43 +15,55 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.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/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.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 + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx index 003b1b6bfa4..71d1d91139b 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMap.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMap.cxx @@ -15,36 +15,46 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" -#include "Common/Core/RecoDecay.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.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/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.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 @@ -52,6 +62,8 @@ #include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx b/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx index f0a35f7c814..a608e07d79a 100644 --- a/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx +++ b/PWGEM/Dilepton/Tasks/createResolutionMapDerived.cxx @@ -20,18 +20,29 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "Common/CCDB/RCTSelectionFlags.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 "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#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/PWGEM/Dilepton/Tasks/dielectron.cxx b/PWGEM/Dilepton/Tasks/dielectron.cxx index c8fa31b0e3b..042831bff30 100644 --- a/PWGEM/Dilepton/Tasks/dielectron.cxx +++ b/PWGEM/Dilepton/Tasks/dielectron.cxx @@ -14,11 +14,13 @@ // This code is for dielectron analyses. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/Dilepton.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx b/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx index 42cfa2eac28..8e5d04d67c5 100644 --- a/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx +++ b/PWGEM/Dilepton/Tasks/dielectronHadronMPC.cxx @@ -15,10 +15,12 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonHadronMPC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dielectronMC.cxx b/PWGEM/Dilepton/Tasks/dielectronMC.cxx index 3c525c29c6e..794b8a48a45 100644 --- a/PWGEM/Dilepton/Tasks/dielectronMC.cxx +++ b/PWGEM/Dilepton/Tasks/dielectronMC.cxx @@ -14,11 +14,13 @@ // This code runs loop over dalitz ee table for dalitz QC. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/DileptonMC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx index 3afec6f363a..3595dbf8354 100644 --- a/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx +++ b/PWGEM/Dilepton/Tasks/dileptonPolarization.cxx @@ -19,30 +19,48 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include #include #include -#include +#include +#include #include #include #include #include +#include #include #include #include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/dimuon.cxx b/PWGEM/Dilepton/Tasks/dimuon.cxx index 51b92ab81b7..be0a7d8386b 100644 --- a/PWGEM/Dilepton/Tasks/dimuon.cxx +++ b/PWGEM/Dilepton/Tasks/dimuon.cxx @@ -14,11 +14,13 @@ // This code is for dimuon analyses. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/Dilepton.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx b/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx index 2e0cf5f5e59..c34d4ba1dbb 100644 --- a/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx +++ b/PWGEM/Dilepton/Tasks/dimuonHadronMPC.cxx @@ -15,10 +15,12 @@ // Please write to: daiki.sekihata@cern.ch #include "PWGEM/Dilepton/Core/DileptonHadronMPC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/dimuonMC.cxx b/PWGEM/Dilepton/Tasks/dimuonMC.cxx index f505c073dc3..58e003819ac 100644 --- a/PWGEM/Dilepton/Tasks/dimuonMC.cxx +++ b/PWGEM/Dilepton/Tasks/dimuonMC.cxx @@ -14,11 +14,13 @@ // This code runs loop over dalitz ee table for dalitz QC. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/DileptonMC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx index 907161d9de2..d223c5d2c1c 100644 --- a/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx +++ b/PWGEM/Dilepton/Tasks/emEfficiencyEE.cxx @@ -23,38 +23,42 @@ #include "PWGDQ/DataModel/ReducedInfoTables.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.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 "DataFormatsParameters/GRPObject.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/HistogramRegistry.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/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx b/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx index 5ad4d765e25..6efc22b11c4 100644 --- a/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx +++ b/PWGEM/Dilepton/Tasks/evaluateAcceptance.cxx @@ -16,26 +16,35 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/LHCConstants.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" +#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 + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/eventQC.cxx b/PWGEM/Dilepton/Tasks/eventQC.cxx index c21d08c6248..4d52520d119 100644 --- a/PWGEM/Dilepton/Tasks/eventQC.cxx +++ b/PWGEM/Dilepton/Tasks/eventQC.cxx @@ -14,6 +14,8 @@ // This code is for event QC for PWG-EM. // Please write to: daiki.sekihata@cern.ch +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/Zorro.h" #include "Common/DataModel/Centrality.h" @@ -24,21 +26,35 @@ #include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "TString.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::aod; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx b/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx index 49d6a823d05..8a07ff873da 100644 --- a/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeHFCocktail.cxx @@ -18,14 +18,32 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/MCUtilities.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/Task.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" - -#include "Math/Vector4D.h" - +#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 using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx index 1cac2727e98..56bd936d9f3 100644 --- a/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx +++ b/PWGEM/Dilepton/Tasks/lmeeLFCocktail.cxx @@ -14,17 +14,38 @@ /// \analysis task for lmee light flavour cocktail /// \author Daniel Samitz, , SMI Vienna -#include -#include -#include - -#include "Math/Vector4D.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/PairUtilities.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 + using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/matchingMFT.cxx b/PWGEM/Dilepton/Tasks/matchingMFT.cxx index ca2f912594e..d962d51b94d 100644 --- a/PWGEM/Dilepton/Tasks/matchingMFT.cxx +++ b/PWGEM/Dilepton/Tasks/matchingMFT.cxx @@ -13,8 +13,7 @@ /// \brief a task to study matching MFT-[MCH-MID] in MC /// \author daiki.sekihata@cern.ch -#include "TableHelper.h" - +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -22,27 +21,43 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.h" -#include "Framework/runDataProcessing.h" -#include "GlobalTracking/MatchGlobalFwd.h" -#include "MCHTracking/TrackExtrap.h" -#include "MCHTracking/TrackParam.h" -#include "ReconstructionDataFormats/TrackFwd.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 + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx b/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx index 9ec7f079712..e04151d9c35 100644 --- a/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx +++ b/PWGEM/Dilepton/Tasks/mcParticlePredictionsOTF.cxx @@ -15,9 +15,19 @@ /// \brief Task to build the predictions from the models based on the generated particles /// -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx index c2ac0b75d80..b35ef08c80f 100644 --- a/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx +++ b/PWGEM/Dilepton/Tasks/prefilterDielectron.cxx @@ -19,29 +19,49 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/PairUtilities.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - -#include +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include +#include #include #include #include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; +using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; +using namespace o2::aod::pwgem::dilepton::utils::pairutil; struct prefilterDielectron { using MyCollisions = soa::Join; diff --git a/PWGEM/Dilepton/Tasks/singleElectronQC.cxx b/PWGEM/Dilepton/Tasks/singleElectronQC.cxx index 4a687e82217..e7dd129af66 100644 --- a/PWGEM/Dilepton/Tasks/singleElectronQC.cxx +++ b/PWGEM/Dilepton/Tasks/singleElectronQC.cxx @@ -14,11 +14,13 @@ // Analysis task for single electron QC // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/SingleTrackQC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx b/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx index da2617158ec..a6a5ece732d 100644 --- a/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/singleElectronQCMC.cxx @@ -14,11 +14,13 @@ // Analysis task for single electron QC in MC // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/SingleTrackQCMC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleMuonQC.cxx b/PWGEM/Dilepton/Tasks/singleMuonQC.cxx index b9ccb722ea3..f0ebe6e2f23 100644 --- a/PWGEM/Dilepton/Tasks/singleMuonQC.cxx +++ b/PWGEM/Dilepton/Tasks/singleMuonQC.cxx @@ -14,11 +14,13 @@ // Analysis task for single muon QC // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/SingleTrackQC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx b/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx index 7b7176238c1..55365013453 100644 --- a/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx +++ b/PWGEM/Dilepton/Tasks/singleMuonQCMC.cxx @@ -14,11 +14,13 @@ // Analysis task for single muon QC in MC // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ASoAHelpers.h" - #include "PWGEM/Dilepton/Core/SingleTrackQCMC.h" +#include "PWGEM/Dilepton/Utils/PairUtilities.h" + +#include +#include + +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { diff --git a/PWGEM/Dilepton/Tasks/smearing.cxx b/PWGEM/Dilepton/Tasks/smearing.cxx index 03d0b272f46..3d5a8668244 100644 --- a/PWGEM/Dilepton/Tasks/smearing.cxx +++ b/PWGEM/Dilepton/Tasks/smearing.cxx @@ -16,17 +16,26 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/MomentumSmearer.h" -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/DataTypes.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 +#include #include using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx b/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx index d1d6452a50a..7dc849507e2 100644 --- a/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx +++ b/PWGEM/Dilepton/Tasks/studyDCAFitter.cxx @@ -17,7 +17,6 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" @@ -25,25 +24,35 @@ #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 "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 "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.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/PWGEM/Dilepton/Tasks/studyMCTruth.cxx b/PWGEM/Dilepton/Tasks/studyMCTruth.cxx index 4204a95a9c4..10c634aae02 100644 --- a/PWGEM/Dilepton/Tasks/studyMCTruth.cxx +++ b/PWGEM/Dilepton/Tasks/studyMCTruth.cxx @@ -14,20 +14,35 @@ // This code is to study MC truth. e.g. evet selection bias // Please write to: daiki.sekihata@cern.ch -#include -#include "Math/Vector4D.h" - -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/TableHelper.h" -#include "Common/DataModel/EventSelection.h" #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/Dilepton/Utils/MCUtilities.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/EventSelection.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 + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx index 9787a5bae04..47eab1ebafb 100644 --- a/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx +++ b/PWGEM/Dilepton/Tasks/tableReaderBarrel.cxx @@ -14,7 +14,6 @@ #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" @@ -24,34 +23,34 @@ #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 -using std::cout; -using std::endl; using std::string; using namespace o2; diff --git a/PWGEM/Dilepton/Tasks/taggingHFE.cxx b/PWGEM/Dilepton/Tasks/taggingHFE.cxx index 02bce88073e..ea169455395 100644 --- a/PWGEM/Dilepton/Tasks/taggingHFE.cxx +++ b/PWGEM/Dilepton/Tasks/taggingHFE.cxx @@ -17,7 +17,6 @@ #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/TableHelper.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" @@ -25,29 +24,43 @@ #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 "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 "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.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 #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; diff --git a/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx b/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx index f5f01ae4cfe..e7268360d74 100644 --- a/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx +++ b/PWGEM/Dilepton/Tasks/testBremsstrahlung.cxx @@ -13,45 +13,39 @@ // Analysis task to produce resolution mapfor electrons/muons in dilepton analysis // Please write to: daiki.sekihata@cern.ch -#include "PWGEM/Dilepton/Utils/MCUtilities.h" - -#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/RecoDecay.h" -#include "Common/Core/fwdtrackUtilities.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" -#include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsParameters/GRPMagField.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/HistogramRegistry.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; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::aod; using namespace o2::soa; -using namespace o2::aod::pwgem::dilepton::utils::mcutil; struct testBremsstrahlung { Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; diff --git a/PWGEM/Dilepton/Utils/EMFwdTrack.h b/PWGEM/Dilepton/Utils/EMFwdTrack.h index 510aa5f3533..3b8ec9ec18e 100644 --- a/PWGEM/Dilepton/Utils/EMFwdTrack.h +++ b/PWGEM/Dilepton/Utils/EMFwdTrack.h @@ -15,6 +15,9 @@ #ifndef PWGEM_DILEPTON_UTILS_EMFWDTRACK_H_ #define PWGEM_DILEPTON_UTILS_EMFWDTRACK_H_ +#include +#include + namespace o2::aod::pwgem::dilepton::utils { class EMFwdTrack diff --git a/PWGEM/Dilepton/Utils/EMTrack.h b/PWGEM/Dilepton/Utils/EMTrack.h index 1ac2f442f7e..8efb0c78226 100644 --- a/PWGEM/Dilepton/Utils/EMTrack.h +++ b/PWGEM/Dilepton/Utils/EMTrack.h @@ -15,7 +15,13 @@ #ifndef PWGEM_DILEPTON_UTILS_EMTRACK_H_ #define PWGEM_DILEPTON_UTILS_EMTRACK_H_ -#include "Math/Vector4D.h" +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include + +#include namespace o2::aod::pwgem::dilepton::utils { diff --git a/PWGEM/Dilepton/Utils/EMTrackUtilities.h b/PWGEM/Dilepton/Utils/EMTrackUtilities.h index 47e73e31f96..ba9953f48b1 100644 --- a/PWGEM/Dilepton/Utils/EMTrackUtilities.h +++ b/PWGEM/Dilepton/Utils/EMTrackUtilities.h @@ -15,15 +15,13 @@ #ifndef PWGEM_DILEPTON_UTILS_EMTRACKUTILITIES_H_ #define PWGEM_DILEPTON_UTILS_EMTRACKUTILITIES_H_ -#include "Framework/DataTypes.h" -#include "Framework/Logger.h" +#include #include +#include +#include #include -#include -#include #include -#include //_______________________________________________________________________ namespace o2::aod::pwgem::dilepton::utils::emtrackutil diff --git a/PWGEM/Dilepton/Utils/EventHistograms.h b/PWGEM/Dilepton/Utils/EventHistograms.h index 74dd96bdb84..fc4061610eb 100644 --- a/PWGEM/Dilepton/Utils/EventHistograms.h +++ b/PWGEM/Dilepton/Utils/EventHistograms.h @@ -15,20 +15,28 @@ #ifndef PWGEM_DILEPTON_UTILS_EVENTHISTOGRAMS_H_ #define PWGEM_DILEPTON_UTILS_EVENTHISTOGRAMS_H_ +#include "PWGEM/Dilepton/DataModel/dileptonTables.h" + #include "Common/Core/RecoDecay.h" -#include "Framework/HistogramRegistry.h" +#include +#include + +#include + +#include +#include -using namespace o2::framework; +#include namespace o2::aod::pwgem::dilepton::utils::eventhistogram { const int nbin_ev = 21; template -void addEventHistograms(HistogramRegistry* fRegistry) +void addEventHistograms(o2::framework::HistogramRegistry* fRegistry) { // event info - auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", kTH1D, {{nbin_ev, 0.5, nbin_ev + 0.5}}, false); + auto hCollisionCounter = fRegistry->add("Event/before/hCollisionCounter", "collision counter;;Number of events", o2::framework::kTH1D, {{nbin_ev, 0.5, nbin_ev + 0.5}}, false); hCollisionCounter->GetXaxis()->SetBinLabel(1, "all"); hCollisionCounter->GetXaxis()->SetBinLabel(2, "FT0AND"); hCollisionCounter->GetXaxis()->SetBinLabel(3, "No TF border"); @@ -51,101 +59,120 @@ void addEventHistograms(HistogramRegistry* fRegistry) hCollisionCounter->GetXaxis()->SetBinLabel(20, "Calibrated Q vector"); hCollisionCounter->GetXaxis()->SetBinLabel(21, "accepted"); - fRegistry->add("Event/before/hZvtx", "vertex z; Z_{vtx} (cm)", kTH1D, {{100, -50, +50}}, false); - fRegistry->add("Event/before/hMultNTracksPV", "hMultNTracksPV; N_{track} to PV", kTH1D, {{6001, -0.5, 6000.5}}, false); - fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", kTH2D, {{200, 0, 200000}, {60, 0, 60000}}, false); - fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentNTPV", "hCentNTPV;centrality NTPV (%)", kTH1D, {{110, 0, 110}}, false); - fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", kTH2D, {{110, 0, 110}, {600, 0, 6000}}, false); - fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", kTH2D, {{60, 0, 60000}, {600, 0, 6000}}, false); - fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", kTH2D, {{60, 0, 60000}, {200, 0, 20000}}, false); - fRegistry->add("Event/before/hNTracksPVvsOccupancy", "hNTracksPVvsOccupancy;N_{track} to PV;N_{track} in time range", kTH2D, {{600, 0, 6000}, {200, 0, 20000}}, false); - fRegistry->add("Event/before/hCorrOccupancy", "occupancy correlation;FT0C occupancy;track occupancy", kTH2D, {{200, 0, 200000}, {200, 0, 20000}}, false); + 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::kTH1D, {{6001, -0.5, 6000.5}}, false); + fRegistry->add("Event/before/hMultFT0", "hMultFT0;mult. FT0A;mult. FT0C", o2::framework::kTH2D, {{200, 0, 200000}, {60, 0, 60000}}, false); + fRegistry->add("Event/before/hCentFT0A", "hCentFT0A;centrality FT0A (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0C", "hCentFT0C;centrality FT0C (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0M", "hCentFT0M;centrality FT0M (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentNTPV", "hCentNTPV;centrality NTPV (%)", o2::framework::kTH1D, {{110, 0, 110}}, false); + fRegistry->add("Event/before/hCentFT0CvsMultNTracksPV", "hCentFT0CvsMultNTracksPV;centrality FT0C (%);N_{track} to PV", o2::framework::kTH2D, {{110, 0, 110}, {600, 0, 6000}}, false); + fRegistry->add("Event/before/hMultFT0CvsMultNTracksPV", "hMultFT0CvsMultNTracksPV;mult. FT0C;N_{track} to PV", o2::framework::kTH2D, {{60, 0, 60000}, {600, 0, 6000}}, false); + fRegistry->add("Event/before/hMultFT0CvsOccupancy", "hMultFT0CvsOccupancy;mult. FT0C;N_{track} in time range", o2::framework::kTH2D, {{60, 0, 60000}, {200, 0, 20000}}, false); + fRegistry->add("Event/before/hNTracksPVvsOccupancy", "hNTracksPVvsOccupancy;N_{track} to PV;N_{track} in time range", o2::framework::kTH2D, {{600, 0, 6000}, {200, 0, 20000}}, false); + fRegistry->add("Event/before/hCorrOccupancy", "occupancy correlation;FT0C occupancy;track occupancy", o2::framework::kTH2D, {{200, 0, 200000}, {200, 0, 20000}}, false); if constexpr (nmod == 2) { - fRegistry->add("Event/before/hQ2xFT0M_CentFT0C", "hQ2xFT0M_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0M}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0M_CentFT0C", "hQ2yFT0M_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0M}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFT0A_CentFT0C", "hQ2xFT0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0A_CentFT0C", "hQ2yFT0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFT0C_CentFT0C", "hQ2xFT0C_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0C}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFT0C_CentFT0C", "hQ2yFT0C_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0C}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xFV0A_CentFT0C", "hQ2xFV0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FV0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yFV0A_CentFT0C", "hQ2yFV0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FV0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBPos_CentFT0C", "hQ2xBPos_CentFT0C;centrality FT0C (%);Q_{2,x}^{BPos}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBPos_CentFT0C", "hQ2yBPos_CentFT0C;centrality FT0C (%);Q_{2,y}^{BPos}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBNeg_CentFT0C", "hQ2xBNeg_CentFT0C;centrality FT0C (%);Q_{2,x}^{BNeg}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBNeg_CentFT0C", "hQ2yBNeg_CentFT0C;centrality FT0C (%);Q_{2,y}^{BNeg}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2xBTot_CentFT0C", "hQ2xBTot_CentFT0C;centrality FT0C (%);Q_{2,x}^{BTot}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ2yBTot_CentFT0C", "hQ2yBTot_CentFT0C;centrality FT0C (%);Q_{2,y}^{BTot}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFT0M_CentFT0C", "hQ2xFT0M_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0M_CentFT0C", "hQ2yFT0M_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFT0A_CentFT0C", "hQ2xFT0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0A_CentFT0C", "hQ2yFT0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFT0C_CentFT0C", "hQ2xFT0C_CentFT0C;centrality FT0C (%);Q_{2,x}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFT0C_CentFT0C", "hQ2yFT0C_CentFT0C;centrality FT0C (%);Q_{2,y}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xFV0A_CentFT0C", "hQ2xFV0A_CentFT0C;centrality FT0C (%);Q_{2,x}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yFV0A_CentFT0C", "hQ2yFV0A_CentFT0C;centrality FT0C (%);Q_{2,y}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBPos_CentFT0C", "hQ2xBPos_CentFT0C;centrality FT0C (%);Q_{2,x}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBPos_CentFT0C", "hQ2yBPos_CentFT0C;centrality FT0C (%);Q_{2,y}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBNeg_CentFT0C", "hQ2xBNeg_CentFT0C;centrality FT0C (%);Q_{2,x}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBNeg_CentFT0C", "hQ2yBNeg_CentFT0C;centrality FT0C (%);Q_{2,y}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2xBTot_CentFT0C", "hQ2xBTot_CentFT0C;centrality FT0C (%);Q_{2,x}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ2yBTot_CentFT0C", "hQ2yBTot_CentFT0C;centrality FT0C (%);Q_{2,y}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hEP2FT0M_CentFT0C", "2nd harmonics event plane FT0M;centrality FT0C (%);#Psi_{2}^{FT0M} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FT0A_CentFT0C", "2nd harmonics event plane FT0A;centrality FT0C (%);#Psi_{2}^{FT0A} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FT0C_CentFT0C", "2nd harmonics event plane FT0C;centrality FT0C (%);#Psi_{2}^{FT0C} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2FV0A_CentFT0C", "2nd harmonics event plane FV0A;centrality FT0C (%);#Psi_{2}^{FV0A} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BPos_CentFT0C", "2nd harmonics event plane BPos;centrality FT0C (%);#Psi_{2}^{BPos} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BNeg_CentFT0C", "2nd harmonics event plane BNeg;centrality FT0C (%);#Psi_{2}^{BNeg} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP2BTot_CentFT0C", "2nd harmonics event plane BTot;centrality FT0C (%);#Psi_{2}^{BTot} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FT0M_CentFT0C", "2nd harmonics event plane FT0M;centrality FT0C (%);#Psi_{2}^{FT0M} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FT0A_CentFT0C", "2nd harmonics event plane FT0A;centrality FT0C (%);#Psi_{2}^{FT0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FT0C_CentFT0C", "2nd harmonics event plane FT0C;centrality FT0C (%);#Psi_{2}^{FT0C} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2FV0A_CentFT0C", "2nd harmonics event plane FV0A;centrality FT0C (%);#Psi_{2}^{FV0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BPos_CentFT0C", "2nd harmonics event plane BPos;centrality FT0C (%);#Psi_{2}^{BPos} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BNeg_CentFT0C", "2nd harmonics event plane BNeg;centrality FT0C (%);#Psi_{2}^{BNeg} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP2BTot_CentFT0C", "2nd harmonics event plane BTot;centrality FT0C (%);#Psi_{2}^{BTot} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hPrfQ2FT0MQ2BPos_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0MQ2BNeg_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2BPosQ2BNeg_CentFT0C", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfQ2FT0CQ2BPos_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0CQ2BNeg_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0CQ2BTot_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BPos_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BNeg_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2BTot_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FT0AQ2FT0C_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - fRegistry->add("Event/before/hPrfQ2FV0AQ2BPos_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2BNeg_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2BTot_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ2FV0AQ2FT0C_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ2FT0MQ2BPos_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0MQ2BNeg_CentFT0C", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2BPosQ2BNeg_CentFT0C", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfQ2FT0CQ2BPos_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0CQ2BNeg_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0CQ2BTot_CentFT0C", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BPos_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BNeg_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2BTot_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FT0AQ2FT0C_CentFT0C", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ2FV0AQ2BPos_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2BNeg_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2BTot_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ2FV0AQ2FT0C_CentFT0C", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons } else if constexpr (nmod == 3) { - fRegistry->add("Event/before/hQ3xFT0M_CentFT0C", "hQ3xFT0M_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0M}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0M_CentFT0C", "hQ3yFT0M_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0M}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFT0A_CentFT0C", "hQ3xFT0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0A_CentFT0C", "hQ3yFT0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFT0C_CentFT0C", "hQ3xFT0C_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0C}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFT0C_CentFT0C", "hQ3yFT0C_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0C}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xFV0A_CentFT0C", "hQ3xFV0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FV0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yFV0A_CentFT0C", "hQ3yFV0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FV0A}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBPos_CentFT0C", "hQ3xBPos_CentFT0C;centrality FT0C (%);Q_{3,x}^{BPos}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBPos_CentFT0C", "hQ3yBPos_CentFT0C;centrality FT0C (%);Q_{3,y}^{BPos}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBNeg_CentFT0C", "hQ3xBNeg_CentFT0C;centrality FT0C (%);Q_{3,x}^{BNeg}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBNeg_CentFT0C", "hQ3yBNeg_CentFT0C;centrality FT0C (%);Q_{3,y}^{BNeg}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3xBTot_CentFT0C", "hQ3xBTot_CentFT0C;centrality FT0C (%);Q_{3,x}^{BTot}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hQ3yBTot_CentFT0C", "hQ3yBTot_CentFT0C;centrality FT0C (%);Q_{3,y}^{BTot}", kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFT0M_CentFT0C", "hQ3xFT0M_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0M_CentFT0C", "hQ3yFT0M_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0M}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFT0A_CentFT0C", "hQ3xFT0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0A_CentFT0C", "hQ3yFT0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFT0C_CentFT0C", "hQ3xFT0C_CentFT0C;centrality FT0C (%);Q_{3,x}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFT0C_CentFT0C", "hQ3yFT0C_CentFT0C;centrality FT0C (%);Q_{3,y}^{FT0C}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xFV0A_CentFT0C", "hQ3xFV0A_CentFT0C;centrality FT0C (%);Q_{3,x}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yFV0A_CentFT0C", "hQ3yFV0A_CentFT0C;centrality FT0C (%);Q_{3,y}^{FV0A}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBPos_CentFT0C", "hQ3xBPos_CentFT0C;centrality FT0C (%);Q_{3,x}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBPos_CentFT0C", "hQ3yBPos_CentFT0C;centrality FT0C (%);Q_{3,y}^{BPos}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBNeg_CentFT0C", "hQ3xBNeg_CentFT0C;centrality FT0C (%);Q_{3,x}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBNeg_CentFT0C", "hQ3yBNeg_CentFT0C;centrality FT0C (%);Q_{3,y}^{BNeg}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3xBTot_CentFT0C", "hQ3xBTot_CentFT0C;centrality FT0C (%);Q_{3,x}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); + fRegistry->add("Event/before/hQ3yBTot_CentFT0C", "hQ3yBTot_CentFT0C;centrality FT0C (%);Q_{3,y}^{BTot}", o2::framework::kTH2D, {{100, 0, 100}, {200, -10, +10}}, false); - fRegistry->add("Event/before/hEP3FT0M_CentFT0C", "3rd harmonics event plane FT0M;centrality FT0C (%);#Psi_{3}^{FT0M} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FT0A_CentFT0C", "3rd harmonics event plane FT0A;centrality FT0C (%);#Psi_{3}^{FT0A} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FT0C_CentFT0C", "3rd harmonics event plane FT0C;centrality FT0C (%);#Psi_{3}^{FT0C} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3FV0A_CentFT0C", "3rd harmonics event plane FV0A;centrality FT0C (%);#Psi_{3}^{FV0A} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BPos_CentFT0C", "3rd harmonics event plane BPos;centrality FT0C (%);#Psi_{3}^{BPos} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BNeg_CentFT0C", "3rd harmonics event plane BNeg;centrality FT0C (%);#Psi_{3}^{BNeg} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hEP3BTot_CentFT0C", "3rd harmonics event plane BTot;centrality FT0C (%);#Psi_{3}^{BTot} (rad.)", kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FT0M_CentFT0C", "3rd harmonics event plane FT0M;centrality FT0C (%);#Psi_{3}^{FT0M} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FT0A_CentFT0C", "3rd harmonics event plane FT0A;centrality FT0C (%);#Psi_{3}^{FT0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FT0C_CentFT0C", "3rd harmonics event plane FT0C;centrality FT0C (%);#Psi_{3}^{FT0C} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3FV0A_CentFT0C", "3rd harmonics event plane FV0A;centrality FT0C (%);#Psi_{3}^{FV0A} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BPos_CentFT0C", "3rd harmonics event plane BPos;centrality FT0C (%);#Psi_{3}^{BPos} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BNeg_CentFT0C", "3rd harmonics event plane BNeg;centrality FT0C (%);#Psi_{3}^{BNeg} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); + fRegistry->add("Event/before/hEP3BTot_CentFT0C", "3rd harmonics event plane BTot;centrality FT0C (%);#Psi_{3}^{BTot} (rad.)", o2::framework::kTH2D, {{100, 0, 100}, {36, -M_PI_2, +M_PI_2}}, false); - fRegistry->add("Event/before/hPrfQ3FT0MQ3BPos_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0MQ3BNeg_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3BPosQ3BNeg_CentFT0C", "Q_{3}^{BPos} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{BPos} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. - fRegistry->add("Event/before/hPrfQ3FT0CQ3BPos_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0CQ3BNeg_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0CQ3BTot_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BPos_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BNeg_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3BTot_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FT0AQ3FT0C_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons - fRegistry->add("Event/before/hPrfQ3FV0AQ3BPos_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BPos}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3BNeg_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BNeg}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3BTot_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BTot}", kTProfile, {{100, 0, 100}}, false); - fRegistry->add("Event/before/hPrfQ3FV0AQ3FT0C_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{FT0C}", kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ3FT0MQ3BPos_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0MQ3BNeg_CentFT0C", "Q_{3}^{FT0M} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0M} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3BPosQ3BNeg_CentFT0C", "Q_{3}^{BPos} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{BPos} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is common for FT0M, FT0A, FT0C, FV0A resolution. + fRegistry->add("Event/before/hPrfQ3FT0CQ3BPos_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0CQ3BNeg_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0CQ3BTot_CentFT0C", "Q_{3}^{FT0C} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0C} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BPos_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BNeg_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3BTot_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FT0AQ3FT0C_CentFT0C", "Q_{3}^{FT0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FT0A} #upoint Q_{3}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons + fRegistry->add("Event/before/hPrfQ3FV0AQ3BPos_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BPos};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BPos}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3BNeg_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BNeg};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BNeg}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3BTot_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{BTot};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{BTot}", o2::framework::kTProfile, {{100, 0, 100}}, false); + fRegistry->add("Event/before/hPrfQ3FV0AQ3FT0C_CentFT0C", "Q_{3}^{FV0A} #upoint Q_{3}^{FT0C};centrality FT0C (%);Q_{3}^{FV0A} #upoint Q_{3}^{FT0C}", o2::framework::kTProfile, {{100, 0, 100}}, false); // this is necessary for dimuons } fRegistry->addClone("Event/before/", "Event/after/"); } +void addEventHistogramsBootstrap(o2::framework::HistogramRegistry* fRegistry, int nsamples = 1) +{ + fRegistry->add("Event/bootstrap/hPoissonWeights", "Poisson Weights per sample;sample;weight", o2::framework::kTH2D, {{nsamples, 0.5, nsamples + 0.5}, {210, -1, 20}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0MQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0M} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0M} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0MQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0M} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0M} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2BPosQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{BPos} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{BPos} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0CQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FT0C} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0C} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FT0AQ2FT0C_CentFT0C_bootstrap", "Q_{2}^{FT0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);bootstrap sample;Q_{2}^{FT0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BPos_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BPos};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BPos}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BNeg_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BNeg};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BNeg}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2BTot_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{BTot};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{BTot}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); + fRegistry->add("Event/bootstrap/hPrfQ2FV0AQ2FT0C_CentFT0C_bootstrap", "Q_{2}^{FV0A} #upoint Q_{2}^{FT0C};centrality FT0C (%);bootstrap sample;Q_{2}^{FV0A} #upoint Q_{2}^{FT0C}", o2::framework::kTProfile2D, {{100, 0, 100}, {nsamples, 0.5, nsamples + 0.5}}, false); +} + template -void fillEventInfo(HistogramRegistry* fRegistry, TCollision const& collision, const float /*weight*/ = 1.f) +void fillEventInfo(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, const float /*weight*/ = 1.f) { static constexpr std::string_view event_types[2] = {"before/", "after/"}; fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 1.0); @@ -176,7 +203,7 @@ void fillEventInfo(HistogramRegistry* fRegistry, TCollision const& collision, co if (collision.sel8()) { fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 10.0); } - if (abs(collision.posZ()) < 10.0) { + if (std::abs(collision.posZ()) < 10.0) { fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hCollisionCounter"), 11.0); } if (collision.selection_bit(o2::aod::emevsel::kNoCollInTimeRangeStandard)) { @@ -311,5 +338,32 @@ void fillEventInfo(HistogramRegistry* fRegistry, TCollision const& collision, co fRegistry->fill(HIST("Event/") + HIST(event_types[ev_id]) + HIST("hPrfQ3FV0AQ3BTot_CentFT0C"), collision.centFT0C(), RecoDecay::dotProd(q3fv0a, q3btot)); } } +template +void fillEventInfoBootstrap(o2::framework::HistogramRegistry* fRegistry, TCollision const& collision, const int sample, const float weight) +{ + std::array q2ft0m = {collision.q2xft0m(), collision.q2yft0m()}; + std::array q2ft0a = {collision.q2xft0a(), collision.q2yft0a()}; + std::array q2ft0c = {collision.q2xft0c(), collision.q2yft0c()}; + std::array q2fv0a = {collision.q2xfv0a(), collision.q2yfv0a()}; + std::array q2bpos = {collision.q2xbpos(), collision.q2ybpos()}; + std::array q2bneg = {collision.q2xbneg(), collision.q2ybneg()}; + std::array q2btot = {collision.q2xbtot(), collision.q2ybtot()}; + + fRegistry->fill(HIST("Event/bootstrap/hPoissonWeights"), sample + 0.5, weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0MQ2BPos_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0m, q2bpos), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0MQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0m, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2BPosQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2bpos, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0CQ2BPos_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0c, q2bpos), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0CQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0c, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0CQ2BTot_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0c, q2btot), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0AQ2BPos_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0a, q2bpos), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0AQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0a, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0AQ2BTot_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0a, q2btot), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FT0AQ2FT0C_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2ft0a, q2ft0c), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FV0AQ2BPos_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2fv0a, q2bpos), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FV0AQ2BNeg_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2fv0a, q2bneg), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FV0AQ2BTot_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2fv0a, q2btot), weight); + fRegistry->fill(HIST("Event/bootstrap/hPrfQ2FV0AQ2FT0C_CentFT0C_bootstrap"), collision.centFT0C(), sample + 0.5, RecoDecay::dotProd(q2fv0a, q2ft0c), weight); +} } // namespace o2::aod::pwgem::dilepton::utils::eventhistogram #endif // PWGEM_DILEPTON_UTILS_EVENTHISTOGRAMS_H_ diff --git a/PWGEM/Dilepton/Utils/EventMixingHandler.h b/PWGEM/Dilepton/Utils/EventMixingHandler.h index 20b38399979..4698654be49 100644 --- a/PWGEM/Dilepton/Utils/EventMixingHandler.h +++ b/PWGEM/Dilepton/Utils/EventMixingHandler.h @@ -16,7 +16,6 @@ #define PWGEM_DILEPTON_UTILS_EVENTMIXINGHANDLER_H_ #include -#include #include namespace o2::aod::pwgem::dilepton::utils diff --git a/PWGEM/Dilepton/Utils/MCUtilities.h b/PWGEM/Dilepton/Utils/MCUtilities.h index f8937f7d1a2..d0a9a69df0e 100644 --- a/PWGEM/Dilepton/Utils/MCUtilities.h +++ b/PWGEM/Dilepton/Utils/MCUtilities.h @@ -15,10 +15,9 @@ #ifndef PWGEM_DILEPTON_UTILS_MCUTILITIES_H_ #define PWGEM_DILEPTON_UTILS_MCUTILITIES_H_ -#include "Framework/AnalysisDataModel.h" -#include "Framework/Logger.h" +#include +#include -#include #include #include #include diff --git a/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h b/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h index 5ec9756b5a9..e16ddd1b9c3 100644 --- a/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h +++ b/PWGEM/Dilepton/Utils/MlResponseDielectronSingleTrack.h @@ -19,7 +19,9 @@ #include "Tools/ML/MlResponse.h" -#include +#include + +#include #include #include diff --git a/PWGEM/Dilepton/Utils/MlResponseO2Track.h b/PWGEM/Dilepton/Utils/MlResponseO2Track.h index e526eb9a3db..0b1bdbbe2be 100644 --- a/PWGEM/Dilepton/Utils/MlResponseO2Track.h +++ b/PWGEM/Dilepton/Utils/MlResponseO2Track.h @@ -18,7 +18,9 @@ #include "Tools/ML/MlResponse.h" -#include +#include + +#include #include #include diff --git a/PWGEM/Dilepton/Utils/MomentumSmearer.h b/PWGEM/Dilepton/Utils/MomentumSmearer.h index d0e73ee971f..59bb41f948c 100644 --- a/PWGEM/Dilepton/Utils/MomentumSmearer.h +++ b/PWGEM/Dilepton/Utils/MomentumSmearer.h @@ -15,12 +15,12 @@ #ifndef PWGEM_DILEPTON_UTILS_MOMENTUMSMEARER_H_ #define PWGEM_DILEPTON_UTILS_MOMENTUMSMEARER_H_ -#include "CCDB/BasicCCDBManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include +#include #include #include #include @@ -28,15 +28,12 @@ #include #include #include +#include #include +#include #include -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; - class MomentumSmearer { public: @@ -576,7 +573,7 @@ class MomentumSmearer void setCcdbPathRes(TString ccdbPathRes) { fCcdbPathRes = ccdbPathRes; } void setCcdbPathEff(TString ccdbPathEff) { fCcdbPathEff = ccdbPathEff; } void setCcdbPathDCA(TString ccdbPathDCA) { fCcdbPathDCA = ccdbPathDCA; } - void setCcdb(Service ccdb) + void setCcdb(o2::framework::Service ccdb) { fCcdb = ccdb; fFromCcdb = true; @@ -645,7 +642,7 @@ class MomentumSmearer std::vector fVecDCA; int64_t fTimestamp; bool fFromCcdb = false; - Service fCcdb; + o2::framework::Service fCcdb; float fMinPtGen = -1.f; }; diff --git a/PWGEM/Dilepton/Utils/PairUtilities.h b/PWGEM/Dilepton/Utils/PairUtilities.h index 0758289bbee..693045306eb 100644 --- a/PWGEM/Dilepton/Utils/PairUtilities.h +++ b/PWGEM/Dilepton/Utils/PairUtilities.h @@ -18,14 +18,20 @@ #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" -#include "ReconstructionDataFormats/TrackFwd.h" +#include -#include "Math/GenVector/Boost.h" -#include "Math/SMatrix.h" -#include "Math/Vector3D.h" -#include "Math/Vector4D.h" +#include +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h) +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include +#include +#include #include //_______________________________________________________________________ @@ -43,6 +49,7 @@ enum class DileptonAnalysisType : int { kFlowV3 = 3, kPolarization = 4, kHFll = 5, + kBootstrapv2 = 6, }; enum class DileptonHadronAnalysisType : int { diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx index aaf16551ba6..6aae90e5d3c 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.cxx +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.cxx @@ -22,9 +22,9 @@ #include "PWGEM/PhotonMeson/Core/PairCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" -#include +#include -#include +#include #include #include diff --git a/PWGEM/PhotonMeson/Core/CutsLibrary.h b/PWGEM/PhotonMeson/Core/CutsLibrary.h index bf4fcfe7037..5647908dd1a 100644 --- a/PWGEM/PhotonMeson/Core/CutsLibrary.h +++ b/PWGEM/PhotonMeson/Core/CutsLibrary.h @@ -15,13 +15,12 @@ #ifndef PWGEM_PHOTONMESON_CORE_CUTSLIBRARY_H_ #define PWGEM_PHOTONMESON_CORE_CUTSLIBRARY_H_ -#include -#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" -#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" -#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/PairCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" namespace o2::aod { diff --git a/PWGEM/PhotonMeson/Core/DalitzEECut.cxx b/PWGEM/PhotonMeson/Core/DalitzEECut.cxx index f129a1ba289..c0709362278 100644 --- a/PWGEM/PhotonMeson/Core/DalitzEECut.cxx +++ b/PWGEM/PhotonMeson/Core/DalitzEECut.cxx @@ -15,7 +15,7 @@ #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" -#include "Framework/Logger.h" +#include #include diff --git a/PWGEM/PhotonMeson/Core/DalitzEECut.h b/PWGEM/PhotonMeson/Core/DalitzEECut.h index 9eb6b1a0801..293a52424c0 100644 --- a/PWGEM/PhotonMeson/Core/DalitzEECut.h +++ b/PWGEM/PhotonMeson/Core/DalitzEECut.h @@ -22,7 +22,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include @@ -34,8 +34,6 @@ #include #include -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; - class DalitzEECut : public TNamed { public: @@ -256,7 +254,7 @@ class DalitzEECut : public TNamed return mMinChi2PerClusterTPC < track.tpcChi2NCl() && track.tpcChi2NCl() < mMaxChi2PerClusterTPC; case DalitzEECuts::kDCA3Dsigma: - return mMinDca3D < dca3DinSigma(track) && dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg + return mMinDca3D < o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) && o2::aod::pwgem::dilepton::utils::emtrackutil::dca3DinSigma(track) < mMaxDca3D; // in sigma for single leg case DalitzEECuts::kDCAxy: return std::fabs(track.dcaXY()) < ((mMaxDcaXYPtDep) ? mMaxDcaXYPtDep(track.pt()) : mMaxDcaXY); diff --git a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h index 3f10f83d55f..3c262fcb540 100644 --- a/PWGEM/PhotonMeson/Core/EMCPhotonCut.h +++ b/PWGEM/PhotonMeson/Core/EMCPhotonCut.h @@ -19,17 +19,24 @@ #include "PWGEM/PhotonMeson/Core/EMBitFlags.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include #include #include +#include +#include #include +#include + #include #include #include #include +#include #include +#include #include template @@ -280,7 +287,7 @@ class EMCPhotonCut : public TNamed /// \param cluster cluster table to check /// \param matchedTracks matched primary tracks table /// \param matchedSecondaries matched secondary tracks table - /// \param fRegistry HistogramRegistry pointer of the main task + /// \param fRegistry o2::framework::HistogramRegistry pointer of the main task void AreSelectedRunning(EMBitFlags& flags, o2::soa::is_table auto const& clusters, IsTrackContainer auto const& emcmatchedtracks, IsTrackContainer auto const& secondaries, o2::framework::HistogramRegistry* fRegistry = nullptr) const { if (clusters.size() <= 0) { diff --git a/PWGEM/PhotonMeson/Core/EMNonLin.h b/PWGEM/PhotonMeson/Core/EMNonLin.h index d272d9e5593..b6fa2594310 100644 --- a/PWGEM/PhotonMeson/Core/EMNonLin.h +++ b/PWGEM/PhotonMeson/Core/EMNonLin.h @@ -16,9 +16,8 @@ #ifndef PWGEM_PHOTONMESON_CORE_EMNONLIN_H_ #define PWGEM_PHOTONMESON_CORE_EMNONLIN_H_ -#include - -#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) +#include #include #include diff --git a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx index 253020c7d69..316b01d9563 100644 --- a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx +++ b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.cxx @@ -13,9 +13,12 @@ // Class for em photon event selection // -#include "Framework/Logger.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include + +#include + ClassImp(EMPhotonEventCut); void EMPhotonEventCut::SetRequireSel8(bool flag) diff --git a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h index 1121a6fd922..5b14aa8d2ef 100644 --- a/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h +++ b/PWGEM/PhotonMeson/Core/EMPhotonEventCut.h @@ -19,9 +19,9 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" -#include "TNamed.h" +#include -using namespace std; +#include class EMPhotonEventCut : public TNamed { diff --git a/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h b/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h index b46e258353c..72e3b364a46 100644 --- a/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h +++ b/PWGEM/PhotonMeson/Core/EmMlResponsePCM.h @@ -20,6 +20,7 @@ #include "Tools/ML/MlResponse.h" +#include #include #include diff --git a/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h b/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h index 094f86ceb8a..0b9cb24bbf5 100644 --- a/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h +++ b/PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h @@ -18,14 +18,15 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include -#include +#include #include -#include +#include #include #include #include +#include + #include #include diff --git a/PWGEM/PhotonMeson/Core/PairCut.cxx b/PWGEM/PhotonMeson/Core/PairCut.cxx index be8bee172c7..3ea3e06acec 100644 --- a/PWGEM/PhotonMeson/Core/PairCut.cxx +++ b/PWGEM/PhotonMeson/Core/PairCut.cxx @@ -13,9 +13,12 @@ // Class for track selection // -#include "Framework/Logger.h" #include "PWGEM/PhotonMeson/Core/PairCut.h" +#include + +#include + ClassImp(PairCut); const char* PairCut::mCutNames[static_cast(PairCut::PairCuts::kNCuts)] = {"Asym"}; diff --git a/PWGEM/PhotonMeson/Core/PairCut.h b/PWGEM/PhotonMeson/Core/PairCut.h index 19ba27c79bf..c514d8946c8 100644 --- a/PWGEM/PhotonMeson/Core/PairCut.h +++ b/PWGEM/PhotonMeson/Core/PairCut.h @@ -16,15 +16,9 @@ #ifndef PWGEM_PHOTONMESON_CORE_PAIRCUT_H_ #define PWGEM_PHOTONMESON_CORE_PAIRCUT_H_ -#include -#include -#include -#include -#include "Framework/Logger.h" -#include "Framework/DataTypes.h" #include "Rtypes.h" -#include "TNamed.h" -#include "TMath.h" + +#include class PairCut : public TNamed { diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h index 1eb74391520..c89fc48990f 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGamma.h @@ -20,6 +20,7 @@ #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -46,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -56,7 +56,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h index 442cf9d13b6..ee823b4f4b0 100644 --- a/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h +++ b/PWGEM/PhotonMeson/Core/Pi0EtaToGammaGammaMC.h @@ -20,6 +20,7 @@ #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -43,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -51,7 +51,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include @@ -939,7 +939,7 @@ struct Pi0EtaToGammaGammaMC { o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; o2::framework::expressions::Filter collisionFilter_centrality = (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); - // using FilteredMyCollisions = o2::soa::Filtered>; + // using FilteredMyCollisions = o2::soa::Filtered>; o2::framework::expressions::Filter prefilter_pcm = ifnode(pcmcuts.cfg_apply_cuts_from_prefilter_derived.node(), o2::aod::v0photonkf::pfbderived == static_cast(0), true); o2::framework::expressions::Filter prefilter_primaryelectron = ifnode(dileptoncuts.cfg_apply_cuts_from_prefilter_derived.node(), o2::aod::emprimaryelectron::pfbderived == static_cast(0), true); @@ -979,7 +979,7 @@ struct Pi0EtaToGammaGammaMC { } PROCESS_SWITCH(Pi0EtaToGammaGammaMC, processAnalysis, "process pair analysis", true); - // using FilteredMyCollisionsWithJJMC = o2::soa::Filtered, aod::EMEventsWeight>>; + // using FilteredMyCollisionsWithJJMC = o2::soa::Filtered, o2::aod::EMEventsWeight>>; void processAnalysisJJMC(o2::soa::Filtered, o2::aod::EMEventsWeight>> const& collisions, o2::soa::Join const& mccollisions, o2::aod::EMMCParticles const& mcparticles, Types const&... args) { if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPCM) { diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0.h b/PWGEM/PhotonMeson/Core/TaggingPi0.h index 71d7fb9f48b..ee4f8fc8083 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0.h @@ -21,7 +21,6 @@ #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" -// #include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -49,7 +48,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include @@ -64,163 +63,155 @@ #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::photonmeson::photonpair; -using namespace o2::aod::pwgem::photon; -using namespace o2::aod::pwgem::dilepton::utils::emtrackutil; -using namespace o2::aod::pwgem::dilepton::utils; - -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyCollisionsWithJJMC = soa::Join; +using MyCollisionsWithJJMC = o2::soa::Join; using MyCollisionWithJJMC = MyCollisionsWithJJMC::iterator; -using MyV0Photons = soa::Join; +using MyV0Photons = o2::soa::Join; using MyV0Photon = MyV0Photons::iterator; -using MyPrimaryElectrons = soa::Join; +using MyPrimaryElectrons = o2::soa::Join; using MyPrimaryElectron = MyPrimaryElectrons::iterator; -using MyEMCClusters = soa::Join; +using MyEMCClusters = o2::soa::Join; using MyEMCCluster = MyEMCClusters::iterator; -// using MyPHOSClusters = soa::Join; +// using MyPHOSClusters = o2::soa::Join; // using MyPHOSCluster = MyPHOSClusters::iterator; -template +template struct TaggingPi0 { - Configurable ccdburl{"ccdb-url", "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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; - - Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; - Configurable cfgCentMin{"cfgCentMin", 0, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; - Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; - Configurable ndepth{"ndepth", 100, "depth for event mixing"}; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"}; - ConfigurableAxis ConfEPBins{"ConfEPBins", {VARIABLE_WIDTH, -o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0.0f, +o2::constants::math::PIQuarter, +o2::constants::math::PIHalf}, "Mixing bins - event plane angle"}; - ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; - ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + o2::framework::Configurable ndiff_bc_mix{"ndiff_bc_mix", 594, "difference in global BC required in mixed events"}; + + o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + o2::framework::Configurable cfgCentMin{"cfgCentMin", 0, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + o2::framework::Configurable cfgDoMix{"cfgDoMix", true, "flag for event mixing"}; + o2::framework::Configurable ndepth{"ndepth", 100, "depth for event mixing"}; + o2::framework::ConfigurableAxis ConfVtxBins{"ConfVtxBins", {o2::framework::VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + o2::framework::ConfigurableAxis ConfCentBins{"ConfCentBins", {o2::framework::VARIABLE_WIDTH, 0.0f, 5.0f, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 60.0f, 70.0f, 80.0f, 90.0f, 100.f, 999.f}, "Mixing bins - centrality"}; + o2::framework::ConfigurableAxis ConfEPBins{"ConfEPBins", {o2::framework::VARIABLE_WIDTH, -o2::constants::math::PIHalf, -o2::constants::math::PIQuarter, 0.0f, +o2::constants::math::PIQuarter, +o2::constants::math::PIHalf}, "Mixing bins - event plane angle"}; + o2::framework::ConfigurableAxis ConfOccupancyBins{"ConfOccupancyBins", {o2::framework::VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + o2::framework::ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; + + using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, o2::aod::pwgem::dilepton::utils::EMTrack>; EMPhotonEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgRequireEMCReadoutInMB{"cfgRequireEMCReadoutInMB", false, "require the EMC to be read out in an MB collision (kTVXinEMC)"}; - Configurable cfgRequireEMCHardwareTriggered{"cfgRequireEMCHardwareTriggered", false, "require the EMC to be hardware triggered (kEMC7 or kDMC7)"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgRequireEMCReadoutInMB{"cfgRequireEMCReadoutInMB", false, "require the EMC to be read out in an MB collision (kTVXinEMC)"}; + o2::framework::Configurable cfgRequireEMCHardwareTriggered{"cfgRequireEMCHardwareTriggered", false, "require the EMC to be hardware triggered (kEMC7 or kDMC7)"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; } eventcuts; V0PhotonCut fV0PhotonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "pcmcut_group"; - Configurable cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"}; - Configurable cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"}; - Configurable cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"}; - Configurable cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"}; - Configurable cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"}; - Configurable cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"}; - Configurable cfg_max_eta_v0{"cfg_max_eta_v0", 0.8, "max eta for v0 photons at PV"}; - Configurable cfg_min_v0radius{"cfg_min_v0radius", 4.0, "min v0 radius"}; - Configurable cfg_max_v0radius{"cfg_max_v0radius", 90.0, "max v0 radius"}; - Configurable cfg_max_alpha_ap{"cfg_max_alpha_ap", 0.95, "max alpha for AP cut"}; - Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; - Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; - Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; - Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; - Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; - - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 10, "min ncluster tpc"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 40, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -3.0, "min. TPC n sigma for electron"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron"}; - Configurable cfg_disable_itsonly_track{"cfg_disable_itsonly_track", false, "flag to disable ITSonly tracks"}; - Configurable cfg_disable_tpconly_track{"cfg_disable_tpconly_track", false, "flag to disable TPConly tracks"}; + o2::framework::Configurable cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"}; + o2::framework::Configurable cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"}; + o2::framework::Configurable cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"}; + o2::framework::Configurable cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"}; + o2::framework::Configurable cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"}; + o2::framework::Configurable cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"}; + o2::framework::Configurable cfg_max_eta_v0{"cfg_max_eta_v0", 0.8, "max eta for v0 photons at PV"}; + o2::framework::Configurable cfg_min_v0radius{"cfg_min_v0radius", 4.0, "min v0 radius"}; + o2::framework::Configurable cfg_max_v0radius{"cfg_max_v0radius", 90.0, "max v0 radius"}; + o2::framework::Configurable cfg_max_alpha_ap{"cfg_max_alpha_ap", 0.95, "max alpha for AP cut"}; + o2::framework::Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; + o2::framework::Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; + o2::framework::Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + o2::framework::Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; + o2::framework::Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; + + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 10, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 40, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -3.0, "min. TPC n sigma for electron"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron"}; + o2::framework::Configurable cfg_disable_itsonly_track{"cfg_disable_itsonly_track", false, "flag to disable ITSonly tracks"}; + o2::framework::Configurable cfg_disable_tpconly_track{"cfg_disable_tpconly_track", false, "flag to disable TPConly tracks"}; } pcmcuts; DalitzEECut fDileptonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dileptoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 0.1, "max mass"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", 0.8, "max eta for single track"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 70, "min ncrossed rows"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.05, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.05, "max dca Z for single track in cm"}; - Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1.5, "max DCA 3D in sigma"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DalitzEECut::PIDSchemes::kTOFif), "pid scheme [kTOFif : 0, kTPConly : 1]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 0.1, "max mass"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", 0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 70, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.05, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.05, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1.5, "max DCA 3D in sigma"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DalitzEECut::PIDSchemes::kTOFif), "pid scheme [kTOFif : 0, kTPConly : 1]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; } dileptoncuts; EMCPhotonCut fEMCCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "emccut_group"; - Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; - Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; - Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; - Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; - Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; - Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; - Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; - Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; - Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; - Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; - Configurable cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; + o2::framework::Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; + o2::framework::Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; + o2::framework::Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; + o2::framework::Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; + o2::framework::Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; + o2::framework::Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; + o2::framework::Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; + o2::framework::Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; + o2::framework::Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + o2::framework::Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + o2::framework::Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; + o2::framework::Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; + o2::framework::Configurable cfgDistanceToEdge{"cfgDistanceToEdge", 1, "Distance to edge in cells required for rotated cluster to be accepted"}; } emccuts; // PHOSPhotonCut fPHOSCut; - // struct : ConfigurableGroup { + // struct : o2::framework::ConfigurableGroup { // std::string prefix = "phoscut_group"; - // Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; + // o2::framework::Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; // } phoscuts; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; @@ -230,11 +221,11 @@ struct TaggingPi0 { std::vector occ_bin_edges; o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; - void init(InitContext&) + void init(o2::framework::InitContext&) { zvtx_bin_edges = std::vector(ConfVtxBins.value.begin(), ConfVtxBins.value.end()); zvtx_bin_edges.erase(zvtx_bin_edges.begin()); @@ -326,20 +317,20 @@ struct TaggingPi0 { void addHistogrms() { TString mggTitle = "ee#gamma"; - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { mggTitle = "ee#gamma"; } else { mggTitle = "#gamma#gamma"; } - const AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; - const AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; + const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; + const o2::framework::AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; - fRegistry.add("Photon/hPt", "p_{T,#gamma};p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); - fRegistry.add("Photon/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); - fRegistry.add("Pair/same/hMvsPt", "mass vs. p_{T,#gamma}", kTH2D, {axis_m, axis_pt}, true); + fRegistry.add("Photon/hPt", "p_{T,#gamma};p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); + fRegistry.add("Photon/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); + fRegistry.add("Pair/same/hMvsPt", "mass vs. p_{T,#gamma}", o2::framework::kTH2D, {axis_m, axis_pt}, true); fRegistry.addClone("Pair/same/", "Pair/mix/"); - fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", kTH1D, {{10001, -0.5, 10000.5}}, true); + fRegistry.add("Pair/mix/hDiffBC", "diff. global BC in mixed event;|BC_{current} - BC_{mixed}|", o2::framework::kTH1D, {{10001, -0.5, 10000.5}}, true); } void DefineEMEventCut() @@ -442,16 +433,15 @@ struct TaggingPi0 { // fPHOSCut.SetEnergyRange(phoscuts.cfg_min_Ecluster, 1e+10); // } - SliceCache cache; - Preslice perCollision_pcm = aod::v0photonkf::pmeventId; - Preslice perCollision_emc = aod::emccluster::pmeventId; - // Preslice perCollision_phos = aod::phoscluster::pmeventId; + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_pcm = o2::aod::v0photonkf::pmeventId; + o2::framework::Preslice perCollision_emc = o2::aod::emccluster::pmeventId; + // o2::framework::Preslice perCollision_phos = o2::aod::phoscluster::pmeventId; - Preslice perCollision_electron = aod::emprimaryelectronda::pmeventId; - Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); - Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectronda::pmeventId; + o2::framework::Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); - using MyEMH = o2::aod::pwgem::dilepton::utils::EventMixingHandler, std::pair, EMTrack>; MyEMH* emh1 = nullptr; MyEMH* emh2 = nullptr; std::vector used_photonIds_per_col; // @@ -534,7 +524,7 @@ struct TaggingPi0 { std::tuple key_bin = std::make_tuple(zbin, centbin, epbin, occbin); std::pair key_df_collision = std::make_pair(ndf, collision.globalIndex()); - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); // PCM auto positrons_per_collision = positrons->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); // positrons auto electrons_per_collision = electrons->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); // electrons @@ -549,7 +539,7 @@ struct TaggingPi0 { fRegistry.fill(HIST("Photon/hPt"), v_gamma.Pt(), weight); fRegistry.fill(HIST("Photon/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); - for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { + for (const auto& [pos2, ele2] : combinations(o2::soa::CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. continue; @@ -574,11 +564,11 @@ struct TaggingPi0 { std::pair tuple_tmp_id2 = std::make_pair(pos2.trackId(), ele2.trackId()); if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) { - emh1->AddTrackToEventPool(key_df_collision, EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); + emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); used_photonIds_per_col.emplace_back(g1.globalIndex()); } if (std::find(used_dileptonIds_per_col.begin(), used_dileptonIds_per_col.end(), tuple_tmp_id2) == used_dileptonIds_per_col.end()) { - emh2->AddTrackToEventPool(key_df_collision, EMTrack(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M())); + emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(v_ee.Pt(), v_ee.Eta(), v_ee.Phi(), v_ee.M())); used_dileptonIds_per_col.emplace_back(tuple_tmp_id2); } ndiphoton++; @@ -588,7 +578,7 @@ struct TaggingPi0 { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); // PCM auto photons2_per_collision = photons2.sliceBy(perCollision2, collision.globalIndex()); // EMC or PHOS - for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(o2::soa::CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } @@ -599,11 +589,11 @@ struct TaggingPi0 { fRegistry.fill(HIST("Pair/same/hMvsPt"), v12.M(), v1.Pt(), weight); if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g1.globalIndex()) == used_photonIds_per_col.end()) { - emh1->AddTrackToEventPool(key_df_collision, EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); + emh1->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g1.pt(), g1.eta(), g1.phi(), 0)); used_photonIds_per_col.emplace_back(g1.globalIndex()); } if (std::find(used_photonIds_per_col.begin(), used_photonIds_per_col.end(), g2.globalIndex()) == used_photonIds_per_col.end()) { - emh2->AddTrackToEventPool(key_df_collision, EMTrack(g2.pt(), g2.eta(), g2.phi(), 0)); + emh2->AddTrackToEventPool(key_df_collision, o2::aod::pwgem::dilepton::utils::EMTrack(g2.pt(), g2.eta(), g2.phi(), 0)); used_photonIds_per_col.emplace_back(g2.globalIndex()); } ndiphoton++; @@ -649,7 +639,7 @@ struct TaggingPi0 { for (const auto& g2 : photons2_from_event_pool) { ROOT::Math::PtEtaPhiMVector v1(g1.pt(), g1.eta(), g1.phi(), 0.); ROOT::Math::PtEtaPhiMVector v2(g2.pt(), g2.eta(), g2.phi(), 0.); - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { v2.SetM(g2.mass()); } ROOT::Math::PtEtaPhiMVector v12 = v1 + v2; @@ -667,29 +657,29 @@ struct TaggingPi0 { } // end of collision loop } - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - Filter collisionFilter_centrality = (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); - using FilteredMyCollisions = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + o2::framework::expressions::Filter collisionFilter_centrality = (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); + using FilteredMyCollisions = o2::soa::Filtered; int ndf = 0; void processAnalysis(FilteredMyCollisions const& collisions, Types const&... args) { // LOGF(info, "ndf = %d", ndf); - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto v0photons = std::get<0>(std::tie(args...)); auto v0legs = std::get<1>(std::tie(args...)); auto emprimaryelectrons = std::get<2>(std::tie(args...)); // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size()); runPairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut); } - // else if constexpr (pairtype == PairType::kPCMEMC) { + // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto emcclusters = std::get<2>(std::tie(args...)); // auto emcmatchedtracks = std::get<3>(std::tie(args...)); // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr); - // } else if constexpr (pairtype == PairType::kPCMPHOS) { + // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto phosclusters = std::get<2>(std::tie(args...)); @@ -699,24 +689,24 @@ struct TaggingPi0 { } PROCESS_SWITCH(TaggingPi0, processAnalysis, "process pair analysis", true); - using FilteredMyCollisionsWithJJMC = soa::Filtered; + using FilteredMyCollisionsWithJJMC = o2::soa::Filtered; void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, Types const&... args) { // LOGF(info, "ndf = %d", ndf); - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto v0photons = std::get<0>(std::tie(args...)); auto v0legs = std::get<1>(std::tie(args...)); auto emprimaryelectrons = std::get<2>(std::tie(args...)); // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size()); runPairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut); } - // else if constexpr (pairtype == PairType::kPCMEMC) { + // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto emcclusters = std::get<2>(std::tie(args...)); // auto emcmatchedtracks = std::get<3>(std::tie(args...)); // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr); - // } else if constexpr (pairtype == PairType::kPCMPHOS) { + // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto phosclusters = std::get<2>(std::tie(args...)); diff --git a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h index 9dda549dc79..17b92c44852 100644 --- a/PWGEM/PhotonMeson/Core/TaggingPi0MC.h +++ b/PWGEM/PhotonMeson/Core/TaggingPi0MC.h @@ -21,7 +21,6 @@ #include "PWGEM/PhotonMeson/Core/DalitzEECut.h" #include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" -// #include "PWGEM/PhotonMeson/Core/PHOSPhotonCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -50,7 +49,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include @@ -62,173 +61,164 @@ #include #include -using namespace o2; -using namespace o2::aod; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::soa; -using namespace o2::aod::pwgem::photonmeson::photonpair; -using namespace o2::aod::pwgem::photonmeson::utils::mcutil; -using namespace o2::aod::pwgem::dilepton::utils::mcutil; - -using MyCollisions = soa::Join; +using MyCollisions = o2::soa::Join; using MyCollision = MyCollisions::iterator; -using MyCollisionsWithJJMC = soa::Join; +using MyCollisionsWithJJMC = o2::soa::Join; using MyCollisionWithJJMC = MyCollisionsWithJJMC::iterator; -using MyMCCollisions = soa::Join; +using MyMCCollisions = o2::soa::Join; using MyMCCollision = MyMCCollisions::iterator; -using MyV0Photons = soa::Join; +using MyV0Photons = o2::soa::Join; using MyV0Photon = MyV0Photons::iterator; -using MyEMCClusters = soa::Join; +using MyEMCClusters = o2::soa::Join; using MyEMCCluster = MyEMCClusters::iterator; -// using MyPHOSClusters = soa::Join; +// using MyPHOSClusters = o2::soa::Join; // using MyPHOSCluster = MyEMCClusters::iterator; -using MyMCV0Legs = soa::Join; +using MyMCV0Legs = o2::soa::Join; using MyMCV0Leg = MyMCV0Legs::iterator; -using MyMCElectrons = soa::Join; +using MyMCElectrons = o2::soa::Join; using MyMCElectron = MyMCElectrons::iterator; -template +template struct TaggingPi0MC { - Configurable ccdburl{"ccdb-url", "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 skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; - Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; - - Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; - Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; - Configurable fd_k0s_to_pi0{"fd_k0s_pi0", "1.0", "feed down correction to pi0"}; - Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; - ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; + o2::framework::Configurable ccdburl{"ccdb-url", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + o2::framework::Configurable grpPath{"grpPath", "GLO/GRP/GRP", "Path of the grp file"}; + o2::framework::Configurable grpmagPath{"grpmagPath", "GLO/Config/GRPMagField", "CCDB path of the GRPMagField object"}; + o2::framework::Configurable skipGRPOquery{"skipGRPOquery", true, "skip grpo query"}; + o2::framework::Configurable d_bz_input{"d_bz_input", -999, "bz field in kG, -999 is automatic"}; + + o2::framework::Configurable cfgQvecEstimator{"cfgQvecEstimator", 0, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + o2::framework::Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + o2::framework::Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + o2::framework::Configurable fd_k0s_to_pi0{"fd_k0s_pi0", "1.0", "feed down correction to pi0"}; + o2::framework::Configurable cfgRequireTrueAssociation{"cfgRequireTrueAssociation", false, "flag to require true mc collision association"}; + o2::framework::ConfigurableAxis ConfPtBins{"ConfPtBins", {100, 0, 10}, "pT bins for output histograms"}; EMPhotonEventCut fEMEventCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "eventcut_group"; - Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; - Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; - Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; - Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; - Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; - Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; - Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; - Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. - Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; - Configurable cfgRequireEMCReadoutInMB{"cfgRequireEMCReadoutInMB", false, "require the EMC to be read out in an MB collision (kTVXinEMC)"}; - Configurable cfgRequireEMCHardwareTriggered{"cfgRequireEMCHardwareTriggered", false, "require the EMC to be hardware triggered (kEMC7 or kDMC7)"}; - Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; - Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; - Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; - Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; - Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; + o2::framework::Configurable cfgZvtxMin{"cfgZvtxMin", -10.f, "min. Zvtx"}; + o2::framework::Configurable cfgZvtxMax{"cfgZvtxMax", 10.f, "max. Zvtx"}; + o2::framework::Configurable cfgRequireSel8{"cfgRequireSel8", true, "require sel8 in event cut"}; + o2::framework::Configurable cfgRequireFT0AND{"cfgRequireFT0AND", true, "require FT0AND in event cut"}; + o2::framework::Configurable cfgRequireNoTFB{"cfgRequireNoTFB", false, "require No time frame border in event cut"}; + o2::framework::Configurable cfgRequireNoITSROFB{"cfgRequireNoITSROFB", false, "require no ITS readout frame border in event cut"}; + o2::framework::Configurable cfgRequireNoSameBunchPileup{"cfgRequireNoSameBunchPileup", false, "require no same bunch pileup in event cut"}; + o2::framework::Configurable cfgRequireVertexITSTPC{"cfgRequireVertexITSTPC", false, "require Vertex ITSTPC in event cut"}; // ITS-TPC matched track contributes PV. + o2::framework::Configurable cfgRequireGoodZvtxFT0vsPV{"cfgRequireGoodZvtxFT0vsPV", false, "require good Zvtx between FT0 vs. PV in event cut"}; + o2::framework::Configurable cfgRequireEMCReadoutInMB{"cfgRequireEMCReadoutInMB", false, "require the EMC to be read out in an MB collision (kTVXinEMC)"}; + o2::framework::Configurable cfgRequireEMCHardwareTriggered{"cfgRequireEMCHardwareTriggered", false, "require the EMC to be hardware triggered (kEMC7 or kDMC7)"}; + o2::framework::Configurable cfgTrackOccupancyMin{"cfgTrackOccupancyMin", -2, "min. occupancy"}; + o2::framework::Configurable cfgTrackOccupancyMax{"cfgTrackOccupancyMax", 1000000000, "max. occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMin{"cfgFT0COccupancyMin", -2, "min. FT0C occupancy"}; + o2::framework::Configurable cfgFT0COccupancyMax{"cfgFT0COccupancyMax", 1000000000, "max. FT0C occupancy"}; + o2::framework::Configurable onlyKeepWeightedEvents{"onlyKeepWeightedEvents", false, "flag to keep only weighted events (for JJ MCs) and remove all MB events (with weight = 1)"}; } eventcuts; V0PhotonCut fV0PhotonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "pcmcut_group"; - Configurable cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"}; - Configurable cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"}; - Configurable cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"}; - Configurable cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"}; - Configurable cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"}; - Configurable cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"}; - Configurable cfg_max_eta_v0{"cfg_max_eta_v0", 0.8, "max eta for v0 photons at PV"}; - Configurable cfg_min_v0radius{"cfg_min_v0radius", 4.0, "min v0 radius"}; - Configurable cfg_max_v0radius{"cfg_max_v0radius", 90.0, "max v0 radius"}; - Configurable cfg_max_alpha_ap{"cfg_max_alpha_ap", 0.95, "max alpha for AP cut"}; - Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; - Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; - Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; - Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; - Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; - - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 10, "min ncluster tpc"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 40, "min ncrossed rows"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -3.0, "min. TPC n sigma for electron"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron"}; - Configurable cfg_disable_itsonly_track{"cfg_disable_itsonly_track", false, "flag to disable ITSonly tracks"}; - Configurable cfg_disable_tpconly_track{"cfg_disable_tpconly_track", false, "flag to disable TPConly tracks"}; + o2::framework::Configurable cfg_require_v0_with_itstpc{"cfg_require_v0_with_itstpc", false, "flag to select V0s with ITS-TPC matched tracks"}; + o2::framework::Configurable cfg_require_v0_with_itsonly{"cfg_require_v0_with_itsonly", false, "flag to select V0s with ITSonly tracks"}; + o2::framework::Configurable cfg_require_v0_with_tpconly{"cfg_require_v0_with_tpconly", false, "flag to select V0s with TPConly tracks"}; + o2::framework::Configurable cfg_min_pt_v0{"cfg_min_pt_v0", 0.1, "min pT for v0 photons at PV"}; + o2::framework::Configurable cfg_max_pt_v0{"cfg_max_pt_v0", 1e+10, "max pT for v0 photons at PV"}; + o2::framework::Configurable cfg_min_eta_v0{"cfg_min_eta_v0", -0.8, "min eta for v0 photons at PV"}; + o2::framework::Configurable cfg_max_eta_v0{"cfg_max_eta_v0", 0.8, "max eta for v0 photons at PV"}; + o2::framework::Configurable cfg_min_v0radius{"cfg_min_v0radius", 4.0, "min v0 radius"}; + o2::framework::Configurable cfg_max_v0radius{"cfg_max_v0radius", 90.0, "max v0 radius"}; + o2::framework::Configurable cfg_max_alpha_ap{"cfg_max_alpha_ap", 0.95, "max alpha for AP cut"}; + o2::framework::Configurable cfg_max_qt_ap{"cfg_max_qt_ap", 0.01, "max qT for AP cut"}; + o2::framework::Configurable cfg_min_cospa{"cfg_min_cospa", 0.997, "min V0 CosPA"}; + o2::framework::Configurable cfg_max_pca{"cfg_max_pca", 3.0, "max distance btween 2 legs"}; + o2::framework::Configurable cfg_max_chi2kf{"cfg_max_chi2kf", 1e+10, "max chi2/ndf with KF"}; + o2::framework::Configurable cfg_reject_v0_on_itsib{"cfg_reject_v0_on_itsib", true, "flag to reject V0s on ITSib"}; + + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 10, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 40, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -3.0, "min. TPC n sigma for electron"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron"}; + o2::framework::Configurable cfg_disable_itsonly_track{"cfg_disable_itsonly_track", false, "flag to disable ITSonly tracks"}; + o2::framework::Configurable cfg_disable_tpconly_track{"cfg_disable_tpconly_track", false, "flag to disable TPConly tracks"}; } pcmcuts; DalitzEECut fDileptonCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "dileptoncut_group"; - Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; - Configurable cfg_max_mass{"cfg_max_mass", 0.1, "max mass"}; - Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; - Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; - Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; - Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; - Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; - - Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; - Configurable cfg_max_eta_track{"cfg_max_eta_track", 0.8, "max eta for single track"}; - Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; - Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; - Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 70, "min ncrossed rows"}; - Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; - Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; - Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; - Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.05, "max dca XY for single track in cm"}; - Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.05, "max dca Z for single track in cm"}; - Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1.5, "max DCA 3D in sigma"}; - - Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DalitzEECut::PIDSchemes::kTOFif), "pid scheme [kTOFif : 0, kTPConly : 1]"}; - Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; - Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; - Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; - Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; - Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; - Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_mass{"cfg_min_mass", 0.0, "min mass"}; + o2::framework::Configurable cfg_max_mass{"cfg_max_mass", 0.1, "max mass"}; + o2::framework::Configurable cfg_apply_phiv{"cfg_apply_phiv", true, "flag to apply phiv cut"}; + o2::framework::Configurable cfg_require_itsib_any{"cfg_require_itsib_any", false, "flag to require ITS ib any hits"}; + o2::framework::Configurable cfg_require_itsib_1st{"cfg_require_itsib_1st", true, "flag to require ITS ib 1st hit"}; + o2::framework::Configurable cfg_phiv_slope{"cfg_phiv_slope", 0.0185, "slope for m vs. phiv"}; + o2::framework::Configurable cfg_phiv_intercept{"cfg_phiv_intercept", -0.0280, "intercept for m vs. phiv"}; + + o2::framework::Configurable cfg_min_pt_track{"cfg_min_pt_track", 0.1, "min pT for single track"}; + o2::framework::Configurable cfg_max_eta_track{"cfg_max_eta_track", 0.8, "max eta for single track"}; + o2::framework::Configurable cfg_min_ncluster_tpc{"cfg_min_ncluster_tpc", 0, "min ncluster tpc"}; + o2::framework::Configurable cfg_min_ncluster_its{"cfg_min_ncluster_its", 5, "min ncluster its"}; + o2::framework::Configurable cfg_min_ncrossedrows{"cfg_min_ncrossedrows", 70, "min ncrossed rows"}; + o2::framework::Configurable cfg_max_frac_shared_clusters_tpc{"cfg_max_frac_shared_clusters_tpc", 999.f, "max fraction of shared clusters in TPC"}; + o2::framework::Configurable cfg_max_chi2tpc{"cfg_max_chi2tpc", 4.0, "max chi2/NclsTPC"}; + o2::framework::Configurable cfg_max_chi2its{"cfg_max_chi2its", 5.0, "max chi2/NclsITS"}; + o2::framework::Configurable cfg_max_dcaxy{"cfg_max_dcaxy", 0.05, "max dca XY for single track in cm"}; + o2::framework::Configurable cfg_max_dcaz{"cfg_max_dcaz", 0.05, "max dca Z for single track in cm"}; + o2::framework::Configurable cfg_max_dca3dsigma_track{"cfg_max_dca3dsigma_track", 1.5, "max DCA 3D in sigma"}; + + o2::framework::Configurable cfg_pid_scheme{"cfg_pid_scheme", static_cast(DalitzEECut::PIDSchemes::kTOFif), "pid scheme [kTOFif : 0, kTPConly : 1]"}; + o2::framework::Configurable cfg_min_TPCNsigmaEl{"cfg_min_TPCNsigmaEl", -2.0, "min. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaEl{"cfg_max_TPCNsigmaEl", +3.0, "max. TPC n sigma for electron inclusion"}; + o2::framework::Configurable cfg_min_TPCNsigmaPi{"cfg_min_TPCNsigmaPi", -0.0, "min. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_max_TPCNsigmaPi{"cfg_max_TPCNsigmaPi", +0.0, "max. TPC n sigma for pion exclusion"}; + o2::framework::Configurable cfg_min_TOFNsigmaEl{"cfg_min_TOFNsigmaEl", -3.0, "min. TOF n sigma for electron inclusion"}; + o2::framework::Configurable cfg_max_TOFNsigmaEl{"cfg_max_TOFNsigmaEl", +3.0, "max. TOF n sigma for electron inclusion"}; } dileptoncuts; EMCPhotonCut fEMCCut; - struct : ConfigurableGroup { + struct : o2::framework::ConfigurableGroup { std::string prefix = "emccut_group"; - Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; - Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; - Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; - Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; - Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; - Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; - Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; - Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; - Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; - Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; - Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; + o2::framework::Configurable clusterDefinition{"clusterDefinition", "kV3Default", "Clusterizer to be selected, e.g. V3Default"}; + o2::framework::Configurable minOpenAngle{"minOpenAngle", 0.0202, "apply min opening angle"}; + o2::framework::Configurable EMC_minTime{"EMC_minTime", -20., "Minimum cluster time for EMCal time cut"}; + o2::framework::Configurable EMC_maxTime{"EMC_maxTime", +25., "Maximum cluster time for EMCal time cut"}; + o2::framework::Configurable EMC_minM02{"EMC_minM02", 0.1, "Minimum M02 for EMCal M02 cut"}; + o2::framework::Configurable EMC_maxM02{"EMC_maxM02", 0.7, "Maximum M02 for EMCal M02 cut"}; + o2::framework::Configurable EMC_minE{"EMC_minE", 0.7, "Minimum cluster energy for EMCal energy cut"}; + o2::framework::Configurable EMC_minNCell{"EMC_minNCell", 1, "Minimum number of cells per cluster for EMCal NCell cut"}; + o2::framework::Configurable> EMC_TM_Eta{"EMC_TM_Eta", {0.01f, 4.07f, -2.5f}, "|eta| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + o2::framework::Configurable> EMC_TM_Phi{"EMC_TM_Phi", {0.015f, 3.65f, -2.f}, "|phi| <= [0]+(pT+[1])^[2] for EMCal track matching"}; + o2::framework::Configurable EMC_Eoverp{"EMC_Eoverp", 1.75, "Minimum cluster energy over track momentum for EMCal track matching"}; + o2::framework::Configurable EMC_UseExoticCut{"EMC_UseExoticCut", true, "FLag to use the EMCal exotic cluster cut"}; } emccuts; // PHOSPhotonCut fPHOSCut; - // struct : ConfigurableGroup { + // struct : o2::framework::ConfigurableGroup { // std::string prefix = "phoscut_group"; - // Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; + // o2::framework::Configurable cfg_min_Ecluster{"cfg_min_Ecluster", 0.3, "Minimum cluster energy for PHOS in GeV"}; // } phoscuts; - HistogramRegistry fRegistry{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + o2::framework::HistogramRegistry fRegistry{"output", {}, o2::framework::OutputObjHandlingPolicy::AnalysisObject, false, false}; static constexpr std::string_view event_types[2] = {"before/", "after/"}; static constexpr std::string_view event_pair_types[2] = {"same/", "mix/"}; static constexpr std::string_view parnames[2] = {"Pi0/", "Eta/"}; o2::ccdb::CcdbApi ccdbApi; - Service ccdb; + o2::framework::Service ccdb; int mRunNumber; float d_bz; TF1* f1fd_k0s_to_pi0; - void init(InitContext&) + void init(o2::framework::InitContext&) { o2::aod::pwgem::photonmeson::utils::eventhistogram::addEventHistograms(&fRegistry); addHistogrms(); @@ -296,26 +286,26 @@ struct TaggingPi0MC { void addHistogrms() { TString mggTitle = "ee#gamma"; - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { mggTitle = "ee#gamma"; } else { mggTitle = "#gamma#gamma"; } - const AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; - const AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; + const o2::framework::AxisSpec axis_m{200, 0, 0.4, Form("m_{%s} (GeV/c^{2})", mggTitle.Data())}; + const o2::framework::AxisSpec axis_pt{ConfPtBins, "p_{T,#gamma} (GeV/c)"}; - fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); // for purity - fRegistry.add("Photon/candidate/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity - fRegistry.add("Photon/primary/hPt", "photon;p_{T,#gamma} (GeV/c)", kTH1D, {axis_pt}, true); // for purity - fRegistry.add("Photon/primary/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity - fRegistry.addClone("Photon/primary/", "Photon/fromWD/"); // only for completeness - fRegistry.addClone("Photon/primary/", "Photon/fromHS/"); // only for completeness - fRegistry.addClone("Photon/primary/", "Photon/fromPi0/"); // for conditional acceptance, denominator + fRegistry.add("Photon/candidate/hPt", "photon candidates;p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); // for purity + fRegistry.add("Photon/candidate/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity + fRegistry.add("Photon/primary/hPt", "photon;p_{T,#gamma} (GeV/c)", o2::framework::kTH1D, {axis_pt}, true); // for purity + fRegistry.add("Photon/primary/hEtaPhi", "#varphi vs. #eta;#varphi_{#gamma} (rad.);#eta_{#gamma}", o2::framework::kTH2D, {{90, 0, o2::constants::math::TwoPI}, {40, -1, +1}}, true); // for purity + fRegistry.addClone("Photon/primary/", "Photon/fromWD/"); // only for completeness + fRegistry.addClone("Photon/primary/", "Photon/fromHS/"); // only for completeness + fRegistry.addClone("Photon/primary/", "Photon/fromPi0/"); // for conditional acceptance, denominator - fRegistry.add("Pair/primary/hMvsPt", "mass vs. p_{T,#gamma} from #pi^{0}", kTH2D, {axis_m, axis_pt}, true); // for conditional acceptance, numerator - fRegistry.addClone("Pair/primary/", "Pair/fromWD/"); // only for completeness - fRegistry.addClone("Pair/primary/", "Pair/fromHS/"); // only for completeness + fRegistry.add("Pair/primary/hMvsPt", "mass vs. p_{T,#gamma} from #pi^{0}", o2::framework::kTH2D, {axis_m, axis_pt}, true); // for conditional acceptance, numerator + fRegistry.addClone("Pair/primary/", "Pair/fromWD/"); // only for completeness + fRegistry.addClone("Pair/primary/", "Pair/fromHS/"); // only for completeness } void DefineEMEventCut() @@ -418,14 +408,14 @@ struct TaggingPi0MC { // fPHOSCut.SetEnergyRange(phoscuts.cfg_min_Ecluster, 1e+10); // } - SliceCache cache; - Preslice perCollision_pcm = aod::v0photonkf::pmeventId; - Preslice perCollision_emc = aod::emccluster::pmeventId; - // Preslice perCollision_phos = aod::phoscluster::pmeventId; + o2::framework::SliceCache cache; + o2::framework::Preslice perCollision_pcm = o2::aod::v0photonkf::pmeventId; + o2::framework::Preslice perCollision_emc = o2::aod::emccluster::pmeventId; + // o2::framework::Preslice perCollision_phos = o2::aod::phoscluster::pmeventId; - Preslice perCollision_electron = aod::emprimaryelectronda::pmeventId; - Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); - Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Preslice perCollision_electron = o2::aod::emprimaryelectronda::pmeventId; + o2::framework::Partition positrons = o2::aod::emprimaryelectron::sign > int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt&& nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl&& o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); + o2::framework::Partition electrons = o2::aod::emprimaryelectron::sign < int8_t(0) && static_cast(dileptoncuts.cfg_min_pt_track) < o2::aod::track::pt && nabs(o2::aod::track::eta) < static_cast(dileptoncuts.cfg_max_eta_track) && static_cast(dileptoncuts.cfg_min_TPCNsigmaEl) < o2::aod::pidtpc::tpcNSigmaEl && o2::aod::pidtpc::tpcNSigmaEl < static_cast(dileptoncuts.cfg_max_TPCNsigmaEl); template void runTruePairing(TCollisions const& collisions, @@ -460,7 +450,7 @@ struct TaggingPi0MC { fRegistry.fill(HIST("Event/before/hCollisionCounter"), 12.0, weight); // accepted fRegistry.fill(HIST("Event/after/hCollisionCounter"), 12.0, weight); // accepted - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); auto positrons_per_collision = positrons->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); auto electrons_per_collision = electrons->sliceByCached(o2::aod::emprimaryelectronda::pmeventId, collision.globalIndex(), cache); @@ -478,7 +468,7 @@ struct TaggingPi0MC { auto ele1 = g1.template negTrack_as(); auto pos1mc = pos1.template emmcparticle_as(); auto ele1mc = ele1.template emmcparticle_as(); - int photonid1 = FindCommonMotherFrom2Prongs(pos1mc, ele1mc, -11, 11, 22, mcparticles); + int photonid1 = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom2Prongs(pos1mc, ele1mc, -11, 11, 22, mcparticles); if (photonid1 < 0) { continue; } @@ -498,8 +488,8 @@ struct TaggingPi0MC { fRegistry.fill(HIST("Photon/fromPi0/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); } } - } else if (IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles) > 0) { - int motherid_strhad = IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles); + } else if (o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles) > 0) { + int motherid_strhad = o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(g1mc.template emmcevent_as(), g1mc, mcparticles); auto str_had = mcparticles.iteratorAt(motherid_strhad); float weight = 1.f; if (std::abs(str_had.pdgCode()) == 310 && f1fd_k0s_to_pi0 != nullptr) { @@ -512,8 +502,8 @@ struct TaggingPi0MC { fRegistry.fill(HIST("Photon/fromHS/hEtaPhi"), v_gamma.Phi() > 0 ? v_gamma.Phi() : v_gamma.Phi() + o2::constants::math::TwoPI, v_gamma.Eta(), weight); } - for (const auto& [pos2, ele2] : combinations(CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { // ULS - if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. + for (const auto& [pos2, ele2] : combinations(o2::soa::CombinationsFullIndexPolicy(positrons_per_collision, electrons_per_collision))) { // ULS + if (pos2.trackId() == ele2.trackId()) { // this is protection against pairing identical 2 tracks. continue; } if (pos1.trackId() == pos2.trackId() || ele1.trackId() == ele2.trackId()) { @@ -530,7 +520,7 @@ struct TaggingPi0MC { auto pos2mc = mcparticles.iteratorAt(pos2.emmcparticleId()); auto ele2mc = mcparticles.iteratorAt(ele2.emmcparticleId()); - int pi0id = FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles); + int pi0id = o2::aod::pwgem::dilepton::utils::mcutil::FindCommonMotherFrom3Prongs(g1mc, pos2mc, ele2mc, 22, -11, 11, 111, mcparticles); if (pi0id < 0) { continue; } @@ -544,8 +534,8 @@ struct TaggingPi0MC { if (pi0mc.isPhysicalPrimary() || pi0mc.producedByGenerator()) { fRegistry.fill(HIST("Pair/primary/hMvsPt"), veeg.M(), v_gamma.Pt(), weight); - } else if (IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles) > 0) { - int motherid_strhad = IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles); + } else if (o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles) > 0) { + int motherid_strhad = o2::aod::pwgem::photonmeson::utils::mcutil::IsFromWD(pi0mc.template emmcevent_as(), pi0mc, mcparticles); auto str_had = mcparticles.iteratorAt(motherid_strhad); float weight = 1.f; if (std::abs(str_had.pdgCode()) == 310 && f1fd_k0s_to_pi0 != nullptr) { @@ -562,7 +552,7 @@ struct TaggingPi0MC { auto photons1_per_collision = photons1.sliceBy(perCollision1, collision.globalIndex()); auto photons2_per_collision = photons2.sliceBy(perCollision2, collision.globalIndex()); - for (const auto& [g1, g2] : combinations(CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { + for (const auto& [g1, g2] : combinations(o2::soa::CombinationsFullIndexPolicy(photons1_per_collision, photons2_per_collision))) { if (!cut1.template IsSelected(g1) || !cut2.template IsSelected(g2)) { continue; } @@ -578,27 +568,27 @@ struct TaggingPi0MC { } // end of collision loop } - Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; - Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; - Filter collisionFilter_centrality = (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); - using FilteredMyCollisions = soa::Filtered; + o2::framework::expressions::Filter collisionFilter_occupancy_track = eventcuts.cfgTrackOccupancyMin <= o2::aod::evsel::trackOccupancyInTimeRange && o2::aod::evsel::trackOccupancyInTimeRange < eventcuts.cfgTrackOccupancyMax; + o2::framework::expressions::Filter collisionFilter_occupancy_ft0c = eventcuts.cfgFT0COccupancyMin <= o2::aod::evsel::ft0cOccupancyInTimeRange && o2::aod::evsel::ft0cOccupancyInTimeRange < eventcuts.cfgFT0COccupancyMax; + o2::framework::expressions::Filter collisionFilter_centrality = (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); + using FilteredMyCollisions = o2::soa::Filtered; - void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, Types const&... args) + void processAnalysis(FilteredMyCollisions const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, Types const&... args) { - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto v0photons = std::get<0>(std::tie(args...)); auto v0legs = std::get<1>(std::tie(args...)); auto emprimaryelectrons = std::get<2>(std::tie(args...)); // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size()); runTruePairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut, mccollisions, mcparticles); } - // else if constexpr (pairtype == PairType::kPCMEMC) { + // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto emcclusters = std::get<2>(std::tie(args...)); // auto emcmatchedtracks = std::get<3>(std::tie(args...)); // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr); - // } else if constexpr (pairtype == PairType::kPCMPHOS) { + // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto phosclusters = std::get<2>(std::tie(args...)); @@ -607,23 +597,23 @@ struct TaggingPi0MC { } PROCESS_SWITCH(TaggingPi0MC, processAnalysis, "process pair analysis", true); - using FilteredMyCollisionsWithJJMC = soa::Filtered; - void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, MyMCCollisions const& mccollisions, aod::EMMCParticles const& mcparticles, Types const&... args) + using FilteredMyCollisionsWithJJMC = o2::soa::Filtered; + void processAnalysisJJMC(FilteredMyCollisionsWithJJMC const& collisions, MyMCCollisions const& mccollisions, o2::aod::EMMCParticles const& mcparticles, Types const&... args) { - if constexpr (pairtype == PairType::kPCMDalitzEE) { + if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMDalitzEE) { auto v0photons = std::get<0>(std::tie(args...)); auto v0legs = std::get<1>(std::tie(args...)); auto emprimaryelectrons = std::get<2>(std::tie(args...)); // LOGF(info, "electrons.size() = %d, positrons.size() = %d", electrons.size(), positrons.size()); runTruePairing(collisions, v0photons, emprimaryelectrons, v0legs, emprimaryelectrons, perCollision_pcm, perCollision_electron, fV0PhotonCut, fDileptonCut, mccollisions, mcparticles); } - // else if constexpr (pairtype == PairType::kPCMEMC) { + // else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMEMC) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto emcclusters = std::get<2>(std::tie(args...)); // auto emcmatchedtracks = std::get<3>(std::tie(args...)); // runPairing(collisions, v0photons, emcclusters, v0legs, nullptr, perCollision_pcm, perCollision_emc, fV0PhotonCut, fEMCCut, emcmatchedtracks, nullptr); - // } else if constexpr (pairtype == PairType::kPCMPHOS) { + // } else if constexpr (pairtype == o2::aod::pwgem::photonmeson::photonpair::PairType::kPCMPHOS) { // auto v0photons = std::get<0>(std::tie(args...)); // auto v0legs = std::get<1>(std::tie(args...)); // auto phosclusters = std::get<2>(std::tie(args...)); diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h index 2e98a0396b5..af9acc7003a 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCandidate.h @@ -22,6 +22,9 @@ #include +#include +#include + enum CentType : uint8_t { CentFT0M = 0, CentFT0A = 1, @@ -71,7 +74,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/Core/V0PhotonCut.cxx b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx index 0511e72d0c7..e38aed371f9 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.cxx @@ -15,9 +15,12 @@ #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" -#include +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" + #include +#include + #include #include diff --git a/PWGEM/PhotonMeson/Core/V0PhotonCut.h b/PWGEM/PhotonMeson/Core/V0PhotonCut.h index 664981df21e..7ea0be9beb3 100644 --- a/PWGEM/PhotonMeson/Core/V0PhotonCut.h +++ b/PWGEM/PhotonMeson/Core/V0PhotonCut.h @@ -26,20 +26,21 @@ #include #include #include +#include +#include #include // IWYU pragma: keep -#include -#include -#include +#include #include -#include +#include #include #include #include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/DataModel/EventTables.h b/PWGEM/PhotonMeson/DataModel/EventTables.h index d902e82562a..05e1541493b 100644 --- a/PWGEM/PhotonMeson/DataModel/EventTables.h +++ b/PWGEM/PhotonMeson/DataModel/EventTables.h @@ -16,7 +16,6 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/EventSelection.h" -#include #include #include diff --git a/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h b/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h index 15e66f8bd96..79219f35fa4 100644 --- a/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h +++ b/PWGEM/PhotonMeson/DataModel/GammaTablesRedux.h @@ -21,8 +21,7 @@ #include #include - -#include +#include #include #include diff --git a/PWGEM/PhotonMeson/DataModel/bcWiseTables.h b/PWGEM/PhotonMeson/DataModel/bcWiseTables.h index efd3f9a2007..4f64bf08fb0 100644 --- a/PWGEM/PhotonMeson/DataModel/bcWiseTables.h +++ b/PWGEM/PhotonMeson/DataModel/bcWiseTables.h @@ -19,8 +19,10 @@ #ifndef PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ #define PWGEM_PHOTONMESON_DATAMODEL_BCWISETABLES_H_ -#include "Framework/AnalysisDataModel.h" +#include +#include +#include #include namespace o2::aod diff --git a/PWGEM/PhotonMeson/DataModel/gammaTables.h b/PWGEM/PhotonMeson/DataModel/gammaTables.h index afb88c6694a..9ef4b45727b 100644 --- a/PWGEM/PhotonMeson/DataModel/gammaTables.h +++ b/PWGEM/PhotonMeson/DataModel/gammaTables.h @@ -254,7 +254,7 @@ DECLARE_SOA_COLUMN(NgPCM, ngpcm, int); DECLARE_SOA_COLUMN(Weight, weight, float); //! Weight of the event (e.g. for JJ MCs). Set to 1 for data and non-weighted MCs. } // namespace emevent -DECLARE_SOA_TABLE(EMEventsNgPCM, "AOD", "EMEVENTNGPCM", emevent::NgPCM); // joinable to EMEvents or aod::Collisions +DECLARE_SOA_TABLE(EMEventsNgPCM, "AOD", "EMEVENTNGPCM", emevent::NgPCM); // joinable to EMEvents or o2::aod::Collisions using EMEventNgPCM = EMEventsNgPCM::iterator; DECLARE_SOA_TABLE(EMEventsWeight, "AOD", "EMEVENTWEIGHT", //! table contanint the weight for eache event (for JJ MCs), joinable to EMEvents diff --git a/PWGEM/PhotonMeson/DataModel/mcV0Tables.h b/PWGEM/PhotonMeson/DataModel/mcV0Tables.h index 16e8ee911ba..95b560a7501 100644 --- a/PWGEM/PhotonMeson/DataModel/mcV0Tables.h +++ b/PWGEM/PhotonMeson/DataModel/mcV0Tables.h @@ -15,7 +15,9 @@ #ifndef PWGEM_PHOTONMESON_DATAMODEL_MCV0TABLES_H_ #define PWGEM_PHOTONMESON_DATAMODEL_MCV0TABLES_H_ -#include "Framework/ASoA.h" +#include + +#include namespace o2::aod { diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx index 9147873fb71..cd159115d4f 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx +++ b/PWGEM/PhotonMeson/TableProducer/Converters/converterEmeventPmevent.cxx @@ -16,7 +16,7 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" -#include +#include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/emcIdConverter1.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/emcIdConverter1.cxx index bdfa1aac27c..9c7027076de 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/emcIdConverter1.cxx +++ b/PWGEM/PhotonMeson/TableProducer/Converters/emcIdConverter1.cxx @@ -11,9 +11,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx index 102907e9547..d6d188abb96 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx +++ b/PWGEM/PhotonMeson/TableProducer/Converters/phosIdConverter1.cxx @@ -11,9 +11,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx b/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx index 25230a2512e..c3b82a8b204 100644 --- a/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx +++ b/PWGEM/PhotonMeson/TableProducer/Converters/v0photonIdConverter1.cxx @@ -11,9 +11,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx b/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx index 685f5e886fa..0bfbe804e31 100644 --- a/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/associateMCinfoPhoton.cxx @@ -20,16 +20,32 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" +#include "Common/DataModel/EventSelection.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 using namespace o2; diff --git a/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx b/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx index dbc8c80c7d2..75838125d69 100644 --- a/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx +++ b/PWGEM/PhotonMeson/TableProducer/bcWiseClusterSkimmer.cxx @@ -18,20 +18,39 @@ #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGJE/DataModel/EMCALClusters.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.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 diff --git a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx index d9365251277..01965fc08ae 100644 --- a/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createEMEventPhoton.cxx @@ -25,9 +25,6 @@ #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Qvectors.h" -#include -#include -#include #include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/createPCM.cxx b/PWGEM/PhotonMeson/TableProducer/createPCM.cxx index 138a190f7cd..70457782ae6 100644 --- a/PWGEM/PhotonMeson/TableProducer/createPCM.cxx +++ b/PWGEM/PhotonMeson/TableProducer/createPCM.cxx @@ -22,20 +22,30 @@ #include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CollisionAssociationTables.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/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx index 6d235b0db0c..a371d109e3e 100644 --- a/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx +++ b/PWGEM/PhotonMeson/TableProducer/materialBudgetWeights.cxx @@ -17,7 +17,8 @@ #include "PWGEM/PhotonMeson/Core/MaterialBudgetWeights.h" -#include "Framework/runDataProcessing.h" +#include +#include using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx b/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx index 3e8d6cb146f..57a551a40c1 100644 --- a/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx +++ b/PWGEM/PhotonMeson/TableProducer/nonLinProducer.cxx @@ -30,7 +30,8 @@ #include #include -#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) +#include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx index 9b2f9e0c411..1199b2415a2 100644 --- a/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx +++ b/PWGEM/PhotonMeson/TableProducer/photonconversionbuilder.cxx @@ -54,7 +54,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx b/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx index b67aeb53d41..70a96f7ba8a 100644 --- a/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx +++ b/PWGEM/PhotonMeson/TableProducer/pmQvectorDummyOtf.cxx @@ -17,8 +17,9 @@ #include "PWGEM/Dilepton/DataModel/dileptonTables.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" -#include +#include #include +#include #include using namespace o2; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx index 0d7afd0a63e..f522e113386 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerDalitzEE.cxx @@ -16,18 +16,28 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "Common/DataModel/PIDResponseTPC.h" + #include #include #include #include -#include +#include #include +#include #include +#include +#include +#include +#include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx index 0ebf6f374c8..c0b14051d74 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversion.cxx @@ -22,38 +22,48 @@ // ************************** // runme like: o2-analysis-trackselection -b --aod-file ${sourceFile} --aod-writer-json ${writerFile} | o2-analysis-timestamp -b | o2-analysis-trackextension -b | o2-analysis-lf-lambdakzerobuilder -b | o2-analysis-pid-tpc -b | o2-analysis-em-skimmermc -b - -#include -#include -#include -#include - // todo: remove reduantant information in GammaConversionsInfoTrue + #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/PCMUtilities.h" #include "PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h" #include "PWGLF/DataModel/LFStrangenessTables.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -// includes for the R recalculation -#include "Common/Core/trackUtilities.h" +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/PIDResponseTPC.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "Tools/KFparticle/KFUtilities.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "ReconstructionDataFormats/HelixHelper.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/Vector4D.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx index 509a949b0dd..e44600aafaa 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerGammaConversionTruthOnlyMc.cxx @@ -20,11 +20,15 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h" -#include "TVector3.h" - -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" +#include +#include +#include +#include +#include +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx index ef825ca5578..0d50b530c08 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerPHOS.cxx @@ -13,13 +13,22 @@ /// dependencies: o2-analysis-calo-cluster /// \author daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/CaloClusters.h" -#include "PHOSBase/Geometry.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" +#include "Common/DataModel/CaloClusters.h" + +#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/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx index cb3452dc177..5efa2817617 100644 --- a/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx +++ b/PWGEM/PhotonMeson/TableProducer/skimmerPrimaryElectronFromDalitzEE.cxx @@ -14,33 +14,46 @@ #include "PWGEM/Dilepton/Utils/PairUtilities.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "PWGEM/PhotonMeson/Utils/TrackSelection.h" -#include "Common/Core/trackUtilities.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" - -#include +#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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include #include +#include #include #include +#include + using namespace o2; using namespace o2::soa; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::constants::physics; -using namespace o2::pwgem::photonmeson; using MyCollisions = soa::Join; using MyCollisionsWithSWT = soa::Join; diff --git a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx index 5002de0a133..3caa5e5b5aa 100644 --- a/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx +++ b/PWGEM/PhotonMeson/Tasks/CheckMCV0.cxx @@ -24,19 +24,34 @@ #include #include #include +#include #include #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/PWGEM/PhotonMeson/Tasks/Converters/electronFromDalitzConverter1.cxx b/PWGEM/PhotonMeson/Tasks/Converters/electronFromDalitzConverter1.cxx index 961f8b0dfe7..cd54adedfb3 100644 --- a/PWGEM/PhotonMeson/Tasks/Converters/electronFromDalitzConverter1.cxx +++ b/PWGEM/PhotonMeson/Tasks/Converters/electronFromDalitzConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx b/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx index 1607c30b94a..a8277d122db 100644 --- a/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx +++ b/PWGEM/PhotonMeson/Tasks/Converters/pcmConverter1.cxx @@ -16,9 +16,9 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include using namespace o2; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx b/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx index 4e345a26c02..a92e1888049 100644 --- a/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx +++ b/PWGEM/PhotonMeson/Tasks/HeavyNeutralMeson.cxx @@ -17,9 +17,11 @@ /// #include "PWGEM/PhotonMeson/Utils/HNMUtilities.h" +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include "PWGJE/DataModel/EMCALMatchedCollisions.h" -#include "Common/Core/TrackSelection.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseITS.h" @@ -27,22 +29,30 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector4D.h" -#include "TMath.h" -#include "TRandom3.h" - -#include "fairlogger/Logger.h" - -#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 diff --git a/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx b/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx index 0ee3d8e2f3e..2ecfd14711d 100644 --- a/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx +++ b/PWGEM/PhotonMeson/Tasks/MaterialBudget.cxx @@ -37,7 +37,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx b/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx index 7e5d8d80fc6..463bc9045a8 100644 --- a/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/MaterialBudgetMC.cxx @@ -22,6 +22,8 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" + +#include "Common/Core/RecoDecay.h" // #include "PWGEM/Dilepton/Utils/MCUtilities.h" @@ -35,10 +37,9 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include -#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx b/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx index 556aa96bd6c..587546ff802 100644 --- a/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/OmegaMesonEMC.cxx @@ -19,28 +19,35 @@ #include "PWGEM/PhotonMeson/Utils/HNMUtilities.h" #include "PWGJE/DataModel/EMCALMatchedCollisions.h" -#include "Common/Core/TrackSelection.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/RecoDecay.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include "Math/GenVector/Boost.h" -#include "Math/Vector4D.h" -#include "TMath.h" -#include "TRandom3.h" - -#include "fairlogger/Logger.h" - -#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 diff --git a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx index aa9afe80489..810be128a00 100644 --- a/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/Pi0EtaToGammaGammaPCMDalitzEE.cxx @@ -18,7 +18,6 @@ #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include -#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx b/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx index ac3f50b594a..818eb101285 100644 --- a/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx +++ b/PWGEM/PhotonMeson/Tasks/TagAndProbe.cxx @@ -43,6 +43,7 @@ #include #include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx b/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx index ccdc4184568..89a84ccd2df 100644 --- a/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/TaggingPi0MCPCMDalitzEE.cxx @@ -14,16 +14,19 @@ // This code loops over photons and makes pairs for neutral mesons analyses. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" #include "PWGEM/PhotonMeson/Core/TaggingPi0MC.h" +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" + +#include +#include using namespace o2; using namespace o2::aod; +using namespace o2::framework; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask>(cfgc, TaskName{"tagging-pi0-mc-pcmdalitzee"}), + adaptAnalysisTask>(cfgc, TaskName{"tagging-pi0-mc-pcmdalitzee"}), }; } diff --git a/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx b/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx index 2292faef120..4b94c5b4f29 100644 --- a/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx +++ b/PWGEM/PhotonMeson/Tasks/TaggingPi0PCMDalitzEE.cxx @@ -14,16 +14,19 @@ // This code loops over photons and makes pairs for neutral mesons analyses. // Please write to: daiki.sekihata@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include "PWGEM/PhotonMeson/Core/EMCPhotonCut.h" #include "PWGEM/PhotonMeson/Core/TaggingPi0.h" +#include "PWGEM/PhotonMeson/Utils/PairUtilities.h" -using namespace o2; -using namespace o2::aod; +#include +#include + +using namespace o2::framework; +using namespace o2::aod::pwgem::photonmeson::photonpair; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask>(cfgc, TaskName{"tagging-pi0-pcmdalitzee"}), + adaptAnalysisTask>(cfgc, TaskName{"tagging-pi0-pcmdalitzee"}), }; } diff --git a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx index 8d0b0ee7b3a..12b03c22cf4 100644 --- a/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx +++ b/PWGEM/PhotonMeson/Tasks/calibTaskEmc.cxx @@ -48,17 +48,18 @@ #include #include -#include -#include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include +#include + #include #include #include #include +#include #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx b/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx index 22f05b2bec4..d7046d8832f 100644 --- a/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx +++ b/PWGEM/PhotonMeson/Tasks/compconvbuilder.cxx @@ -46,6 +46,7 @@ #include #include +using namespace std; using namespace o2; using namespace o2::framework; using namespace o2::aod; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx index e42b30e99cc..c3f41633d9b 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQC.cxx @@ -21,22 +21,40 @@ #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/EventHistograms.h" -#include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" - +#include "Common/DataModel/Centrality.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include #include +#include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx index 7a32eddf6ab..084b866da50 100644 --- a/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/dalitzEEQCMC.cxx @@ -21,30 +21,46 @@ #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" #include "PWGEM/PhotonMeson/Utils/EventHistograms.h" -#include "PWGEM/PhotonMeson/Utils/MCUtilities.h" - -#include "Common/Core/RecoDecay.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" - -#include "Math/Vector4D.h" -#include "TString.h" +#include "Common/DataModel/Centrality.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 // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) +#include + +#include +#include #include +#include #include +#include + using namespace o2; using namespace o2::aod; using namespace o2::framework; using namespace o2::framework::expressions; using namespace o2::soa; -using namespace o2::aod::pwgem::photonmeson::utils::mcutil; using namespace o2::aod::pwgem::dilepton::utils::mcutil; using MyCollisions = soa::Join; diff --git a/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx b/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx index 93e89d45c54..1bc980ed4bc 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalBcWiseGammaGamma.cxx @@ -19,16 +19,28 @@ #include #include +#include +#include +#include #include +#include +#include #include +#include +#include #include -#include -#include -#include // IWYU pragma: keep +#include +#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include +#include #include +#include +#include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx index 0f1d2103db5..ae6192a9dbb 100644 --- a/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx +++ b/PWGEM/PhotonMeson/Tasks/emcalPi0Qc.cxx @@ -47,7 +47,6 @@ #include #include #include -#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx b/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx index ae2ad0c548f..94ad627191a 100644 --- a/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx +++ b/PWGEM/PhotonMeson/Tasks/gammaConversionsTruthOnlyMc.cxx @@ -20,10 +20,11 @@ #include #include +#include +#include +#include #include -#include - #include using namespace o2; diff --git a/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx b/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx index 889858359ed..fc390c4ce65 100644 --- a/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx +++ b/PWGEM/PhotonMeson/Tasks/mcGeneratorStudies.cxx @@ -16,13 +16,16 @@ /// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt /// -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" +#include +#include +#include +#include +#include +#include +#include +#include -#include "TDatabasePDG.h" +#include using namespace o2; using namespace o2::framework; diff --git a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx index 7435451a3a6..9530c9401da 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQC.cxx @@ -14,6 +14,7 @@ /// \author Daiki Sekihata, daiki.sekihata@cern.ch #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -22,22 +23,26 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.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 diff --git a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx index f35b926e50c..264808e451a 100644 --- a/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/pcmQCMC.cxx @@ -15,6 +15,7 @@ #include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" +#include "PWGEM/PhotonMeson/Core/V0PhotonCandidate.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" #include "PWGEM/PhotonMeson/DataModel/gammaTables.h" @@ -24,24 +25,29 @@ #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.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 @@ -233,9 +239,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/phosQC.cxx b/PWGEM/PhotonMeson/Tasks/phosQC.cxx index f98c5fcfba2..56c7adb50b6 100644 --- a/PWGEM/PhotonMeson/Tasks/phosQC.cxx +++ b/PWGEM/PhotonMeson/Tasks/phosQC.cxx @@ -22,12 +22,12 @@ #include "Common/CCDB/TriggerAliases.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" +#include #include +#include #include #include +#include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx index 7036c3a30de..a1ddbb8f3d7 100644 --- a/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonResoTask.cxx @@ -42,7 +42,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx index 40a6599bb71..43a37569823 100644 --- a/PWGEM/PhotonMeson/Tasks/photonhbt.cxx +++ b/PWGEM/PhotonMeson/Tasks/photonhbt.cxx @@ -16,7 +16,6 @@ #include "PWGEM/Dilepton/Utils/EMTrack.h" #include "PWGEM/Dilepton/Utils/EventMixingHandler.h" -#include "PWGEM/Dilepton/Utils/MCUtilities.h" #include "PWGEM/PhotonMeson/Core/EMPhotonEventCut.h" #include "PWGEM/PhotonMeson/Core/V0PhotonCut.h" #include "PWGEM/PhotonMeson/DataModel/EventTables.h" @@ -40,9 +39,9 @@ #include #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector3Dfwd.h) #include -#include +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include @@ -50,11 +49,13 @@ #include #include #include +#include #include #include #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,32 +100,32 @@ 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 { +static constexpr float kMinMagnitude = 1e-12f; +static constexpr float kMinCosine = 1e-12f; +static constexpr float kMinSigma = 1e-9; + +struct Photonhbt { template static inline V0Combo classifyV0Combo(TGamma const& g) @@ -155,33 +158,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 +200,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,65 +210,88 @@ 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 maxY{"maxY", 0.9, "maximum rapidity"}; - - // ─── Configurables: mixed event ──────────────────────────────────────────── + // ─── HBT analysis mode ─────────────────────────────────────────────────────────── + struct : ConfigurableGroup { + std::string prefix = "hbtanalysis_group"; + Configurable cfgDo3D{"cfgDo3D", false, "enable 3D (qout,qside,qlong) analysis"}; + Configurable cfgDo2D{"cfgDo2D", false, "enable 2D (qout,qinv) projection (requires cfgDo3D)"}; + Configurable cfgUseLCMS{"cfgUseLCMS", false, "measure 1D relative momentum in LCMS"}; + } hbtanalysis; - 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"}; - Configurable cfgEP2EstimatorForMix{"cfgEP2EstimatorForMix", 3, "FT0M:0, FT0A:1, FT0C:2, FV0A:3, BTot:4, BPos:5, BNeg:6"}; - Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; - Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + // ─── Event mixing ───────────────────────────────────────────────────────────── + struct : ConfigurableGroup { + std::string prefix = "mixing_group"; + 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"}; + Configurable cfgEP2EstimatorForMix{"cfgEP2EstimatorForMix", 3, "FT0M:0, FT0A:1, FT0C:2, FV0A:3, BTot:4, BPos:5, BNeg:6"}; + Configurable cfgOccupancyEstimator{"cfgOccupancyEstimator", 0, "FT0C:0, Track:1"}; + Configurable cfgCentEstimator{"cfgCentEstimator", 2, "FT0M:0, FT0A:1, FT0C:2"}; + + ConfigurableAxis confVtxBins{"confVtxBins", {VARIABLE_WIDTH, -10.f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; + ConfigurableAxis confCentBins{"confCentBins", {VARIABLE_WIDTH, 0.f, 5.f, 10.f, 20.f, 30.f, 40.f, 50.f, 60.f, 70.f, 80.f, 90.f, 100.f, 999.f}, "Mixing bins - centrality"}; + ConfigurableAxis confEPBinsBins{"confEPBinsBins", {16, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}, "Mixing bins - EP angle"}; + ConfigurableAxis confOccupancyBins{"confOccupancyBins", {VARIABLE_WIDTH, -1, 1e+10}, "Mixing bins - occupancy"}; + } mixing; + + // ─── Centrality slection ───────────────────────────────────────────────── + struct : ConfigurableGroup { + std::string prefix = "centralitySelection_group"; + Configurable cfgCentMin{"cfgCentMin", -1, "min. centrality"}; + Configurable cfgCentMax{"cfgCentMax", 999, "max. centrality"}; + } centralitySelection; - ConfigurableAxis ConfVtxBins{"ConfVtxBins", {VARIABLE_WIDTH, -10.f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; - ConfigurableAxis ConfCentBins{"ConfCentBins", {VARIABLE_WIDTH, 0.f, 5.f, 10.f, 20.f, 30.f, 40.f, 50.f, 60.f, 70.f, 80.f, 90.f, 100.f, 999.f}, "Mixing bins - centrality"}; - 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"}; + struct : ConfigurableGroup { + std::string prefix = "mctruth_group"; + Configurable cfgMCMaxQinv{"cfgMCMaxQinv", 0.3f, "..."}; + Configurable cfgMCMinKt{"cfgMCMinKt", 0.0f, "..."}; + Configurable cfgMCMaxKt{"cfgMCMaxKt", 0.7f, "..."}; + Configurable cfgDoTruthMix{"cfgDoTruthMix", false, "..."}; + Configurable cfgTruthMixDepth{"cfgTruthMixDepth", 10, "..."}; + Configurable cfgMCMinV0Pt{"cfgMCMinV0Pt", 0.1f, + "min pT for true photons in truth-efficiency loop (GeV/c); " + "0 = fall back to pcmcuts.cfgMinPtV0"}; + Configurable cfgMCMinLegPt{"cfgMCMinLegPt", 0.0f, "min pT for true e^{+}/e^{-} legs in truth-efficiency loop (GeV/c);"}; + } mctruth; - // ─── Configurables: pair cuts ────────────────────────────────────────────── + struct : ConfigurableGroup { + std::string prefix = "mctruthSparse_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"}; + } mctruthSparse; 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"}; + Configurable cfgMaxAsymmetry{"cfgMaxAsymmetry", -1.f, "max |p_{T, 1} - p_{T, 2}|/(p_{T, 1} + p_{T, 2}) asymmetry cut"}; } ggpaircuts; - // ─── Event cut ───────────────────────────────────────────────────────────── - EMPhotonEventCut fEMEventCut; struct : ConfigurableGroup { std::string prefix = "eventcut_group"; @@ -301,8 +318,6 @@ struct photonhbt { Configurable cfgRequireGoodITSLayersAll{"cfgRequireGoodITSLayersAll", false, "all ITS layers OK"}; } eventcuts; - // ─── PCM cut ─────────────────────────────────────────────────────────────── - V0PhotonCut fV0PhotonCut; struct : ConfigurableGroup { std::string prefix = "pcmcut_group"; @@ -330,7 +345,7 @@ struct photonhbt { Configurable cfgMaxTPCNsigmaEl{"cfgMaxTPCNsigmaEl", +3.5, "max TPC nsigma electron"}; } pcmcuts; - ~photonhbt() + ~Photonhbt() { delete emh1; emh1 = nullptr; @@ -338,9 +353,13 @@ struct photonhbt { emh2 = nullptr; mapMixedEventIdToGlobalBC.clear(); usedPhotonIdsPerCol.clear(); + truthGammaPool.clear(); } 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,15 +371,13 @@ 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; - if (sE < 1e-9f || sP < 1e-9f) + if (sE < kMinSigma || sP < kMinSigma) return false; return (deta / sE) * (deta / sE) + (dphi / sP) * (dphi / sP) < ggpaircuts.cfgEllipseR2.value; } @@ -374,6 +391,19 @@ struct photonhbt { return true; } + inline bool passAsymmetryCut(float pt1, float pt2) const + { + if (ggpaircuts.cfgMaxAsymmetry.value < 0.f) { + return true; + } + + const float sum = pt1 + pt2; + if (sum < kMinSigma) { + return false; + } + return std::fabs(pt1 - pt2) / sum < ggpaircuts.cfgMaxAsymmetry.value; + } + inline bool passQinvQAGate(float qinv) const { const float limit = qaflags.cfgMaxQinvForQA.value; @@ -386,6 +416,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) { @@ -395,7 +431,7 @@ struct photonhbt { ROOT::Math::PxPyPzEVector p1cm = boost(p1); ROOT::Math::XYZVector pairDir(pair.Px(), pair.Py(), pair.Pz()); ROOT::Math::XYZVector p1cmDir(p1cm.Px(), p1cm.Py(), p1cm.Pz()); - if (pairDir.R() < 1e-9 || p1cmDir.R() < 1e-9) + if (pairDir.R() < kMinSigma || p1cmDir.R() < kMinSigma) return -1.f; return static_cast(pairDir.Unit().Dot(p1cmDir.Unit())); } @@ -422,11 +458,9 @@ struct photonhbt { const int b = static_cast( std::lower_bound(edges.begin(), edges.end(), val) - edges.begin()) - 1; - return clampBin(b, static_cast(edges.size()) - 2); + 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() { @@ -435,7 +469,7 @@ struct photonhbt { return "Pair/same/QA/Before/"; if constexpr (step_id == 1) return "Pair/same/QA/AfterDRCosOA/"; - if constexpr (step_id == 2) + if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) return "Pair/same/QA/AfterRZ/"; return "Pair/same/QA/AfterEllipse/"; } else { @@ -443,7 +477,7 @@ struct photonhbt { return "Pair/mix/QA/Before/"; if constexpr (step_id == 1) return "Pair/mix/QA/AfterDRCosOA/"; - if constexpr (step_id == 2) + if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) return "Pair/mix/QA/AfterRZ/"; return "Pair/mix/QA/AfterEllipse/"; } @@ -460,27 +494,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); - + parseBins(mixing.confVtxBins, ztxBinEdges); + parseBins(mixing.confCentBins, centBinEdges); + parseBins(mixing.confEPBinsBins, epBinEgdes); + parseBins(mixing.confOccupancyBins, occBinEdges); + emh1 = new MyEMH(mixing.ndepth); + emh2 = new MyEMH(mixing.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 +528,46 @@ 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; }; + struct TruthGamma { + int id = -1, posId = -1, negId = -1; + float eta = 0.f, phi = 0.f, pt = 0.f; + float rTrue = -1.f; + float legDRtrue = -1.f; + float legDEta = 0.f; // ← neu + float legDPhi = 0.f; // ← neu + float alphaTrue = 0.f; + }; + + std::map, std::deque>> truthGammaPool; + 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 + "hEtaVsPhiPt").c_str(), "acceptance;#phi (rad);#eta", kTH3D, {axisPhi, axisEta, axisPt}, true); + fRegistryPairQA.add((path + "hRVsZConvPt").c_str(), "R_{conv} vs z_{conv};z_{conv} (cm);R_{conv} (cm)", kTH3D, {axisZConv, axisR, axisPt}, 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 +577,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 @@ -565,79 +586,42 @@ struct photonhbt { constexpr auto base = fullRangePrefix(); fRegistry.fill(HIST(base) + HIST("hDeltaRCosOAVsQinv"), qinv, drOverCosOA); } - 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); + // Ellipse + fRegistryPairQA.add((path + "hEllipseVal").c_str(), "(#Delta#eta/#sigma)^{2}+(#Delta#phi/#sigma)^{2};value;counts", kTH1D, {axisEllipseVal}, true); + + // Conversion point + fRegistryPairQA.add((path + "hR1VsR2").c_str(), "R_{1} vs R_{2};R_{1} (cm);R_{2} (cm)", kTH2D, {axisR, axisR}, true); + fRegistryPairQA.add((path + "hDeltaRxyKt").c_str(), "#Delta r_{xy} vs k_{T};#Delta r_{xy} (cm);k_{T} (GeV/c)", kTH2D, {axisDeltaRxy, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaR3DKt").c_str(), "#Delta r_{3D} vs k_{T};#Delta r_{3D} (cm);k_{T} (GeV/c)", kTH2D, {axisDeltaR3D, axisKt}, true); + + // Delta Eta QA + fRegistryPairQA.add((path + "hDeltaEtaDeltaRKt").c_str(), "#Delta#eta,|R_{1}-R_{2}|,k_{T}", kTHnSparseD, {axisDeltaEta, axisDeltaR, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaEtaDeltaZKt").c_str(), "#Delta#eta,#Delta z,k_{T}", kTHnSparseD, {axisDeltaEta, axisDeltaZ, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaEtaEtaKt").c_str(), "#Delta#eta,#eta_{pair},k_{T}", kTHnSparseD, {axisDeltaEta, axisEta, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaEtaPhiKt").c_str(), "#Delta#eta,#phi_{pair},k_{T}", kTHnSparseD, {axisDeltaEta, axisPhi, axisKt}, true); + + // Delta Phi QA + fRegistryPairQA.add((path + "hSparseDEtaDPhiKt").c_str(), "#Delta#eta,#Delta#phi,k_{T}", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaPhiDeltaRKt").c_str(), "#Delta#phi,|R_{1}-R_{2}|,k_{T}", kTHnSparseD, {axisDeltaPhi, axisDeltaR, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaPhiDeltaZKt").c_str(), "#Delta#phi,#Delta z,k_{T}", kTHnSparseD, {axisDeltaPhi, axisDeltaZ, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaPhiPhiKt").c_str(), "#Delta#phi,#phi_{pair},k_{T}", kTHnSparseD, {axisDeltaPhi, axisPhi, axisKt}, true); + fRegistryPairQA.add((path + "hDeltaPhiEtaKt").c_str(), "#Delta#phi,#eta_{pair},k_{T}", kTHnSparseD, {axisDeltaPhi, axisEta, axisKt}, true); + + // Delta Eta Delta Phi Diagnostics + fRegistryPairQA.add((path + "hPhiVsEtaKt").c_str(), "#phi_{pair},#eta_{pair},k_{T}", kTHnSparseD, {axisPhi, axisEta, axisKt}, true); + fRegistryPairQA.add((path + "hSparseDeltaRDeltaZKt").c_str(), "|R_{1}-R_{2}|,#Delta z,k_{T}", kTHnSparseD, {axisDeltaR, axisDeltaZ, axisKt}, true); } void addhistograms() { static constexpr std::string_view det[6] = {"FT0M", "FT0A", "FT0C", "BTot", "BPos", "BNeg"}; fRegistry.add("Event/before/hEP2_CentFT0C_forMix", - Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[cfgEP2EstimatorForMix].data()), + Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[mixing.cfgEP2EstimatorForMix].data()), kTH2D, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); fRegistry.add("Event/after/hEP2_CentFT0C_forMix", - Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[cfgEP2EstimatorForMix].data()), + Form("2nd harmonics EP for mix;centrality FT0C (%%);#Psi_{2}^{%s} (rad.)", det[mixing.cfgEP2EstimatorForMix].data()), kTH2D, {{110, 0, 110}, {180, -o2::constants::math::PIHalf, +o2::constants::math::PIHalf}}, false); addSinglePhotonQAHistogramsForStep("SinglePhoton/Before/"); @@ -645,43 +629,54 @@ 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); - } + if (hbtanalysis.cfgDo3D) { + fRegistry.add("Pair/same/CF_3D", "diphoton correlation 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (hbtanalysis.cfgDo2D) + fRegistry.add("Pair/same/CF_2D", "diphoton correlation 2D (qout,qinv)", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); } else { - if (cfgUseLCMS) { + if (hbtanalysis.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); + 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); + fRegistry.add("Pair/same/hSparse_DEtaDPhi_kT", + "same-event (#Delta#eta,#Delta#phi,q_{inv},k_{T}) for efficiency reweighting;" + "#Delta#eta;#Delta#phi (rad);q_{inv} (GeV/c);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + + fRegistry.add("Pair/same/hPhi_lowerPtV0", "azimuthal angle of lower-p_{T} V0 in pair;#phi (rad);counts", kTH1D, {axisPhi}, true); + fRegistry.add("Pair/same/hSparse_DEtaDPhi_qinv_kT", "azimuthal angle of lower-p_{T} V0 in pair;#phi (rad);counts", kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisQinv, axisKt}, 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 ────────────────────────────────────────────────────── + fRegistry.add("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_sameSideV0_sameSideLegs", + "both V0 same #eta-side, all legs same side;" + "#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistry.add("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_sameSideV0_mixedLegs", + "both V0 same #eta-side, legs mixed sides;" + "#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistry.add("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_diffSideV0_matchingLegs", + "V0 on opposite #eta-sides, legs match their V0 side;" + "#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + fRegistry.add("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_diffSideV0_crossedLegs", + "V0 on opposite #eta-sides, legs cross their V0 side;" + "#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEta, axisDeltaPhi, axisKt}, true); + } void DefineEMEventCut() { @@ -704,8 +699,6 @@ struct photonhbt { fEMEventCut.SetRequireGoodITSLayersAll(eventcuts.cfgRequireGoodITSLayersAll); } - // ─── DefinePCMCut ────────────────────────────────────────────────────────── - void DefinePCMCut() { fV0PhotonCut = V0PhotonCut("fV0PhotonCut", "fV0PhotonCut"); @@ -733,7 +726,6 @@ struct photonhbt { fV0PhotonCut.SetRequireTPConly(pcmcuts.cfgRequireV0WithTPCOnly); } - /// step_id: 0 = Before, 1 = AfterDRCosOA, 2 = AfterRZ, 3 = AfterEllipse template static constexpr const char* singlePhotonQAPrefix() { @@ -741,7 +733,7 @@ struct photonhbt { return "SinglePhoton/Before/"; if constexpr (step_id == 1) return "SinglePhoton/AfterDRCosOA/"; - if constexpr (step_id == 2) + if constexpr (step_id == 2) // o2-linter: disable=magic-number (just counting the step of a cut) return "SinglePhoton/AfterRZ/"; return "SinglePhoton/AfterEllipse/"; } @@ -753,13 +745,8 @@ 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("hEtaVsPhiPt"), g.phi(), g.eta(), g.pt()); + fRegistryPairQA.fill(HIST(base) + HIST("hRVsZConvPt"), g.vz(), r, g.pt()); } template @@ -772,11 +759,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,17 +771,23 @@ 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) { + if (hbtanalysis.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 (hbtanalysis.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); + hbtanalysis.cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + } + float deta_pair = v1.Eta() - v2.Eta(); + float dphi_pair = v1.Phi() - v2.Phi(); + dphi_pair = RecoDecay::constrainAngle(dphi_pair, -o2::constants::math::PI); + if constexpr (ev_id == 0) { + fRegistry.fill(HIST("Pair/same/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); + } else { + fRegistry.fill(HIST("Pair/mix/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); } } @@ -806,16 +797,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 +813,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 +840,21 @@ 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); - } + if (hbtanalysis.cfgDo3D) { + fRegistryPairMC.fill(HIST(mcDir) + HIST("CF_3D"), + std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt, weight); + if (hbtanalysis.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"), hbtanalysis.cfgUseLCMS ? qabs_lcms : qinv, kt, weight); + } + float deta_pair = v1.Eta() - v2.Eta(); + float dphi_pair = v1.Phi() - v2.Phi(); + dphi_pair = RecoDecay::constrainAngle(dphi_pair, -o2::constants::math::PI); + if constexpr (ev_id == 0) { + fRegistry.fill(HIST("Pair/same/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); + } else { + fRegistry.fill(HIST("Pair/mix/hSparse_DEtaDPhi_qinv_kT"), deta_pair, dphi_pair, qinv, kt, weight); } } @@ -871,31 +862,24 @@ 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()); - if (mag1 < 1e-12f || mag2 < 1e-12f) { + 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 < kMinMagnitude || mag2 < kMinMagnitude) { o.valid = false; return o; } @@ -906,175 +890,168 @@ struct photonhbt { if (o.opa > o2::constants::math::PI) 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.drOverCosOA = (std::fabs(o.cosOA) < kMinCosine) ? 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; } template - inline void fillPairQAStep(PairQAObservables const& o, float cent, float occupancy) + inline void fillPairQAStep(PairQAObservables const& o, float /*cent*/, float /*occupancy*/) { 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); - } + ///// Delta Eta QA + + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaDeltaRKt"), o.deta, o.deltaR, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaEtaKt"), o.deta, o.pairEta, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaPhiKt"), o.deta, o.pairPhi, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaEtaDeltaZKt"), o.deta, o.deltaZ, o.kt); + + ///// Delta Phi QA + + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiDeltaRKt"), o.dphi, o.deltaR, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiDeltaZKt"), o.dphi, o.deltaZ, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hSparseDEtaDPhiKt"), o.deta, o.dphi, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaPhiPhiKt"), o.dphi, o.pairPhi, o.kt); + + // Delta Eta Dleta Phi Stuff - // 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("hDeltaPhiEtaKt"), o.dphi, o.pairEta, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hPhiVsEtaKt"), o.pairPhi, o.pairEta, o.kt); + + //// Delta R (Conversion point) QA + + fRegistryPairQA.fill(HIST(base) + HIST("hR1VsR2"), o.r1, o.r2); + fRegistryPairQA.fill(HIST(base) + HIST("hSparseDeltaRDeltaZKt"), o.deltaR, o.deltaZ, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaRxyKt"), o.deltaRxy, o.kt); + fRegistryPairQA.fill(HIST(base) + HIST("hDeltaR3DKt"), o.deltaR3D, o.kt); + + const float sE = ggpaircuts.cfgEllipseSigEta.value, sP = ggpaircuts.cfgEllipseSigPhi.value; + if (sE > kMinSigma && sP > kMinSigma) + fRegistryPairQA.fill(HIST(base) + HIST("hEllipseVal"), (o.deta / sE) * (o.deta / sE) + (o.dphi / sP) * (o.dphi / sP)); } 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.isTruePhoton = (info.motherPdg == kGamma); 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; } + enum class EtaTopology : uint8_t { + SameSideV0SameSideLegs = 0, ///< both V0 eta same sign; all 4 legs same sign + SameSideV0MixedLegs = 1, ///< both V0 eta same sign; legs not all on that sign + DiffSideV0MatchingLegs = 2, ///< V0s on opposite sides; each V0's legs match its own side + DiffSideV0CrossedLegs = 3, ///< V0s on opposite sides; legs do NOT match their V0's side + }; + + /// Classify the eta-side topology of a photon pair from the 6 raw eta values. + static EtaTopology classifyEtaTopology(float v1eta, float v2eta, + float pos1eta, float neg1eta, + float pos2eta, float neg2eta) + { + const bool v1pos = v1eta >= 0.f; + const bool v2pos = v2eta >= 0.f; + if (v1pos == v2pos) { // same-side V0s + const bool allSame = + ((pos1eta >= 0.f) == v1pos) && ((neg1eta >= 0.f) == v1pos) && + ((pos2eta >= 0.f) == v1pos) && ((neg2eta >= 0.f) == v1pos); + return allSame ? EtaTopology::SameSideV0SameSideLegs + : EtaTopology::SameSideV0MixedLegs; + } + // different-side V0s + const bool v1match = ((pos1eta >= 0.f) == v1pos) && ((neg1eta >= 0.f) == v1pos); + const bool v2match = ((pos2eta >= 0.f) == v2pos) && ((neg2eta >= 0.f) == v2pos); + return (v1match && v2match) ? EtaTopology::DiffSideV0MatchingLegs + : EtaTopology::DiffSideV0CrossedLegs; + } + + inline void fillEtaTopologyHisto(EtaTopology topo, float deta, float dphi, float kt) + { + switch (topo) { + case EtaTopology::SameSideV0SameSideLegs: + fRegistry.fill(HIST("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_sameSideV0_sameSideLegs"), + deta, dphi, kt); + break; + case EtaTopology::SameSideV0MixedLegs: + fRegistry.fill(HIST("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_sameSideV0_mixedLegs"), + deta, dphi, kt); + break; + case EtaTopology::DiffSideV0MatchingLegs: + fRegistry.fill(HIST("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_diffSideV0_matchingLegs"), + deta, dphi, kt); + break; + case EtaTopology::DiffSideV0CrossedLegs: + fRegistry.fill(HIST("Pair/same/EtaTopology/hSparse_DEtaDPhi_kT_diffSideV0_crossedLegs"), + deta, dphi, kt); + break; + } + } + 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) + if (!m1.isTruePhoton || !m2.isTruePhoton || m1.motherId < 0 || m2.motherId < 0) return false; - if (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); + return (std::abs(mcParticles.iteratorAt(gm1).pdgCode()) == kPi0); } static constexpr std::string_view pairTruthLabel(PairTruthType t) @@ -1096,56 +1073,233 @@ struct photonhbt { return "Unknown/"; } } - 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)"}; + const AxisSpec axQinvMC{60, 0.f, 0.3f, "q_{inv}^{true} (GeV/c)"}; + const AxisSpec axRconv{180, 0.f, 90.f, "R_{conv}^{true} (cm)"}; + const AxisSpec axAlpha{100, -1.f, 1.f, "#alpha^{true}"}; + const AxisSpec axLegDR{100, 0.f, 0.3f, "leg #Delta R^{true}"}; + + // fRegistryPairMC — reco-level pair histograms, per MC truth type + + // Per-type CF + observables 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); - } + // CF + if (hbtanalysis.cfgDo3D) { + fRegistryPairMC.add((base + "CF_3D").c_str(), "MC CF 3D LCMS", + kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (hbtanalysis.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); - } + fRegistryPairMC.add((base + "CF_1D").c_str(), + hbtanalysis.cfgUseLCMS ? "MC CF 1D LCMS" : "MC CF 1D (qinv)", + kTH2D, {hbtanalysis.cfgUseLCMS ? axisQabsLcms : axisQinv, axisKt}, 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); + // 1D observables + fRegistryPairMC.add((base + "hQinv").c_str(), "q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, 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); + + // 2D observables + fRegistryPairMC.add((base + "hDEtaDPhi").c_str(), "#Delta#eta vs #Delta#phi", kTH2D, {axisDeltaEta, axisDeltaPhi}, 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); + + // Sparse (conditional) + fRegistryPairMC.add((base + "hSparse_DEtaDPhi_kT").c_str(), + "#Delta#eta,#Delta#phi,k_{T};#Delta#eta;#Delta#phi (rad);k_{T} (GeV/c)", + kTHnSparseD, {axisDeltaEtaMC, axisDeltaPhiMC, axisKt}, true); + + const bool addDEtaDPhiVsQinv = + (label == "TrueTrueDistinct/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value + : (label == "TrueTrueSamePhoton/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value + : (label == "SharedMcLeg/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value + : (label == "TrueFake/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueFake.value + : (label == "FakeFake/") ? mctruthSparse.cfgFillDEtaDPhiVsQinvFakeFake.value + : mctruthSparse.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/") ? mctruthSparse.cfgFillDRDZQinvTrueTrueDistinct.value + : (label == "TrueTrueSamePhoton/") ? mctruthSparse.cfgFillDRDZQinvTrueTrueSamePhoton.value + : (label == "SharedMcLeg/") ? mctruthSparse.cfgFillDRDZQinvSharedMcLeg.value + : (label == "TrueFake/") ? mctruthSparse.cfgFillDRDZQinvTrueFake.value + : (label == "FakeFake/") ? mctruthSparse.cfgFillDRDZQinvFakeFake.value + : mctruthSparse.cfgFillDRDZQinvPi0Daughters.value; + if (addDRDZQinv) + fRegistryPairMC.add((base + "hSparseDeltaRDeltaZQinv").c_str(), + "|R_{1}-R_{2}|,#Delta z,q_{inv}", kTHnSparseD, + {axisDeltaR, axisDeltaZ, axisQinv}, 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); + 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); + + fRegistryPairMC.add("Pair/same/MC/hDEtaDPhi_truePairs", + "true reco pairs (TrueTrueDistinct+SamePhoton+Pi0);" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryPairMC.add("Pair/same/MC/hDEtaDPhi_fakePairs", + "fake reco pairs (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", + "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_kT_fakePairs", + "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_truePairs", + "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_qinv_fakePairs", + "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); + + // ─── Pairs with missing MC label ───────────────────────────────────────── + if (hbtanalysis.cfgDo3D) { + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_3D", + "missing MC label — CF 3D LCMS", kTHnSparseD, {axisQout, axisQside, axisQlong, axisKt}, true); + if (hbtanalysis.cfgDo2D) + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_2D", + "missing MC label — CF 2D", kTHnSparseD, {axisQout, axisQinv, axisKt}, true); + } else { + fRegistryPairMC.add("Pair/same/MC/NoLabel/CF_1D", + hbtanalysis.cfgUseLCMS ? "missing MC label — CF 1D LCMS" : "missing MC label — CF 1D (qinv)", + kTH2D, {hbtanalysis.cfgUseLCMS ? axisQabsLcms : axisQinv, axisKt}, true); + } + fRegistryPairMC.add("Pair/same/MC/NoLabel/hDEtaDPhi", + "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/hQinv", + "missing MC label: q_{inv};q_{inv} (GeV/c);counts", kTH1D, {axisQinv}, true); + fRegistryPairMC.add("Pair/same/MC/NoLabel/hKt", + "missing MC label: k_{T};k_{T} (GeV/c);counts", kTH1D, {axisKt}, true); + + // fRegistryMC — truth-level histograms + + // ─── Truth-level CF + fRegistryMC.add("MC/TruthCF/hQinvVsKt_same", "truth-level same-event CF;k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthCF/hDEtaDPhi_same", + "truth-level same-event #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + fRegistryMC.add("MC/TruthCF/hQinvVsKt_mix", "truth-level mixed-event CF;k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", kTH2D, {axisKt, axQinvMC}, true); + fRegistryMC.add("MC/TruthCF/hDEtaDPhi_mix", + "truth-level mixed-event #Delta#eta vs #Delta#phi;" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + kTH2D, {axisDeltaEta, axisDeltaPhi}, true); + + auto addStageHistos = [&](const char* suffix, const char* title, auto... axes) { + for (const auto& stage : {"truthConverted", "all4LegsThisColl", + "bothPhotonsBuilt", "bothPhotonsSelected"}) { + const std::string name = std::string("MC/TruthAO2D/") + suffix + std::string("_") + stage; + const std::string ttl = std::string(title) + std::string(" [") + stage + "]"; + fRegistryMC.add(name.c_str(), ttl.c_str(), kTHnD, {axes...}, true); + } + }; + auto addStageHistos2D = [&](const char* suffix, const char* title, auto ax1, auto ax2) { + for (const auto& stage : {"truthConverted", "all4LegsThisColl", + "bothPhotonsBuilt", "bothPhotonsSelected"}) { + const std::string name = std::string("MC/TruthAO2D/") + suffix + std::string("_") + stage; + fRegistryMC.add(name.c_str(), title, kTH2D, {ax1, ax2}, true); + } + }; + + addStageHistos("hSparse_DEtaDPhi_qinv", + "#Delta#eta,#Delta#phi,q_{inv}^{true};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);q_{inv}^{true} (GeV/c)", + axisDeltaEta, axisDeltaPhi, axQinvMC); + + addStageHistos("hSparse_DEtaDPhi_kT", + "#Delta#eta,#Delta#phi,k_{T};" + "#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad);k_{T} (GeV/c)", + axisDeltaEta, axisDeltaPhi, axisKt); + + addStageHistos2D("hQinvVsKt", + "q_{inv}^{true} vs k_{T};k_{T} (GeV/c);q_{inv}^{true} (GeV/c)", + axisKt, axQinvMC); + + addStageHistos2D("hDEtaDPhi", + "#Delta#eta vs #Delta#phi;#Delta#eta_{#gamma#gamma};#Delta#phi_{#gamma#gamma} (rad)", + axisDeltaEta, axisDeltaPhi); + + // Rconv waterfall (nur converted + selected) + fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_truthConverted", + "denominator: R_{conv,1} vs R_{conv,2};R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", + kTH2D, {axRconv, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hRconv1_vs_Rconv2_bothPhotonsSelected", + "numerator: R_{conv,1} vs R_{conv,2};R_{conv,1}^{true} (cm);R_{conv,2}^{true} (cm)", + kTH2D, {axRconv, axRconv}, true); + fRegistryMC.add("MC/TruthAO2D/hMinRconv_vs_kT_truthConverted", + "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", + "numerator: min(R_{conv}) vs k_{T};k_{T} (GeV/c);min(R_{conv}^{true}) (cm)", + kTH2D, {axisKt, axRconv}, true); + + // Stage waterfall summary + consistency + fRegistryMC.add("MC/TruthAO2D/hStage_vs_kT", + "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 (expect all at 0);N(V0 built but legs not found);counts", + kTH1D, {AxisSpec{20, -0.5f, 19.5f, "N_{bad}"}}, true); + + // ─── Single-leg diagnostics ─────────────────────────────────────────────── + fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legFound", "leg found: #Delta R^{true} vs p_{T};p_{T,#gamma}^{true} (GeV/c);#Delta R_{e^{+}e^{-}}^{true}", kTH2D, {axisPt, axLegDR}, true); + fRegistryMC.add("MC/LegDiag/hLegDRtrue_vs_pt_legMissing", "leg missing: #Delta R^{true} vs p_{T};p_{T,#gamma}^{true} (GeV/c);#Delta R_{e^{+}e^{-}}^{true}", kTH2D, {axisPt, axLegDR}, true); + fRegistryMC.add("MC/LegDiag/hLegDEta_legFound_vs_pt", "leg found: |#Delta#eta| vs p_{T};p_{T,#gamma}^{true} (GeV/c);|#Delta#eta_{e^{+}e^{-}}|", kTH2D, {axisPt, AxisSpec{100, 0.f, 0.5f, "|#Delta#eta_{legs}|"}}, true); + fRegistryMC.add("MC/LegDiag/hLegDEta_legMissing_vs_pt", "leg missing: |#Delta#eta| vs p_{T};p_{T,#gamma}^{true} (GeV/c);|#Delta#eta_{e^{+}e^{-}}|", kTH2D, {axisPt, AxisSpec{100, 0.f, 0.5f, "|#Delta#eta_{legs}|"}}, true); + fRegistryMC.add("MC/LegDiag/hLegDPhi_legFound_vs_pt", "leg found: |#Delta#phi| vs p_{T};p_{T,#gamma}^{true} (GeV/c);|#Delta#phi_{e^{+}e^{-}}| (rad)", kTH2D, {axisPt, AxisSpec{100, 0.f, 0.5f, "|#Delta#phi_{legs}|"}}, true); + fRegistryMC.add("MC/LegDiag/hLegDPhi_legMissing_vs_pt", "leg missing: |#Delta#phi| vs p_{T};p_{T,#gamma}^{true} (GeV/c);|#Delta#phi_{e^{+}e^{-}}| (rad)", kTH2D, {axisPt, AxisSpec{100, 0.f, 0.5f, "|#Delta#phi_{legs}|"}}, true); + fRegistryMC.add("MC/LegDiag/hAlphaTrue_legFound_vs_pt", "leg found: #alpha^{true} vs p_{T};p_{T,#gamma}^{true} (GeV/c);#alpha^{true}", kTH2D, {axisPt, axAlpha}, true); + fRegistryMC.add("MC/LegDiag/hAlphaTrue_legMissing_vs_pt", "leg missing: #alpha^{true} vs p_{T};p_{T,#gamma}^{true} (GeV/c);#alpha^{true}", kTH2D, {axisPt, axAlpha}, true); + fRegistryMC.add("MC/LegDiag/hAlpha_vs_legDR_legMissing", "leg missing: #alpha^{true} vs #Delta R^{true};#Delta R_{e^{+}e^{-}}^{true};#alpha^{true}", kTH2D, {axLegDR, axAlpha}, true); + + // ─── Pair-level leg diagnostics ─────────────────────────────────────────── + fRegistryMC.add("MC/LegDiag/hNLegsPair_vs_kT", "N legs found per pair vs k_{T};k_{T} (GeV/c);N_{legs found} (0-4)", kTH2D, {axisKt, AxisSpec{5, -0.5f, 4.5f, "N_{legs found}"}}, true); + fRegistryMC.add("MC/LegDiag/hMissingLegPt_vs_kT", "missing leg p_{T}^{true} 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", "missing leg R_{conv}^{true} vs pair k_{T};k_{T} (GeV/c);R_{conv}^{true} (cm)", kTH2D, {axisKt, axisR}, true); + + // ─── Cross-built V0 pairs ───────────────────────────────────────────────── + fRegistryMC.add("MC/PairCrossBuild/hSparse_DEtaDPhi_kT", + "cross-built V0 pairs: #Delta#eta,#Delta#phi,k_{T};" + "#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: N correctly built vs k_{T};" + "k_{T} (GeV/c);N photons correctly built (0/1/2)", + kTH2D, {axisKt, AxisSpec{3, -0.5f, 2.5f, "N correctly built"}}, 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 +1328,43 @@ 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("hDeltaR"), obs.deltaR); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaZ"), obs.deltaZ); + fRegistryPairMC.fill(HIST(base) + HIST("hDeltaR3D"), obs.deltaR3D); + } + 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 +1401,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) ? mctruthSparse.cfgFillDRDZQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mctruthSparse.cfgFillDRDZQinvTrueTrueSamePhoton.value + : (TruthT == PairTruthType::SharedMcLeg) ? mctruthSparse.cfgFillDRDZQinvSharedMcLeg.value + : (TruthT == PairTruthType::TrueFake) ? mctruthSparse.cfgFillDRDZQinvTrueFake.value + : (TruthT == PairTruthType::FakeFake) ? mctruthSparse.cfgFillDRDZQinvFakeFake.value + : mctruthSparse.cfgFillDRDZQinvPi0Daughters.value); + if (fillDRDZ) + fRegistryPairMC.fill(HIST(base) + HIST("hSparseDeltaRDeltaZQinv"), obs.deltaR, obs.deltaZ, obs.qinv); + const bool enabled = ((TruthT == PairTruthType::TrueTrueDistinct) ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueTrueDistinct.value : (TruthT == PairTruthType::TrueTrueSamePhoton) ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueTrueSamePhoton.value + : (TruthT == PairTruthType::SharedMcLeg) ? mctruthSparse.cfgFillDEtaDPhiVsQinvSharedMcLeg.value + : (TruthT == PairTruthType::TrueFake) ? mctruthSparse.cfgFillDEtaDPhiVsQinvTrueFake.value + : (TruthT == PairTruthType::FakeFake) ? mctruthSparse.cfgFillDEtaDPhiVsQinvFakeFake.value + : mctruthSparse.cfgFillDEtaDPhiVsQinvPi0Daughters.value); + if (enabled) + fRegistryPairMC.fill(HIST(base) + HIST("hDEtaDPhiVsQinv"), obs.deta, obs.dphi, obs.qinv); } template @@ -1281,6 +1446,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 (hbtanalysis.cfgDo3D) { + fRegistryPairMC.fill(HIST("Pair/same/MC/NoLabel/CF_3D"), + std::fabs(qout_lcms), std::fabs(qside_lcms), std::fabs(qlong_lcms), kt); + if (hbtanalysis.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"), hbtanalysis.cfgUseLCMS ? qabs_lcms : qinv, kt); + } + } template 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 ──────────────────────────────────────────── + const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + const float ep2 = epArr[mixing.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); - - // ── Event mixing bins ───────────────────────────────────────────────── - const float occupancy = (cfgOccupancyEstimator == 1) + const float occupancy = (mixing.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 float centForQA = cent[mixing.cfgCentEstimator]; + 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; + if (!passAsymmetryCut(g1.pt(), g2.pt())) 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++; - + fRegistry.fill(HIST("Pair/same/hPhi_lowerPtV0"), + (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); + + fillEtaTopologyHisto( + classifyEtaTopology(g1.eta(), g2.eta(), + pos1.eta(), ele1.eta(), + pos2.eta(), ele2.eta()), + obs.deta, obs.dphi, obs.kt); auto addToPool = [&](auto const& g) { if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); @@ -1426,307 +1580,218 @@ struct photonhbt { }; 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 (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) + if (!mixing.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) + if (diffBC < mixing.ndiffBCMix) continue; - auto poolPhotons = emh1->GetTracksPerCollision(mixID); - - for (const auto& g1 : selectedPhotons) { + for (const auto& g1 : selectedPhotons) for (const auto& g2 : poolPhotons) { - + if (!passAsymmetryCut(g1.pt(), g2.pt())) + 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<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); + fRegistry.fill(HIST("Pair/mix/hPhi_lowerPtV0"), + (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); } - } - } // 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]) + if (cent[mixing.cfgCentEstimator] < centralitySelection.cfgCentMin || centralitySelection.cfgCentMax < cent[mixing.cfgCentEstimator]) continue; - - const std::array epArr = { - collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), - collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; - const float ep2 = epArr[cfgEP2EstimatorForMix]; - + const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), collision.ep2bneg()}; + const float ep2 = epArr[mixing.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) + const float occupancy = (mixing.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 float centForQA = cent[mixing.cfgCentEstimator]; + 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; - + if (!passAsymmetryCut(g1.pt(), g2.pt())) + continue; 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); + fRegistry.fill(HIST("Pair/same/hPhi_lowerPtV0"), + (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); + + fillEtaTopologyHisto( + classifyEtaTopology(g1.eta(), g2.eta(), + pos1.eta(), ele1.eta(), + pos2.eta(), ele2.eta()), + obs.deta, obs.dphi, obs.kt); 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) { @@ -1738,51 +1803,49 @@ struct photonhbt { }; 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 (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) + if (!mixing.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) + if (diffBC < mixing.ndiffBCMix) continue; - auto poolPhotons = emh1->GetTracksPerCollision(mixID); - for (const auto& g1 : selectedPhotons) { + for (const auto& g1 : selectedPhotons) for (const auto& g2 : poolPhotons) { + if (!passAsymmetryCut(g1.pt(), g2.pt())) + continue; 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,37 +1860,450 @@ 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); + fRegistry.fill(HIST("Pair/mix/hPhi_lowerPtV0"), + (g1.pt() < g2.pt()) ? g1.phi() : g2.phi()); } - } } - if (ndiphoton > 0) { emh1->AddCollisionIdAtLast(keyBin, keyDFCollision); emh2->AddCollisionIdAtLast(keyBin, keyDFCollision); mapMixedEventIdToGlobalBC[keyDFCollision] = collision.globalBC(); } + } + } + 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[mixing.cfgCentEstimator] < centralitySelection.cfgCentMin || + centralitySelection.cfgCentMax < cent[mixing.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(); + if (pos.collisionId() != thisCollisionId || neg.collisionId() != thisCollisionId) + 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() == kGamma && negMother.pdgCode() == kGamma) { + crossBuildMap[posMotherId].insert(negMotherId); + crossBuildMap[negMotherId].insert(posMotherId); + } + continue; + } + const int gammaId = posMotherId; + if (emmcParticles.iteratorAt(gammaId).pdgCode() != kGamma) + continue; + const bool passes = cut.template IsSelected, TLegs>(g); + auto& info = gammaRecoMap[gammaId]; + info.hasV0 = true; + info.passesCut = info.passesCut || passes; + } + + // ─── Build true gamma list ──────────────────────────────────────────────── + std::vector trueGammas; + trueGammas.reserve(32); + + for (const auto& g : emmcPartsColl) { + if (g.pdgCode() != kGamma) + continue; + if (!g.isPhysicalPrimary() && !g.producedByGenerator()) + continue; + if (std::fabs(g.eta()) > pcmcuts.cfgMaxEtaV0.value) + continue; + const float mcV0PtMin = (mctruth.cfgMCMinV0Pt.value > 0.f) + ? mctruth.cfgMCMinV0Pt.value + : pcmcuts.cfgMinPtV0.value; + if (g.pt() < mcV0PtMin) + continue; + if (!g.has_daughters()) + continue; + + int posId = -1, negId = -1; + float rTrue = -1.f; + for (const auto& dId : g.daughtersIds()) { + if (dId < 0) { + continue; + } + const auto d = emmcParticles.iteratorAt(dId); + if (d.pdgCode() == kElectron) { + posId = dId; + rTrue = std::sqrt(d.vx() * d.vx() + d.vy() * d.vy()); + } else if (d.pdgCode() == kPositron) { + negId = dId; + } + } + if (posId < 0 || negId < 0) { + continue; + } + + const auto mcPosE = emmcParticles.iteratorAt(posId); + const auto mcNegE = emmcParticles.iteratorAt(negId); + + if (mctruth.cfgMCMinLegPt.value > 0.f && + (static_cast(mcPosE.pt()) < mctruth.cfgMCMinLegPt.value || + static_cast(mcNegE.pt()) < mctruth.cfgMCMinLegPt.value)) + continue; + + 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); + + const float pxG = static_cast(g.px()), pyG = static_cast(g.py()), + pzG = static_cast(g.pz()); + const float magG = std::sqrt(pxG * pxG + pyG * pyG + pzG * pzG); + float alphaTrue = 0.f; + if (magG > kMinSigma) { + const float ux = pxG / magG, uy = pyG / magG, uz = pzG / magG; + const float pLpos = static_cast(mcPosE.px()) * ux + + static_cast(mcPosE.py()) * uy + + static_cast(mcPosE.pz()) * uz; + const float pLneg = static_cast(mcNegE.px()) * ux + + static_cast(mcNegE.py()) * uy + + static_cast(mcNegE.pz()) * uz; + const float sumPL = pLpos + pLneg; + if (std::fabs(sumPL) > kMinSigma) + alphaTrue = (pLpos - pLneg) / sumPL; + } + + trueGammas.push_back({static_cast(g.globalIndex()), posId, negId, + static_cast(g.eta()), static_cast(g.phi()), + static_cast(g.pt()), rTrue, legDRt, + deTrE, + dpTrE, + alphaTrue}); + } + + { + 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; + const bool bothFound = posFound && negFound; + + 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); + fRegistryMC.fill(HIST("MC/LegDiag/hLegDEta_legFound_vs_pt"), tg.pt, std::fabs(tg.legDEta)); + fRegistryMC.fill(HIST("MC/LegDiag/hLegDPhi_legFound_vs_pt"), tg.pt, std::fabs(tg.legDPhi)); + } else { + fRegistryMC.fill(HIST("MC/LegDiag/hLegDRtrue_vs_pt_legMissing"), tg.pt, tg.legDRtrue); + fRegistryMC.fill(HIST("MC/LegDiag/hLegDEta_legMissing_vs_pt"), tg.pt, std::fabs(tg.legDEta)); + fRegistryMC.fill(HIST("MC/LegDiag/hLegDPhi_legMissing_vs_pt"), tg.pt, std::fabs(tg.legDPhi)); + } + } + + // ─── Armenteros-α diagnostics per photon ───────────────────────────── + if (bothFound) { + fRegistryMC.fill(HIST("MC/LegDiag/hAlphaTrue_legFound_vs_pt"), tg.pt, tg.alphaTrue); + } else { + // At least one leg missing + fRegistryMC.fill(HIST("MC/LegDiag/hAlphaTrue_legMissing_vs_pt"), tg.pt, tg.alphaTrue); + fRegistryMC.fill(HIST("MC/LegDiag/hAlpha_vs_legDR_legMissing"), tg.legDRtrue, tg.alphaTrue); + } + } + + // ─── Pair loop: efficiency ───────────────────────────────────── + 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 (mctruth.cfgMCMinKt > 0.f && kt < mctruth.cfgMCMinKt) + continue; + if (mctruth.cfgMCMaxKt > 0.f && kt > mctruth.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 (mctruth.cfgMCMaxQinv > 0.f && qinv_true > mctruth.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); + } + } + } + + // ─── Truth-level CF mixing ──────────────────────────────────────────────── + if (mctruth.cfgDoTruthMix.value) { + 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]; + if (!passAsymmetryCut(g1.pt, g2.pt)) + continue; + 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)); + 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)); + fRegistryMC.fill(HIST("MC/TruthCF/hQinvVsKt_same"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthCF/hDEtaDPhi_same"), deta, dphi); + } + } + + const float centForBin = cent[mixing.cfgCentEstimator.value]; + const std::array epArr = {collision.ep2ft0m(), collision.ep2ft0a(), collision.ep2ft0c(), + collision.ep2fv0a(), collision.ep2btot(), collision.ep2bpos(), + collision.ep2bneg()}; + const float ep2 = epArr[mixing.cfgEP2EstimatorForMix.value]; + const float occupancy = (mixing.cfgOccupancyEstimator.value == 1) + ? static_cast(collision.trackOccupancyInTimeRange()) + : collision.ft0cOccupancyInTimeRange(); + auto keyBin = std::make_tuple(binOf(ztxBinEdges, collision.posZ()), + binOf(centBinEdges, centForBin), + binOf(epBinEgdes, ep2), + binOf(occBinEdges, occupancy)); + + if (truthGammaPool.count(keyBin)) { + for (const auto& poolEvent : truthGammaPool[keyBin]) { + for (const auto& g1 : trueGammas) { + for (const auto& g2 : poolEvent) { + if (!passAsymmetryCut(g1.pt, g2.pt)) + continue; + 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)); + 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)); + fRegistryMC.fill(HIST("MC/TruthCF/hQinvVsKt_mix"), kt, qinv_true); + fRegistryMC.fill(HIST("MC/TruthCF/hDEtaDPhi_mix"), deta, dphi); + } + } + } + } + + if (!trueGammas.empty()) { + auto& poolBin = truthGammaPool[keyBin]; + poolBin.push_back(trueGammas); + if (static_cast(poolBin.size()) > mctruth.cfgTruthMixDepth.value) + poolBin.pop_front(); + } + } // end cfgDoTruthMix } // end collision loop + } // end runTruthEfficiency + + 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 = + (centralitySelection.cfgCentMin < o2::aod::cent::centFT0M && o2::aod::cent::centFT0M < centralitySelection.cfgCentMax) || + (centralitySelection.cfgCentMin < o2::aod::cent::centFT0A && o2::aod::cent::centFT0A < centralitySelection.cfgCentMax) || + (centralitySelection.cfgCentMin < o2::aod::cent::centFT0C && o2::aod::cent::centFT0C < centralitySelection.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"})}; + return WorkflowSpec{adaptAnalysisTask(cfgc)}; } diff --git a/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx b/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx index 996ce6abdda..4072a74e096 100644 --- a/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx +++ b/PWGEM/PhotonMeson/Tasks/prefilterPhoton.cxx @@ -44,7 +44,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx index ca6e5a02503..a6a6375cb4c 100644 --- a/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx +++ b/PWGEM/PhotonMeson/Tasks/taskPi0FlowEMC.cxx @@ -50,7 +50,7 @@ #include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include #include diff --git a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h index cc3f938e17d..dbaeebaf1a7 100644 --- a/PWGEM/PhotonMeson/Utils/ClusterHistograms.h +++ b/PWGEM/PhotonMeson/Utils/ClusterHistograms.h @@ -26,6 +26,7 @@ #include #include +#include namespace o2::aod::pwgem::photonmeson::utils::clusterhistogram { diff --git a/PWGEM/PhotonMeson/Utils/EventHistograms.h b/PWGEM/PhotonMeson/Utils/EventHistograms.h index e45409dda9e..dd4c3ca4ac6 100644 --- a/PWGEM/PhotonMeson/Utils/EventHistograms.h +++ b/PWGEM/PhotonMeson/Utils/EventHistograms.h @@ -19,6 +19,7 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" +#include #include #include @@ -28,10 +29,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 +67,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 +84,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/PWGEM/PhotonMeson/Utils/HNMUtilities.h b/PWGEM/PhotonMeson/Utils/HNMUtilities.h index 2df0680a76c..956529610a0 100644 --- a/PWGEM/PhotonMeson/Utils/HNMUtilities.h +++ b/PWGEM/PhotonMeson/Utils/HNMUtilities.h @@ -23,9 +23,10 @@ #include "PWGEM/PhotonMeson/Utils/PairUtilities.h" #include +#include #include -#include // IWYU pragma: keep +#include // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) #include #include diff --git a/PWGEM/PhotonMeson/Utils/NMHistograms.h b/PWGEM/PhotonMeson/Utils/NMHistograms.h index 03c3dcc3f89..6eb784df2cf 100644 --- a/PWGEM/PhotonMeson/Utils/NMHistograms.h +++ b/PWGEM/PhotonMeson/Utils/NMHistograms.h @@ -18,6 +18,7 @@ #include "PWGEM/PhotonMeson/Utils/MCUtilities.h" +#include #include #include diff --git a/PWGEM/PhotonMeson/Utils/PairUtilities.h b/PWGEM/PhotonMeson/Utils/PairUtilities.h index 8110239c0ce..8a1ff20de88 100644 --- a/PWGEM/PhotonMeson/Utils/PairUtilities.h +++ b/PWGEM/PhotonMeson/Utils/PairUtilities.h @@ -15,7 +15,7 @@ #ifndef PWGEM_PHOTONMESON_UTILS_PAIRUTILITIES_H_ #define PWGEM_PHOTONMESON_UTILS_PAIRUTILITIES_H_ -#include +#include "Common/Core/RecoDecay.h" #include #include diff --git a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h index 2eb11525278..0ef33364c80 100644 --- a/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h +++ b/PWGEM/PhotonMeson/Utils/gammaConvDefinitions.h @@ -19,28 +19,26 @@ #include #include -using namespace o2::framework; +o2::framework::AxisSpec const gAxis_zColl{800, -50.f, 50.f}; +o2::framework::AxisSpec const gAxis_pT{800, 0.f, 25.f}; +o2::framework::AxisSpec const gAxis_pT_armenteros{400, 0.f, 1.f}; +o2::framework::AxisSpec const gAxis_pT2d{400, 0.f, 25.f}; +o2::framework::AxisSpec const gAxis_eta{800, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; +o2::framework::AxisSpec const gAxis_eta2d{400, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; +o2::framework::AxisSpec const gAxis_phi{800, 0.f, o2::constants::math::TwoPI}; +o2::framework::AxisSpec const gAxis_r{800, 0.f, 200.f}; +o2::framework::AxisSpec const gAxis_r_extended{800, 0.f, 500.f}; +o2::framework::AxisSpec const gAxis_dr{200, -100.f, 100.f}; +o2::framework::AxisSpec const gAxis_r2d{400, 0.f, 250.f}; +o2::framework::AxisSpec const gAxis_z2d{1000, -250.f, 250.f}; +o2::framework::AxisSpec const gAxis_TPCdEdxSig{401, -10.025f, 10.025f}; +o2::framework::AxisSpec const gAxis_radRes{800, -o2::constants::math::PI, o2::constants::math::PI}; +o2::framework::AxisSpec const gAxis_xyz{2400, -300.f, 300.f}; +o2::framework::AxisSpec const gAxis_chi2{501, -1.f, 500.f}; +o2::framework::AxisSpec gAxis_pT_log{800, 0.01f, 25.f}; -AxisSpec const gAxis_zColl{800, -50.f, 50.f}; -AxisSpec const gAxis_pT{800, 0.f, 25.f}; -AxisSpec const gAxis_pT_armenteros{400, 0.f, 1.f}; -AxisSpec const gAxis_pT2d{400, 0.f, 25.f}; -AxisSpec const gAxis_eta{800, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; -AxisSpec const gAxis_eta2d{400, -o2::constants::math::PIHalf, o2::constants::math::PIHalf}; -AxisSpec const gAxis_phi{800, 0.f, o2::constants::math::TwoPI}; -AxisSpec const gAxis_r{800, 0.f, 200.f}; -AxisSpec const gAxis_r_extended{800, 0.f, 500.f}; -AxisSpec const gAxis_dr{200, -100.f, 100.f}; -AxisSpec const gAxis_r2d{400, 0.f, 250.f}; -AxisSpec const gAxis_z2d{1000, -250.f, 250.f}; -AxisSpec const gAxis_TPCdEdxSig{401, -10.025f, 10.025f}; -AxisSpec const gAxis_radRes{800, -o2::constants::math::PI, o2::constants::math::PI}; -AxisSpec const gAxis_xyz{2400, -300.f, 300.f}; -AxisSpec const gAxis_chi2{501, -1.f, 500.f}; -AxisSpec gAxis_pT_log{800, 0.01f, 25.f}; - -HistogramSpec const gHistoSpec_hCollisionZ_all_MCTrue{"hCollisionZ_all_MCTrue", "hCollisionZ_all_MCTrue;z (cm);counts", {HistType::kTH1F, {gAxis_zColl}}}; -HistogramSpec const gHistoSpec_hCollisionZ_MCTrue{"hCollisionZ_MCTrue", "hCollisionZ_MCTrue;z (cm);counts", {HistType::kTH1F, {gAxis_zColl}}}; -HistogramSpec const gHistoSpec_hCollisionZ_MCRec{"hCollisionZ_MCRec", "hCollisionZ_MCRec;z (cm);counts", {HistType::kTH1F, {gAxis_zColl}}}; +o2::framework::HistogramSpec const gHistoSpec_hCollisionZ_all_MCTrue{"hCollisionZ_all_MCTrue", "hCollisionZ_all_MCTrue;z (cm);counts", {o2::framework::HistType::kTH1F, {gAxis_zColl}}}; +o2::framework::HistogramSpec const gHistoSpec_hCollisionZ_MCTrue{"hCollisionZ_MCTrue", "hCollisionZ_MCTrue;z (cm);counts", {o2::framework::HistType::kTH1F, {gAxis_zColl}}}; +o2::framework::HistogramSpec const gHistoSpec_hCollisionZ_MCRec{"hCollisionZ_MCRec", "hCollisionZ_MCRec;z (cm);counts", {o2::framework::HistType::kTH1F, {gAxis_zColl}}}; #endif // PWGEM_PHOTONMESON_UTILS_GAMMACONVDEFINITIONS_H_ diff --git a/PWGEM/Tasks/phosAlign.cxx b/PWGEM/Tasks/phosAlign.cxx index 5e5856518af..4345280188c 100644 --- a/PWGEM/Tasks/phosAlign.cxx +++ b/PWGEM/Tasks/phosAlign.cxx @@ -9,33 +9,37 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.h" -#include "ReconstructionDataFormats/TrackParametrization.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/PWGEM/Tasks/phosCalibration.cxx b/PWGEM/Tasks/phosCalibration.cxx index 1116f47f0f2..5e62addf7dc 100644 --- a/PWGEM/Tasks/phosCalibration.cxx +++ b/PWGEM/Tasks/phosCalibration.cxx @@ -9,35 +9,42 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/CaloClusters.h" +#include "Common/DataModel/EventSelection.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 "TFile.h" -#include "TGrid.h" -#include "TLorentzVector.h" - -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/CaloClusters.h" -#include "DataFormatsPHOS/Cell.h" -#include "DataFormatsPHOS/Cluster.h" -#include "DataFormatsPHOS/TriggerRecord.h" -#include "DataFormatsPHOS/BadChannelsMap.h" -#include "DataFormatsPHOS/CalibParams.h" -#include "PHOSBase/Geometry.h" -#include "PHOSReconstruction/Clusterer.h" - -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" -#include "CommonUtils/NameConf.h" -#include "CCDB/BasicCCDBManager.h" - -#include "CommonDataFormat/InteractionRecord.h" using namespace o2; using namespace o2::aod::evsel; diff --git a/PWGEM/Tasks/phosCellQA.cxx b/PWGEM/Tasks/phosCellQA.cxx index 710244c1a6d..178c812750b 100644 --- a/PWGEM/Tasks/phosCellQA.cxx +++ b/PWGEM/Tasks/phosCellQA.cxx @@ -9,26 +9,30 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#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 +#include #include -#include -#include -#include #include - -#include "CCDB/BasicCCDBManager.h" -#include "Common/DataModel/EventSelection.h" -#include "DataFormatsPHOS/Cell.h" -#include "DataFormatsPHOS/CalibParams.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" - -#include "PHOSBase/Geometry.h" -#include "CommonDataFormat/InteractionRecord.h" +#include /// \struct PHOS QA /// \brief Monitoring task for PHOS related quantities diff --git a/PWGEM/Tasks/phosCluQA.cxx b/PWGEM/Tasks/phosCluQA.cxx index e563dc3aebe..62d171a7690 100644 --- a/PWGEM/Tasks/phosCluQA.cxx +++ b/PWGEM/Tasks/phosCluQA.cxx @@ -9,26 +9,38 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/CaloClusters.h" +#include "Common/DataModel/EventSelection.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 "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/EventSelection.h" - -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/HistogramRegistry.h" -#include "CommonUtils/NameConf.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" - -#include "PHOSBase/Geometry.h" -#include "CommonDataFormat/InteractionRecord.h" /// \struct PHOS QA /// \brief Monitoring task for PHOS related quantities diff --git a/PWGEM/Tasks/phosElId.cxx b/PWGEM/Tasks/phosElId.cxx index 062bbb6271b..0334b4084e7 100644 --- a/PWGEM/Tasks/phosElId.cxx +++ b/PWGEM/Tasks/phosElId.cxx @@ -16,8 +16,8 @@ /// \author Yeghishe Hambardzumyan, MIPT /// \since Apr, 2024 -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/RecoDecay.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CaloClusters.h" #include "Common/DataModel/Centrality.h" @@ -28,27 +28,33 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/PhysicsConstants.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.h" -#include "ReconstructionDataFormats/TrackParametrization.h" - -#include "TF1.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 +#include +#include #include #include #include diff --git a/PWGEM/Tasks/phosNbar.cxx b/PWGEM/Tasks/phosNbar.cxx index 51610ec9639..56447345bc0 100644 --- a/PWGEM/Tasks/phosNbar.cxx +++ b/PWGEM/Tasks/phosNbar.cxx @@ -8,30 +8,47 @@ // 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 "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/CaloClusters.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "CommonUtils/NameConf.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/ASoA.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.h" -#include "ReconstructionDataFormats/Track.h" - -#include "TRandom.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 phosNbar /// \brief account Nbar who's clusters appeared within PHOS diff --git a/PWGEM/Tasks/phosNonlin.cxx b/PWGEM/Tasks/phosNonlin.cxx index dd3ea3003fb..71abfb45208 100644 --- a/PWGEM/Tasks/phosNonlin.cxx +++ b/PWGEM/Tasks/phosNonlin.cxx @@ -14,31 +14,32 @@ /// \author Dmitri Peresunko /// +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" #include "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.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/PWGEM/Tasks/phosPi0.cxx b/PWGEM/Tasks/phosPi0.cxx index 74536648380..4ba0bc81b40 100644 --- a/PWGEM/Tasks/phosPi0.cxx +++ b/PWGEM/Tasks/phosPi0.cxx @@ -14,31 +14,35 @@ /// \author Dmitri Peresunko /// +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" #include "Common/Core/Zorro.h" #include "Common/Core/ZorroSummary.h" #include "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/ConfigParamSpec.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "PHOSBase/Geometry.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/PWGEM/Tasks/phosTrigQA.cxx b/PWGEM/Tasks/phosTrigQA.cxx index b0b0949cfb5..6cea670f118 100644 --- a/PWGEM/Tasks/phosTrigQA.cxx +++ b/PWGEM/Tasks/phosTrigQA.cxx @@ -9,28 +9,38 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/DataModel/CaloClusters.h" +#include "Common/DataModel/EventSelection.h" +#include "EventFiltering/filterTables.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 "Common/DataModel/CaloClusters.h" -#include "Common/DataModel/EventSelection.h" - -#include "Framework/ConfigParamSpec.h" -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/HistogramRegistry.h" -#include "CommonUtils/NameConf.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPLHCIFData.h" - -#include "PHOSBase/Geometry.h" -#include "CommonDataFormat/InteractionRecord.h" -#include "EventFiltering/filterTables.h" /// \struct PHOS trigger QA /// \brief Monitoring task for PHOS related quantities 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/Macros/compute_fraction_cutvar.py b/PWGHF/D2H/Macros/compute_fraction_cutvar.py index 35f751419fd..0099185472b 100644 --- a/PWGHF/D2H/Macros/compute_fraction_cutvar.py +++ b/PWGHF/D2H/Macros/compute_fraction_cutvar.py @@ -37,8 +37,8 @@ def main(config): infile_rawy = ROOT.TFile.Open(os.path.join(cfg["rawyields"]["inputdir"], filename_rawy)) hist_rawy_name = cfg["rawyields"]["histoname"] hist_rawy.append(infile_rawy.Get(hist_rawy_name)) - if(hist_rawy[-1] is None): - sys.exit(f"Fatal error: Histogram with raw yield \"{hist_rawy_name}\" is absent. Exit.") + if not isinstance(hist_rawy[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with raw yield \"{hist_rawy_name}\" is absent. Exit.\33[0m") hist_rawy[-1].SetDirectory(0) infile_rawy.Close() @@ -47,31 +47,43 @@ def main(config): hist_effnp_name = cfg["efficiencies"]["histonames"]["nonprompt"] hist_effp.append(infile_eff.Get(hist_effp_name)) hist_effnp.append(infile_eff.Get(hist_effnp_name)) - if(hist_effp[-1] is None): - sys.exit(f"Fatal error: Histogram with efficiency for prompt \"{hist_effp_name}\" is absent. Exit.") - if(hist_effnp[-1] is None): - sys.exit(f"Fatal error: Histogram with efficiency for nonprompt \"{hist_effnp}\" is absent. Exit.") + if not isinstance(hist_effp[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with efficiency for prompt \"{hist_effp_name}\" is absent. Exit.\33[0m") + if not isinstance(hist_effnp[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with efficiency for nonprompt \"{hist_effnp}\" is absent. Exit.\33[0m") hist_effp[-1].SetDirectory(0) hist_effnp[-1].SetDirectory(0) infile_eff.Close() pt_bin_to_process = cfg.get("pt_bin_to_process", -1) if not isinstance(pt_bin_to_process, int): - sys.exit("Fatal error: pt_bin_to_process must be an integer value. Exit.") + sys.exit("\33[31mFatal error: pt_bin_to_process must be an integer value. Exit.") if (pt_bin_to_process != -1 and pt_bin_to_process < 1) or pt_bin_to_process > hist_rawy[0].GetNbinsX(): - sys.exit("Fatal error: pt_bin_to_process must be a positive value up to number of bins in raw yield histogram. Exit.") + sys.exit("\33[31mFatal error: pt_bin_to_process must be a positive value up to number of bins in raw yield histogram. Exit.") + + is_draw_title_rawy = cfg.get("is_draw_title", {}).get("rawy", True) + is_draw_title_eff = cfg.get("is_draw_title", {}).get("eff", False) + is_draw_title_frac = cfg.get("is_draw_title", {}).get("frac", False) + is_draw_title_cov = cfg.get("is_draw_title", {}).get("cov", False) + is_draw_title_unc = cfg.get("is_draw_title", {}).get("unc", True) + + is_save_canvas_as_macro_rawy = cfg.get("is_save_canvas_as_macro", {}).get("rawy", False) + is_save_canvas_as_macro_eff = cfg.get("is_save_canvas_as_macro", {}).get("eff", False) + is_save_canvas_as_macro_frac = cfg.get("is_save_canvas_as_macro", {}).get("frac", False) + is_save_canvas_as_macro_cov = cfg.get("is_save_canvas_as_macro", {}).get("cov", False) + is_save_canvas_as_macro_unc = cfg.get("is_save_canvas_as_macro", {}).get("unc", False) if cfg["central_efficiency"]["computerawfrac"]: infile_name = os.path.join(cfg["central_efficiency"]["inputdir"], cfg["central_efficiency"]["inputfile"]) infile_central_eff = ROOT.TFile.Open(infile_name) hist_central_effp_name = cfg["central_efficiency"]["histonames"]["prompt"] hist_central_effp = infile_central_eff.Get(hist_central_effp_name) - if(hist_central_effp is None): - sys.exit(f"Fatal error: Histogram with central efficiency for prompt \"{hist_central_effp_name}\" is absent. Exit.") + if not isinstance(hist_central_effp[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with central efficiency for prompt \"{hist_central_effp_name}\" is absent. Exit.\33[0m") hist_central_effnp_name = cfg["central_efficiency"]["histonames"]["nonprompt"] hist_central_effnp = infile_central_eff.Get(hist_central_effnp_name) - if(hist_central_effnp is None): - sys.exit(f"Fatal error: Histogram with central efficiency for nonprompt \"{hist_central_effnp_name}\" is absent. Exit.") + if not isinstance(hist_central_effnp[-1], ROOT.TH1): + sys.exit(f"\33[31mFatal error: Histogram with central efficiency for nonprompt \"{hist_central_effnp_name}\" is absent. Exit.\33[0m") hist_central_effp.SetDirectory(0) hist_central_effnp.SetDirectory(0) infile_central_eff.Close() @@ -171,10 +183,10 @@ def main(config): if cfg["minimisation"]["correlated"]: if not (np.all(rawy[1:] > rawy[:-1]) or np.all(rawy[1:] < rawy[:-1])): - print("WARNING! main(): the raw yield vector is not monotonous. Check the input for stability.") + print("\0\33[33mWARNING! main(): the raw yield vector is not monotonous. Check the input for stability.\0\33[0m") print(f"raw yield vector elements = {rawy}\n") if not (np.all(unc_rawy[1:] > unc_rawy[:-1]) or np.all(unc_rawy[1:] < unc_rawy[:-1])): - print("WARNING! main(): the raw yield uncertainties vector is not monotonous. Check the input for stability.") + print("\0\33[33mWARNING! main(): the raw yield uncertainties vector is not monotonous. Check the input for stability.\0\33[0m") print(f"raw yield uncertainties vector elements = {unc_rawy}\n") minimiser = CutVarMinimiser(rawy, effp, effnp, unc_rawy, unc_effp, unc_effnp) @@ -211,34 +223,49 @@ def main(config): hist_bin_title = f"bin # {ipt+1}; {pt_axis_title}#in ({pt_min}; {pt_max})" - canv_rawy, histos_rawy, leg_r = minimiser.plot_result(f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_rawy = hist_bin_title if is_draw_title_rawy else "" + canv_rawy, histos_rawy, leg_r = minimiser.plot_result(f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_rawy) output.cd() canv_rawy.Write() for _, hist in histos_rawy.items(): hist.Write() + if (is_save_canvas_as_macro_rawy): + canv_rawy.SaveAs(f"canv_rawy_{ipt+1}.C") - canv_unc, histos_unc, leg_unc = minimiser.plot_uncertainties(f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_unc = hist_bin_title if is_draw_title_unc else "" + canv_unc, histos_unc, leg_unc = minimiser.plot_uncertainties(f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_unc) output.cd() canv_unc.Write() for _, hist in histos_unc.items(): hist.Write() + if (is_save_canvas_as_macro_unc): + canv_unc.SaveAs(f"canv_unc_{ipt+1}.C") - canv_eff, histos_eff, leg_e = minimiser.plot_efficiencies(f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_eff = hist_bin_title if is_draw_title_eff else "" + canv_eff, histos_eff, leg_e = minimiser.plot_efficiencies(f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_eff) output.cd() canv_eff.Write() for _, hist in histos_eff.items(): hist.Write() + if (is_save_canvas_as_macro_eff): + canv_eff.SaveAs(f"canv_eff_{ipt+1}.C") - canv_frac, histos_frac, leg_f = minimiser.plot_fractions(f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_frac = hist_bin_title if is_draw_title_frac else "" + canv_frac, histos_frac, leg_f = minimiser.plot_fractions(f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_frac) output.cd() canv_frac.Write() for _, hist in histos_frac.items(): hist.Write() + if (is_save_canvas_as_macro_frac): + canv_frac.SaveAs(f"canv_frac_{ipt+1}.C") - canv_cov, histo_cov = minimiser.plot_cov_matrix(True, f"_pt{pt_min}_{pt_max}", hist_bin_title) + hist_bin_title_cov = hist_bin_title if is_draw_title_cov else "" + canv_cov, histo_cov = minimiser.plot_cov_matrix(True, f"_pt_{pt_min}_to_{pt_max}", hist_bin_title_cov) output.cd() canv_cov.Write() histo_cov.Write() + if (is_save_canvas_as_macro_cov): + canv_cov.SaveAs(f"canv_cov_{ipt+1}.C") else: print(f"Minimization for pT {pt_min}, {pt_max} not successful") canv_rawy = ROOT.TCanvas("c_rawy_minimization_error", "Minimization error", 500, 500) diff --git a/PWGHF/D2H/Macros/config_cutvar_example.json b/PWGHF/D2H/Macros/config_cutvar_example.json index 20466b37044..e1b768b807d 100644 --- a/PWGHF/D2H/Macros/config_cutvar_example.json +++ b/PWGHF/D2H/Macros/config_cutvar_example.json @@ -57,6 +57,20 @@ "minimisation": { "correlated": true }, + "is_draw_title": { + "rawy": true, + "frac": false, + "eff": false, + "cov": false, + "unc": true + }, + "is_save_canvas_as_macro": { + "rawy": false, + "frac": false, + "eff": false, + "cov": false, + "unc": false + }, "central_efficiency": { "computerawfrac": true, "inputdir": "path/to/central/efficiency", diff --git a/PWGHF/D2H/Macros/cut_variation.py b/PWGHF/D2H/Macros/cut_variation.py index 3d862589836..f9b49f15710 100644 --- a/PWGHF/D2H/Macros/cut_variation.py +++ b/PWGHF/D2H/Macros/cut_variation.py @@ -79,15 +79,15 @@ def __check_input_consistency(self): """ if len(self.eff_prompt) != self.n_sets or len(self.eff_nonprompt) != self.n_sets: - print("ERROR: number of raw yields and efficiencies not consistent! Exit") + print("33[31mERROR: number of raw yields and efficiencies not consistent! Exit\033[0m") sys.exit() if len(self.unc_raw_yields) != self.n_sets: - print("ERROR: number of raw yields and raw-yield uncertainties not consistent! Exit") + print("33[31mERROR: number of raw yields and raw-yield uncertainties not consistent! Exit\033[0m") sys.exit() if len(self.unc_eff_prompt) != self.n_sets or len(self.unc_eff_nonprompt) != self.n_sets: - print("ERROR: number of raw yields and efficiency uncertainties not consistent! Exit") + print("33[31mERROR: number of raw yields and efficiency uncertainties not consistent! Exit\033[0m") sys.exit() def __initialise_objects(self): @@ -199,7 +199,7 @@ def minimise_system(self, correlated=True, precision=1.0e-8, max_iterations=100) if correlated: m_cov_sets_diag = np.diag(self.m_cov_sets) if not (np.all(m_cov_sets_diag[1:] > m_cov_sets_diag[:-1]) or np.all(m_cov_sets_diag[1:] < m_cov_sets_diag[:-1])): - print("WARNING! minimise_system(): the residual vector uncertainties elements are not monotonous. Check the input for stability.") + print("\033[33mWARNING! minimise_system(): the residual vector uncertainties elements are not monotonous. Check the input for stability.\033[0m") print(f"residual vector uncertainties elements = {np.sqrt(m_cov_sets_diag)}\n") # chi2 @@ -484,6 +484,7 @@ def plot_result(self, suffix="", title=""): - leg: ROOT.TLegend needed otherwise it is destroyed """ + suffix = suffix.replace(".", "_") set_global_style(padleftmargin=0.16, padbottommargin=0.12, padtopmargin=0.075, titleoffsety=1.6) @@ -604,6 +605,7 @@ def plot_cov_matrix(self, correlated=True, suffix="", title=""): - hist_corr_matrix: ROOT.TH2F histogram of correlation matrix """ + suffix = suffix.replace(".", "_") set_global_style( padleftmargin=0.14, @@ -667,6 +669,7 @@ def plot_efficiencies(self, suffix="", title=""): - leg: ROOT.TLegend needed otherwise it is destroyed """ + suffix = suffix.replace(".", "_") set_global_style(padleftmargin=0.14, padbottommargin=0.12, titleoffset=1.2, padtopmargin = 0.075) @@ -758,6 +761,7 @@ def plot_fractions(self, suffix="", title=""): - leg: ROOT.TLegend needed otherwise it is destroyed """ + suffix = suffix.replace(".", "_") set_global_style(padleftmargin=0.14, padbottommargin=0.12, titleoffset=1.2, padtopmargin = 0.075) @@ -844,6 +848,7 @@ def plot_uncertainties(self, suffix="", title=""): - leg: ROOT.TLegend needed otherwise it is destroyed """ + suffix = suffix.replace(".", "_") set_global_style(padleftmargin=0.16, padbottommargin=0.12, padtopmargin=0.075, titleoffsety=1.6) diff --git a/PWGHF/D2H/Tasks/taskCd.cxx b/PWGHF/D2H/Tasks/taskCd.cxx index 665e640a87b..fbe561566fd 100644 --- a/PWGHF/D2H/Tasks/taskCd.cxx +++ b/PWGHF/D2H/Tasks/taskCd.cxx @@ -75,6 +75,7 @@ DECLARE_SOA_COLUMN(DecayLength, decayLength, float); //! Decay length DECLARE_SOA_COLUMN(DecayLengthXY, decayLengthXY, float); //! Decay length in transverse plane (cm) DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle (3D) DECLARE_SOA_COLUMN(CpaXY, cpaXY, float); //! Cosine of pointing angle in XY plane +DECLARE_SOA_COLUMN(Chi2PCA, chi2PCA, float); //! chi2PCA DECLARE_SOA_COLUMN(NSigmaTpcDe, nSigmaTpcDe, float); //! TPC nσ for deuteron hypothesis DECLARE_SOA_COLUMN(NSigmaTpcKa, nSigmaTpcKa, float); //! TPC nσ for kaon hypothesis DECLARE_SOA_COLUMN(NSigmaTpcPi, nSigmaTpcPi, float); //! TPC nσ for pion hypothesis @@ -85,7 +86,9 @@ DECLARE_SOA_COLUMN(NSigmaTofPi, nSigmaTofPi, float); //! TOF nσ for DECLARE_SOA_COLUMN(NItsClusters, nItsClusters, int8_t); //! Number of ITS clusters used in the track fit DECLARE_SOA_COLUMN(NItsNClusterSize, nItsNClusterSize, int8_t); //! Number of ITS clusters size used in the track fit DECLARE_SOA_COLUMN(NTpcClusters, nTpcClusters, int8_t); //! Number of TPC clusters used in the track fit -DECLARE_SOA_COLUMN(NTpcSignalsDe, nTpcSignalsDe, int8_t); //! Number of TPC signas +DECLARE_SOA_COLUMN(NTpcSignalsDe, nTpcSignalsDe, int8_t); //! Number of TPC signas for deuteron +DECLARE_SOA_COLUMN(NTpcSignalsPi, nTpcSignalsPi, int8_t); //! Number of TPC signas for pion +DECLARE_SOA_COLUMN(NTpcSignalsKa, nTpcSignalsKa, int8_t); //! Number of TPC signas for kaon DECLARE_SOA_COLUMN(NItsSignalsDe, nItsSignalsDe, int8_t); //! Number of ITS signas DECLARE_SOA_COLUMN(CandidateSelFlag, candidateSelFlag, int8_t); //! Candidates falg DECLARE_SOA_COLUMN(Cent, cent, float); //! Centrality @@ -105,6 +108,7 @@ DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", full::ImpactParameter2, full::DecayLength, full::Cpa, + full::Chi2PCA, full::NSigmaTpcDe, full::NSigmaItsDe, full::NSigmaTofDe, @@ -112,6 +116,8 @@ DECLARE_SOA_TABLE(HfCandCd, "AOD", "HFCANDCD", full::NItsNClusterSize, full::NTpcClusters, full::NTpcSignalsDe, + full::NTpcSignalsPi, + full::NTpcSignalsKa, full::NItsSignalsDe, full::CandidateSelFlag, full::Cent, @@ -214,6 +220,8 @@ struct HfTaskCd { registry.add("Data/hNsigmaTOFDeVsP", "deuteron;#it{p} (GeV/#it{c}); n#sigma^{TOF}_{d}", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hNsigmaITSDeVsP", "deuteron;#it{p} (GeV/#it{c}); n#sigma^{ITS}_{d}", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hTPCSignalDeVsP", "deuteron;#it{p} (GeV/#it{c}); TPC signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {2000, 0, 2000}}}); + registry.add("Data/hTPCSignalPiVsP", "Pion;#it{p} (GeV/#it{c}); TPC signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {2000, 0, 2000}}}); + registry.add("Data/hTPCSignalKaVsP", "Kaon;#it{p} (GeV/#it{c}); TPC signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {2000, 0, 2000}}}); registry.add("Data/hITSSignalDeVsP", "deuteron;#it{p} (GeV/#it{c}); ITS signals", {HistType::kTH2F, {{200, -10.f, 10.f}, {20, 0, 20}}}); registry.add("Data/hNsigmaTPCPiVsP", "Pion;#it{p} (GeV/#it{c});n#sigma^{TPC}_{pi};", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); registry.add("Data/hNsigmaTOFPiVsP", "Pion;#it{p} (GeV/#it{c});n#sigma^{TOF}_{pi};", {HistType::kTH2F, {{200, -10.f, 10.f}, {200, -6.f, 6.f}}}); @@ -353,6 +361,9 @@ struct HfTaskCd { int tpcNClusterDe = 0; float tpcSignalsDe = 0.f; + float tpcSignalsPi = 0.f; + float tpcSignalsKa = 0.f; + float itsSignalsDe = 0.f; float pSignedDe = -999.f; @@ -371,6 +382,8 @@ struct HfTaskCd { auto prong0Its = tracksWithItsPid.iteratorAt(candidate.prong0Id() - tracksWithItsPid.offset()); auto prong2Its = tracksWithItsPid.iteratorAt(candidate.prong2Id() - tracksWithItsPid.offset()); + tpcSignalsKa = prong1.tpcSignal(); + if (selDeKPi) { candFlag = 1; pSignedDe = prong0.p() * prong0.sign(); @@ -384,6 +397,7 @@ struct HfTaskCd { itsNClusterSizeDe = prong0.itsClusterSizes(); tpcNClusterDe = prong0.tpcNClsCrossedRows(); tpcSignalsDe = prong0.tpcSignal(); + tpcSignalsPi = prong2.tpcSignal(); itsSignalsDe = itsSignal(prong0); } else if (selPiKDe) { candFlag = -1; @@ -398,6 +412,7 @@ struct HfTaskCd { itsNClusterSizeDe = prong2.itsClusterSizes(); tpcNClusterDe = prong2.tpcNClsCrossedRows(); tpcSignalsDe = prong2.tpcSignal(); + tpcSignalsPi = prong0.tpcSignal(); itsSignalsDe = itsSignal(prong2); } @@ -406,6 +421,8 @@ struct HfTaskCd { registry.fill(HIST("Data/hNsigmaTOFDeVsP"), pSignedDe, nSigmaTofDe); registry.fill(HIST("Data/hNsigmaITSDeVsP"), pSignedDe, nSigmaItsDe); registry.fill(HIST("Data/hTPCSignalDeVsP"), pSignedDe, tpcSignalsDe); + registry.fill(HIST("Data/hTPCSignalPiVsP"), pSignedPi, tpcSignalsPi); + registry.fill(HIST("Data/hTPCSignalKaVsP"), prong1.p() * prong1.sign(), tpcSignalsKa); registry.fill(HIST("Data/hITSSignalDeVsP"), pSignedDe, itsSignalsDe); registry.fill(HIST("Data/hNsigmaTPCPiVsP"), pSignedPi, nSigmaTpcPi); registry.fill(HIST("Data/hNsigmaTOFPiVsP"), pSignedPi, nSigmaTofPi); @@ -423,6 +440,7 @@ struct HfTaskCd { candidate.impactParameter2(), decayLength, cpa, + chi2PCA, nSigmaTpcDe, nSigmaItsDe, nSigmaTofDe, @@ -430,6 +448,8 @@ struct HfTaskCd { itsNClusterSizeDe, tpcNClusterDe, tpcSignalsDe, + tpcSignalsPi, + tpcSignalsKa, itsSignalsDe, candFlag, cent, diff --git a/PWGHF/D2H/Tasks/taskD0.cxx b/PWGHF/D2H/Tasks/taskD0.cxx index e879ba57c9a..16dbff833e4 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", false, "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/D2H/Tasks/taskLc.cxx b/PWGHF/D2H/Tasks/taskLc.cxx index ecf59c918af..bd29b00c868 100644 --- a/PWGHF/D2H/Tasks/taskLc.cxx +++ b/PWGHF/D2H/Tasks/taskLc.cxx @@ -127,6 +127,7 @@ struct HfTaskLc { ConfigurableAxis thnConfigAxisOccupancy{"thnConfigAxisOccupancy", {14, 0, 14000}, "axis for centrality"}; ConfigurableAxis thnConfigAxisProperLifetime{"thnConfigAxisProperLifetime", {200, 0, 2}, "Proper lifetime, ps"}; ConfigurableAxis thnConfigAxisGapType{"thnConfigAxisGapType", {7, -1.5, 5.5}, "axis for UPC gap type (see TrueGap enum in o2::aod::sgselector)"}; + ConfigurableAxis thnConfigAxisFV0A{"thnConfigAxisFV0A", {1001, -1.5, 999.5}, "axis for FV0-A amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisFT0{"thnConfigAxisFT0", {1001, -1.5, 999.5}, "axis for FT0 amplitude (a.u.)"}; ConfigurableAxis thnConfigAxisZN{"thnConfigAxisZN", {510, -1.5, 49.5}, "axis for ZN energy (a.u.)"}; ConfigurableAxis thnConfigAxisZNTime{"thnConfigAxisZNTime", {200, -10, 10}, "axis for ZN energy (a.u.)"}; @@ -269,6 +270,8 @@ struct HfTaskLc { qaRegistry.add("Data/zdc/energyZNA_vs_energyZNC", "ZNA vs ZNC common energy;E_{ZNA}^{common} (a.u.);E_{ZNC}^{common} (a.u.)", {HistType::kTH2F, {{100, 0., 10}, {100, 0., 10}}}); qaRegistry.add("Data/zdc/timeZNA_vs_timeZNC", "ZNA vs ZNC time;ZNA Time;ZNC time", {HistType::kTH2F, {{200, -10., 10}, {200, -10., 10}}}); qaRegistry.add("Data/hUpcGapAfterSelection", "UPC gap type after selection;Gap side;Counts", {HistType::kTH1F, {{7, -1.5, 5.5}}}); + qaRegistry.add("Data/hUpcMulti", "Multiplicity of UPC events;Multiplicity;Counts", {HistType::kTH1F, {{200, -0.5, 199.5}}}); + qaRegistry.add("Data/hUpcVtz", "Vertex Z position of UPC events;Vz (cm);Counts", {HistType::kTH1F, {{200, -10., 10.}}}); } if (fillTHn) { const AxisSpec thnAxisMass{thnConfigAxisMass, "inv. mass (p K #pi) (GeV/#it{c}^{2})"}; @@ -289,6 +292,7 @@ struct HfTaskLc { const AxisSpec thnAxisTracklets{thnConfigAxisNumPvContr, "Number of PV contributors"}; const AxisSpec thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"}; const AxisSpec thnAxisProperLifetime{thnConfigAxisProperLifetime, "T_{proper} (ps)"}; + const AxisSpec thnAxisFV0A{thnConfigAxisFV0A, "FV0-A amplitude"}; const AxisSpec thnAxisFT0A{thnConfigAxisFT0, "FT0-A amplitude"}; const AxisSpec thnAxisFT0C{thnConfigAxisFT0, "FT0-C amplitude"}; const AxisSpec thnAxisZNA{thnConfigAxisZN, "ZNA energy"}; @@ -307,7 +311,7 @@ struct HfTaskLc { axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets}; } if (isDataStd && isUpc) { - axesUpc = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; + axesUpc = {thnAxisMass, thnAxisPt, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisFV0A, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; } if (isMcStd) { axesStd = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisPtProng0, thnAxisPtProng1, thnAxisPtProng2, thnAxisChi2PCA, thnAxisDecLength, thnAxisCPA, thnAxisTracklets, thnAxisPtB, thnAxisCanType}; @@ -319,7 +323,7 @@ struct HfTaskLc { axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets}; } if (isDataWithMl && isUpc) { - axesUpcWithBdt = {thnAxisMass, thnAxisPt, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; + axesUpcWithBdt = {thnAxisMass, thnAxisPt, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisFV0A, thnAxisFT0A, thnAxisFT0C, thnAxisZNA, thnAxisZNC, thnAxisZNATime, thnAxisZNCTime}; } if (isMcWithMl) { axesWithBdt = {thnAxisMass, thnAxisPt, thnAxisCentrality, thnAxisBdtScoreLcBkg, thnAxisBdtScoreLcPrompt, thnAxisBdtScoreLcNonPrompt, thnAxisTracklets, thnAxisPtB, thnAxisCanType}; @@ -795,7 +799,10 @@ struct HfTaskLc { const auto decayLength = candidate.decayLength(); const auto chi2PCA = candidate.chi2PCA(); const auto cpa = candidate.cpa(); - const auto rapidity = HfHelper::yLc(candidate); + if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { + qaRegistry.fill(HIST("Data/hUpcMulti"), collision.multNTracksPV()); + qaRegistry.fill(HIST("Data/hUpcVtz"), collision.posZ()); + } if (fillTHn) { double outputBkg(-1), outputPrompt(-1), outputFD(-1); @@ -813,22 +820,22 @@ struct HfTaskLc { /// Fill the ML outputScores and variables of candidate if (fillUPCTHnLite) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { - std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; + std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; registry.get(HIST("hnLcUpcVarsWithBdt"))->Fill(valuesToFill.data()); } } else { - std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; + std::vector valuesToFill{massLc, pt, outputBkg, outputPrompt, outputFD, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; registry.get(HIST("hnLcUpcVarsWithBdt"))->Fill(valuesToFill.data()); } } else { if (fillUPCTHnLite) { if (gap == o2::aod::sgselector::TrueGap::SingleGapA || gap == o2::aod::sgselector::TrueGap::SingleGapC) { - std::vector valuesToFill{massLc, pt, rapidity, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; + std::vector valuesToFill{massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; registry.get(HIST("hnLcUpcVars"))->Fill(valuesToFill.data()); } } else { - std::vector valuesToFill{massLc, pt, rapidity, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; + std::vector valuesToFill{massLc, pt, ptProng0, ptProng1, ptProng2, chi2PCA, decayLength, cpa, static_cast(numPvContributors), static_cast(fitInfo.ampFV0A), static_cast(fitInfo.ampFT0A), static_cast(fitInfo.ampFT0C), static_cast(zdcEnergyZNA), static_cast(zdcEnergyZNC), static_cast(zdcTimeZNA), static_cast(zdcTimeZNC)}; registry.get(HIST("hnLcUpcVars"))->Fill(valuesToFill.data()); } } @@ -908,7 +915,7 @@ struct HfTaskLc { } PROCESS_SWITCH(HfTaskLc, processDataWithMlWithFT0M, "Process real data with the ML method and with FT0M centrality", false); - void processDataWithMlWithUpc(soa::Join const& collisions, + void processDataWithMlWithUpc(soa::Join const& collisions, aod::BcFullInfos const& bcs, LcCandidatesMl const& selectedLcCandidatesMl, aod::Tracks const&, @@ -921,7 +928,7 @@ struct HfTaskLc { } PROCESS_SWITCH(HfTaskLc, processDataWithMlWithUpc, "Process real data with the ML method with UPC", false); - void processDataStdWithUpc(soa::Join const& collisions, + void processDataStdWithUpc(soa::Join const& collisions, aod::BcFullInfos const& bcs, LcCandidatesMl const& selectedLcCandidatesMl, aod::Tracks const&, 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/correlatorD0Hadrons.cxx b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx index a53cbd6c862..85ec82b5ed9 100644 --- a/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorD0Hadrons.cxx @@ -254,7 +254,7 @@ struct HfCorrelatorD0Hadrons { Preslice perTrueCollision = o2::aod::mcparticle::mcCollisionId; ConfigurableAxis zPoolBins{"zPoolBins", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "z vertex position pools"}; - ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; + ConfigurableAxis multPoolBins{"multPoolBins", {VARIABLE_WIDTH, 0.0f, 1100.0f, 1900.0f, 10000.0f}, "event multiplicity pools (FT0M)"}; ConfigurableAxis multPoolBinsMcGen{"multPoolBinsMcGen", {VARIABLE_WIDTH, 0.0f, 20.0f, 50.0f, 500.0f}, "Mixing bins - MC multiplicity"}; // In MCGen multiplicity is defined by counting tracks ConfigurableAxis binsMassD{"binsMassD", {200, 1.3848, 2.3848}, "inv. mass (#pi K) (GeV/#it{c}^{2});entries"}; ConfigurableAxis binsEta{"binsEta", {100, -5., 5.}, "#it{#eta}"}; @@ -265,8 +265,6 @@ struct HfCorrelatorD0Hadrons { ConfigurableAxis binsPoolBin{"binsPoolBin", {9, 0., 9.}, "PoolBin"}; ConfigurableAxis binsCentFt0m{"binsCentFt0m", {100, 0., 100.}, "Centrality percentile (FT0M)"}; - BinningType corrBinning{{zPoolBins, multPoolBins}, true}; - HistogramRegistry registry{"registry", {}, OutputObjHandlingPolicy::AnalysisObject}; void init(InitContext&) @@ -363,6 +361,7 @@ struct HfCorrelatorD0Hadrons { SelectedTracks const& tracks, SelectedCandidatesDataMl const& candidates) { + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; // find leading particle if (correlateD0WithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, etaTrackMax.value); @@ -529,6 +528,7 @@ struct HfCorrelatorD0Hadrons { SelectedCandidatesMcRecMl const& candidates, aod::McParticles const& mcParticles) { + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; // find leading particle if (correlateD0WithLeadingParticle) { leadingIndex = findLeadingParticle(tracks, etaTrackMax.value); @@ -864,6 +864,7 @@ struct HfCorrelatorD0Hadrons { SelectedCandidatesDataMl const& candidates, SelectedTracks const& tracks) { + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; for (const auto& collision : collisions) { registry.fill(HIST("hMultFT0M"), collision.multFT0M()); registry.fill(HIST("hZvtx"), collision.posZ()); @@ -952,6 +953,7 @@ struct HfCorrelatorD0Hadrons { SelectedTracksMcRec const& tracks, aod::McParticles const& mcParticles) { + BinningType const corrBinning{{zPoolBins, multPoolBins}, true}; auto tracksTuple = std::make_tuple(candidates, tracks); Pair const pairMcRec{corrBinning, numberEventsMixed, -1, collisions, tracksTuple, &cache}; bool isD0Prompt = false; diff --git a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx index 2005cd9261e..3f7f48f84d3 100644 --- a/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx +++ b/PWGHF/HFC/TableProducer/correlatorDplusHadrons.cxx @@ -186,6 +186,11 @@ struct HfCorrelatorDplusHadrons { Configurable selectionFlagDplus{"selectionFlagDplus", 7, "Selection Flag for Dplus"}; // 7 corresponds to topo+PID cuts Configurable numberEventsMixed{"numberEventsMixed", 5, "Number of events mixed in ME process"}; + Configurable removeUnreconstructedGenCollisions{"removeUnreconstructedGenCollisions", true, "Remove generator-level collisions that were not reconstructed"}; + Configurable removeCollWSplitVtx{"removeCollWSplitVtx", true, "Flag for rejecting the splitted collisions"}; + Configurable useSel8{"useSel8", true, "Flag for applying sel8 for collision selection"}; + Configurable selNoSameBunchPileUpColl{"selNoSameBunchPileUpColl", true, "Flag for rejecting the collisions associated with the same bunch crossing"}; + Configurable zVtxMax{"zVtxMax", 10., "max. position-z of the reconstructed collision"}; Configurable applyEfficiency{"applyEfficiency", true, "Flag for applying D-meson efficiency weights"}; Configurable removeDaughters{"removeDaughters", true, "Flag for removing D-meson daughters from correlations"}; Configurable yCandMax{"yCandMax", 0.8, "max. cand. rapidity"}; @@ -210,6 +215,7 @@ struct HfCorrelatorDplusHadrons { // Event Mixing for the Data Mode using SelCollisionsWithDplus = soa::Filtered>; using SelCollisionsWithDplusMc = soa::Filtered>; // collisionFilter applied + using CollisionsMc = soa::Join; using CandidatesDplusData = soa::Filtered>; // Event Mixing for the MCRec Mode using CandidatesDplusMcRec = soa::Filtered>; @@ -226,6 +232,8 @@ struct HfCorrelatorDplusHadrons { Filter dplusFilter = ((o2::aod::hf_track_index::hfflag & static_cast(1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi)) != static_cast(0)) && aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus; Filter trackFilter = (nabs(aod::track::eta) < etaTrackMax) && (nabs(aod::track::pt) > ptTrackMin) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax); Preslice presliceMc{aod::mcparticle::mcCollisionId}; + Preslice candMcGenPerMcCollision = o2::aod::mcparticle::mcCollisionId; + PresliceUnsorted> recoCollisionsPerMcCollision = o2::aod::mccollisionlabel::mcCollisionId; // Filter particlesFilter = nabs(aod::mcparticle::pdgCode) == 411 || ((aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary); ConfigurableAxis binsMultiplicity{"binsMultiplicity", {VARIABLE_WIDTH, 0.0f, 2000.0f, 6000.0f, 100000.0f}, "Mixing bins - multiplicity"}; ConfigurableAxis binsZVtx{"binsZVtx", {VARIABLE_WIDTH, -10.0f, -2.5f, 2.5f, 10.0f}, "Mixing bins - z-vertex"}; @@ -308,9 +316,129 @@ struct HfCorrelatorDplusHadrons { registry.add("hEtaMcGen", "D+,Hadron particles - MC Gen", {HistType::kTH1F, {axisEta}}); registry.add("hPhiMcGen", "D+,Hadron particles - MC Gen", {HistType::kTH1F, {axisPhi}}); registry.add("hMultFT0AMcGen", "D+,Hadron multiplicity FT0A - MC Gen", {HistType::kTH1F, {axisMultiplicity}}); + registry.add("hFakeCollision", "Fake collision counter", {HistType::kTH1F, {{1, -0.5, 0.5, "n fake coll"}}}); corrBinning = {{binsZVtx, binsMultiplicity}, true}; } + template + void runMcGenDplusHadronAnalysis(const ParticleContainer& particlesToLoop, const AssocContainer& groupedMcParticles, int poolBin, int& counterDplusHadron) + { + for (const auto& particle : particlesToLoop) { + + if (std::abs(particle.pdgCode()) != Pdg::kDPlus) { + continue; + } + + if (std::abs(particle.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { + continue; + } + + double yD = RecoDecay::y(particle.pVector(), MassDPlus); + + if (std::abs(yD) > yCandGenMax || + particle.pt() < ptCandMin || + particle.pt() > ptCandMax) { + continue; + } + + std::vector listDaughters{}; + std::array const arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus}; + std::array prongsId{}; + + RecoDecay::getDaughters(particle, &listDaughters, arrDaughDplusPDG, 2); + + if (listDaughters.size() != NDaughters) { + continue; + } + + bool isDaughtersOk = true; + int counterDaughters = 0; + + for (const auto& dauIdx : listDaughters) { + auto daughI = particlesToLoop.rawIteratorAt(dauIdx - particlesToLoop.offset()); + + if (std::abs(daughI.eta()) >= EtaDaughtersMax) { + isDaughtersOk = false; + break; + } + + prongsId[counterDaughters++] = daughI.globalIndex(); + } + + if (!isDaughtersOk) { // Skip this D+ candidate if any daughter fails eta cut + continue; + } + counterDplusHadron++; + + registry.fill(HIST("hDplusBin"), poolBin); + registry.fill(HIST("hPtCandMCGen"), particle.pt()); + registry.fill(HIST("hEtaMcGen"), particle.eta()); + registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle.phi(), -PIHalf)); + registry.fill(HIST("hYMCGen"), yD); + + // Prompt / Non-prompt separation + bool isDplusPrompt = particle.originMcGen() == RecoDecay::OriginType::Prompt; + bool isDplusNonPrompt = particle.originMcGen() == RecoDecay::OriginType::NonPrompt; + + if (isDplusPrompt) { + registry.fill(HIST("hPtCandMcGenPrompt"), particle.pt()); + } else if (isDplusNonPrompt) { + registry.fill(HIST("hPtCandMcGenNonPrompt"), particle.pt()); + } + + // Count triggers + registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle.pt()); + + for (const auto& particleAssoc : groupedMcParticles) { + + if (std::abs(particleAssoc.eta()) > etaTrackMax || + particleAssoc.pt() < ptTrackMin || + particleAssoc.pt() > ptTrackMax) { + continue; + } + + // Remove daughters if requested + if (removeDaughters) { + if (particleAssoc.globalIndex() == prongsId[0] || + particleAssoc.globalIndex() == prongsId[1] || + particleAssoc.globalIndex() == prongsId[2]) { + continue; + } + } + + // Particle species selection + if ((std::abs(particleAssoc.pdgCode()) != kElectron) && + (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && + (std::abs(particleAssoc.pdgCode()) != kPiPlus) && + (std::abs(particleAssoc.pdgCode()) != kKPlus) && + (std::abs(particleAssoc.pdgCode()) != kProton)) { + continue; + } + + if (!particleAssoc.isPhysicalPrimary()) { + continue; + } + + int trackOrigin = RecoDecay::getCharmHadronOrigin(groupedMcParticles, + particleAssoc, + true); + + registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); + entryDplusHadronPair( + getDeltaPhi(particleAssoc.phi(), particle.phi()), + particleAssoc.eta() - particle.eta(), + particle.pt(), + particleAssoc.pt(), + poolBin); + + entryDplusHadronRecoInfo(MassDPlus, true); + entryDplusHadronGenInfo(isDplusPrompt, + particleAssoc.isPhysicalPrimary(), + trackOrigin); + } + } + } + /// Dplus-hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth) void processData(SelCollisionsWithDplus::iterator const& collision, TracksData const& tracks, @@ -536,101 +664,65 @@ struct HfCorrelatorDplusHadrons { PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcRec, "Process MC Reco mode", true); /// Dplus-Hadron correlation pair builder - for MC gen-level analysis (no filter/selection, only true signal) - void processMcGen(SelCollisionsWithDplusMc::iterator const& mcCollision, + void processMcGen(CollisionsMc const& mcCollisions, + soa::Join const& collisions, CandDplusMcGen const& mcParticles) { - int counterDplusHadron = 0; - registry.fill(HIST("hMCEvtCount"), 0); - BinningTypeMcGen const corrBinningMcGen{{binsZVtx, binsMultiplicityMc}, true}; - int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); - registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); - // MC gen level - for (const auto& particle1 : mcParticles) { - // check if the particle is Dplus (for general plot filling and selection, so both cases are fine) - NOTE: decay channel is not probed! - if (std::abs(particle1.pdgCode()) != Pdg::kDPlus) { - continue; - } - if (std::abs(particle1.flagMcMatchGen()) != hf_decay::hf_cand_3prong::DecayChannelMain::DplusToPiKPi) { - continue; - } - double const yD = RecoDecay::y(particle1.pVector(), MassDPlus); - if (std::abs(yD) >= yCandMax || particle1.pt() <= ptCandMin) { - continue; - } - std::vector listDaughters{}; - std::array const arrDaughDplusPDG = {+kPiPlus, -kKPlus, kPiPlus}; - std::array prongsId{}; - listDaughters.clear(); - RecoDecay::getDaughters(particle1, &listDaughters, arrDaughDplusPDG, 2); - int counterDaughters = 0; - if (listDaughters.size() != NDaughters) { - continue; - } - bool isDaughtersOk = true; - for (const auto& dauIdx : listDaughters) { - auto daughI = mcParticles.rawIteratorAt(dauIdx - mcParticles.offset()); - if (std::abs(daughI.eta()) >= EtaDaughtersMax) { - isDaughtersOk = false; - break; - } - counterDaughters += 1; - prongsId[counterDaughters - 1] = daughI.globalIndex(); - } - if (!isDaughtersOk) { - continue; // Skip this D+ candidate if any daughter fails eta cut - } - counterDplusHadron++; + for (const auto& mcCollision : mcCollisions) { - registry.fill(HIST("hDplusBin"), poolBin); - registry.fill(HIST("hPtCandMCGen"), particle1.pt()); - registry.fill(HIST("hEtaMcGen"), particle1.eta()); - registry.fill(HIST("hPhiMcGen"), RecoDecay::constrainAngle(particle1.phi(), -PIHalf)); - registry.fill(HIST("hYMCGen"), yD); + int counterDplusHadron = 0; + registry.fill(HIST("hMCEvtCount"), 0); - // prompt and non-prompt division - bool isDplusPrompt = particle1.originMcGen() == RecoDecay::OriginType::Prompt; - bool isDplusNonPrompt = particle1.originMcGen() == RecoDecay::OriginType::NonPrompt; - if (isDplusPrompt) { - registry.fill(HIST("hPtCandMcGenPrompt"), particle1.pt()); - } else if (isDplusNonPrompt) { - registry.fill(HIST("hPtCandMcGenNonPrompt"), particle1.pt()); - } + int poolBin = corrBinningMcGen.getBin(std::make_tuple(mcCollision.posZ(), mcCollision.multMCFT0A())); + registry.fill(HIST("hMultFT0AMcGen"), mcCollision.multMCFT0A()); - // Dplus Hadron correlation dedicated section - // if it's a Dplus particle, search for Hadron and evaluate correlations - registry.fill(HIST("hcountDplustriggersMCGen"), 0, particle1.pt()); // to count trigger Dplus for normalisation) - for (const auto& particleAssoc : mcParticles) { - if (std::abs(particleAssoc.eta()) > etaTrackMax || particleAssoc.pt() < ptTrackMin || particleAssoc.pt() > ptTrackMax) { + const auto groupedMcParticles = mcParticles.sliceBy(candMcGenPerMcCollision, mcCollision.globalIndex()); + const auto groupedCollisions = collisions.sliceBy(recoCollisionsPerMcCollision, mcCollision.globalIndex()); + + if (removeUnreconstructedGenCollisions) { + + if (groupedCollisions.size() < 1) { continue; } - if (removeDaughters) { - if (particleAssoc.globalIndex() == prongsId[0] || particleAssoc.globalIndex() == prongsId[1] || particleAssoc.globalIndex() == prongsId[2]) { - continue; - } - } - if ((std::abs(particleAssoc.pdgCode()) != kElectron) && (std::abs(particleAssoc.pdgCode()) != kMuonMinus) && (std::abs(particleAssoc.pdgCode()) != kPiPlus) && (std::abs(particleAssoc.pdgCode()) != kKPlus) && (std::abs(particleAssoc.pdgCode()) != kProton)) { + + if (groupedCollisions.size() > 1 && removeCollWSplitVtx) { continue; } - if (!particleAssoc.isPhysicalPrimary()) { - continue; + + for (const auto& collision : groupedCollisions) { + + if (useSel8 && !collision.sel8()) { + continue; + } + + if (std::abs(collision.posZ()) > zVtxMax) { + continue; + } + + if (selNoSameBunchPileUpColl && + !(collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup))) { + continue; + } + + if (!collision.has_mcCollision()) { + registry.fill(HIST("hFakeCollision"), 0.); + continue; + } + + // MC particles with reconstructed-collision selection + runMcGenDplusHadronAnalysis(groupedMcParticles, groupedMcParticles, poolBin, counterDplusHadron); } - int trackOrigin = RecoDecay::getCharmHadronOrigin(mcParticles, particleAssoc, true); - registry.fill(HIST("hPtParticleAssocMcGen"), particleAssoc.pt()); - entryDplusHadronPair(getDeltaPhi(particleAssoc.phi(), particle1.phi()), - particleAssoc.eta() - particle1.eta(), - particle1.pt(), - particleAssoc.pt(), - poolBin); - entryDplusHadronRecoInfo(MassDPlus, true); - entryDplusHadronGenInfo(isDplusPrompt, particleAssoc.isPhysicalPrimary(), trackOrigin); - } // end associated loop - } // end trigger - registry.fill(HIST("hcountDplusHadronPerEvent"), counterDplusHadron); - registry.fill(HIST("hZvtx"), mcCollision.posZ()); - // registry.fill(HIST("hMultiplicity"), getTracksSize(mcCollision)); + } else { + // MC particles without reconstructed-collision selection (preliminary approval approach) + runMcGenDplusHadronAnalysis(groupedMcParticles, groupedMcParticles, poolBin, counterDplusHadron); + } + + registry.fill(HIST("hcountDplusHadronPerEvent"), counterDplusHadron); + registry.fill(HIST("hZvtx"), mcCollision.posZ()); + } } PROCESS_SWITCH(HfCorrelatorDplusHadrons, processMcGen, "Process MC Gen mode", false); 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/HFL/Tasks/taskSingleMuonSource.cxx b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx index 20c3db63117..aea4ee26bea 100644 --- a/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx +++ b/PWGHF/HFL/Tasks/taskSingleMuonSource.cxx @@ -14,7 +14,6 @@ // \author Maolin Zhang , CCNU #include "Common/Core/RecoDecay.h" -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" #include @@ -28,6 +27,7 @@ #include #include +#include #include #include #include @@ -41,7 +41,7 @@ using namespace o2; using namespace o2::aod; using namespace o2::framework; -using MyCollisions = soa::Join; +using MyCollisions = soa::Join; using McMuons = soa::Join; namespace @@ -74,15 +74,19 @@ struct HfTaskSingleMuonSource { Produces singleMuonSource; Configurable mcMaskSelection{"mcMaskSelection", 0, "McMask for correct match, valid values are 0 and 128"}; - Configurable trackType{"trackType", 0, "Muon track type, validated values are 0, 1, 2, 3 and 4"}; - Configurable charge{"charge", -1, "Muon track charge, validated values are 0, 1 and -1, 0 represents both 1 and -1"}; - - double pDcaMax = 594.0; // p*DCA maximum value for large Rabs - double rAbsMin = 26.5; // R at absorber end minimum value - double rAbsMax = 89.5; // R at absorber end maximum value - double etaLow = -3.6; // low edge of eta acceptance - double etaUp = -2.5; // up edge of eta acceptance - double edgeZ = 10.0; // edge of event position Z + Configurable trackType{"trackType", 3, "Muon track type, validated values are 0, 1, 2, 3 and 4"}; + Configurable charge{"charge", 0, "Muon track charge, validated values are 0, 1 and -1, 0 represents both 1 and -1"}; + Configurable pairSource{"pairSource", true, "check also the source of like-sign muon pairs"}; + + double pDcaMax = 594.0; // p*DCA maximum value for small Rab + double pDcaMax2 = 324.0; // p*DCA maximum value for large Rabs + double rAbsMid = 26.5; // R at absorber end minimum value + double rAbsMax = 89.5; // R at absorber end maximum value + double rAbsMin = 17.6; // R at absorber end maximum value + double etaLow = -4.0; // low edge of eta acceptance + double etaUp = -2.5; // up edge of eta acceptance + double edgeZ = 10.0; // edge of event position Z + double ptLow = 1.0; // low edge of pT for muon pairs HistogramRegistry registry{ "registry", @@ -108,14 +112,23 @@ struct HfTaskSingleMuonSource { AxisSpec const axisChi2{500, 0., 100., "#chi^{2} of MCH-MFT matching"}; AxisSpec const axisPt{200, 0., 100., "#it{p}_{T,reco} (GeV/#it{c})"}; AxisSpec const axisDeltaPt{1000, -50., 50., "#Delta #it{p}_{T} (GeV/#it{c})"}; + AxisSpec const axisMass{200, 0., 20., "Inv.Mass (GeV/#it{c}^2)"}; HistogramConfigSpec const h1ColNumber{HistType::kTH1F, {axisColNumber}}; HistogramConfigSpec const h1Pt{HistType::kTH1F, {axisPt}}; + HistogramConfigSpec h1Mass{HistType::kTH1F, {axisMass}}; HistogramConfigSpec const h2PtDCA{HistType::kTH2F, {axisPt, axisDCA}}; HistogramConfigSpec const h2PtChi2{HistType::kTH2F, {axisPt, axisChi2}}; HistogramConfigSpec const h2PtDeltaPt{HistType::kTH2F, {axisPt, axisDeltaPt}}; registry.add("h1ColNumber", "", h1ColNumber); + registry.add("h1MuBeforeCuts", "", h1Pt); + registry.add("h1MuonMass", "", h1Mass); + registry.add("h1BeautyMass", "", h1Mass); + registry.add("h1OtherMass", "", h1Mass); + registry.add("h1MuonMassGen", "", h1Mass); + registry.add("h1BeautyMassGen", "", h1Mass); + registry.add("h1OtherMassGen", "", h1Mass); for (const auto& src : muonSources) { registry.add(Form("h1%sPt", src.Data()), "", h1Pt); registry.add(Form("h2%sPtDCA", src.Data()), "", h2PtDCA); @@ -146,8 +159,8 @@ struct HfTaskSingleMuonSource { mcPart = *(mcPart.mothers_first_as()); const auto pdgAbs(std::abs(mcPart.pdgCode())); - if (pdgAbs < 10) { - break; // Quark + if (pdgAbs < 10 || pdgAbs == 21) { + break; // Quark and gluon } if (!mcPart.producedByGenerator()) { // Produced in transport code @@ -170,6 +183,9 @@ struct HfTaskSingleMuonSource { if ((pdgRem < 100) || (pdgRem >= 10000)) { continue; } + if ((pdgRem % 100 == 1 || pdgRem % 100 == 3) && pdgRem > 1000) { // diquarks + continue; + } // compute the flavor of constituent quark const int flv(pdgRem / std::pow(10, static_cast(std::log10(pdgRem)))); if (flv > 6) { @@ -325,9 +341,113 @@ struct HfTaskSingleMuonSource { } } + int traceAncestor(const McMuons::iterator& muon, aod::McParticles const& mctracks) + { + int mcNum = 0; + if (!muon.has_mcParticle()) { + return 0; + } + auto mcPart(muon.mcParticle()); + if (std::abs(mcPart.pdgCode()) != kMuonMinus) { + return 0; + } + while (mcPart.has_mothers()) { // the first hadron after hadronization + auto mother = mcPart.mothers_first_as(); + if (std::abs(mother.getGenStatusCode()) < 80) { + break; + } + mcPart = mother; + } + int flv = mcPart.pdgCode() / std::pow(10, static_cast(std::log10(std::abs(mcPart.pdgCode())))); + if (abs(flv) == 5 && mcPart.pdgCode() < 1000) + flv = -flv; + for (int i = (mcPart.mothers_first_as()).globalIndex(); i <= (mcPart.mothers_last_as()).globalIndex(); i++) { // loop over the lund string + for (auto mctrack : mctracks) { + if (mctrack.globalIndex() != i) { + continue; + } + if ((mctrack.pdgCode() != flv) && (abs(mctrack.pdgCode()) < abs(flv) * 1000)) { + continue; + } + while (mctrack.has_mothers()) { + int motherflv = (mctrack.mothers_first_as()).pdgCode() / std::pow(10, static_cast(std::log10(abs((mctrack.mothers_first_as()).pdgCode())))); // find the mother with same flavor + auto mother = (abs(motherflv) == abs(flv)) ? (mctrack.mothers_first_as()) : (mctrack.mothers_last_as()); + if ((mother.pdgCode() != mctrack.pdgCode()) && (abs(mctrack.pdgCode()) < 10)) { // both mother is not the the quark with same flavor + mcNum = mctrack.globalIndex(); + return mcNum; + } + mctrack = mother; + } + } + } + return 0; + } + bool Corr(const McMuons::iterator& muon1, const McMuons::iterator& muon2, aod::McParticles const& mcParts) + { + + int moth11(0), moth12(0), moth21(1), moth22(1); + int anc1 = traceAncestor(muon1, mcParts); + int anc2 = traceAncestor(muon2, mcParts); + if (anc1 == 0 || anc2 == 0) { + return false; + } + for (auto mcPart : mcParts) { + if (mcPart.globalIndex() == anc1) { + moth11 = (mcPart.mothers_first_as()).globalIndex(); + moth12 = (mcPart.mothers_last_as()).globalIndex(); + } + if (mcPart.globalIndex() == anc2) { + moth21 = (mcPart.mothers_first_as()).globalIndex(); + moth22 = (mcPart.mothers_last_as()).globalIndex(); + } + } + if ((moth11 == moth21) && (moth12 == moth22)) { + return true; + } + return false; // uncorrelated + } + void fillPairs(const McMuons::iterator& muon, const McMuons::iterator& muon2, aod::McParticles const& mcParts) + { + if (trackType != 3) { + return; + } + float mm = o2::constants::physics::MassMuon; + + const auto mask1(getMask(muon)); + const auto mask2(getMask(muon2)); + + ROOT::Math::PtEtaPhiMVector mu1Vec(muon.pt(), muon.eta(), muon.phi(), mm); + ROOT::Math::PtEtaPhiMVector mu2Vec(muon2.pt(), muon2.eta(), muon2.phi(), mm); + ROOT::Math::PtEtaPhiMVector dimuVec = mu1Vec + mu2Vec; + auto InvM = dimuVec.M(); + + if (!muon.has_mcParticle() || !muon2.has_mcParticle()) { + return; + } + auto mcPart1(muon.mcParticle()); + auto mcPart2(muon2.mcParticle()); + + ROOT::Math::PtEtaPhiMVector mu1VecGen(mcPart1.pt(), mcPart1.eta(), mcPart1.phi(), mm); + ROOT::Math::PtEtaPhiMVector mu2VecGen(mcPart2.pt(), mcPart2.eta(), mcPart2.phi(), mm); + ROOT::Math::PtEtaPhiMVector dimuVecGen = mu1VecGen + mu2VecGen; + auto InvMGen = dimuVecGen.M(); + + if (isMuon(mask1) && isMuon(mask2)) { + registry.fill(HIST("h1MuonMass"), InvM); + registry.fill(HIST("h1MuonMassGen"), InvMGen); + } + if (Corr(muon, muon2, mcParts) && isBeautyMu(mask1) && isBeautyMu(mask2)) { + registry.fill(HIST("h1BeautyMass"), InvM); + registry.fill(HIST("h1BeautyMassGen"), InvMGen); + } else { + registry.fill(HIST("h1OtherMass"), InvM); + registry.fill(HIST("h1OtherMassGen"), InvMGen); + } + } + void process(MyCollisions::iterator const& collision, McMuons const& muons, - aod::McParticles const&) + aod::McParticles const& mcParts) { // event selections if (std::abs(collision.posZ()) > edgeZ) { @@ -347,11 +467,15 @@ struct HfTaskSingleMuonSource { if ((eta >= etaUp) || (eta < etaLow)) { continue; } - if ((rAbs >= rAbsMax) || (rAbs < rAbsMin)) { - continue; + if ((rAbs >= rAbsMid) || (rAbs < rAbsMin)) { + if (pDca >= pDcaMax || pDca < 0) { + continue; + } } - if (pDca >= pDcaMax) { - continue; + if ((rAbs >= rAbsMax) || (rAbs < rAbsMid)) { + if (pDca >= pDcaMax2 || pDca < 0) { + continue; + } } if ((muon.chi2() >= 1e6) || (muon.chi2() < 0)) { continue; @@ -360,6 +484,48 @@ struct HfTaskSingleMuonSource { continue; } fillHistograms(muon); + if (pairSource) { + if (muon.pt() < ptLow) { + continue; + } + for (const auto& muon2 : muons) { + if (muon2.sign() != muon.sign()) { + continue; + } + if (muon2.globalIndex() <= muon.globalIndex()) { + continue; + } + // muon selections + if (muon2.trackType() != trackType) { + continue; + } + if (muon2.pt() < ptLow) { + continue; + } + const auto eta2(muon2.eta()), pDca2(muon2.pDca()), rAbs2(muon2.rAtAbsorberEnd()); + if ((eta2 >= etaUp) || (eta2 < etaLow)) { + continue; + } + if ((rAbs2 >= rAbsMid) || (rAbs2 < rAbsMin)) { + if (pDca2 >= pDcaMax || pDca2 < 0) { + continue; + } + } + if ((rAbs2 >= rAbsMax) || (rAbs2 < rAbsMid)) { + if (pDca2 >= pDcaMax2 || pDca2 < 0) { + continue; + } + } + + if ((muon2.chi2() >= 1e6) || (muon2.chi2() < 0)) { + continue; + } + if ((muon2.chi2MatchMCHMID() >= 1e6) || (muon2.chi2MatchMCHMID() < 0)) { + continue; + } + fillPairs(muon, muon2, mcParts); + } + } } // loop over muons } }; 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/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx index 47748b4c30d..a21218a5eed 100644 --- a/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx +++ b/PWGHF/TableProducer/treeCreatorXicToXiPiPi.cxx @@ -78,6 +78,9 @@ DECLARE_SOA_COLUMN(PtPi1, ptPi1, float); DECLARE_SOA_COLUMN(ImpactParameterPi1, impactParameterPi1, float); //! Normalised impact parameter of Pi1 (prong2) DECLARE_SOA_COLUMN(ImpactParameterNormalisedPi1, impactParameterNormalisedPi1, float); //! Normalised impact parameter of Pi1 (prong2) DECLARE_SOA_COLUMN(MaxNormalisedDeltaIP, maxNormalisedDeltaIP, float); //! Maximum normalized difference between measured and expected impact parameter of candidate prongs +DECLARE_SOA_COLUMN(MlScoreBkg, mlScoreBkg, float); //! ML score for background class +DECLARE_SOA_COLUMN(MlScorePrompt, mlScorePrompt, float); //! ML score for prompt signal class +DECLARE_SOA_COLUMN(MlScoreNonPrompt, mlScoreNonPrompt, float); //! ML score for non-prompt signal class (3-class model only, -1 otherwise) } // namespace full DECLARE_SOA_TABLE(HfCandXicToXiPiPiLites, "AOD", "HFXICXI2PILITE", @@ -186,6 +189,37 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteKfs, "AOD", "HFXICXI2PILITKF", hf_cand_xic_to_xi_pi_pi::DcaXYPi0Xi, hf_cand_xic_to_xi_pi_pi::DcaXYPi1Xi); +DECLARE_SOA_TABLE(HfCandXicToXiPiPiLiteMLs, "AOD", "HFXICXI2PIMLITE", + full::ParticleFlag, + hf_cand_mc_flag::OriginMcRec, + full::CandidateSelFlag, + full::Y, + full::Eta, + full::Phi, + full::P, + full::Pt, + full::M, + hf_cand_xic_to_xi_pi_pi::InvMassXi, + hf_cand_xic_to_xi_pi_pi::InvMassLambda, + full::DecayLength, + full::DecayLengthXY, + full::Cpa, + full::CpaXY, + hf_cand_xic_to_xi_pi_pi::CpaXi, + hf_cand_xic_to_xi_pi_pi::CpaXYXi, + hf_cand_xic_to_xi_pi_pi::CpaLambda, + hf_cand_xic_to_xi_pi_pi::CpaXYLambda, + full::ImpactParameterXi, + full::ImpactParameterNormalisedXi, + full::ImpactParameterPi0, + full::ImpactParameterNormalisedPi0, + full::ImpactParameterPi1, + full::ImpactParameterNormalisedPi1, + full::MaxNormalisedDeltaIP, + full::MlScoreBkg, + full::MlScorePrompt, + full::MlScoreNonPrompt); + DECLARE_SOA_TABLE(HfCandXicToXiPiPiFulls, "AOD", "HFXICXI2PIFULL", full::ParticleFlag, hf_cand_mc_flag::OriginMcRec, @@ -343,6 +377,7 @@ DECLARE_SOA_TABLE(HfCandXicToXiPiPiFullPs, "AOD", "HFXICXI2PIFULLP", struct HfTreeCreatorXicToXiPiPi { Produces rowCandidateLite; Produces rowCandidateLiteKf; + Produces rowCandidateLiteMl; Produces rowCandidateFull; Produces rowCandidateFullKf; Produces rowCandidateFullParticles; @@ -356,10 +391,14 @@ struct HfTreeCreatorXicToXiPiPi { Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of background candidates to keep for ML trainings"}; Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; + static constexpr int kNumBinaryClasses = 2; + using SelectedCandidates = soa::Filtered>; using SelectedCandidatesKf = soa::Filtered>; + using SelectedCandidatesML = soa::Filtered>; using SelectedCandidatesMc = soa::Filtered>; using SelectedCandidatesKfMc = soa::Filtered>; + using SelectedCandidatesMcML = soa::Filtered>; using MatchedGenXicToXiPiPi = soa::Filtered>; Filter filterSelectCandidates = aod::hf_sel_candidate_xic::isSelXicToXiPiPi >= selectionFlagXic; @@ -372,9 +411,13 @@ struct HfTreeCreatorXicToXiPiPi { void init(InitContext const&) { + std::array doprocess{doprocessData, doprocessDataKf, doprocessDataWithML, doprocessMc, doprocessMcKf, doprocessMcWithML}; + if (std::accumulate(doprocess.begin(), doprocess.end(), 0) != 1) { + LOGP(fatal, "Only one process function can be enabled at a time."); + } } - template + template void fillCandidateTable(const T& candidate) { int8_t particleFlag = candidate.sign(); @@ -383,7 +426,7 @@ struct HfTreeCreatorXicToXiPiPi { particleFlag = candidate.flagMcMatchRec(); originMc = candidate.originMcRec(); } - if constexpr (!DoKf) { + if constexpr (!DoKf && !DoMl) { if (fillCandidateLiteTable) { rowCandidateLite( particleFlag, @@ -484,7 +527,7 @@ struct HfTreeCreatorXicToXiPiPi { candidate.nSigTofPiFromLambda(), candidate.nSigTofPrFromLambda()); } - } else { + } else if constexpr (DoKf) { if (fillCandidateLiteTable) { rowCandidateLiteKf( particleFlag, @@ -636,6 +679,47 @@ struct HfTreeCreatorXicToXiPiPi { candidate.dcaXYPi1Xi()); } } + if constexpr (DoMl) { + float mlScoreBkg = -1.f, mlScorePrompt = -1.f, mlScoreNonPrompt = -1.f; + const int scoreSize = static_cast(candidate.mlProbXicToXiPiPi().size()); + if (scoreSize > 0) { + mlScoreBkg = candidate.mlProbXicToXiPiPi()[0]; + mlScorePrompt = candidate.mlProbXicToXiPiPi()[1]; + if (scoreSize > kNumBinaryClasses) { + mlScoreNonPrompt = candidate.mlProbXicToXiPiPi()[2]; + } + } + rowCandidateLiteMl( + particleFlag, + originMc, + candidate.isSelXicToXiPiPi(), + candidate.y(o2::constants::physics::MassXiCPlus), + candidate.eta(), + candidate.phi(), + candidate.p(), + candidate.pt(), + candidate.invMassXicPlus(), + candidate.invMassXi(), + candidate.invMassLambda(), + candidate.decayLength(), + candidate.decayLengthXY(), + candidate.cpa(), + candidate.cpaXY(), + candidate.cpaXi(), + candidate.cpaXYXi(), + candidate.cpaLambda(), + candidate.cpaXYLambda(), + candidate.impactParameter0(), + candidate.impactParameterNormalised0(), + candidate.impactParameter1(), + candidate.impactParameterNormalised1(), + candidate.impactParameter2(), + candidate.impactParameterNormalised2(), + candidate.maxNormalisedDeltaIP(), + mlScoreBkg, + mlScorePrompt, + mlScoreNonPrompt); + } } void processData(SelectedCandidates const& candidates) @@ -653,10 +737,10 @@ struct HfTreeCreatorXicToXiPiPi { continue; } } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } - PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processData, "Process data with DCAFitter reconstruction", true); + PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processData, "Process data with DCAFitter reconstruction", false); void processDataKf(SelectedCandidatesKf const& candidates) { @@ -673,11 +757,22 @@ struct HfTreeCreatorXicToXiPiPi { continue; } } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processDataKf, "Process data with KFParticle reconstruction", false); + void processDataWithML(SelectedCandidatesML const& candidates) + { + // Filling candidate properties + rowCandidateLiteMl.reserve(candidates.size()); + + for (const auto& candidate : candidates) { + fillCandidateTable(candidate); + } + } + PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processDataWithML, "Process data with DCAFitter reconstruction and ML", false); + void processMc(SelectedCandidatesMc const& candidates, MatchedGenXicToXiPiPi const& particles) { @@ -689,7 +784,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(recSig.size()); } for (const auto& candidate : recSig) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else if (fillOnlyBackground) { if (fillCandidateLiteTable) { @@ -702,7 +797,7 @@ struct HfTreeCreatorXicToXiPiPi { if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else { if (fillCandidateLiteTable) { @@ -711,7 +806,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(candidates.size()); } for (const auto& candidate : candidates) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } @@ -743,7 +838,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(recSigKf.size()); } for (const auto& candidate : recSigKf) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else if (fillOnlyBackground) { if (fillCandidateLiteTable) { @@ -756,7 +851,7 @@ struct HfTreeCreatorXicToXiPiPi { if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { continue; } - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } else { if (fillCandidateLiteTable) { @@ -765,7 +860,7 @@ struct HfTreeCreatorXicToXiPiPi { rowCandidateFull.reserve(candidates.size()); } for (const auto& candidate : candidates) { - fillCandidateTable(candidate); + fillCandidateTable(candidate); } } @@ -785,6 +880,52 @@ struct HfTreeCreatorXicToXiPiPi { } } PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processMcKf, "Process MC with KF Particle reconstruction", false); + + void processMcWithML(SelectedCandidatesMcML const& candidates, + MatchedGenXicToXiPiPi const& particles) + { + // Filling candidate properties + rowCandidateLiteMl.reserve(candidates.size()); + if (fillOnlySignal) { + for (const auto& candidate : candidates) { + if (candidate.flagMcMatchRec() == int8_t(0)) { + continue; + } + fillCandidateTable(candidate); + } + } else if (fillOnlyBackground) { + for (const auto& candidate : candidates) { + if (candidate.flagMcMatchRec() != int8_t(0)) { + continue; + } + float const pseudoRndm = candidate.ptProng1() * 1000. - static_cast(candidate.ptProng1() * 1000); + if (candidate.pt() < ptMaxForDownSample && pseudoRndm >= downSampleBkgFactor) { + continue; + } + fillCandidateTable(candidate); + } + } else { + for (const auto& candidate : candidates) { + fillCandidateTable(candidate); + } + } + + if (fillGenParticleTable) { + rowCandidateFullParticles.reserve(particles.size()); + for (const auto& particle : particles) { + rowCandidateFullParticles( + particle.flagMcMatchGen(), + particle.originMcGen(), + particle.pdgBhadMotherPart(), + particle.pt(), + particle.eta(), + particle.phi(), + RecoDecay::y(particle.pVector(), o2::constants::physics::MassXiCPlus), + particle.decayLengthMcGen()); + } + } + } + PROCESS_SWITCH(HfTreeCreatorXicToXiPiPi, processMcWithML, "Process MC with DCAFitter reconstruction and ML", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) 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/CMakeLists.txt b/PWGJE/Tasks/CMakeLists.txt index 55ec23b2c44..0275a7a66ed 100644 --- a/PWGJE/Tasks/CMakeLists.txt +++ b/PWGJE/Tasks/CMakeLists.txt @@ -317,6 +317,10 @@ if(FastJet_FOUND) SOURCES jetLundReclustering.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore FastJet::FastJet FastJet::Contrib COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(jet-lund-plane + SOURCES jetLundPlane.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore FastJet::FastJet FastJet::Contrib + COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(hf-fragmentation-function SOURCES hfFragmentationFunction.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::PWGJECore O2Physics::AnalysisCore 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..bba4f0273aa 100644 --- a/PWGJE/Tasks/jetCorrelationD0.cxx +++ b/PWGJE/Tasks/jetCorrelationD0.cxx @@ -13,10 +13,8 @@ /// \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/Core/JetHFUtilities.h" #include "PWGJE/DataModel/Jet.h" #include "PWGJE/DataModel/JetReducedData.h" @@ -29,8 +27,11 @@ #include "Framework/runDataProcessing.h" #include +#include #include +#include + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -51,12 +52,15 @@ DECLARE_SOA_TABLE(McCollisionTables, "AOD", "MCCOLLINFOTABLE", o2::soa::Index<>, d0collisionInfo::PosZ); +DECLARE_SOA_TABLE(MatchCollTables, "AOD", "MATCHCOLLTABLE", + o2::soa::Index<>, + d0collisionInfo::PosZ); + namespace collisionInfo { -// DECLARE_SOA_INDEX_COLUMN(CollisionTable, collisionTable); DECLARE_SOA_INDEX_COLUMN_CUSTOM(CollisionTable, collisionTable, "COLLINFOTABLES"); -// DECLARE_SOA_INDEX_COLUMN(McCollisionTable, mcCollisionTable); DECLARE_SOA_INDEX_COLUMN_CUSTOM(McCollisionTable, mcCollisionTable, "MCCOLLINFOTABLES"); +DECLARE_SOA_INDEX_COLUMN_CUSTOM(MatchCollTable, matchCollTable, "MATCHCOLLTABLES"); } // namespace collisionInfo namespace d0Info { @@ -77,7 +81,7 @@ DECLARE_SOA_COLUMN(D0PhiD, d0PhiD, float); DECLARE_SOA_COLUMN(D0Reflection, d0Reflection, int); } // namespace d0Info -DECLARE_SOA_TABLE(D0DataTables, "AOD", "D0DATATABLE", +DECLARE_SOA_TABLE(D0DataTables, "AOD", "D0TABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, d0Info::D0PromptBDT, @@ -107,11 +111,15 @@ DECLARE_SOA_INDEX_COLUMN(D0McPTable, d0McPTable); DECLARE_SOA_COLUMN(JetPt, jetPt, float); DECLARE_SOA_COLUMN(JetEta, jetEta, float); DECLARE_SOA_COLUMN(JetPhi, jetPhi, float); +DECLARE_SOA_COLUMN(PJetPt, pJetPt, float); +DECLARE_SOA_COLUMN(PJetEta, pJetEta, float); +DECLARE_SOA_COLUMN(PJetPhi, pJetPhi, float); // D0-jet DECLARE_SOA_COLUMN(D0JetDeltaPhi, d0JetDeltaPhi, float); +DECLARE_SOA_COLUMN(D0JetDeltaPhiP, d0JetDeltaPhiP, float); } // namespace jetInfo -DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETDATATABLE", +DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETTABLE", o2::soa::Index<>, collisionInfo::CollisionTableId, jetInfo::D0DataTableId, @@ -120,37 +128,52 @@ DECLARE_SOA_TABLE_STAGED(JetDataTables, "JETDATATABLE", jetInfo::JetPhi, jetInfo::D0JetDeltaPhi); -DECLARE_SOA_TABLE_STAGED(JetMCPTables, "JETMCPTABLE", +DECLARE_SOA_TABLE_STAGED(JetMcPTables, "JETMCPTABLE", o2::soa::Index<>, collisionInfo::McCollisionTableId, jetInfo::D0McPTableId, jetInfo::JetPt, jetInfo::JetEta, jetInfo::JetPhi, - jetInfo::D0JetDeltaPhi); + jetInfo::D0JetDeltaPhiP); + +DECLARE_SOA_TABLE_STAGED(JetMatchedTables, "JETMATCHEDTABLE", + o2::soa::Index<>, + collisionInfo::MatchCollTableId, + jetInfo::JetPt, + jetInfo::JetEta, + jetInfo::JetPhi, + jetInfo::PJetPt, + jetInfo::PJetEta, + jetInfo::PJetPhi, + jetInfo::D0JetDeltaPhi, + jetInfo::D0JetDeltaPhiP); } // namespace o2::aod struct JetCorrelationD0 { // Define new table Produces tableCollision; + Produces tableMatchedCollision; Produces tableMcCollision; Produces tableD0; - Produces tableD0MCParticle; + Produces tableD0McParticle; Produces tableJet; - Produces tableJetMCParticle; + Produces tableJetMcParticle; + Produces tableJetMatched; // Configurables Configurable eventSelections{"eventSelections", "sel8", "choose event selection"}; Configurable skipMBGapEvents{"skipMBGapEvents", false, "decide to run over MB gap events or not"}; Configurable applyRCTSelections{"applyRCTSelections", true, "decide to apply RCT selections"}; - // Configurable triggerMasks{"triggerMasks", "", "possible JE Trigger masks: fJetChLowPt,fJetChHighPt,fTrackLowPt,fTrackHighPt,fJetD0ChLowPt,fJetD0ChHighPt,fJetLcChLowPt,fJetLcChHighPt,fEMCALReadout,fJetFullHighPt,fJetFullLowPt,fJetNeutralHighPt,fJetNeutralLowPt,fGammaVeryHighPtEMCAL,fGammaVeryHighPtDCAL,fGammaHighPtEMCAL,fGammaHighPtDCAL,fGammaLowPtEMCAL,fGammaLowPtDCAL,fGammaVeryLowPtEMCAL,fGammaVeryLowPtDCAL"}; Configurable jetPtCutMin{"jetPtCutMin", 5.0, "minimum value of jet pt"}; Configurable d0PtCutMin{"d0PtCutMin", 1.0, "minimum value of d0 pt"}; + Configurable jetMcPtCutMin{"jetMcPtCutMin", 3.0, "minimum value of jet pt particle level"}; + Configurable d0McPtCutMin{"d0McPtCutMin", 0.5, "minimum value of d0 pt particle level"}; Configurable vertexZCut{"vertexZCut", 10.0, "Accepted z-vertex range"}; Configurable pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; - Configurable pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; - Configurable pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; + Configurable pTHatMaxMcD{"pTHatMaxMcD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; + Configurable pTHatMaxMcP{"pTHatMaxMcP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; Configurable pTHatAbsoluteMin{"pTHatAbsoluteMin", -99.0, "minimum value of pTHat"}; // Filters @@ -172,13 +195,14 @@ struct JetCorrelationD0 { registry.fill(HIST("hD0Phi"), d0.phi()); } template - void fillJetHistograms(T const& jet, U const& dphi) + void fillJetHistograms(T const& jet, U const& dPhi) { registry.fill(HIST("hJetPt"), jet.pt()); registry.fill(HIST("hJetEta"), jet.eta()); registry.fill(HIST("hJetPhi"), jet.phi()); registry.fill(HIST("hJet3D"), jet.pt(), jet.eta(), jet.phi()); - registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dphi); + registry.fill(HIST("h_Jet_D0_Jet_dPhi"), dPhi); + registry.fill(HIST("h_Jet_pT_D0_Jet_dPhi"), jet.pt(), dPhi); } template @@ -192,26 +216,6 @@ struct JetCorrelationD0 { registry.fill(HIST("hZvtxSelected"), collision.posZ()); return true; } - - template - // Jetbase is an MCD jet. We then loop through jettagv(MCP jets) to test if they match - // void fillMatchedHistograms(T const& jetBase, float weight = 1.0) // float leadingTrackPtBase, - void fillMatchedHistograms(T const& jetsBase, U const&, float weight = 1.0, float rho = 0.0) - { - for (const auto& jetBase : jetsBase) { - if (jetBase.has_matchedJetGeo()) { // geometric matching - for (auto const& jetTag : jetBase.template matchedJetGeo_as>()) { - registry.fill(HIST("hPtMatched"), jetBase.pt() - (rho * jetBase.area()), jetTag.pt(), weight); - registry.fill(HIST("hPtMatched1d"), jetTag.pt(), weight); - registry.fill(HIST("hPhiMatched"), jetBase.phi(), jetTag.phi(), weight); - registry.fill(HIST("hEtaMatched"), jetBase.eta(), jetTag.eta(), weight); - registry.fill(HIST("hPtResolution"), jetTag.pt(), (jetTag.pt() - (jetBase.pt() - (rho * jetBase.area()))) / jetTag.pt(), weight); - registry.fill(HIST("hPhiResolution"), jetTag.pt(), jetTag.phi() - jetBase.phi(), weight); - registry.fill(HIST("hEtaResolution"), jetTag.pt(), jetTag.eta() - jetBase.eta(), weight); - } - } - } - } void init(InitContext const&) { eventSelectionBits = jetderiveddatautilities::initialiseEventSelectionBits(static_cast(eventSelections)); @@ -239,6 +243,7 @@ struct JetCorrelationD0 { registry.add("hJetEta", "jet #eta;#eta_{jet};entries", HistType::kTH1F, {axisEta}); registry.add("hJetPhi", "jet #phi;#phi_{jet};entries", HistType::kTH1F, {axisPhi}); 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}}}); + registry.add("h_Jet_D0_Jet_dPhi", "#Delta #phi _{D^{0}, jet}", kTH1F, {{100, 0, o2::constants::math::TwoPI}}); registry.add("h_Jet_pT_D0_Jet_dPhi", "p_{T, jet} vs #Delta #phi _{D^{0}, jet}", kTH2F, {{100, 0, 100}, {100, 0, o2::constants::math::TwoPI}}); // Matching histograms @@ -277,23 +282,23 @@ struct JetCorrelationD0 { if (jet.pt() < jetPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { // this is quite loose instead of pi/2 could do 0.6 + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi(), -o2::constants::math::PI); + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); + fillJetHistograms(jet, dPhi); tableJet(tableCollision.lastIndex(), tableD0.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); } } } PROCESS_SWITCH(JetCorrelationD0, processData, "charged particle level jet analysis", true); - void processMCDetector(soa::Filtered::iterator const& collision, + void processMcDetector(soa::Filtered::iterator const& collision, aod::CandidatesD0MCD const& d0Candidates, soa::Join const& jets) { @@ -320,60 +325,110 @@ struct JetCorrelationD0 { if (jet.pt() < jetPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { // this is quite loose instead of pi/2 could do 0.6 + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0Candidate.phi(), -o2::constants::math::PI); + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); + fillJetHistograms(jet, dPhi); tableJet(tableCollision.lastIndex(), tableD0.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); } } } - PROCESS_SWITCH(JetCorrelationD0, processMCDetector, "charged particle level jet analysis", false); + PROCESS_SWITCH(JetCorrelationD0, processMcDetector, "charged detector level jet analysis", false); - void processMCParticle(aod::JetMcCollision const& collision, - aod::CandidatesD0MCP const& d0MCPCandidates, - soa::Filtered> const& jets) + void processMcParticle(aod::JetMcCollision const& collision, + aod::CandidatesD0MCP const& d0McPCandidates, + soa::Join const& jets) { - if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { // build without this + if (!jetderiveddatautilities::selectCollision(collision, eventSelectionBits, skipMBGapEvents, applyRCTSelections)) { return; } tableMcCollision(collision.posZ()); - for (const auto& d0MCPCandidate : d0MCPCandidates) { - if (d0MCPCandidate.pt() < d0PtCutMin) { + for (const auto& d0McPCandidate : d0McPCandidates) { + if (d0McPCandidate.pt() < d0McPtCutMin) { continue; } - tableD0MCParticle(tableCollision.lastIndex(), - d0MCPCandidate.originMcGen(), - d0MCPCandidate.pt(), - d0MCPCandidate.eta(), - d0MCPCandidate.phi(), - d0MCPCandidate.y()); + tableD0McParticle(tableMcCollision.lastIndex(), + d0McPCandidate.originMcGen(), + d0McPCandidate.pt(), + d0McPCandidate.eta(), + d0McPCandidate.phi(), + d0McPCandidate.y()); for (const auto& jet : jets) { - if (jet.pt() < jetPtCutMin) { + if (jet.pt() < jetMcPtCutMin) { continue; } - float dphi = RecoDecay::constrainAngle(jet.phi() - d0MCPCandidate.phi()); - if (std::abs(dphi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + float dPhi = RecoDecay::constrainAngle(jet.phi() - d0McPCandidate.phi(), -o2::constants::math::PI); + if (std::abs(dPhi - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { continue; } - fillJetHistograms(jet, dphi); - tableJetMCParticle(tableCollision.lastIndex(), - tableD0MCParticle.lastIndex(), + fillJetHistograms(jet, dPhi); + tableJetMcParticle(tableMcCollision.lastIndex(), + tableD0McParticle.lastIndex(), jet.pt(), jet.eta(), jet.phi(), - dphi); + dPhi); + } + } + } + PROCESS_SWITCH(JetCorrelationD0, processMcParticle, "charged MC Particle jets", false); + + void processMcMatched(soa::Filtered::iterator const& collision, + aod::CandidatesD0MCD const& d0Candidates, + aod::JetTracksMCD const& tracks, + aod::JetParticles const& particles, + soa::Join const& McDJets, + aod::ChargedMCParticleLevelJets const&) + { + if (!applyCollisionSelections(collision)) { + return; + } + tableMatchedCollision(collision.posZ()); + for (const auto& d0Candidate : d0Candidates) { + if (d0Candidate.pt() < d0PtCutMin) { // once settled on a mlcut, then add the lower bound of the systematics as a cut here + continue; + } + bool isMatched = false; + const auto& d0Particle = jethfutilities::matchedHFParticle(d0Candidate, tracks, particles, isMatched); + if (!isMatched) { + continue; + } + for (const auto& McDJet : McDJets) { + if (McDJet.pt() < jetPtCutMin) { + continue; + } + float dPhiD = RecoDecay::constrainAngle(McDJet.phi() - d0Candidate.phi(), -o2::constants::math::PI); + if (std::abs(dPhiD - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + continue; + } + if (McDJet.has_matchedJetGeo()) { // geometric matching + for (auto const& McPJet : McDJet.template matchedJetGeo_as()) { + float dPhiP = RecoDecay::constrainAngle(McPJet.phi() - d0Particle.phi(), -o2::constants::math::PI); + // if (std::abs(dPhiP - o2::constants::math::PI) > (o2::constants::math::PI / 2)) { + // continue; + // } + tableJetMatched(tableMatchedCollision.lastIndex(), + McDJet.pt(), + McDJet.eta(), + McDJet.phi(), + McPJet.pt(), + McPJet.eta(), + McPJet.phi(), + dPhiD, + dPhiP); + } + } } } } - PROCESS_SWITCH(JetCorrelationD0, processMCParticle, "process MC Particle jets", false); + PROCESS_SWITCH(JetCorrelationD0, processMcMatched, "process matching of particle level jets to detector level jets", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) 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/jetFinderQA.cxx b/PWGJE/Tasks/jetFinderQA.cxx index 40956d71038..c7c9e359a51 100644 --- a/PWGJE/Tasks/jetFinderQA.cxx +++ b/PWGJE/Tasks/jetFinderQA.cxx @@ -91,6 +91,7 @@ struct JetFinderQATask { Configurable multCutCheck_analyseMBGapEvents{"multCutCheck_analyseMBGapEvents", 0, "flag to choose to reject min. bias gap events; -1: MBGap only, 0: skip MBGap events, 1: analyse all events"}; Configurable doMultCutCheck{"doMultCutCheck", false, "decide to apply multCutCheck or not"}; Configurable multCutCheck_applyRCTSelections{"multCutCheck_applyRCTSelections", true, "decide to apply RCT selections"}; + Configurable multCutCheck_applyWeightCorrection{"multCutCheck_applyWeightCorrection", true, "decide to apply weight correction"}; std::vector filledJetR_Both; std::vector filledJetR_Low; @@ -100,6 +101,8 @@ struct JetFinderQATask { std::vector eventSelectionBits; int trackSelection = -1; + float simPtRef = 10.; + std::vector jetPtBins; std::vector jetPtBinsRhoAreaSub; @@ -406,13 +409,15 @@ struct JetFinderQATask { AxisSpec jetPtAxisRhoAreaSub = {400, -200., 200., "#it{p}_{T} (GeV/#it{c})"}; AxisSpec jetEtaAxis = {nBinsEta, -1.0, 1.0, "#eta"}; + registry.add("h_fakecollisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); + registry.add("h_collisions", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}); registry.add("h2_centrality_collisions", "centrality vs collisions; centrality; collisions", {HistType::kTH2F, {centAxis, {4, 0.0, 4.0}}}); - // registry.add("h2_mccollision_pthardfromweight_pthardfromhepmcxsection", "ptHard from weight vs ptHard from HepMCXSections; ptHard_weight; ptHard_hepmcxsections", {HistType::kTH2F, {{200, 0.0, 200.0}, {200, 0.0, 200.0}}}); + registry.add("h2_mccollision_pthardfromweight_pthardfromhepmcxsection", "ptHard from weight vs ptHard from HepMCXSections; ptHard_weight; ptHard_hepmcxsections", {HistType::kTH2F, {{200, 0.0, 200.0}, {200, 0.0, 200.0}}}); registry.add("h_collisions_weighted", "event status;event status;entries", {HistType::kTH1F, {{4, 0.0, 4.0}}}, doSumw2); registry.add("h2_centrality_collisions_weighted", "centrality vs collisions; centrality; collisions", {HistType::kTH2F, {centAxis, {4, 0.0, 4.0}}}, doSumw2); - // registry.add("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted", "ptHard from weight vs ptHard from HepMCXSections; ptHard_weight; ptHard_hepmcxsections", {HistType::kTH2F, {{200, 0.0, 200.0}, {200, 0.0, 200.0}}}, doSumw2); + registry.add("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted", "ptHard from weight vs ptHard from HepMCXSections; ptHard_weight; ptHard_hepmcxsections", {HistType::kTH2F, {{200, 0.0, 200.0}, {200, 0.0, 200.0}}}, doSumw2); registry.add("h_collisions_zvertex", "position of collision ;#it{Z} (cm)", {HistType::kTH1F, {{300, -15.0, 15.0}}}, doSumw2); registry.add("h_collisions_ntracks", "N_{tracks};", {HistType::kTH1F, {{10000, 0.0, 10000.0}}}, doSumw2); @@ -430,6 +435,20 @@ struct JetFinderQATask { registry.add("h2_track_pt_track_sigma1overpt", "#sigma(1/#it{p}_{T}); #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{100, 0., 10.}, {10000, 0.0, 1.0}}}); registry.add("h2_track_pt_high_track_sigma1overpt", "#sigma(1/#it{p}_{T}); #it{p}_{T,track} (GeV/#it{c})", {HistType::kTH2F, {{90, 10., 100.}, {10000, 0.0, 1.0}}}); + registry.add("h_mccollision_processid", "mccollision process id;mccollision process id;entries", {HistType::kTH1D, {{200, 0.0, 200.0}}}); + + registry.add("h_particle_pdgcode", "particle pdgcode;particle pdgcode;entries", {HistType::kTH1D, {{3000, 0.0, 3000.0}}}); + registry.add("h_particle_genstatuscode", "particle gen status code;particle gen status code;entries", {HistType::kTH1D, {{420, -210.0, 210.0}}}); + registry.add("h_particle_hepmcstatuscode", "particle hep mc status code;particle hep mc status code;entries", {HistType::kTH1D, {{210, 0.0, 210.0}}}); + registry.add("h_particle_process", "particle process;particle process;entries", {HistType::kTH1D, {{50, 0.0, 50.0}}}); + registry.add("h_particle_producedbygenerator", "particle producedByGenerator status;particle producedByGenerator status;entries", {HistType::kTH1D, {{2, 0.0, 2}}}); + + registry.add("h_particle_primary_pdgcode", "primary particle pdgcode;primary particle pdgcode;entries", {HistType::kTH1D, {{3000, 0.0, 3000.0}}}); + registry.add("h_particle_primary_genstatuscode", "primary particle gen status code;primary particle gen status code;entries", {HistType::kTH1D, {{420, -210.0, 210.0}}}); + registry.add("h_particle_primary_hepmcstatuscode", "primary particle hep mc status code;primary particle hep mc status code;entries", {HistType::kTH1D, {{210, 0.0, 210.0}}}); + registry.add("h_particle_primary_process", "primary particle process;primary particle process;entries", {HistType::kTH1D, {{50, 0.0, 50.0}}}); + registry.add("h_particle_primary_producedbygenerator", "primary particle producedByGenerator status;primary particle producedByGenerator status;entries", {HistType::kTH1D, {{2, 0.0, 2}}}); + registry.add("h_jet_pt", "jet pT;#it{p}_{T,jet} (GeV/#it{c}); counts", {HistType::kTH1F, {jetPtAxis}}, doSumw2); registry.add("h_jet_eta", "jet eta;#eta; counts", {HistType::kTH1F, {jetEtaAxis}}, doSumw2); registry.add("h_jet_phi", "jet phi;#phi; counts", {HistType::kTH1F, {phiAxis}}, doSumw2); @@ -444,6 +463,7 @@ struct JetFinderQATask { } 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 && ((checkCentFT0M ? aod::jcollision::centFT0M : aod::jcollision::centFT0C) >= centralityMin) && ((checkCentFT0M ? aod::jcollision::centFT0M : aod::jcollision::centFT0C) < centralityMax)); @@ -1471,17 +1491,14 @@ struct JetFinderQATask { } PROCESS_SWITCH(JetFinderQATask, processOccupancyQA, "occupancy QA on jet derived data", false); - void processQcMultCutCheck(soa::Filtered>::iterator const& collision, + void processQcMultCutCheck(soa::Filtered>::iterator const& collision, + soa::Join const&, + // soa::Join const& aodMcCollisions, soa::Join const& mcdjets, - soa::Filtered> const& tracks) + soa::Filtered> const& tracks, + soa::Filtered const& mcparticles) { - bool fillHistograms = true; - bool isWeighted = true; - float eventWeight = collision.weight(); - if (!applyCollisionCuts_multCutCheck(collision, fillHistograms, isWeighted, eventWeight)) { - return; - } - registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); + float eventWeight = multCutCheck_applyWeightCorrection ? collision.weight() : 1; bool hasJetAboveMultCut = false; for (auto const& mcdjet : mcdjets) { @@ -1493,6 +1510,24 @@ struct JetFinderQATask { return; } + bool fillHistograms = true; + bool isWeighted = multCutCheck_applyWeightCorrection; + if (!applyCollisionCuts_multCutCheck(collision, fillHistograms, isWeighted, eventWeight)) { + return; + } + registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); + + if (collision.has_mcCollision()) { // the collision is not fake and has one associated mc coll; .mccollision() can be called + auto jetMcCollision = collision.mcCollision_as>(); + auto aodMcCollision = jetMcCollision.mcCollision_as>(); + + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(collision.weight(), 1.0 / pTHatExponent)), jetMcCollision.ptHard()); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted"), simPtRef / (std::pow(collision.weight(), 1.0 / pTHatExponent)), jetMcCollision.ptHard(), eventWeight); + registry.fill(HIST("h_mccollision_processid"), aodMcCollision.processId(), eventWeight); + } else { + registry.fill(HIST("h_fakecollisions"), 0.5); + } + registry.fill(HIST("h_collisions_ntracks"), tracks.size(), eventWeight); registry.fill(HIST("h2_centrality_ntracks"), collision.centFT0M(), tracks.size(), eventWeight); registry.fill(HIST("h_collisions_njets"), mcdjets.size(), eventWeight); @@ -1501,6 +1536,9 @@ struct JetFinderQATask { registry.fill(HIST("h2_centrality_rho"), collision.centFT0M(), collision.rho(), eventWeight); for (auto const& track : tracks) { + if (!jetderiveddatautilities::selectTrack(track, trackSelection)) { + continue; + } registry.fill(HIST("h2_centrality_track_pt"), collision.centFT0M(), track.pt(), eventWeight); registry.fill(HIST("h2_centrality_track_eta"), collision.centFT0M(), track.eta(), eventWeight); registry.fill(HIST("h2_track_pt_track_sigma1overpt"), track.pt(), track.sigma1Pt(), eventWeight); @@ -1509,6 +1547,21 @@ struct JetFinderQATask { registry.fill(HIST("h2_track_pt_high_track_sigmapt"), track.pt(), track.sigma1Pt() * track.pt(), eventWeight); } + for (auto const& mcparticle : mcparticles) { + registry.fill(HIST("h_particle_pdgcode"), mcparticle.pdgCode(), eventWeight); + registry.fill(HIST("h_particle_genstatuscode"), mcparticle.getGenStatusCode(), eventWeight); + registry.fill(HIST("h_particle_hepmcstatuscode"), mcparticle.getHepMCStatusCode(), eventWeight); + registry.fill(HIST("h_particle_process"), mcparticle.getProcess(), eventWeight); + registry.fill(HIST("h_particle_producedbygenerator"), mcparticle.producedByGenerator(), eventWeight); + if (mcparticle.isPhysicalPrimary()) { + registry.fill(HIST("h_particle_primary_pdgcode"), mcparticle.pdgCode(), eventWeight); + registry.fill(HIST("h_particle_primary_genstatuscode"), mcparticle.getGenStatusCode(), eventWeight); + registry.fill(HIST("h_particle_primary_hepmcstatuscode"), mcparticle.getHepMCStatusCode(), eventWeight); + registry.fill(HIST("h_particle_primary_process"), mcparticle.getProcess(), eventWeight); + registry.fill(HIST("h_particle_primary_producedbygenerator"), mcparticle.producedByGenerator(), eventWeight); + } + } + for (auto const& mcdjet : mcdjets) { registry.fill(HIST("h_jet_pt"), mcdjet.pt(), eventWeight); registry.fill(HIST("h_jet_eta"), mcdjet.eta(), eventWeight); 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/jetLundPlane.cxx b/PWGJE/Tasks/jetLundPlane.cxx new file mode 100644 index 00000000000..eaa2af5b3a6 --- /dev/null +++ b/PWGJE/Tasks/jetLundPlane.cxx @@ -0,0 +1,804 @@ +// 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 jetLundPlane.cxx +/// \brief Task for jet Lund plane. Creates histograms for offline unfolding (including QA histos), and optionally tables. +/// \author Zoltan Varga + +#include "PWGJE/Core/FastJetUtilities.h" +#include "PWGJE/Core/JetFinder.h" +#include "PWGJE/DataModel/Jet.h" +#include "PWGJE/DataModel/JetReducedData.h" + +#include "Common/Core/RecoDecay.h" + +#include "CommonConstants/MathConstants.h" +#include "CommonConstants/PhysicsConstants.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 + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; + +// Mini-AOD (tables) +namespace o2::aod +{ +// Parent table: one row per collision stored in the MiniAOD +DECLARE_SOA_COLUMN(MiniCollTag, miniCollTag, uint8_t); +DECLARE_SOA_TABLE(MiniCollisions, "AOD", "MINICOLL", + MiniCollTag); + +// MiniJets -> MiniCollisions +DECLARE_SOA_INDEX_COLUMN_CUSTOM(MiniCollision, miniCollision, "MINICOLLS"); + +// Jet payload +DECLARE_SOA_COLUMN(Level, level, uint8_t); // JetLevel::Det=reco(det), JetLevel::Part=truth(part) +DECLARE_SOA_COLUMN(JetRint, jetRint, int32_t); // jet.r() as stored (int R*100) +DECLARE_SOA_COLUMN(JetPt, jetPt, float); +DECLARE_SOA_COLUMN(JetEta, jetEta, float); +DECLARE_SOA_COLUMN(JetPhi, jetPhi, float); + +DECLARE_SOA_TABLE(MiniJets, "AOD", "MINIJET", + MiniCollisionId, Level, JetRint, JetPt, JetEta, JetPhi); + +// MiniSplittings -> MiniJets +DECLARE_SOA_INDEX_COLUMN(MiniJet, miniJet); + +// Per-splitting observables (primary branch) +DECLARE_SOA_COLUMN(SplitId, splitId, uint16_t); +DECLARE_SOA_COLUMN(DeltaR, deltaR, float); +DECLARE_SOA_COLUMN(PtSoft, ptSoft, float); +DECLARE_SOA_COLUMN(PtHard, ptHard, float); +DECLARE_SOA_COLUMN(SoftEta, softEta, float); +DECLARE_SOA_COLUMN(SoftPhi, softPhi, float); + +DECLARE_SOA_TABLE(MiniSplittings, "AOD", "MINISPL", + MiniJetId, SplitId, DeltaR, PtSoft, PtHard, SoftEta, SoftPhi, JetPt); + +// Jet-jet matching (MC) +DECLARE_SOA_COLUMN(MatchDR, matchDR, float); +DECLARE_SOA_COLUMN(MatchRelPt, matchRelPt, float); + +DECLARE_SOA_INDEX_COLUMN_FULL(DetMiniJet, detMiniJet, int, MiniJets, "_Det"); +DECLARE_SOA_INDEX_COLUMN_FULL(PartMiniJet, partMiniJet, int, MiniJets, "_Part"); + +DECLARE_SOA_TABLE(MiniJetMatches, "AOD", "MINIMCH", + DetMiniJetId, + PartMiniJetId, + MatchDR, + MatchRelPt); +} // namespace o2::aod + +namespace +{ +constexpr float kTiny = 1e-12f; +constexpr uint64_t collisionKeyShift = 1ULL; +constexpr uint64_t partCollisionKeyTag = 1ULL; +constexpr size_t MinConstituentsForJet = 2; + +struct JetLevel { + enum Type : uint8_t { + Det = 0, + Part = 1 + }; +}; + +template +float jetRfromTable(const JetT& jet) +{ + return static_cast(jet.r()) * 0.01f; +} + +struct SplittingObs { + float deltaR{}; + float ptSoft{}; + float ptHard{}; + float kT{}; + float lnRoverDR{}; + float lnkt{}; + float z{}; + float softEta{}; + float softPhi{}; +}; + +struct SplitMatchPair { + size_t recoIdx{}; + size_t truthIdx{}; + float dR{}; +}; + +struct JetMatchInfo { + uint64_t otherKey{}; + float dR{1e9f}; + float relPt{-1.f}; + float otherPt{}; +}; + +inline float deltaPhi(float phi1, float phi2) +{ + return RecoDecay::constrainAngle(phi1 - phi2, -o2::constants::math::PI); +} + +inline float splittingMatchDistance(const SplittingObs& a, const SplittingObs& b) +{ + return std::hypot(a.softEta - b.softEta, deltaPhi(a.softPhi, b.softPhi)); +} + +std::vector buildUniqueSplittingMatches(const std::vector& recoSpl, + const std::vector& truthSpl, + float maxDR) +{ + std::vector matches; + matches.reserve(std::min(recoSpl.size(), truthSpl.size())); + + if (recoSpl.empty() || truthSpl.empty()) { + return matches; + } + + // Mutual-nearest-neighbor matching in the soft-prong (eta,phi) coordinates: + // 1) for each truth splitting, find the closest reco splitting within maxDR + // 2) for that reco splitting, find the closest truth splitting within maxDR + // 3) keep the pair only if the reco splitting points back to the original truth splitting + for (size_t truthIdx = 0; truthIdx < truthSpl.size(); ++truthIdx) { + float bestRecoDR = maxDR; + size_t bestRecoIdx = recoSpl.size(); + + for (size_t recoIdx = 0; recoIdx < recoSpl.size(); ++recoIdx) { + const float dR = splittingMatchDistance(recoSpl[recoIdx], truthSpl[truthIdx]); + if (dR < bestRecoDR) { + bestRecoDR = dR; + bestRecoIdx = recoIdx; + } + } + + if (bestRecoIdx == recoSpl.size()) { + continue; + } + + float bestTruthDR = maxDR; + size_t reverseTruthIdx = truthSpl.size(); + for (size_t candTruthIdx = 0; candTruthIdx < truthSpl.size(); ++candTruthIdx) { + const float dR = splittingMatchDistance(recoSpl[bestRecoIdx], truthSpl[candTruthIdx]); + if (dR < bestTruthDR) { + bestTruthDR = dR; + reverseTruthIdx = candTruthIdx; + } + } + + if (reverseTruthIdx == truthIdx) { + matches.push_back({bestRecoIdx, truthIdx, bestRecoDR}); + } + } + + return matches; +} + +template +std::vector buildFastJetInputs(ConstituentRangeT&& constituents, float trackPtMin) +{ + std::vector fjInputs; + fjInputs.reserve(64); + for (auto const& c : constituents) { + if (c.pt() < trackPtMin) { + continue; + } + const float mPi = o2::constants::physics::MassPiPlus; + const float e = std::sqrt(c.p() * c.p() + mPi * mPi); + fjInputs.emplace_back(c.px(), c.py(), c.pz(), e); + } + return fjInputs; +} + +std::vector primaryDeclusteringSplittings(fastjet::PseudoJet jetCA, float jetR) +{ + std::vector out; + out.reserve(32); + + fastjet::PseudoJet p1, p2; + while (jetCA.has_parents(p1, p2)) { + if (p2.perp() > p1.perp()) { + std::swap(p1, p2); + } + const float pt1 = p1.perp(); + const float pt2 = p2.perp(); + const float pt = pt1 + pt2; + if (pt <= kTiny) { + break; + } + const float z = pt2 / pt; + const float dR = p1.delta_R(p2); + const float kT = pt2 * std::sin(dR); + + if (dR > kTiny && kT > kTiny && z > kTiny) { + SplittingObs s; + s.deltaR = dR; + s.ptSoft = pt2; + s.ptHard = pt1; + s.kT = kT; + s.lnRoverDR = std::log(jetR / dR); + s.lnkt = std::log(kT); + s.z = z; + s.softEta = p2.eta(); + s.softPhi = p2.phi_std(); + out.push_back(s); + } + jetCA = p1; // follow hard branch (primary Lund) + } + return out; +} + +} // namespace + +struct JetLundPlaneUnfolding { + // Config + Configurable vertexZCut{"vertexZCut", 10.f, "|z_vtx| cut"}; + Configurable jetPtMin{"jetPtMin", 20.f, "min reco jet pT"}; + Configurable jetEtaMin{"jetEtaMin", -0.5f, "min jet eta"}; + Configurable jetEtaMax{"jetEtaMax", 0.5f, "max jet eta"}; + Configurable jetR{"jetR", 0.4f, "jet radius (must match derived tables)"}; + Configurable trackPtMin{"trackPtMin", 0.15f, "min constituent pT"}; + + Configurable nBinsJetPt{"nBinsJetPt", 200, "jet pT bins"}; + Configurable jetPtMax{"jetPtMax", 200.f, "jet pT max"}; + + Configurable nBinsLund{"nBinsLund", 120, "lund bins (lnR/DR and lnkt)"}; + Configurable lnRoverDRMin{"lnRoverDRMin", -1.f, "min ln(R/DR)"}; + Configurable lnRoverDRMax{"lnRoverDRMax", 6.f, "max ln(R/DR)"}; + Configurable lnKtMin{"lnKtMin", -6.f, "min ln(kT)"}; + Configurable lnKtMax{"lnKtMax", 6.f, "max ln(kT)"}; + + // switches (runtime) + Configurable writeMiniAOD{"writeMiniAOD", true, "write mini-AOD tables (jets, splittings, matching)"}; + + // matching knobs (applied on top of matching relations) + Configurable matchMaxDR{"matchMaxDR", 0.2f, "max ΔR between det and part jet"}; + Configurable splitMatchMaxDR{"splitMatchMaxDR", 0.1f, "max ΔR between reco and truth splittings (soft prong)"}; + Configurable matchUseRelPt{"matchUseRelPt", true, "apply relative pT compatibility cut"}; + Configurable matchMaxRelPtDiff{"matchMaxRelPtDiff", 0.5f, "max |pTdet-pTpart|/pTpart"}; + + // Registry + HistogramRegistry registry{"registry"}; + + // Mini-AOD outputs (optional) + Produces outMiniCollisions; + Produces outMiniJets; + Produces outMiniSplittings; + Produces outMiniJetMatches; + + // FastJet reclustering setup (C/A) + JetFinder reclusterer; + std::vector jetReclustered; + + void init(InitContext const&) + { + const int nbPt = nBinsJetPt.value; + const float ptMax = jetPtMax.value; + const int nbL = nBinsLund.value; + + registry.add("hEventCount", "Event counter;step;counts", HistType::kTH1F, {{10, 0.f, 10.f}}); + registry.add("hJetCountSummary", "Jet count summary;category;counts", HistType::kTH1F, {{6, 0.5f, 6.5f}}); + + // Jet spectra / matching QA + registry.add("hJetPtRecoAll", "Reco jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + registry.add("hJetPtRecoMatched", "Reco matched jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + registry.add("hJetPtRecoFake", "Reco unmatched (fake) jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + + registry.add("hJetPtTruthAll", "Truth jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + registry.add("hJetPtTruthMatched", "Truth matched jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + registry.add("hJetPtTruthMiss", "Truth unmatched (miss) jets;p_{T}^{jet} (GeV/c);counts", HistType::kTH1F, {{nbPt, 0.f, ptMax}}); + + // Jet pT response (1D unfolding) + registry.add("hJetPtResponse", "Jet pT response;p_{T}^{det};p_{T}^{part}", HistType::kTH2F, + {{nbPt, 0.f, ptMax}, {nbPt, 0.f, ptMax}}); + + // Lund reco / truth (3D) + registry.add("hLundReco3D", "Primary Lund (reco);ln(R/#DeltaR);ln(k_{T});p_{T}^{jet}", + HistType::kTH3F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, + {nbL, lnKtMin.value, lnKtMax.value}, + {nbPt, 0.f, ptMax}}); + + registry.add("hLundTruth3D", "Primary Lund (truth);ln(R/#DeltaR);ln(k_{T});p_{T}^{jet}", + HistType::kTH3F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, + {nbL, lnKtMin.value, lnKtMax.value}, + {nbPt, 0.f, ptMax}}); + + // 6D response for 3D unfolding: + // (det lnR/DR, det lnkt, det jetpt, part lnR/DR, part lnkt, part jetpt) + registry.add("hLundResponse6D", + "Lund response 6D;" + "ln(R/#DeltaR)_{det};ln(k_{T})_{det};p_{T}^{det};" + "ln(R/#DeltaR)_{part};ln(k_{T})_{part};p_{T}^{part}", + HistType::kTHnSparseF, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, + {nbL, lnKtMin.value, lnKtMax.value}, + {nbPt, 0.f, ptMax}, + {nbL, lnRoverDRMin.value, lnRoverDRMax.value}, + {nbL, lnKtMin.value, lnKtMax.value}, + {nbPt, 0.f, ptMax}}); + + // Early QA histograms for declustering and matching + registry.add("hNSplittingsReco", "Number of primary splittings (reco);N_{split};counts", HistType::kTH1F, {{40, -0.5f, 39.5f}}); + registry.add("hNSplittingsTruth", "Number of primary splittings (truth);N_{split};counts", HistType::kTH1F, {{40, -0.5f, 39.5f}}); + registry.add("hNSplittingsVsJetPtReco", "Reco primary splittings;#it{p}_{T}^{jet} (GeV/#it{c});N_{split}", HistType::kTH2F, {{nbPt, 0.f, ptMax}, {40, -0.5f, 39.5f}}); + registry.add("hNSplittingsVsJetPtTruth", "Truth primary splittings;#it{p}_{T}^{jet} (GeV/#it{c});N_{split}", HistType::kTH2F, {{nbPt, 0.f, ptMax}, {40, -0.5f, 39.5f}}); + + registry.add("hDeltaRReco", "Reco splitting #DeltaR;#DeltaR;counts", HistType::kTH1F, {{120, 0.f, 1.2f}}); + registry.add("hDeltaRTruth", "Truth splitting #DeltaR;#DeltaR;counts", HistType::kTH1F, {{120, 0.f, 1.2f}}); + registry.add("hLnRoverDRReco", "Reco splitting ln(R/#DeltaR);ln(R/#DeltaR);counts", HistType::kTH1F, {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}}); + registry.add("hLnRoverDRTruth", "Truth splitting ln(R/#DeltaR);ln(R/#DeltaR);counts", HistType::kTH1F, {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}}); + registry.add("hLnKtReco", "Reco splitting ln(k_{T});ln(k_{T});counts", HistType::kTH1F, {{nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hLnKtTruth", "Truth splitting ln(k_{T});ln(k_{T});counts", HistType::kTH1F, {{nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hKtReco", "Reco splitting k_{T};k_{T};counts", HistType::kTH1F, {{200, 0.f, 20.f}}); + registry.add("hKtTruth", "Truth splitting k_{T};k_{T};counts", HistType::kTH1F, {{200, 0.f, 20.f}}); + + registry.add("hJetMatchDR", "Matched jet #DeltaR;#DeltaR(det,part);counts", HistType::kTH1F, {{100, 0.f, 1.f}}); + registry.add("hJetMatchRelPt", "Matched jet relative #it{p}_{T} difference;|#it{p}_{T}^{det}-#it{p}_{T}^{part}|/#it{p}_{T}^{part};counts", HistType::kTH1F, {{100, 0.f, 2.f}}); + registry.add("hJetPtResidual", "Jet #it{p}_{T} residual;(#it{p}_{T}^{det}-#it{p}_{T}^{part})/#it{p}_{T}^{part};counts", HistType::kTH1F, {{160, -2.f, 2.f}}); + registry.add("hLnRoverDRResidual", "Splitting ln(R/#DeltaR) residual;ln(R/#DeltaR)_{det}-ln(R/#DeltaR)_{part};counts", HistType::kTH1F, {{160, -4.f, 4.f}}); + registry.add("hLnKtResidual", "Splitting ln(k_{T}) residual;ln(k_{T})_{det}-ln(k_{T})_{part};counts", HistType::kTH1F, {{160, -6.f, 6.f}}); + registry.add("hSplitMatchDR", "Matched splitting #DeltaR (soft prong);#DeltaR_{match};counts", HistType::kTH1F, {{120, 0.f, 1.2f}}); + + registry.add("hSplitTruthDen", "Truth splitting denominator;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hSplitTruthMatched", "Truth matched splitting numerator;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hSplitTruthMiss", "Truth missed splittings;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + + registry.add("hSplitRecoDen", "Reco splitting denominator;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hSplitRecoMatched", "Reco matched splitting numerator;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + registry.add("hSplitRecoFake", "Reco fake splittings;ln(R/#DeltaR);ln(k_{T})", HistType::kTH2F, + {{nbL, lnRoverDRMin.value, lnRoverDRMax.value}, {nbL, lnKtMin.value, lnKtMax.value}}); + + // reclusterer config + reclusterer.isReclustering = true; + reclusterer.algorithm = fastjet::cambridge_algorithm; + reclusterer.jetR = 1.0; // recluster radius for declustering tree + reclusterer.recombScheme = fastjet::E_scheme; + reclusterer.strategy = fastjet::Best; + reclusterer.areaType = fastjet::active_area; + } + + // Filters for reco jets (data or MC reco) + Filter collisionFilter = (nabs(aod::jcollision::posZ) < vertexZCut.node()); + Filter jetFilter = (aod::jet::pt > jetPtMin.node()) && + (aod::jet::eta > jetEtaMin.node()) && + (aod::jet::eta < jetEtaMax.node()) && + (aod::jet::r == nround(jetR.node() * 100.f)); + + // Type aliases + using RecoJets = soa::Join; + using DetJetsMatched = soa::Join; + using PartJetsMatched = soa::Join; + + template + bool passJetFiducial(JetT const& jet, int rWanted) const + { + return (jet.r() == rWanted) && (jet.pt() > jetPtMin.value) && (jet.eta() > jetEtaMin.value) && (jet.eta() < jetEtaMax.value); + } + + void fillJetCountSummary(int bin) + { + registry.fill(HIST("hJetCountSummary"), static_cast(bin)); + } + + // Helpers to fill Lund from a jet row + template + std::vector getPrimarySplittings(JetRowT const& jet, ConstituentTableT const&) + { + auto fjInputs = buildFastJetInputs(jet.template tracks_as(), trackPtMin.value); + if (fjInputs.size() < MinConstituentsForJet) { + return {}; + } + + jetReclustered.clear(); + fastjet::ClusterSequenceArea cs(reclusterer.findJets(fjInputs, jetReclustered)); + jetReclustered = sorted_by_pt(jetReclustered); + if (jetReclustered.empty()) { + return {}; + } + + const float rjet = jetRfromTable(jet); + return primaryDeclusteringSplittings(jetReclustered[0], rjet); + } + + void fillPrimaryLund3DFromSplittings(std::vector const& spl, float jetPt, bool isTruth, float weight = 1.f) + { + for (auto const& s : spl) { + if (isTruth) { + registry.fill(HIST("hLundTruth3D"), s.lnRoverDR, s.lnkt, jetPt, weight); + } else { + registry.fill(HIST("hLundReco3D"), s.lnRoverDR, s.lnkt, jetPt, weight); + } + } + } + + template + void fillPrimaryLund3D(JetRowT const& jet, ConstituentTableT const& constituents, bool isTruth, float weight = 1.f) + { + fillPrimaryLund3DFromSplittings(getPrimarySplittings(jet, constituents), jet.pt(), isTruth, weight); + } + + void fillSplittingQAHists(std::vector const& splittings, bool isTruth, float jetPt) + { + if (isTruth) { + registry.fill(HIST("hNSplittingsTruth"), static_cast(splittings.size())); + registry.fill(HIST("hNSplittingsVsJetPtTruth"), jetPt, static_cast(splittings.size())); + } else { + registry.fill(HIST("hNSplittingsReco"), static_cast(splittings.size())); + registry.fill(HIST("hNSplittingsVsJetPtReco"), jetPt, static_cast(splittings.size())); + } + + for (auto const& s : splittings) { + if (isTruth) { + registry.fill(HIST("hDeltaRTruth"), s.deltaR); + registry.fill(HIST("hLnRoverDRTruth"), s.lnRoverDR); + registry.fill(HIST("hLnKtTruth"), s.lnkt); + registry.fill(HIST("hKtTruth"), s.kT); + } else { + registry.fill(HIST("hDeltaRReco"), s.deltaR); + registry.fill(HIST("hLnRoverDRReco"), s.lnRoverDR); + registry.fill(HIST("hLnKtReco"), s.lnkt); + registry.fill(HIST("hKtReco"), s.kT); + } + } + } + + std::vector fillSplittingCorrectionHists(std::vector const& recoSpl, std::vector const& truthSpl) + { + for (auto const& s : truthSpl) { + registry.fill(HIST("hSplitTruthDen"), s.lnRoverDR, s.lnkt); + } + for (auto const& s : recoSpl) { + registry.fill(HIST("hSplitRecoDen"), s.lnRoverDR, s.lnkt); + } + + const auto matches = buildUniqueSplittingMatches(recoSpl, truthSpl, splitMatchMaxDR.value); + std::vector recoUsed(recoSpl.size(), false); + std::vector truthUsed(truthSpl.size(), false); + + for (const auto& m : matches) { + recoUsed[m.recoIdx] = true; + truthUsed[m.truthIdx] = true; + registry.fill(HIST("hSplitRecoMatched"), recoSpl[m.recoIdx].lnRoverDR, recoSpl[m.recoIdx].lnkt); + registry.fill(HIST("hSplitTruthMatched"), truthSpl[m.truthIdx].lnRoverDR, truthSpl[m.truthIdx].lnkt); + registry.fill(HIST("hSplitMatchDR"), m.dR); + } + + for (size_t i = 0; i < truthSpl.size(); ++i) { + if (!truthUsed[i]) { + registry.fill(HIST("hSplitTruthMiss"), truthSpl[i].lnRoverDR, truthSpl[i].lnkt); + } + } + for (size_t i = 0; i < recoSpl.size(); ++i) { + if (!recoUsed[i]) { + registry.fill(HIST("hSplitRecoFake"), recoSpl[i].lnRoverDR, recoSpl[i].lnkt); + } + } + return matches; + } + + // DATA / RECO PROCESSING + void processData(soa::Filtered::iterator const&, + soa::Filtered const& jets, + aod::JetTracks const& tracks) + { + registry.fill(HIST("hEventCount"), 0.5); + + int miniCollIdx = -1; + if (writeMiniAOD.value) { + outMiniCollisions(static_cast(0)); + miniCollIdx = outMiniCollisions.lastIndex(); + } + for (auto const& jet : jets) { + registry.fill(HIST("hJetPtRecoAll"), jet.pt()); + auto spl = getPrimarySplittings(jet, tracks); + fillPrimaryLund3DFromSplittings(spl, jet.pt(), /*isTruth*/ false); + fillSplittingQAHists(spl, /*isTruth*/ false, jet.pt()); + + if (writeMiniAOD.value) { + outMiniJets(miniCollIdx, /*level*/ JetLevel::Det, jet.r(), jet.pt(), jet.eta(), jet.phi()); + const int miniJetIdx = outMiniJets.lastIndex(); + + uint16_t sid = 0; + for (auto const& s : spl) { + outMiniSplittings(miniJetIdx, sid++, s.deltaR, s.ptSoft, s.ptHard, s.softEta, s.softPhi, jet.pt()); + } + } + } + } + PROCESS_SWITCH(JetLundPlaneUnfolding, processData, "Reco/data Lund + jet spectra", true); + + // MC PROCESSING (det + part + response) + + void processMC(DetJetsMatched const& detJets, + PartJetsMatched const& partJets, + aod::JetCollisions const&, + aod::JetTracks const& tracks, + aod::JetParticles const& particles) + { + registry.fill(HIST("hEventCount"), 1.5); + + const int rWanted = static_cast(std::lround(jetR.value * 100.f)); + std::unordered_map truthMatchedById; + std::unordered_map> truthSplittingsById; + std::unordered_map truthBestDet; + std::unordered_set detSplittingsWritten; + std::unordered_set truthSplittingsWritten; + auto h6 = registry.get(HIST("hLundResponse6D")); + + // Transient maps used only during this task execution to avoid duplicating + // MiniCollision / MiniJet rows and to translate framework-local indices into + // merge-safe MiniAOD row indices. + std::unordered_map detMiniCollByKey; + std::unordered_map partMiniCollByKey; + std::unordered_map detJetToMiniJetIdx; + std::unordered_map partJetToMiniJetIdx; + + // --- Truth pass --- + // Fill inclusive truth histograms, cache truth splittings, write all accepted + // truth jets to MiniJets, and determine the best detector candidate for each truth jet. + for (auto const& partJet : partJets) { + if (!passJetFiducial(partJet, rWanted)) { + continue; + } + + registry.fill(HIST("hJetPtTruthAll"), partJet.pt()); + fillJetCountSummary(4); + + const uint64_t truthJetKey = partJet.globalIndex(); + auto spl = getPrimarySplittings(partJet, particles); + truthSplittingsById[truthJetKey] = spl; + + fillPrimaryLund3DFromSplittings(spl, partJet.pt(), /*isTruth*/ true); + fillSplittingQAHists(spl, /*isTruth*/ true, partJet.pt()); + + if (writeMiniAOD.value) { + const uint64_t partCollKey = + (static_cast(partJet.mcCollisionId()) << collisionKeyShift) | partCollisionKeyTag; + int partMiniCollIdx = -1; + auto collIt = partMiniCollByKey.find(partCollKey); + if (collIt == partMiniCollByKey.end()) { + outMiniCollisions(static_cast(0)); + partMiniCollIdx = outMiniCollisions.lastIndex(); + partMiniCollByKey.emplace(partCollKey, partMiniCollIdx); + } else { + partMiniCollIdx = collIt->second; + } + + outMiniJets(partMiniCollIdx, /*level*/ JetLevel::Part, partJet.r(), partJet.pt(), partJet.eta(), partJet.phi()); + partJetToMiniJetIdx[truthJetKey] = outMiniJets.lastIndex(); + } + + if (!partJet.has_matchedJetGeo()) { + continue; + } + + JetMatchInfo bestDet{}; + bool foundDet = false; + for (auto const& candDetJet : partJet.template matchedJetGeo_as()) { + if (!passJetFiducial(candDetJet, rWanted)) { + continue; + } + + const float dR = std::hypot(candDetJet.eta() - partJet.eta(), + deltaPhi(candDetJet.phi(), partJet.phi())); + if (dR > matchMaxDR.value) { + continue; + } + + const float rel = std::abs(candDetJet.pt() - partJet.pt()) / std::max(partJet.pt(), kTiny); + if (matchUseRelPt.value && rel > matchMaxRelPtDiff.value) { + continue; + } + + if (!foundDet || dR < bestDet.dR) { + bestDet.otherKey = candDetJet.globalIndex(); + bestDet.dR = dR; + bestDet.relPt = rel; + bestDet.otherPt = candDetJet.pt(); + foundDet = true; + } + } + if (foundDet) { + truthBestDet[truthJetKey] = bestDet; + } + } + + // --- Detector loop --- + // Write all accepted detector jets to MiniJets. A final matched pair is accepted only + // if the detector jet and truth jet are mutual best matches under the same cuts. + for (auto const& detJet : detJets) { + if (!passJetFiducial(detJet, rWanted)) { + continue; + } + + registry.fill(HIST("hJetPtRecoAll"), detJet.pt()); + fillJetCountSummary(1); + + const uint64_t detJetKey = detJet.globalIndex(); + auto detSpl = getPrimarySplittings(detJet, tracks); + fillPrimaryLund3DFromSplittings(detSpl, detJet.pt(), /*isTruth*/ false); + fillSplittingQAHists(detSpl, /*isTruth*/ false, detJet.pt()); + + if (writeMiniAOD.value) { + const uint64_t detCollKey = + (static_cast(detJet.collisionId()) << collisionKeyShift); + int detMiniCollIdx = -1; + auto collIt = detMiniCollByKey.find(detCollKey); + if (collIt == detMiniCollByKey.end()) { + outMiniCollisions(static_cast(0)); + detMiniCollIdx = outMiniCollisions.lastIndex(); + detMiniCollByKey.emplace(detCollKey, detMiniCollIdx); + } else { + detMiniCollIdx = collIt->second; + } + + outMiniJets(detMiniCollIdx, /*level*/ JetLevel::Det, detJet.r(), detJet.pt(), detJet.eta(), detJet.phi()); + detJetToMiniJetIdx[detJetKey] = outMiniJets.lastIndex(); + } + + if (!detJet.has_matchedJetGeo()) { + registry.fill(HIST("hJetPtRecoFake"), detJet.pt()); + fillJetCountSummary(3); + continue; + } + + JetMatchInfo bestTruth{}; + bool foundMatch = false; + std::vector bestPartSpl; + + for (auto const& candPartJet : detJet.template matchedJetGeo_as()) { + if (!passJetFiducial(candPartJet, rWanted)) { + continue; + } + + const float dR = std::hypot(detJet.eta() - candPartJet.eta(), + deltaPhi(detJet.phi(), candPartJet.phi())); + if (dR > matchMaxDR.value) { + continue; + } + + const float rel = std::abs(detJet.pt() - candPartJet.pt()) / std::max(candPartJet.pt(), kTiny); + if (matchUseRelPt.value && rel > matchMaxRelPtDiff.value) { + continue; + } + + if (!foundMatch || dR < bestTruth.dR) { + const uint64_t candTruthKey = candPartJet.globalIndex(); + bestTruth.otherKey = candTruthKey; + bestTruth.dR = dR; + bestTruth.relPt = rel; + bestTruth.otherPt = candPartJet.pt(); + + auto splIt = truthSplittingsById.find(candTruthKey); + if (splIt != truthSplittingsById.end()) { + bestPartSpl = splIt->second; + } else { + bestPartSpl = getPrimarySplittings(candPartJet, particles); + truthSplittingsById[candTruthKey] = bestPartSpl; + } + foundMatch = true; + } + } + + if (!foundMatch) { + registry.fill(HIST("hJetPtRecoFake"), detJet.pt()); + fillJetCountSummary(3); + continue; + } + + const auto reverseIt = truthBestDet.find(bestTruth.otherKey); + if (reverseIt == truthBestDet.end() || reverseIt->second.otherKey != detJetKey) { + registry.fill(HIST("hJetPtRecoFake"), detJet.pt()); + fillJetCountSummary(3); + continue; + } + + const float bestDR = bestTruth.dR; + const float bestRelPt = bestTruth.relPt; + const uint64_t bestPartId = bestTruth.otherKey; + const float bestPartPt = bestTruth.otherPt; + + registry.fill(HIST("hJetPtRecoMatched"), detJet.pt()); + fillJetCountSummary(2); + registry.fill(HIST("hJetPtTruthMatched"), bestPartPt); + fillJetCountSummary(5); + registry.fill(HIST("hJetPtResponse"), detJet.pt(), bestPartPt); + registry.fill(HIST("hJetMatchDR"), bestDR); + registry.fill(HIST("hJetMatchRelPt"), bestRelPt); + registry.fill(HIST("hJetPtResidual"), (detJet.pt() - bestPartPt) / std::max(bestPartPt, kTiny)); + truthMatchedById[bestPartId] = true; + + if (writeMiniAOD.value) { + auto detIdxIt = detJetToMiniJetIdx.find(detJetKey); + auto partIdxIt = partJetToMiniJetIdx.find(bestPartId); + if (detIdxIt != detJetToMiniJetIdx.end() && partIdxIt != partJetToMiniJetIdx.end()) { + const int detMiniJetIdx = detIdxIt->second; + const int partMiniJetIdx = partIdxIt->second; + + outMiniJetMatches(detMiniJetIdx, partMiniJetIdx, bestDR, bestRelPt); + + if (detSplittingsWritten.insert(detJetKey).second) { + uint16_t sidTmp = 0; + for (auto const& s : detSpl) { + outMiniSplittings(detMiniJetIdx, sidTmp++, s.deltaR, s.ptSoft, s.ptHard, s.softEta, s.softPhi, detJet.pt()); + } + } + + if (truthSplittingsWritten.insert(bestPartId).second) { + uint16_t sid = 0; + for (auto const& s : bestPartSpl) { + outMiniSplittings(partMiniJetIdx, sid++, s.deltaR, s.ptSoft, s.ptHard, s.softEta, s.softPhi, bestPartPt); + } + } + } + } + + const auto splitMatches = fillSplittingCorrectionHists(detSpl, bestPartSpl); + + // Fill the 6D response and residual QA using the unique geometric splitting matches + for (const auto& m : splitMatches) { + const auto& detS = detSpl[m.recoIdx]; + const auto& partS = bestPartSpl[m.truthIdx]; + double x[6] = {detS.lnRoverDR, detS.lnkt, detJet.pt(), + partS.lnRoverDR, partS.lnkt, bestPartPt}; + h6->Fill(x); + registry.fill(HIST("hLnRoverDRResidual"), detS.lnRoverDR - partS.lnRoverDR); + registry.fill(HIST("hLnKtResidual"), detS.lnkt - partS.lnkt); + } + } + + // --- Final truth pass for misses --- + for (auto const& partJet : partJets) { + if (!passJetFiducial(partJet, rWanted)) { + continue; + } + + const uint64_t truthJetKey = partJet.globalIndex(); + if (!truthMatchedById[truthJetKey]) { + registry.fill(HIST("hJetPtTruthMiss"), partJet.pt()); + fillJetCountSummary(6); + } + } + } + PROCESS_SWITCH(JetLundPlaneUnfolding, processMC, "MC det+part + responses", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} 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..bd055c36f2a 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 @@ -62,6 +63,7 @@ struct JetSpectraCharged { Configurable pTHatMaxMCD{"pTHatMaxMCD", 999.0, "maximum fraction of hard scattering for jet acceptance in detector MC"}; Configurable pTHatMaxMCP{"pTHatMaxMCP", 999.0, "maximum fraction of hard scattering for jet acceptance in particle MC"}; Configurable pTHatExponent{"pTHatExponent", 6.0, "exponent of the event weight for the calculation of pTHat"}; + Configurable simPtRef{"simPtRef", 10.0, "reference pT for the back-calculation of pTHat from the event weight"}; Configurable pTHatAbsoluteMin{"pTHatAbsoluteMin", -99.0, "minimum value of pTHat"}; Configurable jetPtMax{"jetPtMax", 200., "set jet pT bin max"}; Configurable jetEtaMin{"jetEtaMin", -0.7, "minimum jet pseudorapidity"}; @@ -260,6 +262,7 @@ struct JetSpectraCharged { if (doprocessJetsMatchedAreaSub || doprocessJetsMatchedAreaSubWeighted) { registry.add("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_rhoareasubtracted_mcdetaconstraint", "corr pT mcd vs. corr cpT mcp;#it{p}_{T,jet}^{mcd} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, jetPtAxisRhoAreaSub}}, doSumw2); registry.add("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_rhoareasubtracted_mcpetaconstraint", "corr pT mcd vs. corr cpT mcp;#it{p}_{T,jet}^{mcd} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, jetPtAxisRhoAreaSub}}, doSumw2); + registry.add("h2_jet_pt_mcd_rhoareasubtracted_jet_pt_mcp_matchedgeo_mcdetaconstraint", "UEsub pT mcd vs. raw pT mcp;#it{p}_{T,jet}^{mcd} - #rho#it{A} (GeV/#it{c});#it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, jetPtAxis}}, doSumw2); registry.add("h2_jet_pt_mcp_jet_pt_diff_matchedgeo_rhoareasubtracted", "jet mcp corr pT vs. corr delta pT / jet mcp corr pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); (#it{p}_{T,jet}^{mcp} (GeV/#it{c}) - #it{p}_{T,jet}^{mcd} (GeV/#it{c})) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {1000, -5.0, 5.0}}}, doSumw2); registry.add("h2_jet_pt_mcd_jet_pt_diff_matchedgeo_rhoareasubtracted", "jet mcd corr pT vs. corr delta pT / jet mcd corr pt;#it{p}_{T,jet}^{mcd} (GeV/#it{c}); (#it{p}_{T,jet}^{mcd} (GeV/#it{c}) - #it{p}_{T,jet}^{mcp} (GeV/#it{c})) / #it{p}_{T,jet}^{mcd} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {1000, -5.0, 5.0}}}, doSumw2); registry.add("h2_jet_pt_mcp_jet_pt_ratio_matchedgeo_rhoareasubtracted", "jet mcp corr pT vs. jet mcd corr pT / jet mcp corr pt;#it{p}_{T,jet}^{mcp} (GeV/#it{c}); #it{p}_{T,jet}^{mcd} (GeV/#it{c}) / #it{p}_{T,jet}^{mcp} (GeV/#it{c})", {HistType::kTH2F, {jetPtAxisRhoAreaSub, {1000, -5.0, 5.0}}}, doSumw2); @@ -675,6 +678,7 @@ struct JetSpectraCharged { double dcorrpt = corrBasejetpt - corrTagjetpt; if (jetfindingutilities::isInEtaAcceptance(jetMCD, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { registry.fill(HIST("h2_jet_pt_mcd_jet_pt_mcp_matchedgeo_rhoareasubtracted_mcdetaconstraint"), corrBasejetpt, corrTagjetpt, weight); + registry.fill(HIST("h2_jet_pt_mcd_rhoareasubtracted_jet_pt_mcp_matchedgeo_mcdetaconstraint"), corrBasejetpt, jetMCP.pt(), weight); registry.fill(HIST("h2_jet_pt_mcd_jet_pt_diff_matchedgeo_rhoareasubtracted"), corrBasejetpt, dcorrpt / corrBasejetpt, weight); } if (jetfindingutilities::isInEtaAcceptance(jetMCP, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { @@ -714,7 +718,7 @@ struct JetSpectraCharged { registry.fill(HIST("h_collisions_zvertex"), collision.posZ(), eventWeight); - float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_coll_phat"), pTHat); registry.fill(HIST("h_coll_phat_weighted"), pTHat, eventWeight); } @@ -743,7 +747,7 @@ struct JetSpectraCharged { registry.fill(HIST("h_mccollisions_zvertex"), mccollision.posZ(), eventWeight); - float pTHat = 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_mccoll_phat"), pTHat); registry.fill(HIST("h_mccoll_phat_weighted"), pTHat, eventWeight); } @@ -852,7 +856,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); float centrality = -1.0; checkCentFT0M ? centrality = collision.centFT0M() : centrality = collision.centFT0C(); @@ -879,7 +883,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); float centrality = -1.0; checkCentFT0M ? centrality = collision.centFT0M() : centrality = collision.centFT0C(); @@ -1122,7 +1126,7 @@ struct JetSpectraCharged { if (!applyMCCollisionCuts(mccollision, collisions, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); for (auto const& jet : jets) { if (!jetfindingutilities::isInEtaAcceptance(jet, jetEtaMin, jetEtaMax, trackEtaMin, trackEtaMax)) { continue; @@ -1154,7 +1158,7 @@ struct JetSpectraCharged { if (!applyMCCollisionCuts(mccollision, collisions, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mccollision.ptHard() < 999.0f ? mccollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); registry.fill(HIST("h_mccollisions_rho"), mccollision.rho(), eventWeight); for (auto const& jet : jets) { @@ -1245,7 +1249,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); for (const auto& mcdjet : mcdjets) { if (!isAcceptedJet(mcdjet)) { continue; @@ -1288,7 +1292,7 @@ struct JetSpectraCharged { if (!applyCollisionCuts(collision, fillHistograms, isWeighted, eventWeight)) { return; } - float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.has_mcCollision() && collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); double mcrho = collision.has_mcCollision() ? collision.mcCollision_as().rho() : -1; diff --git a/PWGJE/Tasks/jetSpectraEseTask.cxx b/PWGJE/Tasks/jetSpectraEseTask.cxx index 54dbc47901a..e9e445861e0 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,12 @@ struct JetSpectraEseTask { using ChargedMCDJets = soa::Filtered>; Preslice mcdjetsPerJCollision = o2::aod::jet::collisionId; Preslice tracksPerJCollision = o2::aod::jtrack::collisionId; + Preslice mcdTracksPerJCollision = o2::aod::jtrack::collisionId; SliceCache cache; using BinningType = ColumnBinningPolicy; BinningType corrBinning{{binsZVtx, binsCentrality}, true}; + Service pdg; enum class DetID { FT0C, FT0A, @@ -334,6 +350,8 @@ struct JetSpectraEseTask { registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(2, "Collision size < 1"); registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(3, "MCD size != 1"); registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(4, "Occupancy cut"); + registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(5, "Vtx z cut"); + registry.get(HIST("mcp/hEventCounter"))->GetXaxis()->SetBinLabel(6, "Event selection"); } if (doprocessMCDetectorLevel) { LOGF(info, "JetSpectraEseTask::init() - MC Detector level"); @@ -346,8 +364,9 @@ struct JetSpectraEseTask { // registry.add("mcd/hJetPhi", "particle level jet #phi;#phi_{jet part};entries", {HistType::kTH1F, {{phiAxis}}}); registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(1, "Input event"); - registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(2, "Collision size < 1"); - registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(3, "Occupancy cut"); + registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(1, "Event selection"); + registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(2, "Occupancy cut"); + registry.get(HIST("mcd/hEventCounter"))->GetXaxis()->SetBinLabel(3, "Vtx z cut"); } if (doprocessMCChargedMatched) { LOGF(info, "JetSpectraEseTask::init() - MC Charged Matched"); @@ -389,6 +408,48 @@ 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("mcgen/hTrackPtGen", "", {HistType::kTH1F, {{assocTrackPt}}}); + registry.add("mcgen/hTrackEtaGen", "", {HistType::kTH1F, {{etaAxis}}}); + registry.add("mcgen/hTrackPhiGen", "", {HistType::kTH1F, {{phiAxis}}}); + } + if (doprocessMCRecoTrack) { + LOGF(info, "JetSpectraEseTask::init() - MCRec track"); + registry.add("mcrec/hTrackPtReco", "", {HistType::kTH1F, {{assocTrackPt}}}); + registry.add("mcrec/hTrackEtaReco", "", {HistType::kTH1F, {{etaAxis}}}); + registry.add("mcrec/hTrackPhiReco", "", {HistType::kTH1F, {{phiAxis}}}); + } + } + + template + void loadEfficiency(TBC 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 +524,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 +556,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 +618,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 +649,7 @@ struct JetSpectraEseTask { void processESEDataCharged(soa::Join::iterator const& collision, soa::Filtered> const& jets, - aod::JetTracks const& tracks) + aod::JetTracks const& tracks, aod::JBCs const&) { registry.fill(HIST("eventQA/hEventCounter"), kFilteredInputEv); registry.fill(HIST("eventQA/before/hVtxZ"), collision.posZ()); @@ -585,13 +661,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::JBCs const&) { jetMixed(collisions, jets, tracks); } @@ -678,12 +756,13 @@ struct JetSpectraEseTask { } if (cfgEvSelOccupancy && !fOccupancy) return; + registry.fill(HIST("mcp/hEventCounter"), counter++); if (!(std::abs(mcCollision.posZ()) < vertexZCut)) { return; } + registry.fill(HIST("mcp/hEventCounter"), counter++); if (!eventSel) return; - registry.fill(HIST("mcp/hEventCounter"), counter++); registry.fill(HIST("mcp/hCentralitySel"), centrality); @@ -708,6 +787,7 @@ struct JetSpectraEseTask { if (!(std::abs(collision.posZ()) < vertexZCut)) { return; } + registry.fill(HIST("mcd/hEventCounter"), counter++); auto centrality = cfgisPbPb ? collision.centFT0M() : -1; @@ -768,6 +848,134 @@ 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; + } + + for (const auto& particle : particles) { + if (particle.mcCollisionId() != mcCollision.globalIndex()) { + continue; + } + 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("mcgen/hTrackPtGen"), particle.pt()); + registry.fill(HIST("mcgen/hTrackEtaGen"), particle.eta()); + registry.fill(HIST("mcgen/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("mcrec/hTrackPtReco"), track.pt()); + registry.fill(HIST("mcrec/hTrackEtaReco"), track.eta()); + registry.fill(HIST("mcrec/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..c1da7482405 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 @@ -84,6 +86,7 @@ struct TrackEfficiency { Configurable ptHatMin{"ptHatMin", -999, "min pT hat of collisions"}; Configurable ptHatMax{"ptHatMax", 999, "max pT hat of collisions"}; Configurable pTHatExponent{"pTHatExponent", 4.0, "exponent of the event weight for the calculation of pTHat"}; + Configurable simPtRef{"simPtRef", 10.0, "reference pT for the back-calculation of pTHat from the event weight"}; Configurable pTHatMaxFractionMCD{"pTHatMaxFractionMCD", 999.0, "maximum fraction of hard scattering for reconstructed track acceptance in MC"}; Configurable pTHatMaxFractionMCP{"pTHatMaxFractionMCP", 999.0, "maximum fraction of hard scattering for particle acceptance in MC"}; @@ -103,7 +106,6 @@ struct TrackEfficiency { std::vector eventSelectionBits; int trackSelection = -1; - float simPtRef = 10.; enum AcceptSplitCollisionsOptions { NonSplitOnly = 0, @@ -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; } @@ -474,7 +476,7 @@ struct TrackEfficiency { } registry.fill(HIST("hMcCollCutsCounts"), 5.5); // at least one of the reconstructed collisions associated with this mcCollision is selected with regard to centrality - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -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 } } @@ -817,7 +819,7 @@ struct TrackEfficiency { return; } - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -846,7 +848,7 @@ struct TrackEfficiency { return; } - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -871,7 +873,7 @@ struct TrackEfficiency { return; } - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(mcCollision.weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -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; } @@ -934,7 +936,7 @@ struct TrackEfficiency { return; } - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -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; } @@ -1028,7 +1030,7 @@ struct TrackEfficiency { registry.fill(HIST("h_collisions"), 3.5); registry.fill(HIST("h2_centrality_collisions"), centrality, 3.5); - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(collision.mcCollision().weight(), 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -1065,7 +1067,7 @@ struct TrackEfficiency { registry.fill(HIST("h_collisions"), 3.5); registry.fill(HIST("h_collisions_weighted"), 3.5, eventWeight); - float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); + float pTHat = collision.mcCollision().ptHard() < 999.0f ? collision.mcCollision().ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); if (pTHat < ptHatMin || pTHat > ptHatMax) { // only allows mcCollisions with weight in between min and max return; } @@ -1080,14 +1082,14 @@ struct TrackEfficiency { // float centrality = checkCentFT0M ? mcCollision.centFT0M() : mcCollision.centFT0C(); mcCollision.centFT0C() isn't filled at the moment; can be added back when it is float eventWeight = mcCollision.weight(); - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); 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; } @@ -1152,15 +1154,15 @@ struct TrackEfficiency { // float centrality = checkCentFT0M ? mcCollision.centFT0M() : mcCollision.centFT0C(); mcCollision.centFT0C() isn't filled at the moment; can be added back when it is float eventWeight = mcCollision.weight(); - float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)); - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); - registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted"), 10. / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard(), eventWeight); + float pTHat = mcCollision.ptHard() < 999.0f ? mcCollision.ptHard() : simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard()); + registry.fill(HIST("h2_mccollision_pthardfromweight_pthardfromhepmcxsection_weighted"), simPtRef / (std::pow(eventWeight, 1.0 / pTHatExponent)), mcCollision.ptHard(), eventWeight); 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/LFNonPromptCascadeTables.h b/PWGLF/DataModel/LFNonPromptCascadeTables.h index 7d0a9c156a8..da4a1495602 100644 --- a/PWGLF/DataModel/LFNonPromptCascadeTables.h +++ b/PWGLF/DataModel/LFNonPromptCascadeTables.h @@ -438,7 +438,6 @@ DECLARE_SOA_TABLE(NPCascTableMCNT, "AOD", "NPCASCTABLEMCNT", NPCascadeTable::MultNTracksGlobal, NPCascadeTable::ToiMask, NPCascadeTable::NoSameBunchPileup) - DECLARE_SOA_TABLE(NPCascTableGen, "AOD", "NPCASCTABLEGen", NPCascadeTable::gPt, NPCascadeTable::gEta, @@ -451,18 +450,22 @@ DECLARE_SOA_TABLE(NPCascTableGen, "AOD", "NPCASCTABLEGen", NPCascadeTable::IsFromBeauty, NPCascadeTable::IsFromCharm, NPCascadeTable::MotherDecayDaughters) -DECLARE_SOA_TABLE(NPPileUpTable, "AOD", "NPPileUpTABLE", +DECLARE_SOA_TABLE(NPCollisionTable, "AOD", "NPCollisionTABLE", NPCascadeTable::RunNumber, NPCascadeTable::GlobalBC, aod::collision::NumContrib, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::CentFT0M, - NPCascadeTable::MultFT0M) -DECLARE_SOA_TABLE(NPMCNegativesTable, "AOD", "NPMCNegativesTABLE", + NPCascadeTable::MultFT0M); +DECLARE_SOA_TABLE(NPMCChargedTable, "AOD", "NPMCChargedTABLE", NPCascadeTable::PtGen, NPCascadeTable::PtRec, NPCascadeTable::MultNTracksGlobal, NPCascadeTable::MultGen); +DECLARE_SOA_INDEX_COLUMN_FULL(NPCollision, npCollision, int32_t, NPCollisionTable, ""); +DECLARE_SOA_TABLE(NPRecoChargedCandidate, "AOD", "NPRecoChargedCandidate", + NPCollisionId, + NPCascadeTable::PtRec); } // namespace o2::aod #endif // PWGLF_DATAMODEL_LFNONPROMPTCASCADETABLES_H_ diff --git a/PWGLF/DataModel/LFSigmaTables.h b/PWGLF/DataModel/LFSigmaTables.h index 9d728bab596..6c8c9c3a232 100644 --- a/PWGLF/DataModel/LFSigmaTables.h +++ b/PWGLF/DataModel/LFSigmaTables.h @@ -35,16 +35,11 @@ using std::array; namespace o2::aod { -// Indexing -namespace sigma0Core -{ -DECLARE_SOA_INDEX_COLUMN_FULL(PhotonV0, photonV0, int, V0Cores, "_PhotonV0"); //! -DECLARE_SOA_INDEX_COLUMN_FULL(LambdaV0, lambdaV0, int, V0Cores, "_LambdaV0"); //! -} // namespace sigma0Core - // for real data namespace sigma0Core { +DECLARE_SOA_COLUMN(PhotonV0ID, photonV0ID, int); +DECLARE_SOA_COLUMN(LambdaV0ID, lambdaV0ID, int); DECLARE_SOA_COLUMN(X, x, float); DECLARE_SOA_COLUMN(Y, y, float); DECLARE_SOA_COLUMN(Z, z, float); @@ -163,6 +158,9 @@ DECLARE_SOA_DYNAMIC_COLUMN(LambdaPhi, lambdaPhi, //! Phi in the range [0, 2pi) } // namespace sigma0Core DECLARE_SOA_TABLE(Sigma0Cores, "AOD", "SIGMA0CORES", + // Indices for debug + sigma0Core::PhotonV0ID, sigma0Core::LambdaV0ID, + // Basic properties sigma0Core::X, sigma0Core::Y, sigma0Core::Z, sigma0Core::DCADaughters, sigma0Core::PhotonPx, sigma0Core::PhotonPy, sigma0Core::PhotonPz, sigma0Core::PhotonMass, @@ -502,6 +500,42 @@ DECLARE_SOA_TABLE(Sigma0PhotonExtras, "AOD", "SIGMA0PHOTON", sigma0PhotonExtra::PhotonNegTrackCode, sigma0PhotonExtra::PhotonV0Type); +// For EMCal Photon extra info +namespace sigma0EMPhoton +{ +//______________________________________________________ +// REGULAR COLUMNS FOR SIGMA0EMPHOTON +DECLARE_SOA_COLUMN(PhotonID, photonID, int); +DECLARE_SOA_COLUMN(PhotonEnergy, photonEnergy, float); +DECLARE_SOA_COLUMN(PhotonEMCEta, photonEMCEta, float); +DECLARE_SOA_COLUMN(PhotonEMCPhi, photonEMCPhi, float); +DECLARE_SOA_COLUMN(PhotonM02, photonM02, float); +DECLARE_SOA_COLUMN(PhotonM20, photonM20, float); +DECLARE_SOA_COLUMN(PhotonNCells, photonNCells, int); +DECLARE_SOA_COLUMN(PhotonTime, photonTime, float); +DECLARE_SOA_COLUMN(PhotonIsExotic, photonIsExotic, bool); +DECLARE_SOA_COLUMN(PhotonDistToBad, photonDistToBad, float); +DECLARE_SOA_COLUMN(PhotonNLM, photonNLM, int); +DECLARE_SOA_COLUMN(PhotonDefinition, photonDefinition, int); +DECLARE_SOA_COLUMN(PhotonHasAssocTrk, photonHasAssocTrk, bool); + +} // namespace sigma0EMPhoton + +DECLARE_SOA_TABLE(Sigma0EMPhotons, "AOD", "SIGMA0EMPHOTON", + sigma0EMPhoton::PhotonID, + sigma0EMPhoton::PhotonEnergy, + sigma0EMPhoton::PhotonEMCEta, + sigma0EMPhoton::PhotonEMCPhi, + sigma0EMPhoton::PhotonM02, + sigma0EMPhoton::PhotonM20, + sigma0EMPhoton::PhotonNCells, + sigma0EMPhoton::PhotonTime, + sigma0EMPhoton::PhotonIsExotic, + sigma0EMPhoton::PhotonDistToBad, + sigma0EMPhoton::PhotonNLM, + sigma0EMPhoton::PhotonDefinition, + sigma0EMPhoton::PhotonHasAssocTrk); + // For Lambda extra info namespace sigma0LambdaExtra { @@ -567,6 +601,7 @@ DECLARE_SOA_TABLE(Sigma0LambdaExtras, "AOD", "SIGMA0LAMBDA", // for MC namespace sigma0MCCore { +DECLARE_SOA_COLUMN(ParticleIdMC, particleIdMC, int); //! V0 Particle ID DECLARE_SOA_COLUMN(MCradius, mcradius, float); DECLARE_SOA_COLUMN(PDGCode, pdgCode, int); DECLARE_SOA_COLUMN(PDGCodeMother, pdgCodeMother, int); @@ -576,6 +611,9 @@ DECLARE_SOA_COLUMN(IsProducedByGenerator, isProducedByGenerator, bool); DECLARE_SOA_COLUMN(PhotonMCPx, photonmcpx, float); DECLARE_SOA_COLUMN(PhotonMCPy, photonmcpy, float); DECLARE_SOA_COLUMN(PhotonMCPz, photonmcpz, float); +DECLARE_SOA_COLUMN(PhotonAmplitudeA, photonAmplitudeA, float); // Energy fraction deposited by a particle inside this calo cell. +DECLARE_SOA_COLUMN(PhotonPDGCodePos, photonPDGCodePos, int); +DECLARE_SOA_COLUMN(PhotonPDGCodeNeg, photonPDGCodeNeg, int); DECLARE_SOA_COLUMN(IsPhotonPrimary, isPhotonPrimary, bool); DECLARE_SOA_COLUMN(PhotonPDGCode, photonPDGCode, int); DECLARE_SOA_COLUMN(PhotonPDGCodeMother, photonPDGCodeMother, int); @@ -585,6 +623,8 @@ DECLARE_SOA_COLUMN(LambdaMCPx, lambdamcpx, float); DECLARE_SOA_COLUMN(LambdaMCPy, lambdamcpy, float); DECLARE_SOA_COLUMN(LambdaMCPz, lambdamcpz, float); DECLARE_SOA_COLUMN(IsLambdaPrimary, isLambdaPrimary, bool); +DECLARE_SOA_COLUMN(LambdaPDGCodePos, lambdaPDGCodePos, int); +DECLARE_SOA_COLUMN(LambdaPDGCodeNeg, lambdaPDGCodeNeg, int); DECLARE_SOA_COLUMN(LambdaPDGCode, lambdaPDGCode, int); DECLARE_SOA_COLUMN(LambdaPDGCodeMother, lambdaPDGCodeMother, int); DECLARE_SOA_COLUMN(LambdaIsCorrectlyAssoc, lambdaIsCorrectlyAssoc, bool); @@ -691,15 +731,17 @@ DECLARE_SOA_DYNAMIC_COLUMN(LambdaMCPhi, lambdaMCPhi, //! Phi in the range [0, 2p } // namespace sigma0MCCore DECLARE_SOA_TABLE(Sigma0MCCores, "AOD", "SIGMA0MCCORES", + // MC particle index for debug + sigma0MCCore::ParticleIdMC, // Basic properties sigma0MCCore::MCradius, sigma0MCCore::PDGCode, sigma0MCCore::PDGCodeMother, sigma0MCCore::MCprocess, sigma0MCCore::IsProducedByGenerator, - sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, - sigma0MCCore::IsPhotonPrimary, sigma0MCCore::PhotonPDGCode, sigma0MCCore::PhotonPDGCodeMother, sigma0MCCore::PhotonIsCorrectlyAssoc, + sigma0MCCore::PhotonMCPx, sigma0MCCore::PhotonMCPy, sigma0MCCore::PhotonMCPz, sigma0MCCore::PhotonAmplitudeA, + sigma0MCCore::PhotonPDGCodePos, sigma0MCCore::PhotonPDGCodeNeg, sigma0MCCore::IsPhotonPrimary, sigma0MCCore::PhotonPDGCode, sigma0MCCore::PhotonPDGCodeMother, sigma0MCCore::PhotonIsCorrectlyAssoc, sigma0MCCore::LambdaMCPx, sigma0MCCore::LambdaMCPy, sigma0MCCore::LambdaMCPz, - sigma0MCCore::IsLambdaPrimary, sigma0MCCore::LambdaPDGCode, sigma0MCCore::LambdaPDGCodeMother, sigma0MCCore::LambdaIsCorrectlyAssoc, + sigma0MCCore::LambdaPDGCodePos, sigma0MCCore::LambdaPDGCodeNeg, sigma0MCCore::IsLambdaPrimary, sigma0MCCore::LambdaPDGCode, sigma0MCCore::LambdaPDGCodeMother, sigma0MCCore::LambdaIsCorrectlyAssoc, // Dynamic columns sigma0MCCore::IsSigma0, @@ -728,11 +770,6 @@ DECLARE_SOA_TABLE(Sigma0MCCores, "AOD", "SIGMA0MCCORES", sigma0MCCore::LambdaMCY, sigma0MCCore::LambdaMCPhi); -namespace sigma0MCCore -{ -DECLARE_SOA_INDEX_COLUMN(McParticle, mcParticle); //! MC particle for Sigma0 -} - // for MC namespace kstarMCCore { @@ -923,12 +960,6 @@ DECLARE_SOA_TABLE(KStarGens, "AOD", "KSTARGENS", DECLARE_SOA_TABLE(SigmaCollRef, "AOD", "SIGMACOLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraCollisionId); -DECLARE_SOA_TABLE(SigmaIndices, "AOD", "SIGMAINDEX", //! index table when using AO2Ds - o2::soa::Index<>, sigma0Core::PhotonV0Id, sigma0Core::LambdaV0Id, o2::soa::Marker<1>); - -DECLARE_SOA_TABLE(SigmaMCLabels, "AOD", "SIGMAMCLABEL", //! optional table to refer to mcparticles - o2::soa::Index<>, sigma0MCCore::McParticleId); - DECLARE_SOA_TABLE(SigmaGenCollRef, "AOD", "SIGMAGENCOLLREF", //! optional table to refer back to a collision o2::soa::Index<>, v0data::StraMCCollisionId); diff --git a/PWGLF/DataModel/LFStrangenessTables.h b/PWGLF/DataModel/LFStrangenessTables.h index bc7fd7d3aaa..33d06f159d9 100644 --- a/PWGLF/DataModel/LFStrangenessTables.h +++ b/PWGLF/DataModel/LFStrangenessTables.h @@ -82,6 +82,11 @@ DECLARE_SOA_TABLE_VERSIONED(StraCents_001, "AOD", "STRACENTS", 1, //! centrality cent::CentFT0C, cent::CentFV0A, cent::CentFT0CVariant1, cent::CentMFT, cent::CentNGlobal); +DECLARE_SOA_TABLE_VERSIONED(StraCents_002, "AOD", "STRACENTS", 2, //! centrality percentiles in Run 3 + cent::CentFT0M, cent::CentFT0A, + cent::CentFT0C, cent::CentFV0A, + cent::CentFT0CVariant1, cent::CentFT0CVariant2, + cent::CentMFT, cent::CentNGlobal, cent::CentNTPV); DECLARE_SOA_TABLE(StraCentsRun2, "AOD", "STRACENTSRUN2", //! centrality percentiles in Run 2 cent::CentRun2V0M, cent::CentRun2V0A, @@ -274,6 +279,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 @@ -315,11 +330,11 @@ DECLARE_SOA_TABLE(StraEvTimes, "AOD", "STRAEVTIMES", //! event time (FT0, TOF) stracollision::EventTime); using StraRawCents = StraRawCents_004; -using StraCents = StraCents_001; +using StraCents = StraCents_002; using StraEvSels = StraEvSels_005; using StraStamps = StraStamps_001; using StraCollision = StraCollisions::iterator; -using StraCent = StraCents_001::iterator; +using StraCent = StraCents::iterator; namespace stramccollision { 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/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 25aa3e94e7e..1928dbdbc45 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -89,12 +89,22 @@ std::shared_ptr hImpactParamGen; std::shared_ptr hImpactParamReco; std::shared_ptr hGen3HLBeforeEvtSel; std::shared_ptr hGen3HLAfterSel; +std::shared_ptr hGenEventsNchEta05; +std::shared_ptr hGenEventsNchEta08; +std::shared_ptr hGenCentralityColvsMultiplicityGenEta05; +std::shared_ptr hGenCentralityColvsMultiplicityGenEta08; +std::shared_ptr hGenCentralityColvsImpactParamGen; +std::shared_ptr hGenCentralityColvsFT0Cmultiplicity; std::shared_ptr hRecoCentralityColvsMultiplicityRecoEta05; +std::shared_ptr hRecoCentralityColvsMultiplicityRecoEta08; std::shared_ptr hRecoCentralityColvsImpactParamReco; +std::shared_ptr hRecoCentralityColvsFT0Cmultiplicity; std::shared_ptr hGen3HLvsImpactParameterBeforeEvtSel; std::shared_ptr hGen3HLvsImpactParameterAfterSel; std::shared_ptr hGen3HLvsMultiplicityGenEta05BeforeEvtSel; std::shared_ptr hGen3HLvsMultiplicityGenEta05AfterSel; +std::shared_ptr hGen3HLvsMultiplicityGenEta08BeforeEvtSel; +std::shared_ptr hGen3HLvsMultiplicityGenEta08AfterSel; std::shared_ptr hGen3HLvsMultiplicityFT0CBeforeEvtSel; std::shared_ptr hGen3HLvsMultiplicityFT0CAfterSel; @@ -329,21 +339,35 @@ struct hyperRecoTask { hEvtMC->GetXaxis()->SetBinLabel(1, "All gen evts"); hEvtMC->GetXaxis()->SetBinLabel(2, "Gen evts with al least one reconstructed"); hEvtMC->GetXaxis()->SetBinLabel(3, "Gen evts with no reconstructed collisions"); + hGenEventsNchEta05 = qaRegistry.add("QAEvent/hGenEventsNchEta05", ";;", HistType::kTH2D, {{multAxis}, {2, -0.5f, +1.5f}}); + hGenEventsNchEta05->GetYaxis()->SetBinLabel(1, "All gen. events"); + hGenEventsNchEta05->GetYaxis()->SetBinLabel(2, "Gen evts with at least 1 rec. collisions"); + hGenEventsNchEta08 = qaRegistry.add("QAEvent/hGenEventsNchEta08", ";;", HistType::kTH2D, {{multAxis}, {2, -0.5f, +1.5f}}); + hGenEventsNchEta08->GetYaxis()->SetBinLabel(1, "All gen. events"); + hGenEventsNchEta08->GetYaxis()->SetBinLabel(2, "Gen evts with at least 1 rec. collisions"); // Infomation for all generated collisions collisions hImpactParamGen = qaRegistry.add("QAEvent/McColAll/hImpactParamGen", "Impact parameter of generated MC events; Impact Parameter (b); Counts", HistType::kTH1D, {impactParamAxis}); + hGenCentralityColvsMultiplicityGenEta05 = qaRegistry.add("QAEvent/McColAll/hGenCentralityColvsMultiplicityGenEta05", "Correlation between FT0C centrality and charged particle multiplicity in generated MC events; Multiplicity #eta <0.5; Counts", HistType::kTH2D, {centFT0CAxis, multAxis}); + hGenCentralityColvsMultiplicityGenEta08 = qaRegistry.add("QAEvent/McColAll/hGenCentralityColvsMultiplicityGenEta08", "Correlation between FT0C centrality and charged particle multiplicity in generated MC events; Multiplicity #eta <0.8; Counts", HistType::kTH2D, {centFT0CAxis, multAxis}); + hGenCentralityColvsImpactParamGen = qaRegistry.add("QAEvent/McColAll/hGenCentralityColvsImpactParamGen", "Correlation between FT0C centrality and impact parameter in generated MC events; Multiplicity #eta <0.8; Counts", HistType::kTH2D, {centFT0CAxis, impactParamAxis}); + hGenCentralityColvsFT0Cmultiplicity = qaRegistry.add("QAEvent/McColAll/hGenCentralityColvsFT0Cmultiplicity", "Correlation between FT0C centrality and FT0C multiplicity in generated MC events; FT0c multiplicity", HistType::kTH2D, {centFT0CAxis, binsFT0CMultAxis}); // Infomation for generated collisions collisions with at least one rec. event hImpactParamReco = qaRegistry.add("QAEvent/McColAll/hImpactParamReco", "Impact parameter of generated MC events with at least one rec. evt; Impact Parameter (b); Counts", HistType::kTH1D, {impactParamAxis}); hRecoCentralityColvsMultiplicityRecoEta05 = qaRegistry.add("QAEvent/McColAll/hRecoCentralityColvsMultiplicityRecoEta05", "Correlation between FT0C centrality and charged particle multiplicity in generated MC events with at least one rec. evt; Multiplicity #eta <0.5; Counts", HistType::kTH2D, {centFT0CAxis, multAxis}); + hRecoCentralityColvsMultiplicityRecoEta08 = qaRegistry.add("QAEvent/McColAll/hRecoCentralityColvsMultiplicityRecoEta08", "Correlation between FT0C centrality and charged particle multiplicity in generated MC events with at least one rec. evt; Multiplicity #eta <0.8; Counts", HistType::kTH2D, {centFT0CAxis, multAxis}); hRecoCentralityColvsImpactParamReco = qaRegistry.add("QAEvent/McColAll/hRecoCentralityColvsImpactParamReco", "Correlation between FT0C centrality and impact parameter in generated MC events with at least one rec. evt; Impact Parameter (b); Counts", HistType::kTH2D, {centFT0CAxis, impactParamAxis}); + hRecoCentralityColvsFT0Cmultiplicity = qaRegistry.add("QAEvent/McColAll/hRecoCentralityColvsFT0Cmultiplicity", "Correlation between FT0C centrality and FT0C multiplicity in generated MC events with at least one rec. evt; FT0C (%); FT0c multiplicity", HistType::kTH2D, {centFT0CAxis, binsFT0CMultAxis}); // Information of generated 3HL in generated events hGen3HLBeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLBeforeEvtSel", "3HL generated #it{p}_{T} distribution in all gen evt;#it{p}_{T} (GeV/#it{c}); Counts", HistType::kTH1D, {ptAxis}); hGen3HLvsImpactParameterBeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsImpactParameterBeforeEvtSel", "Correlation 3HL generated #it{p}_{T} and impact parameter in all gen evt;#it{p}_{T} (GeV/#it{c}); Impact parameter (b)", HistType::kTH2D, {ptAxis, impactParamAxis}); hGen3HLvsMultiplicityGenEta05BeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityGenEta05BeforeEvtSel", "Correlation 3HL generated #it{p}_{T} and charged particle multiplicity in all gen evt;#it{p}_{T} (GeV/#it{c}); Multiplicity #eta <0.5", HistType::kTH2D, {ptAxis, multAxis}); + hGen3HLvsMultiplicityGenEta08BeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityGenEta08BeforeEvtSel", "Correlation 3HL generated #it{p}_{T} and charged particle multiplicity in all gen evt;#it{p}_{T} (GeV/#it{c}); Multiplicity #eta <0.8", HistType::kTH2D, {ptAxis, multAxis}); hGen3HLvsMultiplicityFT0CBeforeEvtSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityFT0CBeforeEvtSel", "Correlation 3HL generated #it{p}_{T} and FT0C multiplicity in all gen evt;#it{p}_{T} (GeV/#it{c}); FT0C Multiplicity", HistType::kTH2D, {ptAxis, binsFT0CMultAxis}); // Information of generated 3HL in generated events with at least one rec. event hGen3HLAfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLAfterSel", "3HL generated #it{p}_{T} distribution in gen. evts with at least one rec. evt; #it{p}_{T} (GeV/#it{c}); Counts", HistType::kTH1D, {ptAxis}); hGen3HLvsImpactParameterAfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsImpactParameterAfterSel", "Correlation 3HL generated #it{p}_{T} and impact parameter in gen. evts with at least one rec. evt;#it{p}_{T} (GeV/#it{c}); Impact parameter (b)", HistType::kTH2D, {ptAxis, impactParamAxis}); hGen3HLvsMultiplicityGenEta05AfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityGenEta05AfterSel", "Correlation 3HL generated #it{p}_{T} and charged particle multiplicity in gen. evts with at least one rec. evt;#it{p}_{T} (GeV/#it{c}); Multiplicity #eta <0.5", HistType::kTH2D, {ptAxis, multAxis}); + hGen3HLvsMultiplicityGenEta08AfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityGenEta08AfterSel", "Correlation 3HL generated #it{p}_{T} and charged particle multiplicity in gen. evts with at least one rec. evt;#it{p}_{T} (GeV/#it{c}); Multiplicity #eta <0.8", HistType::kTH2D, {ptAxis, multAxis}); hGen3HLvsMultiplicityFT0CAfterSel = qaRegistry.add("QAEvent/McCol3HL/hGen3HLvsMultiplicityFT0CAfterSel", "Correlation 3HL generated #it{p}_{T} and FT0C multiplicity in gen. evts with at least one rec;#it{p}_{T} (GeV/#it{c}); FT0C Multiplicity", HistType::kTH2D, {ptAxis, binsFT0CMultAxis}); } } @@ -435,9 +459,9 @@ struct hyperRecoTask { hEvents->Fill(1.); if (std::abs(collision.posZ()) > 10) { - hEvents->Fill(2.); continue; } + hEvents->Fill(2.); if (zorroSelected) { hEventsZorro->Fill(1.); @@ -480,9 +504,9 @@ struct hyperRecoTask { hEvents->Fill(1.); if (std::abs(collision.posZ()) > 10) { - hEvents->Fill(2.); continue; } + hEvents->Fill(2.); if (cfgEvSelkNoSameBunchPileup) { if (!collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { @@ -666,7 +690,7 @@ struct hyperRecoTask { if (std::abs(posTrack.eta()) > etaMax || std::abs(negTrack.eta()) > etaMax) continue; - // temporary fix: tpcInnerParam() returns the momentum in all the software tags before: https://github.com/AliceO2Group/AliceO2/pull/12521 + // temporary fix: tpcInnhRecoCentralityColvsFT0CmultiplicityerParam() returns the momentum in all the software tags before: https://github.com/AliceO2Group/AliceO2/pull/12521 auto nSigmaTPCpos = computeNSigmaHe3(posTrack); auto nSigmaTPCneg = computeNSigmaHe3(negTrack); // ITS only tracks do not have TPC information. TPCnSigma: only lower cut to allow for both hypertriton and hyperhydrogen4 reconstruction @@ -1033,6 +1057,8 @@ struct hyperRecoTask { // Fill all generated events hEvtMC->Fill(0); hImpactParamGen->Fill(mcCollision.impactParameter()); + hGenEventsNchEta05->Fill(mcCollision.multMCNParticlesEta05(), 0); + hGenEventsNchEta08->Fill(mcCollision.multMCNParticlesEta08(), 0); // Fill generated events with no reconstructed collisions if (collisions.size() == 0) { @@ -1051,11 +1077,20 @@ struct hyperRecoTask { atLeastOneRecoEvt = true; } + hGenCentralityColvsMultiplicityGenEta05->Fill(centralityFT0C, mcCollision.multMCNParticlesEta05()); + hGenCentralityColvsMultiplicityGenEta08->Fill(centralityFT0C, mcCollision.multMCNParticlesEta08()); + hGenCentralityColvsImpactParamGen->Fill(centralityFT0C, mcCollision.impactParameter()); + hGenCentralityColvsFT0Cmultiplicity->Fill(centralityFT0C, mcCollision.multMCFT0C()); + if (atLeastOneRecoEvt) { hEvtMC->Fill(2); + hGenEventsNchEta05->Fill(mcCollision.multMCNParticlesEta05(), 1); + hGenEventsNchEta08->Fill(mcCollision.multMCNParticlesEta08(), 1); hImpactParamReco->Fill(mcCollision.impactParameter()); hRecoCentralityColvsMultiplicityRecoEta05->Fill(centralityFT0C, mcCollision.multMCNParticlesEta05()); + hRecoCentralityColvsMultiplicityRecoEta08->Fill(centralityFT0C, mcCollision.multMCNParticlesEta08()); hRecoCentralityColvsImpactParamReco->Fill(centralityFT0C, mcCollision.impactParameter()); + hRecoCentralityColvsFT0Cmultiplicity->Fill(centralityFT0C, mcCollision.multMCFT0C()); } // Construct the H3L 4-vector based on the generated daugthers identification by PDG ROOT::Math::PxPyPzMVector daugh1, daugh2, mother; @@ -1096,6 +1131,7 @@ struct hyperRecoTask { hGen3HLBeforeEvtSel->Fill(mother.pt()); hGen3HLvsImpactParameterBeforeEvtSel->Fill(mother.pt(), mcCollision.impactParameter()); hGen3HLvsMultiplicityGenEta05BeforeEvtSel->Fill(mother.pt(), mcCollision.multMCNParticlesEta05()); + hGen3HLvsMultiplicityGenEta08BeforeEvtSel->Fill(mother.pt(), mcCollision.multMCNParticlesEta08()); hGen3HLvsMultiplicityFT0CBeforeEvtSel->Fill(mother.pt(), mcCollision.multMCFT0C()); // Fill informations for generated 3HL in generated events with at least one reconstructed event @@ -1103,6 +1139,7 @@ struct hyperRecoTask { hGen3HLAfterSel->Fill(mother.pt()); hGen3HLvsImpactParameterAfterSel->Fill(mother.pt(), mcCollision.impactParameter()); hGen3HLvsMultiplicityGenEta05AfterSel->Fill(mother.pt(), mcCollision.multMCNParticlesEta05()); + hGen3HLvsMultiplicityGenEta08AfterSel->Fill(mother.pt(), mcCollision.multMCNParticlesEta08()); hGen3HLvsMultiplicityFT0CAfterSel->Fill(mother.pt(), mcCollision.multMCFT0C()); } } diff --git a/PWGLF/TableProducer/Strangeness/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/CMakeLists.txt index 3f1d8565951..08ec72c6913 100644 --- a/PWGLF/TableProducer/Strangeness/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/CMakeLists.txt @@ -139,7 +139,7 @@ o2physics_add_dpl_workflow(cascademlselection o2physics_add_dpl_workflow(sigma0builder SOURCES sigma0builder.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB + PUBLIC_LINK_LIBRARIES O2::Framework O2::EMCALBase O2Physics::AnalysisCore O2Physics::MLCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(lambdajetpolarizationbuilder diff --git a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt index 83dfdaa3a36..8239715863d 100644 --- a/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt +++ b/PWGLF/TableProducer/Strangeness/Converters/CMakeLists.txt @@ -124,6 +124,11 @@ o2physics_add_dpl_workflow(stracentconverter PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(stracentconverter2 + SOURCES stracentconverter2.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(stramccollmultconverter SOURCES stramccollmultconverter.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx b/PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx new file mode 100644 index 00000000000..febbb451be9 --- /dev/null +++ b/PWGLF/TableProducer/Strangeness/Converters/stracentconverter2.cxx @@ -0,0 +1,44 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" + +using namespace o2; +using namespace o2::framework; + +// Converts Stra Cents from 001 to 002 +struct stracentconverter2 { + Produces straCents_002; + + void process(aod::StraCents_001 const& straCents_001) + { + for (auto& values : straCents_001) { + straCents_002(values.centFT0M(), + values.centFT0A(), + values.centFT0C(), + values.centFV0A(), + values.centFT0CVariant1(), + -999.0 /*dummy FT0C Variant 2*/, + values.centMFT(), + values.centNGlobal(), + -999.0 /*dummy NTPV value*/); + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx b/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx index e32ebd8a9db..81293bcebf2 100644 --- a/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx +++ b/PWGLF/TableProducer/Strangeness/cascqaanalysis.cxx @@ -34,7 +34,9 @@ #include #include +#include #include +#include #include using namespace o2; @@ -122,7 +124,7 @@ struct Cascqaanalysis { SliceCache cache; // Random number generator for event scaling - TRandom2* fRand = new TRandom2(); + TRandom2 fRand; // Struct to select on event type typedef struct CollisionIndexAndType { @@ -130,6 +132,41 @@ struct Cascqaanalysis { uint8_t typeFlag; } CollisionIndexAndType; + template + static int countITSHits(TTrack const& track) + { + int nHits = 0; + for (unsigned int i = 0; i < 7; ++i) { + if (track.itsClusterMap() & (1 << i)) { + ++nHits; + } + } + return nHits; + } + + template + static uint8_t buildRecoEventFlags(TCollision const& collision) + { + uint8_t evFlag = o2::aod::mycascades::EvFlags::EvINEL; + if (collision.isInelGt0()) { + evFlag |= o2::aod::mycascades::EvFlags::EvINELgt0; + } + if (collision.isInelGt1()) { + evFlag |= o2::aod::mycascades::EvFlags::EvINELgt1; + } + return evFlag; + } + + template + static std::pair computeCascadeCtau(TCascade const& casc, TCollision const& collision) + { + const float decayLength = std::hypot(casc.x() - collision.posX(), casc.y() - collision.posY(), casc.z() - collision.posZ()); + const float totalMomentum = std::hypot(casc.px(), casc.py(), casc.pz()); + const float invMomentum = 1.f / (totalMomentum + 1.e-13f); + return {o2::constants::physics::MassXiMinus * decayLength * invMomentum, + o2::constants::physics::MassOmegaMinus * decayLength * invMomentum}; + } + void init(InitContext const&) { TString hCandidateCounterLabels[4] = {"All candidates", "passed topo cuts", "has associated MC particle", "associated with Xi(Omega)"}; @@ -210,17 +247,13 @@ struct Cascqaanalysis { auto bachelor = cascCand.template bachelor_as(); // Basic set of selections - if (cascCand.cascradius() > cascradius && - cascCand.v0radius() > v0radius && - cascCand.casccosPA(pvx, pvy, pvz) > casccospa && - cascCand.v0cosPA(pvx, pvy, pvz) > v0cospa && - std::fabs(posdau.eta()) < etadau && - std::fabs(negdau.eta()) < etadau && - std::fabs(bachelor.eta()) < etadau) { - return true; - } else { - return false; - } + return cascCand.cascradius() > cascradius && + cascCand.v0radius() > v0radius && + cascCand.casccosPA(pvx, pvy, pvz) > casccospa && + cascCand.v0cosPA(pvx, pvy, pvz) > v0cospa && + std::fabs(posdau.eta()) < etadau && + std::fabs(negdau.eta()) < etadau && + std::fabs(bachelor.eta()) < etadau; } template @@ -419,39 +452,16 @@ struct Cascqaanalysis { registry.fill(HIST("hCandidateCounter"), 1.5); // passed topo cuts nCandSel++; // Fill table - if (fRand->Rndm() < lEventScale) { + if (fRand.Rndm() < lEventScale) { auto posdau = casc.posTrack_as(); auto negdau = casc.negTrack_as(); auto bachelor = casc.bachelor_as(); - // ITS N hits - int posITSNhits = 0, negITSNhits = 0, bachITSNhits = 0; - for (unsigned int i = 0; i < 7; i++) { - if (posdau.itsClusterMap() & (1 << i)) { - posITSNhits++; - } - if (negdau.itsClusterMap() & (1 << i)) { - negITSNhits++; - } - if (bachelor.itsClusterMap() & (1 << i)) { - bachITSNhits++; - } - } - - uint8_t evFlag = 0; - evFlag |= o2::aod::mycascades::EvFlags::EvINEL; - if (collision.multNTracksPVeta1() > 0) { - evFlag |= o2::aod::mycascades::EvFlags::EvINELgt0; - } - if (collision.multNTracksPVeta1() > 1) { - evFlag |= o2::aod::mycascades::EvFlags::EvINELgt1; - } - - // c x tau - float cascpos = std::hypot(casc.x() - collision.posX(), casc.y() - collision.posY(), casc.z() - collision.posZ()); - float cascptotmom = std::hypot(casc.px(), casc.py(), casc.pz()); - float ctauXi = o2::constants::physics::MassXiMinus * cascpos / (cascptotmom + 1e-13); - float ctauOmega = o2::constants::physics::MassOmegaMinus * cascpos / (cascptotmom + 1e-13); + const int posITSNhits = countITSHits(posdau); + const int negITSNhits = countITSHits(negdau); + const int bachITSNhits = countITSHits(bachelor); + const uint8_t evFlag = buildRecoEventFlags(collision); + const auto [ctauXi, ctauOmega] = computeCascadeCtau(casc, collision); mycascades(collision.posZ(), collision.centFT0M(), collision.centFV0A(), @@ -563,41 +573,17 @@ struct Cascqaanalysis { genY = cascmc.y(); } } - if (fRand->Rndm() < lEventScale) { + if (fRand.Rndm() < lEventScale) { // Fill table auto posdau = casc.posTrack_as(); auto negdau = casc.negTrack_as(); auto bachelor = casc.bachelor_as(); - // ITS N hits - int posITSNhits = 0, negITSNhits = 0, bachITSNhits = 0; - for (unsigned int i = 0; i < 7; i++) { - if (posdau.itsClusterMap() & (1 << i)) { - posITSNhits++; - } - if (negdau.itsClusterMap() & (1 << i)) { - negITSNhits++; - } - if (bachelor.itsClusterMap() & (1 << i)) { - bachITSNhits++; - } - } - - // Event type flag - uint8_t evFlag = 0; - evFlag |= o2::aod::mycascades::EvFlags::EvINEL; - if (collision.multNTracksPVeta1() > 0) { - evFlag |= o2::aod::mycascades::EvFlags::EvINELgt0; - } - if (collision.multNTracksPVeta1() > 1) { - evFlag |= o2::aod::mycascades::EvFlags::EvINELgt1; - } - - // c x tau - float cascpos = std::hypot(casc.x() - collision.posX(), casc.y() - collision.posY(), casc.z() - collision.posZ()); - float cascptotmom = std::hypot(casc.px(), casc.py(), casc.pz()); - float ctauXi = o2::constants::physics::MassXiMinus * cascpos / (cascptotmom + 1e-13); - float ctauOmega = o2::constants::physics::MassOmegaMinus * cascpos / (cascptotmom + 1e-13); + const int posITSNhits = countITSHits(posdau); + const int negITSNhits = countITSHits(negdau); + const int bachITSNhits = countITSHits(bachelor); + const uint8_t evFlag = buildRecoEventFlags(collision); + const auto [ctauXi, ctauOmega] = computeCascadeCtau(casc, collision); mycascades(collision.posZ(), mcCollision.centFT0M(), 0, // mcCollision.centFV0A() to be added diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index cc6dcf403cf..339088a311c 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -20,6 +20,8 @@ // gianni.shigeru.setoue.liveraro@cern.ch // +#include "PWGEM/PhotonMeson/Utils/MCUtilities.h" +#include "PWGJE/DataModel/EMCALClusters.h" #include "PWGLF/DataModel/LFSigmaTables.h" #include "PWGLF/DataModel/LFStrangenessMLTables.h" #include "PWGLF/DataModel/LFStrangenessPIDTables.h" @@ -43,10 +45,8 @@ #include "Math/Vector3D.h" #include -#include #include #include -#include #include #include @@ -54,6 +54,7 @@ #include #include #include +#include #include using namespace o2; @@ -66,8 +67,10 @@ using V0DerivedMCDatas = soa::Join; using V0TOFDerivedMCDatas = soa::Join; +using EMCalMCClusters = soa::Join; + static const std::vector DirList = {"V0BeforeSel", "PhotonSel", "LambdaSel", "KShortSel"}; -; +static const std::vector DirList2 = {"EMCalPhotonBeforeSel", "EMCalPhotonSel"}; struct sigma0builder { Service ccdb; @@ -75,7 +78,6 @@ struct sigma0builder { //___________________________________________________ // KStar Specific - Produces kstarcores; // kstar candidates info for analysis Produces kshortExtras; // lambdas from sigma0 candidates info Produces kstarPhotonExtras; // photons from kstar candidates info @@ -86,15 +88,14 @@ struct sigma0builder { //__________________________________________________ // Sigma0 specific - Produces sigmaIndices; // references V0Cores from sigma0Gens - Produces sigma0cores; // sigma0 candidates info for analysis - Produces sigmaPhotonExtras; // photons from sigma0 candidates info - Produces sigmaLambdaExtras; // lambdas from sigma0 candidates info - Produces sigma0CollRefs; // references collisions from Sigma0Cores - Produces sigma0mccores; // Reco sigma0 MC properties - Produces sigma0mclabel; // Link of reco sigma0 to mcparticles - Produces sigma0Gens; // Generated sigma0s - Produces sigma0GenCollRefs; // references collisions from sigma0Gens + Produces sigma0cores; // sigma0 candidates info for analysis + Produces sigmaPhotonExtras; // photons from sigma0 candidates info + Produces sigmaEmCalPhotonExtras; // EMCAL photons from sigma0 candidates info + Produces sigmaLambdaExtras; // lambdas from sigma0 candidates info + Produces sigma0CollRefs; // references collisions from Sigma0Cores + Produces sigma0mccores; // Reco sigma0 MC properties + Produces sigma0Gens; // Generated sigma0s + Produces sigma0GenCollRefs; // references collisions from sigma0Gens //__________________________________________________ // Pi0 specific @@ -161,8 +162,13 @@ struct sigma0builder { Configurable minIR{"minIR", -1, "minimum IR collisions"}; Configurable maxIR{"maxIR", -1, "maximum IR collisions"}; + Configurable fSkipEmptyEMCal{"fSkipEmptyEMCal", true, "Flag to skip events without EMCal clusters"}; + } eventSelections; + // Photon Source + // Configurable fUsePCMPhotons{"fUsePCMPhotons", true, "Use PCM Photons for sigma0/kstar reconstruction. If False, EMCal photons are used instead."}; + // Tables to fill Configurable fillPi0Tables{"fillPi0Tables", false, "fill pi0 tables for QA"}; Configurable fillSigma0Tables{"fillSigma0Tables", true, "fill sigma0 tables for analysis"}; @@ -178,7 +184,7 @@ struct sigma0builder { std::string prefix = "lambdaSelections"; // JSON group name Configurable Lambda_MLThreshold{"Lambda_MLThreshold", 0.1, "Decision Threshold value to select lambdas"}; Configurable AntiLambda_MLThreshold{"AntiLambda_MLThreshold", 0.1, "Decision Threshold value to select antilambdas"}; - Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true lambda/alambdas only"}; + Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true lambda/alambdas only"}; Configurable LambdaMinDCANegToPv{"LambdaMinDCANegToPv", .05, "min DCA Neg To PV (cm)"}; Configurable LambdaMinDCAPosToPv{"LambdaMinDCAPosToPv", .05, "min DCA Pos To PV (cm)"}; Configurable LambdaMaxDCAV0Dau{"LambdaMaxDCAV0Dau", 2.5, "Max DCA V0 Daughters (cm)"}; @@ -207,7 +213,7 @@ struct sigma0builder { struct : ConfigurableGroup { std::string prefix = "photonSelections"; // JSON group name Configurable Gamma_MLThreshold{"Gamma_MLThreshold", 0.1, "Decision Threshold value to select gammas"}; - Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true photons only"}; + Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true photons only"}; Configurable Photonv0TypeSel{"Photonv0TypeSel", 7, "select on a certain V0 type (leave negative if no selection desired)"}; Configurable PhotonMinDCADauToPv{"PhotonMinDCADauToPv", 0.0, "Min DCA daughter To PV (cm)"}; Configurable PhotonMaxDCAV0Dau{"PhotonMaxDCAV0Dau", 3.5, "Max DCA V0 Daughters (cm)"}; @@ -232,11 +238,27 @@ struct sigma0builder { Configurable PhotonPhiMax2{"PhotonPhiMax2", -1, "Phi min value to reject photons, region 2 (leave negative if no selection desired)"}; } photonSelections; + //// Photon criteria: + struct : ConfigurableGroup { + std::string prefix = "EMCalPhotonSelections"; // JSON group name + Configurable definition{"definition", 13, "Cluster definitions to be accepted (e.g. 13 for kV3MostSplitLowSeed)"}; + Configurable MinCells{"MinCells", 1, "Min number of cells in cluster"}; + Configurable MinEnergy{"MinEnergy", 0.0, "Minimum energy of selected clusters (GeV)"}; + Configurable MaxEnergy{"MaxEnergy", 5, "Max energy of selected clusters (GeV)"}; + Configurable MaxEta{"MaxEta", 1.0, "Max absolute cluster Eta"}; + Configurable MinTime{"MinTime", -50, "Minimum time of selected clusters (ns)"}; + Configurable MaxTime{"MaxTime", 50, "Max time of selected clusters (ns)"}; + Configurable RemoveExotic{"RemoveExotic", false, "Flag to enable the removal of exotic clusters"}; + Configurable MinM02{"MinM02", -1., "Minimum shower shape long axis"}; + Configurable MaxM02{"MaxM02", 5., "Max shower shape long axis"}; + + } EMCalPhotonSelections; + // KShort criteria: struct : ConfigurableGroup { std::string prefix = "kshortSelections"; // JSON group name Configurable KShort_MLThreshold{"KShort_MLThreshold", 0.1, "Decision Threshold value to select kshorts"}; - Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true kshorts only"}; + Configurable doMCAssociation{"doMCAssociation", false, "if MC, select true kshorts only"}; Configurable KShortMinDCANegToPv{"KShortMinDCANegToPv", .05, "min DCA Neg To PV (cm)"}; Configurable KShortMinDCAPosToPv{"KShortMinDCAPosToPv", .05, "min DCA Pos To PV (cm)"}; Configurable KShortMaxDCAV0Dau{"KShortMaxDCAV0Dau", 2.5, "Max DCA V0 Daughters (cm)"}; @@ -315,16 +337,22 @@ struct sigma0builder { ConfigurableAxis axisIRBinning{"axisIRBinning", {151, -10, 1500}, "Binning for the interaction rate (kHz)"}; ConfigurableAxis axisLifetime{"axisLifetime", {200, 0, 50}, "Lifetime"}; - // For manual sliceBy (necessary to calculate the correction factors) - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; + // EMCal-specifc + ConfigurableAxis axisClrDefinition{"axisClrDefinition", {51, -0.5, 50.5}, "Cluster Definition"}; + ConfigurableAxis axisClrNCells{"axisClrNCells", {25, 0.0, 25}, "N cells per cluster"}; + ConfigurableAxis axisClrEnergy{"axisClrEnergy", {400, 0.0, 10}, "Energy per cluster"}; + ConfigurableAxis axisClrTime{"axisClrTime", {300, -30.0, 30.0}, "cluster time (ns)"}; + ConfigurableAxis axisClrShape{"axisClrShape", {100, 0.0, 1.0}, "cluster shape"}; void init(InitContext const&) { LOGF(info, "Initializing now: cross-checking correctness..."); if (doprocessRealData + doprocessRealDataWithTOF + + doprocessRealDataWithEMCal + doprocessMonteCarlo + doprocessMonteCarloWithTOF + + doprocessMonteCarloWithEMCal + doprocessV0QA + doprocessV0MCQA > 1) { @@ -373,9 +401,11 @@ struct sigma0builder { } } + bool fUsePCMPhoton = !doprocessRealDataWithEMCal && !doprocessMonteCarloWithEMCal && !doprocessPCMVsEMCalQA; + for (const auto& histodir : DirList) { if ((histodir == "V0BeforeSel" && !fFillNoSelV0Histos) || - (histodir == "PhotonSel" && !fFillSelPhotonHistos) || + (histodir == "PhotonSel" && !fFillSelPhotonHistos && !fUsePCMPhoton) || (histodir == "LambdaSel" && !fFillSelLambdaHistos) || (histodir == "KShortSel" && !fFillSelKShortHistos)) { continue; @@ -424,20 +454,55 @@ struct sigma0builder { histos.add(histodir + "/h3dV0XYZ", "h3dV0XYZ", kTH3D, {axisXY, axisXY, axisZ}); } - histos.add("PhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Mass"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "Y"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Neg Eta"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Pos Eta"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "DCAToPV"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "DCADau"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Radius"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(9, "Z"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(10, "CosPA"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(11, "Phi"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(12, "TPCCR"); - histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "TPC NSigma"); + if (fUsePCMPhoton || doprocessPCMVsEMCalQA) { + histos.add("PhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Mass"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "Y"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Neg Eta"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Pos Eta"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "DCAToPV"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "DCADau"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Radius"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(9, "Z"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(10, "CosPA"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(11, "Phi"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(12, "TPCCR"); + histos.get(HIST("PhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "TPC NSigma"); + + if (doprocessPCMVsEMCalQA) { + histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); + } + + } else { + for (const auto& histodir : DirList2) { + histos.add(histodir + "/hDefinition", "hDefinition", kTH1D, {axisClrDefinition}); + histos.add(histodir + "/h2dNCells", "h2dNCells", kTH2D, {axisPt, axisClrNCells}); + histos.add(histodir + "/h2dEnergy", "h2dEnergy", kTH2D, {axisPt, axisClrEnergy}); + histos.add(histodir + "/h2dEtaVsPhi", "h2dEtaVsPhi", kTH2D, {axisRapidity, axisPhi}); + histos.add(histodir + "/h2dTime", "h2dTime", kTH2D, {axisPt, axisClrTime}); + histos.add(histodir + "/hExotic", "hExotic", kTH1D, {{2, -0.5f, 1.5f}}); + histos.add(histodir + "/h2dShape", "h2dShape", kTH2D, {axisPt, axisClrShape}); + } + + histos.add("EMCalPhotonSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Definition"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "MinCell"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(4, "Energy"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(5, "Eta"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(6, "Time"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(7, "Exotic"); + histos.get(HIST("EMCalPhotonSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(8, "Shape"); + } histos.add("LambdaSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); histos.get(HIST("LambdaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); @@ -471,13 +536,14 @@ struct sigma0builder { histos.get(HIST("KShortSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(13, "ITSNCls"); histos.get(HIST("KShortSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(14, "Lifetime"); - if (doprocessRealData || doprocessRealDataWithTOF || doprocessMonteCarlo || doprocessMonteCarloWithTOF) { + if (doprocessRealData || doprocessRealDataWithTOF || doprocessRealDataWithEMCal || doprocessMonteCarlo || doprocessMonteCarloWithTOF || doprocessMonteCarloWithEMCal) { histos.add("SigmaSel/hSigma0DauDeltaIndex", "hSigma0DauDeltaIndex", kTH1F, {{100, -49.5f, 50.5f}}); histos.add("SigmaSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); histos.get(HIST("SigmaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(1, "No Sel"); histos.get(HIST("SigmaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(2, "Sigma Mass Window"); histos.get(HIST("SigmaSel/hSelectionStatistics"))->GetXaxis()->SetBinLabel(3, "Sigma Y Window"); + histos.add("SigmaSel/hSigmaMassBeforeSel", "hSigmaMassBeforeSel", kTH1F, {axisSigmaMass}); histos.add("SigmaSel/hSigmaMassSelected", "hSigmaMassSelected", kTH1F, {axisSigmaMass}); histos.add("KStarSel/hSelectionStatistics", "hSelectionStatistics", kTH1D, {axisCandSel}); @@ -501,7 +567,7 @@ struct sigma0builder { } // MC - if (doprocessMonteCarlo || doprocessMonteCarloWithTOF) { + if (doprocessMonteCarlo || doprocessMonteCarloWithTOF || doprocessMonteCarloWithEMCal) { histos.add("MCQA/h2dPhotonNMothersVsPDG", "h2dPhotonNMothersVsPDG", kTHnSparseD, {{10, -0.5f, +9.5f}, {10001, -5000.5f, +5000.5f}}); histos.add("MCQA/h2dPhotonNMothersVsMCProcess", "h2dPhotonNMothersVsMCProcess", kTH2D, {{10, -0.5f, +9.5f}, {50, -0.5f, 49.5f}}); histos.add("MCQA/hPhotonMotherSize", "hPhotonMotherSize", kTH1D, {{10, -0.5f, +9.5f}}); @@ -529,6 +595,30 @@ struct sigma0builder { histos.add("MCQA/hNoV0MCCores", "hNoV0MCCores", kTH1D, {{4, -0.5f, +3.5f}}); } + if (doprocessPCMVsEMCalQA) { + histos.add("PhotonMCQA/hPCMPhotonMCpT", "hPCMPhotonMCpT", kTH1D, {axisPt}); + histos.add("PhotonMCQA/h2dPCMPhotonMCpTResolution", "h2dPCMPhotonMCpTResolution", kTH2D, {axisPt, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/hPCMSigma0PhotonMCpT", "hPCMSigma0PhotonMCpT", kTH1D, {axisPt}); + histos.add("PhotonMCQA/h2dPCMSigma0PhotonMCpTResolution", "h2dPCMSigma0PhotonMCpTResolution", kTH2D, {axisPt, {100, -2.0f, 2.0f}}); + + histos.add("PhotonMCQA/hEMCalPhotonMCpT", "hEMCalPhotonMCpT", kTH1D, {axisPt}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCpTResolution", "h2dEMCalPhotonMCpTResolution", kTH2D, {axisPt, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCEnergyResolution", "h2dEMCalPhotonMCEnergyResolution", kTH2D, {axisClrEnergy, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCEtaResolution", "h2dEMCalPhotonMCEtaResolution", kTH2D, {axisRapidity, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCPhiResolution", "h2dEMCalPhotonMCPhiResolution", kTH2D, {axisPhi, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalPhotonMCFractionEnergy", "h2dEMCalPhotonMCFractionEnergy", kTH2D, {axisPt, {100, -1.0f, 1.0f}}); + + histos.add("PhotonMCQA/hEMCalSigma0PhotonMCpT", "hEMCalSigma0PhotonMCpT", kTH1D, {axisPt}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCpTResolution", "h2dEMCalSigma0PhotonMCpTResolution", kTH2D, {axisPt, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCEnergyResolution", "h2dEMCalSigma0PhotonMCEnergyResolution", kTH2D, {axisClrEnergy, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCEtaResolution", "h2dEMCalSigma0PhotonMCEtaResolution", kTH2D, {axisRapidity, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCPhiResolution", "h2dEMCalSigma0PhotonMCPhiResolution", kTH2D, {axisPhi, {100, -2.0f, 2.0f}}); + histos.add("PhotonMCQA/h2dEMCalSigma0PhotonMCFractionEnergy", "h2dEMCalSigma0PhotonMCFractionEnergy", kTH2D, {axisPt, {100, -1.0f, 1.0f}}); + + histos.add("PhotonMCQA/hGenPhoton", "hGenPhoton", kTH1D, {axisPt}); + histos.add("PhotonMCQA/hGenSigma0Photon", "hGenSigma0Photon", kTH1D, {axisPt}); + } + if (doprocessGeneratedRun3 && genSelections.doQA) { // Pi0s @@ -705,6 +795,10 @@ struct sigma0builder { bool fIsV01Primary = false; bool fIsV02Primary = false; bool fV0PairProducedByGenerator = false; + int V01PDGCodePos = 0; + int V02PDGCodePos = 0; + int V01PDGCodeNeg = 0; + int V02PDGCodeNeg = 0; int V01PDGCode = 0; int V02PDGCode = 0; int V01PDGCodeMother = 0; @@ -720,6 +814,7 @@ struct sigma0builder { float V02MCpy = -999.f; float V02MCpz = -999.f; float V0PairMCRadius = -999.f; + float EMCalClusterAmplitude = -999.f; }; // ______________________________________________________ @@ -779,7 +874,8 @@ struct sigma0builder { info.DCADau = (cross.Mag2() > 0) ? std::abs(posdiff.Dot(cross)) / cross.R() : 999.f; info.CosPA = v01momentumNorm.Dot(v02momentumNorm); - if (d < 1e-5f) { // Parallel or nearly parallel lines + float Min_threshold = 1e-5f; // Threshold to consider lines as parallel, can be tuned + if (d < Min_threshold) { // Parallel or nearly parallel lines info.X = info.Y = info.Z = 0.f; // should we use another dummy value? Perhaps 999.f? return info; } @@ -831,6 +927,10 @@ struct sigma0builder { // MC association info MCinfo.fIsV01Primary = v01MC.isPhysicalPrimary(); MCinfo.fIsV02Primary = v02MC.isPhysicalPrimary(); + MCinfo.V01PDGCodePos = v01MC.pdgCodePositive(); + MCinfo.V01PDGCodeNeg = v01MC.pdgCodeNegative(); + MCinfo.V02PDGCodePos = v02MC.pdgCodePositive(); + MCinfo.V02PDGCodeNeg = v02MC.pdgCodeNegative(); MCinfo.V01PDGCode = v01MC.pdgCode(); MCinfo.V02PDGCode = v02MC.pdgCode(); MCinfo.V01PDGCodeMother = v01MC.pdgCodeMother(); @@ -933,6 +1033,169 @@ struct sigma0builder { return MCinfo; } + template + V0PairMCInfo getClusterV0PairMCInfo(TEMCalCls const& cluster, + TV0 const& v0, + TCollision const& collision, + TMCParticles const& mcparticles) + { + // Output container + V0PairMCInfo MCinfo; + + // ============================================================ + // 1) --- V0 (Lambda/AntiLambda) MC information --- + // ============================================================ + + // Check if V0 has MC information + if (!v0.has_v0MCCore()) { + return MCinfo; + } + + auto v0MC = v0.template v0MCCore_as>(); + auto mcLambda = mcparticles.rawIteratorAt(v0MC.particleIdMC()); + + // Save basic Lambda MC info (always saved, independent of matching) + MCinfo.V02MCpx = v0MC.pxMC(); + MCinfo.V02MCpy = v0MC.pyMC(); + MCinfo.V02MCpz = v0MC.pzMC(); + MCinfo.fIsV02Primary = v0MC.isPhysicalPrimary(); + MCinfo.V02PDGCode = v0MC.pdgCode(); + MCinfo.V02PDGCodeMother = v0MC.pdgCodeMother(); + MCinfo.V02PDGCodePos = v0MC.pdgCodePositive(); + MCinfo.V02PDGCodeNeg = v0MC.pdgCodeNegative(); + + // Check correct MC collision assignment (if available) + if (collision.has_straMCCollision()) { + auto MCCollision = collision.template straMCCollision_as< + soa::Join>(); + MCinfo.fIsV02CorrectlyAssign = (v0MC.straMCCollisionId() == MCCollision.globalIndex()); + } + + // Retrieve Lambda mothers + auto const& lambdaMothers = mcLambda.template mothers_as(); + if (lambdaMothers.empty()) { + // No ancestry -> cannot match to any parent + return MCinfo; + } + + // Assumption: first mother is the physical one + auto const& lambdaMother = lambdaMothers.front(); + int lambdaMotherIndex = lambdaMother.globalIndex(); + + // ============================================================ + // 2) --- EMCal cluster: loop over MC contributors --- + // ============================================================ + + int matchedPhotonId = -1; // MC photon candidate + int matchedMotherIndex = -1; // Common Sigma0 candidate + + // Fallback: sum of all contributor momenta (useful for resolution studies, perhaps?) + float sumPx = 0.f, sumPy = 0.f, sumPz = 0.f; + + // Loop over all MC contributors to the cluster + for (size_t i = 0; i < cluster.mcParticleIds().size(); i++) { + + int mcId = cluster.mcParticleIds()[i]; + auto mcPart = mcparticles.iteratorAt(mcId); + + // Accumulate total momentum (fallback strategy) + sumPx += mcPart.px(); + sumPy += mcPart.py(); + sumPz += mcPart.pz(); + + // ------------------------------------------------------------ + // Check 1: + // Does this contributor come from a Sigma0/AntiSigma0 somewhere in its ancestry? + // ------------------------------------------------------------ + int daughterId = aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain(mcPart, mcparticles, std::vector{PDG_t::kSigma0, PDG_t::kSigma0Bar}); + + if (daughterId < 0) + continue; // Not from Sigma0 -> try next contributor + + auto mcPhoton = mcparticles.iteratorAt(daughterId); + + // Sanity check: are we getting the correct particles? + auto dummy = mcparticles.rawIteratorAt(daughterId); + if (mcPhoton.globalIndex() != dummy.globalIndex()) + LOGF(fatal, "The behave of rawIteratorAt != iteratorAt. Index %i != %i. Please check. Aborting.", mcPhoton.globalIndex(), dummy.globalIndex()); + + // Require true photon, please + if (mcPhoton.pdgCode() != PDG_t::kGamma) + continue; + + // Get Sigma0 index from photon mother + auto mothers = mcPhoton.mothersIds(); + if (mothers.empty()) // No mothers? Weird + continue; + + int sigmaIndex = mothers[0]; + + // ------------------------------------------------------------ + // Check 2: + // Does this photon share the same mother as the Lambda? + // ------------------------------------------------------------ + if (sigmaIndex == lambdaMotherIndex) { + matchedPhotonId = daughterId; + matchedMotherIndex = sigmaIndex; + MCinfo.EMCalClusterAmplitude = cluster.amplitudeA()[i]; + break; // SUCCESS -> stop loop + } + } + + // ============================================================ + // 3) --- SUCCESS: true Lambda–photon pair from same Sigma0 --- + // ============================================================ + + if (matchedPhotonId >= 0 && matchedMotherIndex >= 0) { + + auto mcPhoton = mcparticles.iteratorAt(matchedPhotonId); + auto mcSigma = mcparticles.iteratorAt(matchedMotherIndex); + + // --- Pair (Sigma0) information + MCinfo.fV0PairProducedByGenerator = mcSigma.producedByGenerator(); + MCinfo.V0PairPDGCode = mcSigma.pdgCode(); + MCinfo.V0PairMCProcess = mcSigma.getProcess(); + MCinfo.V0PairMCParticleID = mcSigma.globalIndex(); + MCinfo.V0PairMCRadius = std::hypot(mcSigma.vx(), mcSigma.vy()); + + // Sigma0 mother (optional) + auto const& sigmaMothers = mcSigma.template mothers_as(); + if (!sigmaMothers.empty()) { + MCinfo.V0PairPDGCodeMother = sigmaMothers.front().pdgCode(); + } + + // --- Photon MC info + MCinfo.V01MCpx = mcPhoton.px(); + MCinfo.V01MCpy = mcPhoton.py(); + MCinfo.V01MCpz = mcPhoton.pz(); + MCinfo.fIsV01Primary = mcPhoton.isPhysicalPrimary(); + MCinfo.V01PDGCode = mcPhoton.pdgCode(); + + if (!mcPhoton.mothersIds().empty()) { + auto mcMother = mcparticles.iteratorAt(mcPhoton.mothersIds()[0]); + MCinfo.V01PDGCodeMother = mcMother.pdgCode(); + } + + return MCinfo; + } + + // ============================================================ + // 4) --- FAILURE: no true matching photon found --- + // ============================================================ + + // Strategy: + // - Keep Lambda MC info (already filled) + // - For cluster: + // use summed momentum of contributors (proxy for cluster truth) + // - Leave PDG / primary flags as default (dummy) + + MCinfo.V01MCpx = sumPx; + MCinfo.V01MCpy = sumPy; + MCinfo.V01MCpz = sumPz; + + return MCinfo; + } + // ______________________________________________________ // Check whether the collision passes our collision selections // Should work with collisions, mccollisions, stracollisions and stramccollisions tables! @@ -1079,12 +1342,21 @@ struct sigma0builder { std::vector getListOfRecoCollIndices(TMCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); int biggestNContribs = -1; int bestCollisionIndex = -1; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { // consider event selections in the recoed <-> gen collision association, for the denominator (or numerator) of the efficiency (or signal loss)? + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + if (eventSelections.useEvtSelInDenomEff && eventSelections.fUseEventSelection) { if (!IsEventAccepted(collision, false)) continue; @@ -1108,6 +1380,14 @@ struct sigma0builder { void fillGeneratedEventProperties(TMCCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { // Apply selections on MC collisions if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { @@ -1125,14 +1405,15 @@ struct sigma0builder { histos.fill(HIST("V0QA/hGenEvents"), mcCollision.multMCNParticlesEta05(), 0 /* all gen. events*/); - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); // Check if there is at least one of the reconstructed collisions associated to this MC collision // If so, we consider it bool atLeastOne = false; int biggestNContribs = -1; float centrality = 100.5f; int nCollisions = 0; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + if (eventSelections.fUseEventSelection) { if (!IsEventAccepted(collision, false)) continue; @@ -1258,7 +1539,7 @@ struct sigma0builder { auto v0MC = v0.template v0MCCore_as>(); - float V0MCpT = RecoDecay::pt(array{v0MC.pxMC(), v0MC.pyMC()}); + float V0MCpT = RecoDecay::pt(std::array{v0MC.pxMC(), v0MC.pyMC()}); float V0PA = TMath::ACos(v0.v0cosPA()); bool fIsV0CorrectlyAssigned = (v0MC.straMCCollisionId() == v0MCCollision.globalIndex()); bool isPrimary = v0MC.isPhysicalPrimary(); @@ -1322,7 +1603,7 @@ struct sigma0builder { histos.fill(HIST("GenQA/h2dSigma0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); // Checking decay modes and getting daughter pTs - for (auto& daughter : daughters) { + for (auto const& daughter : daughters) { histos.fill(HIST("GenQA/h2dSigma0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); if (GenInfo.NDaughters == 2) { @@ -1337,13 +1618,13 @@ struct sigma0builder { if ((GenInfo.IsKStar) && genSelections.doQA) { histos.fill(HIST("GenQA/h2dKStarMCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto& daughter : daughters) // checking decay modes + for (auto const& daughter : daughters) // checking decay modes histos.fill(HIST("GenQA/h2dKStarNDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); } if (GenInfo.IsPi0 && genSelections.doQA) { histos.fill(HIST("GenQA/h2dPi0MCSourceVsPDGMother"), GenInfo.IsProducedByGenerator, GenInfo.PDGCodeMother); - for (auto& daughter : daughters) // checking decay modes + for (auto const& daughter : daughters) // checking decay modes histos.fill(HIST("GenQA/h2dPi0NDaughtersVsPDG"), daughters.size(), daughter.pdgCode()); } } @@ -1453,7 +1734,7 @@ struct sigma0builder { template void genProcess(TMCParticles const& mcParticles) { - for (auto& mcParticle : mcParticles) { + for (auto const& mcParticle : mcParticles) { // Rapidity selection if ((mcParticle.y() < genSelections.mc_rapidityMin) || (mcParticle.y() > genSelections.mc_rapidityMax)) continue; @@ -1501,9 +1782,28 @@ struct sigma0builder { } } + // Function to fill QA histograms. mode = 0 (before selections, all clusters), 1 after all selections + template + void fillEMCalHistos(TEMCalClusterObject const& cluster) + { + // Check whether it is before or after selections + static constexpr std::string_view MainDir2[] = {"EMCalPhotonBeforeSel", "EMCalPhotonSel"}; + + // calculate pT for cluster assuming they are photons (so no mass) + float gammapT = std::sqrt(cluster.energy() * cluster.energy()) / std::cosh(cluster.eta()); + + histos.fill(HIST(MainDir2[mode]) + HIST("/hDefinition"), cluster.definition()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dNCells"), gammapT, cluster.nCells()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dEnergy"), gammapT, cluster.energy()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dShape"), gammapT, cluster.m02()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dEtaVsPhi"), cluster.eta(), cluster.phi()); + histos.fill(HIST(MainDir2[mode]) + HIST("/h2dTime"), gammapT, cluster.time()); + histos.fill(HIST(MainDir2[mode]) + HIST("/hExotic"), cluster.isExotic()); + } + // Function to fill QA histograms. mode = 0 (before selections, all v0s), 1 (photon candidates), 2 (lambda/alambda candidates) template - void fillHistos(TV0Object const& v0, TCollision const& collision) + void fillV0Histos(TV0Object const& v0, TCollision const& collision) { // Check whether it is before or after selections static constexpr std::string_view MainDir[] = {"V0BeforeSel", "PhotonSel", "LambdaSel", "KShortSel"}; @@ -1567,7 +1867,56 @@ struct sigma0builder { } //_______________________________________________ - // Process photon candidate + // Process v0 photon candidate + template + bool processEMCalPhotonCandidate(TEMCalClusterObject const& cluster) + { + // Clusterizer + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 1.); + if (cluster.definition() != EMCalPhotonSelections.definition && EMCalPhotonSelections.definition > -1) + return false; + + // Number of Cells + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 2.); + if (cluster.nCells() < EMCalPhotonSelections.MinCells) + return false; + + // Energy + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 3.); + if (cluster.energy() < EMCalPhotonSelections.MinEnergy || cluster.energy() > EMCalPhotonSelections.MaxEnergy) + return false; + + // Eta + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 4.); + if (TMath::Abs(cluster.eta()) > EMCalPhotonSelections.MaxEta) + return false; + + // Timing + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 5.); + if (cluster.time() < EMCalPhotonSelections.MinTime || cluster.time() > EMCalPhotonSelections.MaxTime) + return false; + + // Exotic Clusters + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 6.); + if (cluster.isExotic() && EMCalPhotonSelections.RemoveExotic) { + return false; + } + + // Shower shape long axis + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 7.); + if (cluster.nCells() > 1) { // Only if we have more than one + if (cluster.m02() < EMCalPhotonSelections.MinM02 || cluster.m02() > EMCalPhotonSelections.MaxM02) { + return false; + } + } + + histos.fill(HIST("EMCalPhotonSel/hSelectionStatistics"), 8.); + + return true; + } + + //_______________________________________________ + // Process v0 photon candidate template bool processPhotonCandidate(TV0Object const& gamma) { @@ -1918,14 +2267,20 @@ struct sigma0builder { } //_______________________________________________ - // Build sigma0 candidate + // Build sigma0 candidate with PCM photons template - bool buildSigma0(TV0Object const& lambda, TV0Object const& gamma, TCollision const& collision, TMCParticles const& mcparticles) + bool buildPCMSigma0(TV0Object const& lambda, TV0Object const& gamma, TCollision const& collision, TMCParticles const& mcparticles) { //_______________________________________________ + // Same index rejection + if (gamma.globalIndex() == lambda.globalIndex()) + return false; + // Checking if both V0s are made of the very same tracks if (gamma.posTrackExtraId() == lambda.posTrackExtraId() || - gamma.negTrackExtraId() == lambda.negTrackExtraId()) { + gamma.negTrackExtraId() == lambda.negTrackExtraId() || + gamma.posTrackExtraId() == lambda.negTrackExtraId() || + gamma.negTrackExtraId() == lambda.posTrackExtraId()) { return false; } @@ -1959,26 +2314,23 @@ struct sigma0builder { // Sigma0 topological info auto sigma0TopoInfo = propagateV0PairToDCA(gamma, lambda); - sigma0cores(sigma0TopoInfo.X, sigma0TopoInfo.Y, sigma0TopoInfo.Z, sigma0TopoInfo.DCADau, + sigma0cores(gamma.globalIndex(), lambda.globalIndex(), sigma0TopoInfo.X, sigma0TopoInfo.Y, sigma0TopoInfo.Z, sigma0TopoInfo.DCADau, gamma.px(), gamma.py(), gamma.pz(), gamma.mGamma(), lambda.px(), lambda.py(), lambda.pz(), lambda.mLambda(), lambda.mAntiLambda()); // MC properties if constexpr (requires { gamma.motherMCPartId(); lambda.motherMCPartId(); }) { auto sigma0MCInfo = getV0PairMCInfo(gamma, lambda, collision, mcparticles); - sigma0mccores(sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, - sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, - sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, + sigma0mccores(sigma0MCInfo.V0PairMCParticleID, sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, + sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, sigma0MCInfo.EMCalClusterAmplitude, + sigma0MCInfo.V01PDGCodePos, sigma0MCInfo.V01PDGCodeNeg, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, sigma0MCInfo.V02MCpx, sigma0MCInfo.V02MCpy, sigma0MCInfo.V02MCpz, - sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); - - sigma0mclabel(sigma0MCInfo.V0PairMCParticleID); + sigma0MCInfo.V02PDGCodePos, sigma0MCInfo.V02PDGCodeNeg, sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); } // Sigma0s -> stracollisions link histos.fill(HIST("SigmaSel/hSigma0DauDeltaIndex"), gamma.globalIndex() - lambda.globalIndex()); sigma0CollRefs(collision.globalIndex()); - sigmaIndices(gamma.globalIndex(), lambda.globalIndex()); //_______________________________________________ // Photon extra properties @@ -2043,6 +2395,111 @@ struct sigma0builder { return true; } + // Build sigma0 candidate + template + bool buildEMCalSigma0(TV0Object const& lambda, TEMCalClsObject const& gamma, TCollision const& collision, TMCParticles const& mcparticles, std::vector const& emcaltracksmatched) + { + // calculate pT for cluster assuming they are photons (so no mass) + float gammapT = std::sqrt(gamma.energy() * gamma.energy()) / std::cosh(gamma.eta()); + + // Momentum components + float gammapx = gammapT * std::cos(gamma.phi()); + float gammapy = gammapT * std::sin(gamma.phi()); + float gammapz = gammapT * std::sinh(gamma.phi()); + + //_______________________________________________ + // Sigma0 pre-selections + std::array pVecPhotons{gammapx, gammapy, gammapz}; + std::array pVecLambda{lambda.px(), lambda.py(), lambda.pz()}; + + auto arrMom = std::array{pVecPhotons, pVecLambda}; + float sigmaMass = RecoDecay::m(arrMom, std::array{o2::constants::physics::MassPhoton, o2::constants::physics::MassLambda0}); + + // N.B. At this stage, we are only using the reconstructed rapidity (ideally with a very loose cut) + // A proper selection should be done in the sigmaanalysis + float sigmaY = RecoDecay::y(std::array{gammapx + lambda.px(), gammapy + lambda.py(), gammapz + lambda.pz()}, o2::constants::physics::MassSigma0); + + histos.fill(HIST("SigmaSel/hSelectionStatistics"), 1.); + histos.fill(HIST("SigmaSel/hSigmaMassBeforeSel"), sigmaMass); + if (TMath::Abs(sigmaMass - o2::constants::physics::MassSigma0) > Sigma0Window) + return false; + + histos.fill(HIST("SigmaSel/hSelectionStatistics"), 2.); + if (TMath::Abs(sigmaY) > SigmaMaxRap) + return false; + + histos.fill(HIST("SigmaSel/hSigmaMassSelected"), sigmaMass); + histos.fill(HIST("SigmaSel/hSelectionStatistics"), 3.); + + //_______________________________________________ + // Calculate properties & Fill tables + sigma0cores(gamma.globalIndex(), lambda.globalIndex(), + 0.0f, 0.0f, 0.0f, 0.0f, // N.B: Filling with dummy values for now + gammapx, gammapy, gammapz, 0.0f, + lambda.px(), lambda.py(), lambda.pz(), lambda.mLambda(), lambda.mAntiLambda()); + + // MC properties + if constexpr (requires { gamma.mcParticleIds(); lambda.motherMCPartId(); }) { + + auto sigma0MCInfo = getClusterV0PairMCInfo(gamma, lambda, collision, mcparticles); + + sigma0mccores(sigma0MCInfo.V0PairMCParticleID, sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, + sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, sigma0MCInfo.EMCalClusterAmplitude, + sigma0MCInfo.V01PDGCodePos, sigma0MCInfo.V01PDGCodeNeg, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, + sigma0MCInfo.V02MCpx, sigma0MCInfo.V02MCpy, sigma0MCInfo.V02MCpz, + sigma0MCInfo.V02PDGCodePos, sigma0MCInfo.V02PDGCodeNeg, sigma0MCInfo.fIsV02Primary, sigma0MCInfo.V02PDGCode, sigma0MCInfo.V02PDGCodeMother, sigma0MCInfo.fIsV02CorrectlyAssign); + } + + sigma0CollRefs(collision.globalIndex()); + + //_______________________________________________ + // Photon extra properties + bool hasAssociatedTrack = emcaltracksmatched[gamma.globalIndex()]; + sigmaEmCalPhotonExtras(gamma.id(), gamma.energy(), gamma.eta(), gamma.phi(), + gamma.m02(), gamma.m20(), gamma.nCells(), gamma.time(), + gamma.isExotic(), gamma.distanceToBadChannel(), gamma.nlm(), gamma.definition(), hasAssociatedTrack); + + //_______________________________________________ + // Lambda extra properties + auto posTrackLambda = lambda.template posTrackExtra_as(); + auto negTrackLambda = lambda.template negTrackExtra_as(); + + uint8_t fLambdaPosTrackCode = ((uint8_t(posTrackLambda.hasTPC()) << hasTPC) | + (uint8_t(posTrackLambda.hasITSTracker()) << hasITSTracker) | + (uint8_t(posTrackLambda.hasITSAfterburner()) << hasITSAfterburner) | + (uint8_t(posTrackLambda.hasTRD()) << hasTRD) | + (uint8_t(posTrackLambda.hasTOF()) << hasTOF)); + + uint8_t fLambdaNegTrackCode = ((uint8_t(negTrackLambda.hasTPC()) << hasTPC) | + (uint8_t(negTrackLambda.hasITSTracker()) << hasITSTracker) | + (uint8_t(negTrackLambda.hasITSAfterburner()) << hasITSAfterburner) | + (uint8_t(negTrackLambda.hasTRD()) << hasTRD) | + (uint8_t(negTrackLambda.hasTOF()) << hasTOF)); + + float fLambdaLifeTime = lambda.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; + float fLambdaPrTOFNSigma = -999.f; + float fLambdaPiTOFNSigma = -999.f; + float fALambdaPrTOFNSigma = -999.f; + float fALambdaPiTOFNSigma = -999.f; + + if constexpr (requires { lambda.tofNSigmaLaPr(); }) { // If TOF info avaiable + fLambdaPrTOFNSigma = lambda.tofNSigmaLaPr(); + fLambdaPiTOFNSigma = lambda.tofNSigmaLaPi(); + fALambdaPrTOFNSigma = lambda.tofNSigmaALaPr(); + fALambdaPiTOFNSigma = lambda.tofNSigmaALaPi(); + } + + sigmaLambdaExtras(lambda.qtarm(), lambda.alpha(), fLambdaLifeTime, lambda.v0radius(), lambda.v0cosPA(), lambda.dcaV0daughters(), lambda.dcanegtopv(), lambda.dcapostopv(), + posTrackLambda.tpcNSigmaPr(), posTrackLambda.tpcNSigmaPi(), negTrackLambda.tpcNSigmaPr(), negTrackLambda.tpcNSigmaPi(), + fLambdaPrTOFNSigma, fLambdaPiTOFNSigma, fALambdaPrTOFNSigma, fALambdaPiTOFNSigma, + posTrackLambda.tpcCrossedRows(), negTrackLambda.tpcCrossedRows(), + lambda.positiveeta(), lambda.negativeeta(), + posTrackLambda.itsNCls(), negTrackLambda.itsNCls(), posTrackLambda.itsChi2PerNcl(), negTrackLambda.itsChi2PerNcl(), + fLambdaPosTrackCode, fLambdaNegTrackCode, lambda.v0Type()); + + return true; + } + //_______________________________________________ // Build kstar candidate template @@ -2165,25 +2622,40 @@ struct sigma0builder { } // Process photon and lambda candidates to build sigma0 candidates - template - void dataProcess(TCollision const& collisions, TV0s const& fullV0s, TMCParticles const& mcparticles) + template + void dataProcess(TCollision const& collisions, TV0s const& fullV0s, TEMCal const& fullEMCalClusters, TEMCalTracks const& emcaltracks, TMCParticles const& mcparticles) { //_______________________________________________ // Initial setup + bool fUsePCMPhoton = !doprocessRealDataWithEMCal && !doprocessMonteCarloWithEMCal; + // Auxiliary vectors to store best candidates std::vector bestGammasArray; std::vector bestLambdasArray; - - std::vector bestKStarGammasArray; std::vector bestKShortsArray; // Custom grouping std::vector> v0grouped(collisions.size()); + std::vector> emclustersgrouped(collisions.size()); + std::vector emcaltracksgrouped; + // Grouping step: for (const auto& v0 : fullV0s) { v0grouped[v0.straCollisionId()].push_back(v0.globalIndex()); } + if constexpr (soa::is_table) { + emcaltracksgrouped.resize(fullEMCalClusters.size(), false); + for (const auto& cluster : fullEMCalClusters) { + emclustersgrouped[cluster.collisionId()].push_back(cluster.globalIndex()); + } + + // Mapping emccluster to matched tracks + for (const auto& calotrack : emcaltracks) { + emcaltracksgrouped[calotrack.emcalclusterId()] = true; + } + } + //_______________________________________________ // Collisions loop for (const auto& coll : collisions) { @@ -2193,11 +2665,14 @@ struct sigma0builder { continue; } + if constexpr (soa::is_table) { + if (emclustersgrouped[coll.globalIndex()].size() == 0 && eventSelections.fSkipEmptyEMCal) + continue; + } + // Clear vectors bestGammasArray.clear(); bestLambdasArray.clear(); - - bestKStarGammasArray.clear(); bestKShortsArray.clear(); float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C(); @@ -2209,40 +2684,55 @@ struct sigma0builder { auto v0 = fullV0s.rawIteratorAt(v0grouped[coll.globalIndex()][i]); if (fFillNoSelV0Histos) - fillHistos<0>(v0, coll); // Filling "all V0s" histograms + fillV0Histos<0>(v0, coll); // Filling "all V0s" histograms - if (processPhotonCandidate(v0)) { // selecting photons - if (fFillSelPhotonHistos) - fillHistos<1>(v0, coll); // QA histos - bestGammasArray.push_back(v0.globalIndex()); // Save indices of best gamma candidates + if (fUsePCMPhoton) { + if (processPhotonCandidate(v0)) { // selecting photons + if (fFillSelPhotonHistos) + fillV0Histos<1>(v0, coll); // QA histos + bestGammasArray.push_back(v0.globalIndex()); // Save indices of best gamma candidates + } } if (processLambdaCandidate(v0, coll)) { // selecting lambdas if (fFillSelLambdaHistos) - fillHistos<2>(v0, coll); // QA histos + fillV0Histos<2>(v0, coll); // QA histos bestLambdasArray.push_back(v0.globalIndex()); // Save indices of best lambda candidates } if (processKShortCandidate(v0, coll)) { // selecting kshorts if (fFillSelKShortHistos) - fillHistos<3>(v0, coll); // QA histos + fillV0Histos<3>(v0, coll); // QA histos bestKShortsArray.push_back(v0.globalIndex()); // Save indices of best kshort candidates } } + // If EMCalClusters is available, we don't use PCM + if constexpr (soa::is_table) { + for (size_t i = 0; i < emclustersgrouped[coll.globalIndex()].size(); i++) { + auto cluster = fullEMCalClusters.rawIteratorAt(emclustersgrouped[coll.globalIndex()][i]); + fillEMCalHistos<0>(cluster); + + if (processEMCalPhotonCandidate(cluster)) { // selecting photons + fillEMCalHistos<1>(cluster); // QA histos + bestGammasArray.push_back(cluster.globalIndex()); // Save indices of best gamma candidates + } + } + } + //_______________________________________________ // Wrongly collision association study (MC-specific) if constexpr (requires { coll.straMCCollisionId(); }) { if (doAssocStudy) { - analyzeV0CollAssoc(coll, fullV0s, bestGammasArray, true); // Photon-analysis + if constexpr (!soa::is_table) + analyzeV0CollAssoc(coll, fullV0s, bestGammasArray, true); // Photon-analysis analyzeV0CollAssoc(coll, fullV0s, bestLambdasArray, false); // Lambda-analysis } } //_______________________________________________ - // V0 nested loop + // Photon-V0 nested loop for (size_t i = 0; i < bestGammasArray.size(); ++i) { - auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); //_______________________________________________ // Sigma0 loop @@ -2251,32 +2741,45 @@ struct sigma0builder { auto lambda = fullV0s.rawIteratorAt(bestLambdasArray[j]); // Building sigma0 candidate & filling tables - if (!buildSigma0(lambda, gamma1, coll, mcparticles)) - continue; + if constexpr (soa::is_table) { // using EMCal photons + auto gamma1 = fullEMCalClusters.rawIteratorAt(bestGammasArray[i]); + if (!buildEMCalSigma0(lambda, gamma1, coll, mcparticles, emcaltracksgrouped)) + continue; + } else { // using PCM photons + auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); + if (!buildPCMSigma0(lambda, gamma1, coll, mcparticles)) + continue; + } } } //_______________________________________________ // KStar loop - if (fillKStarTables) { - for (size_t j = 0; j < bestKShortsArray.size(); ++j) { - auto kshort = fullV0s.rawIteratorAt(bestKShortsArray[j]); - - // Building kstar candidate & filling tables - if (!buildKStar(kshort, gamma1, coll, mcparticles)) - continue; + if constexpr (!soa::is_table) { // Don't use EMCal clusters here + if (fillKStarTables) { + auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); + for (size_t j = 0; j < bestKShortsArray.size(); ++j) { + auto kshort = fullV0s.rawIteratorAt(bestKShortsArray[j]); + + // Building kstar candidate & filling tables + if (!buildKStar(kshort, gamma1, coll, mcparticles)) + continue; + } } } //_______________________________________________ // pi0 loop - if (fillPi0Tables) { - for (size_t j = i + 1; j < bestGammasArray.size(); ++j) { - auto gamma2 = fullV0s.rawIteratorAt(bestGammasArray[j]); - - // Building pi0 candidate & filling tables - if (!buildPi0(gamma1, gamma2, coll, mcparticles)) - continue; + if constexpr (!soa::is_table) { // Don't use EMCal clusters here + if (fillPi0Tables) { + auto gamma1 = fullV0s.rawIteratorAt(bestGammasArray[i]); + for (size_t j = i + 1; j < bestGammasArray.size(); ++j) { + auto gamma2 = fullV0s.rawIteratorAt(bestGammasArray[j]); + + // Building pi0 candidate & filling tables + if (!buildPi0(gamma1, gamma2, coll, mcparticles)) + continue; + } } } } @@ -2317,7 +2820,7 @@ struct sigma0builder { auto v0 = fullV0s.rawIteratorAt(v0grouped[coll.globalIndex()][i]); if (fFillNoSelV0Histos) - fillHistos<0>(v0, coll); // Filling "all V0s" histograms + fillV0Histos<0>(v0, coll); // Filling "all V0s" histograms // Selection process fPassPhotonSel = processPhotonCandidate(v0); @@ -2327,7 +2830,7 @@ struct sigma0builder { // Reco part: if (fPassPhotonSel) { if (fFillSelPhotonHistos) - fillHistos<1>(v0, coll); + fillV0Histos<1>(v0, coll); // Fill analysis Histos: float PhotonY = RecoDecay::y(std::array{v0.px(), v0.py(), v0.pz()}, o2::constants::physics::MassGamma); @@ -2337,7 +2840,7 @@ struct sigma0builder { } if (fPassLambdaSel) { if (fFillSelLambdaHistos) - fillHistos<2>(v0, coll); + fillV0Histos<2>(v0, coll); // Fill analysis Histos: histos.fill(HIST("V0QA/h3dLambdaMass"), centrality, v0.pt(), v0.mLambda()); @@ -2352,7 +2855,7 @@ struct sigma0builder { if (fPassKShortSel) { if (fFillSelKShortHistos) - fillHistos<3>(v0, coll); + fillV0Histos<3>(v0, coll); // Fill analysis Histos: histos.fill(HIST("V0QA/h3dKShortMass"), centrality, v0.pt(), v0.mK0Short()); @@ -2403,25 +2906,250 @@ struct sigma0builder { } } } + + template + void runPCMVsEMCalQA(TCollision const& collisions, TV0s const& fullV0s, TEMCal const& fullEMCalClusters, TEMCalTracks const& emcaltracks, TMCParticles const& mcparticles) + { + + // Custom grouping + std::vector> v0grouped(collisions.size()); + std::vector> emclustersgrouped(collisions.size()); + std::vector emcaltracksgrouped(collisions.size(), false); + + // Grouping step: + for (const auto& v0 : fullV0s) { + v0grouped[v0.straCollisionId()].push_back(v0.globalIndex()); + } + + for (const auto& cluster : fullEMCalClusters) { + emclustersgrouped[cluster.collisionId()].push_back(cluster.globalIndex()); + } + + // Mapping emccluster to matched tracks + for (const auto& calotrack : emcaltracks) { + emcaltracksgrouped[calotrack.emcalclusterId()] = true; + } + + //_______________________________________________ + // Collisions loop + for (const auto& coll : collisions) { + // Event selection + if (eventSelections.fUseEventSelection) { + if (!IsEventAccepted(coll, true)) + continue; + } + + float centrality = doPPAnalysis ? coll.centFT0M() : coll.centFT0C(); + histos.fill(HIST("hEventCentrality"), centrality); + + //_______________________________________________ + // V0s loop + for (size_t i = 0; i < v0grouped[coll.globalIndex()].size(); i++) { + auto v0 = fullV0s.rawIteratorAt(v0grouped[coll.globalIndex()][i]); + + if (processPhotonCandidate(v0)) { // selecting PCM photons + + // Check if V0 has MC information + if (!v0.has_v0MCCore()) { + continue; + } + + auto v0MC = v0.template v0MCCore_as>(); + auto mcv0Photon = mcparticles.rawIteratorAt(v0MC.particleIdMC()); + + if (mcv0Photon.pdgCode() != PDG_t::kGamma || !mcv0Photon.isPhysicalPrimary() || TMath::Abs(mcv0Photon.y()) > 0.5) + continue; + + // MC pT histo + histos.fill(HIST("PhotonMCQA/hPCMPhotonMCpT"), mcv0Photon.pt()); + + // pT resolution + histos.fill(HIST("PhotonMCQA/h2dPCMPhotonMCpTResolution"), mcv0Photon.pt(), 1 - v0.pt() / mcv0Photon.pt()); + + // photon from sigma0/asigma0 + auto const& v0photonMothers = mcv0Photon.template mothers_as(); + if (!v0photonMothers.empty()) { + // Assumption: first mother is the physical one + auto const& v0photonMother = v0photonMothers.front(); + if (TMath::Abs(v0photonMother.pdgCode()) == PDG_t::kSigma0) { // Sigma0 or ASigma0 + // For efficiency + histos.fill(HIST("PhotonMCQA/hPCMSigma0PhotonMCpT"), mcv0Photon.pt()); + + // pT resolution + histos.fill(HIST("PhotonMCQA/h2dPCMSigma0PhotonMCpTResolution"), mcv0Photon.pt(), 1 - v0.pt() / mcv0Photon.pt()); + } + } + } + } + + // EMCal clusters loop + for (size_t icl = 0; icl < emclustersgrouped[coll.globalIndex()].size(); icl++) { + auto cluster = fullEMCalClusters.rawIteratorAt(emclustersgrouped[coll.globalIndex()][icl]); + + if (!processEMCalPhotonCandidate(cluster)) + continue; + + // ============================================================ + // --- Reco kinematics (assume photon mass = 0) + // ============================================================ + + float E = cluster.energy(); + float eta = cluster.eta(); + + float pt = E / std::cosh(eta); + + // ============================================================ + // --- MC matching + // ============================================================ + // Map to avoid double counting of photons in case of conversions (one cluster can be matched to both e+ and e-) + std::unordered_set uniquePhotonIds; + + // Loop over cluster contributors + for (size_t i = 0; i < cluster.mcParticleIds().size(); i++) { + + int mcId = cluster.mcParticleIds()[i]; + auto mcPart = mcparticles.iteratorAt(mcId); + + // ============================================================ + // Find photon ancestor (including conversions) + // ============================================================ + + int photonId = -1; + + // Case 1: particle itself is photon + if (mcPart.pdgCode() == PDG_t::kGamma) { + photonId = mcPart.globalIndex(); + } else { + // Case 2: climb ancestry to find photon + int candidateId = + aod::pwgem::photonmeson::utils::mcutil::FindMotherInChain( + mcPart, mcparticles, std::vector{22}); + + if (candidateId >= 0) + photonId = candidateId; + } + + if (photonId < 0) + continue; + + // ============================================================ + // Avoid double counting (conversion case!) + // ============================================================ + + if (uniquePhotonIds.find(photonId) != uniquePhotonIds.end()) + continue; + + uniquePhotonIds.insert(photonId); + + auto mcPhoton = mcparticles.iteratorAt(photonId); + + // ============================================================ + // Select TRUE + PRIMARY photons + // ============================================================ + + if (mcPhoton.pdgCode() != PDG_t::kGamma || !mcPhoton.isPhysicalPrimary() || TMath::Abs(mcPhoton.y()) > 0.5) + continue; + + // ============================================================ + // Fill QA histos + // ============================================================ + + // MC pT histo + histos.fill(HIST("PhotonMCQA/hEMCalPhotonMCpT"), mcPhoton.pt()); + + // pT resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCpTResolution"), mcPhoton.pt(), 1 - pt / mcPhoton.pt()); + + // Energy resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCEnergyResolution"), mcPhoton.e(), 1 - cluster.energy() / mcPhoton.e()); + + // Eta resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCEtaResolution"), mcPhoton.eta(), cluster.eta() - mcPhoton.eta()); + + // Phi resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCPhiResolution"), mcPhoton.phi(), cluster.phi() - mcPhoton.phi()); + + // Fraction of energy Vs MC pT + histos.fill(HIST("PhotonMCQA/h2dEMCalPhotonMCFractionEnergy"), mcPhoton.pt(), cluster.amplitudeA()[i]); + + // photon from sigma0/asigma0 + auto const& photonMothers = mcPhoton.template mothers_as(); + if (!photonMothers.empty()) { + // Assumption: first mother is the physical one + auto const& photonMother = photonMothers.front(); + if (TMath::Abs(photonMother.pdgCode()) == PDG_t::kSigma0) { // Sigma0 or ASigma0 + // For efficiency + histos.fill(HIST("PhotonMCQA/hEMCalSigma0PhotonMCpT"), mcPhoton.pt()); + + // pT resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCpTResolution"), mcPhoton.pt(), 1 - pt / mcPhoton.pt()); + + // Energy resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCEnergyResolution"), mcPhoton.e(), 1 - cluster.energy() / mcPhoton.e()); + + // Eta resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCEtaResolution"), mcPhoton.eta(), cluster.eta() - mcPhoton.eta()); + + // Phi resolution + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCPhiResolution"), mcPhoton.phi(), cluster.phi() - mcPhoton.phi()); + + // Fraction of energy Vs MC pT + histos.fill(HIST("PhotonMCQA/h2dEMCalSigma0PhotonMCFractionEnergy"), mcPhoton.pt(), cluster.amplitudeA()[i]); + } + } + } + } + + } // end of collisions loop + + // Process MC generated photons + for (const auto& mcpart : mcparticles) { + if (mcpart.pdgCode() != PDG_t::kGamma || !mcpart.isPhysicalPrimary() || TMath::Abs(mcpart.y()) > 0.5) + continue; + + histos.fill(HIST("PhotonMCQA/hGenPhoton"), mcpart.pt()); + + // photon from sigma0/asigma0 + auto const& photonMothers = mcpart.template mothers_as(); + if (!photonMothers.empty()) { + // Assumption: first mother is the physical one + auto const& photonMother = photonMothers.front(); + if (TMath::Abs(photonMother.pdgCode()) == PDG_t::kSigma0) { // Sigma0 or ASigma0 + histos.fill(HIST("PhotonMCQA/hGenSigma0Photon"), mcpart.pt()); + } + } + } + } + // Sigma0 processing part void processRealData(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&) { - dataProcess(collisions, fullV0s, nullptr); + dataProcess(collisions, fullV0s, nullptr, nullptr, nullptr); } void processRealDataWithTOF(soa::Join const& collisions, V0TOFStandardDerivedDatas const& fullV0s, dauTracks const&) { - dataProcess(collisions, fullV0s, nullptr); + dataProcess(collisions, fullV0s, nullptr, nullptr, nullptr); + } + + void processRealDataWithEMCal(soa::Join const& collisions, V0StandardDerivedDatas const& fullV0s, dauTracks const&, aod::EMCALClusters const& fullEMCalClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + { + dataProcess(collisions, fullV0s, fullEMCalClusters, emcmatchedtracks, nullptr); } void processMonteCarlo(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) { - dataProcess(collisions, fullV0s, mcParticles); + dataProcess(collisions, fullV0s, nullptr, nullptr, mcParticles); } void processMonteCarloWithTOF(soa::Join const& collisions, V0TOFDerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&) { - dataProcess(collisions, fullV0s, mcParticles); + dataProcess(collisions, fullV0s, nullptr, nullptr, mcParticles); + } + + void processMonteCarloWithEMCal(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&, EMCalMCClusters const& fullEMCalMCClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + { + dataProcess(collisions, fullV0s, fullEMCalMCClusters, emcmatchedtracks, mcParticles); } void processGeneratedRun3(aod::McParticles const& mcParticles) @@ -2445,14 +3173,22 @@ struct sigma0builder { runGenV0QA(mcCollisions, V0MCCores, collisions); } + void processPCMVsEMCalQA(soa::Join const& collisions, V0DerivedMCDatas const& fullV0s, aod::McParticles const& mcParticles, dauTracks const&, aod::MotherMCParts const&, soa::Join const&, soa::Join const&, EMCalMCClusters const& fullEMCalMCClusters, aod::EMCALMatchedTracks const& emcmatchedtracks) + { + runPCMVsEMCalQA(collisions, fullV0s, fullEMCalMCClusters, emcmatchedtracks, mcParticles); + } + PROCESS_SWITCH(sigma0builder, processRealData, "process as if real data", true); - PROCESS_SWITCH(sigma0builder, processRealDataWithTOF, "process as if real data", false); + PROCESS_SWITCH(sigma0builder, processRealDataWithTOF, "process as if real data, uses TOF PID info", false); + PROCESS_SWITCH(sigma0builder, processRealDataWithEMCal, "process as if real data, uses EMCal clusters", false); PROCESS_SWITCH(sigma0builder, processMonteCarlo, "process as if MC data", false); PROCESS_SWITCH(sigma0builder, processMonteCarloWithTOF, "process as if MC data, uses TOF PID info", false); + PROCESS_SWITCH(sigma0builder, processMonteCarloWithEMCal, "process as if MC data, uses EMCal clusters", false); PROCESS_SWITCH(sigma0builder, processGeneratedRun3, "process generated MC info", false); PROCESS_SWITCH(sigma0builder, processV0QA, "process QA of lambdas and photons", false); PROCESS_SWITCH(sigma0builder, processV0MCQA, "process QA of lambdas and photons", false); PROCESS_SWITCH(sigma0builder, processV0Generated, "process QA of gen lambdas and photons", false); + PROCESS_SWITCH(sigma0builder, processPCMVsEMCalQA, "process QA of PCM and EMCal photons", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/TableProducer/Strangeness/stracents.cxx b/PWGLF/TableProducer/Strangeness/stracents.cxx index ce5597563da..96ca0a745c8 100644 --- a/PWGLF/TableProducer/Strangeness/stracents.cxx +++ b/PWGLF/TableProducer/Strangeness/stracents.cxx @@ -131,6 +131,7 @@ struct straCents { CalibrationInfo ft0aInfo = CalibrationInfo("FT0A"); CalibrationInfo ft0cInfo = CalibrationInfo("FT0C"); CalibrationInfo ft0cVariant1Info = CalibrationInfo("FT0Cvar1"); + CalibrationInfo ft0cVariant2Info = CalibrationInfo("FT0Cvar2"); CalibrationInfo fddmInfo = CalibrationInfo("FDD"); CalibrationInfo ntpvInfo = CalibrationInfo("NTracksPV"); CalibrationInfo nGlobalInfo = CalibrationInfo("NGlobal"); @@ -243,6 +244,7 @@ struct straCents { ft0aInfo.mCalibrationStored = false; ft0cInfo.mCalibrationStored = false; ft0cVariant1Info.mCalibrationStored = false; + ft0cVariant2Info.mCalibrationStored = false; fddmInfo.mCalibrationStored = false; ntpvInfo.mCalibrationStored = false; nGlobalInfo.mCalibrationStored = false; @@ -371,6 +373,7 @@ struct straCents { getccdb(ft0aInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(ft0cInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(ft0cVariant1Info, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); + getccdb(ft0cVariant2Info, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(fddmInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(ntpvInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); getccdb(nGlobalInfo, ccdbConfig.genName, ccdbConfig.doNotCrashOnNull); @@ -533,12 +536,14 @@ struct straCents { float centFT0C = getCentrality(ft0cInfo, multZeqFT0C); float centFV0A = getCentrality(fv0aInfo, multZeqFV0A); float centFT0CVariant1 = getCentrality(ft0cVariant1Info, multZeqFT0C); + float centFT0CVariant2 = getCentrality(ft0cVariant2Info, multZeqFT0C); float centMFT = 100.5f; // missing mftNtracks in strangeness data model float centNGlobal = getCentrality(nGlobalInfo, collision.multNTracksGlobal()); + float centNTPV = 100.5f; // missing multNContribs in strangeness data model strangeCents(centFT0M, centFT0A, - centFT0C, centFV0A, centFT0CVariant1, - centMFT, centNGlobal); + centFT0C, centFV0A, centFT0CVariant1, centFT0CVariant2, + centMFT, centNGlobal, centNTPV); if (produceHistograms.value) { histos.fill(HIST("FT0M/Mult"), multZeqFT0A + multZeqFT0C); diff --git a/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx b/PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx index a68b06b4b79..7be69eeca47 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,9 +531,32 @@ 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()); + centrality, collision.centFV0A(), collision.centFT0CVariant1(), collision.centFT0CVariant2(), + collision.centMFT(), collision.centNGlobal(), collision.centNTPV()); products.strangeEvSels(collision.sel8(), collision.selection_raw(), collision.multFT0A() * static_cast(fillTruncationOptions.fillRawFT0A), collision.multFT0C() * static_cast(fillTruncationOptions.fillRawFT0C), @@ -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::FV0As const&, aod::FDDs 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::FV0As const&, aod::FDDs 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::FV0As const&, aod::FDDs 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::FV0As const&, aod::FDDs 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/CMakeLists.txt b/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt index b80c7711571..c622a91ee37 100644 --- a/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt +++ b/PWGLF/Tasks/GlobalEventProperties/CMakeLists.txt @@ -19,8 +19,8 @@ o2physics_add_dpl_workflow(ucc-zdc PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) -o2physics_add_dpl_workflow(dndeta-mft-pp - SOURCES dndeta-mft-pp.cxx +o2physics_add_dpl_workflow(pseudorapidity-density-mft + SOURCES PseudorapidityDensityMFT.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx b/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx new file mode 100644 index 00000000000..370f7da75a9 --- /dev/null +++ b/PWGLF/Tasks/GlobalEventProperties/PseudorapidityDensityMFT.cxx @@ -0,0 +1,2870 @@ +// Copyright 2020-2025 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 PseudorapidityDensityMFT.cxx +/// \author Sarah Herrmann +/// \author Tulika Tripathy +/// \brief This code loops over MFT tracks and collisions and fills histograms +/// useful to compute dNdeta + +#include "PWGMM/Mult/DataModel/bestCollisionTable.h" + +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.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 "CCDB/BasicCCDBManager.h" +#include "CommonConstants/GeomConstants.h" +#include "CommonConstants/MathConstants.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "DetectorsBase/Propagator.h" +#include "Field/MagneticField.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/Configurable.h" +#include "Framework/O2DatabasePDGPlugin.h" +#include "Framework/RuntimeError.h" +#include "Framework/runDataProcessing.h" +#include "MathUtils/Utils.h" +#include "ReconstructionDataFormats/GlobalTrackID.h" +#include "ReconstructionDataFormats/TrackFwd.h" +#include "ReconstructionDataFormats/TrackParametrization.h" + +#include "Math/MatrixFunctions.h" +#include "Math/SMatrix.h" +#include "Math/SVector.h" +#include "TFile.h" +#include "TGeoGlobalMagField.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod::track; +using namespace o2::aod::rctsel; + +AxisSpec ptAxis = {2001, -0.005, 20.005}; +AxisSpec deltazAxis = {6100, -6.1, 6.1}; +AxisSpec zAxis = {3001, -30.1, 30.1}; +AxisSpec phiAxis = {629, 0, o2::constants::math::TwoPI, "Rad", "phi axis"}; +AxisSpec etaAxis = {18, -4.6, -1.}; +// AxisSpec dcaXyAxis = {2000, -10, 10}; +// AxisSpec dcaZAxis = {2000, -10, 10}; +// AxisSpec dcaXAxis = {2000, -10, 10}; +// AxisSpec dcaYAxis = {2000, -10, 10};// previous AxisSpec dcaYAxis = {2000, -10, 10}; + +AxisSpec dcaXyAxis = {6000, -30, 30}; +AxisSpec dcaZAxis = {6000, -30, 30}; +AxisSpec dcaXAxis = {6000, -30, 30}; +AxisSpec dcaYAxis = {6000, -30, 30}; // previous AxisSpec dcaYAxis = {2000, -10, 10}; + +// AxisSpec dcaXyAxis = {600, -0.15f, 0.15f}; +// AxisSpec dcaZAxis = {600, -0.15f, 0.15f}; +// AxisSpec dcaXAxis = {600, -0.15f, 0.15f}; +// AxisSpec dcaYAxis = {600, -0.15f, 0.15f}; + +AxisSpec centAxis = {{0, 10, 20, 30, 40, 50, 60, 70, 80, 100}}; + +// Vertex position axes (cm) +AxisSpec vxAxis = {200, -0.5, 0.5, "V_{x} (cm)"}; +AxisSpec vyAxis = {200, -0.5, 0.5, "V_{y} (cm)"}; +// Status axis for reco/truth (1=reco, 2=true) +AxisSpec recoTruthStatusAxis = {2, 0.5, 2.5, "status"}; + +// Delta-vertex axes (reco - true) in cm +AxisSpec deltaVxAxis = {400, -0.5, 0.5, "#DeltaV_{x} = V_{x}^{rec}-V_{x}^{true} (cm)"}; +AxisSpec deltaVyAxis = {400, -0.5, 0.5, "#DeltaV_{y} = V_{y}^{rec}-V_{y}^{true} (cm)"}; + +static constexpr TrackSelectionFlags::flagtype TrackSelectionIts = + TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | + TrackSelectionFlags::kITSHits; + +static constexpr TrackSelectionFlags::flagtype TrackSelectionTpc = + TrackSelectionFlags::kTPCNCls | + TrackSelectionFlags::kTPCCrossedRowsOverNCls | + TrackSelectionFlags::kTPCChi2NDF; + +static constexpr TrackSelectionFlags::flagtype TrackSelectionDca = + TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy; + +// using MFTTracksLabeled = soa::Join; +// replace your alias with the extension included: +using FullBCs = soa::Join; + +// using MFTTracksLabeled = +// soa::Join; +using MFTTracksLabeled = + soa::Join; +using MFTTracksLabeled2d = + soa::Join; + +using MFTTracksLabeledOrg = + soa::Join; +// using McCollisionsWithExtra = soa::Join; +using McCollisionsWithExtra = o2::soa::Join; + +using SMatrix55 = ROOT::Math::SMatrix>; +using SMatrix5 = ROOT::Math::SVector; +struct PseudorapidityDensityMFT { + SliceCache cache; + Preslice perCol = o2::aod::fwdtrack::collisionId; + Preslice perMcCol = aod::mcparticle::mcCollisionId; + Preslice perColCentral = aod::track::collisionId; + + Service pdg; + + // --- CCDB magnetic field (needed for propagateToDCAhelix in this device) --- + Service ccdbMgr; + Configurable ccdburlMag{"ccdburlMag", "http://alice-ccdb.cern.ch", + "CCDB url for GRPMagField"}; + Configurable grpmagPathMag{"grpmagPathMag", "GLO/Config/GRPMagField", + "CCDB path for GRPMagField"}; + + int magRunNumber = -1; + float bzMFT = 0.f; + o2::parameters::GRPMagField* grpmag = nullptr; + static constexpr double CenterMft[3] = {0., 0., -61.4}; + + enum class GenRecoCutBin : int { + AllRecoCollisions = 1, + UseContBestCollisionIndex, + HasMcCollision, + IsTriggerTVX, + NoTimeFrameBorder, + NoITSROFrameBorder, + NoSameBunchPileup, + GoodZvtxFT0vsPV, + NoCollInRofStandard, + NoCollInRofStrict, + NoCollInTimeRangeStandard, + NoCollInTimeRangeStrict, + NoHighMultCollInPrevRof, + RctMFT, + VzWindow, + InelGt0 + }; + + enum class TrackLabelSummaryBin : int { + AllTracks = 1, + NoMcLabel, + FakeTracks, + TrueTracks, + PrimaryTracks, + SecondaryTracks + }; + + enum class GenRecoTimeComTrackMode : int { + AllNonOrphan = 0, + NonOrphanNonAmbiguous, + NonOrphanAmbiguous + }; + + enum class RightWrongBin : int { + Right = 1, + Wrong, + Neither, + Both + }; + enum class EventSelectionBin : int { + All = 1, + Vz, + VzItsRof, + VzSelected, + Sel8VzInelGt0, + SelInelInelFwdGt0, + Rejected, + GoodBCs, + BCsWithCollisions, + BCsWithPileupSplitting, + PerCollisionSampleGt0, + MidtracksAndPerCollisionSampleGt0 + }; + enum class HashTableRowCountsBin : int { + RowsSaved = 1, + UniqueRecoColsSaved, + UniqueBestRecoCols + }; + enum class WrongVertexRecoExistsBin : int { + RecoOfTrueExists = 1, + RecoOfTrueMissing + }; + enum class BoolBin : int { + No = 0, + Yes = 1 + }; + enum class SingleCountBin : int { + Count = 1 + }; + enum class EventEfficiencyBin : int { + Generated = 1, + GeneratedInelGt0, + Reconstructed, + Selected, + SelectedInelGt0 + }; + enum class CentralitySelectionBin : int { + All = 1, + Selected, + Rejected + }; + static constexpr float ForwardEtaMax = -2.0f; + static constexpr float ForwardEtaMin = -3.9f; + + static constexpr float PhiVetoLow = 0.02f; + static constexpr float PhiVetoPiMin = 3.10f; + static constexpr float PhiVetoPiMax = 3.23f; + static constexpr float PhiVetoHigh = 6.21f; + + static constexpr float NdfScale = 2.0f; + static constexpr float NdfOffset = 5.0f; + static constexpr float MinNdf = 1.0f; + + template + static float getTrackNdf(TrackT const& track) + { + return std::max(NdfScale * track.nClusters() - NdfOffset, MinNdf); + } + static constexpr int NoCompatibleCollisions = 0; + static constexpr int SingleCompatibleCollision = 1; + + static constexpr int OrphanAmbDegree = 0; + static constexpr int NonAmbiguousAmbDegree = 1; + + static constexpr int ChargeUnitTimesThree = 3; + + void initMagField(FullBCs::iterator const& bc) + { + if (magRunNumber == bc.runNumber()) { + return; + } + + grpmag = ccdbMgr->getForTimeStamp(grpmagPathMag.value, bc.timestamp()); + if (!grpmag) { + LOGF(warning, "GRPMagField not found in CCDB for ts=%lld", static_cast(bc.timestamp())); + bzMFT = 0.f; + magRunNumber = bc.runNumber(); + return; + } + + // This sets TGeoGlobalMagField internally + o2::base::Propagator::initFieldFromGRP(grpmag); + magRunNumber = bc.runNumber(); + + auto* field = static_cast(TGeoGlobalMagField::Instance()->GetField()); + if (field) { + bzMFT = field->getBz(CenterMft); + LOGP(info, "Initialized magnetic field for run {}: bzMFT={} kG", magRunNumber, bzMFT); + } else { + LOGF(warning, "TGeoGlobalMagField has no field even after initFieldFromGRP; bzMFT=0"); + bzMFT = 0.f; + } + } + + RCTFlagsChecker rctChecker{"CBT"}; + RCTFlagsChecker myChecker{kFT0Bad, kITSBad, kTPCBadTracking, kTPCBadPID, kMFTBad}; + Configurable maxGenRecoEvents{"maxGenRecoEvents", -1, + "Maximum number of MC collisions to process in processGenReco (-1 = all)"}; + + int nProcessedGenReco = 0; + + Configurable estimatorEta{"estimatorEta", 1.0, + "eta range for INEL>0 sample definition"}; + + Configurable useEvSel{"useEvSel", true, "use event selection"}; + Configurable useNoSameBunchPileup{"useNoSameBunchPileup", true, "reject collisions in case of pileup with another collision in the same foundBC"}; + Configurable useNoCollInRofStandard{"useNoCollInRofStandard", true, "Require evsel::kNoCollInRofStrict in processGenReco"}; + Configurable useNoCollInRofStrict{"useNoCollInRofStrict", true, "Require evsel::kNoCollInRofStrict in processGenReco"}; + Configurable useNoCollInTimeRangeStrict{"useNoCollInTimeRangeStrict", true, "Require evsel::kNoCollInTimeRangeStrict in processGenReco"}; + Configurable useNoCollInTimeRangeStandard{"useNoCollInTimeRangeStandard", true, "Require evsel::kNoCollInTimeRangeStandard in processGenReco"}; + Configurable useNoHighMultCollInPrevRof{"useNoHighMultCollInPrevRof", true, "Require evsel::kNoHighMultCollInPrevRof in processGenReco"}; + Configurable useGoodZvtxFT0vsPV{"useGoodZvtxFT0vsPV", true, "Require evsel::kIsGoodZvtxFT0vsPV in processGenReco"}; + Configurable useRctMFT{"useRctMFT", true, "Apply RCT runlist flags for MFT"}; + + Configurable disableITSROFCut{"disableITSROFCut", false, "Disable ITS ROF cut for event selection"}; + + ConfigurableAxis multBinning{"multBinning", {701, -0.5, 700.5}, ""}; + ConfigurableAxis etaBinning{"etaBinning", {36, -4.6, -1.}, ""}; + Configurable useZDiffCut{"useZDiffCut", true, "use Z difference cut"}; + Configurable maxZDiff{"maxZDiff", 1.0f, "max allowed Z difference for reconstructed collisions (cm)"}; + + Configurable usePhiCut{"usePhiCut", true, "use azimuthal angle cut"}; + Configurable useDCAxyCut{"useDCAxyCut", false, "use DCAxy cut"}; + Configurable useCont{"useCont", false, "No of contributors cut"}; + + Configurable usePtCut{"usePtCut", false, "use Pt cut"}; + + Configurable useDCAzCut{"useDCAzCut", false, "use DCAz cut"}; + + Configurable cfgPhiCut{"cfgPhiCut", 0.1f, + "Cut on azimuthal angle of MFT tracks"}; + Configurable cfgPhiCut1{"cfgPhiCut1", 0.0f, + "low Cut on azimuthal angle of MFT tracks"}; + Configurable cfgPhiCut2{"cfgPhiCut2", 6.3f, + "high Cut on azimuthal angle of MFT tracks"}; + Configurable cfgVzCut1{"cfgVzCut1", -30.0f, + "Cut1 on vertex position of MFT tracks"}; + Configurable cfgVzCut2{"cfgVzCut2", 30.0f, + "Cut2 on vertex position of MFT tracks"}; + Configurable cfgnCluster{"cfgnCluster", 5.0f, + "Cut on no of clusters per MFT track"}; + Configurable cfgnEta1{"cfgnEta1", -4.5f, + "Cut on eta1"}; + Configurable cfgnEta2{"cfgnEta2", -1.0f, + "Cut on eta1"}; + Configurable cfgnPt{"cfgnPt", 10.0f, + "Cut on Pt"}; + Configurable cfgChi2NDFMax{"cfgChi2NDFMax", 2000.0f, "Max allowed chi2/NDF for MFT tracks"}; + Configurable maxDCAxy{"maxDCAxy", 2.0f, "Cut on dcaXY"}; + Configurable maxDCAz{"maxDCAz", 2.0f, "Cut on dcaZ"}; + Configurable useLostByCutVeto{"useLostByCutVeto", true, "Reject tracks with lostNoRecoOfTrue or lostRecoExistsButNotCompatible"}; + + Configurable cfgGenRecoTimeComTrackMode{"cfgGenRecoTimeComTrackMode", + static_cast(GenRecoTimeComTrackMode::AllNonOrphan), + "processGenRecoTimeCom track mode: AllNonOrphan=0, NonOrphanNonAmbiguous=1, NonOrphanAmbiguous=2"}; + + HistogramRegistry registry{ + "registry", + { + {"TracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}, // + {"Tracks/EtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}, // + {"TracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}, // + {"TracksPhiZvtx", + "; #varphi; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {phiAxis, zAxis}}}, // + {"TracksPtEta", + " ; p_{T} (GeV/c); #eta", + {HistType::kTH2F, {ptAxis, etaBinning}}}, // + {"EventSelection", + ";status;events", + {HistType::kTH1F, {{15, 0.5, 15.5}}}}, + {"EventCounts", + ";status;events", + {HistType::kTH1F, {{2, 0.5, 2.5}}}}, + }}; + + void init(InitContext&) + { + ccdbMgr->setURL(ccdburlMag.value); // or ccdburlMag.value (depending on your Configurable) + ccdbMgr->setCaching(true); + ccdbMgr->setLocalObjectValidityChecking(); + + if (static_cast(doprocessMult) + + static_cast(doprocessMultReassoc) + + static_cast(doprocessMultReassoc3d) + + static_cast(doprocessCountingCentrality) > + 1) { + LOGP(fatal, + "Exactly one process function between processMult, " + "processMultReassoc, processMultReassoc3d and processCountingCentrality should be " + "enabled!"); + } + AxisSpec multAxis = {multBinning, "N_{trk}"}; + auto hstat = registry.get(HIST("EventSelection")); + auto* x = hstat->GetXaxis(); + x->SetBinLabel(static_cast(EventSelectionBin::All), "All"); + x->SetBinLabel(static_cast(EventSelectionBin::Vz), "Vz"); + x->SetBinLabel(static_cast(EventSelectionBin::VzItsRof), "Vz+ITSRof"); + x->SetBinLabel(static_cast(EventSelectionBin::VzSelected), "Vz+Selected"); + x->SetBinLabel(static_cast(EventSelectionBin::Sel8VzInelGt0), "Sel8+Vz+INEL>0"); + x->SetBinLabel(static_cast(EventSelectionBin::SelInelInelFwdGt0), "Sel INEL,INEL_fwd>0"); + x->SetBinLabel(static_cast(EventSelectionBin::Rejected), "Rejected"); + x->SetBinLabel(static_cast(EventSelectionBin::GoodBCs), "Good BCs"); + x->SetBinLabel(static_cast(EventSelectionBin::BCsWithCollisions), "BCs with collisions"); + x->SetBinLabel(static_cast(EventSelectionBin::BCsWithPileupSplitting), "BCs with pile-up/splitting"); + x->SetBinLabel(static_cast(EventSelectionBin::PerCollisionSampleGt0), "percollisionSample>0"); + x->SetBinLabel(static_cast(EventSelectionBin::MidtracksAndPerCollisionSampleGt0), "midtracks+percollisionSample>0"); + registry.add({"EventsNtrkZvtx", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"EventsNtrkZvtx_gt0", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_all", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelgt0", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelfwdgt0", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"Tracks/Control/DCAXY", + " ; DCA_{XY} (cm)", + {HistType::kTH1F, {dcaXyAxis}}}); + + if (doprocessGenReco || doprocessGenRecoTimeCom) { + registry.add({"EventsRecoCuts_GenReco", + ";cut;events", + {HistType::kTH1F, {{16, 0.5, 16.5}}}}); + { + auto h = registry.get(HIST("EventsRecoCuts_GenReco")); + auto* x = h->GetXaxis(); + x->SetBinLabel(static_cast(GenRecoCutBin::AllRecoCollisions), "All reco collisions (loop entry)"); + x->SetBinLabel(static_cast(GenRecoCutBin::UseContBestCollisionIndex), "useContBestcollisionIndex"); + x->SetBinLabel(static_cast(GenRecoCutBin::HasMcCollision), "has_mcCollision()"); + x->SetBinLabel(static_cast(GenRecoCutBin::IsTriggerTVX), "kIsTriggerTVX (if useEvSel)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoTimeFrameBorder), "kNoTimeFrameBorder (if useEvSel)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoITSROFrameBorder), "kNoITSROFrameBorder (if useEvSel)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoSameBunchPileup), "kNoSameBunchPileup"); + x->SetBinLabel(static_cast(GenRecoCutBin::GoodZvtxFT0vsPV), "kIsGoodZvtxFT0vsPV"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoCollInRofStandard), "kNoCollInRofStandard (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoCollInRofStrict), "kNoCollInRofStrict (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoCollInTimeRangeStandard), "kNoCollInTimeRangeStandard (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoCollInTimeRangeStrict), "kNoCollInTimeRangeStrict (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::NoHighMultCollInPrevRof), "kNoHighMultCollInPrevRof (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::RctMFT), "myChecker (cfg)"); + x->SetBinLabel(static_cast(GenRecoCutBin::VzWindow), "Vz window"); + x->SetBinLabel(static_cast(GenRecoCutBin::InelGt0), "INEL>0 (midtracks>0)"); + // x->SetBinLabel(11, "rctChecker (cfg)"); + + // x->SetBinLabel(15, "Passed all event cuts"); + } + + AxisSpec trackLabelAxis = {6, 0.5, 6.5, "Track label category"}; + registry.add({"Purity/TrackLabelSummary", + ";Track label category;Counts", + {HistType::kTH1D, {trackLabelAxis}}}); + { + auto h = registry.get(HIST("Purity/TrackLabelSummary")); + auto* x = h->GetXaxis(); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::AllTracks), "All tracks"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::NoMcLabel), "No MC label"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::FakeTracks), "Fake tracks"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::TrueTracks), "True tracks"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::PrimaryTracks), "Primary tracks"); + x->SetBinLabel(static_cast(TrackLabelSummaryBin::SecondaryTracks), "Secondary tracks"); + } + registry.add({"Purity/TrackEtaCategorySparse", + ";#eta_{all};#eta_{noMC};#eta_{fake};#eta_{true};#eta_{primary};#eta_{secondary}", + {HistType::kTHnSparseF, {etaBinning, etaBinning, etaBinning, etaBinning, etaBinning, etaBinning}}}); + + registry.add({"Purity/WrongVertexRecoExists", + ";status;Counts", + {HistType::kTH1F, {{2, 0.5, 2.5}}}}); + { + auto h = registry.get(HIST("Purity/WrongVertexRecoExists")); + if (h) { + h->GetXaxis()->SetBinLabel(static_cast(WrongVertexRecoExistsBin::RecoOfTrueExists), "Reco of true exists"); + h->GetXaxis()->SetBinLabel(static_cast(WrongVertexRecoExistsBin::RecoOfTrueMissing), "Reco of true missing"); + } + } + + registry.add({"Purity/HashTableRowCounts", + ";status;counts", + {HistType::kTH1F, {{3, 0.5, 3.5}}}}); + auto hHashTableRowCounts = registry.get(HIST("Purity/HashTableRowCounts")); + auto* xHash = hHashTableRowCounts->GetXaxis(); + xHash->SetBinLabel(static_cast(HashTableRowCountsBin::RowsSaved), "rows saved"); + xHash->SetBinLabel(static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), "unique recoCol saved"); + xHash->SetBinLabel(static_cast(HashTableRowCountsBin::UniqueBestRecoCols), "unique bestRecoCol"); + registry.add({"Purity/THnDCAChosenVsRight_Wrong", + ";#eta;DCA_{xy}^{chosen} (cm);DCA_{xy}^{calculated} (cm);DCA_{xy}^{right} (cm);DCA_{z}^{chosen} (cm);DCA_{z}^{calculated} (cm);DCA_{z}^{right} (cm)", + {HistType::kTHnSparseF, {etaBinning, dcaXyAxis, dcaXyAxis, dcaXyAxis, dcaZAxis, dcaZAxis, dcaZAxis}}}); + registry.add({"Purity/THnDCAChosenVsRight_Right", + ";#eta;DCA_{xy}^{chosen} (cm);DCA_{xy}^{calculated} (cm);DCA_{xy}^{right} (cm);DCA_{z}^{chosen} (cm);DCA_{z}^{calculated} (cm);DCA_{z}^{right} (cm)", + {HistType::kTHnSparseF, {etaBinning, dcaXyAxis, dcaXyAxis, dcaXyAxis, dcaZAxis, dcaZAxis, dcaZAxis}}}); + registry.add("Purity/RecoOfTrueExists", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/RecoOfTrueInCompatible", + "Reco collision(s) of true MC event present in track compatible collisions;inCompatible (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/RecoOfTrueExistsR", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/RecoOfTrueInCompatibleR", + "Reco collision(s) of true MC event present in track compatible collisions;inCompatible (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + + registry.add("Purity/RecoOfTrueExistsW", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/RecoOfTrueInCompatibleW", + "Reco collision(s) of true MC event present in track compatible collisions;inCompatible (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + + registry.add("Purity/hCorrectRecoIDinTheListR", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + registry.add("Purity/hCorrectRecoIDinTheListW", + "Any reco collision exists for track true MC collision id;exists (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + + // P(Nch): number of selected MFT tracks per accepted reco collision (after all event+track cuts) + // Tracks lost because of the OR cut ( !exists || !inCompatible ) + registry.add("Purity/LostByBoth", + "Tracks rejected by (!recoOfTrueExists || !recoOfTrueInCompatible);status (0=kept,1=lost);tracks", + kTH1F, {{2, -0.5, 1.5}}); + // Number of ITS-TPC contributors to the reconstructed collision (PV contributors) + registry.add({"Purity/reco/CollisionNumContrib", + ";N_{contrib} ( PV contributors);collisions", + {HistType::kTH1F, {{3001, -0.5, 3000.5}}}}); + + // Tracks that were WRONG (by your definition) BEFORE applying the cut + registry.add("Purity/WrongBeforeRecoOfTrueCut", + "Tracks classified wrong BEFORE applying recoOfTrue cut;wrong (0=no,1=yes);tracks", + kTH1F, {{2, -0.5, 1.5}}); + + // Optional but very useful: intersection (lost AND wrong) + + registry.add({"Purity/reco/PNchMFT_afterCuts", + ";N_{trk}^{MFT} (selected);events", + {HistType::kTH1F, {multAxis}}}); + registry.add({"Purity/DCAyVsDCAx_Right", + ";DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTH2F, {dcaXAxis, dcaYAxis}}}); + registry.add({"Purity/reco/woOrp/All", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/reco/woOrp/AllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/SelectedAfterDCAxy/PrimaryAll", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/SelectedAfterDCAxy/PrimaryAllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"TracksToPartPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"EventsReco", + "; status; events", + {HistType::kTH1F, {{7, 0.5, 7.5}}}}); + + // Additional histograms for processGenReco (w/o orphan), grouped under Purity/reco/ + registry.add({"Purity/reco/weakStrange/SelectedTracksEta", + "; #eta; selected reco tracks from weak strange decays", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/reco/weakStrange/SelectedTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); selected reco tracks from weak strange decays", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/SelectedTracksEta", + "; #eta; selected reco tracks", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/reco/woOrp/nTrk", + " ; N_{Trk}^{all}", + {HistType::kTH1F, {{701, -0.5, 700.5}}}}); + + registry.add({"Purity/reco/woOrp/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + + registry.add({"Purity/reco/woOrp/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + + registry.add({"Purity/reco/woOrp/woOrpTracksDCAxyZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {dcaXyAxis, zAxis}}}); + + registry.add({"Purity/reco/woOrp/woOrpTracksDCAzZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {dcaZAxis, zAxis}}}); + + registry.add({"Purity/reco/woOrp/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // --- Category-wise woOrp histograms (after track cuts & woOrp) --- + // Fake tracks (no MC particle) + registry.add({"Purity/reco/woOrp_fake/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_fake/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_fake/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_fake/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_fake/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // Tracks that have an MC particle (matched) + registry.add({"Purity/reco/woOrp_hasMC/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_hasMC/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_hasMC/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_hasMC/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_hasMC/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // Secondary tracks (has MC but not primary) + registry.add({"Purity/reco/woOrp_secondary/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_secondary/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_secondary/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_secondary/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_secondary/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // Primary tracks (has MC and is physical primary) + registry.add({"Purity/reco/woOrp_primary/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_primary/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/reco/woOrp_primary/woOrpTracksPtZvtx", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_primary/woOrpPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/reco/woOrp_primary/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // MC-side (generator truth) histograms for purity in processGenReco + registry.add({"Purity/mc/PrimaryAll", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/mc/PrimaryAllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/mc/PrimaryTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/mc/PrimaryTracksEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/mc/PrimaryTracksDCAxyZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {dcaXyAxis, zAxis}}}); + registry.add({"Purity/mc/PrimaryTracksDCAzZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {dcaZAxis, zAxis}}}); + + registry.add({"Purity/mc/PrimaryTracksPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); primary tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/mc/PrimaryTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + // --- MC-side (NO-DCA) truth histograms for pre-DCA accounting --- + registry.add({"Purity/mc_noDCA/PrimaryAll", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/mc_noDCA/PrimaryAllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/mc_noDCA/PrimaryTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/mc_noDCA/PrimaryTracksEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/mc_noDCA/PrimaryTracksPtZvtx_gt0", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); primary tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"Purity/mc_noDCA/PrimaryTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + + // Book keeping for pre-DCA selection counters (for symmetry with AfterDCAxy) + registry.add({"Purity/SelectedBeforeDCAxy/PrimaryAll", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/SelectedBeforeDCAxy/PrimaryAllEta", + ";#eta;counts", + {HistType::kTH1F, {etaBinning}}}); + // --- Fake-track counters (reco side after DCA selections) --- + registry.add({"Purity/Fakes/All", + ";bin;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/Fakes/AllEta", + ";#eta_{reco};counts", + {HistType::kTH1F, {etaBinning}}}); + registry.add({"Purity/Fakes/TracksEtaZvtx", + "; #eta_{reco}; #it{z}_{vtx}^{rec} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Purity/Fakes/TracksPhiEta", + "; #varphi_{reco}; #eta_{reco}; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + // Fake reason breakdown: 1-INEL>0 true (vz), 2-Reco sel (woOrp), 3-has_mcParticle, 4-isPrimary, 5-rightVertex + + // --- Purity calculation histograms (as profiles: purity = ) --- + registry.add({"Purity/PurityOverall", + ";bin;purity", + {HistType::kTProfile, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/PurityVsEta", + ";#eta;purity", + {HistType::kTProfile, {etaBinning}}}); + registry.add({"RightWrong", + ";category;counts", + {HistType::kTH1F, {{4, 0.5, 4.5}}}}); + auto hrw = registry.get(HIST("RightWrong")); + hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Right), "right"); + hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Wrong), "wrong"); + hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Neither), "neither"); + hrw->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Both), "both"); + + registry.add({"Purity/RightWrongLater", + ";category;counts", + {HistType::kTH1F, {{4, 0.5, 4.5}}}}); + auto hrw1 = registry.get(HIST("Purity/RightWrongLater")); + hrw1->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Right), "right"); + hrw1->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Wrong), "wrong"); + hrw1->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Neither), "neither"); + hrw1->GetXaxis()->SetBinLabel(static_cast(RightWrongBin::Both), "both"); + + // Vertex-position difference for wrong-vertex associations (reco - true MC) + registry.add({"deltaVZ_fromReco", + ";#Delta z_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"deltaVZ_fromTrue", + ";#Delta z_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/DeltaXWrong", + ";#Delta x_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/DeltaYWrong", + ";#Delta y_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/DeltaZWrong", + ";#Delta z_{vtx}^{reco-true} (cm);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/xReco", + ";#Delta z_{vtx}^{reco} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/xTrue", + ";#Delta z_{vtx}^{true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/yReco", + ";#Delta z_{vtx}^{reco} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/yTrue", + ";#Delta z_{vtx}^{true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/zReco", + ";#Delta z_{vtx}^{reco} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + registry.add({"Purity/zTrue", + ";#Delta z_{vtx}^{true} (cm);tracks", + {HistType::kTH1F, {zAxis}}}); + + // Vertex positions: store both reco and truth in one THnSparse with a status axis + registry.add({"Purity/VtxXYZTruth", + "; V_{x} (cm); V_{y} (cm); V_{z} (cm)", + {HistType::kTHnSparseF, {vxAxis, vyAxis, zAxis}}}); + registry.add({"Purity/VtxXYZReco", + "; V_{x} (cm); V_{y} (cm); V_{z} (cm)", + {HistType::kTHnSparseF, {vxAxis, vyAxis, zAxis}}}); + + // Delta vertex positions (reco - true) + registry.add({"Purity/DeltaVtxXYZ", + "; #DeltaV_{x} (cm); #DeltaV_{y} (cm); #DeltaV_{z} (cm)", + {HistType::kTHnSparseF, {deltaVxAxis, deltaVyAxis, deltazAxis}}}); + + registry.add({"Purity/DeltaXRight", + ";#Delta x_{vtx}^{reco-true} (cm) (right);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/DeltaYRight", + ";#Delta y_{vtx}^{reco-true} (cm) (right);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Purity/DeltaZRight", + ";#Delta z_{vtx}^{reco-true} (cm) (right);tracks", + {HistType::kTH1F, {dcaZAxis}}}); + + // 5D THnSparse histograms: (eta, DCAxy, DCAz, DCAx, DCAy) + + // 1) All / Primary / Secondary after track selection (no vertex classification) + registry.add({"Purity/RecoSparseAll", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"RecoSparseAllBest", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"RecoSparseAllBestWrong", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparsePrimary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseSecondary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // 2) Right-vertex: all / primary / secondary + registry.add({"Purity/RecoSparseRightAll", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseRightPrimary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseRightSecondary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // 3) Wrong-vertex: all / primary / secondary + registry.add({"Purity/RecoSparseWrongAll", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseWrongPrimary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseWrongSecondary", + ";#eta;DCA_{xy} (cm);DCA_{z} (cm);DCA_{x} (cm);DCA_{y} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // 4) Generator-truth DCA 5D THnSparse: (eta_truth, DCAxy_truth, DCAz_truth, DCAx_truth, DCAy_truth) + // booked under Tracks/dca/Truth/ + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthAll", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthPrim", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (primary)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthSec", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (secondary)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // Right-vertex truth DCA + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthRightAll", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (right vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthRightPrim", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (primary, right vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthRightSec", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (secondary, right vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // Wrong-vertex truth DCA + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthWrongAll", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (wrong vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthWrongPrim", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (primary, wrong vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDCAxyBestGenTruthWrongSec", + ";#eta_{truth};DCA_{xy}^{truth} (cm);DCA_{z}^{truth} (cm);DCA_{x}^{truth} (cm);DCA_{y}^{truth} (cm) (secondary, wrong vertex)", + {HistType::kTHnSparseF, + {etaBinning, dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + // 5) Delta-DCA THnSparse: (ΔDCAxy, ΔDCAz, ΔDCAx, ΔDCAy) for right/wrong vertex, all/primary/secondary + registry.add({"Tracks/dca/Truth/THnDeltaDCARightAll", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDeltaDCARightPrim", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (primary, right vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDeltaDCARightSec", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (secondary, right vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Tracks/dca/Truth/THnDeltaDCAWrongAll", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (wrong vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDeltaDCAWrongPrim", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (primary, wrong vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + registry.add({"Tracks/dca/Truth/THnDeltaDCAWrongSec", + ";#Delta DCA_{xy} (cm);#Delta DCA_{z} (cm);#Delta DCA_{x} (cm);#Delta DCA_{y} (cm) (secondary, wrong vertex)", + {HistType::kTHnSparseF, + {dcaXyAxis, dcaZAxis, dcaXAxis, dcaYAxis}}}); + + registry.add({"Purity/RecoSparseAll_EventCount", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/RecoSparseAll_EventCountBest", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/RecoSparseRightAll_EventCount", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/RecoSparseWrongAll_EventCount", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + registry.add({"Purity/BestRecoColNotFound", + ";events;counts", + {HistType::kTH1F, {{1, 0.5, 1.5}}}}); + } + + if (doprocessGen) { + registry.add({"EventsNtrkZvtxGen", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"EventsNtrkZvtxGen_t", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"EventsNtrkZvtxGen_gt0", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"EventsNtrkZvtxGen_gt0t", + "; N_{trk}; #it{z}_{vtx} (cm); events", + {HistType::kTH2F, {multAxis, zAxis}}}); + registry.add({"TracksEtaZvtxGen", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksEtaZvtxGen_t", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksEtaZvtxGen_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksEtaZvtxGen_gt0t", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksPhiEtaGen", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"TracksPhiEtaGen_gt0", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"TracksPhiEtaGen_gt0t", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"TracksPhiZvtxGen", + "; #varphi; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {phiAxis, zAxis}}}); // + registry.add({"TracksToPartPtEta", + " ; p_{T} (GeV/c); #eta", + {HistType::kTH2F, {ptAxis, etaBinning}}}); // + registry.add({"TracksPtEtaGen", + " ; p_{T} (GeV/c); #eta", + {HistType::kTH2F, {ptAxis, etaBinning}}}); + registry.add({"TracksPtEtaGen_t", + " ; p_{T} (GeV/c); #eta", + {HistType::kTH2F, {ptAxis, etaBinning}}}); + registry.add({"NotFoundEventZvtx", + " ; #it{z}_{vtx} (cm)", + {HistType::kTH1F, {zAxis}}}); + registry.add({"EventsZposDiff", + " ; Z_{rec} - Z_{gen} (cm)", + {HistType::kTH1F, {deltazAxis}}}); + + registry.add({"TracksEtaZvtxGen_gt0_primary", + "; #eta; #it{z}_{vtx} (cm); primary tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"TracksPhiEtaGen_gt0_primary", + "; #varphi; #eta; primary tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"TracksPtZvtxGen_gt0_primary", + "; p_{T} (GeV/c); #it{z}_{vtx} (cm); primary tracks", + {HistType::kTH2F, {ptAxis, zAxis}}}); + registry.add({"EventsSplitMult", " ; N_{gen}", {HistType::kTH1F, {multAxis}}}); + auto heff = registry.get(HIST("EventEfficiency")); + x = heff->GetXaxis(); + x->SetBinLabel(static_cast(EventEfficiencyBin::Generated), "Generated"); + x->SetBinLabel(static_cast(EventEfficiencyBin::GeneratedInelGt0), "Generated INEL>0"); + x->SetBinLabel(static_cast(EventEfficiencyBin::Reconstructed), "Reconstructed"); + x->SetBinLabel(static_cast(EventEfficiencyBin::Selected), "Selected"); + x->SetBinLabel(static_cast(EventEfficiencyBin::SelectedInelGt0), "Selected INEL>0"); + } + + if (doprocessMultReassoc || doprocessMultReassoc3d) { + // Purity denominator histograms (reco side after DCAxy selection) + + registry.add({"Tracks/Control/DeltaZ", + " ; #it{z_{orig}}-#it{z_{reass}}", + {HistType::kTH1F, {zAxis}}}); + + registry.add({"Tracks/Control/TrackAmbDegree", + " ; N_{coll}^{comp}", + {HistType::kTH1F, {{51, -0.5, 50.5}}}}); + registry.add({"Tracks/Control/TrackIsAmb", + " ; isAmbiguous", + {HistType::kTH1I, {{2, -0.5, 1.5}}}}); + + registry.add({"Tracks/Control/ReassignedTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Tracks/Control/ReassignedTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"Tracks/Control/ReassignedVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); + + registry.add({"Tracks/Control/notReassignedTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); + registry.add({"Tracks/Control/notReassignedTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); + registry.add({"Tracks/Control/notReassignedVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); + registry.add({"Tracks/Control/Chi2NDF", + " ; #chi^{2}/ndf", + {HistType::kTH1F, {{5000, 0.0, 5000.0}}}}); + registry.add({"Tracks/Control/amb/AmbTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + + registry.add({"Tracks/Control/woOrp/nTrk", + " ; N_{Trk}^{all}", + {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // + registry.add({"Tracks/Control/amb/nTrkAmb", + " ; N_{Trk}^{amb}", + {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // + registry.add({"Tracks/Control/nonamb/nTrkNonAmb", + " ; N_{Trk}^{nonamb}", + {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // + + registry.add({"Tracks/Control/amb/AmbTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); // + registry.add({"Tracks/Control/amb/AmbVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); // + registry.add({"Tracks/Control/amb/EtaZvtxAmb_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/Control/amb/DCAxy_amb", " ; DCA_{xy} (cm) ambiguous", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {dcaXyAxis}}}); // + + registry.add({"Tracks/Control/nonamb/nonAmbTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + + registry.add({"Tracks/Control/nonamb/nonAmbTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); // + registry.add({"Tracks/Control/nonamb/nonAmbVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); // + registry.add({"Tracks/Control/nonamb/EtaZvtxNonAmb_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/Control/nonamb/DCAxy_nonamb", " ; DCA_{xy}(cm) non-ambiguous", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {{dcaXyAxis}}}}); // + + registry.add({"Tracks/Control/woOrp/woOrpTracksEtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/Control/woOrp/woOrpEtaZvtx_gt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/2Danalysis/EtaZvtx", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/2Danalysis/EtaZvtx_sel8", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/2Danalysis/EtaZvtx_sel8_inelgt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0", + "; #eta; #it{z}_{vtx} (cm); tracks", + {HistType::kTH2F, {etaBinning, zAxis}}}); // + registry.add({"Tracks/Control/woOrp/woOrpTracksPhiEta", + "; #varphi; #eta; tracks", + {HistType::kTH2F, {phiAxis, etaBinning}}}); // + registry.add({"Tracks/Control/woOrp/woOrpVertexCorr", + "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", + {HistType::kTH2F, {zAxis, zAxis}}}); // + registry.add({"Tracks/Control/woOrp/DCAxy_woOrp", " ; DCA_{xy}(cm) w/o orphan", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {{dcaXyAxis}}}}); // + + if (doprocessMultReassoc3d) { + // DCAz histograms analogous to DCAxy, only for 3D reassociation + registry.add({"Tracks/Control/DCAZ", + " ; DCA_{Z} (cm)", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Tracks/Control/amb/DCAz_amb", + " ; DCA_{z} (cm) ambiguous", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Tracks/Control/nonamb/DCAz_nonamb", + " ; DCA_{z}(cm) non-ambiguous", + {HistType::kTH1F, {dcaZAxis}}}); + registry.add({"Tracks/Control/woOrp/DCAz_woOrp", + " ; DCA_{z}(cm) w/o orphan", + {HistType::kTH1F, {dcaZAxis}}}); + } + + registry.add({"collisionID", " ; Collision ID", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {{100000, -50000.0, 50000.0}}}}); // + registry.add({"collisionIDamb", " ; Collision ID amb", + // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // + {HistType::kTH1F, {{100000, -50000.0, 50000.0}}}}); // + registry.add({"NonambEventCounts", " ; EventCounts Nonamb", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"hNumCollisionsNonAmb_InelMFT", " ; Number of Collisions with Non-Ambiguous Tracks;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"hNumCollisionsAmb_InelMFT", " ; Number of Collisions with Non-Ambiguous Tracks;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"hNumCollisions_InelMFT", " ; Number of selected events with Inel>0 and MFT>0;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"hNumCollisions_Inel", " ; Number of selected events with Inel>0;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + registry.add({"ambEventCounts", " ; EventCounts Nonamb", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // + } + + if (doprocessCountingCentrality) { + registry.add({"Events/Centrality/Selection", + ";status;centrality;events", + {HistType::kTH2F, {{3, 0.5, 3.5}, centAxis}}}); + auto hstat = registry.get(HIST("Events/Centrality/Selection")); + auto* x = hstat->GetXaxis(); + x->SetBinLabel(static_cast(CentralitySelectionBin::All), "All"); + x->SetBinLabel(static_cast(CentralitySelectionBin::Selected), "Selected"); + x->SetBinLabel(static_cast(CentralitySelectionBin::Rejected), "Rejected"); + + registry.add({"Events/Centrality/NtrkZvtx", + "; N_{trk}; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {multAxis, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/EtaZvtx", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/PhiEta", + "; #varphi; #eta; centrality", + {HistType::kTH3F, {phiAxis, etaBinning, centAxis}}}); + registry.add({"Tracks/Centrality/Control/PtEta", + " ; p_{T} (GeV/c); #eta; centrality", + {HistType::kTH3F, {ptAxis, etaBinning, centAxis}}}); + registry.add({"Tracks/Centrality/Control/DCAXYPt", + " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", + {HistType::kTH3F, {ptAxis, dcaXyAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ReassignedDCAXYPt", + " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", + {HistType::kTH3F, {ptAxis, dcaXyAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ExtraDCAXYPt", + " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", + {HistType::kTH3F, {ptAxis, dcaXyAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ExtraTracksEtaZvtx", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ExtraTracksPhiEta", + "; #varphi; #eta; centrality", + {HistType::kTH3F, {phiAxis, etaBinning, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ReassignedTracksEtaZvtx", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ReassignedTracksPhiEta", + "; #varphi; #eta; centrality", + {HistType::kTH3F, {phiAxis, etaBinning, centAxis}}}); + registry.add({"Tracks/Centrality/Control/ReassignedVertexCorr", + "; Z_{vtx}^{orig} (cm); Z_{vtx}^{re} (cm); centrality", + {HistType::kTH3F, {zAxis, zAxis, centAxis}}}); + } + + if (doprocessGenCent) { + registry.add({"Events/Centrality/EventEfficiency", + ";status;centrality;events", + {HistType::kTH2F, {{2, 0.5, 2.5}, centAxis}}}); + auto heff = registry.get(HIST("Events/Centrality/EventEfficiency")); + auto* x = heff->GetXaxis(); + x->SetBinLabel(1, "Generated"); + x->SetBinLabel(2, "Selected"); + + registry.add("Events/Centrality/CentPercentileMCGen", + "CentPercentileMCGen", kTH1D, {centAxis}, false); + registry.add({"Events/Centrality/NtrkZvtxGen", + "; N_{trk}; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {multAxis, zAxis, centAxis}}}); + registry.add({"Events/Centrality/NtrkZvtxGen_t", + "; N_{trk}; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {multAxis, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/EtaZvtxGen_t", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/EtaZvtxGen", + "; #eta; Z_{vtx} (cm); centrality", + {HistType::kTH3F, {etaBinning, zAxis, centAxis}}}); + registry.add({"Tracks/Centrality/PhiEtaGen", + "; #varphi; #eta; centrality", + {HistType::kTH3F, {phiAxis, etaBinning, centAxis}}}); + } + } + + using FullBCs = soa::Join; + void processTagging(FullBCs const& bcs, + soa::Join const& collisions) + { + + std::vector::iterator> cols; + for (const auto& bc : bcs) { + if (!useEvSel || + (useEvSel && ((bc.selection_bit(aod::evsel::kIsBBT0A) && + bc.selection_bit(aod::evsel::kIsBBT0C)) != 0))) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::GoodBCs)); + cols.clear(); + for (const auto& collision : collisions) { + if (collision.has_foundBC()) { + if (collision.foundBCId() == bc.globalIndex()) { + cols.emplace_back(collision); + } + } else if (collision.bcId() == bc.globalIndex()) { + cols.emplace_back(collision); + } + } + LOGP(debug, "BC {} has {} collisions", bc.globalBC(), cols.size()); + if (!cols.empty()) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::BCsWithCollisions)); + if (cols.size() > 1) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::BCsWithPileupSplitting)); + } + } + } + } + } + + bool passGenRecoTrackMode(auto const& track) const + { + const auto compatibleColls = track.compatibleCollIds(); + const auto nCompatibleColls = compatibleColls.size(); + + if (nCompatibleColls == NoCompatibleCollisions) { + return false; + } + + const auto mode = + static_cast(cfgGenRecoTimeComTrackMode.value); + + switch (mode) { + case GenRecoTimeComTrackMode::AllNonOrphan: + return nCompatibleColls > NoCompatibleCollisions; + case GenRecoTimeComTrackMode::NonOrphanNonAmbiguous: + return nCompatibleColls == SingleCompatibleCollision; + case GenRecoTimeComTrackMode::NonOrphanAmbiguous: + return nCompatibleColls > SingleCompatibleCollision; + default: + return false; + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processTagging, + "Collect event sample stats", true); + + static constexpr float SampleEtaMax = -2.8f; + static constexpr float SampleEtaMin = -3.2f; + + Partition sample = + (aod::fwdtrack::eta < SampleEtaMax) && (aod::fwdtrack::eta > SampleEtaMin); + + static constexpr float CentralEtaMax = 1.f; + Partition sampleCentral = (nabs(aod::track::eta) < CentralEtaMax); + + static constexpr int ValidBestCollisionIdMin = 0; + static constexpr int InvalidCollisionId = -1; + static constexpr float MaxBestDcaXy = 2.f; + expressions::Filter atrackFilter = + (aod::fwdtrack::bestCollisionId >= ValidBestCollisionIdMin) && + (aod::fwdtrack::eta < ForwardEtaMax) && + (aod::fwdtrack::eta > ForwardEtaMin) && + (nabs(aod::fwdtrack::bestDCAXY) <= MaxBestDcaXy); + + using CollwEv = soa::Join; + + expressions::Filter trackSelectionCentral = + ((aod::track::trackCutFlag & TrackSelectionIts) == TrackSelectionIts) && + ifnode((aod::track::v001::detectorMap & (uint8_t)o2::aod::track::TPC) == + (uint8_t)o2::aod::track::TPC, + (aod::track::trackCutFlag & TrackSelectionTpc) == + TrackSelectionTpc, + true) && + ((aod::track::trackCutFlag & TrackSelectionDca) == TrackSelectionDca) && + (nabs(aod::track::eta) < estimatorEta); + + using FiCentralTracks = soa::Filtered< + soa::Join>; // central tracks for INEL>0 + + void processMult(CollwEv::iterator const& collision, + aod::MFTTracks const& tracks, + FiCentralTracks const& midtracks, aod::Tracks const&) + { + + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::All)); + if (!useEvSel || (useEvSel && collision.sel8())) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::VzSelected)); + auto z = collision.posZ(); + auto perCollisionSample = sampleCentral->sliceByCached( + o2::aod::track::collisionId, collision.globalIndex(), cache); + auto nTrk = perCollisionSample.size(); + + registry.fill(HIST("EventsNtrkZvtx"), nTrk, z); + + if (midtracks.size() > 0) // INEL>0 + { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Sel8VzInelGt0)); + registry.fill(HIST("EventsNtrkZvtx_gt0"), nTrk, z); + } + + if (tracks.size() > 0) { + for (const auto& track : tracks) { + + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + + if (usePhiCut) { + if ((phi < cfgPhiCut) || + ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) || + (phi > o2::constants::math::TwoPI - cfgPhiCut) || + ((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) && + (phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut))) + continue; + } + + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + if (midtracks.size() > 0) // INEL>0 + { + registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z); + } + registry.fill(HIST("TracksPhiEta"), phi, track.eta()); + registry.fill(HIST("TracksPtEta"), track.pt(), track.eta()); + if ((track.eta() < ForwardEtaMax) && (track.eta() > ForwardEtaMin)) { + registry.fill(HIST("TracksPhiZvtx"), phi, z); + } + } + } + + } else { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Rejected)); + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processMult, + "Process reco or data info", true); + // Common implementation for both BestCollisionsFwd and BestCollisionsFwd3d + template + void processMultReassocCommon(CollwEv::iterator const& collision, + o2::aod::MFTTracks const&, + RetracksT const& retracks, + FiCentralTracks const& midtracks, aod::Tracks const&) + { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::All)); + auto perCollisionSample = sampleCentral->sliceByCached( + o2::aod::track::collisionId, collision.globalIndex(), cache); + auto nTrk = perCollisionSample.size(); + auto z = collision.posZ(); + registry.fill(HIST("EventsNtrkZvtx"), nTrk, z); + if ((z >= cfgVzCut1) && (z <= cfgVzCut2)) { + registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_all"), nTrk, z); + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Vz)); + for (const auto& retrack : retracks) { + auto track = retrack.mfttrack(); + float ndf = getTrackNdf(track); + float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + if (usePhiCut) { + if ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh)) { + continue; + } + } + float dcaXyCut = retrack.bestDCAXY(); + if (useDCAxyCut) { + if (dcaXyCut > maxDCAxy) + continue; + } + if constexpr (std::is_same_v>) { + float dcaZCut = retrack.bestDCAZ(); + if (useDCAzCut) { + if (dcaZCut > maxDCAz) + continue; + } + } + if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && retrack.ambDegree() > 0 && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { + registry.fill(HIST("Tracks/2Danalysis/EtaZvtx"), track.eta(), z); + } + } + if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return; + } + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::VzItsRof)); + if (!useEvSel || (useEvSel && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoSameBunchPileup))) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::VzSelected)); + registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8"), nTrk, z); + std::unordered_set uniqueEvents; + std::unordered_set uniqueEventsAmb; + std::unordered_set uniqueCollisions; + std::unordered_set uniqueCollisionsAmb; + std::unordered_set eventsInelMFT; + std::unordered_set eventsInel; + if (midtracks.size() > 0) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Sel8VzInelGt0)); + registry.fill(HIST("EventsNtrkZvtx_gt0"), nTrk, z); + registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelgt0"), nTrk, z); + eventsInel.insert(collision.globalIndex()); + } + if (perCollisionSample.size() > 0) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::PerCollisionSampleGt0)); + } + if (midtracks.size() > 0 && perCollisionSample.size() > 0) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::MidtracksAndPerCollisionSampleGt0)); + } + int64_t i = 0.0, j = 0.0, k = 0.0; + for (const auto& retrack : retracks) { + auto track = retrack.mfttrack(); + float ndf = getTrackNdf(track); + float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + if (usePhiCut) { + if ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh)) { + continue; + } + } + float dcaXyCut = retrack.bestDCAXY(); + if (useDCAxyCut) { + if (dcaXyCut > maxDCAxy) + continue; + } + if constexpr (std::is_same_v>) { + float dcaZCut = retrack.bestDCAZ(); + if (useDCAzCut) { + if (dcaZCut > maxDCAz) + continue; + } + } + if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && retrack.ambDegree() > 0 && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { + registry.fill(HIST("Tracks/Control/Chi2NDF"), chi2ndf); + registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8"), track.eta(), z); + if (midtracks.size() > 0 && retrack.ambDegree() > 0) { + registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelgt0"), track.eta(), z); + } + } + } + if (retracks.size() > 0) { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::SelInelInelFwdGt0)); + if (midtracks.size() > 0) { + registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelfwdgt0"), nTrk, z); + } + for (const auto& retrack : retracks) { + auto track = retrack.mfttrack(); + float ndf = getTrackNdf(track); + float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + float dcaXyCut = retrack.bestDCAXY(); + o2::math_utils::bringTo02Pi(phi); + // Declare dcaZCut only if needed below. + if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { + if (usePhiCut) { + if ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh)) { + continue; + } + } + if (useDCAxyCut) { + if (dcaXyCut > maxDCAxy) + continue; + } + if constexpr (std::is_same_v>) { + float dcaZCut = retrack.bestDCAZ(); + if (useDCAzCut) { + if (dcaZCut > maxDCAz) + continue; + } + } + + registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); + if (midtracks.size() > 0 && retrack.ambDegree() > 0) { + registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0"), track.eta(), z); + eventsInelMFT.insert(retrack.bestCollisionId()); + } + if (retrack.ambDegree() != 0) { + registry.fill(HIST("Tracks/Control/woOrp/woOrpEtaZvtx_gt0"), track.eta(), z); + ++k; + } + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("TracksPhiEta"), phi, track.eta()); + registry.fill(HIST("TracksPtEta"), track.pt(), track.eta()); + if ((track.eta() < ForwardEtaMax) && (track.eta() > ForwardEtaMin)) { + registry.fill(HIST("TracksPhiZvtx"), phi, z); + } + if (track.collisionId() > InvalidCollisionId && + retrack.ambDegree() == SingleCompatibleCollision) { + registry.fill(HIST("collisionID"), track.collisionId()); + } + if (track.collisionId() > InvalidCollisionId && + retrack.ambDegree() > SingleCompatibleCollision) { + registry.fill(HIST("collisionIDamb"), track.collisionId()); + } + if (track.collisionId() != retrack.bestCollisionId()) { + registry.fill(HIST("Tracks/Control/ReassignedTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/ReassignedTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/ReassignedVertexCorr"), + track.template collision_as().posZ(), z); + + registry.fill(HIST("Tracks/Control/DeltaZ"), + track.template collision_as().posZ() - + collision.posZ()); + } + if (track.collisionId() == retrack.bestCollisionId()) { + registry.fill(HIST("Tracks/Control/notReassignedTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/notReassignedTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/notReassignedVertexCorr"), + track.template collision_as().posZ(), z); + } + + registry.fill(HIST("Tracks/Control/TrackAmbDegree"), + retrack.ambDegree()); + registry.fill(HIST("Tracks/Control/DCAXY"), retrack.bestDCAXY()); + if constexpr (std::is_same_v>) { + registry.fill(HIST("Tracks/Control/DCAZ"), retrack.bestDCAZ()); + } + int isAmbiguous = 0; + + if (retrack.ambDegree() > 1 && retrack.ambDegree() != 0) { + isAmbiguous = 1; + ++i; + + registry.fill(HIST("Tracks/Control/amb/EtaZvtxAmb_gt0"), track.eta(), z); + + registry.fill(HIST("Tracks/Control/amb/AmbTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/amb/AmbTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/amb/AmbVertexCorr"), + track.template collision_as().posZ(), z); + registry.fill(HIST("Tracks/Control/amb/DCAxy_amb"), retrack.bestDCAXY()); + if constexpr (std::is_same_v>) { + registry.fill(HIST("Tracks/Control/amb/DCAz_amb"), retrack.bestDCAZ()); + } + uniqueEventsAmb.insert(retrack.bestCollisionId()); + } + if (midtracks.size() > 0 && retrack.ambDegree() > 1 && retrack.ambDegree() != 0) { + uniqueCollisionsAmb.insert(collision.globalIndex()); + } + + registry.fill(HIST("Tracks/Control/TrackIsAmb"), isAmbiguous); + if (retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { + ++j; + registry.fill(HIST("Tracks/Control/nonamb/EtaZvtxNonAmb_gt0"), track.eta(), z); + registry.fill(HIST("Tracks/Control/nonamb/nonAmbTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/nonamb/nonAmbTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/nonamb/nonAmbVertexCorr"), + track.template collision_as().posZ(), z); + registry.fill(HIST("Tracks/Control/nonamb/DCAxy_nonamb"), retrack.bestDCAXY()); + if constexpr (std::is_same_v>) { + registry.fill(HIST("Tracks/Control/nonamb/DCAz_nonamb"), retrack.bestDCAZ()); + } + uniqueEvents.insert(retrack.bestCollisionId()); + } + if (midtracks.size() > 0 && retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { + uniqueCollisions.insert(collision.globalIndex()); + } + + if (retrack.ambDegree() != 0) { + registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksEtaZvtx"), + track.eta(), z); + registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksPhiEta"), phi, + track.eta()); + registry.fill(HIST("Tracks/Control/woOrp/woOrpVertexCorr"), + track.template collision_as().posZ(), z); + registry.fill(HIST("Tracks/Control/woOrp/DCAxy_woOrp"), retrack.bestDCAXY()); + if constexpr (std::is_same_v>) { + registry.fill(HIST("Tracks/Control/woOrp/DCAz_woOrp"), retrack.bestDCAZ()); + } + } + } + } + registry.fill(HIST("ambEventCounts"), 1, uniqueEventsAmb.size()); + registry.fill(HIST("NonambEventCounts"), 1, uniqueEvents.size()); + registry.fill(HIST("hNumCollisionsNonAmb_InelMFT"), 1, uniqueCollisions.size()); + registry.fill(HIST("hNumCollisionsAmb_InelMFT"), 1, uniqueCollisionsAmb.size()); + registry.fill(HIST("hNumCollisions_InelMFT"), 1, eventsInelMFT.size()); + } + registry.fill(HIST("Tracks/Control/amb/nTrkAmb"), i); + registry.fill(HIST("Tracks/Control/nonamb/nTrkNonAmb"), j); + registry.fill(HIST("Tracks/Control/woOrp/nTrk"), k); + registry.fill(HIST("hNumCollisions_Inel"), 1, eventsInel.size()); + } + } else { + registry.fill(HIST("EventSelection"), static_cast(EventSelectionBin::Rejected)); + } + } + + void processMultReassoc(CollwEv::iterator const& collision, + o2::aod::MFTTracks const& mft, + soa::SmallGroups const& retracks, + FiCentralTracks const& midtracks, aod::Tracks const& trk) + { + processMultReassocCommon(collision, mft, retracks, midtracks, trk); + } + + void processMultReassoc3d(CollwEv::iterator const& collision, + o2::aod::MFTTracks const& mft, + soa::SmallGroups const& retracks, + FiCentralTracks const& midtracks, aod::Tracks const& trk) + { + processMultReassocCommon(collision, mft, retracks, midtracks, trk); + } + PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc, + "Process reco or data info", false); + + PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc3d, + "Process reco or data info (3d)", false); + + using ExColsCent = soa::Join; + + void processCountingCentrality(ExColsCent::iterator const& collision, + aod::MFTTracks const& tracks) + { + auto c = collision.centFT0C(); + registry.fill(HIST("Events/Centrality/Selection"), 1., c); + + if (!useEvSel || collision.sel8()) { + auto z = collision.posZ(); + registry.fill(HIST("Events/Centrality/Selection"), 2., c); + auto perCollisionSample = sample->sliceByCached( + o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); + auto nTrk = perCollisionSample.size(); + + registry.fill(HIST("Events/Centrality/NtrkZvtx"), nTrk, z, c); + + for (const auto& track : tracks) { + + float phi = track.phi(); + o2::math_utils::bringTo02Pi(phi); + + if (usePhiCut) { + if ((phi < cfgPhiCut) || + ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) || + (phi > o2::constants::math::TwoPI - cfgPhiCut) || + ((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) && + (phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut))) + continue; + } + + registry.fill(HIST("Tracks/Centrality/EtaZvtx"), track.eta(), z, c); + registry.fill(HIST("Tracks/Centrality/PhiEta"), phi, track.eta(), c); + } + + } else { + registry.fill(HIST("Events/Centrality/Selection"), 3., + c); // rejected events + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processCountingCentrality, + "Count tracks in centrality bins", false); + + using Particles = soa::Filtered; + expressions::Filter primaries = + (aod::mcparticle::flags & + (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == + (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary; + static constexpr float McSampleEtaMax = 1.1f; + Partition mcSample = nabs(aod::mcparticle::eta) < McSampleEtaMax; + Partition mcSampleCentral = + nabs(aod::mcparticle::eta) < estimatorEta; + + void processGen( + aod::McCollisions::iterator const& mcCollision, + o2::soa::SmallGroups> const& collisions, + Particles const& particles, aod::MFTTracks const& /*tracks*/, + FiCentralTracks const& midtracks) + { + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::Generated)); + + auto perCollisionMCSample = mcSample->sliceByCached( + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + auto nCharged = 0; + for (const auto& particle : perCollisionMCSample) { + auto charge = 0.; + auto p = pdg->GetParticle(particle.pdgCode()); + if (p != nullptr) { + charge = p->Charge(); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + nCharged++; + } + registry.fill(HIST("EventsNtrkZvtxGen_t"), nCharged, mcCollision.posZ()); + + //--------for INEL>0 + auto perCollisionMCSampleCentral = mcSampleCentral->sliceByCached( + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + auto nChargedCentral = 0; + for (const auto& particle : perCollisionMCSample) { + auto charge = 0.; + auto p = pdg->GetParticle(particle.pdgCode()); + if (p != nullptr) { + charge = p->Charge(); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + nChargedCentral++; + } + if ((mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { + if (nChargedCentral > 0) { + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::GeneratedInelGt0)); + registry.fill(HIST("EventsNtrkZvtxGen_gt0t"), nCharged, + mcCollision.posZ()); + } + } + //----------- + bool atLeastOne = false; + bool atLeastOneGt0 = false; + int moreThanOne = 0; + + LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), + collisions.size()); + for (const auto& collision : collisions) { + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::Reconstructed)); + if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + return; + } + if (!useEvSel || (useEvSel && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoSameBunchPileup))) { + atLeastOne = true; + auto perCollisionSample = sample->sliceByCached( + o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); + + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::Selected)); + auto perCollisionSampleCentral = + midtracks.sliceBy(perColCentral, collision.globalIndex()); + if ((collision.posZ() >= cfgVzCut1) && (collision.posZ() <= cfgVzCut2) && (mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("EventEfficiency"), static_cast(EventEfficiencyBin::SelectedInelGt0)); + atLeastOneGt0 = true; + registry.fill(HIST("EventsNtrkZvtxGen_gt0"), + perCollisionSample.size(), collision.posZ()); + } + + registry.fill(HIST("EventsZposDiff"), + collision.posZ() - mcCollision.posZ()); + if (useZDiffCut) { + if (std::abs(collision.posZ() - mcCollision.posZ()) > maxZDiff) { + continue; + } + } + registry.fill(HIST("EventsNtrkZvtxGen"), perCollisionSample.size(), + collision.posZ()); + ++moreThanOne; + } + } + } + if (collisions.size() == 0) { + registry.fill(HIST("NotFoundEventZvtx"), mcCollision.posZ()); + } + if (moreThanOne > 1) { + registry.fill(HIST("EventsSplitMult"), nCharged); + } + if ((mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { + + for (const auto& particle : particles) { + auto p = pdg->GetParticle(particle.pdgCode()); + auto charge = 0; + if (p != nullptr) { + charge = static_cast(p->Charge()); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + float phi = particle.phi(); + o2::math_utils::bringTo02Pi(phi); + float ptCut = particle.pt(); + + if (usePhiCut) { + if ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh)) + continue; + } + if (usePtCut) { + if (ptCut > cfgnPt) + continue; + } + if (cfgnEta1 < particle.eta() && particle.eta() < cfgnEta2 && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { + registry.fill(HIST("TracksEtaZvtxGen_t"), particle.eta(), + mcCollision.posZ()); + if (perCollisionMCSampleCentral.size() > 0) { + registry.fill(HIST("TracksEtaZvtxGen_gt0t"), particle.eta(), + mcCollision.posZ()); + registry.fill(HIST("TracksPhiEtaGen_gt0t"), particle.phi(), particle.eta()); + } + if (atLeastOne) { + registry.fill(HIST("TracksEtaZvtxGen"), particle.eta(), + mcCollision.posZ()); + registry.fill(HIST("TracksPtEtaGen"), particle.pt(), particle.eta()); + if (atLeastOneGt0) { + registry.fill(HIST("TracksEtaZvtxGen_gt0"), particle.eta(), + mcCollision.posZ()); + registry.fill(HIST("TracksPhiEtaGen_gt0"), particle.phi(), particle.eta()); + if (particle.isPhysicalPrimary()) { + registry.fill(HIST("TracksEtaZvtxGen_gt0_primary"), particle.eta(), mcCollision.posZ()); + registry.fill(HIST("TracksPhiEtaGen_gt0_primary"), particle.phi(), particle.eta()); + registry.fill(HIST("TracksPtZvtxGen_gt0_primary"), particle.pt(), mcCollision.posZ()); + } + } + } + + registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); + registry.fill(HIST("TracksPhiZvtxGen"), particle.phi(), + mcCollision.posZ()); + registry.fill(HIST("TracksPtEtaGen_t"), particle.pt(), particle.eta()); + } + } + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGen, + "Process generator-level info", false); + + using ExColsGenCent = + soa::SmallGroups>; + + void processGenCent(aod::McCollisions::iterator const& mcCollision, + ExColsGenCent const& collisions, + Particles const& particles, + MFTTracksLabeled const& /*tracks*/) + { + + LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), + collisions.size()); + + float cGen = -1; + bool atLeastOne = false; + for (const auto& collision : collisions) { + float cRec = -1; + if constexpr (ExColsGenCent::template contains()) { + cRec = collision.centFT0C(); + } + if (!useEvSel || (useEvSel && collision.sel8())) { + if constexpr (ExColsGenCent::template contains()) { + if (!atLeastOne) { + cGen = cRec; + } + } + atLeastOne = true; + + registry.fill(HIST("Events/Centrality/EventEfficiency"), 2., cGen); + registry.fill(HIST("Events/Centrality/CentPercentileMCGen"), cGen); + + auto perCollisionSample = sample->sliceByCached( + o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); + registry.fill(HIST("Events/Centrality/NtrkZvtxGen"), + perCollisionSample.size(), collision.posZ(), cGen); + } + } + + registry.fill(HIST("Events/Centrality/EventEfficiency"), 1., cGen); + + auto perCollisionMCSample = mcSample->sliceByCached( + aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); + auto nCharged = 0; + + for (const auto& particle : perCollisionMCSample) { + auto p = pdg->GetParticle(particle.pdgCode()); + auto charge = 0; + if (p != nullptr) { + charge = static_cast(p->Charge()); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + nCharged++; + } + + if constexpr (ExColsGenCent::template contains()) { + registry.fill(HIST("Events/Centrality/NtrkZvtxGen_t"), nCharged, + mcCollision.posZ(), cGen); + } + + for (const auto& particle : particles) { + auto p = pdg->GetParticle(particle.pdgCode()); + auto charge = 0; + if (p != nullptr) { + charge = static_cast(p->Charge()); + } + if (std::abs(charge) < ChargeUnitTimesThree) { + continue; + } + + if constexpr (ExColsGenCent::template contains()) { + registry.fill(HIST("Tracks/Centrality/EtaZvtxGen_t"), particle.eta(), + mcCollision.posZ(), cGen); + } + + if (atLeastOne) { + if constexpr (ExColsGenCent::template contains()) { + registry.fill(HIST("Tracks/Centrality/EtaZvtxGen"), particle.eta(), + mcCollision.posZ(), cGen); + float phi = particle.phi(); + o2::math_utils::bringTo02Pi(phi); + registry.fill(HIST("Tracks/Centrality/PhiEtaGen"), phi, + particle.eta(), cGen); + } + } + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenCent, + "Process generator-level info in centrality bins", false); + + void processGenPt( + soa::Join::iterator const& collision, + MFTTracksLabeled const& tracks, aod::McParticles const&) + { + if (!useEvSel || (useEvSel && collision.sel8())) { + for (const auto& track : tracks) { + if (!track.has_mcParticle()) { + continue; + } + auto particle = track.mcParticle(); + if (!particle.isPhysicalPrimary()) { + continue; + } + registry.fill(HIST("TracksToPartPtEta"), particle.pt(), particle.eta()); + } + } + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenPt, + "Process particle-level info of pt", false); + + void processGenRecoTimeCom(McCollisionsWithExtra::iterator const& mcCollision, + o2::soa::SmallGroups> const& collisions, + MFTTracksLabeledOrg const& tracks, + FiCentralTracks const& midtracks, + aod::McParticles const&) + { + const auto fillGenRecoCut = [&](GenRecoCutBin bin) { + registry.fill(HIST("EventsRecoCuts_GenReco"), static_cast(bin)); + }; + fillGenRecoCut(GenRecoCutBin::AllRecoCollisions); + std::unordered_map recoToMc; + std::unordered_map> mcToReco; // MC collision id -> list of reco collision globalIndex + + for (const auto& collision : collisions) { + int nSavedRows = 0; + std::unordered_set uniqueRecoColsSaved; + int recoCol = collision.globalIndex(); // reconstructed vertex index + int mcCol = collision.mcCollisionId(); // true MC collision index + + if (mcCol >= 0) { + recoToMc[recoCol] = mcCol; + mcToReco[mcCol].push_back(recoCol); + + ++nSavedRows; + uniqueRecoColsSaved.insert(recoCol); + } + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::RowsSaved), nSavedRows); + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), uniqueRecoColsSaved.size()); + + registry.fill(HIST("Purity/reco/CollisionNumContrib"), collision.numContrib()); + + if (useCont && collision.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + fillGenRecoCut(GenRecoCutBin::UseContBestCollisionIndex); + + if (!collision.has_mcCollision()) { + LOGF(warning, "No MC collision found..."); + return; + } + fillGenRecoCut(GenRecoCutBin::HasMcCollision); + + auto countAndPassEvSelGenReco = [&](auto const& collision) { + struct EvSelStep { + bool enabled; + decltype(aod::evsel::kIsTriggerTVX) bit; + GenRecoCutBin bin; + }; + + const std::array steps = {{ + {true, aod::evsel::kIsTriggerTVX, GenRecoCutBin::IsTriggerTVX}, + {true, aod::evsel::kNoTimeFrameBorder, GenRecoCutBin::NoTimeFrameBorder}, + {true, aod::evsel::kNoITSROFrameBorder, GenRecoCutBin::NoITSROFrameBorder}, + {useNoSameBunchPileup, aod::evsel::kNoSameBunchPileup, GenRecoCutBin::NoSameBunchPileup}, + {useGoodZvtxFT0vsPV, aod::evsel::kIsGoodZvtxFT0vsPV, GenRecoCutBin::GoodZvtxFT0vsPV}, + {useNoCollInRofStandard, aod::evsel::kNoCollInRofStandard, GenRecoCutBin::NoCollInRofStandard}, + {useNoCollInRofStrict, aod::evsel::kNoCollInRofStrict, GenRecoCutBin::NoCollInRofStrict}, + {useNoCollInTimeRangeStandard, aod::evsel::kNoCollInTimeRangeStandard, GenRecoCutBin::NoCollInTimeRangeStandard}, + {useNoCollInTimeRangeStrict, aod::evsel::kNoCollInTimeRangeStrict, GenRecoCutBin::NoCollInTimeRangeStrict}, + {useNoHighMultCollInPrevRof, aod::evsel::kNoHighMultCollInPrevRof, GenRecoCutBin::NoHighMultCollInPrevRof}, + }}; + + if (!useEvSel) { + for (const auto& step : steps) { + fillGenRecoCut(step.bin); + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + return true; + } + + for (const auto& step : steps) { + if (!step.enabled) { + fillGenRecoCut(step.bin); + continue; + } + + if (!collision.selection_bit(step.bit)) { + return false; + } + fillGenRecoCut(step.bin); + } + + if (useRctMFT && !myChecker(collision)) { + return false; + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + + return true; + }; + + if (!countAndPassEvSelGenReco(collision)) { + continue; + } + + const auto z = collision.posZ(); + if ((z < cfgVzCut1) || (z > cfgVzCut2)) { + continue; + } + fillGenRecoCut(GenRecoCutBin::VzWindow); + + auto perCollisionSampleCentral = midtracks.sliceBy(perColCentral, collision.globalIndex()); + if (perCollisionSampleCentral.size() <= 0) { + continue; + } + fillGenRecoCut(GenRecoCutBin::InelGt0); + + // constexpr uint8_t kFakeMcMask = 1u << 7; + for (const auto& track : tracks) { + float ndf = getTrackNdf(track); + const float chi2ndf = track.chi2() / ndf; + float phi = track.phi(); + // const float dcaXyCut = track.bestDCAXY(); + // const float dcaZCut = track.bestDCAZ(); + const float ptCut = track.pt(); + o2::math_utils::bringTo02Pi(phi); + + const bool failTrackCuts = + track.nClusters() < cfgnCluster || + track.eta() <= cfgnEta1 || + track.eta() >= cfgnEta2 || + chi2ndf >= cfgChi2NDFMax || + phi <= cfgPhiCut1 || + phi >= cfgPhiCut2 || + (usePhiCut && + ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh))) || + // (useDCAxyCut && dcaxyCut > maxDCAxy) || + // (useDCAzCut && std::abs(dcazCut) > maxDCAz) || + (usePtCut && ptCut > cfgnPt); + + if (failTrackCuts) { + continue; + } + const bool hasMcLabel = track.has_mcParticle(); + const bool isFakeByLabel = hasMcLabel ? (track.mcMask() != 0) : false; + const bool isTrueByLabel = hasMcLabel && !isFakeByLabel; + const bool hasNoMcLabel = !hasMcLabel; + const bool isPrimaryCharged = hasMcLabel && !isFakeByLabel && track.mcParticle().isPhysicalPrimary(); + const bool isSecondaryCharged = hasMcLabel && !isFakeByLabel && !track.mcParticle().isPhysicalPrimary(); + const float eta = track.eta(); + if (!passGenRecoTrackMode(track)) { // 0-> All nonorphans, 1->Non-Amb, 2->Amb + continue; + } + int bin = static_cast(RightWrongBin::Neither); + bool recoOfTrueExists = false; + + if (isTrueByLabel) { + int recoCol = track.collisionId(); + auto itRecoToMc = recoToMc.find(recoCol); + const int mcOfTrack = track.mcParticle().mcCollisionId(); + + // Check whether any reco vertex exists for the true MC collision of this track + for (const auto& [recoId, mcId] : recoToMc) { + if (mcId == mcOfTrack) { + recoOfTrueExists = true; + break; + } + } + + if (recoCol >= 0 && itRecoToMc != recoToMc.end()) { + int mcFromReco = itRecoToMc->second; + bin = (mcFromReco == mcOfTrack) + ? static_cast(RightWrongBin::Right) + : static_cast(RightWrongBin::Wrong); + } + } + + registry.fill(HIST("RightWrong"), bin); + + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/WrongVertexRecoExists"), recoOfTrueExists ? static_cast(BoolBin::Yes) : static_cast(BoolBin::No)); + } + + const auto fillTrackLabelSummary = [&](TrackLabelSummaryBin bin) { + registry.fill(HIST("Purity/TrackLabelSummary"), static_cast(bin)); + }; + const auto fillTrackEtaCategory = [&](TrackLabelSummaryBin bin) { + constexpr float EtaSentinel = -999.f; + + float etaAll = EtaSentinel; + float etaNoMc = EtaSentinel; + float etaFake = EtaSentinel; + float etaTrue = EtaSentinel; + float etaPrimary = EtaSentinel; + float etaSecondary = EtaSentinel; + + switch (bin) { + case TrackLabelSummaryBin::AllTracks: + etaAll = eta; + break; + case TrackLabelSummaryBin::NoMcLabel: + etaNoMc = eta; + break; + case TrackLabelSummaryBin::FakeTracks: + etaFake = eta; + break; + case TrackLabelSummaryBin::TrueTracks: + etaTrue = eta; + break; + case TrackLabelSummaryBin::PrimaryTracks: + etaPrimary = eta; + break; + case TrackLabelSummaryBin::SecondaryTracks: + etaSecondary = eta; + break; + } + + registry.fill(HIST("Purity/TrackEtaCategorySparse"), + etaAll, etaNoMc, etaFake, etaTrue, etaPrimary, etaSecondary); + }; + + // registry.fill(HIST("Purity/TrackLabelStatus"), hasMcLabel ? 1.0 : 0.0); + // registry.fill(HIST("Purity/TrackFakeStatus"), isFakeByLabel ? 1.0 : 0.0); + + fillTrackLabelSummary(TrackLabelSummaryBin::AllTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::AllTracks); + + if (hasNoMcLabel) { + fillTrackLabelSummary(TrackLabelSummaryBin::NoMcLabel); + fillTrackEtaCategory(TrackLabelSummaryBin::NoMcLabel); + continue; + } + + if (isFakeByLabel) { + fillTrackLabelSummary(TrackLabelSummaryBin::FakeTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::FakeTracks); + continue; + } + + fillTrackLabelSummary(TrackLabelSummaryBin::TrueTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::TrueTracks); + + if (isPrimaryCharged) { + fillTrackLabelSummary(TrackLabelSummaryBin::PrimaryTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::PrimaryTracks); + } + + if (isSecondaryCharged) { + fillTrackLabelSummary(TrackLabelSummaryBin::SecondaryTracks); + fillTrackEtaCategory(TrackLabelSummaryBin::SecondaryTracks); + } + // registry.fill(HIST("RightWrong"), bin); + + } // Track loop 1 + } // Collision + } + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenRecoTimeCom, + "Process for MC time compatible", false); + + // using MFTTracksLabeled = soa::Join; + // using MFTTracksLabeled =soa::Join; + + // aod::MFTTracks const& tracks + // soa::Join::iterator const& mcCollision + // aod::McCollisions::iterator const& mcCollision + // McCollisionsWithExtra::iterator const& mcCollision + + // void processMCeff(soa::Join::iterator const& mcCollision, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + // soa::Join::iterator const& mcCollision //This worked + void processGenReco(McCollisionsWithExtra::iterator const& mcCollision, + o2::soa::SmallGroups> const& collisions, + FullBCs const& bcs, + MFTTracksLabeled const& tracks, + FiCentralTracks const& midtracks, + aod::McParticles const&) + + { + + const auto fillGenRecoCut = [&](GenRecoCutBin bin) { + registry.fill(HIST("EventsRecoCuts_GenReco"), static_cast(bin)); + }; + fillGenRecoCut(GenRecoCutBin::AllRecoCollisions); + + // if (maxGenRecoEvents >= 0 && nProcessedGenReco >= maxGenRecoEvents) { + // return; + // } + // ++nProcessedGenReco; // for HIR + std::unordered_map recoToMc; + std::unordered_map> mcToReco; // MC collision id -> list of reco collision globalIndex + std::unordered_map recoToMcVZ; + std::unordered_map recoVtxX; + std::unordered_map recoVtxY; + std::unordered_map recoVtxZ; + std::unordered_map> recoVtxByRecoId; + std::unordered_map> recoVtxByMcId; + + recoVtxByRecoId.reserve(collisions.size()); + recoVtxByMcId.reserve(collisions.size()); + mcToReco.reserve(collisions.size()); + + // --- Make sure magnetic field exists in THIS device before any propagation --- + // IMPORTANT: calling collision.bc_as() requires the BC table to be subscribed. + // We subscribe by taking `FullBCs const& bcs` in the process signature and init once here. + bool magInited = false; + for (auto const& bc : bcs) { + initMagField(bc); + magInited = true; + break; // once is enough (initMagField is internally guarded) + } + if (!magInited) { + LOGF(fatal, "BC table is empty: cannot initialize magnetic field"); + } + + //_______________________________________________________________________________ + + for (const auto& collision : collisions) { + int nSavedRows = 0; + std::unordered_set uniqueRecoColsSaved; + int recoCol = collision.globalIndex(); // reconstructed vertex index + int mcCol = collision.mcCollisionId(); // true MC collision index + + if (mcCol >= 0) { + recoToMc[recoCol] = mcCol; + mcToReco[mcCol].push_back(recoCol); + + ++nSavedRows; + uniqueRecoColsSaved.insert(recoCol); + } + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::RowsSaved), nSavedRows); + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueRecoColsSaved), uniqueRecoColsSaved.size()); + + recoVtxX[recoCol] = collision.posX(); + recoVtxY[recoCol] = collision.posY(); + recoVtxZ[recoCol] = collision.posZ(); + + registry.fill(HIST("Purity/reco/CollisionNumContrib"), collision.numContrib()); + + if (useCont && collision.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + fillGenRecoCut(GenRecoCutBin::UseContBestCollisionIndex); + + if (!collision.has_mcCollision()) { + LOGF(warning, "No MC collision found..."); + return; + } + fillGenRecoCut(GenRecoCutBin::HasMcCollision); + + auto countAndPassEvSelGenReco = [&](auto const& collision) { + struct EvSelStep { + bool enabled; + decltype(aod::evsel::kIsTriggerTVX) bit; + GenRecoCutBin bin; + }; + + const std::array steps = {{ + {true, aod::evsel::kIsTriggerTVX, GenRecoCutBin::IsTriggerTVX}, + {true, aod::evsel::kNoTimeFrameBorder, GenRecoCutBin::NoTimeFrameBorder}, + {true, aod::evsel::kNoITSROFrameBorder, GenRecoCutBin::NoITSROFrameBorder}, + {useNoSameBunchPileup, aod::evsel::kNoSameBunchPileup, GenRecoCutBin::NoSameBunchPileup}, + {useGoodZvtxFT0vsPV, aod::evsel::kIsGoodZvtxFT0vsPV, GenRecoCutBin::GoodZvtxFT0vsPV}, + {useNoCollInRofStandard, aod::evsel::kNoCollInRofStandard, GenRecoCutBin::NoCollInRofStandard}, + {useNoCollInRofStrict, aod::evsel::kNoCollInRofStrict, GenRecoCutBin::NoCollInRofStrict}, + {useNoCollInTimeRangeStandard, aod::evsel::kNoCollInTimeRangeStandard, GenRecoCutBin::NoCollInTimeRangeStandard}, + {useNoCollInTimeRangeStrict, aod::evsel::kNoCollInTimeRangeStrict, GenRecoCutBin::NoCollInTimeRangeStrict}, + {useNoHighMultCollInPrevRof, aod::evsel::kNoHighMultCollInPrevRof, GenRecoCutBin::NoHighMultCollInPrevRof}, + }}; + + if (!useEvSel) { + for (const auto& step : steps) { + fillGenRecoCut(step.bin); + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + return true; + } + + for (const auto& step : steps) { + if (!step.enabled) { + fillGenRecoCut(step.bin); + continue; + } + + if (!collision.selection_bit(step.bit)) { + return false; + } + fillGenRecoCut(step.bin); + } + + if (useRctMFT && !myChecker(collision)) { + return false; + } + fillGenRecoCut(GenRecoCutBin::RctMFT); + + return true; + }; + + if (!countAndPassEvSelGenReco(collision)) { + continue; + } + + const auto z = collision.posZ(); + if ((z < cfgVzCut1) || (z > cfgVzCut2)) { + continue; + } + fillGenRecoCut(GenRecoCutBin::VzWindow); + + auto perCollisionSampleCentral = midtracks.sliceBy(perColCentral, collision.globalIndex()); + if (perCollisionSampleCentral.size() <= 0) { + continue; + } + fillGenRecoCut(GenRecoCutBin::InelGt0); + + //________________________________________________________________________________ + + registry.fill(HIST("Purity/xReco"), collision.posX()); + registry.fill(HIST("Purity/xTrue"), mcCollision.posX()); + registry.fill(HIST("Purity/yReco"), collision.posY()); + + registry.fill(HIST("Purity/yTrue"), mcCollision.posY()); + registry.fill(HIST("Purity/zReco"), collision.posZ()); + registry.fill(HIST("Purity/zTrue"), mcCollision.posZ()); + + // --- Vertex position THnSparse: status axis (1=reco, 2=true) --- + registry.fill(HIST("Purity/VtxXYZTruth"), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()); + registry.fill(HIST("Purity/VtxXYZReco"), collision.posX(), collision.posY(), collision.posZ()); + + // --- Delta vertex THnSparse (reco - true) --- + registry.fill(HIST("Purity/DeltaVtxXYZ"), + collision.posX() - mcCollision.posX(), // Reco - Truth + collision.posY() - mcCollision.posY(), + collision.posZ() - mcCollision.posZ()); + + recoVtxByRecoId[collision.globalIndex()] = {collision.posX(), collision.posY(), collision.posZ()}; + recoVtxByMcId[collision.mcCollisionId()] = {mcCollision.posX(), mcCollision.posY(), mcCollision.posZ()}; + + int64_t woOrpCount = 0; + bool filledRight = false; + bool filledWrong = false; + int nMftSelectedAfterCuts = 0; + std::unordered_set uniqueBestRecoCols; + // auto particle = templatedTrack.template mcParticle_as(); + + if (tracks.size() > 0) { + bool countedPrimary = false; + for (const auto& track : tracks) { // track loop starts + // All compatible collisions assigned by track-to-collision-associator + if (!(midtracks.size() > 0)) + continue; + // std::cout <<" midtracks.size() " <= cfgnEta2 || + chi2ndf >= cfgChi2NDFMax || + phi <= cfgPhiCut1 || + phi >= cfgPhiCut2 || + (usePhiCut && + ((phi <= PhiVetoLow) || + ((phi >= PhiVetoPiMin) && (phi <= PhiVetoPiMax)) || + (phi >= PhiVetoHigh))) || + (useDCAxyCut && dcaXyCut > maxDCAxy) || + (useDCAzCut && std::abs(dcaZCut) > maxDCAz) || + (usePtCut && ptCut > cfgnPt); + + if (failTrackCuts) { + continue; + } + + const bool hasMcLabel = track.has_mcParticle(); + const bool isFakeByLabel = hasMcLabel ? (track.mcMask() != 0) : false; + const bool isTrueByLabel = hasMcLabel && !isFakeByLabel; + const bool isPrimaryCharged = hasMcLabel && !isFakeByLabel && track.mcParticle().isPhysicalPrimary(); + const bool isSecondaryCharged = hasMcLabel && !isFakeByLabel && !track.mcParticle().isPhysicalPrimary(); + const auto mcColObj = track.mcParticle().mcCollision_as(); + const auto mcPart = track.mcParticle(); + + if (!passGenRecoTrackMode(track)) { // + continue; + } + int bin = static_cast(RightWrongBin::Neither); + bool recoOfTrueExists = false; + bool recoOfTrueInCompatible = false; + + const int bestColID = track.bestCollisionId(); // same as track.collisionId(); + if (isTrueByLabel) { + auto itRecoToMc = recoToMc.find(bestColID); + const int mcOfTrack = track.mcParticle().mcCollisionId(); + const auto compatibleIds = track.compatibleCollIds(); + auto itRecoList = mcToReco.find(mcOfTrack); + + // 1) First check whether the correct reco collision of the true MC collision + // is present in the compatible-collision list. + if (!compatibleIds.empty() && itRecoList != mcToReco.end() && !itRecoList->second.empty()) { + for (const auto& trueRecoId : itRecoList->second) { + for (const auto& compatibleId : compatibleIds) { + if (compatibleId == trueRecoId) { + recoOfTrueInCompatible = true; + break; + } + } + if (recoOfTrueInCompatible) { + break; + } + } + } + + // 2) Then check whether any reco collision for the true MC collision exists at all. + if (itRecoList != mcToReco.end() && !itRecoList->second.empty()) { + recoOfTrueExists = true; + } + + // 3) Finally classify the actually chosen reco collision as right/wrong. + if (bestColID >= 0 && itRecoToMc != recoToMc.end()) { + const int mcFromReco = itRecoToMc->second; + bin = (mcFromReco == mcOfTrack) + ? static_cast(RightWrongBin::Right) + : static_cast(RightWrongBin::Wrong); + } + } + + registry.fill(HIST("RightWrong"), bin); + registry.fill(HIST("Purity/RecoOfTrueExists"), + recoOfTrueExists ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + registry.fill(HIST("Purity/RecoOfTrueInCompatible"), + recoOfTrueInCompatible ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/WrongVertexRecoExists"), + recoOfTrueExists ? static_cast(WrongVertexRecoExistsBin::RecoOfTrueExists) + : static_cast(WrongVertexRecoExistsBin::RecoOfTrueMissing)); + registry.fill(HIST("Purity/RecoOfTrueExistsW"), + recoOfTrueExists ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + registry.fill(HIST("Purity/RecoOfTrueInCompatibleW"), + recoOfTrueInCompatible ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + } + + if (bin == static_cast(RightWrongBin::Right)) { + registry.fill(HIST("Purity/RecoOfTrueExistsR"), + recoOfTrueExists ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + registry.fill(HIST("Purity/RecoOfTrueInCompatibleR"), + recoOfTrueInCompatible ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + } + + registry.fill(HIST("Purity/RecoSparseAll"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + + if (isPrimaryCharged) { + registry.fill(HIST("Purity/RecoSparsePrimary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } else { + registry.fill(HIST("Purity/RecoSparseSecondary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } + + registry.fill(HIST("RecoSparseAllBest"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + if (bin == static_cast(RightWrongBin::Wrong)) { + float vzBest = 999.; + float vzTrue = 999.; + auto itVzBest = recoVtxZ.find(bestColID); + if (itVzBest != recoVtxZ.end()) { + vzBest = itVzBest->second; + } + auto itVzTrue = recoToMcVZ.find(vzBest); + if (itVzTrue != recoToMcVZ.end()) { + vzTrue = itVzBest->second; + } + double_t vztrueParticle = mcColObj.posZ(); + double_t diff1 = vzBest - vztrueParticle; + double_t diff2 = vzBest - vzTrue; + registry.fill(HIST("deltaVZ_fromReco"), diff1); + registry.fill(HIST("deltaVZ_fromTrue"), diff2); + registry.fill(HIST("RecoSparseAllBestWrong"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } + + // Truth DCA components w.r.t. MC collision vertex + const auto dcaXtruth = mcPart.vx() - mcColObj.posX(); // here mcColObj -> mcPart.mcCollision() + const auto dcaYtruth = mcPart.vy() - mcColObj.posY(); + const auto dcaZtruth = mcPart.vz() - mcColObj.posZ(); + const auto dcaXYtruth = std::sqrt(dcaXtruth * dcaXtruth + + dcaYtruth * dcaYtruth); + + const float etaTruth = mcPart.eta(); + const bool isPrimaryTruth = mcPart.isPhysicalPrimary(); + + // Base truth histograms (independent of right/wrong vertex) + registry.fill(HIST("Tracks/dca/Truth/THnDCAxyBestGenTruthAll"), + etaTruth, dcaXYtruth, dcaZtruth, dcaXtruth, dcaYtruth); + if (isPrimaryTruth) { + registry.fill(HIST("Tracks/dca/Truth/THnDCAxyBestGenTruthPrim"), + etaTruth, dcaXYtruth, dcaZtruth, dcaXtruth, dcaYtruth); + } else { + registry.fill(HIST("Tracks/dca/Truth/THnDCAxyBestGenTruthSec"), + etaTruth, dcaXYtruth, dcaZtruth, dcaXtruth, dcaYtruth); + } + + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksPtZvtx"), track.pt(), z); + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("Purity/reco/woOrp/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp/woOrpPtZvtx_gt0"), track.pt(), z); + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksDCAxyZvtx_gt0"), dcaXyCut, z); + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksDCAzZvtx_gt0"), dcaZCut, z); + } + registry.fill(HIST("Purity/reco/woOrp/woOrpTracksPhiEta"), phi, track.eta()); + + if (isFakeByLabel) { + // std::cout << " track.eta() " < 0) { + registry.fill(HIST("Purity/reco/woOrp_fake/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_fake/woOrpPtZvtx_gt0"), track.pt(), z); + } + } + if (isTrueByLabel) { + // Has MC particle + // std::cout << " track.eta() has mc particle " < 0) { + registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_hasMC/woOrpPtZvtx_gt0"), track.pt(), z); + } + } + if (isSecondaryCharged) { + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksPtZvtx"), track.pt(), z); + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpTracksPhiEta"), phi, track.eta()); + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_secondary/woOrpPtZvtx_gt0"), track.pt(), z); + } + } + if (isPrimaryCharged) { + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksEtaZvtx"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksPtZvtx"), track.pt(), z); + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpTracksPhiEta"), phi, track.eta()); + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpEtaZvtx_gt0"), track.eta(), z); + registry.fill(HIST("Purity/reco/woOrp_primary/woOrpPtZvtx_gt0"), track.pt(), z); + } + } + + ++woOrpCount; + // Category 2: all reco tracks after selections (woOrp) + + // --- Primary vs Fake accounting --- + const float xTrue = mcColObj.posX(); + const float yTrue = mcColObj.posY(); + const float zTrue = mcColObj.posZ(); + + std::array dcaInfOrig{999., 999., 999.}; + std::array dcaChosen{999., 999.}; // (DCAxy, DCAz) to chosen reco vertex + std::array dcaRight{999., 999.}; // (DCAxy, DCAz) to truth MC vertex (reference) + std::array dcaChosenXYZ{999., 999., 999.}; // (DCAx, DCAy, DCAz) to chosen reco vertex + + const double bZ = o2::base::Propagator::Instance()->getNominalBz(); + + // Build forward track parameters once per track, then use a fresh copy for each vertex propagation + std::vector v1; // empty -> null cov + SMatrix55 tcovs(v1.begin(), v1.end()); + SMatrix5 tpars(track.x(), track.y(), track.phi(), track.tgl(), track.signed1Pt()); + o2::track::TrackParCovFwd trackPar0{track.z(), tpars, tcovs, track.chi2()}; + + auto trackPar = trackPar0; // copy + dcaInfOrig = {999., 999., 999.}; + const std::array vtxChosen{collision.posX(), collision.posY(), collision.posZ()}; + trackPar.propagateToDCAhelix(bZ, vtxChosen, dcaInfOrig); + dcaChosenXYZ = dcaInfOrig; // store (DCAx, DCAy, DCAz) + dcaChosen[0] = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); + dcaChosen[1] = dcaInfOrig[2]; + + dcaInfOrig = {999., 999., 999.}; + const std::array vtxTruth{xTrue, yTrue, zTrue}; + trackPar.propagateToDCAhelix(bZ, vtxTruth, dcaInfOrig); + dcaRight[0] = std::sqrt(dcaInfOrig[0] * dcaInfOrig[0] + dcaInfOrig[1] * dcaInfOrig[1]); + dcaRight[1] = dcaInfOrig[2]; + + registry.fill(HIST("Purity/DCAyVsDCAx_Right"), dcaChosenXYZ[2], dcaChosenXYZ[1]); + // Fill only for WRONG-vertex tracks (the diagnostic you want) + if (bin == static_cast(RightWrongBin::Wrong)) { + // std::cout <<"dcaxy choosen " << dcaXyCut<<" dcaxy calculated "<(RightWrongBin::Right)) { + // std::cout <<"dcaxy choosen " << dcaXyCut<<" dcaxy calculated "<(RightWrongBin::Right)) { + // Right-vertex: all / primary / secondary + registry.fill(HIST("Purity/RecoSparseRightAll"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + if (!filledRight) { + registry.fill(HIST("Purity/RecoSparseRightAll_EventCount"), static_cast(SingleCountBin::Count)); + + filledRight = true; + } + if (isPrimaryCharged) { + registry.fill(HIST("Purity/RecoSparseRightPrimary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } else { + registry.fill(HIST("Purity/RecoSparseRightSecondary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } + } else if (bin == static_cast(RightWrongBin::Wrong)) { + // Wrong-vertex: all / primary / secondary + registry.fill(HIST("Purity/RecoSparseWrongAll"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + if (!filledWrong) { + registry.fill(HIST("Purity/RecoSparseWrongAll_EventCount"), static_cast(SingleCountBin::Count)); + filledWrong = true; + } + if (isPrimaryCharged) { + registry.fill(HIST("Purity/RecoSparseWrongPrimary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } else { + registry.fill(HIST("Purity/RecoSparseWrongSecondary"), + etaReco, dcaXYReco, dcaZReco, dcaXReco, dcaYReco); + } + } + // Reconstructed vertex position for bestbestColID, if available + auto itVtxX = recoVtxX.find(bestColID); + + if (itVtxX != recoVtxX.end()) { + + const float xReco = itVtxX->second; + const float yReco = recoVtxY[bestColID]; + const float zReco = recoVtxZ[bestColID]; + const bool recoVzIn = (zReco >= cfgVzCut1) && (zReco <= cfgVzCut2); + const bool trueVzIn = (zTrue >= cfgVzCut1) && (zTrue <= cfgVzCut2); + + if (!(recoVzIn && trueVzIn)) { + continue; // skip filling Delta* histos for this track + } + + const float deltaXvtx = xReco - xTrue; + const float deltaYvtx = yReco - yTrue; + const float deltaZvtx = zReco - zTrue; + + // We are interested in how far the WRONG collisions are from the true one + if (bin == static_cast(RightWrongBin::Wrong)) { + registry.fill(HIST("Purity/DeltaXWrong"), deltaXvtx); + registry.fill(HIST("Purity/DeltaYWrong"), deltaYvtx); + registry.fill(HIST("Purity/DeltaZWrong"), deltaZvtx); + } + if (bin == static_cast(RightWrongBin::Right)) { + registry.fill(HIST("Purity/DeltaXRight"), deltaXvtx); + registry.fill(HIST("Purity/DeltaYRight"), deltaYvtx); + registry.fill(HIST("Purity/DeltaZRight"), deltaZvtx); + } + } + + // --- Delta-DCA components: truth minus reco --- + const float deltaDCAxy = dcaXYtruth - dcaXYReco; + const float deltaDCAz = dcaZtruth - dcaZReco; + const float deltaDCAx = dcaXtruth - dcaXReco; + const float deltaDCAy = dcaYtruth - dcaYReco; + if (bin == static_cast(RightWrongBin::Right)) { + // Right-vertex: all / primary / secondary + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCARightAll"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + if (isPrimaryCharged) { + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCARightPrim"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + } else { + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCARightSec"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + } + } else { + // Wrong-vertex: all / primary / secondary + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCAWrongAll"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + if (isPrimaryCharged) { + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCAWrongPrim"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + } else { + registry.fill(HIST("Tracks/dca/Truth/THnDeltaDCAWrongSec"), + deltaDCAxy, deltaDCAz, deltaDCAx, deltaDCAy); + } + } + + // auto mcColObj = track.mcParticle().mcCollision_as(); + // True primary match (purity numerator) + registry.fill(HIST("Purity/mc/PrimaryAll"), static_cast(SingleCountBin::Count)); + registry.fill(HIST("Purity/mc/PrimaryAllEta"), mcPart.eta()); + registry.fill(HIST("Purity/mc/PrimaryTracksEtaZvtx"), mcPart.eta(), mcCollision.posZ()); + if (perCollisionSampleCentral.size() > 0) { + registry.fill(HIST("Purity/mc/PrimaryTracksEtaZvtx_gt0"), mcPart.eta(), mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksPtZvtx_gt0"), mcPart.pt(), mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksDCAxyZvtx_gt0"), dcaXyCut, mcCollision.posZ()); + registry.fill(HIST("Purity/mc/PrimaryTracksDCAzZvtx_gt0"), dcaZCut, mcCollision.posZ()); + } + registry.fill(HIST("Purity/mc/PrimaryTracksPhiEta"), mcPart.phi(), mcPart.eta()); + registry.fill(HIST("Purity/SelectedAfterDCAxy/PrimaryAll"), static_cast(SingleCountBin::Count)); + registry.fill(HIST("Purity/SelectedAfterDCAxy/PrimaryAllEta"), mcPart.eta()); + countedPrimary = true; + + // --- Purity profiles (mean of indicator gives purity) --- + registry.fill(HIST("Purity/PurityOverall"), + static_cast(SingleCountBin::Count), + countedPrimary ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + + registry.fill(HIST("Purity/PurityVsEta"), track.eta(), + countedPrimary ? static_cast(BoolBin::Yes) + : static_cast(BoolBin::No)); + } // track loop + registry.fill(HIST("Purity/HashTableRowCounts"), + static_cast(HashTableRowCountsBin::UniqueBestRecoCols), uniqueBestRecoCols.size()); + } + registry.fill(HIST("Purity/reco/woOrp/nTrk"), woOrpCount); + registry.fill(HIST("Purity/reco/PNchMFT_afterCuts"), nMftSelectedAfterCuts); + } // collision + } + + PROCESS_SWITCH(PseudorapidityDensityMFT, processGenReco, + "Process particle-level info of pt", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx b/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx deleted file mode 100644 index 93b8625ba65..00000000000 --- a/PWGLF/Tasks/GlobalEventProperties/dndeta-mft-pp.cxx +++ /dev/null @@ -1,1223 +0,0 @@ -// Copyright 2020-2025 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 dndeta-mft.cxx -// \author Sarah Herrmann -// -// \brief This code loops over MFT tracks and collisions and fills histograms -// useful to compute dNdeta - -#include "PWGMM/Mult/DataModel/bestCollisionTable.h" - -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" - -#include "TFile.h" - -#include -#include -#include -#include -#include -#include -#include - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::aod::track; - -AxisSpec PtAxis = {1001, -0.005, 10.005}; -AxisSpec DeltaZAxis = {61, -6.1, 6.1}; -AxisSpec ZAxis = {301, -30.1, 30.1}; -AxisSpec PhiAxis = {629, 0, o2::constants::math::TwoPI, "Rad", "phi axis"}; -// AxisSpec EtaAxis = {18, -4.6, -1.}; -AxisSpec DCAxyAxis = {5000, -1, 500}; -AxisSpec DCAzAxis = {5000, -251, 250}; -AxisSpec CentAxis = {{0, 10, 20, 30, 40, 50, 60, 70, 80, 100}}; - -static constexpr TrackSelectionFlags::flagtype trackSelectionITS = - TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | - TrackSelectionFlags::kITSHits; - -static constexpr TrackSelectionFlags::flagtype trackSelectionTPC = - TrackSelectionFlags::kTPCNCls | - TrackSelectionFlags::kTPCCrossedRowsOverNCls | - TrackSelectionFlags::kTPCChi2NDF; - -static constexpr TrackSelectionFlags::flagtype trackSelectionDCA = - TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy; - -using MFTTracksLabeled = soa::Join; - -struct PseudorapidityDensityMFT { - SliceCache cache; - Preslice perCol = o2::aod::fwdtrack::collisionId; - Preslice perMcCol = aod::mcparticle::mcCollisionId; - Preslice perColCentral = aod::track::collisionId; - - Service pdg; - - Configurable estimatorEta{"estimatorEta", 1.0, - "eta range for INEL>0 sample definition"}; - - Configurable useEvSel{"useEvSel", true, "use event selection"}; - Configurable disableITSROFCut{"disableITSROFCut", false, "Disable ITS ROF cut for event selection"}; - ConfigurableAxis multBinning{"multBinning", {701, -0.5, 700.5}, ""}; - ConfigurableAxis EtaAxis = {"etaBinning", {36, -4.6, -1.}, ""}; - - Configurable useZDiffCut{"useZDiffCut", true, "use Z difference cut"}; - Configurable maxZDiff{ - "maxZDiff", 1.0f, - "max allowed Z difference for reconstructed collisions (cm)"}; - - Configurable usePhiCut{"usePhiCut", true, "use azimuthal angle cut"}; - Configurable useDCAxyCut{"useDCAxyCut", false, "use DCAxy cut"}; - Configurable useDCAzCut{"useDCAzCut", false, "use DCAz cut"}; - - Configurable cfgPhiCut{"cfgPhiCut", 0.1f, - "Cut on azimuthal angle of MFT tracks"}; - Configurable cfgPhiCut1{"cfgPhiCut1", 0.0f, - "low Cut on azimuthal angle of MFT tracks"}; - Configurable cfgPhiCut2{"cfgPhiCut2", 6.3f, - "high Cut on azimuthal angle of MFT tracks"}; - Configurable cfgVzCut1{"cfgVzCut1", -30.0f, - "Cut1 on vertex position of MFT tracks"}; - Configurable cfgVzCut2{"cfgVzCut2", 30.0f, - "Cut2 on vertex position of MFT tracks"}; - Configurable cfgnCluster{"cfgnCluster", 5.0f, - "Cut on no of clusters per MFT track"}; - Configurable cfgnEta1{"cfgnEta1", -4.5f, - "Cut on eta1"}; - Configurable cfgnEta2{"cfgnEta2", -1.0f, - "Cut on eta1"}; - Configurable cfgChi2NDFMax{"cfgChi2NDFMax", 2000.0f, "Max allowed chi2/NDF for MFT tracks"}; - Configurable maxDCAxy{"maxDCAxy", 2.0f, "Cut on dcaXY"}; - Configurable maxDCAz{"maxDCAz", 2.0f, "Cut on dcaZ"}; - - HistogramRegistry registry{ - "registry", - {{"TracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}, // - {"Tracks/EtaZvtx_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}, // - {"TracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}, // - {"TracksPhiZvtx", - "; #varphi; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {PhiAxis, ZAxis}}}, // - {"TracksPtEta", - " ; p_{T} (GeV/c); #eta", - {HistType::kTH2F, {PtAxis, EtaAxis}}}, // - {"EventSelection", - ";status;events", - {HistType::kTH1F, {{15, 0.5, 15.5}}}}, - {"EventCounts", - ";status;events", - {HistType::kTH1F, {{2, 0.5, 2.5}}}}, - {"Tracks/Control/TrackCount", ";status;Track counts", {HistType::kTH1F, {{15, 0.5, 15.5}}}}, // added - // Purity-related histograms - {"Purity/SelectedAfterDCAxy/All", - ";bin;counts", - {HistType::kTH1F, {{1, 0.5, 1.5}}}}, - {"Purity/SelectedAfterDCAxy/AllEta", - ";#eta;counts", - {HistType::kTH1F, {EtaAxis}}}, - {"Purity/Gen/PrimaryEta", - ";#eta;primaries", - {HistType::kTH1F, {EtaAxis}}}, - {"Purity/Gen/All", - ";bin;counts", - {HistType::kTH1F, {{1, 0.5, 1.5}}}}, - {"Purity/Gen/AllEta", - ";#eta;counts", - {HistType::kTH1F, {EtaAxis}}}}}; - - void init(InitContext&) - { - if (static_cast(doprocessMult) + - static_cast(doprocessMultReassoc) + - static_cast(doprocessMultReassoc3d) + - static_cast(doprocessCountingCentrality) > - 1) { - LOGP(fatal, - "Exactly one process function between processMult, " - "processMultReassoc, processMultReassoc3d and processCountingCentrality should be " - "enabled!"); - } - AxisSpec MultAxis = {multBinning, "N_{trk}"}; - auto hstat = registry.get(HIST("EventSelection")); - auto* x = hstat->GetXaxis(); - x->SetBinLabel(1, "All"); - x->SetBinLabel(2, "Vz"); - x->SetBinLabel(3, "Vz+ITSRof"); - x->SetBinLabel(4, "Vz+Selected"); - x->SetBinLabel(5, "Sel8+Vz+INEL>0"); - x->SetBinLabel(6, "Sel INEL,INEL_fwd>0"); - x->SetBinLabel(7, "Rejected"); - x->SetBinLabel(8, "Good BCs"); - x->SetBinLabel(9, "BCs with collisions"); - x->SetBinLabel(10, "BCs with pile-up/splitting"); - x->SetBinLabel(11, "percollisionSample>0"); - x->SetBinLabel(12, "midtracks+percollisionSample>0"); - registry.add({"EventsNtrkZvtx", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"EventsNtrkZvtx_gt0", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_all", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelgt0", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelfwdgt0", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"Tracks/Control/DCAXY", - " ; DCA_{XY} (cm)", - {HistType::kTH1F, {DCAxyAxis}}}); - if (doprocessGen) { - registry.add({"EventsNtrkZvtxGen", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"EventsNtrkZvtxGen_t", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"EventsNtrkZvtxGen_gt0", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"EventsNtrkZvtxGen_gt0t", - "; N_{trk}; #it{z}_{vtx} (cm); events", - {HistType::kTH2F, {MultAxis, ZAxis}}}); - registry.add({"TracksEtaZvtxGen", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"TracksEtaZvtxGen_t", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"TracksEtaZvtxGen_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"TracksEtaZvtxGen_gt0t", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"TracksPhiEtaGen", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"TracksPhiEtaGen_gt0", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"TracksPhiEtaGen_gt0t", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"TracksPhiZvtxGen", - "; #varphi; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {PhiAxis, ZAxis}}}); // - registry.add({"TracksToPartPtEta", - " ; p_{T} (GeV/c); #eta", - {HistType::kTH2F, {PtAxis, EtaAxis}}}); // - registry.add({"TracksPtEtaGen", - " ; p_{T} (GeV/c); #eta", - {HistType::kTH2F, {PtAxis, EtaAxis}}}); - registry.add({"TracksPtEtaGen_t", - " ; p_{T} (GeV/c); #eta", - {HistType::kTH2F, {PtAxis, EtaAxis}}}); - registry.add({"EventEfficiency", - "; status; events", - {HistType::kTH1F, {{5, 0.5, 5.5}}}}); - registry.add({"NotFoundEventZvtx", - " ; #it{z}_{vtx} (cm)", - {HistType::kTH1F, {ZAxis}}}); - registry.add({"EventsZposDiff", - " ; Z_{rec} - Z_{gen} (cm)", - {HistType::kTH1F, {DeltaZAxis}}}); - registry.add({"EventsSplitMult", " ; N_{gen}", {HistType::kTH1F, {MultAxis}}}); - auto heff = registry.get(HIST("EventEfficiency")); - x = heff->GetXaxis(); - x->SetBinLabel(1, "Generated"); - x->SetBinLabel(2, "Generated INEL>0"); - x->SetBinLabel(3, "Reconstructed"); - x->SetBinLabel(4, "Selected"); - x->SetBinLabel(5, "Selected INEL>0"); - } - - if (doprocessMultReassoc || doprocessMultReassoc3d) { - registry.add({"Tracks/Control/DeltaZ", - " ; #it{z_{orig}}-#it{z_{reass}}", - {HistType::kTH1F, {ZAxis}}}); - - registry.add({"Tracks/Control/TrackAmbDegree", - " ; N_{coll}^{comp}", - {HistType::kTH1F, {{51, -0.5, 50.5}}}}); - registry.add({"Tracks/Control/TrackIsAmb", - " ; isAmbiguous", - {HistType::kTH1I, {{2, -0.5, 1.5}}}}); - - auto htrk = registry.get(HIST("Tracks/Control/TrackCount")); - auto* x = htrk->GetXaxis(); - x->SetBinLabel(0, "All"); - x->SetBinLabel(1, "Reass"); - x->SetBinLabel(2, "Not Reass"); - x->SetBinLabel(3, "Amb"); - x->SetBinLabel(4, "Amb+Not-reass"); - x->SetBinLabel(5, "Non-Amb"); - x->SetBinLabel(6, "Not-Reass+Non-Amb"); - x->SetBinLabel(7, "Amb+Non-Amb"); - x->SetBinLabel(8, "colid<0"); - x->SetBinLabel(9, "wo orphan"); - - registry.add({"Tracks/Control/ReassignedTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"Tracks/Control/ReassignedTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"Tracks/Control/ReassignedVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); - - registry.add({"Tracks/Control/notReassignedTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); - registry.add({"Tracks/Control/notReassignedTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); - registry.add({"Tracks/Control/notReassignedVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); - registry.add({"Tracks/Control/Chi2NDF", - " ; #chi^{2}/ndf", - {HistType::kTH1F, {{5000, 0.0, 5000.0}}}}); - registry.add({"Tracks/Control/amb/AmbTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - - registry.add({"Tracks/Control/woOrp/nTrk", - " ; N_{Trk}^{all}", - {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // - registry.add({"Tracks/Control/amb/nTrkAmb", - " ; N_{Trk}^{amb}", - {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // - registry.add({"Tracks/Control/nonamb/nTrkNonAmb", - " ; N_{Trk}^{nonamb}", - {HistType::kTH1F, {{701, -0.5, 700.5}}}}); // - - registry.add({"Tracks/Control/amb/AmbTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); // - registry.add({"Tracks/Control/amb/AmbVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); // - registry.add({"Tracks/Control/amb/EtaZvtxAmb_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/Control/amb/DCAxy_amb", " ; DCA_{xy} (cm) ambiguous", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {DCAxyAxis}}}); // - - registry.add({"Tracks/Control/nonamb/nonAmbTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - - registry.add({"Tracks/Control/nonamb/nonAmbTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); // - registry.add({"Tracks/Control/nonamb/nonAmbVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); // - registry.add({"Tracks/Control/nonamb/EtaZvtxNonAmb_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/Control/nonamb/DCAxy_nonamb", " ; DCA_{xy}(cm) non-ambiguous", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {{DCAxyAxis}}}}); // - - registry.add({"Tracks/Control/woOrp/woOrpTracksEtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/Control/woOrp/woOrpEtaZvtx_gt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/2Danalysis/EtaZvtx", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/2Danalysis/EtaZvtx_sel8", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/2Danalysis/EtaZvtx_sel8_inelgt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0", - "; #eta; #it{z}_{vtx} (cm); tracks", - {HistType::kTH2F, {EtaAxis, ZAxis}}}); // - registry.add({"Tracks/Control/woOrp/woOrpTracksPhiEta", - "; #varphi; #eta; tracks", - {HistType::kTH2F, {PhiAxis, EtaAxis}}}); // - registry.add({"Tracks/Control/woOrp/woOrpVertexCorr", - "; #it{z}_{vtx}^{orig} (cm); #it{z}_{vtx}^{re} (cm)", - {HistType::kTH2F, {ZAxis, ZAxis}}}); // - registry.add({"Tracks/Control/woOrp/DCAxy_woOrp", " ; DCA_{xy}(cm) w/o orphan", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {{DCAxyAxis}}}}); // - - if (doprocessMultReassoc3d) { - // DCAz histograms analogous to DCAxy, only for 3D reassociation - registry.add({"Tracks/Control/DCAZ", - " ; DCA_{Z} (cm)", - {HistType::kTH1F, {DCAzAxis}}}); - registry.add({"Tracks/Control/amb/DCAz_amb", - " ; DCA_{z} (cm) ambiguous", - {HistType::kTH1F, {DCAzAxis}}}); - registry.add({"Tracks/Control/nonamb/DCAz_nonamb", - " ; DCA_{z}(cm) non-ambiguous", - {HistType::kTH1F, {DCAzAxis}}}); - registry.add({"Tracks/Control/woOrp/DCAz_woOrp", - " ; DCA_{z}(cm) w/o orphan", - {HistType::kTH1F, {DCAzAxis}}}); - } - - registry.add({"collisionID", " ; Collision ID", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {{100000, -50000.0, 50000.0}}}}); // - registry.add({"collisionIDamb", " ; Collision ID amb", - // {HistType::kTH1F,{{100000, 0.5, 100000.0}}}}); // - {HistType::kTH1F, {{100000, -50000.0, 50000.0}}}}); // - registry.add({"NonambEventCounts", " ; EventCounts Nonamb", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"hNumCollisionsNonAmb_InelMFT", " ; Number of Collisions with Non-Ambiguous Tracks;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"hNumCollisionsAmb_InelMFT", " ; Number of Collisions with Non-Ambiguous Tracks;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"hNumCollisions_InelMFT", " ; Number of selected events with Inel>0 and MFT>0;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"hNumCollisions_Inel", " ; Number of selected events with Inel>0;Count;Frequency", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - registry.add({"ambEventCounts", " ; EventCounts Nonamb", {HistType::kTH1F, {{1, 0.5, 1.5}}}}); // - } - - if (doprocessCountingCentrality) { - registry.add({"Events/Centrality/Selection", - ";status;centrality;events", - {HistType::kTH2F, {{3, 0.5, 3.5}, CentAxis}}}); - auto hstat = registry.get(HIST("Events/Centrality/Selection")); - auto* x = hstat->GetXaxis(); - x->SetBinLabel(1, "All"); - x->SetBinLabel(2, "Selected"); - x->SetBinLabel(3, "Rejected"); - - registry.add({"Events/Centrality/NtrkZvtx", - "; N_{trk}; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {MultAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/EtaZvtx", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/PhiEta", - "; #varphi; #eta; centrality", - {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/PtEta", - " ; p_{T} (GeV/c); #eta; centrality", - {HistType::kTH3F, {PtAxis, EtaAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/DCAXYPt", - " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", - {HistType::kTH3F, {PtAxis, DCAxyAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ReassignedDCAXYPt", - " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", - {HistType::kTH3F, {PtAxis, DCAxyAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ExtraDCAXYPt", - " ; p_{T} (GeV/c) ; DCA_{XY} (cm); centrality", - {HistType::kTH3F, {PtAxis, DCAxyAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ExtraTracksEtaZvtx", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ExtraTracksPhiEta", - "; #varphi; #eta; centrality", - {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ReassignedTracksEtaZvtx", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ReassignedTracksPhiEta", - "; #varphi; #eta; centrality", - {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/Control/ReassignedVertexCorr", - "; Z_{vtx}^{orig} (cm); Z_{vtx}^{re} (cm); centrality", - {HistType::kTH3F, {ZAxis, ZAxis, CentAxis}}}); - } - - if (doprocessGenCent) { - registry.add({"Events/Centrality/EventEfficiency", - ";status;centrality;events", - {HistType::kTH2F, {{2, 0.5, 2.5}, CentAxis}}}); - auto heff = registry.get(HIST("Events/Centrality/EventEfficiency")); - auto* x = heff->GetXaxis(); - x->SetBinLabel(1, "Generated"); - x->SetBinLabel(2, "Selected"); - - registry.add("Events/Centrality/CentPercentileMCGen", - "CentPercentileMCGen", kTH1D, {CentAxis}, false); - registry.add({"Events/Centrality/NtrkZvtxGen", - "; N_{trk}; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {MultAxis, ZAxis, CentAxis}}}); - registry.add({"Events/Centrality/NtrkZvtxGen_t", - "; N_{trk}; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {MultAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/EtaZvtxGen_t", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/EtaZvtxGen", - "; #eta; Z_{vtx} (cm); centrality", - {HistType::kTH3F, {EtaAxis, ZAxis, CentAxis}}}); - registry.add({"Tracks/Centrality/PhiEtaGen", - "; #varphi; #eta; centrality", - {HistType::kTH3F, {PhiAxis, EtaAxis, CentAxis}}}); - } - } - - using FullBCs = soa::Join; - void processTagging(FullBCs const& bcs, - soa::Join const& collisions) - { - - std::vector::iterator> cols; - for (const auto& bc : bcs) { - if (!useEvSel || - (useEvSel && ((bc.selection_bit(aod::evsel::kIsBBT0A) && - bc.selection_bit(aod::evsel::kIsBBT0C)) != 0))) { - registry.fill(HIST("EventSelection"), 8); // added 5->12 - cols.clear(); - for (const auto& collision : collisions) { - if (collision.has_foundBC()) { - if (collision.foundBCId() == bc.globalIndex()) { - cols.emplace_back(collision); - } - } else if (collision.bcId() == bc.globalIndex()) { - cols.emplace_back(collision); - } - } - LOGP(debug, "BC {} has {} collisions", bc.globalBC(), cols.size()); - if (!cols.empty()) { - registry.fill(HIST("EventSelection"), 9); // added 6->13 - if (cols.size() > 1) { - registry.fill(HIST("EventSelection"), 10); // added 7->14 - } - } - } - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processTagging, - "Collect event sample stats", true); - - Partition sample = - (aod::fwdtrack::eta < -2.8f) && (aod::fwdtrack::eta > -3.2f); - - Partition sampleCentral = (nabs(aod::track::eta) < 1.f); - - expressions::Filter atrackFilter = - (aod::fwdtrack::bestCollisionId >= 0) && (aod::fwdtrack::eta < -2.0f) && - (aod::fwdtrack::eta > -3.9f) && (nabs(aod::fwdtrack::bestDCAXY) <= 2.f); - - using CollwEv = soa::Join; - - expressions::Filter trackSelectionCentral = - ((aod::track::trackCutFlag & trackSelectionITS) == trackSelectionITS) && - ifnode((aod::track::v001::detectorMap & (uint8_t)o2::aod::track::TPC) == - (uint8_t)o2::aod::track::TPC, - (aod::track::trackCutFlag & trackSelectionTPC) == - trackSelectionTPC, - true) && - ((aod::track::trackCutFlag & trackSelectionDCA) == trackSelectionDCA) && - (nabs(aod::track::eta) < estimatorEta); - - using FiCentralTracks = soa::Filtered< - soa::Join>; // central tracks for INEL>0 - - void processMult(CollwEv::iterator const& collision, - aod::MFTTracks const& tracks, - FiCentralTracks const& midtracks, aod::Tracks const&) - { - - registry.fill(HIST("EventSelection"), 1.); - if (!useEvSel || (useEvSel && collision.sel8())) { - registry.fill(HIST("EventSelection"), 2.); - auto z = collision.posZ(); - auto perCollisionSample = sampleCentral->sliceByCached( - o2::aod::track::collisionId, collision.globalIndex(), cache); - auto Ntrk = perCollisionSample.size(); - - registry.fill(HIST("EventsNtrkZvtx"), Ntrk, z); - - if (midtracks.size() > 0) // INEL>0 - { - registry.fill(HIST("EventSelection"), 3.); - registry.fill(HIST("EventsNtrkZvtx_gt0"), Ntrk, z); - } - - if (tracks.size() > 0) { - for (const auto& track : tracks) { - - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - - if (usePhiCut) { - if ((phi < cfgPhiCut) || - ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) || - (phi > o2::constants::math::TwoPI - cfgPhiCut) || - ((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) && - (phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut))) - continue; - } - - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - if (midtracks.size() > 0) // INEL>0 - { - registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z); - } - registry.fill(HIST("TracksPhiEta"), phi, track.eta()); - registry.fill(HIST("TracksPtEta"), track.pt(), track.eta()); - if ((track.eta() < -2.0f) && (track.eta() > -3.9f)) { - registry.fill(HIST("TracksPhiZvtx"), phi, z); - } - } - } - - } else { - registry.fill(HIST("EventSelection"), 4.); - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processMult, - "Process reco or data info", true); - // Common implementation for both BestCollisionsFwd and BestCollisionsFwd3d - template - void processMultReassocCommon(CollwEv::iterator const& collision, - o2::aod::MFTTracks const&, - RetracksT const& retracks, - FiCentralTracks const& midtracks, aod::Tracks const&) - { - registry.fill(HIST("EventSelection"), 1.); - auto perCollisionSample = sampleCentral->sliceByCached( - o2::aod::track::collisionId, collision.globalIndex(), cache); - auto Ntrk = perCollisionSample.size(); - auto z = collision.posZ(); - registry.fill(HIST("EventsNtrkZvtx"), Ntrk, z); - if ((z >= cfgVzCut1) && (z <= cfgVzCut2)) { - registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_all"), Ntrk, z); - registry.fill(HIST("EventSelection"), 2.); - for (const auto& retrack : retracks) { - auto track = retrack.mfttrack(); - float ndf = std::max(2.0f * track.nClusters() - 5.0f, 1.0f); - float chi2ndf = track.chi2() / ndf; - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - if (usePhiCut) { - if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21)) - continue; - } - float dcaxy_cut = retrack.bestDCAXY(); - if (useDCAxyCut) { - if (dcaxy_cut > maxDCAxy) - continue; - } - if constexpr (std::is_same_v>) { - float dcaz_cut = retrack.bestDCAZ(); - if (useDCAzCut) { - if (dcaz_cut > maxDCAz) - continue; - } - } - if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && retrack.ambDegree() > 0 && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { - registry.fill(HIST("Tracks/2Danalysis/EtaZvtx"), track.eta(), z); - } - } - if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { - return; - } - registry.fill(HIST("EventSelection"), 3.); - if (!useEvSel || (useEvSel && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoSameBunchPileup))) { - registry.fill(HIST("EventSelection"), 4.); - registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8"), Ntrk, z); - std::unordered_set uniqueEvents; - std::unordered_set uniqueEventsAmb; - std::unordered_set uniqueCollisions; - std::unordered_set uniqueCollisionsAmb; - std::unordered_set eventsInelMFT; - std::unordered_set eventsInel; - if (midtracks.size() > 0) { - registry.fill(HIST("EventSelection"), 5.); - registry.fill(HIST("EventsNtrkZvtx_gt0"), Ntrk, z); - registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelgt0"), Ntrk, z); - eventsInel.insert(collision.globalIndex()); - } - if (perCollisionSample.size() > 0) { - registry.fill(HIST("EventSelection"), 11.); - } - if (midtracks.size() > 0 && perCollisionSample.size() > 0) { - registry.fill(HIST("EventSelection"), 12.); - } - int64_t i = 0.0, j = 0.0, k = 0.0; - for (const auto& retrack : retracks) { - auto track = retrack.mfttrack(); - float ndf = std::max(2.0f * track.nClusters() - 5.0f, 1.0f); - float chi2ndf = track.chi2() / ndf; - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - if (usePhiCut) { - if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21)) - continue; - } - float dcaxy_cut = retrack.bestDCAXY(); - if (useDCAxyCut) { - if (dcaxy_cut > maxDCAxy) - continue; - } - if constexpr (std::is_same_v>) { - float dcaz_cut = retrack.bestDCAZ(); - if (useDCAzCut) { - if (dcaz_cut > maxDCAz) - continue; - } - } - if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && retrack.ambDegree() > 0 && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { - registry.fill(HIST("Tracks/Control/Chi2NDF"), chi2ndf); - registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8"), track.eta(), z); - if (midtracks.size() > 0 && retrack.ambDegree() > 0) { - registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelgt0"), track.eta(), z); - } - } - } - if (retracks.size() > 0) { - registry.fill(HIST("EventSelection"), 6.); - if (midtracks.size() > 0) { - registry.fill(HIST("Tracks/2Danalysis/EventsNtrkZvtx_sel8_inelfwdgt0"), Ntrk, z); - } - for (const auto& retrack : retracks) { - auto track = retrack.mfttrack(); - float ndf = std::max(2.0f * track.nClusters() - 5.0f, 1.0f); - float chi2ndf = track.chi2() / ndf; - float phi = track.phi(); - float dcaxy_cut = retrack.bestDCAXY(); - o2::math_utils::bringTo02Pi(phi); - // Declare dcaz_cut only if needed below. - if ((cfgnEta1 < track.eta()) && (track.eta() < cfgnEta2) && track.nClusters() >= cfgnCluster && chi2ndf < cfgChi2NDFMax && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { - if (usePhiCut) { - if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21)) - continue; - } - if (useDCAxyCut) { - if (dcaxy_cut > maxDCAxy) - continue; - } - if constexpr (std::is_same_v>) { - float dcaz_cut = retrack.bestDCAZ(); - if (useDCAzCut) { - if (dcaz_cut > maxDCAz) - continue; - } - } - // Purity denominator: all tracks that pass the DCA selection and other quality cuts - registry.fill(HIST("Purity/SelectedAfterDCAxy/All"), 1.); - registry.fill(HIST("Purity/SelectedAfterDCAxy/AllEta"), track.eta()); - registry.fill(HIST("TracksEtaZvtx"), track.eta(), z); - if (midtracks.size() > 0 && retrack.ambDegree() > 0) { - registry.fill(HIST("Tracks/EtaZvtx_gt0"), track.eta(), z); - registry.fill(HIST("Tracks/2Danalysis/EtaZvtx_sel8_inelfwdgt0"), track.eta(), z); - eventsInelMFT.insert(retrack.bestCollisionId()); - } - if (retrack.ambDegree() != 0) { - registry.fill(HIST("Tracks/Control/woOrp/woOrpEtaZvtx_gt0"), track.eta(), z); - ++k; - } - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Tracks/Control/TrackCount"), 0); - registry.fill(HIST("TracksPhiEta"), phi, track.eta()); - registry.fill(HIST("TracksPtEta"), track.pt(), track.eta()); - if ((track.eta() < -2.0f) && (track.eta() > -3.9f)) { - registry.fill(HIST("TracksPhiZvtx"), phi, z); - } - if (track.collisionId() > -1 && retrack.ambDegree() == 1) { - registry.fill(HIST("Tracks/Control/TrackCount"), 8); - registry.fill(HIST("collisionID"), track.collisionId()); - } - if (track.collisionId() > -1 && retrack.ambDegree() > 1) { - registry.fill(HIST("collisionIDamb"), track.collisionId()); - } - if (track.collisionId() != retrack.bestCollisionId()) { - registry.fill(HIST("Tracks/Control/ReassignedTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/ReassignedTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/ReassignedVertexCorr"), - track.template collision_as().posZ(), z); - - registry.fill(HIST("Tracks/Control/DeltaZ"), - track.template collision_as().posZ() - - collision.posZ()); - registry.fill(HIST("Tracks/Control/TrackCount"), 1); - } - if (track.collisionId() == retrack.bestCollisionId()) { - registry.fill(HIST("Tracks/Control/notReassignedTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/notReassignedTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/notReassignedVertexCorr"), - track.template collision_as().posZ(), z); - registry.fill(HIST("Tracks/Control/TrackCount"), 2); - } - - registry.fill(HIST("Tracks/Control/TrackAmbDegree"), - retrack.ambDegree()); - registry.fill(HIST("Tracks/Control/DCAXY"), retrack.bestDCAXY()); - if constexpr (std::is_same_v>) { - registry.fill(HIST("Tracks/Control/DCAZ"), retrack.bestDCAZ()); - } - int isAmbiguous = 0; - - if (retrack.ambDegree() > 1 && retrack.ambDegree() != 0) { - isAmbiguous = 1; - ++i; - - registry.fill(HIST("Tracks/Control/amb/EtaZvtxAmb_gt0"), track.eta(), z); - - registry.fill(HIST("Tracks/Control/amb/AmbTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/amb/AmbTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/amb/AmbVertexCorr"), - track.template collision_as().posZ(), z); - registry.fill(HIST("Tracks/Control/amb/DCAxy_amb"), retrack.bestDCAXY()); - if constexpr (std::is_same_v>) { - registry.fill(HIST("Tracks/Control/amb/DCAz_amb"), retrack.bestDCAZ()); - } - registry.fill(HIST("Tracks/Control/TrackCount"), 3); - if (track.collisionId() == retrack.bestCollisionId()) { - registry.fill(HIST("Tracks/Control/TrackCount"), 5); - } - uniqueEventsAmb.insert(retrack.bestCollisionId()); - } - if (midtracks.size() > 0 && retrack.ambDegree() > 1 && retrack.ambDegree() != 0) { - uniqueCollisionsAmb.insert(collision.globalIndex()); - } - - registry.fill(HIST("Tracks/Control/TrackIsAmb"), isAmbiguous); - if (retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { - ++j; - registry.fill(HIST("Tracks/Control/nonamb/EtaZvtxNonAmb_gt0"), track.eta(), z); - registry.fill(HIST("Tracks/Control/nonamb/nonAmbTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/nonamb/nonAmbTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/nonamb/nonAmbVertexCorr"), - track.template collision_as().posZ(), z); - registry.fill(HIST("Tracks/Control/nonamb/DCAxy_nonamb"), retrack.bestDCAXY()); - if constexpr (std::is_same_v>) { - registry.fill(HIST("Tracks/Control/nonamb/DCAz_nonamb"), retrack.bestDCAZ()); - } - registry.fill(HIST("Tracks/Control/TrackCount"), 4); - if (track.collisionId() == retrack.bestCollisionId()) { - registry.fill(HIST("Tracks/Control/TrackCount"), 6); - } - uniqueEvents.insert(retrack.bestCollisionId()); - } - if (midtracks.size() > 0 && retrack.ambDegree() == 1 && retrack.ambDegree() != 0) { - uniqueCollisions.insert(collision.globalIndex()); - } - if ((retrack.ambDegree() > 1) || (retrack.ambDegree() <= 1)) - registry.fill(HIST("Tracks/Control/TrackCount"), 7); - if (retrack.ambDegree() != 0) { - registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksEtaZvtx"), - track.eta(), z); - registry.fill(HIST("Tracks/Control/woOrp/woOrpTracksPhiEta"), phi, - track.eta()); - registry.fill(HIST("Tracks/Control/woOrp/woOrpVertexCorr"), - track.template collision_as().posZ(), z); - registry.fill(HIST("Tracks/Control/TrackCount"), 9); // without orphan - registry.fill(HIST("Tracks/Control/woOrp/DCAxy_woOrp"), retrack.bestDCAXY()); - if constexpr (std::is_same_v>) { - registry.fill(HIST("Tracks/Control/woOrp/DCAz_woOrp"), retrack.bestDCAZ()); - } - } - } - } - registry.fill(HIST("ambEventCounts"), 1, uniqueEventsAmb.size()); - registry.fill(HIST("NonambEventCounts"), 1, uniqueEvents.size()); - registry.fill(HIST("hNumCollisionsNonAmb_InelMFT"), 1, uniqueCollisions.size()); - registry.fill(HIST("hNumCollisionsAmb_InelMFT"), 1, uniqueCollisionsAmb.size()); - registry.fill(HIST("hNumCollisions_InelMFT"), 1, eventsInelMFT.size()); - } - registry.fill(HIST("Tracks/Control/amb/nTrkAmb"), i); - registry.fill(HIST("Tracks/Control/nonamb/nTrkNonAmb"), j); - registry.fill(HIST("Tracks/Control/woOrp/nTrk"), k); - registry.fill(HIST("hNumCollisions_Inel"), 1, eventsInel.size()); - } - } else { - registry.fill(HIST("EventSelection"), 7); - } - } - - void processMultReassoc(CollwEv::iterator const& collision, - o2::aod::MFTTracks const& mft, - soa::SmallGroups const& retracks, - FiCentralTracks const& midtracks, aod::Tracks const& trk) - { - processMultReassocCommon(collision, mft, retracks, midtracks, trk); - } - - void processMultReassoc3d(CollwEv::iterator const& collision, - o2::aod::MFTTracks const& mft, - soa::SmallGroups const& retracks, - FiCentralTracks const& midtracks, aod::Tracks const& trk) - { - processMultReassocCommon(collision, mft, retracks, midtracks, trk); - } - PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc, - "Process reco or data info", false); - - PROCESS_SWITCH(PseudorapidityDensityMFT, processMultReassoc3d, - "Process reco or data info (3d)", false); - - using ExColsCent = soa::Join; - - void processCountingCentrality(ExColsCent::iterator const& collision, - aod::MFTTracks const& tracks) - { - auto c = collision.centFT0C(); - registry.fill(HIST("Events/Centrality/Selection"), 1., c); - - if (!useEvSel || collision.sel8()) { - auto z = collision.posZ(); - registry.fill(HIST("Events/Centrality/Selection"), 2., c); - auto perCollisionSample = sample->sliceByCached( - o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); - auto Ntrk = perCollisionSample.size(); - - registry.fill(HIST("Events/Centrality/NtrkZvtx"), Ntrk, z, c); - - for (const auto& track : tracks) { - - float phi = track.phi(); - o2::math_utils::bringTo02Pi(phi); - - if (usePhiCut) { - if ((phi < cfgPhiCut) || - ((phi > o2::constants::math::PI - cfgPhiCut) && (phi < o2::constants::math::PI + cfgPhiCut)) || - (phi > o2::constants::math::TwoPI - cfgPhiCut) || - ((phi > ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) - cfgPhiCut) && - (phi < ((o2::constants::math::PIHalf - 0.1) * o2::constants::math::PI) + cfgPhiCut))) - continue; - } - - registry.fill(HIST("Tracks/Centrality/EtaZvtx"), track.eta(), z, c); - registry.fill(HIST("Tracks/Centrality/PhiEta"), phi, track.eta(), c); - } - - } else { - registry.fill(HIST("Events/Centrality/Selection"), 3., - c); // rejected events - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processCountingCentrality, - "Count tracks in centrality bins", false); - - using Particles = soa::Filtered; - expressions::Filter primaries = - (aod::mcparticle::flags & - (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == - (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary; - Partition mcSample = nabs(aod::mcparticle::eta) < 1.1f; - Partition mcSampleCentral = - nabs(aod::mcparticle::eta) < estimatorEta; - - void processGen( - aod::McCollisions::iterator const& mcCollision, - o2::soa::SmallGroups> const& collisions, - Particles const& particles, aod::MFTTracks const& /*tracks*/, - FiCentralTracks const& midtracks) - { - registry.fill(HIST("EventEfficiency"), 1.); - - auto perCollisionMCSample = mcSample->sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - auto nCharged = 0; - for (const auto& particle : perCollisionMCSample) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { - continue; - } - nCharged++; - } - registry.fill(HIST("EventsNtrkZvtxGen_t"), nCharged, mcCollision.posZ()); - - //--------for INEL>0 - auto perCollisionMCSampleCentral = mcSampleCentral->sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - auto nChargedCentral = 0; - for (const auto& particle : perCollisionMCSample) { - auto charge = 0.; - auto p = pdg->GetParticle(particle.pdgCode()); - if (p != nullptr) { - charge = p->Charge(); - } - if (std::abs(charge) < 3.) { - continue; - } - nChargedCentral++; - } - if ((mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { - if (nChargedCentral > 0) { - registry.fill(HIST("EventEfficiency"), 2.); - registry.fill(HIST("EventsNtrkZvtxGen_gt0t"), nCharged, - mcCollision.posZ()); - } - } - //----------- - bool atLeastOne = false; - bool atLeastOne_gt0 = false; - int moreThanOne = 0; - - LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), - collisions.size()); - for (const auto& collision : collisions) { - registry.fill(HIST("EventEfficiency"), 3.); - if (!disableITSROFCut && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { - return; - } - if (!useEvSel || (useEvSel && collision.selection_bit(aod::evsel::kIsTriggerTVX) && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoSameBunchPileup))) { - atLeastOne = true; - auto perCollisionSample = sample->sliceByCached( - o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); - - registry.fill(HIST("EventEfficiency"), 4.); - - auto perCollisionSampleCentral = - midtracks.sliceBy(perColCentral, collision.globalIndex()); - if ((collision.posZ() >= cfgVzCut1) && (collision.posZ() <= cfgVzCut2) && (mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { - if (perCollisionSampleCentral.size() > 0) { - registry.fill(HIST("EventEfficiency"), 5.); - atLeastOne_gt0 = true; - registry.fill(HIST("EventsNtrkZvtxGen_gt0"), - perCollisionSample.size(), collision.posZ()); - } - - registry.fill(HIST("EventsZposDiff"), - collision.posZ() - mcCollision.posZ()); - if (useZDiffCut) { - if (std::abs(collision.posZ() - mcCollision.posZ()) > maxZDiff) { - continue; - } - } - registry.fill(HIST("EventsNtrkZvtxGen"), perCollisionSample.size(), - collision.posZ()); - ++moreThanOne; - } - } - } - if (collisions.size() == 0) { - registry.fill(HIST("NotFoundEventZvtx"), mcCollision.posZ()); - } - if (moreThanOne > 1) { - registry.fill(HIST("EventsSplitMult"), nCharged); - } - if ((mcCollision.posZ() >= cfgVzCut1) && (mcCollision.posZ() <= cfgVzCut2)) { - for (const auto& particle : particles) { - auto p = pdg->GetParticle(particle.pdgCode()); - auto charge = 0; - if (p != nullptr) { - charge = static_cast(p->Charge()); - } - if (std::abs(charge) < 3.) { - continue; - } - float phi = particle.phi(); - o2::math_utils::bringTo02Pi(phi); - if (usePhiCut) { - if ((phi <= 0.02) || ((phi >= 3.10) && (phi <= 3.23)) || (phi >= 6.21)) - continue; - } - if (cfgnEta1 < particle.eta() && particle.eta() < cfgnEta2 && (phi > cfgPhiCut1 && phi < cfgPhiCut2)) { - // Purity numerator reference at generator level: physical primaries in the same eta window - if (particle.isPhysicalPrimary()) { - registry.fill(HIST("Purity/Gen/PrimaryEta"), particle.eta()); - // Truth-side total counters for primaries in acceptance (for purity calculations) - registry.fill(HIST("Purity/Gen/All"), 1.); - registry.fill(HIST("Purity/Gen/AllEta"), particle.eta()); - } - registry.fill(HIST("TracksEtaZvtxGen_t"), particle.eta(), - mcCollision.posZ()); - if (perCollisionMCSampleCentral.size() > 0) { - registry.fill(HIST("TracksEtaZvtxGen_gt0t"), particle.eta(), - mcCollision.posZ()); - registry.fill(HIST("TracksPhiEtaGen_gt0t"), particle.phi(), particle.eta()); - } - if (atLeastOne) { - registry.fill(HIST("TracksEtaZvtxGen"), particle.eta(), - mcCollision.posZ()); - registry.fill(HIST("TracksPtEtaGen"), particle.pt(), particle.eta()); - if (atLeastOne_gt0) { - registry.fill(HIST("TracksEtaZvtxGen_gt0"), particle.eta(), - mcCollision.posZ()); - registry.fill(HIST("TracksPhiEtaGen_gt0"), particle.phi(), particle.eta()); - } - } - - registry.fill(HIST("TracksPhiEtaGen"), particle.phi(), particle.eta()); - registry.fill(HIST("TracksPhiZvtxGen"), particle.phi(), - mcCollision.posZ()); - registry.fill(HIST("TracksPtEtaGen_t"), particle.pt(), particle.eta()); - } - } - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processGen, - "Process generator-level info", false); - - using ExColsGenCent = - soa::SmallGroups>; - - void processGenCent(aod::McCollisions::iterator const& mcCollision, - ExColsGenCent const& collisions, - Particles const& particles, - MFTTracksLabeled const& /*tracks*/) - { - - LOGP(debug, "MC col {} has {} reco cols", mcCollision.globalIndex(), - collisions.size()); - - float c_gen = -1; - bool atLeastOne = false; - for (const auto& collision : collisions) { - float c_rec = -1; - if constexpr (ExColsGenCent::template contains()) { - c_rec = collision.centFT0C(); - } - if (!useEvSel || (useEvSel && collision.sel8())) { - if constexpr (ExColsGenCent::template contains()) { - if (!atLeastOne) { - c_gen = c_rec; - } - } - atLeastOne = true; - - registry.fill(HIST("Events/Centrality/EventEfficiency"), 2., c_gen); - registry.fill(HIST("Events/Centrality/CentPercentileMCGen"), c_gen); - - auto perCollisionSample = sample->sliceByCached( - o2::aod::fwdtrack::collisionId, collision.globalIndex(), cache); - registry.fill(HIST("Events/Centrality/NtrkZvtxGen"), - perCollisionSample.size(), collision.posZ(), c_gen); - } - } - - registry.fill(HIST("Events/Centrality/EventEfficiency"), 1., c_gen); - - auto perCollisionMCSample = mcSample->sliceByCached( - aod::mcparticle::mcCollisionId, mcCollision.globalIndex(), cache); - auto nCharged = 0; - - for (const auto& particle : perCollisionMCSample) { - auto p = pdg->GetParticle(particle.pdgCode()); - auto charge = 0; - if (p != nullptr) { - charge = static_cast(p->Charge()); - } - if (std::abs(charge) < 3.) { - continue; - } - nCharged++; - } - - if constexpr (ExColsGenCent::template contains()) { - registry.fill(HIST("Events/Centrality/NtrkZvtxGen_t"), nCharged, - mcCollision.posZ(), c_gen); - } - - for (const auto& particle : particles) { - auto p = pdg->GetParticle(particle.pdgCode()); - auto charge = 0; - if (p != nullptr) { - charge = static_cast(p->Charge()); - } - if (std::abs(charge) < 3.) { - continue; - } - - if constexpr (ExColsGenCent::template contains()) { - registry.fill(HIST("Tracks/Centrality/EtaZvtxGen_t"), particle.eta(), - mcCollision.posZ(), c_gen); - } - - if (atLeastOne) { - if constexpr (ExColsGenCent::template contains()) { - registry.fill(HIST("Tracks/Centrality/EtaZvtxGen"), particle.eta(), - mcCollision.posZ(), c_gen); - float phi = particle.phi(); - o2::math_utils::bringTo02Pi(phi); - registry.fill(HIST("Tracks/Centrality/PhiEtaGen"), phi, - particle.eta(), c_gen); - } - } - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processGenCent, - "Process generator-level info in centrality bins", false); - - void processGenPt( - soa::Join::iterator const& collision, - MFTTracksLabeled const& tracks, aod::McParticles const&) - { - if (!useEvSel || (useEvSel && collision.sel8())) { - for (const auto& track : tracks) { - if (!track.has_mcParticle()) { - continue; - } - auto particle = track.mcParticle(); - if (!particle.isPhysicalPrimary()) { - continue; - } - registry.fill(HIST("TracksToPartPtEta"), particle.pt(), particle.eta()); - } - } - } - - PROCESS_SWITCH(PseudorapidityDensityMFT, processGenPt, - "Process particle-level info of pt", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index 32f9cca29d8..f86828f6cea 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -50,10 +50,12 @@ #include "TEfficiency.h" #include "THashList.h" -#include "TPDGCode.h" #include #include #include +#include +#include +#include #include #include @@ -72,7 +74,9 @@ using namespace o2::constants::math; using namespace o2::aod::rctsel; auto static constexpr CminCharge = 3.f; +static constexpr float CnullInt = 0; static constexpr float Cnull = 0.0f; +static constexpr float ConeInt = 1; static constexpr float Cone = 1.0f; // FV0 specific constants @@ -83,6 +87,10 @@ static constexpr float Cfv0IndexPhi[5] = {0., 8., 16., 24., 32.}; static constexpr float CmaxEtaFV0 = 5.1; static constexpr float CminEtaFV0 = 2.2; static constexpr float CdEtaFV0 = (CmaxEtaFV0 - CminEtaFV0) / CmaxRingsFV0; +auto static constexpr CminAccFT0A = 3.5f; +auto static constexpr CmaxAccFT0A = 4.9f; +auto static constexpr CminAccFT0C = -3.3f; +auto static constexpr CmaxAccFT0C = -2.1f; // PID names static constexpr int CprocessIdWeak = 4; static constexpr int Ncharges = 2; @@ -92,7 +100,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/"}; @@ -104,20 +111,30 @@ 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 = "/hdEdxMcRecPrim"; +static constexpr std::string_view CdEdxMcRecPrimF = "Tracks/{}/hdEdxMcRecPrim"; +static constexpr std::string_view CpTvsDCAxy = "/hPtVsDCAxy"; +static constexpr std::string_view CpTvsDCAxyF = "Tracks/{}/hPtVsDCAxy"; +static constexpr std::string_view CpTvsDCAxyAll = "/hPtVsDCAxyAll"; +static constexpr std::string_view CpTvsDCAxyAllF = "Tracks/{}/hPtVsDCAxyAll"; +static constexpr std::string_view CpTvsDCAxyPrimAll = "/hPtVsDCAxyRecPrimAll"; +static constexpr std::string_view CpTvsDCAxyPrimAllF = "Tracks/{}/hPtVsDCAxyRecPrimAll"; +static constexpr std::string_view CpTvsDCAxyWeakAll = "/hPtVsDCAxyRecWeakAll"; +static constexpr std::string_view CpTvsDCAxyWeakAllF = "Tracks/{}/hPtVsDCAxyRecWeakAll"; +static constexpr std::string_view CpTvsDCAxyMatAll = "/hPtVsDCAxyRecMatAll"; +static constexpr std::string_view CpTvsDCAxyMatAllF = "Tracks/{}/hPtVsDCAxyRecMatAll"; static constexpr std::string_view CpTgenPrimSgn = "/hPtGenPrimSgn"; static constexpr std::string_view CpTgenPrimSgnF = "Tracks/{}/hPtGenPrimSgn"; -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"; +static constexpr std::string_view CpTmcClosureGenPrim = "/hPtMCclosureGenPrim"; +static constexpr std::string_view CpTmcClosureGenPrimF = "Tracks/{}/hPtMCclosureGenPrim"; +static constexpr std::string_view CpTmcClosureRec = "/hPtMCclosureRec"; +static constexpr std::string_view CpTmcClosureRecF = "Tracks/{}/hPtMCclosureRec"; +static constexpr std::string_view CpTeffPrimRecEvt = "/hPtEffPrimRecEvt"; +static constexpr std::string_view CpTeffPrimRecEvtF = "Tracks/{}/hPtEffPrimRecEvt"; +static constexpr std::string_view CpTeffGenPrimRecEvt = "/hPtEffGenPrimRecEvt"; +static constexpr std::string_view CpTeffGenPrimRecEvtF = "Tracks/{}/hPtEffGenPrimRecEvt"; enum PidType { kEl = 0, @@ -191,31 +208,29 @@ struct MultE { std::array rhoLatticeFV0{0}; std::array fv0AmplitudeWoCalib{0}; - -std::array, NpartChrg> hPtEffRecPrim{}; -std::array, NpartChrg> hPtEffRecWeak{}; -std::array, NpartChrg> hPtEffRecMat{}; +std::array, NpartChrg> hPtGenRecEvt{}; +std::array, NpartChrg> hPtGenPrimRecEvt{}; std::array, NpartChrg> hPtEffRec{}; std::array, NpartChrg> hPtEffGen{}; -std::array, NpartChrg> hPtGenRecEvt{}; -std::array, NpartChrg> hPtGenPrimRecEvt{}; -std::array, NpartChrg> hPtEffGenPrim{}; -std::array, NpartChrg> hPtEffGenWeak{}; -std::array, NpartChrg> hPtEffGenMat{}; -std::array, NpartChrg> hPtVsDCAxyPrim{}; -std::array, NpartChrg> hPtVsDCAxyWeak{}; -std::array, NpartChrg> hPtVsDCAxyMat{}; -std::array, NpartChrg> hDCAxyBadCollPrim{}; -std::array, NpartChrg> hDCAxyBadCollWeak{}; -std::array, NpartChrg> hDCAxyBadCollMat{}; -std::array, NpartChrg> hPtNsigmaTPC{}; -std::array, NpartChrg> hThPtNsigmaTPC{}; -std::array, NpartChrg> hPtNsigmaTOF{}; -std::array, NpartChrg> hPtNsigmaTPCTOF{}; +std::array, NpartChrg> hPtEffRecGoodCollPrim{}; +std::array, NpartChrg> hPtEffRecGoodCollWeak{}; +std::array, NpartChrg> hPtEffRecGoodCollMat{}; +std::array, NpartChrg> hPtEffGenPrim{}; +std::array, NpartChrg> hPtEffGenWeak{}; +std::array, NpartChrg> hPtEffGenMat{}; +std::array, NpartChrg> hDCAxyRecBadCollPrim{}; +std::array, NpartChrg> hDCAxyRecBadCollWeak{}; +std::array, NpartChrg> hDCAxyRecBadCollMat{}; +std::array, NpartChrg> hPtVsDCAxyRecGoodCollPrim{}; +std::array, NpartChrg> hPtVsDCAxyRecGoodCollWeak{}; +std::array, NpartChrg> hPtVsDCAxyRecGoodCollMat{}; struct FlattenictyPikp { - HistogramRegistry flatchrg{"flatchrg", {}, OutputObjHandlingPolicy::AnalysisObject, true, false}; + HistogramRegistry registryData{"registryData", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry registryMC{"registryMC", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry registryQC{"registryQC", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + OutputObj listEfficiency{"Efficiency"}; Service pdg; @@ -231,9 +246,10 @@ 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 cfgFillNsigmaQAHist{"cfgFillNsigmaQAHist", false, "fill nsigma QA histograms"}; + Configurable cfgFillDCAxyHist{"cfgFillDCAxyHist", false, "fill nsigma QA histograms"}; Configurable cfgFillV0Hist{"cfgFillV0Hist", false, "fill V0 histograms"}; Configurable cfgFillChrgType{"cfgFillChrgType", false, "fill histograms per charge types"}; Configurable cfgFillChrgTypeV0s{"cfgFillChrgTypeV0s", false, "fill V0s histograms per charge types"}; @@ -261,26 +277,23 @@ struct FlattenictyPikp { Configurable cfgRemoveNoTimeFrameBorder{"cfgRemoveNoTimeFrameBorder", false, "Bunch crossing is far from Time Frame borders"}; Configurable cfgRemoveITSROFrameBorder{"cfgRemoveITSROFrameBorder", false, "Bunch crossing is far from ITS RO Frame border"}; Configurable cfgCutVtxZ{"cfgCutVtxZ", 10.0f, "Accepted z-vertex range"}; - Configurable cfgINELCut{"cfgINELCut", true, "INEL event selection"}; Configurable cfgRemoveNoSameBunchPileup{"cfgRemoveNoSameBunchPileup", true, "Reject collisions in case of pileup with another collision in the same foundBC"}; Configurable cfgRequireIsGoodZvtxFT0vsPV{"cfgRequireIsGoodZvtxFT0vsPV", true, "Small difference between z-vertex from PV and from FT0"}; Configurable cfgRequireIsVertexITSTPC{"cfgRequireIsVertexITSTPC", false, "At least one ITS-TPC track (reject vertices built from ITS-only tracks)"}; Configurable cfgRequirekIsVertexTOFmatched{"cfgRequirekIsVertexTOFmatched", false, "Require kIsVertexTOFmatched: at least one of vertex contributors is matched to TOF"}; + Configurable useMultMCmidrap{"useMultMCmidrap", true, "use generated Nch in ∣eta∣ < 0.8"}; + Configurable cfgUseInelgt0wTVX{"cfgUseInelgt0wTVX", true, "Use INEL > 0 condition with TVX trigger, i.e. FT0A and FT0C acceptance"}; } evtSelOpt; struct : ConfigurableGroup { - Configurable useFlatData{"useFlatData", true, "use flattenicity from rec collisions"}; - } flatSelOpt; - - struct : ConfigurableGroup { - 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 axisPt{"axisPt", {VARIABLE_WIDTH, 0, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1, 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.2, 3.4, 3.6, 3.8, 4, 4.4, 4.8, 5.2, 5.6, 6, 6.5, 7, 7.5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30}, "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.2, 2.4, 2.6, 2.8, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.4, 4.8, 5.2, 5.6, 6, 6.4, 6.8, 7.2, 7.6, 8, 8.4, 8.8, 9.2, 9.6, 10, 10.5, 11, 11.5, 12, 12.5, 13, 13.5, 14, 14.5, 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"}; - ConfigurableAxis axisDCAz{"axisDCAz", {200, -5, 5}, "DCAz binning"}; + ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -5., 5.}, "DCAxy binning"}; + ConfigurableAxis axisDCAz{"axisDCAz", {200, -5., 5.}, "DCAz binning"}; ConfigurableAxis axisPhi = {"axisPhi", {60, 0, constants::math::TwoPI}, "#varphi binning"}; ConfigurableAxis axisPhiMod = {"axisPhiMod", {100, 0, constants::math::PI / 9}, "fmod(#varphi,#pi/9)"}; ConfigurableAxis axisEta = {"axisEta", {50, -1.0, 1.0}, "#eta binning"}; @@ -312,6 +325,7 @@ struct FlattenictyPikp { Configurable cfgDeDxMIPMax{"cfgDeDxMIPMax", 60.0f, "Maximum range of MIP dedx"}; Configurable cfgDeDxMIPMin{"cfgDeDxMIPMin", 40.0f, "Maximum range of MIP dedx"}; Configurable cfgNsigmaMax{"cfgNsigmaMax", 100.0f, "Maximum range of nsgima for tracks"}; + Configurable cfgDcaNsigmaCombinedMax{"cfgDcaNsigmaCombinedMax", 3.0f, "Maximum range of combined nsgima of tracks for DCA"}; Configurable cfgMomSelPiTOF{"cfgMomSelPiTOF", 0.4f, "Minimum momentum cut for TOF pions"}; Configurable cfgNsigSelKaTOF{"cfgNsigSelKaTOF", 3.0f, "Nsigma cut for TOF kaons"}; Configurable cfgBetaPlateuMax{"cfgBetaPlateuMax", 0.1f, "Beta max for Plateau electrons"}; @@ -321,8 +335,6 @@ struct FlattenictyPikp { // common selection Configurable cfgV0TypeSel{"cfgV0TypeSel", 1, "select on a certain V0 type (leave negative if no selection desired)"}; Configurable cfgV0Ymax{"cfgV0Ymax", 0.5f, "Maximum rapidity of V0s"}; - Configurable cfgPtDaughterMin{"cfgPtDaughterMin", 0.1f, "minimum pT of the V0 daughter tracks"}; - Configurable cfgPtDaughterMax{"cfgPtDaughterMax", 20.0f, "maximum pT of the V0 daughter tracks"}; Configurable cfgRejectV0sAtTPCSector{"cfgRejectV0sAtTPCSector", true, "Reject V0s close to the TPC sector boundaries"}; Configurable cfgRequireITS{"cfgRequireITS", true, "Additional cut on the ITS requirement"}; Configurable cfgNsigmaElTPC{"cfgNsigmaElTPC", 5.0, "max nsigma of TPC for electorn"}; @@ -402,10 +414,12 @@ struct FlattenictyPikp { TrackSelection selTrkGlobal; Configurable isCustomTracks{"isCustomTracks", true, "Use custom track cuts"}; - Configurable minPt{"minPt", 0.15f, "Set minimum pT of tracks"}; - Configurable maxPt{"maxPt", 20.0f, "Set maximum pT of tracks"}; + Configurable minPt{"minPt", 0.1f, "Set minimum pT of tracks"}; + Configurable maxPt{"maxPt", 1e10f, "Set maximum pT of tracks"}; Configurable requireEta{"requireEta", 0.8f, "Set eta range of tracks"}; Configurable setITSreq{"setITSreq", 0, "0 = Run3ITSibAny, 1 = Run3ITSallAny, 2 = Run3ITSall7Layers, 3 = Run3ITSibTwo"}; + Configurable requireITSminCl{"requireITSminCl", false, "Require additional cut on ITS clusters"}; + Configurable setITSminCl{"setITSminCl", 7, "Additional cut on ITS clusters"}; 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"}; @@ -501,6 +515,9 @@ struct FlattenictyPikp { selTrkGlobal.SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC.value); selTrkGlobal.SetMaxChi2PerClusterITS(maxChi2PerClusterITS.value); selTrkGlobal.SetMinNClustersITS(minITSnClusters.value); + if (requireITSminCl.value) { + selTrkGlobal.SetRequireHitsInITSLayers(setITSminCl.value, {0, 1, 2, 3, 4, 5, 6}); + } selTrkGlobal.SetMinNCrossedRowsTPC(minNCrossedRowsTPC.value); selTrkGlobal.SetMinNCrossedRowsOverFindableClustersTPC(minNCrossedRowsOverFindableClustersTPC.value); // // selTrkGlobal.SetMaxDcaXYPtDep([](float pt) { return 0.0105f + 0.0350f / pow(pt, 1.1f); }); @@ -513,6 +530,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"}; @@ -545,219 +563,254 @@ struct FlattenictyPikp { LOG(fatal) << "No valid option for mult estimator " << multEst; } - // Event counter - flatchrg.add("Events/hEvtSel", "Number of events; Cut; #Events Passed Cut", {kTH1F, {{nEvtSel, 0, nEvtSel}}}); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelAll + 1, "Events read"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelSel8 + 1, "Evt. sel8"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelNoITSROFrameBorder + 1, "NoITSROFrameBorder"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkNoTimeFrameBorder + 1, "NoTimeFrameBorder"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkNoSameBunchPileup + 1, "NoSameBunchPileup"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsGoodZvtxFT0vsPV + 1, "IsGoodZvtxFT0vsPV"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsVertexITSTPC + 1, "IsVertexITSTPC"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsVertexTOFmatched + 1, "IsVertexTOFmatched"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelVtxZ + 1, "Vtx-z pos"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelINELgt0 + 1, "INEL>0"); - flatchrg.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelRCTFlagChecker + 1, "RCT Flag Checker"); - // Track counter - flatchrg.add("Tracks/hTrkSel", "Number of tracks; Cut; #Tracks Passed Cut", {kTH1F, {{nTrkSel, 0, nTrkSel}}}); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelAll + 1, "All"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelEta + 1, "Eta"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPt + 1, "Pt"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelDCA + 1, "DCA"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkNRowsTPC + 1, "trkNRowsTPC"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNClsFound + 1, "NClsTPCFound"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNClsPID + 1, "NClsTPCPid"); - flatchrg.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelTPCBndr + 1, "TPC Boundary"); - // V0 counter - flatchrg.add("Tracks/V0qa/hV0Sel", "Number of V0s; Cut; #Tracks Passed Cut", {kTH1F, {{nV0Sel, 0, nV0Sel}}}); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelAll + 1, "All"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelRejectSameSign + 1, "Reject same sign"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelRejectV0sAtTPCSector + 1, "Reject V0s at TPC sector"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelCosPA + 1, "Cos PA"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelV0radius + 1, "V0 radius"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDCAposToPV + 1, "DCA pos to PV"); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDaughters + 1, "V0 daughters' sel."); - flatchrg.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDCAv0daughter + 1, "DCA v0 daughter"); - if (trkSelOpt.cfgRejectTrkAtTPCSector || v0SelOpt.cfgRejectV0sAtTPCSector) { fPhiCutLow = new TF1("fPhiCutLow", trkSelOpt.cfgGeoTrkCutMin.value.c_str(), 0, 100); fPhiCutHigh = new TF1("fPhiCutHigh", trkSelOpt.cfgGeoTrkCutMax.value.c_str(), 0, 100); } + registryQC.add("Events/hVtxZ", "Measured vertex z position", kTH1F, {vtxzAxis}); + + // Event counter + registryQC.add("Events/hEvtSel", "Number of events; Cut; #Events Passed Cut", {kTH1F, {{nEvtSel, 0, nEvtSel}}}); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelAll + 1, "Events read"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelSel8 + 1, "Evt. sel8"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelNoITSROFrameBorder + 1, "NoITSROFrameBorder"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkNoTimeFrameBorder + 1, "NoTimeFrameBorder"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkNoSameBunchPileup + 1, "NoSameBunchPileup"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsGoodZvtxFT0vsPV + 1, "IsGoodZvtxFT0vsPV"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsVertexITSTPC + 1, "IsVertexITSTPC"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelkIsVertexTOFmatched + 1, "IsVertexTOFmatched"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelVtxZ + 1, "Vtx-z pos"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelINELgt0 + 1, "INEL>0"); + registryQC.get(HIST("Events/hEvtSel"))->GetXaxis()->SetBinLabel(evtSelRCTFlagChecker + 1, "RCT Flag Checker"); + // FV0 QA + registryQC.add("FV0/hFV0AmplWCalib", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); + registryQC.add("FV0/hFV0AmplvsVtxzWoCalib", "", {kTH2F, {vtxzAxis, amplitudeFV0Sum}}); + registryQC.add("FV0/hFV0AmplvsVtxzCalib", "", {kTH2F, {vtxzAxis, amplitudeFV0Sum}}); + registryQC.add("FV0/hFV0amp", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); + registryQC.add("FV0/pFV0amp", "", kTProfile, {channelFV0Axis}); + registryQC.add("FV0/hFV0ampCorr", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); + + LOG(info) << "Size of the QC histograms:"; + registryQC.print(); + if (doprocessFlat) { - 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 || cfgFillNsigmaQAHist) { + // Track counter + registryData.add("Tracks/hTrkSel", "Number of tracks; Cut; #Tracks Passed Cut", {kTH1F, {{nTrkSel, 0, nTrkSel}}}); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelAll + 1, "All"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelEta + 1, "Eta"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelPt + 1, "Pt"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelDCA + 1, "DCA"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkNRowsTPC + 1, "trkNRowsTPC"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNClsFound + 1, "NClsTPCFound"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelNClsPID + 1, "NClsTPCPid"); + registryData.get(HIST("Tracks/hTrkSel"))->GetXaxis()->SetBinLabel(trkSelTPCBndr + 1, "TPC Boundary"); + // V0 counter + registryData.add("Tracks/V0qa/hV0Sel", "Number of V0s; Cut; #Tracks Passed Cut", {kTH1F, {{nV0Sel, 0, nV0Sel}}}); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelAll + 1, "All"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelRejectSameSign + 1, "Reject same sign"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelRejectV0sAtTPCSector + 1, "Reject V0s at TPC sector"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelCosPA + 1, "Cos PA"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelV0radius + 1, "V0 radius"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDCAposToPV + 1, "DCA pos to PV"); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDaughters + 1, "V0 daughters' sel."); + registryData.get(HIST("Tracks/V0qa/hV0Sel"))->GetXaxis()->SetBinLabel(v0SelDCAv0daughter + 1, "DCA v0 daughter"); + + registryData.add("Events/hFlatVsMultEst", "hFlatVsMultEst", kTH2F, {flatAxis, multAxis}); + registryData.add("Tracks/postSel/hPVsPtEta", "; #it{p} (GeV/#it{c}); #it{p}_{T} (GeV/#it{c}); #eta;", {kTH3F, {pAxis, ptAxis, etaAxis}}); + if (cfgFillNclVsPhiCutQaHist || cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { + if (cfgFillNclVsPhiCutQaHist) { + registryData.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); + registryData.add("Tracks/postSel/hPtPhiNclTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + registryData.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + registryData.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); + registryData.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); + } if (cfgFillTrackQaHist) { - 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}); + registryData.add("Tracks/postSel/hShTpcClvsPt", "", {kTH2F, {ptAxis, shCluserAxis}}); + registryData.add("Tracks/postSel/hNclTPCFoundvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/hNClTPCPidvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/hNclTPCFoundvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/hNClTPCPidvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); + registryData.add("Tracks/postSel/hTPCCluster", "N_{cluster}", kTH1F, {clTpcAxis}); + registryData.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); + registryData.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); + registryData.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); + registryData.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); + registryData.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); + registryData.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/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}}); - 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/hTPCCluster", "N_{cluster}", kTH1F, {clTpcAxis}); - 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}}); + registryData.add("Tracks/postSel/hTPCnClsShared", " ; # shared TPC clusters TPC", kTH1F, {{165, -0.5, 164.5}}); + registryData.add("Tracks/postSel/hTPCcrossedRows", " ; # crossed TPC rows", kTH1F, {{165, -0.5, 164.5}}); + registryData.add("Tracks/postSel/hTPCcrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", kTH1F, {{60, 0.7, 1.3}}); // its - flatchrg.add("Tracks/postSel/hITSnCls", " ; # ITS clusters", kTH1F, {{8, -0.5, 7.5}}); - flatchrg.add("Tracks/postSel/hChi2ITSTrkSegment", "chi2ITS", kTH1F, {{100, -0.5, 99.5}}); + registryData.add("Tracks/postSel/hITSnCls", " ; # ITS clusters", kTH1F, {{8, -0.5, 7.5}}); + registryData.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}}); - } + registryData.add("Tracks/postSel/hTOFPvsBeta", "Beta from TOF; #it{p} (GeV/#it{c}); #beta", {kTH2F, {pAxis, {120, 0.0, 1.2}}}); + registryData.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); } if (cfgFilldEdxQaHist) { if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postCalib/all/hMIP", "; mult; flat; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {kTHnSparseF, {multAxis, flatAxis, etaAxis, dEdxAxis}}); - flatchrg.add("Tracks/postCalib/all/hPlateau", "; mult; flat; #eta; #LT dE/dx #GT_{Plateau, primary tracks};", {kTHnSparseF, {multAxis, flatAxis, etaAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/hMIP", "; mult; flat; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {kTHnSparseF, {multAxis, flatAxis, etaAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/hPlateau", "; mult; flat; #eta; #LT dE/dx #GT_{Plateau, primary tracks};", {kTHnSparseF, {multAxis, flatAxis, etaAxis, dEdxAxis}}); } else { - flatchrg.add("Tracks/postCalib/all/hMIP", "; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {kTH2F, {etaAxis, dEdxAxis}}); - flatchrg.add("Tracks/postCalib/all/hPlateau", "; #eta; #LT dE/dx #GT_{Plateau, primary tracks};", {kTH2F, {etaAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/hMIP", "; #eta; #LT dE/dx #GT_{MIP, primary tracks};", {kTH2F, {etaAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/hPlateau", "; #eta; #LT dE/dx #GT_{Plateau, primary tracks};", {kTH2F, {etaAxis, dEdxAxis}}); } - flatchrg.add("Tracks/postCalib/all/hMIPVsPhi", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks};", {kTH2F, {phiAxis, dEdxAxis}}); - flatchrg.add("Tracks/postCalib/all/pMIPVsPhi", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks};", {kTProfile, {phiAxis}}); - flatchrg.add("Tracks/postCalib/all/hMIPVsPhiVsEta", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks}; #eta;", {kTH3F, {phiAxis, dEdxAxis, etaAxis}}); - flatchrg.add("Tracks/postCalib/all/hPlateauVsPhi", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks};", {kTH2F, {phiAxis, dEdxAxis}}); - flatchrg.add("Tracks/postCalib/all/pPlateauVsPhi", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks};", {kTProfile, {phiAxis}}); - flatchrg.add("Tracks/postCalib/all/hPlateauVsPhiVsEta", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks}; #eta;", {kTH3F, {phiAxis, dEdxAxis, etaAxis}}); - flatchrg.addClone("Tracks/postCalib/all/", "Tracks/preCalib/all/"); + registryData.add("Tracks/postCalib/all/hMIPVsPhi", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks};", {kTH2F, {phiAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/pMIPVsPhi", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks};", {kTProfile, {phiAxis}}); + registryData.add("Tracks/postCalib/all/hMIPVsPhiVsEta", "; #varphi; #LT dE/dx #GT_{MIP, primary tracks}; #eta;", {kTH3F, {phiAxis, dEdxAxis, etaAxis}}); + registryData.add("Tracks/postCalib/all/hPlateauVsPhi", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks};", {kTH2F, {phiAxis, dEdxAxis}}); + registryData.add("Tracks/postCalib/all/pPlateauVsPhi", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks};", {kTProfile, {phiAxis}}); + registryData.add("Tracks/postCalib/all/hPlateauVsPhiVsEta", "; #varphi; #LT dE/dx #GT_{Plateau, primary tracks}; #eta;", {kTH3F, {phiAxis, dEdxAxis, etaAxis}}); + registryData.addClone("Tracks/postCalib/all/", "Tracks/preCalib/all/"); if (cfgFillChrgType) { - flatchrg.addClone("Tracks/postCalib/all/", "Tracks/postCalib/pos/"); - flatchrg.addClone("Tracks/postCalib/all/", "Tracks/postCalib/neg/"); - flatchrg.addClone("Tracks/preCalib/all/", "Tracks/preCalib/pos/"); - flatchrg.addClone("Tracks/preCalib/all/", "Tracks/preCalib/neg/"); + registryData.addClone("Tracks/postCalib/all/", "Tracks/postCalib/pos/"); + registryData.addClone("Tracks/postCalib/all/", "Tracks/postCalib/neg/"); + registryData.addClone("Tracks/preCalib/all/", "Tracks/preCalib/pos/"); + registryData.addClone("Tracks/preCalib/all/", "Tracks/preCalib/neg/"); } } - if (cfgFillNsigmaQAHist) { - for (int i = 0; i < NpartChrg; i++) { - const std::string strID = Form("/%s/%s", (i < Npart) ? "pos" : "neg", Pid[i % Npart]); - if (cfgStoreThnSparse) { - hThPtNsigmaTPC[i] = flatchrg.add("Tracks/hThPtNsigmaTPC" + strID, " ; p_{T} (GeV/c)", kTHnSparseF, {ptAxis, nSigmaTPCAxis, multAxis, flatAxis}); - } else { - hPtNsigmaTPC[i] = flatchrg.add("Tracks/hPtNsigmaTPC" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, nSigmaTPCAxis}); - } - hPtNsigmaTOF[i] = flatchrg.add("Tracks/hPtNsigmaTOF" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, nSigmaTOFAxis}); - hPtNsigmaTPCTOF[i] = flatchrg.add("Tracks/hPtNsigmaTPCTOF" + strID, PidChrg[i], kTH2F, {nSigmaTPCAxis, nSigmaTOFAxis}); + if (cfgFillDCAxyHist) { + for (int i = 0; i < Npart; i++) { + registryData.add({fmt::format(CpTvsDCAxyF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); } } } - flatchrg.addClone("Tracks/postSel/", "Tracks/preSel/"); - // FV0 QA - flatchrg.add("FV0/hFV0AmplWCalib", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); - flatchrg.add("FV0/hFV0AmplvsVtxzWoCalib", "", {kTH2F, {vtxzAxis, amplitudeFV0Sum}}); - flatchrg.add("FV0/hFV0AmplvsVtxzCalib", "", {kTH2F, {vtxzAxis, amplitudeFV0Sum}}); - flatchrg.add("FV0/hFV0amp", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); - flatchrg.add("FV0/pFV0amp", "", kTProfile, {channelFV0Axis}); - flatchrg.add("FV0/hFV0ampCorr", "", {kTH2F, {channelFV0Axis, amplitudeFV0}}); + registryData.addClone("Tracks/postSel/", "Tracks/preSel/"); // V0's QA - flatchrg.add("Tracks/V0qa/hV0Pt", "pT", kTH1F, {ptAxisV0s}); - flatchrg.add("Tracks/V0qa/hV0ArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); + registryData.add("Tracks/V0qa/hV0Pt", "pT", kTH1F, {ptAxisV0s}); + registryData.add("Tracks/V0qa/hV0ArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); // daughters' QA - flatchrg.add("Tracks/V0qa/el/Ga/hArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); - flatchrg.add("Tracks/V0qa/pi/K0s/hArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); - flatchrg.add("Tracks/V0qa/el/Ga/hNclVsEta", ";#eta; #it{N}^{TPC}_cl", kTH2F, {etaAxis, clTpcAxis}); - flatchrg.add("Tracks/V0qa/pi/K0s/hNclVsEta", ";#eta; #it{N}^{TPC}_cl", kTH2F, {etaAxis, clTpcAxis}); - flatchrg.add("Tracks/V0qa/el/Ga/hdEdxMIPVsEta", ";#eta; dE/dx", kTH2F, {etaAxis, dEdxAxis}); - flatchrg.add("Tracks/V0qa/pi/K0s/hdEdxMIPVsEta", ";#eta; dE/dx", kTH2F, {etaAxis, dEdxAxis}); - flatchrg.addClone("Tracks/V0qa/pi/K0s/", "Tracks/V0qa/pi/La/"); - flatchrg.addClone("Tracks/V0qa/pi/K0s/", "Tracks/V0qa/pi/ALa/"); - flatchrg.addClone("Tracks/V0qa/pi/La/", "Tracks/V0qa/pr/La/"); - flatchrg.addClone("Tracks/V0qa/pi/ALa/", "Tracks/V0qa/pr/ALa/"); + registryData.add("Tracks/V0qa/el/Ga/hArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); + registryData.add("Tracks/V0qa/pi/K0s/hArmPod", ";#alpha; #it{q}_T (GeV/c)", kTH2F, {v0SelOpt.axisArmPodAlpha, v0SelOpt.axisArmPodqT}); + registryData.add("Tracks/V0qa/el/Ga/hNclVsEta", ";#eta; #it{N}^{TPC}_cl", kTH2F, {etaAxis, clTpcAxis}); + registryData.add("Tracks/V0qa/pi/K0s/hNclVsEta", ";#eta; #it{N}^{TPC}_cl", kTH2F, {etaAxis, clTpcAxis}); + registryData.add("Tracks/V0qa/el/Ga/hdEdxMIPVsEta", ";#eta; dE/dx", kTH2F, {etaAxis, dEdxAxis}); + registryData.add("Tracks/V0qa/pi/K0s/hdEdxMIPVsEta", ";#eta; dE/dx", kTH2F, {etaAxis, dEdxAxis}); + registryData.addClone("Tracks/V0qa/pi/K0s/", "Tracks/V0qa/pi/La/"); + registryData.addClone("Tracks/V0qa/pi/K0s/", "Tracks/V0qa/pi/ALa/"); + registryData.addClone("Tracks/V0qa/pi/La/", "Tracks/V0qa/pr/La/"); + registryData.addClone("Tracks/V0qa/pi/ALa/", "Tracks/V0qa/pr/ALa/"); // dEdx PID - flatchrg.add({"Tracks/all/hdEdx", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/all/hdEdx", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); // Clean samples if (cfgFillV0Hist) { if (cfgStoreThnSparse) { - flatchrg.add({"Tracks/CleanTof/all/hPiTof", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hEV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hPiV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hPV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanTof/all/hPiTof", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hEV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hPiV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hPV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); } else { - flatchrg.add({"Tracks/CleanTof/all/hPiTof", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hEV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hPiV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); - flatchrg.add({"Tracks/CleanV0/all/hPV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanTof/all/hPiTof", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hEV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hPiV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); + registryData.add({"Tracks/CleanV0/all/hPV0", "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}}); } - flatchrg.add("Tracks/CleanTof/all/hBetaVsP", ";Momentum (GeV/#it{c}); #beta", kTH2F, {{{ptAxisV0s}, {120, 0., 1.2}}}); - flatchrg.add("Tracks/CleanTof/all/hTofExpPi", ";Momentum (GeV/#it{c});#it{t}^{#pi}_{Exp}/#it{t}_{TOF}", kTH2F, {{{ptAxisV0s}, {100, 0.2, 1.2}}}); + registryData.add("Tracks/CleanTof/all/hBetaVsP", ";Momentum (GeV/#it{c}); #beta", kTH2F, {{{ptAxisV0s}, {120, 0., 1.2}}}); + registryData.add("Tracks/CleanTof/all/hTofExpPi", ";Momentum (GeV/#it{c});#it{t}^{#pi}_{Exp}/#it{t}_{TOF}", kTH2F, {{{ptAxisV0s}, {100, 0.2, 1.2}}}); if (cfgFillChrgType) { - flatchrg.addClone("Tracks/CleanTof/all/", "Tracks/CleanTof/pos/"); - flatchrg.addClone("Tracks/CleanTof/all/", "Tracks/CleanTof/neg/"); - flatchrg.addClone("Tracks/CleanV0/all/", "Tracks/CleanV0/pos/"); - flatchrg.addClone("Tracks/CleanV0/all/", "Tracks/CleanV0/neg/"); + registryData.addClone("Tracks/CleanTof/all/", "Tracks/CleanTof/pos/"); + registryData.addClone("Tracks/CleanTof/all/", "Tracks/CleanTof/neg/"); + registryData.addClone("Tracks/CleanV0/all/", "Tracks/CleanV0/pos/"); + registryData.addClone("Tracks/CleanV0/all/", "Tracks/CleanV0/neg/"); } } if (cfgFillChrgType) { - flatchrg.addClone("Tracks/all/", "Tracks/pos/"); - flatchrg.addClone("Tracks/all/", "Tracks/neg/"); + registryData.addClone("Tracks/all/", "Tracks/pos/"); + registryData.addClone("Tracks/all/", "Tracks/neg/"); } + LOG(info) << "Size of the Data histograms:"; + registryData.print(); } if (doprocessMC) { - auto h = flatchrg.add("hEvtGenRec", "Generated and Reconstructed MC Collisions", kTH1F, {{3, 0.5, 3.5}}); + registryMC.add({"Events/ResponseGen", ";N_{ch,FV0};1-#rho_{FV0};", {kTHnSparseF, {multAxis, flatAxis}}}); + registryMC.add("Events/h1flatencityFV0MCGen", "", {kTH1F, {flatAxis}}); + registryMC.add("Events/hFlatMCGen", "Events/hFlatMCGen", {kTH1F, {flatAxis}}); + registryMC.add("Events/hFlatMCRec", "Events/hFlatMCRec", {kTH1F, {flatAxis}}); + // Event counter + auto h = registryMC.add("Events/hEvtGenRec", "Generated and Reconstructed MC Collisions", kTH1F, {{3, 0.5, 3.5}}); h->GetXaxis()->SetBinLabel(1, "Gen coll"); h->GetXaxis()->SetBinLabel(2, "Rec coll"); h->GetXaxis()->SetBinLabel(3, "INEL>0"); - - flatchrg.add("hEvtMcGenColls", "Number of events; Cut; #Events Passed Cut", {kTH1F, {{5, 0.5, 5.5}}}); - flatchrg.get(HIST("hEvtMcGenColls"))->GetXaxis()->SetBinLabel(1, "Gen. coll"); - flatchrg.get(HIST("hEvtMcGenColls"))->GetXaxis()->SetBinLabel(2, "At least 1 reco"); - flatchrg.get(HIST("hEvtMcGenColls"))->GetXaxis()->SetBinLabel(3, "Reco. coll."); - flatchrg.get(HIST("hEvtMcGenColls"))->GetXaxis()->SetBinLabel(4, "Reco. good coll."); - - flatchrg.add("Events/hVtxZRec", "MC Rec vertex z position", kTH1F, {vtxzAxis}); - flatchrg.add("Events/hVtxZGen", "Generated vertex z position", kTH1F, {vtxzAxis}); + registryMC.add("Events/hEvtMcGen", "Events/hEvtMcGen", {kTH1F, {{4, 0.f, 4.f}}}); + registryMC.get(HIST("Events/hEvtMcGen"))->GetXaxis()->SetBinLabel(1, "all"); + registryMC.get(HIST("Events/hEvtMcGen"))->GetXaxis()->SetBinLabel(2, "z-vtx"); + registryMC.get(HIST("Events/hEvtMcGen"))->GetXaxis()->SetBinLabel(3, "INELgt0"); + registryMC.get(HIST("Events/hEvtMcGen"))->GetXaxis()->SetBinLabel(4, "INELgt0TVX"); + registryMC.add("Events/hEvtMCRec", "Events/hEvtMCRec", {kTH1F, {{3, 0.f, 3.f}}}); + registryMC.get(HIST("Events/hEvtMCRec"))->GetXaxis()->SetBinLabel(1, "all"); + registryMC.get(HIST("Events/hEvtMCRec"))->GetXaxis()->SetBinLabel(2, "evt sel"); + registryMC.get(HIST("Events/hEvtMCRec"))->GetXaxis()->SetBinLabel(3, "INELgt0"); + registryMC.add("Events/hEvtMcGenColls", "Number of events; Cut; #Events Passed Cut", {kTH1F, {{4, 0.5, 4.5}}}); + registryMC.get(HIST("Events/hEvtMcGenColls"))->GetXaxis()->SetBinLabel(1, "Gen. coll"); + registryMC.get(HIST("Events/hEvtMcGenColls"))->GetXaxis()->SetBinLabel(2, "At least 1 reco"); + registryMC.get(HIST("Events/hEvtMcGenColls"))->GetXaxis()->SetBinLabel(3, "Reco. coll."); + registryMC.get(HIST("Events/hEvtMcGenColls"))->GetXaxis()->SetBinLabel(4, "Reco. good coll."); + // + registryMC.add("Events/hNchVsCent", "Gen Nch vs Cent; mult; Gen Nch (|#eta|<0.8)", {kTH2F, {multAxis, nChAxis}}); + registryMC.add("Events/hVtxZRec", "MC Rec vertex z position", kTH1F, {vtxzAxis}); + registryMC.add("Events/hVtxZGen", "Generated vertex z position", kTH1F, {vtxzAxis}); + registryMC.add("Events/hNchTVX", "Nch in FT0A+FT0C; Nch; status", {kTH2F, {nChAxis, {2, 0, 2}}}); + registryMC.add({"Tracks/hPtFakes", "Fake tracks; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + // Event loss + registryMC.add("Events/hNchVsFlatGenINELgt0", "Gen Nch w/o Evt sel; Gen Nch (|#eta|<0.8); flat", {kTH2F, {nChAxis, flatAxis}}); + registryMC.add("Events/hNchVsFlatGenINELgt0wRecEvtSel", "Gen Nch w/ Nrec > 0 + Evt sel; Gen Nch (|#eta|<0.8); flat", {kTH2F, {nChAxis, flatAxis}}); + // Event split + registryMC.add("Events/hCentVsFlatRecINELgt0", "Gen evt w/o Evt sel; mult; flat", {kTH2F, {multAxis, flatAxis}}); + registryMC.add("Events/hCentVsFlatRecINELgt0wRecEvt", "Gen evt w/ Nrec > 0; mult; flat", {kTH2F, {multAxis, flatAxis}}); + registryMC.add("Events/hCentVsFlatRecINELgt0wRecEvtSel", "Gen evt w/ Nrec > 0 + Evt sel; mult; flat", {kTH2F, {multAxis, flatAxis}}); + for (int i = 0; i < Npart; ++i) { + // Signal loss + registryMC.add({fmt::format(CpTgenPrimSgnF.data(), CspeciesAll[i]).c_str(), "Gen evt w/o Evt sel; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + registryMC.add({fmt::format(CpTrecCollPrimSgnF.data(), CspeciesAll[i]).c_str(), "Gen Nch w/ Nrec > 0; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + // Closure test + registryMC.add({fmt::format(CpTmcClosureGenPrimF.data(), CspeciesAll[i]).c_str(), "Gen evt w/o Evt sel; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + registryMC.add({fmt::format(CpTmcClosureRecF.data(), CspeciesAll[i]).c_str(), "Gen Nch w/ Nrec > 0 + Evt. sel; Gen Nch (|#eta|<0.8); flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + } + if (cfgFillNclVsPhiCutQaHist) { + registryMC.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); + registryMC.add("Tracks/postSel/hPtPhiNclTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + registryMC.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + registryMC.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + registryMC.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); + registryMC.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); + registryMC.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); + } + registryMC.addClone("Tracks/postSel/", "Tracks/preSel/"); 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}); - } - - flatchrg.add({"hPtOut", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add({"hPtOutPrim", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add({"hPtOutNoEtaCut", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add({"PtOutFakes", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add("hPtVsDCAxyPrimAll", "hPtVsDCAxyPrimAll", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("hPtVsDCAxyWeakAll", "hPtVsDCAxyWeakAll", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("hPtVsDCAxyMatAll", "hPtVsDCAxyMatAll", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("hPtVsDCAxyAll", "hPtVsDCAxyAll", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add({"ResponseGen", " ; N_{part}; F_{FV0};", {kTHnSparseF, {multAxis, flatAxis}}}); - flatchrg.add("h1flatencityFV0MCGen", "", kTH1F, {{102, -0.01, 1.01, "1-flatencityFV0"}}); + hPtGenRecEvt[i] = registryMC.add("Tracks/hPtGenRecEvt" + strID, "Gen evt w/ Nrec > 0; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtGenPrimRecEvt[i] = registryMC.add("Tracks/hPtGenPrimRecEvt" + strID, "Gen evt w/ Nrec > 0 (primary); mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffGenPrim[i] = registryMC.add("Tracks/hPtEffGenPrim" + strID, "Gen evt w/o rec Evt; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffGenWeak[i] = registryMC.add("Tracks/hPtEffGenWeak" + strID, "Gen evt w/o rec Evt; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffGenMat[i] = registryMC.add("Tracks/hPtEffGenMat" + strID, "Gen evt w/o rec Evt; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffRecGoodCollPrim[i] = registryMC.add("Tracks/hPtEffRecGoodCollPrim" + strID, "; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffRecGoodCollWeak[i] = registryMC.add("Tracks/hPtEffRecGoodCollWeak" + strID, "; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hPtEffRecGoodCollMat[i] = registryMC.add("Tracks/hPtEffRecGoodCollMat" + strID, "; mult; flat; #it{p}_{T} (GeV/#it{c})", kTHnSparseF, {multAxis, flatAxis, ptAxis}); + hDCAxyRecBadCollPrim[i] = registryMC.add("Tracks/hDCAxyRecBadCollPrim" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyRecBadCollWeak[i] = registryMC.add("Tracks/hDCAxyRecBadCollWeak" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyRecBadCollMat[i] = registryMC.add("Tracks/hDCAxyRecBadCollMat" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyRecGoodCollPrim[i] = registryMC.add("Tracks/hPtVsDCAxyRecGoodCollPrim" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyRecGoodCollWeak[i] = registryMC.add("Tracks/hPtVsDCAxyRecGoodCollWeak" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyRecGoodCollMat[i] = registryMC.add("Tracks/hPtVsDCAxyRecGoodCollMat" + strID, "; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", kTH2F, {ptAxis, dcaXYAxis}); + } + + for (int i = 0; i < Npart; i++) { + registryMC.add({fmt::format(CpTeffGenPrimRecEvtF.data(), CspeciesAll[i]).c_str(), "Gen evt w/ Nrec > 0; mult; flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {multAxis, flatAxis, ptAxis}}}); + registryMC.add({fmt::format(CpTeffPrimRecEvtF.data(), CspeciesAll[i]).c_str(), "Gen evt w/ Nrec > 0 + Evt sel; mult; flat; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {multAxis, flatAxis, ptAxis}}}); + registryMC.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}}}); + registryMC.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}}}); + registryMC.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}}}); + registryMC.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}}}); + registryMC.add({fmt::format(CdEdxMcRecPrimF.data(), CspeciesAll[i]).c_str(), "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); + } // Hash list for efficiency listEfficiency.setObject(new THashList); @@ -769,44 +822,10 @@ struct FlattenictyPikp { initEfficiency(); initEfficiency(); }); - } - 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}}}); - } + LOG(info) << "Size of the MC histograms:"; + registryMC.print(); } - - if (doprocessSgnLoss) { - flatchrg.add("hFlatMCGenRecColl", "hFlatMCGenRecColl", {kTH1F, {flatAxis}}); - flatchrg.add("hFlatMCGen", "hFlatMCGen", {kTH1F, {flatAxis}}); - // Event counter - flatchrg.add("hEvtMcGen", "hEvtMcGen", {kTH1F, {{4, 0.f, 4.f}}}); - flatchrg.get(HIST("hEvtMcGen"))->GetXaxis()->SetBinLabel(1, "all"); - flatchrg.get(HIST("hEvtMcGen"))->GetXaxis()->SetBinLabel(2, "z-vtx"); - flatchrg.get(HIST("hEvtMcGen"))->GetXaxis()->SetBinLabel(3, "INELgt0"); - flatchrg.add("hEvtMCRec", "hEvtMCRec", {kTH1F, {{4, 0.f, 4.f}}}); - 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}}}); - } - } - - LOG(info) << "Size of the histograms:"; - flatchrg.print(); } void initCCDB(aod::BCsWithTimestamps::iterator const& bc) @@ -903,23 +922,12 @@ struct FlattenictyPikp { template bool isPID(const P& mcParticle) { - static_assert(pidSgn == Cnull || pidSgn == 1); - static_assert(id > Cnull || id < Npart); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); + static_assert(id > CnullInt || id < Npart); constexpr int Cidx = id + pidSgn * Npart; return mcParticle.pdgCode() == PidSgn[Cidx]; } - template - bool selTPCtrack(T const& track) - { - return (track.hasTPC() && - track.passedTPCCrossedRowsOverNCls() && - track.passedTPCChi2NDF() && - track.passedTPCNCls() && - track.passedTPCCrossedRows() && - track.passedTPCRefit()); - } - template bool selTOFPi(T const& track) { @@ -928,9 +936,9 @@ struct FlattenictyPikp { const float trkLength = track.length(); const float tExpPiTOF = track.tofExpSignalPi(tTOF); if (track.p() >= trkSelOpt.cfgMomSelPiTOF && trkLength > Cnull && tTOF > Cnull) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hTofExpPi"), track.p(), tExpPiTOF / tTOF); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hTofExpPi"), track.p(), tExpPiTOF / tTOF); if (std::abs((tExpPiTOF / tTOF) - Cone) < trkSelOpt.cfgTofBetaPiMax) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hBetaVsP"), track.p(), track.beta()); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[chrg]) + HIST("hBetaVsP"), track.p(), track.beta()); // if (std::abs(track.tpcNSigmaPi()) < v0SelOpt.cfgNsigmaPiTPC && std::abs(track.tofNSigmaPi()) < v0SelOpt.cfgNsigmaPiTOF) { return true; // } @@ -940,13 +948,43 @@ struct FlattenictyPikp { return false; } - template - void fillNsigma(T const& tracks, C const& collision) + template + void fillDCA(T const& tracks, C const& collision, aod::BCsWithTimestamps const& /*bcs*/) { + if (trkSelOpt.cfgRejectTrkAtTPCSector) { + auto bc = collision.template bc_as(); + int currentRun = bc.runNumber(); + if (runNumber != currentRun) { + initCCDB(bc); + runNumber = currentRun; + } + } const float mult = getMult(collision); const float flat = fillFlat(collision); for (const auto& track : tracks) { - checkNsigma(track, mult, flat); + if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (track.pt() < trkSelOpt.cfgTrkPtMin) { + continue; + } + if (trkSelOpt.cfgApplyNcl && track.tpcNClsFound() < trkSelOpt.cfgNclTPCMin) { + continue; + } + if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { + continue; + } + 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)) { + continue; + } + if (track.hasTOF() && (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax))) { + registryData.fill(HIST(Cprefix) + HIST(CspeciesAll[id]) + HIST(CpTvsDCAxy), mult, flat, track.pt(), track.dcaXY()); + } } } @@ -964,7 +1002,7 @@ struct FlattenictyPikp { const float mult = getMult(collision); const float flat = fillFlat(collision); - flatchrg.fill(HIST("Events/hFlatVsMultEst"), flat, mult); + registryData.fill(HIST("Events/hFlatVsMultEst"), flat, mult); for (const auto& track : tracks) { float dEdx = track.tpcSignal(); @@ -1024,12 +1062,12 @@ struct FlattenictyPikp { // PID TPC dEdx if (cfgFillChrgType) { if (track.sign() * track.p() > Cnull) { - flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kPos]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(Ccharge[kPos]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } else { - flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kNeg]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(Ccharge[kNeg]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } } else { - flatchrg.fill(HIST(Cprefix) + HIST(Ccharge[kAll]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(Ccharge[kAll]) + HIST("hdEdx"), track.eta(), mult, flat, track.p(), dEdx); } // TOF pions @@ -1038,22 +1076,22 @@ struct FlattenictyPikp { if (cfgFillChrgType) { if (track.sign() * track.p() > Cnull) { if (cfgStoreThnSparse) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kPos]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } else { if (cfgStoreThnSparse) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kNeg]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } } else { if (cfgStoreThnSparse) { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), mult, flat, track.p(), dEdx); } else { - flatchrg.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); + registryData.fill(HIST(CprefixCleanTof) + HIST(Ccharge[kAll]) + HIST("hPiTof"), track.eta(), track.p(), dEdx); } } } @@ -1131,19 +1169,19 @@ struct FlattenictyPikp { } if (cfgStoreThnSparse) { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hEV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hEV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hEV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hEV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } } else { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hEV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hEV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hEV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hEV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hEV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } } } @@ -1152,19 +1190,19 @@ struct FlattenictyPikp { fillV0QA(v0, negTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } } else { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } } } @@ -1173,19 +1211,19 @@ struct FlattenictyPikp { fillV0QA(v0, posTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } } else { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } } } @@ -1194,19 +1232,19 @@ struct FlattenictyPikp { fillV0QA(v0, negTrack); if (cfgStoreThnSparse) { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), mult, flat, posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), negTrack.eta(), mult, flat, negTrack.sign() * negTrack.p(), dEdxNeg); } } else { if (cfgFillChrgType) { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kPos]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kNeg]) + HIST("hPV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } else { - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); - flatchrg.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPiV0"), posTrack.eta(), posTrack.sign() * posTrack.p(), dEdxPos); + registryData.fill(HIST(CprefixCleanV0) + HIST(Ccharge[kAll]) + HIST("hPV0"), negTrack.eta(), negTrack.sign() * negTrack.p(), dEdxNeg); } } } @@ -1252,103 +1290,136 @@ 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; + } + + template + bool isInelGt0wTVX(P const& particles) + { + int nChrgMc = 0; + int nChrgFT0A = 0; + int nChrgFT0C = 0; + for (auto const& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + // trigger TVX + if (particle.eta() > CminAccFT0A && particle.eta() < CmaxAccFT0A) { + nChrgFT0A++; + } + if (particle.eta() > CminAccFT0C && particle.eta() < CmaxAccFT0C) { + nChrgFT0C++; + } + nChrgMc++; + } + if (nChrgFT0A == CnullInt || nChrgFT0C == CnullInt) { + registryMC.fill(HIST("Events/hNchTVX"), nChrgMc, 0.5); + return false; + } + registryMC.fill(HIST("Events/hNchTVX"), nChrgMc, 1.5); + if (nChrgMc == CnullInt) { + return false; + } + return true; + } + + 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) { + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhi"), track.pt(), phimodn); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclPIDTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsPID()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclTPC"), track.pt(), track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclTPC"), track.pt(), track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); + registryData.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); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelAll); if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelEta); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelEta); if (track.pt() < trkSelOpt.cfgTrkPtMin) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelPt); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelPt); if (!isDCAxyCut(track)) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelDCA); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelDCA); if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkNRowsTPC); + registryData.fill(HIST("Tracks/hTrkSel"), trkNRowsTPC); if (trkSelOpt.cfgApplyNcl && track.tpcNClsFound() < trkSelOpt.cfgNclTPCMin) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsFound); + registryData.fill(HIST("Tracks/hTrkSel"), trkSelNClsFound); if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { return false; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magfield, fPhiCutLow, fPhiCutHigh)) { + registryData.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); + + 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; } - flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); + if (cfgFillNclVsPhiCutQaHist) { + fillNclVsPhiCutQaHist(track, phimodn); + } + registryData.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); return true; } template void fillV0QA(V const& v0, U const& track) { - flatchrg.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hArmPod"), v0.alpha(), v0.qtarm()); - flatchrg.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hNclVsEta"), track.eta(), track.tpcNClsPID()); - flatchrg.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hdEdxMIPVsEta"), track.eta(), track.tpcSignal()); + registryData.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hArmPod"), v0.alpha(), v0.qtarm()); + registryData.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hNclVsEta"), track.eta(), track.tpcNClsPID()); + registryData.fill(HIST(CprefixV0qa) + HIST(PidDir[id]) + HIST(V0Dir[typeMother]) + HIST("hdEdxMIPVsEta"), track.eta(), track.tpcSignal()); } template @@ -1446,47 +1517,52 @@ 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(); - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelAll); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelAll); if (posTrack.sign() * negTrack.sign() > Cnull) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectSameSign); + registryData.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; } } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectV0sAtTPCSector); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectV0sAtTPCSector); // V0 topological selections if (v0.v0cosPA() < v0SelOpt.cfgv0cospa) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelCosPA); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelCosPA); if (v0.v0radius() < v0SelOpt.cfgv0Rmin || v0.v0radius() > v0SelOpt.cfgv0Rmax) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelV0radius); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelV0radius); if (std::abs(v0.dcapostopv()) < v0SelOpt.cfgDCAposToPV || std::abs(v0.dcanegtopv()) < v0SelOpt.cfgDCAnegToPV) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAposToPV); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAposToPV); // selection of V0 daughters if (!(isGoodV0DaughterTrack(posTrack) && isGoodV0DaughterTrack(negTrack))) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDaughters); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDaughters); if (v0.dcaV0daughters() > v0SelOpt.cfgDCAv0daughter) { return false; } - flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAv0daughter); + registryData.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelDCAv0daughter); if constexpr (fillHist) { - flatchrg.fill(HIST("Tracks/V0qa/hV0Pt"), v0.pt()); - flatchrg.fill(HIST("Tracks/V0qa/hV0ArmPod"), v0.alpha(), v0.qtarm()); + registryData.fill(HIST("Tracks/V0qa/hV0Pt"), v0.pt()); + registryData.fill(HIST("Tracks/V0qa/hV0ArmPod"), v0.alpha(), v0.qtarm()); } return true; } @@ -1497,9 +1573,6 @@ struct FlattenictyPikp { if (track.eta() < v0SelOpt.cfgV0etamin || track.eta() > v0SelOpt.cfgV0etamax) { return false; } - if (track.pt() < v0SelOpt.cfgPtDaughterMin || track.pt() > v0SelOpt.cfgPtDaughterMax) { - return false; - } if (!track.hasTPC()) { return false; } @@ -1534,99 +1607,42 @@ struct FlattenictyPikp { return true; } - template - void checkNsigma(const T& track, const float mult, const float flat) - { - if (std::abs(track.rapidity(o2::track::PID::getMass(pid))) > trkSelOpt.cfgRapMax) { - return; - } - - float valTPCnsigma = -999, valTOFnsigma = -999; - switch (pid) { - case o2::track::PID::Pion: - valTPCnsigma = track.tpcNSigmaPi(); - valTOFnsigma = track.tofNSigmaPi(); - break; - case o2::track::PID::Kaon: - valTPCnsigma = track.tpcNSigmaKa(); - valTOFnsigma = track.tofNSigmaKa(); - break; - case o2::track::PID::Proton: - valTPCnsigma = track.tpcNSigmaPr(); - valTOFnsigma = track.tofNSigmaPr(); - break; - case o2::track::PID::Electron: - valTPCnsigma = track.tpcNSigmaEl(); - valTOFnsigma = track.tofNSigmaEl(); - break; - case o2::track::PID::Muon: - valTPCnsigma = track.tpcNSigmaMu(); - valTOFnsigma = track.tofNSigmaMu(); - break; - default: - valTPCnsigma = -999, valTOFnsigma = -999; - break; - } - - if (track.sign() > Cnull) { - if (cfgStoreThnSparse) { - hThPtNsigmaTPC[pid]->Fill(track.pt(), valTPCnsigma, mult, flat); - } else { - hPtNsigmaTPC[pid]->Fill(track.pt(), valTPCnsigma); - } - } else { - if (cfgStoreThnSparse) { - hThPtNsigmaTPC[pid + Npart]->Fill(track.pt(), valTPCnsigma, mult, flat); - } else { - hPtNsigmaTPC[pid + Npart]->Fill(track.pt(), valTPCnsigma); - } - } - if (!track.hasTOF()) { - return; - } - if (track.sign() > Cnull) { - hPtNsigmaTOF[pid]->Fill(track.pt(), valTOFnsigma); - hPtNsigmaTPCTOF[pid]->Fill(valTPCnsigma, valTOFnsigma); - } else { - hPtNsigmaTOF[pid + Npart]->Fill(track.pt(), valTOFnsigma); - hPtNsigmaTPCTOF[pid + Npart]->Fill(valTPCnsigma, valTOFnsigma); - } - } - template inline void fillTrackQA(T const& track) { if constexpr (fillHist) { - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPt"), track.pt()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPhi"), track.phi()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hEta"), track.eta()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hDCAXYvsPt"), track.pt(), track.dcaXY()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hDCAZvsPt"), track.pt(), track.dcaZ()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPt"), track.pt()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPhi"), track.phi()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hEta"), track.eta()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hDCAXYvsPt"), track.pt(), track.dcaXY()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hDCAZvsPt"), track.pt(), track.dcaZ()); if (track.hasTPC() && track.hasITS()) { - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCCluster"), track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hShTpcClvsPt"), track.pt(), track.tpcFractionSharedCls()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsPt"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsPt"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCnClsShared"), track.tpcNClsShared()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRows"), track.tpcNClsCrossedRows()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hChi2ITSTrkSegment"), track.itsChi2NCl()); - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hITSnCls"), track.itsNCls()); - } - - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFPvsBeta"), track.p(), track.beta()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCCluster"), track.tpcNClsFindable() - track.tpcNClsFindableMinusFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hShTpcClvsPt"), track.pt(), track.tpcFractionSharedCls()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsPt"), track.pt(), track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsPt"), track.pt(), track.tpcNClsPID()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNclTPCFoundvsEta"), track.eta(), track.tpcNClsFound()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hNClTPCPidvsEta"), track.eta(), track.tpcNClsPID()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCnClsShared"), track.tpcNClsShared()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRows"), track.tpcNClsCrossedRows()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTPCcrossedRowsOverFindableCls"), track.tpcCrossedRowsOverFindableCls()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hChi2ITSTrkSegment"), track.itsChi2NCl()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hITSnCls"), track.itsNCls()); + } + + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFPvsBeta"), track.p(), track.beta()); if (track.beta() > trkSelOpt.cfgTOFBetaPion && track.beta() < trkSelOpt.cfgTOFBetaPion + 0.05) { // TOF pions - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFpi"), track.eta(), track.p(), track.tpcSignal()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hTOFpi"), track.eta(), track.p(), track.tpcSignal()); } if (std::abs(track.eta()) < trkSelOpt.cfgTrkEtaMax) { if (isDCAxyWoCut(track)) { - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtVsWOcutDCA"), track.pt(), track.dcaXY()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtVsWOcutDCA"), track.pt(), track.dcaXY()); } } } - flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPVsPtEta"), track.p(), track.pt(), track.eta()); + registryData.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPVsPtEta"), track.p(), track.pt(), track.eta()); } template @@ -1638,24 +1654,24 @@ struct FlattenictyPikp { if (track.p() >= trkSelOpt.cfgMomMIPMin && track.p() <= trkSelOpt.cfgMomMIPMax) { if (dEdx > trkSelOpt.cfgDeDxMIPMin && dEdx < trkSelOpt.cfgDeDxMIPMax) { // MIP pions if (cfgStoreThnSparse) { - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), mult, flat, track.eta(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), mult, flat, track.eta(), dEdx); } else { - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), track.eta(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIP"), track.eta(), dEdx); } - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIPVsPhi"), track.phi(), dEdx); - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIPVsPhiVsEta"), track.phi(), dEdx, track.eta()); - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("pMIPVsPhi"), track.phi(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIPVsPhi"), track.phi(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hMIPVsPhiVsEta"), track.phi(), dEdx, track.eta()); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("pMIPVsPhi"), track.phi(), dEdx); } if (dEdx > trkSelOpt.cfgDeDxMIPMax + 10. && dEdx < trkSelOpt.cfgDeDxMIPMax + 30.) { // Plateau electrons if (std::abs(track.beta() - 1) < trkSelOpt.cfgBetaPlateuMax) { if (cfgStoreThnSparse) { - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), mult, flat, track.eta(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), mult, flat, track.eta(), dEdx); } else { - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), track.eta(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateau"), track.eta(), dEdx); } - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateauVsPhi"), track.phi(), dEdx); - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateauVsPhiVsEta"), track.phi(), dEdx, track.eta()); - flatchrg.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("pPlateauVsPhi"), track.phi(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateauVsPhi"), track.phi(), dEdx); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("hPlateauVsPhiVsEta"), track.phi(), dEdx, track.eta()); + registryData.fill(HIST(Cprefix) + HIST(CstatCalib[ft]) + HIST(Ccharge[chrg]) + HIST("pPlateauVsPhi"), track.phi(), dEdx); } } } @@ -1666,7 +1682,7 @@ struct FlattenictyPikp { bool isGoodEvent(C const& collision) { if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelAll); + registryQC.fill(HIST("Events/hEvtSel"), evtSelAll); } if (evtSelOpt.cfgCustomTVX) { if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) { @@ -1678,62 +1694,62 @@ struct FlattenictyPikp { } } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelSel8); + registryQC.fill(HIST("Events/hEvtSel"), evtSelSel8); } if (evtSelOpt.cfgRemoveITSROFrameBorder && !collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelNoITSROFrameBorder); + registryQC.fill(HIST("Events/hEvtSel"), evtSelNoITSROFrameBorder); } if (evtSelOpt.cfgRemoveNoTimeFrameBorder && !collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkNoTimeFrameBorder); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkNoTimeFrameBorder); } if (evtSelOpt.cfgRemoveNoSameBunchPileup && !collision.selection_bit(aod::evsel::kNoSameBunchPileup)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkNoSameBunchPileup); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkNoSameBunchPileup); } if (evtSelOpt.cfgRequireIsGoodZvtxFT0vsPV && !collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsGoodZvtxFT0vsPV); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsGoodZvtxFT0vsPV); } if (evtSelOpt.cfgRequireIsVertexITSTPC && !collision.selection_bit(aod::evsel::kIsVertexITSTPC)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsVertexITSTPC); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsVertexITSTPC); } if (evtSelOpt.cfgRequirekIsVertexTOFmatched && !collision.selection_bit(aod::evsel::kIsVertexTOFmatched)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelkIsVertexTOFmatched); + registryQC.fill(HIST("Events/hEvtSel"), evtSelkIsVertexTOFmatched); } if (std::abs(collision.posZ()) > evtSelOpt.cfgCutVtxZ) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelVtxZ); - flatchrg.fill(HIST("Events/hVtxZ"), collision.posZ()); + registryQC.fill(HIST("Events/hEvtSel"), evtSelVtxZ); + registryQC.fill(HIST("Events/hVtxZ"), collision.posZ()); } - if (evtSelOpt.cfgINELCut && !collision.isInelGt0()) { + if (!collision.isInelGt0()) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelINELgt0); + registryQC.fill(HIST("Events/hEvtSel"), evtSelINELgt0); } if (rctCuts.requireRCTFlagChecker && !rctChecker(collision)) { return false; } if constexpr (fillHist) { - flatchrg.fill(HIST("Events/hEvtSel"), evtSelRCTFlagChecker); + registryQC.fill(HIST("Events/hEvtSel"), evtSelRCTFlagChecker); } return true; } @@ -1843,7 +1859,11 @@ struct FlattenictyPikp { return val; break; case MultE::CmultFT0M: - return collision.centFT0M(); + if constexpr (!isMC) { + return collision.centFT0M(); + } else { + return collision.multMCFT0C() + collision.multMCFT0A(); + } break; case MultE::CmultTPC: if constexpr (!isMC) { @@ -1915,10 +1935,10 @@ struct FlattenictyPikp { int chv0 = fv0.channel()[ich]; int chv0phi = getFV0IndexPhi(chv0); if constexpr (fillHist) { - flatchrg.fill(HIST("FV0/hFV0amp"), chv0, amplCh); - flatchrg.fill(HIST("FV0/pFV0amp"), chv0, amplCh); + registryQC.fill(HIST("FV0/hFV0amp"), chv0, amplCh); + registryQC.fill(HIST("FV0/pFV0amp"), chv0, amplCh); if (applyCalibGain) { - flatchrg.fill(HIST("FV0/hFV0ampCorr"), chv0, amplCh / fv0AmplCorr[chv0]); + registryQC.fill(HIST("FV0/hFV0ampCorr"), chv0, amplCh / fv0AmplCorr[chv0]); } } if (amplCh > Cnull) { @@ -1928,7 +1948,7 @@ struct FlattenictyPikp { if (chv0phi > Cnull) { fv0AmplitudeWoCalib[chv0phi] = amplCh; if constexpr (fillHist) { - flatchrg.fill(HIST("FV0/hFV0AmplWCalib"), ich, fv0AmplitudeWoCalib[ich]); + registryQC.fill(HIST("FV0/hFV0AmplWCalib"), ich, fv0AmplitudeWoCalib[ich]); } if (chv0 < CinnerFV0) { rhoLatticeFV0[chv0phi] += amplCh; @@ -1936,12 +1956,12 @@ struct FlattenictyPikp { rhoLatticeFV0[chv0phi] += amplCh / 2.; } if constexpr (fillHist) { - flatchrg.fill(HIST("FV0/hFV0AmplvsVtxzWoCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); + registryQC.fill(HIST("FV0/hFV0AmplvsVtxzWoCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); } if (applyCalibVtx) { rhoLatticeFV0[chv0phi] *= zVtxMap->GetBinContent(zVtxMap->GetXaxis()->FindBin(chv0phi), zVtxMap->GetYaxis()->FindBin(collision.posZ())); if constexpr (fillHist) { - flatchrg.fill(HIST("FV0/hFV0AmplvsVtxzCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); + registryQC.fill(HIST("FV0/hFV0AmplvsVtxzCalib"), collision.posZ(), rhoLatticeFV0[chv0phi]); } } } @@ -2011,10 +2031,10 @@ struct FlattenictyPikp { auto v0sPerCollision = v0s.sliceBy(perColV0s, collision.globalIndex()); v0sPerCollision.bindExternalIndices(&tracks); filldEdx(tracksPerCollision, v0sPerCollision, collision, bcs); - if (cfgFillNsigmaQAHist) { - fillNsigma(tracksPerCollision, collision); - fillNsigma(tracksPerCollision, collision); - fillNsigma(tracksPerCollision, collision); + if (cfgFillDCAxyHist) { + static_for<0, 4>([&](auto i) { + fillDCA(tracksPerCollision, collision, bcs); + }); } } } @@ -2038,8 +2058,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) { @@ -2051,11 +2071,18 @@ struct FlattenictyPikp { rhoLatticeFV0.fill(0); std::vector vNch; - float nCharged{0}; + float nChFV0{0}; for (const auto& mcPart : mcparts) { if (!isChrgParticle(mcPart.pdgCode())) { continue; } + if (!mcPart.isPhysicalPrimary()) { + continue; + } + if (mcPart.pt() <= 0.) { + continue; + } + auto etaMc = mcPart.eta(); auto phiMc = mcPart.phi(); @@ -2075,22 +2102,22 @@ struct FlattenictyPikp { if (etaMc >= etaMinFV0bins[ieta] && etaMc < etaMaxFV0bins[ieta] && phiMc >= minPhi && phiMc < maxPhi) { rhoLatticeFV0[isegment] += 1. / std::abs(CdEtaFV0 * dPhi); + nChFV0++; } isegment++; } } - nCharged++; } - vNch.push_back(nCharged); - auto flatFV0 = calcFlatenicity(rhoLatticeFV0); + vNch.push_back(nChFV0); + auto flatFV0 = 1. - calcFlatenicity(rhoLatticeFV0); if constexpr (fillHist) { - flatchrg.fill(HIST("ResponseGen"), vNch[0], 1. - flatFV0); - flatchrg.fill(HIST("h1flatencityFV0MCGen"), 1. - flatFV0); + registryMC.fill(HIST("Events/ResponseGen"), vNch[0], flatFV0); + registryMC.fill(HIST("Events/h1flatencityFV0MCGen"), flatFV0); } vNch.clear(); - return 1. - flatFV0; + return flatFV0; } template @@ -2099,16 +2126,16 @@ struct FlattenictyPikp { AxisSpec ptAxis{binOpt.axisPt, "#it{p}_{T} (GeV/#it{c})"}; constexpr int ChistIdx = id + pidSgn * Npart; auto idx = static_cast(id); - const std::string strID = Form("/%s/%s", (pidSgn == Cnull && 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}); + const std::string strID = Form("/%s/%s", (pidSgn == CnullInt && id < Npart) ? "pos" : "neg", Pid[idx]); + hPtEffRec[ChistIdx] = registryMC.add("Tracks/hPtEffRec" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + hPtEffGen[ChistIdx] = registryMC.add("Tracks/hPtEffGen" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); } template void initEfficiency() { - static_assert(pidSgn == Cnull || pidSgn == 1); - static_assert(id > Cnull || id < Npart); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); + static_assert(id > CnullInt || id < Npart); constexpr int Cidx = id + pidSgn * Npart; const TString partName = PidChrg[Cidx]; THashList* lhash = new THashList(); @@ -2130,7 +2157,7 @@ struct FlattenictyPikp { template void fillEfficiency() { - static_assert(pidSgn == Cnull || pidSgn == 1); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); constexpr int ChistIdx = id + pidSgn * Npart; const char* partName = PidChrg[ChistIdx]; THashList* lhash = static_cast(listEfficiency->FindObject(partName)); @@ -2154,64 +2181,57 @@ struct FlattenictyPikp { template void fillMCRecTrack(MyLabeledPIDTracks::iterator const& track, const float mult, const float flat) { - static_assert(pidSgn == Cnull || pidSgn == 1); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); constexpr int ChistIdx = id + pidSgn * Npart; + // LOG(debug) << "fillMCRecTrack for pidSgn '" << pidSgn << "' and id '" << static_cast(id) << " with index " << ChistIdx; const aod::McParticles::iterator& mcParticle = track.mcParticle(); const CollsGen::iterator& collision = track.collision_as(); - if (!isPID(mcParticle)) { + if (!isChrgParticle(mcParticle.pdgCode())) { return; } - flatchrg.fill(HIST("hPtOutNoEtaCut"), track.pt()); - if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { + if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { return; } - if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { + if (!isPID(mcParticle)) { return; } if ((collision.has_mcCollision() && (mcParticle.mcCollisionId() != collision.mcCollisionId())) || !collision.has_mcCollision()) { if (!mcParticle.isPhysicalPrimary()) { if (mcParticle.getProcess() == CprocessIdWeak) { - hDCAxyBadCollWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyRecBadCollWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); } else { - hDCAxyBadCollMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyRecBadCollMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); } } else { - hDCAxyBadCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); + hDCAxyRecBadCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); } } - if (!isDCAxyCut(track)) { - return; - } - flatchrg.fill(HIST("hPtVsDCAxyAll"), track.pt(), track.dcaXY()); - - if (selTPCtrack(track)) { - hPtEffRec[ChistIdx]->Fill(mcParticle.pt()); - } - - if (!mcParticle.isPhysicalPrimary()) { - if (mcParticle.getProcess() == CprocessIdWeak) { - hPtEffRecWeak[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST("hPtVsDCAxyWeakAll"), track.pt(), track.dcaXY()); + if (collision.has_mcCollision() && (mcParticle.mcCollisionId() == collision.mcCollisionId())) { + if (!mcParticle.isPhysicalPrimary()) { + if (mcParticle.getProcess() == CprocessIdWeak) { + hPtEffRecGoodCollWeak[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyRecGoodCollWeak[ChistIdx]->Fill(track.pt(), track.dcaXY()); + } else { + hPtEffRecGoodCollMat[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyRecGoodCollMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); + } } else { - hPtEffRecMat[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyMat[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST("hPtVsDCAxyMatAll"), track.pt(), track.dcaXY()); + hPtEffRecGoodCollPrim[ChistIdx]->Fill(mult, flat, track.pt()); + hPtVsDCAxyRecGoodCollPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); } - } else { - hPtEffRecPrim[ChistIdx]->Fill(mult, flat, track.pt()); - hPtVsDCAxyPrim[ChistIdx]->Fill(track.pt(), track.dcaXY()); - flatchrg.fill(HIST("hPtVsDCAxyPrimAll"), track.pt(), track.dcaXY()); + } + if (isDCAxyCut(track)) { + hPtEffRec[ChistIdx]->Fill(mcParticle.pt()); } } template void fillMCGen(aod::McParticles::iterator const& mcParticle, const float mult, const float flat) { - static_assert(pidSgn == Cnull || pidSgn == 1); + static_assert(pidSgn == CnullInt || pidSgn == ConeInt); constexpr int ChistIdx = id + pidSgn * Npart; if (!isPID(mcParticle)) { @@ -2219,9 +2239,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; } @@ -2238,248 +2258,178 @@ struct FlattenictyPikp { } } - void processSgnLoss(MCColls::iterator const& mcCollision, - CollsGenSgn const& collisions, - aod::FV0As const& /*fv0s*/, - aod::McParticles const& particles) - { - float flat; - float mult; - 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 - flatchrg.fill(HIST("hEvtMcGen"), 0.5); - if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { - return; - } - flatchrg.fill(HIST("hEvtMcGen"), 1.5); - - bool isINELgt0mc = false; - if (pwglf::isINELgtNmc(particles, 0, pdg)) { - isINELgt0mc = true; - flatchrg.fill(HIST("hEvtMcGen"), 2.5); - flatchrg.fill(HIST("hFlatGenINELgt0"), flat); - } - - // Sgn loss den - 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(CpTgenPrimSgn), mult, flat, particle.pt()); - if (isINELgt0mc) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTgenPrimSgnINEL), mult, flat, particle.pt()); - } - } - }); - } - - int nRecCollINEL = 0; - int nRecCollINELgt0 = 0; - for (const auto& collision : collisions) { - // Evt split num - flatchrg.fill(HIST("hEvtMCRec"), 0.5); - if (!isGoodEvent(collision)) { - continue; - } - 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()) { - 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(CpTrecCollPrimSgn), mult, flat, particle.pt()); - if (nRecCollINELgt0) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTrecCollPrimSgnINEL), mult, flat, particle.pt()); - } - } - }); - } - } - - if (nRecCollINEL < 1) { - return; - } - // Evt loss num - flatchrg.fill(HIST("hEvtMcGenRecColl"), 0.5); - if (nRecCollINELgt0 > Cnull) { - flatchrg.fill(HIST("hEvtMcGenRecColl"), 1.5); - } - - // 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()); - } - } - }); - } - } - PROCESS_SWITCH(FlattenictyPikp, processSgnLoss, "process to calcuate signal/event lossses", false); - - // using Particles = soa::Filtered; - // expressions::Filter primaries = (aod::mcparticle::flags & (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary) == (uint8_t)o2::aod::mcparticle::enums::PhysicalPrimary; - void processMCclosure(Colls::iterator const& collision, - MyPIDTracks const& tracks, - MyLabeledTracks const& mcTrackLabels, - aod::McParticles const& particles, - // Particles const& particles, - aod::FV0As const& /*fv0s*/, - aod::BCsWithTimestamps const& /*bcs*/) - { - const float multRec = getMult(collision); - const float flatRec = fillFlat(collision); - for (const auto& track : tracks) { - if (!track.has_collision()) { - continue; - } - const auto& coll = track.collision_as(); - if (trkSelOpt.cfgRejectTrkAtTPCSector) { - auto bc = coll.template bc_as(); - int currentRun = bc.runNumber(); - if (runNumber != currentRun) { - initCCDB(bc); - runNumber = currentRun; - } - } - if (!isGoodEvent(coll)) { - continue; - } - if (!isGoodTrack(track, magField)) { - continue; - } - if (!isDCAxyCut(track)) { - continue; - } - const auto& mcLabel = mcTrackLabels.iteratorAt(track.globalIndex()); - const auto& mcParticle = particles.iteratorAt(mcLabel.mcParticleId()); - - static_for<0, 4>([&](auto i) { - constexpr int Cidx = i.value; - if ((std::abs(o2::aod::pidutils::tpcNSigma(track)) < trkSelOpt.cfgNsigmaMax) && std::abs(track.rapidity(o2::track::PID::getMass(Cidx))) <= trkSelOpt.cfgRapMax) { - if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTmcClosurePrim), multRec, flatRec, track.pt()); - } - } - }); - } - } - PROCESS_SWITCH(FlattenictyPikp, processMCclosure, "process MC closure test", false); - Preslice perCollTrk = aod::track::collisionId; PresliceUnsorted perCollMcLabel = aod::mccollisionlabel::mcCollisionId; Preslice perCollMcPart = aod::mcparticle::mcCollisionId; void processMC(MCColls const& mcCollisions, CollsGen const& collisions, + aod::BCsWithTimestamps const& /*bcs*/, MyLabeledPIDTracks const& tracks, + aod::FV0As const& /*fv0s*/, aod::McParticles const& mcparticles) { - flatchrg.fill(HIST("hEvtGenRec"), 1.f, mcCollisions.size()); - flatchrg.fill(HIST("hEvtGenRec"), 2.f, collisions.size()); + registryMC.fill(HIST("Events/hEvtGenRec"), 1.f, mcCollisions.size()); + registryMC.fill(HIST("Events/hEvtGenRec"), 2.f, collisions.size()); + // Generated collisions for (const auto& mcCollision : mcCollisions) { if (mcCollision.isInelGt0()) { - flatchrg.fill(HIST("hEvtGenRec"), 3.f); + registryMC.fill(HIST("Events/hEvtGenRec"), 3.f); } - flatchrg.fill(HIST("hEvtMcGenColls"), 1); + registryMC.fill(HIST("Events/hEvtMcGenColls"), 1); + const auto groupedColls = collisions.sliceBy(perCollMcLabel, mcCollision.globalIndex()); const auto groupedParts = mcparticles.sliceBy(perCollMcPart, mcCollision.globalIndex()); const float flatMC = fillFlatMC(groupedParts); - const float multMC = getMultMC(mcCollision); - if (groupedColls.size() < 1) { // if MC events have no rec collisions + registryMC.fill(HIST("Events/hFlatMCGen"), flatMC); + + auto multMC = -1.; + if (evtSelOpt.useMultMCmidrap || multEst == 2) { // use generated Nch in ∣eta∣ < 0.8 + multMC = countPart(groupedParts); + } else { + multMC = getMultMC(mcCollision); // using McCentFT0Ms + } + + if (groupedColls.size() < ConeInt) { // if MC events have no rec collisions continue; } - flatchrg.fill(HIST("hEvtMcGenColls"), 2); + + auto maxNcontributors = -1; + auto bestCollIndex = -1; for (const auto& collision : groupedColls) { - flatchrg.fill(HIST("hEvtMcGenColls"), 3); + registryMC.fill(HIST("Events/hEvtMCRec"), 0.5); + if (!isGoodEvent(collision)) { + continue; + } + registryMC.fill(HIST("Events/hEvtMCRec"), 1.5); + if (collision.isInelGt0()) { + registryMC.fill(HIST("Events/hEvtMCRec"), 2.5); + } + const float multRecGt1 = getMult(collision); + const float flatRec = fillFlat(collision); + registryMC.fill(HIST("Events/hFlatMCRec"), flatRec); + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + } + registryMC.fill(HIST("Events/hCentVsFlatRecINELgt0"), multRecGt1, flatRec); // Evt split den + } + registryMC.fill(HIST("Events/hEvtMcGenColls"), 2); + // + // Rec collisions w/ largest number of PV contributors + for (const auto& collision : groupedColls) { + if (trkSelOpt.cfgRejectTrkAtTPCSector || applyCalibGain || applyCalibVtx) { + auto bc = collision.bc_as(); + int currentRun = bc.runNumber(); + if (runNumber != currentRun) { + initCCDB(bc); + runNumber = currentRun; + } + } + const float multRecGt1 = getMult(collision); + const float flatRec = fillFlat(collision); + registryMC.fill(HIST("Events/hEvtMcGenColls"), 3); + if (bestCollIndex != collision.globalIndex()) { + continue; + } + registryMC.fill(HIST("Events/hCentVsFlatRecINELgt0wRecEvt"), multRecGt1, flatRec); // Evt split num, w/ Nrec > 0 if (!isGoodEvent(collision)) { continue; } - flatchrg.fill(HIST("hEvtMcGenColls"), 4); + registryMC.fill(HIST("Events/hEvtMcGenColls"), 4); + registryMC.fill(HIST("Events/hCentVsFlatRecINELgt0wRecEvtSel"), multRecGt1, flatRec); // Evt split num, w/ Nrec > 0 + Evt. sel + registryMC.fill(HIST("Events/hNchVsCent"), multRecGt1, multMC); + registryMC.fill(HIST("Events/hNchVsFlatGenINELgt0wRecEvtSel"), multMC, flatMC); // Evt loss num, w/ Nrec > 0 + Evt. sel + // + // Rec tracks; track selection w/ DCA open (for secondaries), w/ DCA close (for efficiency) + // Obtain here: DCAxy for sec contamination, closure const auto groupedTrks = tracks.sliceBy(perCollTrk, collision.globalIndex()); for (const auto& track : groupedTrks) { - if (!isDCAxyWoCut(track)) { + if (!track.has_collision()) { continue; } - if (!track.has_mcParticle()) { - flatchrg.fill(HIST("PtOutFakes"), track.pt()); + if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { continue; } - const auto& mcParticle = track.mcParticle(); - if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { + if (track.pt() < trkSelOpt.cfgTrkPtMin) { continue; } - if (!track.has_collision()) { + if (trkSelOpt.cfgApplyNcl && track.tpcNClsFound() < trkSelOpt.cfgNclTPCMin) { continue; } + if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { + continue; + } + 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)) { + continue; + } + if (!track.has_mcParticle()) { + registryMC.fill(HIST("Tracks/hPtFakes"), multMC, flatMC, track.pt()); + continue; + } + auto particle = track.mcParticle_as(); static_for<0, 1>([&](auto pidSgn) { fillMCRecTrack(track, multMC, flatMC); fillMCRecTrack(track, multMC, flatMC); fillMCRecTrack(track, multMC, flatMC); }); + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::sqrt(std::pow(std::fabs(o2::aod::pidutils::tpcNSigma(track)), 2) + std::pow(std::fabs(o2::aod::pidutils::tofNSigma(track)), 2) < trkSelOpt.cfgDcaNsigmaCombinedMax)) { + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + if (!particle.isPhysicalPrimary()) { + if (particle.getProcess() == CprocessIdWeak) { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyWeakAll), multMC, flatMC, track.pt(), track.dcaXY()); + } else { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyMatAll), multMC, flatMC, track.pt(), track.dcaXY()); + } + } else { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyPrimAll), multMC, flatMC, track.pt(), track.dcaXY()); + } + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTvsDCAxyAll), multMC, flatMC, track.pt(), track.dcaXY()); + } + } + }); + if (isDCAxyCut(track)) { + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + if (particle.isPhysicalPrimary()) { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CdEdxMcRecPrim), track.eta(), multMC, flatMC, track.p(), track.tpcSignal()); + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTeffPrimRecEvt), multRecGt1, flatRec, track.pt()); // Tracking eff. num + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTmcClosureRec), multMC, flatMC, track.pt()); + } + } + }); + } } if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { continue; } - - flatchrg.fill(HIST("Events/hVtxZRec"), collision.posZ()); - flatchrg.fill(HIST("Events/hVtxZGen"), mcCollision.posZ()); - - if (evtSelOpt.cfgINELCut.value) { - if (!o2::pwglf::isINELgt0mc(groupedParts, pdg)) { - continue; - } + registryMC.fill(HIST("Events/hVtxZRec"), collision.posZ()); + registryMC.fill(HIST("Events/hVtxZGen"), mcCollision.posZ()); + if (!pwglf::isINELgt0mc(groupedParts, pdg)) { + continue; } for (const auto& particle : groupedParts) { - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { + 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, 1>([&](auto pidSgn) { @@ -2487,17 +2437,41 @@ struct FlattenictyPikp { fillMCGen(particle, multMC, flatMC); fillMCGen(particle, multMC, flatMC); }); + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTrecCollPrimSgn), multMC, flatMC, particle.pt()); // Sgn loss num + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTeffGenPrimRecEvt), multRecGt1, flatRec, particle.pt()); // Tracking eff. den + } + }); } - } // reco collisions - - if (evtSelOpt.cfgINELCut.value) { - if (!o2::pwglf::isINELgt0mc(groupedParts, pdg)) { - continue; - } } + // Generated collisions without rec collision requirement + // Obtain here: signal loss den, event loss den, closure + // + registryMC.fill(HIST("Events/hEvtMcGen"), 0.5); + if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { + continue; + } + registryMC.fill(HIST("Events/hEvtMcGen"), 1.5); + if (!pwglf::isINELgt0mc(groupedParts, pdg)) { + continue; + } + registryMC.fill(HIST("Events/hEvtMcGen"), 2.5); + if (evtSelOpt.cfgUseInelgt0wTVX && !isInelGt0wTVX(groupedParts)) { // TVX trigger: FT0A + FT0C acceptance + continue; + } + registryMC.fill(HIST("Events/hEvtMcGen"), 3.5); + registryMC.fill(HIST("Events/hNchVsFlatGenINELgt0"), multMC, flatMC); // Evt loss den for (const auto& mcParticle : groupedParts) { - if (std::abs(mcParticle.y()) > trkSelOpt.cfgRapMax) { + if (!isChrgParticle(mcParticle.pdgCode())) { + continue; + } + if (std::abs(mcParticle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (mcParticle.pt() < trkSelOpt.cfgTrkPtMin) { continue; } static_for<0, 1>([&](auto pidSgn) { @@ -2505,15 +2479,23 @@ struct FlattenictyPikp { fillMCGen(mcParticle, multMC, flatMC); fillMCGen(mcParticle, multMC, flatMC); }); + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + // LOG(debug) << "fillMCGen for pidSgn '" << pidSgn << "' and id '" << static_cast(id) << " with index " << ChistIdx; + if (mcParticle.isPhysicalPrimary()) { + if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgn), multMC, flatMC, mcParticle.pt()); // Sgn loss den + registryMC.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTmcClosureGenPrim), multMC, flatMC, mcParticle.pt()); + } + } + }); } - static_for<0, 1>([&](auto pidSgn) { fillEfficiency(); fillEfficiency(); fillEfficiency(); }); - - } // gen collisions + } } PROCESS_SWITCH(FlattenictyPikp, processMC, "process MC", false); diff --git a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx index d6f8a6df09f..5dd2ed61719 100644 --- a/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/heavyionMultiplicity.cxx @@ -52,13 +52,11 @@ using namespace o2::aod::track; using namespace o2::aod::evsel; using CollisionDataTable = soa::Join; -using ColDataTablepp = soa::Join; using TrackDataTable = soa::Join; using FilTrackDataTable = soa::Filtered; using CollisionMCTrueTable = aod::McCollisions; using TrackMCTrueTable = aod::McParticles; using CollisionMCRecTable = soa::SmallGroups>; -using ColMCRecTablepp = soa::SmallGroups>; using TrackMCRecTable = soa::Join; using FilTrackMCRecTable = soa::Filtered; using V0TrackCandidates = soa::Join; @@ -87,6 +85,7 @@ enum { kSpOther, kSpStrangeDecay, kBkg, + kFake, kSpNotPrimary, kSpAll, kSpeciesend @@ -128,7 +127,7 @@ static constexpr TrackSelectionFlags::flagtype TrackSelectionDca = static constexpr TrackSelectionFlags::flagtype TrackSelectionDcaxyOnly = TrackSelectionFlags::kDCAxy; -AxisSpec axisEvent{10, 0.5, 10.5, "#Event", "EventAxis"}; +AxisSpec axisEvent{15, 0.5, 15.5, "#Event", "EventAxis"}; AxisSpec axisVtxZ{40, -20, 20, "Vertex Z", "VzAxis"}; AxisSpec axisEta{40, -2, 2, "#eta", "EtaAxis"}; AxisSpec axisEtaExtended{100, -5, 5, "#eta", "EtaAxisExtended"}; @@ -190,15 +189,14 @@ struct HeavyionMultiplicity { ConfigurableAxis binsMult{"binsMult", {500, 0.0f, +500.0f}, ""}; ConfigurableAxis binsDCA{"binsDCA", {500, -10.0f, 10.0f}, ""}; + Configurable isApplyTFcut{"isApplyTFcut", true, "Enable TimeFrameBorder cut"}; + Configurable isApplyITSROcut{"isApplyITSROcut", true, "Enable ITS ReadOutFrameBorder cut"}; Configurable isApplySameBunchPileup{"isApplySameBunchPileup", true, "Enable SameBunchPileup cut"}; Configurable isApplyGoodZvtxFT0vsPV{"isApplyGoodZvtxFT0vsPV", true, "Enable GoodZvtxFT0vsPV cut"}; - Configurable isApplyExtraCorrCut{"isApplyExtraCorrCut", false, "Enable extra NPVtracks vs FTOC correlation cut"}; - Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; - Configurable npvTracksCut{"npvTracksCut", 1.0f, "Apply extra NPVtracks cut"}; - Configurable ft0cCut{"ft0cCut", 1.0f, "Apply extra FT0C cut"}; Configurable isApplyNoCollInTimeRangeStandard{"isApplyNoCollInTimeRangeStandard", true, "Enable NoCollInTimeRangeStandard cut"}; Configurable isApplyNoCollInRofStandard{"isApplyNoCollInRofStandard", false, "Enable NoCollInRofStandard cut"}; Configurable isApplyNoHighMultCollInPrevRof{"isApplyNoHighMultCollInPrevRof", false, "Enable NoHighMultCollInPrevRof cut"}; + Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; Configurable isApplyFT0CbasedOccupancy{"isApplyFT0CbasedOccupancy", false, "Enable FT0CbasedOccupancy cut"}; Configurable isApplyCentFT0C{"isApplyCentFT0C", true, "Centrality based on FT0C"}; Configurable isApplyCentFV0A{"isApplyCentFV0A", false, "Centrality based on FV0A"}; @@ -207,9 +205,8 @@ struct HeavyionMultiplicity { Configurable isApplyCentFT0M{"isApplyCentFT0M", false, "Centrality based on FT0A + FT0C"}; Configurable isApplyCentNGlobal{"isApplyCentNGlobal", false, "Centrality based on global tracks"}; Configurable isApplyCentMFT{"isApplyCentMFT", false, "Centrality based on MFT tracks"}; - Configurable isApplySplitRecCol{"isApplySplitRecCol", false, "Split MC reco collisions"}; - Configurable isApplyInelgt0{"isApplyInelgt0", false, "Enable INEL > 0 condition"}; Configurable isApplyTVX{"isApplyTVX", false, "Enable TVX trigger sel"}; + Configurable isApplyExtraPhiCut{"isApplyExtraPhiCut", false, "Enable extra phi cut"}; void init(InitContext const&) { @@ -232,14 +229,15 @@ struct HeavyionMultiplicity { auto hstat = histos.get(HIST("EventHist")); auto* x = hstat->GetXaxis(); x->SetBinLabel(1, "All events"); - x->SetBinLabel(2, "sel8"); - x->SetBinLabel(3, "kNoSameBunchPileup"); // reject collisions in case of pileup with another collision in the same foundBC - x->SetBinLabel(4, "kIsGoodZvtxFT0vsPV"); // small difference between z-vertex from PV and from FT0 - x->SetBinLabel(5, "ApplyExtraCorrCut"); - x->SetBinLabel(6, "ApplyNoCollInTimeRangeStandard"); - x->SetBinLabel(7, "ApplyNoCollInRofStandard"); - x->SetBinLabel(8, "ApplyNoHighMultCollInPrevRof"); - x->SetBinLabel(9, "INEL > 0"); + x->SetBinLabel(2, "kIsTriggerTVX"); + x->SetBinLabel(3, "kNoTimeFrameBorder"); + x->SetBinLabel(4, "kNoITSROFrameBorder"); + x->SetBinLabel(5, "kNoSameBunchPileup"); // reject collisions in case of pileup with another collision in the same foundBC + x->SetBinLabel(6, "kIsGoodZvtxFT0vsPV"); // small difference between z-vertex from PV and from FT0 + x->SetBinLabel(7, "ApplyNoCollInTimeRangeStandard"); + x->SetBinLabel(8, "ApplyNoCollInRofStandard"); + x->SetBinLabel(9, "ApplyNoHighMultCollInPrevRof"); + x->SetBinLabel(10, "INEL > 0"); if (doprocessData) { histos.add("hdcaxy", "dca to pv in the xy plane", kTH1D, {dcaAxis}, false); @@ -251,7 +249,7 @@ struct HeavyionMultiplicity { histos.add("hdatadndetaMB", "hdatadndetaMB", kTHnSparseD, {axisVtxZ, axisEta, axisPhi}, false); } - if (doprocessMonteCarlo || doprocessMCpTefficiency || doprocessMCcheckFakeTracks) { + if (doprocessMonteCarlo || doprocessMCcheckFakeTracks) { histos.add("CentPercentileMCRecHist", "CentPercentileMCRecHist", kTH1D, {axisCent}, false); histos.add("hmczvtxcent", "hmczvtxcent", kTH3D, {axisVtxZ, centAxis, axisOccupancy}, false); } @@ -266,11 +264,6 @@ struct HeavyionMultiplicity { histos.add("hmcgendndetaMB", "hmcgendndetaMB", kTHnSparseD, {axisVtxZ, axisEta, axisPhi, axisSpecies}, false); } - if (doprocessMCpTefficiency) { - histos.add("hmcrecdndpt", "hmcrecdndpt", kTHnSparseD, {centAxis, axisOccupancy, axisTrackType, axisPt}, false); - histos.add("hmcgendndpt", "hmcgendndpt", kTHnSparseD, {centAxis, axisPt, axisGenPtVary}, false); - } - if (doprocessMCcheckFakeTracks) { histos.add("hTracksCount", "hTracksCount", kTHnSparseD, {centAxis, axisTracks}, false); auto htrack = histos.get(HIST("hTracksCount")); @@ -300,21 +293,6 @@ struct HeavyionMultiplicity { histos.add("AntiLambdaCentEtaMass", "AntiLambdaCentEtaMass", kTH3D, {centAxis, axisEta, axisMassLambda}, false); } - if (doprocessppData) { - histos.add("MultPercentileHist", "MultPercentileHist", kTH1D, {axisCent}, false); - histos.add("hdatazvtxmultpp", "hdatazvtxmultpp", kTH2D, {axisVtxZ, centAxis}, false); - histos.add("PhiVsEtaHistpp", "PhiVsEtaHistpp", kTH2D, {axisPhi2, axisEta}, false); - histos.add("hdatadndetapp", "hdatadndetapp", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisTrackType}, false); - } - - if (doprocessppMonteCarlo) { - histos.add("MultPercentileMCRecHist", "MultPercentileMCRecHist", kTH1D, {axisCent}, false); - histos.add("hmczvtxmultpp", "hmczvtxmultpp", kTH2D, {axisVtxZ, centAxis}, false); - histos.add("MCrecPhiVsEtaHistpp", "MCrecPhiVsEtaHistpp", kTH2D, {axisPhi2, axisEta}, false); - histos.add("hmcrecdndetapp", "hmcrecdndetapp", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisSpecies, axisTrackType}, false); - histos.add("hmcgendndetapp", "hmcgendndetapp", kTHnSparseD, {axisVtxZ, centAxis, axisEta, axisPhi, axisSpecies, axisGenPtVary}, false); - } - if (doprocessGen) { histos.add("MultBarrelEta10_vs_FT0A", "MultBarrelEta10_vs_FT0A", kTH2F, {axisMult, axisFt0aMult}, true); histos.add("MultBarrelEta10_vs_FT0C", "MultBarrelEta10_vs_FT0C", kTH2F, {axisMult, axisFt0cMult}, true); @@ -385,50 +363,42 @@ struct HeavyionMultiplicity { bool isEventSelected(CheckCol const& col) { histos.fill(HIST("EventHist"), 1); - - if (!col.sel8()) { + if (!col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { return false; } histos.fill(HIST("EventHist"), 2); - - if (isApplyTVX && !col.selection_bit(o2::aod::evsel::kIsTriggerTVX)) { - return false; - } - - if (isApplySameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + if (isApplyTFcut && !col.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { return false; } histos.fill(HIST("EventHist"), 3); - - if (isApplyGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + if (isApplyITSROcut && !col.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { return false; } histos.fill(HIST("EventHist"), 4); - - if (isApplyExtraCorrCut && col.multNTracksPV() > npvTracksCut && col.multFT0C() < (10 * col.multNTracksPV() - ft0cCut)) { + if (isApplySameBunchPileup && !col.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { return false; } histos.fill(HIST("EventHist"), 5); - - if (isApplyNoCollInTimeRangeStandard && !col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + if (isApplyGoodZvtxFT0vsPV && !col.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { return false; } histos.fill(HIST("EventHist"), 6); - - if (isApplyNoCollInRofStandard && !col.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + if (isApplyNoCollInTimeRangeStandard && !col.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { return false; } histos.fill(HIST("EventHist"), 7); - - if (isApplyNoHighMultCollInPrevRof && !col.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { + if (isApplyNoCollInRofStandard && !col.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { return false; } histos.fill(HIST("EventHist"), 8); - - if (isApplyInelgt0 && !col.isInelGt0()) { + if (isApplyNoHighMultCollInPrevRof && !col.selection_bit(o2::aod::evsel::kNoHighMultCollInPrevRof)) { return false; } histos.fill(HIST("EventHist"), 9); + if (isApplyInelgt0 && !col.isInelGt0()) { + return false; + } + histos.fill(HIST("EventHist"), 10); return true; } @@ -467,7 +437,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(); } @@ -580,17 +550,15 @@ struct HeavyionMultiplicity { histos.fill(HIST("NPVtracks_vs_GlobalMult"), cols.multNTracksPV(), nchTracks); } - void processMonteCarlo(CollisionMCTrueTable::iterator const&, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) + void processMonteCarlo(soa::Join::iterator const& mcCollision, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) { - - if (isApplySplitRecCol && (RecCols.size() == 0 || RecCols.size() > 1)) { - return; - } - for (const auto& RecCol : RecCols) { if (!isEventSelected(RecCol)) { continue; } + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } histos.fill(HIST("VtxZHist"), RecCol.posZ()); histos.fill(HIST("CentPercentileMCRecHist"), selColCent(RecCol)); histos.fill(HIST("hmczvtxcent"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol)); @@ -600,6 +568,15 @@ struct HeavyionMultiplicity { if (!isTrackSelected(Rectrack)) { continue; } + if (!Rectrack.has_mcParticle()) { + histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg), kGlobalplusITS); + histos.fill(HIST("hmcrecdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg)); + continue; + } + auto mcpart = Rectrack.mcParticle(); + if (RecCol.mcCollisionId() != mcpart.mcCollisionId()) { + continue; + } histos.fill(HIST("hmcdcaxy"), Rectrack.dcaXY()); histos.fill(HIST("hmcdcaz"), Rectrack.dcaZ()); histos.fill(HIST("MCrecPhiVsEtaHist"), Rectrack.phi(), Rectrack.eta()); @@ -611,43 +588,37 @@ struct HeavyionMultiplicity { histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kITSonly); } - if (Rectrack.has_mcParticle()) { - int pid = kBkg; - auto mcpart = Rectrack.template mcParticle_as(); - if (mcpart.isPhysicalPrimary()) { - switch (std::abs(mcpart.pdgCode())) { - case PDG_t::kPiPlus: - pid = kSpPion; - break; - case PDG_t::kKPlus: - pid = kSpKaon; - break; - case PDG_t::kProton: - pid = kSpProton; - break; - default: - pid = kSpOther; - break; - } - } else { - pid = kSpNotPrimary; - } - if (mcpart.has_mothers()) { - auto mcpartMother = mcpart.template mothers_as().front(); - if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { - pid = kSpStrangeDecay; - } + int pid = kFake; + if (mcpart.isPhysicalPrimary()) { + switch (std::abs(mcpart.pdgCode())) { + case PDG_t::kPiPlus: + pid = kSpPion; + break; + case PDG_t::kKPlus: + pid = kSpKaon; + break; + case PDG_t::kProton: + pid = kSpProton; + break; + default: + pid = kSpOther; + break; } - if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { - pid = kBkg; - } - mclabels.push_back(Rectrack.mcParticleId()); - histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(pid), kGlobalplusITS); - histos.fill(HIST("hmcrecdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(pid)); } else { - histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg), kGlobalplusITS); - histos.fill(HIST("hmcrecdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg)); + pid = kSpNotPrimary; + } + if (mcpart.has_mothers()) { + auto mcpartMother = mcpart.template mothers_as().front(); + if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { + pid = kSpStrangeDecay; + } } + if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { + pid = kFake; + } + mclabels.push_back(Rectrack.mcParticleId()); + histos.fill(HIST("hmcrecdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(pid), kGlobalplusITS); + histos.fill(HIST("hmcrecdndetaMB"), RecCol.posZ(), Rectrack.eta(), Rectrack.phi(), static_cast(pid)); } // track (mcrec) loop for (const auto& particle : GenParticles) { @@ -663,7 +634,6 @@ struct HeavyionMultiplicity { histos.fill(HIST("hmcgendndeta"), RecCol.posZ(), selColCent(RecCol), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTup); histos.fill(HIST("hmcgendndeta"), RecCol.posZ(), selColCent(RecCol), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTdown); } - int pid = 0; switch (std::abs(particle.pdgCode())) { case PDG_t::kPiPlus: @@ -685,53 +655,6 @@ struct HeavyionMultiplicity { } // collision loop } - void processMCpTefficiency(CollisionMCTrueTable::iterator const&, CollisionMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) - { - for (const auto& RecCol : RecCols) { - if (!isEventSelected(RecCol)) { - continue; - } - if (std::abs(RecCol.posZ()) >= vtxRange) { - continue; - } - histos.fill(HIST("VtxZHist"), RecCol.posZ()); - histos.fill(HIST("CentPercentileMCRecHist"), selColCent(RecCol)); - histos.fill(HIST("hmczvtxcent"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol)); - - auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); - for (const auto& Rectrack : recTracksPart) { - if (std::abs(Rectrack.eta()) >= etaRange) { - continue; - } - if (Rectrack.has_mcParticle()) { - auto mcpart = Rectrack.mcParticle(); - if (mcpart.isPhysicalPrimary()) { - histos.fill(HIST("hmcrecdndpt"), selColCent(RecCol), selColOccu(RecCol), kGlobalplusITS, mcpart.pt()); - if (Rectrack.hasTPC()) { - histos.fill(HIST("hmcrecdndpt"), selColCent(RecCol), selColOccu(RecCol), kGlobalonly, mcpart.pt()); - } else { - histos.fill(HIST("hmcrecdndpt"), selColCent(RecCol), selColOccu(RecCol), kITSonly, mcpart.pt()); - } - } - } - } - - for (const auto& particle : GenParticles) { - if (!isGenTrackSelected(particle)) { - continue; - } - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kNoGenpTVar); - if (particle.pt() < KminPtCut) { - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kGenpTup, -10.0 * particle.pt() + 2); - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kGenpTdown, 5.0 * particle.pt() + 0.5); - } else { - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kGenpTup); - histos.fill(HIST("hmcgendndpt"), selColCent(RecCol), particle.pt(), kGenpTdown); - } - } - } - } - void processMCcheckFakeTracks(CollisionMCTrueTable::iterator const&, CollisionMCRecTable const& RecCols, FilTrackMCRecTable const& RecTracks) { for (const auto& RecCol : RecCols) { @@ -798,129 +721,6 @@ struct HeavyionMultiplicity { } } - void processppData(ColDataTablepp::iterator const& cols, FilTrackDataTable const& tracks) - { - if (!isEventSelected(cols)) { - return; - } - - histos.fill(HIST("VtxZHist"), cols.posZ()); - histos.fill(HIST("MultPercentileHist"), cols.centFT0M()); - histos.fill(HIST("hdatazvtxmultpp"), cols.posZ(), cols.centFT0M()); - - for (const auto& track : tracks) { - if (!isTrackSelected(track)) { - continue; - } - histos.fill(HIST("PhiVsEtaHistpp"), track.phi(), track.eta()); - histos.fill(HIST("hdatadndetapp"), cols.posZ(), cols.centFT0M(), track.eta(), track.phi(), kGlobalplusITS); - if (track.hasTPC()) { - histos.fill(HIST("hdatadndetapp"), cols.posZ(), cols.centFT0M(), track.eta(), track.phi(), kGlobalonly); - } else { - histos.fill(HIST("hdatadndetapp"), cols.posZ(), cols.centFT0M(), track.eta(), track.phi(), kITSonly); - } - } // track loop - } - - void processppMonteCarlo(CollisionMCTrueTable::iterator const&, ColMCRecTablepp const& RecCols, TrackMCTrueTable const& GenParticles, FilTrackMCRecTable const& RecTracks) - { - if (isApplySplitRecCol && (RecCols.size() == 0 || RecCols.size() > 1)) { - return; - } - - for (const auto& RecCol : RecCols) { - if (!isEventSelected(RecCol)) { - continue; - } - auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); - std::vector mclabels; - - histos.fill(HIST("VtxZHist"), RecCol.posZ()); - histos.fill(HIST("MultPercentileMCRecHist"), RecCol.centFT0M()); - histos.fill(HIST("hmczvtxmultpp"), RecCol.posZ(), RecCol.centFT0M()); - - for (const auto& Rectrack : recTracksPart) { - if (!isTrackSelected(Rectrack)) { - continue; - } - histos.fill(HIST("MCrecPhiVsEtaHistpp"), Rectrack.phi(), Rectrack.eta()); - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kGlobalplusITS); - if (Rectrack.hasTPC()) { - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kGlobalonly); - } else { - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kSpAll), kITSonly); - } - - if (Rectrack.has_mcParticle()) { - int pid = kBkg; - auto mcpart = Rectrack.template mcParticle_as(); - if (mcpart.isPhysicalPrimary()) { - switch (std::abs(mcpart.pdgCode())) { - case PDG_t::kPiPlus: - pid = kSpPion; - break; - case PDG_t::kKPlus: - pid = kSpKaon; - break; - case PDG_t::kProton: - pid = kSpProton; - break; - default: - pid = kSpOther; - break; - } - } else { - pid = kSpNotPrimary; - } - if (mcpart.has_mothers()) { - auto mcpartMother = mcpart.template mothers_as().front(); - if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { - pid = kSpStrangeDecay; - } - } - if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { - pid = kBkg; - } - mclabels.push_back(Rectrack.mcParticleId()); - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(pid), kGlobalplusITS); - } else { - histos.fill(HIST("hmcrecdndetapp"), RecCol.posZ(), RecCol.centFT0M(), Rectrack.eta(), Rectrack.phi(), static_cast(kBkg), kGlobalplusITS); - } - } // track (mcrec) loop - - for (const auto& particle : GenParticles) { - if (!isGenTrackSelected(particle)) { - continue; - } - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kNoGenpTVar); - if (particle.pt() < KminPtCut) { - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTup, -10.0 * particle.pt() + 2); - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTdown, 5.0 * particle.pt() + 0.5); - } else { - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTup); - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(kSpAll), kGenpTdown); - } - - int pid = 0; - switch (std::abs(particle.pdgCode())) { - case PDG_t::kPiPlus: - pid = kSpPion; - break; - case PDG_t::kKPlus: - pid = kSpKaon; - break; - case PDG_t::kProton: - pid = kSpProton; - break; - default: - pid = kSpOther; - break; - } - histos.fill(HIST("hmcgendndetapp"), RecCol.posZ(), RecCol.centFT0M(), particle.eta(), particle.phi(), static_cast(pid), kNoGenpTVar); - } // track (mcgen) loop - } // collision loop - } - void processGen(aod::McCollisions::iterator const&, aod::McParticles const& GenParticles) { @@ -1125,44 +925,48 @@ struct HeavyionMultiplicity { if (!isTrackSelected(Rectrack)) { continue; } + if (!Rectrack.has_mcParticle()) { + histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoBkg)); + continue; + } + auto mcpart = Rectrack.mcParticle(); + if (RecCol.mcCollisionId() != mcpart.mcCollisionId()) { + continue; + } histos.fill(HIST("hRecMCphivseta"), Rectrack.phi(), Rectrack.eta()); histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoAll)); - if (Rectrack.has_mcParticle()) { - int pid = 0; - auto mcpart = Rectrack.mcParticle(); - histos.fill(HIST("etaResolution"), Rectrack.eta(), Rectrack.eta() - mcpart.eta()); - if (mcpart.isPhysicalPrimary()) { - switch (std::abs(mcpart.pdgCode())) { - case PDG_t::kPiPlus: - pid = kRecoPion; - break; - case PDG_t::kKPlus: - pid = kRecoKaon; - break; - case PDG_t::kProton: - pid = kRecoProton; - break; - default: - pid = kRecoOther; - break; - } - } else { - pid = kRecoSecondary; - } - if (mcpart.has_mothers()) { - auto mcpartMother = mcpart.template mothers_as().front(); - if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { - pid = kRecoWeakDecay; - } - } - if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { - pid = kRecoFake; + + int pid = 0; + histos.fill(HIST("etaResolution"), Rectrack.eta(), Rectrack.eta() - mcpart.eta()); + if (mcpart.isPhysicalPrimary()) { + switch (std::abs(mcpart.pdgCode())) { + case PDG_t::kPiPlus: + pid = kRecoPion; + break; + case PDG_t::kKPlus: + pid = kRecoKaon; + break; + case PDG_t::kProton: + pid = kRecoProton; + break; + default: + pid = kRecoOther; + break; } - mclabels.push_back(Rectrack.mcParticleId()); - histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), mcpart.eta(), mcpart.phi(), static_cast(pid)); } else { - histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), Rectrack.eta(), Rectrack.phi(), static_cast(kRecoBkg)); + pid = kRecoSecondary; + } + if (mcpart.has_mothers()) { + auto mcpartMother = mcpart.template mothers_as().front(); + if (mcpartMother.pdgCode() == PDG_t::kK0Short || std::abs(mcpartMother.pdgCode()) == PDG_t::kLambda0) { + pid = kRecoWeakDecay; + } + } + if (find(mclabels.begin(), mclabels.end(), Rectrack.mcParticleId()) != mclabels.end()) { + pid = kRecoFake; } + mclabels.push_back(Rectrack.mcParticleId()); + histos.fill(HIST("hRecMCdndeta"), RecCol.posZ(), selColCent(RecCol), selColOccu(RecCol), mcpart.eta(), mcpart.phi(), static_cast(pid)); } // track (mcrec) loop } // collision loop } @@ -1170,11 +974,8 @@ struct HeavyionMultiplicity { PROCESS_SWITCH(HeavyionMultiplicity, processData, "process data CentFT0C", false); PROCESS_SWITCH(HeavyionMultiplicity, processCorrelation, "do correlation study in data", false); PROCESS_SWITCH(HeavyionMultiplicity, processMonteCarlo, "process MC CentFT0C", false); - PROCESS_SWITCH(HeavyionMultiplicity, processMCpTefficiency, "process MC pTefficiency", false); PROCESS_SWITCH(HeavyionMultiplicity, processMCcheckFakeTracks, "Check Fake tracks", false); PROCESS_SWITCH(HeavyionMultiplicity, processStrangeYield, "Strange particle yield", false); - PROCESS_SWITCH(HeavyionMultiplicity, processppData, "process pp data", false); - PROCESS_SWITCH(HeavyionMultiplicity, processppMonteCarlo, "process pp MC", false); PROCESS_SWITCH(HeavyionMultiplicity, processGen, "process pure MC gen", false); PROCESS_SWITCH(HeavyionMultiplicity, processEvtLossSigLossMC, "process Signal Loss, Event Loss", false); PROCESS_SWITCH(HeavyionMultiplicity, processMCeff, "process extra efficiency function", false); diff --git a/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx b/PWGLF/Tasks/GlobalEventProperties/studyPnch.cxx index cab9f30cb9a..62f5e93d830 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); @@ -250,7 +256,6 @@ struct StudyPnch { if (!isGenTrackSelected(track)) { continue; } - // Verify that the track belongs to the given MC collision if (track.mcCollisionId() != McCol.globalIndex()) { continue; } @@ -270,7 +275,6 @@ struct StudyPnch { if (!isTrackSelected(track)) { continue; } - // Verify that the track belongs to the given MC collision if (track.has_mcParticle()) { auto particle = track.mcParticle(); if (particle.mcCollisionId() != McCol.mcCollisionId()) { @@ -281,7 +285,7 @@ struct StudyPnch { } histos.fill(HIST("PhiVsEtaHist"), track.phi(), track.eta()); } - // Once all the frequencies have been counted, a loop can be made to fill the histogram + // Loop to fill the histogram without cloned tracks for (const auto& [globalIndex, frequency] : recoFrequencies) { histos.fill(HIST("hCountNTracks"), frequency); // Fill histogram with not cloned tracks @@ -343,6 +347,32 @@ 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; + } + // Evaluation of reconstructed collisions with more than 1 contributor + if (RecCol.globalIndex() != mcCollision.bestCollisionIndex()) { + continue; + } + if (!RecCol.has_mcCollision()) { + continue; + } + auto recTracksPart = RecTracks.sliceBy(perCollision, RecCol.globalIndex()); + auto multrec = countNTracksMcCol(recTracksPart, RecCol); + if (multrec > 0) { + histos.fill(HIST("hMultiplicityMCrecMod"), multrec); + } + auto multgen = countGenTracks(GenParticles, mcCollision); + if (multgen > 0 && multrec > 0) { + histos.fill(HIST("hMultiplicityMCgenMod"), multgen); + histos.fill(HIST("hResponseMatrixMod"), multrec, multgen); + } + } + } + void processEvtLossSigLossMC(soa::Join::iterator const& mcCollision, ColMCRecTable const& RecCols, TrackMCTrueTable const& GenParticles) { if (isApplyInelgt0 && !mcCollision.isInelGt0()) { @@ -387,6 +417,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..1a71c04db8b --- /dev/null +++ b/PWGLF/Tasks/Nuspex/multiplicityPt.cxx @@ -0,0 +1,1215 @@ +// 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 "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 // 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; + +struct MultiplicityPt { + + // Service + Service pdg; + Service ccdb; + 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 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 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"}; + + // 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; + + // TF1 pointers for phi cuts + TF1* fphiCutLow = nullptr; + TF1* fphiCutHigh = nullptr; + + // Histogram Registry + HistogramRegistry ue; + + // 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; + + 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; + + // Get magnetic field from CCDB + 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(); + } + + // Get transformed phi for phi cut (with magnetic field) + 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; + } + + // Phi cut function (with magnetic field) + 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; + } + + 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, 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 (!passesDCAxyCut(track)) + return false; + + if (!passedNClTPCFoundCut(track)) + return false; + + if (!passedNClTPCPIDCut(track)) + return false; + + // Add phi cut with magnetic field + if (!passedPhiCut(track, magField)) + 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; + } + + 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); + + 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 ==="; + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} + +void MultiplicityPt::init(InitContext const&) +{ + LOG(info) << "=================================================="; + LOG(info) << "Initializing MultiplicityPt task with full centrality diagnostics"; + LOG(info) << "=================================================="; + + // Initialize phi cut functions + 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); + } + + 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}"}; + + // 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}); + + // Phi cut monitoring histograms + 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}}); + } + + // 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%)"; + if (applyPhiCut.value) { + LOG(info) << "Phi cut ENABLED for pT > " << pTthresholdPhiCut.value << " GeV/c"; + } +} + +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(); + + 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."; + + 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(); + + 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(); + + 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++; + + // Get magnetic field for phi cut + float magField = 0; + if (applyPhiCut.value) { + const auto& bc = collision.bc_as(); + magField = getMagneticField(bc.timestamp()); + } + + // Process tracks in selected events + int nTracksInEvent = 0; + for (const auto& track : tracks) { + if (!track.has_collision()) + continue; + if (track.collisionId() != collId) + continue; + + // Fill phi cut monitoring before cut + 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; + } + + // Fill phi cut monitoring after cut + if (applyPhiCut.value && track.pt() >= pTthresholdPhiCut.value) { + float phiPrime = getTransformedPhi(track.phi(), track.sign(), magField); + ue.fill(HIST("PhiCut/hPtVsPhiPrimeAfter"), track.pt(), phiPrime); + } + + 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/QC/CMakeLists.txt b/PWGLF/Tasks/QC/CMakeLists.txt index 319d21d9d96..e1618a43d06 100644 --- a/PWGLF/Tasks/QC/CMakeLists.txt +++ b/PWGLF/Tasks/QC/CMakeLists.txt @@ -11,7 +11,7 @@ o2physics_add_dpl_workflow(v0cascades-qa SOURCES v0cascadesqa.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(track-checks diff --git a/PWGLF/Tasks/QC/v0cascadesqa.cxx b/PWGLF/Tasks/QC/v0cascadesqa.cxx index dc3d615cc57..962687d2869 100644 --- a/PWGLF/Tasks/QC/v0cascadesqa.cxx +++ b/PWGLF/Tasks/QC/v0cascadesqa.cxx @@ -9,15 +9,22 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. // +/// \file v0cascadesqa.cxx /// \brief QA task for V0s and Cascades /// +/// /// In case of questions please write to: /// \author Aimeric Landou (aimeric.landou@cern.ch) /// \author Chiara De Martin (chiara.de.martin@cern.ch) /// \author Francesca Ercolessi (francesca.ercolessi@cern.ch) +/// \author Romain Schotter (romain.schotter@cern.ch) +#include +// #include +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" @@ -34,382 +41,1073 @@ #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/Track.h" -#include +#include + +using namespace o2::aod::rctsel; using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using MyTracks = soa::Join; -using MyTracksMC = soa::Join; -using DaughterTracks = soa::Join; +enum ParticleType : uint8_t { kPhoton = 0, + kK0s, + kLambda, + kAntiLambda, + kXiM, + kXiP, + kOmegaM, + kOmegaP }; + +// using DaughterTracks = soa::Join; +using DaughterTracks = soa::Join; struct v0cascadesQA { - static constexpr float defaultLifetimeCuts[1][2] = {{25., 20.}}; + HistogramRegistry histos_event{"histos_event", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histos_V0{"histos_V0", {}, OutputObjHandlingPolicy::AnalysisObject}; + HistogramRegistry histos_Casc{"histos_Casc", {}, OutputObjHandlingPolicy::AnalysisObject}; // configurable event properties - Configurable isMC{"isMC", false, "does the data have MC info"}; - Configurable sel8{"sel8", 0, "Apply sel8 event selection"}; - Configurable doextraanalysis{"doextraanalysis", 0, "Add extra histograms"}; - - // configurable track properties - Configurable checkDauTPC{"checkDauTPC", false, "check if daughter tracks have TPC match"}; - - // configurable binning of histograms - ConfigurableAxis binPt{"binPt", {100, 0.0f, 10.0f}, ""}; - ConfigurableAxis binPtsmall{"binPtsmall", {50, 0.0f, 10.0f}, ""}; - ConfigurableAxis binV0CosPA{"binV0CosPA", {200, 0.8f, 1.0f}, ""}; - ConfigurableAxis binV0PA{"binV0PA", {1000, 0.f, 1.0f}, ""}; - ConfigurableAxis binV0Radius{"binV0Radius", {100, 0.0f, 10.0f}, ""}; - ConfigurableAxis binV0DecayLength{"binV0DecayLength", {100, 0.0f, 10.0f}, ""}; - ConfigurableAxis binV0DCANegToPV{"binV0DCANegToPV", {100, -1.0f, 1.0f}, ""}; - ConfigurableAxis binV0DCAPosToPV{"binV0DCAPosToPV", {100, -1.0f, 1.0f}, ""}; - ConfigurableAxis binV0DCAV0Dau{"binV0DCAV0Dau", {55, 0.0f, 2.20f}, ""}; - ConfigurableAxis binCtauK0s{"binCtauK0s", {65, 0.0f, 13.0f}, ""}; - ConfigurableAxis binCtauLambda{"binCtauLambda", {100, 0.0f, 40.0f}, ""}; - ConfigurableAxis binCtauAntiLambda{"binCtauAntiLambda", {100, 0.0f, 40.0f}, ""}; - ConfigurableAxis binDecayLengthK0s{"binDecayLengthK0s", {100, 0.0f, 40.0f}, ""}; - ConfigurableAxis binDecayLengthLambda{"binDecayLengthLambda", {100, 0.0f, 80.0f}, ""}; - ConfigurableAxis binDecayLengthAntiLambda{"binDecayLengthAntiLambda", {100, 0.0f, 80.0f}, ""}; - ConfigurableAxis binV0DCAV0ToPVK0S{"binV0DCAV0ToPVK0S", {250, 0.0f, 0.25f}, ""}; - ConfigurableAxis binV0DCAV0ToPVLambda{"binV0DCAV0ToPVLambda", {250, 0.0f, 0.25f}, ""}; - ConfigurableAxis binV0DCAV0ToPVAntiLambda{"binV0DCAV0ToPVAntiLambda", {250, 0.0f, 0.25f}, ""}; - ConfigurableAxis binInvMassK0S{"binInvMassK0S", {200, 0.4f, 0.6f}, ""}; - ConfigurableAxis binInvMassLambda{"binInvMassLambda", {200, 1.07f, 1.17f}, ""}; - ConfigurableAxis binInvMassAntiLambda{"binInvMassAntiLambda", {200, 1.07f, 1.17f}, ""}; - ConfigurableAxis binResponsePionFromLambda{"binResponsePionFromLambda", {200, -20.f, 20.f}, ""}; - ConfigurableAxis binResponseProtonFromLambda{"binResponseProtonFromLambda", {200, -20.f, 20.f}, ""}; - ConfigurableAxis binEtaFlag{"binEtaFlag", {3, -1.5f, 1.5f}, ""}; - ConfigurableAxis binEta{"binEta", {100, -1.0f, 1.0f}, ""}; - ConfigurableAxis binPhi{"binPhi", {static_cast(TMath::Pi()) * 10 / 2, 0.0f, 2. * static_cast(TMath::Pi())}, ""}; - ConfigurableAxis binRadius{"binRadius", {100, 0.0f, 50.0f}, ""}; - ConfigurableAxis binRadiussmall{"binRadiussmall", {30, 0.0f, 30.0f}, ""}; - ConfigurableAxis binITSMapDaughters{"binITSMapDaughters", {8, -0.5f, 7.5f}, ""}; - ConfigurableAxis binInvMassCasc{"binInvMassCasc", {1000, 0.f, 1.0f}, ""}; - - // configurables for V0s - Configurable V0_rapidity{"V0_rapidity", 0.5, "rapidity"}; - Configurable V0_cosPA{"V0_cosPA", 0.995, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0) - Configurable V0_dcav0dau{"V0_dcav0dau", 1, "DCA V0 Daughters"}; - Configurable V0_dcapostopv{"V0_dcapostopv", 0.1, "DCA Pos To PV"}; - Configurable V0_dcanegtopv{"V0_dcanegtopv", 0.1, "DCA Neg To PV"}; - Configurable V0_radius{"V0_radius", 5, "v0radius"}; - Configurable NSigmaV0Pion{"NSigmaV0Pion", 6, "NSigmaV0Pion"}; - Configurable NSigmaV0Proton{"NSigmaV0Proton", 6, "NSigmaV0Proton"}; - Configurable> lifetimecut{"lifetimecut", {defaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0S"}}, "lifetimecut"}; - - // configurables for Cascades - Configurable Casc_rapidity{"Casc_rapidity", 0.5, "rapidity"}; - Configurable Casc_v0cospa{"Casc_V0cospa", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0) - Configurable Casc_casccospa{"Casc_casccospa", 0.98, "Cascade CosPA"}; // AliAnalysisTaskStrAODqa: 0.9992 //double -> N.B. dcos(x)/dx = 0 at x=0) - Configurable Casc_dcav0dau{"Casc_dcav0dau", 1.0, "DCA V0 Daughters"}; // AliAnalysisTaskStrAODqa: 1. different scale - Configurable Casc_dcacascdau{"Casc_dcacascdau", 0.6, "DCA Casc Daughters"}; // AliAnalysisTaskStrAODqa: 0.3 different scale - Configurable Casc_dcav0topv{"Casc_dcav0topv", 0.1, "DCA Pos To PV"}; // AliAnalysisTaskStrAODqa: 0.15 different scale - Configurable Casc_dcabachtopv{"Casc_dcabachtopv", .1, "DCA Bach To PV"}; // AliAnalysisTaskStrAODqa: 0.17 different scale - Configurable Casc_dcapostopv{"Casc_dcapostopv", 0.1, "DCA V0 To PV"}; // AliAnalysisTaskStrAODqa: if( fCasc_charge>0 &&(fCasc_DcaPosToPV < 0.3 || fCasc_DcaNegToPV < 0.11)) return kFALSE; different scale - Configurable Casc_dcanegtopv{"Casc_dcanegtopv", 0.1, "DCA Neg To PV"}; // AliAnalysisTaskStrAODqa: if( fCasc_charge<0 &&(fCasc_DcaPosToPV < 0.11 || fCasc_DcaNegToPV < 0.3)) return kFALSE; different scale - Configurable Casc_v0radius{"Casc_v0radius", 0.9, "v0 radius"}; // AliAnalysisTaskStrAODqa: 5. - Configurable Casc_cascradius{"Casc_cascradius", 1.0, "cascade radius"}; // AliAnalysisTaskStrAODqa: 1. - Configurable NSigmaCascPion{"NSigmaCascPion", 6, "NSigmaCascPion"}; - Configurable NSigmaCascProton{"NSigmaCascProton", 6, "NSigmaCascProton"}; - Configurable NSigmaCascKaon{"NSigmaCascKaon", 6, "NSigmaCascKaon"}; - - OutputObj V0SelectionSummary{TH1F("V0SelectionSummary", "V0SelectionSummary; Selections; Cut", 10, 0., 10.)}; - HistogramRegistry histos_eve{"histos-eve", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - HistogramRegistry histos_V0{"histos-V0", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; - HistogramRegistry histos_Casc{"histos-Casc", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; + bool isMC = false; + Configurable doextraanalysis{"doextraanalysis", false, "Add extra histograms"}; + Configurable doTreatPiToMuon{"doTreatPiToMuon", true, "Take pi decay into muon into account in MC"}; + Configurable irSource{"irSource", "", "Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; + + struct : ConfigurableGroup { + std::string prefix = "eventSelections"; // JSON group name + Configurable requireSel8{"requireSel8", true, "require sel8 event selection"}; + Configurable requireTriggerTVX{"requireTriggerTVX", true, "require FT0 vertex (acceptable FT0C-FT0A time difference) at trigger level"}; + Configurable rejectITSROFBorder{"rejectITSROFBorder", true, "reject events at ITS ROF border (Run 3 only)"}; + Configurable rejectTFBorder{"rejectTFBorder", true, "reject events at TF border (Run 3 only)"}; + Configurable requireIsVertexITSTPC{"requireIsVertexITSTPC", false, "require events with at least one ITS-TPC track (Run 3 only)"}; + Configurable requireIsGoodZvtxFT0VsPV{"requireIsGoodZvtxFT0VsPV", false, "require events with PV position along z consistent (within 1 cm) between PV reconstructed using tracks and PV using FT0 A-C time difference (Run 3 only)"}; + Configurable requireIsVertexTOFmatched{"requireIsVertexTOFmatched", false, "require events with at least one of vertex contributors matched to TOF (Run 3 only)"}; + Configurable requireIsVertexTRDmatched{"requireIsVertexTRDmatched", false, "require events with at least one of vertex contributors matched to TRD (Run 3 only)"}; + Configurable rejectSameBunchPileup{"rejectSameBunchPileup", false, "reject collisions in case of pileup with another collision in the same foundBC (Run 3 only)"}; + Configurable requireNoCollInTimeRangeStd{"requireNoCollInTimeRangeStd", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds (Run 3 only)"}; + Configurable requireNoCollInTimeRangeStrict{"requireNoCollInTimeRangeStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 10 microseconds (Run 3 only)"}; + Configurable requireNoCollInTimeRangeNarrow{"requireNoCollInTimeRangeNarrow", false, "reject collisions corrupted by the cannibalism, with other collisions within +/- 2 microseconds (Run 3 only)"}; + Configurable requireNoCollInROFStd{"requireNoCollInROFStd", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF with mult. above a certain threshold (Run 3 only)"}; + Configurable requireNoCollInROFStrict{"requireNoCollInROFStrict", false, "reject collisions corrupted by the cannibalism, with other collisions within the same ITS ROF (Run 3 only)"}; + Configurable requireINEL0{"requireINEL0", false, "require INEL>0 event selection"}; + Configurable requireINEL1{"requireINEL1", false, "require INEL>1 event selection"}; + + Configurable maxZVtxPosition{"maxZVtxPosition", 10., "max Z vtx position"}; + + Configurable useEvtSelInDenomEff{"useEvtSelInDenomEff", false, "Consider event selections in the recoed <-> gen collision association for the denominator (or numerator) of the acc. x eff. (or signal loss)?"}; + Configurable applyZVtxSelOnMCPV{"applyZVtxSelOnMCPV", false, "Apply Z-vtx cut on the PV of the generated collision?"}; + Configurable useFT0CbasedOccupancy{"useFT0CbasedOccupancy", false, "Use sum of FT0-C amplitudes for estimating occupancy? (if not, use track-based definition)"}; + // fast check on occupancy + Configurable minOccupancy{"minOccupancy", -1, "minimum occupancy from neighbouring collisions"}; + Configurable maxOccupancy{"maxOccupancy", -1, "maximum occupancy from neighbouring collisions"}; + // fast check on interaction rate + Configurable minIR{"minIR", -1, "minimum IR collisions"}; + Configurable maxIR{"maxIR", -1, "maximum IR collisions"}; + } eventSelections; + + struct : ConfigurableGroup { + std::string prefix = "rctConfigurations"; // JSON group name + Configurable cfgRCTLabel{"cfgRCTLabel", "", "Which detector condition requirements? (CBT, CBT_hadronPID, CBT_electronPID, CBT_calo, CBT_muon, CBT_muon_glo)"}; + Configurable cfgCheckZDC{"cfgCheckZDC", false, "Include ZDC flags in the bit selection (for Pb-Pb only)"}; + Configurable cfgTreatLimitedAcceptanceAsBad{"cfgTreatLimitedAcceptanceAsBad", false, "reject all events where the detectors relevant for the specified Runlist are flagged as LimitedAcceptance"}; + } rctConfigurations; + + RCTFlagsChecker rctFlagsChecker{rctConfigurations.cfgRCTLabel.value}; + + static constexpr float DefaultLifetimeCuts[1][2] = {{30., 20.}}; + + struct : ConfigurableGroup { + std::string prefix = "v0Selections"; // JSON group name + Configurable v0TypeSelection{"v0TypeSelection", 1, "select on a certain V0 type (leave negative if no selection desired)"}; + + // Selection criteria: acceptance + Configurable rapidityCut{"rapidityCut", 0.5, "rapidity"}; + Configurable daughterEtaCut{"daughterEtaCut", 0.8, "max eta for daughters"}; + + // Standard 5 topological criteria + Configurable v0cospa{"v0cospa", 0.97, "min V0 CosPA"}; + Configurable dcav0dau{"dcav0dau", 1.0, "max DCA V0 Daughters (cm)"}; + Configurable dcanegtopv{"dcanegtopv", .05, "min DCA Neg To PV (cm)"}; + Configurable dcapostopv{"dcapostopv", .05, "min DCA Pos To PV (cm)"}; + Configurable v0radius{"v0radius", 1.2, "minimum V0 radius (cm)"}; + Configurable v0radiusMax{"v0radiusMax", 1E5, "maximum V0 radius (cm)"}; + Configurable> lifetimecut{"lifetimecut", {DefaultLifetimeCuts[0], 2, {"lifetimecutLambda", "lifetimecutK0s"}}, "lifetimecut"}; + + // invariant mass selection + Configurable compMassRejection{"compMassRejection", -1, "Competing mass rejection (GeV/#it{c}^{2})"}; + + // Additional selection on the AP plot (exclusive for K0Short) + // original equation: lArmPt*5>TMath::Abs(lArmAlpha) + Configurable armPodCut{"armPodCut", 5.0f, "pT * (cut) > |alpha|, AP cut. Negative: no cut"}; + + // Track quality + Configurable minTPCrows{"minTPCrows", 70, "minimum TPC crossed rows"}; + Configurable minITSclusters{"minITSclusters", -1, "minimum ITS clusters"}; + Configurable maxFractionTPCSharedClusters{"maxFractionTPCSharedClusters", 1e+09, "maximum fraction of TPC shared clusters"}; + Configurable maxITSchi2PerNcls{"maxITSchi2PerNcls", 1e+09, "maximum ITS chi2 per clusters"}; + Configurable maxTPCchi2PerNcls{"maxTPCchi2PerNcls", 1e+09, "maximum TPC chi2 per clusters"}; + Configurable skipTPConly{"skipTPConly", false, "skip V0s comprised of at least one TPC only prong"}; + Configurable requirePosITSonly{"requirePosITSonly", false, "require that positive track is ITSonly (overrides TPC quality)"}; + Configurable requireNegITSonly{"requireNegITSonly", false, "require that negative track is ITSonly (overrides TPC quality)"}; + Configurable rejectPosITSafterburner{"rejectPosITSafterburner", false, "reject positive track formed out of afterburner ITS tracks"}; + Configurable rejectNegITSafterburner{"rejectNegITSafterburner", false, "reject negative track formed out of afterburner ITS tracks"}; + Configurable requirePosITSafterburnerOnly{"requirePosITSafterburnerOnly", false, "require positive track formed out of afterburner ITS tracks"}; + Configurable requireNegITSafterburnerOnly{"requireNegITSafterburnerOnly", false, "require negative track formed out of afterburner ITS tracks"}; + Configurable requireAtLeastOneHasTOF{"requireAtLeastOneHasTOF", false, "require that at least one of daughter tracks has an associated TOF signal"}; + Configurable requirePosHasTOF{"requirePosHasTOF", false, "require that positive track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requireNegHasTOF{"requireNegHasTOF", false, "require that negative track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requirePosHasTRD{"requirePosHasTRD", false, "require that positive track is formed out of TRD track."}; + Configurable requireNegHasTRD{"requireNegHasTRD", false, "require that negative track is formed out of TRD track."}; + Configurable minTRDclusters{"minTRDclusters", -1, "minimum TRD clusters IF track is formed out of a TRD track"}; + + // PID (TPC/TOF) + Configurable tpcPidNsigmaCutLaPr{"tpcPidNsigmaCutLaPr", 5, "tpcPidNsigmaCutLaPr"}; + Configurable tpcPidNsigmaCutLaPi{"tpcPidNsigmaCutLaPi", 5, "tpcPidNsigmaCutLaPi"}; + Configurable tpcPidNsigmaCutK0Pi{"tpcPidNsigmaCutK0Pi", 5, "tpcPidNsigmaCutK0Pi"}; + + // PID (TOF) + Configurable tofPidNsigmaCutLaPr{"tofPidNsigmaCutLaPr", 1e+6, "tofPidNsigmaCutLaPr"}; + Configurable tofPidNsigmaCutLaPi{"tofPidNsigmaCutLaPi", 1e+6, "tofPidNsigmaCutLaPi"}; + Configurable tofPidNsigmaCutK0Pi{"tofPidNsigmaCutK0Pi", 1e+6, "tofPidNsigmaCutK0Pi"}; + } v0Selections; + + struct : ConfigurableGroup { + std::string prefix = "cascadeSelections"; // JSON group name + // Selection criteria: acceptance + Configurable rapidityCut{"rapidityCut", 0.5, "rapidity"}; + Configurable daughterEtaCut{"daughterEtaCut", 0.8, "max eta for daughters"}; + + // Standard 6 topological criteria on V0 + Configurable v0cospa{"v0cospa", 0.97, "min V0 CosPA"}; + Configurable dcav0dau{"dcav0dau", 1.0, "max DCA V0 Daughters (cm)"}; + Configurable dcav0topv{"dcav0topv", .05, "min DCA V0 to PV (cm)"}; + Configurable dcapiontopv{"dcapiontopv", .05, "min DCA Pion To PV (cm)"}; + Configurable dcaprotontopv{"dcaprotontopv", .05, "min DCA Proton To PV (cm)"}; + Configurable v0radius{"v0radius", 1.2, "minimum V0 radius (cm)"}; + Configurable v0radiusMax{"v0radiusMax", 1E5, "maximum V0 radius (cm)"}; + + // Standard 6 topological criteria on cascades + Configurable casccospa{"casccospa", 0.97, "min Cascade CosPA"}; + Configurable dcacascdau{"dcacascdau", 1.0, "max DCA Cascade Daughters (cm)"}; + Configurable dcaxybachbaryontopv{"dcaxybachbaryontopv", -1, "DCAxy Bachelor-Baryon to PV (cm)"}; + Configurable bachbaryoncospa{"bachbaryoncospa", -1, "Bachelor-Baryon CosPA"}; + Configurable dcabachtopv{"dcabachtopv", .05, "min DCA Bachelor To PV (cm)"}; + Configurable cascradius{"cascradius", 0.5, "minimum Cascade radius (cm)"}; + Configurable cascradiusMax{"cascradiusMax", 1E5, "maximum Cascade radius (cm)"}; + Configurable cascProperLifeTime{"cascProperLifeTime", 3, "maximum lifetime (ctau)"}; + + // invariant mass selection + Configurable v0MassWindow{"v0MassWindow", 0.008, "#Lambda mass (GeV/#it{c}^{2})"}; + Configurable compMassRejection{"compMassRejection", 0.008, "Competing mass rejection (GeV/#it{c}^{2})"}; + + // Track quality + Configurable minTPCrows{"minTPCrows", 70, "minimum TPC crossed rows"}; + Configurable minITSclusters{"minITSclusters", -1, "minimum ITS clusters"}; + Configurable skipTPConly{"skipTPConly", false, "skip V0s comprised of at least one TPC only prong"}; + Configurable requireBachITSonly{"requireBachITSonly", false, "require that bachelor track is ITSonly (overrides TPC quality)"}; + Configurable requirePosITSonly{"requirePosITSonly", false, "require that positive track is ITSonly (overrides TPC quality)"}; + Configurable requireNegITSonly{"requireNegITSonly", false, "require that negative track is ITSonly (overrides TPC quality)"}; + Configurable requireAtLeastOneHasTOF{"requireAtLeastOneHasTOF", false, "require that at least one of daughter tracks has an associated TOF signal"}; + Configurable requireBachHasTOF{"requireBachHasTOF", false, "require that bachelor track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requirePosHasTOF{"requirePosHasTOF", false, "require that positive track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requireNegHasTOF{"requireNegHasTOF", false, "require that negative track has an associated TOF signal. On false, TOF requirement (if any) is only applied IF the track has an associated TOF signal."}; + Configurable requireBachHasTRD{"requireBachHasTRD", false, "require that bachelor track is formed out of TRD track."}; + Configurable requirePosHasTRD{"requirePosHasTRD", false, "require that positive track is formed out of TRD track."}; + Configurable requireNegHasTRD{"requireNegHasTRD", false, "require that negative track is formed out of TRD track."}; + Configurable minTRDclusters{"minTRDclusters", -1, "minimum TRD clusters IF track is formed out of a TRD track"}; + + // PID (TPC/TOF) + Configurable tpcPidNsigmaCut{"tpcPidNsigmaCut", 5, "tpcPidNsigmaCut"}; + Configurable tofPidNsigmaCutLaPr{"tofPidNsigmaCutLaPr", 1e+6, "tofPidNsigmaCutLaPr"}; + Configurable tofPidNsigmaCutLaPi{"tofPidNsigmaCutLaPi", 1e+6, "tofPidNsigmaCutLaPi"}; + Configurable tofPidNsigmaCutXiPi{"tofPidNsigmaCutXiPi", 1e+6, "tofPidNsigmaCutXiPi"}; + Configurable tofPidNsigmaCutOmKa{"tofPidNsigmaCutOmKa", 1e+6, "tofPidNsigmaCutOmKa"}; + } cascSelections; + + // CCDB options + struct : ConfigurableGroup { + std::string prefix = "ccdbConfigurations"; // JSON group name + 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 lutPath{"lutPath", "GLO/Param/MatLUT", "Path of the Lut parametrization"}; + Configurable geoPath{"geoPath", "GLO/Config/GeometryAligned", "Path of the geometry file"}; + Configurable mVtxPath{"mVtxPath", "GLO/Calib/MeanVertex", "Path of the mean vertex file"}; + + // manual + Configurable useCustomMagField{"useCustomMagField", false, "Use custom magnetic field value"}; + Configurable customMagField{"customMagField", 5.0f, "Manually set magnetic field"}; + } ccdbConfigurations; + + o2::ccdb::CcdbApi ccdbApi; + Service ccdb; + ctpRateFetcher rateFetcher; + + struct : ConfigurableGroup { + std::string prefix = "axisConfigurations"; // JSON group name + // configurable binning of histograms + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis axisPtCoarse{"axisPtCoarse", {50, 0.0f, 10.0f}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis axisV0CosPA{"axisV0CosPA", {100, 0.95f, 1.0f}, "V0 cos(PA)"}; + ConfigurableAxis axisV0PA{"axisV0PA", {1000, 0.f, 1.0f}, "Pointing angle (rad)"}; + ConfigurableAxis axisV0Radius{"axisV0Radius", {100, 0.0f, 50.0f}, "V0 radius (cm)"}; + ConfigurableAxis axisV0RadiusCoarse{"axisV0RadiusCoarse", {30, 0.0f, 30.0f}, "V0 radius (cm)"}; + ConfigurableAxis axisV0DecayLength{"axisV0DecayLength", {100, 0.0f, 80.0f}, "Decay length (cm)"}; + ConfigurableAxis axisV0DCANegToPV{"axisV0DCANegToPV", {100, -1.0f, 1.0f}, "DCA neg. to PV (cm)"}; + ConfigurableAxis axisV0DCAPosToPV{"axisV0DCAPosToPV", {100, -1.0f, 1.0f}, "DCA pos. to PV (cm)"}; + ConfigurableAxis axisV0DCAV0Dau{"axisV0DCAV0Dau", {100, 0.0f, 2.f}, "DCA between V0 daughters (cm)"}; + ConfigurableAxis axisLifetimeK0s{"axisLifetimeK0s", {100, 0.0f, 40.0f}, "K^{0}_{S} lifetime (cm)"}; + ConfigurableAxis axisLifetimeLambda{"axisLifetimeLambda", {100, 0.0f, 80.0f}, "#Lambda lifetime (cm)"}; + ConfigurableAxis axisDecayLengthK0s{"axisDecayLengthK0s", {100, 0.0f, 40.0f}, "K^{0}_{S} decay length (cm)"}; + ConfigurableAxis axisDecayLengthLambda{"axisDecayLengthLambda", {100, 0.0f, 80.0f}, "#Lambda decay length (cm)"}; + ConfigurableAxis axisV0DCAV0ToPVK0s{"axisV0DCAV0ToPVK0s", {250, 0.0f, 0.25f}, "DCA V0 to PV (cm)"}; + ConfigurableAxis axisV0DCAV0ToPVLambda{"axisV0DCAV0ToPVLambda", {250, 0.0f, 0.25f}, "DCA V0 to PV (cm)"}; + ConfigurableAxis axisInvMassK0s{"axisInvMassK0s", {200, 0.4f, 0.6f}, "Inv. mass (GeV/#it{c}%{2})"}; + ConfigurableAxis axisInvMassLambda{"axisInvMassLambda", {200, 1.07f, 1.17f}, "Inv. mass (GeV/#it{c}%{2})"}; + ConfigurableAxis axisTPCPIDPion{"axisTPCPIDPion", {100, -10.f, 10.f}, "TPC PID Pion N_{#sigma}"}; + ConfigurableAxis axisTPCPIDProton{"axisTPCPIDProton", {100, -10.f, 10.f}, "TPC PID Proton N_{#sigma}"}; + ConfigurableAxis axisEtaFlag{"axisEtaFlag", {3, -1.5f, 1.5f}, "Pseudorapidity"}; + ConfigurableAxis axisEta{"axisEta", {100, -1.0f, 1.0f}, "Pseudorapidity"}; + ConfigurableAxis axisPhi{"axisPhi", {90, 0.0f, constants::math::TwoPI}, "Azimuthal angle (#rad)"}; + ConfigurableAxis axisITSMapDaughters{"axisITSMapDaughters", {8, -0.5f, 7.5f}, ""}; + + ConfigurableAxis axisPtCasc{"axisPtCasc", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "#it{p}_{T} (GeV/#it{c})"}; + ConfigurableAxis axisCascDecayLength{"axisCascDecayLength", {200, 0.0f, 20.0f}, "Decay length (cm)"}; + ConfigurableAxis axisCascRadius{"axisCascRadius", {100, 0.0f, 30.0f}, "Decay length (cm)"}; + ConfigurableAxis axisCascCosPA{"axisCascCosPA", {100, 0.95f, 1.0f}, "Casc cos(PA)"}; + ConfigurableAxis axisCascRapidity{"axisCascRapidity", {100, -1.0f, 1.0f}, "Rapidity"}; + ConfigurableAxis axisCascLifetimeXi{"axisLifetimeXi", {100, 0.0f, 40.0f}, "#Xi lifetime (cm)"}; + ConfigurableAxis axisCascLifetimeOmega{"axisLifetimeOmega", {100, 0.0f, 30.0f}, "#Omega lifetime (cm)"}; + ConfigurableAxis axisCascDCAV0Dau{"axisCascDCAV0Dau", {100, 0.0f, 2.f}, "DCA between casc. daughters (cm)"}; + ConfigurableAxis axisCascDCABachToPV{"axisCascDCABachToPV", {100, -1.0f, 1.0f}, "DCA bach. to PV (cm)"}; + ConfigurableAxis axisInvMassXi{"axisInvMassXi", {80, 1.28f, 1.36f}, "Inv. mass (GeV/#it{c}%{2})"}; + ConfigurableAxis axisInvMassOmega{"axisInvMassOmega", {80, 1.63f, 1.71f}, "Inv. mass (GeV/#it{c}%{2})"}; + + } axisConfigurations; + + int dauEtaFlag = 0; void init(InitContext const&) { - const AxisSpec axisPt{binPt, "p_{T} (GeV/c)"}; - const AxisSpec axisPtsmall{binPtsmall, "p_{T} (GeV/c)"}; - const AxisSpec axisV0CosPA{binV0CosPA, "V0 Cos(PA)"}; - const AxisSpec axisV0PA{binV0PA, "Pointing Angle"}; - const AxisSpec axisV0Radius{binV0Radius, "V0 Radius (cm)"}; - const AxisSpec axisV0DecayLength{binV0DecayLength, "V0 Decay Length (cm)"}; - const AxisSpec axisV0DCANegToPV{binV0DCANegToPV, "V0 DCA Neg To PV (cm)"}; - const AxisSpec axisV0DCAPosToPV{binV0DCAPosToPV, "V0 DCA Pos To PV (cm)"}; - const AxisSpec axisV0DCAV0Dau{binV0DCAV0Dau, "V0 DCA V0 Daughters (cm)"}; - const AxisSpec axisCtauK0s{binCtauK0s, "K0s c#tau (cm)"}; - const AxisSpec axisCtauLambda{binCtauLambda, "Lambda c#tau (cm)"}; - const AxisSpec axisCtauAntiLambda{binCtauAntiLambda, "AntiLambda c#tau (cm)"}; - const AxisSpec axisDecayLengthK0s{binDecayLengthK0s, "Decay length K0s (cm)"}; - const AxisSpec axisDecayLengthLambda{binDecayLengthLambda, "Decay length Lambda (cm)"}; - const AxisSpec axisDecayLengthAntiLambda{binDecayLengthAntiLambda, "Decay length AntiLambda (cm)"}; - const AxisSpec axisV0DCAV0ToPVK0S{binV0DCAV0ToPVK0S, "DCAV0ToPV K0s"}; - const AxisSpec axisV0DCAV0ToPVLambda{binV0DCAV0ToPVLambda, "DCAV0ToPV Lambda"}; - const AxisSpec axisV0DCAV0ToPVAntiLambda{binV0DCAV0ToPVAntiLambda, "DCAV0ToPV AntiLambda"}; - const AxisSpec axisInvMassK0S{binInvMassK0S, "InvMass K0s"}; - const AxisSpec axisInvMassLambda{binInvMassLambda, "InvMass Lambda"}; - const AxisSpec axisInvMassAntiLambda{binInvMassAntiLambda, "InvMass AntiLambda"}; - const AxisSpec axisInvMassCasc{binInvMassCasc, "InvMass Cascades"}; - const AxisSpec axisResponsePionFromLambda{binResponsePionFromLambda, "Response Pion From Lambda"}; - const AxisSpec axisResponseProtonFromLambda{binResponseProtonFromLambda, "Response Proton From Lambda"}; - const AxisSpec axisEta{binEta, "Eta"}; - const AxisSpec axisPhi{binPhi, "Phi"}; - const AxisSpec axisEtaFlag{binEtaFlag, "Eta"}; - const AxisSpec axisRadius{binRadius, "Radius"}; - const AxisSpec axisRadiussmall{binRadiussmall, "Radius"}; - const AxisSpec axisITSMapDaughters{binITSMapDaughters, "ITS Map Daughters"}; - - histos_eve.add("GeneratedParticles", "GeneratedParticles", {HistType::kTH3F, {{14, 0.0f, 14.0f}, {100, 0, 10}, {100, 0.f, 50.f}}}); - histos_eve.add("hEventCounter", "hEventCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}); - histos_eve.add("hEventCounterMC", "hEventCounterMC", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}); - histos_eve.add("GenK0sPtVsEta", "GenK0sPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenLambdaPtVsEta", "GenLambdaPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenAntiLambdaPtVsEta", "GenAntiLambdaPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenXiMinusPtVsEta", "GenXiMinusPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenXiPlusPtVsEta", "GenXiPlusPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenOmegaMinusPtVsEta", "GenOmegaMinusPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - histos_eve.add("GenOmegaPlusPtVsEta", "GenOmegaPlusPtVsEta", {HistType::kTH2F, {axisPt, axisEta}}); - - histos_V0.add("CosPA", "CosPA", HistType::kTH1F, {axisV0CosPA}); - histos_V0.add("V0Radius", "V0Radius", HistType::kTH1F, {axisV0Radius}); - histos_V0.add("DecayLength", "DecayLength", HistType::kTH1F, {axisV0DecayLength}); - histos_V0.add("V0DCANegToPV", "V0DCANegToPV", HistType::kTH1F, {axisV0DCANegToPV}); - histos_V0.add("V0DCAPosToPV", "V0DCAPosToPV", HistType::kTH1F, {axisV0DCAPosToPV}); - histos_V0.add("V0DCAV0Daughters", "V0DCAV0Daughters", HistType::kTH1F, {axisV0DCAV0Dau}); - histos_V0.add("CtauK0s", "CtauK0s", HistType::kTH1F, {axisCtauK0s}); - histos_V0.add("CtauLambda", "CtauLambda", HistType::kTH1F, {axisCtauLambda}); - histos_V0.add("CtauAntiLambda", "CtauAntiLambda", HistType::kTH1F, {axisCtauAntiLambda}); - histos_V0.add("DecayLengthK0s", "DecayLengthK0s", HistType::kTH1F, {axisDecayLengthK0s}); - histos_V0.add("DecayLengthLambda", "DecayLengthLambda", HistType::kTH1F, {axisDecayLengthLambda}); - histos_V0.add("DecayLengthAntiLambda", "DecayLengthAntiLambda", HistType::kTH1F, {axisDecayLengthAntiLambda}); - histos_V0.add("V0DCAV0ToPVK0S", "V0DCAV0ToPVK0S", HistType::kTH1F, {axisV0DCAV0ToPVK0S}); - histos_V0.add("V0DCAV0ToPVLambda", "V0DCAV0ToPVLambda", HistType::kTH1F, {axisV0DCAV0ToPVLambda}); - histos_V0.add("V0DCAV0ToPVAntiLambda", "V0DCAV0ToPVAntiLambda", HistType::kTH1F, {axisV0DCAV0ToPVAntiLambda}); - histos_V0.add("InvMassK0S", "InvMassK0S", HistType::kTH3F, {axisPt, axisInvMassK0S, axisEtaFlag}); - histos_V0.add("InvMassLambda", "InvMassLambda", HistType::kTH3F, {axisPt, axisInvMassLambda, axisEtaFlag}); - histos_V0.add("InvMassAntiLambda", "InvMassAntiLambda", HistType::kTH3F, {axisPt, axisInvMassAntiLambda, axisEtaFlag}); - histos_V0.add("ResponsePionFromLambda", "ResponsePionFromLambda", HistType::kTH2F, {axisPt, axisResponsePionFromLambda}); - histos_V0.add("ResponseProtonFromLambda", "ResponseProtonFromLambda", HistType::kTH2F, {axisPt, axisResponseProtonFromLambda}); - histos_V0.add("InvMassK0SVsPtVsPA", "InvMassK0SVsPtVsPA", HistType::kTH3F, {axisPt, axisV0PA, axisInvMassK0S}); - histos_V0.add("InvMassK0STrue", "InvMassK0STrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 0.4f, 0.6f}}}); - histos_V0.add("InvMassLambdaTrue", "InvMassLambdaTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 1.07f, 1.17f}}}); - histos_V0.add("InvMassAntiLambdaTrue", "InvMassAntiLambdaTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 1.07f, 1.17f}}}); + if (doprocessGenerated || doprocessMonteCarlo) { + isMC = true; + } + // setting CCDB service + ccdb->setURL(ccdbConfigurations.ccdbUrl); + ccdb->setCaching(true); + ccdb->setFatalWhenNull(false); + + // Event Counters + histos_event.add("hEventCounter", "hEventCounter", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}); + histos_event.add("hEventCounterMC", "hEventCounterMC", {HistType::kTH1F, {{2, 0.0f, 2.0f}}}); + histos_event.add("hEventSelection", "hEventSelection", kTH1D, {{24, -0.5f, +23.5f}}); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "kIsTriggerTVX"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "kNoTimeFrameBorder"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(6, "posZ cut"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(7, "kIsVertexITSTPC"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(8, "kIsGoodZvtxFT0vsPV"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(9, "kIsVertexTOFmatched"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(10, "kIsVertexTRDmatched"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(11, "kNoSameBunchPileup"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(12, "kNoCollInTimeRangeStd"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(13, "kNoCollInTimeRangeStrict"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(14, "kNoCollInTimeRangeNarrow"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(15, "kNoCollInRofStd"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(16, "kNoCollInRofStrict"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(17, "Below min occup."); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(18, "Above max occup."); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(19, "Below min IR"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(20, "Above max IR"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(21, "INEL>0"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(22, "INEL>1"); + histos_event.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(23, "RCT flags"); + + histos_V0.add("CosPA", "CosPA", kTH1F, {axisConfigurations.axisV0CosPA}); + histos_V0.add("Radius", "Radius", kTH1D, {axisConfigurations.axisV0Radius}); + histos_V0.add("DecayLength", "DecayLength", kTH1F, {axisConfigurations.axisV0DecayLength}); + histos_V0.add("DCANegToPV", "DCANegToPV", kTH1F, {axisConfigurations.axisV0DCANegToPV}); + histos_V0.add("DCAPosToPV", "DCAPosToPV", kTH1F, {axisConfigurations.axisV0DCAPosToPV}); + histos_V0.add("DCAV0Daughters", "DCAV0Daughters", kTH1F, {axisConfigurations.axisV0DCAV0Dau}); + histos_V0.add("CosPAK0s", "CosPAK0s", kTH1F, {axisConfigurations.axisV0CosPA}); + histos_V0.add("CosPALambda", "CosPALambda", kTH1F, {axisConfigurations.axisV0CosPA}); + histos_V0.add("CosPAAntiLambda", "CosPAAntiLambda", kTH1F, {axisConfigurations.axisV0CosPA}); + histos_V0.add("RadiusK0s", "RadiusK0s", kTH1D, {axisConfigurations.axisV0Radius}); + histos_V0.add("RadiusLambda", "RadiusLambda", kTH1D, {axisConfigurations.axisV0Radius}); + histos_V0.add("RadiusAntiLambda", "RadiusAntiLambda", kTH1D, {axisConfigurations.axisV0Radius}); + histos_V0.add("DCANegToPVK0s", "DCANegToPVK0s", kTH1F, {axisConfigurations.axisV0DCANegToPV}); + histos_V0.add("DCANegToPVLambda", "DCANegToPVLambda", kTH1F, {axisConfigurations.axisV0DCANegToPV}); + histos_V0.add("DCANegToPVAntiLambda", "DCANegToPVAntiLambda", kTH1F, {axisConfigurations.axisV0DCANegToPV}); + histos_V0.add("DCAPosToPVK0s", "DCAPosToPVK0s", kTH1F, {axisConfigurations.axisV0DCAPosToPV}); + histos_V0.add("DCAPosToPVLambda", "DCAPosToPVLambda", kTH1F, {axisConfigurations.axisV0DCAPosToPV}); + histos_V0.add("DCAPosToPVAntiLambda", "DCAPosToPVAntiLambda", kTH1F, {axisConfigurations.axisV0DCAPosToPV}); + histos_V0.add("DCAV0DaughtersK0s", "DCAV0DaughtersK0s", kTH1F, {axisConfigurations.axisV0DCAV0Dau}); + histos_V0.add("DCAV0DaughtersLambda", "DCAV0DaughtersLambda", kTH1F, {axisConfigurations.axisV0DCAV0Dau}); + histos_V0.add("DCAV0DaughtersAntiLambda", "DCAV0DaughtersAntiLambda", kTH1F, {axisConfigurations.axisV0DCAV0Dau}); + histos_V0.add("LifetimeK0s", "LifetimeK0s", kTH1F, {axisConfigurations.axisLifetimeK0s}); + histos_V0.add("LifetimeLambda", "LifetimeLambda", kTH1F, {axisConfigurations.axisLifetimeLambda}); + histos_V0.add("LifetimeAntiLambda", "LifetimeAntiLambda", kTH1F, {axisConfigurations.axisLifetimeLambda}); + histos_V0.add("DecayLengthK0s", "DecayLengthK0s", kTH1F, {axisConfigurations.axisDecayLengthK0s}); + histos_V0.add("DecayLengthLambda", "DecayLengthLambda", kTH1F, {axisConfigurations.axisDecayLengthLambda}); + histos_V0.add("DecayLengthAntiLambda", "DecayLengthAntiLambda", kTH1F, {axisConfigurations.axisDecayLengthLambda}); + histos_V0.add("DCAV0ToPVK0s", "DCAV0ToPVK0s", kTH1F, {axisConfigurations.axisV0DCAV0ToPVK0s}); + histos_V0.add("DCAV0ToPVLambda", "DCAV0ToPVLambda", kTH1F, {axisConfigurations.axisV0DCAV0ToPVLambda}); + histos_V0.add("DCAV0ToPVAntiLambda", "DCAV0ToPVAntiLambda", kTH1F, {axisConfigurations.axisV0DCAV0ToPVLambda}); + histos_V0.add("InvMassK0s", "InvMassK0s", kTH3F, {axisConfigurations.axisPt, axisConfigurations.axisInvMassK0s, axisConfigurations.axisEtaFlag}); + histos_V0.add("InvMassLambda", "InvMassLambda", kTH3F, {axisConfigurations.axisPt, axisConfigurations.axisInvMassLambda, axisConfigurations.axisEtaFlag}); + histos_V0.add("InvMassAntiLambda", "InvMassAntiLambda", kTH3F, {axisConfigurations.axisPt, axisConfigurations.axisInvMassLambda, axisConfigurations.axisEtaFlag}); + histos_V0.add("TPCPIDPosPionFromK0s", "TPCPIDPosPionFromK0s", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDPion}); + histos_V0.add("TPCPIDNegPionFromK0s", "TPCPIDNegPionFromK0s", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDProton}); + histos_V0.add("TPCPIDPionFromLambda", "TPCPIDPionFromLambda", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDPion}); + histos_V0.add("TPCPIDProtonFromLambda", "TPCPIDProtonFromLambda", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDProton}); + histos_V0.add("TPCPIDPionFromAntiLambda", "TPCPIDPionFromAntiLambda", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDPion}); + histos_V0.add("TPCPIDProtonFromAntiLambda", "TPCPIDProtonFromAntiLambda", kTH2F, {axisConfigurations.axisPt, axisConfigurations.axisTPCPIDProton}); if (doextraanalysis) { - histos_V0.add("InvMassK0S_Radius", "InvMassK0S_Radius", HistType::kTH2F, {axisRadius, axisInvMassK0S}); - histos_V0.add("InvMassLambda_Radius", "InvMassLambda_Radius", HistType::kTH2F, {axisRadius, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_Radius", "InvMassAntiLambda_Radius", HistType::kTH2F, {axisRadius, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_EtaDaughters", "InvMassK0S_EtaDaughters", HistType::kTH3F, {axisEta, axisEta, axisInvMassK0S}); - histos_V0.add("InvMassLambda_EtaDaughters", "InvMassLambda_EtaDaughters", HistType::kTH3F, {axisEta, axisEta, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_EtaDaughters", "InvMassAntiLambda_EtaDaughters", HistType::kTH3F, {axisEta, axisEta, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_Ctau", "InvMassK0S_Ctau", HistType::kTH2F, {axisCtauK0s, axisInvMassK0S}); - histos_V0.add("InvMassLambda_Ctau", "InvMassLambda_Ctau", HistType::kTH2F, {axisCtauLambda, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_Ctau", "InvMassAntiLambda_Ctau", HistType::kTH2F, {axisCtauAntiLambda, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_PhiDaughters", "InvMassK0S_PhiDaughters", HistType::kTH3F, {axisPhi, axisPhi, axisInvMassK0S}); - histos_V0.add("InvMassLambda_PhiDaughters", "InvMassLambda_PhiDaughters", HistType::kTH3F, {axisPhi, axisPhi, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_PhiDaughters", "InvMassAntiLambda_PhiDaughters", HistType::kTH3F, {axisPhi, axisPhi, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_ITSMapDaughters", "InvMassK0S_ITSMapDaughters", HistType::kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassK0S}); - histos_V0.add("InvMassLambda_ITSMapDaughters", "InvMassLambda_ITSMapDaughters", HistType::kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_ITSMapDaughters", "InvMassAntiLambda_ITSMapDaughters", HistType::kTH3F, {axisITSMapDaughters, axisITSMapDaughters, axisInvMassAntiLambda}); - histos_V0.add("InvMassK0S_PtRadius", "InvMassK0S_PtRadius", HistType::kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassK0S}); - histos_V0.add("InvMassLambda_PtRadius", "InvMassLambda_PtRadius", HistType::kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambda_PtRadius", "InvMassAntiLambda_PtRadius", HistType::kTH3F, {axisPtsmall, axisRadiussmall, axisInvMassAntiLambda}); - histos_V0.add("InvMassLambdaVsPtVsPA", "InvMassLambdaVsPtVsPA", HistType::kTH3F, {axisPt, axisV0PA, axisInvMassLambda}); - histos_V0.add("InvMassAntiLambdaVsPtVsPA", "InvMassAntiLambdaVsPtVsPA", HistType::kTH3F, {axisPt, axisV0PA, axisInvMassAntiLambda}); - } - - histos_Casc.add("CascSelectionSummary", "CascSelectionSummary", HistType::kTH1F, {{10, 0.f, 10.f}}); - histos_Casc.add("QA_XiMinusCandidates", "QA_XiMinusCandidates", HistType::kTH1F, {{10, 0.f, 10.f}}); - histos_Casc.add("XiProgSelections", "XiProgSelections", HistType::kTH2F, {{30, 0.5f, 30.5f}, {2, -2, 2}}); - histos_Casc.add("OmegaProgSelections", "OmegaProgSelections", HistType::kTH2F, {{30, 0.5f, 30.5f}, {2, -2, 2}}); - histos_Casc.add("CascCosPA", "CascCosPA", HistType::kTH2D, {{200, 0.6f, 1.0f}, {2, -2, 2}}); - histos_Casc.add("V0CosPA", "V0CosPA", HistType::kTH2D, {{300, 0.7f, 1.0f}, {2, -2, 2}}); - histos_Casc.add("V0CosPAToXi", "V0CosPAToXi", HistType::kTH2D, {{100, 0.9f, 1.0f}, {2, -2, 2}}); - histos_Casc.add("CascDecayLength", "CascDecayLength", HistType::kTH2F, {{100, 0.0f, 10.0f}, {2, -2, 2}}); - histos_Casc.add("CascDecayLengthXi", "CascDecayLengthXi", HistType::kTH2F, {{200, 0.0f, 20.0f}, {2, -2, 2}}); - histos_Casc.add("CascDecayLengthOmega", "CascDecayLengthOmega", HistType::kTH2F, {{200, 0.0f, 20.0f}, {2, -2, 2}}); - histos_Casc.add("CascRadius", "CascRadius", HistType::kTH2F, {{100, 0.0f, 10.0f}, {2, -2, 2}}); - histos_Casc.add("CascV0Radius", "CascV0Radius", HistType::kTH2D, {{100, 0.0f, 10.0f}, {2, -2, 2}}); - histos_Casc.add("CascyXi", "CascyXi", HistType::kTH2F, {{200, -2.0f, 2.0f}, {2, -2, 2}}); - histos_Casc.add("CascyOmega", "CascyOmega", HistType::kTH2F, {{200, -2.0f, 2.0f}, {2, -2, 2}}); - histos_Casc.add("CascCtauXi", "CascCtauXi", HistType::kTH2F, {{100, 0.0f, 100.0f}, {2, -2, 2}}); - histos_Casc.add("CascCtauOmega", "CascCtauOmega", HistType::kTH2F, {{100, 0.0f, 100.0f}, {2, -2, 2}}); - histos_Casc.add("V0Ctau", "V0Ctau", HistType::kTH2F, {{100, 0.0f, 100.0f}, {2, -2, 2}}); - histos_Casc.add("CascPt", "CascPt", HistType::kTH2F, {{100, 0.0f, 25.0f}, {2, -2, 2}}); - histos_Casc.add("DcaV0Daughters", "DcaV0Daughters", HistType::kTH2F, {{110, 0.0f, 2.2f}, {2, -2, 2}}); - histos_Casc.add("DcaCascDaughters", "DcaCascDaughters", HistType::kTH2F, {{110, 0.0f, 2.2f}, {2, -2, 2}}); - histos_Casc.add("DcaV0ToPV", "DcaV0ToPV", HistType::kTH2F, {{200, 0.0f, 2.f}, {2, -2, 2}}); - histos_Casc.add("DcaBachToPV", "DcaBachToPV", HistType::kTH2F, {{80, -0.2f, 0.2f}, {2, -2, 2}}); - histos_Casc.add("DcaPosToPV", "DcaPosToPV", HistType::kTH2F, {{80, -0.2f, 0.2f}, {2, -2, 2}}); - histos_Casc.add("DcaNegToPV", "DcaNegToPV", HistType::kTH2F, {{80, -0.2f, 0.2f}, {2, -2, 2}}); - histos_Casc.add("InvMassLambdaDaughter", "InvMassLambdaDaughter", HistType::kTH2F, {{100, 1.1f, 1.13f}, {2, -2, 2}}); - histos_Casc.add("InvMassXiPlus", "InvMassXiPlus", HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.28f, 1.36f}, {2, -1.0f, 1.0f}}); - histos_Casc.add("InvMassXiMinus", "InvMassXiMinus", HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.28f, 1.36f}, {2, -1.0f, 1.0f}}); - histos_Casc.add("InvMassXiPlus_Radius", "InvMassXiPlus_Radius", HistType::kTH2F, {{100, 0.f, 50.f}, {80, 1.28f, 1.36f}}); - histos_Casc.add("InvMassXiMinus_Radius", "InvMassXiMinus_Radius", HistType::kTH2F, {{100, 0.f, 50.f}, {80, 1.28f, 1.36f}}); - histos_Casc.add("InvMassOmegaPlus", "InvMassOmegaPlus", HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.63f, 1.71f}, {2, -1.0f, 1.0f}}); - histos_Casc.add("InvMassOmegaMinus", "InvMassOmegaMinus", HistType::kTH3F, {{100, 0.f, 10.f}, {80, 1.63f, 1.71f}, {2, -1.0f, 1.0f}}); - histos_Casc.add("InvMassXiPlusTrue", "InvMassXiPlusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}); - histos_Casc.add("InvMassXiMinusTrue", "InvMassXiMinusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}); - histos_Casc.add("InvMassOmegaPlusTrue", "InvMassOmegaPlusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.63f, 1.71f}}}); - histos_Casc.add("InvMassOmegaMinusTrue", "InvMassOmegaMinusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.63f, 1.71f}}}); - - V0SelectionSummary->SetBinContent(1, V0_rapidity); - V0SelectionSummary->SetBinContent(2, V0_cosPA); - V0SelectionSummary->SetBinContent(3, V0_dcav0dau); - V0SelectionSummary->SetBinContent(4, V0_dcapostopv); - V0SelectionSummary->SetBinContent(5, V0_dcanegtopv); - V0SelectionSummary->SetBinContent(6, V0_radius); - V0SelectionSummary->SetBinContent(7, NSigmaV0Pion); - V0SelectionSummary->SetBinContent(8, NSigmaV0Proton); - V0SelectionSummary->SetBinContent(9, lifetimecut->get("lifetimecutLambda")); - V0SelectionSummary->SetBinContent(10, lifetimecut->get("lifetimecutK0S")); - - V0SelectionSummary->GetXaxis()->SetBinLabel(1, "rapidity"); - V0SelectionSummary->GetXaxis()->SetBinLabel(2, "cosPA"); - V0SelectionSummary->GetXaxis()->SetBinLabel(3, "dcav0dau"); - V0SelectionSummary->GetXaxis()->SetBinLabel(4, "dcapostopv"); - V0SelectionSummary->GetXaxis()->SetBinLabel(5, "dcanegtopv"); - V0SelectionSummary->GetXaxis()->SetBinLabel(6, "radius"); - V0SelectionSummary->GetXaxis()->SetBinLabel(7, "NSigmaV0Pion"); - V0SelectionSummary->GetXaxis()->SetBinLabel(8, "NSigmaV0Proton"); - V0SelectionSummary->GetXaxis()->SetBinLabel(9, "lifetimecutLambda"); - V0SelectionSummary->GetXaxis()->SetBinLabel(10, "lifetimecutK0S"); - } + histos_V0.add("InvMassK0s_Radius", "InvMassK0s_Radius", kTH2F, {axisConfigurations.axisV0Radius, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_Radius", "InvMassLambda_Radius", kTH2F, {axisConfigurations.axisV0Radius, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_Radius", "InvMassAntiLambda_Radius", kTH2F, {axisConfigurations.axisV0Radius, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_EtaDaughters", "InvMassK0s_EtaDaughters", kTH3F, {axisConfigurations.axisEta, axisConfigurations.axisEta, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_EtaDaughters", "InvMassLambda_EtaDaughters", kTH3F, {axisConfigurations.axisEta, axisConfigurations.axisEta, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_EtaDaughters", "InvMassAntiLambda_EtaDaughters", kTH3F, {axisConfigurations.axisEta, axisConfigurations.axisEta, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_Lifetime", "InvMassK0s_Lifetime", kTH2F, {axisConfigurations.axisLifetimeK0s, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_Lifetime", "InvMassLambda_Lifetime", kTH2F, {axisConfigurations.axisLifetimeLambda, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_Lifetime", "InvMassAntiLambda_Lifetime", kTH2F, {axisConfigurations.axisLifetimeLambda, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_PhiDaughters", "InvMassK0s_PhiDaughters", kTH3F, {axisConfigurations.axisPhi, axisConfigurations.axisPhi, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_PhiDaughters", "InvMassLambda_PhiDaughters", kTH3F, {axisConfigurations.axisPhi, axisConfigurations.axisPhi, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_PhiDaughters", "InvMassAntiLambda_PhiDaughters", kTH3F, {axisConfigurations.axisPhi, axisConfigurations.axisPhi, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_ITSMapDaughters", "InvMassK0s_ITSMapDaughters", kTH3F, {axisConfigurations.axisITSMapDaughters, axisConfigurations.axisITSMapDaughters, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_ITSMapDaughters", "InvMassLambda_ITSMapDaughters", kTH3F, {axisConfigurations.axisITSMapDaughters, axisConfigurations.axisITSMapDaughters, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_ITSMapDaughters", "InvMassAntiLambda_ITSMapDaughters", kTH3F, {axisConfigurations.axisITSMapDaughters, axisConfigurations.axisITSMapDaughters, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0s_PtRadius", "InvMassK0s_PtRadius", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0RadiusCoarse, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambda_PtRadius", "InvMassLambda_PtRadius", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0RadiusCoarse, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambda_PtRadius", "InvMassAntiLambda_PtRadius", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0RadiusCoarse, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassK0sVsPtVsPA", "InvMassK0sVsPtVsPA", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0PA, axisConfigurations.axisInvMassK0s}); + histos_V0.add("InvMassLambdaVsPtVsPA", "InvMassLambdaVsPtVsPA", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0PA, axisConfigurations.axisInvMassLambda}); + histos_V0.add("InvMassAntiLambdaVsPtVsPA", "InvMassAntiLambdaVsPtVsPA", kTH3F, {axisConfigurations.axisPtCoarse, axisConfigurations.axisV0PA, axisConfigurations.axisInvMassLambda}); + } + + histos_Casc.add("QA_CascadeCandidates", "QA_CascadeCandidates", {HistType::kTH1F, {{10, 0.f, 10.f}}}); + histos_Casc.add("CascCosPA", "CascCosPA", kTH2D, {axisConfigurations.axisV0CosPA, {2, -2, 2}}); + histos_Casc.add("V0CosPA", "V0CosPA", kTH2D, {axisConfigurations.axisV0CosPA, {2, -2, 2}}); + histos_Casc.add("V0CosPAToXi", "V0CosPAToXi", kTH2D, {axisConfigurations.axisV0CosPA, {2, -2, 2}}); + histos_Casc.add("CascDecayLength", "CascDecayLength", kTH2D, {axisConfigurations.axisCascDecayLength, {2, -2, 2}}); + histos_Casc.add("CascRadius", "CascRadius", kTH2F, {axisConfigurations.axisCascRadius, {2, -2, 2}}); + histos_Casc.add("V0Radius", "V0Radius", kTH2F, {axisConfigurations.axisV0Radius, {2, -2, 2}}); + histos_Casc.add("CascRapidityXi", "CascRapidityXi", kTH2F, {axisConfigurations.axisCascRapidity, {2, -2, 2}}); + histos_Casc.add("CascRapidityOmega", "CascRapidityOmega", kTH2F, {axisConfigurations.axisCascRapidity, {2, -2, 2}}); + histos_Casc.add("CascLifetimeXi", "CascLifetimeXi", kTH2F, {axisConfigurations.axisCascLifetimeXi, {2, -2, 2}}); + histos_Casc.add("CascLifetimeOmega", "CascLifetimeOmega", kTH2F, {axisConfigurations.axisCascLifetimeOmega, {2, -2, 2}}); + histos_Casc.add("V0Lifetime", "V0Lifetime", kTH2F, {axisConfigurations.axisLifetimeLambda, {2, -2, 2}}); + histos_Casc.add("CascPt", "CascPt", kTH2F, {axisConfigurations.axisPtCasc, {2, -2, 2}}); + histos_Casc.add("DcaV0Daughters", "DcaV0Daughters", kTH2F, {axisConfigurations.axisV0DCAV0Dau, {2, -2, 2}}); + histos_Casc.add("DcaCascDaughters", "DcaCascDaughters", kTH2F, {axisConfigurations.axisCascDCAV0Dau, {2, -2, 2}}); + histos_Casc.add("DcaV0ToPV", "DcaV0ToPV", kTH2F, {axisConfigurations.axisV0DCAV0ToPVLambda, {2, -2, 2}}); + histos_Casc.add("DcaBachToPV", "DcaBachToPV", kTH2F, {axisConfigurations.axisCascDCABachToPV, {2, -2, 2}}); + histos_Casc.add("DcaPosToPV", "DcaPosToPV", kTH2F, {axisConfigurations.axisV0DCAPosToPV, {2, -2, 2}}); + histos_Casc.add("DcaNegToPV", "DcaNegToPV", kTH2F, {axisConfigurations.axisV0DCANegToPV, {2, -2, 2}}); + histos_Casc.add("InvMassLambda", "InvMassLambda", kTH2F, {axisConfigurations.axisInvMassLambda, {2, -2, 2}}); + histos_Casc.add("InvMassXiPlus", "InvMassXiPlus", kTH3F, {axisConfigurations.axisPtCasc, axisConfigurations.axisInvMassXi, {2, -1.f, 1.f}}); + histos_Casc.add("InvMassXiMinus", "InvMassXiMinus", kTH3F, {axisConfigurations.axisPtCasc, axisConfigurations.axisInvMassXi, {2, -1.f, 1.f}}); + histos_Casc.add("InvMassXiPlus_Radius", "InvMassXiPlus_Radius", kTH2F, {axisConfigurations.axisCascRadius, axisConfigurations.axisInvMassXi}); + histos_Casc.add("InvMassXiMinus_Radius", "InvMassXiMinus_Radius", kTH2F, {axisConfigurations.axisCascRadius, axisConfigurations.axisInvMassXi}); + histos_Casc.add("InvMassOmegaPlus", "InvMassOmegaPlus", kTH3F, {axisConfigurations.axisPtCasc, axisConfigurations.axisInvMassOmega, {2, -1.f, 1.f}}); + histos_Casc.add("InvMassOmegaMinus", "InvMassOmegaMinus", kTH3F, {axisConfigurations.axisPtCasc, axisConfigurations.axisInvMassOmega, {2, -1.f, 1.f}}); + + if (isMC) { + histos_event.add("GeneratedV0s", "GeneratedV0s", kTH3D, {{3, 0.0f, 3.0f}, axisConfigurations.axisPt, axisConfigurations.axisV0Radius}); + histos_event.get(HIST("GeneratedV0s"))->GetXaxis()->SetBinLabel(1, "K^{0}_{S}"); + histos_event.get(HIST("GeneratedV0s"))->GetXaxis()->SetBinLabel(2, "#Lambda"); + histos_event.get(HIST("GeneratedV0s"))->GetXaxis()->SetBinLabel(3, "#bar{#Lambda}"); + histos_event.add("GeneratedCascades", "GeneratedCascades", kTH3D, {{4, 0.0f, 4.0f}, axisConfigurations.axisPtCasc, axisConfigurations.axisCascRadius}); + histos_event.get(HIST("GeneratedCascades"))->GetXaxis()->SetBinLabel(1, "#Xi^{#minus}"); + histos_event.get(HIST("GeneratedCascades"))->GetXaxis()->SetBinLabel(2, "#bar{#Xi}^{+}"); + histos_event.get(HIST("GeneratedCascades"))->GetXaxis()->SetBinLabel(3, "#Omega^{#minus}"); + histos_event.get(HIST("GeneratedCascades"))->GetXaxis()->SetBinLabel(4, "#bar{#Omega}^{+}"); + + histos_V0.add("InvMassK0sTrue", "InvMassK0sTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 0.4f, 0.6f}}}); + histos_V0.add("InvMassLambdaTrue", "InvMassLambdaTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 1.07f, 1.17f}}}); + histos_V0.add("InvMassAntiLambdaTrue", "InvMassAntiLambdaTrue", {HistType::kTH3F, {{100, 0.0f, 10.0f}, {100, 0.f, 50.f}, {200, 1.07f, 1.17f}}}); + + histos_Casc.add("InvMassXiPlusTrue", "InvMassXiPlusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}); + histos_Casc.add("InvMassXiMinusTrue", "InvMassXiMinusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.28f, 1.36f}}}); + histos_Casc.add("InvMassOmegaPlusTrue", "InvMassOmegaPlusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.63f, 1.71f}}}); + histos_Casc.add("InvMassOmegaMinusTrue", "InvMassOmegaMinusTrue", {HistType::kTH3F, {{100, 0.f, 10.f}, {100, 0.f, 50.f}, {80, 1.63f, 1.71f}}}); + } - /////////////////////////////////////////////////// - ////////// Collisions QA - reconstructed ////////// - /////////////////////////////////////////////////// + // Initialise the RCTFlagsChecker + rctFlagsChecker.init(rctConfigurations.cfgRCTLabel.value, rctConfigurations.cfgCheckZDC, rctConfigurations.cfgTreatLimitedAcceptanceAsBad); + } - void processReconstructedEvent(soa::Join::iterator const& Collision) + template + bool isEventAccepted(TCollision collision, bool fillHists) + // check whether the collision passes our collision selections { - histos_eve.fill(HIST("hEventCounter"), 0.5); - if (sel8 && !Collision.sel8()) { - return; + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 0. /* all collisions */); } - histos_eve.fill(HIST("hEventCounter"), 1.5); - } - PROCESS_SWITCH(v0cascadesQA, processReconstructedEvent, "Process reconstructed level Event", true); - /////////////////////////////////////// - ////////// Collision QA - MC ////////// - /////////////////////////////////////// + if (eventSelections.requireSel8 && !collision.sel8()) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 1 /* sel8 collisions */); + } + + if (eventSelections.requireTriggerTVX && !collision.selection_bit(aod::evsel::kIsTriggerTVX)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 2 /* FT0 vertex (acceptable FT0C-FT0A time difference) collisions */); + } + + if (eventSelections.rejectITSROFBorder && !collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 3 /* Not at ITS ROF border */); + } + + if (eventSelections.rejectTFBorder && !collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 4 /* Not at TF border */); + } + + if (std::abs(collision.posZ()) > eventSelections.maxZVtxPosition) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 5 /* vertex-Z selected */); + } + + if (eventSelections.requireIsVertexITSTPC && !collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 6 /* Contains at least one ITS-TPC track */); + } + + if (eventSelections.requireIsGoodZvtxFT0VsPV && !collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 7 /* PV position consistency check */); + } - void processMcEvent(aod::McCollision const& mcCollision, aod::McParticles const& mcParticles, const soa::SmallGroups>& collisions) + if (eventSelections.requireIsVertexTOFmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTOFmatched)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 8 /* PV with at least one contributor matched with TOF */); + } + + if (eventSelections.requireIsVertexTRDmatched && !collision.selection_bit(o2::aod::evsel::kIsVertexTRDmatched)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 9 /* PV with at least one contributor matched with TRD */); + } + + if (eventSelections.rejectSameBunchPileup && !collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 10 /* Not at same bunch pile-up */); + } + + if (eventSelections.requireNoCollInTimeRangeStd && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 11 /* No other collision within +/- 2 microseconds or mult above a certain threshold in -4 - -2 microseconds*/); + } + + if (eventSelections.requireNoCollInTimeRangeStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStrict)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 12 /* No other collision within +/- 10 microseconds */); + } + + if (eventSelections.requireNoCollInTimeRangeNarrow && !collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 13 /* No other collision within +/- 2 microseconds */); + } + + if (eventSelections.requireNoCollInROFStd && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 14 /* No other collision within the same ITS ROF with mult. above a certain threshold */); + } + + if (eventSelections.requireNoCollInROFStrict && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStrict)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 15 /* No other collision within the same ITS ROF */); + } + + float collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange() : collision.trackOccupancyInTimeRange(); + if (eventSelections.minOccupancy >= 0 && collisionOccupancy < eventSelections.minOccupancy) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 16 /* Below min occupancy */); + } + + if (eventSelections.maxOccupancy >= 0 && collisionOccupancy > eventSelections.maxOccupancy) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 17 /* Above max occupancy */); + } + + // Fetch interaction rate only if required (in order to limit ccdb calls) + auto bc = collision.template bc_as(); + double interactionRate = ((eventSelections.minIR >= 0 || eventSelections.maxIR >= 0) && !irSource.value.empty()) ? rateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), irSource) * 1.e-3 : -1; + if (eventSelections.minIR >= 0 && interactionRate < eventSelections.minIR) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 18 /* Below min IR */); + } + + if (eventSelections.maxIR >= 0 && interactionRate > eventSelections.maxIR) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 19 /* Above max IR */); + } + + if (eventSelections.requireINEL0 && !collision.isInelGt0()) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 20 /* INEL > 0 */); + } + + if (eventSelections.requireINEL1 && !collision.isInelGt1()) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 21 /* INEL > 1 */); + } + + if (!rctConfigurations.cfgRCTLabel.value.empty() && !rctFlagsChecker(collision)) { + return false; + } + if (fillHists) { + histos_event.fill(HIST("hEventSelection"), 22 /* Pass CBT condition */); + } + + return true; + } + + template + bool isV0Accepted(TV0 v0, TCollision collision, float rapidity, int v0Type) + // precalculate this information so that a check is one mask operation, not many { - histos_eve.fill(HIST("hEventCounterMC"), 0.5); + // Base topological variables + if (v0.v0radius() < v0Selections.v0radius) + return false; + if (v0.v0radius() > v0Selections.v0radiusMax) + return false; + if (std::abs(v0.dcapostopv()) < v0Selections.dcapostopv) + return false; + if (std::abs(v0.dcanegtopv()) < v0Selections.dcanegtopv) + return false; + if (v0.v0cosPA() < v0Selections.v0cospa) + return false; + if (v0.dcaV0daughters() > v0Selections.dcav0dau) + return false; + + // proper lifetime + if ((v0Type == kLambda || v0Type == kAntiLambda) && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0 > v0Selections.lifetimecut->get("lifetimecutLambda")) + return false; + if (v0Type == kK0s && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short > v0Selections.lifetimecut->get("lifetimecutK0s")) + return false; + + // armenteros (for K0s only) + if (v0Type == kK0s && v0Selections.armPodCut > 1e-4 && v0.qtarm() * v0Selections.armPodCut < std::abs(v0.alpha())) + return false; + + // rapidity + if (std::abs(rapidity) > v0Selections.rapidityCut) + return false; + + // competing mass rejection + if ((v0Type == kLambda || v0Type == kAntiLambda) && std::fabs(v0.mK0Short() - o2::constants::physics::MassK0Short) < v0Selections.compMassRejection) + return false; + if (v0Type == kK0s && std::fabs(v0.mLambda() - o2::constants::physics::MassLambda0) < v0Selections.compMassRejection) + return false; + + auto posTrackExtra = v0.template posTrack_as(); + auto negTrackExtra = v0.template negTrack_as(); + + // ITS quality flags + bool posIsFromAfterburner = posTrackExtra.isITSAfterburner(); + bool negIsFromAfterburner = negTrackExtra.isITSAfterburner(); + + // reject afterburner track or not + if (v0Selections.rejectPosITSafterburner && posIsFromAfterburner) + return false; + if (v0Selections.rejectNegITSafterburner && negIsFromAfterburner) + return false; + + // keep afterburner track or not + if (v0Selections.requirePosITSafterburnerOnly && !posIsFromAfterburner) + return false; + if (v0Selections.requireNegITSafterburnerOnly && !negIsFromAfterburner) + return false; + + // check minium ITS clusters + if (posTrackExtra.itsNCls() < v0Selections.minITSclusters) + return false; + if (negTrackExtra.itsNCls() < v0Selections.minITSclusters) + return false; + + // check maximum ITS chi2 per clusters + if (posTrackExtra.itsChi2NCl() > v0Selections.maxITSchi2PerNcls) + return false; + if (negTrackExtra.itsChi2NCl() > v0Selections.maxITSchi2PerNcls) + return false; + + // ITS only tag + if (v0Selections.requirePosITSonly) { + if (posTrackExtra.tpcNClsCrossedRows() > 0) + return false; + } + if (v0Selections.requireNegITSonly) { + if (negTrackExtra.tpcNClsCrossedRows() > 0) + return false; + } - std::vector SelectedEvents(collisions.size()); - int nevts = 0; - for (const auto& collision : collisions) { - if (sel8 && !collision.sel8()) { - continue; + // check minimum TPC crossed rows + if (posTrackExtra.tpcNClsCrossedRows() < v0Selections.minTPCrows) + return false; + if (negTrackExtra.tpcNClsCrossedRows() < v0Selections.minTPCrows) + return false; + + // check maximum TPC chi2 per clusters + if (posTrackExtra.tpcChi2NCl() > v0Selections.maxTPCchi2PerNcls) + return false; + if (negTrackExtra.tpcChi2NCl() > v0Selections.maxTPCchi2PerNcls) + return false; + + // check the maximum fraction of allowed shared TPC + if (posTrackExtra.tpcFractionSharedCls() > v0Selections.maxFractionTPCSharedClusters) + return false; + if (negTrackExtra.tpcFractionSharedCls() > v0Selections.maxFractionTPCSharedClusters) + return false; + + // TPC only tag + if (v0Selections.skipTPConly) { + if (posTrackExtra.hasTPC()) + return false; + if (negTrackExtra.hasTPC()) + return false; + } + + // TPC PID + if (v0Type == kK0s) { + if (std::fabs(posTrackExtra.tpcNSigmaPi()) > v0Selections.tpcPidNsigmaCutK0Pi) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPi()) > v0Selections.tpcPidNsigmaCutK0Pi) + return false; + } + if (v0Type == kLambda) { + if (std::fabs(posTrackExtra.tpcNSigmaPr()) > v0Selections.tpcPidNsigmaCutLaPr) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPi()) > v0Selections.tpcPidNsigmaCutLaPi) + return false; + } + if (v0Type == kAntiLambda) { + if (std::fabs(posTrackExtra.tpcNSigmaPi()) > v0Selections.tpcPidNsigmaCutLaPi) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPr()) > v0Selections.tpcPidNsigmaCutLaPr) + return false; + } + + // TOF Requirement checks + if (v0Selections.requirePosHasTOF && !v0.positiveHasTOF()) { + return false; + } + if (v0Selections.requireNegHasTOF && !v0.negativeHasTOF()) { + return false; + } + + if (v0Selections.requireAtLeastOneHasTOF && !v0.positiveHasTOF() && !v0.negativeHasTOF()) { + return false; + } + + // TOF Nsigma + if (v0Type == kK0s) { + if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5 && v0.positiveHasTOF() && std::fabs(v0.tofNSigmaK0PiPlus()) > v0Selections.tofPidNsigmaCutK0Pi) { + return false; } - SelectedEvents[nevts++] = collision.mcCollision_as().globalIndex(); + if (v0Selections.tofPidNsigmaCutK0Pi < 1e+5 && v0.negativeHasTOF() && std::fabs(v0.tofNSigmaK0PiMinus()) > v0Selections.tofPidNsigmaCutK0Pi) { + return false; + } + } + if (v0Type == kLambda) { + if (v0Selections.tofPidNsigmaCutLaPr < 1e+5 && v0.positiveHasTOF() && std::fabs(v0.tofNSigmaLaPr()) > v0Selections.tofPidNsigmaCutLaPr) { + return false; + } + if (v0Selections.tofPidNsigmaCutLaPi < 1e+5 && v0.negativeHasTOF() && std::fabs(v0.tofNSigmaLaPi()) > v0Selections.tofPidNsigmaCutLaPi) { + return false; + } + } + if (v0Type == kAntiLambda) { + if (v0Selections.tofPidNsigmaCutLaPi < 1e+5 && v0.positiveHasTOF() && std::fabs(v0.tofNSigmaLaPi()) > v0Selections.tofPidNsigmaCutLaPi) { + return false; + } + if (v0Selections.tofPidNsigmaCutLaPr < 1e+5 && v0.negativeHasTOF() && std::fabs(v0.tofNSigmaLaPr()) > v0Selections.tofPidNsigmaCutLaPr) { + return false; + } + } + + // TRD Requirement checks + if (v0Selections.requirePosHasTRD && !posTrackExtra.hasTRD()) { + return false; + } + if (v0Selections.requireNegHasTRD && !negTrackExtra.hasTRD()) { + return false; } - SelectedEvents.resize(nevts); - const auto evtReconstructedAndSelected = std::find(SelectedEvents.begin(), SelectedEvents.end(), mcCollision.globalIndex()) != SelectedEvents.end(); + int posTRDhits = 0, negTRDhits = 0; + for (unsigned int i = 0; i <= 5; i++) { + if (posTrackExtra.trdPattern() & (1 << i)) { + posTRDhits++; + } + if (negTrackExtra.trdPattern() & (1 << i)) { + negTRDhits++; + } + } - if (!evtReconstructedAndSelected) { // Check that the event is reconstructed and that the reconstructed events pass the selection - return; + if (posTrackExtra.hasTRD() && posTRDhits < v0Selections.minTRDclusters) { + return false; + } + if (negTrackExtra.hasTRD() && negTRDhits < v0Selections.minTRDclusters) { + return false; } - histos_eve.fill(HIST("hEventCounterMC"), 1.5); + return true; + } + + template + bool isCascadeSelected(TCascade casc, TCollision collision, float rapidity, int cascType) + // precalculate this information so that a check is one mask operation, not many + { + // + // Base topological variables + // + + // v0 radius min/max selections + if (casc.v0radius() < cascSelections.v0radius) + return false; + if (casc.v0radius() > cascSelections.v0radiusMax) + return false; + // DCA proton and pion to PV for Lambda and AntiLambda decay hypotheses + if (casc.sign() < 0) { // Xi- or Omega- --> positive/negative daughter = proton/pion + if (std::fabs(casc.dcapostopv()) < cascSelections.dcaprotontopv) + return false; + if (std::fabs(casc.dcanegtopv()) < cascSelections.dcapiontopv) + return false; + } else { // Xi+ or Omega+ --> positive/negative daughter = pion/proton + if (std::fabs(casc.dcapostopv()) < cascSelections.dcapiontopv) + return false; + if (std::fabs(casc.dcanegtopv()) < cascSelections.dcaprotontopv) + return false; + } + // V0 cosine of pointing angle + if (casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.v0cospa) + return false; + // DCA between v0 daughters + if (casc.dcaV0daughters() > cascSelections.dcav0dau) + return false; + // DCA V0 to prim vtx + if (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.dcav0topv) + return false; + + // casc radius min/max selections + if (casc.cascradius() < cascSelections.cascradius) + return false; + if (casc.cascradius() > cascSelections.cascradiusMax) + return false; + // DCA bachelor selection + if (std::fabs(casc.dcabachtopv()) < cascSelections.dcabachtopv) + return false; + // Bachelor-baryon cosPA selection + if (casc.bachBaryonCosPA() < cascSelections.bachbaryoncospa) + return false; + // DCA bachelor-baryon selection + if (std::fabs(casc.bachBaryonDCAxyToPV()) < cascSelections.dcaxybachbaryontopv) + return false; + // casc cosine of pointing angle + if (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascSelections.casccospa) + return false; + // DCA between casc daughters + if (casc.dcacascdaughters() > cascSelections.dcacascdau) + return false; + + if (casc.sign() < 0 && (cascType == kXiP || cascType == kOmegaP)) + return false; + if (casc.sign() > 0 && (cascType == kXiM || cascType == kOmegaM)) + return false; + + // + // proper lifetime + float distOverTotMom = std::sqrt(std::pow(casc.x() - collision.posX(), 2) + std::pow(casc.y() - collision.posY(), 2) + std::pow(casc.z() - collision.posZ(), 2)) / (casc.p() + 1E-10); + if ((cascType == kXiM || cascType == kXiP) && distOverTotMom * o2::constants::physics::MassXiMinus > cascSelections.cascProperLifeTime) + return false; + if ((cascType == kOmegaM || cascType == kOmegaP) && distOverTotMom * o2::constants::physics::MassOmegaMinus > cascSelections.cascProperLifeTime) + return false; + + // rapidity + if (std::fabs(rapidity) > cascSelections.rapidityCut) + return false; + + // + // invariant mass window + // + if (std::fabs(casc.mLambda() - o2::constants::physics::MassLambda0) > cascSelections.v0MassWindow) + return false; + + // + // competing mass rejection + // + if ((cascType == kXiM || cascType == kXiP) && std::fabs(casc.mOmega() - o2::constants::physics::MassOmegaMinus) < cascSelections.compMassRejection) + return false; + if ((cascType == kOmegaM || cascType == kOmegaP) && std::fabs(casc.mXi() - o2::constants::physics::MassXiMinus) < cascSelections.compMassRejection) + return false; + + auto bachTrackExtra = casc.template bachelor_as(); + auto posTrackExtra = casc.template posTrack_as(); + auto negTrackExtra = casc.template negTrack_as(); + + // ITS quality flags + if (bachTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + if (posTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + if (negTrackExtra.itsNCls() < cascSelections.minITSclusters) + return false; + + // TPC quality flags + if (bachTrackExtra.tpcNClsCrossedRows() < cascSelections.minTPCrows) + return false; + if (posTrackExtra.tpcNClsCrossedRows() < cascSelections.minTPCrows) + return false; + if (negTrackExtra.tpcNClsCrossedRows() < cascSelections.minTPCrows) + return false; + + // TPC PID + if ((cascType == kXiM || cascType == kXiP) && std::fabs(bachTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + if ((cascType == kOmegaM || cascType == kOmegaP) && std::fabs(bachTrackExtra.tpcNSigmaKa()) > cascSelections.tpcPidNsigmaCut) + return false; + if (casc.sign() < 0) { // Xi- or Omega- --> positive/negative daughter = proton/pion + if (std::fabs(posTrackExtra.tpcNSigmaPr()) > cascSelections.tpcPidNsigmaCut) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + } else { // Xi+ or Omega+ --> positive/negative daughter = pion/proton + if (std::fabs(posTrackExtra.tpcNSigmaPi()) > cascSelections.tpcPidNsigmaCut) + return false; + if (std::fabs(negTrackExtra.tpcNSigmaPr()) > cascSelections.tpcPidNsigmaCut) + return false; + } - double posx = mcCollision.posX(); - double posy = mcCollision.posY(); + // TOF Requirement checks + if (cascSelections.requireBachHasTOF && !casc.bachelorHasTOF()) { + return false; + } + if (cascSelections.requirePosHasTOF && !casc.positiveHasTOF()) { + return false; + } + if (cascSelections.requireNegHasTOF && !casc.negativeHasTOF()) { + return false; + } - for (auto& mcparticle : mcParticles) { + if (cascSelections.requireAtLeastOneHasTOF && !casc.bachelorHasTOF() && !casc.positiveHasTOF() && !casc.negativeHasTOF()) { + return false; + } - if (!mcparticle.has_daughters()) { - continue; + // + // TOF PID in NSigma + // Bachelor track + if (casc.bachelorHasTOF()) { + if ((cascType == kXiM || cascType == kXiP) && std::fabs(casc.tofNSigmaXiPi()) > cascSelections.tofPidNsigmaCutXiPi) + return false; + if ((cascType == kOmegaM || cascType == kOmegaP) && std::fabs(casc.tofNSigmaOmKa()) > cascSelections.tofPidNsigmaCutOmKa) + return false; + } + // Positive track + if (casc.positiveHasTOF()) { + if (casc.sign() < 0) { // Xi- or Omega- --> positive daughter = proton + if (cascType == kXiM && std::fabs(casc.tofNSigmaXiLaPr()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + if (cascType == kOmegaM && std::fabs(casc.tofNSigmaOmLaPr()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + } else { // Xi+ or Omega+ --> positive daughter = pion + if (cascType == kXiP && std::fabs(casc.tofNSigmaXiLaPi()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + if (cascType == kOmegaP && std::fabs(casc.tofNSigmaOmLaPi()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + } + } + // Negative track + if (casc.negativeHasTOF()) { + if (casc.sign() < 0) { // Xi- or Omega- --> negative daughter = pion + if (cascType == kXiM && std::fabs(casc.tofNSigmaXiLaPr()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + if (cascType == kOmegaM && std::fabs(casc.tofNSigmaOmLaPr()) > cascSelections.tofPidNsigmaCutLaPi) + return false; + } else { // Xi+ or Omega+ --> negative daughter = proton + if (cascType == kXiP && std::fabs(casc.tofNSigmaXiLaPi()) > cascSelections.tofPidNsigmaCutLaPr) + return false; + if (cascType == kOmegaP && std::fabs(casc.tofNSigmaOmLaPi()) > cascSelections.tofPidNsigmaCutLaPr) + return false; } + } - double vx = 0; - double vy = 0; - for (auto& mcparticleDaughter0 : mcparticle.daughters_as()) { - vx = mcparticleDaughter0.vx() - posx; - vy = mcparticleDaughter0.vy() - posy; - if (vx != 0 && vy != 0) - break; + // TRD Requirement checks + if (cascSelections.requireBachHasTRD && !bachTrackExtra.hasTRD()) { + return false; + } + if (cascSelections.requirePosHasTRD && !posTrackExtra.hasTRD()) { + return false; + } + if (cascSelections.requireNegHasTRD && !negTrackExtra.hasTRD()) { + return false; + } + + int bachTRDhits = 0, posTRDhits = 0, negTRDhits = 0; + for (unsigned int i = 0; i <= 5; i++) { + if (bachTrackExtra.trdPattern() & (1 << i)) { + bachTRDhits++; } - double R_Decay = TMath::Sqrt(vx * vx + vy * vy); - - if (mcparticle.pdgCode() == PDG_t::kK0Short) - histos_eve.fill(HIST("GenK0sPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kLambda0) - histos_eve.fill(HIST("GenLambdaPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kLambda0Bar) - histos_eve.fill(HIST("GenAntiLambdaPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kXiMinus) - histos_eve.fill(HIST("GenXiMinusPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kXiPlusBar) - histos_eve.fill(HIST("GenXiPlusPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kOmegaMinus) - histos_eve.fill(HIST("GenOmegaMinusPtVsEta"), mcparticle.pt(), mcparticle.eta()); - if (mcparticle.pdgCode() == PDG_t::kOmegaPlusBar) - histos_eve.fill(HIST("GenOmegaPlusPtVsEta"), mcparticle.pt(), mcparticle.eta()); - - if (mcparticle.isPhysicalPrimary() && TMath::Abs(mcparticle.y()) < V0_rapidity) { - if (mcparticle.pdgCode() == PDG_t::kK0Short) - histos_eve.fill(HIST("GeneratedParticles"), 0.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kLambda0) - histos_eve.fill(HIST("GeneratedParticles"), 2.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kLambda0Bar) - histos_eve.fill(HIST("GeneratedParticles"), 4.5, mcparticle.pt(), R_Decay); + if (posTrackExtra.trdPattern() & (1 << i)) { + posTRDhits++; } - if (mcparticle.isPhysicalPrimary() && TMath::Abs(mcparticle.y()) < Casc_rapidity) { - if (mcparticle.pdgCode() == PDG_t::kXiMinus) - histos_eve.fill(HIST("GeneratedParticles"), 6.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kXiPlusBar) - histos_eve.fill(HIST("GeneratedParticles"), 8.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kOmegaMinus) - histos_eve.fill(HIST("GeneratedParticles"), 10.5, mcparticle.pt(), R_Decay); - if (mcparticle.pdgCode() == PDG_t::kOmegaPlusBar) - histos_eve.fill(HIST("GeneratedParticles"), 12.5, mcparticle.pt(), R_Decay); + if (negTrackExtra.trdPattern() & (1 << i)) { + negTRDhits++; } } + + if (bachTrackExtra.hasTRD() && bachTRDhits < cascSelections.minTRDclusters) { + return false; + } + if (posTrackExtra.hasTRD() && posTRDhits < cascSelections.minTRDclusters) { + return false; + } + if (negTrackExtra.hasTRD() && negTRDhits < cascSelections.minTRDclusters) { + return false; + } + + return true; + } + + template + bool checkV0MCAssociation(TV0 v0, int v0Type) + // precalculate this information so that a check is one mask operation, not many + { + if (!v0.isPhysicalPrimary()) + return false; + + bool isPositiveProton = v0.pdgCodePositive() == PDG_t::kProton; + bool isPositivePion = v0.pdgCodePositive() == PDG_t::kPiPlus || (doTreatPiToMuon && v0.pdgCodePositive() == PDG_t::kMuonPlus); + bool isNegativeProton = v0.pdgCodeNegative() == PDG_t::kProtonBar; + bool isNegativePion = v0.pdgCodeNegative() == PDG_t::kPiMinus || (doTreatPiToMuon && v0.pdgCodeNegative() == PDG_t::kMuonMinus); + + if (v0Type == kK0s && v0.pdgCode() == PDG_t::kK0Short && isPositivePion && isNegativePion) { + return true; + } + if (v0Type == kLambda && v0.pdgCode() == PDG_t::kLambda0 && isPositiveProton && isNegativePion) { + return true; + } + if (v0Type == kAntiLambda && v0.pdgCode() == PDG_t::kLambda0Bar && isPositivePion && isNegativeProton) { + return true; + } + return false; + } + + template + bool checkCascadeMCAssociation(TCascade casc, int cascType) + // precalculate this information so that a check is one mask operation, not many + { + if (!casc.isPhysicalPrimary()) + return false; + + bool isBachelorPionPlus = casc.pdgCodeBachelor() == PDG_t::kPiPlus || (doTreatPiToMuon && casc.pdgCodeBachelor() == PDG_t::kMuonPlus); + bool isBachelorKaonPlus = casc.pdgCodeBachelor() == PDG_t::kKPlus; + bool isBachelorPionMinus = casc.pdgCodeBachelor() == PDG_t::kPiMinus || (doTreatPiToMuon && casc.pdgCodeBachelor() == PDG_t::kMuonMinus); + bool isBachelorKaonMinus = casc.pdgCodeBachelor() == PDG_t::kKMinus; + bool isPositiveProton = casc.pdgCodePositive() == PDG_t::kProton; + bool isPositivePion = casc.pdgCodePositive() == PDG_t::kPiPlus || (doTreatPiToMuon && casc.pdgCodePositive() == PDG_t::kMuonPlus); + bool isNegativeProton = casc.pdgCodeNegative() == PDG_t::kProtonBar; + bool isNegativePion = casc.pdgCodeNegative() == PDG_t::kPiMinus || (doTreatPiToMuon && casc.pdgCodeNegative() == PDG_t::kMuonMinus); + + if (cascType == kXiM && casc.pdgCode() == PDG_t::kXiMinus && isPositiveProton && isNegativePion && isBachelorPionMinus) { + return true; + } + if (cascType == kXiP && casc.pdgCode() == PDG_t::kXiPlusBar && isPositivePion && isNegativeProton && isBachelorPionPlus) { + return true; + } + if (cascType == kOmegaM && casc.pdgCode() == PDG_t::kOmegaMinus && isPositiveProton && isNegativePion && isBachelorKaonMinus) { + return true; + } + if (cascType == kOmegaP && casc.pdgCode() == PDG_t::kOmegaPlusBar && isPositivePion && isNegativeProton && isBachelorKaonPlus) { + return true; + } + return false; } - PROCESS_SWITCH(v0cascadesQA, processMcEvent, "Process MC level Event", true); //////////////////////////////////////////// - ////////// V0 QA - Reconstructed /////////// + /////////// QA - Reconstructed ///////////// //////////////////////////////////////////// - void processReconstructedV0(soa::Join::iterator const& collision, aod::V0Datas const& fullV0s, DaughterTracks&) + void processReconstructed(soa::Join::iterator const& collision, soa::Join const& fullV0s, soa::Join const& fullCascades, DaughterTracks const&, aod::BCsWithTimestamps const&) { - if (sel8 && !collision.sel8()) { + histos_event.fill(HIST("hEventCounter"), 0.5); + if (!isEventAccepted(collision, true)) { return; } + histos_event.fill(HIST("hEventCounter"), 1.5); + + for (auto const& v0 : fullV0s) { + if (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut || + std::abs(v0.positiveeta()) > v0Selections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future + + if (v0Selections.v0TypeSelection > -1 && v0.v0Type() != v0Selections.v0TypeSelection) + continue; // skip V0s that are not standard + + // fillV0s(v0, collision.posX(), collision.posY(), collision.posZ()); - int dauEtaFlag = 0; - for (auto& v0 : fullV0s) { auto posdau = v0.posTrack_as(); auto negdau = v0.negTrack_as(); - if (posdau.eta() < 0. && negdau.eta() < 0.) { + if (v0.negativeeta() < 0. && v0.positiveeta() < 0.) { dauEtaFlag = -1; - } else if (posdau.eta() >= 0. && negdau.eta() >= 0.) { + } else if (v0.negativeeta() >= 0. && v0.positiveeta() >= 0.) { dauEtaFlag = 1; } else { dauEtaFlag = 0; } - // check TPC - if (checkDauTPC && (!posdau.hasTPC() || !negdau.hasTPC())) { - continue; - } - - Int_t posITSNhits = 0, negITSNhits = 0; - for (unsigned int i = 0; i < 7; i++) { - if (posdau.itsClusterMap() & (1 << i)) { - posITSNhits++; - } - if (negdau.itsClusterMap() & (1 << i)) { - negITSNhits++; - } - } - histos_V0.fill(HIST("CosPA"), v0.v0cosPA()); - histos_V0.fill(HIST("V0Radius"), v0.v0radius()); - histos_V0.fill(HIST("V0DCANegToPV"), v0.dcanegtopv()); - histos_V0.fill(HIST("V0DCAPosToPV"), v0.dcapostopv()); - histos_V0.fill(HIST("V0DCAV0Daughters"), v0.dcaV0daughters()); + histos_V0.fill(HIST("Radius"), v0.v0radius()); + histos_V0.fill(HIST("DCANegToPV"), v0.dcanegtopv()); + histos_V0.fill(HIST("DCAPosToPV"), v0.dcapostopv()); + histos_V0.fill(HIST("DCAV0Daughters"), v0.dcaV0daughters()); float decayLength = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * RecoDecay::sqrtSumOfSquares(v0.px(), v0.py(), v0.pz()); histos_V0.fill(HIST("DecayLength"), decayLength); @@ -417,166 +1115,98 @@ struct v0cascadesQA { float CtauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; float CtauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; - if (v0.v0cosPA() > V0_cosPA && - v0.v0radius() > V0_radius && - v0.dcaV0daughters() < V0_dcav0dau && - TMath::Abs(v0.dcapostopv()) > V0_dcapostopv && TMath::Abs(v0.dcanegtopv()) > V0_dcanegtopv) { - - // K0Short - if (TMath::Abs(v0.yK0Short()) < V0_rapidity && - CtauK0s < lifetimecut->get("lifetimecutK0S") && - TMath::Abs(posdau.tpcNSigmaPi()) < NSigmaV0Pion && TMath::Abs(negdau.tpcNSigmaPi()) < NSigmaV0Pion) { - - histos_V0.fill(HIST("CtauK0s"), CtauK0s); - histos_V0.fill(HIST("DecayLengthK0s"), decayLength); - histos_V0.fill(HIST("InvMassK0S"), v0.pt(), v0.mK0Short(), dauEtaFlag); - histos_V0.fill(HIST("InvMassK0SVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mK0Short()); - histos_V0.fill(HIST("V0DCAV0ToPVK0S"), v0.dcav0topv()); - if (doextraanalysis) { - histos_V0.fill(HIST("InvMassK0S_Radius"), v0.v0radius(), v0.mK0Short()); - histos_V0.fill(HIST("InvMassK0S_PtRadius"), v0.pt(), v0.v0radius(), v0.mK0Short()); - histos_V0.fill(HIST("InvMassK0S_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mK0Short()); - histos_V0.fill(HIST("InvMassK0S_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mK0Short()); - histos_V0.fill(HIST("InvMassK0S_ITSMapDaughters"), posITSNhits, negITSNhits, v0.mK0Short()); - } - } - - // Lambda - if (TMath::Abs(v0.yLambda()) < V0_rapidity && - CtauLambda < lifetimecut->get("lifetimecutLambda") && - TMath::Abs(posdau.tpcNSigmaPr()) < NSigmaV0Proton && TMath::Abs(negdau.tpcNSigmaPi()) < NSigmaV0Pion) { - - histos_V0.fill(HIST("DecayLengthLambda"), decayLength); - histos_V0.fill(HIST("CtauLambda"), CtauLambda); - histos_V0.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), dauEtaFlag); - if (doextraanalysis) - histos_V0.fill(HIST("InvMassLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mLambda()); - histos_V0.fill(HIST("V0DCAV0ToPVLambda"), v0.dcav0topv()); - if (v0.v0cosPA() > 0.999 && v0.dcaV0daughters() < 1 && TMath::Abs(v0.mK0Short() - o2::constants::physics::MassK0Short) > 0.012 && TMath::Abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0) > 0.08 && TMath::Abs(v0.mLambda() - o2::constants::physics::MassLambda0) < 0.002) { - histos_V0.fill(HIST("ResponsePionFromLambda"), v0.pt(), negdau.tpcNSigmaPi()); - histos_V0.fill(HIST("ResponseProtonFromLambda"), v0.pt(), posdau.tpcNSigmaPr()); - } - if (doextraanalysis) { - histos_V0.fill(HIST("InvMassLambda_Radius"), v0.v0radius(), v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_Ctau"), CtauLambda, v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mLambda()); - histos_V0.fill(HIST("InvMassLambda_ITSMapDaughters"), posITSNhits, negITSNhits, v0.mLambda()); - } - } - - // AntiLambda - if (TMath::Abs(v0.yLambda()) < V0_rapidity && - CtauLambda < lifetimecut->get("lifetimecutLambda") && - TMath::Abs(posdau.tpcNSigmaPi()) < NSigmaV0Pion && TMath::Abs(negdau.tpcNSigmaPr()) < NSigmaV0Proton) { - - histos_V0.fill(HIST("DecayLengthAntiLambda"), decayLength); - histos_V0.fill(HIST("CtauAntiLambda"), CtauLambda); - histos_V0.fill(HIST("InvMassAntiLambda"), v0.pt(), v0.mAntiLambda(), dauEtaFlag); - if (doextraanalysis) - histos_V0.fill(HIST("InvMassAntiLambdaVsPtVsPA"), v0.pt(), TMath::ACos(v0.v0cosPA()), v0.mAntiLambda()); - histos_V0.fill(HIST("V0DCAV0ToPVAntiLambda"), v0.dcav0topv()); - if (doextraanalysis) { - histos_V0.fill(HIST("InvMassAntiLambda_Radius"), v0.v0radius(), v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_Ctau"), CtauLambda, v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mAntiLambda()); - histos_V0.fill(HIST("InvMassAntiLambda_ITSMapDaughters"), posITSNhits, negITSNhits, v0.mAntiLambda()); - } + // K0Short + if (isV0Accepted(v0, collision, v0.rapidity(0), kK0s)) { + histos_V0.fill(HIST("CosPAK0s"), v0.v0cosPA()); + histos_V0.fill(HIST("RadiusK0s"), v0.v0radius()); + histos_V0.fill(HIST("DCANegToPVK0s"), v0.dcanegtopv()); + histos_V0.fill(HIST("DCAPosToPVK0s"), v0.dcapostopv()); + histos_V0.fill(HIST("DCAV0DaughtersK0s"), v0.dcaV0daughters()); + histos_V0.fill(HIST("DecayLengthK0s"), decayLength); + histos_V0.fill(HIST("LifetimeK0s"), CtauK0s); + histos_V0.fill(HIST("InvMassK0s"), v0.pt(), v0.mK0Short(), dauEtaFlag); + histos_V0.fill(HIST("DCAV0ToPVK0s"), v0.dcav0topv()); + histos_V0.fill(HIST("TPCPIDPosPionFromK0s"), v0.pt(), posdau.tpcNSigmaPi()); + histos_V0.fill(HIST("TPCPIDNegPionFromK0s"), v0.pt(), negdau.tpcNSigmaPi()); + if (doextraanalysis) { + histos_V0.fill(HIST("InvMassK0s_Radius"), v0.v0radius(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_PtRadius"), v0.pt(), v0.v0radius(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_Lifetime"), CtauK0s, v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0s_ITSMapDaughters"), posdau.itsNCls(), negdau.itsNCls(), v0.mK0Short()); + histos_V0.fill(HIST("InvMassK0sVsPtVsPA"), v0.pt(), std::acos(v0.v0cosPA()), v0.mK0Short()); } } - } - } - PROCESS_SWITCH(v0cascadesQA, processReconstructedV0, "Process reconstructed level V0s", true); - - //////////////////////////////// - ////////// V0 QA - MC ////////// - //////////////////////////////// - - void processMcV0(soa::Join::iterator const& collision, soa::Join const& fullV0s, aod::McParticles const&, MyTracksMC const&) - { - if (sel8 && !collision.sel8()) { - return; - } - - for (auto& v0 : fullV0s) { - if (!v0.has_mcParticle()) { - continue; - } - auto v0mcparticle = v0.mcParticle(); - Int_t lPDG = 0; - if (TMath::Abs(v0mcparticle.pdgCode()) == PDG_t::kK0Short || TMath::Abs(v0mcparticle.pdgCode()) == PDG_t::kLambda0) { - lPDG = v0mcparticle.pdgCode(); + // Lambda + if (isV0Accepted(v0, collision, v0.rapidity(1), kLambda)) { + histos_V0.fill(HIST("CosPALambda"), v0.v0cosPA()); + histos_V0.fill(HIST("RadiusLambda"), v0.v0radius()); + histos_V0.fill(HIST("DCANegToPVLambda"), v0.dcanegtopv()); + histos_V0.fill(HIST("DCAPosToPVLambda"), v0.dcapostopv()); + histos_V0.fill(HIST("DCAV0DaughtersLambda"), v0.dcaV0daughters()); + histos_V0.fill(HIST("DecayLengthLambda"), decayLength); + histos_V0.fill(HIST("LifetimeLambda"), CtauLambda); + histos_V0.fill(HIST("InvMassLambda"), v0.pt(), v0.mLambda(), dauEtaFlag); + histos_V0.fill(HIST("DCAV0ToPVLambda"), v0.dcav0topv()); + histos_V0.fill(HIST("TPCPIDPionFromLambda"), v0.pt(), negdau.tpcNSigmaPi()); + histos_V0.fill(HIST("TPCPIDProtonFromLambda"), v0.pt(), posdau.tpcNSigmaPr()); + if (doextraanalysis) { + histos_V0.fill(HIST("InvMassLambda_Radius"), v0.v0radius(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_Lifetime"), CtauLambda, v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambda_ITSMapDaughters"), posdau.itsNCls(), negdau.itsNCls(), v0.mLambda()); + histos_V0.fill(HIST("InvMassLambdaVsPtVsPA"), v0.pt(), std::acos(v0.v0cosPA()), v0.mLambda()); + } } - float CtauLambda = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassLambda0; - float CtauK0s = v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * o2::constants::physics::MassK0Short; - - if (v0.v0cosPA() > V0_cosPA && - v0.v0radius() > V0_radius && - v0.dcaV0daughters() < V0_dcav0dau && - TMath::Abs(v0.dcapostopv()) > V0_dcapostopv && - TMath::Abs(v0.dcanegtopv()) > V0_dcanegtopv) { - - // K0Short - if (lPDG == PDG_t::kK0Short) { - if (TMath::Abs(v0.yK0Short()) < V0_rapidity && CtauK0s < lifetimecut->get("lifetimecutK0S")) { - histos_V0.fill(HIST("InvMassK0STrue"), v0.pt(), v0.v0radius(), v0.mK0Short()); - } - } - if (lPDG == PDG_t::kLambda0) { - if (TMath::Abs(v0.yLambda()) < V0_rapidity && CtauLambda < lifetimecut->get("lifetimecutLambda")) { - histos_V0.fill(HIST("InvMassLambdaTrue"), v0.pt(), v0.v0radius(), v0.mLambda()); - } - } - if (lPDG == PDG_t::kLambda0Bar) { - if (TMath::Abs(v0.yLambda()) < V0_rapidity && CtauLambda < lifetimecut->get("lifetimecutLambda")) { - histos_V0.fill(HIST("InvMassAntiLambdaTrue"), v0.pt(), v0.v0radius(), v0.mAntiLambda()); - } + // AntiLambda + if (isV0Accepted(v0, collision, v0.rapidity(2), kAntiLambda)) { + histos_V0.fill(HIST("CosPAAntiLambda"), v0.v0cosPA()); + histos_V0.fill(HIST("RadiusAntiLambda"), v0.v0radius()); + histos_V0.fill(HIST("DCANegToPVAntiLambda"), v0.dcanegtopv()); + histos_V0.fill(HIST("DCAPosToPVAntiLambda"), v0.dcapostopv()); + histos_V0.fill(HIST("DCAV0DaughtersAntiLambda"), v0.dcaV0daughters()); + histos_V0.fill(HIST("DecayLengthAntiLambda"), decayLength); + histos_V0.fill(HIST("LifetimeAntiLambda"), CtauLambda); + histos_V0.fill(HIST("InvMassAntiLambda"), v0.pt(), v0.mAntiLambda(), dauEtaFlag); + histos_V0.fill(HIST("DCAV0ToPVAntiLambda"), v0.dcav0topv()); + histos_V0.fill(HIST("TPCPIDPionFromAntiLambda"), v0.pt(), posdau.tpcNSigmaPi()); + histos_V0.fill(HIST("TPCPIDProtonFromAntiLambda"), v0.pt(), negdau.tpcNSigmaPr()); + if (doextraanalysis) { + histos_V0.fill(HIST("InvMassAntiLambda_Radius"), v0.v0radius(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_PtRadius"), v0.pt(), v0.v0radius(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_Lifetime"), CtauLambda, v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_EtaDaughters"), posdau.eta(), negdau.eta(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_PhiDaughters"), posdau.phi(), negdau.phi(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambda_ITSMapDaughters"), posdau.itsNCls(), negdau.itsNCls(), v0.mAntiLambda()); + histos_V0.fill(HIST("InvMassAntiLambdaVsPtVsPA"), v0.pt(), std::acos(v0.v0cosPA()), v0.mAntiLambda()); } } } - } - PROCESS_SWITCH(v0cascadesQA, processMcV0, "Process MC level V0s", false); - ////////////////////////////////////// - ///// Cascade QA - Reconstructed ///// - ////////////////////////////////////// - - void processReconstructedCascade(soa::Join::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, DaughterTracks&) - { - if (sel8 && !collision.sel8()) { - return; - } - - for (auto& casc : Cascades) { - auto bachelor = casc.bachelor_as(); - auto posdau = casc.posTrack_as(); - auto negdau = casc.negTrack_as(); - - // check TPC - if (checkDauTPC && (!posdau.hasTPC() || !negdau.hasTPC() || !bachelor.hasTPC())) { - continue; - } + for (auto const& casc : fullCascades) { + if (std::abs(casc.negativeeta()) > cascSelections.daughterEtaCut || + std::abs(casc.positiveeta()) > cascSelections.daughterEtaCut || + std::abs(casc.bacheloreta()) > cascSelections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future histos_Casc.fill(HIST("CascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()), casc.sign()); histos_Casc.fill(HIST("V0CosPA"), casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()), casc.sign()); - double v0cospatoxi = RecoDecay::cpa(array{casc.x(), casc.y(), casc.z()}, array{casc.xlambda(), casc.ylambda(), casc.zlambda()}, array{casc.pxpos() + casc.pxneg(), casc.pypos() + casc.pyneg(), casc.pzpos() + casc.pzneg()}); + double v0cospatoxi = RecoDecay::cpa(std::array{casc.x(), casc.y(), casc.z()}, array{casc.xlambda(), casc.ylambda(), casc.zlambda()}, std::array{casc.pxpos() + casc.pxneg(), casc.pypos() + casc.pyneg(), casc.pzpos() + casc.pzneg()}); histos_Casc.fill(HIST("V0CosPAToXi"), v0cospatoxi, casc.sign()); histos_Casc.fill(HIST("CascRadius"), casc.cascradius(), casc.sign()); - histos_Casc.fill(HIST("CascV0Radius"), casc.v0radius(), casc.sign()); - histos_Casc.fill(HIST("CascyXi"), casc.yXi(), casc.sign()); - histos_Casc.fill(HIST("CascyOmega"), casc.yOmega(), casc.sign()); + histos_Casc.fill(HIST("V0Radius"), casc.v0radius(), casc.sign()); + histos_Casc.fill(HIST("CascRapidityXi"), casc.yXi(), casc.sign()); + histos_Casc.fill(HIST("CascRapidityOmega"), casc.yOmega(), casc.sign()); float cascDecayLength = std::sqrt(std::pow(casc.x() - collision.posX(), 2) + std::pow(casc.y() - collision.posY(), 2) + std::pow(casc.z() - collision.posZ(), 2)); histos_Casc.fill(HIST("CascDecayLength"), cascDecayLength, casc.sign()); - histos_Casc.fill(HIST("CascDecayLengthXi"), cascDecayLength, casc.sign()); - histos_Casc.fill(HIST("CascDecayLengthOmega"), cascDecayLength, casc.sign()); float cascTotalMomentum = RecoDecay::sqrtSumOfSquares(casc.px(), casc.py(), casc.pz()); float CtauXi = cascDecayLength / (cascTotalMomentum + 1E-10) * o2::constants::physics::MassXi0; // see O2Physics/Common/Core/MC.h for codes and names accepted @@ -586,9 +1216,9 @@ struct v0cascadesQA { float v0DecayLength = std::sqrt(std::pow(casc.xlambda() - casc.x(), 2) + std::pow(casc.ylambda() - casc.y(), 2) + std::pow(casc.zlambda() - casc.z(), 2)); float CtauV0 = v0DecayLength / (v0TotalMomentum + 1E-10) * o2::constants::physics::MassLambda0; - histos_Casc.fill(HIST("CascCtauXi"), CtauXi, casc.sign()); - histos_Casc.fill(HIST("CascCtauOmega"), CtauOmega, casc.sign()); - histos_Casc.fill(HIST("V0Ctau"), CtauV0, casc.sign()); + histos_Casc.fill(HIST("CascLifetimeXi"), CtauXi, casc.sign()); + histos_Casc.fill(HIST("CascLifetimeOmega"), CtauOmega, casc.sign()); + histos_Casc.fill(HIST("V0Lifetime"), CtauV0, casc.sign()); histos_Casc.fill(HIST("CascPt"), casc.pt(), casc.sign()); histos_Casc.fill(HIST("DcaV0Daughters"), casc.dcaV0daughters(), casc.sign()); histos_Casc.fill(HIST("DcaCascDaughters"), casc.dcacascdaughters(), casc.sign()); @@ -596,176 +1226,196 @@ struct v0cascadesQA { histos_Casc.fill(HIST("DcaBachToPV"), casc.dcabachtopv(), casc.sign()); histos_Casc.fill(HIST("DcaPosToPV"), casc.dcapostopv(), casc.sign()); histos_Casc.fill(HIST("DcaNegToPV"), casc.dcanegtopv(), casc.sign()); - histos_Casc.fill(HIST("InvMassLambdaDaughter"), casc.mLambda(), casc.sign()); - - if (casc.v0radius() > Casc_v0radius && - casc.cascradius() > Casc_cascradius && - casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > Casc_v0cospa && - casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > Casc_casccospa && - TMath::Abs(casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ())) > Casc_dcav0topv && - TMath::Abs(casc.dcapostopv()) > Casc_dcapostopv && TMath::Abs(casc.dcanegtopv()) > Casc_dcanegtopv && TMath::Abs(casc.dcabachtopv()) > Casc_dcabachtopv && - casc.dcaV0daughters() < Casc_dcav0dau && casc.dcacascdaughters() < Casc_dcacascdau) { - if (casc.sign() < 0) { - if (TMath::Abs(posdau.tpcNSigmaPr()) < NSigmaCascProton && TMath::Abs(negdau.tpcNSigmaPi()) < NSigmaCascPion) { - if (TMath::Abs(casc.yXi()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < NSigmaCascPion) { - histos_Casc.fill(HIST("InvMassXiMinus"), casc.pt(), casc.mXi(), casc.eta()); - histos_Casc.fill(HIST("InvMassXiMinus_Radius"), casc.cascradius(), casc.mXi()); - } - if (TMath::Abs(casc.yOmega()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < NSigmaCascKaon) { - histos_Casc.fill(HIST("InvMassOmegaMinus"), casc.pt(), casc.mOmega(), casc.eta()); - } - } - } else { - if (TMath::Abs(posdau.tpcNSigmaPi()) < NSigmaCascPion && TMath::Abs(negdau.tpcNSigmaPr()) < NSigmaCascProton) { - if (TMath::Abs(casc.yXi()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaPi()) < NSigmaCascPion) { - histos_Casc.fill(HIST("InvMassXiPlus"), casc.pt(), casc.mXi(), casc.eta()); - histos_Casc.fill(HIST("InvMassXiPlus_Radius"), casc.cascradius(), casc.mXi()); - } - if (TMath::Abs(casc.yOmega()) < Casc_rapidity && TMath::Abs(bachelor.tpcNSigmaKa()) < NSigmaCascKaon) { - histos_Casc.fill(HIST("InvMassOmegaPlus"), casc.pt(), casc.mOmega(), casc.eta()); - } - } - } + histos_Casc.fill(HIST("InvMassLambda"), casc.mLambda(), casc.sign()); + + if (isCascadeSelected(casc, collision, casc.rapidity(0), kXiM)) { + histos_Casc.fill(HIST("InvMassXiMinus"), casc.pt(), casc.mXi(), casc.eta()); + histos_Casc.fill(HIST("InvMassXiMinus_Radius"), casc.cascradius(), casc.mXi()); + } + if (isCascadeSelected(casc, collision, casc.rapidity(0), kXiP)) { + histos_Casc.fill(HIST("InvMassXiPlus"), casc.pt(), casc.mXi(), casc.eta()); + histos_Casc.fill(HIST("InvMassXiPlus_Radius"), casc.cascradius(), casc.mXi()); + } + if (isCascadeSelected(casc, collision, casc.rapidity(2), kOmegaM)) { + histos_Casc.fill(HIST("InvMassOmegaMinus"), casc.pt(), casc.mOmega(), casc.eta()); + } + if (isCascadeSelected(casc, collision, casc.rapidity(2), kOmegaP)) { + histos_Casc.fill(HIST("InvMassOmegaPlus"), casc.pt(), casc.mOmega(), casc.eta()); } } } - PROCESS_SWITCH(v0cascadesQA, processReconstructedCascade, "Process reconstructed level Cascades", true); - ////////////////////////////////////// - ////////// Cascade QA - MC /////////// - ////////////////////////////////////// + //////////////////////////////// + ////////// QA - MC ///////////// + //////////////////////////////// - void processMcCascade(soa::Join::iterator const& collision, aod::CascDataExt const& Cascades, aod::V0sLinked const&, aod::V0Datas const&, MyTracksMC const&, aod::McParticles const&) + void processMonteCarlo(soa::Join::iterator const& collision, soa::Join const&, soa::Join const& fullV0s, soa::Join const&, soa::Join const& fullCascades, soa::Join const&, DaughterTracks const&, aod::BCsWithTimestamps const&) { - if (sel8 && !collision.sel8()) { + if (!isEventAccepted(collision, false)) { + return; + } + if (!collision.has_mcCollision()) + return; + auto mcCollision = collision.mcCollision_as>(); + // Apply selections on MC collisions + if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { + return; + } + if (eventSelections.requireINEL0 && mcCollision.multMCNParticlesEta10() < 1) { + return; + } + if (eventSelections.requireINEL1 && mcCollision.multMCNParticlesEta10() < 2) { return; } - for (auto& casc : Cascades) { + for (auto const& v0 : fullV0s) { + if (std::abs(v0.negativeeta()) > v0Selections.daughterEtaCut || + std::abs(v0.positiveeta()) > v0Selections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 0.5); + if (v0Selections.v0TypeSelection > -1 && v0.v0Type() != v0Selections.v0TypeSelection) + continue; // skip V0s that are not standard - if (casc.v0radius() > Casc_v0radius && - casc.cascradius() > Casc_cascradius && - casc.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) > Casc_v0cospa && - casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) > Casc_casccospa && - TMath::Abs(casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ())) > Casc_dcav0topv && - TMath::Abs(casc.dcapostopv()) > Casc_dcapostopv && TMath::Abs(casc.dcanegtopv()) > Casc_dcanegtopv && TMath::Abs(casc.dcabachtopv()) > Casc_dcabachtopv && - casc.dcaV0daughters() < Casc_dcav0dau && casc.dcacascdaughters() < Casc_dcacascdau) { + if (!v0.has_v0MCCore()) + continue; - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 1.5); + auto v0MC = v0.template v0MCCore_as>(); - auto reconegtrack = casc.negTrack_as(); - auto recopostrack = casc.posTrack_as(); - auto recobachelor = casc.bachelor_as(); - if (!reconegtrack.has_mcParticle() || !recopostrack.has_mcParticle() || !recobachelor.has_mcParticle()) { - continue; - } - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 2.5); + // K0Short + if (isV0Accepted(v0, collision, v0MC.rapidityMC(0), kK0s) && checkV0MCAssociation(v0MC, kK0s)) { + histos_V0.fill(HIST("InvMassK0sTrue"), v0MC.ptMC(), v0.v0radius(), v0.mK0Short()); + } + // Lambda + if (isV0Accepted(v0, collision, v0MC.rapidityMC(1), kLambda) && checkV0MCAssociation(v0MC, kLambda)) { + histos_V0.fill(HIST("InvMassLambdaTrue"), v0MC.ptMC(), v0.v0radius(), v0.mLambda()); + } + // AntiLambda + if (isV0Accepted(v0, collision, v0MC.rapidityMC(2), kAntiLambda) && checkV0MCAssociation(v0MC, kAntiLambda)) { + histos_V0.fill(HIST("InvMassAntiLambdaTrue"), v0MC.ptMC(), v0.v0radius(), v0.mAntiLambda()); + } + } + + for (auto const& casc : fullCascades) { + if (std::abs(casc.negativeeta()) > cascSelections.daughterEtaCut || + std::abs(casc.positiveeta()) > cascSelections.daughterEtaCut || + std::abs(casc.bacheloreta()) > cascSelections.daughterEtaCut) + continue; // remove acceptance that's badly reproduced by MC / superfluous in future + + if (!casc.has_cascMCCore()) + continue; + + auto cascMC = casc.template cascMCCore_as>(); + + histos_Casc.fill(HIST("QA_CascadeCandidates"), 0.5); - auto mcnegtrack = reconegtrack.mcParticle_as(); - auto mcpostrack = recopostrack.mcParticle_as(); - auto bachelor = recobachelor.mcParticle_as(); - if (!mcnegtrack.has_mothers() || !mcpostrack.has_mothers() || !bachelor.has_mothers()) { - continue; + if (isCascadeSelected(casc, collision, cascMC.rapidityMC(0), kXiM)) { + histos_Casc.fill(HIST("QA_CascCandidates"), 1.5); + if (checkCascadeMCAssociation(cascMC, kXiM)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 2.5); + histos_Casc.fill(HIST("InvMassXiMinusTrue"), cascMC.ptMC(), casc.cascradius(), casc.mXi()); } - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 3.5); - - for (auto& particleMotherOfBach : bachelor.mothers_as()) { - for (auto& particleMotherOfNeg : mcnegtrack.mothers_as()) { - for (auto& particleMotherOfPos : mcpostrack.mothers_as()) { - for (auto& particleMotherOfV0 : particleMotherOfNeg.mothers_as()) { - - bool MomOfBachIsPrimary = particleMotherOfBach.isPhysicalPrimary(); - bool MomOfNegIsPrimary = particleMotherOfNeg.isPhysicalPrimary(); - bool MomOfPosIsPrimary = particleMotherOfPos.isPhysicalPrimary(); - - bool isXiMinusCascade = MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary) && - particleMotherOfNeg == particleMotherOfPos && - particleMotherOfV0 == particleMotherOfBach && - particleMotherOfBach.pdgCode() == PDG_t::kXiMinus && - bachelor.pdgCode() == PDG_t::kPiMinus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0 && - mcnegtrack.pdgCode() == PDG_t::kPiMinus && - mcpostrack.pdgCode() == PDG_t::kProton; - - bool isOmegaMinusCascade = MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary) && - particleMotherOfNeg == particleMotherOfPos && - particleMotherOfV0 == particleMotherOfBach && - particleMotherOfBach.pdgCode() == PDG_t::kOmegaMinus && - bachelor.pdgCode() == PDG_t::kKMinus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0 && - mcnegtrack.pdgCode() == PDG_t::kPiMinus && - mcpostrack.pdgCode() == PDG_t::kProton; - - bool isXiPlusCascade = MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary) && - particleMotherOfNeg == particleMotherOfPos && - particleMotherOfV0 == particleMotherOfBach && - particleMotherOfBach.pdgCode() == PDG_t::kXiPlusBar && - bachelor.pdgCode() == PDG_t::kPiPlus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0Bar && - mcnegtrack.pdgCode() == PDG_t::kProtonBar && - mcpostrack.pdgCode() == PDG_t::kPiPlus; - - bool isOmegaPlusCascade = MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary) && - particleMotherOfNeg == particleMotherOfPos && - particleMotherOfV0 == particleMotherOfBach && - particleMotherOfBach.pdgCode() == PDG_t::kOmegaPlusBar && - bachelor.pdgCode() == PDG_t::kKPlus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0Bar && - mcnegtrack.pdgCode() == PDG_t::kProtonBar && - mcpostrack.pdgCode() == PDG_t::kPiPlus; - - if (isXiMinusCascade) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 8.5); - if (TMath::Abs(casc.yXi()) < Casc_rapidity) { - histos_Casc.fill(HIST("InvMassXiMinusTrue"), casc.pt(), casc.cascradius(), casc.mXi()); - } - } - - if (isOmegaMinusCascade) { - if (TMath::Abs(casc.yOmega()) < Casc_rapidity) { - histos_Casc.fill(HIST("InvMassOmegaMinusTrue"), casc.pt(), casc.cascradius(), casc.mOmega()); - } - } - - if (isXiPlusCascade) { - if (TMath::Abs(casc.yXi()) < Casc_rapidity) { - histos_Casc.fill(HIST("InvMassXiPlusTrue"), casc.pt(), casc.cascradius(), casc.mXi()); - } - } - - if (isOmegaPlusCascade) { - if (TMath::Abs(casc.yOmega()) < Casc_rapidity) { - histos_Casc.fill(HIST("InvMassOmegaPlusTrue"), casc.pt(), casc.cascradius(), casc.mOmega()); - } - } - - // QA section - XiMinus - if (MomOfBachIsPrimary && !(MomOfNegIsPrimary) && !(MomOfPosIsPrimary)) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 4.5); - } - if ((particleMotherOfNeg.pdgCode() == particleMotherOfPos.pdgCode())) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 5.5); - } - if ((particleMotherOfV0 == particleMotherOfBach)) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 6.5); - } - if (particleMotherOfBach.pdgCode() == PDG_t::kXiMinus && - bachelor.pdgCode() == PDG_t::kPiMinus && - particleMotherOfNeg.pdgCode() == PDG_t::kLambda0 && - mcnegtrack.pdgCode() == PDG_t::kPiMinus && - mcpostrack.pdgCode() == PDG_t::kProton) { - histos_Casc.fill(HIST("QA_XiMinusCandidates"), 7.5); - } - } - } - } + } + if (isCascadeSelected(casc, collision, cascMC.rapidityMC(0), kXiP)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 3.5); + if (checkCascadeMCAssociation(cascMC, kXiP)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 4.5); + histos_Casc.fill(HIST("InvMassXiPlusTrue"), cascMC.ptMC(), casc.cascradius(), casc.mXi()); + } + } + if (isCascadeSelected(casc, collision, cascMC.rapidityMC(2), kOmegaM)) { + histos_Casc.fill(HIST("QA_CascCandidates"), 5.5); + if (checkCascadeMCAssociation(cascMC, kOmegaM)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 6.5); + histos_Casc.fill(HIST("InvMassOmegaMinusTrue"), cascMC.ptMC(), casc.cascradius(), casc.mOmega()); + } + } + if (isCascadeSelected(casc, collision, cascMC.rapidityMC(2), kOmegaP)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 7.5); + if (checkCascadeMCAssociation(cascMC, kOmegaP)) { + histos_Casc.fill(HIST("QA_CascadeCandidates"), 8.5); + histos_Casc.fill(HIST("InvMassOmegaPlusTrue"), cascMC.ptMC(), casc.cascradius(), casc.mOmega()); } } } } - PROCESS_SWITCH(v0cascadesQA, processMcCascade, "Process MC level Cascades", false); + + /////////////////////////////////////// + ////////// Collision QA - MC ////////// + /////////////////////////////////////// + + void processGenerated(soa::Join::iterator const& mcCollision, aod::McParticles const& mcParticles, soa::SmallGroups> const& collisions) + { + // Apply selections on MC collisions + if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { + return; + } + if (eventSelections.requireINEL0 && mcCollision.multMCNParticlesEta10() < 1) { + return; + } + if (eventSelections.requireINEL1 && mcCollision.multMCNParticlesEta10() < 2) { + return; + } + + histos_event.fill(HIST("hEventCounterMC"), 0.5); + + // Check if there is at least one of the reconstructed collisions associated to this MC collision + // If so, we consider it + bool atLeastOne = false; + for (const auto& collision : collisions) { + if (!isEventAccepted(collision, false)) { + continue; + } + atLeastOne = true; + } + + if (!atLeastOne) { // Check that the event is reconstructed and that the reconstructed events pass the selection + return; + } + + histos_event.fill(HIST("hEventCounterMC"), 1.5); + + for (auto const& mcparticle : mcParticles) { + + if (!mcparticle.has_daughters()) { + continue; + } + + double vx = 0; + double vy = 0; + for (auto const& mcparticleDaughter0 : mcparticle.daughters_as()) { + vx = mcparticleDaughter0.vx(); + vy = mcparticleDaughter0.vy(); + if (vx != 0 && vy != 0) + break; + } + double R_Decay = std::sqrt(vx * vx + vy * vy); + + if (mcparticle.isPhysicalPrimary() && std::abs(mcparticle.y()) < v0Selections.rapidityCut) { + if (mcparticle.pdgCode() == PDG_t::kK0Short) + histos_event.fill(HIST("GeneratedV0s"), 0.5, mcparticle.pt(), R_Decay); // K0s + if (mcparticle.pdgCode() == PDG_t::kLambda0) + histos_event.fill(HIST("GeneratedV0s"), 1.5, mcparticle.pt(), R_Decay); // Lambda + if (mcparticle.pdgCode() == PDG_t::kLambda0Bar) + histos_event.fill(HIST("GeneratedV0s"), 2.5, mcparticle.pt(), R_Decay); // AntiLambda + } + if (mcparticle.isPhysicalPrimary() && std::abs(mcparticle.y()) < cascSelections.rapidityCut) { + if (mcparticle.pdgCode() == PDG_t::kXiMinus) + histos_event.fill(HIST("GeneratedCascades"), 0.5, mcparticle.pt(), R_Decay); // Xi- + if (mcparticle.pdgCode() == PDG_t::kXiPlusBar) + histos_event.fill(HIST("GeneratedCascades"), 1.5, mcparticle.pt(), R_Decay); // Xi+ + if (mcparticle.pdgCode() == PDG_t::kOmegaMinus) + histos_event.fill(HIST("GeneratedCascades"), 2.5, mcparticle.pt(), R_Decay); // Omega- + if (mcparticle.pdgCode() == PDG_t::kOmegaPlusBar) + histos_event.fill(HIST("GeneratedCascades"), 3.5, mcparticle.pt(), R_Decay); // Omega+ + + // if (!IsParticleFromOutOfBunchPileupCollision){fill the 1.5, 3.5 etc} AliPhysics analysis + } + } + } + + PROCESS_SWITCH(v0cascadesQA, processReconstructed, "Process reconstructed event and V0s+cascades in data", true); + PROCESS_SWITCH(v0cascadesQA, processMonteCarlo, "Process reconstructed event and V0s+cascades in MC", false); + PROCESS_SWITCH(v0cascadesQA, processGenerated, "Process MC level event and V0s+cascades in MC", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx index 770ea3a38a7..6081e136eec 100644 --- a/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx +++ b/PWGLF/Tasks/Resonances/chargedkstaranalysis.cxx @@ -17,6 +17,7 @@ /// \author Navneet Kumar , Protay #include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/mcCentrality.h" #include "PWGLF/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" @@ -69,6 +70,8 @@ #include #include #include +#include +#include #include using namespace o2; @@ -84,6 +87,9 @@ struct Chargedkstaranalysis { FT0C = 1, FT0M = 2 }; + SliceCache cache; + Preslice perCollision = aod::track::collisionId; + struct : ConfigurableGroup { ConfigurableAxis cfgvtxbins{"cfgvtxbins", {VARIABLE_WIDTH, -10.0f, -8.f, -6.f, -4.f, -2.f, 0.f, 2.f, 4.f, 6.f, 8.f, 10.f}, "Mixing bins - z-vertex"}; ConfigurableAxis cfgmultbins{"cfgmultbins", {VARIABLE_WIDTH, 0., 1., 5., 10., 30., 50., 70., 100., 110.}, "Mixing bins - multiplicity"}; @@ -106,7 +112,7 @@ struct Chargedkstaranalysis { Configurable activateProductionFrame{"activateProductionFrame", false, "Activate the THnSparse with cosThStar w.r.t. production axis"}; Configurable activateBeamAxisFrame{"activateBeamAxisFrame", false, "Activate the THnSparse with cosThStar w.r.t. beam axis (Gottified jackson frame)"}; Configurable activateRandomFrame{"activateRandomFrame", false, "Activate the THnSparse with cosThStar w.r.t. random axis"}; - Configurable cRotations{"cRotations", 3, "Number of random rotations in the rotational background"}; + Configurable cRotations{"cRotations", 5, "Number of random rotations in the rotational background"}; Configurable cBoostKShot{"cBoostKShot", true, "Boost the Kshot in Charged Kstar frame of reference"}; // Other cuts on Ks Configurable rotationalCut{"rotationalCut", 10, "Cut value (Rotation angle pi - pi/cut and pi + pi/cut)"}; @@ -125,9 +131,15 @@ struct Chargedkstaranalysis { using TrackCandidates = soa::Join; using V0Candidates = aod::V0Datas; + // for MC reco using MCEventCandidates = soa::Join; using MCTrackCandidates = soa::Join; using MCV0Candidates = soa::Join; + // for MC truth + using MCTrueEventCandidates = aod::McCollisions; + using MCTrueTrackCandidates = aod::McParticles; + + using LorentzVectorSetXYZM = ROOT::Math::LorentzVector>; HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry hChaKstar{"hChaKstar", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; @@ -158,7 +170,7 @@ struct Chargedkstaranalysis { Configurable cNbinsDiv{"cNbinsDiv", 1, "Integer to divide the number of bins"}; struct RCTCut : ConfigurableGroup { - Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; + Configurable requireRCTFlagChecker{"requireRCTFlagChecker", false, "Check event quality in run condition table"}; Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; Configurable cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", false, "Evt sel: RCT flag checker ZDC check"}; Configurable cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", true, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; @@ -185,6 +197,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"}; @@ -272,14 +285,7 @@ struct Chargedkstaranalysis { Configurable cKstarMinRap{"cKstarMinRap", -0.5, "Kstar minimum rapidity"}; } kstarCutCfgs; - struct : ConfigurableGroup { - // For rotational background - Configurable cFillRotBkg{"cFillRotBkg", true, "Fill rotated background"}; - Configurable confMinRot{"confMinRot", 5.0 * o2::constants::math::PI / 6.0, "Minimum of rotation"}; - Configurable confMaxRot{"confMaxRot", 7.0 * o2::constants::math::PI / 6.0, "Maximum of rotation"}; - Configurable nBkgRotations{"nBkgRotations", 9, "Number of rotated copies (background) per each original candidate"}; - } rotBkgEstCfgs; - + Configurable isQaRequired{"isQaRequired", false, "Fill QA plots"}; float centrality; // PDG code @@ -295,9 +301,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 +322,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 +335,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}; @@ -340,224 +346,235 @@ struct Chargedkstaranalysis { // THnSparse AxisSpec mcLabelAxis = {5, -0.5, 4.5, "MC Label"}; - histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{5, 0, 5.0}}); - auto hCutFlow = histos.get(HIST("hEvtSelInfo")); - hCutFlow->GetXaxis()->SetBinLabel(1, "All Events"); - hCutFlow->GetXaxis()->SetBinLabel(2, "coll cuts"); - hCutFlow->GetXaxis()->SetBinLabel(3, "rctChecker"); - hCutFlow->GetXaxis()->SetBinLabel(4, "Multiplicity"); - hCutFlow->GetXaxis()->SetBinLabel(5, "IsINELgt0"); - - constexpr int kNTrackCuts = 22; - - histos.add("QA/hTrackCutFlow", "Track cut flow", kTH1I, {{kNTrackCuts, 0.5, kNTrackCuts + 0.5}}); - - auto hTrackCutFlow = histos.get(HIST("QA/hTrackCutFlow")); - - int bin = 1; - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "All tracks"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT min"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "|eta| max"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS clusters"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC clusters"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC crossed rows ratio"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS chi2/Ncl"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC chi2/Ncl"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has ITS"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has TPC"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has TOF"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS refit"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC refit"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "PV contributor"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Global w/o DCA"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Global track"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Primary track"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "DCAxy max"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "DCAz max"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAxy"); - hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAz"); - - constexpr int kNK0sCuts = 14; - int iK0sbin = 1; - histos.add("QA/K0sCutCheck", "K0s cut flow", kTH1I, {{kNK0sCuts, 0.5, kNK0sCuts + 0.5}}); - auto hK0sCut = histos.get(HIST("QA/K0sCutCheck")); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "All PASS"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DauDCA>max"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "PosDCAtoPVGetXaxis()->SetBinLabel(iK0sbin++, "NegDCAtoPVGetXaxis()->SetBinLabel(iK0sbin++, "pTGetXaxis()->SetBinLabel(iK0sbin++, "|y|>max"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "Rmax"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DCAtoPV>max"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "cosPAGetXaxis()->SetBinLabel(iK0sbin++, "ctau>max"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "qtarmGetXaxis()->SetBinLabel(iK0sbin++, "|M(K0s)-m0|>win"); - hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "cross-mass veto"); - - histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); - histos.add("QA/before/CentDist1", "Centrality distribution", o2::framework::kTH1F, {{110, 0, 110}}); - histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); - histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); - - histos.add("QA/trkbpionTPCPIDME", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - - // Bachelor pion - histos.add("QA/before/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/before/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QA/before/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - histos.add("QA/after/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/after/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QA/after/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 1 - histos.add("QA/before/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QA/before/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/before/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - - histos.add("QA/after/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QA/after/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/after/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - - // Secondary pion 2 - histos.add("QA/before/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/before/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QA/before/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/before/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - histos.add("QA/after/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); - histos.add("QA/after/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QA/after/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QA/after/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - // K0s - histos.add("QA/before/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/before/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/before/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/before/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/before/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QA/before/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); - histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/after/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); - histos.add("QA/after/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QA/after/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); - histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - // Kstar - // Invariant mass nSparse - histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - histos.add("hInvmass_Kstar", "Invariant mass of unlike-sign chK(892)", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); - histos.add("hInvmass_KstarME", "Invariant mass of unlike-sign chK(892)ME", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); - histos.add("hInvmass_KstarRotated", "Invariant mass of unlike-sign chK(892)Rota", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); - - // Mass QA (quick check) - histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QA/before/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); - - histos.add("QA/after/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QA/after/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); - - if (!helicityCfgs.qAOptimisation) { - hChaKstar.add("h3ChaKstarInvMassDS", "h3ChaKstarInvMassDS", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); - hChaKstar.add("h3ChaKstarInvMassME", "h3ChaKstarInvMassME", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); - hChaKstar.add("h3ChaKstarInvMassRot", "h3ChaKstarInvMassRot", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); - } + if (!doprocessMC) { + histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{5, 0, 5.0}}); + auto hCutFlow = histos.get(HIST("hEvtSelInfo")); + hCutFlow->GetXaxis()->SetBinLabel(1, "All Events"); + hCutFlow->GetXaxis()->SetBinLabel(2, "coll cuts"); + hCutFlow->GetXaxis()->SetBinLabel(3, "rctChecker"); + hCutFlow->GetXaxis()->SetBinLabel(4, "Multiplicity"); + hCutFlow->GetXaxis()->SetBinLabel(5, "IsINELgt0"); + if (isQaRequired) { + constexpr int kNTrackCuts = 22; + + histos.add("QA/hTrackCutFlow", "Track cut flow", kTH1I, {{kNTrackCuts, 0.5, kNTrackCuts + 0.5}}); + + auto hTrackCutFlow = histos.get(HIST("QA/hTrackCutFlow")); + + int bin = 1; + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "All tracks"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT min"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "|eta| max"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS clusters"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC clusters"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC crossed rows ratio"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS chi2/Ncl"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC chi2/Ncl"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has ITS"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has TPC"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Has TOF"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "ITS refit"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "TPC refit"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "PV contributor"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Global w/o DCA"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Global track"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "Primary track"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "DCAxy max"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "DCAz max"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAxy"); + hTrackCutFlow->GetXaxis()->SetBinLabel(bin++, "pT-dep DCAz"); + + constexpr int kNK0sCuts = 14; + int iK0sbin = 1; + histos.add("QA/K0sCutCheck", "K0s cut flow", kTH1I, {{kNK0sCuts, 0.5, kNK0sCuts + 0.5}}); + auto hK0sCut = histos.get(HIST("QA/K0sCutCheck")); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "All PASS"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DauDCA>max"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "PosDCAtoPVGetXaxis()->SetBinLabel(iK0sbin++, "NegDCAtoPVGetXaxis()->SetBinLabel(iK0sbin++, "pTGetXaxis()->SetBinLabel(iK0sbin++, "|y|>max"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "Rmax"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "DCAtoPV>max"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "cosPAGetXaxis()->SetBinLabel(iK0sbin++, "ctau>max"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "qtarmGetXaxis()->SetBinLabel(iK0sbin++, "|M(K0s)-m0|>win"); + hK0sCut->GetXaxis()->SetBinLabel(iK0sbin++, "cross-mass veto"); + + histos.add("QA/before/CentDist", "Centrality distribution", {HistType::kTH1D, {centAxis}}); + histos.add("QA/before/CentDist1", "Centrality distribution", o2::framework::kTH1F, {{110, 0, 110}}); + histos.add("QA/before/VtxZ", "Centrality distribution", {HistType::kTH1D, {vtxzAxis}}); + histos.add("QA/before/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + + histos.add("QA/trkbpionTPCPIDME", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + + // Bachelor pion + histos.add("QA/before/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/before/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + histos.add("QA/after/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QA/after/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QA/before/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary pion 2 + histos.add("QA/before/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/before/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/before/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/before/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + histos.add("QA/after/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxisQA, pidQAAxis}); + histos.add("QA/after/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QA/after/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QA/after/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // K0s + histos.add("QA/before/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/before/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/before/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/before/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/before/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/before/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/before/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/before/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + histos.add("QA/after/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxisQA}); + histos.add("QA/after/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QA/after/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QA/after/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QA/after/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QA/after/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QA/after/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QA/after/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // Kstar + // Invariant mass nSparse + histos.add("QA/before/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + + // Mass QA (quick check) + histos.add("QA/before/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/before/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + + histos.add("QA/after/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + histos.add("QA/after/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QA/after/kstarinvmass_Mix", "Invariant mass of unlike-sign chK(892) from mixed event", HistType::kTH1D, {invMassAxisReso}); + } + if (!helicityCfgs.qAOptimisation) { + hChaKstar.add("h3ChaKstarInvMassDS", "h3ChaKstarInvMassDS", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); + hChaKstar.add("h3ChaKstarInvMassRot", "h3ChaKstarInvMassRot", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL}, true); - if (rotBkgEstCfgs.cFillRotBkg) { - histos.add("hRotation", "hRotation", kTH1F, {{360, 0.0, o2::constants::math::TwoPI}}); + // hChaKstar.add("h3ChaKstarInvMassDS", "h3ChaKstarInvMassDS", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); + // hChaKstar.add("h3ChaKstarInvMassRot", "h3ChaKstarInvMassRot", kTHnSparseF, {centAxis, ptAxis, invMassAxisReso, thnAxisPOL, thnAxisPhi}, true); + } } // MC if (doprocessMC) { + if (isQaRequired) { + histos.add("QA/MC/QACent_woCut", "Centrality without cut", HistType::kTH1F, {centAxis}); + histos.add("QA/MC/QACent_woCentCut", "Centrality without cent cut", HistType::kTH1F, {centAxis}); + histos.add("QA/MC/QACent_wCentCut", "Centrality with cent cut", HistType::kTH1F, {centAxis}); + histos.add("QA/MC/QAvtxz_woCut", "z-vertex without cut", HistType::kTH1F, {vtxzAxis}); + histos.add("QA/MC/QAvtxz_wVtxzCut", "z-vertex with vtxz cut", HistType::kTH1F, {vtxzAxis}); + + histos.add("QAMC/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); + // Bachelor pion + histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 1 + histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); + histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + + // Secondary pion 2 + histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); + histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); + histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); + histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); + + // Secondary Resonance (K0s cand) + histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); + + histos.add("QAMC/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxis}); + histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); + histos.add("QAMC/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); + histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); + histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); + histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); + histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); + histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); + + // K892 + histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); + histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); + + histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); + histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); + } + histos.add("EffKstar/genKstar", "Gen Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis}); + histos.add("EffKstar/genKstar_pri", "Gen primary Kstar (|y|<0.5)", HistType::kTH2F, {ptAxis, centAxis}); - histos.add("QAMC/hEvent", "Number of Events", HistType::kTH1F, {{1, 0.5, 1.5}}); - // Bachelor pion - histos.add("QAMC/trkbpionDCAxy", "DCAxy distribution of bachelor pion candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkbpionDCAz", "DCAz distribution of bachelor pion candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkbpionpT", "pT distribution of bachelor pion candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkbpionTPCPID", "TPC PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTOFPID", "TOF PID of bachelor pion candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkbpionTPCTOFPID", "TPC-TOF PID map of bachelor pion candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 1 - histos.add("QAMC/trkppionDCAxy", "DCAxy distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trkppionDCAz", "DCAz distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {dcazAxis}); - histos.add("QAMC/trkppionpT", "pT distribution of secondary pion 1 (positive) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trkppionTPCPID", "TPC PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTOFPID", "TOF PID of secondary pion 1 (positive) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trkppionTPCTOFPID", "TPC-TOF PID map of secondary pion 1 (positive) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - - // Secondary pion 2 - histos.add("QAMC/trknpionTPCPID", "TPC PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTOFPID", "TOF PID of secondary pion 2 (negative) candidates", HistType::kTH2D, {ptAxis, pidQAAxis}); - histos.add("QAMC/trknpionTPCTOFPID", "TPC-TOF PID map of secondary pion 2 (negative) candidates", HistType::kTH2D, {pidQAAxis, pidQAAxis}); - histos.add("QAMC/trknpionpT", "pT distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/trknpionDCAxy", "DCAxy distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcaxyAxis}); - histos.add("QAMC/trknpionDCAz", "DCAz distribution of secondary pion 2 (negative) candidates", HistType::kTH1D, {dcazAxis}); - - // Secondary Resonance (K0s cand) - histos.add("QAMC/hDauDCASecondary", "DCA of daughters of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauPosDCAtoPVSecondary", "Pos DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hDauNegDCAtoPVSecondary", "Neg DCA to PV of daughters secondary resonance", HistType::kTH1D, {dcaAxis}); - - histos.add("QAMC/hpT_Secondary", "pT distribution of secondary resonance", HistType::kTH1D, {ptAxis}); - histos.add("QAMC/hy_Secondary", "Rapidity distribution of secondary resonance", HistType::kTH1D, {yAxis}); - histos.add("QAMC/hRadiusSecondary", "Radius distribution of secondary resonance", HistType::kTH1D, {radiusAxis}); - histos.add("QAMC/hCPASecondary", "Cosine pointing angle distribution of secondary resonance", HistType::kTH1D, {cpaAxis}); - histos.add("QAMC/hDCAtoPVSecondary", "DCA to PV distribution of secondary resonance", HistType::kTH1D, {dcaAxis}); - histos.add("QAMC/hPropTauSecondary", "Proper Lifetime distribution of secondary resonance", HistType::kTH1D, {tauAxis}); - histos.add("QAMC/hPtAsymSecondary", "pT asymmetry distribution of secondary resonance", HistType::kTH1D, {AxisSpec{100, -1, 1, "Pair asymmetry"}}); - histos.add("QAMC/hInvmassSecondary", "Invariant mass of unlike-sign secondary resonance", HistType::kTH1D, {invMassAxisK0s}); - - // K892 - histos.add("QAMC/KstarOA", "Opening angle of chK(892)", HistType::kTH1D, {AxisSpec{100, 0, 3.14, "Opening angle"}}); - histos.add("QAMC/KstarRapidity", "Rapidity distribution of chK(892)", HistType::kTH1D, {yAxis}); - - histos.add("QAMC/kstarinvmass", "Invariant mass of unlike-sign chK(892)", HistType::kTH1D, {invMassAxisReso}); - histos.add("QAMC/kstarinvmass_noKstar", "Invariant mass of unlike-sign no chK(892)", HistType::kTH1D, {invMassAxisReso}); - - histos.add("hInvmass_Kstar_MC", "Invariant mass of unlike chK(892)", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); - - ccdb->setURL(cfgURL); - ccdbApi.init("http://alice-ccdb.cern.ch"); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + histos.add("EffKstar/recoKstar", "Kstar Reco matched (final all)", HistType::kTH2F, {ptAxis, centAxis}); + histos.add("MCReco/hInvmass_Kstar_true", "MC-reco truth-tagged chK(892)", HistType::kTHnSparseD, {centAxis, ptAxis, invMassAxisReso}); } + ccdb->setURL(cfgURL); + ccdbApi.init("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + // Print output histograms statistics LOG(info) << "Size of the histograms in chK(892) Analysis Task"; histos.print(); } + + std::unordered_set allowedMcIds; + std::unordered_map centTruthByAllowed; + float lMultiplicity; template float getCentrality(CollisionType const& collision) @@ -574,107 +591,86 @@ struct Chargedkstaranalysis { } } - // Track selection template bool trackCut(TrackType const& track) { int ibin = 1; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - // basic track cuts - if (std::abs(track.pt()) < trackCutCfgs.cMinPtcut) - return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + auto applyCut = [&](bool condition) -> bool { + if (!condition) + return false; + if (!doprocessMC && isQaRequired) + histos.fill(HIST("QA/hTrackCutFlow"), ibin); + ibin++; + return true; + }; - if (std::abs(track.eta()) > trackCutCfgs.cMaxEtacut) - return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + // First bin (before any cuts) + if (!doprocessMC && isQaRequired) + histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (track.itsNCls() < trackCutCfgs.cfgITScluster) + // Cuts + if (!applyCut(std::abs(track.pt()) >= trackCutCfgs.cMinPtcut)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (track.tpcNClsFound() < trackCutCfgs.cfgTPCcluster) + if (!applyCut(std::abs(track.eta()) <= trackCutCfgs.cMaxEtacut)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (track.tpcCrossedRowsOverFindableCls() < trackCutCfgs.cfgRatioTPCRowsOverFindableCls) + if (!applyCut(track.itsNCls() >= trackCutCfgs.cfgITScluster)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (track.itsChi2NCl() >= trackCutCfgs.cfgITSChi2NCl) + if (!applyCut(track.tpcNClsFound() >= trackCutCfgs.cfgTPCcluster)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (track.tpcChi2NCl() >= trackCutCfgs.cfgTPCChi2NCl) + if (!applyCut(track.tpcCrossedRowsOverFindableCls() >= trackCutCfgs.cfgRatioTPCRowsOverFindableCls)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgHasITS && !track.hasITS()) + if (!applyCut(track.itsChi2NCl() < trackCutCfgs.cfgITSChi2NCl)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgHasTPC && !track.hasTPC()) + if (!applyCut(track.tpcChi2NCl() < trackCutCfgs.cfgTPCChi2NCl)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (trackCutCfgs.cfgHasTOF && !track.hasTOF()) + if (!applyCut(!trackCutCfgs.cfgHasITS || track.hasITS())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgUseITSRefit && !track.passedITSRefit()) + if (!applyCut(!trackCutCfgs.cfgHasTPC || track.hasTPC())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgUseTPCRefit && !track.passedTPCRefit()) + if (!applyCut(!trackCutCfgs.cfgHasTOF || track.hasTOF())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (trackCutCfgs.cfgPVContributor && !track.isPVContributor()) + if (!applyCut(!trackCutCfgs.cfgUseITSRefit || track.passedITSRefit())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgGlobalWoDCATrack && !track.isGlobalTrackWoDCA()) + if (!applyCut(!trackCutCfgs.cfgUseTPCRefit || track.passedTPCRefit())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (trackCutCfgs.cfgGlobalTrack && !track.isGlobalTrack()) + if (!applyCut(!trackCutCfgs.cfgPVContributor || track.isPVContributor())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (trackCutCfgs.cfgPrimaryTrack && !track.isPrimaryTrack()) + if (!applyCut(!trackCutCfgs.cfgGlobalWoDCATrack || track.isGlobalTrackWoDCA())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - - if (std::abs(track.dcaXY()) > trackCutCfgs.cMaxbDCArToPVcut) + if (!applyCut(!trackCutCfgs.cfgGlobalTrack || track.isGlobalTrack())) + return false; + if (!applyCut(!trackCutCfgs.cfgPrimaryTrack || track.isPrimaryTrack())) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); - if (std::abs(track.dcaZ()) > trackCutCfgs.cMaxbDCAzToPVcut) + if (!applyCut(std::abs(track.dcaXY()) <= trackCutCfgs.cMaxbDCArToPVcut)) + return false; + if (!applyCut(std::abs(track.dcaZ()) <= trackCutCfgs.cMaxbDCAzToPVcut)) return false; - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + // pT dependent DCA XY if (trackCutCfgs.cfgpTdepDCAxyCut) { - if (std::abs(track.dcaXY()) > (0.004 + (0.013 / track.pt()))) + if (!applyCut(std::abs(track.dcaXY()) <= (0.004 + (0.013 / track.pt())))) return false; } else { - if (std::abs(track.dcaXY()) > trackCutCfgs.cfgMaxbDCArToPVcut) + if (!applyCut(std::abs(track.dcaXY()) <= trackCutCfgs.cfgMaxbDCArToPVcut)) return false; } - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + // pT dependent DCA Z if (trackCutCfgs.cfgpTdepDCAzCut) { - // Tuned on the LHC22f anchored MC LHC23d1d on primary pions. 7 Sigmas of the resolution - if (std::abs(track.dcaZ()) > (0.004 + (0.013 / track.pt()))) + if (!applyCut(std::abs(track.dcaZ()) <= (0.004 + (0.013 / track.pt())))) return false; } else { - if (std::abs(track.dcaZ()) > trackCutCfgs.cfgMaxbDCAzToPVcut) + if (!applyCut(std::abs(track.dcaZ()) <= trackCutCfgs.cfgMaxbDCAzToPVcut)) return false; } - histos.fill(HIST("QA/hTrackCutFlow"), ibin++); + return true; } - // PID selection tools template bool selectionPIDPion(TrackType const& candidate) @@ -702,108 +698,51 @@ 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(); + bool returnFlag = true; + + auto applyCut = [&](bool condition) { + if (!condition) { + returnFlag = false; + } + if (returnFlag && (!doprocessMC && isQaRequired)) { + histos.fill(HIST("QA/K0sCutCheck"), ibin); + } + ibin++; + }; + + // Precompute variables + 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(); auto mLambda = candidate.mLambda(); auto mALambda = candidate.mAntiLambda(); - bool returnFlag = true; - histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (dauDCA > secondaryCutsCfgs.cSecondaryDauDCAMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (dauPosDCAtoPV < secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (dauNegDCAtoPV < secondaryCutsCfgs.cSecondaryDauNegDCAtoPVMin) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (pT < secondaryCutsCfgs.cSecondaryPtMin) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (std::fabs(rapidity) > secondaryCutsCfgs.cSecondaryRapidityMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (v0Radius < secondaryCutsCfgs.cSecondaryRadiusMin || v0Radius > secondaryCutsCfgs.cSecondaryRadiusMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (dcaToPV > secondaryCutsCfgs.cSecondaryDCAtoPVMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (cosPA < secondaryCutsCfgs.cSecondaryCosPAMin) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) + if (!doprocessMC && isQaRequired) histos.fill(HIST("QA/K0sCutCheck"), ibin); - if (propTauK0s > secondaryCutsCfgs.cSecondaryProperLifetimeMax) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); + applyCut(dauDCA <= secondaryCutsCfgs.cSecondaryDauDCAMax); + applyCut(dauPosDCAtoPV >= secondaryCutsCfgs.cSecondaryDauPosDCAtoPVMin); + applyCut(dauNegDCAtoPV >= secondaryCutsCfgs.cSecondaryDauNegDCAtoPVMin); + applyCut(pT >= secondaryCutsCfgs.cSecondaryPtMin); + applyCut(std::fabs(rapidity) <= secondaryCutsCfgs.cSecondaryRapidityMax); + applyCut(v0Radius >= secondaryCutsCfgs.cSecondaryRadiusMin && v0Radius <= secondaryCutsCfgs.cSecondaryRadiusMax); + applyCut(dcaToPV <= secondaryCutsCfgs.cSecondaryDCAtoPVMax); + applyCut(cosPA >= secondaryCutsCfgs.cSecondaryCosPAMin); + applyCut(propTauK0s <= secondaryCutsCfgs.cSecondaryProperLifetimeMax); + applyCut(candidate.qtarm() >= secondaryCutsCfgs.cfgSecondaryparamArmenterosCut * std::fabs(candidate.alpha())); + applyCut(std::fabs(mK0s - MassK0Short) <= secondaryCutsCfgs.cSecondaryMassWindow); - if (candidate.qtarm() < secondaryCutsCfgs.cfgSecondaryparamArmenterosCut * std::fabs(candidate.alpha())) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); - - if (std::fabs(mK0s - MassK0Short) > secondaryCutsCfgs.cSecondaryMassWindow) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); + applyCut(!secondaryCutsCfgs.cfgSecondaryCrossMassHypothesisCut || ((std::fabs(mLambda - MassLambda0) >= secondaryCutsCfgs.cfgSecondaryCrossMassCutWindow) && (std::fabs(mALambda - MassLambda0Bar) >= secondaryCutsCfgs.cfgSecondaryCrossMassCutWindow))); - if (secondaryCutsCfgs.cfgSecondaryCrossMassHypothesisCut && - ((std::fabs(mLambda - MassLambda0) < secondaryCutsCfgs.cfgSecondaryCrossMassCutWindow) || (std::fabs(mALambda - MassLambda0Bar) < secondaryCutsCfgs.cfgSecondaryCrossMassCutWindow))) { - returnFlag = false; - } - ibin++; - if (returnFlag == true) - histos.fill(HIST("QA/K0sCutCheck"), ibin); return returnFlag; - - } // selectionK0s - + } template bool isTrueKstar(const TrackTemplate& bTrack, const V0Template& K0scand) { @@ -842,6 +781,53 @@ struct Chargedkstaranalysis { double massPi = o2::constants::physics::MassPionCharged; double massK0s = o2::constants::physics::MassK0Short; + template + bool matchRecoToTruthKstar(V0T const& v0, TrkT const& trk) + { + if (!v0.has_mcParticle() || !trk.has_mcParticle()) + return false; + + auto mcK0s = v0.template mcParticle_as(); + auto mcPi = trk.template mcParticle_as(); + + if (std::abs(mcK0s.pdgCode()) != kPDGK0s) + return false; + if (std::abs(mcPi.pdgCode()) != kPiPlus) + return false; + + MCTrueTrackCandidates::iterator kstarFromPi; + bool havePiKstar = false; + for (const auto& m1 : mcPi.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kKstarPlus) { + kstarFromPi = m1; + havePiKstar = true; + break; + } + } + if (!havePiKstar) { + return false; + } + + bool shareSameKstar = false; + for (const auto& m1 : mcK0s.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kPDGK0) { + for (const auto& m2 : m1.template mothers_as()) { + if (m2.globalIndex() == kstarFromPi.globalIndex()) { + shareSameKstar = true; + break; + } + } + if (shareSameKstar) + break; + } + } + if (!shareSameKstar) { + return false; + } + + return true; + } // matchRecoToTruthKstar + template void fillInvMass(const T& mother, float multiplicity, const T& daughter1, const T& daughter2, bool isMix) { @@ -895,7 +881,7 @@ struct Chargedkstaranalysis { auto cosThetaStarHelicity = mother.Vect().Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(mother.Vect().Mag2())); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity); //, anglePhi); } for (int i = 0; i < helicityCfgs.cRotations; i++) { @@ -911,18 +897,14 @@ struct Chargedkstaranalysis { auto cosThetaStarHelicityRot = motherRot.Vect().Dot(daughterRotCM.Vect()) / (std::sqrt(daughterRotCM.Vect().Mag2()) * std::sqrt(motherRot.Vect().Mag2())); auto phiHelicityRot = std::atan2(yaxisHE.Dot(daughterRotCM.Vect().Unit()), xaxisHE.Dot(daughterRotCM.Vect().Unit())); phiHelicityRot = RecoDecay::constrainAngle(phiHelicityRot, 0.0); - if (motherRot.Rapidity() < helicityCfgs.rapidityMotherData) - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot, phiHelicityRot); - } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarHelicity, anglePhi); + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarHelicityRot); //, phiHelicityRot); } } } else if (helicityCfgs.activateCollinsSoperFrame) { if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarCS, phiCS); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarCS); //, phiCS); } for (int i = 0; i < helicityCfgs.cRotations; i++) { @@ -939,12 +921,8 @@ struct Chargedkstaranalysis { auto phiCSrot = std::atan2(yAxisCS.Dot(daughterRotCM.Vect().Unit()), xAxisCS.Dot(daughterRotCM.Vect().Unit())); phiCSrot = RecoDecay::constrainAngle(phiCSrot, 0.0); - if (motherRot.Rapidity() < helicityCfgs.rapidityMotherData) - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarCSrot, phiCSrot); - } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarCS, phiCS); + if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarCSrot); //, phiCSrot); } } } else if (helicityCfgs.activateProductionFrame) { @@ -952,38 +930,30 @@ struct Chargedkstaranalysis { auto cosThetaProduction = normalVec.Dot(fourVecDauCM.Vect()) / (std::sqrt(fourVecDauCM.Vect().Mag2()) * std::sqrt(normalVec.Mag2())); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaProduction, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaProduction); //, anglePhi); } for (int i = 0; i < helicityCfgs.cRotations; i++) { theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaProduction, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaProduction); //, anglePhi); } } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaProduction, anglePhi); - } } } else if (helicityCfgs.activateBeamAxisFrame) { beamVec = ROOT::Math::XYZVector(0.f, 0.f, 1.f); auto cosThetaStarBeam = beamVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam); //, anglePhi); } for (int i = 0; i < helicityCfgs.cRotations; i++) { theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarBeam, anglePhi); + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarBeam); //, anglePhi); } } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarBeam, anglePhi); - } } } else if (helicityCfgs.activateRandomFrame) { auto phiRandom = gRandom->Uniform(0.f, constants::math::TwoPI); @@ -993,19 +963,15 @@ struct Chargedkstaranalysis { auto cosThetaStarRandom = randomVec.Dot(fourVecDauCM.Vect()) / std::sqrt(fourVecDauCM.Vect().Mag2()); if (!isMix) { if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom, phiRandom); + hChaKstar.fill(HIST("h3ChaKstarInvMassDS"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom); //, phiRandom); } for (int i = 0; i < helicityCfgs.cRotations; i++) { theta2 = rn->Uniform(o2::constants::math::PI - o2::constants::math::PI / helicityCfgs.rotationalCut, o2::constants::math::PI + o2::constants::math::PI / helicityCfgs.rotationalCut); motherRot = ROOT::Math::PxPyPzMVector(mother.Px() * std::cos(theta2) - mother.Py() * std::sin(theta2), mother.Px() * std::sin(theta2) + mother.Py() * std::cos(theta2), mother.Pz(), mother.M()); if (std::abs(motherRot.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarRandom, phiRandom); + hChaKstar.fill(HIST("h3ChaKstarInvMassRot"), multiplicity, motherRot.Pt(), motherRot.M(), cosThetaStarRandom); //, phiRandom); } } - } else { - if (std::abs(mother.Rapidity()) < helicityCfgs.rapidityMotherData) { - hChaKstar.fill(HIST("h3ChaKstarInvMassME"), multiplicity, mother.Pt(), mother.M(), cosThetaStarRandom, phiRandom); - } } } // } @@ -1014,69 +980,82 @@ struct Chargedkstaranalysis { template void fillHistograms(const CollisionType& collision, const TracksType& dTracks1, const TracksTypeK0s& dTracks2) { - histos.fill(HIST("QA/before/CentDist"), collision.centFT0M()); - histos.fill(HIST("QA/before/CentDist1"), collision.centFT0M()); - ROOT::Math::PxPyPzMVector lDecayDaughter1, lDecayDaughter2, lResoSecondary, lDecayDaughter_bach, lResoKstar, chargeKstarrot; - std::vector trackIndicies = {}; - std::vector k0sIndicies = {}; + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/before/CentDist"), collision.centFT0M()); + histos.fill(HIST("QA/before/CentDist1"), collision.centFT0M()); + } + + ROOT::Math::PxPyPzMVector lResoSecondary, lDecayDaughter_bach, lResoKstar, chargeKstarrot; + + std::vector trackIndicies; + std::vector k0sIndicies; + // ========================= + // Bachelor tracks + // ========================= for (const auto& bTrack : dTracks1) { + auto trkbpt = bTrack.pt(); auto istrkbhasTOF = bTrack.hasTOF(); auto trkbNSigmaPiTPC = bTrack.tpcNSigmaPi(); - auto trkbNSigmaPiTOF = (istrkbhasTOF) ? bTrack.tofNSigmaPi() : -999.; + auto trkbNSigmaPiTOF = istrkbhasTOF ? bTrack.tofNSigmaPi() : -999.; if constexpr (!IsMix) { - // Bachelor pion QA plots - histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); - if (istrkbhasTOF) { - histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); - histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/before/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/before/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/before/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/before/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/before/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/before/trkbpionDCAz"), bTrack.dcaZ()); } - histos.fill(HIST("QA/before/trkbpionpT"), trkbpt); - histos.fill(HIST("QA/before/trkbpionDCAxy"), bTrack.dcaXY()); - histos.fill(HIST("QA/before/trkbpionDCAz"), bTrack.dcaZ()); } else { - - histos.fill(HIST("QA/trkbpionTPCPIDME"), trkbpt, trkbNSigmaPiTPC); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/trkbpionTPCPIDME"), trkbpt, trkbNSigmaPiTPC); + } } - if (!trackCut(bTrack)) - continue; - if (!selectionPIDPion(bTrack)) + if (!trackCut(bTrack) || !selectionPIDPion(bTrack)) continue; if constexpr (!IsMix) { - // Bachelor pion QA plots after applying cuts - histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); - if (istrkbhasTOF) { - histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); - histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/after/trkbpionTPCPID"), trkbpt, trkbNSigmaPiTPC); + if (istrkbhasTOF) { + histos.fill(HIST("QA/after/trkbpionTOFPID"), trkbpt, trkbNSigmaPiTOF); + histos.fill(HIST("QA/after/trkbpionTPCTOFPID"), trkbNSigmaPiTPC, trkbNSigmaPiTOF); + } + histos.fill(HIST("QA/after/trkbpionpT"), trkbpt); + histos.fill(HIST("QA/after/trkbpionDCAxy"), bTrack.dcaXY()); + histos.fill(HIST("QA/after/trkbpionDCAz"), bTrack.dcaZ()); } - histos.fill(HIST("QA/after/trkbpionpT"), trkbpt); - histos.fill(HIST("QA/after/trkbpionDCAxy"), bTrack.dcaXY()); - histos.fill(HIST("QA/after/trkbpionDCAz"), bTrack.dcaZ()); } + trackIndicies.push_back(bTrack.index()); } + // ========================= + // K0s loop + // ========================= for (const auto& K0scand : dTracks2) { - auto posDauTrack = K0scand.template posTrack_as(); - auto negDauTrack = K0scand.template negTrack_as(); - - /// Daughters - // Positve pion - auto trkppt = posDauTrack.pt(); - auto istrkphasTOF = posDauTrack.hasTOF(); - auto trkpNSigmaPiTPC = posDauTrack.tpcNSigmaPi(); - auto trkpNSigmaPiTOF = (istrkphasTOF) ? posDauTrack.tofNSigmaPi() : -999.; - // Negative pion - auto trknpt = negDauTrack.pt(); - auto istrknhasTOF = negDauTrack.hasTOF(); - auto trknNSigmaPiTPC = negDauTrack.tpcNSigmaPi(); - auto trknNSigmaPiTOF = (istrknhasTOF) ? negDauTrack.tofNSigmaPi() : -999.; - - /// K0s + + auto pos = K0scand.template posTrack_as(); + auto neg = K0scand.template negTrack_as(); + + auto trkppt = pos.pt(); + auto trknpt = neg.pt(); + + auto istrkphasTOF = pos.hasTOF(); + auto istrknhasTOF = neg.hasTOF(); + + auto trkpNSigmaPiTPC = pos.tpcNSigmaPi(); + auto trknNSigmaPiTPC = neg.tpcNSigmaPi(); + + auto trkpNSigmaPiTOF = istrkphasTOF ? pos.tofNSigmaPi() : -999.; + auto trknNSigmaPiTOF = istrknhasTOF ? neg.tofNSigmaPi() : -999.; + auto trkkDauDCA = K0scand.dcaV0daughters(); auto trkkDauDCAPostoPV = K0scand.dcapostopv(); auto trkkDauDCANegtoPV = K0scand.dcanegtopv(); @@ -1088,139 +1067,99 @@ struct Chargedkstaranalysis { auto trkkMass = K0scand.mK0Short(); if constexpr (!IsMix) { - // Seconddary QA plots - histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); - if (istrkphasTOF) { - histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); - histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); - } - histos.fill(HIST("QA/before/trkppionpT"), trkppt); - histos.fill(HIST("QA/before/trkppionDCAxy"), posDauTrack.dcaXY()); - histos.fill(HIST("QA/before/trkppionDCAz"), posDauTrack.dcaZ()); - - histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); - if (istrknhasTOF) { - histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); - histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + if (!doprocessMC && isQaRequired) { + // positive pion + histos.fill(HIST("QA/before/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); + if (istrkphasTOF) { + histos.fill(HIST("QA/before/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); + histos.fill(HIST("QA/before/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + } + + // negative pion + histos.fill(HIST("QA/before/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); + if (istrknhasTOF) { + histos.fill(HIST("QA/before/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); + histos.fill(HIST("QA/before/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); + } + + // K0s + histos.fill(HIST("QA/before/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/before/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/before/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + histos.fill(HIST("QA/before/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/before/hy_Secondary"), trkky); + histos.fill(HIST("QA/before/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); } - histos.fill(HIST("QA/before/trknpionpT"), trknpt); - histos.fill(HIST("QA/before/trknpionDCAxy"), negDauTrack.dcaXY()); - histos.fill(HIST("QA/before/trknpionDCAz"), negDauTrack.dcaZ()); - - histos.fill(HIST("QA/before/hDauDCASecondary"), trkkDauDCA); - histos.fill(HIST("QA/before/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); - histos.fill(HIST("QA/before/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); - - histos.fill(HIST("QA/before/hpT_Secondary"), trkkpt); - histos.fill(HIST("QA/before/hy_Secondary"), trkky); - histos.fill(HIST("QA/before/hRadiusSecondary"), trkkRadius); - histos.fill(HIST("QA/before/hDCAtoPVSecondary"), trkkDCAtoPV); - histos.fill(HIST("QA/before/hCPASecondary"), trkkCPA); - histos.fill(HIST("QA/before/hInvmassSecondary"), trkkMass); } - if (!secondaryCutsCfgs.cfgByPassDauPIDSelection && !selectionPIDPion(posDauTrack)) // Perhaps it's already applied in trackCut (need to check QA plots) - continue; - if (!secondaryCutsCfgs.cfgByPassDauPIDSelection && !selectionPIDPion(negDauTrack)) - continue; - if (!selectionK0s(collision, K0scand)) + if ((!secondaryCutsCfgs.cfgByPassDauPIDSelection && + (!selectionPIDPion(pos) || !selectionPIDPion(neg))) || + !selectionK0s(collision, K0scand)) continue; if constexpr (!IsMix) { - // Seconddary QA plots after applying cuts - - histos.fill(HIST("QA/after/trkppionTPCPID"), trkppt, trkpNSigmaPiTPC); - if (istrkphasTOF) { - histos.fill(HIST("QA/after/trkppionTOFPID"), trkppt, trkpNSigmaPiTOF); - histos.fill(HIST("QA/after/trkppionTPCTOFPID"), trkpNSigmaPiTPC, trkpNSigmaPiTOF); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); + histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); + histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); + histos.fill(HIST("QA/after/hpT_Secondary"), trkkpt); + histos.fill(HIST("QA/after/hy_Secondary"), trkky); + histos.fill(HIST("QA/after/hRadiusSecondary"), trkkRadius); + histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); + histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); + histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); } - histos.fill(HIST("QA/after/trkppionpT"), trkppt); - histos.fill(HIST("QA/after/trkppionDCAxy"), posDauTrack.dcaXY()); - histos.fill(HIST("QA/after/trkppionDCAz"), posDauTrack.dcaZ()); - - histos.fill(HIST("QA/after/trknpionTPCPID"), trknpt, trknNSigmaPiTPC); - if (istrknhasTOF) { - histos.fill(HIST("QA/after/trknpionTOFPID"), trknpt, trknNSigmaPiTOF); - histos.fill(HIST("QA/after/trknpionTPCTOFPID"), trknNSigmaPiTPC, trknNSigmaPiTOF); - } - histos.fill(HIST("QA/after/trknpionpT"), trknpt); - histos.fill(HIST("QA/after/trknpionDCAxy"), negDauTrack.dcaXY()); - histos.fill(HIST("QA/after/trknpionDCAz"), negDauTrack.dcaZ()); - - histos.fill(HIST("QA/after/hDauDCASecondary"), trkkDauDCA); - histos.fill(HIST("QA/after/hDauPosDCAtoPVSecondary"), trkkDauDCAPostoPV); - histos.fill(HIST("QA/after/hDauNegDCAtoPVSecondary"), trkkDauDCANegtoPV); - - histos.fill(HIST("QA/after/hpT_Secondary"), trkkpt); - histos.fill(HIST("QA/after/hy_Secondary"), trkky); - histos.fill(HIST("QA/after/hRadiusSecondary"), trkkRadius); - histos.fill(HIST("QA/after/hDCAtoPVSecondary"), trkkDCAtoPV); - histos.fill(HIST("QA/after/hCPASecondary"), trkkCPA); - histos.fill(HIST("QA/after/hInvmassSecondary"), trkkMass); } + k0sIndicies.push_back(K0scand.index()); } - for (const auto& trackIndex : trackIndicies) { - for (const auto& k0sIndex : k0sIndicies) { - auto bTrack = dTracks1.rawIteratorAt(trackIndex); - auto k0Scand = dTracks2.rawIteratorAt(k0sIndex); - lDecayDaughter_bach = ROOT::Math::PxPyPzMVector(bTrack.px(), bTrack.py(), bTrack.pz(), massPi); - lResoSecondary = ROOT::Math::PxPyPzMVector(k0Scand.px(), k0Scand.py(), k0Scand.pz(), massK0s); + // ========================= + // Pairing + // ========================= + for (auto tIdx : trackIndicies) { + for (auto kIdx : k0sIndicies) { + + auto bTrack = dTracks1.rawIteratorAt(tIdx); + auto k0s = dTracks2.rawIteratorAt(kIdx); + + lDecayDaughter_bach = {bTrack.px(), bTrack.py(), bTrack.pz(), massPi}; + lResoSecondary = {k0s.px(), k0s.py(), k0s.pz(), massK0s}; lResoKstar = lResoSecondary + lDecayDaughter_bach; - // QA plots if constexpr (!IsMix) { - histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); - histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/before/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/before/kstarinvmass"), lResoKstar.M()); + } } - if (lResoKstar.Rapidity() > kstarCutCfgs.cKstarMaxRap || lResoKstar.Rapidity() < kstarCutCfgs.cKstarMinRap) + if (lResoKstar.Rapidity() > kstarCutCfgs.cKstarMaxRap || + lResoKstar.Rapidity() < kstarCutCfgs.cKstarMinRap) continue; if constexpr (!IsMix) { + if (!doprocessMC && isQaRequired) { + histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); + histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); + } - histos.fill(HIST("QA/after/KstarRapidity"), lResoKstar.Rapidity()); - histos.fill(HIST("QA/after/kstarinvmass"), lResoKstar.M()); - histos.fill(HIST("hInvmass_Kstar"), collision.centFT0M(), lResoKstar.Pt(), lResoKstar.M()); if (helicityCfgs.cBoostKShot) { fillInvMass(lResoKstar, collision.centFT0M(), lResoSecondary, lDecayDaughter_bach, IsMix); } else { fillInvMass(lResoKstar, collision.centFT0M(), lDecayDaughter_bach, lResoSecondary, IsMix); } } else { - - histos.fill(HIST("hInvmass_KstarME"), collision.centFT0M(), lResoKstar.Pt(), lResoKstar.M()); fillInvMass(lResoKstar, collision.centFT0M(), lResoSecondary, lDecayDaughter_bach, IsMix); } - if constexpr (!IsMix) { - if (rotBkgEstCfgs.cFillRotBkg) { - for (int nrotbkg = 0; nrotbkg < rotBkgEstCfgs.nBkgRotations; nrotbkg++) { - auto rotangle = o2::constants::math::PI; // If there is only one rotation then it should be pi ): - if (rotBkgEstCfgs.nBkgRotations > 1) { - auto anglestart = rotBkgEstCfgs.confMinRot; - auto angleend = rotBkgEstCfgs.confMaxRot; - auto anglestep = (angleend - anglestart) / (1.0 * (rotBkgEstCfgs.nBkgRotations - 1)); - rotangle = anglestart + nrotbkg * anglestep; - } - histos.fill(HIST("hRotation"), rotangle); - auto rotpionPx = lDecayDaughter_bach.Px() * std::cos(rotangle) - lDecayDaughter_bach.Py() * std::sin(rotangle); - auto rotpionPy = lDecayDaughter_bach.Px() * std::sin(rotangle) + lDecayDaughter_bach.Py() * std::cos(rotangle); - ROOT::Math::PtEtaPhiMVector pionrot; - pionrot = ROOT::Math::PxPyPzMVector(rotpionPx, rotpionPy, lDecayDaughter_bach.Pz(), massPi); - chargeKstarrot = pionrot + lResoSecondary; - if (chargeKstarrot.Rapidity() > kstarCutCfgs.cKstarMaxRap || chargeKstarrot.Rapidity() < kstarCutCfgs.cKstarMinRap) - continue; - histos.fill(HIST("hInvmass_KstarRotated"), collision.centFT0M(), chargeKstarrot.Pt(), chargeKstarrot.M()); - } - } - } - } // K0scand - } // bTrack + } + } count++; - - } // fillHistograms + } // process data void processDataSE(EventCandidates::iterator const& collision, @@ -1249,7 +1188,6 @@ struct Chargedkstaranalysis { } PROCESS_SWITCH(Chargedkstaranalysis, processDataSE, "Process Event for data without Partitioning", true); - SliceCache cache; using BinningTypeVertexContributor = ColumnBinningPolicy; BinningTypeVertexContributor binningOnPositions{{axisCfgs.cfgvtxbins, axisCfgs.cfgmultbins}, true}; Pair pair{binningOnPositions, nEvtMixing, -1, &cache}; @@ -1295,15 +1233,178 @@ struct Chargedkstaranalysis { } PROCESS_SWITCH(Chargedkstaranalysis, processDataME, "Process Event for data without Partitioning", true); - // process MC reconstructed level - void processMC(MCEventCandidates::iterator const& collision, - MCTrackCandidates const& tracks, - MCV0Candidates const& v0s) + void processMC(soa::Join const&, aod::McParticles& mcParticles, soa::Join const& events, MCV0Candidates const& v0s, MCTrackCandidates const& tracks) { + allowedMcIds.clear(); + centTruthByAllowed.clear(); + + // To apply event selection and store the collision IDs of reconstructed tracks that pass the selection criteria + for (const auto& coll : events) { + + if (!coll.has_mcCollision()) + continue; + + const auto mcid = coll.mcCollisionId(); + + const auto mccoll = coll.template mcCollision_as>(); + const float lCentrality = mccoll.centFT0M(); + + if (doprocessMC && isQaRequired) { + histos.fill(HIST("QA/MC/QACent_woCut"), lCentrality); + histos.fill(HIST("QA/MC/QAvtxz_woCut"), coll.posZ()); + } + + if (!colCuts.isSelected(coll)) + continue; + if (rctCut.requireRCTFlagChecker && !rctCut.rctChecker(coll)) + continue; + if (!coll.isInelGt0()) + continue; + + if (doprocessMC && isQaRequired) { + histos.fill(HIST("QA/MC/QACent_woCentCut"), lCentrality); + histos.fill(HIST("QA/MC/QAvtxz_wVtxzCut"), coll.posZ()); + } + + if (lCentrality < eventCutCfgs.cfgEventCentralityMin || lCentrality > eventCutCfgs.cfgEventCentralityMax) + continue; + + if (doprocessMC && isQaRequired) { + histos.fill(HIST("QA/MC/QACent_wCentCut"), lCentrality); + } + allowedMcIds.insert(mcid); + centTruthByAllowed.emplace(mcid, lCentrality); + } + + // Calculating the generated Kstar + for (const auto& part : mcParticles) { + if (!part.has_mcCollision()) + continue; + if (std::abs(part.pdgCode()) != kKstarPlus) + continue; + if (std::abs(part.y()) > kstarCutCfgs.cKstarMaxRap) + continue; + + const int pionWanted = (part.pdgCode() > 0) ? +kPiPlus : -kPiPlus; + bool hasRightPion = false; + bool hasK0sToPipi = false; + + for (const auto& d1 : part.template daughters_as()) { + const int pdg1 = d1.pdgCode(); + if (pdg1 == pionWanted) { + hasRightPion = true; + } else if (std::abs(pdg1) == kPDGK0) { + for (const auto& d2 : d1.template daughters_as()) { + if (std::abs(d2.pdgCode()) == kPDGK0s) { + bool seenPip = false, seenPim = false; + for (const auto& d3 : d2.template daughters_as()) { + if (d3.pdgCode() == +kPiPlus) + seenPip = true; + else if (d3.pdgCode() == -kPiPlus) + seenPim = true; + } + if (seenPip && seenPim) { + hasK0sToPipi = true; + break; + } + } + } + } + if (hasRightPion && hasK0sToPipi) + break; + } + + if (!(hasRightPion && hasK0sToPipi)) + continue; + + const auto mcid = part.mcCollisionId(); + if (allowedMcIds.count(mcid) == 0) + continue; - // histos.fill(HIST("QAMC/hEvent"), 1.0); + auto iter = centTruthByAllowed.find(mcid); + if (iter == centTruthByAllowed.end()) + continue; + + const float lCentrality = iter->second; - fillHistograms(collision, tracks, v0s); + histos.fill(HIST("EffKstar/genKstar"), part.pt(), lCentrality); + + if (part.vt() == 0) { + histos.fill(HIST("EffKstar/genKstar_pri"), part.pt(), lCentrality); // To check the primary particle + } + } + // To store the recoKstar + for (const auto& v0 : v0s) { + auto coll = v0.template collision_as(); + + if (!coll.has_mcCollision()) + continue; + + const auto mcid = coll.mcCollisionId(); + + if (allowedMcIds.count(mcid) == 0) + continue; // To check the event is allowed or not + + const auto mccoll = coll.template mcCollision_as>(); + const float lCentrality = mccoll.centFT0M(); + + if (!secondaryCutsCfgs.cfgByPassDauPIDSelection) { + auto posDauTrack = v0.template posTrack_as(); + auto negDauTrack = v0.template negTrack_as(); + if (!selectionPIDPion(posDauTrack)) + continue; + if (!selectionPIDPion(negDauTrack)) + continue; + } + if (!selectionK0s(coll, v0)) + continue; + + auto trks = tracks.sliceBy(perCollision, v0.collisionId()); // Grouping the tracks with the v0s, means only those tracks that belong to the same collision as v0 + for (const auto& bTrack : trks) { + if (bTrack.collisionId() != v0.collisionId()) + continue; + if (!trackCut(bTrack)) + continue; + if (!selectionPIDPion(bTrack)) + continue; + + LorentzVectorSetXYZM lResoSecondary, lDecayDaughter_bach, lResoKstar, lDaughterRot; + + lResoSecondary = LorentzVectorSetXYZM(v0.px(), v0.py(), v0.pz(), MassK0Short); + lDecayDaughter_bach = LorentzVectorSetXYZM(bTrack.px(), bTrack.py(), bTrack.pz(), MassPionCharged); + lResoKstar = lResoSecondary + lDecayDaughter_bach; + + const double ptreco = lResoKstar.Pt(); + const double yreco = lResoKstar.Rapidity(); + if (std::abs(yreco) > kstarCutCfgs.cKstarMaxRap) + continue; + + // Since we are doing the MC study and we know about the PDG code of each particle let's try to check the things which we have + if (!v0.has_mcParticle() || !bTrack.has_mcParticle()) + continue; + auto mcK0s = v0.template mcParticle_as(); // To get the MC truth particle corressponds to the V0 candidate + auto mcPi = bTrack.template mcParticle_as(); + if (std::abs(mcK0s.pdgCode()) != kPDGK0s) + continue; + if (std::abs(mcPi.pdgCode()) != kPiPlus) + continue; + MCTrueTrackCandidates::iterator kstarFromPi; + bool havePiKstar = false; + // Loops over all the mother's of pions and check if this pion comming from a kstar + for (const auto& m1 : mcPi.template mothers_as()) { + if (std::abs(m1.pdgCode()) == kKstarPlus) { + kstarFromPi = m1; + havePiKstar = true; + break; + } + } + if (!havePiKstar) { + continue; + } + histos.fill(HIST("EffKstar/recoKstar"), ptreco, lCentrality); + histos.fill(HIST("MCReco/hInvmass_Kstar_true"), lCentrality, ptreco, lResoKstar.M()); + } + } } PROCESS_SWITCH(Chargedkstaranalysis, processMC, "Process Event for MC", false); }; 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/Resonances/lambda1520analysisinpp.cxx b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx index fada8bbc6e4..6c6d0a66b25 100644 --- a/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx +++ b/PWGLF/Tasks/Resonances/lambda1520analysisinpp.cxx @@ -428,6 +428,11 @@ struct Lambda1520analysisinpp { histos.add("Result/MC/h3lambda1520Recoinvmass", "Invariant mass of Reconstructed MC #Lambda(1520)0", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); histos.add("Result/MC/h3antilambda1520Recoinvmass", "Invariant mass of Reconstructed MC Anti-#Lambda(1520)0", kTHnSparseF, {axisMult, axisPt, axisMassLambda1520}); } + if (doprocessdummy) { + histos.add("Result/dummy/Genprotonpt", "pT distribution of #Lambda(1520) from Proton", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/dummy/Genlambdapt", "pT distribution of #Lambda(1520) from #Lambda", kTH3F, {axisMClabel, axisPt, axisMult}); + histos.add("Result/dummy/Genxipt", "pT distribution of #Lambda(1520) from #Xi^{-}", kTH3F, {axisMClabel, axisPt, axisMult}); + } // Print output histograms statistics LOG(info) << "Size of the histograms in Lambda1520analysisinpp:"; @@ -1284,6 +1289,119 @@ struct Lambda1520analysisinpp { } } PROCESS_SWITCH(Lambda1520analysisinpp, processME, "Process EventMixing light without partition", false); + + void processdummy(MCEventCandidates::iterator const& collision, aod::McCollisions const&, aod::McParticles const& mcParticles) + { + bool isInAfterAllCuts = colCuts.isSelected(collision, false); + bool inVtx10 = (std::abs(collision.mcCollision().posZ()) > configEvents.cfgEvtZvtx) ? false : true; + bool isTriggerTVX = collision.selection_bit(aod::evsel::kIsTriggerTVX); + bool isSel8 = collision.sel8(); + + auto mcPartsAll = mcParticles.sliceBy(perMcCollision, collision.mcCollision().globalIndex()); + + bool isTrueINELgt0 = pwglf::isINELgt0mc(mcPartsAll, pdg); + // bool isTrueINELgt0 = collision.isInelGt0(); + + auto centrality = centEst(collision); + + auto computePtL = [&](float pt, float m_ref) { + float ptL2 = pt * pt + m_ref * m_ref - MassLambda1520 * MassLambda1520; + return (ptL2 > 0) ? std::sqrt(ptL2) : -1.f; + }; + + for (auto& part : mcPartsAll) { + + if (!part.isPhysicalPrimary()) + continue; + + float pt = part.pt(); + + if (cUseRapcutMC && std::abs(part.y()) > configTracks.cfgCutRapidity) // rapidity cut + continue; + + if (std::abs(part.pdgCode()) == kProton) { + + float ptL = computePtL(pt, massPr); + if (ptL < 0) + continue; + + histos.fill(HIST("Result/dummy/Genprotonpt"), 0, ptL, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/Genprotonpt"), 1, ptL, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/Genprotonpt"), 2, ptL, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/Genprotonpt"), 3, ptL, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/Genprotonpt"), 4, ptL, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/Genprotonpt"), 5, ptL, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/Genprotonpt"), 6, ptL, centrality); + } + + if (std::abs(part.pdgCode()) == kLambda0) { + + float ptL = computePtL(pt, MassLambda0); + if (ptL < 0) + continue; + + histos.fill(HIST("Result/dummy/Genlambdapt"), 0, ptL, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/Genlambdapt"), 1, ptL, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/Genlambdapt"), 2, ptL, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/Genlambdapt"), 3, ptL, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/Genlambdapt"), 4, ptL, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/Genlambdapt"), 5, ptL, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/Genlambdapt"), 6, ptL, centrality); + } + + if (std::abs(part.pdgCode()) == PDG_t::kXiMinus) { + + float ptL = computePtL(pt, MassXiMinus); + if (ptL < 0) + continue; + + histos.fill(HIST("Result/dummy/Genxipt"), 0, ptL, centrality); + + if (inVtx10) // vtx10 + histos.fill(HIST("Result/dummy/Genxipt"), 1, ptL, centrality); + + if (inVtx10 && isSel8) // vtx10, sel8 + histos.fill(HIST("Result/dummy/Genxipt"), 2, ptL, centrality); + + if (inVtx10 && isTriggerTVX) // vtx10, TriggerTVX + histos.fill(HIST("Result/dummy/Genxipt"), 3, ptL, centrality); + + if (inVtx10 && isTrueINELgt0) // vtx10, INEL>0 + histos.fill(HIST("Result/dummy/Genxipt"), 4, ptL, centrality); + + if (isInAfterAllCuts) // after all event selection + histos.fill(HIST("Result/dummy/Genxipt"), 5, ptL, centrality); + + if (isInAfterAllCuts && isTrueINELgt0) // after all event selection && INEL>0 + histos.fill(HIST("Result/dummy/Genxipt"), 6, ptL, centrality); + } + } + } + PROCESS_SWITCH(Lambda1520analysisinpp, processdummy, "Process dummy", false); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) diff --git a/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx b/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx index 098251faf28..0cf6ba274e5 100644 --- a/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx +++ b/PWGLF/Tasks/Strangeness/cascpostprocessing.cxx @@ -243,6 +243,8 @@ struct cascpostprocessing { bool isCorrectlyRec = 0; for (auto& candidate : mycascades) { + isCandidate = false; + isCorrectlyRec = false; switch (evSelFlag) { case 1: { diff --git a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx index 6b43f823c12..9f340ebbf6c 100644 --- a/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/derivedupcanalysis.cxx @@ -65,18 +65,17 @@ using NeutronsMC = soa::Join; using CascMCCoresFull = soa::Join; -using StraCollisonsFull = soa::Join; -using StraCollisonFull = soa::Join::iterator; +using StraCollisonsFull = soa::Join; +using StraCollisonFull = soa::Join::iterator; -using StraCollisonsFullMC = soa::Join; -using StraCollisonFullMC = soa::Join::iterator; +using StraCollisonsFullMC = soa::Join; +using StraCollisonFullMC = soa::Join::iterator; using StraMCCollisionsFull = soa::Join; using V0MCCoresFull = soa::Join; struct Derivedupcanalysis { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - // master analysis switches Configurable analyseK0Short{"analyseK0Short", true, "process K0Short-like candidates"}; Configurable analyseLambda{"analyseLambda", true, "process Lambda-like candidates"}; @@ -168,6 +167,13 @@ struct Derivedupcanalysis { Configurable ft0a{"ft0a", 100., "FT0A threshold"}; Configurable ft0c{"ft0c", 50., "FT0C threshold"}; Configurable zdc{"zdc", 1., "ZDC threshold"}; + Configurable fddaTimeCut{"fddaTimeCut", -1., "FDDA timing cut (ns); negative: no cut"}; + Configurable fddcTimeCut{"fddcTimeCut", -1., "FDDC timing cut (ns); negative: no cut"}; + Configurable fv0aTimeCut{"fv0aTimeCut", -1., "FV0A timing cut (ns); negative: no cut"}; + Configurable ft0aTimeCut{"ft0aTimeCut", -1., "FT0A timing cut (ns); negative: no cut"}; + Configurable ft0cTimeCut{"ft0cTimeCut", -1., "FT0C timing cut (ns); negative: no cut"}; + Configurable zdcTimeCut{"zdcTimeCut", 2., "ZDC timing cut (ns)"}; + Configurable requireZDCTiming{"requireZDCTiming", true, "require valid ZDC timing for gap-side selection"}; Configurable genGapSide{"genGapSide", 0, "0 -- A, 1 -- C, 2 -- double"}; } upcCuts; @@ -213,6 +219,8 @@ struct Derivedupcanalysis { ConfigurableAxis axisFDDCampl{"axisFDDCampl", {100, 0.0f, 2000.0f}, "FDDCamplitude"}; ConfigurableAxis axisZNAampl{"axisZNAampl", {100, 0.0f, 250.0f}, "ZNAamplitude"}; ConfigurableAxis axisZNCampl{"axisZNCampl", {100, 0.0f, 250.0f}, "ZNCamplitude"}; + ConfigurableAxis axisFitTime{"axisFitTime", {166, -42.5f, 40.5f}, "FIT time (ns)"}; + ConfigurableAxis axisZdcTime{"axisZdcTime", {110, -12.5f, 10.0f}, "ZDC time (ns)"}; } axisDetectors; // for MC @@ -268,7 +276,7 @@ struct Derivedupcanalysis { ConfigurableAxis axisOccupancy{"axisOccupancy", {VARIABLE_WIDTH, 0.0f, 250.0f, 500.0f, 750.0f, 1000.0f, 1500.0f, 2000.0f, 3000.0f, 4500.0f, 6000.0f, 8000.0f, 10000.0f, 50000.0f}, "Occupancy"}; // UPC axes - ConfigurableAxis axisSelGap{"axisSelGap", {4, -1.5, 2.5}, "Gap side"}; + ConfigurableAxis axisSelGap{"axisSelGap", {7, -1.5, 5.5}, "Gap side"}; // AP plot axes ConfigurableAxis axisAPAlpha{"axisAPAlpha", {220, -1.1f, 1.1f}, "V0 AP alpha"}; @@ -297,6 +305,8 @@ struct Derivedupcanalysis { ConfigurableAxis axisCtau{"axisCtau", {200, 0.0f, 20.0f}, "c x tau (cm)"}; static constexpr std::string_view kParticlenames[] = {"K0Short", "Lambda", "AntiLambda", "Xi", "AntiXi", "Omega", "AntiOmega"}; + static constexpr uint8_t kFT0TriggerBitIsActiveA = 5; + static constexpr uint8_t kFT0TriggerBitIsActiveC = 6; void setBits(std::bitset& mask, std::initializer_list selections) { @@ -931,6 +941,22 @@ struct Derivedupcanalysis { histos.add("eventQA/hFT0", "hFT0", kTH3D, {axisDetectors.axisFT0Aampl, axisDetectors.axisFT0Campl, axisSelGap}); histos.add("eventQA/hFDD", "hFDD", kTH3D, {axisDetectors.axisFDDAampl, axisDetectors.axisFDDCampl, axisSelGap}); histos.add("eventQA/hZN", "hZN", kTH3D, {axisDetectors.axisZNAampl, axisDetectors.axisZNCampl, axisSelGap}); + histos.add("eventQA/hTimeFT0A", "hTimeFT0A", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFT0C", "hTimeFT0C", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFV0A", "hTimeFV0A", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFDDA", "hTimeFDDA", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFDDC", "hTimeFDDC", kTH2D, {axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hTimeFT0APreSel", "hTimeFT0APreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFT0CPreSel", "hTimeFT0CPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFV0APreSel", "hTimeFV0APreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFDDAPreSel", "hTimeFDDAPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hTimeFDDCPreSel", "hTimeFDDCPreSel", kTH1D, {axisDetectors.axisFitTime}); + histos.add("eventQA/hFT0Time", "hFT0Time", kTH3D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hFDDTime", "hFDDTime", kTH3D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime, axisSelGap}); + histos.add("eventQA/hZNTime", "hZNTime", kTH3D, {axisDetectors.axisZdcTime, axisDetectors.axisZdcTime, axisSelGap}); + histos.add("eventQA/hFT0TimePreSel", "hFT0TimePreSel", kTH2D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime}); + histos.add("eventQA/hFDDTimePreSel", "hFDDTimePreSel", kTH2D, {axisDetectors.axisFitTime, axisDetectors.axisFitTime}); + histos.add("eventQA/hZNTimePreSel", "hZNTimePreSel", kTH2D, {axisDetectors.axisZdcTime, axisDetectors.axisZdcTime}); if (doprocessGenerated) { histos.add("eventQA/mc/hEventSelectionMC", "hEventSelectionMC", kTH3D, {{3, -0.5, 2.5}, axisNTracksPVeta1, axisGeneratorIds}); @@ -955,7 +981,7 @@ struct Derivedupcanalysis { histos.add("eventQA/mc/hNTracksPVeta1vsMCNParticlesEta10rec", "hNTracksPVeta1vsMCNParticlesEta10rec", kTH2D, {axisNTracksPVeta1, axisNTracksPVeta1}); histos.add("eventQA/mc/hNTracksGlobalvstotalMultMCParticles", "hNTracksGlobalvstotalMultMCParticles", kTH2D, {axisNTracksGlobal, axisNchInvMass}); histos.add("eventQA/mc/hNTracksPVeta1vstotalMultMCParticles", "hNTracksPVeta1vstotalMultMCParticles", kTH2D, {axisNTracksPVeta1, axisNchInvMass}); - histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {{5, -0.5, 4.5}}); + histos.add("eventQA/hSelGapSideNoNeutrons", "Selected gap side (no n); Entries", kTH1D, {axisSelGap}); } if (doprocessV0sMC) { @@ -1050,12 +1076,164 @@ struct Derivedupcanalysis { } template - int getGapSide(TCollision const& collision) + int applyZDCTiming(int selGapSide, TCollision const& collision) { - int selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); + if (!upcCuts.requireZDCTiming) { + return selGapSide; + } + if (selGapSide == o2::aod::sgselector::SingleGapA || + selGapSide == o2::aod::sgselector::SingleGapC || + selGapSide == o2::aod::sgselector::DoubleGap) { + + const float timeZNA = collision.timeZNA(); + const float timeZNC = collision.timeZNC(); + const float cut = upcCuts.zdcTimeCut; + + auto isInvalidTime = [](float time) { + return !std::isfinite(time) || (std::abs(time) == 999.f); + }; + + const bool gapA = isInvalidTime(timeZNA) || (std::abs(timeZNA) > cut); + const bool gapC = isInvalidTime(timeZNC) || (std::abs(timeZNC) > cut); + const bool neutronA = !isInvalidTime(timeZNA) && (std::abs(timeZNA) < cut); + const bool neutronC = !isInvalidTime(timeZNC) && (std::abs(timeZNC) < cut); + + if (selGapSide == o2::aod::sgselector::SingleGapA) { // 0nXn + if (!(gapA && neutronC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::SingleGapC) { // Xn0n + if (!(neutronA && gapC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::DoubleGap) { + if (!(gapA && gapC)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } + } + return selGapSide; } + bool isInvalidTime(float time) const + { + return !std::isfinite(time) || (std::abs(time) >= 998.f); + } + + bool isTimingCutEnabled(float cut) const + { + return cut >= 0.f; + } + + bool isTimingGap(float time, float cut) const + { + return isInvalidTime(time) || (std::abs(time) > cut); + } + + bool isTimingActivity(float time, float cut) const + { + return !isInvalidTime(time) && (std::abs(time) < cut); + } + + bool hasFT0Activity(uint8_t triggerMask, uint8_t bit) const + { + return (triggerMask & (static_cast(1u) << bit)) != 0; + } + + template + int applyFITTiming(int selGapSide, TCollision const& collision) + { + if (selGapSide != o2::aod::sgselector::SingleGapA && + selGapSide != o2::aod::sgselector::SingleGapC && + selGapSide != o2::aod::sgselector::DoubleGap) { + return selGapSide; + } + + const bool useFDDA = isTimingCutEnabled(upcCuts.fddaTimeCut); + const bool useFDDC = isTimingCutEnabled(upcCuts.fddcTimeCut); + const bool useFV0A = isTimingCutEnabled(upcCuts.fv0aTimeCut); + const bool useFT0A = isTimingCutEnabled(upcCuts.ft0aTimeCut); + const bool useFT0C = isTimingCutEnabled(upcCuts.ft0cTimeCut); + + if (!(useFDDA || useFDDC || useFV0A || useFT0A || useFT0C)) { + return selGapSide; + } + + const bool ft0ActiveA = hasFT0Activity(collision.triggerMaskFT0(), kFT0TriggerBitIsActiveA); + const bool ft0ActiveC = hasFT0Activity(collision.triggerMaskFT0(), kFT0TriggerBitIsActiveC); + + const bool gapFDDA = !useFDDA || isTimingGap(collision.timeFDDA(), upcCuts.fddaTimeCut); + const bool actFDDA = !useFDDA || isTimingActivity(collision.timeFDDA(), upcCuts.fddaTimeCut); + const bool gapFDDC = !useFDDC || isTimingGap(collision.timeFDDC(), upcCuts.fddcTimeCut); + const bool actFDDC = !useFDDC || isTimingActivity(collision.timeFDDC(), upcCuts.fddcTimeCut); + const bool gapFV0A = !useFV0A || isTimingGap(collision.timeFV0A(), upcCuts.fv0aTimeCut); + const bool actFV0A = !useFV0A || isTimingActivity(collision.timeFV0A(), upcCuts.fv0aTimeCut); + const bool gapFT0A = !useFT0A || !ft0ActiveA || isTimingGap(collision.timeFT0A(), upcCuts.ft0aTimeCut); + const bool actFT0A = !useFT0A || (ft0ActiveA && isTimingActivity(collision.timeFT0A(), upcCuts.ft0aTimeCut)); + const bool gapFT0C = !useFT0C || !ft0ActiveC || isTimingGap(collision.timeFT0C(), upcCuts.ft0cTimeCut); + const bool actFT0C = !useFT0C || (ft0ActiveC && isTimingActivity(collision.timeFT0C(), upcCuts.ft0cTimeCut)); + + if (selGapSide == o2::aod::sgselector::SingleGapA) { + if (!(gapFV0A && gapFDDA && gapFT0A && actFDDC && actFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::SingleGapC) { + if (!(actFV0A && actFDDA && actFT0A && gapFDDC && gapFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } else if (selGapSide == o2::aod::sgselector::DoubleGap) { + if (!(gapFV0A && gapFDDA && gapFT0A && gapFDDC && gapFT0C)) { + selGapSide = o2::aod::sgselector::NoGap; + } + } + + return selGapSide; + } + + template + int getGapSide(TCollision const& collision) + { + int selGapSide = o2::aod::sgselector::NoGap; + selGapSide = sgSelector.trueGap(collision, upcCuts.fv0a, upcCuts.ft0a, upcCuts.ft0c, upcCuts.zdc); + selGapSide = applyZDCTiming(selGapSide, collision); + return applyFITTiming(selGapSide, collision); + } + float sanitizeZdcTime(float time) const + { + if (!std::isfinite(time)) { + return -12.f; + } + if (std::abs(time) >= 998.f) { + return -11.f; + } + return time; + } + + float sanitizeFITTime(float time) const + { + if (!std::isfinite(time)) { + return -42.f; + } + if (std::abs(time) >= 998.f) { + return -41.f; + } + return time; + } + + template + void fillPreSelTimingHistograms(TCollision const& collision) + { + histos.fill(HIST("eventQA/hFT0TimePreSel"), sanitizeFITTime(collision.timeFT0A()), sanitizeFITTime(collision.timeFT0C())); + histos.fill(HIST("eventQA/hFDDTimePreSel"), sanitizeFITTime(collision.timeFDDA()), sanitizeFITTime(collision.timeFDDC())); + histos.fill(HIST("eventQA/hZNTimePreSel"), sanitizeZdcTime(collision.timeZNA()), sanitizeZdcTime(collision.timeZNC())); + histos.fill(HIST("eventQA/hTimeFT0APreSel"), sanitizeFITTime(collision.timeFT0A())); + histos.fill(HIST("eventQA/hTimeFT0CPreSel"), sanitizeFITTime(collision.timeFT0C())); + histos.fill(HIST("eventQA/hTimeFV0APreSel"), sanitizeFITTime(collision.timeFV0A())); + histos.fill(HIST("eventQA/hTimeFDDAPreSel"), sanitizeFITTime(collision.timeFDDA())); + histos.fill(HIST("eventQA/hTimeFDDCPreSel"), sanitizeFITTime(collision.timeFDDC())); + } + template void fillHistogramsQA(TCollision const& collision, int const& gap) { @@ -1091,14 +1269,26 @@ struct Derivedupcanalysis { auto znc = collision.energyCommonZNC(); constexpr float inf_f = std::numeric_limits::infinity(); - if (zna == -inf_f) + if (zna == -inf_f) { histos.fill(HIST("eventQA/hZN"), -1, znc, gap); - else if (znc == -inf_f) + } else if (znc == -inf_f) { histos.fill(HIST("eventQA/hZN"), zna, -1, gap); - else if (zna == -999 && znc == -999) + } else if (zna == -999 && znc == -999) { histos.fill(HIST("eventQA/hZN"), -2, -2, gap); - else if (zna == -999 || znc == -999) + } else if (zna == -999 || znc == -999) { LOG(warning) << "Only one ZDC signal is -999"; + } else { + histos.fill(HIST("eventQA/hZN"), zna, znc, gap); + } + + histos.fill(HIST("eventQA/hFT0Time"), sanitizeFITTime(collision.timeFT0A()), sanitizeFITTime(collision.timeFT0C()), gap); + histos.fill(HIST("eventQA/hFDDTime"), sanitizeFITTime(collision.timeFDDA()), sanitizeFITTime(collision.timeFDDC()), gap); + histos.fill(HIST("eventQA/hZNTime"), sanitizeZdcTime(collision.timeZNA()), sanitizeZdcTime(collision.timeZNC()), gap); + histos.fill(HIST("eventQA/hTimeFT0A"), sanitizeFITTime(collision.timeFT0A()), gap); + histos.fill(HIST("eventQA/hTimeFT0C"), sanitizeFITTime(collision.timeFT0C()), gap); + histos.fill(HIST("eventQA/hTimeFV0A"), sanitizeFITTime(collision.timeFV0A()), gap); + histos.fill(HIST("eventQA/hTimeFDDA"), sanitizeFITTime(collision.timeFDDA()), gap); + histos.fill(HIST("eventQA/hTimeFDDC"), sanitizeFITTime(collision.timeFDDC()), gap); } template @@ -1868,13 +2058,13 @@ struct Derivedupcanalysis { } } - if (evSels.studyUPConly && (selGapSide != static_cast(upcCuts.genGapSide))) - continue; - - ++nCollisions; - atLeastOne = true; + const bool passStd = !evSels.studyUPConly || (selGapSide == static_cast(upcCuts.genGapSide)); + if (passStd) { + ++nCollisions; + atLeastOne = true; + } - if (biggestNContribs < collision.multPVTotalContributors()) { + if (passStd && biggestNContribs < collision.multPVTotalContributors()) { biggestNContribs = collision.multPVTotalContributors(); if (static_cast(upcCuts.genGapSide) == 0) { ft0ampl = collision.totalFT0AmplitudeC(); @@ -1946,6 +2136,9 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; @@ -2002,6 +2195,9 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; @@ -2087,6 +2283,9 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; @@ -2139,6 +2338,9 @@ struct Derivedupcanalysis { continue; } // event is accepted + if (collision.isUPC()) { + fillPreSelTimingHistograms(collision); + } histos.fill(HIST("eventQA/hRawGapSide"), collision.gapSide()); int selGapSide = collision.isUPC() ? getGapSide(collision) : -1; 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/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx index e5f7a59e3d4..bb7e91da1f0 100644 --- a/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx +++ b/PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx @@ -195,25 +195,22 @@ struct lambdaspincorrderived { TH3D* hweight22; TH3D* hweight32; TH3D* hweight42; - TH2D* hweightCentPair = nullptr; - Configurable ConfWeightPathCentPair{"ConfWeightPathCentPair", "", "Centrality x pair-type weight path"}; + // ---------- NUA single-particle weights in (phi, eta) ---------- + TH2D* hNUALambda = nullptr; + TH2D* hNUAAntiLambda = nullptr; + Configurable ConfWeightPathLL{"ConfWeightPathLL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; Configurable ConfWeightPathALAL{"ConfWeightPathALAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; Configurable ConfWeightPathLAL{"ConfWeightPathLAL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; Configurable ConfWeightPathALL{"ConfWeightPathALL", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path"}; - Configurable ConfWeightPathLL2{"ConfWeightPathLL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; Configurable ConfWeightPathALAL2{"ConfWeightPathALAL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; Configurable ConfWeightPathLAL2{"ConfWeightPathLAL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; Configurable ConfWeightPathALL2{"ConfWeightPathALL2", "Users/s/skundu/My/Object/spincorr/cent010LL", "Weight path 2"}; - - // Mixing ///////// - struct : ConfigurableGroup { - Configurable nKinematicPt{"nKinematicPt", 1.0, "Number of pT buffer bins"}; - Configurable nKinematicEta{"nKinematicEta", 1.0, "Number of eta buffer bins"}; - Configurable nKinematicPhi{"nKinematicPhi", 1.0, "Number of phi buffer bins"}; - } cfgKinematicBins; + Configurable useNUA{"useNUA", false, "Apply single-candidate NUA weight in (phi,eta)"}; + Configurable ConfNUAPathLambda{"ConfNUAPathLambda", "", "CCDB path for Lambda NUA TH2D(phi,eta)"}; + Configurable ConfNUAPathAntiLambda{"ConfNUAPathAntiLambda", "", "CCDB path for AntiLambda NUA TH2D(phi,eta)"}; Configurable> massMixEdges{"massMixEdges", {1.09f, 1.108f, 1.122f, 1.14f}, "Mass-mixing region edges: [SB low | signal | SB high]"}; Configurable cfgMixLegMode{"cfgMixLegMode", 0, "0=replace leg-1 only, 1=replace leg-2 only, 2=do both one-leg replacements"}; Configurable cfgV5MassBins{"cfgV5MassBins", 5, "Number of fixed mass bins for V5 mixing"}; @@ -240,8 +237,6 @@ struct lambdaspincorrderived { Configurable harmonic{"harmonic", 1, "Harmonic phi"}; Configurable harmonicDphi{"harmonicDphi", 2, "Harmonic delta phi"}; Configurable useweight{"useweight", 0, "Use weight"}; - Configurable usebothweight{"usebothweight", 1, "Use both weight"}; - // Configurable useNUA{"useNUA", 0, "Use NUA weight"}; Configurable usePDGM{"usePDGM", 1, "Use PDG mass"}; Configurable useAdditionalHisto{"useAdditionalHisto", 0, "Use additional histogram"}; Configurable checkDoubleStatus{"checkDoubleStatus", 0, "Check Double status"}; @@ -286,14 +281,21 @@ struct lambdaspincorrderived { histos.add("hPtRadiusV0", "V0 QA;#it{p}_{T}^{V0} (GeV/#it{c});V0 decay radius (cm)", kTH2F, {{100, 0.0, 10.0}, {120, 0.0, 45.0}}); histos.add("hPtYSame", "hPtYSame", kTH2F, {{100, 0.0, 10.0}, {200, -1.0, 1.0}}); histos.add("hPtYMix", "hPtYMix", kTH2F, {{100, 0.0, 10.0}, {200, -1.0, 1.0}}); + histos.add("hPhiEtaSame", "hPhiEtaSame", kTH2F, {{720, 0.0, 2.0 * TMath::Pi()}, {200, -1.0, 1.0}}); + histos.add("hPhiEtaMix", "hPhiEtaMix", kTH2F, {{720, 0.0, 2.0 * TMath::Pi()}, {200, -1.0, 1.0}}); histos.add("hCentrality", "Centrality distribution", kTH1F, {{configThnAxisCentrality}}); histos.add("deltaPhiSame", "deltaPhiSame", HistType::kTH1D, {{72, -TMath::Pi(), TMath::Pi()}}, true); histos.add("deltaPhiMix", "deltaPhiMix", HistType::kTH1D, {{72, -TMath::Pi(), TMath::Pi()}}, true); histos.add("ptCent", "ptCent", HistType::kTH2D, {{100, 0.0, 10.0}, {8, 0.0, 80.0}}, true); histos.add("etaCent", "etaCent", HistType::kTH2D, {{32, -0.8, 0.8}, {8, 0.0, 80.0}}, true); - histos.add("hCentPairTypeSE", "SE pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}}); - histos.add("hCentPairTypeME", "ME pair-weighted centrality;Centrality;PairType", kTH2D, {{110, 0.0, 110.0}, {4, -0.5, 3.5}}); + histos.add("hEtaPhiLambdaRaw", "Lambda raw;#phi;#eta", kTH2D, + {{360, 0.0, 2.0 * TMath::Pi()}, {32, -0.8, 0.8}}); + histos.add("hEtaPhiAntiLambdaRaw", "AntiLambda raw;#phi;#eta", kTH2D, + {{360, 0.0, 2.0 * TMath::Pi()}, {32, -0.8, 0.8}}); + + histos.add("hNUAWeightLambda", "Lambda NUA weight", kTH1D, {{200, 0.0, 5.0}}); + histos.add("hNUAWeightAntiLambda", "AntiLambda NUA weight", kTH1D, {{200, 0.0, 5.0}}); // --- target/replacement single-leg occupancy maps for replacement correction histos.add("TGT_LL_leg1", "Target LL leg1", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); @@ -316,27 +318,6 @@ struct lambdaspincorrderived { histos.add("REP_ALL_leg2", "Repl ALL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); histos.add("REP_ALAL_leg2", "Repl ALAL leg2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - // --- 3D SE/ME pair-space maps per category (LL, LAL, ALL, ALAL) - histos.add("SE_LL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_LAL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_ALL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_ALAL", "SE pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - - histos.add("ME_LL", "ME pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_LAL", "ME pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_ALL", "ME pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_ALAL", "ME pairs", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - - histos.add("SE_LL2", "SE pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_LAL2", "SE pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_ALL2", "SE pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("SE_ALAL2", "SE pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - - histos.add("ME_LL2", "ME pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_LAL2", "ME pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_ALL2", "ME pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("ME_ALAL2", "ME pairs 2", HistType::kTH3D, {ax_dphi_h, ax_deta, ax_ptpair}, true); - histos.add("hSparseLambdaLambda", "hSparseLambdaLambda", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisR}, true); histos.add("hSparseLambdaAntiLambda", "hSparseLambdaAntiLambda", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisR}, true); histos.add("hSparseAntiLambdaLambda", "hSparseAntiLambdLambda", HistType::kTHnSparseF, {configThnAxisInvMass, configThnAxisInvMass, configThnAxisPol, configThnAxisR}, true); @@ -406,8 +387,16 @@ struct lambdaspincorrderived { hweight32 = ccdb->getForTimeStamp(ConfWeightPathALL2.value, cfgCcdbParam.nolaterthan.value); hweight42 = ccdb->getForTimeStamp(ConfWeightPathALAL2.value, cfgCcdbParam.nolaterthan.value); } - if (!ConfWeightPathCentPair.value.empty()) { - hweightCentPair = ccdb->getForTimeStamp(ConfWeightPathCentPair.value, cfgCcdbParam.nolaterthan.value); + if (useNUA) { + hNUALambda = ccdb->getForTimeStamp(ConfNUAPathLambda.value, cfgCcdbParam.nolaterthan.value); + hNUAAntiLambda = ccdb->getForTimeStamp(ConfNUAPathAntiLambda.value, cfgCcdbParam.nolaterthan.value); + + if (!hNUALambda) { + LOGF(fatal, "NUA enabled but Lambda NUA histogram not found at path: %s", ConfNUAPathLambda.value.data()); + } + if (!hNUAAntiLambda) { + LOGF(fatal, "NUA enabled but AntiLambda NUA histogram not found at path: %s", ConfNUAPathAntiLambda.value.data()); + } } } @@ -485,6 +474,26 @@ struct lambdaspincorrderived { return true; } + double getNUAWeight(int v0Status, double phi, double eta) + { + if (!useNUA) { + return 1.0; + } + + TH2D* h = (v0Status == 0) ? hNUALambda : hNUAAntiLambda; + if (!h) { + return 1.0; + } + + const double phiWrap = RecoDecay::constrainAngle(phi, 0.0F, harmonic); // [0,2pi) + const int bin = h->FindBin(phiWrap, eta); // assumes axes are (phi, eta) + const double w = h->GetBinContent(bin); + + if (!std::isfinite(w) || w <= 0.0) { + return 1.0; + } + return w; + } void fillHistograms(int tag1, int tag2, const ROOT::Math::PtEtaPhiMVector& particle1, const ROOT::Math::PtEtaPhiMVector& particle2, @@ -559,6 +568,10 @@ struct lambdaspincorrderived { double dphi2 = RecoDecay::constrainAngle(particle2.Phi(), 0.0F, harmonic); double deta2 = particle2.Eta(); + double nuaWeight1 = getNUAWeight(tag1, particle1.Phi(), particle1.Eta()); + double nuaWeight2 = getNUAWeight(tag2, particle2.Phi(), particle2.Eta()); + const double pairNUAWeight = nuaWeight1 * nuaWeight2; + double dphi_pair = RecoDecay::constrainAngle(dphi1 - dphi2, -TMath::Pi(), harmonicDphi); double deltaRap = std::abs(particle1.Rapidity() - particle2.Rapidity()); double deltaR = TMath::Sqrt(deltaRap * deltaRap + dphi_pair * dphi_pair); @@ -583,18 +596,10 @@ struct lambdaspincorrderived { } if (datatype == 0) { - const double weight = 1.0; - + const double weight = pairNUAWeight; if (tag1 == 0 && tag2 == 0) { - if (!userapidity) { - histos.fill(HIST("hPtYSame"), particle1.Pt(), particle1.Rapidity(), weight); - histos.fill(HIST("SE_LL"), dphi1, deta1, pt1, weight); - histos.fill(HIST("SE_LL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("hPtYSame"), particle1.Pt(), particle1.Rapidity(), weight); - histos.fill(HIST("SE_LL"), dphi1, particle1.Rapidity(), pt1, weight); - histos.fill(HIST("SE_LL2"), dphi2, particle2.Rapidity(), pt2, weight); - } + histos.fill(HIST("hPtYSame"), particle1.Pt(), particle1.Rapidity(), nuaWeight1); + histos.fill(HIST("hPhiEtaSame"), dphi1, particle1.Eta(), nuaWeight1); histos.fill(HIST("hSparseLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaLambdaAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -603,13 +608,6 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePairMassLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } } else if (tag1 == 0 && tag2 == 1) { - if (!userapidity) { - histos.fill(HIST("SE_LAL"), dphi1, deta1, pt1, weight); - histos.fill(HIST("SE_LAL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("SE_LAL"), dphi1, particle1.Rapidity(), pt1, weight); - histos.fill(HIST("SE_LAL2"), dphi2, particle2.Rapidity(), pt2, weight); - } histos.fill(HIST("hSparseLambdaAntiLambda"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaAntiLambdaAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -618,13 +616,6 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePairMassLambdaAntiLambda"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } } else if (tag1 == 1 && tag2 == 0) { - if (!userapidity) { - histos.fill(HIST("SE_ALL"), dphi1, deta1, pt1, weight); - histos.fill(HIST("SE_ALL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("SE_ALL"), dphi1, particle1.Rapidity(), pt1, weight); - histos.fill(HIST("SE_ALL2"), dphi2, particle2.Rapidity(), pt2, weight); - } histos.fill(HIST("hSparseAntiLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseAntiLambdaLambdaAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -633,13 +624,6 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePairMassAntiLambdaLambda"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } } else if (tag1 == 1 && tag2 == 1) { - if (!userapidity) { - histos.fill(HIST("SE_ALAL"), dphi1, deta1, pt1, weight); - histos.fill(HIST("SE_ALAL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("SE_ALAL"), dphi1, particle1.Rapidity(), pt1, weight); - histos.fill(HIST("SE_ALAL2"), dphi2, particle2.Rapidity(), pt2, weight); - } histos.fill(HIST("hSparseAntiLambdaAntiLambda"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseAntiLambdaAntiLambdaAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -659,26 +643,15 @@ struct lambdaspincorrderived { } weight = mixpairweight / epsWeightReplaced; } - + weight *= pairNUAWeight; if (!std::isfinite(weight) || weight <= 0.0) { return; } if (tag1 == 0 && tag2 == 0) { if (replacedLeg == 1) { - if (!userapidity) { - histos.fill(HIST("hPtYMix"), particle1.Pt(), particle1.Rapidity(), weight); - histos.fill(HIST("ME_LL"), dphi1, deta1, pt1, weight); - } else { - histos.fill(HIST("hPtYMix"), particle1.Pt(), particle1.Rapidity(), weight); - histos.fill(HIST("ME_LL"), dphi1, particle1.Rapidity(), pt1, weight); - } - } else { - if (!userapidity) { - histos.fill(HIST("ME_LL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("ME_LL2"), dphi2, particle2.Rapidity(), pt2, weight); - } + histos.fill(HIST("hPtYMix"), particle1.Pt(), particle1.Rapidity(), nuaWeight1 * mixpairweight); + histos.fill(HIST("hPhiEtaMix"), dphi1, particle1.Eta(), nuaWeight1 * mixpairweight); } histos.fill(HIST("hSparseLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); @@ -689,19 +662,6 @@ struct lambdaspincorrderived { } } else if (tag1 == 0 && tag2 == 1) { - if (replacedLeg == 1) { - if (!userapidity) { - histos.fill(HIST("ME_LAL"), dphi1, deta1, pt1, weight); - } else { - histos.fill(HIST("ME_LAL"), dphi1, particle1.Rapidity(), pt1, weight); - } - } else { - if (!userapidity) { - histos.fill(HIST("ME_LAL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("ME_LAL2"), dphi2, particle2.Rapidity(), pt2, weight); - } - } histos.fill(HIST("hSparseLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseLambdaAntiLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -709,21 +669,7 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePhiLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, dphi_pair, weight); histos.fill(HIST("hSparsePairMassLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } - } else if (tag1 == 1 && tag2 == 0) { - if (replacedLeg == 1) { - if (!userapidity) { - histos.fill(HIST("ME_ALL"), dphi1, deta1, pt1, weight); - } else { - histos.fill(HIST("ME_ALL"), dphi1, particle1.Rapidity(), pt1, weight); - } - } else { - if (!userapidity) { - histos.fill(HIST("ME_ALL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("ME_ALL2"), dphi2, particle2.Rapidity(), pt2, weight); - } - } histos.fill(HIST("hSparseAntiLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseAntiLambdaLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -731,21 +677,7 @@ struct lambdaspincorrderived { histos.fill(HIST("hSparsePhiAntiLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, dphi_pair, weight); histos.fill(HIST("hSparsePairMassAntiLambdaLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, pairDummy.M(), weight); } - } else if (tag1 == 1 && tag2 == 1) { - if (replacedLeg == 1) { - if (!userapidity) { - histos.fill(HIST("ME_ALAL"), dphi1, deta1, pt1, weight); - } else { - histos.fill(HIST("ME_ALAL"), dphi1, particle1.Rapidity(), pt1, weight); - } - } else { - if (!userapidity) { - histos.fill(HIST("ME_ALAL2"), dphi2, deta2, pt2, weight); - } else { - histos.fill(HIST("ME_ALAL2"), dphi2, particle2.Rapidity(), pt2, weight); - } - } histos.fill(HIST("hSparseAntiLambdaAntiLambdaMixed"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, weight); histos.fill(HIST("hSparseAntiLambdaAntiLambdaMixedAnalysis"), particle1.M(), particle2.M(), cosThetaDiff, deltaR, deltaRap, std::abs(dphi_pair), weight); if (useAdditionalHisto) { @@ -808,7 +740,14 @@ struct lambdaspincorrderived { histos.fill(HIST("etaCent"), v0.lambdaEta(), centrality); proton = ROOT::Math::PtEtaPhiMVector(v0.protonPt(), v0.protonEta(), v0.protonPhi(), o2::constants::physics::MassProton); lambda = ROOT::Math::PtEtaPhiMVector(v0.lambdaPt(), v0.lambdaEta(), v0.lambdaPhi(), v0.lambdaMass()); + const double phi = RecoDecay::constrainAngle(v0.lambdaPhi(), 0.0F, harmonic); + const double eta = v0.lambdaEta(); + if (v0.v0Status() == 0) { + histos.fill(HIST("hEtaPhiLambdaRaw"), phi, eta, getNUAWeight(0, v0.lambdaPhi(), v0.lambdaEta())); + } else { + histos.fill(HIST("hEtaPhiAntiLambdaRaw"), phi, eta, getNUAWeight(1, v0.lambdaPhi(), v0.lambdaEta())); + } for (const auto& v02 : V0s) { if (v02.index() <= v0.index()) { continue; @@ -821,8 +760,7 @@ struct lambdaspincorrderived { proton2 = ROOT::Math::PtEtaPhiMVector(v02.protonPt(), v02.protonEta(), v02.protonPhi(), o2::constants::physics::MassProton); lambda2 = ROOT::Math::PtEtaPhiMVector(v02.lambdaPt(), v02.lambdaEta(), v02.lambdaPhi(), v02.lambdaMass()); histos.fill(HIST("deltaPhiSame"), RecoDecay::constrainAngle(v0.lambdaPhi() - v02.lambdaPhi(), -TMath::Pi(), harmonicDphi)); - const int ptype = pairTypeCode(v0.v0Status(), v02.v0Status()); - histos.fill(HIST("hCentPairTypeSE"), collision.cent(), ptype, 1.0); + // const int ptype = pairTypeCode(v0.v0Status(), v02.v0Status()); if (v0.v0Status() == 0 && v02.v0Status() == 0) { fillHistograms(0, 0, lambda, lambda2, proton, proton2, 0, 1.0); } @@ -1339,6 +1277,11 @@ struct lambdaspincorrderived { o2::constants::physics::MassProton); lambda = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(v0), mcacc::lamEta(v0), mcacc::lamPhi(v0), mcacc::lamMass(v0)); + if (mcacc::v0Status(v0) == 0) { + histos.fill(HIST("hEtaPhiLambdaRaw"), lambda.Phi(), lambda.Eta(), getNUAWeight(0, lambda.Phi(), lambda.Eta())); + } else { + histos.fill(HIST("hEtaPhiAntiLambdaRaw"), lambda.Phi(), lambda.Eta(), getNUAWeight(1, lambda.Phi(), lambda.Eta())); + } for (const auto& v02 : V0sMC) { if (v02.index() <= v0.index()) { @@ -1358,8 +1301,7 @@ struct lambdaspincorrderived { RecoDecay::constrainAngle(mcacc::lamPhi(v0) - mcacc::lamPhi(v02), -TMath::Pi(), harmonicDphi)); - const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02)); - histos.fill(HIST("hCentPairTypeSE"), mcacc::cent(collision), ptype, 1.0); + // const int ptype = pairTypeCode(mcacc::v0Status(v0), mcacc::v0Status(v02)); // datatype=0 (same event) fillHistograms(mcacc::v0Status(v0), mcacc::v0Status(v02), lambda, lambda2, proton, proton2, @@ -1369,175 +1311,6 @@ struct lambdaspincorrderived { } PROCESS_SWITCH(lambdaspincorrderived, processMC, "Process MC (SE)", false); - void processMCMEV3(EventCandidatesMC const& collisions, AllTrackCandidatesMC const& V0sMC) - { - auto nBins = colBinning.getAllBinsCount(); - std::vector>> eventPools(nBins); - - for (auto& collision1 : collisions) { - const int bin = colBinning.getBin(std::make_tuple(mcacc::posz(collision1), mcacc::cent(collision1))); - if (bin < 0) { - continue; - } - - auto poolA = V0sMC.sliceBy(tracksPerCollisionV0mc, collision1.index()); - - if (eventPools[bin].empty()) { - eventPools[bin].emplace_back(collision1.index(), std::move(poolA)); - if ((int)eventPools[bin].size() > nEvtMixing) { - eventPools[bin].pop_front(); - } - continue; - } - - for (auto& [t1, t2] : soa::combinations(o2::soa::CombinationsFullIndexPolicy(poolA, poolA))) { - if (!selectionV0MC(t1) || !selectionV0MC(t2)) { - continue; - } - if (t2.index() <= t1.index()) { - continue; - } - if (hasSharedDaughtersMC(t1, t2)) - continue; - const bool doMixLeg1 = (cfgMixLegMode.value == 0 || cfgMixLegMode.value == 2); - const bool doMixLeg2 = (cfgMixLegMode.value == 1 || cfgMixLegMode.value == 2); - - if (doMixLeg1) { - fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(t2), 1, true, - ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), mcacc::lamMass(t1)), - 1.0f); - } - if (doMixLeg2) { - fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(t2), 2, true, - ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), mcacc::lamMass(t2)), - 1.0f); - } - - struct PV { - AllTrackCandidatesMC* pool; - int nRepl1 = 0; - int nRepl2 = 0; - }; - - std::vector usable; - int totalRepl = 0; - - int mixes = 0; - for (auto it = eventPools[bin].rbegin(); it != eventPools[bin].rend() && mixes < nEvtMixing; ++it, ++mixes) { - const int collision2idx = it->first; - auto& poolB = it->second; - - if (collision2idx == collision1.index()) { - continue; - } - - int nRepl1 = 0; - int nRepl2 = 0; - - for (auto& tX : poolB) { - if (!selectionV0MC(tX)) { - continue; - } - - if (doMixLeg1) { - if (checkKinematicsMC(t1, tX)) { - ++nRepl1; - } - } - - if (doMixLeg2) { - if (checkKinematicsMC(t2, tX)) { - ++nRepl2; - } - } - } - - if (nRepl1 > 0 || nRepl2 > 0) { - usable.push_back(PV{&poolB, nRepl1, nRepl2}); - totalRepl += nRepl1 + nRepl2; - } - } - - if (totalRepl <= 0) { - continue; - } - - const float wBase = 1.0f / static_cast(totalRepl); - - for (auto& pv : usable) { - auto& poolB = *pv.pool; - - for (auto& tX : poolB) { - if (!selectionV0MC(tX)) { - continue; - } - - // -------- leg-1 replacement: (tX, t2) - if (doMixLeg1) { - if (checkKinematicsMC(t1, tX)) { - fillReplacementControlMap(mcacc::v0Status(tX), mcacc::v0Status(t2), 1, false, - ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), - wBase); - auto pX = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(tX), mcacc::prEta(tX), mcacc::prPhi(tX), - o2::constants::physics::MassProton); - auto lX = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), - mcacc::lamMass(tX)); - auto p2 = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(t2), mcacc::prEta(t2), mcacc::prPhi(t2), - o2::constants::physics::MassProton); - auto l2 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), - mcacc::lamMass(t2)); - - const float dPhi = RecoDecay::constrainAngle( - RecoDecay::constrainAngle(lX.Phi(), 0.0F, harmonic) - - RecoDecay::constrainAngle(l2.Phi(), 0.0F, harmonic), - -TMath::Pi(), harmonicDphi); - - histos.fill(HIST("deltaPhiMix"), dPhi, wBase); - fillHistograms(mcacc::v0Status(tX), mcacc::v0Status(t2), - lX, l2, pX, p2, - 1, wBase, 1); - } - } - - // -------- leg-2 replacement: (t1, tX) - if (doMixLeg2) { - if (checkKinematicsMC(t2, tX)) { - fillReplacementControlMap(mcacc::v0Status(t1), mcacc::v0Status(tX), 2, false, - ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), mcacc::lamMass(tX)), - wBase); - auto p1 = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(t1), mcacc::prEta(t1), mcacc::prPhi(t1), - o2::constants::physics::MassProton); - auto l1 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t1), mcacc::lamEta(t1), mcacc::lamPhi(t1), - mcacc::lamMass(t1)); - auto pX = ROOT::Math::PtEtaPhiMVector(mcacc::prPt(tX), mcacc::prEta(tX), mcacc::prPhi(tX), - o2::constants::physics::MassProton); - auto lX = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tX), mcacc::lamEta(tX), mcacc::lamPhi(tX), - mcacc::lamMass(tX)); - - const float dPhi = RecoDecay::constrainAngle( - RecoDecay::constrainAngle(l1.Phi(), 0.0F, harmonic) - - RecoDecay::constrainAngle(lX.Phi(), 0.0F, harmonic), - -TMath::Pi(), harmonicDphi); - - histos.fill(HIST("deltaPhiMix"), dPhi, wBase); - fillHistograms(mcacc::v0Status(t1), mcacc::v0Status(tX), - l1, lX, p1, pX, - 1, wBase, 2); - } - } - } - } - } - - auto sliced = V0sMC.sliceBy(tracksPerCollisionV0mc, collision1.index()); - eventPools[bin].emplace_back(collision1.index(), std::move(sliced)); - if ((int)eventPools[bin].size() > nEvtMixing) { - eventPools[bin].pop_front(); - } - } - } - PROCESS_SWITCH(lambdaspincorrderived, processMCMEV3, "Process MC ME v3 FIFO", false); - static inline float phi0To2Pi(float phi) { // harmonic=1, min=0 => [0, 2pi) @@ -1555,19 +1328,16 @@ struct lambdaspincorrderived { { return std::abs(deltaPhiMinusPiToPi(phiA, phiB)); } - - // symmetric neighbors for phi: periodic wrap + // symmetric neighbors for phi: no wrap at edge static inline void collectNeighborBinsPhi(int b, int nPhi, int nNeighbor, std::vector& out) { out.clear(); out.reserve(2 * nNeighbor + 1); for (int d = -nNeighbor; d <= nNeighbor; ++d) { - int bb = b + d; - bb %= nPhi; - if (bb < 0) { - bb += nPhi; + const int bb = b + d; + if (bb >= 0 && bb < nPhi) { + out.push_back(bb); } - out.push_back(bb); } std::sort(out.begin(), out.end()); out.erase(std::unique(out.begin(), out.end()), out.end()); @@ -1978,21 +1748,11 @@ struct lambdaspincorrderived { auto proton2 = ROOT::Math::PtEtaPhiMVector(t2.protonPt(), t2.protonEta(), t2.protonPhi(), o2::constants::physics::MassProton); auto lambda2 = ROOT::Math::PtEtaPhiMVector(t2.lambdaPt(), t2.lambdaEta(), t2.lambdaPhi(), t2.lambdaMass()); - const int ptype = pairTypeCode(tX.v0Status(), t2.v0Status()); - double centPairWeight = 1.0; - if (hweightCentPair) { - const int bin = hweightCentPair->FindBin(col1.cent(), ptype); - centPairWeight = hweightCentPair->GetBinContent(bin); - if (centPairWeight <= 0.0) { - centPairWeight = 1.0; - } - } + // const int ptype = pairTypeCode(tX.v0Status(), t2.v0Status()); - const float meWeight = wSE * centPairWeight; + const float meWeight = wSE; const float dPhi = deltaPhiMinusPiToPi((float)lambda.Phi(), (float)lambda2.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wSE); - histos.fill(HIST("hCentPairTypeME"), col1.cent(), ptype, wSE); - fillHistograms(tX.v0Status(), t2.v0Status(), lambda, lambda2, proton, proton2, 1, meWeight, 1); } } @@ -2021,21 +1781,10 @@ struct lambdaspincorrderived { auto proton2 = ROOT::Math::PtEtaPhiMVector(tY.protonPt(), tY.protonEta(), tY.protonPhi(), o2::constants::physics::MassProton); auto lambda2 = ROOT::Math::PtEtaPhiMVector(tY.lambdaPt(), tY.lambdaEta(), tY.lambdaPhi(), tY.lambdaMass()); - const int ptype = pairTypeCode(t1.v0Status(), tY.v0Status()); - double centPairWeight = 1.0; - if (hweightCentPair) { - const int bin = hweightCentPair->FindBin(col1.cent(), ptype); - centPairWeight = hweightCentPair->GetBinContent(bin); - if (centPairWeight <= 0.0) { - centPairWeight = 1.0; - } - } - - const float meWeight = wSE * centPairWeight; + // const int ptype = pairTypeCode(t1.v0Status(), tY.v0Status()); + const float meWeight = wSE; const float dPhi = deltaPhiMinusPiToPi((float)lambda.Phi(), (float)lambda2.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wSE); - histos.fill(HIST("hCentPairTypeME"), col1.cent(), ptype, wSE); - fillHistograms(t1.v0Status(), tY.v0Status(), lambda, lambda2, proton, proton2, 1, meWeight, 2); } } @@ -2371,21 +2120,10 @@ struct lambdaspincorrderived { auto l2 = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(t2), mcacc::lamEta(t2), mcacc::lamPhi(t2), mcacc::lamMass(t2)); - const int ptype = pairTypeCode(mcacc::v0Status(tX), mcacc::v0Status(t2)); - double centPairWeight = 1.0; - if (hweightCentPair) { - const int bin = hweightCentPair->FindBin(mcacc::cent(col1), ptype); - centPairWeight = hweightCentPair->GetBinContent(bin); - if (centPairWeight <= 0.0) { - centPairWeight = 1.0; - } - } - - const float meWeight = wSE * centPairWeight; + // const int ptype = pairTypeCode(mcacc::v0Status(tX), mcacc::v0Status(t2)); + const float meWeight = wSE; const float dPhi = deltaPhiMinusPiToPi((float)lX.Phi(), (float)l2.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wSE); - histos.fill(HIST("hCentPairTypeME"), mcacc::cent(col1), ptype, wSE); - fillHistograms(mcacc::v0Status(tX), mcacc::v0Status(t2), lX, l2, pX, p2, 1, meWeight, 1); @@ -2420,21 +2158,10 @@ struct lambdaspincorrderived { auto lY = ROOT::Math::PtEtaPhiMVector(mcacc::lamPt(tY), mcacc::lamEta(tY), mcacc::lamPhi(tY), mcacc::lamMass(tY)); - const int ptype = pairTypeCode(mcacc::v0Status(t1), mcacc::v0Status(tY)); - double centPairWeight = 1.0; - if (hweightCentPair) { - const int bin = hweightCentPair->FindBin(mcacc::cent(col1), ptype); - centPairWeight = hweightCentPair->GetBinContent(bin); - if (centPairWeight <= 0.0) { - centPairWeight = 1.0; - } - } - - const float meWeight = wSE * centPairWeight; + // const int ptype = pairTypeCode(mcacc::v0Status(t1), mcacc::v0Status(tY)); + const float meWeight = wSE; const float dPhi = deltaPhiMinusPiToPi((float)l1.Phi(), (float)lY.Phi()); histos.fill(HIST("deltaPhiMix"), dPhi, wSE); - histos.fill(HIST("hCentPairTypeME"), mcacc::cent(col1), ptype, wSE); - fillHistograms(mcacc::v0Status(t1), mcacc::v0Status(tY), l1, lY, p1, pY, 1, meWeight, 2); diff --git a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx index 6639404d334..2085067c176 100644 --- a/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx +++ b/PWGLF/Tasks/Strangeness/nonPromptCascade.cxx @@ -182,14 +182,17 @@ struct NonPromptCascadeTask { Produces NPCTableNT; Produces NPCTableMCNT; Produces NPCTableGen; - Produces NPPUTable; - Produces NPMCNTable; + // + Produces NPCollsTable; + Produces NPMCNTable; + Produces NPRecoCandTable; using TracksExtData = soa::Join; using TracksExtMC = soa::Join; using CollisionCandidatesRun3 = soa::Join; using CollisionCandidatesRun3MC = soa::Join; using TracksWithLabel = soa::Join; + using TracksWithSel = soa::Join; Preslice perCollision = aod::track::collisionId; Preslice perCollisionMC = aod::track::collisionId; @@ -417,12 +420,10 @@ struct NonPromptCascadeTask { for (const auto& coll : collisions) { float centFT0M = coll.centFT0M(); float multFT0M = coll.multFT0M(); - // float centFV0A = coll.centFV0A(); - // float multFV0A = coll.multFV0A(); float multNTracks = coll.multNTracksGlobal(); - float run = mRunNumber; + float runNumber = mRunNumber; float numContrib = coll.numContrib(); - mRegistryMults.fill(HIST("hCentMultsRuns"), centFT0M, multFT0M, numContrib, multNTracks, run); + mRegistryMults.fill(HIST("hCentMultsRuns"), centFT0M, multFT0M, numContrib, multNTracks, runNumber); } }; @@ -981,6 +982,50 @@ struct NonPromptCascadeTask { } PROCESS_SWITCH(NonPromptCascadeTask, processdNdetaMC, "process mc dN/deta", false); + // + void processdNdeta(CollisionCandidatesRun3 const& collisions, TracksWithSel const& tracks) + { + int ds = 1; + uint32_t orbitO = 0; + bool writeFlag = 0; + for (const auto& coll : collisions) { + auto bc = coll.template bc_as(); + uint64_t globalBC = bc.globalBC(); + uint32_t orbit = globalBC / 3564; + if (orbitO != orbit) { + orbitO = orbit; + if ((ds % cfgDownscaleMB) == 0) { + writeFlag = 1; + } else { + writeFlag = 0; + } + ds++; + } + if (writeFlag) { + if (mRunNumber != bc.runNumber()) { + mRunNumber = bc.runNumber(); + } + NPCollsTable(mRunNumber, + coll.bc().globalBC(), + coll.numContrib(), + coll.multNTracksGlobal(), + coll.centFT0M(), + coll.multFT0M()); + + auto collIdx = NPCollsTable.lastIndex(); + auto tracksThisColl = tracks.sliceBy(perCollision, coll.globalIndex()); + for (auto const& track : tracksThisColl) { + if (std::fabs(track.eta()) < 0.8 && track.tpcNClsFound() >= 80 && track.tpcNClsCrossedRows() >= 100) { + if (track.isGlobalTrack()) { + // mults.multGlobalTracks++; + NPRecoCandTable(collIdx, track.pt()); + } + } + } + } + } + } + PROCESS_SWITCH(NonPromptCascadeTask, processdNdeta, "process dN/deta", false); void processPileUp(CollisionCandidatesRun3 const& collisions, aod::BCsWithTimestamps const&) { @@ -1007,7 +1052,7 @@ struct NonPromptCascadeTask { } float centFT0M = coll.centFT0M(); float multFT0M = coll.multFT0M(); - NPPUTable(mRunNumber, globalBC, coll.numContrib(), coll.multNTracksGlobal(), centFT0M, multFT0M); + NPCollsTable(mRunNumber, globalBC, coll.numContrib(), coll.multNTracksGlobal(), centFT0M, multFT0M); } } }; diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 9c37b4a8b1b..fd6b48609e1 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -60,8 +60,10 @@ using namespace o2::framework; using namespace o2::framework::expressions; using std::array; -using MCSigma0s = soa::Join; using Sigma0s = soa::Join; +using MCSigma0s = soa::Join; +using Sigma0sWithEMCal = soa::Join; +using MCSigma0sWithEMCal = soa::Join; static const std::vector PhotonSels = {"NoSel", "V0Type", "DCADauToPV", "DCADau", "DauTPCCR", "TPCNSigmaEl", "V0pT", @@ -88,10 +90,6 @@ struct sigmaanalysis { ctpRateFetcher rateFetcher; //__________________________________________________ - // For manual sliceBy - // SliceCache cache; - PresliceUnsorted> perMcCollision = aod::v0data::straMCCollisionId; - HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Event level @@ -220,6 +218,23 @@ struct sigmaanalysis { Configurable PhotonPhiMax2{"PhotonPhiMax2", -1, "Phi min value to reject photons, region 2 (leave negative if no selection desired)"}; } photonSelections; + //// Photon criteria: + struct : ConfigurableGroup { + std::string prefix = "EMCalPhotonSelections"; // JSON group name + Configurable definition{"definition", 13, "Cluster definitions to be accepted (e.g. 13 for kV3MostSplitLowSeed)"}; + Configurable MinCells{"MinCells", 1, "Min number of cells in cluster"}; + Configurable MinEnergy{"MinEnergy", 0.0, "Minimum energy of selected clusters (GeV)"}; + Configurable MaxEnergy{"MaxEnergy", 5, "Max energy of selected clusters (GeV)"}; + Configurable MaxEta{"MaxEta", 1.0, "Max absolute cluster Eta"}; + Configurable MinTime{"MinTime", -50, "Minimum time of selected clusters (ns)"}; + Configurable MaxTime{"MaxTime", 50, "Max time of selected clusters (ns)"}; + Configurable RemoveExotic{"RemoveExotic", false, "Flag to enable the removal of exotic clusters"}; + Configurable MinM02{"MinM02", -1., "Minimum shower shape long axis"}; + Configurable MaxM02{"MaxM02", 5., "Max shower shape long axis"}; + Configurable RemoveMatchedTrack{"RemoveMatchedTrack", true, "Flag to enable the removal of clusters matched to tracks"}; + + } EMCalPhotonSelections; + struct : ConfigurableGroup { std::string prefix = "sigma0Selections"; // JSON group name Configurable Sigma0MinRapidity{"Sigma0MinRapidity", -0.5, "sigma0 min rapidity"}; @@ -277,6 +292,13 @@ struct sigmaanalysis { ConfigurableAxis axisPhi{"axisPhi", {200, 0, 2 * o2::constants::math::PI}, "Phi for photons"}; ConfigurableAxis axisZ{"axisZ", {120, -120.0f, 120.0f}, "V0 Z position (cm)"}; + // EMCal-specifc + ConfigurableAxis axisClrDefinition{"axisClrDefinition", {51, -0.5, 50.5}, "Cluster Definition"}; + ConfigurableAxis axisClrNCells{"axisClrNCells", {25, 0.0, 25}, "N cells per cluster"}; + ConfigurableAxis axisClrEnergy{"axisClrEnergy", {400, 0.0, 10}, "Energy per cluster"}; + ConfigurableAxis axisClrTime{"axisClrTime", {300, -30.0, 30.0}, "cluster time (ns)"}; + ConfigurableAxis axisClrShape{"axisClrShape", {100, 0.0, 1.0}, "cluster shape"}; + ConfigurableAxis axisCandSel{"axisCandSel", {20, 0.5f, +20.5f}, "Candidate Selection"}; // ML @@ -286,7 +308,7 @@ struct sigmaanalysis { void init(InitContext const&) { LOGF(info, "Initializing now: cross-checking correctness..."); - if ((doprocessRealData + doprocessMonteCarlo + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || + if ((doprocessRealData + doprocessRealDataWithEMCal + doprocessMonteCarlo + doprocessMonteCarloWithEMCal + doprocessPi0RealData + doprocessPi0MonteCarlo > 1) || (doprocessGeneratedRun3 + doprocessPi0GeneratedRun3 > 1)) { LOGF(fatal, "You have enabled more than one process function. Please check your configuration! Aborting now."); } @@ -333,33 +355,52 @@ struct sigmaanalysis { histos.add("GeneralQA/hCentralityVsInteractionRate", "hCentralityVsInteractionRate", kTH2D, {axisCentrality, axisIRBinning}); } - if (doprocessRealData || doprocessMonteCarlo) { + if (doprocessRealData || doprocessRealDataWithEMCal || doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { for (const auto& histodir : DirList) { if (fillSelhistos) { - histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); - histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); - histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); - histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); - histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); - histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - - histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); - histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hNegEta", "hNegEta", kTH1D, {axisRapidity}); - histos.add(histodir + "/Photon/hRadius", "hRadius", kTH1D, {axisV0Radius}); - histos.add(histodir + "/Photon/hZ", "hZ", kTH1D, {axisZ}); - histos.add(histodir + "/Photon/h2dRZCut", "h2dRZCut", kTH2D, {axisZ, axisV0Radius}); - histos.add(histodir + "/Photon/h2dRZPlane", "h2dRZPlane", kTH2D, {axisZ, axisV0Radius}); - histos.add(histodir + "/Photon/hCosPA", "hCosPA", kTH1D, {axisCosPA}); - histos.add(histodir + "/Photon/hPsiPair", "hPsiPair", kTH1D, {axisPsiPair}); - histos.add(histodir + "/Photon/hPhi", "hPhi", kTH1D, {axisPhi}); - histos.add(histodir + "/Photon/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); - histos.add(histodir + "/Photon/hMass", "hMass", kTH1D, {axisPhotonMass}); + + if (doprocessRealData || doprocessMonteCarlo) { + + histos.add(histodir + "/Photon/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); + histos.add(histodir + "/Photon/hV0Type", "hV0Type", kTH1D, {{8, 0.5f, 8.5f}}); + histos.add(histodir + "/Photon/hDCANegToPV", "hDCANegToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Photon/hDCAPosToPV", "hDCAPosToPV", kTH1D, {axisDCAtoPV}); + histos.add(histodir + "/Photon/hDCADau", "hDCADau", kTH1D, {axisDCAdau}); + histos.add(histodir + "/Photon/hPosTPCCR", "hPosTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hNegTPCCR", "hNegTPCCR", kTH1D, {axisTPCrows}); + histos.add(histodir + "/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + histos.add(histodir + "/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); + + // PCM photons + histos.add(histodir + "/Photon/hpT", "hpT", kTH1D, {axisPt}); + histos.add(histodir + "/Photon/hY", "hY", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hPosEta", "hPosEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hNegEta", "hNegEta", kTH1D, {axisRapidity}); + histos.add(histodir + "/Photon/hRadius", "hRadius", kTH1D, {axisV0Radius}); + histos.add(histodir + "/Photon/hZ", "hZ", kTH1D, {axisZ}); + histos.add(histodir + "/Photon/h2dRZCut", "h2dRZCut", kTH2D, {axisZ, axisV0Radius}); + histos.add(histodir + "/Photon/h2dRZPlane", "h2dRZPlane", kTH2D, {axisZ, axisV0Radius}); + histos.add(histodir + "/Photon/hCosPA", "hCosPA", kTH1D, {axisCosPA}); + histos.add(histodir + "/Photon/hPsiPair", "hPsiPair", kTH1D, {axisPsiPair}); + histos.add(histodir + "/Photon/hPhi", "hPhi", kTH1D, {axisPhi}); + histos.add(histodir + "/Photon/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisPhotonMass}); + histos.add(histodir + "/Photon/hMass", "hMass", kTH1D, {axisPhotonMass}); + histos.add(histodir + "/Photon/h3dPhotonYSigma0Mass", "h3dPhotonYSigma0Mass", kTH3D, {axisRapidity, axisPt, axisSigmaMass}); + histos.add(histodir + "/Photon/h3dPhotonRadiusSigma0Mass", "h3dPhotonRadiusSigma0Mass", kTH3D, {axisV0Radius, axisPt, axisSigmaMass}); + } + + if (doprocessRealDataWithEMCal || doprocessMonteCarloWithEMCal) { + // EMCal photons + histos.add(histodir + "/EMCalPhotonSel/hpT", "hpT", kTH1D, {axisPt}); + histos.add(histodir + "/EMCalPhotonSel/hDefinition", "hDefinition", kTH1D, {axisClrDefinition}); + histos.add(histodir + "/EMCalPhotonSel/hNCells", "hNCells", kTH1D, {axisClrNCells}); + histos.add(histodir + "/EMCalPhotonSel/hEnergy", "hEnergy", kTH1D, {axisClrEnergy}); + histos.add(histodir + "/EMCalPhotonSel/h2dEtaVsPhi", "h2dEtaVsPhi", kTH2D, {axisRapidity, axisPhi}); + histos.add(histodir + "/EMCalPhotonSel/hTime", "hTime", kTH1D, {axisClrTime}); + histos.add(histodir + "/EMCalPhotonSel/hExotic", "hExotic", kTH1D, {{2, -0.5f, 1.5f}}); + histos.add(histodir + "/EMCalPhotonSel/hShape", "hShape", kTH1D, {axisClrShape}); + } histos.add(histodir + "/Lambda/hTrackCode", "hTrackCode", kTH1D, {{11, 0.5f, 11.5f}}); histos.add(histodir + "/Lambda/hRadius", "hRadius", kTH1D, {axisV0Radius}); @@ -400,8 +441,6 @@ struct sigmaanalysis { histos.add(histodir + "/Sigma0/h2dRadiusVspT", "h2dRadiusVspT", kTH2D, {axisV0PairRadius, axisPt}); histos.add(histodir + "/Sigma0/hDCAPairDau", "hDCAPairDau", kTH1D, {axisDCAdau}); histos.add(histodir + "/Sigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); - histos.add(histodir + "/Sigma0/h3dPhotonYMass", "h3dPhotonYMass", kTH3D, {axisRapidity, axisPt, axisSigmaMass}); - histos.add(histodir + "/Sigma0/h3dPhotonRadiusMass", "h3dPhotonRadiusMass", kTH3D, {axisV0Radius, axisPt, axisSigmaMass}); histos.add(histodir + "/Sigma0/h3dOPAngleVsMass", "h3dOPAngleVsMass", kTH3D, {{140, 0.0f, +7.0f}, axisPt, axisSigmaMass}); histos.add(histodir + "/ASigma0/hMass", "hMass", kTH1D, {axisSigmaMass}); @@ -411,22 +450,21 @@ struct sigmaanalysis { histos.add(histodir + "/ASigma0/h2dRadiusVspT", "h2dRadiusVspT", kTH2D, {axisV0PairRadius, axisPt}); histos.add(histodir + "/ASigma0/hDCAPairDau", "hDCAPairDau", kTH1D, {axisDCAdau}); histos.add(histodir + "/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); - histos.add(histodir + "/ASigma0/h3dPhotonYMass", "h3dPhotonYMass", kTH3D, {axisRapidity, axisPt, axisSigmaMass}); - histos.add(histodir + "/ASigma0/h3dPhotonRadiusMass", "h3dPhotonRadiusMass", kTH3D, {axisV0Radius, axisPt, axisSigmaMass}); histos.add(histodir + "/ASigma0/h3dOPAngleVsMass", "h3dOPAngleVsMass", kTH3D, {{140, 0.0f, +7.0f}, axisPt, axisSigmaMass}); // Process MC - if (doprocessMonteCarlo) { + if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { if (fillSelhistos) { histos.add(histodir + "/MC/Photon/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); histos.add(histodir + "/MC/Photon/hPt", "hPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Photon/hMCPt", "hMCPt", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/hPosTPCNSigmaEl", "hPosTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/MC/Photon/hNegTPCNSigmaEl", "hNegTPCNSigmaEl", kTH1D, {axisTPCNSigma}); - histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); - histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); - histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); + + if (doprocessMonteCarlo) { + histos.add(histodir + "/MC/Photon/h2dPAVsPt", "h2dPAVsPt", kTH2D, {axisPA, axisPt}); + histos.add(histodir + "/MC/Photon/hPt_BadCollAssig", "hPt_BadCollAssig", kTH1D, {axisPt}); + histos.add(histodir + "/MC/Photon/h2dPAVsPt_BadCollAssig", "h2dPAVsPt_BadCollAssig", kTH2D, {axisPA, axisPt}); + } histos.add(histodir + "/MC/Lambda/hV0ToCollAssoc", "hV0ToCollAssoc", kTH1D, {{2, 0.0f, 2.0f}}); histos.add(histodir + "/MC/Lambda/hPt", "hPt", kTH1D, {axisPt}); @@ -441,8 +479,6 @@ struct sigmaanalysis { histos.add(histodir + "/MC/ALambda/h3dTPCvsTOFNSigma_Pi", "h3dTPCvsTOFNSigma_Pi", kTH3D, {axisTPCNSigma, axisTOFNSigma, axisPt}); } - histos.add(histodir + "/MC/h2dArmenteros", "h2dArmenteros", kTH2D, {axisAPAlpha, axisAPQt}); - histos.add(histodir + "/MC/Sigma0/hPt", "hPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Sigma0/hMCPt", "hMCPt", kTH1D, {axisPt}); histos.add(histodir + "/MC/Sigma0/hMass", "hMass", kTH1D, {axisSigmaMass}); @@ -465,11 +501,10 @@ struct sigmaanalysis { histos.add(histodir + "/MC/ASigma0/h3dMass", "h3dMass", kTH3D, {axisCentrality, axisPt, axisSigmaMass}); histos.add(histodir + "/MC/ASigma0/h3dMCProcess", "h3dMCProcess", kTH3D, {{50, -0.5f, 49.5f}, axisPt, axisSigmaMass}); - // 1/pT Resolution: + // pT Resolution: if (fillResoQAhistos && histodir == "BeforeSel") { - histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dGammaPtResoVsTPCCR", "h3dGammaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); @@ -477,6 +512,7 @@ struct sigmaanalysis { histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dSigma0RadiusResolution", "h2dSigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dASigma0RadiusResolution", "h2dASigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); @@ -751,12 +787,21 @@ struct sigmaanalysis { std::vector getListOfRecoCollIndices(TMCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); int biggestNContribs = -1; int bestCollisionIndex = -1; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { // consider event selections in the recoed <-> gen collision association, for the denominator (or numerator) of the efficiency (or signal loss)? + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); + if (eventSelections.useEvtSelInDenomEff) { if (!IsEventAccepted(collision, false)) { continue; @@ -781,6 +826,14 @@ struct sigmaanalysis { void fillGeneratedEventProperties(TMCCollisions const& mcCollisions, TCollisions const& collisions) { std::vector listBestCollisionIdx(mcCollisions.size()); + + // Custom grouping + std::vector> groupedCollisions(mcCollisions.size()); + + for (const auto& coll : collisions) { + groupedCollisions[coll.straMCCollisionId()].push_back(coll.globalIndex()); + } + for (auto const& mcCollision : mcCollisions) { // Apply selections on MC collisions if (eventSelections.applyZVtxSelOnMCPV && std::abs(mcCollision.posZ()) > eventSelections.maxZVtxPosition) { @@ -798,14 +851,14 @@ struct sigmaanalysis { histos.fill(HIST("Gen/hGenEvents"), mcCollision.multMCNParticlesEta05(), 0 /* all gen. events*/); - auto groupedCollisions = collisions.sliceBy(perMcCollision, mcCollision.globalIndex()); // Check if there is at least one of the reconstructed collisions associated to this MC collision // If so, we consider it bool atLeastOne = false; int biggestNContribs = -1; float centrality = 100.5f; int nCollisions = 0; - for (auto const& collision : groupedCollisions) { + for (size_t i = 0; i < groupedCollisions[mcCollision.globalIndex()].size(); i++) { + auto collision = collisions.rawIteratorAt(groupedCollisions[mcCollision.globalIndex()][i]); if (!IsEventAccepted(collision, false)) { continue; @@ -926,14 +979,16 @@ struct sigmaanalysis { int TrkCode = 10; // 1: TPC-only, 2: TPC+Something, 3: ITS-Only, 4: ITS+TPC + Something, 10: anything else if (isGamma) { - if (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() == 1) - TrkCode = 1; - if ((sigma.photonPosTrackCode() != 1 && sigma.photonNegTrackCode() == 1) || (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() != 1)) - TrkCode = 2; - if (sigma.photonPosTrackCode() == 3 && sigma.photonNegTrackCode() == 3) - TrkCode = 3; - if (sigma.photonPosTrackCode() == 2 || sigma.photonNegTrackCode() == 2) - TrkCode = 4; + if constexpr (requires { sigma.photonV0Type(); }) { + if (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() == 1) + TrkCode = 1; + if ((sigma.photonPosTrackCode() != 1 && sigma.photonNegTrackCode() == 1) || (sigma.photonPosTrackCode() == 1 && sigma.photonNegTrackCode() != 1)) + TrkCode = 2; + if (sigma.photonPosTrackCode() == 3 && sigma.photonNegTrackCode() == 3) + TrkCode = 3; + if (sigma.photonPosTrackCode() == 2 || sigma.photonNegTrackCode() == 2) + TrkCode = 4; + } } else { if (sigma.lambdaPosTrackCode() == 1 && sigma.lambdaNegTrackCode() == 1) TrkCode = 1; @@ -956,9 +1011,8 @@ struct sigmaanalysis { // Gamma MC association if (sigma.photonPDGCode() == 22) { if (sigma.photonmcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.photonNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dGammaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.photonPosTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), sigma.photonPt() - sigma.photonmcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution } } @@ -986,8 +1040,10 @@ struct sigmaanalysis { // Sigma and AntiSigma MC association if (sigma.isSigma0()) { histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution - if (sigma.mcpt() > 0) - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + if (sigma.mcpt() > 0) { + histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), sigma.pt() - sigma.mcpt()); // pT resolution + histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + } } if (sigma.isAntiSigma0()) { histos.fill(HIST("BeforeSel/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution @@ -1044,39 +1100,61 @@ struct sigmaanalysis { // Check whether it is before or after selections static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; - // Get V0trackCode - int GammaTrkCode = retrieveV0TrackCode(sigma); - int LambdaTrkCode = retrieveV0TrackCode(sigma); - - float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; float centrality = getCentralityRun3(collision); if (fillSelhistos) { - //_______________________________________ - // Photon - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); - - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegEta"), sigma.photonNegEta()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hRadius"), sigma.photonRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hZ"), sigma.photonZconv()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZCut"), sigma.photonRadius(), photonRZLineCut); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZPlane"), sigma.photonZconv(), sigma.photonRadius()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hCosPA"), sigma.photonCosPA()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPsiPair"), sigma.photonPsiPair()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPhi"), sigma.photonPhi()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dMass"), centrality, sigma.photonPt(), sigma.photonMass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hMass"), sigma.photonMass()); + + // Get V0trackCode + int LambdaTrkCode = retrieveV0TrackCode(sigma); + + if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon + + // Base properties + int GammaTrkCode = retrieveV0TrackCode(sigma); + float photonRZLineCut = TMath::Abs(sigma.photonZconv()) * TMath::Tan(2 * TMath::ATan(TMath::Exp(-photonSelections.PhotonMaxDauEta))) - photonSelections.PhotonLineCutZ0; + + //_______________________________________ + // Photon + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hTrackCode"), GammaTrkCode); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hV0Type"), sigma.photonV0Type()); + + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCANegToPV"), sigma.photonDCANegPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCAPosToPV"), sigma.photonDCAPosPV()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hDCADau"), sigma.photonDCADau()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCCR"), sigma.photonPosTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCCR"), sigma.photonNegTPCCrossedRows()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hpT"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hY"), sigma.photonY()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPosEta"), sigma.photonPosEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hNegEta"), sigma.photonNegEta()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hRadius"), sigma.photonRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hZ"), sigma.photonZconv()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZCut"), sigma.photonRadius(), photonRZLineCut); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h2dRZPlane"), sigma.photonZconv(), sigma.photonRadius()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hCosPA"), sigma.photonCosPA()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPsiPair"), sigma.photonPsiPair()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hPhi"), sigma.photonPhi()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dMass"), centrality, sigma.photonPt(), sigma.photonMass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/hMass"), sigma.photonMass()); + + histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dPhotonYSigma0Mass"), sigma.photonY(), sigma.pt(), sigma.sigma0Mass()); + histos.fill(HIST(MainDir[mode]) + HIST("/Photon/h3dPhotonRadiusSigma0Mass"), sigma.photonRadius(), sigma.pt(), sigma.sigma0Mass()); + } + + if constexpr (requires { sigma.photonDefinition(); }) { // Processing EMCal photon + + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hpT"), sigma.photonPt()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hDefinition"), sigma.photonDefinition()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hNCells"), sigma.photonNCells()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hEnergy"), sigma.photonEnergy()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/h2dEtaVsPhi"), sigma.photonEMCEta(), sigma.photonEMCPhi()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hTime"), sigma.photonTime()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hExotic"), sigma.photonIsExotic()); + histos.fill(HIST(MainDir[mode]) + HIST("/EMCalPhotonSel/hShape"), sigma.photonM02()); + } //_______________________________________ // Lambdas @@ -1094,13 +1172,12 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hPosChi2PerNc"), sigma.lambdaPosChi2PerNcl()); histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hNegChi2PerNc"), sigma.lambdaNegChi2PerNcl()); histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/hLifeTime"), sigma.lambdaLifeTime()); + + histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); } //_______________________________________ // Sigmas and Lambdas - histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - if (sigma.lambdaAlpha() > 0) { if (fillSelhistos) { histos.fill(HIST(MainDir[mode]) + HIST("/Lambda/h2dTPCvsTOFNSigma_LambdaPr"), sigma.lambdaPosPrTPCNSigma(), sigma.lambdaPrTOFNSigma()); @@ -1119,8 +1196,6 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h2dRadiusVspT"), sigma.radius(), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/hDCAPairDau"), sigma.dcadaughters()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dPhotonYMass"), sigma.photonY(), sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dPhotonRadiusMass"), sigma.photonRadius(), sigma.pt(), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/Sigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); } else { if (fillSelhistos) { @@ -1140,8 +1215,6 @@ struct sigmaanalysis { histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h2dRadiusVspT"), sigma.radius(), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/hDCAPairDau"), sigma.dcadaughters()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dMass"), centrality, sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dPhotonYMass"), sigma.photonY(), sigma.pt(), sigma.sigma0Mass()); - histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dPhotonRadiusMass"), sigma.photonRadius(), sigma.pt(), sigma.sigma0Mass()); histos.fill(HIST(MainDir[mode]) + HIST("/ASigma0/h3dOPAngleVsMass"), sigma.opAngle(), sigma.pt(), sigma.sigma0Mass()); } @@ -1154,17 +1227,18 @@ struct sigmaanalysis { //_______________________________________ // Gamma MC association if (sigma.photonPDGCode() == 22) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hV0ToCollAssoc"), sigma.photonIsCorrectlyAssoc()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt"), sigma.photonPt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hMCPt"), sigma.photonmcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPosTPCNSigmaEl"), sigma.photonPosTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hNegTPCNSigmaEl"), sigma.photonNegTPCNSigmaEl()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + if constexpr (requires { sigma.photonV0Type(); }) { // Processing PCM photon + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); - if (!sigma.photonIsCorrectlyAssoc()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), sigma.photonmcpt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + if (!sigma.photonIsCorrectlyAssoc()) { + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/hPt_BadCollAssig"), sigma.photonmcpt()); + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Photon/h2dPAVsPt_BadCollAssig"), TMath::ACos(sigma.photonCosPA()), sigma.photonmcpt()); + } } } @@ -1191,9 +1265,6 @@ struct sigmaanalysis { //_______________________________________ // Sigma0 MC association if (sigma.isSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/Sigma0/hMCPt"), sigma.mcpt()); @@ -1211,9 +1282,6 @@ struct sigmaanalysis { //_______________________________________ // AntiSigma0 MC association if (sigma.isAntiSigma0()) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.photonAlpha(), sigma.photonQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/h2dArmenteros"), sigma.lambdaAlpha(), sigma.lambdaQt()); - histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hPt"), sigma.pt()); histos.fill(HIST(MainDir[mode]) + HIST("/MC/ASigma0/hMCPt"), sigma.mcpt()); @@ -1382,6 +1450,48 @@ struct sigmaanalysis { return true; } + // Apply specific selections for photons + template + bool selectEMCalPhoton(TClusterObject const& cand) + { + // Clusterizer + if (cand.photonDefinition() != EMCalPhotonSelections.definition && EMCalPhotonSelections.definition > -1) + return false; + + // Number of Cells + if (cand.photonNCells() < EMCalPhotonSelections.MinCells) + return false; + + // Energy + if (cand.photonEnergy() < EMCalPhotonSelections.MinEnergy || cand.photonEnergy() > EMCalPhotonSelections.MaxEnergy) + return false; + + // Eta + if (TMath::Abs(cand.photonEMCEta()) > EMCalPhotonSelections.MaxEta) + return false; + + // Timing + if (cand.photonTime() < EMCalPhotonSelections.MinTime || cand.photonTime() > EMCalPhotonSelections.MaxTime) + return false; + + // Exotic Clusters + if (cand.photonIsExotic() && EMCalPhotonSelections.RemoveExotic) { + return false; + } + + // Shower shape long axis + if (cand.photonNCells() > 1) { // Only if we have more than one + if (cand.photonM02() < EMCalPhotonSelections.MinM02 || cand.photonM02() > EMCalPhotonSelections.MaxM02) { + return false; + } + } + // Has matched track? + if (cand.photonHasAssocTrk() && EMCalPhotonSelections.RemoveMatchedTrack) + return false; + + return true; + } + // Apply specific selections for lambdas template bool selectLambda(TV0Object const& cand) @@ -1492,8 +1602,15 @@ struct sigmaanalysis { bool processSigma0Candidate(TSigma0Object const& cand) { // Photon specific selections - if (!selectPhoton(cand)) - return false; + if constexpr (requires { cand.photonV0Type(); }) { // Processing PCM photon + if (!selectPhoton(cand)) + return false; + } + + if constexpr (requires { cand.photonDefinition(); }) { // Processing EMCal photon + if (!selectEMCalPhoton(cand)) + return false; + } // Lambda specific selections if (!selectLambda(cand)) @@ -1539,7 +1656,7 @@ struct sigmaanalysis { for (const auto& coll : collisions) { // Event selection - if (!IsEventAccepted(coll, true)) + if (!IsEventAccepted(coll, true)) // TODO: Should I Add event selection for events without EMCal? continue; // Sigma0s loop @@ -1721,11 +1838,21 @@ struct sigmaanalysis { analyzeRecoeSigma0s(collisions, fullSigma0s); } + void processRealDataWithEMCal(soa::Join const& collisions, Sigma0sWithEMCal const& fullSigma0s) + { + analyzeRecoeSigma0s(collisions, fullSigma0s); + } + void processMonteCarlo(soa::Join const& collisions, MCSigma0s const& fullSigma0s) { analyzeRecoeSigma0s(collisions, fullSigma0s); } + void processMonteCarloWithEMCal(soa::Join const& collisions, MCSigma0sWithEMCal const& fullSigma0s) + { + analyzeRecoeSigma0s(collisions, fullSigma0s); + } + // Simulated processing in Run 3 void processGeneratedRun3(soa::Join const& mcCollisions, soa::Join const& collisions, soa::Join const& Sigma0Gens) { @@ -1751,7 +1878,9 @@ struct sigmaanalysis { // _____________________________________________________ PROCESS_SWITCH(sigmaanalysis, processRealData, "Do real data analysis", true); + PROCESS_SWITCH(sigmaanalysis, processRealDataWithEMCal, "Do real data analysis with EMCal photons", false); PROCESS_SWITCH(sigmaanalysis, processMonteCarlo, "Do Monte-Carlo-based analysis", false); + PROCESS_SWITCH(sigmaanalysis, processMonteCarloWithEMCal, "Do Monte-Carlo-based analysis with EMCal photons", false); PROCESS_SWITCH(sigmaanalysis, processGeneratedRun3, "process MC generated Run 3", false); PROCESS_SWITCH(sigmaanalysis, processPi0RealData, "Do real data analysis for pi0 QA", false); PROCESS_SWITCH(sigmaanalysis, processPi0MonteCarlo, "Do Monte-Carlo-based analysis for pi0 QA", false); diff --git a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx index 44eb59d507e..de8e38ecbfb 100644 --- a/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx +++ b/PWGLF/Tasks/Strangeness/strangeCascTrack.cxx @@ -87,24 +87,33 @@ struct StrangeCascTrack { // axes struct : ConfigurableGroup { + std::string prefix = "axes"; ConfigurableAxis axisEta{"axisEta", {102, -2.01, 2.01}, "#eta"}; ConfigurableAxis axisDCAxy{"axisDCAxy", {500, 0., 0.5}, "cm"}; ConfigurableAxis axisDCAz{"axisDCAz", {500, 0., 0.5}, "cm"}; - ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 6.0, 10.0}, "p_{T} (GeV/c)"}; + ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 10}, "p_{T} (GeV/c)"}; ConfigurableAxis axisMult{"axisMult", {VARIABLE_WIDTH, 0.0f, 5.0, 10.0f, 20.0f, 30.0f, 40.0f, 50.0f, 70.0f, 100.0f}, "FT0 mult %"}; ConfigurableAxis axisOmegaMass{"axisOmegaMass", {2000, 1.6, 1.8}, "#Omega M_{inv} (GeV/c^{2})"}; ConfigurableAxis axisXiMass{"axisXiMass", {2000, 1.2, 1.4}, "#Xi M_{inv} (GeV/c^{2})"}; } axesConfig; - // event and dau track selection + // event selections struct : ConfigurableGroup { - // event cuts + std::string prefix = "eventSelections"; Configurable cutDoINEL{"cutDoINEL", true, "choose events with INEL>0"}; Configurable cutZVertex{"cutZVertex", 10.0f, "max Z-vertex position"}; Configurable cutDoSel8{"cutDoSel8", true, "choose events with sel8"}; Configurable cutDoNoPileup{"cutDoNoPileup", true, "choose events with no bunch pileup"}; Configurable cutDoGoodFT0{"cutDoGoodFT0", true, "choose events with IsGoodZvtxFT0VsPV"}; - // cascade cuts + Configurable doINELMCGen{"doINELMCGen", true, "apply INEL>0 for gen MC events"}; + Configurable doITSTPCVertexEventCut{"doITSTPCVertexEventCut", true, ">=1 ITS-TPC track"}; + Configurable doNoCollInRofStandardCut{"doNoCollInRofStandardCut", true, "rejects if there are other events within the same ITS ROF with mult above threshold"}; + Configurable doTimeRangeStandardCut{"doTimeRangeStandardCut", true, "rejects if there are events nearby in dtime +/- 2 μs, or mult above some threshold in -4..-2 μs"}; + } eventCuts; + + // cascade selections + struct : ConfigurableGroup { + std::string prefix = "cascadeSelections"; Configurable cutDoPropagateDCA{"cutDoPropagateDCA", false, "choose events with sel8"}; Configurable cutPropDCAtoPVxy{"cutPropDCAtoPVxy", 0.02f, "max cascade dca to PV in xy - propagated"}; Configurable cutPropDCAtoPVz{"cutPropDCAtoPVz", 0.02f, "max cascade dca to PV in z - propagated"}; @@ -115,7 +124,7 @@ struct StrangeCascTrack { Configurable cutMaxBachCosPA{"cutMaxBachCosPA", 1.1f, "max Bachelor cosPA"}; Configurable> cutMinCascCosPaVsPt{ "cutMinCascCosPaVsPt", - {0.993, 0.994, 0.995, 0.996, 0.997, 0.997, 0.998, 0.998, 0.999, 0.999, 0.999}, + {0.993, 0.993, 0.994, 0.995, 0.996, 0.997, 0.997, 0.998, 0.998, 0.999, 0.999}, "Min Casc CosPA per pT bin (same binning as axisPt)"}; Configurable cutRapidity{"cutRapidity", 0.5f, "max rapidity"}; Configurable cutDauEta{"cutDauEta", 1.0f, "max eta of dau tracks"}; @@ -136,7 +145,7 @@ struct StrangeCascTrack { // TOF PID selection Configurable cutNSigmaTOFXi{"cutNSigmaTOFXi", 3, "cutNSigmaTOFXi"}; Configurable cutNSigmaTOFOmega{"cutNSigmaTOFOmega", 3, "cutNSigmaTOFOmega"}; - } selCuts; + } cascCuts; // cascade reconstruction Types static constexpr std::string_view TypeNames[] = {"Standard", "Tracked"}; @@ -160,44 +169,65 @@ struct StrangeCascTrack { { bool passedAllSels = true; //* inel>0 cut - if (!selCuts.cutDoINEL || collision.multNTracksPVeta1() > 0) { + if (!eventCuts.cutDoINEL || collision.multNTracksPVeta1() > 0) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 0.5); } else { passedAllSels = false; } //* pvz cut - if (std::abs(collision.posZ()) < selCuts.cutZVertex) { + if (std::abs(collision.posZ()) < eventCuts.cutZVertex) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 1.5); } else { passedAllSels = false; } //* sel8 cut - if (!selCuts.cutDoSel8 || collision.sel8()) { + if (!eventCuts.cutDoSel8 || collision.sel8()) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 2.5); } else { passedAllSels = false; } //* pileup cut - if (!selCuts.cutDoNoPileup || collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { + if (!eventCuts.cutDoNoPileup || collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 3.5); } else { passedAllSels = false; } //* good ft0 z-vertex vs pv cut - if (!selCuts.cutDoGoodFT0 || collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { + if (!eventCuts.cutDoGoodFT0 || collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { if (fillHists) histos.fill(HIST("Rec-Events/EvFilter"), 4.5); } else { passedAllSels = false; } + //* + if (!eventCuts.doITSTPCVertexEventCut || collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { + if (fillHists) + histos.fill(HIST("Rec-Events/EvFilter"), 5.5); + } else { + passedAllSels = false; + } + //* + if (!eventCuts.doNoCollInRofStandardCut || collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { + if (fillHists) + histos.fill(HIST("Rec-Events/EvFilter"), 6.5); + } else { + passedAllSels = false; + } + //* + if (!eventCuts.doTimeRangeStandardCut || collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { + if (fillHists) + histos.fill(HIST("Rec-Events/EvFilter"), 7.5); + } else { + passedAllSels = false; + } //* all cuts if (passedAllSels) { if (fillHists) - histos.fill(HIST("Rec-Events/EvFilter"), 5.5); + histos.fill(HIST("Rec-Events/EvFilter"), 8.5); } return passedAllSels; } @@ -209,20 +239,20 @@ struct StrangeCascTrack { double ptMin = 0.0; double ptMax = 0.0; if (Type == 1 && particle == "Xi") { - ptMin = selCuts.cutMinPtXiTra; - ptMax = selCuts.cutMaxPtXiTra; + ptMin = cascCuts.cutMinPtXiTra; + ptMax = cascCuts.cutMaxPtXiTra; } if (Type == 1 && particle == "Omega") { - ptMin = selCuts.cutMinPtOmegaTra; - ptMax = selCuts.cutMaxPtOmegaTra; + ptMin = cascCuts.cutMinPtOmegaTra; + ptMax = cascCuts.cutMaxPtOmegaTra; } if (Type == 0 && particle == "Xi") { - ptMin = selCuts.cutMinPtXiStd; - ptMax = selCuts.cutMaxPtXiStd; + ptMin = cascCuts.cutMinPtXiStd; + ptMax = cascCuts.cutMaxPtXiStd; } if (Type == 0 && particle == "Omega") { - ptMin = selCuts.cutMinPtOmegaStd; - ptMax = selCuts.cutMaxPtOmegaStd; + ptMin = cascCuts.cutMinPtOmegaStd; + ptMax = cascCuts.cutMaxPtOmegaStd; } if (cascade.pt() < ptMin || cascade.pt() > ptMax) passedSel = false; @@ -240,7 +270,7 @@ struct StrangeCascTrack { y = std::abs(cascade.yXi()); else y = std::abs(cascade.yOmega()); - if (y > selCuts.cutRapidity) { + if (y > cascCuts.cutRapidity) { passedRapidity = false; passedAllSels = false; } @@ -249,7 +279,7 @@ struct StrangeCascTrack { double bachEta = std::abs(cascade.bacheloreta()); double negEta = std::abs(cascade.negativeeta()); double posEta = std::abs(cascade.positiveeta()); - if (bachEta > selCuts.cutDauEta || negEta > selCuts.cutDauEta || posEta > selCuts.cutDauEta) { + if (bachEta > cascCuts.cutDauEta || negEta > cascCuts.cutDauEta || posEta > cascCuts.cutDauEta) { passedDauEta = false; passedAllSels = false; } @@ -261,21 +291,21 @@ struct StrangeCascTrack { double posCls = posTrack.tpcClusters(); double negCls = negTrack.tpcClusters(); double bachCls = bachTrack.tpcClusters(); - if (posCls < selCuts.cutNClsTPC || negCls < selCuts.cutNClsTPC || bachCls < selCuts.cutNClsTPC) { + if (posCls < cascCuts.cutNClsTPC || negCls < cascCuts.cutNClsTPC || bachCls < cascCuts.cutNClsTPC) { passedTPCCls = false; passedAllSels = false; } // V0 cosPA bool passedV0CosPA = true; double v0cospa = cascade.v0cosPA(collision.posX(), collision.posY(), collision.posZ()); - if (v0cospa < selCuts.cutMinV0CosPA || v0cospa > selCuts.cutMaxV0CosPA) { + if (v0cospa < cascCuts.cutMinV0CosPA || v0cospa > cascCuts.cutMaxV0CosPA) { passedV0CosPA = false; passedAllSels = false; } // Bachelor cosPA bool passedBachCosPA = true; double bachcospa = stdcasc.bachBaryonCosPA(); - if (bachcospa < selCuts.cutMinBachCosPA || bachcospa > selCuts.cutMaxBachCosPA) { + if (bachcospa < cascCuts.cutMinBachCosPA || bachcospa > cascCuts.cutMaxBachCosPA) { passedBachCosPA = false; passedAllSels = false; } @@ -284,22 +314,22 @@ struct StrangeCascTrack { double casccospa = cascade.casccosPA(collision.posX(), collision.posY(), collision.posZ()); const auto& edges = axesConfig.axisPt.value; int ptBin = std::upper_bound(edges.begin(), edges.end(), cascade.pt()) - edges.begin() - 1; - if (ptBin < 0 || ptBin >= static_cast(selCuts.cutMinCascCosPaVsPt->size())) { + if (ptBin < 0 || ptBin >= static_cast(cascCuts.cutMinCascCosPaVsPt->size())) { ptBin = 1; } // safety check - if pt bin not determined, default to loosest cut - if (casccospa < selCuts.cutMinCascCosPaVsPt->at(ptBin)) { + if (casccospa < cascCuts.cutMinCascCosPaVsPt->at(ptBin)) { passedCascCosPA = false; passedAllSels = false; } // Propagated cacade DCAxy to PV bool passedPropDCAxy = true; - if (selCuts.cutDoPropagateDCA && cascade.dcaXYCascToPV() > selCuts.cutPropDCAtoPVxy) { + if (cascCuts.cutDoPropagateDCA && cascade.dcaXYCascToPV() > cascCuts.cutPropDCAtoPVxy) { passedPropDCAxy = false; passedAllSels = false; } // Propagated cacade DCAz to PV bool passedPropDCAz = true; - if (selCuts.cutDoPropagateDCA && cascade.dcaZCascToPV() > selCuts.cutPropDCAtoPVz) { + if (cascCuts.cutDoPropagateDCA && cascade.dcaZCascToPV() > cascCuts.cutPropDCAtoPVz) { passedPropDCAz = false; passedAllSels = false; } @@ -314,25 +344,25 @@ struct StrangeCascTrack { const auto& negTrack = cascade.template negTrackExtra_as(); const auto& bachTrack = cascade.template bachTrackExtra_as(); if (cascade.sign() < 0) { - if (std::abs(posTrack.tpcNSigmaPr()) > selCuts.cutNSigmaTPCProton) { + if (std::abs(posTrack.tpcNSigmaPr()) > cascCuts.cutNSigmaTPCProton) { passedSel = false; } - if (std::abs(negTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) { + if (std::abs(negTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) { passedSel = false; } - if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) || - (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > selCuts.cutNSigmaTPCKaon)) { + if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) || + (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > cascCuts.cutNSigmaTPCKaon)) { passedSel = false; } } else { - if (std::abs(negTrack.tpcNSigmaPr()) > selCuts.cutNSigmaTPCProton) { + if (std::abs(negTrack.tpcNSigmaPr()) > cascCuts.cutNSigmaTPCProton) { passedSel = false; } - if (std::abs(posTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) { + if (std::abs(posTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) { passedSel = false; } - if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > selCuts.cutNSigmaTPCPion) || - (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > selCuts.cutNSigmaTPCKaon)) { + if ((particle == "Xi" && std::abs(bachTrack.tpcNSigmaPi()) > cascCuts.cutNSigmaTPCPion) || + (particle == "Omega" && std::abs(bachTrack.tpcNSigmaKa()) > cascCuts.cutNSigmaTPCKaon)) { passedSel = false; } } @@ -344,9 +374,9 @@ struct StrangeCascTrack { { bool passedSel = true; if (particle == "Xi") - passedSel = cascade.tofXiCompatibility(selCuts.cutNSigmaTOFXi); + passedSel = cascade.tofXiCompatibility(cascCuts.cutNSigmaTOFXi); if (particle == "Omega") - passedSel = cascade.tofOmegaCompatibility(selCuts.cutNSigmaTOFOmega); + passedSel = cascade.tofOmegaCompatibility(cascCuts.cutNSigmaTOFOmega); return passedSel; } // checks whether gen cascade corresponds to PDG code @@ -375,18 +405,6 @@ struct StrangeCascTrack { } return false; } - // applies purities and efficiencies - void fillHist(std::shared_ptr hist, double binFillThn[], float efficiency, float effUncert, float purity, float purityUncert) - { - float previousContent, previousError2, currentContent, currentError2; - int bin = hist->GetBin(binFillThn); - previousContent = hist->GetBinContent(bin); - previousError2 = hist->GetBinError2(bin); - currentContent = previousContent + purity / (efficiency); - currentError2 = previousError2 + std::pow(purity / (efficiency), 2) + std::pow(purityUncert / (efficiency), 2) + std::pow(effUncert * purity, 2) / std::pow(efficiency, 4); - hist->SetBinContent(bin, currentContent); - hist->SetBinError2(bin, currentError2); - } // applies selections for and fills histograms template @@ -422,15 +440,6 @@ struct StrangeCascTrack { } }(); - float efficiencyOmega = 1.0f; - float efficiencyXi = 1.0f; - float efficiencyOmegaErr = 0.0f; - float efficiencyXiErr = 0.0f; - float purityOmega = 1.0f; - float purityXi = 1.0f; - float purityOmegaErr = 0.0f; - float purityXiErr = 0.0f; - double mult = (doProcessIons) ? collision.centFT0C() : collision.centFT0M(); // ion collisions use FT0C for multiplicity, pp uses both // fill multiplicity for events with >=1 cascade @@ -599,7 +608,7 @@ struct StrangeCascTrack { } // apply competing mass rej if (doCompetingMassRej) { - if ((std::abs(massXi - o2::constants::physics::MassXiMinus) > selCuts.cutCompMassRej)) { + if ((std::abs(massXi - o2::constants::physics::MassXiMinus) > cascCuts.cutCompMassRej)) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 4.5); if (fillTruthOmega) histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 4.5); @@ -643,46 +652,49 @@ struct StrangeCascTrack { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Filters/RapidityOmega"), cascade.yOmega()); } } - double binFillXi[3] = {massXi, pt, mult}; if (passedAllSelsXi) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersXi"), 4.5); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXi"), massXi); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/Xi")), binFillXi, efficiencyXi, efficiencyXiErr, purityXi, purityXiErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Xi"), massXi, pt, mult); // fill for particle-antiparticle type if (cascade.sign() < 0) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXiMinus"), massXi); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/XiMinus")), binFillXi, efficiencyXi, efficiencyXiErr, purityXi, purityXiErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/XiMinus"), massXi, pt, mult); } if (cascade.sign() > 0) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassXiPlus"), massXi); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/XiPlus")), binFillXi, efficiencyXi, efficiencyXiErr, purityXi, purityXiErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/XiPlus"), massXi, pt, mult); } // fill truth if (fillTruthXi) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersXi"), 4.5); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/MassXi"), massXi); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Xi"), massXi, pt, mult); + // + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/RapCheck_TH3_Truth_Xi"), pt, mult, cascade.yXi()); } } - double binFillOmega[3] = {massOmega, pt, mult}; if (passedAllSelsOmega) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/FiltersOmega"), 5.5); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmega"), massOmega); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/Omega")), binFillOmega, efficiencyOmega, efficiencyOmegaErr, purityOmega, purityOmegaErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Xi"), massXi, pt, mult); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/Omega"), massOmega, pt, mult); // fill for particle-antiparticle type if (cascade.sign() < 0) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmegaMinus"), massOmega); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/OmegaMinus")), binFillOmega, efficiencyOmega, efficiencyOmegaErr, purityOmega, purityOmegaErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/OmegaMinus"), massOmega, pt, mult); } if (cascade.sign() > 0) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/MassOmegaPlus"), massOmega); - fillHist(histos.get(HIST(TypeNames[Type]) + HIST("/Rec/OmegaPlus")), binFillOmega, efficiencyOmega, efficiencyOmegaErr, purityOmega, purityOmegaErr); + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec/OmegaPlus"), massOmega, pt, mult); } // fill truth if (fillTruthOmega) { histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/FiltersOmega"), 5.5); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/MassOmega"), massOmega); histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/Omega"), massOmega, pt, mult); + // + histos.fill(HIST(TypeNames[Type]) + HIST("/Rec-Truth/RapCheck_TH3_Truth_Omega"), pt, mult, cascade.yOmega()); } } @@ -725,7 +737,7 @@ struct StrangeCascTrack { void init(InitContext const&) { // check if cut configuration is valid - if (selCuts.cutMinCascCosPaVsPt->size() != axesConfig.axisPt.value.size() - 1) { + if (cascCuts.cutMinCascCosPaVsPt->size() != axesConfig.axisPt.value.size() - 1) { LOGF(fatal, "cutMinCascCosPaVsPt size does not match axisPt binning"); } // for all events processing @@ -738,13 +750,16 @@ struct StrangeCascTrack { histos.add("Rec-Events/PVxy", "PV xy position", kTH2D, {{200, -0.1, 0.1}, {200, -0.1, 0.1}}); histos.add("Rec-Events/PVz", "PV z position", kTH1D, {{100, -20, 20}}); histos.add("Rec-Events/Mult", "Multiplicity", kTH1D, {axesConfig.axisMult}); - histos.add("Rec-Events/EvFilter", "Event Filter", kTH1D, {{6, 0, 6}}); + histos.add("Rec-Events/EvFilter", "Event Filter", kTH1D, {{9, 0, 9}}); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(1, "INEL>0"); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(2, "PVz cut"); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(3, "sel8"); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(4, "NoSameBunchPileup"); histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(5, "IsGoodZvtxFT0VsPV"); - histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(6, "all"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(6, "ITSTPCVertexEventCut"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(7, "NoCollInRofStandardCut"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(8, "TimeRangeStandardCut"); + histos.get(HIST("Rec-Events/EvFilter"))->GetXaxis()->SetBinLabel(9, "all"); // for cascade processing static_for<0, 1>([&](auto Type) { // no selections applied @@ -800,18 +815,18 @@ struct StrangeCascTrack { histos.add(Form("%s/Rec/MassXi", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisXiMass}); histos.add(Form("%s/Rec/MassXiMinus", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisXiMass}); histos.add(Form("%s/Rec/MassXiPlus", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisXiMass}); - histos.add(Form("%s/Rec/Xi", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); - histos.add(Form("%s/Rec/XiMinus", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); - histos.add(Form("%s/Rec/XiPlus", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/Xi", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/XiMinus", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/XiPlus", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisXiMass, axesConfig.axisPt, axesConfig.axisMult}); // selected omega histos.add(Form("%s/Rec/FiltersOmega", TypeNames[Type].data()), "main cascade filters for Omega", kTH1D, {{6, 0, 6}}); histos.add(Form("%s/Rec/GenFiltersOmega", TypeNames[Type].data()), "general cascade filters for Omega", kTH1D, {{9, 0, 9}}); histos.add(Form("%s/Rec/MassOmega", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); histos.add(Form("%s/Rec/MassOmegaMinus", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); histos.add(Form("%s/Rec/MassOmegaPlus", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); - histos.add(Form("%s/Rec/Omega", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); - histos.add(Form("%s/Rec/OmegaMinus", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); - histos.add(Form("%s/Rec/OmegaPlus", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/Omega", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/OmegaMinus", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); + histos.add(Form("%s/Rec/OmegaPlus", TypeNames[Type].data()), "", kTHnSparseD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); // mc truth for all passed selections // xi and omega truth selection statistics histos.add(Form("%s/Rec-Truth/Filters/PropDCAxy", TypeNames[Type].data()), "DCA to xy (propagated)", kTH1D, {axesConfig.axisDCAxy}); @@ -834,6 +849,9 @@ struct StrangeCascTrack { histos.add(Form("%s/Rec-Truth/GenFiltersOmega", TypeNames[Type].data()), "general cascade filters for Omega", kTH1D, {{9, 0, 9}}); histos.add(Form("%s/Rec-Truth/MassOmega", TypeNames[Type].data()), "Invariant mass hypothesis", kTH1D, {axesConfig.axisOmegaMass}); histos.add(Form("%s/Rec-Truth/Omega", TypeNames[Type].data()), "", kTHnD, {axesConfig.axisOmegaMass, axesConfig.axisPt, axesConfig.axisMult}); + /// + histos.add(Form("%s/Rec-Truth/RapCheck_TH3_Truth_Xi", TypeNames[Type].data()), "Rapidity check (pt, mult, y)", kTHnD, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); + histos.add(Form("%s/Rec-Truth/RapCheck_TH3_Truth_Omega", TypeNames[Type].data()), "Rapidity check (pt, mult, y)", kTHnD, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); }); // for MC-specific processing // all generated events: @@ -866,6 +884,8 @@ struct StrangeCascTrack { histos.add("MC/EvRec/PrimaryOmegaRapidity", "Omega primaries in |y|", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Omegas in selected rapidity range in reco>=1 histos.add("MC/EvRec/PrimaryOmegaMinusRapidity", "Omega- primaries in |y|", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Omega-minus in selected rapidity range in reco>=1 histos.add("MC/EvRec/PrimaryOmegaPlusRapidity", "Omega+ primaries in |y|", kTH2D, {axesConfig.axisPt, axesConfig.axisMult}); // generated primary Omega-plus in selected rapidity range in reco>=1 + histos.add("MC/EvRec/RapCheck_TH3_Gen_Xi", "Xi (primary, y<0.5) from pt, cent, rapidity", kTH3D, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); + histos.add("MC/EvRec/RapCheck_TH3_Gen_Omega", "Omega (primary, y<0.5) from pt, cent, rapidity", kTH3D, {axesConfig.axisPt, axesConfig.axisMult, {200, -1.0, 1.0}}); // label filter statistic bins for standard cascs histos.get(HIST("Standard/Rec/FiltersXi"))->GetXaxis()->SetBinLabel(1, "p_{T}"); histos.get(HIST("Standard/Rec/FiltersXi"))->GetXaxis()->SetBinLabel(2, "gen"); @@ -1003,6 +1023,8 @@ struct StrangeCascTrack { void processDerivedMCGen(soa::Join const& genColls, DerMCGenCascades const& genCascs, DerMCRecCollisions const& recColls) { for (auto const& genColl : genColls) { + if (eventCuts.doINELMCGen && genColl.multMCNParticlesEta10() <= 0) + continue; // skip zero gen mult events histos.fill(HIST("MC/Gen/EvCounter"), 0.5); // generated events statistics double genMult = genColl.multMCNParticlesEta05(); histos.fill(HIST("MC/Gen/Mult"), genMult); @@ -1024,7 +1046,7 @@ struct StrangeCascTrack { if (isValidPDG(casc, "Omega")) histos.fill(HIST("MC/Gen/PrimaryOmega"), genMult, cascPt); // fill generated primary Xi within rapidity for corrections - if (isValidPDG(casc, "Xi") && std::abs(casc.rapidityMC(0)) < selCuts.cutRapidity) { + if (isValidPDG(casc, "Xi") && std::abs(casc.rapidityMC(0)) < cascCuts.cutRapidity) { histos.fill(HIST("MC/Gen/PrimaryXiRapidity"), genMult, cascPt); if (casc.pdgCode() == PDG_t::kXiMinus) histos.fill(HIST("MC/Gen/PrimaryXiMinusRapidity"), genMult, cascPt); @@ -1032,7 +1054,7 @@ struct StrangeCascTrack { histos.fill(HIST("MC/Gen/PrimaryXiPlusRapidity"), genMult, cascPt); } // fill generated primary Omega within rapidity for corrections - if (isValidPDG(casc, "Omega") && std::abs(casc.rapidityMC(2)) < selCuts.cutRapidity) { + if (isValidPDG(casc, "Omega") && std::abs(casc.rapidityMC(2)) < cascCuts.cutRapidity) { histos.fill(HIST("MC/Gen/PrimaryOmegaRapidity"), genMult, cascPt); if (casc.pdgCode() == PDG_t::kOmegaMinus) histos.fill(HIST("MC/Gen/PrimaryOmegaMinusRapidity"), genMult, cascPt); @@ -1078,8 +1100,9 @@ struct StrangeCascTrack { if (casc.isPhysicalPrimary()) { if (isValidPDG(casc, "Xi")) { histos.fill(HIST("MC/EvRec/PrimaryXi"), cascPt, bestCentrality); - if (std::abs(casc.rapidityMC(0)) < selCuts.cutRapidity) { + if (std::abs(casc.rapidityMC(0)) < cascCuts.cutRapidity) { histos.fill(HIST("MC/EvRec/PrimaryXiRapidity"), cascPt, bestCentrality); + histos.fill(HIST("MC/EvRec/RapCheck_TH3_Gen_Xi"), cascPt, bestCentrality, casc.rapidityMC(0)); if (casc.pdgCode() == PDG_t::kXiMinus) histos.fill(HIST("MC/EvRec/PrimaryXiMinusRapidity"), cascPt, bestCentrality); if (casc.pdgCode() == PDG_t::kXiPlusBar) @@ -1088,8 +1111,9 @@ struct StrangeCascTrack { } if (isValidPDG(casc, "Omega")) { histos.fill(HIST("MC/EvRec/PrimaryOmega"), cascPt, bestCentrality); - if (std::abs(casc.rapidityMC(2)) < selCuts.cutRapidity) { + if (std::abs(casc.rapidityMC(2)) < cascCuts.cutRapidity) { histos.fill(HIST("MC/EvRec/PrimaryOmegaRapidity"), cascPt, bestCentrality); + histos.fill(HIST("MC/EvRec/RapCheck_TH3_Gen_Omega"), cascPt, bestCentrality, casc.rapidityMC(2)); if (casc.pdgCode() == PDG_t::kOmegaMinus) histos.fill(HIST("MC/EvRec/PrimaryOmegaMinusRapidity"), cascPt, bestCentrality); if (casc.pdgCode() == PDG_t::kOmegaPlusBar) diff --git a/PWGMM/Lumi/Tasks/CMakeLists.txt b/PWGMM/Lumi/Tasks/CMakeLists.txt index 5bd93ae27d8..000f831a5c8 100644 --- a/PWGMM/Lumi/Tasks/CMakeLists.txt +++ b/PWGMM/Lumi/Tasks/CMakeLists.txt @@ -50,3 +50,8 @@ o2physics_add_dpl_workflow(lumi-stability-p-p SOURCES lumiStabilityPP.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCCDB O2Physics::AnalysisCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(lumi-zdc-qa + SOURCES lumiZdcQa.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCCDB O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx b/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx index c5609cbbd9a..629c2a7078d 100644 --- a/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx +++ b/PWGMM/Lumi/Tasks/LumiFDDFT0.cxx @@ -10,36 +10,33 @@ // or submit itself to any jurisdiction. // author: akhuntia@cern.ch -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/GeomConstants.h" -#include "CommonUtils/NameConf.h" -#include "DataFormatsCalibration/MeanVertexObject.h" -#include "DataFormatsFDD/Digit.h" -#include "DataFormatsFIT/Triggers.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "DetectorsVertexing/PVertexer.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 "ReconstructionDataFormats/PrimaryVertex.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 +#include +#include #include using namespace o2; diff --git a/PWGMM/Lumi/Tasks/fitLumi.cxx b/PWGMM/Lumi/Tasks/fitLumi.cxx index a62771cda66..4bcc73496c9 100644 --- a/PWGMM/Lumi/Tasks/fitLumi.cxx +++ b/PWGMM/Lumi/Tasks/fitLumi.cxx @@ -11,21 +11,25 @@ // author: arvind.khuntia@cern.ch -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/EventSelection.h" -#include "DataFormatsFDD/Digit.h" -#include "DataFormatsFIT/Triggers.h" -#include "Common/DataModel/FT0Corrected.h" - -#include "CCDB/CcdbApi.h" -#include "CommonDataFormat/BunchFilling.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "TH1F.h" -#include "TH2F.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include using namespace o2; using namespace o2::framework; @@ -111,7 +115,7 @@ struct VdMAO2D { registry.get(HIST("FT0/bcVertexCollBC"))->Fill(localBC); } } // vertex - } // ft0 + } // ft0 nTF++; } // process @@ -174,7 +178,7 @@ struct VdMAO2D { } } // vertex - } // fdd + } // fdd } PROCESS_SWITCH(VdMAO2D, processFDD, "Process FDD trigger rates for VdM", true); diff --git a/PWGMM/Lumi/Tasks/lumi.cxx b/PWGMM/Lumi/Tasks/lumi.cxx index cc0149dbde7..b1fcd5910d5 100644 --- a/PWGMM/Lumi/Tasks/lumi.cxx +++ b/PWGMM/Lumi/Tasks/lumi.cxx @@ -15,43 +15,30 @@ // o2-analysis-trackselection -b --isRun3 0 | o2-analysis-mm-lumi -b // --configuration json://./config.json -#include -#include -#include -#include - -#include "Common/Core/TrackSelection.h" #include "Common/Core/trackUtilities.h" -#include "Common/DataModel/EventSelection.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 "DetectorsVertexing/PVertexer.h" - -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/PrimaryVertex.h" -#include "ReconstructionDataFormats/Vertex.h" - -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" - -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" - -#include "CommonConstants/GeomConstants.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" - -#include "DataFormatsCalibration/MeanVertexObject.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include namespace o2::aod { diff --git a/PWGMM/Lumi/Tasks/lumiStability.cxx b/PWGMM/Lumi/Tasks/lumiStability.cxx index 976fd6d351a..ab1dca52f6e 100644 --- a/PWGMM/Lumi/Tasks/lumiStability.cxx +++ b/PWGMM/Lumi/Tasks/lumiStability.cxx @@ -16,22 +16,32 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonDataFormat/BunchFilling.h" -#include "DataFormatsFDD/Digit.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsFV0/Digit.h" -#include "DataFormatsParameters/GRPECSObject.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.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 diff --git a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx index 8ad19ef30a6..068801a64c5 100644 --- a/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx +++ b/PWGMM/Lumi/Tasks/lumiStabilityLightIons.cxx @@ -15,25 +15,39 @@ /// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt /// \author Stefanie Mrozinski (stefanie.mrozinski@cern.ch) - Goethe University Frankfurt +#include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/MetadataHelper.h" -#include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.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 using namespace o2; @@ -42,30 +56,9 @@ using namespace o2::framework::expressions; o2::common::core::MetadataHelper metadataInfo; -namespace o2::aod -{ -namespace myBc_aod -{ -DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t); -DECLARE_SOA_COLUMN(BCid, bcId, int); -DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); -DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); -DECLARE_SOA_COLUMN(AmplitudeZNA, amplitudeZNA, float); -DECLARE_SOA_COLUMN(AmplitudeZNC, amplitudeZNC, float); -} // namespace myBc_aod -DECLARE_SOA_TABLE(MyBCaod, "AOD", "MYBCAOD", - myBc_aod::Timestamp, - myBc_aod::BCid, - myBc_aod::TimeZNA, - myBc_aod::TimeZNC, - myBc_aod::AmplitudeZNA, - myBc_aod::AmplitudeZNC); -} // namespace o2::aod - using MyBCs = soa::Join; struct LumiStabilityLightIons { - Produces BCaod; Configurable cfgDoFT0Vtx{"cfgDoFT0Vtx", true, "Create and fill histograms for the FT0 vertex trigger"}; Configurable cfgDoFT0CE{"cfgDoFT0CE", true, "Create and fill histograms for the FT0 centrality trigger"}; @@ -85,20 +78,12 @@ struct LumiStabilityLightIons { Configurable cfgDoBCNSLFDD{"cfgDoBCNSLFDD", true, "Create and fill histograms for non-super-leading BCs w.r.t. FDD activity"}; Configurable cfgDoBCNSLFT0{"cfgDoBCNSLFT0", true, "Create and fill histograms for non-super-leading BCs w.r.t. FT0 activity"}; - Configurable cfgRequireZDCTriggerForZDCQA{"cfgRequireZDCTriggerForZDCQA", true, "Require ZDC trigger (1ZNC) for filling QA histograms"}; - Configurable cfgRequireTVXTriggerForZDCQA{"cfgRequireTVXTriggerForZDCQA", true, "Require FT0 vertex trigger (MTVX) for filling ZDC QA histograms"}; - Configurable cfgRequireZEDTriggerForZDCQA{"cfgRequireZEDTriggerForZDCQA", true, "Require ZED trigger (1ZNC||1ZNA) for filling QA histograms"}; - Configurable cfgRequireNoT0ForSLBC{"cfgRequireNoT0ForSLBC", false, "Require no T0 signal for definition of super leading BC (otherwise only no FDD)"}; Configurable cfgEmptyBCsBeforeLeadingBC{"cfgEmptyBCsBeforeLeadingBC", 5, "Minimum number of non-B BCs before a BCL leading BC"}; Configurable cfgEmptyBCsBeforeLeadingBCLE{"cfgEmptyBCsBeforeLeadingBCLE", 5, "Minimum number of strictly empty (E-type) BCs before a BCLE leading BC"}; Configurable cfgBCsBeforeSuperLeading{"cfgBCsBeforeSuperLeading", 5, "Minimum number of BCs without FDD/FT0 activity before a super-leading BC"}; - Configurable cfgFillBCao2d{"cfgFillBCao2d", false, "Fill BC ao2d with timestamps and ZDC times"}; - Configurable cfgTstampStartFillingBCao2d{"cfgTstampStartFillingBCao2d", 0, "Minimum value of timestamp for output bc ao2d to be filled"}; - Configurable cfgTstampEndFillingBCao2d{"cfgTstampEndFillingBCao2d", 0, "Maximum value of timestamp for output bc ao2d to be filled"}; - Configurable cfgBcShiftFDDForData2023{"cfgBcShiftFDDForData2023", 7, "Number of BCs to shift FDD, applied for 2023 data only"}; std::bitset beamPatternA, beamPatternC; @@ -142,7 +127,7 @@ struct LumiStabilityLightIons { kBCNSLFT0 = 11 }; - static constexpr std::string_view NBCsVsTimeHistNames[6][12] = { + static constexpr std::string_view NBCsVsTimeHistNames[5][12] = { {"AllBCs/BC_A/nBCsVsTime", "AllBCs/BC_B/nBCsVsTime", "AllBCs/BC_C/nBCsVsTime", "AllBCs/BC_E/nBCsVsTime", "AllBCs/BC_L/nBCsVsTime", "AllBCs/BC_LE/nBCsVsTime", "AllBCs/BC_NL/nBCsVsTime", "AllBCs/BC_NLE/nBCsVsTime", "AllBCs/BC_SL_FDD/nBCsVsTime", "AllBCs/BC_SL_FT0/nBCsVsTime", "AllBCs/BC_NSL_FDD/nBCsVsTime", "AllBCs/BC_NSL_FT0/nBCsVsTime"}, {"FT0VTx/BC_A/nBCsVsTime", "FT0VTx/BC_B/nBCsVsTime", "FT0VTx/BC_C/nBCsVsTime", "FT0VTx/BC_E/nBCsVsTime", "FT0VTx/BC_L/nBCsVsTime", "FT0VTx/BC_LE/nBCsVsTime", "FT0VTx/BC_NL/nBCsVsTime", "FT0VTx/BC_NLE/nBCsVsTime", "FT0VTx/BC_SL_FDD/nBCsVsTime", "FT0VTx/BC_SL_FT0/nBCsVsTime", "FT0VTx/BC_NSL_FDD/nBCsVsTime", "FT0VTx/BC_NSL_FT0/nBCsVsTime"}, {"FT0CE/BC_A/nBCsVsTime", "FT0CE/BC_B/nBCsVsTime", "FT0CE/BC_C/nBCsVsTime", "FT0CE/BC_E/nBCsVsTime", "FT0CE/BC_L/nBCsVsTime", "FT0CE/BC_LE/nBCsVsTime", "FT0CE/BC_NL/nBCsVsTime", "FT0CE/BC_NLE/nBCsVsTime", "FT0CE/BC_SL_FDD/nBCsVsTime", "FT0CE/BC_SL_FT0/nBCsVsTime", "FT0CE/BC_NSL_FDD/nBCsVsTime", "FT0CE/BC_NSL_FT0/nBCsVsTime"}, @@ -206,10 +191,7 @@ struct LumiStabilityLightIons { (iBCCategory == kBCNSLFDD && cfgDoBCNSLFDD) || (iBCCategory == kBCNSLFT0 && cfgDoBCNSLFT0)) { mHistManager.add(Form("%s", std::string(NBCsVsTimeHistNames[iTrigger][iBCCategory]).c_str()), "Time of triggered BCs since the start of fill;#bf{t-t_{SOF} (min)};#bf{#it{N}_{BC}}", HistType::kTH1D, {timeAxis}); mHistManager.add(Form("%s", std::string(NBCsVsBCIDHistNames[iTrigger][iBCCategory]).c_str()), "BC ID of triggered BCs;#bf{BC ID in orbit};#bf{#it{N}_{BC}}", HistType::kTH1D, {bcIDAxis}); - mInspectedHistos[iTrigger][iBCCategory] = mHistManager.add( - Form("%s", std::string(NBCsInspectedVsBCIDHistNames[iTrigger][iBCCategory]).c_str()), - "Inspected BC ID (denominator for mu);#bf{BC ID in orbit};#bf{#it{N}_{BC}}", - HistType::kTH1D, {bcIDAxis}); + mInspectedHistos[iTrigger][iBCCategory] = mHistManager.add(Form("%s", std::string(NBCsInspectedVsBCIDHistNames[iTrigger][iBCCategory]).c_str()), "Inspected BC ID (denominator for mu);#bf{BC ID in orbit};#bf{#it{N}_{BC}}", HistType::kTH1D, {bcIDAxis}); } } } @@ -232,19 +214,6 @@ struct LumiStabilityLightIons { mHistManager.add("FT0Vtx_EvSel/nBCsVsTime", "Time of TVX triggered BCs since the start of fill;;#bf{#it{N}_{BC}}", HistType::kTH1D, {timeAxis}); mHistManager.add("nBCsVsBCID", "Time of TVX triggered BCs since the start of fill;#bf{t-t_{SOF} (min)};#bf{#it{N}_{BC}}", HistType::kTH1D, {bcIDAxis}); mHistManager.add("TFsPerMinute", "TFs seen in this minute (to account for failed jobs);#bf{t-t_{SOF} (min)};#bf{#it{N}_{TFs}}", HistType::kTH1D, {timeAxis}); - - if (cfgDo1ZNC) { - AxisSpec zdcTimeAxis{200, -50., 50.}; - mHistManager.add("ZDCQA/BCHasZDC", "Does the BC have ZDC?;BC has ZDC;Has ZNC according to CTP;#bf{#it{N}_{BC}}", HistType::kTH2D, {{2, -0.5, 1.5}, {2, -0.5, 1.5}}); - mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetYaxis()->SetBinLabel(1, "No CTP trigger"); - mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetYaxis()->SetBinLabel(2, "CTP triggered"); - mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetXaxis()->SetBinLabel(1, "No found ZDC"); - mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetXaxis()->SetBinLabel(2, "Good ZDC"); - mHistManager.add("ZDCQA/ZNCTimeVsEnergy", "ZDC properties in BCs with found ZDC;Energy;#bf{ZNC arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH2D, {{1501, -10, 1.5E4}, zdcTimeAxis}); - mHistManager.add("ZDCQA/ZDCTimes", "Correlation between ZNA and ZNC timing;#bf{ZNC arrival time (ns)};#bf{ZNA arrival time (ns)}", HistType::kTH2D, {zdcTimeAxis, zdcTimeAxis}); - mHistManager.add("ZDCQA/ZNATime", "Time of the ZNA signal;#bf{ZNA arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH1D, {zdcTimeAxis}); - mHistManager.add("ZDCQA/ZNCTime", "Time of the ZNC signal;#bf{ZNC arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH1D, {zdcTimeAxis}); - } } void setLHCIFData(const auto& bc) @@ -417,64 +386,6 @@ struct LumiStabilityLightIons { } } - void processZDCQA(MyBCs const& bcs, aod::Zdcs const&) - { - const int maxTimeZDC = 50; - const float dummyZDCTime = 42.f; - - for (const auto& bc : bcs) { - std::bitset<64> ctpInputMask(bc.inputMask()); - - if (cfgRequireTVXTriggerForZDCQA && !(ctpInputMask.test(2))) { - continue; - } - if (cfgRequireZDCTriggerForZDCQA && !(ctpInputMask.test(25))) { - continue; - } - if (cfgRequireZEDTriggerForZDCQA && !(ctpInputMask.test(24))) { - continue; - } - - bool zdcHit = !bc.has_zdc() ? 0 : ((bc.zdc().energyCommonZNC() > -1 && std::abs(bc.zdc().timeZNC()) < 1E5) ? 1 : 0); - mHistManager.fill(HIST("ZDCQA/BCHasZDC"), zdcHit, ctpInputMask.test(25) ? 1 : 0); - - if (!bc.has_zdc()) { - continue; - } - - mHistManager.fill(HIST("ZDCQA/ZNCTimeVsEnergy"), - bc.zdc().energyCommonZNC() > -1 ? bc.zdc().energyCommonZNC() : -1, - std::abs(bc.zdc().timeZNC()) < maxTimeZDC ? bc.zdc().timeZNC() : dummyZDCTime); - - float timeZNA = bc.zdc().timeZNA(); - float timeZNC = bc.zdc().timeZNC(); - - if (std::abs(timeZNA) > maxTimeZDC) { - timeZNA = dummyZDCTime; - mHistManager.fill(HIST("ZDCQA/ZNCTime"), timeZNC); - } - if (std::abs(timeZNC) > maxTimeZDC) { - timeZNC = dummyZDCTime; - if (timeZNA != dummyZDCTime) { - mHistManager.fill(HIST("ZDCQA/ZNATime"), timeZNA); - } - } - - mHistManager.fill(HIST("ZDCQA/ZDCTimes"), timeZNA, timeZNC); - - uint64_t timestamp = bc.timestamp(); - int64_t globalBC = bc.globalBC(); - int localBC = globalBC % nBCsPerOrbit; - float amplitudeZNA = bc.zdc().amplitudeZNA(); - float amplitudeZNC = bc.zdc().amplitudeZNC(); - - if (cfgFillBCao2d && timestamp >= cfgTstampStartFillingBCao2d && timestamp <= cfgTstampEndFillingBCao2d) { - BCaod(timestamp, localBC, timeZNA, timeZNC, amplitudeZNA, amplitudeZNC); - } - } - } - PROCESS_SWITCH(LumiStabilityLightIons, processZDCQA, "process QA for the ZDC triggers (light ions and PbPb)", false); - void process(MyBCs const& bcs, aod::FT0s const&, aod::FDDs const&) { DenomCounter nBCsPerBcId(nBCsPerOrbit); @@ -485,17 +396,15 @@ struct LumiStabilityLightIons { } for (const auto& bc : bcs) { - if (bc.timestamp() == 0) { + if (bc.timestamp() == 0) continue; - } setLHCIFData(bc); float timeSinceSOF = getTimeSinceSOF(bc); - if (bc.selection_bit(aod::evsel::kIsTriggerTVX)) { + if (bc.selection_bit(aod::evsel::kIsTriggerTVX)) mHistManager.fill(HIST("FT0Vtx_EvSel/nBCsVsTime"), timeSinceSOF); - } int64_t globalBC = bc.globalBC(); int localBC = static_cast(globalBC % nBCsPerOrbit); @@ -527,9 +436,8 @@ struct LumiStabilityLightIons { int64_t globalBCStart = (globalBCLastInspectedBC >= 0 && globalBCLastInspectedBC < globalBC) ? globalBCLastInspectedBC + 1 : globalBC; const int64_t maxBcGap = 2LL * nBCsPerOrbit; - if (globalBC - globalBCStart > maxBcGap) { + if (globalBC - globalBCStart > maxBcGap) globalBCStart = globalBC; - } for (int64_t iGBC = globalBCStart; iGBC <= globalBC; ++iGBC) { const int iLBC = static_cast((iGBC % nBCsPerOrbit + nBCsPerOrbit) % nBCsPerOrbit); @@ -564,12 +472,10 @@ struct LumiStabilityLightIons { } } - if (anyFDDTrigger) { + if (anyFDDTrigger) globalBCIdOfLastBCWithActivityFDD = globalBCFDD; - } - if (anyFT0Trigger) { + if (anyFT0Trigger) globalBCIdOfLastBCWithActivityFT0 = globalBC; - } globalBCLastInspectedBC = globalBC; diff --git a/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx b/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx index 2962148c4dc..bf0cae99e81 100644 --- a/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx +++ b/PWGMM/Lumi/Tasks/lumiStabilityPP.cxx @@ -17,25 +17,33 @@ #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/MetadataHelper.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/FT0Corrected.h" - -#include "CCDB/BasicCCDBManager.h" -#include "DataFormatsFT0/Digit.h" -#include "DataFormatsParameters/AggregatedRunInfo.h" -#include "DataFormatsParameters/GRPLHCIFData.h" -#include "Framework/ASoA.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 o2::common::core::MetadataHelper metadataInfo; // Metadata helper @@ -213,7 +221,7 @@ struct LumiStabilityPP { std::array totalLeadingBCs = {0, 0}; for (int iBC = 0; iBC < o2::constants::lhc::LHCMaxBunches; iBC++) { - if (bcPatternB[iBC]) { // Check if current BC is of type B + if (bcPatternB[iBC]) { // Check if current BC is of type B int nonBtypeBCsBefore{0}, emptyBCsBefore{0}; // Count how many consecutive BCs before this one are non-B for (int j = 1; j <= numEmptyBCsBeforeLeadingBC->get(0u, 0u); j++) { int prevBC = (iBC - j + o2::constants::lhc::LHCMaxBunches) % o2::constants::lhc::LHCMaxBunches; // Protection for BCs at small indices to check the end of the orbit diff --git a/PWGMM/Lumi/Tasks/lumiZdcQa.cxx b/PWGMM/Lumi/Tasks/lumiZdcQa.cxx new file mode 100644 index 00000000000..80f2012a164 --- /dev/null +++ b/PWGMM/Lumi/Tasks/lumiZdcQa.cxx @@ -0,0 +1,165 @@ +// 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 lumiStabilityLightIons.cxx +/// \brief Analysis over BCs to study the luminosity stability along time +/// +/// \author Nicolas Strangmann (nicolas.strangmann@cern.ch) - Goethe University Frankfurt +/// \author Stefanie Mrozinski (stefanie.mrozinski@cern.ch) - Goethe University Frankfurt +/// \author Lorenzo Mattei (lorenzo.mattei@cern.ch) - Turin University + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/Core/MetadataHelper.h" +#include "Common/DataModel/EventSelection.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; + +o2::common::core::MetadataHelper metadataInfo; + +namespace o2::aod +{ +namespace myBc_aod +{ +DECLARE_SOA_COLUMN(Timestamp, timestamp, uint64_t); +DECLARE_SOA_COLUMN(BCid, bcId, int); +DECLARE_SOA_COLUMN(TimeZNA, timeZNA, float); +DECLARE_SOA_COLUMN(TimeZNC, timeZNC, float); +DECLARE_SOA_COLUMN(AmplitudeZNA, amplitudeZNA, float); +DECLARE_SOA_COLUMN(AmplitudeZNC, amplitudeZNC, float); +} // namespace myBc_aod +DECLARE_SOA_TABLE(MyBCaod, "AOD", "MYBCAOD", + myBc_aod::Timestamp, + myBc_aod::BCid, + myBc_aod::TimeZNA, + myBc_aod::TimeZNC, + myBc_aod::AmplitudeZNA, + myBc_aod::AmplitudeZNC); +} // namespace o2::aod + +using MyBCs = soa::Join; + +struct LumiZdcQa { + Produces BCaod; + + Configurable cfgRequireZDCTriggerForZDCQA{"cfgRequireZDCTriggerForZDCQA", true, "Require ZDC trigger (1ZNC) for filling QA histograms"}; + Configurable cfgRequireTVXTriggerForZDCQA{"cfgRequireTVXTriggerForZDCQA", true, "Require FT0 vertex trigger (MTVX) for filling ZDC QA histograms"}; + Configurable cfgRequireZEDTriggerForZDCQA{"cfgRequireZEDTriggerForZDCQA", true, "Require ZED trigger (1ZNC||1ZNA) for filling QA histograms"}; + + Configurable cfgFillBCao2d{"cfgFillBCao2d", false, "Fill BC ao2d with timestamps and ZDC times"}; + Configurable cfgTstampStartFillingBCao2d{"cfgTstampStartFillingBCao2d", 0, "Minimum value of timestamp for output bc ao2d to be filled"}; + Configurable cfgTstampEndFillingBCao2d{"cfgTstampEndFillingBCao2d", 0, "Maximum value of timestamp for output bc ao2d to be filled"}; + + const int nBCsPerOrbit = 3564; + + HistogramRegistry mHistManager{"output", {}, OutputObjHandlingPolicy::AnalysisObject, false, false}; + + void init(InitContext&) + { + AxisSpec zdcTimeAxis{200, -50., 50.}; + mHistManager.add("ZDCQA/BCHasZDC", "Does the BC have ZDC?;BC has ZDC;Has ZNC according to CTP;#bf{#it{N}_{BC}}", HistType::kTH2D, {{2, -0.5, 1.5}, {2, -0.5, 1.5}}); + mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetYaxis()->SetBinLabel(1, "No CTP trigger"); + mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetYaxis()->SetBinLabel(2, "CTP triggered"); + mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetXaxis()->SetBinLabel(1, "No found ZDC"); + mHistManager.get(HIST("ZDCQA/BCHasZDC")).get()->GetXaxis()->SetBinLabel(2, "Good ZDC"); + mHistManager.add("ZDCQA/ZNCTimeVsEnergy", "ZDC properties in BCs with found ZDC;Energy;#bf{ZNC arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH2D, {{1501, -10, 1.5E4}, zdcTimeAxis}); + mHistManager.add("ZDCQA/ZDCTimes", "Correlation between ZNA and ZNC timing;#bf{ZNC arrival time (ns)};#bf{ZNA arrival time (ns)}", HistType::kTH2D, {zdcTimeAxis, zdcTimeAxis}); + mHistManager.add("ZDCQA/ZNATime", "Time of the ZNA signal;#bf{ZNA arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH1D, {zdcTimeAxis}); + mHistManager.add("ZDCQA/ZNCTime", "Time of the ZNC signal;#bf{ZNC arrival time (ns)};#bf{#it{N}_{BC}}", HistType::kTH1D, {zdcTimeAxis}); + } + + void process(MyBCs const& bcs, aod::Zdcs const&) + { + const int maxTimeZDC = 50; + const float dummyZDCTime = 42.f; + + for (const auto& bc : bcs) { + std::bitset<64> ctpInputMask(bc.inputMask()); + + if (cfgRequireTVXTriggerForZDCQA && !(ctpInputMask.test(2))) { + continue; + } + if (cfgRequireZDCTriggerForZDCQA && !(ctpInputMask.test(25))) { + continue; + } + if (cfgRequireZEDTriggerForZDCQA && !(ctpInputMask.test(24))) { + continue; + } + + bool zdcHit = !bc.has_zdc() ? 0 : ((bc.zdc().energyCommonZNC() > -1 && std::abs(bc.zdc().timeZNC()) < 1E5) ? 1 : 0); + mHistManager.fill(HIST("ZDCQA/BCHasZDC"), zdcHit, ctpInputMask.test(25) ? 1 : 0); + + if (!bc.has_zdc()) { + continue; + } + + mHistManager.fill(HIST("ZDCQA/ZNCTimeVsEnergy"), + bc.zdc().energyCommonZNC() > -1 ? bc.zdc().energyCommonZNC() : -1, + std::abs(bc.zdc().timeZNC()) < maxTimeZDC ? bc.zdc().timeZNC() : dummyZDCTime); + + float timeZNA = bc.zdc().timeZNA(); + float timeZNC = bc.zdc().timeZNC(); + + if (std::abs(timeZNA) > maxTimeZDC) { + timeZNA = dummyZDCTime; + mHistManager.fill(HIST("ZDCQA/ZNCTime"), timeZNC); + } + if (std::abs(timeZNC) > maxTimeZDC) { + timeZNC = dummyZDCTime; + if (timeZNA != dummyZDCTime) { + mHistManager.fill(HIST("ZDCQA/ZNATime"), timeZNA); + } + } + + mHistManager.fill(HIST("ZDCQA/ZDCTimes"), timeZNA, timeZNC); + + uint64_t timestamp = bc.timestamp(); + int64_t globalBC = bc.globalBC(); + int localBC = globalBC % nBCsPerOrbit; + float amplitudeZNA = bc.zdc().amplitudeZNA(); + float amplitudeZNC = bc.zdc().amplitudeZNC(); + + if (cfgFillBCao2d && timestamp >= cfgTstampStartFillingBCao2d && timestamp <= cfgTstampEndFillingBCao2d) { + BCaod(timestamp, localBC, timeZNA, timeZNC, amplitudeZNA, amplitudeZNC); + } + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + metadataInfo.initMetadata(cfgc); + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} diff --git a/PWGMM/Lumi/macros/merger.C b/PWGMM/Lumi/macros/merger.C index f3759a277ef..1ad2cd5f920 100644 --- a/PWGMM/Lumi/macros/merger.C +++ b/PWGMM/Lumi/macros/merger.C @@ -13,6 +13,15 @@ // merge all trees into one tree to construct event by event log-likelihood // function. +#include +#include +#include +#include +#include +#include + +#include + void merger() { TFile* fin = new TFile("../data/PbPb_NF/AnalysisResults_trees.root", "read"); diff --git a/PWGMM/Lumi/macros/non_fac.C b/PWGMM/Lumi/macros/non_fac.C index 34022f82f8b..ea858e409f0 100644 --- a/PWGMM/Lumi/macros/non_fac.C +++ b/PWGMM/Lumi/macros/non_fac.C @@ -12,6 +12,21 @@ /// \since November 2021 // code for fitting the luminous region for each step +#include +#include +#include +#include +#include // IWYU pragma: keep (do not replace with TMatrixDfwd.h) +#include +#include +#include +#include + +#include + +#include +#include + TFile* fin = new TFile("mergedOutput.root", "read"); TTree* tin; @@ -193,7 +208,7 @@ void non_fac() FunMinuit[i]->mnexcm("MIGRAD", arglist, 2, ierflg); for (int p = 0; p < 10; p++) { FunMinuit[i]->GetParameter(p, FitRes_cntl[i][p], FitRes_stat[i][p]); - cout << FitRes_cntl[i][p] << ", " << FitRes_stat[i][p] << endl; + std::cout << FitRes_cntl[i][p] << ", " << FitRes_stat[i][p] << std::endl; } hResults[i] = new TH1D(Form("hResults%d", i), "", 12, 0, 12); for (int p = 0; p < 10; p++) { diff --git a/PWGMM/Mult/Core/include/Axes.h b/PWGMM/Mult/Core/include/Axes.h index c215a8ba357..9528e5a84ac 100644 --- a/PWGMM/Mult/Core/include/Axes.h +++ b/PWGMM/Mult/Core/include/Axes.h @@ -11,35 +11,39 @@ #ifndef PWGMM_MULT_CORE_INCLUDE_AXES_H_ #define PWGMM_MULT_CORE_INCLUDE_AXES_H_ -#include "Framework/HistogramSpec.h" -#include "CommonConstants/MathConstants.h" + +#include +#include + +#include +#include +#include namespace pwgmm::mult { -using namespace o2::framework; static constexpr std::string_view ptAxisName = "p_{T} (GeV/c)"; // common axis definitions -AxisSpec ZAxis = {301, -30.1, 30.1, "Z_{vtx} (cm)"}; // Z vertex in cm -AxisSpec DeltaZAxis = {61, -6.1, 6.1, "#Delta Z (cm)"}; // Z vertex difference in cm -AxisSpec DCAAxis = {601, -3.01, 3.01}; // DCA in cm -AxisSpec EtaAxis = {22, -2.2, 2.2, "#eta"}; // Eta +o2::framework::AxisSpec ZAxis = {301, -30.1, 30.1, "Z_{vtx} (cm)"}; // Z vertex in cm +o2::framework::AxisSpec DeltaZAxis = {61, -6.1, 6.1, "#Delta Z (cm)"}; // Z vertex difference in cm +o2::framework::AxisSpec DCAAxis = {601, -3.01, 3.01}; // DCA in cm +o2::framework::AxisSpec EtaAxis = {22, -2.2, 2.2, "#eta"}; // Eta -AxisSpec PhiAxis = {629, 0, o2::constants::math::TwoPI, "#phi"}; // Phi (azimuthal angle) -AxisSpec PtAxis = {2401, -0.005, 24.005, ptAxisName.data()}; // Large fine-binned Pt +o2::framework::AxisSpec PhiAxis = {629, 0, o2::constants::math::TwoPI, "#phi"}; // Phi (azimuthal angle) +o2::framework::AxisSpec PtAxis = {2401, -0.005, 24.005, ptAxisName.data()}; // Large fine-binned Pt // Large wide-binned Pt (for efficiency) -AxisSpec PtAxisEff = {{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.2, 2.4, 2.6, 2.8, 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}, - ptAxisName.data()}; -AxisSpec PtAxis_wide = {1041, -0.05, 104.05, ptAxisName.data()}; // Smaller wider-binned Pt -AxisSpec FT0CAxis = {1001, -0.5, 1000.5, "FT0C amplitude (arb. units)"}; // FT0C amplitudes -AxisSpec FT0AAxis = {3001, -0.5, 3000.5, "FT0A amplitude (arb. units)"}; // FT0A amplitudes -AxisSpec FDAAxis = {3001, -0.5, 3000.5, "FDA amplitude (arb. units)"}; // FDD amplitudes -AxisSpec FDCAxis = {3001, -0.5, 3000.5, "FDC amplitude (arb. units)"}; // FDD amplitudes -AxisSpec RapidityAxis = {102, -10.2, 10.2, "Y"}; // Rapidity -AxisSpec ScaleAxis = {121, -0.5, 120.5, "Event scale (GeV)"}; // Event scale -AxisSpec MPIAxis = {51, -0.5, 50.5, "N_{MPI}"}; // N_{MPI} -AxisSpec ProcAxis = {21, 89.5, 110.5}; // Process flag -AxisSpec SpeciesAxis = {5, 0.5, 5.5}; // Particle species +o2::framework::AxisSpec PtAxisEff = {{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.2, 2.4, 2.6, 2.8, 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}, + ptAxisName.data()}; +o2::framework::AxisSpec PtAxis_wide = {1041, -0.05, 104.05, ptAxisName.data()}; // Smaller wider-binned Pt +o2::framework::AxisSpec FT0CAxis = {1001, -0.5, 1000.5, "FT0C amplitude (arb. units)"}; // FT0C amplitudes +o2::framework::AxisSpec FT0AAxis = {3001, -0.5, 3000.5, "FT0A amplitude (arb. units)"}; // FT0A amplitudes +o2::framework::AxisSpec FDAAxis = {3001, -0.5, 3000.5, "FDA amplitude (arb. units)"}; // FDD amplitudes +o2::framework::AxisSpec FDCAxis = {3001, -0.5, 3000.5, "FDC amplitude (arb. units)"}; // FDD amplitudes +o2::framework::AxisSpec RapidityAxis = {102, -10.2, 10.2, "Y"}; // Rapidity +o2::framework::AxisSpec ScaleAxis = {121, -0.5, 120.5, "Event scale (GeV)"}; // Event scale +o2::framework::AxisSpec MPIAxis = {51, -0.5, 50.5, "N_{MPI}"}; // N_{MPI} +o2::framework::AxisSpec ProcAxis = {21, 89.5, 110.5}; // Process flag +o2::framework::AxisSpec SpeciesAxis = {5, 0.5, 5.5}; // Particle species // event selection/efficiency binning enum struct EvSelBins : int { @@ -78,4 +82,5 @@ std::array(EvEffBins::kSelectedPVgt0) + 1> "Selected INEL>0", "Selected INEL>0 (PV)"}; } // namespace pwgmm::mult + #endif // PWGMM_MULT_CORE_INCLUDE_AXES_H_ diff --git a/PWGMM/Mult/Core/include/Histograms.h b/PWGMM/Mult/Core/include/Histograms.h index 2b41c9ecefe..17828d1edcb 100644 --- a/PWGMM/Mult/Core/include/Histograms.h +++ b/PWGMM/Mult/Core/include/Histograms.h @@ -11,7 +11,8 @@ #ifndef PWGMM_MULT_CORE_INCLUDE_HISTOGRAMS_H_ #define PWGMM_MULT_CORE_INCLUDE_HISTOGRAMS_H_ -#include "TPDGCode.h" +#include + #include #include diff --git a/PWGMM/Mult/Core/include/Selections.h b/PWGMM/Mult/Core/include/Selections.h index 2532da6ccce..8240410c462 100644 --- a/PWGMM/Mult/Core/include/Selections.h +++ b/PWGMM/Mult/Core/include/Selections.h @@ -11,30 +11,30 @@ #ifndef PWGMM_MULT_CORE_INCLUDE_SELECTIONS_H_ #define PWGMM_MULT_CORE_INCLUDE_SELECTIONS_H_ + #include "Common/DataModel/TrackSelectionTables.h" namespace pwgmm::mult { -using namespace o2::aod::track; // default quality criteria for tracks with ITS contribution -static constexpr TrackSelectionFlags::flagtype trackSelectionITS = - TrackSelectionFlags::kITSNCls | TrackSelectionFlags::kITSChi2NDF | - TrackSelectionFlags::kITSHits; +static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionITS = + o2::aod::track::TrackSelectionFlags::kITSNCls | o2::aod::track::TrackSelectionFlags::kITSChi2NDF | + o2::aod::track::TrackSelectionFlags::kITSHits; // default quality criteria for tracks with TPC contribution -static constexpr TrackSelectionFlags::flagtype trackSelectionTPC = - TrackSelectionFlags::kTPCNCls | - TrackSelectionFlags::kTPCCrossedRowsOverNCls | - TrackSelectionFlags::kTPCChi2NDF; +static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionTPC = + o2::aod::track::TrackSelectionFlags::kTPCNCls | + o2::aod::track::TrackSelectionFlags::kTPCCrossedRowsOverNCls | + o2::aod::track::TrackSelectionFlags::kTPCChi2NDF; // default standard DCA cuts -static constexpr TrackSelectionFlags::flagtype trackSelectionDCA = - TrackSelectionFlags::kDCAz | TrackSelectionFlags::kDCAxy; +static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionDCA = + o2::aod::track::TrackSelectionFlags::kDCAz | o2::aod::track::TrackSelectionFlags::kDCAxy; // default standard transversal-only DCA cuts -static constexpr TrackSelectionFlags::flagtype trackSelectionDCAXYonly = - TrackSelectionFlags::kDCAxy; +static constexpr o2::aod::track::TrackSelectionFlags::flagtype trackSelectionDCAXYonly = + o2::aod::track::TrackSelectionFlags::kDCAxy; } // namespace pwgmm::mult #endif // PWGMM_MULT_CORE_INCLUDE_SELECTIONS_H_ diff --git a/PWGMM/Mult/DataModel/Gencentralities.h b/PWGMM/Mult/DataModel/Gencentralities.h index 112072fa2c8..fb7de9da0e8 100644 --- a/PWGMM/Mult/DataModel/Gencentralities.h +++ b/PWGMM/Mult/DataModel/Gencentralities.h @@ -12,7 +12,7 @@ #ifndef PWGMM_MULT_DATAMODEL_GENCENTRALITIES_H_ #define PWGMM_MULT_DATAMODEL_GENCENTRALITIES_H_ -#include "Framework/AnalysisDataModel.h" +#include namespace o2::aod { namespace gencents diff --git a/PWGMM/Mult/DataModel/Index.h b/PWGMM/Mult/DataModel/Index.h index b3c71f534a2..ba4c29ef606 100644 --- a/PWGMM/Mult/DataModel/Index.h +++ b/PWGMM/Mult/DataModel/Index.h @@ -9,10 +9,11 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#ifndef O2_ANALYSIS_INDEX_H_ -#define O2_ANALYSIS_INDEX_H_ +#ifndef PWGMM_MULT_DATAMODEL_INDEX_H_ +#define PWGMM_MULT_DATAMODEL_INDEX_H_ + +#include -#include "Framework/AnalysisDataModel.h" namespace o2::aod { namespace idx @@ -23,4 +24,5 @@ DECLARE_SOA_ARRAY_INDEX_COLUMN(MFTTrack, mfttracks); DECLARE_SOA_TABLE(ParticlesToTracks, "AOD", "P2T", idx::TrackIds); DECLARE_SOA_TABLE(ParticlesToMftTracks, "AOD", "P2MFTT", idx::MFTTrackIds); } // namespace o2::aod -#endif // O2_ANALYSIS_INDEX_H_ + +#endif // PWGMM_MULT_DATAMODEL_INDEX_H_ diff --git a/PWGMM/Mult/DataModel/ReducedTables.h b/PWGMM/Mult/DataModel/ReducedTables.h index fbdd68b89db..60eb29ac659 100644 --- a/PWGMM/Mult/DataModel/ReducedTables.h +++ b/PWGMM/Mult/DataModel/ReducedTables.h @@ -11,13 +11,14 @@ #ifndef PWGMM_MULT_DATAMODEL_REDUCEDTABLES_H_ #define PWGMM_MULT_DATAMODEL_REDUCEDTABLES_H_ -#include - -#include "Framework/AnalysisDataModel.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" +#include + +#include + namespace o2::aod { diff --git a/PWGMM/Mult/DataModel/bestCollisionTable.h b/PWGMM/Mult/DataModel/bestCollisionTable.h index 0b4ee5440bc..27b524b5b89 100644 --- a/PWGMM/Mult/DataModel/bestCollisionTable.h +++ b/PWGMM/Mult/DataModel/bestCollisionTable.h @@ -19,7 +19,9 @@ #ifndef PWGMM_MULT_DATAMODEL_BESTCOLLISIONTABLE_H_ #define PWGMM_MULT_DATAMODEL_BESTCOLLISIONTABLE_H_ -#include "Framework/AnalysisDataModel.h" +#include + +#include namespace o2::aod { diff --git a/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx b/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx index dc958a3cd02..af3a895eec3 100644 --- a/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx +++ b/PWGMM/Mult/TableProducer/ambiguousTrackPropagation.cxx @@ -25,20 +25,32 @@ #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/GeomConstants.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 "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/MatrixFunctions.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/PWGMM/Mult/TableProducer/particles2tracks.cxx b/PWGMM/Mult/TableProducer/particles2tracks.cxx index 6b7e7db6a17..662bd34dd69 100644 --- a/PWGMM/Mult/TableProducer/particles2tracks.cxx +++ b/PWGMM/Mult/TableProducer/particles2tracks.cxx @@ -16,12 +16,17 @@ /// \brief A task to create a reverse index from McParticles to Tracks /// -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" - #include "Index.h" +#include +#include +#include +#include +#include +#include + +#include + using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/percentiles.cxx b/PWGMM/Mult/TableProducer/percentiles.cxx index c11fca858f8..d34802ab2ae 100644 --- a/PWGMM/Mult/TableProducer/percentiles.cxx +++ b/PWGMM/Mult/TableProducer/percentiles.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 "Gencentralities.h" #include "Selections.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include #include +#include #include #include -#include -#include "Common/DataModel/Centrality.h" -#include +#include +#include +#include +#include #include -#include #include -#include "Gencentralities.h" +#include + +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/reducer.cxx b/PWGMM/Mult/TableProducer/reducer.cxx index de9d516703b..6d290692e55 100644 --- a/PWGMM/Mult/TableProducer/reducer.cxx +++ b/PWGMM/Mult/TableProducer/reducer.cxx @@ -9,14 +9,34 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" - -#include "Selections.h" #include "ReducedTables.h" +#include "Selections.h" -#include "Framework/runDataProcessing.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/EventSelection.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 using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/TableProducer/reducerPostprocess.cxx b/PWGMM/Mult/TableProducer/reducerPostprocess.cxx index d05f5534eb0..29bfecf43e4 100644 --- a/PWGMM/Mult/TableProducer/reducerPostprocess.cxx +++ b/PWGMM/Mult/TableProducer/reducerPostprocess.cxx @@ -9,11 +9,14 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/AnalysisTask.h" - #include "ReducedTables.h" -#include "Framework/runDataProcessing.h" +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/assessment-mft.cxx b/PWGMM/Mult/Tasks/assessment-mft.cxx index 70304229e1e..735e95e9a6c 100644 --- a/PWGMM/Mult/Tasks/assessment-mft.cxx +++ b/PWGMM/Mult/Tasks/assessment-mft.cxx @@ -15,11 +15,15 @@ // \brief This code loops over MFT tracks and fills basic histograms // close to the QC ones -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" +#include +#include +#include +#include +#include +#include +#include -#include "MathUtils/Utils.h" -#include "CommonConstants/LHCConstants.h" +#include using namespace o2; using namespace o2::framework; @@ -35,7 +39,7 @@ struct AssessmentMFT { {"TracksChi2", "; #chi^{2}; tracks", {HistType::kTH1F, {{600, 0, 20}}}}, // {"TracksNclustersEta", "; nClusters; #eta; tracks", {HistType::kTH2F, {{7, 4, 10}, {100, -8, 8}}}}, // {"TracksTime", "; time; #count", {HistType::kTH1D, {{6000000, 0, 60000}}}}, // - } // + } // }; void process(aod::Collisions::iterator const& collision, aod::MFTTracks const& tracks, aod::BCs const& bcs) diff --git a/PWGMM/Mult/Tasks/dndeta-hi.cxx b/PWGMM/Mult/Tasks/dndeta-hi.cxx index d479a3138e3..630922994cb 100644 --- a/PWGMM/Mult/Tasks/dndeta-hi.cxx +++ b/PWGMM/Mult/Tasks/dndeta-hi.cxx @@ -10,47 +10,41 @@ // or submit itself to any jurisdiction. #include "Index.h" -#include "bestCollisionTable.h" -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/DataModel/CandidateSelectionTables.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTOF.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/GlobalTrackID.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 using namespace o2; using namespace o2::framework; @@ -58,7 +52,6 @@ using namespace o2::framework::expressions; using namespace o2::aod::track; using namespace o2::aod; -using namespace o2::analysis; using BCsRun3 = soa::Join; using MyCollisions = soa::Join; diff --git a/PWGMM/Mult/Tasks/dndeta-mft.cxx b/PWGMM/Mult/Tasks/dndeta-mft.cxx index f70cc1d638a..e7ff487021d 100644 --- a/PWGMM/Mult/Tasks/dndeta-mft.cxx +++ b/PWGMM/Mult/Tasks/dndeta-mft.cxx @@ -15,27 +15,34 @@ // \brief This code loops over MFT tracks and collisions and fills histograms // useful to compute dNdeta -#include -#include - -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" +#include "bestCollisionTable.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "TDatabasePDG.h" -#include "bestCollisionTable.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; @@ -108,7 +115,7 @@ struct PseudorapidityDensityMFT { {"EventSelection", ";status;events", {HistType::kTH1F, {{7, 0.5, 7.5}}}}, // - } // + } // }; void init(InitContext&) diff --git a/PWGMM/Mult/Tasks/dndeta.cxx b/PWGMM/Mult/Tasks/dndeta.cxx index 220bdbdebb8..df1ebc63cd8 100644 --- a/PWGMM/Mult/Tasks/dndeta.cxx +++ b/PWGMM/Mult/Tasks/dndeta.cxx @@ -9,26 +9,40 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/Centrality.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include -#include - +#include "Axes.h" +#include "Functions.h" #include "Gencentralities.h" +#include "Histograms.h" #include "Index.h" +#include "Selections.h" #include "bestCollisionTable.h" -#include "Axes.h" -#include "Functions.h" -#include "Selections.h" -#include "Histograms.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/DataModel/Centrality.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 using namespace o2; using namespace o2::aod::track; diff --git a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx index 3b060924ad7..97425d586c6 100644 --- a/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx +++ b/PWGMM/Mult/Tasks/dndetaMFTPbPb.cxx @@ -19,42 +19,57 @@ #include "Index.h" #include "bestCollisionTable.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/fwdtrackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/GeomConstants.h" -#include "CommonConstants/MathConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/Propagator.h" -#include "Field/MagneticField.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "ReconstructionDataFormats/TrackFwd.h" - -#include "Math/MatrixFunctions.h" -#include "Math/SMatrix.h" -#include "TGeoGlobalMagField.h" -#include "TMCProcess.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 +#include +#include +#include +#include + +#include #include +#include #include #include +#include +#include +#include +#include #include #include +#include #include #include diff --git a/PWGMM/Mult/Tasks/effpt-mft.cxx b/PWGMM/Mult/Tasks/effpt-mft.cxx index 2d3a9919922..c34dea1def2 100644 --- a/PWGMM/Mult/Tasks/effpt-mft.cxx +++ b/PWGMM/Mult/Tasks/effpt-mft.cxx @@ -9,25 +9,26 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include -#include "Framework/Configurable.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/RuntimeError.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "TDatabasePDG.h" -#include "MathUtils/Utils.h" #include "Index.h" +#include "Common/DataModel/EventSelection.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; @@ -219,9 +220,9 @@ struct EffPtMFT { registry.fill(HIST("TracksPhiEtaGenDuplicates"), particle.phi(), particle.eta()); } } // the particle has a track - } // loop on particlesI - } // loop on collisions - } // end of processTrackEfficiencyIndexed + } // loop on particlesI + } // loop on collisions + } // end of processTrackEfficiencyIndexed PROCESS_SWITCH(EffPtMFT, processTrackEfficiencyIndexed, "Calculate tracking efficiency vs pt (indexed)", false); }; diff --git a/PWGMM/Mult/Tasks/flatenicityFV0.cxx b/PWGMM/Mult/Tasks/flatenicityFV0.cxx index 3a403d9ea1b..0c7c3565676 100644 --- a/PWGMM/Mult/Tasks/flatenicityFV0.cxx +++ b/PWGMM/Mult/Tasks/flatenicityFV0.cxx @@ -8,24 +8,32 @@ // 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 "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" - -#include "ReconstructionDataFormats/Track.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" #include "Common/DataModel/EventSelection.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; diff --git a/PWGMM/Mult/Tasks/flattenicty-chrg.cxx b/PWGMM/Mult/Tasks/flattenicty-chrg.cxx index fbfa4ab578d..2f84c6603bb 100644 --- a/PWGMM/Mult/Tasks/flattenicty-chrg.cxx +++ b/PWGMM/Mult/Tasks/flattenicty-chrg.cxx @@ -17,28 +17,37 @@ // // \since 2024 +#include "Common/Core/TrackSelection.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 +#include #include -#include #include -#include "EventFiltering/filterTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/StaticFor.h" -#include "Framework/runDataProcessing.h" - -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "DataFormatsFT0/Digit.h" -#include "ReconstructionDataFormats/Track.h" +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/heavy-ion-mult.cxx b/PWGMM/Mult/Tasks/heavy-ion-mult.cxx index 9d8fdf30a2a..d281fb37ac7 100644 --- a/PWGMM/Mult/Tasks/heavy-ion-mult.cxx +++ b/PWGMM/Mult/Tasks/heavy-ion-mult.cxx @@ -18,38 +18,42 @@ // 3. https://github.com/AliceO2Group/O2Physics/blob/master/PWGMM/Mult/Tasks/puremc-dndeta.cxx // 4. O2 analysis tutorial: https://indico.cern.ch/event/1267433/ -#include "Index.h" -#include "bestCollisionTable.h" - #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CommonConstants/MathConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/GlobalTrackID.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 + using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; diff --git a/PWGMM/Mult/Tasks/mcdata_split_test.cxx b/PWGMM/Mult/Tasks/mcdata_split_test.cxx index 5d5194be4be..32f85d3e946 100644 --- a/PWGMM/Mult/Tasks/mcdata_split_test.cxx +++ b/PWGMM/Mult/Tasks/mcdata_split_test.cxx @@ -13,20 +13,24 @@ /// /// \author hhesouno -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" - -#include "ReconstructionDataFormats/GlobalTrackID.h" - #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/O2DatabasePDGPlugin.h" +#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/PWGMM/Mult/Tasks/mftReassociationValidation.cxx b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx index 5f59abee9ed..56a6f0215da 100644 --- a/PWGMM/Mult/Tasks/mftReassociationValidation.cxx +++ b/PWGMM/Mult/Tasks/mftReassociationValidation.cxx @@ -17,7 +17,10 @@ #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/RCTSelectionFlags.h" +<<<<<<< changes_mftReasso #include "Common/Core/fwdtrackUtilities.h" + ======= +>>>>>>> master #include "Common/DataModel/CollisionAssociationTables.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" @@ -27,7 +30,10 @@ #include #include #include + <<<<<<< changes_mftReasso #include + ======= +>>>>>>> master #include #include #include @@ -39,7 +45,10 @@ #include #include #include + <<<<<<< changes_mftReasso #include + ======= +>>>>>>> master #include #include @@ -56,7 +65,7 @@ #include #include -using namespace o2; + using namespace o2; using namespace o2::aod::rctsel; using namespace o2::aod::track; using namespace o2::constants::math; diff --git a/PWGMM/Mult/Tasks/multiplicityPbPb.cxx b/PWGMM/Mult/Tasks/multiplicityPbPb.cxx index 367b7e991a6..70f62629b54 100644 --- a/PWGMM/Mult/Tasks/multiplicityPbPb.cxx +++ b/PWGMM/Mult/Tasks/multiplicityPbPb.cxx @@ -13,17 +13,21 @@ /// /// \author hhesouno -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" - -#include "ReconstructionDataFormats/GlobalTrackID.h" - #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" -#include "Framework/O2DatabasePDGPlugin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/Mult/Tasks/pseudoEffMFT.cxx b/PWGMM/Mult/Tasks/pseudoEffMFT.cxx index d8dc1990329..7a47c760094 100644 --- a/PWGMM/Mult/Tasks/pseudoEffMFT.cxx +++ b/PWGMM/Mult/Tasks/pseudoEffMFT.cxx @@ -16,40 +16,47 @@ /// \since OCT 2025 #include "Functions.h" -#include "Index.h" #include "bestCollisionTable.h" +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/CCDB/ctpRateFetcher.h" #include "Common/Core/RecoDecay.h" #include "Common/DataModel/Centrality.h" -#include "Common/DataModel/CollisionAssociationTables.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/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Configurable.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/RuntimeError.h" -#include "Framework/runDataProcessing.h" -#include "MathUtils/Utils.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" + +#include +#include #include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include #include +#include + +#include +#include +#include +#include -#include "TPDGCode.h" +#include #include +#include #include #include -#include +#include #include #include +#include #include #include diff --git a/PWGMM/Mult/Tasks/puremc-dndeta.cxx b/PWGMM/Mult/Tasks/puremc-dndeta.cxx index 86e52b38850..f634755a3dd 100644 --- a/PWGMM/Mult/Tasks/puremc-dndeta.cxx +++ b/PWGMM/Mult/Tasks/puremc-dndeta.cxx @@ -9,17 +9,30 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include -#include - #include "Axes.h" #include "Histograms.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; using namespace o2::framework::expressions; diff --git a/PWGMM/Mult/Tasks/run2dndeta.cxx b/PWGMM/Mult/Tasks/run2dndeta.cxx index 9db9fd291d9..84e7fca4123 100644 --- a/PWGMM/Mult/Tasks/run2dndeta.cxx +++ b/PWGMM/Mult/Tasks/run2dndeta.cxx @@ -8,24 +8,29 @@ // 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 "Framework/Configurable.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/RuntimeError.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "Framework/runDataProcessing.h" - -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/MathConstants.h" -#include "TDatabasePDG.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include + +#include +#include +#include + +#include using namespace o2; using namespace o2::framework; @@ -56,7 +61,7 @@ struct PseudorapidityDensity { {"TracksEtaZvtx_gt0", "; #eta; Z_{vtx}; tracks", {HistType::kTH2F, {{21, -2.1, 2.1}, {201, -20.1, 20.1}}}}, // {"TracksPhiEta", "; #varphi; #eta; tracks", {HistType::kTH2F, {{600, 0, 2 * M_PI}, {21, -2.1, 2.1}}}}, // {"EventSelection", ";status;events", {HistType::kTH1F, {{4, 0.5, 4.5}}}} // - } // + } // }; void init(InitContext&) diff --git a/PWGMM/Mult/Tasks/vertexing-fwd.cxx b/PWGMM/Mult/Tasks/vertexing-fwd.cxx index aecb9e7cd9c..f5dd786acc7 100644 --- a/PWGMM/Mult/Tasks/vertexing-fwd.cxx +++ b/PWGMM/Mult/Tasks/vertexing-fwd.cxx @@ -16,18 +16,27 @@ // \brief This code loops over every ambiguous MFT tracks and associates // them to a collision that has the smallest DCAxy +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include #include -#include "ReconstructionDataFormats/TrackFwd.h" -#include "Math/MatrixFunctions.h" -#include "Math/SMatrix.h" -#include "MathUtils/Utils.h" -#include "Framework/Configurable.h" -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/runDataProcessing.h" - -#include "CommonConstants/MathConstants.h" -#include "CommonConstants/LHCConstants.h" +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/UE/Tasks/dedxAnalysis.cxx b/PWGMM/UE/Tasks/dedxAnalysis.cxx index a4ea4bb22ac..cb8e1cbbc0d 100644 --- a/PWGMM/UE/Tasks/dedxAnalysis.cxx +++ b/PWGMM/UE/Tasks/dedxAnalysis.cxx @@ -16,29 +16,33 @@ #include "PWGLF/DataModel/LFStrangenessTables.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/PIDResponseTOF.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CCDB/BasicCCDBManager.h" -#include "CCDB/CcdbApi.h" -#include "CommonConstants/PhysicsConstants.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "Framework/ASoA.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/Logger.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/Track.h" -#include "ReconstructionDataFormats/V0.h" - -#include "TF1.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/PWGMM/UE/Tasks/ue-zdc-analysys.cxx b/PWGMM/UE/Tasks/ue-zdc-analysys.cxx index ec5294f7248..bf632017ee4 100644 --- a/PWGMM/UE/Tasks/ue-zdc-analysys.cxx +++ b/PWGMM/UE/Tasks/ue-zdc-analysys.cxx @@ -12,22 +12,21 @@ /// \brief Task for ZDC /// \author /// \since -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" #include "Common/DataModel/EventSelection.h" -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/TriggerAliases.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/Core/TrackSelection.h" -#include "ReconstructionDataFormats/GlobalTrackID.h" -#include "ReconstructionDataFormats/Track.h" -#include "TH1F.h" -#include "TH2F.h" -#include "TObjArray.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include using namespace o2; using namespace o2::framework; diff --git a/PWGMM/UE/Tasks/uecharged.cxx b/PWGMM/UE/Tasks/uecharged.cxx index 9af0eb3cc2a..5f8908db124 100644 --- a/PWGMM/UE/Tasks/uecharged.cxx +++ b/PWGMM/UE/Tasks/uecharged.cxx @@ -15,31 +15,35 @@ /// \since November 2021 /// \last update: March 2026 -#include "PWGLF/DataModel/mcCentrality.h" -#include "PWGLF/Utils/collisionCuts.h" #include "PWGLF/Utils/inelGt.h" -#include "PWGLF/Utils/mcParticle.h" +#include "Common/CCDB/EventSelectionParams.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.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/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 using namespace o2; 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..d58c98ac587 100644 --- a/PWGUD/TableProducer/UPCCandidateProducer.cxx +++ b/PWGUD/TableProducer/UPCCandidateProducer.cxx @@ -11,6 +11,8 @@ /// \author Nazar Burmasov, nazar.burmasov@cern.ch /// \author Diana Krupova, diana.krupova@cern.ch /// \since 04.06.2024 +/// \author Andrea Riffero, andrea.giovanni.riffero@cern.ch +/// \since 19.03.2026 #include "PWGUD/Core/UPCCutparHolder.h" #include "PWGUD/Core/UPCHelpers.h" @@ -18,17 +20,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 @@ -603,17 +624,25 @@ struct UpcCandProducer { // "uncorrected" bcs template void collectAmbTrackBCs(std::unordered_map& ambTrIds, + TBCs const& bcs, TAmbTracks ambTracks) { for (const auto& ambTrk : ambTracks) { auto trkId = getAmbTrackId(ambTrk); - const auto& bcSlice = ambTrk.template bc_as(); - uint64_t trackBC = -1; - if (bcSlice.size() != 0) { - auto first = bcSlice.begin(); - trackBC = first.globalBC(); + + const auto& bcIds = ambTrk.bcIds(); + if (bcIds.size() == 0) + continue; + + const auto firstBcId = static_cast(*bcIds.begin()); + if (firstBcId < 0 || firstBcId >= static_cast(bcs.size())) { + LOGP(debug, + "Skipping ambiguous track {}: invalid first bcId {} (nBCs = {})", + trkId, firstBcId, bcs.size()); + continue; } - ambTrIds[trkId] = trackBC; + + ambTrIds[trkId] = bcs.iteratorAt(firstBcId).globalBC(); } } @@ -649,16 +678,22 @@ struct UpcCandProducer { continue; int64_t trkId = trk.globalIndex(); int32_t nContrib = -1; + bool hasTrackBC = false; uint64_t trackBC = 0; if (trk.has_collision()) { const auto& col = trk.collision(); nContrib = col.numContrib(); trackBC = col.bc_as().globalBC(); + hasTrackBC = true; } else { auto ambIter = ambBarrelTrBCs.find(trkId); - if (ambIter != ambBarrelTrBCs.end()) + if (ambIter != ambBarrelTrBCs.end()) { trackBC = ambIter->second; + hasTrackBC = true; + } } + if (!hasTrackBC) + continue; int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast(fBarrelTrackTShift)); uint64_t bc = trackBC + tint; if (nContrib > upcCuts.getMaxNContrib()) @@ -683,15 +718,22 @@ struct UpcCandProducer { continue; int64_t trkId = trk.globalIndex(); int32_t nContrib = -1; + bool hasTrackBC = false; uint64_t trackBC = 0; auto ambIter = ambFwdTrBCs.find(trkId); if (ambIter == ambFwdTrBCs.end()) { + if (!trk.has_collision()) + continue; const auto& col = trk.collision(); nContrib = col.numContrib(); trackBC = col.bc_as().globalBC(); + hasTrackBC = true; } else { trackBC = ambIter->second; + hasTrackBC = true; } + if (!hasTrackBC) + continue; int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast(fMuonTrackTShift)); uint64_t bc = trackBC + tint; if (nContrib > upcCuts.getMaxNContrib()) @@ -716,9 +758,12 @@ struct UpcCandProducer { continue; int64_t trkId = trk.globalIndex(); int32_t nContrib = -1; + bool hasTrackBC = false; uint64_t trackBC = 0; auto ambIter = ambFwdTrBCs.find(trkId); if (ambIter == ambFwdTrBCs.end()) { + if (!trk.has_collision()) + continue; const auto& col = trk.collision(); nContrib = col.numContrib(); trackBC = col.bc_as().globalBC(); @@ -729,9 +774,13 @@ struct UpcCandProducer { if (fRequireNoITSROFrameBorder && !bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder)) { continue; // skip this track if the kNoITSROFrameBorder bit is required but not set } + hasTrackBC = true; } else { trackBC = ambIter->second; + hasTrackBC = true; } + if (!hasTrackBC) + continue; int64_t tint = TMath::FloorNint(trk.trackTime() / o2::constants::lhc::LHCBunchSpacingNS + static_cast(fMuonTrackTShift)); uint64_t bc = trackBC + tint; if (nContrib > upcCuts.getMaxNContrib()) @@ -800,7 +849,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambBarrelTrBCs; if (upcCuts.getAmbigSwitch() != 1) - collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, ambBarrelTracks); + collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, bcs, ambBarrelTracks); collectBarrelTracks(bcsMatchedTrIdsTOF, 0, @@ -1101,10 +1150,10 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambBarrelTrBCs; - collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, ambBarrelTracks); + collectAmbTrackBCs<0, BCsWithBcSels>(ambBarrelTrBCs, bcs, ambBarrelTracks); std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, @@ -1301,7 +1350,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, @@ -1556,7 +1605,7 @@ struct UpcCandProducer { // trackID -> index in amb. track table std::unordered_map ambFwdTrBCs; - collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, ambFwdTracks); + collectAmbTrackBCs<1, BCsWithBcSels>(ambFwdTrBCs, bcs, ambFwdTracks); collectForwardTracks(bcsMatchedTrIdsMID, o2::aod::fwdtrack::ForwardTrackTypeEnum::MuonStandaloneTrack, 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..744b4e8523a 100644 --- a/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx +++ b/PWGUD/TableProducer/upcCandProducerGlobalMuon.cxx @@ -16,27 +16,45 @@ #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 #include @@ -70,8 +88,6 @@ struct UpcCandProducerGlobalMuon { // NEW: MFT/Global track support configurables Configurable fEnableMFT{"fEnableMFT", true, "Enable MFT/global track processing"}; - Configurable fMinEtaMFT{"fMinEtaMFT", -3.6, "Minimum eta for MFT acceptance"}; - Configurable fMaxEtaMFT{"fMaxEtaMFT", -2.5, "Maximum eta for MFT acceptance"}; Configurable fSaveMFTClusters{"fSaveMFTClusters", true, "Save MFT cluster information"}; // Ambiguous track propagation configurables @@ -80,6 +96,8 @@ struct UpcCandProducerGlobalMuon { Configurable fManualZShift{"fManualZShift", 0.0f, "Manual z-shift for global muon propagation to PV"}; Configurable fMaxDCAxy{"fMaxDCAxy", 999.f, "Maximum DCAxy for global muon track selection (cm)"}; Configurable fBcWindowCollision{"fBcWindowCollision", 4, "BC window for collision search for DCA-based vertex assignment"}; + Configurable fMaxChi2MatchMCHMFT{"fMaxChi2MatchMCHMFT", 4.f, "Maximum chi2 for MCH-MFT matching quality filter"}; + Configurable fBcWindowMCHMFT{"fBcWindowMCHMFT", 20, "BC window for searching MCH-MFT tracks around MCH-MID-MFT anchors"}; using ForwardTracks = o2::soa::Join; @@ -123,7 +141,6 @@ struct UpcCandProducerGlobalMuon { histRegistry.get(HIST("hTrackTypes"))->GetXaxis()->SetBinLabel(4, "GlobalFwd"); const AxisSpec axisEta{100, -4.0, -2.0, "#eta"}; - histRegistry.add("hEtaMFT", "MFT track eta", kTH1F, {axisEta}); histRegistry.add("hEtaGlobal", "Global track eta", kTH1F, {axisEta}); const AxisSpec axisDCAxy{200, 0., 10., "DCA_{xy} (cm)"}; @@ -131,6 +148,13 @@ struct UpcCandProducerGlobalMuon { histRegistry.add("hDCAxyGlobal", "DCAxy of global tracks to best collision", kTH1F, {axisDCAxy}); histRegistry.add("hDCAzGlobal", "DCAz of global tracks to best collision", kTH1F, {axisDCAz}); histRegistry.add("hNCompatColls", "Number of compatible collisions per global track", kTH1F, {{21, -0.5, 20.5}}); + + const AxisSpec axisChi2Match{200, 0., 100., "#chi^{2}_{MCH-MFT}"}; + histRegistry.add("hChi2MatchMCHMFT", "Chi2 of MCH-MFT matching (before cut)", kTH1F, {axisChi2Match}); + + const AxisSpec axisMass{500, 0., 10., "m_{inv} (GeV/c^{2})"}; + histRegistry.add("hMassGlobalMuon", "Invariant mass from MCH-MID-MFT tracks only", kTH1F, {axisMass}); + histRegistry.add("hMassGlobalMuonWithMCHMFT", "Invariant mass from MCH-MID-MFT + MCH-MFT tracks", kTH1F, {axisMass}); } } @@ -465,12 +489,6 @@ struct UpcCandProducerGlobalMuon { } } - // NEW: Check if track is in MFT acceptance - bool isInMFTAcceptance(float eta) - { - return (eta > fMinEtaMFT && eta < fMaxEtaMFT); - } - // Propagate global muon track to collision vertex using helix propagation // and compute DCA (adapted from ambiguousTrackPropagation) // Returns {DCAxy, DCAz, DCAx, DCAy} @@ -577,7 +595,8 @@ struct UpcCandProducerGlobalMuon { std::map> mapGlobalBcsWithMCHMIDTrackIds; std::map> mapGlobalBcsWithMCHTrackIds; - std::map> mapGlobalBcsWithGlobalTrackIds; // NEW: For global tracks + std::map> mapGlobalBcsWithGlobalMuonTrackIds; // MCH-MID-MFT (good timing from MID) + std::map> mapGlobalBcsWithMCHMFTTrackIds; // MCH-MFT only (poor timing) for (const auto& fwdTrack : fwdTracks) { auto trackType = fwdTrack.trackType(); @@ -597,8 +616,16 @@ struct UpcCandProducerGlobalMuon { mapGlobalBcsWithMCHMIDTrackIds[globalBC].push_back(trackId); } else if (trackType == MCHStandaloneTrack) { // MCH-only mapGlobalBcsWithMCHTrackIds[globalBC].push_back(trackId); - } else if (fEnableMFT && (trackType == GlobalMuonTrack || trackType == GlobalForwardTrack)) { // NEW: Global tracks - mapGlobalBcsWithGlobalTrackIds[globalBC].push_back(trackId); + } else if (fEnableMFT && trackType == GlobalMuonTrack) { // MCH-MID-MFT: good timing, used as anchor + histRegistry.fill(HIST("hChi2MatchMCHMFT"), fwdTrack.chi2MatchMCHMFT()); + if (fwdTrack.chi2MatchMCHMFT() > 0 && fwdTrack.chi2MatchMCHMFT() < fMaxChi2MatchMCHMFT) { + mapGlobalBcsWithGlobalMuonTrackIds[globalBC].push_back(trackId); + } + } else if (fEnableMFT && trackType == GlobalForwardTrack) { // MCH-MFT: poor timing, matched to anchors + histRegistry.fill(HIST("hChi2MatchMCHMFT"), fwdTrack.chi2MatchMCHMFT()); + if (fwdTrack.chi2MatchMCHMFT() > 0 && fwdTrack.chi2MatchMCHMFT() < fMaxChi2MatchMCHMFT) { + mapGlobalBcsWithMCHMFTTrackIds[globalBC].push_back(trackId); + } } } @@ -615,11 +642,13 @@ struct UpcCandProducerGlobalMuon { int32_t candId = 0; - // NEW: Process global tracks if MFT is enabled - if (fEnableMFT && !mapGlobalBcsWithGlobalTrackIds.empty()) { - for (const auto& gbc_globalids : mapGlobalBcsWithGlobalTrackIds) { - uint64_t globalBcGlobal = gbc_globalids.first; - auto itFv0Id = mapGlobalBcWithV0A.find(globalBcGlobal); + // Process global tracks: MCH-MID-MFT anchors + MCH-MFT in BC window + // MCH-MID-MFT tracks have good timing (from MID) and serve as anchors. + // MCH-MFT tracks have poor timing and are searched in a BC window around anchors. + if (fEnableMFT && !mapGlobalBcsWithGlobalMuonTrackIds.empty()) { + for (const auto& gbc_anchorids : mapGlobalBcsWithGlobalMuonTrackIds) { + uint64_t globalBcAnchor = gbc_anchorids.first; + auto itFv0Id = mapGlobalBcWithV0A.find(globalBcAnchor); if (itFv0Id != mapGlobalBcWithV0A.end()) { auto fv0Id = itFv0Id->second; const auto& fv0 = fv0s.iteratorAt(fv0Id); @@ -630,17 +659,28 @@ struct UpcCandProducerGlobalMuon { continue; } - auto& vGlobalIds = gbc_globalids.second; + auto& vAnchorIds = gbc_anchorids.second; // MCH-MID-MFT tracks at this BC + + // Search MCH-MFT tracks in BC window around anchor (analogous to MCH-only matching) + std::map mapMchMftIdBc{}; + getMchTrackIds(globalBcAnchor, mapGlobalBcsWithMCHMFTTrackIds, fBcWindowMCHMFT, mapMchMftIdBc); + + // Collect all track IDs for vertex finding (anchors + matched MCH-MFT) + std::vector allTrackIds; + allTrackIds.reserve(vAnchorIds.size() + mapMchMftIdBc.size()); + for (const auto& id : vAnchorIds) + allTrackIds.push_back(id); + for (const auto& [id, gbc] : mapMchMftIdBc) + allTrackIds.push_back(id); // Step 1: Find best collision vertex using DCA-based propagation - // (adapted from ambiguousTrackPropagation processMFTReassoc3D) float bestVtxX = 0., bestVtxY = 0., bestVtxZ = 0.; double bestAvgDCA = 999.; bool hasVertex = false; int nCompatColls = 0; for (int dbc = -static_cast(fBcWindowCollision); dbc <= static_cast(fBcWindowCollision); dbc++) { - uint64_t searchBC = globalBcGlobal + dbc; + uint64_t searchBC = globalBcAnchor + dbc; auto itCol = mapGlobalBCtoCollisions.find(searchBC); if (itCol == mapGlobalBCtoCollisions.end()) continue; @@ -649,7 +689,7 @@ struct UpcCandProducerGlobalMuon { const auto& col = collisions.iteratorAt(colIdx); double sumDCAxy = 0.; int nTracks = 0; - for (const auto& iglobal : vGlobalIds) { + for (const auto& iglobal : allTrackIds) { const auto& trk = fwdTracks.iteratorAt(iglobal); auto dca = propagateGlobalToDCA(trk, col.posX(), col.posY(), col.posZ()); sumDCAxy += dca[0]; @@ -668,60 +708,80 @@ struct UpcCandProducerGlobalMuon { histRegistry.fill(HIST("hNCompatColls"), nCompatColls); - // Step 2: Select tracks with DCA quality cut - std::vector tracksToSave; - for (const auto& iglobal : vGlobalIds) { - const auto& trk = fwdTracks.iteratorAt(iglobal); - - // Apply DCA cut using best collision vertex + // Step 2: Write anchor tracks (MCH-MID-MFT) with DCA quality cut + constexpr double kMuonMass = o2::constants::physics::MassMuon; + uint16_t numContrib = 0; + double sumPx = 0., sumPy = 0., sumPz = 0., sumE = 0.; + for (const auto& ianchor : vAnchorIds) { if (hasVertex) { + const auto& trk = fwdTracks.iteratorAt(ianchor); auto dca = propagateGlobalToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); histRegistry.fill(HIST("hDCAxyGlobal"), dca[0]); histRegistry.fill(HIST("hDCAzGlobal"), dca[1]); if (dca[0] > static_cast(fMaxDCAxy)) continue; } + if (!addToFwdTable(candId, ianchor, globalBcAnchor, 0., fwdTracks, mcFwdTrackLabels)) + continue; + const auto& trk = fwdTracks.iteratorAt(ianchor); + double p2 = trk.px() * trk.px() + trk.py() * trk.py() + trk.pz() * trk.pz(); + sumPx += trk.px(); + sumPy += trk.py(); + sumPz += trk.pz(); + sumE += std::sqrt(p2 + kMuonMass * kMuonMass); + numContrib++; + selTrackIds.push_back(ianchor); + } - // Check MFT acceptance and decide which track to use - if (isInMFTAcceptance(trk.eta())) { - // Inside MFT acceptance - use global track - tracksToSave.push_back(iglobal); - histRegistry.fill(HIST("hEtaMFT"), trk.eta()); - } else { - // Outside MFT acceptance - look for MCH-MID counterpart - auto itMid = mapGlobalBcsWithMCHMIDTrackIds.find(globalBcGlobal); - if (itMid != mapGlobalBcsWithMCHMIDTrackIds.end()) { - if (!itMid->second.empty()) { - tracksToSave.push_back(itMid->second[0]); - itMid->second.erase(itMid->second.begin()); - } - } - } + // Fill invariant mass from MCH-MID-MFT anchors only + uint16_t numContribAnch = numContrib; + if (numContribAnch >= 2) { + double mass2 = sumE * sumE - sumPx * sumPx - sumPy * sumPy - sumPz * sumPz; + histRegistry.fill(HIST("hMassGlobalMuon"), mass2 > 0. ? std::sqrt(mass2) : 0.); } - // Step 3: Write tracks and event candidate with actual vertex position - uint16_t numContrib = 0; - for (const auto& trkId : tracksToSave) { - if (!addToFwdTable(candId, trkId, globalBcGlobal, 0., fwdTracks, mcFwdTrackLabels)) + // Step 3: Write matched MCH-MFT tracks with DCA quality cut and adjusted track time + for (const auto& [imchMft, gbc] : mapMchMftIdBc) { + if (hasVertex) { + const auto& trk = fwdTracks.iteratorAt(imchMft); + auto dca = propagateGlobalToDCA(trk, bestVtxX, bestVtxY, bestVtxZ); + histRegistry.fill(HIST("hDCAxyGlobal"), dca[0]); + histRegistry.fill(HIST("hDCAzGlobal"), dca[1]); + if (dca[0] > static_cast(fMaxDCAxy)) + continue; + } + if (!addToFwdTable(candId, imchMft, gbc, (gbc - globalBcAnchor) * o2::constants::lhc::LHCBunchSpacingNS, fwdTracks, mcFwdTrackLabels)) continue; + const auto& trk = fwdTracks.iteratorAt(imchMft); + double p2 = trk.px() * trk.px() + trk.py() * trk.py() + trk.pz() * trk.pz(); + sumPx += trk.px(); + sumPy += trk.py(); + sumPz += trk.pz(); + sumE += std::sqrt(p2 + kMuonMass * kMuonMass); numContrib++; - selTrackIds.push_back(trkId); + selTrackIds.push_back(imchMft); + } + + // Fill invariant mass including MCH-MFT tracks (only if MCH-MFT tracks were added) + if (numContrib > numContribAnch && numContrib >= 2) { + double mass2 = sumE * sumE - sumPx * sumPx - sumPy * sumPy - sumPz * sumPz; + histRegistry.fill(HIST("hMassGlobalMuonWithMCHMFT"), mass2 > 0. ? std::sqrt(mass2) : 0.); } if (numContrib < 1) continue; - eventCandidates(globalBcGlobal, runNumber, bestVtxX, bestVtxY, bestVtxZ, 0, numContrib, 0, 0); + eventCandidates(globalBcAnchor, runNumber, bestVtxX, bestVtxY, bestVtxZ, 0, numContrib, 0, 0); std::vector amplitudesV0A{}; std::vector relBCsV0A{}; std::vector amplitudesT0A{}; std::vector relBCsT0A{}; if (nFV0s > 0) { - getFV0Amplitudes(globalBcGlobal, fv0s, fBcWindowFITAmps, mapGlobalBcWithV0A, amplitudesV0A, relBCsV0A); + getFV0Amplitudes(globalBcAnchor, fv0s, fBcWindowFITAmps, mapGlobalBcWithV0A, amplitudesV0A, relBCsV0A); } eventCandidatesSelsFwd(0., 0., amplitudesT0A, relBCsT0A, amplitudesV0A, relBCsV0A); if (nZdcs > 0) { - auto itZDC = mapGlobalBcWithZdc.find(globalBcGlobal); + auto itZDC = mapGlobalBcWithZdc.find(globalBcAnchor); if (itZDC != mapGlobalBcWithZdc.end()) { const auto& zdc = zdcs.iteratorAt(itZDC->second); float timeZNA = zdc.timeZNA(); @@ -804,7 +864,8 @@ struct UpcCandProducerGlobalMuon { vAmbFwdTrackIndexBCs.clear(); mapGlobalBcsWithMCHMIDTrackIds.clear(); mapGlobalBcsWithMCHTrackIds.clear(); - mapGlobalBcsWithGlobalTrackIds.clear(); + mapGlobalBcsWithGlobalMuonTrackIds.clear(); + mapGlobalBcsWithMCHMFTTrackIds.clear(); mapGlobalBCtoCollisions.clear(); selTrackIds.clear(); } 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..9624c1a5c86 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 @@ -115,9 +125,18 @@ struct FlowCumulantsUpc { O2_DEFINE_CONFIGURABLE(cfgDcazCut, float, 10.0, "dcaz cut") O2_DEFINE_CONFIGURABLE(cfgItsClusterSize, unsigned int, 5, "ITS cluster size") O2_DEFINE_CONFIGURABLE(cfgMaxTPCChi2NCl, int, 4, "tpcchi2") + O2_DEFINE_CONFIGURABLE(cfgConsistentEventFlag, int, 0, "Flag to select consistent events - 0: off, 1: v2{2} gap calculable, 2: v2{4} full calculable, 4: v2{4} gap calculable, 8: v2{4} 3sub calculable") + Configurable> cfgUserDefineGFWCorr{"cfgUserDefineGFWCorr", std::vector{"refN02 {2} refP02 {-2}", "refN12 {2} refP12 {-2}"}, "User defined GFW CorrelatorConfig"}; Configurable> cfgUserDefineGFWName{"cfgUserDefineGFWName", std::vector{"Ch02Gap22", "Ch12Gap22"}, "User defined GFW Name"}; Configurable> cfgRunRemoveList{"cfgRunRemoveList", std::vector{-1}, "excluded run numbers"}; + Configurable> cfgConsistentEventVector{"cfgConsistentEventVector", std::vector{-0.8, -0.5, -0.4, 0.4, 0.5, 0.8}, "eta regions: left(min,max), mid(min,max), right(min,max)"}; + struct AcceptedTracks { + int nNeg; + int nMid; + int nPos; + int nFull; + }; ConfigurableAxis axisPtHist{"axisPtHist", {100, 0., 10.}, "pt axis for histograms"}; ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 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}, "pt axis for histograms"}; @@ -207,13 +226,15 @@ struct FlowCumulantsUpc { // Add some output objects to the histogram registry // Event QA - registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{5, 0, 5}}}); + registry.add("hEventCount", "Number of Event;; Count", {HistType::kTH1D, {{6, 0, 6}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(1, "Filtered event"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(2, "after gapside selection"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(3, "after its selection"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(4, "after pt selection"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(5, "after occupancy"); - registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{5, 0, 5}}}); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(6, "after consistency check"); + + registry.add("hTrackCount", "Number of tracks;; Count", {HistType::kTH1D, {{7, 0, 7}}}); registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(1, "after event selection"); registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(2, "PVContributor"); registry.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(3, "dcaz"); @@ -945,7 +966,7 @@ struct FlowCumulantsUpc { registry.fill(HIST("hMult"), tracks.size()); registry.fill(HIST("hCent"), cent); fGFW->Clear(); - if (cfgIfVertex && abs(vtxz) > cfgCutVertex) { + if (cfgIfVertex && std::abs(vtxz) > cfgCutVertex) { return; } registry.fill(HIST("hEventCount"), 3.5); @@ -961,6 +982,8 @@ struct FlowCumulantsUpc { if (cfgUseNch) { independent = static_cast(tracks.size()); } + AcceptedTracks acceptedTracks{0, 0, 0, 0}; + std::vector consistentEventVector = cfgConsistentEventVector; for (const auto& track : tracks) { registry.fill(HIST("hChi2prTPCcls"), track.tpcChi2NCl()); @@ -986,6 +1009,16 @@ struct FlowCumulantsUpc { continue; } registry.fill(HIST("hPt"), track.pt()); + + if (cfgConsistentEventFlag && consistentEventVector.size() == 6) { // o2-linter: disable=magic-number (size match) + acceptedTracks.nFull += 1; + if (eta > consistentEventVector[0] && eta < consistentEventVector[1]) + acceptedTracks.nNeg += 1; + if (eta > consistentEventVector[2] && eta < consistentEventVector[3]) + acceptedTracks.nMid += 1; + if (eta > consistentEventVector[4] && eta < consistentEventVector[5]) + acceptedTracks.nPos += 1; + } if (withinPtRef) { registry.fill(HIST("hPhi"), phi); registry.fill(HIST("hPhiWeighted"), phi, wacc); @@ -1007,6 +1040,23 @@ struct FlowCumulantsUpc { registry.fill(HIST("hEtaNch2D"), eta, tracks.size()); } registry.fill(HIST("hTrackCorrection2d"), tracks.size(), nTracksCorrected); + if (cfgConsistentEventFlag) { + if (cfgConsistentEventFlag & 1) { + if (!acceptedTracks.nPos || !acceptedTracks.nNeg) + return; + } else if (cfgConsistentEventFlag & 2) { + if (acceptedTracks.nFull < 4) // o2-linter: disable=magic-number (at least four tracks in full acceptance) + return; + } else if (cfgConsistentEventFlag & 4) { + if (acceptedTracks.nPos < 2 || acceptedTracks.nNeg < 2) // o2-linter: disable=magic-number (at least two tracks in each subevent) + return; + } + if (cfgConsistentEventFlag & 8) { + if (acceptedTracks.nPos < 2 || acceptedTracks.nMid < 2 || acceptedTracks.nNeg < 2) // o2-linter: disable=magic-number (at least two tracks in all three subevents) + return; + } + } + registry.fill(HIST("hEventCount"), 5.5); // Filling Flow Container for (uint l_ind = 0; l_ind < corrconfigs.size(); l_ind++) { 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; diff --git a/Tools/KFparticle/qaKFEventTrack.cxx b/Tools/KFparticle/qaKFEventTrack.cxx index f3f026a8da7..2242de51154 100644 --- a/Tools/KFparticle/qaKFEventTrack.cxx +++ b/Tools/KFparticle/qaKFEventTrack.cxx @@ -15,47 +15,42 @@ /// \brief Task to test the performance of the KFParticle package /// +#ifndef HomogeneousField +#define HomogeneousField +#endif + #include "Tools/KFparticle/qaKFEventTrack.h" -#include -#include -#include "TableHelper.h" -#include -using namespace std; -/// includes O2 -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DataFormatsParameters/GRPMagField.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" - -/// includes O2Physics #include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/Core/trackUtilities.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/TrackSelectionTables.h" #include "Tools/KFparticle/KFUtilities.h" -/// includes KFParticle -#include "KFParticle.h" -#include "KFPTrack.h" -#include "KFPVertex.h" -#include "KFParticleBase.h" -#include "KFVertex.h" - -#ifndef HomogeneousField - -#define HomogeneousField - -#endif +#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::framework; using namespace o2::framework::expressions; diff --git a/Tools/KFparticle/qaKFEventTrack.h b/Tools/KFparticle/qaKFEventTrack.h index 399a3139a91..51f505a435e 100644 --- a/Tools/KFparticle/qaKFEventTrack.h +++ b/Tools/KFparticle/qaKFEventTrack.h @@ -15,9 +15,11 @@ #ifndef TOOLS_KFPARTICLE_QAKFEVENTTRACK_H_ #define TOOLS_KFPARTICLE_QAKFEVENTTRACK_H_ -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/Core/trackUtilities.h" +#include + +#include + +#include enum FlagsTracks { kITS = BIT(0), diff --git a/Tools/KFparticle/qaKFParticle.h b/Tools/KFparticle/qaKFParticle.h index afb23851cb5..e9c8f298325 100644 --- a/Tools/KFparticle/qaKFParticle.h +++ b/Tools/KFparticle/qaKFParticle.h @@ -15,9 +15,9 @@ #ifndef TOOLS_KFPARTICLE_QAKFPARTICLE_H_ #define TOOLS_KFPARTICLE_QAKFPARTICLE_H_ -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/Core/trackUtilities.h" +#include + +#include enum Source { kPrompt = BIT(0), diff --git a/Tools/KFparticle/qaKFParticleLc.cxx b/Tools/KFparticle/qaKFParticleLc.cxx index 792acdff439..86902d349cd 100644 --- a/Tools/KFparticle/qaKFParticleLc.cxx +++ b/Tools/KFparticle/qaKFParticleLc.cxx @@ -15,52 +15,40 @@ /// \brief Task to test the performance of the KFParticle package on the Lc to pKpi decay /// -#include "Tools/KFparticle/qaKFParticleLc.h" - -#include "TableHelper.h" - -#include - -#include -#include +#ifndef HomogeneousField +#define HomogeneousField +#endif -#include +#include "Tools/KFparticle/qaKFParticleLc.h" -/// includes O2 -#include "DataFormatsParameters/GRPMagField.h" -#include "DataFormatsParameters/GRPObject.h" -#include "DetectorsBase/GeometryManager.h" -#include "DetectorsBase/Propagator.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/DCA.h" -#include "ReconstructionDataFormats/Track.h" - -/// includes O2Physics -#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/PIDResponseTOF.h" #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/KFparticle/KFUtilities.h" -/// includes KFParticle -#include "KFPTrack.h" -#include "KFPVertex.h" -#include "KFParticle.h" -#include "KFParticleBase.h" -#include "KFVertex.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#ifndef HomogeneousField +#include -#define HomogeneousField +#include +#include +#include -#endif +#include +#include +#include using namespace o2; using namespace o2::framework; diff --git a/Tools/KFparticle/qaKFParticleLc.h b/Tools/KFparticle/qaKFParticleLc.h index 8c57232f99a..29fc5707be4 100644 --- a/Tools/KFparticle/qaKFParticleLc.h +++ b/Tools/KFparticle/qaKFParticleLc.h @@ -15,9 +15,9 @@ #ifndef TOOLS_KFPARTICLE_QAKFPARTICLELC_H_ #define TOOLS_KFPARTICLE_QAKFPARTICLELC_H_ -#include "Framework/AnalysisTask.h" -#include "Framework/AnalysisDataModel.h" -#include "Common/Core/trackUtilities.h" +#include + +#include enum Source { kPrompt = BIT(0), diff --git a/Tools/ML/model.cxx b/Tools/ML/model.cxx index a60abc65af5..6d2098068aa 100644 --- a/Tools/ML/model.cxx +++ b/Tools/ML/model.cxx @@ -23,6 +23,7 @@ #include +#include #include #include diff --git a/Tools/ML/model.h b/Tools/ML/model.h index 468c3dfd733..3be08e72fa9 100644 --- a/Tools/ML/model.h +++ b/Tools/ML/model.h @@ -22,6 +22,7 @@ #include +#include #include #include