Skip to content

Commit 034bdac

Browse files
authored
[Trigger,PWGHF] Add granular event selection in HF triggers (#14678)
1 parent 1e8539e commit 034bdac

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

EventFiltering/PWGHF/HFFilter.cxx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ struct HfFilter { // Main struct for HF triggers
9494
Configurable<bool> activateSecVtxForB{"activateSecVtxForB", false, "flag to enable 2nd vertex fitting - only beauty hadrons"};
9595

9696
// parameters for all triggers
97+
// event selection
98+
struct : o2::framework::ConfigurableGroup {
99+
Configurable<bool> applyTVX{"applyTVX", true, "flag to apply TVX selection"};
100+
Configurable<bool> applyTFBorderCut{"applyTFBorderCut", true, "apply TF border cut"};
101+
Configurable<bool> applyITSROFBorderCut{"applyITSROFBorderCut", false, "apply ITS ROF border cut"};
102+
Configurable<float> maxPvZ{"maxPvZ", 11.f, "maximum absolute value of PV position in the Z coordinate"};
103+
} evSel;
104+
97105
// nsigma PID (except for V0 and cascades)
98106
Configurable<LabeledArray<float>> nSigmaPidCuts{"nSigmaPidCuts", {cutsNsigma[0], 4, 8, labelsRowsNsigma, labelsColumnsNsigma}, "Nsigma cuts for ITS/TPC/TOF PID (except for V0 and cascades)"};
99107
// min and max pts for tracks and bachelors (except for V0 and cascades)
@@ -442,7 +450,11 @@ struct HfFilter { // Main struct for HF triggers
442450
for (const auto& collision : collisions) {
443451

444452
bool keepEvent[kNtriggersHF]{false};
445-
if (!collision.sel8() || std::fabs(collision.posZ()) > 11.f) { // safety margin for Zvtx
453+
bool isSelectedTVX = evSel.applyTVX ? collision.selection_bit(o2::aod::evsel::kIsTriggerTVX) : true;
454+
bool isSelectedTFBorder = evSel.applyTFBorderCut ? collision.selection_bit(o2::aod::evsel::kNoTimeFrameBorder) : true;
455+
bool isSelectedITSROFBorder = evSel.applyITSROFBorderCut ? collision.selection_bit(o2::aod::evsel::kNoITSROFrameBorder) : true;
456+
bool isSelectedPvZ = (std::fabs(collision.posZ()) < evSel.maxPvZ);
457+
if (!isSelectedTVX || !isSelectedTFBorder || !isSelectedITSROFBorder || !isSelectedPvZ) {
446458
tags(keepEvent[kHighPt2P], keepEvent[kHighPt3P], keepEvent[kBeauty3P], keepEvent[kBeauty4P], keepEvent[kFemto2P], keepEvent[kFemto3P], keepEvent[kDoubleCharm2P], keepEvent[kDoubleCharm3P], keepEvent[kDoubleCharmMix], keepEvent[kV0Charm2P], keepEvent[kV0Charm3P], keepEvent[kCharmBarToXiBach], keepEvent[kSigmaCPPK], keepEvent[kSigmaC0K0], keepEvent[kPhotonCharm2P], keepEvent[kPhotonCharm3P], keepEvent[kSingleCharm2P], keepEvent[kSingleCharm3P], keepEvent[kSingleNonPromptCharm2P], keepEvent[kSingleNonPromptCharm3P], keepEvent[kCharmBarToXi2Bach], keepEvent[kPrCharm2P], keepEvent[kBtoJPsiKa], keepEvent[kBtoJPsiKstar], keepEvent[kBtoJPsiPhi], keepEvent[kBtoJPsiPrKa], keepEvent[kBtoJPsiPi]);
447459
continue;
448460
}

0 commit comments

Comments
 (0)