Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@
setLabelHistoCands(hCandidatesD0);
setLabelHistoCands(hCandidatesDPlus);
setLabelHistoCands(hCandidatesDs);

// init HF event selection helper
hfEvSel.init(registry);
}

/// Pion selection (D Pi <-- B0)
Expand Down Expand Up @@ -519,7 +522,7 @@
std::vector<int> arrDaughDsIndex;
std::array<int, 2> arrPDGDaughDs;
RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1);
if (arrDaughDsIndex.size() == 2) {

Check failure on line 525 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) {
auto daughI = particlesMc.rawIteratorAt(arrDaughDsIndex[iProng]);
arrPDGDaughDs[iProng] = std::abs(daughI.pdgCode());
Expand Down Expand Up @@ -556,7 +559,7 @@
std::vector<int> arrDaughDsIndex;
std::array<int, 2> arrPDGDaughDs;
RecoDecay::getDaughters(particlesMc.rawIteratorAt(indexRec), &arrDaughDsIndex, std::array{0}, 1);
if (arrDaughDsIndex.size() == 2) {

Check failure on line 562 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (auto iProng = 0u; iProng < arrDaughDsIndex.size(); ++iProng) {
auto daughI = particlesMc.rawIteratorAt(arrDaughDsIndex[iProng]);
arrPDGDaughDs[iProng] = std::abs(daughI.pdgCode());
Expand Down Expand Up @@ -679,7 +682,7 @@
// look for common c-hadron mother among prongs 0, 1 and 2
for (const auto& cHadronMotherHypo : cHadronMotherHypos) {
int8_t depthMax = 2;
if (cHadronMotherHypo == Pdg::kDStar || cHadronMotherHypo == 423 || cHadronMotherHypo == Pdg::kDSStar) { // to include D* -> D π0/γ, D* -> D0 π, and Ds* -> Ds π0/γ

Check failure on line 685 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.

Check failure on line 685 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[pdg/explicit-code]

Avoid hard-coded PDG codes. Use named values from PDG_t or o2::constants::physics::Pdg instead.
depthMax += 1;
}
int index0CharmMother = RecoDecay::getMother(particlesMc, particleProng0, cHadronMotherHypo, true, &sign, depthMax);
Expand Down Expand Up @@ -989,10 +992,10 @@
hfCand3ProngMl(candC.mlProbDplusToPiKPi()[0], candC.mlProbDplusToPiKPi()[1], candC.mlProbDplusToPiKPi()[2], -1., -1., -1.);
} else {
std::array<float, 6> mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f};
if (candC.mlProbDsToKKPi().size() == 3) {

Check failure on line 995 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::copy(candC.mlProbDsToKKPi().begin(), candC.mlProbDsToKKPi().end(), mlScores.begin());
}
if (candC.mlProbDsToPiKK().size() == 3) {

Check failure on line 998 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::copy(candC.mlProbDsToPiKK().begin(), candC.mlProbDsToPiKK().end(), mlScores.begin() + 3);
}
hfCand3ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]);
Expand All @@ -1016,10 +1019,10 @@
hfCandPidProng1(candC.nSigTpcPi1(), candC.nSigTofPi1(), candC.nSigTpcKa1(), candC.nSigTofKa1(), charmHadDauTracks[1].hasTOF(), charmHadDauTracks[1].hasTPC());
if constexpr (withMl) {
std::array<float, 6> mlScores = {-1.f, -1.f, -1.f, -1.f, -1.f, -1.f};
if (candC.mlProbD0().size() == 3) {

Check failure on line 1022 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::copy(candC.mlProbD0().begin(), candC.mlProbD0().end(), mlScores.begin());
}
if (candC.mlProbD0bar().size() == 3) {

Check failure on line 1025 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
std::copy(candC.mlProbD0bar().begin(), candC.mlProbD0bar().end(), mlScores.begin() + 3);
}
hfCand2ProngMl(mlScores[0], mlScores[1], mlScores[2], mlScores[3], mlScores[4], mlScores[5]);
Expand Down Expand Up @@ -1101,7 +1104,7 @@
std::vector<int> arrDaughDsIndex;
std::array<int, 2> arrPDGDaughDs;
RecoDecay::getDaughters(candCMC, &arrDaughDsIndex, std::array{0}, 1);
if (arrDaughDsIndex.size() == 2) {

Check failure on line 1107 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) {
auto daughJ = particlesMc.rawIteratorAt(arrDaughDsIndex[jProng]);
arrPDGDaughDs[jProng] = std::abs(daughJ.pdgCode());
Expand All @@ -1127,7 +1130,7 @@
std::vector<int> arrDaughDsIndex;
std::array<int, 2> arrPDGDaughDs;
RecoDecay::getDaughters(candCMC, &arrDaughDsIndex, std::array{0}, 1);
if (arrDaughDsIndex.size() == 2) {

Check failure on line 1133 in PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

View workflow job for this annotation

GitHub Actions / O2 linter

[magic-number]

Avoid magic numbers in expressions. Assign the value to a clearly named variable or constant.
for (auto jProng = 0u; jProng < arrDaughDsIndex.size(); ++jProng) {
auto daughJ = particlesMc.rawIteratorAt(arrDaughDsIndex[jProng]);
arrPDGDaughDs[jProng] = std::abs(daughJ.pdgCode());
Expand Down
3 changes: 3 additions & 0 deletions PWGHF/D2H/TableProducer/dataCreatorCharmResoReduced.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ struct HfDataCreatorCharmResoReduced {
fitter.setMaxChi2(1e9);
fitter.setUseAbsDCA(true);
fitter.setWeightedFinalPCA(false);

// init HF event selection helper
hfEvSel.init(registry);
}

/// Basic track quality selections for V0 daughters
Expand Down
8 changes: 5 additions & 3 deletions PWGHF/TableProducer/candidateCreator2Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ struct HfCandidateCreator2Prong {
registry.add("hDcaZProngs", "DCAz of 2-prong candidate daughters;#it{p}_{T} (GeV/#it{c};#it{d}_{z}) (#mum);entries", {HistType::kTH2F, {{100, 0., 20.}, {200, -500., 500.}}});
registry.add("hVertexerType", "Use KF or DCAFitterN;Vertexer type;entries", {HistType::kTH1D, {{2, -0.5, 1.5}}}); // See o2::aod::hf_cand::VertexerType
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
hfEvSel.addHistograms(registry); // collision monitoring

// init HF event selection helper
hfEvSel.init(registry);

massPi = MassPiPlus;
massK = MassKPlus;
Expand Down Expand Up @@ -713,11 +715,11 @@ struct HfCandidateCreator2ProngExpressions {
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-2prong") == 0) {
hfEvSelMc.configureFromDevice(device);
// init HF event selection helper
hfEvSelMc.init(device, registry);
break;
}
}
hfEvSelMc.addHistograms(registry); // particles monitoring
}

/// Performs MC matching.
Expand Down
9 changes: 5 additions & 4 deletions PWGHF/TableProducer/candidateCreator3Prong.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ struct HfCandidateCreator3Prong {
registry.add("hDcaXYProngs", "DCAxy of 3-prong candidate daughters;#it{p}_{T} (GeV/#it{c};#it{d}_{xy}) (#mum);entries", {HistType::kTH2F, {{100, 0., 20.}, {200, -500., 500.}}});
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.}}});
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
hfEvSel.addHistograms(registry); // collision monitoring

// init HF event selection helper
hfEvSel.init(registry);

massP = MassProton;
massPi = MassPiPlus;
Expand Down Expand Up @@ -838,12 +840,11 @@ struct HfCandidateCreator3ProngExpressions {
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-3prong") == 0) {
hfEvSelMc.configureFromDevice(device);
// init HF event selection helper
hfEvSelMc.init(device, registry);
break;
}
}

