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 
44 
46 
48 
49 #include <cmath>
56 
57 // forward declarations
58 class GlobalCondition;
59 class GlobalAlgorithm;
60 
61 namespace l1t {
62 
63  typedef enum { COS, SIN } TrigFunc_t;
64 
65  // class declaration
67  public:
71 
73  virtual ~TriggerMenuParser();
74 
75  public:
77  inline const unsigned int gtNumberConditionChips() const { return m_numberConditionChips; }
78 
79  void setGtNumberConditionChips(const unsigned int&);
80 
82  inline const unsigned int gtPinsOnConditionChip() const { return m_pinsOnConditionChip; }
83 
84  void setGtPinsOnConditionChip(const unsigned int&);
85 
88  inline std::vector<int> gtOrderConditionChip() const { return m_orderConditionChip; }
89 
90  void setGtOrderConditionChip(const std::vector<int>&);
91 
93  inline const unsigned int gtNumberPhysTriggers() const { return m_numberPhysTriggers; }
94 
95  void setGtNumberPhysTriggers(const unsigned int&);
96 
97  public:
99  inline const std::vector<ConditionMap>& gtConditionMap() const { return m_conditionMap; }
100 
101  void setGtConditionMap(const std::vector<ConditionMap>&);
102 
105 
107 
108  //
109  inline const std::string& gtTriggerMenuName() const { return m_triggerMenuName; }
110 
111  void setGtTriggerMenuName(const std::string&);
112 
113  //
114  inline const unsigned long gtTriggerMenuImplementation() const { return m_triggerMenuImplementation; }
115 
116  void setGtTriggerMenuImplementation(const unsigned long&);
117 
119  inline const std::string& gtScaleDbKey() const { return m_scaleDbKey; }
120 
122  inline const GlobalScales& gtScales() const { return m_gtScales; }
123 
124  void setGtScaleDbKey(const std::string&);
125 
127  inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const { return m_vecMuonTemplate; }
128  void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
129 
130  //
131  inline const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTemplate() const {
133  }
134  void setVecMuonShowerTemplate(const std::vector<std::vector<MuonShowerTemplate> >&);
135 
136  //
137  inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const { return m_vecCaloTemplate; }
138 
139  void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
140 
141  //
142  inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
143  return m_vecEnergySumTemplate;
144  }
145 
146  void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
147 
148  //
149  inline const std::vector<std::vector<EnergySumZdcTemplate> >& vecEnergySumZdcTemplate() const {
151  }
152 
153  void setVecEnergySumZdcTemplate(const std::vector<std::vector<EnergySumZdcTemplate> >&);
154 
155  //
156  inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
157  return m_vecExternalTemplate;
158  }
159 
160  void setVecExternalTemplate(const std::vector<std::vector<ExternalTemplate> >&);
161 
162  //
163  inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
165  }
166 
167  void setVecCorrelationTemplate(const std::vector<std::vector<CorrelationTemplate> >&);
168 
169  //
170  inline const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTemplate() const {
172  }
173 
174  void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);
175 
176  //
177  inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
180  }
181 
183  const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
184 
185  // get / set the vectors containing the conditions for correlation templates
186  //
187  inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
188 
189  void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
190 
191  //
192  inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const { return m_corCaloTemplate; }
193 
194  void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
195 
196  //
197  inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
198  return m_corEnergySumTemplate;
199  }
200 
201  void setCorEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
202 
204  inline const AlgorithmMap& gtAlgorithmMap() const { return m_algorithmMap; }
205 
206  void setGtAlgorithmMap(const AlgorithmMap&);
207 
209  inline const AlgorithmMap& gtAlgorithmAliasMap() const { return m_algorithmAliasMap; }
210 
212 
213  public:
214  void parseCondFormats(const L1TUtmTriggerMenu* utmMenu);
215 
216  std::map<std::string, unsigned int> getExternalSignals(const L1TUtmTriggerMenu* utmMenu);
217 
218  public:
221 
223 
225 
227 
229 
231 
232  //
233 
234  inline const int gtTriggerMenuUUID() const { return m_triggerMenuUUID; }
235 
236  void setGtTriggerMenuUUID(const int);
237 
238  inline const std::string& gtTriggerMenuDate() const { return m_triggerMenuDate; }
239 
240  void setGtTriggerMenuDate(const std::string&);
241 
242  inline const std::string& gtTriggerMenuAuthor() const { return m_triggerMenuAuthor; }
243 
244  void setGtTriggerMenuAuthor(const std::string&);
245 
247 
249 
251 
253 
254  private:
255  // methods for conditions and algorithms
256 
259  void clearMaps();
260 
263  bool insertConditionIntoMap(GlobalCondition& cond, const int chipNr);
264 
266  bool insertAlgorithmIntoMap(const GlobalAlgorithm& alg);
267 
268  template <typename T>
270  int l1tstr2int(const std::string data);
271 
273  /* bool parseScale(L1TUtmScale scale); */
274  // bool parseScales( L1TUtmScale scale);
275  bool parseScales(std::map<std::string, tmeventsetup::esScale> scaleMap);
276 
278  /* bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode* node, */
279  /* const std::string& name, unsigned int chipNr = 0, */
280  /* const bool corrFlag = false); */
281  bool parseMuon(L1TUtmCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
282 
283  bool parseMuonCorr(const L1TUtmObject* condMu, unsigned int chipNr = 0);
284 
286  bool parseMuonShower(L1TUtmCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
287 
289  /* bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode* node, */
290  /* const std::string& name, unsigned int chipNr = 0, */
291  /* const bool corrFlag = false); */
292  bool parseCalo(L1TUtmCondition condCalo, unsigned int chipNr = 0, const bool corrFlag = false);
293 
294  bool parseCaloCorr(const L1TUtmObject* corrCalo, unsigned int chipNr = 0);
295 
297  /* bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode* node, */
298  /* const std::string& name, unsigned int chipNr = 0, */
299  /* const bool corrFlag = false); */
300 
301  bool parseEnergySum(L1TUtmCondition condEnergySums, unsigned int chipNr = 0, const bool corrFlag = false);
302 
303  bool parseEnergySumZdc(L1TUtmCondition condEnergySumZdcs, unsigned int chipNr = 0, const bool corrFlag = false);
304 
305  bool parseEnergySumCorr(const L1TUtmObject* corrESum, unsigned int chipNr = 0);
306 
307  bool parseExternal(L1TUtmCondition condExt, unsigned int chipNr = 0);
308 
310  bool parseCorrelation(L1TUtmCondition corrCond, unsigned int chipNr = 0);
311 
313  bool parseCorrelationThreeBody(L1TUtmCondition corrCond, unsigned int chipNr = 0);
314 
316  bool parseCorrelationWithOverlapRemoval(const L1TUtmCondition& corrCond, unsigned int chipNr = 0);
317 
319  //bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser* parser);
320  bool parseAlgorithm(L1TUtmAlgorithm algorithm, unsigned int chipNr = 0);
321 
322  // Parse LUT for Cal Mu Eta
323  void parseCalMuEta_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
324 
325  // Parse LUT for Cal Mu Phi
326  void parseCalMuPhi_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
327 
328  // Parse LUT for Pt LUT in Mass calculation
329  void parsePt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
330  std::string lutpfx,
331  std::string obj1,
332  unsigned int prec);
333 
334  // Parse LUT for Upt LUT in Mass calculation for displaced muons
335  void parseUpt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
336  std::string lutpfx,
337  std::string obj1,
338  unsigned int prec);
339 
340  // Parse LUT for Delta Eta and Cosh
341  void parseDeltaEta_Cosh_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
342  std::string obj1,
343  std::string obj2,
344  unsigned int prec1,
345  unsigned int prec2);
346 
347  // Parse LUT for Delta Eta and Cosh
348  void parseDeltaPhi_Cos_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
349  const std::string& obj1,
350  const std::string& obj2,
351  unsigned int prec1,
352  unsigned int prec2);
353 
354  // Parse LUT for Sin(Phi),Cos(Phi) in TwoBodyPt algorithm calculation
355  void parsePhi_Trig_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
356  const std::string& obj,
358  unsigned int prec);
359 
360  private:
362 
365 
367  unsigned int m_pinsOnConditionChip;
368 
371  std::vector<int> m_orderConditionChip;
372 
374  unsigned int m_numberPhysTriggers;
375 
377  //unsigned int m_numberTechTriggers;
378 
379  private:
383 
387 
389 
390  private:
392  std::vector<ConditionMap> m_conditionMap;
393 
394  private:
399  unsigned long m_triggerMenuUUID;
400 
403 
406  std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
407  std::vector<std::vector<MuonShowerTemplate> > m_vecMuonShowerTemplate;
408  std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
409  std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
410  std::vector<std::vector<EnergySumZdcTemplate> > m_vecEnergySumZdcTemplate;
411  std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
412 
413  std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
414  std::vector<std::vector<CorrelationThreeBodyTemplate> > m_vecCorrelationThreeBodyTemplate;
415  std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
416  std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
417  std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
418  std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
419 
422 
425 
426  // class containing the scales from the L1 Menu XML
428  };
429 
430 } // namespace l1t
431 #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)
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< 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
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
void setVecEnergySumZdcTemplate(const std::vector< std::vector< EnergySumZdcTemplate > > &)
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
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 &)