CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
L1TMenuHelper Class Reference

#include <L1TMenuHelper.h>

Classes

struct  Tokens
 

Public Member Functions

std::string enumToStringL1GtConditionCategory (L1GtConditionCategory iConditionCategory)
 
std::string enumToStringL1GtConditionType (L1GtConditionType iConditionType)
 
std::string enumToStringL1GtObject (L1GtObject iObject)
 
unsigned int getEtaRangeByAlias (const TString &iCategory, const TString &iAlias)
 
std::map< std::string, std::string > getLUSOTrigger (const std::map< std::string, bool > &iCategories, int IndexRefPrescaleFactors, L1GtUtils const &myUtils)
 
int getPrescaleByAlias (const TString &iCategory, const TString &iAlias)
 
unsigned int getQualityAlias (const TString &iCategory, const TString &iAlias)
 
 L1TMenuHelper (const edm::EventSetup &iSetup, const Tokens &tokens)
 
std::map< std::string, std::string > testAlgos (const std::map< std::string, std::string > &)
 
 ~L1TMenuHelper ()
 

Static Public Member Functions

template<edm::Transition Tr = edm::Transition::Event>
static Tokens consumes (edm::ConsumesCollector iC)
 

Private Attributes

const L1GtTriggerMenum_l1GtMenu
 
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
 
std::vector< SingleObjectTriggerm_vTrigCenJet
 
std::vector< SingleObjectTriggerm_vTrigEG
 
std::vector< SingleObjectTriggerm_vTrigETM
 
std::vector< SingleObjectTriggerm_vTrigETT
 
std::vector< SingleObjectTriggerm_vTrigForJet
 
std::vector< SingleObjectTriggerm_vTrigHTM
 
std::vector< SingleObjectTriggerm_vTrigHTT
 
std::vector< SingleObjectTriggerm_vTrigIsoEG
 
std::vector< SingleObjectTriggerm_vTrigJet
 
std::vector< SingleObjectTriggerm_vTrigMu
 
std::vector< SingleObjectTriggerm_vTrigTauJet
 

Detailed Description

Definition at line 77 of file L1TMenuHelper.h.

Constructor & Destructor Documentation

◆ L1TMenuHelper()

L1TMenuHelper::L1TMenuHelper ( const edm::EventSetup iSetup,
const Tokens tokens 
)

Definition at line 37 of file L1TMenuHelper.cc.

References edm::EventSetup::getData(), L1TMenuHelper::Tokens::l1GtPfAlgo, and L1TMenuHelper::Tokens::menu.

