From 815110ecb94e7a310054a71a5ace392b0dea3d30 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Mon, 9 Jun 2025 13:00:32 +0200 Subject: [PATCH 01/21] add upc selection into HF framework --- PWGHF/Tasks/taskPidStudies.cxx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/PWGHF/Tasks/taskPidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx index ad3943a7134..5729729eed5 100644 --- a/PWGHF/Tasks/taskPidStudies.cxx +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -197,6 +197,7 @@ struct HfTaskPidStudies { using CollisionsMc = soa::Join; using V0sMcRec = soa::Join; using CascsMcRec = soa::Join; + using BCs = soa::Join; ctpRateFetcher rateFetcher; HfEventSelection hfEvSel; @@ -336,17 +337,17 @@ struct HfTaskPidStudies { return Particle::NotMatched; } - template - bool isCollSelected(const Coll& coll) + template + bool isCollSelected(const Coll& coll, const BCs& bcs) { - auto bc = coll.template bc_as(); + auto bc = coll.template bc_as(); interactionRate = rateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), ctpFetcherSource.value) * 1.e-3; // convert to kHz if (interactionRate < interactionRateMin || interactionRate > interactionRateMax) { return false; } float cent{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(coll, cent, ccdb, registry); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(coll, cent, ccdb, registry, bcs); /// monitor the satisfied event selections hfEvSel.fillHistograms(coll, rejectionMask, cent); return rejectionMask == 0; @@ -503,10 +504,10 @@ struct HfTaskPidStudies { aod::V0MCCores const&, aod::McParticles const& /*particlesMc*/, PidTracks const& /*tracks*/, - aod::BCsWithTimestamps const&) + BCs const& bcs) { for (const auto& v0 : V0s) { - if (applyEvSels && !isCollSelected(v0.collision_as())) { + if (applyEvSels && !isCollSelected(v0.collision_as(), bcs)) { continue; } if (applyTrackSels && !isTrackSelected(v0)) { @@ -524,11 +525,11 @@ struct HfTaskPidStudies { void processV0Data(aod::V0Datas const& V0s, PidTracks const&, - aod::BCsWithTimestamps const&, + BCs const& bcs, CollSels const&) { for (const auto& v0 : V0s) { - if (applyEvSels && !isCollSelected(v0.collision_as())) { + if (applyEvSels && !isCollSelected(v0.collision_as(), bcs)) { continue; } if (applyTrackSels && !isTrackSelected(v0)) { @@ -546,10 +547,10 @@ struct HfTaskPidStudies { aod::CascMCCores const&, aod::McParticles const& /*particlesMc*/, PidTracks const&, - aod::BCsWithTimestamps const&) + BCs const& bcs) { for (const auto& casc : cascades) { - if (applyEvSels && !isCollSelected(casc.collision_as())) { + if (applyEvSels && !isCollSelected(casc.collision_as(), bcs)) { continue; } if (applyTrackSels && !isTrackSelected(casc)) { @@ -567,11 +568,11 @@ struct HfTaskPidStudies { void processCascData(aod::CascDatas const& cascades, PidTracks const&, - aod::BCsWithTimestamps const&, + BCs const& bcs, CollSels const&) { for (const auto& casc : cascades) { - if (applyEvSels && !isCollSelected(casc.collision_as())) { + if (applyEvSels && !isCollSelected(casc.collision_as(), bcs)) { continue; } if (applyTrackSels && !isTrackSelected(casc)) { From 249b3c1b51b67163f91431bdf503448e08873ca8 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Jun 2025 21:52:36 +0200 Subject: [PATCH 02/21] updates with final option --- PWGHF/TableProducer/CMakeLists.txt | 6 +- .../TableProducer/candidateCreator2Prong.cxx | 129 +++++++++++++---- .../TableProducer/candidateCreator3Prong.cxx | 134 ++++++++++++++---- PWGHF/Utils/utilsEvSelHf.h | 101 +++++++++---- 4 files changed, 289 insertions(+), 81 deletions(-) diff --git a/PWGHF/TableProducer/CMakeLists.txt b/PWGHF/TableProducer/CMakeLists.txt index 2ec33b5d134..aa94cea8c22 100644 --- a/PWGHF/TableProducer/CMakeLists.txt +++ b/PWGHF/TableProducer/CMakeLists.txt @@ -13,7 +13,7 @@ o2physics_add_dpl_workflow(track-index-skim-creator SOURCES trackIndexSkimCreator.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing O2::DCAFitter O2Physics::AnalysisCCDB O2Physics::MLCore O2Physics::EventFilteringUtils + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing O2::DCAFitter O2Physics::AnalysisCCDB O2Physics::MLCore O2Physics::EventFilteringUtils O2Physics::SGCutParHolder COMPONENT_NAME Analysis) # Helpers @@ -37,12 +37,12 @@ o2physics_add_dpl_workflow(mc-pid-tof o2physics_add_dpl_workflow(candidate-creator-2prong SOURCES candidateCreator2Prong.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils O2Physics::SGCutParHolder COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(candidate-creator-3prong SOURCES candidateCreator3Prong.cxx - PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DCAFitter KFParticle::KFParticle O2Physics::EventFilteringUtils O2Physics::SGCutParHolder COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(candidate-creator-b0 diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 7396a0b6f0f..e81a2eb8daa 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -112,18 +112,20 @@ struct HfCandidateCreator2Prong { void init(InitContext const&) { - std::array doprocessDF{doprocessPvRefitWithDCAFitterN, doprocessNoPvRefitWithDCAFitterN, + std::array doprocessDF{doprocessPvRefitWithDCAFitterN, doprocessNoPvRefitWithDCAFitterN, doprocessPvRefitWithDCAFitterNCentFT0C, doprocessNoPvRefitWithDCAFitterNCentFT0C, - doprocessPvRefitWithDCAFitterNCentFT0M, doprocessNoPvRefitWithDCAFitterNCentFT0M}; - std::array doprocessKF{doprocessPvRefitWithKFParticle, doprocessNoPvRefitWithKFParticle, + doprocessPvRefitWithDCAFitterNCentFT0M, doprocessNoPvRefitWithDCAFitterNCentFT0M, doprocessPvRefitWithDCAFitterNUPC, doprocessNoPvRefitWithDCAFitterNUPC}; + std::array doprocessKF{doprocessPvRefitWithKFParticle, doprocessNoPvRefitWithKFParticle, doprocessPvRefitWithKFParticleCentFT0C, doprocessNoPvRefitWithKFParticleCentFT0C, - doprocessPvRefitWithKFParticleCentFT0M, doprocessNoPvRefitWithKFParticleCentFT0M}; + doprocessPvRefitWithKFParticleCentFT0M, doprocessNoPvRefitWithKFParticleCentFT0M, doprocessPvRefitWithKFParticleUPC, doprocessNoPvRefitWithKFParticleUPC}; if ((std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) + std::accumulate(doprocessKF.begin(), doprocessKF.end(), 0)) != 1) { LOGP(fatal, "One and only one process function must be enabled at a time."); } - std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M}; + std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUPC}; const int nProcessesCollisions = std::accumulate(processesCollisions.begin(), processesCollisions.end(), 0); + std::array processesCollisionsUPC = {doprocessPvRefitWithDCAFitterNUPC, doprocessNoPvRefitWithDCAFitterNUPC, doprocessPvRefitWithKFParticleUPC, doprocessNoPvRefitWithKFParticleUPC, doprocessCollisionsUPC}; + const int nProcessesCollisionsUPC = std::accumulate(processesCollisionsUPC.begin(), processesCollisionsUPC.end(), 0); if (nProcessesCollisions > 1) { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); } @@ -138,6 +140,9 @@ struct HfCandidateCreator2Prong { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsCentFT0M\"?"); } } + if (nProcessesCollisionsUPC > 1 && isRun2) { + LOGP(fatal, "Process function for UPC is only available in Run 3!"); + } // histograms registry.add("hMass2", "2-prong candidates;inv. mass (#pi K) (GeV/#it{c}^{2});entries", {HistType::kTH1F, {{500, 1.6, 2.1}}}); @@ -185,11 +190,11 @@ struct HfCandidateCreator2Prong { setLabelHistoCands(hCandidates); } - template + template void runCreator2ProngWithDCAFitterN(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, - aod::BCsWithTimestamps const& /*bcWithTimeStamps*/) + BCsType const& bcs) { // loop over pairs of track indices for (const auto& rowTrackIndexProng2 : rowsTrackIndexProng2) { @@ -197,7 +202,12 @@ struct HfCandidateCreator2Prong { /// reject candidates not satisfying the event selections auto collision = rowTrackIndexProng2.template collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + uint32_t rejectionMask{0}; + if constexpr (useUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + } else { + rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + } if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -211,7 +221,7 @@ struct HfCandidateCreator2Prong { /// Set the magnetic field from ccdb. /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, /// but this is not true when running on Run2 data/MC already converted into AO2Ds. - auto bc = collision.template bc_as(); + auto bc = collision.template bc_as(); if (runNumber != bc.runNumber()) { LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, nullptr, isRun2); @@ -333,11 +343,11 @@ struct HfCandidateCreator2Prong { } } - template + template void runCreator2ProngWithKFParticle(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, - aod::BCsWithTimestamps const& /*bcWithTimeStamps*/) + BCsType const& bcs) { for (const auto& rowTrackIndexProng2 : rowsTrackIndexProng2) { @@ -345,7 +355,12 @@ struct HfCandidateCreator2Prong { /// reject candidates in collisions not satisfying the event selections auto collision = rowTrackIndexProng2.template collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + uint32_t rejectionMask{0}; + if constexpr (useUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + } else { + rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + } if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -357,7 +372,7 @@ struct HfCandidateCreator2Prong { /// Set the magnetic field from ccdb. /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, /// but this is not true when running on Run2 data/MC already converted into AO2Ds. - auto bc = collision.template bc_as(); + auto bc = collision.template bc_as(); if (runNumber != bc.runNumber()) { LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, nullptr, isRun2); @@ -497,7 +512,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterN, "Run candidate creator using DCA fitter w/ PV refit and w/o centrality selections", false); @@ -507,7 +522,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterN, "Run candidate creator using DCA fitter w/o PV refit and w/o centrality selections", true); @@ -517,7 +532,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticle, "Run candidate creator using KFParticle package w/ PV refit and w/o centrality selections", false); @@ -527,7 +542,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithKFParticle, "Run candidate creator using KFParticle package w/o PV refit and w/o centrality selections", false); @@ -543,7 +558,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterNCentFT0C, "Run candidate creator using DCA fitter w/ PV refit and w/ centrality selection on FT0C", false); @@ -553,7 +568,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterNCentFT0C, "Run candidate creator using DCA fitter w/o PV refit and w/ centrality selection FT0C", false); @@ -563,7 +578,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticleCentFT0C, "Run candidate creator using KFParticle package w/ PV refit and w/ centrality selection on FT0C", false); @@ -573,7 +588,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithKFParticleCentFT0C, "Run candidate creator using KFParticle package w/o PV refit and w/ centrality selection on FT0C", false); @@ -589,7 +604,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterNCentFT0M, "Run candidate creator using DCA fitter w/ PV refit and w/ centrality selection on FT0M", false); @@ -599,7 +614,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterNCentFT0M, "Run candidate creator using DCA fitter w/o PV refit and w/ centrality selection FT0M", false); @@ -609,7 +624,7 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticleCentFT0M, "Run candidate creator using KFParticle package w/ PV refit and w/ centrality selection on FT0M", false); @@ -619,10 +634,56 @@ struct HfCandidateCreator2Prong { TracksWCovExtraPidPiKa const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithKFParticleCentFT0M, "Run candidate creator using KFParticle package w/o PV refit and w/ centrality selection on FT0M", false); + ///////////////////////////////////////////// + /// /// + /// with centrality selection on UPC /// + /// /// + ///////////////////////////////////////////// + + /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on UPC + void processPvRefitWithDCAFitterNUPC(soa::Join const& collisions, + soa::Join const& rowsTrackIndexProng2, + TracksWCovExtraPidPiKa const& tracks, + aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + } + PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterNUPC, "Run candidate creator using DCA fitter w/ PV refit and w/ centrality selection on UltraPeripheral Collision", false); + + /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection UPC + void processNoPvRefitWithDCAFitterNUPC(soa::Join const& collisions, + aod::Hf2Prongs const& rowsTrackIndexProng2, + TracksWCovExtraPidPiKa const& tracks, + aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + } + PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterNUPC, "Run candidate creator using DCA fitter w/o PV refit and w/ centrality selection UltraPeripheral Collision", false); + + /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on UPC + void processPvRefitWithKFParticleUPC(soa::Join const& collisions, + soa::Join const& rowsTrackIndexProng2, + TracksWCovExtraPidPiKa const& tracks, + aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + } + PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticleUPC, "Run candidate creator using KFParticle package w/ PV refit and w/ centrality selection on UltraPeripheral Collision", false); + + /// @brief process function using KFParticle package w/o PV refit and w/o centrality selections on UPC + void processNoPvRefitWithKFParticleUPC(soa::Join const& collisions, + aod::Hf2Prongs const& rowsTrackIndexProng2, + TracksWCovExtraPidPiKa const& tracks, + aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); + } + PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithKFParticleUPC, "Run candidate creator using KFParticle package w/o PV refit and w/ centrality selection on UltraPeripheral Collision", false); + /////////////////////////////////////////////////////////// /// /// /// Process functions only for collision monitoring /// @@ -682,6 +743,24 @@ struct HfCandidateCreator2Prong { } /// end loop over collisions } PROCESS_SWITCH(HfCandidateCreator2Prong, processCollisionsCentFT0M, "Collision monitoring - FT0M centrality", false); + + /// @brief process function to monitor collisions - UPC collision + void processCollisionsUPC(soa::Join const& collisions, aod::BCFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + /// loop over collisions + for (const auto& collision : collisions) { + + /// bitmask with event. selection info + float centrality{-1.f}; + float occupancy = getOccupancyColl(collision, OccupancyEstimator::Its); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + + /// monitor the satisfied event selections + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); + + } /// end loop over collisions + } + PROCESS_SWITCH(HfCandidateCreator2Prong, processCollisionsUPC, "Collision monitoring - UPC", false); }; /// Extends the base table with expression columns. diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 3460ff0a8a3..209e8ef043e 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -136,18 +136,21 @@ struct HfCandidateCreator3Prong { void init(InitContext const&) { - std::array doprocessDF{doprocessPvRefitWithDCAFitterN, doprocessNoPvRefitWithDCAFitterN, + std::array doprocessDF{doprocessPvRefitWithDCAFitterN, doprocessNoPvRefitWithDCAFitterN, doprocessPvRefitWithDCAFitterNCentFT0C, doprocessNoPvRefitWithDCAFitterNCentFT0C, - doprocessPvRefitWithDCAFitterNCentFT0M, doprocessNoPvRefitWithDCAFitterNCentFT0M}; - std::array doprocessKF{doprocessPvRefitWithKFParticle, doprocessNoPvRefitWithKFParticle, + doprocessPvRefitWithDCAFitterNCentFT0M, doprocessNoPvRefitWithDCAFitterNCentFT0M, doprocessPvRefitWithDCAFitterNUPC, doprocessNoPvRefitWithDCAFitterNUPC}; + std::array doprocessKF{doprocessPvRefitWithKFParticle, doprocessNoPvRefitWithKFParticle, doprocessPvRefitWithKFParticleCentFT0C, doprocessNoPvRefitWithKFParticleCentFT0C, - doprocessPvRefitWithKFParticleCentFT0M, doprocessNoPvRefitWithKFParticleCentFT0M}; + doprocessPvRefitWithKFParticleCentFT0M, doprocessNoPvRefitWithKFParticleCentFT0M, doprocessPvRefitWithKFParticleUPC, doprocessNoPvRefitWithKFParticleUPC}; if ((std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) + std::accumulate(doprocessKF.begin(), doprocessKF.end(), 0)) != 1) { LOGP(fatal, "One and only one process function must be enabled at a time."); } - - std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M}; + std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUPC}; const int nProcessesCollisions = std::accumulate(processesCollisions.begin(), processesCollisions.end(), 0); + + std::array processesCollisionsUPC = {doprocessPvRefitWithDCAFitterNUPC, doprocessNoPvRefitWithDCAFitterNUPC, doprocessPvRefitWithKFParticleUPC, doprocessNoPvRefitWithKFParticleUPC, doprocessCollisionsUPC}; + const int nProcessesCollisionsUPC = std::accumulate(processesCollisionsUPC.begin(), processesCollisionsUPC.end(), 0); + if (nProcessesCollisions > 1) { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); } @@ -162,7 +165,9 @@ struct HfCandidateCreator3Prong { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsCentFT0M\"?"); } } - + if (nProcessesCollisionsUPC > 1 && isRun2) { + LOGP(fatal, "Process function for UPC is only available in Run 3!"); + } std::array creationFlags = {createDplus, createDs, createLc, createXic}; if (std::accumulate(creationFlags.begin(), creationFlags.end(), 0) == 0) { LOGP(fatal, "At least one particle specie should be enabled for the creation."); @@ -236,11 +241,8 @@ struct HfCandidateCreator3Prong { } } - template - void runCreator3ProngWithDCAFitterN(Coll const&, - Cand const& rowsTrackIndexProng3, - TracksWCovExtraPidPiKaPr const&, - aod::BCsWithTimestamps const& /*bcWithTimeStamps*/) + template + void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, BCsType const& bcs) { // loop over triplets of track indices for (const auto& rowTrackIndexProng3 : rowsTrackIndexProng3) { @@ -248,7 +250,12 @@ struct HfCandidateCreator3Prong { /// reject candidates in collisions not satisfying the event selections auto collision = rowTrackIndexProng3.template collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + uint32_t rejectionMask{0}; + if constexpr (useUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + } else { + rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + } if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -264,7 +271,7 @@ struct HfCandidateCreator3Prong { /// Set the magnetic field from ccdb. /// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator, /// but this is not true when running on Run2 data/MC already converted into AO2Ds. - auto bc = collision.template bc_as(); + auto bc = collision.template bc_as(); if (runNumber != bc.runNumber()) { LOG(info) << ">>>>>>>>>>>> Current run number: " << runNumber; initCCDB(bc, runNumber, ccdb, isRun2 ? ccdbPathGrp : ccdbPathGrpMag, nullptr, isRun2); @@ -404,17 +411,22 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithKFParticle(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, - aod::BCsWithTimestamps const& /*bcWithTimeStamps*/) + BCsType const& bcs) { for (const auto& rowTrackIndexProng3 : rowsTrackIndexProng3) { /// reject candidates in collisions not satisfying the event selections auto collision = rowTrackIndexProng3.template collision_as(); float centrality{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + uint32_t rejectionMask{0}; + if constexpr (useUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + } else { + rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + } if (rejectionMask != 0) { /// at least one event selection not satisfied --> reject the candidate continue; @@ -654,7 +666,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithDCAFitterN, "Run candidate creator using DCA fitter with PV refit and w/o centrality selections", false); @@ -664,7 +676,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithDCAFitterN, "Run candidate creator using DCA fitter without PV refit and w/o centrality selections", true); @@ -674,7 +686,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithKFParticle, "Run candidate creator using KFParticle package with PV refit and w/o centrality selections", false); @@ -684,7 +696,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithKFParticle, "Run candidate creator using KFParticle package without PV refit and w/o centrality selections", false); @@ -700,7 +712,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithDCAFitterNCentFT0C, "Run candidate creator using DCA fitter with PV refit and w/ centrality selection on FT0C", false); @@ -710,7 +722,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithDCAFitterNCentFT0C, "Run candidate creator using DCA fitter without PV refit and w/ centrality selection on FT0C", false); @@ -720,7 +732,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithKFParticleCentFT0C, "Run candidate creator using KFParticle package with PV refit and w/ centrality selection on FT0C", false); @@ -730,7 +742,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithKFParticleCentFT0C, "Run candidate creator using KFParticle package without PV refit and w/ centrality selection on FT0C", false); @@ -746,7 +758,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithDCAFitterNCentFT0M, "Run candidate creator using DCA fitter with PV refit and w/ centrality selection on FT0M", false); @@ -756,7 +768,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithDCAFitterNCentFT0M, "Run candidate creator using DCA fitter without PV refit and w/ centrality selection on FT0M", false); @@ -766,7 +778,7 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithKFParticleCentFT0M, "Run candidate creator using KFParticle package with PV refit and w/ centrality selection on FT0M", false); @@ -776,10 +788,56 @@ struct HfCandidateCreator3Prong { TracksWCovExtraPidPiKaPr const& tracks, aod::BCsWithTimestamps const& bcWithTimeStamps) { - runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithKFParticleCentFT0M, "Run candidate creator using KFParticle package without PV refit and w/ centrality selection on FT0M", false); + ///////////////////////////////////////////// + /// /// + /// with centrality selection on UPC /// + /// /// + ///////////////////////////////////////////// + + /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on UPC + void processPvRefitWithDCAFitterNUPC(soa::Join const& collisions, + FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, + TracksWCovExtraPidPiKaPr const& tracks, + aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + } + PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithDCAFitterNUPC, "Run candidate creator using DCA fitter with PV refit and w/ centrality selection on UPC", false); + + /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection on UPC + void processNoPvRefitWithDCAFitterNUPC(soa::Join const& collisions, + FilteredHf3Prongs const& rowsTrackIndexProng3, + TracksWCovExtraPidPiKaPr const& tracks, + aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + } + PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithDCAFitterNUPC, "Run candidate creator using DCA fitter without PV refit and w/ centrality selection on UPC", false); + + /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on UPC + void processPvRefitWithKFParticleUPC(soa::Join const& collisions, + FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, + TracksWCovExtraPidPiKaPr const& tracks, + aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + } + PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithKFParticleUPC, "Run candidate creator using KFParticle package with PV refit and w/ centrality selection on UPC", false); + + /// @brief process function using KFParticle package w/o PV refit and w/ centrality selection on UPC + void processNoPvRefitWithKFParticleUPC(soa::Join const& collisions, + FilteredHf3Prongs const& rowsTrackIndexProng3, + TracksWCovExtraPidPiKaPr const& tracks, + aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); + } + PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithKFParticleUPC, "Run candidate creator using KFParticle package without PV refit and w/ centrality selection on UPC", false); + /////////////////////////////////////////////////////////// /// /// /// Process functions only for collision monitoring /// @@ -839,6 +897,24 @@ struct HfCandidateCreator3Prong { } /// end loop over collisions } PROCESS_SWITCH(HfCandidateCreator3Prong, processCollisionsCentFT0M, "Collision monitoring - FT0M centrality", false); + + /// @brief process function to monitor collisions - UPC + void processCollisionsUPC(soa::Join const& collisions, aod::BCFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + /// loop over collisions + for (const auto& collision : collisions) { + + /// bitmask with event. selection info + float centrality{-1.f}; + float occupancy = getOccupancyColl(collision, OccupancyEstimator::Its); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + + /// monitor the satisfied event selections + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); + + } /// end loop over collisions + } + PROCESS_SWITCH(HfCandidateCreator3Prong, processCollisionsUPC, "Collision monitoring - UPC", false); }; /// Extends the base table with expression columns. diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 5d57ffb5eff..9697ade5efa 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -18,11 +18,13 @@ #ifndef PWGHF_UTILS_UTILSEVSELHF_H_ #define PWGHF_UTILS_UTILSEVSELHF_H_ -#include +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGUD/Core/SGSelector.h" -#include -#include -#include +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" +#include "EventFiltering/Zorro.h" +#include "EventFiltering/ZorroSummary.h" #include #include @@ -30,18 +32,18 @@ #include #include -#include +#include +#include + +#include + +#include + #include +#include #include // std::shared_ptr #include // std::string -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" -#include "EventFiltering/Zorro.h" -#include "EventFiltering/ZorroSummary.h" - -#include "PWGHF/Core/CentralityEstimation.h" - namespace o2::hf_occupancy { // centrality selection estimators @@ -103,15 +105,25 @@ enum EventRejection { NoSameBunchPileup, Occupancy, NContrib, - Chi2, - PositionZ, NoCollInTimeRangeNarrow, NoCollInTimeRangeStandard, NoCollInRofStandard, + UpcEventCut, + Chi2, + PositionZ, NEventRejection }; +// upc event type, refer from PWGUD/Core/SGSelector.h +enum EventTypeUpc { + SingleGapA = 0, + SingleGapC = 1, + DoubleGap = 2, + NEventTypes = 3 +}; + o2::framework::AxisSpec axisEvents = {EventRejection::NEventRejection, -0.5f, +EventRejection::NEventRejection - 0.5f, ""}; +o2::framework::AxisSpec axisUPCEvents = {EventTypeUpc::NEventTypes, -0.5f, +EventTypeUpc::NEventTypes - 0.5f, ""}; /// \brief Function to put labels on monitoring histogram /// \param hRejection monitoring histogram @@ -128,6 +140,7 @@ void setEventRejectionLabels(Histo& hRejection, std::string softwareTriggerLabel hRejection->GetXaxis()->SetBinLabel(EventRejection::TvxTrigger + 1, "TVX Trigger"); hRejection->GetXaxis()->SetBinLabel(EventRejection::TimeFrameBorderCut + 1, "TF border"); hRejection->GetXaxis()->SetBinLabel(EventRejection::ItsRofBorderCut + 1, "ITS ROF border"); + hRejection->GetXaxis()->SetBinLabel(EventRejection::UpcEventCut + 1, "UPC event"); hRejection->GetXaxis()->SetBinLabel(EventRejection::IsGoodZvtxFT0vsPV + 1, "PV #it{z} consistency FT0 timing"); hRejection->GetXaxis()->SetBinLabel(EventRejection::NoSameBunchPileup + 1, "No same-bunch pile-up"); // POTENTIALLY BAD FOR BEAUTY ANALYSES hRejection->GetXaxis()->SetBinLabel(EventRejection::Occupancy + 1, "Occupancy"); @@ -172,6 +185,9 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable rctCheckZDC{"rctCheckZDC", false, "RCT flag to check whether the ZDC is present or not"}; o2::framework::Configurable rctTreatLimitedAcceptanceAsBad{"rctTreatLimitedAcceptanceAsBad", false, "RCT flag to reject events with limited acceptance for selected detectors"}; + // SG selector + SGSelector sgSelector; + // histogram names static constexpr char NameHistCollisions[] = "hCollisions"; static constexpr char NameHistSelCollisionsCent[] = "hSelCollisionsCent"; @@ -181,8 +197,9 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { static constexpr char NameHistPosYAfterEvSel[] = "hPosYAfterEvSel"; static constexpr char NameHistNumPvContributorsAfterSel[] = "hNumPvContributorsAfterSel"; static constexpr char NameHistCollisionsCentOcc[] = "hCollisionsCentOcc"; + static constexpr char NameHistUPC[] = "hUPCollisions"; - std::shared_ptr hCollisions, hSelCollisionsCent, hPosZBeforeEvSel, hPosZAfterEvSel, hPosXAfterEvSel, hPosYAfterEvSel, hNumPvContributorsAfterSel; + std::shared_ptr hCollisions, hSelCollisionsCent, hPosZBeforeEvSel, hPosZAfterEvSel, hPosXAfterEvSel, hPosYAfterEvSel, hNumPvContributorsAfterSel, hUPCollisions; std::shared_ptr hCollisionsCentOcc; // util to retrieve the RCT info from CCDB @@ -193,6 +210,21 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::OutputObj zorroSummary{"zorroSummary"}; int currentRun{-1}; + /// Set standard preselection gap trigger (values taken from UD group) + SGCutParHolder setSGPreselection() + { + SGCutParHolder sgCuts; + sgCuts.SetNDtcoll(1); // Minimum number of sigma around the collision + sgCuts.SetMinNBCs(2); // Minimum number of bunch crossings + sgCuts.SetNTracks(2, 1000); // Minimum and maximum number of PV contributors + sgCuts.SetMaxFITtime(34.f); // Maximum FIT time in ns + + // Set FIT amplitudes: FV0, FT0A, FT0C, FDDA, FDDC + sgCuts.SetFITAmpLimits({-1.f, 150.f, 50.f, -1.f, -1.f}); + + return sgCuts; + } + /// \brief Adds collision monitoring histograms in the histogram registry. /// \param registry reference to the histogram registry void addHistograms(o2::framework::HistogramRegistry& registry) @@ -205,7 +237,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hPosYAfterEvSel = registry.add(NameHistPosYAfterEvSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{200, -0.5, 0.5}}}); hNumPvContributorsAfterSel = registry.add(NameHistNumPvContributorsAfterSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{500, -0.5, 499.5}}}); setEventRejectionLabels(hCollisions, softwareTrigger); - + hUPCollisions = registry.add(NameHistUPC, "HF upc counter;;# of upc events", {o2::framework::HistType::kTH1D, {axisUPCEvents}}); const o2::framework::AxisSpec th2AxisCent{th2ConfigAxisCent, "Centrality"}; const o2::framework::AxisSpec th2AxisOccupancy{th2ConfigAxisOccupancy, "Occupancy"}; hCollisionsCentOcc = registry.add(NameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {th2AxisCent, th2AxisOccupancy}}); @@ -229,7 +261,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { addHistograms(registry); } - /// \brief Applies event selection. + /// \brief Applies event selection /// \tparam useEvSel use information from the EvSel table /// \tparam centEstimator centrality estimator /// \param collision collision to test against the selection criteria @@ -238,9 +270,9 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { /// \param registry reference to the histogram registry needed for zorro /// \return bitmask with the event selection criteria not satisfied by the collision template - uint16_t getHfCollisionRejectionMask(const Coll& collision, float& centrality, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry) + uint32_t getHfCollisionRejectionMask(const Coll& collision, float& centrality, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry) { - uint16_t rejectionMask{0}; // 16 bits, in case new ev. selections will be added + uint32_t rejectionMask{0}; // 32 bits, in case new ev. selections will be added if constexpr (centEstimator != o2::hf_centrality::CentralityEstimator::None) { centrality = o2::hf_centrality::getCentralityColl(collision, centEstimator); @@ -298,7 +330,6 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { } } } - /// number of PV contributors if (collision.numContrib() < nPvContributorsMin) { SETBIT(rejectionMask, EventRejection::NContrib); @@ -341,11 +372,32 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { return rejectionMask; } + template + uint32_t getHfCollisionRejectionMaskWithUPC(const Coll& collision, float& centrality, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry, const BCsType& bcs) + { + auto rejectionMaskWithUPC = getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + + if (useEvSel) { + SGCutParHolder sgCuts = setSGPreselection(); + auto bc = collision.template foundBC_as(); + auto bcRange = udhelpers::compatibleBCs(collision, sgCuts.NDtcoll(), bcs, sgCuts.minNBCs()); + auto sgSelectionResult = sgSelector.IsSelected(sgCuts, collision, bcRange, bc); + int upcEventType = sgSelectionResult.value; + if (upcEventType > EventTypeUpc::DoubleGap) { + SETBIT(rejectionMaskWithUPC, EventRejection::UpcEventCut); + } else { + hUPCollisions->Fill(upcEventType); + } + } + + return rejectionMaskWithUPC; + } + /// \brief Fills histograms for monitoring event selections satisfied by the collision. /// \param collision analysed collision /// \param rejectionMask bitmask storing the info about which ev. selections are not satisfied by the collision template - void fillHistograms(Coll const& collision, const uint16_t rejectionMask, float& centrality, float occupancy = -1) + void fillHistograms(Coll const& collision, const uint32_t rejectionMask, float& centrality, float occupancy = -1) { hCollisions->Fill(EventRejection::None); const float posZ = collision.posZ(); @@ -355,6 +407,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { if (TESTBIT(rejectionMask, reason)) { return; } + hCollisions->Fill(reason); } @@ -464,9 +517,9 @@ struct HfEventSelectionMc { /// \param centrality centrality variable to be set in this function /// \return a bitmask with the event selections not satisfied by the analysed collision template - uint16_t getHfMcCollisionRejectionMask(TMcColl const& mcCollision, CCs const& collSlice, float& centrality) + uint32_t getHfMcCollisionRejectionMask(TMcColl const& mcCollision, CCs const& collSlice, float& centrality) { - uint16_t rejectionMask{0}; + uint32_t rejectionMask{0}; float zPv = mcCollision.posZ(); auto bc = mcCollision.template bc_as(); @@ -515,7 +568,7 @@ struct HfEventSelectionMc { /// \param collision analysed collision /// \param rejectionMask bitmask storing the info about which ev. selections are not satisfied by the collision template - void fillHistograms(Coll const& mcCollision, const uint16_t rejectionMask, int nSplitColl = 0) + void fillHistograms(Coll const& mcCollision, const uint32_t rejectionMask, int nSplitColl = 0) { hParticles->Fill(EventRejection::None); From e7e45b981ae96064d174f7bef7e88ccdaa084a15 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Jun 2025 21:54:55 +0200 Subject: [PATCH 03/21] updates with final option --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 101 +-- PWGHF/Tasks/taskPidStudies.cxx | 592 ------------------ 2 files changed, 58 insertions(+), 635 deletions(-) delete mode 100644 PWGHF/Tasks/taskPidStudies.cxx diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 0f98525ceb1..5d15d1a83bf 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -21,23 +21,13 @@ /// \author Federica Zanone , Heidelberg University /// \author Ruiqi Yin , Fudan University -#include // std::find -#include // std::distance -#include // std::string -#include // std::vector - -#include "CommonConstants/PhysicsConstants.h" -#include "CCDB/BasicCCDBManager.h" // for PV refit -#include "DataFormatsParameters/GRPMagField.h" // for PV refit -#include "DataFormatsParameters/GRPObject.h" // for PV refit -#include "DCAFitter/DCAFitterN.h" -#include "DetectorsBase/Propagator.h" // for PV refit -#include "DetectorsVertexing/PVertexer.h" // for PV refit -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/V0.h" -#include "ReconstructionDataFormats/Vertex.h" // for PV refit +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" +#include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/Core/TrackSelectorPID.h" #include "Common/Core/trackUtilities.h" @@ -47,14 +37,23 @@ #include "Common/DataModel/TrackSelectionTables.h" #include "Tools/ML/MlResponse.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "CCDB/BasicCCDBManager.h" // for PV refit +#include "CommonConstants/PhysicsConstants.h" +#include "DCAFitter/DCAFitterN.h" +#include "DataFormatsParameters/GRPMagField.h" // for PV refit +#include "DataFormatsParameters/GRPObject.h" // for PV refit +#include "DetectorsBase/Propagator.h" // for PV refit +#include "DetectorsVertexing/PVertexer.h" // for PV refit +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "ReconstructionDataFormats/V0.h" +#include "ReconstructionDataFormats/Vertex.h" // for PV refit -#include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/Utils/utilsAnalysis.h" -#include "PWGHF/Utils/utilsBfieldCCDB.h" -#include "PWGHF/Utils/utilsEvSelHf.h" +#include // std::find +#include // std::distance +#include // std::string +#include // std::vector using namespace o2; using namespace o2::analysis; @@ -108,7 +107,7 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { void init(InitContext const&) { - std::array doProcess = {doprocessTrigAndCentFT0ASel, doprocessTrigAndCentFT0CSel, doprocessTrigAndCentFT0MSel, doprocessTrigAndCentFV0ASel, doprocessTrigSel, doprocessNoTrigSel}; + std::array doProcess = {doprocessTrigAndCentFT0ASel, doprocessTrigAndCentFT0CSel, doprocessTrigAndCentFT0MSel, doprocessTrigAndCentFV0ASel, doprocessTrigSel, doprocessNoTrigSel, doprocessUpcSel}; if (std::accumulate(doProcess.begin(), doProcess.end(), 0) != 1) { LOGP(fatal, "One and only one process function for collision selection can be enabled at a time!"); } @@ -132,11 +131,19 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { /// Collision selection /// \param collision collision table with - template - void selectCollision(const Col& collision, const BCs&) + template + void selectCollision(const Col& collision, const BCsType& bcs) { float centrality = -1.; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + uint32_t rejectionMask; + + if constexpr (applyUPCSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC( + collision, centrality, ccdb, registry, bcs); + } else { + rejectionMask = hfEvSel.getHfCollisionRejectionMask( + collision, centrality, ccdb, registry); + } if (fillHistograms) { hfEvSel.fillHistograms(collision, rejectionMask, centrality); @@ -155,46 +162,54 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { } /// Event selection with trigger and FT0A centrality selection - void processTrigAndCentFT0ASel(soa::Join::iterator const& collision, aod::BCsWithTimestamps const& bcs) + void + processTrigAndCentFT0ASel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) { - selectCollision(collision, bcs); + selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0ASel, "Use trigger and centrality selection with FT0A", false); /// Event selection with trigger and FT0C centrality selection - void processTrigAndCentFT0CSel(soa::Join::iterator const& collision, aod::BCsWithTimestamps const& bcs) + void processTrigAndCentFT0CSel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) { - selectCollision(collision, bcs); + selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0CSel, "Use trigger and centrality selection with FT0C", false); /// Event selection with trigger and FT0M centrality selection - void processTrigAndCentFT0MSel(soa::Join::iterator const& collision, aod::BCsWithTimestamps const& bcs) + void processTrigAndCentFT0MSel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) { - selectCollision(collision, bcs); + selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0MSel, "Use trigger and centrality selection with FT0M", false); /// Event selection with trigger and FV0A centrality selection - void processTrigAndCentFV0ASel(soa::Join::iterator const& collision, aod::BCsWithTimestamps const& bcs) + void processTrigAndCentFV0ASel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) { - selectCollision(collision, bcs); + selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFV0ASel, "Use trigger and centrality selection with FV0A", false); /// Event selection with trigger selection - void processTrigSel(soa::Join::iterator const& collision, aod::BCsWithTimestamps const& bcs) + void processTrigSel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) { - selectCollision(collision, bcs); + selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigSel, "Use trigger selection", false); /// Event selection without trigger selection - void processNoTrigSel(aod::Collision const& collision, aod::BCsWithTimestamps const& bcs) + void processNoTrigSel(aod::Collision const& collision, aod::BCFullInfos const& bcs) { - selectCollision(collision, bcs); + selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processNoTrigSel, "Do not use trigger selection", true); + + /// Event selection with UPC + void processUpcSel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + { + selectCollision(collision, bcs); + } + PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processUpcSel, "Use upc selection", false); }; /// Track selection @@ -1246,7 +1261,7 @@ struct HfTrackIndexSkimCreator { using FilteredTrackAssocSel = soa::Filtered>; // filter collisions - Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast(0)); + Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast(0)); // filter track indices Filter filterSelectTrackIds = ((aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::Cand2Prong))) != 0u) || ((aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::Cand3Prong))) != 0u) || ((aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandDstar))) != 0u); @@ -3058,7 +3073,7 @@ struct HfTrackIndexSkimCreatorCascades { using SelectedCollisions = soa::Filtered>; using FilteredTrackAssocSel = soa::Filtered>; - Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast(0)); + Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast(0)); Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandV0bachelor))) != 0u && (config.applyProtonPid == false || (aod::hf_sel_track::isIdentifiedPid & static_cast(BIT(ChannelsProtonPid::LcToPK0S))) != 0u); Preslice trackIndicesPerCollision = aod::track_association::collisionId; @@ -3337,7 +3352,7 @@ struct HfTrackIndexSkimCreatorLfCascades { using CascFull = soa::Join; using V0Full = soa::Join; - Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast(0)); + Filter filterSelectCollisions = (aod::hf_sel_collision::whyRejectColl == static_cast(0)); Filter filterSelectTrackIds = (aod::hf_sel_track::isSelProng & static_cast(BIT(CandidateType::CandCascadeBachelor))) != 0u; Preslice tracksPerCollision = aod::track::collisionId; // needed for PV refit diff --git a/PWGHF/Tasks/taskPidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx deleted file mode 100644 index 5729729eed5..00000000000 --- a/PWGHF/Tasks/taskPidStudies.cxx +++ /dev/null @@ -1,592 +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. - -/// \file taskPidStudies.cxx -/// \brief task for studies of PID performance -/// -/// \author Fabrizio Chinu , Università and INFN Torino -/// \author Stefano Politanò , INFN Torino -/// \author Marcello Di Costanzo , Politecnico and INFN Torino -/// \author Luca Aglietta , Università and INFN Torino - -#include -#include - -#include "TPDGCode.h" - -#include "CCDB/BasicCCDBManager.h" -#include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" -#include "Framework/HistogramRegistry.h" - -#include "Common/CCDB/ctpRateFetcher.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/Multiplicity.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/TrackSelectionTables.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" -#include "PWGLF/DataModel/LFStrangenessPIDTables.h" -#include "PWGHF/Utils/utilsEvSelHf.h" -#include "PWGHF/Core/CentralityEstimation.h" - -using namespace o2; -using namespace o2::framework; -using namespace o2::framework::expressions; -using namespace o2::hf_evsel; -using namespace o2::hf_centrality; - -enum Particle { NotMatched = 0, - K0s, - Lambda, - Omega }; - -enum TrackCuts { All = 0, - HasIts, - HasTpc, - TpcNClsCrossedRows, - Eta, - Pt, - TpcChi2NCls, - ItsChi2NCls, - NCuts }; - -namespace o2::aod -{ -namespace pid_studies -{ -// V0s -DECLARE_SOA_COLUMN(MassK0, massK0, float); //! Candidate mass -DECLARE_SOA_COLUMN(MassLambda, massLambda, float); //! Candidate mass -DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Candidate mass -DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of the candidate (GeV/c) -DECLARE_SOA_COLUMN(PtPos, ptPos, float); //! Transverse momentum of positive track (GeV/c) -DECLARE_SOA_COLUMN(PtNeg, ptNeg, float); //! Transverse momentum of negative track (GeV/c) -DECLARE_SOA_COLUMN(PtPosTpc, ptPosTpc, float); //! Transverse Momentum of positive track at inner wall of TPC (GeV/c) -DECLARE_SOA_COLUMN(PtNegTpc, ptNegTpc, float); //! Transverse Momentum of negative track at inner wall of TPC (GeV/c) -DECLARE_SOA_COLUMN(Radius, radius, float); //! Radius -DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle -DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float); //! DCA between V0 daughters -DECLARE_SOA_COLUMN(DcaV0ToPv, dcaV0ToPv, float); //! DCA V0 to PV -DECLARE_SOA_COLUMN(NSigmaTpcPosPi, nSigmaTpcPosPi, float); //! nSigmaTPC of positive track with pion hypothesis -DECLARE_SOA_COLUMN(NSigmaTpcNegPi, nSigmaTpcNegPi, float); //! nSigmaTPC of negative track with pion hypothesis -DECLARE_SOA_COLUMN(NSigmaTpcPosPr, nSigmaTpcPosPr, float); //! nSigmaTPC of positive track with proton hypothesis -DECLARE_SOA_COLUMN(NSigmaTpcNegPr, nSigmaTpcNegPr, float); //! nSigmaTPC of negative track with proton hypothesis -DECLARE_SOA_COLUMN(NSigmaTofPosPi, nSigmaTofPosPi, float); //! nSigmaTOF of positive track with pion hypothesis -DECLARE_SOA_COLUMN(NSigmaTofNegPi, nSigmaTofNegPi, float); //! nSigmaTOF of negative track with pion hypothesis -DECLARE_SOA_COLUMN(NSigmaTofPosPr, nSigmaTofPosPr, float); //! nSigmaTOF of positive track with proton hypothesis -DECLARE_SOA_COLUMN(NSigmaTofNegPr, nSigmaTofNegPr, float); //! nSigmaTOF of negative track with proton hypothesis -DECLARE_SOA_COLUMN(AlphaArm, alphaArm, float); //! Armenteros alpha -DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt - -// Cascades -DECLARE_SOA_COLUMN(MassOmega, massOmega, float); //! Candidate mass -DECLARE_SOA_COLUMN(MassXi, massXi, float); //! Candidate mass -DECLARE_SOA_COLUMN(PtBach, ptBach, float); //! Transverse momentum of the bachelor (GeV/c) -DECLARE_SOA_COLUMN(PtBachTpc, ptBachTpc, float); //! Transverse momentum of the bachelor at inner wall of TPC (GeV/c) -DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! Daughter lambda mass (GeV/c^2) -DECLARE_SOA_COLUMN(V0cosPA, v0cosPA, float); //! V0 CPA -DECLARE_SOA_COLUMN(CascCosPa, cascCosPa, float); //! Cascade CPA -DECLARE_SOA_COLUMN(NSigmaTpcBachKa, nSigmaTpcBachKa, float); //! nSigmaTPC of bachelor with kaon hypothesis -DECLARE_SOA_COLUMN(NSigmaTofBachKa, nSigmaTofBachKa, float); //! nSigmaTOF of bachelor with kaon hypothesis - -// Common columns -DECLARE_SOA_COLUMN(OccupancyFt0c, occupancyFt0c, float); //! Occupancy from FT0C -DECLARE_SOA_COLUMN(OccupancyIts, occupancyIts, float); //! Occupancy from ITS -DECLARE_SOA_COLUMN(CentralityFT0C, centralityFT0C, float); //! Centrality from FT0C -DECLARE_SOA_COLUMN(CentralityFT0M, centralityFT0M, float); //! Centrality from FT0M -DECLARE_SOA_COLUMN(InteractionRate, interactionRate, double); //! Centrality from FT0M -DECLARE_SOA_COLUMN(CandFlag, candFlag, int); //! Flag for MC matching -} // namespace pid_studies - -DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information - pid_studies::MassK0, - pid_studies::MassLambda, - pid_studies::MassAntiLambda, - pid_studies::Pt, - pid_studies::PtPos, - pid_studies::PtNeg, - pid_studies::PtPosTpc, - pid_studies::PtNegTpc, - pid_studies::Radius, - pid_studies::Cpa, - pid_studies::DcaV0Daughters, - pid_studies::DcaV0ToPv, - pid_studies::NSigmaTpcPosPi, - pid_studies::NSigmaTpcNegPi, - pid_studies::NSigmaTpcPosPr, - pid_studies::NSigmaTpcNegPr, - pid_studies::NSigmaTofPosPi, - pid_studies::NSigmaTofNegPi, - pid_studies::NSigmaTofPosPr, - pid_studies::NSigmaTofNegPr, - pid_studies::AlphaArm, - pid_studies::QtArm, - pid_studies::OccupancyFt0c, - pid_studies::OccupancyIts, - pid_studies::CentralityFT0C, - pid_studies::CentralityFT0M, - pid_studies::InteractionRate, - pid_studies::CandFlag); - -DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID information - pid_studies::MassOmega, - pid_studies::Pt, - pid_studies::PtBach, - pid_studies::PtBachTpc, - pid_studies::Radius, - pid_studies::MLambda, - pid_studies::V0cosPA, - pid_studies::MassXi, - pid_studies::CascCosPa, - pid_studies::DcaV0Daughters, - pid_studies::DcaV0ToPv, - pid_studies::NSigmaTpcBachKa, - pid_studies::NSigmaTofBachKa, - pid_studies::OccupancyFt0c, - pid_studies::OccupancyIts, - pid_studies::CentralityFT0C, - pid_studies::CentralityFT0M, - pid_studies::InteractionRate, - pid_studies::CandFlag); -} // namespace o2::aod - -struct HfTaskPidStudies { - Produces pidV0; - Produces pidCascade; - - Configurable applyEvSels{"applyEvSels", true, "Apply event selections"}; - Configurable applyTrackSels{"applyTrackSels", true, "Apply track selections"}; - Configurable tpcNClsCrossedRowsTrackMin{"tpcNClsCrossedRowsTrackMin", 70, "Minimum number of crossed rows in TPC"}; - Configurable etaTrackMax{"etaTrackMax", 0.8, "Maximum pseudorapidity"}; - Configurable ptTrackMin{"ptTrackMin", 0.1, "Minimum transverse momentum"}; - Configurable tpcChi2NClTrackMax{"tpcChi2NClTrackMax", 4, "Maximum TPC chi2 per number of TPC clusters"}; - Configurable itsChi2NClTrackMax{"itsChi2NClTrackMax", 36, "Maximum ITS chi2 per number of ITS clusters"}; - Configurable massK0Min{"massK0Min", 0.4, "Minimum mass for K0"}; - Configurable massK0Max{"massK0Max", 0.6, "Maximum mass for K0"}; - Configurable massLambdaMin{"massLambdaMin", 1.0, "Minimum mass for lambda"}; - Configurable massLambdaMax{"massLambdaMax", 1.3, "Maximum mass for lambda"}; - Configurable massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"}; - Configurable massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"}; - Configurable interactionRateMin{"interactionRateMin", -1, "Minimum interaction rate (kHz)"}; - Configurable interactionRateMax{"interactionRateMax", 1.e20, "Maximum interaction rate (kHz)"}; - Configurable radiusMax{"radiusMax", 2.3, "Maximum decay radius (cm)"}; - Configurable cosPaMin{"cosPaMin", 0.98, "Minimum cosine of pointing angle"}; - Configurable dcaV0DaughtersMax{"dcaV0DaughtersMax", 0.2, "Maximum DCA among the V0 daughters (cm)"}; - Configurable dcaV0ToPvMax{"dcaV0ToPvMax", 0.2, "Maximum DCA of the V0 from the primary vertex (cm)"}; - Configurable cosPaV0Min{"cosPaV0Min", 0.95, "Minimum cosine of pointing angle for V0 stemming from cascade decays"}; - Configurable qtArmenterosMinForK0{"qtArmenterosMinForK0", 0.12, "Minimum Armenteros' qt for K0"}; - Configurable qtArmenterosMaxForLambda{"qtArmenterosMaxForLambda", 0.12, "Minimum Armenteros' qt for (anti)Lambda"}; - Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"}; - Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; - Configurable ctpFetcherSource{"ctpFetcherSource", "T0VTX", "Source for CTP rate fetching, e.g. T0VTX, T0CE, T0SC, ZNC (hadronic)"}; - Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; - - using PidTracks = soa::Join; - using CollSels = soa::Join; - using CollisionsMc = soa::Join; - using V0sMcRec = soa::Join; - using CascsMcRec = soa::Join; - using BCs = soa::Join; - - ctpRateFetcher rateFetcher; - HfEventSelection hfEvSel; - HfEventSelectionMc hfEvSelMc; - double interactionRate{-1.}; - - o2::framework::Service ccdb; - HistogramRegistry registry{"registry", {}}; - - void init(InitContext&) - { - if ((doprocessV0Mc && doprocessV0Data) || (doprocessCascMc && doprocessCascData)) { - LOGP(fatal, "Both data and MC process functions were enabled! Please check your configuration!"); - } - ccdb->setURL(ccdbUrl); - ccdb->setCaching(true); - ccdb->setLocalObjectValidityChecking(); - hfEvSel.addHistograms(registry); - - std::shared_ptr hTrackSel = registry.add("hTrackSel", "Track selection;;Counts", {HistType::kTH1F, {{TrackCuts::NCuts, 0, TrackCuts::NCuts}}}); - - // Set Labels for hTrackSel - hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::All + 1, "All"); - hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::HasIts + 1, "HasITS"); - hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::HasTpc + 1, "HasTPC"); - hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::TpcNClsCrossedRows + 1, "TPC NCls/CrossedRows"); - hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::Eta + 1, "#eta"); - hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::Pt + 1, "#it{p}_{T}"); - hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::TpcChi2NCls + 1, "TPC #chi^{2}/NCls"); - hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::ItsChi2NCls + 1, "ITS #chi^{2}/NCls"); - } - - template - void fillTree(Cand const& candidate, const int flag) - { - float pseudoRndm = candidate.pt() * 1000. - static_cast(candidate.pt() * 1000); - if (candidate.pt() < ptMaxForDownSample && pseudoRndm > downSampleBkgFactor) { - return; - } - - const auto& coll = candidate.template collision_as(); - if constexpr (isV0) { - const auto& posTrack = candidate.template posTrack_as(); - const auto& negTrack = candidate.template negTrack_as(); - pidV0( - candidate.mK0Short(), - candidate.mLambda(), - candidate.mAntiLambda(), - candidate.pt(), - posTrack.pt(), - negTrack.pt(), - posTrack.tpcInnerParam() / std::cosh(candidate.positiveeta()), - negTrack.tpcInnerParam() / std::cosh(candidate.negativeeta()), - candidate.v0radius(), - candidate.v0cosPA(), - candidate.dcaV0daughters(), - candidate.dcav0topv(), - posTrack.tpcNSigmaPi(), - negTrack.tpcNSigmaPi(), - posTrack.tpcNSigmaPr(), - negTrack.tpcNSigmaPr(), - posTrack.tofNSigmaPi(), - negTrack.tofNSigmaPi(), - posTrack.tofNSigmaPr(), - negTrack.tofNSigmaPr(), - candidate.alpha(), - candidate.qtarm(), - coll.ft0cOccupancyInTimeRange(), - coll.trackOccupancyInTimeRange(), - coll.centFT0C(), - coll.centFT0M(), - interactionRate, - flag); - } else { - const auto& bachTrack = candidate.template bachelor_as(); - pidCascade( - candidate.mOmega(), - candidate.pt(), - candidate.bachelorpt(), - bachTrack.tpcInnerParam() / std::cosh(candidate.bacheloreta()), - candidate.cascradius(), - candidate.mLambda(), - candidate.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), - candidate.mXi(), - candidate.casccosPA(coll.posX(), coll.posY(), coll.posZ()), - candidate.dcaV0daughters(), - candidate.dcav0topv(coll.posX(), coll.posY(), coll.posZ()), - bachTrack.tpcNSigmaKa(), - bachTrack.tofNSigmaKa(), - coll.ft0cOccupancyInTimeRange(), - coll.trackOccupancyInTimeRange(), - coll.centFT0C(), - coll.centFT0M(), - interactionRate, - flag); - } - } - - template - int isMatched(const T1& cand) - { - if constexpr (std::is_same::value) { - if (!cand.has_v0MCCore()) { - return Particle::NotMatched; - } - auto v0MC = cand.template v0MCCore_as(); - if (v0MC.pdgCode() == kK0Short && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kPiPlus) { - return Particle::K0s; - } - if (v0MC.pdgCode() == kLambda0 && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kProton) { - return Particle::Lambda; - } - if (v0MC.pdgCode() == -kLambda0 && v0MC.pdgCodeNegative() == -kProton && v0MC.pdgCodePositive() == kPiPlus) { - return -Particle::Lambda; - } - } - if constexpr (std::is_same::value) { - if (!cand.has_cascMCCore()) { - return Particle::NotMatched; - } - auto cascMC = cand.template cascMCCore_as(); - if (cascMC.pdgCode() == kOmegaMinus && - cascMC.pdgCodeBachelor() == -kKPlus && - cascMC.pdgCodeV0() == kLambda0 && - cascMC.pdgCodePositive() == kProton && - cascMC.pdgCodeNegative() == -kPiPlus) { - return Particle::Omega; - } - if (cascMC.pdgCode() == -kOmegaMinus && - cascMC.pdgCodeBachelor() == kKPlus && - cascMC.pdgCodeV0() == -kLambda0 && - cascMC.pdgCodePositive() == kPiPlus && - cascMC.pdgCodeNegative() == -kProton) { - return -Particle::Omega; - } - } - return Particle::NotMatched; - } - - template - bool isCollSelected(const Coll& coll, const BCs& bcs) - { - auto bc = coll.template bc_as(); - interactionRate = rateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), ctpFetcherSource.value) * 1.e-3; // convert to kHz - if (interactionRate < interactionRateMin || interactionRate > interactionRateMax) { - return false; - } - - float cent{-1.f}; - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(coll, cent, ccdb, registry, bcs); - /// monitor the satisfied event selections - hfEvSel.fillHistograms(coll, rejectionMask, cent); - return rejectionMask == 0; - } - - template - bool isTrackSelected(const T1& candidate) - { - const auto& posTrack = candidate.template posTrack_as(); - const auto& negTrack = candidate.template negTrack_as(); - registry.fill(HIST("hTrackSel"), TrackCuts::All); - if constexpr (isV0) { - if (!posTrack.hasITS() || !negTrack.hasITS()) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::HasIts); - if (!posTrack.hasTPC() || !negTrack.hasTPC()) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::HasTpc); - if (posTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin || negTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::TpcNClsCrossedRows); - if (std::abs(posTrack.eta()) > etaTrackMax || std::abs(negTrack.eta()) > etaTrackMax) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::Eta); - if (posTrack.pt() < ptTrackMin || negTrack.pt() < ptTrackMin) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::Pt); - if (posTrack.tpcChi2NCl() > tpcChi2NClTrackMax || negTrack.tpcChi2NCl() > tpcChi2NClTrackMax) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::TpcChi2NCls); - if (posTrack.itsChi2NCl() > itsChi2NClTrackMax || negTrack.itsChi2NCl() > itsChi2NClTrackMax) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::ItsChi2NCls); - } else { - const auto& bachTrack = candidate.template bachelor_as(); - if (!posTrack.hasITS() || !negTrack.hasITS() || !bachTrack.hasITS()) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::HasIts); - if (!posTrack.hasTPC() || !negTrack.hasTPC() || !bachTrack.hasTPC()) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::HasTpc); - if (posTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin || negTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin || bachTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::TpcNClsCrossedRows); - if (std::abs(posTrack.eta()) > etaTrackMax || std::abs(negTrack.eta()) > etaTrackMax || std::abs(bachTrack.eta()) > etaTrackMax) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::Eta); - if (posTrack.pt() < ptTrackMin || negTrack.pt() < ptTrackMin || bachTrack.pt() < ptTrackMin) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::Pt); - if (posTrack.tpcChi2NCl() > tpcChi2NClTrackMax || negTrack.tpcChi2NCl() > tpcChi2NClTrackMax || bachTrack.tpcChi2NCl() > tpcChi2NClTrackMax) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::TpcChi2NCls); - if (posTrack.itsChi2NCl() > itsChi2NClTrackMax || negTrack.itsChi2NCl() > itsChi2NClTrackMax || bachTrack.itsChi2NCl() > itsChi2NClTrackMax) { - return false; - } - registry.fill(HIST("hTrackSel"), TrackCuts::ItsChi2NCls); - } - return true; - } - - template - bool isSelectedV0AsK0s(const V0Cand& v0) - { - if (v0.mK0Short() < massK0Min || v0.mK0Short() > massK0Max) { - return false; - } - if (v0.qtarm() < qtArmenterosMinForK0) { - return false; - } - if (v0.v0radius() > radiusMax) { - return false; - } - if (v0.v0cosPA() < cosPaMin) { - return false; - } - if (v0.dcaV0daughters() > dcaV0DaughtersMax) { - return false; - } - if (v0.dcav0topv() > dcaV0ToPvMax) { - return false; - } - return true; - } - - template - bool isSelectedV0AsLambda(const V0Cand& v0) - { - if ((v0.mLambda() < massLambdaMin || v0.mLambda() > massLambdaMax) && - (v0.mAntiLambda() < massLambdaMin || v0.mAntiLambda() > massLambdaMax)) { - return false; - } - if (v0.qtarm() > qtArmenterosMaxForLambda) { - return false; - } - if (v0.v0radius() > radiusMax) { - return false; - } - if (v0.v0cosPA() < cosPaMin) { - return false; - } - if (v0.dcaV0daughters() > dcaV0DaughtersMax) { - return false; - } - if (v0.dcav0topv() > dcaV0ToPvMax) { - return false; - } - return true; - } - - template - bool isSelectedCascAsOmega(const CascCand& casc) - { - if (casc.mOmega() < massOmegaMin || casc.mOmega() > massOmegaMax) { - return false; - } - if (casc.mLambda() < massLambdaMin || casc.mLambda() > massLambdaMax) { - return false; - } - if (casc.cascradius() > radiusMax) { - return false; - } - const auto& coll = casc.template collision_as(); - if (casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()) < cosPaMin) { - return false; - } - if (casc.dcaV0daughters() > dcaV0DaughtersMax) { - return false; - } - if (casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ()) > dcaV0ToPvMax) { - return false; - } - if (casc.v0cosPA(coll.posX(), coll.posY(), coll.posZ()) < cosPaV0Min) { - return false; - } - return true; - } - - void processV0Mc(CollisionsMc const& /*mcCollisions*/, - V0sMcRec const& V0s, - aod::V0MCCores const&, - aod::McParticles const& /*particlesMc*/, - PidTracks const& /*tracks*/, - BCs const& bcs) - { - for (const auto& v0 : V0s) { - if (applyEvSels && !isCollSelected(v0.collision_as(), bcs)) { - continue; - } - if (applyTrackSels && !isTrackSelected(v0)) { - continue; - } - if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { - int matched = isMatched(v0); - if (matched != Particle::NotMatched) { - fillTree(v0, matched); - } - } - } - } - PROCESS_SWITCH(HfTaskPidStudies, processV0Mc, "Process MC", true); - - void processV0Data(aod::V0Datas const& V0s, - PidTracks const&, - BCs const& bcs, - CollSels const&) - { - for (const auto& v0 : V0s) { - if (applyEvSels && !isCollSelected(v0.collision_as(), bcs)) { - continue; - } - if (applyTrackSels && !isTrackSelected(v0)) { - continue; - } - if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { - fillTree(v0, Particle::NotMatched); - } - } - } - PROCESS_SWITCH(HfTaskPidStudies, processV0Data, "Process data", false); - - void processCascMc(CollisionsMc const& /*mcCollisions*/, - CascsMcRec const& cascades, - aod::CascMCCores const&, - aod::McParticles const& /*particlesMc*/, - PidTracks const&, - BCs const& bcs) - { - for (const auto& casc : cascades) { - if (applyEvSels && !isCollSelected(casc.collision_as(), bcs)) { - continue; - } - if (applyTrackSels && !isTrackSelected(casc)) { - continue; - } - if (isSelectedCascAsOmega(casc)) { - int matched = isMatched(casc); - if (matched != Particle::NotMatched) { - fillTree(casc, matched); - } - } - } - } - PROCESS_SWITCH(HfTaskPidStudies, processCascMc, "Process MC", true); - - void processCascData(aod::CascDatas const& cascades, - PidTracks const&, - BCs const& bcs, - CollSels const&) - { - for (const auto& casc : cascades) { - if (applyEvSels && !isCollSelected(casc.collision_as(), bcs)) { - continue; - } - if (applyTrackSels && !isTrackSelected(casc)) { - continue; - } - if (isSelectedCascAsOmega(casc)) { - fillTree(casc, Particle::NotMatched); - } - } - } - PROCESS_SWITCH(HfTaskPidStudies, processCascData, "Process data", false); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{adaptAnalysisTask(cfgc)}; -} From 5ca7b8173a567743b6669ef37089e5de2e805da5 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Jun 2025 21:57:25 +0200 Subject: [PATCH 04/21] restore the file by mistake --- PWGHF/Tasks/taskPidStudies.cxx | 591 +++++++++++++++++++++++++++++++++ 1 file changed, 591 insertions(+) create mode 100644 PWGHF/Tasks/taskPidStudies.cxx diff --git a/PWGHF/Tasks/taskPidStudies.cxx b/PWGHF/Tasks/taskPidStudies.cxx new file mode 100644 index 00000000000..ad3943a7134 --- /dev/null +++ b/PWGHF/Tasks/taskPidStudies.cxx @@ -0,0 +1,591 @@ +// 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 taskPidStudies.cxx +/// \brief task for studies of PID performance +/// +/// \author Fabrizio Chinu , Università and INFN Torino +/// \author Stefano Politanò , INFN Torino +/// \author Marcello Di Costanzo , Politecnico and INFN Torino +/// \author Luca Aglietta , Università and INFN Torino + +#include +#include + +#include "TPDGCode.h" + +#include "CCDB/BasicCCDBManager.h" +#include "Framework/AnalysisTask.h" +#include "Framework/runDataProcessing.h" +#include "Framework/HistogramRegistry.h" + +#include "Common/CCDB/ctpRateFetcher.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "PWGLF/DataModel/LFStrangenessTables.h" +#include "PWGLF/DataModel/LFStrangenessPIDTables.h" +#include "PWGHF/Utils/utilsEvSelHf.h" +#include "PWGHF/Core/CentralityEstimation.h" + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::hf_evsel; +using namespace o2::hf_centrality; + +enum Particle { NotMatched = 0, + K0s, + Lambda, + Omega }; + +enum TrackCuts { All = 0, + HasIts, + HasTpc, + TpcNClsCrossedRows, + Eta, + Pt, + TpcChi2NCls, + ItsChi2NCls, + NCuts }; + +namespace o2::aod +{ +namespace pid_studies +{ +// V0s +DECLARE_SOA_COLUMN(MassK0, massK0, float); //! Candidate mass +DECLARE_SOA_COLUMN(MassLambda, massLambda, float); //! Candidate mass +DECLARE_SOA_COLUMN(MassAntiLambda, massAntiLambda, float); //! Candidate mass +DECLARE_SOA_COLUMN(Pt, pt, float); //! Transverse momentum of the candidate (GeV/c) +DECLARE_SOA_COLUMN(PtPos, ptPos, float); //! Transverse momentum of positive track (GeV/c) +DECLARE_SOA_COLUMN(PtNeg, ptNeg, float); //! Transverse momentum of negative track (GeV/c) +DECLARE_SOA_COLUMN(PtPosTpc, ptPosTpc, float); //! Transverse Momentum of positive track at inner wall of TPC (GeV/c) +DECLARE_SOA_COLUMN(PtNegTpc, ptNegTpc, float); //! Transverse Momentum of negative track at inner wall of TPC (GeV/c) +DECLARE_SOA_COLUMN(Radius, radius, float); //! Radius +DECLARE_SOA_COLUMN(Cpa, cpa, float); //! Cosine of pointing angle +DECLARE_SOA_COLUMN(DcaV0Daughters, dcaV0Daughters, float); //! DCA between V0 daughters +DECLARE_SOA_COLUMN(DcaV0ToPv, dcaV0ToPv, float); //! DCA V0 to PV +DECLARE_SOA_COLUMN(NSigmaTpcPosPi, nSigmaTpcPosPi, float); //! nSigmaTPC of positive track with pion hypothesis +DECLARE_SOA_COLUMN(NSigmaTpcNegPi, nSigmaTpcNegPi, float); //! nSigmaTPC of negative track with pion hypothesis +DECLARE_SOA_COLUMN(NSigmaTpcPosPr, nSigmaTpcPosPr, float); //! nSigmaTPC of positive track with proton hypothesis +DECLARE_SOA_COLUMN(NSigmaTpcNegPr, nSigmaTpcNegPr, float); //! nSigmaTPC of negative track with proton hypothesis +DECLARE_SOA_COLUMN(NSigmaTofPosPi, nSigmaTofPosPi, float); //! nSigmaTOF of positive track with pion hypothesis +DECLARE_SOA_COLUMN(NSigmaTofNegPi, nSigmaTofNegPi, float); //! nSigmaTOF of negative track with pion hypothesis +DECLARE_SOA_COLUMN(NSigmaTofPosPr, nSigmaTofPosPr, float); //! nSigmaTOF of positive track with proton hypothesis +DECLARE_SOA_COLUMN(NSigmaTofNegPr, nSigmaTofNegPr, float); //! nSigmaTOF of negative track with proton hypothesis +DECLARE_SOA_COLUMN(AlphaArm, alphaArm, float); //! Armenteros alpha +DECLARE_SOA_COLUMN(QtArm, qtArm, float); //! Armenteros Qt + +// Cascades +DECLARE_SOA_COLUMN(MassOmega, massOmega, float); //! Candidate mass +DECLARE_SOA_COLUMN(MassXi, massXi, float); //! Candidate mass +DECLARE_SOA_COLUMN(PtBach, ptBach, float); //! Transverse momentum of the bachelor (GeV/c) +DECLARE_SOA_COLUMN(PtBachTpc, ptBachTpc, float); //! Transverse momentum of the bachelor at inner wall of TPC (GeV/c) +DECLARE_SOA_COLUMN(MLambda, mLambda, float); //! Daughter lambda mass (GeV/c^2) +DECLARE_SOA_COLUMN(V0cosPA, v0cosPA, float); //! V0 CPA +DECLARE_SOA_COLUMN(CascCosPa, cascCosPa, float); //! Cascade CPA +DECLARE_SOA_COLUMN(NSigmaTpcBachKa, nSigmaTpcBachKa, float); //! nSigmaTPC of bachelor with kaon hypothesis +DECLARE_SOA_COLUMN(NSigmaTofBachKa, nSigmaTofBachKa, float); //! nSigmaTOF of bachelor with kaon hypothesis + +// Common columns +DECLARE_SOA_COLUMN(OccupancyFt0c, occupancyFt0c, float); //! Occupancy from FT0C +DECLARE_SOA_COLUMN(OccupancyIts, occupancyIts, float); //! Occupancy from ITS +DECLARE_SOA_COLUMN(CentralityFT0C, centralityFT0C, float); //! Centrality from FT0C +DECLARE_SOA_COLUMN(CentralityFT0M, centralityFT0M, float); //! Centrality from FT0M +DECLARE_SOA_COLUMN(InteractionRate, interactionRate, double); //! Centrality from FT0M +DECLARE_SOA_COLUMN(CandFlag, candFlag, int); //! Flag for MC matching +} // namespace pid_studies + +DECLARE_SOA_TABLE(PidV0s, "AOD", "PIDV0S", //! Table with PID information + pid_studies::MassK0, + pid_studies::MassLambda, + pid_studies::MassAntiLambda, + pid_studies::Pt, + pid_studies::PtPos, + pid_studies::PtNeg, + pid_studies::PtPosTpc, + pid_studies::PtNegTpc, + pid_studies::Radius, + pid_studies::Cpa, + pid_studies::DcaV0Daughters, + pid_studies::DcaV0ToPv, + pid_studies::NSigmaTpcPosPi, + pid_studies::NSigmaTpcNegPi, + pid_studies::NSigmaTpcPosPr, + pid_studies::NSigmaTpcNegPr, + pid_studies::NSigmaTofPosPi, + pid_studies::NSigmaTofNegPi, + pid_studies::NSigmaTofPosPr, + pid_studies::NSigmaTofNegPr, + pid_studies::AlphaArm, + pid_studies::QtArm, + pid_studies::OccupancyFt0c, + pid_studies::OccupancyIts, + pid_studies::CentralityFT0C, + pid_studies::CentralityFT0M, + pid_studies::InteractionRate, + pid_studies::CandFlag); + +DECLARE_SOA_TABLE(PidCascades, "AOD", "PIDCASCADES", //! Table with PID information + pid_studies::MassOmega, + pid_studies::Pt, + pid_studies::PtBach, + pid_studies::PtBachTpc, + pid_studies::Radius, + pid_studies::MLambda, + pid_studies::V0cosPA, + pid_studies::MassXi, + pid_studies::CascCosPa, + pid_studies::DcaV0Daughters, + pid_studies::DcaV0ToPv, + pid_studies::NSigmaTpcBachKa, + pid_studies::NSigmaTofBachKa, + pid_studies::OccupancyFt0c, + pid_studies::OccupancyIts, + pid_studies::CentralityFT0C, + pid_studies::CentralityFT0M, + pid_studies::InteractionRate, + pid_studies::CandFlag); +} // namespace o2::aod + +struct HfTaskPidStudies { + Produces pidV0; + Produces pidCascade; + + Configurable applyEvSels{"applyEvSels", true, "Apply event selections"}; + Configurable applyTrackSels{"applyTrackSels", true, "Apply track selections"}; + Configurable tpcNClsCrossedRowsTrackMin{"tpcNClsCrossedRowsTrackMin", 70, "Minimum number of crossed rows in TPC"}; + Configurable etaTrackMax{"etaTrackMax", 0.8, "Maximum pseudorapidity"}; + Configurable ptTrackMin{"ptTrackMin", 0.1, "Minimum transverse momentum"}; + Configurable tpcChi2NClTrackMax{"tpcChi2NClTrackMax", 4, "Maximum TPC chi2 per number of TPC clusters"}; + Configurable itsChi2NClTrackMax{"itsChi2NClTrackMax", 36, "Maximum ITS chi2 per number of ITS clusters"}; + Configurable massK0Min{"massK0Min", 0.4, "Minimum mass for K0"}; + Configurable massK0Max{"massK0Max", 0.6, "Maximum mass for K0"}; + Configurable massLambdaMin{"massLambdaMin", 1.0, "Minimum mass for lambda"}; + Configurable massLambdaMax{"massLambdaMax", 1.3, "Maximum mass for lambda"}; + Configurable massOmegaMin{"massOmegaMin", 1.5, "Minimum mass for omega"}; + Configurable massOmegaMax{"massOmegaMax", 1.8, "Maximum mass for omega"}; + Configurable interactionRateMin{"interactionRateMin", -1, "Minimum interaction rate (kHz)"}; + Configurable interactionRateMax{"interactionRateMax", 1.e20, "Maximum interaction rate (kHz)"}; + Configurable radiusMax{"radiusMax", 2.3, "Maximum decay radius (cm)"}; + Configurable cosPaMin{"cosPaMin", 0.98, "Minimum cosine of pointing angle"}; + Configurable dcaV0DaughtersMax{"dcaV0DaughtersMax", 0.2, "Maximum DCA among the V0 daughters (cm)"}; + Configurable dcaV0ToPvMax{"dcaV0ToPvMax", 0.2, "Maximum DCA of the V0 from the primary vertex (cm)"}; + Configurable cosPaV0Min{"cosPaV0Min", 0.95, "Minimum cosine of pointing angle for V0 stemming from cascade decays"}; + Configurable qtArmenterosMinForK0{"qtArmenterosMinForK0", 0.12, "Minimum Armenteros' qt for K0"}; + Configurable qtArmenterosMaxForLambda{"qtArmenterosMaxForLambda", 0.12, "Minimum Armenteros' qt for (anti)Lambda"}; + Configurable downSampleBkgFactor{"downSampleBkgFactor", 1., "Fraction of candidates to keep"}; + Configurable ptMaxForDownSample{"ptMaxForDownSample", 10., "Maximum pt for the application of the downsampling factor"}; + Configurable ctpFetcherSource{"ctpFetcherSource", "T0VTX", "Source for CTP rate fetching, e.g. T0VTX, T0CE, T0SC, ZNC (hadronic)"}; + Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; + + using PidTracks = soa::Join; + using CollSels = soa::Join; + using CollisionsMc = soa::Join; + using V0sMcRec = soa::Join; + using CascsMcRec = soa::Join; + + ctpRateFetcher rateFetcher; + HfEventSelection hfEvSel; + HfEventSelectionMc hfEvSelMc; + double interactionRate{-1.}; + + o2::framework::Service ccdb; + HistogramRegistry registry{"registry", {}}; + + void init(InitContext&) + { + if ((doprocessV0Mc && doprocessV0Data) || (doprocessCascMc && doprocessCascData)) { + LOGP(fatal, "Both data and MC process functions were enabled! Please check your configuration!"); + } + ccdb->setURL(ccdbUrl); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + hfEvSel.addHistograms(registry); + + std::shared_ptr hTrackSel = registry.add("hTrackSel", "Track selection;;Counts", {HistType::kTH1F, {{TrackCuts::NCuts, 0, TrackCuts::NCuts}}}); + + // Set Labels for hTrackSel + hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::All + 1, "All"); + hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::HasIts + 1, "HasITS"); + hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::HasTpc + 1, "HasTPC"); + hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::TpcNClsCrossedRows + 1, "TPC NCls/CrossedRows"); + hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::Eta + 1, "#eta"); + hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::Pt + 1, "#it{p}_{T}"); + hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::TpcChi2NCls + 1, "TPC #chi^{2}/NCls"); + hTrackSel->GetXaxis()->SetBinLabel(TrackCuts::ItsChi2NCls + 1, "ITS #chi^{2}/NCls"); + } + + template + void fillTree(Cand const& candidate, const int flag) + { + float pseudoRndm = candidate.pt() * 1000. - static_cast(candidate.pt() * 1000); + if (candidate.pt() < ptMaxForDownSample && pseudoRndm > downSampleBkgFactor) { + return; + } + + const auto& coll = candidate.template collision_as(); + if constexpr (isV0) { + const auto& posTrack = candidate.template posTrack_as(); + const auto& negTrack = candidate.template negTrack_as(); + pidV0( + candidate.mK0Short(), + candidate.mLambda(), + candidate.mAntiLambda(), + candidate.pt(), + posTrack.pt(), + negTrack.pt(), + posTrack.tpcInnerParam() / std::cosh(candidate.positiveeta()), + negTrack.tpcInnerParam() / std::cosh(candidate.negativeeta()), + candidate.v0radius(), + candidate.v0cosPA(), + candidate.dcaV0daughters(), + candidate.dcav0topv(), + posTrack.tpcNSigmaPi(), + negTrack.tpcNSigmaPi(), + posTrack.tpcNSigmaPr(), + negTrack.tpcNSigmaPr(), + posTrack.tofNSigmaPi(), + negTrack.tofNSigmaPi(), + posTrack.tofNSigmaPr(), + negTrack.tofNSigmaPr(), + candidate.alpha(), + candidate.qtarm(), + coll.ft0cOccupancyInTimeRange(), + coll.trackOccupancyInTimeRange(), + coll.centFT0C(), + coll.centFT0M(), + interactionRate, + flag); + } else { + const auto& bachTrack = candidate.template bachelor_as(); + pidCascade( + candidate.mOmega(), + candidate.pt(), + candidate.bachelorpt(), + bachTrack.tpcInnerParam() / std::cosh(candidate.bacheloreta()), + candidate.cascradius(), + candidate.mLambda(), + candidate.v0cosPA(coll.posX(), coll.posY(), coll.posZ()), + candidate.mXi(), + candidate.casccosPA(coll.posX(), coll.posY(), coll.posZ()), + candidate.dcaV0daughters(), + candidate.dcav0topv(coll.posX(), coll.posY(), coll.posZ()), + bachTrack.tpcNSigmaKa(), + bachTrack.tofNSigmaKa(), + coll.ft0cOccupancyInTimeRange(), + coll.trackOccupancyInTimeRange(), + coll.centFT0C(), + coll.centFT0M(), + interactionRate, + flag); + } + } + + template + int isMatched(const T1& cand) + { + if constexpr (std::is_same::value) { + if (!cand.has_v0MCCore()) { + return Particle::NotMatched; + } + auto v0MC = cand.template v0MCCore_as(); + if (v0MC.pdgCode() == kK0Short && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kPiPlus) { + return Particle::K0s; + } + if (v0MC.pdgCode() == kLambda0 && v0MC.pdgCodeNegative() == -kPiPlus && v0MC.pdgCodePositive() == kProton) { + return Particle::Lambda; + } + if (v0MC.pdgCode() == -kLambda0 && v0MC.pdgCodeNegative() == -kProton && v0MC.pdgCodePositive() == kPiPlus) { + return -Particle::Lambda; + } + } + if constexpr (std::is_same::value) { + if (!cand.has_cascMCCore()) { + return Particle::NotMatched; + } + auto cascMC = cand.template cascMCCore_as(); + if (cascMC.pdgCode() == kOmegaMinus && + cascMC.pdgCodeBachelor() == -kKPlus && + cascMC.pdgCodeV0() == kLambda0 && + cascMC.pdgCodePositive() == kProton && + cascMC.pdgCodeNegative() == -kPiPlus) { + return Particle::Omega; + } + if (cascMC.pdgCode() == -kOmegaMinus && + cascMC.pdgCodeBachelor() == kKPlus && + cascMC.pdgCodeV0() == -kLambda0 && + cascMC.pdgCodePositive() == kPiPlus && + cascMC.pdgCodeNegative() == -kProton) { + return -Particle::Omega; + } + } + return Particle::NotMatched; + } + + template + bool isCollSelected(const Coll& coll) + { + auto bc = coll.template bc_as(); + interactionRate = rateFetcher.fetch(ccdb.service, bc.timestamp(), bc.runNumber(), ctpFetcherSource.value) * 1.e-3; // convert to kHz + if (interactionRate < interactionRateMin || interactionRate > interactionRateMax) { + return false; + } + + float cent{-1.f}; + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(coll, cent, ccdb, registry); + /// monitor the satisfied event selections + hfEvSel.fillHistograms(coll, rejectionMask, cent); + return rejectionMask == 0; + } + + template + bool isTrackSelected(const T1& candidate) + { + const auto& posTrack = candidate.template posTrack_as(); + const auto& negTrack = candidate.template negTrack_as(); + registry.fill(HIST("hTrackSel"), TrackCuts::All); + if constexpr (isV0) { + if (!posTrack.hasITS() || !negTrack.hasITS()) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::HasIts); + if (!posTrack.hasTPC() || !negTrack.hasTPC()) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::HasTpc); + if (posTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin || negTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::TpcNClsCrossedRows); + if (std::abs(posTrack.eta()) > etaTrackMax || std::abs(negTrack.eta()) > etaTrackMax) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::Eta); + if (posTrack.pt() < ptTrackMin || negTrack.pt() < ptTrackMin) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::Pt); + if (posTrack.tpcChi2NCl() > tpcChi2NClTrackMax || negTrack.tpcChi2NCl() > tpcChi2NClTrackMax) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::TpcChi2NCls); + if (posTrack.itsChi2NCl() > itsChi2NClTrackMax || negTrack.itsChi2NCl() > itsChi2NClTrackMax) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::ItsChi2NCls); + } else { + const auto& bachTrack = candidate.template bachelor_as(); + if (!posTrack.hasITS() || !negTrack.hasITS() || !bachTrack.hasITS()) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::HasIts); + if (!posTrack.hasTPC() || !negTrack.hasTPC() || !bachTrack.hasTPC()) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::HasTpc); + if (posTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin || negTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin || bachTrack.tpcNClsCrossedRows() < tpcNClsCrossedRowsTrackMin) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::TpcNClsCrossedRows); + if (std::abs(posTrack.eta()) > etaTrackMax || std::abs(negTrack.eta()) > etaTrackMax || std::abs(bachTrack.eta()) > etaTrackMax) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::Eta); + if (posTrack.pt() < ptTrackMin || negTrack.pt() < ptTrackMin || bachTrack.pt() < ptTrackMin) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::Pt); + if (posTrack.tpcChi2NCl() > tpcChi2NClTrackMax || negTrack.tpcChi2NCl() > tpcChi2NClTrackMax || bachTrack.tpcChi2NCl() > tpcChi2NClTrackMax) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::TpcChi2NCls); + if (posTrack.itsChi2NCl() > itsChi2NClTrackMax || negTrack.itsChi2NCl() > itsChi2NClTrackMax || bachTrack.itsChi2NCl() > itsChi2NClTrackMax) { + return false; + } + registry.fill(HIST("hTrackSel"), TrackCuts::ItsChi2NCls); + } + return true; + } + + template + bool isSelectedV0AsK0s(const V0Cand& v0) + { + if (v0.mK0Short() < massK0Min || v0.mK0Short() > massK0Max) { + return false; + } + if (v0.qtarm() < qtArmenterosMinForK0) { + return false; + } + if (v0.v0radius() > radiusMax) { + return false; + } + if (v0.v0cosPA() < cosPaMin) { + return false; + } + if (v0.dcaV0daughters() > dcaV0DaughtersMax) { + return false; + } + if (v0.dcav0topv() > dcaV0ToPvMax) { + return false; + } + return true; + } + + template + bool isSelectedV0AsLambda(const V0Cand& v0) + { + if ((v0.mLambda() < massLambdaMin || v0.mLambda() > massLambdaMax) && + (v0.mAntiLambda() < massLambdaMin || v0.mAntiLambda() > massLambdaMax)) { + return false; + } + if (v0.qtarm() > qtArmenterosMaxForLambda) { + return false; + } + if (v0.v0radius() > radiusMax) { + return false; + } + if (v0.v0cosPA() < cosPaMin) { + return false; + } + if (v0.dcaV0daughters() > dcaV0DaughtersMax) { + return false; + } + if (v0.dcav0topv() > dcaV0ToPvMax) { + return false; + } + return true; + } + + template + bool isSelectedCascAsOmega(const CascCand& casc) + { + if (casc.mOmega() < massOmegaMin || casc.mOmega() > massOmegaMax) { + return false; + } + if (casc.mLambda() < massLambdaMin || casc.mLambda() > massLambdaMax) { + return false; + } + if (casc.cascradius() > radiusMax) { + return false; + } + const auto& coll = casc.template collision_as(); + if (casc.casccosPA(coll.posX(), coll.posY(), coll.posZ()) < cosPaMin) { + return false; + } + if (casc.dcaV0daughters() > dcaV0DaughtersMax) { + return false; + } + if (casc.dcav0topv(coll.posX(), coll.posY(), coll.posZ()) > dcaV0ToPvMax) { + return false; + } + if (casc.v0cosPA(coll.posX(), coll.posY(), coll.posZ()) < cosPaV0Min) { + return false; + } + return true; + } + + void processV0Mc(CollisionsMc const& /*mcCollisions*/, + V0sMcRec const& V0s, + aod::V0MCCores const&, + aod::McParticles const& /*particlesMc*/, + PidTracks const& /*tracks*/, + aod::BCsWithTimestamps const&) + { + for (const auto& v0 : V0s) { + if (applyEvSels && !isCollSelected(v0.collision_as())) { + continue; + } + if (applyTrackSels && !isTrackSelected(v0)) { + continue; + } + if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { + int matched = isMatched(v0); + if (matched != Particle::NotMatched) { + fillTree(v0, matched); + } + } + } + } + PROCESS_SWITCH(HfTaskPidStudies, processV0Mc, "Process MC", true); + + void processV0Data(aod::V0Datas const& V0s, + PidTracks const&, + aod::BCsWithTimestamps const&, + CollSels const&) + { + for (const auto& v0 : V0s) { + if (applyEvSels && !isCollSelected(v0.collision_as())) { + continue; + } + if (applyTrackSels && !isTrackSelected(v0)) { + continue; + } + if (isSelectedV0AsK0s(v0) || isSelectedV0AsLambda(v0)) { + fillTree(v0, Particle::NotMatched); + } + } + } + PROCESS_SWITCH(HfTaskPidStudies, processV0Data, "Process data", false); + + void processCascMc(CollisionsMc const& /*mcCollisions*/, + CascsMcRec const& cascades, + aod::CascMCCores const&, + aod::McParticles const& /*particlesMc*/, + PidTracks const&, + aod::BCsWithTimestamps const&) + { + for (const auto& casc : cascades) { + if (applyEvSels && !isCollSelected(casc.collision_as())) { + continue; + } + if (applyTrackSels && !isTrackSelected(casc)) { + continue; + } + if (isSelectedCascAsOmega(casc)) { + int matched = isMatched(casc); + if (matched != Particle::NotMatched) { + fillTree(casc, matched); + } + } + } + } + PROCESS_SWITCH(HfTaskPidStudies, processCascMc, "Process MC", true); + + void processCascData(aod::CascDatas const& cascades, + PidTracks const&, + aod::BCsWithTimestamps const&, + CollSels const&) + { + for (const auto& casc : cascades) { + if (applyEvSels && !isCollSelected(casc.collision_as())) { + continue; + } + if (applyTrackSels && !isTrackSelected(casc)) { + continue; + } + if (isSelectedCascAsOmega(casc)) { + fillTree(casc, Particle::NotMatched); + } + } + } + PROCESS_SWITCH(HfTaskPidStudies, processCascData, "Process data", false); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{adaptAnalysisTask(cfgc)}; +} From 0ec265af6f28c4269ba05cc7ec17b7e04120db1d Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Jun 2025 22:09:27 +0200 Subject: [PATCH 05/21] Fix format --- .../DataModel/CandidateReconstructionTables.h | 1 + .../TableProducer/candidateCreator2Prong.cxx | 24 +++++++++++++++---- .../TableProducer/candidateCreator3Prong.cxx | 24 +++++++++++++++---- 3 files changed, 41 insertions(+), 8 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 83b9a594912..96a991a52a2 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -39,6 +39,7 @@ namespace o2::aod { // Table aliases +using BCFullInfos = soa::Join; using TracksWCov = soa::Join; using TracksWDca = soa::Join; diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index e81a2eb8daa..aae6fb95beb 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -648,7 +648,11 @@ struct HfCandidateCreator2Prong { void processPvRefitWithDCAFitterNUPC(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + aod::BCFullInfos const& bcWithTimeStamps, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } @@ -658,7 +662,11 @@ struct HfCandidateCreator2Prong { void processNoPvRefitWithDCAFitterNUPC(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + aod::BCFullInfos const& bcWithTimeStamps, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } @@ -668,7 +676,11 @@ struct HfCandidateCreator2Prong { void processPvRefitWithKFParticleUPC(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + aod::BCFullInfos const& bcWithTimeStamps, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } @@ -678,7 +690,11 @@ struct HfCandidateCreator2Prong { void processNoPvRefitWithKFParticleUPC(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + aod::BCFullInfos const& bcWithTimeStamps, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 209e8ef043e..ae77912f825 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -802,7 +802,11 @@ struct HfCandidateCreator3Prong { void processPvRefitWithDCAFitterNUPC(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + aod::BCFullInfos const& bcWithTimeStamps, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } @@ -812,7 +816,11 @@ struct HfCandidateCreator3Prong { void processNoPvRefitWithDCAFitterNUPC(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + aod::BCFullInfos const& bcWithTimeStamps, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } @@ -822,7 +830,11 @@ struct HfCandidateCreator3Prong { void processPvRefitWithKFParticleUPC(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + aod::BCFullInfos const& bcWithTimeStamps, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } @@ -832,7 +844,11 @@ struct HfCandidateCreator3Prong { void processNoPvRefitWithKFParticleUPC(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + aod::BCFullInfos const& bcWithTimeStamps, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } From c35320be8effd733014c190822305d4be98b6a38 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Jun 2025 22:16:18 +0200 Subject: [PATCH 06/21] Fix format --- PWGHF/Utils/utilsEvSelHf.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 9697ade5efa..5a9b66a97a0 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -261,7 +261,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { addHistograms(registry); } - /// \brief Applies event selection + /// \brief Applies event selection. /// \tparam useEvSel use information from the EvSel table /// \tparam centEstimator centrality estimator /// \param collision collision to test against the selection criteria @@ -407,7 +407,6 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { if (TESTBIT(rejectionMask, reason)) { return; } - hCollisions->Fill(reason); } From 5b49c3b0533d7dcbe929e097685ebe2e2efcdfd0 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 19 Jun 2025 23:10:26 +0200 Subject: [PATCH 07/21] fix the int type --- PWGHF/D2H/DataModel/ReducedDataModel.h | 2 +- PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx | 2 +- PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx | 2 +- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 2 +- PWGHF/DataModel/CandidateReconstructionTables.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/D2H/DataModel/ReducedDataModel.h b/PWGHF/D2H/DataModel/ReducedDataModel.h index 02cab44cb2b..10e997f7ed4 100644 --- a/PWGHF/D2H/DataModel/ReducedDataModel.h +++ b/PWGHF/D2H/DataModel/ReducedDataModel.h @@ -50,7 +50,7 @@ namespace aod namespace hf_reduced_collision { DECLARE_SOA_COLUMN(Bz, bz, float); //! Magnetic field in z-direction -DECLARE_SOA_COLUMN(HfCollisionRejectionMap, hfCollisionRejectionMap, uint16_t); //! Bitmask with failed selection criteria +DECLARE_SOA_COLUMN(HfCollisionRejectionMap, hfCollisionRejectionMap, uint32_t); //! Bitmask with failed selection criteria // keep track of the number of studied events (for normalization purposes) DECLARE_SOA_COLUMN(OriginalCollisionCount, originalCollisionCount, int); //! Size of COLLISION table processed DECLARE_SOA_COLUMN(ZvtxSelectedCollisionCount, zvtxSelectedCollisionCount, int); //! Number of COLLISIONS with |zvtx| < zvtxMax diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx index fde8c3b553e..5470de035b0 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx @@ -1258,7 +1258,7 @@ struct HfDataCreatorCharmHadPiReduced { } registry.fill(HIST("hEvents"), 1 + Event::CharmHadPiSelected); float centrality = -1.f; - uint16_t hfRejMap = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + uint32_t hfRejMap = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); // fill collision table if it contains a DPi pair a minima hfReducedCollision(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), hfRejMap, bz); hfReducedCollExtra(collision.covXX(), collision.covXY(), collision.covYY(), diff --git a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx index a424d95d95b..36deb224116 100644 --- a/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx +++ b/PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx @@ -1307,7 +1307,7 @@ struct HfDataCreatorCharmResoReduced { } registry.fill(HIST("hEvents"), 1 + Event::DV0Selected); float centrality = -1.f; - uint16_t hfRejMap = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + uint32_t hfRejMap = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); // fill collision table if it contains a DPi pair a minima hfReducedCollision(collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), hfRejMap, bz); } // end of runDataCreation function diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 6a090bfd2ed..2f0ec2b4eff 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -491,7 +491,7 @@ struct HfTaskFlowCharmHadrons { return; } float occupancy = 0.; - uint16_t hfevflag{}; + uint32_t hfevflag{}; if (occEstimator != 0) { occupancy = getOccupancyColl(collision, occEstimator); registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index 96a991a52a2..dab571b9b6b 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -192,7 +192,7 @@ DECLARE_SOA_TABLE(PidTpcTofTinyPr, "AOD", "PIDTPCTOFTINYPR", //! Table of the TP namespace hf_sel_collision { -DECLARE_SOA_COLUMN(WhyRejectColl, whyRejectColl, uint16_t); //! +DECLARE_SOA_COLUMN(WhyRejectColl, whyRejectColl, uint32_t); //! } // namespace hf_sel_collision DECLARE_SOA_TABLE(HfSelCollision, "AOD", "HFSELCOLLISION", //! From f9b1c0e705b9257ac134e843a8d0d40cfca78d11 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Sun, 22 Jun 2025 19:14:52 +0200 Subject: [PATCH 08/21] fix the megalinter --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 47 ++++++++++--------- PWGHF/Utils/utilsEvSelHf.h | 27 +++++------ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 5d15d1a83bf..c73e9df39c3 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -21,39 +21,40 @@ /// \author Federica Zanone , Heidelberg University /// \author Ruiqi Yin , Fudan University -#include "PWGHF/Core/CentralityEstimation.h" -#include "PWGHF/Core/SelectorCuts.h" -#include "PWGHF/DataModel/CandidateReconstructionTables.h" -#include "PWGHF/Utils/utilsAnalysis.h" -#include "PWGHF/Utils/utilsBfieldCCDB.h" -#include "PWGHF/Utils/utilsEvSelHf.h" -#include "PWGLF/DataModel/LFStrangenessTables.h" - -#include "Common/Core/TrackSelectorPID.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 "Tools/ML/MlResponse.h" +#include // std::find +#include // std::distance +#include // std::string +#include // std::vector -#include "CCDB/BasicCCDBManager.h" // for PV refit #include "CommonConstants/PhysicsConstants.h" -#include "DCAFitter/DCAFitterN.h" +#include "CCDB/BasicCCDBManager.h" // for PV refit #include "DataFormatsParameters/GRPMagField.h" // for PV refit #include "DataFormatsParameters/GRPObject.h" // for PV refit -#include "DetectorsBase/Propagator.h" // for PV refit -#include "DetectorsVertexing/PVertexer.h" // for PV refit +#include "DCAFitter/DCAFitterN.h" +#include "DetectorsBase/Propagator.h" // for PV refit +#include "DetectorsVertexing/PVertexer.h" // for PV refit #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" #include "ReconstructionDataFormats/V0.h" #include "ReconstructionDataFormats/Vertex.h" // for PV refit -#include // std::find -#include // std::distance -#include // std::string -#include // std::vector +#include "Common/Core/TrackSelectorPID.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 "Tools/ML/MlResponse.h" + +#include "PWGLF/DataModel/LFStrangenessTables.h" + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGHF/Core/SelectorCuts.h" +#include "PWGHF/DataModel/CandidateReconstructionTables.h" +#include "PWGHF/Utils/utilsAnalysis.h" +#include "PWGHF/Utils/utilsBfieldCCDB.h" +#include "PWGHF/Utils/utilsEvSelHf.h" using namespace o2; using namespace o2::analysis; diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 5a9b66a97a0..8c3c0a66fab 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -18,13 +18,11 @@ #ifndef PWGHF_UTILS_UTILSEVSELHF_H_ #define PWGHF_UTILS_UTILSEVSELHF_H_ -#include "PWGHF/Core/CentralityEstimation.h" -#include "PWGUD/Core/SGSelector.h" +#include -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" -#include "EventFiltering/Zorro.h" -#include "EventFiltering/ZorroSummary.h" +#include +#include +#include #include #include @@ -32,18 +30,19 @@ #include #include -#include -#include - -#include - -#include - -#include #include +#include #include // std::shared_ptr #include // std::string +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" +#include "EventFiltering/Zorro.h" +#include "EventFiltering/ZorroSummary.h" + +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGUD/Core/SGSelector.h" + namespace o2::hf_occupancy { // centrality selection estimators From 76b4423a77d8c9f4589a8becf9ea784b65f3fa81 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Sun, 22 Jun 2025 19:17:39 +0200 Subject: [PATCH 09/21] fix the megalinter --- PWGHF/Utils/utilsEvSelHf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 8c3c0a66fab..3cc6c314b3a 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -329,6 +329,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { } } } + /// number of PV contributors if (collision.numContrib() < nPvContributorsMin) { SETBIT(rejectionMask, EventRejection::NContrib); From 91efd9e918d44f789a828dd8f897d40564dd045d Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Sun, 22 Jun 2025 21:06:41 +0200 Subject: [PATCH 10/21] fix the error --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 2f0ec2b4eff..65608d34ffe 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -343,7 +343,7 @@ struct HfTaskFlowCharmHadrons { /// Get the event selection flags /// \param hfevselflag is the event selection flag - std::vector getEventSelectionFlags(uint16_t hfevselflag) + std::vector getEventSelectionFlags(uint32_t hfevselflag) { return { TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), @@ -373,7 +373,7 @@ struct HfTaskFlowCharmHadrons { float& sp, std::vector& outputMl, float& occupancy, - uint16_t& hfevselflag) + uint32_t& hfevselflag) { if (occEstimator != 0) { std::vector evtSelFlags = getEventSelectionFlags(hfevselflag); @@ -784,7 +784,7 @@ struct HfTaskFlowCharmHadrons { float occupancy{-1.f}; occupancy = getOccupancyColl(collision, occEstimator); registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); - uint16_t hfevflag = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + uint32_t hfevflag = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); std::vector evtSelFlags = getEventSelectionFlags(hfevflag); registry.fill(HIST("spReso/hSparseReso"), centrality, xQVecFT0c * xQVecFV0a + yQVecFT0c * yQVecFV0a, xQVecFT0c * xQVecBTot + yQVecFT0c * yQVecBTot, From f7af3ba8c839a81cf5c4fa72230e3d5485760579 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Mon, 23 Jun 2025 18:31:00 +0200 Subject: [PATCH 11/21] fix comments from vit --- .../TableProducer/candidateCreator2Prong.cxx | 47 +++++++++-------- .../TableProducer/candidateCreator3Prong.cxx | 52 +++++++++++-------- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 6 +-- PWGHF/Utils/utilsEvSelHf.h | 10 ++-- 4 files changed, 64 insertions(+), 51 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index aae6fb95beb..a5d6ee688f9 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -114,18 +114,18 @@ struct HfCandidateCreator2Prong { { std::array doprocessDF{doprocessPvRefitWithDCAFitterN, doprocessNoPvRefitWithDCAFitterN, doprocessPvRefitWithDCAFitterNCentFT0C, doprocessNoPvRefitWithDCAFitterNCentFT0C, - doprocessPvRefitWithDCAFitterNCentFT0M, doprocessNoPvRefitWithDCAFitterNCentFT0M, doprocessPvRefitWithDCAFitterNUPC, doprocessNoPvRefitWithDCAFitterNUPC}; + doprocessPvRefitWithDCAFitterNCentFT0M, doprocessNoPvRefitWithDCAFitterNCentFT0M, doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc}; std::array doprocessKF{doprocessPvRefitWithKFParticle, doprocessNoPvRefitWithKFParticle, doprocessPvRefitWithKFParticleCentFT0C, doprocessNoPvRefitWithKFParticleCentFT0C, - doprocessPvRefitWithKFParticleCentFT0M, doprocessNoPvRefitWithKFParticleCentFT0M, doprocessPvRefitWithKFParticleUPC, doprocessNoPvRefitWithKFParticleUPC}; + doprocessPvRefitWithKFParticleCentFT0M, doprocessNoPvRefitWithKFParticleCentFT0M, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc}; if ((std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) + std::accumulate(doprocessKF.begin(), doprocessKF.end(), 0)) != 1) { LOGP(fatal, "One and only one process function must be enabled at a time."); } - std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUPC}; + std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUpc}; const int nProcessesCollisions = std::accumulate(processesCollisions.begin(), processesCollisions.end(), 0); - std::array processesCollisionsUPC = {doprocessPvRefitWithDCAFitterNUPC, doprocessNoPvRefitWithDCAFitterNUPC, doprocessPvRefitWithKFParticleUPC, doprocessNoPvRefitWithKFParticleUPC, doprocessCollisionsUPC}; - const int nProcessesCollisionsUPC = std::accumulate(processesCollisionsUPC.begin(), processesCollisionsUPC.end(), 0); + std::array processesCollisionsUpc = {doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc, doprocessCollisionsUpc}; + const int nProcessesCollisionsUpc = std::accumulate(processesCollisionsUpc.begin(), processesCollisionsUpc.end(), 0); if (nProcessesCollisions > 1) { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); } @@ -140,7 +140,7 @@ struct HfCandidateCreator2Prong { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsCentFT0M\"?"); } } - if (nProcessesCollisionsUPC > 1 && isRun2) { + if (nProcessesCollisionsUpc > 0 && isRun2) { LOGP(fatal, "Process function for UPC is only available in Run 3!"); } @@ -190,7 +190,7 @@ struct HfCandidateCreator2Prong { setLabelHistoCands(hCandidates); } - template + template void runCreator2ProngWithDCAFitterN(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, @@ -204,7 +204,7 @@ struct HfCandidateCreator2Prong { float centrality{-1.f}; uint32_t rejectionMask{0}; if constexpr (useUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); } @@ -343,7 +343,7 @@ struct HfCandidateCreator2Prong { } } - template + template void runCreator2ProngWithKFParticle(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, @@ -357,7 +357,7 @@ struct HfCandidateCreator2Prong { float centrality{-1.f}; uint32_t rejectionMask{0}; if constexpr (useUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); } @@ -645,7 +645,7 @@ struct HfCandidateCreator2Prong { ///////////////////////////////////////////// /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on UPC - void processPvRefitWithDCAFitterNUPC(soa::Join const& collisions, + void processPvRefitWithDCAFitterNUpc(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, aod::BCFullInfos const& bcWithTimeStamps, @@ -656,10 +656,10 @@ struct HfCandidateCreator2Prong { { runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterNUPC, "Run candidate creator using DCA fitter w/ PV refit and w/ centrality selection on UltraPeripheral Collision", false); + PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithDCAFitterNUpc, "Run candidate creator using DCA fitter w/ PV refit and w/ centrality selection on UltraPeripheral Collision", false); /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection UPC - void processNoPvRefitWithDCAFitterNUPC(soa::Join const& collisions, + void processNoPvRefitWithDCAFitterNUpc(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, aod::BCFullInfos const& bcWithTimeStamps, @@ -670,10 +670,10 @@ struct HfCandidateCreator2Prong { { runCreator2ProngWithDCAFitterN(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterNUPC, "Run candidate creator using DCA fitter w/o PV refit and w/ centrality selection UltraPeripheral Collision", false); + PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithDCAFitterNUpc, "Run candidate creator using DCA fitter w/o PV refit and w/ centrality selection UltraPeripheral Collision", false); /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on UPC - void processPvRefitWithKFParticleUPC(soa::Join const& collisions, + void processPvRefitWithKFParticleUpc(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, aod::BCFullInfos const& bcWithTimeStamps, @@ -684,10 +684,10 @@ struct HfCandidateCreator2Prong { { runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticleUPC, "Run candidate creator using KFParticle package w/ PV refit and w/ centrality selection on UltraPeripheral Collision", false); + PROCESS_SWITCH(HfCandidateCreator2Prong, processPvRefitWithKFParticleUpc, "Run candidate creator using KFParticle package w/ PV refit and w/ centrality selection on UltraPeripheral Collision", false); /// @brief process function using KFParticle package w/o PV refit and w/o centrality selections on UPC - void processNoPvRefitWithKFParticleUPC(soa::Join const& collisions, + void processNoPvRefitWithKFParticleUpc(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, aod::BCFullInfos const& bcWithTimeStamps, @@ -698,7 +698,7 @@ struct HfCandidateCreator2Prong { { runCreator2ProngWithKFParticle(collisions, rowsTrackIndexProng2, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithKFParticleUPC, "Run candidate creator using KFParticle package w/o PV refit and w/ centrality selection on UltraPeripheral Collision", false); + PROCESS_SWITCH(HfCandidateCreator2Prong, processNoPvRefitWithKFParticleUpc, "Run candidate creator using KFParticle package w/o PV refit and w/ centrality selection on UltraPeripheral Collision", false); /////////////////////////////////////////////////////////// /// /// @@ -761,7 +761,12 @@ struct HfCandidateCreator2Prong { PROCESS_SWITCH(HfCandidateCreator2Prong, processCollisionsCentFT0M, "Collision monitoring - FT0M centrality", false); /// @brief process function to monitor collisions - UPC collision - void processCollisionsUPC(soa::Join const& collisions, aod::BCFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + void processCollisionsUpc(soa::Join const& collisions, + aod::BCFullInfos const& bcs, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { /// loop over collisions for (const auto& collision : collisions) { @@ -769,14 +774,14 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; float occupancy = getOccupancyColl(collision, OccupancyEstimator::Its); - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); /// monitor the satisfied event selections hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } - PROCESS_SWITCH(HfCandidateCreator2Prong, processCollisionsUPC, "Collision monitoring - UPC", false); + PROCESS_SWITCH(HfCandidateCreator2Prong, processCollisionsUpc, "Collision monitoring - UPC", false); }; /// Extends the base table with expression columns. diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index ae77912f825..af5da90fac8 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -138,18 +138,18 @@ struct HfCandidateCreator3Prong { { std::array doprocessDF{doprocessPvRefitWithDCAFitterN, doprocessNoPvRefitWithDCAFitterN, doprocessPvRefitWithDCAFitterNCentFT0C, doprocessNoPvRefitWithDCAFitterNCentFT0C, - doprocessPvRefitWithDCAFitterNCentFT0M, doprocessNoPvRefitWithDCAFitterNCentFT0M, doprocessPvRefitWithDCAFitterNUPC, doprocessNoPvRefitWithDCAFitterNUPC}; + doprocessPvRefitWithDCAFitterNCentFT0M, doprocessNoPvRefitWithDCAFitterNCentFT0M, doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc}; std::array doprocessKF{doprocessPvRefitWithKFParticle, doprocessNoPvRefitWithKFParticle, doprocessPvRefitWithKFParticleCentFT0C, doprocessNoPvRefitWithKFParticleCentFT0C, - doprocessPvRefitWithKFParticleCentFT0M, doprocessNoPvRefitWithKFParticleCentFT0M, doprocessPvRefitWithKFParticleUPC, doprocessNoPvRefitWithKFParticleUPC}; + doprocessPvRefitWithKFParticleCentFT0M, doprocessNoPvRefitWithKFParticleCentFT0M, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc}; if ((std::accumulate(doprocessDF.begin(), doprocessDF.end(), 0) + std::accumulate(doprocessKF.begin(), doprocessKF.end(), 0)) != 1) { LOGP(fatal, "One and only one process function must be enabled at a time."); } - std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUPC}; + std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUpc}; const int nProcessesCollisions = std::accumulate(processesCollisions.begin(), processesCollisions.end(), 0); - std::array processesCollisionsUPC = {doprocessPvRefitWithDCAFitterNUPC, doprocessNoPvRefitWithDCAFitterNUPC, doprocessPvRefitWithKFParticleUPC, doprocessNoPvRefitWithKFParticleUPC, doprocessCollisionsUPC}; - const int nProcessesCollisionsUPC = std::accumulate(processesCollisionsUPC.begin(), processesCollisionsUPC.end(), 0); + std::array processesCollisionsUpc = {doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc, doprocessCollisionsUpc}; + const int nProcessesCollisionsUpc = std::accumulate(processesCollisionsUpc.begin(), processesCollisionsUpc.end(), 0); if (nProcessesCollisions > 1) { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); @@ -165,7 +165,7 @@ struct HfCandidateCreator3Prong { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsCentFT0M\"?"); } } - if (nProcessesCollisionsUPC > 1 && isRun2) { + if (nProcessesCollisionsUpc > 0 && isRun2) { LOGP(fatal, "Process function for UPC is only available in Run 3!"); } std::array creationFlags = {createDplus, createDs, createLc, createXic}; @@ -241,8 +241,11 @@ struct HfCandidateCreator3Prong { } } - template - void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, BCsType const& bcs) + template + void runCreator3ProngWithDCAFitterN(Coll const&, + Cand const& rowsTrackIndexProng3, + TracksWCovExtraPidPiKaPr const&, + BCsType const& bcs) { // loop over triplets of track indices for (const auto& rowTrackIndexProng3 : rowsTrackIndexProng3) { @@ -252,7 +255,7 @@ struct HfCandidateCreator3Prong { float centrality{-1.f}; uint32_t rejectionMask{0}; if constexpr (useUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); } @@ -411,7 +414,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithKFParticle(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, @@ -423,7 +426,7 @@ struct HfCandidateCreator3Prong { float centrality{-1.f}; uint32_t rejectionMask{0}; if constexpr (useUpcSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); } @@ -799,7 +802,7 @@ struct HfCandidateCreator3Prong { ///////////////////////////////////////////// /// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on UPC - void processPvRefitWithDCAFitterNUPC(soa::Join const& collisions, + void processPvRefitWithDCAFitterNUpc(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, aod::BCFullInfos const& bcWithTimeStamps, @@ -810,10 +813,10 @@ struct HfCandidateCreator3Prong { { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithDCAFitterNUPC, "Run candidate creator using DCA fitter with PV refit and w/ centrality selection on UPC", false); + PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithDCAFitterNUpc, "Run candidate creator using DCA fitter with PV refit and w/ centrality selection on UPC", false); /// @brief process function using DCA fitter w/o PV refit and w/ centrality selection on UPC - void processNoPvRefitWithDCAFitterNUPC(soa::Join const& collisions, + void processNoPvRefitWithDCAFitterNUpc(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, aod::BCFullInfos const& bcWithTimeStamps, @@ -824,10 +827,10 @@ struct HfCandidateCreator3Prong { { runCreator3ProngWithDCAFitterN(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithDCAFitterNUPC, "Run candidate creator using DCA fitter without PV refit and w/ centrality selection on UPC", false); + PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithDCAFitterNUpc, "Run candidate creator using DCA fitter without PV refit and w/ centrality selection on UPC", false); /// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on UPC - void processPvRefitWithKFParticleUPC(soa::Join const& collisions, + void processPvRefitWithKFParticleUpc(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, aod::BCFullInfos const& bcWithTimeStamps, @@ -838,10 +841,10 @@ struct HfCandidateCreator3Prong { { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithKFParticleUPC, "Run candidate creator using KFParticle package with PV refit and w/ centrality selection on UPC", false); + PROCESS_SWITCH(HfCandidateCreator3Prong, processPvRefitWithKFParticleUpc, "Run candidate creator using KFParticle package with PV refit and w/ centrality selection on UPC", false); /// @brief process function using KFParticle package w/o PV refit and w/ centrality selection on UPC - void processNoPvRefitWithKFParticleUPC(soa::Join const& collisions, + void processNoPvRefitWithKFParticleUpc(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, aod::BCFullInfos const& bcWithTimeStamps, @@ -852,7 +855,7 @@ struct HfCandidateCreator3Prong { { runCreator3ProngWithKFParticle(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps); } - PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithKFParticleUPC, "Run candidate creator using KFParticle package without PV refit and w/ centrality selection on UPC", false); + PROCESS_SWITCH(HfCandidateCreator3Prong, processNoPvRefitWithKFParticleUpc, "Run candidate creator using KFParticle package without PV refit and w/ centrality selection on UPC", false); /////////////////////////////////////////////////////////// /// /// @@ -915,7 +918,12 @@ struct HfCandidateCreator3Prong { PROCESS_SWITCH(HfCandidateCreator3Prong, processCollisionsCentFT0M, "Collision monitoring - FT0M centrality", false); /// @brief process function to monitor collisions - UPC - void processCollisionsUPC(soa::Join const& collisions, aod::BCFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + void processCollisionsUpc(soa::Join const& collisions, + aod::BCFullInfos const& bcs, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { /// loop over collisions for (const auto& collision : collisions) { @@ -923,14 +931,14 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; float occupancy = getOccupancyColl(collision, OccupancyEstimator::Its); - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC(collision, centrality, ccdb, registry, bcs); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); /// monitor the satisfied event selections hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } - PROCESS_SWITCH(HfCandidateCreator3Prong, processCollisionsUPC, "Collision monitoring - UPC", false); + PROCESS_SWITCH(HfCandidateCreator3Prong, processCollisionsUpc, "Collision monitoring - UPC", false); }; /// Extends the base table with expression columns. diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index c73e9df39c3..e842765e14b 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -132,14 +132,14 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { /// Collision selection /// \param collision collision table with - template + template void selectCollision(const Col& collision, const BCsType& bcs) { float centrality = -1.; uint32_t rejectionMask; - if constexpr (applyUPCSel) { - rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUPC( + if constexpr (applyUpcSel) { + rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc( collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask( diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 3cc6c314b3a..a6ad6e062c7 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -196,7 +196,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { static constexpr char NameHistPosYAfterEvSel[] = "hPosYAfterEvSel"; static constexpr char NameHistNumPvContributorsAfterSel[] = "hNumPvContributorsAfterSel"; static constexpr char NameHistCollisionsCentOcc[] = "hCollisionsCentOcc"; - static constexpr char NameHistUPC[] = "hUPCollisions"; + static constexpr char NameHistUpCollisions[] = "hUpCollisions"; std::shared_ptr hCollisions, hSelCollisionsCent, hPosZBeforeEvSel, hPosZAfterEvSel, hPosXAfterEvSel, hPosYAfterEvSel, hNumPvContributorsAfterSel, hUPCollisions; std::shared_ptr hCollisionsCentOcc; @@ -210,7 +210,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { int currentRun{-1}; /// Set standard preselection gap trigger (values taken from UD group) - SGCutParHolder setSGPreselection() + SGCutParHolder setSgPreselection() { SGCutParHolder sgCuts; sgCuts.SetNDtcoll(1); // Minimum number of sigma around the collision @@ -236,7 +236,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hPosYAfterEvSel = registry.add(NameHistPosYAfterEvSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{200, -0.5, 0.5}}}); hNumPvContributorsAfterSel = registry.add(NameHistNumPvContributorsAfterSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{500, -0.5, 499.5}}}); setEventRejectionLabels(hCollisions, softwareTrigger); - hUPCollisions = registry.add(NameHistUPC, "HF upc counter;;# of upc events", {o2::framework::HistType::kTH1D, {axisUPCEvents}}); + hUPCollisions = registry.add(NameHistUpCollisions, "HF upc counter;;# of upc events", {o2::framework::HistType::kTH1D, {axisUPCEvents}}); const o2::framework::AxisSpec th2AxisCent{th2ConfigAxisCent, "Centrality"}; const o2::framework::AxisSpec th2AxisOccupancy{th2ConfigAxisOccupancy, "Occupancy"}; hCollisionsCentOcc = registry.add(NameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {th2AxisCent, th2AxisOccupancy}}); @@ -373,12 +373,12 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { } template - uint32_t getHfCollisionRejectionMaskWithUPC(const Coll& collision, float& centrality, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry, const BCsType& bcs) + uint32_t getHfCollisionRejectionMaskWithUpc(const Coll& collision, float& centrality, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry, const BCsType& bcs) { auto rejectionMaskWithUPC = getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (useEvSel) { - SGCutParHolder sgCuts = setSGPreselection(); + SGCutParHolder sgCuts = setSgPreselection(); auto bc = collision.template foundBC_as(); auto bcRange = udhelpers::compatibleBCs(collision, sgCuts.NDtcoll(), bcs, sgCuts.minNBCs()); auto sgSelectionResult = sgSelector.IsSelected(sgCuts, collision, bcRange, bc); From 4e135a0a02728879597b4efbbe794dc32ce85a0c Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Mon, 23 Jun 2025 18:45:19 +0200 Subject: [PATCH 12/21] fix comments from vit --- PWGHF/Utils/utilsEvSelHf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index a6ad6e062c7..29f49fe5412 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -375,7 +375,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { template uint32_t getHfCollisionRejectionMaskWithUpc(const Coll& collision, float& centrality, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry, const BCsType& bcs) { - auto rejectionMaskWithUPC = getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + auto rejectionMaskWithUpc = getHfCollisionRejectionMask(collision, centrality, ccdb, registry); if (useEvSel) { SGCutParHolder sgCuts = setSgPreselection(); @@ -384,13 +384,13 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { auto sgSelectionResult = sgSelector.IsSelected(sgCuts, collision, bcRange, bc); int upcEventType = sgSelectionResult.value; if (upcEventType > EventTypeUpc::DoubleGap) { - SETBIT(rejectionMaskWithUPC, EventRejection::UpcEventCut); + SETBIT(rejectionMaskWithUpc, EventRejection::UpcEventCut); } else { hUPCollisions->Fill(upcEventType); } } - return rejectionMaskWithUPC; + return rejectionMaskWithUpc; } /// \brief Fills histograms for monitoring event selections satisfied by the collision. From e1247cf596ea9c2b4d612b11d6282c528d25cf55 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Tue, 24 Jun 2025 12:59:10 +0200 Subject: [PATCH 13/21] fix comments from vit --- PWGHF/TableProducer/candidateCreator3Prong.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index af5da90fac8..8a5baf1e90f 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -241,7 +241,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, @@ -414,7 +414,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithKFParticle(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, From 4c88515396c4bf16c60774627ab4f66285a3ac8a Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Tue, 24 Jun 2025 13:44:00 +0200 Subject: [PATCH 14/21] fix comments from vit --- PWGHF/TableProducer/candidateCreator2Prong.cxx | 8 ++++---- PWGHF/TableProducer/candidateCreator3Prong.cxx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index a5d6ee688f9..aff83cf3d48 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -190,7 +190,7 @@ struct HfCandidateCreator2Prong { setLabelHistoCands(hCandidates); } - template + template void runCreator2ProngWithDCAFitterN(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, @@ -203,7 +203,7 @@ struct HfCandidateCreator2Prong { auto collision = rowTrackIndexProng2.template collision_as(); float centrality{-1.f}; uint32_t rejectionMask{0}; - if constexpr (useUpcSel) { + if constexpr (applyTrigSel) { rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); @@ -343,7 +343,7 @@ struct HfCandidateCreator2Prong { } } - template + template void runCreator2ProngWithKFParticle(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, @@ -356,7 +356,7 @@ struct HfCandidateCreator2Prong { auto collision = rowTrackIndexProng2.template collision_as(); float centrality{-1.f}; uint32_t rejectionMask{0}; - if constexpr (useUpcSel) { + if constexpr (applyTrigSel) { rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 8a5baf1e90f..3d919d85eb0 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -241,7 +241,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, @@ -254,7 +254,7 @@ struct HfCandidateCreator3Prong { auto collision = rowTrackIndexProng3.template collision_as(); float centrality{-1.f}; uint32_t rejectionMask{0}; - if constexpr (useUpcSel) { + if constexpr (applyTrigSel) { rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); @@ -414,7 +414,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithKFParticle(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, @@ -425,7 +425,7 @@ struct HfCandidateCreator3Prong { auto collision = rowTrackIndexProng3.template collision_as(); float centrality{-1.f}; uint32_t rejectionMask{0}; - if constexpr (useUpcSel) { + if constexpr (applyTrigSel) { rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); From 0899aa26e0decd1ef51251257628bd38536647d1 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Tue, 24 Jun 2025 13:48:33 +0200 Subject: [PATCH 15/21] fix comments from typo --- PWGHF/TableProducer/candidateCreator2Prong.cxx | 8 ++++---- PWGHF/TableProducer/candidateCreator3Prong.cxx | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index aff83cf3d48..2e2a26d5f94 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -190,7 +190,7 @@ struct HfCandidateCreator2Prong { setLabelHistoCands(hCandidates); } - template + template void runCreator2ProngWithDCAFitterN(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, @@ -203,7 +203,7 @@ struct HfCandidateCreator2Prong { auto collision = rowTrackIndexProng2.template collision_as(); float centrality{-1.f}; uint32_t rejectionMask{0}; - if constexpr (applyTrigSel) { + if constexpr (applyUpcSel) { rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); @@ -343,7 +343,7 @@ struct HfCandidateCreator2Prong { } } - template + template void runCreator2ProngWithKFParticle(Coll const&, CandType const& rowsTrackIndexProng2, TTracks const&, @@ -356,7 +356,7 @@ struct HfCandidateCreator2Prong { auto collision = rowTrackIndexProng2.template collision_as(); float centrality{-1.f}; uint32_t rejectionMask{0}; - if constexpr (applyTrigSel) { + if constexpr (applyUpcSel) { rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 3d919d85eb0..679e8a66ee5 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -241,7 +241,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, @@ -254,7 +254,7 @@ struct HfCandidateCreator3Prong { auto collision = rowTrackIndexProng3.template collision_as(); float centrality{-1.f}; uint32_t rejectionMask{0}; - if constexpr (applyTrigSel) { + if constexpr (applyUpcSel) { rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); @@ -414,7 +414,7 @@ struct HfCandidateCreator3Prong { } } - template + template void runCreator3ProngWithKFParticle(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, @@ -425,7 +425,7 @@ struct HfCandidateCreator3Prong { auto collision = rowTrackIndexProng3.template collision_as(); float centrality{-1.f}; uint32_t rejectionMask{0}; - if constexpr (applyTrigSel) { + if constexpr (applyUpcSel) { rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); } else { rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); From 1b7ce840bd3bac82eaa5487dcb1fc6521dd83263 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Wed, 25 Jun 2025 14:31:33 +0200 Subject: [PATCH 16/21] fix comments from vit --- PWGHF/Utils/utilsEvSelHf.h | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 29f49fe5412..c82f6bc126b 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -113,16 +113,8 @@ enum EventRejection { NEventRejection }; -// upc event type, refer from PWGUD/Core/SGSelector.h -enum EventTypeUpc { - SingleGapA = 0, - SingleGapC = 1, - DoubleGap = 2, - NEventTypes = 3 -}; - o2::framework::AxisSpec axisEvents = {EventRejection::NEventRejection, -0.5f, +EventRejection::NEventRejection - 0.5f, ""}; -o2::framework::AxisSpec axisUPCEvents = {EventTypeUpc::NEventTypes, -0.5f, +EventTypeUpc::NEventTypes - 0.5f, ""}; +o2::framework::AxisSpec axisUpcEvents = { o2::aod::sgselector::DoubleGap + 1, -0.5f, +o2::aod::sgselector::DoubleGap + 0.5f, ""}; /// \brief Function to put labels on monitoring histogram /// \param hRejection monitoring histogram @@ -198,7 +190,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { static constexpr char NameHistCollisionsCentOcc[] = "hCollisionsCentOcc"; static constexpr char NameHistUpCollisions[] = "hUpCollisions"; - std::shared_ptr hCollisions, hSelCollisionsCent, hPosZBeforeEvSel, hPosZAfterEvSel, hPosXAfterEvSel, hPosYAfterEvSel, hNumPvContributorsAfterSel, hUPCollisions; + std::shared_ptr hCollisions, hSelCollisionsCent, hPosZBeforeEvSel, hPosZAfterEvSel, hPosXAfterEvSel, hPosYAfterEvSel, hNumPvContributorsAfterSel, hUpCollisions; std::shared_ptr hCollisionsCentOcc; // util to retrieve the RCT info from CCDB @@ -236,7 +228,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hPosYAfterEvSel = registry.add(NameHistPosYAfterEvSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{200, -0.5, 0.5}}}); hNumPvContributorsAfterSel = registry.add(NameHistNumPvContributorsAfterSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{500, -0.5, 499.5}}}); setEventRejectionLabels(hCollisions, softwareTrigger); - hUPCollisions = registry.add(NameHistUpCollisions, "HF upc counter;;# of upc events", {o2::framework::HistType::kTH1D, {axisUPCEvents}}); + hUpCollisions = registry.add(NameHistUpCollisions, "HF upc counter;;# of upc events", {o2::framework::HistType::kTH1D, {axisUpcEvents}}); const o2::framework::AxisSpec th2AxisCent{th2ConfigAxisCent, "Centrality"}; const o2::framework::AxisSpec th2AxisOccupancy{th2ConfigAxisOccupancy, "Occupancy"}; hCollisionsCentOcc = registry.add(NameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {th2AxisCent, th2AxisOccupancy}}); @@ -383,10 +375,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { auto bcRange = udhelpers::compatibleBCs(collision, sgCuts.NDtcoll(), bcs, sgCuts.minNBCs()); auto sgSelectionResult = sgSelector.IsSelected(sgCuts, collision, bcRange, bc); int upcEventType = sgSelectionResult.value; - if (upcEventType > EventTypeUpc::DoubleGap) { + if (upcEventType > o2::aod::sgselector::DoubleGap) { SETBIT(rejectionMaskWithUpc, EventRejection::UpcEventCut); } else { - hUPCollisions->Fill(upcEventType); + hUpCollisions->Fill(upcEventType); } } From a7c94217260d53a4a7ee5659ad3ebbc4e965a8ea Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 26 Jun 2025 11:05:22 +0200 Subject: [PATCH 17/21] fix comments from vit --- .../DataModel/CandidateReconstructionTables.h | 2 +- .../TableProducer/candidateCreator2Prong.cxx | 18 +++++----- .../TableProducer/candidateCreator3Prong.cxx | 18 +++++----- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 34 ++++++++++++++----- PWGHF/Utils/utilsEvSelHf.h | 2 +- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/PWGHF/DataModel/CandidateReconstructionTables.h b/PWGHF/DataModel/CandidateReconstructionTables.h index dab571b9b6b..4280dbb94a6 100644 --- a/PWGHF/DataModel/CandidateReconstructionTables.h +++ b/PWGHF/DataModel/CandidateReconstructionTables.h @@ -39,7 +39,7 @@ namespace o2::aod { // Table aliases -using BCFullInfos = soa::Join; +using BcFullInfos = soa::Join; using TracksWCov = soa::Join; using TracksWDca = soa::Join; diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 2e2a26d5f94..b7b642d2f17 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -124,8 +124,8 @@ struct HfCandidateCreator2Prong { std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUpc}; const int nProcessesCollisions = std::accumulate(processesCollisions.begin(), processesCollisions.end(), 0); - std::array processesCollisionsUpc = {doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc, doprocessCollisionsUpc}; - const int nProcessesCollisionsUpc = std::accumulate(processesCollisionsUpc.begin(), processesCollisionsUpc.end(), 0); + std::array processesUpc = {doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc, doprocessCollisionsUpc}; + const int nprocessesUpc = std::accumulate(processesUpc.begin(), processesUpc.end(), 0); if (nProcessesCollisions > 1) { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); } @@ -140,7 +140,7 @@ struct HfCandidateCreator2Prong { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsCentFT0M\"?"); } } - if (nProcessesCollisionsUpc > 0 && isRun2) { + if (nprocessesUpc > 0 && isRun2) { LOGP(fatal, "Process function for UPC is only available in Run 3!"); } @@ -648,7 +648,7 @@ struct HfCandidateCreator2Prong { void processPvRefitWithDCAFitterNUpc(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, + aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -662,7 +662,7 @@ struct HfCandidateCreator2Prong { void processNoPvRefitWithDCAFitterNUpc(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, + aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -676,7 +676,7 @@ struct HfCandidateCreator2Prong { void processPvRefitWithKFParticleUpc(soa::Join const& collisions, soa::Join const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, + aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -690,7 +690,7 @@ struct HfCandidateCreator2Prong { void processNoPvRefitWithKFParticleUpc(soa::Join const& collisions, aod::Hf2Prongs const& rowsTrackIndexProng2, TracksWCovExtraPidPiKa const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, + aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -762,7 +762,7 @@ struct HfCandidateCreator2Prong { /// @brief process function to monitor collisions - UPC collision void processCollisionsUpc(soa::Join const& collisions, - aod::BCFullInfos const& bcs, + aod::BcFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -774,7 +774,7 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; float occupancy = getOccupancyColl(collision, OccupancyEstimator::Its); - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); /// monitor the satisfied event selections hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index 679e8a66ee5..f1a36f0079f 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -148,8 +148,8 @@ struct HfCandidateCreator3Prong { std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUpc}; const int nProcessesCollisions = std::accumulate(processesCollisions.begin(), processesCollisions.end(), 0); - std::array processesCollisionsUpc = {doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc, doprocessCollisionsUpc}; - const int nProcessesCollisionsUpc = std::accumulate(processesCollisionsUpc.begin(), processesCollisionsUpc.end(), 0); + std::array processesUpc = {doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc, doprocessCollisionsUpc}; + const int nprocessesUpc = std::accumulate(processesUpc.begin(), processesUpc.end(), 0); if (nProcessesCollisions > 1) { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); @@ -165,7 +165,7 @@ struct HfCandidateCreator3Prong { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsCentFT0M\"?"); } } - if (nProcessesCollisionsUpc > 0 && isRun2) { + if (nprocessesUpc > 0 && isRun2) { LOGP(fatal, "Process function for UPC is only available in Run 3!"); } std::array creationFlags = {createDplus, createDs, createLc, createXic}; @@ -805,7 +805,7 @@ struct HfCandidateCreator3Prong { void processPvRefitWithDCAFitterNUpc(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, + aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -819,7 +819,7 @@ struct HfCandidateCreator3Prong { void processNoPvRefitWithDCAFitterNUpc(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, + aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -833,7 +833,7 @@ struct HfCandidateCreator3Prong { void processPvRefitWithKFParticleUpc(soa::Join const& collisions, FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, + aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -847,7 +847,7 @@ struct HfCandidateCreator3Prong { void processNoPvRefitWithKFParticleUpc(soa::Join const& collisions, FilteredHf3Prongs const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const& tracks, - aod::BCFullInfos const& bcWithTimeStamps, + aod::BcFullInfos const& bcWithTimeStamps, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -919,7 +919,7 @@ struct HfCandidateCreator3Prong { /// @brief process function to monitor collisions - UPC void processCollisionsUpc(soa::Join const& collisions, - aod::BCFullInfos const& bcs, + aod::BcFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, @@ -931,7 +931,7 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; float occupancy = getOccupancyColl(collision, OccupancyEstimator::Its); - const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); + const auto rejectionMask = hfEvSel.getHfCollisionRejectionMaskWithUpc(collision, centrality, ccdb, registry, bcs); /// monitor the satisfied event selections hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index e842765e14b..bd8fb621d38 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -163,54 +163,70 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { } /// Event selection with trigger and FT0A centrality selection - void - processTrigAndCentFT0ASel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) + void processTrigAndCentFT0ASel(soa::Join::iterator const& collision, + aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0ASel, "Use trigger and centrality selection with FT0A", false); /// Event selection with trigger and FT0C centrality selection - void processTrigAndCentFT0CSel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) + void processTrigAndCentFT0CSel(soa::Join::iterator const& collision, + aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0CSel, "Use trigger and centrality selection with FT0C", false); /// Event selection with trigger and FT0M centrality selection - void processTrigAndCentFT0MSel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) + void processTrigAndCentFT0MSel(soa::Join::iterator const& collision, + aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0MSel, "Use trigger and centrality selection with FT0M", false); /// Event selection with trigger and FV0A centrality selection - void processTrigAndCentFV0ASel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) + void processTrigAndCentFV0ASel(soa::Join::iterator const& collision, + aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFV0ASel, "Use trigger and centrality selection with FV0A", false); /// Event selection with trigger selection - void processTrigSel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs) + void processTrigSel(soa::Join::iterator const& collision, + aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigSel, "Use trigger selection", false); /// Event selection without trigger selection - void processNoTrigSel(aod::Collision const& collision, aod::BCFullInfos const& bcs) + void processNoTrigSel(aod::Collision const& collision, + aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); } PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processNoTrigSel, "Do not use trigger selection", true); /// Event selection with UPC - void processUpcSel(soa::Join::iterator const& collision, aod::BCFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) + void processUpcSel(soa::Join::iterator const& collision, + aod::BcFullInfos const& bcs, + aod::FT0s const& /*ft0s*/, + aod::FV0As const& /*fv0as*/, + aod::FDDs const& /*fdds*/, + aod::Zdcs const& /*zdcs*/) { selectCollision(collision, bcs); } - PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processUpcSel, "Use upc selection", false); + PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processUpcSel, "Use UPC event selection", false); }; /// Track selection diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index c82f6bc126b..ec0b7a79535 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -228,7 +228,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hPosYAfterEvSel = registry.add(NameHistPosYAfterEvSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{200, -0.5, 0.5}}}); hNumPvContributorsAfterSel = registry.add(NameHistNumPvContributorsAfterSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{500, -0.5, 499.5}}}); setEventRejectionLabels(hCollisions, softwareTrigger); - hUpCollisions = registry.add(NameHistUpCollisions, "HF upc counter;;# of upc events", {o2::framework::HistType::kTH1D, {axisUpcEvents}}); + hUpCollisions = registry.add(NameHistUpCollisions, "HF UPC counter;;# of UPC events", {o2::framework::HistType::kTH1D, {axisUpcEvents}}); const o2::framework::AxisSpec th2AxisCent{th2ConfigAxisCent, "Centrality"}; const o2::framework::AxisSpec th2AxisOccupancy{th2ConfigAxisOccupancy, "Occupancy"}; hCollisionsCentOcc = registry.add(NameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {th2AxisCent, th2AxisOccupancy}}); From 29962865994b1a3640c3b1df00517bc15ab17c91 Mon Sep 17 00:00:00 2001 From: BiaoZhang Date: Thu, 26 Jun 2025 11:28:36 +0200 Subject: [PATCH 18/21] fix comments from vit --- PWGHF/TableProducer/candidateCreator2Prong.cxx | 9 ++++++--- PWGHF/TableProducer/candidateCreator3Prong.cxx | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index b7b642d2f17..851fa76c33d 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -125,7 +125,7 @@ struct HfCandidateCreator2Prong { std::array processesCollisions = {doprocessCollisions, doprocessCollisionsCentFT0C, doprocessCollisionsCentFT0M, doprocessCollisionsUpc}; const int nProcessesCollisions = std::accumulate(processesCollisions.begin(), processesCollisions.end(), 0); std::array processesUpc = {doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc, doprocessCollisionsUpc}; - const int nprocessesUpc = std::accumulate(processesUpc.begin(), processesUpc.end(), 0); + const int nProcessesUpc = std::accumulate(processesUpc.begin(), processesUpc.end(), 0); if (nProcessesCollisions > 1) { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); } @@ -139,8 +139,11 @@ struct HfCandidateCreator2Prong { if ((doprocessPvRefitWithDCAFitterNCentFT0M || doprocessNoPvRefitWithDCAFitterNCentFT0M || doprocessPvRefitWithKFParticleCentFT0M || doprocessNoPvRefitWithKFParticleCentFT0M) && !doprocessCollisionsCentFT0M) { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsCentFT0M\"?"); } + if ((doprocessPvRefitWithDCAFitterNUpc || doprocessNoPvRefitWithDCAFitterNUpc || doprocessPvRefitWithKFParticleUpc || doprocessNoPvRefitWithKFParticleUpc) && !doprocessCollisionsUpc) { + LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsUpc\"?"); + } } - if (nprocessesUpc > 0 && isRun2) { + if (nProcessesUpc > 0 && isRun2) { LOGP(fatal, "Process function for UPC is only available in Run 3!"); } @@ -764,7 +767,7 @@ struct HfCandidateCreator2Prong { void processCollisionsUpc(soa::Join const& collisions, aod::BcFullInfos const& bcs, aod::FT0s const& /*ft0s*/, - aod::FV0As const& /*fv0as*/, + aod::FV0As const& /*fv0as*/, aod::FDDs const& /*fdds*/, aod::Zdcs const& /*zdcs*/) { diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index f1a36f0079f..40ab5709951 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -149,7 +149,7 @@ struct HfCandidateCreator3Prong { const int nProcessesCollisions = std::accumulate(processesCollisions.begin(), processesCollisions.end(), 0); std::array processesUpc = {doprocessPvRefitWithDCAFitterNUpc, doprocessNoPvRefitWithDCAFitterNUpc, doprocessPvRefitWithKFParticleUpc, doprocessNoPvRefitWithKFParticleUpc, doprocessCollisionsUpc}; - const int nprocessesUpc = std::accumulate(processesUpc.begin(), processesUpc.end(), 0); + const int nProcessesUpc = std::accumulate(processesUpc.begin(), processesUpc.end(), 0); if (nProcessesCollisions > 1) { LOGP(fatal, "At most one process function for collision monitoring can be enabled at a time."); @@ -164,8 +164,11 @@ struct HfCandidateCreator3Prong { if ((doprocessPvRefitWithDCAFitterNCentFT0M || doprocessNoPvRefitWithDCAFitterNCentFT0M || doprocessPvRefitWithKFParticleCentFT0M || doprocessNoPvRefitWithKFParticleCentFT0M) && !doprocessCollisionsCentFT0M) { LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsCentFT0M\"?"); } + if ((doprocessPvRefitWithDCAFitterNUpc || doprocessNoPvRefitWithDCAFitterNUpc || doprocessPvRefitWithKFParticleUpc || doprocessNoPvRefitWithKFParticleUpc) && !doprocessCollisionsUpc) { + LOGP(fatal, "Process function for collision monitoring not correctly enabled. Did you enable \"processCollisionsUpc\"?"); + } } - if (nprocessesUpc > 0 && isRun2) { + if (nProcessesUpc > 0 && isRun2) { LOGP(fatal, "Process function for UPC is only available in Run 3!"); } std::array creationFlags = {createDplus, createDs, createLc, createXic}; @@ -242,7 +245,7 @@ struct HfCandidateCreator3Prong { } template - void runCreator3ProngWithDCAFitterN(Coll const&, + void runCreator3ProngWithDCAFitterN(Coll const&, Cand const& rowsTrackIndexProng3, TracksWCovExtraPidPiKaPr const&, BCsType const& bcs) From 6d85be09188c2607d1815685400cbc7a60f17a3e Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 26 Jun 2025 09:29:08 +0000 Subject: [PATCH 19/21] Please consider the following formatting changes --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 22 ++++++------- PWGHF/Utils/utilsEvSelHf.h | 33 ++++++++++--------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index bd8fb621d38..67d2d8b8568 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -164,7 +164,7 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { /// Event selection with trigger and FT0A centrality selection void processTrigAndCentFT0ASel(soa::Join::iterator const& collision, + aod::EvSels, aod::CentFT0As>::iterator const& collision, aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); @@ -172,8 +172,8 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0ASel, "Use trigger and centrality selection with FT0A", false); /// Event selection with trigger and FT0C centrality selection - void processTrigAndCentFT0CSel(soa::Join::iterator const& collision, + void processTrigAndCentFT0CSel(soa::Join::iterator const& collision, aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); @@ -181,8 +181,8 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0CSel, "Use trigger and centrality selection with FT0C", false); /// Event selection with trigger and FT0M centrality selection - void processTrigAndCentFT0MSel(soa::Join::iterator const& collision, + void processTrigAndCentFT0MSel(soa::Join::iterator const& collision, aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); @@ -190,8 +190,8 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFT0MSel, "Use trigger and centrality selection with FT0M", false); /// Event selection with trigger and FV0A centrality selection - void processTrigAndCentFV0ASel(soa::Join::iterator const& collision, + void processTrigAndCentFV0ASel(soa::Join::iterator const& collision, aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); @@ -199,8 +199,8 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigAndCentFV0ASel, "Use trigger and centrality selection with FV0A", false); /// Event selection with trigger selection - void processTrigSel(soa::Join::iterator const& collision, + void processTrigSel(soa::Join::iterator const& collision, aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); @@ -208,7 +208,7 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigSel, "Use trigger selection", false); /// Event selection without trigger selection - void processNoTrigSel(aod::Collision const& collision, + void processNoTrigSel(aod::Collision const& collision, aod::BcFullInfos const& bcs) { selectCollision(collision, bcs); @@ -217,7 +217,7 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { /// Event selection with UPC void processUpcSel(soa::Join::iterator const& collision, + aod::EvSels>::iterator const& collision, aod::BcFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index ec0b7a79535..3f5870dc71e 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -18,11 +18,13 @@ #ifndef PWGHF_UTILS_UTILSEVSELHF_H_ #define PWGHF_UTILS_UTILSEVSELHF_H_ -#include +#include "PWGHF/Core/CentralityEstimation.h" +#include "PWGUD/Core/SGSelector.h" -#include -#include -#include +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/RCTSelectionFlags.h" +#include "EventFiltering/Zorro.h" +#include "EventFiltering/ZorroSummary.h" #include #include @@ -30,19 +32,18 @@ #include #include -#include +#include +#include + +#include + +#include + #include +#include #include // std::shared_ptr #include // std::string -#include "Common/CCDB/EventSelectionParams.h" -#include "Common/CCDB/RCTSelectionFlags.h" -#include "EventFiltering/Zorro.h" -#include "EventFiltering/ZorroSummary.h" - -#include "PWGHF/Core/CentralityEstimation.h" -#include "PWGUD/Core/SGSelector.h" - namespace o2::hf_occupancy { // centrality selection estimators @@ -114,7 +115,7 @@ enum EventRejection { }; o2::framework::AxisSpec axisEvents = {EventRejection::NEventRejection, -0.5f, +EventRejection::NEventRejection - 0.5f, ""}; -o2::framework::AxisSpec axisUpcEvents = { o2::aod::sgselector::DoubleGap + 1, -0.5f, +o2::aod::sgselector::DoubleGap + 0.5f, ""}; +o2::framework::AxisSpec axisUpcEvents = {o2::aod::sgselector::DoubleGap + 1, -0.5f, +o2::aod::sgselector::DoubleGap + 0.5f, ""}; /// \brief Function to put labels on monitoring histogram /// \param hRejection monitoring histogram @@ -228,7 +229,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hPosYAfterEvSel = registry.add(NameHistPosYAfterEvSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{200, -0.5, 0.5}}}); hNumPvContributorsAfterSel = registry.add(NameHistNumPvContributorsAfterSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{500, -0.5, 499.5}}}); setEventRejectionLabels(hCollisions, softwareTrigger); - hUpCollisions = registry.add(NameHistUpCollisions, "HF UPC counter;;# of UPC events", {o2::framework::HistType::kTH1D, {axisUpcEvents}}); + hUpCollisions = registry.add(NameHistUpCollisions, "HF UPC counter;;# of UPC events", {o2::framework::HistType::kTH1D, {axisUpcEvents}}); const o2::framework::AxisSpec th2AxisCent{th2ConfigAxisCent, "Centrality"}; const o2::framework::AxisSpec th2AxisOccupancy{th2ConfigAxisOccupancy, "Occupancy"}; hCollisionsCentOcc = registry.add(NameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {th2AxisCent, th2AxisOccupancy}}); @@ -378,7 +379,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { if (upcEventType > o2::aod::sgselector::DoubleGap) { SETBIT(rejectionMaskWithUpc, EventRejection::UpcEventCut); } else { - hUpCollisions->Fill(upcEventType); + hUpCollisions->Fill(upcEventType); } } From e0c1abeee497aa386a30458b60d7036a85f0c2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 26 Jun 2025 14:55:52 +0200 Subject: [PATCH 20/21] Update trackIndexSkimCreator.cxx --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 67d2d8b8568..2c6dfd66343 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -216,8 +216,7 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processNoTrigSel, "Do not use trigger selection", true); /// Event selection with UPC - void processUpcSel(soa::Join::iterator const& collision, + void processUpcSel(soa::Join::iterator const& collision, aod::BcFullInfos const& bcs, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0as*/, From 7f17e5eed4b90ebb29c7688f26cdc05c8b3a0df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?BiaoZhang=20=28=E5=BC=A0=E5=BD=AA=29?= <52267892+zhangbiao-phy@users.noreply.github.com> Date: Thu, 26 Jun 2025 16:01:07 +0200 Subject: [PATCH 21/21] Update utilsEvSelHf.h --- PWGHF/Utils/utilsEvSelHf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 3f5870dc71e..27426db230e 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -261,7 +261,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { /// \param ccdb ccdb service needed to retrieve the needed info for zorro /// \param registry reference to the histogram registry needed for zorro /// \return bitmask with the event selection criteria not satisfied by the collision - template + template uint32_t getHfCollisionRejectionMask(const Coll& collision, float& centrality, o2::framework::Service const& ccdb, o2::framework::HistogramRegistry& registry) { uint32_t rejectionMask{0}; // 32 bits, in case new ev. selections will be added @@ -340,7 +340,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { if (softwareTrigger.value != "") { // we might have to update it from CCDB - auto bc = collision.template bc_as(); + auto bc = collision.template bc_as(); int runNumber = bc.runNumber(); if (runNumber != currentRun) { // We might need to update Zorro from CCDB if the run number changes