12 #include <boost/shared_ptr.hpp> 88 bxFirst_ (iConfig.getParameter<
int>(
"bxFirst")),
89 bxLast_ (iConfig.getParameter<
int>(
"bxLast")),
90 setBptxAND_ (iConfig.getParameter<
bool>(
"setBptxAND")),
91 setBptxPlus_ (iConfig.getParameter<
bool>(
"setBptxPlus")),
92 setBptxMinus_ (iConfig.getParameter<
bool>(
"setBptxMinus")),
93 setBptxOR_ (iConfig.getParameter<
bool>(
"setBptxOR")),
94 tcdsInputTag_(iConfig.getParameter<
edm::
InputTag>(
"tcdsRecordLabel"))
102 edm::LogWarning(
"L1TExtCondProducer") <<
"Default trigger rule prefire veto bit number too large. Resetting to " 114 produces<GlobalExtBlkBxCollection>();
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);
252 desc.
add<
bool>(
"setBptxMinus",
true);
253 desc.
add<
bool>(
"setBptxAND",
true);
254 desc.
add<
int>(
"bxFirst", -2);
255 desc.
add<
bool>(
"setBptxOR",
true);
256 desc.
add<
int>(
"bxLast", 2);
257 desc.
add<
bool>(
"setBptxPlus",
true);
259 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