37  {
38  m_l1GtMenu = &iSetup.getData(tokens.menu); // Getting the menu
40  &(iSetup.getData(tokens.l1GtPfAlgo).gtPrescaleFactors()); // Retriving the list of prescale sets
41 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const L1GtTriggerMenu * m_l1GtMenu

◆ ~L1TMenuHelper()

L1TMenuHelper::~L1TMenuHelper ( )

Definition at line 46 of file L1TMenuHelper.cc.

46 {}

Member Function Documentation

◆ consumes()

template<edm::Transition Tr = edm::Transition::Event>
static Tokens L1TMenuHelper::consumes ( edm::ConsumesCollector  iC)
inlinestatic

Definition at line 85 of file L1TMenuHelper.h.

References edm::ConsumesCollector::esConsumes(), L1TMenuHelper::Tokens::l1GtPfAlgo, and L1TMenuHelper::Tokens::menu.

85  {
86  Tokens tok;
87  tok.menu = iC.esConsumes<Tr>();
88  tok.l1GtPfAlgo = iC.esConsumes<Tr>();
89  return tok;
90  }

◆ enumToStringL1GtConditionCategory()

string L1TMenuHelper::enumToStringL1GtConditionCategory ( L1GtConditionCategory  iConditionCategory)

Definition at line 553 of file L1TMenuHelper.cc.

References CondBptx, CondCalo, CondCastor, CondCorrelation, CondEnergySum, CondExternal, CondHfBitCounts, CondHfRingEtSums, CondJetCounts, CondMuon, CondNull, and MillePedeFileConverter_cfg::out.

553  {
554  string out;
555 
556  switch (iConditionCategory) {
557  case CondNull:
558  out = "CondNull";
559  break;
560  case CondMuon:
561  out = "CondMuon";
562  break;
563  case CondCalo:
564  out = "CondCalo";
565  break;
566  case CondEnergySum:
567  out = "CondEnergySum";
568  break;
569  case CondJetCounts:
570  out = "CondJetCounts";
571  break;
572  case CondCorrelation:
573  out = "CondCorrelation";
574  break;
575  case CondCastor:
576  out = "CondCastor";
577  break;
578  case CondHfBitCounts:
579  out = "CondHfBitCounts";
580  break;
581  case CondHfRingEtSums:
582  out = "CondHfRingEtSums";
583  break;
584  case CondBptx:
585  out = "CondBptx";
586  break;
587  case CondExternal:
588  out = "CondExternal";
589  break;
590  default:
591  out = "Unknown";
592  break;
593  };
594 
595  return out;
596 }

◆ enumToStringL1GtConditionType()

string L1TMenuHelper::enumToStringL1GtConditionType ( L1GtConditionType  iConditionType)

Definition at line 486 of file L1TMenuHelper.cc.

References MillePedeFileConverter_cfg::out, Type1s, Type2cor, Type2s, Type2wsc, Type3s, Type4s, TypeBptx, TypeCastor, TypeETM, TypeETT, TypeExternal, TypeHfBitCounts, TypeHfRingEtSums, TypeHTM, TypeHTT, TypeJetCounts, and TypeNull.

486  {
487  string out;
488 
489  switch (iConditionType) {
490  case TypeNull:
491  out = "TypeNull";
492  break;
493  case Type1s:
494  out = "Type1s";
495  break;
496  case Type2s:
497  out = "Type2s";
498  break;
499  case Type2wsc:
500  out = "Type2wsc";
501  break;
502  case Type2cor:
503  out = "Type2cor";
504  break;
505  case Type3s:
506  out = "Type3s";
507  break;
508  case Type4s:
509  out = "Type4s";
510  break;
511  case TypeETM:
512  out = "TypeETM";
513  break;
514  case TypeETT:
515  out = "TypeETT";
516  break;
517  case TypeHTT:
518  out = "TypeHTT";
519  break;
520  case TypeHTM:
521  out = "TypeHTM";
522  break;
523  case TypeJetCounts:
524  out = "TypeJetCounts";
525  break;
526  case TypeCastor:
527  out = "TypeCastor";
528  break;
529  case TypeHfBitCounts:
530  out = "TypeHfBitCounts";
531  break;
532  case TypeHfRingEtSums:
533  out = "TypeHfRingEtSums";
534  break;
535  case TypeBptx:
536  out = "TypeBptx";
537  break;
538  case TypeExternal:
539  out = "TypeExternal";
540  break;
541  default:
542  out = "Unknown";
543  break;
544  };
545 
546  return out;
547 }

◆ enumToStringL1GtObject()

string L1TMenuHelper::enumToStringL1GtObject ( L1GtObject  iObject)

Definition at line 419 of file L1TMenuHelper.cc.

References BPTX, Castor, CenJet, ETM, ETT, ForJet, GtExternal, HfBitCounts, HfRingEtSums, HTM, HTT, IsoEG, JetCounts, Mu, NoIsoEG, MillePedeFileConverter_cfg::out, TauJet, and TechTrig.

419  {
420  string out;
421 
422  switch (iObject) {
423  case Mu:
424  out = "Mu";
425  break;
426  case NoIsoEG:
427  out = "NoIsoEG";
428  break;
429  case IsoEG:
430  out = "IsoEG";
431  break;
432  case CenJet:
433  out = "CenJet";
434  break;
435  case ForJet:
436  out = "ForJet";
437  break;
438  case TauJet:
439  out = "TauJet";
440  break;
441  case ETM:
442  out = "ETM";
443  break;
444  case ETT:
445  out = "ETT";
446  break;
447  case HTT:
448  out = "HTT";
449  break;
450  case HTM:
451  out = "HTM";
452  break;
453  case JetCounts:
454  out = "JetCounts";
455  break;
456  case HfBitCounts:
457  out = "HfBitCounts";
458  break;
459  case HfRingEtSums:
460  out = "HfRingEtSums";
461  break;
462  case TechTrig:
463  out = "TechTrig";
464  break;
465  case Castor:
466  out = "Castor";
467  break;
468  case BPTX:
469  out = "BPTX";
470  break;
471  case GtExternal:
472  out = "GtExternal";
473  break;
474  default:
475  out = "Unknown";
476  break;
477  };
478 
479  return out;
480 }
Definition: L1GtObject.h:38
Definition: L1GtObject.h:36
Definition: L1GtObject.h:29
Definition: L1GtObject.h:35
Definition: L1GtObject.h:37

◆ getEtaRangeByAlias()

unsigned int L1TMenuHelper::getEtaRangeByAlias ( const TString &  iCategory,
const TString &  iAlias 
)

Definition at line 674 of file L1TMenuHelper.cc.

References SiStripOfflineCRack_cfg::alias, mps_fire::i, and MillePedeFileConverter_cfg::out.

Referenced by L1TRate_Offline::bookHistograms(), and L1TRate::bookHistograms().

674  {
675  unsigned int out = -1;
676 
677  if (iCategory == "Mu") {
678  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
679  if (m_vTrigMu[i].alias == iAlias) {
680  return m_vTrigMu[i].etaRange;
681  }
682  }
683  } else if (iCategory == "EG") {
684  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
685  if (m_vTrigEG[i].alias == iAlias) {
686  return m_vTrigEG[i].etaRange;
687  }
688  }
689  } else if (iCategory == "IsoEG") {
690  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
691  if (m_vTrigIsoEG[i].alias == iAlias) {
692  return m_vTrigIsoEG[i].etaRange;
693  }
694  }
695  } else if (iCategory == "Jet") {
696  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
697  if (m_vTrigJet[i].alias == iAlias) {
698  return m_vTrigJet[i].etaRange;
699  }
700  }
701  } else if (iCategory == "CenJet") {
702  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
703  if (m_vTrigCenJet[i].alias == iAlias) {
704  return m_vTrigCenJet[i].etaRange;
705  }
706  }
707  } else if (iCategory == "ForJet") {
708  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
709  if (m_vTrigForJet[i].alias == iAlias) {
710  return m_vTrigForJet[i].etaRange;
711  }
712  }
713  } else if (iCategory == "TauJet") {
714  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
715  if (m_vTrigTauJet[i].alias == iAlias) {
716  return m_vTrigTauJet[i].etaRange;
717  }
718  }
719  } else if (iCategory == "ETT") {
720  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
721  if (m_vTrigETT[i].alias == iAlias) {
722  return m_vTrigETT[i].etaRange;
723  }
724  }
725  } else if (iCategory == "ETM") {
726  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
727  if (m_vTrigETM[i].alias == iAlias) {
728  return m_vTrigETM[i].etaRange;
729  }
730  }
731  } else if (iCategory == "HTT") {
732  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
733  if (m_vTrigHTT[i].alias == iAlias) {
734  return m_vTrigHTT[i].etaRange;
735  }
736  }
737  } else if (iCategory == "HTM") {
738  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
739  if (m_vTrigHTM[i].alias == iAlias) {
740  return m_vTrigHTM[i].etaRange;
741  }
742  }
743  }
744 
745  return out;
746 }
std::vector< SingleObjectTrigger > m_vTrigJet
std::vector< SingleObjectTrigger > m_vTrigETM
std::vector< SingleObjectTrigger > m_vTrigMu
std::vector< SingleObjectTrigger > m_vTrigTauJet
std::vector< SingleObjectTrigger > m_vTrigHTM
std::vector< SingleObjectTrigger > m_vTrigHTT
std::vector< SingleObjectTrigger > m_vTrigIsoEG
std::vector< SingleObjectTrigger > m_vTrigETT
std::vector< SingleObjectTrigger > m_vTrigCenJet
std::vector< SingleObjectTrigger > m_vTrigForJet
std::vector< SingleObjectTrigger > m_vTrigEG

