CMS 3D CMS Logo

TriggerMenuParser.h
Go to the documentation of this file.
1 #ifndef L1TGlobal_TriggerMenuParser_h
2 #define L1TGlobal_TriggerMenuParser_h
3 
29 // system include files
30 #include <string>
31 #include <vector>
32 
34 
45 
47 
49 
50 #include <cmath>
57 
58 // forward declarations
59 class GlobalCondition;
60 class GlobalAlgorithm;
61 
62 namespace l1t {
63 
64  typedef enum { COS, SIN } TrigFunc_t;
65 
66  // class declaration
68  public:
72 
74  virtual ~TriggerMenuParser();
75 
76  public:
78  inline const unsigned int gtNumberConditionChips() const { return m_numberConditionChips; }
79 
80  void setGtNumberConditionChips(const unsigned int&);
81 
83  inline const unsigned int gtPinsOnConditionChip() const { return m_pinsOnConditionChip; }
84 
85  void setGtPinsOnConditionChip(const unsigned int&);
86 
89  inline std::vector<int> gtOrderConditionChip() const { return m_orderConditionChip; }
90 
91  void setGtOrderConditionChip(const std::vector<int>&);
92 
94  inline const unsigned int gtNumberPhysTriggers() const { return m_numberPhysTriggers; }
95 
96  void setGtNumberPhysTriggers(const unsigned int&);
97 
98  public:
100  inline const std::vector<ConditionMap>& gtConditionMap() const { return m_conditionMap; }
101 
102  void setGtConditionMap(const std::vector<ConditionMap>&);
103 
106 
108 
109  //
110  inline const std::string& gtTriggerMenuName() const { return m_triggerMenuName; }
111 
112  void setGtTriggerMenuName(const std::string&);
113 
114  //
115  inline const unsigned long gtTriggerMenuImplementation() const { return m_triggerMenuImplementation; }
116 
117  void setGtTriggerMenuImplementation(const unsigned long&);
118 
120  inline const std::string& gtScaleDbKey() const { return m_scaleDbKey; }
121 
123  inline const GlobalScales& gtScales() const { return m_gtScales; }
124 
125  void setGtScaleDbKey(const std::string&);
126 
128  inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const { return m_vecMuonTemplate; }
129  void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
130 
131  //
132  inline const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTemplate() const {
134  }
135  void setVecMuonShowerTemplate(const std::vector<std::vector<MuonShowerTemplate> >&);
136 
137  //
138  inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const { return m_vecCaloTemplate; }
139 
140  void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
141 
142  //
143  inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
144  return m_vecEnergySumTemplate;
145  }
146 
147  void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
148 
149  //
150  inline const std::vector<std::vector<EnergySumZdcTemplate> >& vecEnergySumZdcTemplate() const {
152  }
153 
154  void setVecEnergySumZdcTemplate(const std::vector<std::vector<EnergySumZdcTemplate> >&);
155 
156  //
157  inline const std::vector<std::vector<AXOL1TLTemplate> >& vecAXOL1TLTemplate() const { return m_vecAXOL1TLTemplate; }
158  void setVecAXOL1TLTemplate(const std::vector<std::vector<AXOL1TLTemplate> >&);
159 
160  //
161  inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
162  return m_vecExternalTemplate;
163  }
164 
165  void setVecExternalTemplate(const std::vector<std::vector<ExternalTemplate> >&);
166 
167  //
168  inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
170  }
171 
172  void setVecCorrelationTemplate(const std::vector<std::vector<CorrelationTemplate> >&);
173 
174  //
175  inline const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTemplate() const {
177  }
178 
179  void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);
180 
181  //
182  inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
185  }
186 
188  const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
189 
190  // get / set the vectors containing the conditions for correlation templates
191  //
192  inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
193 
194  void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
195 
196  //
197  inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const { return m_corCaloTemplate; }
198 
199  void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
200 
201  //
202  inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
203  return m_corEnergySumTemplate;
204  }
205 
206  void setCorEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
207 
209  inline const AlgorithmMap& gtAlgorithmMap() const { return m_algorithmMap; }
210 
211  void setGtAlgorithmMap(const AlgorithmMap&);
212 
214  inline const AlgorithmMap& gtAlgorithmAliasMap() const { return m_algorithmAliasMap; }
215 
217 
218  public:
219  void parseCondFormats(const L1TUtmTriggerMenu* utmMenu);
220 
221  std::map<std::string, unsigned int> getExternalSignals(const L1TUtmTriggerMenu* utmMenu);
222 
223  public:
226 
228 
230 
232 
234 
236 
237  //
238 
239  inline const int gtTriggerMenuUUID() const { return m_triggerMenuUUID; }
240 
241  void setGtTriggerMenuUUID(const int);
242 
243  inline const std::string& gtTriggerMenuDate() const { return m_triggerMenuDate; }
244 
245  void setGtTriggerMenuDate(const std::string&);
246 
247  inline const std::string& gtTriggerMenuAuthor() const { return m_triggerMenuAuthor; }
248 
249  void setGtTriggerMenuAuthor(const std::string&);
250 
252 
254 
256 
258 
259  private:
260  // methods for conditions and algorithms
261 
264  void clearMaps();
265 
268  bool insertConditionIntoMap(GlobalCondition& cond, const int chipNr);
269 
271  bool insertAlgorithmIntoMap(const GlobalAlgorithm& alg);
272 
273  template <typename T>
275  int l1tstr2int(const std::string data);
276 
278  /* bool parseScale(L1TUtmScale scale); */
279  // bool parseScales( L1TUtmScale scale);
280  bool parseScales(std::map<std::string, tmeventsetup::esScale> scaleMap);
281 
283  /* bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode* node, */
284  /* const std::string& name, unsigned int chipNr = 0, */
285  /* const bool corrFlag = false); */
286  bool parseMuon(L1TUtmCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
287 
288  bool parseMuonCorr(const L1TUtmObject* condMu, unsigned int chipNr = 0);
289 
291  bool parseMuonShower(L1TUtmCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
292 
294  /* bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode* node, */
295  /* const std::string& name, unsigned int chipNr = 0, */
296  /* const bool corrFlag = false); */
297  bool parseCalo(L1TUtmCondition condCalo, unsigned int chipNr = 0, const bool corrFlag = false);
298 
299  bool parseCaloCorr(const L1TUtmObject* corrCalo, unsigned int chipNr = 0);
300 
302  /* bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode* node, */
303  /* const std::string& name, unsigned int chipNr = 0, */
304  /* const bool corrFlag = false); */
305 
306  bool parseEnergySum(L1TUtmCondition condEnergySums, unsigned int chipNr = 0, const bool corrFlag = false);
307 
308  bool parseEnergySumZdc(L1TUtmCondition condEnergySumZdcs, unsigned int chipNr = 0, const bool corrFlag = false);
309 
310  bool parseAXOL1TL(L1TUtmCondition condAXOL1TL, unsigned int chipNr = 0);
311 
312  bool parseEnergySumCorr(const L1TUtmObject* corrESum, unsigned int chipNr = 0);
313 
314  bool parseExternal(L1TUtmCondition condExt, unsigned int chipNr = 0);
315 
317  bool parseCorrelation(L1TUtmCondition corrCond, unsigned int chipNr = 0);
318 
320  bool parseCorrelationThreeBody(L1TUtmCondition corrCond, unsigned int chipNr = 0);
321 
323  bool parseCorrelationWithOverlapRemoval(const L1TUtmCondition& corrCond, unsigned int chipNr = 0);
324 
326  //bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser* parser);
327  bool parseAlgorithm(L1TUtmAlgorithm algorithm, unsigned int chipNr = 0);
328 
329  // Parse LUT for Cal Mu Eta
330  void parseCalMuEta_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
331 
332  // Parse LUT for Cal Mu Phi
333  void parseCalMuPhi_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
334 
335  // Parse LUT for Pt LUT in Mass calculation
336  void parsePt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
337  std::string lutpfx,
338  std::string obj1,
339  unsigned int prec);
340 
341  // Parse LUT for Upt LUT in Mass calculation for displaced muons
342  void parseUpt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
343  std::string lutpfx,
344  std::string obj1,
345  unsigned int prec);
346 
347  // Parse LUT for Delta Eta and Cosh
348  void parseDeltaEta_Cosh_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
349  std::string obj1,
350  std::string obj2,
351  unsigned int prec1,
352  unsigned int prec2);
353 
354  // Parse LUT for Delta Eta and Cosh
355  void parseDeltaPhi_Cos_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
356  const std::string& obj1,
357  const std::string& obj2,
358  unsigned int prec1,
359  unsigned int prec2);
360 
361  // Parse LUT for Sin(Phi),Cos(Phi) in TwoBodyPt algorithm calculation
362  void parsePhi_Trig_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
363  const std::string& obj,
365  unsigned int prec);
366 
367  private:
369 
372 
374  unsigned int m_pinsOnConditionChip;
375 
378  std::vector<int> m_orderConditionChip;
379 
381  unsigned int m_numberPhysTriggers;
382 
384  //unsigned int m_numberTechTriggers;
385 
386  private:
390 
394 
396 
397  private:
399  std::vector<ConditionMap> m_conditionMap;
400 
401  private:
406  unsigned long m_triggerMenuUUID;
407 
410 
413  std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
414  std::vector<std::vector<MuonShowerTemplate> > m_vecMuonShowerTemplate;
415  std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
416  std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
417  std::vector<std::vector<EnergySumZdcTemplate> > m_vecEnergySumZdcTemplate;
418  std::vector<std::vector<AXOL1TLTemplate> > m_vecAXOL1TLTemplate;
419  std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
420 
421  std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
422  std::vector<std::vector<CorrelationThreeBodyTemplate> > m_vecCorrelationThreeBodyTemplate;
423  std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
424  std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
425  std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
426  std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
427 
430 
433 
434  // class containing the scales from the L1 Menu XML
436  };
437 
438 } // namespace l1t
439 #endif /*L1TGlobal_TriggerMenuParser_h*/
const std::vector< std::vector< CorrelationTemplate > > & vecCorrelationTemplate() const
std::vector< std::vector< MuonShowerTemplate > > m_vecMuonShowerTemplate
unsigned int m_numberPhysTriggers
number of physics trigger algorithms
void setGtTriggerMenuName(const std::string &)
const std::vector< std::vector< MuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
bool parseAlgorithm(L1TUtmAlgorithm algorithm, unsigned int chipNr=0)
parse all algorithms
void setGtScaleDbKey(const std::string &)
void parseCalMuEta_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string obj1, std::string obj2)
const unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
void parseCalMuPhi_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string obj1, std::string obj2)
void setGtOrderConditionChip(const std::vector< int > &)
void parseUpt_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string lutpfx, std::string obj1, unsigned int prec)
const GlobalScales & gtScales() const
menu associated scales
bool parseEnergySumCorr(const L1TUtmObject *corrESum, unsigned int chipNr=0)
std::vector< int > gtOrderConditionChip() const
void parseDeltaPhi_Cos_LUTS(const std::map< std::string, tmeventsetup::esScale > &scaleMap, const std::string &obj1, const std::string &obj2, unsigned int prec1, unsigned int prec2)
bool parseExternal(L1TUtmCondition condExt, unsigned int chipNr=0)
unsigned int m_numberConditionChips
hardware limits
std::vector< std::vector< CaloTemplate > > m_vecCaloTemplate
const unsigned int gtPinsOnConditionChip() const
get / set the number of pins on the GTL condition chips
const std::string & gtTriggerMenuName() const
bool parseEnergySumZdc(L1TUtmCondition condEnergySumZdcs, unsigned int chipNr=0, const bool corrFlag=false)
void setGtAlgorithmMap(const AlgorithmMap &)
void setVecCaloTemplate(const std::vector< std::vector< CaloTemplate > > &)
std::vector< std::vector< EnergySumTemplate > > m_corEnergySumTemplate
std::vector< std::vector< CaloTemplate > > m_corCaloTemplate
virtual ~TriggerMenuParser()
destructor
delete x;
Definition: CaloConfig.h:22
const std::string & gtTriggerMenuInterfaceAuthor() const
std::map< std::string, unsigned int > getExternalSignals(const L1TUtmTriggerMenu *utmMenu)
std::vector< std::vector< AXOL1TLTemplate > > m_vecAXOL1TLTemplate
const unsigned int gtNumberConditionChips() const
get / set the number of condition chips in GTL
std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > m_vecCorrelationWithOverlapRemovalTemplate
const std::vector< std::vector< CorrelationThreeBodyTemplate > > & vecCorrelationThreeBodyTemplate() const
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
void setVecEnergySumTemplate(const std::vector< std::vector< EnergySumTemplate > > &)
void setVecCorrelationTemplate(const std::vector< std::vector< CorrelationTemplate > > &)
const std::string & gtTriggerMenuDescription() const
std::string m_triggerMenuInterface
menu names
void setVecMuonTemplate(const std::vector< std::vector< MuonTemplate > > &)
bool parseMuonShower(L1TUtmCondition condMu, unsigned int chipNr=0, const bool corrFlag=false)
parse a muon shower condition
const std::string & gtTriggerMenuAuthor() const
const std::vector< std::vector< CaloTemplate > > & vecCaloTemplate() const
void setGtAlgorithmAliasMap(const AlgorithmMap &)
void setGtPinsOnConditionChip(const unsigned int &)
void setGtAlgorithmImplementation(const std::string &)
std::string m_scaleDbKey
menu associated scale key
bool parseCorrelationWithOverlapRemoval(const L1TUtmCondition &corrCond, unsigned int chipNr=0)
parse a correlation condition with overlap removal
void parseCondFormats(const L1TUtmTriggerMenu *utmMenu)
void parseDeltaEta_Cosh_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string obj1, std::string obj2, unsigned int prec1, unsigned int prec2)
std::string m_triggerMenuInterfaceAuthor
std::vector< ConditionMap > m_conditionMap
map containing the conditions (per condition chip) - transient
const int gtTriggerMenuUUID() const
std::vector< std::vector< MuonTemplate > > m_corMuonTemplate
void setGtTriggerMenuInterface(const std::string &)
std::string m_triggerMenuDescription
const std::string & gtTriggerMenuInterfaceDate() const
get / set the XML parser creation date, author, description for menu interface, menu ...
const std::string & gtAlgorithmImplementation() const
bool parseAXOL1TL(L1TUtmCondition condAXOL1TL, unsigned int chipNr=0)
std::vector< std::vector< CorrelationThreeBodyTemplate > > m_vecCorrelationThreeBodyTemplate
void setGtTriggerMenuAuthor(const std::string &)
const std::vector< std::vector< EnergySumTemplate > > & vecEnergySumTemplate() const
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
std::string m_triggerMenuInterfaceDescription
const std::string & gtScaleDbKey() const
menu associated scale key
void setGtTriggerMenuInterfaceDescription(const std::string &)
std::string m_triggerMenuInterfaceDate
number of technical triggers
void setVecCorrelationThreeBodyTemplate(const std::vector< std::vector< CorrelationThreeBodyTemplate > > &)
std::vector< std::vector< CorrelationTemplate > > m_vecCorrelationTemplate
void setVecAXOL1TLTemplate(const std::vector< std::vector< AXOL1TLTemplate > > &)
bool insertConditionIntoMap(GlobalCondition &cond, const int chipNr)
const std::vector< std::vector< EnergySumZdcTemplate > > & vecEnergySumZdcTemplate() const
const std::vector< std::vector< EnergySumTemplate > > & corEnergySumTemplate() const
void setGtTriggerMenuDate(const std::string &)
bool parseMuonCorr(const L1TUtmObject *condMu, unsigned int chipNr=0)
bool parseMuon(L1TUtmCondition condMu, unsigned int chipNr=0, const bool corrFlag=false)
parse a muon condition
const std::vector< std::vector< MuonTemplate > > & corMuonTemplate() const
bool parseScales(std::map< std::string, tmeventsetup::esScale > scaleMap)
parse scales
void setVecExternalTemplate(const std::vector< std::vector< ExternalTemplate > > &)
const std::string & gtTriggerMenuInterfaceDescription() const
bool parseCaloCorr(const L1TUtmObject *corrCalo, unsigned int chipNr=0)
void setGtTriggerMenuDescription(const std::string &)
const unsigned long gtTriggerMenuImplementation() const
void setCorMuonTemplate(const std::vector< std::vector< MuonTemplate > > &)
unsigned int m_pinsOnConditionChip
number of pins on the GTL condition chips
void setCorEnergySumTemplate(const std::vector< std::vector< EnergySumTemplate > > &)
unsigned long m_triggerMenuUUID
const std::vector< ConditionMap > & gtConditionMap() const
get / set / build the condition maps
std::vector< std::vector< ExternalTemplate > > m_vecExternalTemplate
std::vector< int > m_orderConditionChip
void setGtNumberConditionChips(const unsigned int &)
const std::string & gtTriggerMenuDate() const
int l1tstr2int(const std::string data)
bool parseCalo(L1TUtmCondition condCalo, unsigned int chipNr=0, const bool corrFlag=false)
parse a calorimeter condition
const std::vector< std::vector< CaloTemplate > > & corCaloTemplate() const
bool parseCorrelation(L1TUtmCondition corrCond, unsigned int chipNr=0)
parse a correlation condition
void setGtTriggerMenuUUID(const int)
unsigned long m_triggerMenuImplementation
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
void setVecMuonShowerTemplate(const std::vector< std::vector< MuonShowerTemplate > > &)
std::string m_algorithmImplementation
std::vector< std::vector< EnergySumTemplate > > m_vecEnergySumTemplate
void setCorCaloTemplate(const std::vector< std::vector< CaloTemplate > > &)
const std::vector< std::vector< MuonShowerTemplate > > & vecMuonShowerTemplate() const
void setVecCorrelationWithOverlapRemovalTemplate(const std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > &)
const std::vector< std::vector< ExternalTemplate > > & vecExternalTemplate() const
void setGtTriggerMenuInterfaceDate(const std::string &)
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
const std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > & vecCorrelationWithOverlapRemovalTemplate() const
void setGtTriggerMenuImplementation(const unsigned long &)
bool insertAlgorithmIntoMap(const GlobalAlgorithm &alg)
insert an algorithm into algorithm map
void setVecEnergySumZdcTemplate(const std::vector< std::vector< EnergySumZdcTemplate > > &)
long double T
const std::vector< std::vector< AXOL1TLTemplate > > & vecAXOL1TLTemplate() const
bool parseEnergySum(L1TUtmCondition condEnergySums, unsigned int chipNr=0, const bool corrFlag=false)
parse an "energy sum" condition
void setGtConditionMap(const std::vector< ConditionMap > &)
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
bool parseCorrelationThreeBody(L1TUtmCondition corrCond, unsigned int chipNr=0)
parse a three-body correlation condition
std::vector< std::vector< EnergySumZdcTemplate > > m_vecEnergySumZdcTemplate
void parsePhi_Trig_LUTS(const std::map< std::string, tmeventsetup::esScale > &scaleMap, const std::string &obj, TrigFunc_t func, unsigned int prec)
void setGtTriggerMenuInterfaceAuthor(const std::string &)
void parsePt_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string lutpfx, std::string obj1, unsigned int prec)
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
std::vector< std::vector< MuonTemplate > > m_vecMuonTemplate
void setGtNumberPhysTriggers(const unsigned int &)