Skip to content

Commit 7d208d9

Browse files
committed
Add RCT selection in HF event selection utils
1 parent c108926 commit 7d208d9

File tree

8 files changed

+63
-8
lines changed

8 files changed

+63
-8
lines changed

PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,9 @@ struct HfDataCreatorCharmHadPiReduced {
291291
setLabelHistoCands(hCandidatesD0);
292292
setLabelHistoCands(hCandidatesDPlus);
293293
setLabelHistoCands(hCandidatesDs);
294+
295+
// init RCT checker
296+
hfEvSel.initRctChecker();
294297
}
295298

296299
/// Pion selection (D Pi <-- B0)

PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,9 @@ struct HfDataCreatorCharmResoReduced {
302302
fitter.setMaxChi2(1e9);
303303
fitter.setUseAbsDCA(true);
304304
fitter.setWeightedFinalPCA(false);
305+
306+
// init RCT checker
307+
hfEvSel.initRctChecker();
305308
}
306309

307310
/// Basic track quality selections for V0 daughters

PWGHF/TableProducer/candidateCreator2Prong.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ struct HfCandidateCreator2Prong {
148148
registry.add("hVertexerType", "Use KF or DCAFitterN;Vertexer type;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); // See o2::aod::hf_cand::VertexerType
149149
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
150150
hfEvSel.addHistograms(registry); // collision monitoring
151+
hfEvSel.initRctChecker();
151152

152153
massPi = MassPiPlus;
153154
massK = MassKPlus;

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ struct HfCandidateCreator3Prong {
169169
registry.add("hDcaZProngs", "DCAz of 3-prong candidate daughters;#it{p}_{T} (GeV/#it{c};#it{d}_{z}) (#mum);entries", {HistType::kTH2F, {{100, 0., 20.}, {200, -500., 500.}}});
170170
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
171171
hfEvSel.addHistograms(registry); // collision monitoring
172+
hfEvSel.initRctChecker();
172173

173174
massP = MassProton;
174175
massPi = MassPiPlus;

PWGHF/TableProducer/candidateCreatorCascade.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct HfCandidateCreatorCascade {
119119
registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}});
120120
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
121121
hfEvSel.addHistograms(registry); // collision monitoring
122+
hfEvSel.initRctChecker();
122123

123124
massP = MassProton;
124125
massK0s = MassK0Short;

PWGHF/TableProducer/candidateCreatorDstar.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ struct HfCandidateCreatorDstar {
137137

138138
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
139139
hfEvSel.addHistograms(registry); // collision monitoring
140+
hfEvSel.initRctChecker();
140141

141142
// LOG(info) << "Init Function Invoked";
142143
massPi = MassPiPlus;

PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ struct HfCandidateCreatorXic0Omegac0 {
342342
registry.add("hKFcosPaCascToOmegac", "hKFcosPaCascToOmegac", kTH1D, {{5000, 0.8f, 1.1f}});
343343
}
344344
hfEvSel.addHistograms(registry); // collision monitoring
345+
hfEvSel.initRctChecker();
345346

346347
df.setPropagateToPCA(propagateToPCA);
347348
df.setMaxR(maxR);

PWGHF/Utils/utilsEvSelHf.h

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "Framework/OutputObjHeader.h"
2828

2929
#include "Common/CCDB/EventSelectionParams.h"
30+
#include "Common/CCDB/RCTSelectionFlags.h"
3031
#include "EventFiltering/Zorro.h"
3132
#include "EventFiltering/ZorroSummary.h"
3233
#include "PWGLF/DataModel/mcCentrality.h"
@@ -82,6 +83,7 @@ namespace o2::hf_evsel
8283
// event rejection types
8384
enum EventRejection {
8485
None = 0,
86+
Rct,
8587
SoftwareTrigger,
8688
Centrality,
8789
Trigger,
@@ -110,6 +112,7 @@ void setEventRejectionLabels(Histo& hRejection, std::string softwareTriggerLabel
110112
{
111113
// Puts labels on the collision monitoring histogram.
112114
hRejection->GetXaxis()->SetBinLabel(EventRejection::None + 1, "All");
115+
hRejection->GetXaxis()->SetBinLabel(EventRejection::Rct + 1, "RCT");
113116
hRejection->GetXaxis()->SetBinLabel(EventRejection::SoftwareTrigger + 1, softwareTriggerLabel.data());
114117
hRejection->GetXaxis()->SetBinLabel(EventRejection::Centrality + 1, "Centrality");
115118
hRejection->GetXaxis()->SetBinLabel(EventRejection::Trigger + 1, "Trigger");
@@ -155,6 +158,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
155158
o2::framework::Configurable<std::string> ccdbPathSoftwareTrigger{"ccdbPathSoftwareTrigger", "Users/m/mpuccio/EventFiltering/OTS/Chunked/", "ccdb path for ZORRO objects"};
156159
o2::framework::ConfigurableAxis th2ConfigAxisCent{"th2ConfigAxisCent", {100, 0., 100.}, ""};
157160
o2::framework::ConfigurableAxis th2ConfigAxisOccupancy{"th2ConfigAxisOccupancy", {14, 0, 14000}, ""};
161+
o2::framework::Configurable<bool> requireGoodRct{"requireGoodRct", false, "Flag to require good RCT"};
162+
o2::framework::Configurable<std::string> rctLabel{"rctLabel", "CBT_hadronPID", "RCT selection flag (CBT, CBT_hadronPID, CBT_electronPID, CCBT_calo, CBT_muon, CBT_muon_glo)"};
163+
o2::framework::Configurable<bool> rctCheckZDC{"rctCheckZDC", false, "RCT flag to check whether the ZDC is present or not"};
164+
o2::framework::Configurable<bool> rctTreatLimitedAcceptanceAsBad{"rctTreatLimitedAcceptanceAsBad", false, "RCT flag to reject events with limited acceptance for selected detectors"};
158165

159166
// histogram names
160167
static constexpr char NameHistCollisions[] = "hCollisions";
@@ -169,6 +176,9 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
169176
std::shared_ptr<TH1> hCollisions, hSelCollisionsCent, hPosZBeforeEvSel, hPosZAfterEvSel, hPosXAfterEvSel, hPosYAfterEvSel, hNumPvContributorsAfterSel;
170177
std::shared_ptr<TH2> hCollisionsCentOcc;
171178

179+
// util to retrieve the RCT info from CCDB
180+
o2::aod::rctsel::RCTFlagsChecker rctChecker;
181+
172182
// util to retrieve trigger mask in case of software triggers
173183
Zorro zorro;
174184
o2::framework::OutputObj<ZorroSummary> zorroSummary{"zorroSummary"};
@@ -197,6 +207,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
197207
}
198208
}
199209

210+
void initRctChecker() {
211+
rctChecker.init(rctLabel.value, rctCheckZDC.value, rctTreatLimitedAcceptanceAsBad.value);
212+
}
213+
200214
/// \brief Applies event selection.
201215
/// \tparam useEvSel use information from the EvSel table
202216
/// \tparam centEstimator centrality estimator
@@ -218,6 +232,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
218232
}
219233

220234
if constexpr (useEvSel) {
235+
/// RCT condition
236+
if (requireGoodRct && !rctChecker.checkTable(collision)) {
237+
SETBIT(rejectionMask, EventRejection::Rct);
238+
}
221239
/// trigger condition
222240
if ((useSel8Trigger && !collision.sel8()) || (!useSel8Trigger && triggerClass > -1 && !collision.alias_bit(triggerClass))) {
223241
SETBIT(rejectionMask, EventRejection::Trigger);
@@ -333,14 +351,21 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
333351

334352
struct HfEventSelectionMc {
335353
// event selection parameters (in chronological order of application)
336-
bool useSel8Trigger{false}; // Apply the Sel8 selection
337-
bool useTvxTrigger{false}; // Apply the TVX trigger
338-
bool useTimeFrameBorderCut{true}; // Apply TF border cut
339-
bool useItsRofBorderCut{false}; // Apply the ITS RO frame border cut
340-
float zPvPosMin{-1000.f}; // Minimum PV posZ (cm)
341-
float zPvPosMax{1000.f}; // Maximum PV posZ (cm)
342-
float centralityMin{0.f}; // Minimum centrality
343-
float centralityMax{100.f}; // Maximum centrality
354+
bool useSel8Trigger{false}; // Apply the Sel8 selection
355+
bool useTvxTrigger{false}; // Apply the TVX trigger
356+
bool useTimeFrameBorderCut{true}; // Apply TF border cut
357+
bool useItsRofBorderCut{false}; // Apply the ITS RO frame border cut
358+
float zPvPosMin{-1000.f}; // Minimum PV posZ (cm)
359+
float zPvPosMax{1000.f}; // Maximum PV posZ (cm)
360+
float centralityMin{0.f}; // Minimum centrality
361+
float centralityMax{100.f}; // Maximum centrality
362+
bool requireGoodRct{false}; // Apply RCT selection
363+
std::string rctLabel{""}; // RCT selection flag
364+
bool rctCheckZDC; // require ZDC from RCT
365+
bool rctTreatLimitedAcceptanceAsBad; // RCT flag to reject events with limited acceptance for selected detectors
366+
367+
// util to retrieve the RCT info from CCDB
368+
o2::aod::rctsel::RCTFlagsChecker rctChecker;
344369

345370
// histogram names
346371
static constexpr char NameHistGenCollisionsCent[] = "hGenCollisionsCent";
@@ -383,8 +408,17 @@ struct HfEventSelectionMc {
383408
centralityMin = option.defaultValue.get<float>();
384409
} else if (option.name.compare("hfEvSel.centralityMax") == 0) {
385410
centralityMax = option.defaultValue.get<float>();
411+
} else if (option.name.compare("hfEvSel.requireGoodRct") == 0) {
412+
requireGoodRct = option.defaultValue.get<bool>();
413+
} else if (option.name.compare("hfEvSel.rctLabel") == 0) {
414+
rctLabel = option.defaultValue.get<std::string>();
415+
} else if (option.name.compare("hfEvSel.rctCheckZDC") == 0) {
416+
rctCheckZDC = option.defaultValue.get<bool>();
417+
} else if (option.name.compare("hfEvSel.rctTreatLimitedAcceptanceAsBad") == 0) {
418+
rctTreatLimitedAcceptanceAsBad = option.defaultValue.get<bool>();
386419
}
387420
}
421+
rctChecker.init(rctLabel, rctCheckZDC, rctTreatLimitedAcceptanceAsBad);
388422
}
389423

390424
/// \brief Function to apply event selections to generated MC collisions
@@ -406,6 +440,16 @@ struct HfEventSelectionMc {
406440
SETBIT(rejectionMask, EventRejection::Centrality);
407441
}
408442
}
443+
444+
/// RCT condition
445+
if (requireGoodRct) {
446+
for (auto const& collision : collSlice) {
447+
if (!rctChecker.checkTable(collision)) {
448+
SETBIT(rejectionMask, EventRejection::Rct);
449+
break;
450+
}
451+
}
452+
}
409453
/// Sel8 trigger selection
410454
if (useSel8Trigger && (!bc.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) {
411455
SETBIT(rejectionMask, EventRejection::Trigger);

0 commit comments

Comments
 (0)