CMS 3D CMS Logo

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