CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
L1TMenuHelper Class Reference

#include <L1TMenuHelper.h>

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)
 
int getPrescaleByAlias (const TString &iCategory, const TString &iAlias)
 
unsigned int getQualityAlias (const TString &iCategory, const TString &iAlias)
 
 L1TMenuHelper (const edm::EventSetup &iSetup)
 
std::map< std::string,
std::string > 
testAlgos (const std::map< std::string, std::string > &)
 
 ~L1TMenuHelper ()
 

Private Attributes

edm::ESHandle
< L1GtPrescaleFactors
l1GtPfAlgo
 
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
 
edm::ESHandle< L1GtTriggerMenumenuRcd
 
L1GtUtils myUtils
 

Detailed Description

Definition at line 75 of file L1TMenuHelper.h.

Constructor & Destructor Documentation

L1TMenuHelper::L1TMenuHelper ( const edm::EventSetup iSetup)

Definition at line 41 of file L1TMenuHelper.cc.

References edm::EventSetup::get(), and L1GtPrescaleFactors::gtPrescaleFactors().

41  {
42 
43  iSetup.get<L1GtTriggerMenuRcd>() .get(menuRcd);
45 
46  const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
47 
48  m_l1GtMenu = menuRcd .product(); // Getting the menu
49  m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors()); // Retriving the list of prescale sets
50 
52 
53 }
L1GtUtils myUtils
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const L1GtTriggerMenu * m_l1GtMenu
void retrieveL1EventSetup(const edm::EventSetup &)
retrieve all the relevant L1 trigger event setup records and cache them to improve the speed ...
Definition: L1GtUtils.cc:112
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
edm::ESHandle< L1GtTriggerMenu > menuRcd
Definition: L1TMenuHelper.h:99
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:86
edm::ESHandle< L1GtPrescaleFactors > l1GtPfAlgo
L1TMenuHelper::~L1TMenuHelper ( )

Definition at line 59 of file L1TMenuHelper.cc.

59 {}

Member Function Documentation

string L1TMenuHelper::enumToStringL1GtConditionCategory ( L1GtConditionCategory  iConditionCategory)

Definition at line 422 of file L1TMenuHelper.cc.

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

422  {
423 
424  string out;
425 
426  switch(iConditionCategory){
427  case CondNull: out = "CondNull"; break;
428  case CondMuon: out = "CondMuon"; break;
429  case CondCalo: out = "CondCalo"; break;
430  case CondEnergySum: out = "CondEnergySum"; break;
431  case CondJetCounts: out = "CondJetCounts"; break;
432  case CondCorrelation: out = "CondCorrelation"; break;
433  case CondCastor: out = "CondCastor"; break;
434  case CondHfBitCounts: out = "CondHfBitCounts"; break;
435  case CondHfRingEtSums: out = "CondHfRingEtSums"; break;
436  case CondBptx: out = "CondBptx"; break;
437  case CondExternal: out = "CondExternal"; break;
438  default: out = "Unknown"; break;
439  };
440 
441  return out;
442 
443 }
tuple out
Definition: dbtoconf.py:99
string L1TMenuHelper::enumToStringL1GtConditionType ( L1GtConditionType  iConditionType)

Definition at line 389 of file L1TMenuHelper.cc.

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

389  {
390 
391  string out;
392 
393  switch(iConditionType){
394  case TypeNull: out = "TypeNull"; break;
395  case Type1s: out = "Type1s"; break;
396  case Type2s: out = "Type2s"; break;
397  case Type2wsc: out = "Type2wsc"; break;
398  case Type2cor: out = "Type2cor"; break;
399  case Type3s: out = "Type3s"; break;
400  case Type4s: out = "Type4s"; break;
401  case TypeETM: out = "TypeETM"; break;
402  case TypeETT: out = "TypeETT"; break;
403  case TypeHTT: out = "TypeHTT"; break;
404  case TypeHTM: out = "TypeHTM"; break;
405  case TypeJetCounts: out = "TypeJetCounts"; break;
406  case TypeCastor: out = "TypeCastor"; break;
407  case TypeHfBitCounts: out = "TypeHfBitCounts"; break;
408  case TypeHfRingEtSums: out = "TypeHfRingEtSums"; break;
409  case TypeBptx: out = "TypeBptx"; break;
410  case TypeExternal: out = "TypeExternal"; break;
411  default: out = "Unknown"; break;
412  };
413 
414  return out;
415 
416 }
tuple out
Definition: dbtoconf.py:99
string L1TMenuHelper::enumToStringL1GtObject ( L1GtObject  iObject)

