From f083eece9c8d798bf5c9c3d4d0142aaf4a96c987 Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Wed, 27 Nov 2024 13:25:06 +0100 Subject: [PATCH 01/11] [PWGHF] Adding occupcany vs centrality info in HF ev. sel. utils --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 2 +- PWGHF/Utils/utilsEvSelHf.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index fe77bb275d9..4c39c1ab96b 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -188,7 +188,7 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { 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(soa::Join::iterator const& collision, aod::BCsWithTimestamps const& bcs) { selectCollision(collision, bcs); } diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 71f0bd0559d..01a383cb377 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -116,8 +116,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { static constexpr char nameHistPosXAfterEvSel[] = "hPosXAfterEvSel"; static constexpr char nameHistPosYAfterEvSel[] = "hPosYAfterEvSel"; static constexpr char nameHistNumPvContributorsAfterSel[] = "hNumPvContributorsAfterSel"; + static constexpr char nameHistCollisionsCentOcc[] = "hCollisionsCentOcc"; std::shared_ptr hCollisions, hSelCollisionsCent, hPosZBeforeEvSel, hPosZAfterEvSel, hPosXAfterEvSel, hPosYAfterEvSel, hNumPvContributorsAfterSel; + std::shared_ptr hCollisionsCentOcc; // util to retrieve trigger mask in case of software triggers Zorro zorro; @@ -136,6 +138,13 @@ 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); + + if (useFT0cOccEstimator) { + hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {{110, 0, 110}, {100, 0, 140000}}}); + } else { + hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {{110, 0, 110}, {140, 0, 14000}}}); + } + setEventRejectionLabels(hCollisions, softwareTrigger); // we initialise the summary object if (softwareTrigger.value != "") { @@ -290,6 +299,13 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hPosZAfterEvSel->Fill(posZ); hNumPvContributorsAfterSel->Fill(collision.numContrib()); hSelCollisionsCent->Fill(centrality); + if (useFT0cOccEstimator) { + /// occupancy estimator (FT0c signal amplitudes in +-10us from current collision) + hCollisionsCentOcc->Fill(centrality, collision.ft0cOccupancyInTimeRange()); + } else { + /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) + hCollisionsCentOcc->Fill(centrality, collision.trackOccupancyInTimeRange()); + } } }; From 8301014629e70343d983c2cbf8081b0e73595385 Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Wed, 27 Nov 2024 17:51:15 +0100 Subject: [PATCH 02/11] [PWGHF] Adjusting binning in occ.vs cent histo --- 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 01a383cb377..cd58c05046e 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -140,11 +140,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { setEventRejectionLabels(hCollisions, softwareTrigger); if (useFT0cOccEstimator) { - hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {{110, 0, 110}, {100, 0, 140000}}}); + hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {{111, -1, 110}, {100, 0., 140000}}}); } else { - hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {{110, 0, 110}, {140, 0, 14000}}}); + hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {{111, -1, 111}, {140, 0., 14000}}}); } - setEventRejectionLabels(hCollisions, softwareTrigger); // we initialise the summary object if (softwareTrigger.value != "") { @@ -304,6 +303,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hCollisionsCentOcc->Fill(centrality, collision.ft0cOccupancyInTimeRange()); } else { /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) + LOG(info) << collision.trackOccupancyInTimeRange() <<" "<< centrality; hCollisionsCentOcc->Fill(centrality, collision.trackOccupancyInTimeRange()); } } From 94bed17574dddf4cdddabecb01ab69dc79a39f28 Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Wed, 27 Nov 2024 17:52:48 +0100 Subject: [PATCH 03/11] [PWGHF] Removing unused log --- PWGHF/Utils/utilsEvSelHf.h | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index cd58c05046e..0088554feac 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -303,7 +303,6 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hCollisionsCentOcc->Fill(centrality, collision.ft0cOccupancyInTimeRange()); } else { /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) - LOG(info) << collision.trackOccupancyInTimeRange() <<" "<< centrality; hCollisionsCentOcc->Fill(centrality, collision.trackOccupancyInTimeRange()); } } From 98ddfca72ab77a33323fd6cacfb1f1417609c65a Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Thu, 28 Nov 2024 15:54:59 +0100 Subject: [PATCH 04/11] [PWGHF] Adding axis configurable to adjust occ. and cent. axes --- PWGHF/Utils/utilsEvSelHf.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 0088554feac..5588b212595 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -107,6 +107,8 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable softwareTrigger{"softwareTrigger", "", "Label of software trigger. Multiple triggers can be selected dividing them by a comma. Set None if you want bcs that are not selected by any trigger"}; o2::framework::Configurable bcMarginForSoftwareTrigger{"bcMarginForSoftwareTrigger", 100, "Number of BCs of margin for software triggers"}; o2::framework::Configurable ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "Users/m/mpuccio/EventFiltering/OTS/", "ccdb path for ZORRO objects"}; + o2::framework::ConfigurableAxis th2ConfigAxisCent{"th2ConfigAxisCent", {100, 0., 100.}, ""}; + o2::framework::ConfigurableAxis th2ConfigAxisOccupancy{"th2ConfigAxisOccupancy", {14, 0, 140000}, ""}; // histogram names static constexpr char nameHistCollisions[] = "hCollisions"; @@ -139,11 +141,9 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hNumPvContributorsAfterSel = registry.add(nameHistNumPvContributorsAfterSel, "selected events;#it{y}_{prim. vtx.} (cm);entries", {o2::framework::HistType::kTH1D, {{500, -0.5, 499.5}}}); setEventRejectionLabels(hCollisions, softwareTrigger); - if (useFT0cOccEstimator) { - hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {{111, -1, 110}, {100, 0., 140000}}}); - } else { - hCollisionsCentOcc = registry.add(nameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {{111, -1, 111}, {140, 0., 14000}}}); - } + 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}}); // we initialise the summary object if (softwareTrigger.value != "") { From 654f16c2f80a068e52f61df6aea07bf8fbadf8ae Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 28 Nov 2024 14:57:29 +0000 Subject: [PATCH 05/11] Please consider the following formatting changes --- PWGHF/Utils/utilsEvSelHf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 5588b212595..cbc511efe18 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -140,7 +140,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); - + 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 87f697f575c328d56a4fd3bb606fd1a4087ad6bf Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Thu, 28 Nov 2024 17:49:01 +0100 Subject: [PATCH 06/11] [PWGHF] Setting default occupancy in ev sel, adding occ info in creators and flow tasks --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 3 ++- PWGHF/TableProducer/candidateCreator2Prong.cxx | 9 ++++++--- PWGHF/TableProducer/candidateCreator3Prong.cxx | 9 ++++++--- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 2 +- PWGHF/Utils/utilsEvSelHf.h | 10 ++-------- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 2d84a9afdf8..476eab84476 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -386,10 +386,11 @@ struct HfTaskFlowCharmHadrons { aod::BCsWithTimestamps const&) { float centrality{-1.f}; + float occupancy = getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); return rejectionMask == 0; } diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index 6d27cfd9021..c536e17132a 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -625,10 +625,11 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = collision.trackOccupancyInTimeRange(); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } @@ -642,10 +643,11 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = collision.trackOccupancyInTimeRange(); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } @@ -659,10 +661,11 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = collision.trackOccupancyInTimeRange(); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index a14df266590..b6b100a92da 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -404,10 +404,11 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = collision.trackOccupancyInTimeRange(); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } @@ -421,10 +422,11 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = collision.trackOccupancyInTimeRange(); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } @@ -438,10 +440,11 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; + float occupancy = collision.trackOccupancyInTimeRange(); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections - hfEvSel.fillHistograms(collision, rejectionMask, centrality); + hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); } /// end loop over collisions } diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 4c39c1ab96b..fe77bb275d9 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -188,7 +188,7 @@ struct HfTrackIndexSkimCreatorTagSelCollisions { PROCESS_SWITCH(HfTrackIndexSkimCreatorTagSelCollisions, processTrigSel, "Use trigger selection", false); /// Event selection without trigger selection - void processNoTrigSel(soa::Join::iterator const& collision, aod::BCsWithTimestamps const& bcs) + void processNoTrigSel(aod::Collision const& collision, aod::BCsWithTimestamps const& bcs) { selectCollision(collision, bcs); } diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index cbc511efe18..d9f481a5d0d 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -280,7 +280,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { /// \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) + void fillHistograms(Coll const& collision, const uint16_t rejectionMask, float& centrality, float occupancy=-1) { hCollisions->Fill(EventRejection::None); const float posZ = collision.posZ(); @@ -298,13 +298,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { hPosZAfterEvSel->Fill(posZ); hNumPvContributorsAfterSel->Fill(collision.numContrib()); hSelCollisionsCent->Fill(centrality); - if (useFT0cOccEstimator) { - /// occupancy estimator (FT0c signal amplitudes in +-10us from current collision) - hCollisionsCentOcc->Fill(centrality, collision.ft0cOccupancyInTimeRange()); - } else { - /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) - hCollisionsCentOcc->Fill(centrality, collision.trackOccupancyInTimeRange()); - } + hCollisionsCentOcc->Fill(centrality, occupancy); } }; From ecdb40800b346353005ccb92efae0f05594afb56 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 28 Nov 2024 16:53:32 +0000 Subject: [PATCH 07/11] Please consider the following formatting changes --- PWGHF/Utils/utilsEvSelHf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index d9f481a5d0d..3fa822d9e8f 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -280,7 +280,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { /// \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 uint16_t rejectionMask, float& centrality, float occupancy = -1) { hCollisions->Fill(EventRejection::None); const float posZ = collision.posZ(); From e627bfc4d2d6c663acf9f307f22921e578831874 Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Fri, 29 Nov 2024 10:18:56 +0100 Subject: [PATCH 08/11] [PWGHF] Implementing PR comments --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 46 ++++++------------- .../TableProducer/candidateCreator2Prong.cxx | 6 +-- .../TableProducer/candidateCreator3Prong.cxx | 6 +-- PWGHF/Utils/utilsEvSelHf.h | 31 +++++++++---- 4 files changed, 42 insertions(+), 47 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 476eab84476..987b695279a 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -64,8 +64,7 @@ struct HfTaskFlowCharmHadrons { Configurable centralityMax{"centralityMax", 100., "Maximum centrality accepted in SP/EP computation (not applied in resolution process)"}; Configurable storeEP{"storeEP", false, "Flag to store EP-related axis"}; Configurable storeMl{"storeMl", false, "Flag to store ML scores"}; - Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; - Configurable storeOccupancy{"storeOccupancy", false, "Flag to store TH2 occITS/occFT0C + HfEvSelBitMasks"}; + Configurable occEstimator{"occEstimator", 0, "Occupancy estimation (0: None, 1: ITS, 2: FT0C)"}; Configurable saveEpResoHisto{"saveEpResoHisto", false, "Flag to save event plane resolution histogram"}; Configurable ccdbUrl{"ccdbUrl", "http://alice-ccdb.cern.ch", "url of the ccdb repository"}; Configurable> classMl{"classMl", {0, 2}, "Indexes of BDT scores to be stored. Two indexes max."}; @@ -147,7 +146,7 @@ struct HfTaskFlowCharmHadrons { if (storeMl) { axes.insert(axes.end(), {thnAxisMlOne, thnAxisMlTwo}); } - if (storeOccupancy) { + if (occEstimator != 0) { if (occEstimator == 1) { axes.insert(axes.end(), {thnAxisOccupancyITS, thnAxisNoSameBunchPileup, thnAxisNumTracksInTimeRange, thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard}); @@ -158,7 +157,7 @@ struct HfTaskFlowCharmHadrons { } registry.add("hSparseFlowCharm", "THn for SP", HistType::kTHnSparseF, axes); - if (storeOccupancy) { + if (occEstimator != 0) { registry.add("trackOccVsFT0COcc", "trackOccVsFT0COcc; trackOcc; FT0COcc", {HistType::kTH2F, {thnAxisOccupancyITS, thnAxisOccupancyFT0C}}); } @@ -280,7 +279,7 @@ struct HfTaskFlowCharmHadrons { float& occupancy, uint16_t& hfevselflag) { - if (storeOccupancy) { + if (occEstimator != 0) { if (storeMl) { if (storeEP) { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, outputMl[0], outputMl[1], occupancy, @@ -331,26 +330,6 @@ struct HfTaskFlowCharmHadrons { } } - /// Get the occupancy - /// \param collision is the collision with the occupancy information - float getOccupancy(CollsWithQvecs::iterator const& collision) - { - float occupancy = -999.; - switch (occEstimator) { - case 1: - occupancy = collision.trackOccupancyInTimeRange(); - break; - case 2: - occupancy = collision.ft0cOccupancyInTimeRange(); - break; - default: - LOG(warning) << "Occupancy estimator not valid. Possible values are ITS or FT0C. Fallback to ITS"; - occupancy = collision.trackOccupancyInTimeRange(); - break; - } - return occupancy; - } - /// Get the centrality /// \param collision is the collision with the centrality information float getCentrality(CollsWithQvecs::iterator const& collision) @@ -380,17 +359,20 @@ struct HfTaskFlowCharmHadrons { /// Check if the collision is selected /// \param collision is the collision with the Q vector information /// \param bc is the bunch crossing with timestamp information + /// \param centrality is the collision centrality /// \return true if the collision is selected, false otherwise template bool isCollSelected(CollsWithQvecs::iterator const& collision, - aod::BCsWithTimestamps const&) + aod::BCsWithTimestamps const&, + float& centrality) { - float centrality{-1.f}; - float occupancy = getOccupancy(collision); + float occupancy = hfEvSel.getOccupancy(collision, occEstimator); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); + centrality = getCentrality(collision); /// monitor the satisfied event selections hfEvSel.fillHistograms(collision, rejectionMask, centrality, occupancy); + registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); return rejectionMask == 0; } @@ -455,8 +437,8 @@ struct HfTaskFlowCharmHadrons { } float occupancy = 0.; uint16_t hfevflag; - if (storeOccupancy) { - occupancy = getOccupancy(collision); + if (occEstimator != 0) { + occupancy = hfEvSel.getOccupancy(collision, occEstimator); registry.fill(HIST("trackOccVsFT0COcc"), collision.trackOccupancyInTimeRange(), collision.ft0cOccupancyInTimeRange()); hfevflag = hfEvSel.getHfCollisionRejectionMask(collision, cent, ccdb, registry); } @@ -649,12 +631,12 @@ struct HfTaskFlowCharmHadrons { void processResolution(CollsWithQvecs::iterator const& collision, aod::BCsWithTimestamps const& bcs) { - if (!isCollSelected(collision, bcs)) { + float centrality {-1.f}; + if (!isCollSelected(collision, bcs, centrality)) { // no selection on the centrality is applied on purpose to allow for the resolution study in post-processing return; } - float centrality = getCentrality(collision); // centrality not updated in the rejection mask function float xQVecFT0a = collision.qvecFT0ARe(); float yQVecFT0a = collision.qvecFT0AIm(); float xQVecFT0c = collision.qvecFT0CRe(); diff --git a/PWGHF/TableProducer/candidateCreator2Prong.cxx b/PWGHF/TableProducer/candidateCreator2Prong.cxx index c536e17132a..5b8128182d6 100644 --- a/PWGHF/TableProducer/candidateCreator2Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator2Prong.cxx @@ -625,7 +625,7 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; - float occupancy = collision.trackOccupancyInTimeRange(); + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections @@ -643,7 +643,7 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; - float occupancy = collision.trackOccupancyInTimeRange(); + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections @@ -661,7 +661,7 @@ struct HfCandidateCreator2Prong { /// bitmask with event. selection info float centrality{-1.f}; - float occupancy = collision.trackOccupancyInTimeRange(); + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections diff --git a/PWGHF/TableProducer/candidateCreator3Prong.cxx b/PWGHF/TableProducer/candidateCreator3Prong.cxx index b6b100a92da..985e21acee8 100644 --- a/PWGHF/TableProducer/candidateCreator3Prong.cxx +++ b/PWGHF/TableProducer/candidateCreator3Prong.cxx @@ -404,7 +404,7 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; - float occupancy = collision.trackOccupancyInTimeRange(); + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections @@ -422,7 +422,7 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; - float occupancy = collision.trackOccupancyInTimeRange(); + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections @@ -440,7 +440,7 @@ struct HfCandidateCreator3Prong { /// bitmask with event. selection info float centrality{-1.f}; - float occupancy = collision.trackOccupancyInTimeRange(); + float occupancy = hfEvSel.getOccupancy(collision); const auto rejectionMask = hfEvSel.getHfCollisionRejectionMask(collision, centrality, ccdb, registry); /// monitor the satisfied event selections diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 3fa822d9e8f..8d1cc9fd9d4 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -94,7 +94,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useIsGoodZvtxFT0vsPV{"useIsGoodZvtxFT0vsPV", false, "Check consistency between PVz from central barrel with that from FT0 timing"}; o2::framework::Configurable useNoSameBunchPileup{"useNoSameBunchPileup", false, "Exclude collisions in bunches with more than 1 reco. PV"}; // POTENTIALLY BAD FOR BEAUTY ANALYSES o2::framework::Configurable useNumTracksInTimeRange{"useNumTracksInTimeRange", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters in +-100us from current collision)"}; - o2::framework::Configurable useFT0cOccEstimator{"useFT0cOccEstimator", false, "Adopt FT0c amplitudes as occupancy estimator instead of ITS tracks"}; + o2::framework::Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; o2::framework::Configurable numTracksInTimeRangeMin{"numTracksInTimeRangeMin", 0, "Minimum occupancy"}; o2::framework::Configurable numTracksInTimeRangeMax{"numTracksInTimeRangeMax", 1000000, "Maximum occupancy"}; o2::framework::Configurable nPvContributorsMin{"nPvContributorsMin", 0, "Minimum number of PV contributors"}; @@ -220,14 +220,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { SETBIT(rejectionMask, EventRejection::NoCollInRofStandard); } if (useNumTracksInTimeRange) { - float numTracksInTimeRange; - if (useFT0cOccEstimator) { - /// occupancy estimator (FT0c signal amplitudes in +-10us from current collision) - numTracksInTimeRange = collision.ft0cOccupancyInTimeRange(); - } else { - /// occupancy estimator (ITS tracks with at least 5 clusters in +-10us from current collision) - numTracksInTimeRange = static_cast(collision.trackOccupancyInTimeRange()); - } + float numTracksInTimeRange = getOccupancy(collision, occEstimator); if (numTracksInTimeRange < numTracksInTimeRangeMin || numTracksInTimeRange > numTracksInTimeRangeMax) { SETBIT(rejectionMask, EventRejection::NumTracksInTimeRange); } @@ -276,6 +269,26 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { return rejectionMask; } + /// Get the occupancy + /// \param collision is the collision with the occupancy information + /// \param occEstimator is the occupancy estimation (1: ITS, 2: FT0C) + template + float getOccupancy(Coll const& collision, int occEstimator = 1) + { + switch (occEstimator) { + case 1: // ITS + return collision.trackOccupancyInTimeRange(); + break; + case 2: // FT0c + return collision.ft0cOccupancyInTimeRange(); + break; + default: + LOG(warning) << "Occupancy estimator not valid. Possible values are ITS or FT0C. Fallback to ITS"; + return collision.trackOccupancyInTimeRange(); + break; + } + } + /// \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 From 388a0d3223f483389dc359cd785fff4ba41cf5a1 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 29 Nov 2024 09:22:13 +0000 Subject: [PATCH 09/11] Please consider the following formatting changes --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index 987b695279a..a667aadb169 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -631,7 +631,7 @@ struct HfTaskFlowCharmHadrons { void processResolution(CollsWithQvecs::iterator const& collision, aod::BCsWithTimestamps const& bcs) { - float centrality {-1.f}; + float centrality{-1.f}; if (!isCollSelected(collision, bcs, centrality)) { // no selection on the centrality is applied on purpose to allow for the resolution study in post-processing return; From b578bfe00ff5cd8b60005eb17cdd9f9dc43b0d9e Mon Sep 17 00:00:00 2001 From: stefanopolitano Date: Fri, 29 Nov 2024 11:49:51 +0100 Subject: [PATCH 10/11] [PWGHF] Implementing PR comments adding centrality function in evsel --- PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx | 16 ++++---- PWGHF/Utils/utilsEvSelHf.h | 52 ++++++++++++++---------- 2 files changed, 39 insertions(+), 29 deletions(-) diff --git a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx index a667aadb169..59e4f0f4523 100644 --- a/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx +++ b/PWGHF/D2H/Tasks/taskFlowCharmHadrons.cxx @@ -80,7 +80,7 @@ struct HfTaskFlowCharmHadrons { ConfigurableAxis thnConfigAxisOccupancyITS{"thnConfigAxisOccupancyITS", {14, 0, 14000}, ""}; ConfigurableAxis thnConfigAxisOccupancyFT0C{"thnConfigAxisOccupancyFT0C", {14, 0, 140000}, ""}; ConfigurableAxis thnConfigAxisNoSameBunchPileup{"thnConfigAxisNoSameBunchPileup", {2, 0, 2}, ""}; - ConfigurableAxis thnConfigAxisNumTracksInTimeRange{"thnConfigAxisNumTracksInTimeRange", {2, 0, 2}, ""}; + ConfigurableAxis thnConfigAxisOccupancy{"thnConfigAxisOccupancy", {2, 0, 2}, ""}; ConfigurableAxis thnConfigAxisNoCollInTimeRangeNarrow{"thnConfigAxisNoCollInTimeRangeNarrow", {2, 0, 2}, ""}; ConfigurableAxis thnConfigAxisNoCollInTimeRangeStandard{"thnConfigAxisNoCollInTimeRangeStandard", {2, 0, 2}, ""}; ConfigurableAxis thnConfigAxisNoCollInRofStandard{"thnConfigAxisNoCollInRofStandard", {2, 0, 2}, ""}; @@ -134,7 +134,7 @@ struct HfTaskFlowCharmHadrons { const AxisSpec thnAxisOccupancyITS{thnConfigAxisOccupancyITS, "OccupancyITS"}; const AxisSpec thnAxisOccupancyFT0C{thnConfigAxisOccupancyFT0C, "OccupancyFT0C"}; const AxisSpec thnAxisNoSameBunchPileup{thnConfigAxisNoSameBunchPileup, "NoSameBunchPileup"}; - const AxisSpec thnAxisNumTracksInTimeRange{thnConfigAxisNumTracksInTimeRange, "NumTracksInTimeRange"}; + const AxisSpec thnAxisOccupancy{thnConfigAxisOccupancy, "Occupancy"}; const AxisSpec thnAxisNoCollInTimeRangeNarrow{thnConfigAxisNoCollInTimeRangeNarrow, "NoCollInTimeRangeNarrow"}; const AxisSpec thnAxisNoCollInTimeRangeStandard{thnConfigAxisNoCollInTimeRangeStandard, "NoCollInTimeRangeStandard"}; const AxisSpec thnAxisNoCollInRofStandard{thnConfigAxisNoCollInRofStandard, "NoCollInRofStandard"}; @@ -148,10 +148,10 @@ struct HfTaskFlowCharmHadrons { } if (occEstimator != 0) { if (occEstimator == 1) { - axes.insert(axes.end(), {thnAxisOccupancyITS, thnAxisNoSameBunchPileup, thnAxisNumTracksInTimeRange, + axes.insert(axes.end(), {thnAxisOccupancyITS, thnAxisNoSameBunchPileup, thnAxisOccupancy, thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard}); } else { - axes.insert(axes.end(), {thnAxisOccupancyFT0C, thnAxisNoSameBunchPileup, thnAxisNumTracksInTimeRange, + axes.insert(axes.end(), {thnAxisOccupancyFT0C, thnAxisNoSameBunchPileup, thnAxisOccupancy, thnAxisNoCollInTimeRangeNarrow, thnAxisNoCollInTimeRangeStandard, thnAxisNoCollInRofStandard}); } } @@ -284,14 +284,14 @@ struct HfTaskFlowCharmHadrons { if (storeEP) { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, outputMl[0], outputMl[1], occupancy, TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), - TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::Occupancy), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); } else { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, outputMl[0], outputMl[1], occupancy, TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), - TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::Occupancy), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); @@ -300,14 +300,14 @@ struct HfTaskFlowCharmHadrons { if (storeEP) { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, cosNPhi, cosDeltaPhi, occupancy, TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), - TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::Occupancy), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); } else { registry.fill(HIST("hSparseFlowCharm"), mass, pt, cent, sp, occupancy, TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoSameBunchPileup), - TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NumTracksInTimeRange), + TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::Occupancy), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeNarrow), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInTimeRangeStandard), TESTBIT(hfevselflag, o2::hf_evsel::EventRejection::NoCollInRofStandard)); diff --git a/PWGHF/Utils/utilsEvSelHf.h b/PWGHF/Utils/utilsEvSelHf.h index 8d1cc9fd9d4..0151b7028bf 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -44,7 +44,7 @@ enum EventRejection { ItsRofBorderCut, IsGoodZvtxFT0vsPV, NoSameBunchPileup, - NumTracksInTimeRange, + Occupancy, NContrib, Chi2, PositionZ, @@ -72,7 +72,7 @@ void setEventRejectionLabels(Histo& hRejection, std::string softwareTriggerLabel hRejection->GetXaxis()->SetBinLabel(EventRejection::ItsRofBorderCut + 1, "ITS ROF border"); 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::NumTracksInTimeRange + 1, "Occupancy"); + hRejection->GetXaxis()->SetBinLabel(EventRejection::Occupancy + 1, "Occupancy"); hRejection->GetXaxis()->SetBinLabel(EventRejection::NContrib + 1, "# of PV contributors"); hRejection->GetXaxis()->SetBinLabel(EventRejection::Chi2 + 1, "PV #it{#chi}^{2}"); hRejection->GetXaxis()->SetBinLabel(EventRejection::PositionZ + 1, "PV #it{z}"); @@ -93,10 +93,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useItsRofBorderCut{"useItsRofBorderCut", true, "Apply ITS ROF border cut"}; o2::framework::Configurable useIsGoodZvtxFT0vsPV{"useIsGoodZvtxFT0vsPV", false, "Check consistency between PVz from central barrel with that from FT0 timing"}; o2::framework::Configurable useNoSameBunchPileup{"useNoSameBunchPileup", false, "Exclude collisions in bunches with more than 1 reco. PV"}; // POTENTIALLY BAD FOR BEAUTY ANALYSES - o2::framework::Configurable useNumTracksInTimeRange{"useNumTracksInTimeRange", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters in +-100us from current collision)"}; + o2::framework::Configurable useOccupancyCut {"useOccupancyCut ", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters or num. of signals in FT0c in +-100us from current collision)"}; o2::framework::Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; - o2::framework::Configurable numTracksInTimeRangeMin{"numTracksInTimeRangeMin", 0, "Minimum occupancy"}; - o2::framework::Configurable numTracksInTimeRangeMax{"numTracksInTimeRangeMax", 1000000, "Maximum occupancy"}; + o2::framework::Configurable occupancyMin{"occupancyMin", 0, "Minimum occupancy"}; + o2::framework::Configurable occupancyMax{"occupancyMax", 1000000, "Maximum occupancy"}; o2::framework::Configurable nPvContributorsMin{"nPvContributorsMin", 0, "Minimum number of PV contributors"}; o2::framework::Configurable chi2PvMax{"chi2PvMax", -1.f, "Maximum PV chi2"}; o2::framework::Configurable zPvPosMin{"zPvPosMin", -10.f, "Minimum PV posZ (cm)"}; @@ -165,17 +165,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { uint16_t rejectionMask{0}; // 16 bits, in case new ev. selections will be added if constexpr (centEstimator != o2::hf_centrality::CentralityEstimator::None) { - if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0A) { - centrality = collision.centFT0A(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { - centrality = collision.centFT0C(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { - centrality = collision.centFT0M(); - } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FV0A) { - centrality = collision.centFV0A(); - } else { - LOGP(fatal, "Unsupported centrality estimator!"); - } + centrality = getCentrality(collision); if (centrality < centralityMin || centrality > centralityMax) { SETBIT(rejectionMask, EventRejection::Centrality); } @@ -219,10 +209,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { if (useNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { SETBIT(rejectionMask, EventRejection::NoCollInRofStandard); } - if (useNumTracksInTimeRange) { - float numTracksInTimeRange = getOccupancy(collision, occEstimator); - if (numTracksInTimeRange < numTracksInTimeRangeMin || numTracksInTimeRange > numTracksInTimeRangeMax) { - SETBIT(rejectionMask, EventRejection::NumTracksInTimeRange); + if (useOccupancyCut ) { + float occupancy = getOccupancy(collision, occEstimator); + if (occupancy < occupancyMin || occupancy > occupancyMax) { + SETBIT(rejectionMask, EventRejection::Occupancy); } } } @@ -271,7 +261,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { /// Get the occupancy /// \param collision is the collision with the occupancy information - /// \param occEstimator is the occupancy estimation (1: ITS, 2: FT0C) + /// \param occEstimator is the occupancy estimator (1: ITS, 2: FT0C) template float getOccupancy(Coll const& collision, int occEstimator = 1) { @@ -289,6 +279,26 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { } } + /// Get the centrality + /// \param collision is the collision with the centrality information + /// \param centEstimator is the centrality estimator from hf_centrality::CentralityEstimator + template + float getCentrality(Coll const& collision) + { + if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0A) { + return collision.centFT0A(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0C) { + return collision.centFT0C(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FT0M) { + return collision.centFT0M(); + } else if constexpr (centEstimator == o2::hf_centrality::CentralityEstimator::FV0A) { + return collision.centFV0A(); + } else { + LOG(warning) << "Centrality estimator not valid. Possible values are V0A, T0M, T0A, T0C. Fallback to FT0c"; + return collision.centFT0C(); + } + } + /// \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 From 00e295503fbd374c342903491159b770a6922e04 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 29 Nov 2024 10:53:16 +0000 Subject: [PATCH 11/11] Please consider the following formatting changes --- 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 0151b7028bf..616608116bb 100644 --- a/PWGHF/Utils/utilsEvSelHf.h +++ b/PWGHF/Utils/utilsEvSelHf.h @@ -93,7 +93,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { o2::framework::Configurable useItsRofBorderCut{"useItsRofBorderCut", true, "Apply ITS ROF border cut"}; o2::framework::Configurable useIsGoodZvtxFT0vsPV{"useIsGoodZvtxFT0vsPV", false, "Check consistency between PVz from central barrel with that from FT0 timing"}; o2::framework::Configurable useNoSameBunchPileup{"useNoSameBunchPileup", false, "Exclude collisions in bunches with more than 1 reco. PV"}; // POTENTIALLY BAD FOR BEAUTY ANALYSES - o2::framework::Configurable useOccupancyCut {"useOccupancyCut ", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters or num. of signals in FT0c in +-100us from current collision)"}; + o2::framework::Configurable useOccupancyCut{"useOccupancyCut ", false, "Apply occupancy selection (num. ITS tracks with at least 5 clusters or num. of signals in FT0c in +-100us from current collision)"}; o2::framework::Configurable occEstimator{"occEstimator", 1, "Occupancy estimation (1: ITS, 2: FT0C)"}; o2::framework::Configurable occupancyMin{"occupancyMin", 0, "Minimum occupancy"}; o2::framework::Configurable occupancyMax{"occupancyMax", 1000000, "Maximum occupancy"}; @@ -209,7 +209,7 @@ struct HfEventSelection : o2::framework::ConfigurableGroup { if (useNoCollInRofStandard && !collision.selection_bit(o2::aod::evsel::kNoCollInRofStandard)) { SETBIT(rejectionMask, EventRejection::NoCollInRofStandard); } - if (useOccupancyCut ) { + if (useOccupancyCut) { float occupancy = getOccupancy(collision, occEstimator); if (occupancy < occupancyMin || occupancy > occupancyMax) { SETBIT(rejectionMask, EventRejection::Occupancy);