71 std::vector<unsigned int>
mask_;
79 : legacyL1_(params.getParameter<bool>(
"legacyL1")),
80 store_unprefireable_bit_(!legacyL1_ ? params.getParameter<bool>(
"storeUnprefireableBit") :
false),
85 token_ext_(store_unprefireable_bit_
91 produces<edm::TriggerResults>();
109 for (
auto const& keyval : mapping) {
110 names_.push_back(keyval.first);
111 indices_.push_back(keyval.second.algoBitNumber());
116 for (
auto const& keyval : mapping) {
117 names_.push_back(keyval.first);
118 indices_.push_back(keyval.second.getIndex());
121 names_.push_back(
"L1_UnprefireableEvent");
129 const std::vector<bool>* wordp =
nullptr;
130 bool unprefireable_bit =
false;
134 wordp = &handleResults->at(0, 0).getAlgoDecisionFinal();
138 if (handleExtResults.
isValid()) {
139 if (handleExtResults->size() != 0) {
143 LogDebug(
"Unprefirable bit not found, always set to false");
150 wordp = &handleResults->decisionWord();
152 auto const&
word = *wordp;
154 unsigned indices_size =
indices_.size();
155 for (
size_t nidx = 0; nidx < indices_size; nidx++) {
159 result &= (
mask_[index] != 0);
165 auto out = std::make_unique<edm::TriggerResults>(l1bitsAsHLTStatus,
names_);
172 desc.
add<
bool>(
"legacyL1")->setComment(
"is legacy L1");
174 "L1 input (L1GlobalTriggerReadoutRecord if legacy, GlobalAlgBlkBxCollection otherwise)");
175 desc.
add<
bool>(
"storeUnprefireableBit",
false)
176 ->setComment(
"Activate storage of L1 unprefireable bit (needs L1 external decision input)");
178 ->setComment(
"L1 external decision input (GlobalExtBlkBxCollection, only supported if not legacy");
179 descriptions.
add(
"L1TriggerResultsConverter", desc);
std::vector< unsigned int > indices_
std::vector< std::string > names_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
static const unsigned int maxExternalConditions
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
~L1TriggerResultsConverter() override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void beginRun(edm::Run const &, edm::EventSetup const &) override
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< GlobalAlgBlkBxCollection > token_
const bool store_unprefireable_bit_
L1TriggerResultsConverter(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDGetTokenT< GlobalExtBlkBxCollection > token_ext_
const edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > tokenLegacy_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< unsigned int > mask_
edm::ESGetToken< L1TUtmTriggerMenu, L1TUtmTriggerMenuRcd > l1utmTrigToken_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd > l1gtalgoMaskToken_
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > l1gtmenuToken_