hfEvSelMc.addHistograms(registry); // particles monitoring
}

/// Performs MC matching.
Expand Down
8 changes: 5 additions & 3 deletions PWGHF/TableProducer/candidateCreatorCascade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ struct HfCandidateCreatorCascade {
registry.add("hCovPVXX", "2-prong candidates;XX element of cov. matrix of prim. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 1.e-4}}});
registry.add("hCovSVXX", "2-prong candidates;XX element of cov. matrix of sec. vtx. position (cm^{2});entries", {HistType::kTH1F, {{100, 0., 0.2}}});
hCandidates = registry.add<TH1>("hCandidates", "candidates counter", {HistType::kTH1D, {axisCands}});
hfEvSel.addHistograms(registry); // collision monitoring

// init HF event selection helper
hfEvSel.init(registry);

massP = MassProton;
massK0s = MassK0Short;
Expand Down Expand Up @@ -471,11 +473,11 @@ struct HfCandidateCreatorCascadeMc {
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-cascade") == 0) {
hfEvSelMc.configureFromDevice(device);
// init HF event selection helper
hfEvSelMc.init(device, registry);
break;
}
}
hfEvSelMc.addHistograms(registry); // particles monitoring
}

template <o2::hf_centrality::CentralityEstimator centEstimator, typename CCs, typename McCollisions>
Expand Down
8 changes: 5 additions & 3 deletions PWGHF/TableProducer/candidateCreatorDstar.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ struct HfCandidateCreatorDstar {
}

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

// init HF event selection helper
hfEvSel.init(registry);

