86 : bxFirst_(iConfig.getParameter<
int>(
"bxFirst")),
87 bxLast_(iConfig.getParameter<
int>(
"bxLast")),
88 setBptxAND_(iConfig.getParameter<
bool>(
"setBptxAND")),
89 setBptxPlus_(iConfig.getParameter<
bool>(
"setBptxPlus")),
90 setBptxMinus_(iConfig.getParameter<
bool>(
"setBptxMinus")),
91 setBptxOR_(iConfig.getParameter<
bool>(
"setBptxOR")),
92 tcdsInputTag_(iConfig.getParameter<
edm::
InputTag>(
"tcdsRecordLabel")) {
108 produces<GlobalExtBlkBxCollection>();
122 LogDebug(
"L1TExtCondProducer") <<
"L1TExtCondProducer::produce function called...\n";
136 std::map<std::string, unsigned int> extBitMap = gtParser.
getExternalSignals(utml1GtMenu);
142 bool TriggerRulePrefireVetoBit(
false);
148 const auto& tcdsRecord = *tcdsRecordH.
product();
150 uint64_t thisEvent = (tcdsRecord.getBXID() - 1) + tcdsRecord.getOrbitNr() * 3564ull;
152 std::vector<uint64_t> eventHistory;
153 for (
auto&& l1a : tcdsRecord.getFullL1aHistory()) {
154 eventHistory.push_back(thisEvent - ((l1a.getBXID() - 1) + l1a.getOrbitNr() * 3564ull));
158 if (eventHistory.size() < 4) {
159 edm::LogError(
"L1TExtCondProducer") <<
"Unexpectedly small L1A history from TCDSRecord";
163 if (eventHistory[0] < 3ull) {
164 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (1 in 3)";
167 if (eventHistory[0] == 3ull)
168 TriggerRulePrefireVetoBit =
true;
171 if (eventHistory[0] < 25ull and eventHistory[1] < 25ull) {
172 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (2 in 25)";
174 if (eventHistory[0] < 25ull and eventHistory[1] == 25ull)
175 TriggerRulePrefireVetoBit =
true;
178 if (eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] < 100ull) {
179 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (3 in 100)";
181 if (eventHistory[0] < 100ull and eventHistory[1] < 100ull and eventHistory[2] == 100ull)
182 TriggerRulePrefireVetoBit =
true;
185 if (eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and
186 eventHistory[3] < 240ull) {
187 edm::LogError(
"L1TExtCondProducer") <<
"Found an L1A in an impossible location?! (4 in 240)";
189 if (eventHistory[0] < 240ull and eventHistory[1] < 240ull and eventHistory[2] < 240ull and
190 eventHistory[3] == 240ull)
191 TriggerRulePrefireVetoBit =
true;
232 if (TriggerRulePrefireVetoBit)
237 extCond->push_back(iBx, extCond_bx);
247 desc.
add<
bool>(
"setBptxMinus",
true);
248 desc.
add<
bool>(
"setBptxAND",
true);
249 desc.
add<
int>(
"bxFirst", -2);
250 desc.
add<
bool>(
"setBptxOR",
true);
251 desc.
add<
int>(
"bxLast", 2);
252 desc.
add<
bool>(
"setBptxPlus",
true);
254 descriptions.
add(
"simGtExtFakeProd", desc);
BXVector< GlobalExtBlk > GlobalExtBlkBxCollection
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~L1TExtCondProducer() override
edm::EDGetTokenT< TCDSRecord > tcdsRecordToken_
static const unsigned int maxExternalConditions
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
unsigned int m_triggerRulePrefireVetoBit
edm::InputTag tcdsInputTag_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
L1TExtCondProducer(const ParameterSet &)
void setExternalDecision(unsigned int bit, bool val)
Set decision bits.
unsigned long long m_l1GtMenuCacheID
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T const * product() const
unsigned long long uint64_t
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool makeTriggerRulePrefireVetoBit_
std::map< std::string, unsigned int > m_extBitMap
T const * product() const
void produce(edm::Event &, const edm::EventSetup &) override