Skip to content

Commit 7af8f70

Browse files
victor-gonzalezVictor
andauthored
[PWGCF] DptDpt - RCT validation support (#12572)
Co-authored-by: Victor <victor@cern.ch>
1 parent 05af22b commit 7af8f70

File tree

2 files changed

+36
-2
lines changed

2 files changed

+36
-2
lines changed

PWGCF/TableProducer/dptDptFilter.cxx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,9 @@ struct DptDptFilter {
356356
std::string prefix = "cfgEventSelection";
357357
Configurable<int64_t> minOrbit{"minOrbit", -1, "Lowest orbit to track"};
358358
Configurable<int64_t> maxOrbit{"maxOrbit", INT64_MAX, "Highest orbit to track"};
359+
Configurable<std::string> rctSource{"rctSource", "None", "RCT selection source: None,CBT,CBT_hadronPID,CBT_electronPID,CBT_calo,CBT_muon,CBT_muon_glo. Default: None"};
359360
struct : ConfigurableGroup {
360-
std::string prefix = "cfgOccupancySelection";
361+
std::string prefix = "cfgEventSelection.cfgOccupancySelection";
361362
Configurable<std::string> cfgOccupancyEstimation{"cfgOccupancyEstimation", "None", "Occupancy estimation: None, Tracks, FT0C. Default None"};
362363
Configurable<float> cfgMinOccupancy{"cfgMinOccupancy", 0.0f, "Minimum allowed occupancy. Depends on the occupancy estimation"};
363364
Configurable<float> cfgMaxOccupancy{"cfgMaxOccupancy", 1e6f, "Maximum allowed occupancy. Depends on the occupancy estimation"};
@@ -418,6 +419,15 @@ struct DptDptFilter {
418419
} else {
419420
fCentMultEstimator = getCentMultEstimator(cfgCentMultEstimator);
420421
}
422+
/* RCT information usage */
423+
if (cfgEventSelection.rctSource.value == "None") {
424+
useRctInformation = false;
425+
} else {
426+
/* for the time being we don't require ZDC and treat limited acceptance as faulty */
427+
rctChecker.init(cfgEventSelection.rctSource.value, false, true);
428+
useRctInformation = true;
429+
}
430+
421431
/* the occupancy selection */
422432
fOccupancyEstimation = getOccupancyEstimator(cfgEventSelection.cfgOccupancySelection.cfgOccupancyEstimation);
423433
fMinOccupancy = cfgEventSelection.cfgOccupancySelection.cfgMinOccupancy;

PWGCF/TableProducer/dptDptFilter.h

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "PWGCF/Core/AnalysisConfigurableCuts.h"
2020

21+
#include "Common/CCDB/RCTSelectionFlags.h"
2122
#include "Common/Core/MetadataHelper.h"
2223
#include "Common/Core/RecoDecay.h"
2324
#include "Common/Core/TrackSelection.h"
@@ -212,6 +213,7 @@ enum CollisionSelectionFlags {
212213
CollSelINT7BIT, ///< INT7 Run 1/2
213214
CollSelSEL7BIT, ///< Sel7 Run 1/2
214215
CollSelTRIGGSELBIT, ///< Accepted by trigger selection
216+
CollSelRCTBIT, ///< Accetped by the RCT information
215217
CollSelOCCUPANCYBIT, ///< occupancy within limits
216218
CollSelCENTRALITYBIT, ///< centrality cut passed
217219
CollSelZVERTEXBIT, ///< zvtx cut passed
@@ -227,6 +229,7 @@ static const std::map<int, std::string> collisionSelectionExternalNamesMap{
227229
{CollSelINT7BIT, "INT7"},
228230
{CollSelSEL7BIT, "Sel7"},
229231
{CollSelTRIGGSELBIT, "Trigger selection"},
232+
{CollSelRCTBIT, "RCT accepted"},
230233
{CollSelOCCUPANCYBIT, "Occupancy"},
231234
{CollSelCENTRALITYBIT, "Centrality"},
232235
{CollSelZVERTEXBIT, "z vertex"},
@@ -270,6 +273,12 @@ std::bitset<32> triggerSelectionFlags;
270273
//============================================================================================
271274
o2::common::core::MetadataHelper metadataInfo;
272275

276+
//============================================================================================
277+
// The RCT information access
278+
//============================================================================================
279+
bool useRctInformation = false;
280+
o2::aod::rctsel::RCTFlagsChecker rctChecker;
281+
273282
//============================================================================================
274283
// The DptDptFilter configuration objects
275284
//============================================================================================
@@ -1155,6 +1164,21 @@ inline bool isEventSelected(CollisionObject const& collision, float& centormult)
11551164

11561165
bool trigsel = triggerSelection(collision);
11571166

1167+
bool rctsel = false;
1168+
if (useRctInformation) {
1169+
if constexpr (framework::has_type_v<aod::evsel::Rct, typename CollisionObject::all_columns>) {
1170+
if (rctChecker.checkTable(collision)) {
1171+
rctsel = true;
1172+
collisionFlags.set(CollSelRCTBIT);
1173+
}
1174+
} else {
1175+
LOGF(fatal, "RCT check required but the dataset does not have RCT information associated. Please, fix it");
1176+
}
1177+
} else {
1178+
collisionFlags.set(CollSelRCTBIT);
1179+
rctsel = true;
1180+
}
1181+
11581182
bool occupancysel = occupancySelection(collision);
11591183

11601184
bool zvtxsel = false;
@@ -1174,7 +1198,7 @@ inline bool isEventSelected(CollisionObject const& collision, float& centormult)
11741198

11751199
bool centmultsel = centralitySelection(collision, centormult);
11761200

1177-
bool accepted = trigsel && occupancysel && zvtxsel && centmultsel;
1201+
bool accepted = trigsel && rctsel && occupancysel && zvtxsel && centmultsel;
11781202

11791203
if (accepted) {
11801204
collisionFlags.set(CollSelSELECTED);

0 commit comments

Comments
 (0)