Definition at line 356 of file L1TMenuHelper.cc.

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

356  {
357 
358  string out;
359 
360  switch(iObject){
361  case Mu: out = "Mu"; break;
362  case NoIsoEG: out = "NoIsoEG"; break;
363  case IsoEG: out = "IsoEG"; break;
364  case CenJet: out = "CenJet"; break;
365  case ForJet: out = "ForJet"; break;
366  case TauJet: out = "TauJet"; break;
367  case ETM: out = "ETM"; break;
368  case ETT: out = "ETT"; break;
369  case HTT: out = "HTT"; break;
370  case HTM: out = "HTM"; break;
371  case JetCounts: out = "JetCounts"; break;
372  case HfBitCounts: out = "HfBitCounts"; break;
373  case HfRingEtSums: out = "HfRingEtSums"; break;
374  case TechTrig: out = "TechTrig"; break;
375  case Castor: out = "Castor"; break;
376  case BPTX: out = "BPTX"; break;
377  case GtExternal: out = "GtExternal"; break;
378  default: out = "Unknown"; break;
379  };
380 
381  return out;
382 
383 }
Definition: L1GtObject.h:39
Definition: L1GtObject.h:36
Definition: L1GtObject.h:38
tuple out
Definition: dbtoconf.py:99
Definition: L1GtObject.h:30
Definition: L1GtObject.h:37
unsigned int L1TMenuHelper::getEtaRangeByAlias ( const TString &  iCategory,
const TString &  iAlias 
)

Definition at line 479 of file L1TMenuHelper.cc.

References HLT_25ns14e33_v1_cff::alias, i, and dbtoconf::out.

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

479  {
480 
481  unsigned int out = -1;
482 
483  if(iCategory == "Mu"){
484  for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias) {return m_vTrigMu[i].etaRange;}}
485  }else if(iCategory == "EG"){
486  for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias) {return m_vTrigEG[i].etaRange;}}
487  }else if(iCategory == "IsoEG"){
488  for(unsigned int i=0 ; i<m_vTrigIsoEG.size() ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].etaRange;}}
489  }else if(iCategory == "Jet"){
490  for(unsigned int i=0 ; i<m_vTrigJet.size() ; i++){if(m_vTrigJet[i].alias==iAlias) {return m_vTrigJet[i].etaRange;}}
491  }else if(iCategory == "CenJet"){
492  for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].etaRange;}}
493  }else if(iCategory == "ForJet"){
494  for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].etaRange;}}
495  }else if(iCategory == "TauJet"){
496  for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].etaRange;}}
497  }else if(iCategory == "ETT"){
498  for(unsigned int i=0 ; i<m_vTrigETT.size() ; i++){if(m_vTrigETT[i].alias==iAlias) {return m_vTrigETT[i].etaRange;}}
499  }else if(iCategory == "ETM"){
500  for(unsigned int i=0 ; i<m_vTrigETM.size() ; i++){if(m_vTrigETM[i].alias==iAlias) {return m_vTrigETM[i].etaRange;}}
501  }else if(iCategory == "HTT"){
502  for(unsigned int i=0 ; i<m_vTrigHTT.size() ; i++){if(m_vTrigHTT[i].alias==iAlias) {return m_vTrigHTT[i].etaRange;}}
503  }else if(iCategory == "HTM"){
504  for(unsigned int i=0 ; i<m_vTrigHTM.size() ; i++){if(m_vTrigHTM[i].alias==iAlias) {return m_vTrigHTM[i].etaRange;}}
505  }
506 
507  return out;
508 
509 }
int i
Definition: DBlmapReader.cc:9
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
tuple out
Definition: dbtoconf.py:99
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
map< string, string > L1TMenuHelper::getLUSOTrigger ( const std::map< std::string, bool > &  iCategories,
int  IndexRefPrescaleFactors 
)

Definition at line 65 of file L1TMenuHelper.cc.

