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