CMS 3D CMS Logo

HLTLevel1GTSeed.cc
Go to the documentation of this file.
1 
17 // this class header
18 #include "HLTLevel1GTSeed.h"
20 
21 // system include files
22 #include <string>
23 #include <list>
24 #include <vector>
25 #include <algorithm>
26 
27 #include <iostream>
28 #include <sstream>
29 
30 // user include files
33 
37 
40 
42 
47 
52 
54 
57 
61 
63 
66 
69 
71 
74 
75 // constructors
77  : HLTStreamFilter(parSet),
78  // initialize the cache
79  m_l1GtMenu(nullptr),
80  m_l1GtMenuCacheID(0ULL),
81 
82  // seeding done via L1 trigger object maps, with objects that fired
83  m_l1UseL1TriggerObjectMaps(parSet.getParameter<bool>("L1UseL1TriggerObjectMaps")),
84 
85  // option used forL1UseL1TriggerObjectMaps = False only
86  m_l1NrBxInEvent(parSet.getParameter<int>("L1NrBxInEvent")),
87 
88  // seeding done via technical trigger bits, if value is "true"
89  m_l1TechTriggerSeeding(parSet.getParameter<bool>("L1TechTriggerSeeding")),
90 
91  // seeding uses algorithm aliases instead of algorithm names, if value is "true";
92  m_l1UseAliasesForSeeding(parSet.getParameter<bool>("L1UseAliasesForSeeding")),
93 
94  // logical expression for the required L1 algorithms
95  m_l1SeedsLogicalExpression(parSet.getParameter<std::string>("L1SeedsLogicalExpression")),
96 
97  // InputTag for the L1 Global Trigger DAQ readout record
98  m_l1GtReadoutRecordTag(parSet.getParameter<edm::InputTag>("L1GtReadoutRecordTag")),
99  m_l1GtReadoutRecordToken(consumes<L1GlobalTriggerReadoutRecord>(m_l1GtReadoutRecordTag)),
100 
101  // InputTag for L1 Global Trigger object maps
102  m_l1GtObjectMapTag(parSet.getParameter<edm::InputTag>("L1GtObjectMapTag")),
103  m_l1GtObjectMapToken(consumes<L1GlobalTriggerObjectMapRecord>(m_l1GtObjectMapTag)),
104 
105  // InputTag for L1 particle collections (except muon)
106  m_l1CollectionsTag(parSet.getParameter<edm::InputTag>("L1CollectionsTag")),
107 
108  // InputTag for L1 muon collection
109  m_l1MuonCollectionTag(parSet.getParameter<edm::InputTag>("L1MuonCollectionTag")),
110 
112  m_l1ExtraTag(edm::InputTag(m_l1CollectionsTag.label())),
113  m_l1MuonTag(edm::InputTag(m_l1MuonCollectionTag.label())),
114  m_l1MuonToken(consumes<l1extra::L1MuonParticleCollection>(m_l1MuonTag)),
115  m_l1IsoEGTag(edm::InputTag(m_l1CollectionsTag.label(), "Isolated")),
116  m_l1IsoEGToken(consumes<l1extra::L1EmParticleCollection>(m_l1IsoEGTag)),
117  m_l1NoIsoEGTag(edm::InputTag(m_l1CollectionsTag.label(), "NonIsolated")),
118  m_l1NoIsoEGToken(consumes<l1extra::L1EmParticleCollection>(m_l1NoIsoEGTag)),
119  m_l1CenJetTag(edm::InputTag(m_l1CollectionsTag.label(), "Central")),
120  m_l1CenJetToken(consumes<l1extra::L1JetParticleCollection>(m_l1CenJetTag)),
121  m_l1ForJetTag(edm::InputTag(m_l1CollectionsTag.label(), "Forward")),
122  m_l1ForJetToken(consumes<l1extra::L1JetParticleCollection>(m_l1ForJetTag)),
123  m_l1TauJetTag(edm::InputTag(m_l1CollectionsTag.label(), "Tau")),
124  m_l1TauJetToken(consumes<l1extra::L1JetParticleCollection>(m_l1TauJetTag)),
125  m_l1IsoTauJetTag(edm::InputTag(m_l1CollectionsTag.label(), "IsoTau")),
126  m_l1IsoTauJetToken(consumes<l1extra::L1JetParticleCollection>(m_l1IsoTauJetTag)),
127  m_l1EtMissMETTag(edm::InputTag(m_l1CollectionsTag.label(), "MET")),
128  m_l1EtMissMETToken(consumes<l1extra::L1EtMissParticleCollection>(m_l1EtMissMETTag)),
129  m_l1EtMissMHTTag(edm::InputTag(m_l1CollectionsTag.label(), "MHT")),
130  m_l1EtMissMHTToken(consumes<l1extra::L1EtMissParticleCollection>(m_l1EtMissMHTTag)),
131  m_l1GlobalDecision(false),
132  m_isDebugEnabled(edm::isDebugEnabled()) {
133  if (m_l1SeedsLogicalExpression != "L1GlobalDecision") {
134  // check also the logical expression - add/remove spaces if needed
136 
137  // list of required algorithms for seeding
138  // dummy values for tokenNumber and tokenResult
141  size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();
142 
143  //
144  m_l1AlgoSeedsRpn.reserve(l1AlgoSeedsSize);
145  m_l1AlgoSeedsObjType.reserve(l1AlgoSeedsSize);
146  } else {
147  m_l1GlobalDecision = true;
148  }
149 
150  // for seeding via technical triggers, convert the "name" to tokenNumber
151  // (seeding via bit numbers)
154  }
155 
156  LogDebug("HLTLevel1GTSeed") << "\n"
157  << "L1 Seeding using L1 trigger object maps: " << m_l1UseL1TriggerObjectMaps << "\n"
158  << " if false: seeding with L1Extra\n"
159  << "Number of BxInEvent when seeding with L1Extra: " << m_l1NrBxInEvent << "\n"
160  << " aka w/o object maps\n "
161  << "\n"
162  << "L1 Seeding via Technical Triggers: " << m_l1TechTriggerSeeding << "\n"
163  << "L1 Seeding uses algorithm aliases: " << m_l1UseAliasesForSeeding << "\n"
164  << "L1 Seeds Logical Expression: "
165  << "\n " << m_l1SeedsLogicalExpression << "\n"
166  << "Input tag for L1 GT DAQ record: " << m_l1GtReadoutRecordTag << " \n"
167  << "Input tag for L1 GT object map record: " << m_l1GtObjectMapTag << " \n"
168  << "Input tag for L1 extra collections: " << m_l1CollectionsTag << " \n"
169  << "Input tag for L1 muon collections: " << m_l1MuonCollectionTag << " \n"
170  << std::endl;
171 }
172 
173 // destructor
175  // empty now
176 }
177 
178 // member functions
179 
183 
184  // # default: true
185  // # seeding done via L1 trigger object maps, with objects that fired
186  // # only objects from the central BxInEvent (L1A) are used
187  // # if false:
188  // # seeding is done ignoring if a L1 object fired or not,
189  // # adding all L1EXtra objects corresponding to the object types
190  // # used in all conditions from the algorithms in logical expression
191  // # for a given number of BxInEvent
192  desc.add<bool>("L1UseL1TriggerObjectMaps", true);
193 
194  // # option used forL1UseL1TriggerObjectMaps = False only
195  // # number of BxInEvent: 1: L1A=0; 3: -1, L1A=0, 1; 5: -2, -1, L1A=0, 1, 2
196  desc.add<int>("L1NrBxInEvent", 3);
197 
198  // # seeding done via technical trigger bits, if value is "true";
199  // # default: false (seeding via physics algorithms)
200  desc.add<bool>("L1TechTriggerSeeding", false);
201 
202  // # seeding done with aliases for physics algorithms
203  desc.add<bool>("L1UseAliasesForSeeding", true);
204 
205  // # logical expression for the required L1 algorithms;
206  // # the algorithms are specified by name
207  // # allowed operators: "AND", "OR", "NOT", "(", ")"
208  // #
209  // # by convention, "L1GlobalDecision" logical expression means global decision
210  desc.add<std::string>("L1SeedsLogicalExpression", "");
211 
212  // # InputTag for the L1 Global Trigger DAQ readout record
213  // # GT Emulator = gtDigis
214  // # GT Unpacker = l1GtUnpack
215  // #
216  // # cloned GT unpacker in HLT = gtDigis
217  desc.add<edm::InputTag>("L1GtReadoutRecordTag", edm::InputTag("gtDigis"));
218 
219  // # InputTag for L1 Global Trigger object maps
220  // # only the emulator produces the object maps
221  // # GT Emulator = gtDigis
222  // #
223  // # cloned GT emulator in HLT = l1GtObjectMap
224  desc.add<edm::InputTag>("L1GtObjectMapTag", edm::InputTag("l1GtObjectMap"));
225 
226  // # InputTag for L1 particle collections (except muon)
227  // # L1 Extra = l1extraParticles
228  desc.add<edm::InputTag>("L1CollectionsTag", edm::InputTag("l1extraParticles"));
229 
230  // # InputTag for L1 muon collection
231  // # L1 Extra = l1extraParticles
232  desc.add<edm::InputTag>("L1MuonCollectionTag", edm::InputTag("l1extraParticles"));
233 
234  descriptions.add("hltLevel1GTSeed", desc);
235 }
236 
238  const edm::EventSetup& evSetup,
239  trigger::TriggerFilterObjectWithRefs& filterproduct) {
240  // all HLT filters must create and fill a HLT filter object,
241  // recording any reconstructed physics objects satisfying
242  // this HLT filter, and place it in the event.
243 
244  // the filter object
245  if (saveTags()) {
246  filterproduct.addCollectionTag(m_l1MuonTag);
247  filterproduct.addCollectionTag(m_l1ExtraTag);
248  filterproduct.addCollectionTag(m_l1IsoEGTag);
249  filterproduct.addCollectionTag(m_l1NoIsoEGTag);
250  filterproduct.addCollectionTag(m_l1CenJetTag);
251  filterproduct.addCollectionTag(m_l1ForJetTag);
252  filterproduct.addCollectionTag(m_l1TauJetTag);
253  filterproduct.addCollectionTag(m_l1IsoTauJetTag);
254  filterproduct.addCollectionTag(m_l1EtMissMETTag);
255  filterproduct.addCollectionTag(m_l1EtMissMHTTag);
256  }
257 
258  // get the trigger mask from the EventSetup
260  evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().get(l1GtTmAlgo);
261 
262  // get L1GlobalTriggerReadoutRecord and GT decision
264  iEvent.getByToken(m_l1GtReadoutRecordToken, gtReadoutRecord);
265  const L1GlobalTriggerReadoutRecord* gtReadoutRecordPtr = gtReadoutRecord.product();
266 
267  if (!gtReadoutRecord.isValid()) {
268  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1GlobalTriggerReadoutRecord with input tag "
270  << "\nrequested in configuration, but not found in the event." << std::endl;
271  return false;
272  }
273 
274  //
275  uint16_t gtFinalOR = gtReadoutRecord->finalOR();
276  int physicsDaqPartition = 0;
277  bool gtDecision = static_cast<bool>(gtFinalOR & (1 << physicsDaqPartition));
278 
279  // GT global decision "false" possible only when running on MC or on random triggers
280  if (!gtDecision) {
281  return false;
282 
283  } else {
284  // by convention, "L1GlobalDecision" logical expression means global decision
285  if (m_l1GlobalDecision) {
286  // return the full L1GlobalTriggerObjectMapRecord in filter format FIXME
287  return true;
288  }
289  }
290 
291  // seeding done via technical trigger bits
293  // get the technical trigger mask from the EventSetup
295  evSetup.get<L1GtTriggerMaskTechTrigRcd>().get(l1GtTmTech);
296 
297  // get Global Trigger technical trigger word, update the tokenResult members
298  // from m_l1AlgoLogicParser and get the result for the logical expression
299  const std::vector<bool>& gtTechTrigWord = gtReadoutRecord->technicalTriggerWord();
300  updateAlgoLogicParser(gtTechTrigWord, l1GtTmTech->gtTriggerMask(), physicsDaqPartition);
301 
302  // always empty filter - GT not aware of objects for technical triggers
303  bool seedsResult = m_l1AlgoLogicParser.expressionResult();
304 
305  if (seedsResult) {
306  return true;
307  } else {
308  return false;
309  }
310  }
311 
312  // seeding via physics algorithms
313 
314  // get / update the trigger menu from the EventSetup
315  // local cache & check on cacheIdentifier
316 
317  unsigned long long l1GtMenuCacheID = evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();
318 
319  if (m_l1GtMenuCacheID != l1GtMenuCacheID) {
321  evSetup.get<L1GtTriggerMenuRcd>().get(l1GtMenu);
322  m_l1GtMenu = l1GtMenu.product();
323  m_l1GtMenuCacheID = l1GtMenuCacheID;
324 
325  const AlgorithmMap& algorithmMap = l1GtMenu->gtAlgorithmMap();
326  const AlgorithmMap& algorithmAliasMap = l1GtMenu->gtAlgorithmAliasMap();
327 
328  LogTrace("HLTLevel1GTSeed") << "\n L1 trigger menu " << l1GtMenu->gtTriggerMenuInterface()
329  << "\n Number of algorithm names: " << (algorithmMap.size())
330  << "\n Number of algorithm aliases: " << (algorithmAliasMap.size()) << "\n"
331  << std::endl;
332 
333  // update also the tokenNumber members (holding the bit numbers) from m_l1AlgoLogicParser
335  updateAlgoLogicParser(m_l1GtMenu, algorithmAliasMap);
336  } else {
337  updateAlgoLogicParser(m_l1GtMenu, algorithmMap);
338  }
339  }
340 
341  // FinalOR is true, it was tested before
343  if (not seedsL1TriggerObjectMaps(
344  iEvent, filterproduct, l1GtTmAlgo.product(), gtReadoutRecordPtr, physicsDaqPartition))
345  return false;
346  } else {
347  if (not seedsL1Extra(iEvent, filterproduct))
348  return false;
349  }
350 
351  if (m_isDebugEnabled) {
352  dumpTriggerFilterObjectWithRefs(filterproduct);
353  }
354 
355  return true;
356 }
357 
358 const std::vector<L1GtObject>* HLTLevel1GTSeed::objectTypeVec(const int chipNr, const std::string& cndName) const {
359  const ConditionMap& conditionMap = (m_l1GtMenu->gtConditionMap()).at(chipNr);
360 
361  auto itCond = conditionMap.find(cndName);
362  if (itCond != conditionMap.end())
363  return (&((itCond->second)->objectType()));
364 
365  // this should never be happen, all conditions are in the maps
366  throw cms::Exception("FailModule") << "\nCondition " << cndName << " not found in the condition map"
367  << " for chip number " << chipNr;
368 }
369 
370 // for a new L1 Trigger menu, update the tokenNumber (holding the bit numbers)
371 // from m_l1AlgoLogicParser and from m_l1AlgoSeeds, and fill the m_l1AlgoSeedsRpn vector
372 void HLTLevel1GTSeed::updateAlgoLogicParser(const L1GtTriggerMenu* l1GtMenu, const AlgorithmMap& algorithmMap) {
373  std::vector<L1GtLogicParser::OperandToken>& algOpTokenVector = m_l1AlgoLogicParser.operandTokenVector();
374 
375  size_t jSeed = 0;
376  size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();
377 
378  // clear the content from the previous menu for the vector of RPN vectors m_l1AlgoSeedsRpn
379  // and for the the vector of object-type vectors m_l1AlgoSeedsObjType
380  m_l1AlgoSeedsRpn.clear();
381  m_l1AlgoSeedsObjType.clear();
382 
383  //
384 
385  for (auto& i : algOpTokenVector) {
386  auto itAlgo = algorithmMap.find(i.tokenName);
387  if (itAlgo != algorithmMap.end()) {
388  int bitNr = (itAlgo->second).algoBitNumber();
389  int chipNr = (itAlgo->second).algoChipNumber();
390 
391  i.tokenNumber = bitNr;
392 
393  // algOpTokenVector and m_l1AlgoSeeds must have the same ordering
394  // of the algorithms
395  if (jSeed < l1AlgoSeedsSize) {
396  //LogTrace("HLTLevel1GTSeed") << "(m_l1AlgoSeeds[jSeed]).tokenName: "
397  // << (m_l1AlgoSeeds[jSeed]).tokenName
398  // << std::endl;
399 
400  if ((m_l1AlgoSeeds[jSeed]).tokenName == i.tokenName) {
401  (m_l1AlgoSeeds[jSeed]).tokenNumber = bitNr;
402 
403  const std::vector<L1GtLogicParser::TokenRPN>& aRpnVector = (itAlgo->second).algoRpnVector();
404  size_t aRpnVectorSize = aRpnVector.size();
405 
406  m_l1AlgoSeedsRpn.push_back(&aRpnVector);
407 
408  // loop over RpnVector to fill for each condition the object type
409  std::vector<const std::vector<L1GtObject>*> tmpObjTypeVec;
410  tmpObjTypeVec.reserve(aRpnVectorSize);
411 
412  for (size_t opI = 0; opI < aRpnVectorSize; ++opI) {
413  std::string cName = (aRpnVector[opI]).operand;
414 
415  if (!cName.empty()) {
416  tmpObjTypeVec.push_back(objectTypeVec(chipNr, cName));
417 
418  //LogTrace("HLTLevel1GTSeed")
419  // << " Push object vector for condition: " << cName
420  // << std::endl;
421  }
422  }
423 
424  m_l1AlgoSeedsObjType.push_back(tmpObjTypeVec);
425 
426  jSeed++;
427  }
428  }
429  } else {
430  throw cms::Exception("FailModule") << "\nAlgorithm " << i.tokenName
431  << ", requested as seed by a HLT path, not found in the L1 trigger menu\n "
432  << l1GtMenu->gtTriggerMenuName() << "\nIncompatible L1 and HLT menus.\n"
433  << std::endl;
434  }
435  }
436 
437  //
438  if (m_isDebugEnabled) {
439  bool newMenu = true;
440  debugPrint(newMenu);
441  }
442 }
443 
444 // update the tokenResult members from m_l1AlgoLogicParser
445 // for a new event
446 void HLTLevel1GTSeed::updateAlgoLogicParser(const std::vector<bool>& gtWord,
447  const std::vector<unsigned int>& triggerMask,
448  const int physicsDaqPartition) {
449  std::vector<L1GtLogicParser::OperandToken>& algOpTokenVector = m_l1AlgoLogicParser.operandTokenVector();
450 
451  for (auto& i : algOpTokenVector) {
452  int iBit = i.tokenNumber;
453  bool iResult = gtWord.at(iBit);
454 
455  int triggerMaskBit = triggerMask[iBit] & (1 << physicsDaqPartition);
456  //LogTrace("HLTLevel1GTSeed")
457  //<< "\nTrigger bit: " << iBit
458  //<< " mask = " << triggerMaskBit
459  //<< " DAQ partition " << physicsDaqPartition
460  //<< std::endl;
461 
462  if (triggerMaskBit) {
463  iResult = false;
464 
465  //LogTrace("HLTLevel1GTSeed")
466  //<< "\nMasked trigger: " << iBit << ". Result set to false\n"
467  //<< std::endl;
468  }
469 
470  i.tokenResult = iResult;
471  }
472 
473  for (auto& m_l1AlgoSeed : m_l1AlgoSeeds) {
474  int iBit = m_l1AlgoSeed.tokenNumber;
475  bool iResult = gtWord.at(iBit);
476 
477  int triggerMaskBit = triggerMask[iBit] & (1 << physicsDaqPartition);
478  //LogTrace("HLTLevel1GTSeed")
479  //<< "\nTrigger bit: " << iBit
480  //<< " mask = " << triggerMaskBit
481  //<< " DAQ partition " << physicsDaqPartition
482  //<< std::endl;
483 
484  if (triggerMaskBit) {
485  iResult = false;
486 
487  //LogTrace("HLTLevel1GTSeed")
488  //<< "\nMasked trigger: " << iBit << ". Result set to false\n"
489  //<< std::endl;
490  }
491 
492  m_l1AlgoSeed.tokenResult = iResult;
493  }
494 
495  if (m_isDebugEnabled) {
496  bool newMenu = false;
497  debugPrint(newMenu);
498  }
499 }
500 
501 // for seeding via technical triggers, convert the "name" to tokenNumber
502 // (seeding via bit numbers) - done once in constructor
504  std::vector<L1GtLogicParser::OperandToken>& algOpTokenVector = m_l1AlgoLogicParser.operandTokenVector();
505 
506  for (auto& i : algOpTokenVector) {
507  std::string bitString = i.tokenName;
508  std::istringstream bitStream(bitString);
509  int bitInt;
510 
511  if ((bitStream >> bitInt).fail()) {
512  throw cms::Exception("FailModule") << "\nL1 Seeds Logical Expression: = '" << m_l1SeedsLogicalExpression << "'"
513  << "\n Conversion to integer failed for " << bitString << std::endl;
514  }
515 
516  i.tokenNumber = bitInt;
517  }
518 
519  for (auto& m_l1AlgoSeed : m_l1AlgoSeeds) {
520  std::string bitString = m_l1AlgoSeed.tokenName;
521  std::istringstream bitStream(bitString);
522  int bitInt;
523 
524  if ((bitStream >> bitInt).fail()) {
525  throw cms::Exception("FailModule") << "\nL1 Seeds Logical Expression: = '" << m_l1SeedsLogicalExpression << "'"
526  << "\n Conversion to integer failed for " << bitString << std::endl;
527  }
528 
529  m_l1AlgoSeed.tokenNumber = bitInt;
530  }
531 }
532 
533 // debug print grouped in a single function
534 // can be called for a new menu (bool "true") or for a new event
535 void HLTLevel1GTSeed::debugPrint(bool newMenu) const {
537  LogDebug("HLTLevel1GTSeed") << "\n\nupdateAlgoLogicParser: seeding via technical trigger"
538  << "\n update event quantities." << std::endl;
539 
540  } else {
541  if (newMenu) {
542  LogDebug("HLTLevel1GTSeed") << "\n\nupdateAlgoLogicParser: L1 trigger menu changed to "
543  << m_l1GtMenu->gtTriggerMenuName() << std::endl;
544  } else {
545  LogDebug("HLTLevel1GTSeed") << "\n\nupdateAlgoLogicParser: L1 trigger menu unchanged ("
546  << m_l1GtMenu->gtTriggerMenuName() << ")\n update event quantities." << std::endl;
547  }
548  }
549 
550  std::vector<L1GtLogicParser::OperandToken> const& algOpTokenVector = m_l1AlgoLogicParser.operandTokenVector();
551 
552  LogTrace("HLTLevel1GTSeed") << "\n\nupdateAlgoLogicParser: algOpTokenVector.size() = " << algOpTokenVector.size()
553  << std::endl;
554 
555  for (auto const& i : algOpTokenVector) {
556  LogTrace("HLTLevel1GTSeed") << " " << std::setw(5) << i.tokenNumber << "\t" << std::setw(25) << i.tokenName
557  << "\t" << i.tokenResult << std::endl;
558  }
559 
560  LogTrace("HLTLevel1GTSeed") << std::endl;
561 
562  LogTrace("HLTLevel1GTSeed") << "\nupdateAlgoLogicParser: m_l1AlgoSeeds.size() = " << m_l1AlgoSeeds.size()
563  << std::endl;
564 
565  for (auto const& m_l1AlgoSeed : m_l1AlgoSeeds) {
566  LogTrace("HLTLevel1GTSeed") << " " << std::setw(5) << m_l1AlgoSeed.tokenNumber << "\t" << std::setw(25)
567  << m_l1AlgoSeed.tokenName << "\t" << m_l1AlgoSeed.tokenResult << std::endl;
568  }
569 
570  LogTrace("HLTLevel1GTSeed") << std::endl;
571 
572  if (!newMenu) {
573  return;
574  }
575 
576  LogTrace("HLTLevel1GTSeed") << "\nupdateAlgoLogicParser: m_l1AlgoSeedsRpn.size() = " << m_l1AlgoSeedsRpn.size()
577  << std::endl;
578 
579  for (auto i : m_l1AlgoSeedsRpn) {
580  LogTrace("HLTLevel1GTSeed") << " Rpn vector size: " << i->size() << std::endl;
581 
582  for (size_t j = 0; j < i->size(); ++j) {
583  LogTrace("HLTLevel1GTSeed") << " ( " << (*i)[j].operation << ", " << (*i)[j].operand << " )" << std::endl;
584  }
585  }
586 
587  LogTrace("HLTLevel1GTSeed") << std::endl;
588 
589  LogTrace("HLTLevel1GTSeed") << "\nupdateAlgoLogicParser: "
590  << "algorithms in seed expression: m_l1AlgoSeedsObjType.size() = "
591  << m_l1AlgoSeedsObjType.size() << std::endl;
592 
593  for (auto const& i : m_l1AlgoSeedsObjType) {
594  LogTrace("HLTLevel1GTSeed") << " Conditions for an algorithm: vector size: " << i.size() << std::endl;
595 
596  for (size_t j = 0; j < i.size(); ++j) {
597  LogTrace("HLTLevel1GTSeed") << " Condition object type vector: size: " << (i[j])->size() << std::endl;
598 
599  for (size_t k = 0; k < (i[j])->size(); ++k) {
600  L1GtObject obj = (*(i[j]))[k];
601  LogTrace("HLTLevel1GTSeed") << " " << obj << " ";
602  }
603 
604  LogTrace("HLTLevel1GTSeed") << std::endl;
605  }
606  }
607 
608  LogTrace("HLTLevel1GTSeed") << std::endl;
609 }
610 
611 // seeding is done via L1 trigger object maps, considering the objects which fired in L1
614  const L1GtTriggerMask* l1GtTmAlgo,
615  const L1GlobalTriggerReadoutRecord* gtReadoutRecordPtr,
616  const int physicsDaqPartition) {
617  // get Global Trigger decision word, update the tokenResult members
618  // from m_l1AlgoLogicParser and get the result for the logical expression
619  const std::vector<bool>& gtDecisionWord = gtReadoutRecordPtr->decisionWord();
620  updateAlgoLogicParser(gtDecisionWord, l1GtTmAlgo->gtTriggerMask(), physicsDaqPartition);
621 
622  bool seedsResult = m_l1AlgoLogicParser.expressionResult();
623 
624  if (m_isDebugEnabled) {
625  // define an output stream to print into
626  // it can then be directed to whatever log level is desired
627  std::ostringstream myCoutStream;
628  gtReadoutRecordPtr->printGtDecision(myCoutStream);
629 
630  LogTrace("HLTLevel1GTSeed") << myCoutStream.str() << "\nHLTLevel1GTSeed::hltFilter "
631  << "\nLogical expression (names) = '" << m_l1SeedsLogicalExpression << "'"
632  << "\n Result for logical expression: " << seedsResult << "\n"
633  << std::endl;
634  }
635 
636  // the evaluation of the logical expression is false - skip event
637  if (!seedsResult) {
638  return false;
639  }
640 
641  // define index lists for all particle types
642 
643  std::list<int> listMuon;
644 
645  std::list<int> listIsoEG;
646  std::list<int> listNoIsoEG;
647 
648  std::list<int> listCenJet;
649  std::list<int> listForJet;
650  std::list<int> listTauJet;
651  std::list<int> listIsoTauJet;
652 
653  std::list<int> listETM;
654  std::list<int> listETT;
655  std::list<int> listHTT;
656  std::list<int> listHTM;
657 
658  std::list<int> listJetCounts;
659 
660  // get handle to object maps (one object map per algorithm)
662  iEvent.getByToken(m_l1GtObjectMapToken, gtObjectMapRecord);
663 
664  if (!gtObjectMapRecord.isValid()) {
665  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1GlobalTriggerObjectMapRecord with input tag "
667  << "\nrequested in configuration, but not found in the event." << std::endl;
668 
669  return false;
670  }
671 
672  // TODO check that the L1GlobalTriggerObjectMapRecord corresponds to the same menu as
673  // the menu run by HLTLevel1GTSeed
674  // true normally online (they are run in the same job)
675  // can be false offline, when re-running HLT without re-running the object map producer
676 
677  // loop over the list of required algorithms for seeding
678  int iAlgo = -1;
679 
680  for (std::vector<L1GtLogicParser::OperandToken>::const_iterator itSeed = m_l1AlgoSeeds.begin();
681  itSeed != m_l1AlgoSeeds.end();
682  ++itSeed) {
683  //
684  iAlgo++;
685  //
686  int algBit = (*itSeed).tokenNumber;
687  std::string algName = (*itSeed).tokenName;
688  bool algResult = (*itSeed).tokenResult;
689 
690  LogTrace("HLTLevel1GTSeed") << "\nHLTLevel1GTSeed::hltFilter "
691  << "\n Algorithm " << algName << " with bit number " << algBit
692  << " in the object map seed list"
693  << "\n Algorithm result = " << algResult << "\n"
694  << std::endl;
695 
696  // algorithm result is false - no seeds
697  if (!algResult) {
698  continue;
699  }
700 
701  // algorithm result is true - get object map, loop over conditions in the algorithm
702  const L1GlobalTriggerObjectMap* objMap = gtObjectMapRecord->getObjectMap(algBit);
703 
704  if (objMap == nullptr) {
705  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1GlobalTriggerObjectMap for algorithm " << algName
706  << " (bit number " << algBit << ") does not exist.\nReturn false.\n"
707  << std::endl;
708  return false;
709  }
710 
711  const std::vector<L1GtLogicParser::OperandToken>& opTokenVecObjMap = objMap->operandTokenVector();
712 
713  const std::vector<L1GtLogicParser::TokenRPN>& algoSeedsRpn = *(m_l1AlgoSeedsRpn.at(iAlgo));
714 
715  const std::vector<const std::vector<L1GtObject>*>& algoSeedsObjTypeVec = m_l1AlgoSeedsObjType[iAlgo];
716 
717  //
718  L1GtLogicParser logicParserConditions(algoSeedsRpn, opTokenVecObjMap);
719 
720  // get list of required conditions for seeding - loop over
721  std::vector<L1GtLogicParser::OperandToken> condSeeds = logicParserConditions.expressionSeedsOperandList();
722 
723  if (m_isDebugEnabled) {
724  LogTrace("HLTLevel1GTSeed") << "\n HLTLevel1GTSeed::hltFilter "
725  << "\n condSeeds.size() = " << condSeeds.size() << std::endl;
726 
727  for (auto& condSeed : condSeeds) {
728  LogTrace("HLTLevel1GTSeed") << " " << std::setw(5) << condSeed.tokenNumber << "\t" << std::setw(25)
729  << condSeed.tokenName << "\t" << condSeed.tokenResult << std::endl;
730  }
731 
732  LogTrace("HLTLevel1GTSeed") << std::endl;
733  }
734 
735  for (std::vector<L1GtLogicParser::OperandToken>::const_iterator itCond = condSeeds.begin();
736  itCond != condSeeds.end();
737  itCond++) {
738  std::string cndName = (*itCond).tokenName;
739  int cndNumber = (*itCond).tokenNumber;
740  bool cndResult = (*itCond).tokenResult;
741 
742  const std::vector<L1GtObject>* cndObjTypeVec = algoSeedsObjTypeVec.at(cndNumber);
743 
744  //LogTrace("HLTLevel1GTSeed")
745  // << "\n HLTLevel1GTSeed::hltFilter "
746  // << "\n Condition " << cndName << " with number " << cndNumber
747  // << " in the seed list"
748  // << "\n Condition result = " << cndResult << "\n"
749  // << std::endl;
750 
751  if (!cndResult) {
752  continue;
753  }
754 
755  // loop over combinations for a given condition
756 
757  const CombinationsInCond* cndComb = objMap->getCombinationsInCond(cndNumber);
758 
759  for (auto const& itComb : (*cndComb)) {
760  // loop over objects in a combination for a given condition
761  int iObj = 0;
762  for (auto itObject = itComb.begin(); itObject != itComb.end(); itObject++) {
763  // get object type and push indices on the list
764  const L1GtObject objTypeVal = (*cndObjTypeVec).at(iObj);
765 
766  //LogTrace("HLTLevel1GTSeed")
767  // << "\n HLTLevel1GTSeed::hltFilter "
768  // << "\n Add object of type " << objTypeVal
769  // << " and index " << (*itObject) << " to the seed list."
770  // << std::endl;
771 
772  switch (objTypeVal) {
773  case Mu: {
774  listMuon.push_back(*itObject);
775  }
776 
777  break;
778  case NoIsoEG: {
779  listNoIsoEG.push_back(*itObject);
780  }
781 
782  break;
783  case IsoEG: {
784  listIsoEG.push_back(*itObject);
785  }
786 
787  break;
788  case CenJet: {
789  listCenJet.push_back(*itObject);
790  }
791 
792  break;
793  case ForJet: {
794  listForJet.push_back(*itObject);
795  }
796 
797  break;
798  case TauJet: {
799  listTauJet.push_back(*itObject);
800  }
801 
802  break;
803  case HfRingEtSums: {
804  // Special treatment needed to match HFRingEtSums index (Ind) with corresponding l1extra item
805  // Same ranking (Et) is assumed for both HFRingEtSums indexes and items in l1extra IsoTau collection
806  // Each HFRingEtSums_IndN corresponds with one object (with (*itObject)=0);
807  // its index (hfInd) encodded by parsing algorithm name
808  int hfInd = (*itObject);
809  if (cndName.find("Ind0") != std::string::npos)
810  hfInd = 0;
811  else if (cndName.find("Ind1") != std::string::npos)
812  hfInd = 1;
813  else if (cndName.find("Ind2") != std::string::npos)
814  hfInd = 2;
815  else if (cndName.find("Ind3") != std::string::npos)
816  hfInd = 3;
817  listIsoTauJet.push_back(hfInd);
818  }
819 
820  break;
821  case ETM: {
822  listETM.push_back(*itObject);
823 
824  }
825 
826  break;
827  case ETT: {
828  listETT.push_back(*itObject);
829 
830  }
831 
832  break;
833  case HTT: {
834  listHTT.push_back(*itObject);
835 
836  }
837 
838  break;
839  case HTM: {
840  listHTM.push_back(*itObject);
841 
842  }
843 
844  break;
845  case JetCounts: {
846  listJetCounts.push_back(*itObject);
847  }
848 
849  break;
850  default: {
851  // should not arrive here
852 
853  LogDebug("HLTLevel1GTSeed") << "\n HLTLevel1GTSeed::hltFilter "
854  << "\n Unknown object of type " << objTypeVal << " and index "
855  << (*itObject) << " in the seed list." << std::endl;
856  } break;
857  }
858 
859  iObj++;
860  }
861  }
862  }
863  }
864 
865  // eliminate duplicates
866 
867  listMuon.sort();
868  listMuon.unique();
869 
870  listIsoEG.sort();
871  listIsoEG.unique();
872 
873  listNoIsoEG.sort();
874  listNoIsoEG.unique();
875 
876  listCenJet.sort();
877  listCenJet.unique();
878 
879  listForJet.sort();
880  listForJet.unique();
881 
882  listTauJet.sort();
883  listTauJet.unique();
884 
885  listIsoTauJet.sort();
886  listIsoTauJet.unique();
887 
888  listETM.sort();
889  listETM.unique();
890 
891  listETT.sort();
892  listETT.unique();
893 
894  listHTT.sort();
895  listHTT.unique();
896 
897  listHTM.sort();
898  listHTM.unique();
899 
900  listJetCounts.sort();
901  listJetCounts.unique();
902 
903  //
904  // record the L1 physics objects in the HLT filterproduct
905  //
906 
907  // muon
908  if (!listMuon.empty()) {
910  iEvent.getByToken(m_l1MuonToken, l1Muon);
911 
912  if (!l1Muon.isValid()) {
913  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1MuonParticleCollection with input tag " << m_l1MuonTag
914  << "\nrequested in configuration, but not found in the event."
915  << "\nNo muon added to filterproduct." << std::endl;
916 
917  } else {
918  for (std::list<int>::const_iterator itObj = listMuon.begin(); itObj != listMuon.end(); ++itObj) {
920  }
921  }
922  }
923 
924  // EG (isolated)
925  if (!listIsoEG.empty()) {
927  iEvent.getByToken(m_l1IsoEGToken, l1IsoEG);
928 
929  if (!l1IsoEG.isValid()) {
930  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EmParticleCollection with input tag " << m_l1IsoEGTag
931  << "\nrequested in configuration, but not found in the event."
932  << "\nNo IsoEG added to filterproduct." << std::endl;
933 
934  } else {
935  for (std::list<int>::const_iterator itObj = listIsoEG.begin(); itObj != listIsoEG.end(); ++itObj) {
936  filterproduct.addObject(trigger::TriggerL1IsoEG, l1extra::L1EmParticleRef(l1IsoEG, *itObj));
937  }
938  }
939  }
940 
941  // EG (no isolation)
942  if (!listNoIsoEG.empty()) {
944  iEvent.getByToken(m_l1NoIsoEGToken, l1NoIsoEG);
945 
946  if (!l1NoIsoEG.isValid()) {
947  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EmParticleCollection with input tag " << m_l1NoIsoEGTag
948  << "\nrequested in configuration, but not found in the event."
949  << "\nNo NoIsoEG added to filterproduct." << std::endl;
950 
951  } else {
952  for (std::list<int>::const_iterator itObj = listNoIsoEG.begin(); itObj != listNoIsoEG.end(); ++itObj) {
953  filterproduct.addObject(trigger::TriggerL1NoIsoEG, l1extra::L1EmParticleRef(l1NoIsoEG, *itObj));
954  }
955  }
956  }
957 
958  // central jets
959  if (!listCenJet.empty()) {
961  iEvent.getByToken(m_l1CenJetToken, l1CenJet);
962 
963  if (!l1CenJet.isValid()) {
964  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1JetParticleCollection with input tag " << m_l1CenJetTag
965  << "\nrequested in configuration, but not found in the event."
966  << "\nNo CenJet added to filterproduct." << std::endl;
967 
968  } else {
969  for (std::list<int>::const_iterator itObj = listCenJet.begin(); itObj != listCenJet.end(); ++itObj) {
970  filterproduct.addObject(trigger::TriggerL1CenJet, l1extra::L1JetParticleRef(l1CenJet, *itObj));
971  }
972  }
973  }
974 
975  // forward jets
976  if (!listForJet.empty()) {
978  iEvent.getByToken(m_l1ForJetToken, l1ForJet);
979 
980  if (!l1ForJet.isValid()) {
981  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1JetParticleCollection with input tag " << m_l1ForJetTag
982  << "\nrequested in configuration, but not found in the event."
983  << "\nNo ForJet added to filterproduct." << std::endl;
984 
985  } else {
986  for (std::list<int>::const_iterator itObj = listForJet.begin(); itObj != listForJet.end(); ++itObj) {
987  filterproduct.addObject(trigger::TriggerL1ForJet, l1extra::L1JetParticleRef(l1ForJet, *itObj));
988  }
989  }
990  }
991 
992  // tau jets
993  if (!listTauJet.empty()) {
995  iEvent.getByToken(m_l1TauJetToken, l1TauJet);
996 
997  if (!l1TauJet.isValid()) {
998  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1JetParticleCollection with input tag " << m_l1TauJetTag
999  << "\nrequested in configuration, but not found in the event."
1000  << "\nNo TauJet added to filterproduct." << std::endl;
1001 
1002  } else {
1003  for (std::list<int>::const_iterator itObj = listTauJet.begin(); itObj != listTauJet.end(); ++itObj) {
1004  filterproduct.addObject(trigger::TriggerL1TauJet, l1extra::L1JetParticleRef(l1TauJet, *itObj));
1005  }
1006  }
1007  }
1008 
1009  // isotau jets
1010  if (!listIsoTauJet.empty()) {
1012  iEvent.getByToken(m_l1IsoTauJetToken, l1IsoTauJet);
1013 
1014  if (!l1IsoTauJet.isValid()) {
1015  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1JetParticleCollection with input tag " << m_l1IsoTauJetTag
1016  << "\nrequested in configuration, but not found in the event."
1017  << "\nNo IsoTauJet added to filterproduct." << std::endl;
1018 
1019  } else {
1020  for (std::list<int>::const_iterator itObj = listIsoTauJet.begin(); itObj != listIsoTauJet.end(); ++itObj) {
1021  filterproduct.addObject(trigger::TriggerL1TauJet, l1extra::L1JetParticleRef(l1IsoTauJet, *itObj));
1022  }
1023  }
1024  }
1025 
1026  // energy sums
1027  if (!listETM.empty()) {
1029  iEvent.getByToken(m_l1EtMissMETToken, l1EnergySums);
1030 
1031  if (!l1EnergySums.isValid()) {
1032  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMETTag
1033  << "\nrequested in configuration, but not found in the event."
1034  << "\nNo ETM added to filterproduct." << std::endl;
1035  } else if (l1EnergySums->empty()) {
1036  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMETTag
1037  << "\nfound in the event but with 0 size."
1038  << "\nNo ETM added to filterproduct." << std::endl;
1039 
1040  } else {
1041  for (std::list<int>::const_iterator itObj = listETM.begin(); itObj != listETM.end(); ++itObj) {
1042  filterproduct.addObject(trigger::TriggerL1ETM, l1extra::L1EtMissParticleRef(l1EnergySums, *itObj));
1043  }
1044  }
1045  }
1046 
1047  if (!listETT.empty()) {
1049  iEvent.getByToken(m_l1EtMissMETToken, l1EnergySums);
1050 
1051  if (!l1EnergySums.isValid()) {
1052  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMETTag
1053  << "\nrequested in configuration, but not found in the event."
1054  << "\nNo ETT added to filterproduct." << std::endl;
1055  } else if (l1EnergySums->empty()) {
1056  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMETTag
1057  << "\nfound in the event but with 0 size."
1058  << "\nNo ETT added to filterproduct." << std::endl;
1059 
1060  } else {
1061  for (std::list<int>::const_iterator itObj = listETT.begin(); itObj != listETT.end(); ++itObj) {
1062  filterproduct.addObject(trigger::TriggerL1ETT, l1extra::L1EtMissParticleRef(l1EnergySums, *itObj));
1063  }
1064  }
1065  }
1066 
1067  if (!listHTT.empty()) {
1069  iEvent.getByToken(m_l1EtMissMHTToken, l1EnergySums);
1070 
1071  if (!l1EnergySums.isValid()) {
1072  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMHTTag
1073  << "\nrequested in configuration, but not found in the event."
1074  << "\nNo HTT added to filterproduct." << std::endl;
1075 
1076  } else if (l1EnergySums->empty()) {
1077  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMHTTag
1078  << "\nfound in the event but with 0 size."
1079  << "\nNo HTT added to filterproduct." << std::endl;
1080 
1081  } else {
1082  for (std::list<int>::const_iterator itObj = listHTT.begin(); itObj != listHTT.end(); ++itObj) {
1083  filterproduct.addObject(trigger::TriggerL1HTT, l1extra::L1EtMissParticleRef(l1EnergySums, *itObj));
1084  }
1085  }
1086  }
1087 
1088  if (!listHTM.empty()) {
1090  iEvent.getByToken(m_l1EtMissMHTToken, l1EnergySums);
1091 
1092  if (!l1EnergySums.isValid()) {
1093  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMHTTag
1094  << "\nrequested in configuration, but not found in the event."
1095  << "\nNo HTM added to filterproduct." << std::endl;
1096 
1097  } else if (l1EnergySums->empty()) {
1098  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMHTTag
1099  << "\nfound in the event but with 0 size."
1100  << "\nNo HTM added to filterproduct." << std::endl;
1101 
1102  } else {
1103  for (std::list<int>::const_iterator itObj = listHTM.begin(); itObj != listHTM.end(); ++itObj) {
1104  filterproduct.addObject(trigger::TriggerL1HTM, l1extra::L1EtMissParticleRef(l1EnergySums, *itObj));
1105  }
1106  }
1107  }
1108 
1109  // TODO FIXME uncomment if block when JetCounts implemented
1110 
1111  // // jet counts
1112  // if (!listJetCounts.empty()) {
1113  // edm::Handle<l1extra::L1JetCounts> l1JetCounts;
1114  // iEvent.getByToken(m_l1CollectionsToken.label(), l1JetCounts);
1115  //
1116  // for (std::list<int>::const_iterator itObj = listJetCounts.begin();
1117  // itObj != listJetCounts.end(); ++itObj) {
1118  //
1119  // filterproduct.addObject(trigger::TriggerL1JetCounts,l1extra::L1JetCountsRefProd(l1JetCounts));
1120  // // FIXME: RefProd!
1121  //
1122  // }
1123  //
1124  // }
1125 
1126  return seedsResult;
1127 }
1128 
1129 // seeding is done ignoring if a L1 object fired or not
1130 // if the event is selected at L1, fill all the L1 objects of types corresponding to the
1131 // L1 conditions from the seeding logical expression for bunch crosses F, 0, 1
1132 // directly from L1Extra and use them as seeds at HLT
1133 // method and filter return true if at least an object is filled
1135  // if (m_isDebugEnabled) {
1136  //
1137  // LogTrace("HLTLevel1GTSeed") << "\n Printing muons from gtDigis\n " << std::endl;
1138  //
1139  // edm::Handle<std::vector<L1MuGMTCand> > muonData;
1140  // iEvent.getByToken("gtDigis", muonData);
1141  //
1142  // if (!muonData.isValid()) {
1143  // edm::LogWarning("HLTLevel1GTSeed")
1144  // << "\nWarning: std::vector<L1MuGMTCand> with input tag "
1145  // << "gtDigis"
1146  // << "\nrequested in configuration, but not found in the event.\n"
1147  // << std::endl;
1148  // } else {
1149  //
1150  // std::vector<L1MuGMTCand>::const_iterator itMuon;
1151  // for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
1152  //
1153  // LogTrace("HLTLevel1GTSeed") << (*itMuon) << std::endl;
1154  //
1155  // }
1156  //
1157  // }
1158  // }
1159 
1160  // define bools to prevent entering more copies of the objects
1161  bool includeMuon = true;
1162 
1163  bool includeIsoEG = true;
1164  bool includeNoIsoEG = true;
1165 
1166  bool includeCenJet = true;
1167  bool includeForJet = true;
1168  bool includeTauJet = true;
1169  bool includeIsoTauJet = true;
1170 
1171  bool includeETM = true;
1172  bool includeETT = true;
1173  bool includeHTT = true;
1174  bool includeHTM = true;
1175 
1176  bool includeJetCounts = true;
1177 
1178  //
1179  bool objectsInFilter = false;
1180 
1181  // loop over the list of required algorithms for seeding
1182  int iAlgo = -1;
1183 
1184  for (auto const& m_l1AlgoSeed : m_l1AlgoSeeds) {
1185  //
1186  iAlgo++;
1187  //
1188  int algBit = m_l1AlgoSeed.tokenNumber;
1189  std::string algName = m_l1AlgoSeed.tokenName;
1190  bool algResult = m_l1AlgoSeed.tokenResult;
1191 
1192  LogTrace("HLTLevel1GTSeed") << "\nHLTLevel1GTSeed::hltFilter "
1193  << "\n Algorithm " << algName << " with bit number " << algBit
1194  << " in the object map seed list"
1195  << "\n Algorithm result = " << algResult << std::endl;
1196 
1197  const std::vector<const std::vector<L1GtObject>*>& algoSeedsObjTypeVec = m_l1AlgoSeedsObjType[iAlgo];
1198 
1199  int minBxInEvent = (m_l1NrBxInEvent + 1) / 2 - m_l1NrBxInEvent;
1200  int maxBxInEvent = (m_l1NrBxInEvent + 1) / 2 - 1;
1201 
1202  // loop over all object types found for an algorithm and fill the lists
1203  //
1204  for (auto condObj : algoSeedsObjTypeVec) {
1205  for (auto itObj : (*condObj)) {
1206  LogTrace("HLTLevel1GTSeed") << " Object type in conditions from this algorithm = " << itObj << std::endl;
1207 
1208  switch (itObj) {
1209  case Mu: {
1210  if (includeMuon) {
1212  iEvent.getByToken(m_l1MuonToken, l1Muon);
1213 
1214  if (!l1Muon.isValid()) {
1215  edm::LogWarning("HLTLevel1GTSeed")
1216  << "\nWarning: L1MuonParticleCollection with input tag " << m_l1MuonTag
1217  << "\nrequested in configuration, but not found in the event."
1218  << "\nNo muon added to filterproduct." << std::endl;
1219 
1220  } else {
1221  int iObj = -1;
1222  for (auto objIter = l1Muon->begin(); objIter != l1Muon->end(); ++objIter) {
1223  iObj++;
1224 
1225  int bxNr = objIter->bx();
1226  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1227  objectsInFilter = true;
1229  }
1230  }
1231  }
1232  includeMuon = false;
1233  }
1234  }
1235 
1236  break;
1237  case IsoEG: {
1238  if (includeIsoEG) {
1240  iEvent.getByToken(m_l1IsoEGToken, l1IsoEG);
1241 
1242  if (!l1IsoEG.isValid()) {
1243  edm::LogWarning("HLTLevel1GTSeed")
1244  << "\nWarning: L1EmParticleCollection with input tag " << m_l1IsoEGTag
1245  << "\nrequested in configuration, but not found in the event."
1246  << "\nNo IsoEG added to filterproduct." << std::endl;
1247 
1248  } else {
1249  int iObj = -1;
1250  for (auto objIter = l1IsoEG->begin(); objIter != l1IsoEG->end(); ++objIter) {
1251  iObj++;
1252 
1253  int bxNr = objIter->bx();
1254  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1255  objectsInFilter = true;
1256  filterproduct.addObject(trigger::TriggerL1IsoEG, l1extra::L1EmParticleRef(l1IsoEG, iObj));
1257  }
1258  }
1259  }
1260  includeIsoEG = false;
1261  }
1262 
1263  } break;
1264  case NoIsoEG: {
1265  if (includeNoIsoEG) {
1267  iEvent.getByToken(m_l1NoIsoEGToken, l1NoIsoEG);
1268 
1269  if (!l1NoIsoEG.isValid()) {
1270  edm::LogWarning("HLTLevel1GTSeed")
1271  << "\nWarning: L1EmParticleCollection with input tag " << m_l1NoIsoEGTag
1272  << "\nrequested in configuration, but not found in the event."
1273  << "\nNo NoIsoEG added to filterproduct." << std::endl;
1274 
1275  } else {
1276  int iObj = -1;
1277  for (auto objIter = l1NoIsoEG->begin(); objIter != l1NoIsoEG->end(); ++objIter) {
1278  iObj++;
1279 
1280  int bxNr = objIter->bx();
1281  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1282  objectsInFilter = true;
1283  filterproduct.addObject(trigger::TriggerL1NoIsoEG, l1extra::L1EmParticleRef(l1NoIsoEG, iObj));
1284  }
1285  }
1286  }
1287  includeNoIsoEG = false;
1288  }
1289 
1290  } break;
1291  case CenJet: {
1292  if (includeCenJet) {
1294  iEvent.getByToken(m_l1CenJetToken, l1CenJet);
1295 
1296  if (!l1CenJet.isValid()) {
1297  edm::LogWarning("HLTLevel1GTSeed")
1298  << "\nWarning: L1JetParticleCollection with input tag " << m_l1CenJetTag
1299  << "\nrequested in configuration, but not found in the event."
1300  << "\nNo CenJet added to filterproduct." << std::endl;
1301 
1302  } else {
1303  int iObj = -1;
1304  for (auto objIter = l1CenJet->begin(); objIter != l1CenJet->end(); ++objIter) {
1305  iObj++;
1306 
1307  int bxNr = objIter->bx();
1308  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1309  objectsInFilter = true;
1310  filterproduct.addObject(trigger::TriggerL1CenJet, l1extra::L1JetParticleRef(l1CenJet, iObj));
1311  }
1312  }
1313  }
1314  includeCenJet = false;
1315  }
1316 
1317  }
1318 
1319  break;
1320  case ForJet: {
1321  if (includeForJet) {
1323  iEvent.getByToken(m_l1ForJetToken, l1ForJet);
1324 
1325  if (!l1ForJet.isValid()) {
1326  edm::LogWarning("HLTLevel1GTSeed")
1327  << "\nWarning: L1JetParticleCollection with input tag " << m_l1ForJetTag
1328  << "\nrequested in configuration, but not found in the event."
1329  << "\nNo ForJet added to filterproduct." << std::endl;
1330 
1331  } else {
1332  int iObj = -1;
1333  for (auto objIter = l1ForJet->begin(); objIter != l1ForJet->end(); ++objIter) {
1334  iObj++;
1335 
1336  int bxNr = objIter->bx();
1337  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1338  objectsInFilter = true;
1339  filterproduct.addObject(trigger::TriggerL1ForJet, l1extra::L1JetParticleRef(l1ForJet, iObj));
1340  }
1341  }
1342  }
1343  includeForJet = false;
1344  }
1345 
1346  }
1347 
1348  break;
1349  case TauJet: {
1350  if (includeTauJet) {
1352  iEvent.getByToken(m_l1TauJetToken, l1TauJet);
1353 
1354  if (!l1TauJet.isValid()) {
1355  edm::LogWarning("HLTLevel1GTSeed")
1356  << "\nWarning: L1JetParticleCollection with input tag " << m_l1TauJetTag
1357  << "\nrequested in configuration, but not found in the event."
1358  << "\nNo TauJet added to filterproduct." << std::endl;
1359 
1360  } else {
1361  int iObj = -1;
1362  for (auto objIter = l1TauJet->begin(); objIter != l1TauJet->end(); ++objIter) {
1363  iObj++;
1364 
1365  int bxNr = objIter->bx();
1366  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1367  objectsInFilter = true;
1368  filterproduct.addObject(trigger::TriggerL1TauJet, l1extra::L1JetParticleRef(l1TauJet, iObj));
1369  }
1370  }
1371  }
1372  includeTauJet = false;
1373  }
1374  } break;
1375  case HfRingEtSums: {
1376  if (includeIsoTauJet) {
1378  iEvent.getByToken(m_l1IsoTauJetToken, l1IsoTauJet);
1379 
1380  if (!l1IsoTauJet.isValid()) {
1381  edm::LogWarning("HLTLevel1GTSeed")
1382  << "\nWarning: L1JetParticleCollection with input tag " << m_l1IsoTauJetTag
1383  << "\nrequested in configuration, but not found in the event."
1384  << "\nNo IsoTauJet added to filterproduct." << std::endl;
1385 
1386  } else {
1387  int iObj = -1;
1388  for (auto objIter = l1IsoTauJet->begin(); objIter != l1IsoTauJet->end(); ++objIter) {
1389  iObj++;
1390 
1391  int bxNr = objIter->bx();
1392  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1393  objectsInFilter = true;
1394  filterproduct.addObject(trigger::TriggerL1TauJet, l1extra::L1JetParticleRef(l1IsoTauJet, iObj));
1395  }
1396  }
1397  }
1398  includeIsoTauJet = false;
1399  }
1400 
1401  }
1402 
1403  break;
1404  case ETM: {
1405  if (includeETM) {
1407  iEvent.getByToken(m_l1EtMissMETToken, l1EnergySums);
1408 
1409  if (!l1EnergySums.isValid()) {
1410  edm::LogWarning("HLTLevel1GTSeed")
1411  << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMETTag
1412  << "\nrequested in configuration, but not found in the event."
1413  << "\nNo ETM added to filterproduct." << std::endl;
1414 
1415  } else if (l1EnergySums->empty()) {
1416  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag "
1417  << m_l1EtMissMETTag << "\nfound in the event but with 0 size."
1418  << "\nNo ETM added to filterproduct." << std::endl;
1419 
1420  } else {
1421  int iObj = -1;
1422  for (auto objIter = l1EnergySums->begin(); objIter != l1EnergySums->end(); ++objIter) {
1423  iObj++;
1424 
1425  int bxNr = objIter->bx();
1426  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1427  objectsInFilter = true;
1428  filterproduct.addObject(trigger::TriggerL1ETM, l1extra::L1EtMissParticleRef(l1EnergySums, iObj));
1429  }
1430  }
1431  }
1432  includeETM = false;
1433  }
1434 
1435  }
1436 
1437  break;
1438  case ETT: {
1439  if (includeETT) {
1441  iEvent.getByToken(m_l1EtMissMETToken, l1EnergySums);
1442 
1443  if (!l1EnergySums.isValid()) {
1444  edm::LogWarning("HLTLevel1GTSeed")
1445  << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMETTag
1446  << "\nrequested in configuration, but not found in the event."
1447  << "\nNo ETT added to filterproduct." << std::endl;
1448 
1449  } else if (l1EnergySums->empty()) {
1450  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag "
1451  << m_l1EtMissMETTag << "\nfound in the event but with 0 size."
1452  << "\nNo ETT added to filterproduct." << std::endl;
1453 
1454  } else {
1455  int iObj = -1;
1456  for (auto objIter = l1EnergySums->begin(); objIter != l1EnergySums->end(); ++objIter) {
1457  iObj++;
1458 
1459  int bxNr = objIter->bx();
1460  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1461  objectsInFilter = true;
1462  filterproduct.addObject(trigger::TriggerL1ETT, l1extra::L1EtMissParticleRef(l1EnergySums, iObj));
1463  }
1464  }
1465  }
1466  includeETT = false;
1467  }
1468 
1469  }
1470 
1471  break;
1472  case HTT: {
1473  if (includeHTT) {
1475  iEvent.getByToken(m_l1EtMissMHTToken, l1EnergySums);
1476 
1477  if (!l1EnergySums.isValid()) {
1478  edm::LogWarning("HLTLevel1GTSeed")
1479  << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMHTTag
1480  << "\nrequested in configuration, but not found in the event."
1481  << "\nNo HTT added to filterproduct." << std::endl;
1482 
1483  } else if (l1EnergySums->empty()) {
1484  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag "
1485  << m_l1EtMissMHTTag << "\nfound in the event but with 0 size."
1486  << "\nNo HTT added to filterproduct." << std::endl;
1487 
1488  } else {
1489  int iObj = -1;
1490  for (auto objIter = l1EnergySums->begin(); objIter != l1EnergySums->end(); ++objIter) {
1491  iObj++;
1492 
1493  int bxNr = objIter->bx();
1494  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1495  objectsInFilter = true;
1496  filterproduct.addObject(trigger::TriggerL1HTT, l1extra::L1EtMissParticleRef(l1EnergySums, iObj));
1497  }
1498  }
1499  }
1500  includeHTT = false;
1501  }
1502  }
1503 
1504  break;
1505  case HTM: {
1506  if (includeHTM) {
1508  iEvent.getByToken(m_l1EtMissMHTToken, l1EnergySums);
1509 
1510  if (!l1EnergySums.isValid()) {
1511  edm::LogWarning("HLTLevel1GTSeed")
1512  << "\nWarning: L1EtMissParticleCollection with input tag " << m_l1EtMissMHTTag
1513  << "\nrequested in configuration, but not found in the event."
1514  << "\nNo HTM added to filterproduct." << std::endl;
1515 
1516  } else if (l1EnergySums->empty()) {
1517  edm::LogWarning("HLTLevel1GTSeed") << "\nWarning: L1EtMissParticleCollection with input tag "
1518  << m_l1EtMissMHTTag << "\nfound in the event but with 0 size."
1519  << "\nNo HTM added to filterproduct." << std::endl;
1520 
1521  } else {
1522  int iObj = -1;
1523  for (auto objIter = l1EnergySums->begin(); objIter != l1EnergySums->end(); ++objIter) {
1524  iObj++;
1525 
1526  int bxNr = objIter->bx();
1527  if ((bxNr >= minBxInEvent) && (bxNr <= maxBxInEvent)) {
1528  objectsInFilter = true;
1529  filterproduct.addObject(trigger::TriggerL1HTM, l1extra::L1EtMissParticleRef(l1EnergySums, iObj));
1530  }
1531  }
1532  }
1533  includeHTM = false;
1534  }
1535  }
1536 
1537  break;
1538  case JetCounts: {
1539  if (includeJetCounts) {
1540  // do nothing, JetCounts do not exist now
1541  }
1542  }
1543 
1544  break;
1545  default: {
1546  // should not arrive here
1547 
1548  LogDebug("HLTLevel1GTSeed") << "\n HLTLevel1GTSeed::hltFilter "
1549  << "\n Unknown object of type " << itObj << " in the seed list."
1550  << std::endl;
1551  } break;
1552  }
1553  }
1554  }
1555 
1556  LogTrace("HLTLevel1GTSeed") << std::endl;
1557  }
1558 
1559  return objectsInFilter;
1560 }
1561 
1562 // detailed print of filter content
1564  LogDebug("HLTLevel1GTSeed") << "\nHLTLevel1GTSeed::hltFilter "
1565  << "\n Dump TriggerFilterObjectWithRefs\n"
1566  << std::endl;
1567 
1568  std::vector<l1extra::L1MuonParticleRef> seedsL1Mu;
1569 
1570  std::vector<l1extra::L1EmParticleRef> seedsL1IsoEG;
1571  std::vector<l1extra::L1EmParticleRef> seedsL1NoIsoEG;
1572 
1573  std::vector<l1extra::L1JetParticleRef> seedsL1CenJet;
1574  std::vector<l1extra::L1JetParticleRef> seedsL1ForJet;
1575  std::vector<l1extra::L1JetParticleRef> seedsL1TauJet;
1576  std::vector<l1extra::L1JetParticleRef> seedsL1IsoTauJet;
1577 
1578  std::vector<l1extra::L1EtMissParticleRef> seedsL1ETM;
1579  std::vector<l1extra::L1EtMissParticleRef> seedsL1ETT;
1580  std::vector<l1extra::L1EtMissParticleRef> seedsL1HTT;
1581  std::vector<l1extra::L1EtMissParticleRef> seedsL1HTM;
1582 
1583  filterproduct.getObjects(trigger::TriggerL1Mu, seedsL1Mu);
1584  const size_t sizeSeedsL1Mu = seedsL1Mu.size();
1585 
1586  filterproduct.getObjects(trigger::TriggerL1IsoEG, seedsL1IsoEG);
1587  const size_t sizeSeedsL1IsoEG = seedsL1IsoEG.size();
1588 
1589  filterproduct.getObjects(trigger::TriggerL1NoIsoEG, seedsL1NoIsoEG);
1590  const size_t sizeSeedsL1NoIsoEG = seedsL1NoIsoEG.size();
1591 
1592  filterproduct.getObjects(trigger::TriggerL1CenJet, seedsL1CenJet);
1593  const size_t sizeSeedsL1CenJet = seedsL1CenJet.size();
1594 
1595  filterproduct.getObjects(trigger::TriggerL1ForJet, seedsL1ForJet);
1596  const size_t sizeSeedsL1ForJet = seedsL1ForJet.size();
1597 
1598  filterproduct.getObjects(trigger::TriggerL1TauJet, seedsL1TauJet);
1599  const size_t sizeSeedsL1TauJet = seedsL1TauJet.size();
1600 
1601  filterproduct.getObjects(trigger::TriggerL1TauJet, seedsL1IsoTauJet);
1602  const size_t sizeSeedsL1IsoTauJet = seedsL1IsoTauJet.size();
1603 
1604  filterproduct.getObjects(trigger::TriggerL1ETM, seedsL1ETM);
1605  const size_t sizeSeedsL1ETM = seedsL1ETM.size();
1606 
1607  filterproduct.getObjects(trigger::TriggerL1ETT, seedsL1ETT);
1608  const size_t sizeSeedsL1ETT = seedsL1ETT.size();
1609 
1610  filterproduct.getObjects(trigger::TriggerL1HTT, seedsL1HTT);
1611  const size_t sizeSeedsL1HTT = seedsL1HTT.size();
1612 
1613  filterproduct.getObjects(trigger::TriggerL1HTM, seedsL1HTM);
1614  const size_t sizeSeedsL1HTM = seedsL1HTM.size();
1615 
1616  LogTrace("HLTLevel1GTSeed") << " L1Mu seeds: " << sizeSeedsL1Mu << "\n"
1617  << " L1IsoEG seeds: " << sizeSeedsL1IsoEG << "\n"
1618  << " L1NoIsoEG seeds: " << sizeSeedsL1NoIsoEG << "\n"
1619  << " L1CenJet seeds: " << sizeSeedsL1CenJet << "\n"
1620  << " L1ForJet seeds: " << sizeSeedsL1ForJet << "\n"
1621  << " L1TauJet seeds: " << sizeSeedsL1TauJet << "\n"
1622  << " L1IsoTauJet seeds: " << sizeSeedsL1IsoTauJet << "\n"
1623  << " L1ETM seeds: " << sizeSeedsL1ETM << "\n"
1624  << " L1ETT seeds: " << sizeSeedsL1ETT << "\n"
1625  << " L1HTT seeds: " << sizeSeedsL1HTT << "\n"
1626  << " L1HTM seeds: " << sizeSeedsL1HTM << "\n"
1627  << std::endl;
1628 
1629  for (size_t i = 0; i != sizeSeedsL1Mu; i++) {
1631 
1632  LogTrace("HLTLevel1GTSeed") << "L1Mu "
1633  << "\t"
1634  << "q*PT = " << obj->charge() * obj->pt() << "\t"
1635  << "eta = " << obj->eta() << "\t"
1636  << "phi = " << obj->phi() << "\t"
1637  << "BX = " << obj->bx();
1638  }
1639 
1640  for (size_t i = 0; i != sizeSeedsL1IsoEG; i++) {
1642 
1643  LogTrace("HLTLevel1GTSeed") << "L1IsoEG "
1644  << "\t"
1645  << "ET = " << obj->et() << "\t"
1646  << "eta = " << obj->eta() << "\t"
1647  << "phi = " << obj->phi() << "\t"
1648  << "BX = " << obj->bx();
1649  ;
1650  }
1651 
1652  for (size_t i = 0; i != sizeSeedsL1NoIsoEG; i++) {
1654 
1655  LogTrace("HLTLevel1GTSeed") << "L1NoIsoEG"
1656  << "\t"
1657  << "ET = " << obj->et() << "\t"
1658  << "eta = " << obj->eta() << "\t"
1659  << "phi = " << obj->phi() << "\t"
1660  << "BX = " << obj->bx();
1661  }
1662 
1663  for (size_t i = 0; i != sizeSeedsL1CenJet; i++) {
1665 
1666  LogTrace("HLTLevel1GTSeed") << "L1CenJet "
1667  << "\t"
1668  << "ET = " << obj->et() << "\t"
1669  << "eta = " << obj->eta() << "\t"
1670  << "phi = " << obj->phi() << "\t"
1671  << "BX = " << obj->bx();
1672  }
1673 
1674  for (size_t i = 0; i != sizeSeedsL1ForJet; i++) {
1676 
1677  LogTrace("HLTLevel1GTSeed") << "L1ForJet "
1678  << "\t"
1679  << "ET = " << obj->et() << "\t"
1680  << "eta = " << obj->eta() << "\t"
1681  << "phi = " << obj->phi() << "\t"
1682  << "BX = " << obj->bx();
1683  }
1684 
1685  for (size_t i = 0; i != sizeSeedsL1TauJet; i++) {
1687 
1688  LogTrace("HLTLevel1GTSeed") << "L1TauJet "
1689  << "\t"
1690  << "ET = " << obj->et() << "\t"
1691  << "eta = " << obj->eta() << "\t"
1692  << "phi = " << obj->phi() << "\t"
1693  << "BX = " << obj->bx();
1694  }
1695 
1696  for (size_t i = 0; i != sizeSeedsL1IsoTauJet; i++) {
1698 
1699  LogTrace("HLTLevel1GTSeed") << "L1IsoTauJet "
1700  << "\t"
1701  << "ET = " << obj->et() << "\t"
1702  << "eta = " << obj->eta() << "\t"
1703  << "phi = " << obj->phi() << "\t"
1704  << "BX = " << obj->bx();
1705  }
1706 
1707  for (size_t i = 0; i != sizeSeedsL1ETM; i++) {
1709 
1710  LogTrace("HLTLevel1GTSeed") << "L1ETM "
1711  << "\t"
1712  << "ET = " << obj->etMiss() << "\t"
1713  << "phi = " << obj->phi() << "BX = " << obj->bx();
1714  }
1715 
1716  for (size_t i = 0; i != sizeSeedsL1ETT; i++) {
1718 
1719  LogTrace("HLTLevel1GTSeed") << "L1ETT "
1720  << "\t"
1721  << "ET = " << obj->etTotal() << "\t"
1722  << "BX = " << obj->bx();
1723  }
1724 
1725  for (size_t i = 0; i != sizeSeedsL1HTT; i++) {
1727 
1728  LogTrace("HLTLevel1GTSeed") << "L1HTT "
1729  << "\t"
1730  << "ET = " << obj->etTotal() << "\t"
1731  << "BX = " << obj->bx();
1732  }
1733 
1734  for (size_t i = 0; i != sizeSeedsL1HTM; i++) {
1736 
1737  LogTrace("HLTLevel1GTSeed") << "L1HTM "
1738  << "\t"
1739  << "ET = " << obj->etMiss() << "\t"
1740  << "phi = " << obj->phi() << "BX = " << obj->bx();
1741  }
1742 
1743  LogTrace("HLTLevel1GTSeed") << " \n\n" << std::endl;
1744 }
1745 
1746 // register as framework plugin
ConfigurationDescriptions.h
trigger::TriggerRefsCollections::addObject
void addObject(int id, const reco::RecoEcalCandidateRef &ref)
setters for L3 collections: (id=physics type, and Ref<C>)
Definition: TriggerRefsCollections.h:235
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1GtTriggerMenu.h
trigger::TriggerFilterObjectWithRefs
Definition: TriggerFilterObjectWithRefs.h:35
HLTLevel1GTSeed::m_l1ForJetTag
edm::InputTag m_l1ForJetTag
Definition: HLTLevel1GTSeed.h:173
Handle.h
L1JetParticleCollection
L1GtTriggerMenu::gtTriggerMenuName
const std::string & gtTriggerMenuName() const
Definition: L1GtTriggerMenu.h:91
HTM
Definition: L1GtObject.h:38
electrons_cff.bool
bool
Definition: electrons_cff.py:372
trigger::TriggerL1HTM
Definition: TriggerTypeDefs.h:39
L1GlobalTriggerReadoutRecord::finalOR
const cms_uint16_t finalOR(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:159
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
L1MuonParticleCollection
MessageLogger.h
L1GtTriggerMaskAlgoTrigRcd.h
funct::false
false
Definition: Factorize.h:34
HLTLevel1GTSeed::m_l1NoIsoEGToken
edm::EDGetTokenT< l1extra::L1EmParticleCollection > m_l1NoIsoEGToken
Definition: HLTLevel1GTSeed.h:170
edm::Handle::product
T const * product() const
Definition: Handle.h:70
L1GtTriggerMask.h
L1MuonParticleFwd.h
trigger::TriggerL1IsoEG
Definition: TriggerTypeDefs.h:32
l1extra::L1MuonParticleRef
edm::Ref< L1MuonParticleCollection > L1MuonParticleRef
Definition: L1MuonParticleFwd.h:32
l1extra::L1EmParticleRef
edm::Ref< L1EmParticleCollection > L1EmParticleRef
Definition: L1EmParticleFwd.h:32
ESHandle.h
ETM
Definition: L1GtObject.h:35
HLTLevel1GTSeed::m_l1GtMenuCacheID
unsigned long long m_l1GtMenuCacheID
Definition: HLTLevel1GTSeed.h:110
trigger::TriggerL1ForJet
Definition: TriggerTypeDefs.h:34
L1GlobalTriggerReadoutSetupFwd.h
HLTLevel1GTSeed::objectTypeVec
const std::vector< L1GtObject > * objectTypeVec(const int chipNumber, const std::string &cndName) const
get the vector of object types for a condition cndName on the GTL chip chipNumber
Definition: HLTLevel1GTSeed.cc:358
edm
HLT enums.
Definition: AlignableModifier.h:19
HLTLevel1GTSeed::m_l1GtReadoutRecordToken
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1GtReadoutRecordToken
Definition: HLTLevel1GTSeed.h:151
L1GtTriggerMenuRcd.h
HLTLevel1GTSeed::m_l1IsoTauJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_l1IsoTauJetToken
Definition: HLTLevel1GTSeed.h:178
HLTLevel1GTSeed::dumpTriggerFilterObjectWithRefs
void dumpTriggerFilterObjectWithRefs(trigger::TriggerFilterObjectWithRefs &) const
detailed print of filter content
Definition: HLTLevel1GTSeed.cc:1563
HLTLevel1GTSeed::m_l1AlgoSeeds
std::vector< L1GtLogicParser::OperandToken > m_l1AlgoSeeds
list of required algorithms for seeding
Definition: HLTLevel1GTSeed.h:116
HLTLevel1GTSeed::m_l1AlgoSeedsObjType
std::vector< std::vector< const std::vector< L1GtObject > * > > m_l1AlgoSeedsObjType
vector of object-type vectors for each condition in the required algorithms for seeding
Definition: HLTLevel1GTSeed.h:122
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
trigger::TriggerFilterObjectWithRefs::addCollectionTag
void addCollectionTag(const edm::InputTag &collectionTag)
collectionTags
Definition: TriggerFilterObjectWithRefs.h:55
HLTLevel1GTSeed::m_isDebugEnabled
bool m_isDebugEnabled
cache edm::isDebugEnabled()
Definition: HLTLevel1GTSeed.h:188
HLTLevel1GTSeed::m_l1MuonTag
edm::InputTag m_l1MuonTag
Definition: HLTLevel1GTSeed.h:165
L1GlobalTriggerObjectMap::operandTokenVector
const std::vector< L1GtLogicParser::OperandToken > & operandTokenVector() const
Definition: L1GlobalTriggerObjectMap.h:71
L1GtTriggerMaskTechTrigRcd.h
TriggerFilterObjectWithRefs.h
NoIsoEG
Definition: L1GtObject.h:30
HLTLevel1GTSeed::m_l1GtMenu
const L1GtTriggerMenu * m_l1GtMenu
trigger menu
Definition: HLTLevel1GTSeed.h:109
CombinationsInCond
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
Definition: L1GlobalTriggerObjectMapFwd.h:32
IsoEG
Definition: L1GtObject.h:31
edm::Handle
Definition: AssociativeIterator.h:50
L1GlobalTriggerReadoutRecord
Definition: L1GlobalTriggerReadoutRecord.h:46
trigger::TriggerRefsCollections::getObjects
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
Definition: TriggerRefsCollections.h:452
HLTLevel1GTSeed::hltFilter
bool hltFilter(edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) override
filter the event
Definition: HLTLevel1GTSeed.cc:237
edm::Ref< L1MuonParticleCollection >
HLTLevel1GTSeed::convertStringToBitNumber
void convertStringToBitNumber()
Definition: HLTLevel1GTSeed.cc:503
HLTLevel1GTSeed::m_l1NrBxInEvent
int m_l1NrBxInEvent
Definition: HLTLevel1GTSeed.h:137
HLTLevel1GTSeed::m_l1GtReadoutRecordTag
edm::InputTag m_l1GtReadoutRecordTag
InputTag for the L1 Global Trigger DAQ readout record.
Definition: HLTLevel1GTSeed.h:150
L1GlobalTriggerReadoutRecord::printGtDecision
void printGtDecision(std::ostream &myCout, int bxInEventValue) const
print global decision and algorithm decision word
Definition: L1GlobalTriggerReadoutRecord.cc:311
MakerMacros.h
L1GlobalTriggerObjectMap
Definition: L1GlobalTriggerObjectMap.h:33
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTLevel1GTSeed::m_l1CenJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_l1CenJetToken
Definition: HLTLevel1GTSeed.h:172
L1GtTriggerMenu::gtTriggerMenuInterface
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
Definition: L1GtTriggerMenu.h:86
HTT
Definition: L1GtObject.h:37
HLTLevel1GTSeed::seedsL1TriggerObjectMaps
bool seedsL1TriggerObjectMaps(edm::Event &, trigger::TriggerFilterObjectWithRefs &, const L1GtTriggerMask *, const L1GlobalTriggerReadoutRecord *, const int physicsDaqPartition)
seeding is done via L1 trigger object maps, considering the objects which fired in L1
Definition: HLTLevel1GTSeed.cc:612
L1GtTriggerMaskTechTrigRcd
Definition: L1GtTriggerMaskTechTrigRcd.h:39
ConditionMap
std::map< std::string, L1GtCondition * > ConditionMap
map containing the conditions
Definition: L1GtTriggerMenuFwd.h:28
L1GtTriggerMenuRcd
Definition: L1GtTriggerMenuRcd.h:32
HfRingEtSums
Definition: L1GtObject.h:41
HLTLevel1GTSeed::updateAlgoLogicParser
void updateAlgoLogicParser(const L1GtTriggerMenu *, const AlgorithmMap &)
Definition: HLTLevel1GTSeed.cc:372
AlgorithmMap
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
Definition: L1GtTriggerMenuFwd.h:31
L1GtTriggerMaskAlgoTrigRcd
Definition: L1GtTriggerMaskAlgoTrigRcd.h:39
edm::ESHandle
Definition: DTSurvey.h:22
CenJet
Definition: L1GtObject.h:32
L1GtTriggerMask
Definition: L1GtTriggerMask.h:33
HLTLevel1GTSeed::m_l1EtMissMETToken
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > m_l1EtMissMETToken
Definition: HLTLevel1GTSeed.h:180
dqmdumpme.k
k
Definition: dqmdumpme.py:60
HLTLevel1GTSeed::seedsL1Extra
bool seedsL1Extra(edm::Event &, trigger::TriggerFilterObjectWithRefs &) const
Definition: HLTLevel1GTSeed.cc:1134
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
l1extra::L1JetParticleRef
edm::Ref< L1JetParticleCollection > L1JetParticleRef
Definition: L1JetParticleFwd.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
L1EmParticleFwd.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLTLevel1GTSeed::m_l1CenJetTag
edm::InputTag m_l1CenJetTag
Definition: HLTLevel1GTSeed.h:171
HLTLevel1GTSeed::m_l1TauJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_l1TauJetToken
Definition: HLTLevel1GTSeed.h:176
edm::LogWarning
Definition: MessageLogger.h:141
HLTLevel1GTSeed::m_l1EtMissMETTag
edm::InputTag m_l1EtMissMETTag
Definition: HLTLevel1GTSeed.h:179
HLTLevel1GTSeed::m_l1AlgoSeedsRpn
std::vector< const std::vector< L1GtLogicParser::TokenRPN > * > m_l1AlgoSeedsRpn
vector of Rpn vectors for the required algorithms for seeding
Definition: HLTLevel1GTSeed.h:119
TauJet
Definition: L1GtObject.h:34
L1JetParticleFwd.h
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
MessageDrop.h
edm::ParameterSet
Definition: ParameterSet.h:36
L1EtMissParticleFwd.h
HLTLevel1GTSeed
Definition: HLTLevel1GTSeed.h:52
L1GtTriggerMenu
Definition: L1GtTriggerMenu.h:48
L1GtCondition.h
L1GlobalTriggerObjectMapRecord
Definition: L1GlobalTriggerObjectMapRecord.h:29
L1GtTriggerMask::gtTriggerMask
const std::vector< unsigned int > & gtTriggerMask() const
get the trigger mask
Definition: L1GtTriggerMask.h:47
trigger::TriggerL1Mu
enum start value shifted to 81 so as to avoid clashes with PDG codes
Definition: TriggerTypeDefs.h:30
L1GlobalTriggerReadoutRecord::decisionWord
const DecisionWord & decisionWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:186
L1GtLogicParser::operandTokenVector
std::vector< OperandToken > & operandTokenVector()
return the vector of operand tokens
Definition: L1GtLogicParser.h:111
HLTLevel1GTSeed::~HLTLevel1GTSeed
~HLTLevel1GTSeed() override
destructor
Definition: HLTLevel1GTSeed.cc:174
HLTLevel1GTSeed::m_l1UseAliasesForSeeding
bool m_l1UseAliasesForSeeding
seeding uses algorithm aliases instead of algorithm names, if value is "true"
Definition: HLTLevel1GTSeed.h:143
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTStreamFilter
Definition: HLTStreamFilter.h:29
L1GlobalTriggerObjectMapRecord::getObjectMap
const L1GlobalTriggerObjectMap * getObjectMap(const std::string &algoNameVal) const
return the object map for the algorithm algoNameVal
Definition: L1GlobalTriggerObjectMapRecord.cc:33
l1extra::L1EtMissParticleCollection
std::vector< L1EtMissParticle > L1EtMissParticleCollection
Definition: L1EtMissParticleFwd.h:32
ETT
Definition: L1GtObject.h:36
L1GtLogicParser::expressionSeedsOperandList
std::vector< L1GtLogicParser::OperandToken > expressionSeedsOperandList()
Definition: L1GtLogicParser.cc:1042
HLTLevel1GTSeed::m_l1NoIsoEGTag
edm::InputTag m_l1NoIsoEGTag
Definition: HLTLevel1GTSeed.h:169
L1GtTriggerMenu::gtAlgorithmAliasMap
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
Definition: L1GtTriggerMenu.h:192
HLTStreamFilter::saveTags
bool saveTags() const
Definition: HLTStreamFilter.h:47
edm::EventSetup
Definition: EventSetup.h:57
L1EmParticle.h
HLTLevel1GTSeed::m_l1IsoEGTag
edm::InputTag m_l1IsoEGTag
Definition: HLTLevel1GTSeed.h:167
HLTLevel1GTSeed::m_l1TauJetTag
edm::InputTag m_l1TauJetTag
Definition: HLTLevel1GTSeed.h:175
get
#define get
L1GtLogicParser::expressionResult
virtual const bool expressionResult() const
Definition: L1GtLogicParser.cc:579
HLTLevel1GTSeed::m_l1EtMissMHTTag
edm::InputTag m_l1EtMissMHTTag
Definition: HLTLevel1GTSeed.h:181
L1EmParticleCollection
InputTag.h
L1GtTriggerMenu::gtConditionMap
const std::vector< ConditionMap > & gtConditionMap() const
get / set / build the condition maps
Definition: L1GtTriggerMenu.h:80
HLTStreamFilter::makeHLTFilterDescription
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTStreamFilter.cc:26
Mu
Definition: L1GtObject.h:29
HLTLevel1GTSeed::m_l1MuonCollectionTag
edm::InputTag m_l1MuonCollectionTag
Meta InputTag for L1 muon collection.
Definition: HLTLevel1GTSeed.h:161
std
Definition: JetResolutionObject.h:76
Ref.h
l1extra::L1EtMissParticleRef
edm::Ref< L1EtMissParticleCollection > L1EtMissParticleRef
Definition: L1EtMissParticleFwd.h:34
trigger::TriggerL1HTT
Definition: TriggerTypeDefs.h:38
L1GlobalTriggerObjectMapFwd.h
trigger::TriggerL1NoIsoEG
Definition: TriggerTypeDefs.h:31
HLTLevel1GTSeed::m_l1AlgoLogicParser
L1GtLogicParser m_l1AlgoLogicParser
logic parser for m_l1SeedsLogicalExpression
Definition: HLTLevel1GTSeed.h:113
L1MuonParticle.h
L1GtLogicParser
Definition: L1GtLogicParser.h:31
trigger::TriggerL1TauJet
Definition: TriggerTypeDefs.h:35
triggerObjects_cff.l1Muon
l1Muon
Definition: triggerObjects_cff.py:26
L1GtLogicParser.h
Exception
Definition: hltDiff.cc:246
HLTLevel1GTSeed::debugPrint
void debugPrint(bool) const
Definition: HLTLevel1GTSeed.cc:535
HLTLevel1GTSeed::m_l1GtObjectMapTag
edm::InputTag m_l1GtObjectMapTag
InputTag for L1 Global Trigger object maps.
Definition: HLTLevel1GTSeed.h:154
L1GlobalTriggerObjectMap::getCombinationsInCond
const CombinationsInCond * getCombinationsInCond(const std::string &condNameVal) const
return all the combinations passing the requirements imposed in condition condNameVal
Definition: L1GlobalTriggerObjectMap.cc:34
EventSetup.h
trigger::TriggerL1ETM
Definition: TriggerTypeDefs.h:36
HLTLevel1GTSeed::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
parameter description
Definition: HLTLevel1GTSeed.cc:180
ForJet
Definition: L1GtObject.h:33
JetCounts
Definition: L1GtObject.h:39
Exception.h
HLTLevel1GTSeed::m_l1IsoTauJetTag
edm::InputTag m_l1IsoTauJetTag
Definition: HLTLevel1GTSeed.h:177
HLTLevel1GTSeed::m_l1EtMissMHTToken
edm::EDGetTokenT< l1extra::L1EtMissParticleCollection > m_l1EtMissMHTToken
Definition: HLTLevel1GTSeed.h:182
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:71
HLTLevel1GTSeed::m_l1SeedsLogicalExpression
std::string m_l1SeedsLogicalExpression
Definition: HLTLevel1GTSeed.h:147
HLTLevel1GTSeed::m_l1GlobalDecision
bool m_l1GlobalDecision
replace string "L1GlobalDecision" with bool to speed up the "if"
Definition: HLTLevel1GTSeed.h:185
L1GlobalTriggerReadoutRecord::technicalTriggerWord
const TechnicalTriggerWord & technicalTriggerWord(int bxInEventValue) const
Definition: L1GlobalTriggerReadoutRecord.cc:212
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
trigger::TriggerL1CenJet
Definition: TriggerTypeDefs.h:33
L1GlobalTriggerObjectMapRecord.h
L1EtMissParticle.h
ParameterSet.h
HLTLevel1GTSeed::m_l1ForJetToken
edm::EDGetTokenT< l1extra::L1JetParticleCollection > m_l1ForJetToken
Definition: HLTLevel1GTSeed.h:174
HLTLevel1GTSeed::m_l1ExtraTag
edm::InputTag m_l1ExtraTag
cached InputTags
Definition: HLTLevel1GTSeed.h:164
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
l1extra
Definition: L1EmParticle.h:26
HLTLevel1GTSeed::m_l1TechTriggerSeeding
bool m_l1TechTriggerSeeding
seeding done via technical trigger bits, if value is "true"
Definition: HLTLevel1GTSeed.h:140
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
HLTLevel1GTSeed::m_l1CollectionsTag
edm::InputTag m_l1CollectionsTag
Meta InputTag for L1 particle collections (except muon)
Definition: HLTLevel1GTSeed.h:158
L1GlobalTriggerObjectMap.h
HLTLevel1GTSeed::m_l1UseL1TriggerObjectMaps
bool m_l1UseL1TriggerObjectMaps
Definition: HLTLevel1GTSeed.h:133
L1JetParticle.h
HLTLevel1GTSeed::HLTLevel1GTSeed
HLTLevel1GTSeed(const edm::ParameterSet &)
constructor
Definition: HLTLevel1GTSeed.cc:76
HLTLevel1GTSeed::m_l1MuonToken
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > m_l1MuonToken
Definition: HLTLevel1GTSeed.h:166
HLTLevel1GTSeed.h
trigger::TriggerL1ETT
Definition: TriggerTypeDefs.h:37
edm::InputTag
Definition: InputTag.h:15
L1GlobalTriggerReadoutRecord.h
label
const char * label
Definition: PFTauDecayModeTools.cc:11
L1GtTriggerMenu::gtAlgorithmMap
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
Definition: L1GtTriggerMenu.h:187
L1GtObject
HLTLevel1GTSeed::m_l1IsoEGToken
edm::EDGetTokenT< l1extra::L1EmParticleCollection > m_l1IsoEGToken
Definition: HLTLevel1GTSeed.h:168
HLTLevel1GTSeed::m_l1GtObjectMapToken
edm::EDGetTokenT< L1GlobalTriggerObjectMapRecord > m_l1GtObjectMapToken
Definition: HLTLevel1GTSeed.h:155
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443