References a, L1GtAlgorithm::algoRpnVector(), SingleObjectTrigger::alias, b, begin, SingleObjectTrigger::bit, CenJet, edm::check(), L1GtCondition::condCategory(), SingleObjectCondition::conditionCategory, SingleObjectCondition::conditionType, L1GtCondition::condName(), L1GtCondition::condType(), end, relativeConstraints::error, MuonErrorMatrixValues_cff::etaRange, SingleObjectCondition::etaRange, SingleObjectTrigger::etaRange, ETM, ETT, ForJet, HTM, HTT, i, IsoEG, relval_steps::key, Mu, SingleObjectCondition::name, NoIsoEG, L1GtCondition::nrObjects(), SingleObjectCondition::object, SingleObjectTrigger::object, L1GtEnergySumTemplate::objectParameter(), L1GtCaloTemplate::objectParameter(), L1GtMuonTemplate::objectParameter(), L1GtCondition::objectType(), L1GtLogicParser::OP_AND, L1GtLogicParser::OP_OPERAND, dbtoconf::out, SingleObjectTrigger::prescale, SingleObjectCondition::quality, SingleObjectTrigger::quality, findQualityFiles::size, python.multivaluedict::sort(), TauJet, SingleObjectCondition::threshold, SingleObjectTrigger::threshold, Type1s, TypeETM, TypeETT, TypeHTM, and TypeHTT.

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

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

Definition at line 446 of file L1TMenuHelper.cc.

References HLT_25ns14e33_v1_cff::alias, i, and dbtoconf::out.

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

446  {
447 
448  int out = -1;
449 
450  if(iCategory == "Mu"){
451  for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias) {return m_vTrigMu[i].prescale;}}
452  }else if(iCategory == "EG"){
453  for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias) {return m_vTrigEG[i].prescale;}}
454  }else if(iCategory == "IsoEG"){
455  for(unsigned int i=0 ; i<m_vTrigIsoEG.size() ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].prescale;}}
456  }else if(iCategory == "Jet"){
457  for(unsigned int i=0 ; i<m_vTrigJet.size() ; i++){if(m_vTrigJet[i].alias==iAlias) {return m_vTrigJet[i].prescale;}}
458  }else if(iCategory == "CenJet"){
459  for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].prescale;}}
460  }else if(iCategory == "ForJet"){
461  for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].prescale;}}
462  }else if(iCategory == "TauJet"){
463  for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].prescale;}}
464  }else if(iCategory == "ETT"){
465  for(unsigned int i=0 ; i<m_vTrigETT.size() ; i++){if(m_vTrigETT[i].alias==iAlias) {return m_vTrigETT[i].prescale;}}
466  }else if(iCategory == "ETM"){
467  for(unsigned int i=0 ; i<m_vTrigETM.size() ; i++){if(m_vTrigETM[i].alias==iAlias) {return m_vTrigETM[i].prescale;}}
468  }else if(iCategory == "HTT"){
469  for(unsigned int i=0 ; i<m_vTrigHTT.size() ; i++){if(m_vTrigHTT[i].alias==iAlias) {return m_vTrigHTT[i].prescale;}}
470  }else if(iCategory == "HTM"){
471  for(unsigned int i=0 ; i<m_vTrigHTM.size() ; i++){if(m_vTrigHTM[i].alias==iAlias) {return m_vTrigHTM[i].prescale;}}
472  }
473 
474  return out;
475 
476 }
int i
Definition: DBlmapReader.cc:9
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
tuple out
Definition: dbtoconf.py:99
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
unsigned int L1TMenuHelper::getQualityAlias ( const TString &  iCategory,
const TString &  iAlias 
)

Definition at line 512 of file L1TMenuHelper.cc.

References HLT_25ns14e33_v1_cff::alias, i, and dbtoconf::out.

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

