CMS 3D CMS Logo

PATTriggerProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: PatAlgos
4 // Class: pat::PATTriggerProducer
5 //
6 //
62 
63 #include <cassert>
64 #include <map>
65 #include <memory>
66 #include <string>
67 #include <utility>
68 #include <vector>
69 
70 namespace pat {
71 
73  public:
74  explicit PATTriggerProducer(const edm::ParameterSet& iConfig);
75  ~PATTriggerProducer() override{};
76 
77  private:
78  void beginRun(const edm::Run& iRun, const edm::EventSetup& iSetup) override;
79  void beginLuminosityBlock(const edm::LuminosityBlock& iLuminosityBlock, const edm::EventSetup& iSetup) override;
80  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
81 
82  std::string nameProcess_; // configuration
84  bool onlyStandAlone_; // configuration
86  // L1
88  bool addL1Algos_; // configuration (optional with default)
89  edm::InputTag tagL1GlobalTriggerObjectMaps_; // configuration (optional with default)
91  edm::InputTag tagL1ExtraMu_; // configuration (optional)
93  edm::InputTag tagL1ExtraNoIsoEG_; // configuration (optional)
95  edm::InputTag tagL1ExtraIsoEG_; // configuration (optional)
97  edm::InputTag tagL1ExtraCenJet_; // configuration (optional)
99  edm::InputTag tagL1ExtraForJet_; // configuration (optional)
101  edm::InputTag tagL1ExtraTauJet_; // configuration (optional)
103  edm::InputTag tagL1ExtraETM_; // configuration (optional)
105  edm::InputTag tagL1ExtraHTM_; // configuration (optional)
115  bool mainBxOnly_; // configuration (optional with default)
116  bool saveL1Refs_; // configuration (optional with default)
117  // HLT
120  edm::InputTag tagTriggerResults_; // configuration (optional with default)
122  edm::InputTag tagTriggerEvent_; // configuration (optional with default)
124  std::string hltPrescaleLabel_; // configuration (optional)
125  std::string labelHltPrescaleTable_; // configuration (optional)
131  bool addPathModuleLabels_; // configuration (optional with default)
132  std::vector<std::string> exludeCollections_; // configuration (optional)
133  bool packPathNames_; // configuration (optional width default)
134  bool packLabels_; // configuration (optional width default)
135  bool packPrescales_; // configuration (optional width default)
137 
139  public:
140  struct PathAndFlags {
141  PathAndFlags(const std::string& name, unsigned int index, bool last, bool l3)
145  unsigned int pathIndex;
147  bool l3Filter;
148  };
149  void init(const HLTConfigProvider&);
150  void clear() { map_.clear(); }
151  const std::vector<PathAndFlags>& operator[](const std::string& filter) const {
152  std::map<std::string, std::vector<PathAndFlags> >::const_iterator it = map_.find(filter);
153  return (it == map_.end() ? empty_ : it->second);
154  }
155 
156  private:
157  void insert(
158  const std::string& filter, const std::string& path, unsigned int pathIndex, bool lastFilter, bool l3Filter) {
159  map_[filter].push_back(PathAndFlags(path, pathIndex, lastFilter, l3Filter));
160  }
161  std::map<std::string, std::vector<PathAndFlags> > map_;
162  const std::vector<PathAndFlags> empty_ = {};
163  };
165  };
166 } // namespace pat
167 
168 using namespace pat;
169 using namespace edm;
170 
171 // Constants' definitions
175 
177  : nameProcess_(iConfig.getParameter<std::string>("processName")),
178  autoProcessName_(nameProcess_ == "*"),
179  onlyStandAlone_(iConfig.getParameter<bool>("onlyStandAlone")),
180  firstInRun_(true),
181  // L1 configuration parameters
182  addL1Algos_(false),
183  tagL1GlobalTriggerObjectMaps_("l1L1GtObjectMap"),
184  tagL1ExtraMu_(),
185  tagL1ExtraNoIsoEG_(),
186  tagL1ExtraIsoEG_(),
187  tagL1ExtraCenJet_(),
188  tagL1ExtraForJet_(),
189  tagL1ExtraTauJet_(),
190  tagL1ExtraETM_(),
191  tagL1ExtraHTM_(),
192  autoProcessNameL1ExtraMu_(false),
193  autoProcessNameL1ExtraNoIsoEG_(false),
194  autoProcessNameL1ExtraIsoEG_(false),
195  autoProcessNameL1ExtraCenJet_(false),
196  autoProcessNameL1ExtraForJet_(false),
197  autoProcessNameL1ExtraTauJet_(false),
198  autoProcessNameL1ExtraETM_(false),
199  autoProcessNameL1ExtraHTM_(false),
200  mainBxOnly_(true),
201  saveL1Refs_(false),
202  hltPrescaleProvider_(iConfig, consumesCollector(), *this),
203  hltConfigInit_(false),
204  // HLT configuration parameters
205  tagTriggerResults_("TriggerResults"),
206  tagTriggerEvent_("hltTriggerSummaryAOD"),
207  hltPrescaleLabel_(),
208  labelHltPrescaleTable_(),
209  hltPrescaleTableRun_(),
210  hltPrescaleTableLumi_(),
211  addPathModuleLabels_(false),
212  packPathNames_(iConfig.existsAs<bool>("packTriggerPathNames") ? iConfig.getParameter<bool>("packTriggerPathNames")
213  : false),
214  packLabels_(iConfig.existsAs<bool>("packTriggerLabels") ? iConfig.getParameter<bool>("packTriggerLabels") : true),
215  packPrescales_(iConfig.existsAs<bool>("packTriggerPrescales") ? iConfig.getParameter<bool>("packTriggerPrescales")
216  : true),
217  handleL1GtTriggerMenuToken_{esConsumes()} {
218  // L1 configuration parameters
219  if (iConfig.exists("addL1Algos"))
220  addL1Algos_ = iConfig.getParameter<bool>("addL1Algos");
221  if (iConfig.exists("l1GlobalTriggerObjectMaps"))
222  tagL1GlobalTriggerObjectMaps_ = iConfig.getParameter<InputTag>("l1GlobalTriggerObjectMaps");
223  l1GlobalTriggerObjectMapsToken_ = mayConsume<L1GlobalTriggerObjectMaps>(tagL1GlobalTriggerObjectMaps_);
224  if (iConfig.exists("l1ExtraMu")) {
225  tagL1ExtraMu_ = iConfig.getParameter<InputTag>("l1ExtraMu");
226  if (tagL1ExtraMu_.process() == "*") {
227  if (autoProcessName_)
228  autoProcessNameL1ExtraMu_ = true;
229  else
230  tagL1ExtraMu_ = InputTag(tagL1ExtraMu_.label(), tagL1ExtraMu_.instance(), nameProcess_);
231  }
233  InputTagMatch(InputTag(tagL1ExtraMu_.label(), tagL1ExtraMu_.instance())), this);
234  }
235  if (iConfig.exists("l1ExtraNoIsoEG")) {
236  tagL1ExtraNoIsoEG_ = iConfig.getParameter<InputTag>("l1ExtraNoIsoEG");
237  if (tagL1ExtraNoIsoEG_.process() == "*") {
238  if (autoProcessName_)
239  autoProcessNameL1ExtraNoIsoEG_ = true;
240  else
241  tagL1ExtraNoIsoEG_ = InputTag(tagL1ExtraNoIsoEG_.label(), tagL1ExtraNoIsoEG_.instance(), nameProcess_);
242  }
244  InputTagMatch(InputTag(tagL1ExtraNoIsoEG_.label(), tagL1ExtraNoIsoEG_.instance())), this);
245  }
246  if (iConfig.exists("l1ExtraIsoEG")) {
247  tagL1ExtraIsoEG_ = iConfig.getParameter<InputTag>("l1ExtraIsoEG");
248  if (tagL1ExtraIsoEG_.process() == "*") {
249  if (autoProcessName_)
250  autoProcessNameL1ExtraIsoEG_ = true;
251  else
252  tagL1ExtraIsoEG_ = InputTag(tagL1ExtraIsoEG_.label(), tagL1ExtraIsoEG_.instance(), nameProcess_);
253  }
255  InputTagMatch(InputTag(tagL1ExtraIsoEG_.label(), tagL1ExtraIsoEG_.instance())), this);
256  }
257  if (iConfig.exists("l1ExtraCenJet")) {
258  tagL1ExtraCenJet_ = iConfig.getParameter<InputTag>("l1ExtraCenJet");
259  if (tagL1ExtraCenJet_.process() == "*") {
260  if (autoProcessName_)
261  autoProcessNameL1ExtraCenJet_ = true;
262  else
263  tagL1ExtraCenJet_ = InputTag(tagL1ExtraCenJet_.label(), tagL1ExtraCenJet_.instance(), nameProcess_);
264  }
266  InputTagMatch(InputTag(tagL1ExtraCenJet_.label(), tagL1ExtraCenJet_.instance())), this);
267  }
268  if (iConfig.exists("l1ExtraForJet")) {
269  tagL1ExtraForJet_ = iConfig.getParameter<InputTag>("l1ExtraForJet");
270  if (tagL1ExtraForJet_.process() == "*") {
271  if (autoProcessName_)
272  autoProcessNameL1ExtraForJet_ = true;
273  else
274  tagL1ExtraForJet_ = InputTag(tagL1ExtraForJet_.label(), tagL1ExtraForJet_.instance(), nameProcess_);
275  }
277  InputTagMatch(InputTag(tagL1ExtraForJet_.label(), tagL1ExtraForJet_.instance())), this);
278  }
279  if (iConfig.exists("l1ExtraTauJet")) {
280  tagL1ExtraTauJet_ = iConfig.getParameter<InputTag>("l1ExtraTauJet");
281  if (tagL1ExtraTauJet_.process() == "*") {
282  if (autoProcessName_)
283  autoProcessNameL1ExtraTauJet_ = true;
284  else
285  tagL1ExtraTauJet_ = InputTag(tagL1ExtraTauJet_.label(), tagL1ExtraTauJet_.instance(), nameProcess_);
286  }
288  InputTagMatch(InputTag(tagL1ExtraTauJet_.label(), tagL1ExtraTauJet_.instance())), this);
289  }
290  if (iConfig.exists("l1ExtraETM")) {
291  tagL1ExtraETM_ = iConfig.getParameter<InputTag>("l1ExtraETM");
292  if (tagL1ExtraETM_.process() == "*") {
293  if (autoProcessName_)
294  autoProcessNameL1ExtraETM_ = true;
295  else
296  tagL1ExtraETM_ = InputTag(tagL1ExtraETM_.label(), tagL1ExtraETM_.instance(), nameProcess_);
297  }
299  InputTagMatch(InputTag(tagL1ExtraETM_.label(), tagL1ExtraETM_.instance())), this);
300  }
301  if (iConfig.exists("l1ExtraHTM")) {
302  tagL1ExtraHTM_ = iConfig.getParameter<InputTag>("l1ExtraHTM");
303  if (tagL1ExtraHTM_.process() == "*") {
304  if (autoProcessName_)
305  autoProcessNameL1ExtraHTM_ = true;
306  else
307  tagL1ExtraHTM_ = InputTag(tagL1ExtraHTM_.label(), tagL1ExtraHTM_.instance(), nameProcess_);
308  }
310  InputTagMatch(InputTag(tagL1ExtraHTM_.label(), tagL1ExtraHTM_.instance())), this);
311  }
312  if (iConfig.exists("mainBxOnly"))
313  mainBxOnly_ = iConfig.getParameter<bool>("mainBxOnly");
314  if (iConfig.exists("saveL1Refs"))
315  saveL1Refs_ = iConfig.getParameter<bool>("saveL1Refs");
316 
317  // HLT configuration parameters
318  if (iConfig.exists("triggerResults"))
319  tagTriggerResults_ = iConfig.getParameter<InputTag>("triggerResults");
320  triggerResultsGetter_ =
321  GetterOfProducts<TriggerResults>(InputTagMatch(InputTag(tagTriggerResults_.label(),
322  tagTriggerResults_.instance(),
323  autoProcessName_ ? std::string("") : nameProcess_)),
324  this);
325  if (iConfig.exists("triggerEvent"))
326  tagTriggerEvent_ = iConfig.getParameter<InputTag>("triggerEvent");
327  triggerEventGetter_ = GetterOfProducts<trigger::TriggerEvent>(
328  InputTagMatch(InputTag(tagTriggerEvent_.label(), tagTriggerEvent_.instance())), this);
329  if (iConfig.exists("hltPrescaleLabel"))
330  hltPrescaleLabel_ = iConfig.getParameter<std::string>("hltPrescaleLabel");
331  if (iConfig.exists("hltPrescaleTable")) {
332  labelHltPrescaleTable_ = iConfig.getParameter<std::string>("hltPrescaleTable");
333  hltPrescaleTableRunGetter_ = GetterOfProducts<trigger::HLTPrescaleTable>(
334  InputTagMatch(InputTag(labelHltPrescaleTable_, "Run")), this, InRun);
335  hltPrescaleTableLumiGetter_ = GetterOfProducts<trigger::HLTPrescaleTable>(
336  InputTagMatch(InputTag(labelHltPrescaleTable_, "Lumi")), this, InLumi);
337  hltPrescaleTableEventGetter_ =
338  GetterOfProducts<trigger::HLTPrescaleTable>(InputTagMatch(InputTag(labelHltPrescaleTable_, "Event")), this);
339  }
340  if (iConfig.exists("addPathModuleLabels"))
341  addPathModuleLabels_ = iConfig.getParameter<bool>("addPathModuleLabels");
342  exludeCollections_.clear();
343  if (iConfig.exists("exludeCollections"))
344  exludeCollections_ = iConfig.getParameter<std::vector<std::string> >("exludeCollections");
345 
346  callWhenNewProductsRegistered([this, &iConfig](BranchDescription const& bd) {
347  if (iConfig.exists("l1ExtraMu"))
348  l1ExtraMuGetter_(bd);
349  if (iConfig.exists("l1ExtraNoIsoEG"))
350  l1ExtraNoIsoEGGetter_(bd);
351  if (iConfig.exists("l1ExtraIsoEG"))
352  l1ExtraIsoEGGetter_(bd);
353  if (iConfig.exists("l1ExtraCenJet"))
354  l1ExtraCenJetGetter_(bd);
355  if (iConfig.exists("l1ExtraForJet"))
356  l1ExtraForJetGetter_(bd);
357  if (iConfig.exists("l1ExtraTauJet"))
358  l1ExtraTauJetGetter_(bd);
359  if (iConfig.exists("l1ExtraETM"))
360  l1ExtraETMGetter_(bd);
361  if (iConfig.exists("l1ExtraHTM"))
362  l1ExtraHTMGetter_(bd);
363  if (not(this->autoProcessName_ and bd.processName() == this->moduleDescription().processName())) {
364  triggerResultsGetter_(bd);
365  }
366  triggerEventGetter_(bd);
367  if (iConfig.exists("hltPrescaleTable")) {
368  hltPrescaleTableRunGetter_(bd);
369  hltPrescaleTableLumiGetter_(bd);
370  hltPrescaleTableEventGetter_(bd);
371  }
372  });
373 
374  if (!onlyStandAlone_) {
375  produces<TriggerAlgorithmCollection>();
376  produces<TriggerConditionCollection>();
377  produces<TriggerPathCollection>();
378  produces<TriggerFilterCollection>();
379  produces<TriggerObjectCollection>();
380  }
381  if (packPrescales_) {
382  produces<PackedTriggerPrescales>();
383  produces<PackedTriggerPrescales>("l1max");
384  produces<PackedTriggerPrescales>("l1min");
385  }
386  produces<TriggerObjectStandAloneCollection>();
387 }
388 
389 void PATTriggerProducer::beginRun(const Run& iRun, const EventSetup& iSetup) {
390  // Initialize
391  firstInRun_ = true;
392  l1PSet_ = nullptr;
393  hltConfigInit_ = false;
394 
395  // Initialize process name
396  if (autoProcessName_) {
397  // reset
398  nameProcess_ = "*";
399  // determine process name from last run TriggerSummaryProducerAOD module in process history of input
400  const ProcessHistory& processHistory(iRun.processHistory());
401  ProcessConfiguration processConfiguration;
402  ParameterSet processPSet;
403  // unbroken loop, which relies on time ordering (accepts the last found entry)
404  for (ProcessHistory::const_iterator iHist = processHistory.begin(); iHist != processHistory.end(); ++iHist) {
405  if (processHistory.getConfigurationForProcess(iHist->processName(), processConfiguration) &&
406  pset::Registry::instance()->getMapped(processConfiguration.parameterSetID(), processPSet) &&
407  processPSet.exists(tagTriggerEvent_.label())) {
408  nameProcess_ = iHist->processName();
409  LogDebug("autoProcessName") << "HLT process name '" << nameProcess_ << "' discovered";
410  }
411  }
412  // terminate, if nothing is found
413  if (nameProcess_ == "*") {
414  LogError("autoProcessName") << "trigger::TriggerEvent product with label '" << tagTriggerEvent_.label()
415  << "' not produced according to process history of input data\n"
416  << "No trigger information produced";
417  return;
418  }
419  LogInfo("autoProcessName") << "HLT process name' " << nameProcess_ << "' used for PAT trigger information";
420  }
421  // adapt configuration of used input tags
422  if (tagTriggerResults_.process().empty() || tagTriggerResults_.process() == "*") {
424  } else if (tagTriggerEvent_.process() != nameProcess_) {
425  LogWarning("inputTags") << "TriggerResults process name '" << tagTriggerResults_.process()
426  << "' differs from HLT process name '" << nameProcess_ << "'";
427  }
428  if (tagTriggerEvent_.process().empty() || tagTriggerEvent_.process() == "*") {
430  } else if (tagTriggerEvent_.process() != nameProcess_) {
431  LogWarning("inputTags") << "TriggerEvent process name '" << tagTriggerEvent_.process()
432  << "' differs from HLT process name '" << nameProcess_ << "'";
433  }
450 
451  // Initialize HLTConfigProvider
453  bool changed(true);
454  if (!hltPrescaleProvider_.init(iRun, iSetup, nameProcess_, changed)) {
455  LogError("hltConfig") << "HLT config extraction error with process name '" << nameProcess_ << "'";
456  } else if (hltConfig.size() <= 0) {
457  LogError("hltConfig") << "HLT config size error";
458  } else
459  hltConfigInit_ = true;
460 
461  // Update mapping from filter names to path names
462  if (hltConfigInit_ && changed)
464 
465  // Extract pre-scales
466  if (hltConfigInit_) {
467  // Start empty
469  // Try run product, if configured
470  if (!labelHltPrescaleTable_.empty()) {
471  Handle<trigger::HLTPrescaleTable> handleHltPrescaleTable;
472  iRun.getByLabel(InputTag(labelHltPrescaleTable_, "Run", nameProcess_), handleHltPrescaleTable);
473  if (handleHltPrescaleTable.isValid()) {
475  handleHltPrescaleTable->set(), handleHltPrescaleTable->labels(), handleHltPrescaleTable->table());
476  }
477  }
478  }
479 }
480 
481 void PATTriggerProducer::beginLuminosityBlock(const LuminosityBlock& iLuminosityBlock, const EventSetup& iSetup) {
482  // Terminate, if auto process name determination failed
483  if (nameProcess_ == "*")
484  return;
485 
486  // Extract pre-scales
487  if (hltConfigInit_) {
488  // Start from run
491  // Try lumi product, if configured and available
492  if (!labelHltPrescaleTable_.empty()) {
493  Handle<trigger::HLTPrescaleTable> handleHltPrescaleTable;
494  iLuminosityBlock.getByLabel(InputTag(labelHltPrescaleTable_, "Lumi", nameProcess_), handleHltPrescaleTable);
495  if (handleHltPrescaleTable.isValid()) {
497  handleHltPrescaleTable->set(), handleHltPrescaleTable->labels(), handleHltPrescaleTable->table());
498  }
499  }
500  }
501 }
502 
504  // Terminate, if auto process name determination failed
505  if (nameProcess_ == "*")
506  return;
507 
508  auto triggerObjects = std::make_unique<TriggerObjectCollection>();
509  auto triggerObjectsStandAlone = std::make_unique<TriggerObjectStandAloneCollection>();
510  std::unique_ptr<PackedTriggerPrescales> packedPrescales, packedPrescalesL1min, packedPrescalesL1max;
511 
512  // HLT
514 
515  // Get and check HLT event data
516  Handle<trigger::TriggerEvent> handleTriggerEvent;
517  iEvent.getByLabel(tagTriggerEvent_, handleTriggerEvent);
518  Handle<TriggerResults> handleTriggerResults;
519  iEvent.getByLabel(tagTriggerResults_, handleTriggerResults);
520  bool goodHlt(hltConfigInit_);
521  if (goodHlt) {
522  if (!handleTriggerResults.isValid()) {
523  LogError("triggerResultsValid") << "TriggerResults product with InputTag '" << tagTriggerResults_.encode()
524  << "' not in event\n"
525  << "No HLT information produced";
526  goodHlt = false;
527  } else if (!handleTriggerEvent.isValid()) {
528  LogError("triggerEventValid") << "trigger::TriggerEvent product with InputTag '" << tagTriggerEvent_.encode()
529  << "' not in event\n"
530  << "No HLT information produced";
531  goodHlt = false;
532  }
533  }
534 
535  // Produce HLT paths and determine status of modules
536 
537  if (goodHlt) {
538  // Extract pre-scales
539  // Start from lumi
540  trigger::HLTPrescaleTable hltPrescaleTable(
542  // Try event product, if configured and available
543  if (!labelHltPrescaleTable_.empty()) {
544  Handle<trigger::HLTPrescaleTable> handleHltPrescaleTable;
545  iEvent.getByLabel(InputTag(labelHltPrescaleTable_, "Event", nameProcess_), handleHltPrescaleTable);
546  if (handleHltPrescaleTable.isValid()) {
547  hltPrescaleTable = trigger::HLTPrescaleTable(
548  handleHltPrescaleTable->set(), handleHltPrescaleTable->labels(), handleHltPrescaleTable->table());
549  }
550  }
551  // Try event setup, if no product
552  if (hltPrescaleTable.size() == 0) {
553  if (!labelHltPrescaleTable_.empty()) {
554  LogWarning("hltPrescaleInputTag") << "HLTPrescaleTable product with label '" << labelHltPrescaleTable_
555  << "' not found in process" << nameProcess_ << "\n"
556  << "Using default from event setup";
557  }
558  if (hltConfig.prescaleSize() > 0) {
559  if (hltPrescaleProvider_.prescaleSet(iEvent, iSetup) != -1) {
560  hltPrescaleTable = trigger::HLTPrescaleTable(
561  hltPrescaleProvider_.prescaleSet(iEvent, iSetup), hltConfig.prescaleLabels(), {});
562  LogDebug("hltPrescaleTable") << "HLT prescale table found in event setup";
563  } else {
564  LogWarning("hltPrescaleSet") << "HLTPrescaleTable from event setup has error";
565  }
566  }
567  }
568  unsigned set(hltPrescaleTable.set());
569  if (hltPrescaleTable.size() > 0) {
570  if (!hltPrescaleLabel_.empty()) {
571  bool foundPrescaleLabel(false);
572  for (unsigned iLabel = 0; iLabel < hltPrescaleTable.labels().size(); ++iLabel) {
573  if (hltPrescaleTable.labels().at(iLabel) == hltPrescaleLabel_) {
574  set = iLabel;
575  foundPrescaleLabel = true;
576  break;
577  }
578  }
579  if (!foundPrescaleLabel) {
580  LogWarning("hltPrescaleLabel") << "HLT prescale label '" << hltPrescaleLabel_ << "' not in prescale table\n"
581  << "Using default";
582  }
583  }
584  } else if (iEvent.isRealData()) {
585  if ((labelHltPrescaleTable_.empty() && firstInRun_) || !labelHltPrescaleTable_.empty()) {
586  LogError("hltPrescaleTable") << "No HLT prescale table found\n"
587  << "Using default empty table with all prescales 1";
588  }
589  }
590 
591  const unsigned sizePaths(hltConfig.size());
592  const unsigned sizeFilters(handleTriggerEvent->sizeFilters());
593  const unsigned sizeObjects(handleTriggerEvent->sizeObjects());
594 
595  std::map<std::string, int> moduleStates;
596 
597  if (!onlyStandAlone_) {
598  auto triggerPaths = std::make_unique<TriggerPathCollection>();
599  triggerPaths->reserve(sizePaths);
600  const std::vector<std::string>& pathNames = hltConfig.triggerNames();
601  for (size_t indexPath = 0; indexPath < sizePaths; ++indexPath) {
602  const std::string& namePath = pathNames.at(indexPath);
603  unsigned indexLastFilterPathModules(handleTriggerResults->index(indexPath) + 1);
604  const unsigned sizeModulesPath(hltConfig.size(indexPath));
605  //protection for paths with zero filters (needed for reco, digi, etc paths)
606  if (sizeModulesPath != 0) {
607  while (indexLastFilterPathModules > 0) {
608  --indexLastFilterPathModules;
609  const std::string& labelLastFilterPathModules(hltConfig.moduleLabel(indexPath, indexLastFilterPathModules));
610  unsigned indexLastFilterFilters =
611  handleTriggerEvent->filterIndex(InputTag(labelLastFilterPathModules, "", nameProcess_));
612  if (indexLastFilterFilters < sizeFilters) {
613  if (hltConfig.moduleType(labelLastFilterPathModules) == "HLTBool")
614  continue;
615  break;
616  }
617  }
618  } else {
619  indexLastFilterPathModules = 0;
620  }
621  TriggerPath triggerPath(namePath,
622  indexPath,
623  hltConfig.prescaleValue<double>(set, namePath),
624  handleTriggerResults->wasrun(indexPath),
625  handleTriggerResults->accept(indexPath),
626  handleTriggerResults->error(indexPath),
627  indexLastFilterPathModules,
628  hltConfig.saveTagsModules(namePath).size());
629  // add module names to path and states' map
630 
631  assert(indexLastFilterPathModules < sizeModulesPath || sizeModulesPath == 0);
632  std::map<unsigned, std::string> indicesModules;
633  for (size_t iM = 0; iM < sizeModulesPath; ++iM) {
634  const std::string& nameModule(hltConfig.moduleLabel(indexPath, iM));
635  if (addPathModuleLabels_) {
636  triggerPath.addModule(nameModule);
637  }
638  const unsigned indexFilter(handleTriggerEvent->filterIndex(InputTag(nameModule, "", nameProcess_)));
639  if (indexFilter < sizeFilters) {
640  triggerPath.addFilterIndex(indexFilter);
641  }
642  const unsigned slotModule(hltConfig.moduleIndex(indexPath, nameModule));
643  indicesModules.insert(std::pair<unsigned, std::string>(slotModule, nameModule));
644  }
645  // add L1 seeds
646  const L1SeedCollection& l1Seeds(hltConfig.hltL1GTSeeds(namePath));
647  for (L1SeedCollection::const_iterator iSeed = l1Seeds.begin(); iSeed != l1Seeds.end(); ++iSeed) {
648  triggerPath.addL1Seed(*iSeed);
649  }
650  // store path
651  triggerPaths->push_back(triggerPath);
652  // cache module states to be used for the filters
653  for (std::map<unsigned, std::string>::const_iterator iM = indicesModules.begin(); iM != indicesModules.end();
654  ++iM) {
655  if (iM->first < indexLastFilterPathModules) {
656  moduleStates[iM->second] = 1;
657  } else if (iM->first == indexLastFilterPathModules) {
658  moduleStates[iM->second] = handleTriggerResults->accept(indexPath);
659  } else if (moduleStates.find(iM->second) == moduleStates.end()) {
660  moduleStates[iM->second] = -1;
661  }
662  }
663  }
664  // Put HLT paths to event
666  }
667 
668  // Store used trigger objects and their types for HLT filters
669  // (only active filter(s) available from trigger::TriggerEvent)
670 
671  std::multimap<trigger::size_type, int> objectTypes;
672  std::multimap<trigger::size_type, std::string> filterLabels;
673 
674  for (size_t iF = 0; iF < sizeFilters; ++iF) {
675  const std::string nameFilter(handleTriggerEvent->filterLabel(iF));
676  const trigger::Keys& keys = handleTriggerEvent->filterKeys(iF);
677  const trigger::Vids& types = handleTriggerEvent->filterIds(iF);
678  assert(types.size() == keys.size());
679  for (size_t iK = 0; iK < keys.size(); ++iK) {
680  filterLabels.insert(std::pair<trigger::size_type, std::string>(keys[iK], nameFilter));
681  objectTypes.insert(std::pair<trigger::size_type, int>(keys[iK], types[iK]));
682  }
683  }
684 
685  // HLT objects
686 
687  triggerObjects->reserve(onlyStandAlone_ ? 0 : sizeObjects);
688  triggerObjectsStandAlone->reserve(sizeObjects);
689 
690  const trigger::Keys& collectionKeys(handleTriggerEvent->collectionKeys());
691  std::map<trigger::size_type, trigger::size_type> newObjectKeys;
692  for (size_t iO = 0, iC = 0, nC = handleTriggerEvent->sizeCollections(); iO < sizeObjects && iC < nC; ++iO) {
693  const trigger::TriggerObject tobj = handleTriggerEvent->getObjects().at(iO);
694  TriggerObject triggerObject(reco::Particle::PolarLorentzVector(tobj.pt(), tobj.eta(), tobj.phi(), tobj.mass()),
695  tobj.id());
696  // set collection
697  while (iO >= collectionKeys[iC])
698  ++iC; // relies on well ordering of trigger objects with respect to the collections
699  triggerObject.setCollection(handleTriggerEvent->collectionTagEncoded(iC));
700  // set filter ID
701  typedef std::multimap<trigger::size_type, int>::const_iterator it_type;
702  for (std::pair<it_type, it_type> trange = objectTypes.equal_range(iO); trange.first != trange.second;
703  ++trange.first) {
704  triggerObject.addTriggerObjectType(trange.first->second);
705  }
706 
707  // stand-alone trigger object
708  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
709  // check for excluded collections
710  bool excluded(false);
711  for (size_t iE = 0; iE < exludeCollections_.size(); ++iE) {
712  if (triggerObjectStandAlone.hasCollection(exludeCollections_.at(iE))) {
713  if (!onlyStandAlone_)
714  newObjectKeys[iO] = trigger::size_type(sizeObjects);
715  excluded = true;
716  break;
717  }
718  }
719  if (excluded)
720  continue;
721  typedef std::multimap<trigger::size_type, std::string>::const_iterator it_fl;
722  for (std::pair<it_fl, it_fl> frange = filterLabels.equal_range(iO); frange.first != frange.second;
723  ++frange.first) {
724  triggerObjectStandAlone.addFilterLabel(frange.first->second);
725  const std::vector<ModuleLabelToPathAndFlags::PathAndFlags>& paths =
726  moduleLabelToPathAndFlags_[frange.first->second];
727  for (std::vector<ModuleLabelToPathAndFlags::PathAndFlags>::const_iterator iP = paths.begin(); iP != paths.end();
728  ++iP) {
729  bool pathFired = handleTriggerResults->wasrun(iP->pathIndex) && handleTriggerResults->accept(iP->pathIndex);
730  triggerObjectStandAlone.addPathName(iP->pathName, pathFired && iP->lastFilter, pathFired && iP->l3Filter);
731  }
732  }
733 
734  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
735  if (!onlyStandAlone_) {
736  triggerObjects->push_back(triggerObject);
737  newObjectKeys[iO] = trigger::size_type(triggerObjects->size() - 1);
738  }
739  }
740 
741  // Re-iterate HLT filters and finally produce them in order to account for optionally skipped objects
742  if (!onlyStandAlone_) {
743  auto triggerFilters = std::make_unique<TriggerFilterCollection>();
744  triggerFilters->reserve(sizeFilters);
745  for (size_t iF = 0; iF < sizeFilters; ++iF) {
746  const std::string nameFilter(handleTriggerEvent->filterTag(iF).label());
747  const trigger::Keys& keys = handleTriggerEvent->filterKeys(iF); // not cached
748  const trigger::Vids& types = handleTriggerEvent->filterIds(iF); // not cached
749  TriggerFilter triggerFilter(nameFilter);
750  // set filter type
751  const std::string typeFilter(hltConfig.moduleType(nameFilter));
752  triggerFilter.setType(typeFilter);
753  triggerFilter.setSaveTags(hltConfig.saveTags(nameFilter));
754  // set keys and trigger object types of used objects
755  for (size_t iK = 0; iK < keys.size(); ++iK) { // identical to types.size()
756  // check, if current object is excluded
757  if (newObjectKeys.find(keys.at(iK)) != newObjectKeys.end()) {
758  if (newObjectKeys[keys.at(iK)] == sizeObjects)
759  continue;
760  triggerFilter.addObjectKey(newObjectKeys[keys.at(iK)]);
761  triggerFilter.addTriggerObjectType(types.at(iK));
762  } else {
763  LogWarning("triggerObjectKey") << "TriggerFilter '" << nameFilter
764  << "' requests non-existing TriggerObject key " << keys.at(iK) << "\n"
765  << "Skipping object assignment";
766  }
767  }
768  // set status from path info
769  std::map<std::string, int>::iterator iS(moduleStates.find(nameFilter));
770  if (iS != moduleStates.end()) {
771  if (!triggerFilter.setStatus(iS->second)) {
772  triggerFilter.setStatus(-1); // FIXME different code for "unvalid status determined" needed?
773  }
774  } else {
775  triggerFilter.setStatus(-1); // FIXME different code for "unknown" needed?
776  }
777  // store filter
778  triggerFilters->push_back(triggerFilter);
779  }
780  // put HLT filters to event
781  iEvent.put(std::move(triggerFilters));
782  }
783 
784  if (packPrescales_) {
785  packedPrescales = std::make_unique<PackedTriggerPrescales>(handleTriggerResults);
786  packedPrescalesL1min = std::make_unique<PackedTriggerPrescales>(handleTriggerResults);
787  packedPrescalesL1max = std::make_unique<PackedTriggerPrescales>(handleTriggerResults);
788  const edm::TriggerNames& names = iEvent.triggerNames(*handleTriggerResults);
789  for (unsigned int i = 0, n = names.size(); i < n; ++i) {
790  auto pvdet = hltPrescaleProvider_.prescaleValuesInDetail<double, double>(iEvent, iSetup, names.triggerName(i));
791  if (pvdet.first.empty()) {
792  packedPrescalesL1max->addPrescaledTrigger(i, 1);
793  packedPrescalesL1min->addPrescaledTrigger(i, 1);
794  } else {
795  double pmin = -1, pmax = -1;
796  for (const auto& p : pvdet.first) {
797  pmax = std::max(pmax, p.second);
798  if (p.second > 0 && (pmin == -1 || pmin > p.second))
799  pmin = p.second;
800  }
801  packedPrescalesL1max->addPrescaledTrigger(i, pmax);
802  packedPrescalesL1min->addPrescaledTrigger(i, pmin);
803  }
804  packedPrescales->addPrescaledTrigger(i, pvdet.second);
805  }
806  iEvent.put(std::move(packedPrescales));
807  iEvent.put(std::move(packedPrescalesL1max), "l1max");
808  iEvent.put(std::move(packedPrescalesL1min), "l1min");
809  }
810 
811  } // if ( goodHlt )
812 
813  // L1 objects
814  // (needs to be done after HLT objects, since their x-links with filters rely on their collection keys)
815 
816  // map for assignments of objects to conditions
817  std::map<L1GtObject, std::vector<unsigned> > l1ObjectTypeMap;
818  if (!tagL1ExtraMu_.label().empty()) {
820  iEvent.getByLabel(tagL1ExtraMu_, handleL1ExtraMu);
821  if (handleL1ExtraMu.isValid()) {
822  std::vector<unsigned> muKeys;
823  for (size_t l1Mu = 0; l1Mu < handleL1ExtraMu->size(); ++l1Mu) {
824  if (mainBxOnly_ && handleL1ExtraMu->at(l1Mu).bx() != 0)
825  continue;
826  TriggerObject triggerObject;
827  if (saveL1Refs_) {
828  const reco::CandidateBaseRef leafCandRef(l1extra::L1MuonParticleRef(handleL1ExtraMu, l1Mu));
829  triggerObject = TriggerObject(leafCandRef);
830  } else {
831  const reco::LeafCandidate leafCandidate(*(handleL1ExtraMu->at(l1Mu).reco::LeafCandidate::clone()));
832  triggerObject = TriggerObject(leafCandidate);
833  }
834  triggerObject.setCollection(tagL1ExtraMu_);
836  if (!onlyStandAlone_)
837  triggerObjects->push_back(triggerObject);
838  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
839  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
840  if (handleL1ExtraMu->at(l1Mu).bx() == 0)
841  muKeys.push_back(triggerObjectsStandAlone->size() - 1);
842  }
843  l1ObjectTypeMap.insert(std::make_pair(Mu, muKeys));
844  } else
845  LogError("l1ExtraValid") << "l1extra::L1MuonParticleCollection product with InputTag '" << tagL1ExtraMu_.encode()
846  << "' not in event";
847  }
848  if (!tagL1ExtraNoIsoEG_.label().empty()) {
849  Handle<l1extra::L1EmParticleCollection> handleL1ExtraNoIsoEG;
850  iEvent.getByLabel(tagL1ExtraNoIsoEG_, handleL1ExtraNoIsoEG);
851  if (handleL1ExtraNoIsoEG.isValid()) {
852  std::vector<unsigned> noIsoEGKeys;
853  for (size_t l1NoIsoEG = 0; l1NoIsoEG < handleL1ExtraNoIsoEG->size(); ++l1NoIsoEG) {
854  if (mainBxOnly_ && handleL1ExtraNoIsoEG->at(l1NoIsoEG).bx() != 0)
855  continue;
856  TriggerObject triggerObject;
857  if (saveL1Refs_) {
858  const reco::CandidateBaseRef leafCandRef(l1extra::L1EmParticleRef(handleL1ExtraNoIsoEG, l1NoIsoEG));
859  triggerObject = TriggerObject(leafCandRef);
860  } else {
861  const reco::LeafCandidate leafCandidate(*(handleL1ExtraNoIsoEG->at(l1NoIsoEG).reco::LeafCandidate::clone()));
862  triggerObject = TriggerObject(leafCandidate);
863  }
864  triggerObject.setCollection(tagL1ExtraNoIsoEG_);
866  if (!onlyStandAlone_)
867  triggerObjects->push_back(triggerObject);
868  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
869  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
870  if (handleL1ExtraNoIsoEG->at(l1NoIsoEG).bx() == 0)
871  noIsoEGKeys.push_back(triggerObjectsStandAlone->size() - 1);
872  }
873  l1ObjectTypeMap.insert(std::make_pair(NoIsoEG, noIsoEGKeys));
874  } else
875  LogError("l1ExtraValid") << "l1extra::L1EmParticleCollection product with InputTag '"
876  << tagL1ExtraNoIsoEG_.encode() << "' not in event";
877  }
878  if (!tagL1ExtraIsoEG_.label().empty()) {
879  Handle<l1extra::L1EmParticleCollection> handleL1ExtraIsoEG;
880  iEvent.getByLabel(tagL1ExtraIsoEG_, handleL1ExtraIsoEG);
881  if (handleL1ExtraIsoEG.isValid()) {
882  std::vector<unsigned> isoEGKeys;
883  for (size_t l1IsoEG = 0; l1IsoEG < handleL1ExtraIsoEG->size(); ++l1IsoEG) {
884  if (mainBxOnly_ && handleL1ExtraIsoEG->at(l1IsoEG).bx() != 0)
885  continue;
886  TriggerObject triggerObject;
887  if (saveL1Refs_) {
888  const reco::CandidateBaseRef leafCandRef(l1extra::L1EmParticleRef(handleL1ExtraIsoEG, l1IsoEG));
889  triggerObject = TriggerObject(leafCandRef);
890  } else {
891  const reco::LeafCandidate leafCandidate(*(handleL1ExtraIsoEG->at(l1IsoEG).reco::LeafCandidate::clone()));
892  triggerObject = TriggerObject(leafCandidate);
893  }
894  triggerObject.setCollection(tagL1ExtraIsoEG_);
896  if (!onlyStandAlone_)
897  triggerObjects->push_back(triggerObject);
898  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
899  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
900  if (handleL1ExtraIsoEG->at(l1IsoEG).bx() == 0)
901  isoEGKeys.push_back(triggerObjectsStandAlone->size() - 1);
902  }
903  l1ObjectTypeMap.insert(std::make_pair(IsoEG, isoEGKeys));
904  } else
905  LogError("l1ExtraValid") << "l1extra::L1EmParticleCollection product with InputTag '" << tagL1ExtraIsoEG_.encode()
906  << "' not in event";
907  }
908  if (!tagL1ExtraCenJet_.label().empty()) {
909  Handle<l1extra::L1JetParticleCollection> handleL1ExtraCenJet;
910  iEvent.getByLabel(tagL1ExtraCenJet_, handleL1ExtraCenJet);
911  if (handleL1ExtraCenJet.isValid()) {
912  std::vector<unsigned> cenJetKeys;
913  for (size_t l1CenJet = 0; l1CenJet < handleL1ExtraCenJet->size(); ++l1CenJet) {
914  if (mainBxOnly_ && handleL1ExtraCenJet->at(l1CenJet).bx() != 0)
915  continue;
916  TriggerObject triggerObject;
917  if (saveL1Refs_) {
918  const reco::CandidateBaseRef leafCandRef(l1extra::L1JetParticleRef(handleL1ExtraCenJet, l1CenJet));
919  triggerObject = TriggerObject(leafCandRef);
920  } else {
921  const reco::LeafCandidate leafCandidate(*(handleL1ExtraCenJet->at(l1CenJet).reco::LeafCandidate::clone()));
922  triggerObject = TriggerObject(leafCandidate);
923  }
924  triggerObject.setCollection(tagL1ExtraCenJet_);
926  if (!onlyStandAlone_)
927  triggerObjects->push_back(triggerObject);
928  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
929  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
930  if (handleL1ExtraCenJet->at(l1CenJet).bx() == 0)
931  cenJetKeys.push_back(triggerObjectsStandAlone->size() - 1);
932  }
933  l1ObjectTypeMap.insert(std::make_pair(CenJet, cenJetKeys));
934  } else
935  LogError("l1ExtraValid") << "l1extra::L1JetParticleCollection product with InputTag '"
936  << tagL1ExtraCenJet_.encode() << "' not in event";
937  }
938  if (!tagL1ExtraForJet_.label().empty()) {
939  Handle<l1extra::L1JetParticleCollection> handleL1ExtraForJet;
940  iEvent.getByLabel(tagL1ExtraForJet_, handleL1ExtraForJet);
941  if (handleL1ExtraForJet.isValid()) {
942  std::vector<unsigned> forJetKeys;
943  for (size_t l1ForJet = 0; l1ForJet < handleL1ExtraForJet->size(); ++l1ForJet) {
944  if (mainBxOnly_ && handleL1ExtraForJet->at(l1ForJet).bx() != 0)
945  continue;
946  TriggerObject triggerObject;
947  if (saveL1Refs_) {
948  const reco::CandidateBaseRef leafCandRef(l1extra::L1JetParticleRef(handleL1ExtraForJet, l1ForJet));
949  triggerObject = TriggerObject(leafCandRef);
950  } else {
951  const reco::LeafCandidate leafCandidate(*(handleL1ExtraForJet->at(l1ForJet).reco::LeafCandidate::clone()));
952  triggerObject = TriggerObject(leafCandidate);
953  }
954  triggerObject.setCollection(tagL1ExtraForJet_);
956  if (!onlyStandAlone_)
957  triggerObjects->push_back(triggerObject);
958  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
959  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
960  if (handleL1ExtraForJet->at(l1ForJet).bx() == 0)
961  forJetKeys.push_back(triggerObjectsStandAlone->size() - 1);
962  }
963  l1ObjectTypeMap.insert(std::make_pair(ForJet, forJetKeys));
964  } else
965  LogError("l1ExtraValid") << "l1extra::L1JetParticleCollection product with InputTag '"
966  << tagL1ExtraForJet_.encode() << "' not in event";
967  }
968  if (!tagL1ExtraTauJet_.label().empty()) {
969  Handle<l1extra::L1JetParticleCollection> handleL1ExtraTauJet;
970  iEvent.getByLabel(tagL1ExtraTauJet_, handleL1ExtraTauJet);
971  if (handleL1ExtraTauJet.isValid()) {
972  std::vector<unsigned> tauJetKeys;
973  for (size_t l1TauJet = 0; l1TauJet < handleL1ExtraTauJet->size(); ++l1TauJet) {
974  if (mainBxOnly_ && handleL1ExtraTauJet->at(l1TauJet).bx() != 0)
975  continue;
976  TriggerObject triggerObject;
977  if (saveL1Refs_) {
978  const reco::CandidateBaseRef leafCandRef(l1extra::L1JetParticleRef(handleL1ExtraTauJet, l1TauJet));
979  triggerObject = TriggerObject(leafCandRef);
980  } else {
981  const reco::LeafCandidate leafCandidate(*(handleL1ExtraTauJet->at(l1TauJet).reco::LeafCandidate::clone()));
982  triggerObject = TriggerObject(leafCandidate);
983  }
984  triggerObject.setCollection(tagL1ExtraTauJet_);
986  if (!onlyStandAlone_)
987  triggerObjects->push_back(triggerObject);
988  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
989  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
990  if (handleL1ExtraTauJet->at(l1TauJet).bx() == 0)
991  tauJetKeys.push_back(triggerObjectsStandAlone->size() - 1);
992  }
993  l1ObjectTypeMap.insert(std::make_pair(TauJet, tauJetKeys));
994  } else
995  LogError("l1ExtraValid") << "l1extra::L1JetParticleCollection product with InputTag '"
996  << tagL1ExtraTauJet_.encode() << "' not in event";
997  }
998  if (!tagL1ExtraETM_.label().empty()) {
1000  iEvent.getByLabel(tagL1ExtraETM_, handleL1ExtraETM);
1001  if (handleL1ExtraETM.isValid()) {
1002  std::vector<unsigned> etmKeys;
1003  for (size_t l1ETM = 0; l1ETM < handleL1ExtraETM->size(); ++l1ETM) {
1004  if (mainBxOnly_ && handleL1ExtraETM->at(l1ETM).bx() != 0)
1005  continue;
1006  TriggerObject triggerObject;
1007  if (saveL1Refs_) {
1008  const reco::CandidateBaseRef leafCandRef(l1extra::L1EtMissParticleRef(handleL1ExtraETM, l1ETM));
1009  triggerObject = TriggerObject(leafCandRef);
1010  } else {
1011  const reco::LeafCandidate leafCandidate(*(handleL1ExtraETM->at(l1ETM).reco::LeafCandidate::clone()));
1012  triggerObject = TriggerObject(leafCandidate);
1013  }
1014  triggerObject.setCollection(tagL1ExtraETM_);
1016  if (!onlyStandAlone_)
1017  triggerObjects->push_back(triggerObject);
1018  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
1019  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
1020  if (handleL1ExtraETM->at(l1ETM).bx() == 0)
1021  etmKeys.push_back(triggerObjectsStandAlone->size() - 1);
1022  }
1023  l1ObjectTypeMap.insert(std::make_pair(ETM, etmKeys));
1024  } else
1025  LogError("l1ExtraValid") << "l1extra::L1EtMissParticleCollection product with InputTag '"
1026  << tagL1ExtraETM_.encode() << "' not in event";
1027  }
1028  if (!tagL1ExtraHTM_.label().empty()) {
1030  iEvent.getByLabel(tagL1ExtraHTM_, handleL1ExtraHTM);
1031  if (handleL1ExtraHTM.isValid()) {
1032  std::vector<unsigned> htmKeys;
1033  for (size_t l1HTM = 0; l1HTM < handleL1ExtraHTM->size(); ++l1HTM) {
1034  if (mainBxOnly_ && handleL1ExtraHTM->at(l1HTM).bx() != 0)
1035  continue;
1036  TriggerObject triggerObject;
1037  if (saveL1Refs_) {
1038  const reco::CandidateBaseRef leafCandRef(l1extra::L1EtMissParticleRef(handleL1ExtraHTM, l1HTM));
1039  triggerObject = TriggerObject(leafCandRef);
1040  } else {
1041  const reco::LeafCandidate leafCandidate(*(handleL1ExtraHTM->at(l1HTM).reco::LeafCandidate::clone()));
1042  triggerObject = TriggerObject(leafCandidate);
1043  }
1044  triggerObject.setCollection(tagL1ExtraHTM_);
1046  if (!onlyStandAlone_)
1047  triggerObjects->push_back(triggerObject);
1048  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
1049  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
1050  if (handleL1ExtraHTM->at(l1HTM).bx() == 0)
1051  htmKeys.push_back(triggerObjectsStandAlone->size() - 1);
1052  }
1053  l1ObjectTypeMap.insert(std::make_pair(HTM, htmKeys));
1054  } else
1055  LogError("l1ExtraValid") << "l1extra::L1EtMissParticleCollection product with InputTag '"
1056  << tagL1ExtraHTM_.encode() << "' not in event";
1057  }
1058 
1059  // Put trigger objects to event
1060  if (!onlyStandAlone_)
1062 
1063  // L1 algorithms
1064  if (!onlyStandAlone_) {
1065  auto triggerAlgos = std::make_unique<TriggerAlgorithmCollection>();
1066  auto triggerConditions = std::make_unique<TriggerConditionCollection>();
1067  if (addL1Algos_) {
1068  // create trigger object types transalation map (yes, it's ugly!)
1069  std::map<L1GtObject, trigger::TriggerObjectType> mapObjectTypes;
1070  mapObjectTypes.insert(std::make_pair(Mu, trigger::TriggerL1Mu));
1071  mapObjectTypes.insert(std::make_pair(NoIsoEG, trigger::TriggerL1NoIsoEG));
1072  mapObjectTypes.insert(std::make_pair(IsoEG, trigger::TriggerL1IsoEG));
1073  mapObjectTypes.insert(std::make_pair(CenJet, trigger::TriggerL1CenJet));
1074  mapObjectTypes.insert(std::make_pair(ForJet, trigger::TriggerL1ForJet));
1075  mapObjectTypes.insert(std::make_pair(TauJet, trigger::TriggerL1TauJet));
1076  mapObjectTypes.insert(std::make_pair(ETM, trigger::TriggerL1ETM));
1077  mapObjectTypes.insert(std::make_pair(HTM, trigger::TriggerL1HTM));
1078  // get and cache L1 menu
1079  L1GtUtils const& l1GtUtils = hltPrescaleProvider_.l1GtUtils();
1080  auto handleL1GtTriggerMenu = iSetup.getHandle(handleL1GtTriggerMenuToken_);
1081  auto const& l1GtAlgorithms = handleL1GtTriggerMenu->gtAlgorithmMap();
1082  auto const& l1GtTechTriggers = handleL1GtTriggerMenu->gtTechnicalTriggerMap();
1083  auto const& l1GtConditionsVector = handleL1GtTriggerMenu->gtConditionMap();
1084  // cache conditions in one single condition map
1085  ConditionMap l1GtConditions;
1086  for (size_t iCv = 0; iCv < l1GtConditionsVector.size(); ++iCv) {
1087  l1GtConditions.insert(l1GtConditionsVector.at(iCv).begin(), l1GtConditionsVector.at(iCv).end());
1088  }
1089  triggerAlgos->reserve(l1GtAlgorithms.size() + l1GtTechTriggers.size());
1090  Handle<L1GlobalTriggerObjectMaps> handleL1GlobalTriggerObjectMaps;
1091  iEvent.getByToken(l1GlobalTriggerObjectMapsToken_, handleL1GlobalTriggerObjectMaps);
1092  if (!handleL1GlobalTriggerObjectMaps.isValid()) {
1093  LogError("l1ObjectMap") << "L1GlobalTriggerObjectMaps product with InputTag '"
1094  << tagL1GlobalTriggerObjectMaps_.encode() << "' not in event\n"
1095  << "No L1 objects and GTL results available for physics algorithms";
1096  }
1097  handleL1GlobalTriggerObjectMaps->consistencyCheck();
1098  if (firstInRun_) {
1099  l1PSet_ = (ParameterSet*)(pset::Registry::instance()->getMapped(
1100  handleL1GlobalTriggerObjectMaps->namesParameterSetID()));
1101  if (l1PSet_ == nullptr) {
1102  LogError("l1ObjectMap") << "ParameterSet registry not available\n"
1103  << "Skipping conditions for all L1 physics algorithm names in this run";
1104  }
1105  } else {
1106  if (l1PSet_ == nullptr) {
1107  LogInfo("l1ObjectMap") << "ParameterSet registry not available\n"
1108  << "Skipping conditions for all L1 physics algorithm names in this event";
1109  }
1110  }
1111  // physics algorithms
1112  for (CItAlgo iAlgo = l1GtAlgorithms.begin(); iAlgo != l1GtAlgorithms.end(); ++iAlgo) {
1113  const std::string& algoName(iAlgo->second.algoName());
1114  if (!(iAlgo->second.algoBitNumber() < int(L1GlobalTriggerReadoutSetup::NumberPhysTriggers))) {
1115  LogError("l1Algo") << "L1 physics algorithm '" << algoName << "' has bit number "
1116  << iAlgo->second.algoBitNumber()
1118  << "Skipping";
1119  continue;
1120  }
1122  int bit;
1123  if (!l1GtUtils.l1AlgoTechTrigBitNumber(algoName, category, bit)) {
1124  LogError("l1Algo") << "L1 physics algorithm '" << algoName << "' not found in the L1 menu\n"
1125  << "Skipping";
1126  continue;
1127  }
1129  LogError("l1Algo") << "L1 physics algorithm '" << algoName
1130  << "' does not have category 'AlgorithmTrigger' from 'L1GtUtils'\n"
1131  << "Skipping";
1132  continue;
1133  }
1134  bool decisionBeforeMask;
1135  bool decisionAfterMask;
1136  int prescale;
1137  int mask;
1138  int error(l1GtUtils.l1Results(iEvent, algoName, decisionBeforeMask, decisionAfterMask, prescale, mask));
1139  if (error) {
1140  LogError("l1Algo") << "L1 physics algorithm '" << algoName << "' decision has error code " << error
1141  << " from 'L1GtUtils'\n"
1142  << "Skipping";
1143  continue;
1144  }
1145  TriggerAlgorithm triggerAlgo(algoName,
1146  iAlgo->second.algoAlias(),
1148  (unsigned)bit,
1149  (unsigned)prescale,
1150  (bool)mask,
1151  decisionBeforeMask,
1152  decisionAfterMask);
1153  triggerAlgo.setLogicalExpression(iAlgo->second.algoLogicalExpression());
1154  // GTL result and used conditions in physics algorithm
1155  if (!handleL1GlobalTriggerObjectMaps.isValid()) {
1156  triggerAlgos->push_back(triggerAlgo);
1157  continue; // LogWarning already earlier (before loop)
1158  }
1159  if (!handleL1GlobalTriggerObjectMaps->algorithmExists(bit)) {
1160  LogError("l1ObjectMap") << "L1 physics algorithm '" << algoName
1161  << "' is missing in L1GlobalTriggerObjectMaps\n"
1162  << "Skipping conditions and GTL result";
1163  triggerAlgos->push_back(triggerAlgo);
1164  continue;
1165  }
1166  bool algorithmResult = handleL1GlobalTriggerObjectMaps->algorithmResult(bit);
1167  // if ( ( algorithmResult != decisionBeforeMask ) && ( decisionBeforeMask == true || prescale == 1 ) ) {
1168  if ((algorithmResult != decisionBeforeMask) &&
1169  (decisionBeforeMask == true)) { // FIXME: understand the difference for un-prescaled algos 118, 119, 123
1170  LogInfo("l1ObjectMap") << "L1 physics algorithm '" << algoName << "' with different decisions in\n"
1171  << "L1GlobalTriggerObjectMaps (GTL result) : " << algorithmResult << "\n"
1172  << "L1GlobalTriggerReadoutRecord (decision before mask): " << decisionBeforeMask;
1173  }
1174  triggerAlgo.setGtlResult(algorithmResult);
1175  // conditions in algorithm
1177  handleL1GlobalTriggerObjectMaps->getConditionsInAlgorithm(bit);
1178  if (l1PSet_ == nullptr) {
1179  triggerAlgos->push_back(triggerAlgo);
1180  continue;
1181  }
1182  if (!l1PSet_->exists(algoName)) {
1183  if (firstInRun_) {
1184  LogError("l1ObjectMap") << "L1 physics algorithm name '" << algoName
1185  << "' not available in ParameterSet registry\n"
1186  << "Skipping conditions for this algorithm in this run";
1187  } else {
1188  LogInfo("l1ObjectMap") << "L1 physics algorithm name '" << algoName
1189  << "' not available in ParameterSet registry\n"
1190  << "Skipping conditions for this algorithm in this event";
1191  }
1192  triggerAlgos->push_back(triggerAlgo);
1193  continue;
1194  }
1195  std::vector<std::string> conditionNames(l1PSet_->getParameter<std::vector<std::string> >(algoName));
1196 
1197  for (unsigned iT = 0; iT < conditionNames.size(); ++iT) {
1198  size_t key(triggerConditions->size());
1199  for (size_t iC = 0; iC < triggerConditions->size(); ++iC) {
1200  if (conditionNames.at(iT) == triggerConditions->at(iC).name()) {
1201  key = iC;
1202  break;
1203  }
1204  }
1205  if (key == triggerConditions->size()) {
1206  if (iT >= conditions.nConditions()) {
1207  LogError("l1CondMap") << "More condition names from ParameterSet registry than the "
1208  << conditions.nConditions() << " conditions in L1GlobalTriggerObjectMaps\n"
1209  << "Skipping condition " << conditionNames.at(iT) << " in algorithm " << algoName;
1210  break;
1211  }
1212  TriggerCondition triggerCond(conditionNames[iT], conditions.getConditionResult(iT));
1213  if (l1GtConditions.find(triggerCond.name()) != l1GtConditions.end()) {
1214  triggerCond.setCategory(l1GtConditions[triggerCond.name()]->condCategory());
1215  triggerCond.setType(l1GtConditions[triggerCond.name()]->condType());
1216  const std::vector<L1GtObject> l1ObjectTypes(l1GtConditions[triggerCond.name()]->objectType());
1217  for (size_t iType = 0; iType < l1ObjectTypes.size(); ++iType) {
1218  triggerCond.addTriggerObjectType(mapObjectTypes[l1ObjectTypes.at(iType)]);
1219  }
1220  // objects in condition
1222  handleL1GlobalTriggerObjectMaps->getCombinationsInCondition(bit, iT);
1223  for (size_t iVV = 0; iVV < combinations.nCombinations(); ++iVV) {
1224  for (size_t iV = 0; iV < combinations.nObjectsPerCombination(); ++iV) {
1225  unsigned objectIndex = combinations.getObjectIndex(iVV, iV);
1226  if (iV >= l1ObjectTypes.size()) {
1227  LogError("l1CondMap") << "Index " << iV << " in combinations vector overshoots size "
1228  << l1ObjectTypes.size() << " of types vector in conditions map\n"
1229  << "Skipping object key in condition " << triggerCond.name();
1230  } else if (l1ObjectTypeMap.find(l1ObjectTypes.at(iV)) != l1ObjectTypeMap.end()) {
1231  if (objectIndex >= l1ObjectTypeMap[l1ObjectTypes.at(iV)].size()) {
1232  LogError("l1CondMap")
1233  << "Index " << objectIndex << " in combination overshoots number "
1234  << l1ObjectTypeMap[l1ObjectTypes.at(iV)].size() << "of according trigger objects\n"
1235  << "Skipping object key in condition " << triggerCond.name();
1236  }
1237  const unsigned objectKey(l1ObjectTypeMap[l1ObjectTypes.at(iV)].at(objectIndex));
1238  triggerCond.addObjectKey(objectKey);
1239  // add current condition and algorithm also to the according stand-alone trigger object
1240  triggerObjectsStandAlone->at(objectKey).addAlgorithmName(
1241  triggerAlgo.name(), (triggerAlgo.decision() && triggerCond.wasAccept()));
1242  triggerObjectsStandAlone->at(objectKey).addConditionName(triggerCond.name());
1243  }
1244  }
1245  }
1246  } else {
1247  LogWarning("l1CondMap") << "L1 conditions '" << triggerCond.name() << "' not found in the L1 menu\n"
1248  << "Remains incomplete";
1249  }
1250  triggerConditions->push_back(triggerCond);
1251  }
1252  triggerAlgo.addConditionKey(key);
1253  }
1254  triggerAlgos->push_back(triggerAlgo);
1255  }
1256  // technical triggers
1257  for (CItAlgo iAlgo = l1GtTechTriggers.begin(); iAlgo != l1GtTechTriggers.end(); ++iAlgo) {
1258  const std::string& algoName(iAlgo->second.algoName());
1259  if (!(iAlgo->second.algoBitNumber() < int(L1GlobalTriggerReadoutSetup::NumberTechnicalTriggers))) {
1260  LogError("l1Algo") << "L1 technical trigger '" << algoName << "' has bit number "
1261  << iAlgo->second.algoBitNumber()
1263  << "Skipping";
1264  continue;
1265  }
1267  int bit;
1268  if (!l1GtUtils.l1AlgoTechTrigBitNumber(algoName, category, bit)) {
1269  LogError("l1Algo") << "L1 technical trigger '" << algoName << "' not found in the L1 menu\n"
1270  << "Skipping";
1271  continue;
1272  }
1274  LogError("l1Algo") << "L1 technical trigger '" << algoName
1275  << "' does not have category 'TechnicalTrigger' from 'L1GtUtils'\n"
1276  << "Skipping";
1277  continue;
1278  }
1279  bool decisionBeforeMask;
1280  bool decisionAfterMask;
1281  int prescale;
1282  int mask;
1283  int error(l1GtUtils.l1Results(iEvent, algoName, decisionBeforeMask, decisionAfterMask, prescale, mask));
1284  if (error) {
1285  LogError("l1Algo") << "L1 technical trigger '" << algoName << "' decision has error code " << error
1286  << " from 'L1GtUtils'\n"
1287  << "Skipping";
1288  continue;
1289  }
1290  TriggerAlgorithm triggerAlgo(algoName,
1291  iAlgo->second.algoAlias(),
1293  (unsigned)bit,
1294  (unsigned)prescale,
1295  (bool)mask,
1296  decisionBeforeMask,
1297  decisionAfterMask);
1298  triggerAlgo.setLogicalExpression(iAlgo->second.algoLogicalExpression());
1299  triggerAlgos->push_back(triggerAlgo);
1300  }
1301  }
1302 
1303  // Put L1 algorithms and conditions to event
1304  iEvent.put(std::move(triggerAlgos));
1306  }
1307 
1309  iEvent.processHistory().getConfigurationForProcess(nameProcess_, config);
1310 
1311  const edm::TriggerNames& names = iEvent.triggerNames(*handleTriggerResults);
1312  for (pat::TriggerObjectStandAlone& obj : *triggerObjectsStandAlone) {
1313  obj.setPSetID(config.parameterSetID());
1314  if (packPathNames_)
1315  obj.packPathNames(names);
1316  if (packLabels_)
1317  obj.packFilterLabels(iEvent, *handleTriggerResults);
1318  }
1319 
1320  // Put (finally) stand-alone trigger objects to event
1321  iEvent.put(std::move(triggerObjectsStandAlone));
1322 
1323  firstInRun_ = false;
1324 }
1325 
1327  clear();
1328  const std::vector<std::string>& pathNames = hltConfig.triggerNames();
1329  unsigned int sizePaths = pathNames.size();
1330  for (unsigned int indexPath = 0; indexPath < sizePaths; ++indexPath) {
1331  const std::string& namePath = pathNames[indexPath];
1332 
1333  const std::vector<std::string>& nameModules = hltConfig.moduleLabels(indexPath);
1334  unsigned int sizeModulesPath = nameModules.size();
1335  bool lastFilter = true;
1336  unsigned int iM = sizeModulesPath;
1337  while (iM > 0) {
1338  const std::string& nameFilter = nameModules[--iM];
1339  if (hltConfig.moduleEDMType(nameFilter) != "EDFilter")
1340  continue;
1341  if (hltConfig.moduleType(nameFilter) == "HLTBool")
1342  continue;
1343  bool saveTags = hltConfig.saveTags(nameFilter);
1344  insert(nameFilter, namePath, indexPath, lastFilter, saveTags);
1345  if (saveTags)
1346  lastFilter = false; // FIXME: rather always?
1347  }
1348  }
1349 }
1350 
collection_type::const_iterator const_iterator
unsigned int index(const unsigned int i) const
Get index (slot position) of module giving the decision of the ith path.
bool accept() const
Has at least one path accepted the event?
const Keys & filterKeys(trigger::size_type index) const
Definition: TriggerEvent.h:118
std::vector< L1Seed > L1SeedCollection
Collection of L1Seed.
Definition: TriggerPath.h:35
const std::vector< std::string > & labels() const
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Analysis-level L1 trigger algorithm class.
void beginLuminosityBlock(const edm::LuminosityBlock &iLuminosityBlock, const edm::EventSetup &iSetup) override
bool error() const
Has any path encountered an error (exception)
bool algorithmResult(int algorithmBitNumber) const
Returns whether an algorithm trigger passed or failed.
Definition: L1GtObject.h:38
edm::EDGetTokenT< L1GlobalTriggerObjectMaps > l1GlobalTriggerObjectMapsToken_
PATTriggerProducer(const edm::ParameterSet &iConfig)
static PFTauRenderPlugin instance
enum start value shifted to 81 so as to avoid clashes with PDG codes
std::string encode() const
Definition: InputTag.cc:159
std::map< std::string, L1GtCondition * > ConditionMap
map containing the conditions
std::string const & instance() const
Definition: InputTag.h:37
Definition: L1GtObject.h:35
static const unsigned int NumberTechnicalTriggers
bool exists(std::string const &parameterName) const
checks if a parameter exists
trigger::size_type sizeFilters() const
Definition: TriggerEvent.h:146
dictionary config
Read in AllInOne config in JSON format.
Definition: DMR_cfg.py:21
The single EDProduct containing the HLT Prescale Table.
void setGtlResult(bool gtlResult)
Set L1 algorithm GTL result.
const bool l1AlgoTechTrigBitNumber(const std::string &nameAlgoTechTrig, TriggerCategory &trigCategory, int &bitNumber) const
Definition: L1GtUtils.cc:371
void insert(const std::string &filter, const std::string &path, unsigned int pathIndex, bool lastFilter, bool l3Filter)
std::pair< std::vector< std::pair< std::string, TL1 > >, THLT > prescaleValuesInDetail(const edm::Event &iEvent, const edm::EventSetup &iSetup, const std::string &trigger)
void beginRun(const edm::Run &iRun, const edm::EventSetup &iSetup) override
PathAndFlags(const std::string &name, unsigned int index, bool last, bool l3)
const std::string & collectionTagEncoded(trigger::size_type index) const
Definition: TriggerEvent.h:106
HLTConfigProvider const & hltConfigProvider() const
Definition: config.py:1
std::string const & label() const
Definition: InputTag.h:36
Log< level::Error, false > LogError
assert(be >=bs)
edm::GetterOfProducts< trigger::HLTPrescaleTable > hltPrescaleTableLumiGetter_
edm::GetterOfProducts< l1extra::L1JetParticleCollection > l1ExtraForJetGetter_
uint16_t size_type
const edm::InputTag filterTag(trigger::size_type index) const
Definition: TriggerEvent.h:108
const std::string names[nVars_]
void addFilterLabel(const std::string &filterLabel)
Adds a new HLT filter label.
constexpr uint32_t mask
Definition: gpuClustering.h:26
bool wasrun() const
Was at least one path run?
Definition: HeavyIon.h:7
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
Single trigger physics object (e.g., an isolated muon)
Definition: TriggerObject.h:21
const int l1Results(const edm::Event &iEvent, const std::string &nameAlgoTechTrig, bool &decisionBeforeMask, bool &decisionAfterMask, int &prescaleFactor, int &triggerMask) const
Definition: L1GtUtils.cc:666
const std::vector< PathAndFlags > & operator[](const std::string &filter) const
void addPathName(const std::string &pathName, bool pathLastFilterAccepted=true, bool pathL3FilterAccepted=true)
Adds a new HLT path name.
Analysis-level HLTrigger filter class.
Definition: TriggerFilter.h:33
std::vector< std::string > exludeCollections_
edm::GetterOfProducts< l1extra::L1EmParticleCollection > l1ExtraNoIsoEGGetter_
edm::GetterOfProducts< trigger::HLTPrescaleTable > hltPrescaleTableEventGetter_
Produces the full or stand-alone PAT trigger information collections.
std::map< std::string, std::vector< PathAndFlags > > map_
int iEvent
Definition: GenABIO.cc:224
ConditionsInAlgorithm getConditionsInAlgorithm(int algorithmBitNumber) const
unsigned int set() const
low-level const accessors for data members
std::string filterLabel(trigger::size_type index) const
Definition: TriggerEvent.h:112
void setCollection(const std::string &collName)
Methods.
Definition: TriggerObject.h:79
Analysis-level L1 trigger condition class.
static const unsigned int NumberPhysTriggersExtended
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > l1ExtraHTMGetter_
const std::map< std::string, std::vector< unsigned int > > & table() const
trigger::HLTPrescaleTable hltPrescaleTableLumi_
trigger::size_type sizeCollections() const
other
Definition: TriggerEvent.h:144
bool hasCollection(const std::string &collName) const override
Checks, if a certain label of original collection is assigned (method overrides)
edm::GetterOfProducts< l1extra::L1JetParticleCollection > l1ExtraTauJetGetter_
unsigned char getObjectIndex(unsigned combination, unsigned object) const
edm::GetterOfProducts< l1extra::L1JetParticleCollection > l1ExtraCenJetGetter_
const TriggerObjectCollection & getObjects() const
Definition: TriggerEvent.h:101
bool getByLabel(std::string const &label, Handle< PROD > &result) const
Definition: Run.h:283
edm::GetterOfProducts< l1extra::L1EtMissParticleCollection > l1ExtraETMGetter_
int id() const
getters
Definition: TriggerObject.h:51
trigger::size_type sizeObjects() const
Definition: TriggerEvent.h:145
static const unsigned int NumberPhysTriggers
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ProcessHistory const & processHistory() const
Definition: Run.cc:115
edm::GetterOfProducts< l1extra::L1EmParticleCollection > l1ExtraIsoEGGetter_
void setLogicalExpression(const std::string &expression)
Set L1 algorithm logical expression.
edm::GetterOfProducts< trigger::TriggerEvent > triggerEventGetter_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
int prescaleSet(const edm::Event &iEvent, const edm::EventSetup &iSetup)
edm::GetterOfProducts< l1extra::L1MuonParticleCollection > l1ExtraMuGetter_
edm::InputTag tagL1GlobalTriggerObjectMaps_
Log< level::Info, false > LogInfo
ModuleLabelToPathAndFlags moduleLabelToPathAndFlags_
const Vids & filterIds(trigger::size_type index) const
Definition: TriggerEvent.h:117
bool getByLabel(std::string const &label, Handle< PROD > &result) const
void setCategory(L1GtConditionCategory category)
Set the condition category.
trigger::size_type filterIndex(const edm::InputTag &filterTag) const
find index of filter in data-member vector from filter tag
Definition: TriggerEvent.h:132
const edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > handleL1GtTriggerMenuToken_
Definition: L1GtObject.h:29
std::vector< size_type > Keys
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
const std::string & name() const
Get L1 algorithm name.
bool isValid() const
Definition: HandleBase.h:70
void addConditionKey(unsigned conditionKey)
Add a new trigger condition collection index.
edm::ParameterSetID const & namesParameterSetID() const
HLT enums.
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Particle.h:23
bool algorithmExists(int algorithmBitNumber) const
Returns true if there is an entry for this algorithm bit number.
trigger::HLTPrescaleTable hltPrescaleTableRun_
L1GtUtils const & l1GtUtils() const
Log< level::Warning, false > LogWarning
std::string const & process() const
Definition: InputTag.h:40
void addTriggerObjectType(trigger::TriggerObjectType triggerObjectType)
Add a new trigger object type identifier.
Definition: TriggerObject.h:82
static std::string const triggerPaths
Definition: EdmProvDump.cc:48
CombinationsInCondition getCombinationsInCondition(int algorithmBitNumber, unsigned conditionNumber) const
const Keys & collectionKeys() const
Definition: TriggerEvent.h:100
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
std::vector< int > Vids
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45
edm::GetterOfProducts< edm::TriggerResults > triggerResultsGetter_
HLTPrescaleProvider hltPrescaleProvider_
edm::GetterOfProducts< trigger::HLTPrescaleTable > hltPrescaleTableRunGetter_
Analysis-level trigger object class (stand-alone)
edm::ParameterSet * l1PSet_
#define LogDebug(id)
triggerConditions
Definition: JetHT_cfg.py:258