CMS 3D CMS Logo

TriggerMenuParser.h
Go to the documentation of this file.
1 #ifndef L1TGlobal_TriggerMenuParser_h
2 #define L1TGlobal_TriggerMenuParser_h
3 
24 // system include files
25 #include <string>
26 #include <vector>
27 
29 
36 
38 
40 
41 #include "tmEventSetup/esTriggerMenu.hh"
42 #include "tmEventSetup/esAlgorithm.hh"
43 #include "tmEventSetup/esCondition.hh"
44 #include "tmEventSetup/esObject.hh"
45 #include "tmEventSetup/esCut.hh"
46 #include "tmEventSetup/esScale.hh"
47 
48 // forward declarations
49 class GlobalCondition;
50 class GlobalAlgorithm;
51 
52 namespace l1t {
53 
54 
55 typedef enum { COS, SIN } TrigFunc_t;
56 
57 // class declaration
59 {
60 
61 
62 public:
63 
67 
69  virtual ~TriggerMenuParser();
70 
71 public:
72 
73 
75  inline const unsigned int gtNumberConditionChips() const {
77  }
78 
79  void setGtNumberConditionChips(const unsigned int&);
80 
82  inline const unsigned int gtPinsOnConditionChip() const {
83  return m_pinsOnConditionChip;
84  }
85 
86  void setGtPinsOnConditionChip(const unsigned int&);
87 
90  inline std::vector<int> gtOrderConditionChip() const {
91  return m_orderConditionChip;
92  }
93 
94  void setGtOrderConditionChip(const std::vector<int>&);
95 
97  inline const unsigned int gtNumberPhysTriggers() const {
98  return m_numberPhysTriggers;
99  }
100 
101  void setGtNumberPhysTriggers(const unsigned int&);
102 
103 
104 
105 public:
106 
108  inline const std::vector<ConditionMap>& gtConditionMap() const {
109  return m_conditionMap;
110  }
111 
112  void setGtConditionMap(const std::vector<ConditionMap>&);
113 
115  inline const std::string& gtTriggerMenuInterface() const {
116  return m_triggerMenuInterface;
117  }
118 
120 
121  //
122  inline const std::string& gtTriggerMenuName() const {
123  return m_triggerMenuName;
124  }
125 
126  void setGtTriggerMenuName(const std::string&);
127 
128  //
129  inline const unsigned long gtTriggerMenuImplementation() const {
131  }
132 
133  void setGtTriggerMenuImplementation(const unsigned long&);
134 
136  inline const std::string& gtScaleDbKey() const {
137  return m_scaleDbKey;
138  }
139 
141  inline const GlobalScales& gtScales() const {
142  return m_gtScales;
143  }
144 
145  void setGtScaleDbKey(const std::string&);
146 
148  inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const {
149  return m_vecMuonTemplate;
150  }
151  void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
152 
153  //
154  inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const {
155  return m_vecCaloTemplate;
156  }
157 
158  void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
159 
160  //
161  inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
162 
163  return m_vecEnergySumTemplate;
164  }
165 
167  const std::vector<std::vector<EnergySumTemplate> >&);
168 
169  //
170 
171  inline const std::vector<std::vector<ExternalTemplate> >&
173 
174  return m_vecExternalTemplate;
175  }
176 
178  const std::vector<std::vector<ExternalTemplate> >&);
179 
180  //
181  inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
182 
184  }
185 
187  const std::vector<std::vector<CorrelationTemplate> >&);
188 
189  inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >& vecCorrelationWithOverlapRemovalTemplate() const {
190 
192  }
193 
195  const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
196 
197  // get / set the vectors containing the conditions for correlation templates
198  //
199  inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const {
200  return m_corMuonTemplate;
201  }
202 
203  void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
204 
205  //
206  inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const {
207  return m_corCaloTemplate;
208  }
209 
210  void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
211 
212  //
213  inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
214 
215  return m_corEnergySumTemplate;
216  }
217 
219  const std::vector<std::vector<EnergySumTemplate> >&);
220 
222  inline const AlgorithmMap& gtAlgorithmMap() const {
223  return m_algorithmMap;
224  }
225 
226  void setGtAlgorithmMap(const AlgorithmMap&);
227 
229  inline const AlgorithmMap& gtAlgorithmAliasMap() const {
230  return m_algorithmAliasMap;
231  }
232 
234 
235 
236 public:
237 
238 
239  void parseCondFormats(const L1TUtmTriggerMenu* utmMenu);
240 
241 
242  std::map<std::string, unsigned int> getExternalSignals(const L1TUtmTriggerMenu* utmMenu);
243 
244 public:
245 
247  inline const std::string& gtTriggerMenuInterfaceDate() const {
249  }
250 
252 
255  }
256 
258 
261  }
262 
264 
265  //
266 
267  inline const int gtTriggerMenuUUID() const {
268  return m_triggerMenuUUID;
269  }
270 
271  void setGtTriggerMenuUUID(const int);
272 
273  inline const std::string& gtTriggerMenuDate() const {
274  return m_triggerMenuDate;
275  }
276 
277  void setGtTriggerMenuDate(const std::string&);
278 
279  inline const std::string& gtTriggerMenuAuthor() const {
280  return m_triggerMenuAuthor;
281  }
282 
283  void setGtTriggerMenuAuthor(const std::string&);
284 
285  inline const std::string& gtTriggerMenuDescription() const {
287  }
288 
290 
291 
292  inline const std::string& gtAlgorithmImplementation() const {
294  }
295 
297 
298 
299 private:
300 
301  // methods for conditions and algorithms
302 
305  void clearMaps();
306 
309  bool insertConditionIntoMap(GlobalCondition& cond, const int chipNr);
310 
312  bool insertAlgorithmIntoMap(const GlobalAlgorithm& alg);
313 
314  template <typename T> std::string l1t2string( T );
315  int l1tstr2int( const std::string data );
316 
317 
319 /* bool parseScale(tmeventsetup::esScale scale); */
320 // bool parseScales( tmeventsetup::esScale scale);
321  bool parseScales(std::map<std::string, tmeventsetup::esScale> scaleMap);
322 
323 
325 /* bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode* node, */
326 /* const std::string& name, unsigned int chipNr = 0, */
327 /* const bool corrFlag = false); */
328  bool parseMuon( tmeventsetup::esCondition condMu,
329  unsigned int chipNr = 0, const bool corrFlag = false);
330 
331  bool parseMuonCorr(const tmeventsetup::esObject* condMu,
332  unsigned int chipNr = 0);
333 
334 
336 /* bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode* node, */
337 /* const std::string& name, unsigned int chipNr = 0, */
338 /* const bool corrFlag = false); */
339  bool parseCalo( tmeventsetup::esCondition condCalo,
340  unsigned int chipNr = 0, const bool corrFlag = false);
341 
342  bool parseCaloCorr(const tmeventsetup::esObject* corrCalo,
343  unsigned int chipNr = 0);
344 
346  /* bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode* node, */
347  /* const std::string& name, unsigned int chipNr = 0, */
348  /* const bool corrFlag = false); */
349 
350  bool parseEnergySum( tmeventsetup::esCondition condEnergySums,
351  unsigned int chipNr = 0, const bool corrFlag = false);
352 
353 
354  bool parseEnergySumCorr(const tmeventsetup::esObject* corrESum,
355  unsigned int chipNr = 0);
356 
357 
358  bool parseExternal(tmeventsetup::esCondition condExt,
359  unsigned int chipNr = 0);
360 
361 
363  bool parseCorrelation(tmeventsetup::esCondition corrCond, unsigned int chipNr = 0);
364 
366  bool parseCorrelationWithOverlapRemoval(const tmeventsetup::esCondition& corrCond, unsigned int chipNr = 0);
367 
368 
370  //bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser* parser);
371  bool parseAlgorithm( tmeventsetup::esAlgorithm algorithm,
372  unsigned int chipNr = 0 );
373 
374  // Parse LUT for Cal Mu Eta
375  void parseCalMuEta_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
376  std::string obj1, std::string obj2);
377 
378 
379  // Parse LUT for Cal Mu Phi
380  void parseCalMuPhi_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
381  std::string obj1, std::string obj2);
382 
383  // Parse LUT for Pt LUT in Mass calculation
384  void parsePt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
385  std::string lutpfx, std::string obj1, unsigned int prec);
386 
387  // Parse LUT for Delta Eta and Cosh
388  void parseDeltaEta_Cosh_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
389  std::string obj1, std::string obj2,
390  unsigned int prec1, unsigned int prec2) ;
391 
392  // Parse LUT for Delta Eta and Cosh
393  void parseDeltaPhi_Cos_LUTS(const std::map<std::string, tmeventsetup::esScale> & scaleMap,
394  const std::string & obj1, const std::string & obj2,
395  unsigned int prec1, unsigned int prec2) ;
396 
397  // Parse LUT for Sin(Phi),Cos(Phi) in TwoBodyPt algorithm calculation
398  void parsePhi_Trig_LUTS(const std::map<std::string, tmeventsetup::esScale> & scaleMap,
399  const std::string & obj, TrigFunc_t func,
400  unsigned int prec) ;
401 
402 
403 private:
404 
405 
407 
410 
412  unsigned int m_pinsOnConditionChip;
413 
416  std::vector<int> m_orderConditionChip;
417 
419  unsigned int m_numberPhysTriggers;
420 
422  //unsigned int m_numberTechTriggers;
423 
424 
425 private:
426 
427 
431 
435 
437 
438 
439 private:
440 
442  std::vector<ConditionMap> m_conditionMap;
443 
444 private:
445 
450  unsigned long m_triggerMenuUUID;
451 
454 
457  std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
458  std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
459  std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
460  std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
461 
462  std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
463  std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
464  std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
465  std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
466  std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
467 
470 
473 
474  // class containing the scales from the L1 Menu XML
476 
477 };
478 
479 }
480 #endif /*L1TGlobal_TriggerMenuParser_h*/
unsigned int m_numberPhysTriggers
number of physics trigger algorithms
void setGtTriggerMenuName(const std::string &)
const unsigned int gtPinsOnConditionChip() const
get / set the number of pins on the GTL condition chips
void setGtScaleDbKey(const std::string &)
const std::vector< std::vector< EnergySumTemplate > > & vecEnergySumTemplate() const
void parseCalMuEta_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string obj1, std::string obj2)
void parseCalMuPhi_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string obj1, std::string obj2)
void setGtOrderConditionChip(const std::vector< int > &)
const AlgorithmMap & gtAlgorithmAliasMap() const
get / set the algorithm map (by alias)
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)
unsigned int m_numberConditionChips
hardware limits
const std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > & vecCorrelationWithOverlapRemovalTemplate() const
std::vector< std::vector< CaloTemplate > > m_vecCaloTemplate
void setGtAlgorithmMap(const AlgorithmMap &)
const std::vector< std::vector< ExternalTemplate > > & vecExternalTemplate() const
void setVecCaloTemplate(const std::vector< std::vector< CaloTemplate > > &)
std::vector< std::vector< EnergySumTemplate > > m_corEnergySumTemplate
bool parseExternal(tmeventsetup::esCondition condExt, unsigned int chipNr=0)
std::vector< std::vector< CaloTemplate > > m_corCaloTemplate
virtual ~TriggerMenuParser()
destructor
delete x;
Definition: CaloConfig.h:22
std::map< std::string, unsigned int > getExternalSignals(const L1TUtmTriggerMenu *utmMenu)
const std::string & gtTriggerMenuDate() const
std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > m_vecCorrelationWithOverlapRemovalTemplate
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
const std::string & gtTriggerMenuInterfaceAuthor() const
void setVecEnergySumTemplate(const std::vector< std::vector< EnergySumTemplate > > &)
void setVecCorrelationTemplate(const std::vector< std::vector< CorrelationTemplate > > &)
std::string m_triggerMenuInterface
menu names
void setVecMuonTemplate(const std::vector< std::vector< MuonTemplate > > &)
void setGtAlgorithmAliasMap(const AlgorithmMap &)
void setGtPinsOnConditionChip(const unsigned int &)
void setGtAlgorithmImplementation(const std::string &)
const std::vector< ConditionMap > & gtConditionMap() const
get / set / build the condition maps
std::string m_scaleDbKey
menu associated scale key
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
std::vector< std::vector< MuonTemplate > > m_corMuonTemplate
void setGtTriggerMenuInterface(const std::string &)
std::string m_triggerMenuDescription
std::vector< int > gtOrderConditionChip() const
const std::string & gtTriggerMenuName() const
const std::vector< std::vector< CaloTemplate > > & corCaloTemplate() const
void setGtTriggerMenuAuthor(const std::string &)
std::string m_triggerMenuInterfaceDescription
const std::string & gtTriggerMenuInterfaceDescription() const
const std::vector< std::vector< MuonTemplate > > & corMuonTemplate() const
void setGtTriggerMenuInterfaceDescription(const std::string &)
std::string m_triggerMenuInterfaceDate
number of technical triggers
const std::vector< std::vector< MuonTemplate > > & vecMuonTemplate() const
get / set the vectors containing the conditions
std::vector< std::vector< CorrelationTemplate > > m_vecCorrelationTemplate
bool insertConditionIntoMap(GlobalCondition &cond, const int chipNr)
const std::vector< std::vector< EnergySumTemplate > > & corEnergySumTemplate() const
void setGtTriggerMenuDate(const std::string &)
const std::string & gtTriggerMenuInterfaceDate() const
get / set the XML parser creation date, author, description for menu interface, menu ...
const std::vector< std::vector< CorrelationTemplate > > & vecCorrelationTemplate() const
bool parseScales(std::map< std::string, tmeventsetup::esScale > scaleMap)
parse scales
const unsigned int gtNumberConditionChips() const
get / set the number of condition chips in GTL
void setVecExternalTemplate(const std::vector< std::vector< ExternalTemplate > > &)
bool parseCaloCorr(const tmeventsetup::esObject *corrCalo, unsigned int chipNr=0)
bool parseEnergySum(tmeventsetup::esCondition condEnergySums, unsigned int chipNr=0, const bool corrFlag=false)
parse an "energy sum" condition
void setGtTriggerMenuDescription(const std::string &)
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 unsigned int gtNumberPhysTriggers() const
get / set the number of physics trigger algorithms
std::vector< std::vector< ExternalTemplate > > m_vecExternalTemplate
std::vector< int > m_orderConditionChip
const GlobalScales & gtScales() const
menu associated scales
bool parseMuon(tmeventsetup::esCondition condMu, unsigned int chipNr=0, const bool corrFlag=false)
parse a muon condition
const int gtTriggerMenuUUID() const
const AlgorithmMap & gtAlgorithmMap() const
get / set the algorithm map (by name)
void setGtNumberConditionChips(const unsigned int &)
bool parseEnergySumCorr(const tmeventsetup::esObject *corrESum, unsigned int chipNr=0)
bool parseAlgorithm(tmeventsetup::esAlgorithm algorithm, unsigned int chipNr=0)
parse all algorithms
int l1tstr2int(const std::string data)
void setGtTriggerMenuUUID(const int)
unsigned long m_triggerMenuImplementation
Definition: plugin.cc:24
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool parseCorrelationWithOverlapRemoval(const tmeventsetup::esCondition &corrCond, unsigned int chipNr=0)
parse a correlation condition with overlap removal
std::string m_algorithmImplementation
bool parseCalo(tmeventsetup::esCondition condCalo, unsigned int chipNr=0, const bool corrFlag=false)
parse a calorimeter condition
std::vector< std::vector< EnergySumTemplate > > m_vecEnergySumTemplate
bool parseCorrelation(tmeventsetup::esCondition corrCond, unsigned int chipNr=0)
parse a correlation condition
void setCorCaloTemplate(const std::vector< std::vector< CaloTemplate > > &)
void setVecCorrelationWithOverlapRemovalTemplate(const std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > &)
const std::string & gtAlgorithmImplementation() const
bool parseMuonCorr(const tmeventsetup::esObject *condMu, unsigned int chipNr=0)
void setGtTriggerMenuInterfaceDate(const std::string &)
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
void setGtTriggerMenuImplementation(const unsigned long &)
const std::vector< std::vector< CaloTemplate > > & vecCaloTemplate() const
const std::string & gtTriggerMenuInterface() const
get / set the trigger menu names
bool insertAlgorithmIntoMap(const GlobalAlgorithm &alg)
insert an algorithm into algorithm map
long double T
void setGtConditionMap(const std::vector< ConditionMap > &)
std::map< std::string, GlobalAlgorithm > AlgorithmMap
map containing the algorithms
const std::string & gtScaleDbKey() const
menu associated scale key
void parsePhi_Trig_LUTS(const std::map< std::string, tmeventsetup::esScale > &scaleMap, const std::string &obj, TrigFunc_t func, unsigned int prec)
const unsigned long gtTriggerMenuImplementation() const
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 std::string & gtTriggerMenuAuthor() const
std::vector< std::vector< MuonTemplate > > m_vecMuonTemplate
void setGtNumberPhysTriggers(const unsigned int &)
const std::string & gtTriggerMenuDescription() const