CMS 3D CMS Logo

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