◆ getLUSOTrigger()

map< string, string > L1TMenuHelper::getLUSOTrigger ( const std::map< std::string, bool > &  iCategories,
int  IndexRefPrescaleFactors,
L1GtUtils const &  myUtils 
)

Definition at line 52 of file L1TMenuHelper.cc.

References a, L1GtAlgorithm::algoRpnVector(), SingleObjectTrigger::alias, b, SingleObjectTrigger::bit, CenJet, edm::check(), L1GtCondition::condCategory(), SingleObjectCondition::conditionCategory, SingleObjectCondition::conditionType, L1GtCondition::condName(), L1GtCondition::condType(), relativeConstraints::error, SingleObjectCondition::etaRange, SingleObjectTrigger::etaRange, generateTowerEtThresholdLUT::etaRange, ETM, ETT, ForJet, HTM, HTT, mps_fire::i, IsoEG, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, submitPVResolutionJobs::key, HLT_2024v14_cff::maxThreshold, Mu, SingleObjectCondition::name, NoIsoEG, L1GtCondition::nrObjects(), SingleObjectCondition::object, SingleObjectTrigger::object, L1GtMuonTemplate::objectParameter(), L1GtCondition::objectType(), L1GtLogicParser::OP_AND, L1GtLogicParser::OP_OPERAND, MillePedeFileConverter_cfg::out, SingleObjectTrigger::prescale, SingleObjectCondition::quality, SingleObjectTrigger::quality, jetUpdater_cfi::sort, TauJet, SingleObjectCondition::threshold, SingleObjectTrigger::threshold, L1GtUtils::triggerMask(), Type1s, TypeETM, TypeETT, TypeHTM, and TypeHTT.

Referenced by L1TRate_Offline::bookHistograms(), L1TRate::bookHistograms(), L1TSync::bookHistograms(), and L1TSync_Offline::bookHistograms().

