120 LogDebug(
"L1TExtCondProducer") <<
"L1TExtCondProducer::produce function called...\n";
133 std::map<std::string, unsigned int> extBitMap = gtParser.
getExternalSignals(utml1GtMenu);
139 bool TriggerRulePrefireVetoBit(
false);
145 const auto& tcdsRecord = *tcdsRecordH.
product();
147 uint64_t thisEvent = (tcdsRecord.getBXID() - 1) + tcdsRecord.getOrbitNr() * 3564ull;
149 std::vector<uint64_t> eventHistory;
150 for (
auto&& l1a : tcdsRecord.getFullL1aHistory()) {
151 eventHistory.push_back(thisEvent - ((l1a.getBXID() - 1) + l1a.getOrbitNr() * 3564ull));
155 if (eventHistory.size() < 4) {
156 edm::LogError(
"L1TExtCondProducer") <<
"Unexpectedly small L1A history from TCDSRecord";
160 if (eventHistory[0] < 3ull) {
161 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (1 in 3)";
164 if (eventHistory[0] == 3ull)
165 TriggerRulePrefireVetoBit =
true;
168 if (eventHistory[0] < 25ull and eventHistory[1] < 25ull) {
169 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (2 in 25)";
171 if (eventHistory[0] < 25ull and eventHistory[1] == 25ull)
172 TriggerRulePrefireVetoBit =
true;
175 if (eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] < 100ull) {
176 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (3 in 100)";
178 if (eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] == 100ull)
179 TriggerRulePrefireVetoBit =
true;
182 if (eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and
183 eventHistory[3] < 240ull) {
184 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (4 in 240)";
186 if (eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and
187 eventHistory[3] == 240ull)
188 TriggerRulePrefireVetoBit =
true;
229 if (TriggerRulePrefireVetoBit)
234 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