From cc313f57832e1cbf4115359c67e3921a0a418a4c Mon Sep 17 00:00:00 2001 From: Victor Date: Wed, 13 Aug 2025 23:19:40 +0200 Subject: [PATCH] [PWGCF] DptDpt - RCT validation support --- PWGCF/TableProducer/dptDptFilter.cxx | 12 +++++++++++- PWGCF/TableProducer/dptDptFilter.h | 26 +++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/PWGCF/TableProducer/dptDptFilter.cxx b/PWGCF/TableProducer/dptDptFilter.cxx index 2e9e7dcc721..7d49129b992 100644 --- a/PWGCF/TableProducer/dptDptFilter.cxx +++ b/PWGCF/TableProducer/dptDptFilter.cxx @@ -356,8 +356,9 @@ struct DptDptFilter { std::string prefix = "cfgEventSelection"; Configurable minOrbit{"minOrbit", -1, "Lowest orbit to track"}; Configurable maxOrbit{"maxOrbit", INT64_MAX, "Highest orbit to track"}; + Configurable rctSource{"rctSource", "None", "RCT selection source: None,CBT,CBT_hadronPID,CBT_electronPID,CBT_calo,CBT_muon,CBT_muon_glo. Default: None"}; struct : ConfigurableGroup { - std::string prefix = "cfgOccupancySelection"; + std::string prefix = "cfgEventSelection.cfgOccupancySelection"; Configurable cfgOccupancyEstimation{"cfgOccupancyEstimation", "None", "Occupancy estimation: None, Tracks, FT0C. Default None"}; Configurable cfgMinOccupancy{"cfgMinOccupancy", 0.0f, "Minimum allowed occupancy. Depends on the occupancy estimation"}; Configurable cfgMaxOccupancy{"cfgMaxOccupancy", 1e6f, "Maximum allowed occupancy. Depends on the occupancy estimation"}; @@ -418,6 +419,15 @@ struct DptDptFilter { } else { fCentMultEstimator = getCentMultEstimator(cfgCentMultEstimator); } + /* RCT information usage */ + if (cfgEventSelection.rctSource.value == "None") { + useRctInformation = false; + } else { + /* for the time being we don't require ZDC and treat limited acceptance as faulty */ + rctChecker.init(cfgEventSelection.rctSource.value, false, true); + useRctInformation = true; + } + /* the occupancy selection */ fOccupancyEstimation = getOccupancyEstimator(cfgEventSelection.cfgOccupancySelection.cfgOccupancyEstimation); fMinOccupancy = cfgEventSelection.cfgOccupancySelection.cfgMinOccupancy; diff --git a/PWGCF/TableProducer/dptDptFilter.h b/PWGCF/TableProducer/dptDptFilter.h index f0107b77a2e..0652e4c2750 100644 --- a/PWGCF/TableProducer/dptDptFilter.h +++ b/PWGCF/TableProducer/dptDptFilter.h @@ -18,6 +18,7 @@ #include "PWGCF/Core/AnalysisConfigurableCuts.h" +#include "Common/CCDB/RCTSelectionFlags.h" #include "Common/Core/MetadataHelper.h" #include "Common/Core/RecoDecay.h" #include "Common/Core/TrackSelection.h" @@ -212,6 +213,7 @@ enum CollisionSelectionFlags { CollSelINT7BIT, ///< INT7 Run 1/2 CollSelSEL7BIT, ///< Sel7 Run 1/2 CollSelTRIGGSELBIT, ///< Accepted by trigger selection + CollSelRCTBIT, ///< Accetped by the RCT information CollSelOCCUPANCYBIT, ///< occupancy within limits CollSelCENTRALITYBIT, ///< centrality cut passed CollSelZVERTEXBIT, ///< zvtx cut passed @@ -227,6 +229,7 @@ static const std::map collisionSelectionExternalNamesMap{ {CollSelINT7BIT, "INT7"}, {CollSelSEL7BIT, "Sel7"}, {CollSelTRIGGSELBIT, "Trigger selection"}, + {CollSelRCTBIT, "RCT accepted"}, {CollSelOCCUPANCYBIT, "Occupancy"}, {CollSelCENTRALITYBIT, "Centrality"}, {CollSelZVERTEXBIT, "z vertex"}, @@ -270,6 +273,12 @@ std::bitset<32> triggerSelectionFlags; //============================================================================================ o2::common::core::MetadataHelper metadataInfo; +//============================================================================================ +// The RCT information access +//============================================================================================ +bool useRctInformation = false; +o2::aod::rctsel::RCTFlagsChecker rctChecker; + //============================================================================================ // The DptDptFilter configuration objects //============================================================================================ @@ -1155,6 +1164,21 @@ inline bool isEventSelected(CollisionObject const& collision, float& centormult) bool trigsel = triggerSelection(collision); + bool rctsel = false; + if (useRctInformation) { + if constexpr (framework::has_type_v) { + if (rctChecker.checkTable(collision)) { + rctsel = true; + collisionFlags.set(CollSelRCTBIT); + } + } else { + LOGF(fatal, "RCT check required but the dataset does not have RCT information associated. Please, fix it"); + } + } else { + collisionFlags.set(CollSelRCTBIT); + rctsel = true; + } + bool occupancysel = occupancySelection(collision); bool zvtxsel = false; @@ -1174,7 +1198,7 @@ inline bool isEventSelected(CollisionObject const& collision, float& centormult) bool centmultsel = centralitySelection(collision, centormult); - bool accepted = trigsel && occupancysel && zvtxsel && centmultsel; + bool accepted = trigsel && rctsel && occupancysel && zvtxsel && centmultsel; if (accepted) { collisionFlags.set(CollSelSELECTED);