54  {
55  map<string, string> out;
56 
57  // Getting information from the menu
58  const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
59  const vector<vector<L1GtMuonTemplate> >* vMuonConditions = &m_l1GtMenu->vecMuonTemplate();
60  const vector<vector<L1GtCaloTemplate> >* vCaloConditions = &m_l1GtMenu->vecCaloTemplate();
61  const vector<vector<L1GtEnergySumTemplate> >* vEnergySumConditions = &m_l1GtMenu->vecEnergySumTemplate();
62 
63  // Getting reference prescales
64  const vector<int>& refPrescaleFactors = (*m_prescaleFactorsAlgoTrig).at(IndexRefPrescaleFactors);
65 
66  AlgorithmMap MyAlgos;
67 
68  map<string, SingleObjectCondition> myConditions;
69 
70  for (unsigned int a = 0; a < vMuonConditions->size(); a++) {
71  for (unsigned int b = 0; b < (*vMuonConditions)[a].size(); b++) {
72  const L1GtMuonTemplate* MuonCondition = &(*vMuonConditions)[a][b];
73 
74  // Selecting conditions that require single objects
75  if (MuonCondition->condType() == Type1s && MuonCondition->nrObjects() == 1) {
76  SingleObjectCondition tCondition;
77 
78  tCondition.name = MuonCondition->condName();
79  tCondition.conditionCategory = MuonCondition->condCategory();
80  tCondition.conditionType = MuonCondition->condType();
81  tCondition.object = MuonCondition->objectType()[0];
82  tCondition.threshold = (*MuonCondition->objectParameter())[0].ptHighThreshold;
83  tCondition.quality = (*MuonCondition->objectParameter())[0].qualityRange;
84  tCondition.etaRange = (*MuonCondition->objectParameter())[0].etaRange;
85 
86  myConditions[MuonCondition->condName()] = tCondition;
87  }
88  }
89  }
90 
91  for (unsigned int a = 0; a < vCaloConditions->size(); a++) {
92  for (unsigned int b = 0; b < (*vCaloConditions)[a].size(); b++) {
93  const L1GtCaloTemplate* CaloCondition = &(*vCaloConditions)[a][b];
94 
95  if (CaloCondition->condType() == Type1s && CaloCondition->nrObjects() == 1) {
96  SingleObjectCondition tCondition;
97 
98  tCondition.name = CaloCondition->condName();
99  tCondition.conditionCategory = CaloCondition->condCategory();
100  tCondition.conditionType = CaloCondition->condType();
101  tCondition.object = CaloCondition->objectType()[0];
102  tCondition.threshold = (*CaloCondition->objectParameter())[0].etThreshold;
103  tCondition.quality = 0;
104  tCondition.etaRange = (*CaloCondition->objectParameter())[0].etaRange;
105 
106  myConditions[CaloCondition->condName()] = tCondition;
107  }
108  }
109  }
110 
111  for (unsigned int a = 0; a < vEnergySumConditions->size(); a++) {
112  for (unsigned int b = 0; b < (*vEnergySumConditions)[a].size(); b++) {
113  const L1GtEnergySumTemplate* EnergySumCondition = &(*vEnergySumConditions)[a][b];
114 
115  if ((EnergySumCondition->condType() == TypeETT || EnergySumCondition->condType() == TypeETM ||
116  EnergySumCondition->condType() == TypeHTT || EnergySumCondition->condType() == TypeHTM) &&
117  EnergySumCondition->nrObjects() == 1) {
118  SingleObjectCondition tCondition;
119 
120  tCondition.name = EnergySumCondition->condName();
121  tCondition.conditionCategory = EnergySumCondition->condCategory();
122  tCondition.conditionType = EnergySumCondition->condType();
123  tCondition.object = EnergySumCondition->objectType()[0];
124  tCondition.threshold = (*EnergySumCondition->objectParameter())[0].etThreshold;
125  tCondition.quality = 0;
126  tCondition.etaRange = 0;
127 
128  myConditions[EnergySumCondition->condName()] = tCondition;
129  }
130  }
131  }
132 
133  for (CItAlgo iAlgo = theAlgoMap->begin(); iAlgo != theAlgoMap->end(); ++iAlgo) {
134  int error;
135 
136  bool algoIsValid = true;
137  unsigned int maxThreshold = 0;
138  int tAlgoMask = myUtils.triggerMask(iAlgo->first, error);
139  L1GtObject tObject = Mu; // Initial dummy value
140  unsigned int tQuality = 0; // Only aplicable to Muons
141  unsigned int tEtaRange = 0;
142 
143  // Objects associated
144  bool isMu = false;
145  bool isNoIsoEG = false;
146  bool isIsoEG = false;
147  bool isCenJet = false;
148  bool isForJet = false;
149  bool isTauJet = false;
150  bool isETM = false;
151  bool isETT = false;
152  bool isHTT = false;
153  bool isHTM = false;
154 
155  // Check if the trigger is masked
156  if (tAlgoMask != 0) {
157  algoIsValid = false;
158  } else {
159  const L1GtAlgorithm* pAlgo = &(iAlgo->second);
160 
161  for (unsigned int i = 0; i < pAlgo->algoRpnVector().size(); i++) {
162  // Algorithm cannot be single algo if it requires 2 simultaneous conditions
163  // FIXME: Should be improved to be sure one of the conditions is not technical (ex: BPTX)
164  if (pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_AND) {
165  algoIsValid = false;
166  break;
167  } else if (pAlgo->algoRpnVector()[i].operation == L1GtLogicParser::OP_OPERAND) {
168  string AlgoCondition = pAlgo->algoRpnVector()[i].operand;
169  map<string, SingleObjectCondition>::const_iterator ciCond = myConditions.find(AlgoCondition);
170 
171  // If there is no matching condition (i.e. its not a single object or energy sum condition)
172  // ignore this this L1 algo
173  if (ciCond == myConditions.end()) {
174  algoIsValid = false;
175  break;
176  }
177  // If trigger was not invalidated by this condition we register its objects and threshold
178  else {
179  // Updating value for the object with the maximum threshold for this triger
180  if (maxThreshold < (*ciCond).second.threshold) {
181  maxThreshold = (*ciCond).second.threshold;
182  tObject = (*ciCond).second.object;
183  tQuality = (*ciCond).second.quality;
184  tEtaRange = (*ciCond).second.etaRange;
185  }
186 
187  if ((*ciCond).second.object == Mu) {
188  isMu = true;
189  } else if ((*ciCond).second.object == NoIsoEG) {
190  isNoIsoEG = true;
191  } else if ((*ciCond).second.object == IsoEG) {
192  isIsoEG = true;
193  } else if ((*ciCond).second.object == CenJet) {
194  isCenJet = true;
195  } else if ((*ciCond).second.object == ForJet) {
196  isForJet = true;
197  } else if ((*ciCond).second.object == TauJet) {
198  isTauJet = true;
199  } else if ((*ciCond).second.object == ETM) {
200  isETM = true;
201  } else if ((*ciCond).second.object == ETT) {
202  isETT = true;
203  } else if ((*ciCond).second.object == HTT) {
204  isHTT = true;
205  } else if ((*ciCond).second.object == HTM) {
206  isHTM = true;
207  }
208  }
209  }
210  }
211  }
212 
213  if (algoIsValid) {
214  SingleObjectTrigger tTrigger;
215  tTrigger.alias = iAlgo->first;
216  tTrigger.bit = (iAlgo->second).algoBitNumber();
217  tTrigger.prescale = refPrescaleFactors[tTrigger.bit];
218  tTrigger.threshold = maxThreshold;
219  tTrigger.object = tObject;
220  tTrigger.quality = tQuality; // Only aplicable to Muons
221  tTrigger.etaRange = tEtaRange; // Only aplicable to EG and Muons
222 
223  // Counting the number of different trigger conditions
224  int nCond = 0;
225  if (isMu) {
226  nCond++;
227  }
228  if (isNoIsoEG) {
229  nCond++;
230  }
231  if (isIsoEG) {
232  nCond++;
233  }
234  if (isCenJet) {
235  nCond++;
236  }
237  if (isForJet) {
238  nCond++;
239  }
240  if (isTauJet) {
241  nCond++;
242  }
243  if (isETM) {
244  nCond++;
245  }
246  if (isETT) {
247  nCond++;
248  }
249  if (isHTT) {
250  nCond++;
251  }
252  if (isHTM) {
253  nCond++;
254  }
255 
256  // If the trigger matched one of the pre-defined categories it is added to
257  // the corresponding trigger vector
258  if (nCond == 1 && isMu == true) {
259  //TODO: tTrigger.etaRange
260  m_vTrigMu.push_back(tTrigger);
261  } else if (nCond == 2 && isNoIsoEG == true && isIsoEG == true) {
262  m_vTrigEG.push_back(tTrigger);
263  } else if (nCond == 1 && isIsoEG == true) {
264  m_vTrigIsoEG.push_back(tTrigger);
265  } else if (nCond == 3 && isCenJet == true && isForJet == true && isTauJet == true) {
266  m_vTrigJet.push_back(tTrigger);
267  } else if (nCond == 1 && isCenJet == true) {
268  m_vTrigCenJet.push_back(tTrigger);
269  } else if (nCond == 1 && isForJet == true) {
270  m_vTrigForJet.push_back(tTrigger);
271  } else if (nCond == 1 && isTauJet == true) {
272  m_vTrigTauJet.push_back(tTrigger);
273  } else if (nCond == 1 && isETT == true) {
274  m_vTrigETT.push_back(tTrigger);
275  } else if (nCond == 1 && isETM == true) {
276  m_vTrigETM.push_back(tTrigger);
277  } else if (nCond == 1 && isHTT == true) {
278  m_vTrigHTT.push_back(tTrigger);
279  } else if (nCond == 1 && isHTM == true) {
280  m_vTrigHTM.push_back(tTrigger);
281  }
282  }
283  }
284 
285  //--------------------------------------------------------------------------------------
286  // Now that we have built vectors of SingleObjectTrigger by category we can select for
287  // each category the lowest unprescaled single object trigger.
288  // NOTE: Since it is not guaranteed that all categories will have at least one unprescaled
289  // trigger this method will return in that case the lowest prescale trigger available
290  //--------------------------------------------------------------------------------------
291 
292  string selTrigMu = "Undefined";
293  string selTrigEG = "Undefined";
294  string selTrigIsoEG = "Undefined";
295  string selTrigJet = "Undefined";
296  string selTrigCenJet = "Undefined";
297  string selTrigForJet = "Undefined";
298  string selTrigTauJet = "Undefined";
299  string selTrigETT = "Undefined";
300  string selTrigETM = "Undefined";
301  string selTrigHTT = "Undefined";
302  string selTrigHTM = "Undefined";
303 
304  if (!m_vTrigMu.empty()) {
305  sort(m_vTrigMu.begin(), m_vTrigMu.end());
306  selTrigMu = m_vTrigMu[0].alias;
307  }
308  if (!m_vTrigEG.empty()) {
309  sort(m_vTrigEG.begin(), m_vTrigEG.end());
310  selTrigEG = m_vTrigEG[0].alias;
311  }
312  if (!m_vTrigIsoEG.empty()) {
313  sort(m_vTrigIsoEG.begin(), m_vTrigIsoEG.end());
314  selTrigIsoEG = m_vTrigIsoEG[0].alias;
315  }
316  if (!m_vTrigJet.empty()) {
317  sort(m_vTrigJet.begin(), m_vTrigJet.end());
318  selTrigJet = m_vTrigJet[0].alias;
319  }
320  if (!m_vTrigCenJet.empty()) {
321  sort(m_vTrigCenJet.begin(), m_vTrigCenJet.end());
322  selTrigCenJet = m_vTrigCenJet[0].alias;
323  }
324  if (!m_vTrigForJet.empty()) {
325  sort(m_vTrigForJet.begin(), m_vTrigForJet.end());
326  selTrigForJet = m_vTrigForJet[0].alias;
327  }
328  if (!m_vTrigTauJet.empty()) {
329  sort(m_vTrigTauJet.begin(), m_vTrigTauJet.end());
330  selTrigTauJet = m_vTrigTauJet[0].alias;
331  }
332  if (!m_vTrigETT.empty()) {
333  sort(m_vTrigETT.begin(), m_vTrigETT.end());
334  selTrigETT = m_vTrigETT[0].alias;
335  }
336  if (!m_vTrigETM.empty()) {
337  sort(m_vTrigETM.begin(), m_vTrigETM.end());
338  selTrigETM = m_vTrigETM[0].alias;
339  }
340  if (!m_vTrigHTT.empty()) {
341  sort(m_vTrigHTT.begin(), m_vTrigHTT.end());
342  selTrigHTT = m_vTrigHTT[0].alias;
343  }
344  if (!m_vTrigHTM.empty()) {
345  sort(m_vTrigHTM.begin(), m_vTrigHTM.end());
346  selTrigHTM = m_vTrigHTM[0].alias;
347  }
348 
349  auto check = [](const map<string, bool>& cats, const char* key) -> bool {
350  auto it = cats.find(key);
351  if (it != cats.end())
352  return it->second;
353 
354  return false;
355  };
356 
357  if (check(iCategories, "Mu")) {
358  out["Mu"] = selTrigMu;
359  }
360  if (check(iCategories, "EG")) {
361  out["EG"] = selTrigEG;
362  }
363  if (check(iCategories, "IsoEG")) {
364  out["IsoEG"] = selTrigIsoEG;
365  }
366  if (check(iCategories, "Jet")) {
367  out["Jet"] = selTrigJet;
368  }
369  if (check(iCategories, "CenJet")) {
370  out["CenJet"] = selTrigCenJet;
371  }
372  if (check(iCategories, "ForJet")) {
373  out["ForJet"] = selTrigForJet;
374  }
375  if (check(iCategories, "TauJet")) {
376  out["TauJet"] = selTrigTauJet;
377  }
378  if (check(iCategories, "ETT")) {
379  out["ETT"] = selTrigETT;
380  }
381  if (check(iCategories, "ETM")) {
382  out["ETM"] = selTrigETM;
383  }
384  if (check(iCategories, "HTT")) {
385  out["HTT"] = selTrigHTT;
386  }
387  if (check(iCategories, "HTM")) {
388  out["HTM"] = selTrigHTM;
389  }
390 
391  return out;
392 }
Definition: L1GtObject.h:38
L1GtConditionCategory conditionCategory
Definition: L1TMenuHelper.h:36
std::vector< SingleObjectTrigger > m_vTrigJet
unsigned int quality
Definition: L1TMenuHelper.h:51
const std::vector< std::vector< L1GtEnergySumTemplate > > & vecEnergySumTemplate() const
std::vector< SingleObjectTrigger > m_vTrigETM
std::vector< SingleObjectTrigger > m_vTrigMu
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
Definition: L1GtObject.h:36
unsigned int etaRange
Definition: L1TMenuHelper.h:40
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
Definition: L1GtObject.h:29
const L1GtTriggerMenu * m_l1GtMenu
const L1GtConditionCategory & condCategory() const
get / set the category of the condition
Definition: L1GtCondition.h:57
L1GtConditionType conditionType
Definition: L1TMenuHelper.h:37
std::vector< SingleObjectTrigger > m_vTrigTauJet
unsigned int threshold
Definition: L1TMenuHelper.h:50
unsigned int threshold
Definition: L1TMenuHelper.h:41
const std::vector< std::vector< L1GtCaloTemplate > > & vecCaloTemplate() const
AlgorithmMap::const_iterator CItAlgo
iterators through map containing the algorithms
unsigned int quality
Definition: L1TMenuHelper.h:39
std::vector< SingleObjectTrigger > m_vTrigHTM
std::vector< SingleObjectTrigger > m_vTrigHTT
Definition: L1GtObject.h:35
const std::vector< L1GtLogicParser::TokenRPN > & algoRpnVector() const
return the RPN vector
Definition: L1GtAlgorithm.h:69
const std::string & condName() const
get / set condition name
Definition: L1GtCondition.h:52
key
prepare the HTCondor submission files and eventually submit them
unsigned int bit
Definition: L1TMenuHelper.h:48
unsigned int etaRange
Definition: L1TMenuHelper.h:52
std::vector< SingleObjectTrigger > m_vTrigIsoEG
const std::vector< L1GtObject > & objectType() const
get / set the trigger object type(s) in the condition
Definition: L1GtCondition.h:67
const std::vector< ObjectParameter > * objectParameter() const
double b
Definition: hdecay.h:120
std::vector< SingleObjectTrigger > m_vTrigETT
std::vector< SingleObjectTrigger > m_vTrigCenJet
const L1GtConditionType & condType() const
get / set the type of the condition (1s, etc)
Definition: L1GtCondition.h:62
double a
Definition: hdecay.h:121
const std::vector< std::vector< L1GtMuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
const int nrObjects() const
get number of trigger objects
Definition: L1GtObject.h:37
std::vector< SingleObjectTrigger > m_vTrigForJet
std::vector< SingleObjectTrigger > m_vTrigEG

