118 LogDebug(
"L1TExtCondProducer") <<
"L1TExtCondProducer::produce function called...\n";
131 std::map<std::string, unsigned int> extBitMap = gtParser.
getExternalSignals(utml1GtMenu);
137 bool TriggerRulePrefireVetoBit(
false);
143 const auto& tcdsRecord = *tcdsRecordH.
product();
145 uint64_t thisEvent = (tcdsRecord.getBXID() - 1) + tcdsRecord.getOrbitNr() * 3564ull;
147 std::vector<uint64_t> eventHistory;
148 for (
auto&& l1a : tcdsRecord.getFullL1aHistory()) {
149 eventHistory.push_back(thisEvent - ((l1a.getBXID() - 1) + l1a.getOrbitNr() * 3564ull));
153 if (eventHistory.size() < 4) {
155 <<
"Unexpectedly small L1A history from TCDSRecord: (size = " << eventHistory.size() <<
" < 4)";
159 if (eventHistory[0] < 3ull) {
160 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (1 in 3)";
163 if (eventHistory[0] == 3ull)
164 TriggerRulePrefireVetoBit =
true;
167 if (eventHistory[0] < 25ull and eventHistory[1] < 25ull) {
168 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (2 in 25)";
170 if (eventHistory[0] < 25ull and eventHistory[1] == 25ull)
171 TriggerRulePrefireVetoBit =
true;
174 if (eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] < 100ull) {
175 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (3 in 100)";
177 if (eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] == 100ull)
178 TriggerRulePrefireVetoBit =
true;
181 if (eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and
182 eventHistory[3] < 240ull) {
183 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (4 in 240)";
185 if (eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and
186 eventHistory[3] == 240ull)
187 TriggerRulePrefireVetoBit =
true;
228 if (TriggerRulePrefireVetoBit)
233 extCond->push_back(iBx, extCond_bx);
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > l1GtMenuToken_
BXVector< GlobalExtBlk > GlobalExtBlkBxCollection
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< TCDSRecord > tcdsRecordToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Log< level::Error, false > LogError
unsigned int m_triggerRulePrefireVetoBit
void setExternalDecision(unsigned int bit, bool val)
Set decision bits.
unsigned long long m_l1GtMenuCacheID
T const * product() const
unsigned long long uint64_t
T const * product() const
bool makeTriggerRulePrefireVetoBit_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
std::map< std::string, unsigned int > m_extBitMap