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