◆ getPrescaleByAlias()

int L1TMenuHelper::getPrescaleByAlias ( const TString &  iCategory,
const TString &  iAlias 
)

Definition at line 599 of file L1TMenuHelper.cc.

References SiStripOfflineCRack_cfg::alias, mps_fire::i, and MillePedeFileConverter_cfg::out.

Referenced by L1TRate_Offline::bookHistograms(), and L1TRate::bookHistograms().

599  {
600  int out = -1;
601 
602  if (iCategory == "Mu") {
603  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
604  if (m_vTrigMu[i].alias == iAlias) {
605  return m_vTrigMu[i].prescale;
606  }
607  }
608  } else if (iCategory == "EG") {
609  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
610  if (m_vTrigEG[i].alias == iAlias) {
611  return m_vTrigEG[i].prescale;
612  }
613  }
614  } else if (iCategory == "IsoEG") {
615  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
616  if (m_vTrigIsoEG[i].alias == iAlias) {
617  return m_vTrigIsoEG[i].prescale;
618  }
619  }
620  } else if (iCategory == "Jet") {
621  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
622  if (m_vTrigJet[i].alias == iAlias) {
623  return m_vTrigJet[i].prescale;
624  }
625  }
626  } else if (iCategory == "CenJet") {
627  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
628  if (m_vTrigCenJet[i].alias == iAlias) {
629  return m_vTrigCenJet[i].prescale;
630  }
631  }
632  } else if (iCategory == "ForJet") {
633  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
634  if (m_vTrigForJet[i].alias == iAlias) {
635  return m_vTrigForJet[i].prescale;
636  }
637  }
638  } else if (iCategory == "TauJet") {
639  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
640  if (m_vTrigTauJet[i].alias == iAlias) {
641  return m_vTrigTauJet[i].prescale;
642  }
643  }
644  } else if (iCategory == "ETT") {
645  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
646  if (m_vTrigETT[i].alias == iAlias) {
647  return m_vTrigETT[i].prescale;
648  }
649  }
650  } else if (iCategory == "ETM") {
651  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
652  if (m_vTrigETM[i].alias == iAlias) {
653  return m_vTrigETM[i].prescale;
654  }
655  }
656  } else if (iCategory == "HTT") {
657  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
658  if (m_vTrigHTT[i].alias == iAlias) {
659  return m_vTrigHTT[i].prescale;
660  }
661  }
662  } else if (iCategory == "HTM") {
663  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
664  if (m_vTrigHTM[i].alias == iAlias) {
665  return m_vTrigHTM[i].prescale;
666  }
667  }
668  }
669 
670  return out;
671 }
std::vector< SingleObjectTrigger > m_vTrigJet
std::vector< SingleObjectTrigger > m_vTrigETM
std::vector< SingleObjectTrigger > m_vTrigMu
std::vector< SingleObjectTrigger > m_vTrigTauJet
std::vector< SingleObjectTrigger > m_vTrigHTM
std::vector< SingleObjectTrigger > m_vTrigHTT
std::vector< SingleObjectTrigger > m_vTrigIsoEG
std::vector< SingleObjectTrigger > m_vTrigETT
std::vector< SingleObjectTrigger > m_vTrigCenJet
std::vector< SingleObjectTrigger > m_vTrigForJet
std::vector< SingleObjectTrigger > m_vTrigEG