512  {
513 
514  unsigned int out = -1;
515 
516  if(iCategory == "Mu"){
517  for(unsigned int i=0 ; i<m_vTrigMu.size() ; i++){if(m_vTrigMu[i].alias==iAlias) {return m_vTrigMu[i].quality;}}
518  }else if(iCategory == "EG"){
519  for(unsigned int i=0 ; i<m_vTrigEG.size() ; i++){if(m_vTrigEG[i].alias==iAlias) {return m_vTrigEG[i].quality;}}
520  }else if(iCategory == "IsoEG"){
521  for(unsigned int i=0 ; i<m_vTrigIsoEG.size() ; i++){if(m_vTrigIsoEG[i].alias==iAlias) {return m_vTrigIsoEG[i].quality;}}
522  }else if(iCategory == "Jet"){
523  for(unsigned int i=0 ; i<m_vTrigJet.size() ; i++){if(m_vTrigJet[i].alias==iAlias) {return m_vTrigJet[i].quality;}}
524  }else if(iCategory == "CenJet"){
525  for(unsigned int i=0 ; i<m_vTrigCenJet.size() ; i++){if(m_vTrigCenJet[i].alias==iAlias){return m_vTrigCenJet[i].quality;}}
526  }else if(iCategory == "ForJet"){
527  for(unsigned int i=0 ; i<m_vTrigForJet.size() ; i++){if(m_vTrigForJet[i].alias==iAlias){return m_vTrigForJet[i].quality;}}
528  }else if(iCategory == "TauJet"){
529  for(unsigned int i=0 ; i<m_vTrigTauJet.size() ; i++){if(m_vTrigTauJet[i].alias==iAlias){return m_vTrigTauJet[i].quality;}}
530  }else if(iCategory == "ETT"){
531  for(unsigned int i=0 ; i<m_vTrigETT.size() ; i++){if(m_vTrigETT[i].alias==iAlias) {return m_vTrigETT[i].quality;}}
532  }else if(iCategory == "ETM"){
533  for(unsigned int i=0 ; i<m_vTrigETM.size() ; i++){if(m_vTrigETM[i].alias==iAlias) {return m_vTrigETM[i].quality;}}
534  }else if(iCategory == "HTT"){
535  for(unsigned int i=0 ; i<m_vTrigHTT.size() ; i++){if(m_vTrigHTT[i].alias==iAlias) {return m_vTrigHTT[i].quality;}}
536  }else if(iCategory == "HTM"){
537  for(unsigned int i=0 ; i<m_vTrigHTM.size() ; i++){if(m_vTrigHTM[i].alias==iAlias) {return m_vTrigHTM[i].quality;}}
538  }
539 
540  return out;
541 
542 }
int i
Definition: DBlmapReader.cc:9
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
tuple out
Definition: dbtoconf.py:99
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
map< string, string > L1TMenuHelper::testAlgos ( const std::map< std::string, std::string > &  )

Definition at line 331 of file L1TMenuHelper.cc.

References i.

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

331  {
332  map<string,string> iAlgos = _iAlgos;
333  // Getting information from the menu
334  const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
335 
336  for(map<string,string>::const_iterator i = iAlgos.begin() ; iAlgos.end() != i ; i++){
337 
338  string tCategory = (*i).first;
339  string tTrigger = (*i).second;
340 
341  if(tTrigger == "" ){iAlgos[tCategory] = "Undefined";}
342  else{
343  if(theAlgoMap->find(tTrigger) == theAlgoMap->end()){iAlgos[tCategory] = "Undefined (Wrong Name)";}
344  }
345 
346  }
347 
348  return iAlgos;
349 
350 }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
const L1GtTriggerMenu * m_l1GtMenu
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)

Member Data Documentation

edm::ESHandle<L1GtPrescaleFactors> L1TMenuHelper::l1GtPfAlgo
private

Definition at line 100 of file L1TMenuHelper.h.

const L1GtTriggerMenu* L1TMenuHelper::m_l1GtMenu
private

Definition at line 104 of file L1TMenuHelper.h.

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

Definition at line 105 of file L1TMenuHelper.h.

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

Definition at line 112 of file L1TMenuHelper.h.

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

Definition at line 109 of file L1TMenuHelper.h.

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

Definition at line 115 of file L1TMenuHelper.h.

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

Definition at line 116 of file L1TMenuHelper.h.

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

Definition at line 113 of file L1TMenuHelper.h.

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

Definition at line 118 of file L1TMenuHelper.h.

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

Definition at line 117 of file L1TMenuHelper.h.

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

Definition at line 110 of file L1TMenuHelper.h.

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

Definition at line 111 of file L1TMenuHelper.h.

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

Definition at line 108 of file L1TMenuHelper.h.

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

Definition at line 114 of file L1TMenuHelper.h.

edm::ESHandle<L1GtTriggerMenu> L1TMenuHelper::menuRcd
private

Definition at line 99 of file L1TMenuHelper.h.

L1GtUtils L1TMenuHelper::myUtils
private

Definition at line 102 of file L1TMenuHelper.h.