// LOG(info) << "Init Function Invoked";
massPi = MassPiPlus;
Expand Down Expand Up @@ -534,11 +536,11 @@ struct HfCandidateCreatorDstarExpressions {
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-dstar") == 0) {
hfEvSelMc.configureFromDevice(device);
// init HF event selection helper
hfEvSelMc.init(device, registry);
break;
}
}
hfEvSelMc.addHistograms(registry); // particles monitoring
}

/// Perform MC Matching.
Expand Down
5 changes: 2 additions & 3 deletions PWGHF/TableProducer/candidateCreatorSigmac0plusplus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,11 @@ struct HfCandidateSigmac0plusplusMc {
// here we assume that the hf-candidate-creator-3prong is in the workflow
// configure the ev. sel from that workflow
if (device.name.compare("hf-candidate-creator-3prong") == 0) {
hfEvSelMc.configureFromDevice(device);
// init HF event selection helper
hfEvSelMc.init(device, registry);
break;
}
}

hfEvSelMc.addHistograms(registry); // particles monitoring
}

/// @brief dummy process function, to be run on data
Expand Down
8 changes: 5 additions & 3 deletions PWGHF/TableProducer/candidateCreatorXic0Omegac0.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,9 @@ struct HfCandidateCreatorXic0Omegac0 {
registry.add("hKFcosPaV0ToCasc", "hKFcosPaV0ToCasc", kTH1D, {{5000, 0.8f, 1.1f}});
registry.add("hKFcosPaCascToOmegac", "hKFcosPaCascToOmegac", kTH1D, {{5000, 0.8f, 1.1f}});
}
hfEvSel.addHistograms(registry); // collision monitoring

// init HF event selection helper
hfEvSel.init(registry);