◆ getQualityAlias()

unsigned int L1TMenuHelper::getQualityAlias ( const TString &  iCategory,
const TString &  iAlias 
)

Definition at line 749 of file L1TMenuHelper.cc.

References SiStripOfflineCRack_cfg::alias, mps_fire::i, and MillePedeFileConverter_cfg::out.

Referenced by L1TRate_Offline::bookHistograms(), and L1TRate::bookHistograms().

749  {
750  unsigned int out = -1;
751 
752  if (iCategory == "Mu") {
753  for (unsigned int i = 0; i < m_vTrigMu.size(); i++) {
754  if (m_vTrigMu[i].alias == iAlias) {
755  return m_vTrigMu[i].quality;
756  }
757  }
758  } else if (iCategory == "EG") {
759  for (unsigned int i = 0; i < m_vTrigEG.size(); i++) {
760  if (m_vTrigEG[i].alias == iAlias) {
761  return m_vTrigEG[i].quality;
762  }
763  }
764  } else if (iCategory == "IsoEG") {
765  for (unsigned int i = 0; i < m_vTrigIsoEG.size(); i++) {
766  if (m_vTrigIsoEG[i].alias == iAlias) {
767  return m_vTrigIsoEG[i].quality;
768  }
769  }
770  } else if (iCategory == "Jet") {
771  for (unsigned int i = 0; i < m_vTrigJet.size(); i++) {
772  if (m_vTrigJet[i].alias == iAlias) {
773  return m_vTrigJet[i].quality;
774  }
775  }
776  } else if (iCategory == "CenJet") {
777  for (unsigned int i = 0; i < m_vTrigCenJet.size(); i++) {
778  if (m_vTrigCenJet[i].alias == iAlias) {
779  return m_vTrigCenJet[i].quality;
780  }
781  }
782  } else if (iCategory == "ForJet") {
783  for (unsigned int i = 0; i < m_vTrigForJet.size(); i++) {
784  if (m_vTrigForJet[i].alias == iAlias) {
785  return m_vTrigForJet[i].quality;
786  }
787  }
788  } else if (iCategory == "TauJet") {
789  for (unsigned int i = 0; i < m_vTrigTauJet.size(); i++) {
790  if (m_vTrigTauJet[i].alias == iAlias) {
791  return m_vTrigTauJet[i].quality;
792  }
793  }
794  } else if (iCategory == "ETT") {
795  for (unsigned int i = 0; i < m_vTrigETT.size(); i++) {
796  if (m_vTrigETT[i].alias == iAlias) {
797  return m_vTrigETT[i].quality;
798  }
799  }
800  } else if (iCategory == "ETM") {
801  for (unsigned int i = 0; i < m_vTrigETM.size(); i++) {
802  if (m_vTrigETM[i].alias == iAlias) {
803  return m_vTrigETM[i].quality;
804  }
805  }
806  } else if (iCategory == "HTT") {
807  for (unsigned int i = 0; i < m_vTrigHTT.size(); i++) {
808  if (m_vTrigHTT[i].alias == iAlias) {
809  return m_vTrigHTT[i].quality;
810  }
811  }
812  } else if (iCategory == "HTM") {
813  for (unsigned int i = 0; i < m_vTrigHTM.size(); i++) {
814  if (m_vTrigHTM[i].alias == iAlias) {
815  return m_vTrigHTM[i].quality;
816  }
817  }
818  }
819 
820  return out;
821 }
std::vector< SingleObjectTrigger > m_vTrigJet
std::vector< SingleObjectTrigger > m_vTrigETM
std::vector< SingleObjectTrigger > m_vTrigMu
std::vector< SingleObjectTrigger > m_vTrigTauJet
std::vector< SingleObjectTrigger > m_vTrigHTM
std::vector< SingleObjectTrigger > m_vTrigHTT
std::vector< SingleObjectTrigger > m_vTrigIsoEG
std::vector< SingleObjectTrigger > m_vTrigETT
std::vector< SingleObjectTrigger > m_vTrigCenJet
std::vector< SingleObjectTrigger > m_vTrigForJet
std::vector< SingleObjectTrigger > m_vTrigEG

