Skip to content

Commit 982c1f0

Browse files
committed
Adding L1FinalOR in bx-2
1 parent e34f98f commit 982c1f0

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

PhysicsTools/NanoAOD/plugins/L1TriggerResultsConverter.cc

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ void L1TriggerResultsConverter::beginRun(edm::Run const&, edm::EventSetup const&
121121
names_.push_back("L1_UnprefireableEvent_TriggerRules");
122122
names_.push_back("L1_UnprefireableEvent_FirstBxInTrain");
123123
names_.push_back("L1_FinalOR_BXmin1");
124+
names_.push_back("L1_FinalOR_BXmin2");
124125
}
125126
}
126127
}
@@ -130,9 +131,11 @@ void L1TriggerResultsConverter::beginRun(edm::Run const&, edm::EventSetup const&
130131
void L1TriggerResultsConverter::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
131132
const std::vector<bool>* wordp = nullptr;
132133
const std::vector<bool>* wordp_bxmin1 = nullptr;
134+
const std::vector<bool>* wordp_bxmin2 = nullptr;
133135
bool unprefireable_bit_triggerrules = false;
134136
bool unprefireable_bit_firstbxintrain = false;
135137
bool l1FinalOR_bxmin1 = false;
138+
bool l1FinalOR_bxmin2 = false;
136139

137140
if (!legacyL1_) {
138141
const auto& resultsProd = iEvent.get(token_);
@@ -142,6 +145,9 @@ void L1TriggerResultsConverter::produce(edm::Event& iEvent, const edm::EventSetu
142145
if (not resultsProd.isEmpty(-1)) {
143146
wordp_bxmin1 = &resultsProd.at(-1, 0).getAlgoDecisionFinal();
144147
}
148+
if (not resultsProd.isEmpty(-2)) {
149+
wordp_bxmin2 = &resultsProd.at(-2, 0).getAlgoDecisionFinal();
150+
}
145151
if (store_unprefireable_bits_) {
146152
auto handleExtResults = iEvent.getHandle(token_ext_);
147153
if (handleExtResults.isValid()) {
@@ -165,6 +171,7 @@ void L1TriggerResultsConverter::produce(edm::Event& iEvent, const edm::EventSetu
165171
unsigned int const index = indices_[nidx];
166172
bool result = wordp ? wordp->at(index) : false;
167173
bool result_bxmin1 = wordp_bxmin1 ? wordp_bxmin1->at(index) : false;
174+
bool result_bxmin2 = wordp_bxmin2 ? wordp_bxmin2->at(index) : false;
168175
if (not mask_.empty())
169176
result &= (mask_.at(index) != 0);
170177
l1bitsAsHLTStatus[nidx] = edm::HLTPathStatus(result ? edm::hlt::Pass : edm::hlt::Fail);
@@ -174,10 +181,13 @@ void L1TriggerResultsConverter::produce(edm::Event& iEvent, const edm::EventSetu
174181
if (!legacyL1_) {
175182
if (names_[nidx] == "L1_FirstBunchBeforeTrain")
176183
unprefireable_bit_firstbxintrain = result_bxmin1;
177-
//If any other seed was fired in BX-1 there is some prefiring
184+
//Checks if any other seed was fired in BX-1 or -2
178185
else if (result_bxmin1) {
179186
l1FinalOR_bxmin1 = true;
180187
}
188+
else if (result_bxmin2) {
189+
l1FinalOR_bxmin2 = true;
190+
}
181191
}
182192
}
183193
if (store_unprefireable_bits_) {
@@ -186,6 +196,7 @@ void L1TriggerResultsConverter::produce(edm::Event& iEvent, const edm::EventSetu
186196
l1bitsAsHLTStatus[indices_size + 1] =
187197
edm::HLTPathStatus(unprefireable_bit_firstbxintrain ? edm::hlt::Pass : edm::hlt::Fail);
188198
l1bitsAsHLTStatus[indices_size + 2] = edm::HLTPathStatus(l1FinalOR_bxmin1 ? edm::hlt::Pass : edm::hlt::Fail);
199+
l1bitsAsHLTStatus[indices_size + 3] = edm::HLTPathStatus(l1FinalOR_bxmin2 ? edm::hlt::Pass : edm::hlt::Fail);
189200
}
190201
//mimic HLT trigger bits for L1
191202
auto out = std::make_unique<edm::TriggerResults>(l1bitsAsHLTStatus, names_);

0 commit comments

Comments
 (0)