136 LogDebug(
"L1TExtCondProducer") <<
"L1TExtCondProducer::produce function called...\n";
151 std::map<std::string, unsigned int> extBitMap = gtParser.
getExternalSignals(utml1GtMenu);
157 bool TriggerRulePrefireVetoBit(
false);
163 const auto& tcdsRecord = *tcdsRecordH.
product();
165 uint64_t thisEvent = (tcdsRecord.getBXID()-1) + tcdsRecord.getOrbitNr()*3564ull;
167 std::vector<uint64_t> eventHistory;
168 for (
auto&& l1a : tcdsRecord.getFullL1aHistory()) {
169 eventHistory.push_back(thisEvent - ((l1a.getBXID()-1) + l1a.getOrbitNr()*3564ull));
173 if ( eventHistory.size() < 4 ) {
174 edm::LogError(
"L1TExtCondProducer") <<
"Unexpectedly small L1A history from TCDSRecord";
178 if ( eventHistory[0] < 3ull ) {
179 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (1 in 3)";
182 if ( eventHistory[0] == 3ull ) TriggerRulePrefireVetoBit =
true;
185 if ( eventHistory[0] < 25ull and eventHistory[1] < 25ull ) {
186 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (2 in 25)";
188 if ( eventHistory[0] < 25ull and eventHistory[1] == 25ull ) TriggerRulePrefireVetoBit =
true;
191 if ( eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] < 100ull ) {
192 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (3 in 100)";
194 if ( eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] == 100ull ) TriggerRulePrefireVetoBit =
true;
197 if ( eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and eventHistory[3] < 240ull ) {
198 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (4 in 240)";
200 if ( eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and eventHistory[3] == 240ull ) TriggerRulePrefireVetoBit =
true;
233 if (TriggerRulePrefireVetoBit)
239 extCond->push_back(iBx, extCond_bx);
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
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
bool makeTriggerRulePrefireVetoBit_
std::map< std::string, unsigned int > m_extBitMap
T const * product() const