◆ testAlgos()

map< string, string > L1TMenuHelper::testAlgos ( const std::map< std::string, std::string > &  )

Definition at line 394 of file L1TMenuHelper.cc.

References mps_fire::i.

Referenced by L1TSync::bookHistograms(), and L1TSync_Offline::bookHistograms().

394  {
395  map<string, string> iAlgos = _iAlgos;
396  // Getting information from the menu
397  const AlgorithmMap* theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
398 
399  for (map<string, string>::const_iterator i = iAlgos.begin(); iAlgos.end() != i; i++) {
400  string tCategory = (*i).first;
401  string tTrigger = (*i).second;
402 
403  if (tTrigger.empty()) {
404  iAlgos[tCategory] = "Undefined";
405  } else {
406  if (theAlgoMap->find(tTrigger) == theAlgoMap->end()) {
407  iAlgos[tCategory] = "Undefined (Wrong Name)";
408  }
409  }
410  }
411 
412  return iAlgos;
413 }
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
const L1GtTriggerMenu * m_l1GtMenu

Member Data Documentation

◆ m_l1GtMenu

const L1GtTriggerMenu* L1TMenuHelper::m_l1GtMenu
private

Definition at line 112 of file L1TMenuHelper.h.

◆ m_prescaleFactorsAlgoTrig

