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 
43 
45 
47 
48 #include <cmath>
55 
56 // forward declarations
57 class GlobalCondition;
58 class GlobalAlgorithm;
59 
60 namespace l1t {
61 
62  typedef enum { COS, SIN } TrigFunc_t;
63 
64  // class declaration
66  public:
70 
72  virtual ~TriggerMenuParser();
73 
74  public:
76  inline const unsigned int gtNumberConditionChips() const { return m_numberConditionChips; }
77 
78  void setGtNumberConditionChips(const unsigned int&);
79 
81  inline const unsigned int gtPinsOnConditionChip() const { return m_pinsOnConditionChip; }
82 
83  void setGtPinsOnConditionChip(const unsigned int&);
84 
87  inline std::vector<int> gtOrderConditionChip() const { return m_orderConditionChip; }
88 
89  void setGtOrderConditionChip(const std::vector<int>&);
90 
92  inline const unsigned int gtNumberPhysTriggers() const { return m_numberPhysTriggers; }
93 
94  void setGtNumberPhysTriggers(const unsigned int&);
95 
96  public:
98  inline const std::vector<ConditionMap>& gtConditionMap() const { return m_conditionMap; }
99 
100  void setGtConditionMap(const std::vector<ConditionMap>&);
101 
104 
106 
107  //
108  inline const std::string& gtTriggerMenuName() const { return m_triggerMenuName; }
109 
110  void setGtTriggerMenuName(const std::string&);
111 
112  //
113  inline const unsigned long gtTriggerMenuImplementation() const { return m_triggerMenuImplementation; }
114 
115  void setGtTriggerMenuImplementation(const unsigned long&);
116 
118  inline const std::string& gtScaleDbKey() const { return m_scaleDbKey; }
119 
121  inline const GlobalScales& gtScales() const { return m_gtScales; }
122 
123  void setGtScaleDbKey(const std::string&);
124 
126  inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const { return m_vecMuonTemplate; }
127  void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
128 
129  //
130  inline const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTemplate() const {
132  }
133  void setVecMuonShowerTemplate(const std::vector<std::vector<MuonShowerTemplate> >&);
134 
135  //
136  inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const { return m_vecCaloTemplate; }
137 
138  void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
139 
140  //
141  inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
142  return m_vecEnergySumTemplate;
143  }
144 
145  void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
146 
147  //
148  inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
149  return m_vecExternalTemplate;
150  }
151 
152  void setVecExternalTemplate(const std::vector<std::vector<ExternalTemplate> >&);
153 
154  //
155  inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
157  }
158 
159  void setVecCorrelationTemplate(const std::vector<std::vector<CorrelationTemplate> >&);
160 
161  //
162  inline const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTemplate() const {
164  }
165 
166  void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);
167 
168  //
169  inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
172  }
173 
175  const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
176 
177  // get / set the vectors containing the conditions for correlation templates
178  //
179  inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
180 
181  void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
182 
183  //
184  inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const { return m_corCaloTemplate; }
185 
186  void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
187 
188  //
189  inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
190  return m_corEnergySumTemplate;
191  }
192 
193  void setCorEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
194 
196  inline const AlgorithmMap& gtAlgorithmMap() const { return m_algorithmMap; }
197 
198  void setGtAlgorithmMap(const AlgorithmMap&);
199 
201  inline const AlgorithmMap& gtAlgorithmAliasMap() const { return m_algorithmAliasMap; }
202 
204 
205  public:
206  void parseCondFormats(const L1TUtmTriggerMenu* utmMenu);
207 
208  std::map<std::string, unsigned int> getExternalSignals(const L1TUtmTriggerMenu* utmMenu);
209 
210  public:
213 
215 
217 
219 
221 
223 
224  //
225 
226  inline const int gtTriggerMenuUUID() const { return m_triggerMenuUUID; }
227 
228  void setGtTriggerMenuUUID(const int);
229 
230  inline const std::string& gtTriggerMenuDate() const { return m_triggerMenuDate; }
231 
232  void setGtTriggerMenuDate(const std::string&);
233 
234  inline const std::string& gtTriggerMenuAuthor() const { return m_triggerMenuAuthor; }
235 
236  void setGtTriggerMenuAuthor(const std::string&);
237 
239 
241 
243 
245 
246  private:
247  // methods for conditions and algorithms
248 
251  void clearMaps();
252 
255  bool insertConditionIntoMap(GlobalCondition& cond, const int chipNr);
256 
258  bool insertAlgorithmIntoMap(const GlobalAlgorithm& alg);
259 
260  template <typename T>
262  int l1tstr2int(const std::string data);
263 
265  /* bool parseScale(L1TUtmScale scale); */
266  // bool parseScales( L1TUtmScale scale);
267  bool parseScales(std::map<std::string, tmeventsetup::esScale> scaleMap);
268 
270  /* bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode* node, */
271  /* const std::string& name, unsigned int chipNr = 0, */
272  /* const bool corrFlag = false); */
273  bool parseMuon(L1TUtmCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
274 
275  bool parseMuonCorr(const L1TUtmObject* condMu, unsigned int chipNr = 0);
276 
278  bool parseMuonShower(L1TUtmCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
279 
281  /* bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode* node, */
282  /* const std::string& name, unsigned int chipNr = 0, */
283  /* const bool corrFlag = false); */
284  bool parseCalo(L1TUtmCondition condCalo, unsigned int chipNr = 0, const bool corrFlag = false);
285 
286  bool parseCaloCorr(const L1TUtmObject* corrCalo, unsigned int chipNr = 0);
287 
289  /* bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode* node, */
290  /* const std::string& name, unsigned int chipNr = 0, */
291  /* const bool corrFlag = false); */
292 
293  bool parseEnergySum(L1TUtmCondition condEnergySums, unsigned int chipNr = 0, const bool corrFlag = false);
294 
295  bool parseEnergySumCorr(const L1TUtmObject* corrESum, unsigned int chipNr = 0);
296 
297  bool parseExternal(L1TUtmCondition condExt, unsigned int chipNr = 0);
298 
300  bool parseCorrelation(L1TUtmCondition corrCond, unsigned int chipNr = 0);
301 
303  bool parseCorrelationThreeBody(L1TUtmCondition corrCond, unsigned int chipNr = 0);
304 
306  bool parseCorrelationWithOverlapRemoval(const L1TUtmCondition& corrCond, unsigned int chipNr = 0);
307 
309  //bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser* parser);
310  bool parseAlgorithm(L1TUtmAlgorithm algorithm, unsigned int chipNr = 0);
311 
312  // Parse LUT for Cal Mu Eta
313  void parseCalMuEta_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
314 
315  // Parse LUT for Cal Mu Phi
316  void parseCalMuPhi_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
317 
318  // Parse LUT for Pt LUT in Mass calculation
319  void parsePt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
320  std::string lutpfx,
321  std::string obj1,
322  unsigned int prec);
323 
324  // Parse LUT for Upt LUT in Mass calculation for displaced muons
325  void parseUpt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
326  std::string lutpfx,
327  std::string obj1,
328  unsigned int prec);
329 
330  // Parse LUT for Delta Eta and Cosh
331  void parseDeltaEta_Cosh_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
332  std::string obj1,
333  std::string obj2,
334  unsigned int prec1,
335  unsigned int prec2);
336 
337  // Parse LUT for Delta Eta and Cosh
338  void parseDeltaPhi_Cos_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
339  const std::string& obj1,
340  const std::string& obj2,
341  unsigned int prec1,
342  unsigned int prec2);
343 
344  // Parse LUT for Sin(Phi),Cos(Phi) in TwoBodyPt algorithm calculation
345  void parsePhi_Trig_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
346  const std::string& obj,
348  unsigned int prec);
349 
350  private:
352 
355 
357  unsigned int m_pinsOnConditionChip;
358 
361  std::vector<int> m_orderConditionChip;
362 
364  unsigned int m_numberPhysTriggers;
365 
367  //unsigned int m_numberTechTriggers;
368 
369  private:
373 
377 
379 
380  private:
382  std::vector<ConditionMap> m_conditionMap;
383 
384  private:
389  unsigned long m_triggerMenuUUID;
390 
393 
396  std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
397  std::vector<std::vector<MuonShowerTemplate> > m_vecMuonShowerTemplate;
398  std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
399  std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
400  std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
401 
402  std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
403  std::vector<std::vector<CorrelationThreeBodyTemplate> > m_vecCorrelationThreeBodyTemplate;
404  std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
405  std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
406  std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
407  std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
408 
411 
414 
415  // class containing the scales from the L1 Menu XML
417  };
418 
419 } // namespace l1t
420 #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
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)
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
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
bool insertConditionIntoMap(GlobalCondition &cond, const int chipNr)
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
Definition: plugin.cc:23
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
long double T
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
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 &)