CMS 3D CMS Logo

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< L1GtPrescaleFactorsl1GtPfAlgo
 
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 76 of file L1TMenuHelper.h.

Constructor & Destructor Documentation

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

Definition at line 40 of file L1TMenuHelper.cc.

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

40  {
41 
42  iSetup.get<L1GtTriggerMenuRcd>() .get(menuRcd);
44 
45  const L1GtPrescaleFactors* m_l1GtPfAlgo = l1GtPfAlgo.product();
46 
47  m_l1GtMenu = menuRcd .product(); // Getting the menu
48  m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors()); // Retriving the list of prescale sets
49 }
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
T get() const
Definition: EventSetup.h:63
edm::ESHandle< L1GtPrescaleFactors > l1GtPfAlgo
T const * product() const
Definition: ESHandle.h:86
L1TMenuHelper::~L1TMenuHelper ( )

Definition at line 55 of file L1TMenuHelper.cc.

55 {}

Member Function Documentation

string L1TMenuHelper::enumToStringL1GtConditionCategory ( L1GtConditionCategory  iConditionCategory)

Definition at line 420 of file L1TMenuHelper.cc.

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

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

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

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

Definition at line 354 of file L1TMenuHelper.cc.

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

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

Definition at line 477 of file L1TMenuHelper.cc.

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

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

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

Definition at line 61 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, mps_fire::i, jets_cff::isMu, IsoEG, crabWrapper::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, MillePedeFileConverter_cfg::out, SingleObjectTrigger::prescale, SingleObjectCondition::quality, SingleObjectTrigger::quality, 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().

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

Definition at line 444 of file L1TMenuHelper.cc.

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

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

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

Definition at line 510 of file L1TMenuHelper.cc.

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

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

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

Definition at line 329 of file L1TMenuHelper.cc.

References mps_fire::i.

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

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

const L1GtTriggerMenu* L1TMenuHelper::m_l1GtMenu
private

Definition at line 105 of file L1TMenuHelper.h.

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

Definition at line 106 of file L1TMenuHelper.h.

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

Definition at line 113 of file L1TMenuHelper.h.

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

Definition at line 110 of file L1TMenuHelper.h.

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

Definition at line 116 of file L1TMenuHelper.h.

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

Definition at line 117 of file L1TMenuHelper.h.

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

Definition at line 114 of file L1TMenuHelper.h.

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

Definition at line 119 of file L1TMenuHelper.h.

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

Definition at line 118 of file L1TMenuHelper.h.

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

Definition at line 111 of file L1TMenuHelper.h.

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

Definition at line 112 of file L1TMenuHelper.h.

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

Definition at line 109 of file L1TMenuHelper.h.

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

Definition at line 115 of file L1TMenuHelper.h.

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

Definition at line 102 of file L1TMenuHelper.h.