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, 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)
 
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
 

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 }
const std::vector< std::vector< int > > * m_prescaleFactorsAlgoTrig
const L1GtTriggerMenu * m_l1GtMenu
const std::vector< std::vector< int > > & gtPrescaleFactors() const
get the prescale factors by reference
edm::ESHandle< L1GtTriggerMenu > menuRcd
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 56 of file L1TMenuHelper.cc.

56 {}

Member Function Documentation

string L1TMenuHelper::enumToStringL1GtConditionCategory ( L1GtConditionCategory  iConditionCategory)

Definition at line 421 of file L1TMenuHelper.cc.

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

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

Definition at line 388 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.

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

Definition at line 355 of file L1TMenuHelper.cc.

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

355  {
356 
357  string out;
358 
359  switch(iObject){
360  case Mu: out = "Mu"; break;
361  case NoIsoEG: out = "NoIsoEG"; break;
362  case IsoEG: out = "IsoEG"; break;
363  case CenJet: out = "CenJet"; break;
364  case ForJet: out = "ForJet"; break;
365  case TauJet: out = "TauJet"; break;
366  case ETM: out = "ETM"; break;
367  case ETT: out = "ETT"; break;
368  case HTT: out = "HTT"; break;
369  case HTM: out = "HTM"; break;
370  case JetCounts: out = "JetCounts"; break;
371  case HfBitCounts: out = "HfBitCounts"; break;
372  case HfRingEtSums: out = "HfRingEtSums"; break;
373  case TechTrig: out = "TechTrig"; break;
374  case Castor: out = "Castor"; break;
375  case BPTX: out = "BPTX"; break;
376  case GtExternal: out = "GtExternal"; break;
377  default: out = "Unknown"; break;
378  };
379 
380  return out;
381 
382 }
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 478 of file L1TMenuHelper.cc.

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

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

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

Definition at line 62 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, L1GtUtils::triggerMask(), Type1s, TypeETM, TypeETT, TypeHTM, and TypeHTT.

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

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

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

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

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

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

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

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

References i.

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

330  {
331  map<string,string> iAlgos = _iAlgos;
332  // Getting information from the menu
333  const AlgorithmMap *theAlgoMap = &m_l1GtMenu->gtAlgorithmAliasMap();
334 
335  for(map<string,string>::const_iterator i = iAlgos.begin() ; iAlgos.end() != i ; i++){
336 
337  string tCategory = (*i).first;
338  string tTrigger = (*i).second;
339 
340  if(tTrigger == "" ){iAlgos[tCategory] = "Undefined";}
341  else{
342  if(theAlgoMap->find(tTrigger) == theAlgoMap->end()){iAlgos[tCategory] = "Undefined (Wrong Name)";}
343  }
344 
345  }
346 
347  return iAlgos;
348 
349 }
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 102 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 101 of file L1TMenuHelper.h.