const std::vector<std::vector<int> >* L1TMenuHelper::m_prescaleFactorsAlgoTrig
private

Definition at line 113 of file L1TMenuHelper.h.

◆ m_vTrigCenJet

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigCenJet
private

Definition at line 120 of file L1TMenuHelper.h.

◆ m_vTrigEG

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigEG
private

Definition at line 117 of file L1TMenuHelper.h.

◆ m_vTrigETM

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigETM
private

Definition at line 123 of file L1TMenuHelper.h.

◆ m_vTrigETT

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigETT
private

Definition at line 124 of file L1TMenuHelper.h.

◆ m_vTrigForJet

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigForJet
private

Definition at line 121 of file L1TMenuHelper.h.

◆ m_vTrigHTM

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigHTM
private

Definition at line 126 of file L1TMenuHelper.h.

◆ m_vTrigHTT

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigHTT
private

Definition at line 125 of file L1TMenuHelper.h.

◆ m_vTrigIsoEG

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigIsoEG
private

Definition at line 118 of file L1TMenuHelper.h.

◆ m_vTrigJet

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigJet
private

Definition at line 119 of file L1TMenuHelper.h.

◆ m_vTrigMu

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigMu
private

Definition at line 116 of file L1TMenuHelper.h.

◆ m_vTrigTauJet

std::vector<SingleObjectTrigger> L1TMenuHelper::m_vTrigTauJet
private

Definition at line 122 of file L1TMenuHelper.h.