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(), hltConfig.prescaleTable());
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(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  //std::cout << "Run " << iEvent.id().run() << ", LS " << iEvent.id().luminosityBlock() << ": pset " << set << std::endl;
790  for (unsigned int i = 0, n = names.size(); i < n; ++i) {
791  auto pvdet = hltPrescaleProvider_.prescaleValuesInDetail(iEvent, iSetup, names.triggerName(i));
792  //int hltprescale = hltConfig_.prescaleValue(set, names.triggerName(i));
793  if (pvdet.first.empty()) {
794  packedPrescalesL1max->addPrescaledTrigger(i, 1);
795  packedPrescalesL1min->addPrescaledTrigger(i, 1);
796  } else {
797  int pmin = -1, pmax = -1;
798  for (const auto& p : pvdet.first) {
799  pmax = std::max(pmax, p.second);
800  if (p.second > 0 && (pmin == -1 || pmin > p.second))
801  pmin = p.second;
802  }
803  packedPrescalesL1max->addPrescaledTrigger(i, pmax);
804  packedPrescalesL1min->addPrescaledTrigger(i, pmin);
805  //std::cout << "\tTrigger " << names.triggerName(i) << ", L1 ps " << pmin << "-" << pmax << ", HLT ps " << hltprescale << std::endl;
806  }
807  packedPrescales->addPrescaledTrigger(i, pvdet.second);
808  //assert( hltprescale == pvdet.second );
809  }
810  iEvent.put(std::move(packedPrescales));
811  iEvent.put(std::move(packedPrescalesL1max), "l1max");
812  iEvent.put(std::move(packedPrescalesL1min), "l1min");
813  }
814 
815  } // if ( goodHlt )
816 
817  // L1 objects
818  // (needs to be done after HLT objects, since their x-links with filters rely on their collection keys)
819 
820  // map for assignments of objects to conditions
821  std::map<L1GtObject, std::vector<unsigned> > l1ObjectTypeMap;
822  if (!tagL1ExtraMu_.label().empty()) {
824  iEvent.getByLabel(tagL1ExtraMu_, handleL1ExtraMu);
825  if (handleL1ExtraMu.isValid()) {
826  std::vector<unsigned> muKeys;
827  for (size_t l1Mu = 0; l1Mu < handleL1ExtraMu->size(); ++l1Mu) {
828  if (mainBxOnly_ && handleL1ExtraMu->at(l1Mu).bx() != 0)
829  continue;
830  TriggerObject triggerObject;
831  if (saveL1Refs_) {
832  const reco::CandidateBaseRef leafCandRef(l1extra::L1MuonParticleRef(handleL1ExtraMu, l1Mu));
833  triggerObject = TriggerObject(leafCandRef);
834  } else {
835  const reco::LeafCandidate leafCandidate(*(handleL1ExtraMu->at(l1Mu).reco::LeafCandidate::clone()));
836  triggerObject = TriggerObject(leafCandidate);
837  }
838  triggerObject.setCollection(tagL1ExtraMu_);
840  if (!onlyStandAlone_)
841  triggerObjects->push_back(triggerObject);
842  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
843  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
844  if (handleL1ExtraMu->at(l1Mu).bx() == 0)
845  muKeys.push_back(triggerObjectsStandAlone->size() - 1);
846  }
847  l1ObjectTypeMap.insert(std::make_pair(Mu, muKeys));
848  } else
849  LogError("l1ExtraValid") << "l1extra::L1MuonParticleCollection product with InputTag '" << tagL1ExtraMu_.encode()
850  << "' not in event";
851  }
852  if (!tagL1ExtraNoIsoEG_.label().empty()) {
853  Handle<l1extra::L1EmParticleCollection> handleL1ExtraNoIsoEG;
854  iEvent.getByLabel(tagL1ExtraNoIsoEG_, handleL1ExtraNoIsoEG);
855  if (handleL1ExtraNoIsoEG.isValid()) {
856  std::vector<unsigned> noIsoEGKeys;
857  for (size_t l1NoIsoEG = 0; l1NoIsoEG < handleL1ExtraNoIsoEG->size(); ++l1NoIsoEG) {
858  if (mainBxOnly_ && handleL1ExtraNoIsoEG->at(l1NoIsoEG).bx() != 0)
859  continue;
860  TriggerObject triggerObject;
861  if (saveL1Refs_) {
862  const reco::CandidateBaseRef leafCandRef(l1extra::L1EmParticleRef(handleL1ExtraNoIsoEG, l1NoIsoEG));
863  triggerObject = TriggerObject(leafCandRef);
864  } else {
865  const reco::LeafCandidate leafCandidate(*(handleL1ExtraNoIsoEG->at(l1NoIsoEG).reco::LeafCandidate::clone()));
866  triggerObject = TriggerObject(leafCandidate);
867  }
868  triggerObject.setCollection(tagL1ExtraNoIsoEG_);
870  if (!onlyStandAlone_)
871  triggerObjects->push_back(triggerObject);
872  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
873  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
874  if (handleL1ExtraNoIsoEG->at(l1NoIsoEG).bx() == 0)
875  noIsoEGKeys.push_back(triggerObjectsStandAlone->size() - 1);
876  }
877  l1ObjectTypeMap.insert(std::make_pair(NoIsoEG, noIsoEGKeys));
878  } else
879  LogError("l1ExtraValid") << "l1extra::L1EmParticleCollection product with InputTag '"
880  << tagL1ExtraNoIsoEG_.encode() << "' not in event";
881  }
882  if (!tagL1ExtraIsoEG_.label().empty()) {
883  Handle<l1extra::L1EmParticleCollection> handleL1ExtraIsoEG;
884  iEvent.getByLabel(tagL1ExtraIsoEG_, handleL1ExtraIsoEG);
885  if (handleL1ExtraIsoEG.isValid()) {
886  std::vector<unsigned> isoEGKeys;
887  for (size_t l1IsoEG = 0; l1IsoEG < handleL1ExtraIsoEG->size(); ++l1IsoEG) {
888  if (mainBxOnly_ && handleL1ExtraIsoEG->at(l1IsoEG).bx() != 0)
889  continue;
890  TriggerObject triggerObject;
891  if (saveL1Refs_) {
892  const reco::CandidateBaseRef leafCandRef(l1extra::L1EmParticleRef(handleL1ExtraIsoEG, l1IsoEG));
893  triggerObject = TriggerObject(leafCandRef);
894  } else {
895  const reco::LeafCandidate leafCandidate(*(handleL1ExtraIsoEG->at(l1IsoEG).reco::LeafCandidate::clone()));
896  triggerObject = TriggerObject(leafCandidate);
897  }
898  triggerObject.setCollection(tagL1ExtraIsoEG_);
900  if (!onlyStandAlone_)
901  triggerObjects->push_back(triggerObject);
902  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
903  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
904  if (handleL1ExtraIsoEG->at(l1IsoEG).bx() == 0)
905  isoEGKeys.push_back(triggerObjectsStandAlone->size() - 1);
906  }
907  l1ObjectTypeMap.insert(std::make_pair(IsoEG, isoEGKeys));
908  } else
909  LogError("l1ExtraValid") << "l1extra::L1EmParticleCollection product with InputTag '" << tagL1ExtraIsoEG_.encode()
910  << "' not in event";
911  }
912  if (!tagL1ExtraCenJet_.label().empty()) {
913  Handle<l1extra::L1JetParticleCollection> handleL1ExtraCenJet;
914  iEvent.getByLabel(tagL1ExtraCenJet_, handleL1ExtraCenJet);
915  if (handleL1ExtraCenJet.isValid()) {
916  std::vector<unsigned> cenJetKeys;
917  for (size_t l1CenJet = 0; l1CenJet < handleL1ExtraCenJet->size(); ++l1CenJet) {
918  if (mainBxOnly_ && handleL1ExtraCenJet->at(l1CenJet).bx() != 0)
919  continue;
920  TriggerObject triggerObject;
921  if (saveL1Refs_) {
922  const reco::CandidateBaseRef leafCandRef(l1extra::L1JetParticleRef(handleL1ExtraCenJet, l1CenJet));
923  triggerObject = TriggerObject(leafCandRef);
924  } else {
925  const reco::LeafCandidate leafCandidate(*(handleL1ExtraCenJet->at(l1CenJet).reco::LeafCandidate::clone()));
926  triggerObject = TriggerObject(leafCandidate);
927  }
928  triggerObject.setCollection(tagL1ExtraCenJet_);
930  if (!onlyStandAlone_)
931  triggerObjects->push_back(triggerObject);
932  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
933  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
934  if (handleL1ExtraCenJet->at(l1CenJet).bx() == 0)
935  cenJetKeys.push_back(triggerObjectsStandAlone->size() - 1);
936  }
937  l1ObjectTypeMap.insert(std::make_pair(CenJet, cenJetKeys));
938  } else
939  LogError("l1ExtraValid") << "l1extra::L1JetParticleCollection product with InputTag '"
940  << tagL1ExtraCenJet_.encode() << "' not in event";
941  }
942  if (!tagL1ExtraForJet_.label().empty()) {
943  Handle<l1extra::L1JetParticleCollection> handleL1ExtraForJet;
944  iEvent.getByLabel(tagL1ExtraForJet_, handleL1ExtraForJet);
945  if (handleL1ExtraForJet.isValid()) {
946  std::vector<unsigned> forJetKeys;
947  for (size_t l1ForJet = 0; l1ForJet < handleL1ExtraForJet->size(); ++l1ForJet) {
948  if (mainBxOnly_ && handleL1ExtraForJet->at(l1ForJet).bx() != 0)
949  continue;
950  TriggerObject triggerObject;
951  if (saveL1Refs_) {
952  const reco::CandidateBaseRef leafCandRef(l1extra::L1JetParticleRef(handleL1ExtraForJet, l1ForJet));
953  triggerObject = TriggerObject(leafCandRef);
954  } else {
955  const reco::LeafCandidate leafCandidate(*(handleL1ExtraForJet->at(l1ForJet).reco::LeafCandidate::clone()));
956  triggerObject = TriggerObject(leafCandidate);
957  }
958  triggerObject.setCollection(tagL1ExtraForJet_);
960  if (!onlyStandAlone_)
961  triggerObjects->push_back(triggerObject);
962  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
963  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
964  if (handleL1ExtraForJet->at(l1ForJet).bx() == 0)
965  forJetKeys.push_back(triggerObjectsStandAlone->size() - 1);
966  }
967  l1ObjectTypeMap.insert(std::make_pair(ForJet, forJetKeys));
968  } else
969  LogError("l1ExtraValid") << "l1extra::L1JetParticleCollection product with InputTag '"
970  << tagL1ExtraForJet_.encode() << "' not in event";
971  }
972  if (!tagL1ExtraTauJet_.label().empty()) {
973  Handle<l1extra::L1JetParticleCollection> handleL1ExtraTauJet;
974  iEvent.getByLabel(tagL1ExtraTauJet_, handleL1ExtraTauJet);
975  if (handleL1ExtraTauJet.isValid()) {
976  std::vector<unsigned> tauJetKeys;
977  for (size_t l1TauJet = 0; l1TauJet < handleL1ExtraTauJet->size(); ++l1TauJet) {
978  if (mainBxOnly_ && handleL1ExtraTauJet->at(l1TauJet).bx() != 0)
979  continue;
980  TriggerObject triggerObject;
981  if (saveL1Refs_) {
982  const reco::CandidateBaseRef leafCandRef(l1extra::L1JetParticleRef(handleL1ExtraTauJet, l1TauJet));
983  triggerObject = TriggerObject(leafCandRef);
984  } else {
985  const reco::LeafCandidate leafCandidate(*(handleL1ExtraTauJet->at(l1TauJet).reco::LeafCandidate::clone()));
986  triggerObject = TriggerObject(leafCandidate);
987  }
988  triggerObject.setCollection(tagL1ExtraTauJet_);
990  if (!onlyStandAlone_)
991  triggerObjects->push_back(triggerObject);
992  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
993  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
994  if (handleL1ExtraTauJet->at(l1TauJet).bx() == 0)
995  tauJetKeys.push_back(triggerObjectsStandAlone->size() - 1);
996  }
997  l1ObjectTypeMap.insert(std::make_pair(TauJet, tauJetKeys));
998  } else
999  LogError("l1ExtraValid") << "l1extra::L1JetParticleCollection product with InputTag '"
1000  << tagL1ExtraTauJet_.encode() << "' not in event";
1001  }
1002  if (!tagL1ExtraETM_.label().empty()) {
1004  iEvent.getByLabel(tagL1ExtraETM_, handleL1ExtraETM);
1005  if (handleL1ExtraETM.isValid()) {
1006  std::vector<unsigned> etmKeys;
1007  for (size_t l1ETM = 0; l1ETM < handleL1ExtraETM->size(); ++l1ETM) {
1008  if (mainBxOnly_ && handleL1ExtraETM->at(l1ETM).bx() != 0)
1009  continue;
1010  TriggerObject triggerObject;
1011  if (saveL1Refs_) {
1012  const reco::CandidateBaseRef leafCandRef(l1extra::L1EtMissParticleRef(handleL1ExtraETM, l1ETM));
1013  triggerObject = TriggerObject(leafCandRef);
1014  } else {
1015  const reco::LeafCandidate leafCandidate(*(handleL1ExtraETM->at(l1ETM).reco::LeafCandidate::clone()));
1016  triggerObject = TriggerObject(leafCandidate);
1017  }
1018  triggerObject.setCollection(tagL1ExtraETM_);
1020  if (!onlyStandAlone_)
1021  triggerObjects->push_back(triggerObject);
1022  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
1023  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
1024  if (handleL1ExtraETM->at(l1ETM).bx() == 0)
1025  etmKeys.push_back(triggerObjectsStandAlone->size() - 1);
1026  }
1027  l1ObjectTypeMap.insert(std::make_pair(ETM, etmKeys));
1028  } else
1029  LogError("l1ExtraValid") << "l1extra::L1EtMissParticleCollection product with InputTag '"
1030  << tagL1ExtraETM_.encode() << "' not in event";
1031  }
1032  if (!tagL1ExtraHTM_.label().empty()) {
1034  iEvent.getByLabel(tagL1ExtraHTM_, handleL1ExtraHTM);
1035  if (handleL1ExtraHTM.isValid()) {
1036  std::vector<unsigned> htmKeys;
1037  for (size_t l1HTM = 0; l1HTM < handleL1ExtraHTM->size(); ++l1HTM) {
1038  if (mainBxOnly_ && handleL1ExtraHTM->at(l1HTM).bx() != 0)
1039  continue;
1040  TriggerObject triggerObject;
1041  if (saveL1Refs_) {
1042  const reco::CandidateBaseRef leafCandRef(l1extra::L1EtMissParticleRef(handleL1ExtraHTM, l1HTM));
1043  triggerObject = TriggerObject(leafCandRef);
1044  } else {
1045  const reco::LeafCandidate leafCandidate(*(handleL1ExtraHTM->at(l1HTM).reco::LeafCandidate::clone()));
1046  triggerObject = TriggerObject(leafCandidate);
1047  }
1048  triggerObject.setCollection(tagL1ExtraHTM_);
1050  if (!onlyStandAlone_)
1051  triggerObjects->push_back(triggerObject);
1052  TriggerObjectStandAlone triggerObjectStandAlone(triggerObject);
1053  triggerObjectsStandAlone->push_back(triggerObjectStandAlone);
1054  if (handleL1ExtraHTM->at(l1HTM).bx() == 0)
1055  htmKeys.push_back(triggerObjectsStandAlone->size() - 1);
1056  }
1057  l1ObjectTypeMap.insert(std::make_pair(HTM, htmKeys));
1058  } else
1059  LogError("l1ExtraValid") << "l1extra::L1EtMissParticleCollection product with InputTag '"
1060  << tagL1ExtraHTM_.encode() << "' not in event";
1061  }
1062 
1063  // Put trigger objects to event
1064  if (!onlyStandAlone_)
1066 
1067  // L1 algorithms
1068  if (!onlyStandAlone_) {
1069  auto triggerAlgos = std::make_unique<TriggerAlgorithmCollection>();
1070  auto triggerConditions = std::make_unique<TriggerConditionCollection>();
1071  if (addL1Algos_) {
1072  // create trigger object types transalation map (yes, it's ugly!)
1073  std::map<L1GtObject, trigger::TriggerObjectType> mapObjectTypes;
1074  mapObjectTypes.insert(std::make_pair(Mu, trigger::TriggerL1Mu));
1075  mapObjectTypes.insert(std::make_pair(NoIsoEG, trigger::TriggerL1NoIsoEG));
1076  mapObjectTypes.insert(std::make_pair(IsoEG, trigger::TriggerL1IsoEG));
1077  mapObjectTypes.insert(std::make_pair(CenJet, trigger::TriggerL1CenJet));
1078  mapObjectTypes.insert(std::make_pair(ForJet, trigger::TriggerL1ForJet));
1079  mapObjectTypes.insert(std::make_pair(TauJet, trigger::TriggerL1TauJet));
1080  mapObjectTypes.insert(std::make_pair(ETM, trigger::TriggerL1ETM));
1081  mapObjectTypes.insert(std::make_pair(HTM, trigger::TriggerL1HTM));
1082  // get and cache L1 menu
1083  L1GtUtils const& l1GtUtils = hltPrescaleProvider_.l1GtUtils();
1084  auto handleL1GtTriggerMenu = iSetup.getHandle(handleL1GtTriggerMenuToken_);
1085  auto const& l1GtAlgorithms = handleL1GtTriggerMenu->gtAlgorithmMap();
1086  auto const& l1GtTechTriggers = handleL1GtTriggerMenu->gtTechnicalTriggerMap();
1087  auto const& l1GtConditionsVector = handleL1GtTriggerMenu->gtConditionMap();
1088  // cache conditions in one single condition map
1089  ConditionMap l1GtConditions;
1090  for (size_t iCv = 0; iCv < l1GtConditionsVector.size(); ++iCv) {
1091  l1GtConditions.insert(l1GtConditionsVector.at(iCv).begin(), l1GtConditionsVector.at(iCv).end());
1092  }
1093  triggerAlgos->reserve(l1GtAlgorithms.size() + l1GtTechTriggers.size());
1094  Handle<L1GlobalTriggerObjectMaps> handleL1GlobalTriggerObjectMaps;
1095  iEvent.getByToken(l1GlobalTriggerObjectMapsToken_, handleL1GlobalTriggerObjectMaps);
1096  if (!handleL1GlobalTriggerObjectMaps.isValid()) {
1097  LogError("l1ObjectMap") << "L1GlobalTriggerObjectMaps product with InputTag '"
1098  << tagL1GlobalTriggerObjectMaps_.encode() << "' not in event\n"
1099  << "No L1 objects and GTL results available for physics algorithms";
1100  }
1101  handleL1GlobalTriggerObjectMaps->consistencyCheck();
1102  if (firstInRun_) {
1103  l1PSet_ = (ParameterSet*)(pset::Registry::instance()->getMapped(
1104  handleL1GlobalTriggerObjectMaps->namesParameterSetID()));
1105  if (l1PSet_ == nullptr) {
1106  LogError("l1ObjectMap") << "ParameterSet registry not available\n"
1107  << "Skipping conditions for all L1 physics algorithm names in this run";
1108  }
1109  } else {
1110  if (l1PSet_ == nullptr) {
1111  LogInfo("l1ObjectMap") << "ParameterSet registry not available\n"
1112  << "Skipping conditions for all L1 physics algorithm names in this event";
1113  }
1114  }
1115  // physics algorithms
1116  for (CItAlgo iAlgo = l1GtAlgorithms.begin(); iAlgo != l1GtAlgorithms.end(); ++iAlgo) {
1117  const std::string& algoName(iAlgo->second.algoName());
1118  if (!(iAlgo->second.algoBitNumber() < int(L1GlobalTriggerReadoutSetup::NumberPhysTriggers))) {
1119  LogError("l1Algo") << "L1 physics algorithm '" << algoName << "' has bit number "
1120  << iAlgo->second.algoBitNumber()
1122  << "Skipping";
1123  continue;
1124  }
1126  int bit;
1127  if (!l1GtUtils.l1AlgoTechTrigBitNumber(algoName, category, bit)) {
1128  LogError("l1Algo") << "L1 physics algorithm '" << algoName << "' not found in the L1 menu\n"
1129  << "Skipping";
1130  continue;
1131  }
1133  LogError("l1Algo") << "L1 physics algorithm '" << algoName
1134  << "' does not have category 'AlgorithmTrigger' from 'L1GtUtils'\n"
1135  << "Skipping";
1136  continue;
1137  }
1138  bool decisionBeforeMask;
1139  bool decisionAfterMask;
1140  int prescale;
1141  int mask;
1142  int error(l1GtUtils.l1Results(iEvent, algoName, decisionBeforeMask, decisionAfterMask, prescale, mask));
1143  if (error) {
1144  LogError("l1Algo") << "L1 physics algorithm '" << algoName << "' decision has error code " << error
1145  << " from 'L1GtUtils'\n"
1146  << "Skipping";
1147  continue;
1148  }
1149  TriggerAlgorithm triggerAlgo(algoName,
1150  iAlgo->second.algoAlias(),
1152  (unsigned)bit,
1153  (unsigned)prescale,
1154  (bool)mask,
1155  decisionBeforeMask,
1156  decisionAfterMask);
1157  triggerAlgo.setLogicalExpression(iAlgo->second.algoLogicalExpression());
1158  // GTL result and used conditions in physics algorithm
1159  if (!handleL1GlobalTriggerObjectMaps.isValid()) {
1160  triggerAlgos->push_back(triggerAlgo);
1161  continue; // LogWarning already earlier (before loop)
1162  }
1163  if (!handleL1GlobalTriggerObjectMaps->algorithmExists(bit)) {
1164  LogError("l1ObjectMap") << "L1 physics algorithm '" << algoName
1165  << "' is missing in L1GlobalTriggerObjectMaps\n"
1166  << "Skipping conditions and GTL result";
1167  triggerAlgos->push_back(triggerAlgo);
1168  continue;
1169  }
1170  bool algorithmResult = handleL1GlobalTriggerObjectMaps->algorithmResult(bit);
1171  // if ( ( algorithmResult != decisionBeforeMask ) && ( decisionBeforeMask == true || prescale == 1 ) ) {
1172  if ((algorithmResult != decisionBeforeMask) &&
1173  (decisionBeforeMask == true)) { // FIXME: understand the difference for un-prescaled algos 118, 119, 123
1174  LogInfo("l1ObjectMap") << "L1 physics algorithm '" << algoName << "' with different decisions in\n"
1175  << "L1GlobalTriggerObjectMaps (GTL result) : " << algorithmResult << "\n"
1176  << "L1GlobalTriggerReadoutRecord (decision before mask): " << decisionBeforeMask;
1177  }
1178  triggerAlgo.setGtlResult(algorithmResult);
1179  // conditions in algorithm
1181  handleL1GlobalTriggerObjectMaps->getConditionsInAlgorithm(bit);
1182  if (l1PSet_ == nullptr) {
1183  triggerAlgos->push_back(triggerAlgo);
1184  continue;
1185  }
1186  if (!l1PSet_->exists(algoName)) {
1187  if (firstInRun_) {
1188  LogError("l1ObjectMap") << "L1 physics algorithm name '" << algoName
1189  << "' not available in ParameterSet registry\n"
1190  << "Skipping conditions for this algorithm in this run";
1191  } else {
1192  LogInfo("l1ObjectMap") << "L1 physics algorithm name '" << algoName
1193  << "' not available in ParameterSet registry\n"
1194  << "Skipping conditions for this algorithm in this event";
1195  }
1196  triggerAlgos->push_back(triggerAlgo);
1197  continue;
1198  }
1199  std::vector<std::string> conditionNames(l1PSet_->getParameter<std::vector<std::string> >(algoName));
1200 
1201  for (unsigned iT = 0; iT < conditionNames.size(); ++iT) {
1202  size_t key(triggerConditions->size());
1203  for (size_t iC = 0; iC < triggerConditions->size(); ++iC) {
1204  if (conditionNames.at(iT) == triggerConditions->at(iC).name()) {
1205  key = iC;
1206  break;
1207  }
1208  }
1209  if (key == triggerConditions->size()) {
1210  if (iT >= conditions.nConditions()) {
1211  LogError("l1CondMap") << "More condition names from ParameterSet registry than the "
1212  << conditions.nConditions() << " conditions in L1GlobalTriggerObjectMaps\n"
1213  << "Skipping condition " << conditionNames.at(iT) << " in algorithm " << algoName;
1214  break;
1215  }
1216  TriggerCondition triggerCond(conditionNames[iT], conditions.getConditionResult(iT));
1217  if (l1GtConditions.find(triggerCond.name()) != l1GtConditions.end()) {
1218  triggerCond.setCategory(l1GtConditions[triggerCond.name()]->condCategory());
1219  triggerCond.setType(l1GtConditions[triggerCond.name()]->condType());
1220  const std::vector<L1GtObject> l1ObjectTypes(l1GtConditions[triggerCond.name()]->objectType());
1221  for (size_t iType = 0; iType < l1ObjectTypes.size(); ++iType) {
1222  triggerCond.addTriggerObjectType(mapObjectTypes[l1ObjectTypes.at(iType)]);
1223  }
1224  // objects in condition
1226  handleL1GlobalTriggerObjectMaps->getCombinationsInCondition(bit, iT);
1227  for (size_t iVV = 0; iVV < combinations.nCombinations(); ++iVV) {
1228  for (size_t iV = 0; iV < combinations.nObjectsPerCombination(); ++iV) {
1229  unsigned objectIndex = combinations.getObjectIndex(iVV, iV);
1230  if (iV >= l1ObjectTypes.size()) {
1231  LogError("l1CondMap") << "Index " << iV << " in combinations vector overshoots size "
1232  << l1ObjectTypes.size() << " of types vector in conditions map\n"
1233  << "Skipping object key in condition " << triggerCond.name();
1234  } else if (l1ObjectTypeMap.find(l1ObjectTypes.at(iV)) != l1ObjectTypeMap.end()) {
1235  if (objectIndex >= l1ObjectTypeMap[l1ObjectTypes.at(iV)].size()) {
1236  LogError("l1CondMap")
1237  << "Index " << objectIndex << " in combination overshoots number "
1238  << l1ObjectTypeMap[l1ObjectTypes.at(iV)].size() << "of according trigger objects\n"
1239  << "Skipping object key in condition " << triggerCond.name();
1240  }
1241  const unsigned objectKey(l1ObjectTypeMap[l1ObjectTypes.at(iV)].at(objectIndex));
1242  triggerCond.addObjectKey(objectKey);
1243  // add current condition and algorithm also to the according stand-alone trigger object
1244  triggerObjectsStandAlone->at(objectKey).addAlgorithmName(
1245  triggerAlgo.name(), (triggerAlgo.decision() && triggerCond.wasAccept()));
1246  triggerObjectsStandAlone->at(objectKey).addConditionName(triggerCond.name());
1247  }
1248  }
1249  }
1250  } else {
1251  LogWarning("l1CondMap") << "L1 conditions '" << triggerCond.name() << "' not found in the L1 menu\n"
1252  << "Remains incomplete";
1253  }
1254  triggerConditions->push_back(triggerCond);
1255  }
1256  triggerAlgo.addConditionKey(key);
1257  }
1258  triggerAlgos->push_back(triggerAlgo);
1259  }
1260  // technical triggers
1261  for (CItAlgo iAlgo = l1GtTechTriggers.begin(); iAlgo != l1GtTechTriggers.end(); ++iAlgo) {
1262  const std::string& algoName(iAlgo->second.algoName());
1263  if (!(iAlgo->second.algoBitNumber() < int(L1GlobalTriggerReadoutSetup::NumberTechnicalTriggers))) {
1264  LogError("l1Algo") << "L1 technical trigger '" << algoName << "' has bit number "
1265  << iAlgo->second.algoBitNumber()
1267  << "Skipping";
1268  continue;
1269  }
1271  int bit;
1272  if (!l1GtUtils.l1AlgoTechTrigBitNumber(algoName, category, bit)) {
1273  LogError("l1Algo") << "L1 technical trigger '" << algoName << "' not found in the L1 menu\n"
1274  << "Skipping";
1275  continue;
1276  }
1278  LogError("l1Algo") << "L1 technical trigger '" << algoName
1279  << "' does not have category 'TechnicalTrigger' from 'L1GtUtils'\n"
1280  << "Skipping";
1281  continue;
1282  }
1283  bool decisionBeforeMask;
1284  bool decisionAfterMask;
1285  int prescale;
1286  int mask;
1287  int error(l1GtUtils.l1Results(iEvent, algoName, decisionBeforeMask, decisionAfterMask, prescale, mask));
1288  if (error) {
1289  LogError("l1Algo") << "L1 technical trigger '" << algoName << "' decision has error code " << error
1290  << " from 'L1GtUtils'\n"
1291  << "Skipping";
1292  continue;
1293  }
1294  TriggerAlgorithm triggerAlgo(algoName,
1295  iAlgo->second.algoAlias(),
1297  (unsigned)bit,
1298  (unsigned)prescale,
1299  (bool)mask,
1300  decisionBeforeMask,
1301  decisionAfterMask);
1302  triggerAlgo.setLogicalExpression(iAlgo->second.algoLogicalExpression());
1303  triggerAlgos->push_back(triggerAlgo);
1304  }
1305  }
1306 
1307  // Put L1 algorithms and conditions to event
1308  iEvent.put(std::move(triggerAlgos));
1310  }
1311 
1313  iEvent.processHistory().getConfigurationForProcess(nameProcess_, config);
1314 
1315  const edm::TriggerNames& names = iEvent.triggerNames(*handleTriggerResults);
1316  for (pat::TriggerObjectStandAlone& obj : *triggerObjectsStandAlone) {
1317  obj.setPSetID(config.parameterSetID());
1318  if (packPathNames_)
1319  obj.packPathNames(names);
1320  if (packLabels_)
1321  obj.packFilterLabels(iEvent, *handleTriggerResults);
1322  }
1323 
1324  // Put (finally) stand-alone trigger objects to event
1325  iEvent.put(std::move(triggerObjectsStandAlone));
1326 
1327  firstInRun_ = false;
1328 }
1329 
1331  clear();
1332  const std::vector<std::string>& pathNames = hltConfig.triggerNames();
1333  unsigned int sizePaths = pathNames.size();
1334  for (unsigned int indexPath = 0; indexPath < sizePaths; ++indexPath) {
1335  const std::string& namePath = pathNames[indexPath];
1336 
1337  const std::vector<std::string>& nameModules = hltConfig.moduleLabels(indexPath);
1338  unsigned int sizeModulesPath = nameModules.size();
1339  bool lastFilter = true;
1340  unsigned int iM = sizeModulesPath;
1341  while (iM > 0) {
1342  const std::string& nameFilter = nameModules[--iM];
1343  if (hltConfig.moduleEDMType(nameFilter) != "EDFilter")
1344  continue;
1345  if (hltConfig.moduleType(nameFilter) == "HLTBool")
1346  continue;
1347  bool saveTags = hltConfig.saveTags(nameFilter);
1348  insert(nameFilter, namePath, indexPath, lastFilter, saveTags);
1349  if (saveTags)
1350  lastFilter = false; // FIXME: rather always?
1351  }
1352  }
1353 }
1354 
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:34
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
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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
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.
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.
Analysis-level HLTrigger path class.
Definition: TriggerPath.h:36
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
ProcessHistory const & processHistory() const
Definition: Run.cc:113
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:151
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.
config
parse the configuration file
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:45
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)