df.setPropagateToPCA(propagateToPCA);
df.setMaxR(maxR);
Expand Down Expand Up @@ -1879,11 +1881,11 @@ struct HfCandidateCreatorXic0Omegac0Mc {
const auto& workflows = initContext.services().get<RunningWorkflowInfo const>();
for (const DeviceSpec& device : workflows.devices) {
if (device.name.compare("hf-candidate-creator-xic0-omegac0") == 0) {
hfEvSelMc.configureFromDevice(device);
// init HF event selection helper
hfEvSelMc.init(device, registry);
break;
}
}
hfEvSelMc.addHistograms(registry); // particles monitoring

hGenCharmBaryonPtRapidityTightXicToXiPi = registry.add<TH1>("hGenCharmBaryonPtRapidityTightXicToXiPi", "Generated charm baryon #it{p}_{T};#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{20, 0.0, 20.0}}}); // keep track of generated candidates pt when |y|<0.5
hGenCharmBaryonPtRapidityLooseXicToXiPi = registry.add<TH1>("hGenCharmBaryonPtRapidityLooseXicToXiPi", "Generated charm baryon #it{p}_{T};#it{p}_{T} (GeV/#it{c});entries", {HistType::kTH1D, {{20, 0.0, 20.0}}}); // keep track of generated candidates pt when |y|<0.8
Expand Down
88 changes: 80 additions & 8 deletions PWGHF/Utils/utilsEvSelHf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "Framework/OutputObjHeader.h"

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

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

// util to retrieve the RCT info from CCDB
o2::aod::rctsel::RCTFlagsChecker rctChecker;

// util to retrieve trigger mask in case of software triggers
Zorro zorro;
o2::framework::OutputObj<ZorroSummary> zorroSummary{"zorroSummary"};
Expand All @@ -190,11 +200,24 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
const o2::framework::AxisSpec th2AxisCent{th2ConfigAxisCent, "Centrality"};
const o2::framework::AxisSpec th2AxisOccupancy{th2ConfigAxisOccupancy, "Occupancy"};
hCollisionsCentOcc = registry.add<TH2>(NameHistCollisionsCentOcc, "selected events;Centrality; Occupancy", {o2::framework::HistType::kTH2D, {th2AxisCent, th2AxisOccupancy}});
}

/// \brief Inits the HF event selection object
/// \param registry reference to the histogram registry
void init(o2::framework::HistogramRegistry& registry)
{
// we initialise the RCT checker
if (requireGoodRct) {
rctChecker.init(rctLabel.value, rctCheckZDC.value, rctTreatLimitedAcceptanceAsBad.value);
}

// we initialise the summary object
if (softwareTrigger.value != "") {
zorroSummary.setObject(zorro.getZorroSummary());
}

// we initialise histograms
addHistograms(registry);
}

/// \brief Applies event selection.
Expand All @@ -218,6 +241,10 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {
}

if constexpr (useEvSel) {
/// RCT condition
if (requireGoodRct && !rctChecker.checkTable(collision)) {
SETBIT(rejectionMask, EventRejection::Rct);
}
/// trigger condition
if ((useSel8Trigger && !collision.sel8()) || (!useSel8Trigger && triggerClass > -1 && !collision.alias_bit(triggerClass))) {
SETBIT(rejectionMask, EventRejection::Trigger);
Expand Down Expand Up @@ -333,14 +360,21 @@ struct HfEventSelection : o2::framework::ConfigurableGroup {

struct HfEventSelectionMc {
// event selection parameters (in chronological order of application)
bool useSel8Trigger{false}; // Apply the Sel8 selection
bool useTvxTrigger{false}; // Apply the TVX trigger
bool useTimeFrameBorderCut{true}; // Apply TF border cut
bool useItsRofBorderCut{false}; // Apply the ITS RO frame border cut
float zPvPosMin{-1000.f}; // Minimum PV posZ (cm)
float zPvPosMax{1000.f}; // Maximum PV posZ (cm)
float centralityMin{0.f}; // Minimum centrality
float centralityMax{100.f}; // Maximum centrality
bool useSel8Trigger{false}; // Apply the Sel8 selection
bool useTvxTrigger{false}; // Apply the TVX trigger
bool useTimeFrameBorderCut{true}; // Apply TF border cut
bool useItsRofBorderCut{false}; // Apply the ITS RO frame border cut
float zPvPosMin{-1000.f}; // Minimum PV posZ (cm)
float zPvPosMax{1000.f}; // Maximum PV posZ (cm)
float centralityMin{0.f}; // Minimum centrality
float centralityMax{100.f}; // Maximum centrality
bool requireGoodRct{false}; // Apply RCT selection
std::string rctLabel{""}; // RCT selection flag
bool rctCheckZDC; // require ZDC from RCT
bool rctTreatLimitedAcceptanceAsBad; // RCT flag to reject events with limited acceptance for selected detectors

// util to retrieve the RCT info from CCDB
o2::aod::rctsel::RCTFlagsChecker rctChecker;

// histogram names
static constexpr char NameHistGenCollisionsCent[] = "hGenCollisionsCent";
Expand All @@ -364,6 +398,9 @@ struct HfEventSelectionMc {
setEventRejectionLabels(hParticles);
}

/// \brief Configures the object from the reco workflow
/// \param registry reference to the histogram registry
/// \param device device spec to get the configs from the reco workflow
void configureFromDevice(const o2::framework::DeviceSpec& device)
{
for (const auto& option : device.options) {
Expand All @@ -383,10 +420,35 @@ struct HfEventSelectionMc {
centralityMin = option.defaultValue.get<float>();
} else if (option.name.compare("hfEvSel.centralityMax") == 0) {
centralityMax = option.defaultValue.get<float>();
} else if (option.name.compare("hfEvSel.requireGoodRct") == 0) {
requireGoodRct = option.defaultValue.get<bool>();
} else if (option.name.compare("hfEvSel.rctLabel") == 0) {
rctLabel = option.defaultValue.get<std::string>();
} else if (option.name.compare("hfEvSel.rctCheckZDC") == 0) {
rctCheckZDC = option.defaultValue.get<bool>();
} else if (option.name.compare("hfEvSel.rctTreatLimitedAcceptanceAsBad") == 0) {
rctTreatLimitedAcceptanceAsBad = option.defaultValue.get<bool>();
}
}
}

/// \brief Inits the HF event selection object
/// \param device device spec to get the configs from the reco workflow
/// \param registry reference to the histogram registry
void init(const o2::framework::DeviceSpec& device, o2::framework::HistogramRegistry& registry)
{
// we get the configuration from the reco workflow
configureFromDevice(device);

// we initialise the RCT checker
if (requireGoodRct) {
rctChecker.init(rctLabel, rctCheckZDC, rctTreatLimitedAcceptanceAsBad);
}

// we initialise histograms
addHistograms(registry);
}

/// \brief Function to apply event selections to generated MC collisions
/// \param mcCollision MC collision to test against the selection criteria
/// \param collSlice collection of reconstructed collisions
Expand All @@ -406,6 +468,16 @@ struct HfEventSelectionMc {
SETBIT(rejectionMask, EventRejection::Centrality);
}
}

/// RCT condition
if (requireGoodRct) {
for (auto const& collision : collSlice) {
if (!rctChecker.checkTable(collision)) {
SETBIT(rejectionMask, EventRejection::Rct);
break;
}
}
}
/// Sel8 trigger selection
if (useSel8Trigger && (!bc.selection_bit(o2::aod::evsel::kIsTriggerTVX) || !bc.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) || !bc.selection_bit(o2::aod::evsel::kNoITSROFrameBorder))) {
SETBIT(rejectionMask, EventRejection::Trigger);
Expand Down
Loading