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 
46 
48 
50 
51 #include <cmath>
58 
59 // forward declarations
60 class GlobalCondition;
61 class GlobalAlgorithm;
62 
63 namespace l1t {
64 
65  typedef enum { COS, SIN } TrigFunc_t;
66 
67  // class declaration
69  public:
73 
75  virtual ~TriggerMenuParser();
76 
77  public:
79  inline const unsigned int gtNumberConditionChips() const { return m_numberConditionChips; }
80 
81  void setGtNumberConditionChips(const unsigned int&);
82 
84  inline const unsigned int gtPinsOnConditionChip() const { return m_pinsOnConditionChip; }
85 
86  void setGtPinsOnConditionChip(const unsigned int&);
87 
90  inline std::vector<int> gtOrderConditionChip() const { return m_orderConditionChip; }
91 
92  void setGtOrderConditionChip(const std::vector<int>&);
93 
95  inline const unsigned int gtNumberPhysTriggers() const { return m_numberPhysTriggers; }
96 
97  void setGtNumberPhysTriggers(const unsigned int&);
98 
99  public:
101  inline const std::vector<ConditionMap>& gtConditionMap() const { return m_conditionMap; }
102 
103  void setGtConditionMap(const std::vector<ConditionMap>&);
104 
107 
109 
110  //
111  inline const std::string& gtTriggerMenuName() const { return m_triggerMenuName; }
112 
113  void setGtTriggerMenuName(const std::string&);
114 
115  //
116  inline const unsigned long gtTriggerMenuImplementation() const { return m_triggerMenuImplementation; }
117 
118  void setGtTriggerMenuImplementation(const unsigned long&);
119 
121  inline const std::string& gtScaleDbKey() const { return m_scaleDbKey; }
122 
124  inline const GlobalScales& gtScales() const { return m_gtScales; }
125 
126  void setGtScaleDbKey(const std::string&);
127 
129  inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const { return m_vecMuonTemplate; }
130  void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
131 
132  //
133  inline const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTemplate() const {
135  }
136  void setVecMuonShowerTemplate(const std::vector<std::vector<MuonShowerTemplate> >&);
137 
138  //
139  inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const { return m_vecCaloTemplate; }
140 
141  void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
142 
143  //
144  inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
145  return m_vecEnergySumTemplate;
146  }
147 
148  void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
149 
150  //
151  inline const std::vector<std::vector<EnergySumZdcTemplate> >& vecEnergySumZdcTemplate() const {
153  }
154 
155  void setVecEnergySumZdcTemplate(const std::vector<std::vector<EnergySumZdcTemplate> >&);
156 
157  //
158  inline const std::vector<std::vector<AXOL1TLTemplate> >& vecAXOL1TLTemplate() const { return m_vecAXOL1TLTemplate; }
159  void setVecAXOL1TLTemplate(const std::vector<std::vector<AXOL1TLTemplate> >&);
160 
161  //
162  inline const std::vector<std::vector<CICADATemplate> >& vecCICADATemplate() const { return m_vecCICADATemplate; }
163  void setVecCICADATemplate(const std::vector<std::vector<CICADATemplate> >&);
164 
165  //
166  inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
167  return m_vecExternalTemplate;
168  }
169 
170  void setVecExternalTemplate(const std::vector<std::vector<ExternalTemplate> >&);
171 
172  //
173  inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
175  }
176 
177  void setVecCorrelationTemplate(const std::vector<std::vector<CorrelationTemplate> >&);
178 
179  //
180  inline const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTemplate() const {
182  }
183 
184  void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);
185 
186  //
187  inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
190  }
191 
193  const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
194 
195  // get / set the vectors containing the conditions for correlation templates
196  //
197  inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
198 
199  void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
200 
201  //
202  inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const { return m_corCaloTemplate; }
203 
204  void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
205 
206  //
207  inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
208  return m_corEnergySumTemplate;
209  }
210 
211  void setCorEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
212 
214  inline const AlgorithmMap& gtAlgorithmMap() const { return m_algorithmMap; }
215 
216  void setGtAlgorithmMap(const AlgorithmMap&);
217 
219  inline const AlgorithmMap& gtAlgorithmAliasMap() const { return m_algorithmAliasMap; }
220 
222 
223  public:
224  void parseCondFormats(const L1TUtmTriggerMenu* utmMenu);
225 
226  std::map<std::string, unsigned int> getExternalSignals(const L1TUtmTriggerMenu* utmMenu);
227 
228  public:
231 
233 
235 
237 
239 
241 
242  //
243 
244  inline const int gtTriggerMenuUUID() const { return m_triggerMenuUUID; }
245 
246  void setGtTriggerMenuUUID(const int);
247 
248  inline const std::string& gtTriggerMenuDate() const { return m_triggerMenuDate; }
249 
250  void setGtTriggerMenuDate(const std::string&);
251 
252  inline const std::string& gtTriggerMenuAuthor() const { return m_triggerMenuAuthor; }
253 
254  void setGtTriggerMenuAuthor(const std::string&);
255 
257 
259 
261 
263 
264  private:
265  // methods for conditions and algorithms
266 
269  void clearMaps();
270 
273  bool insertConditionIntoMap(GlobalCondition& cond, const int chipNr);
274 
276  bool insertAlgorithmIntoMap(const GlobalAlgorithm& alg);
277 
278  template <typename T>
280  int l1tstr2int(const std::string data);
281 
283  /* bool parseScale(L1TUtmScale scale); */
284  // bool parseScales( L1TUtmScale scale);
285  bool parseScales(std::map<std::string, tmeventsetup::esScale> scaleMap);
286 
288  /* bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode* node, */
289  /* const std::string& name, unsigned int chipNr = 0, */
290  /* const bool corrFlag = false); */
291  bool parseMuon(L1TUtmCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
292 
293  bool parseMuonCorr(const L1TUtmObject* condMu, unsigned int chipNr = 0);
294 
296  bool parseMuonShower(L1TUtmCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
297 
299  /* bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode* node, */
300  /* const std::string& name, unsigned int chipNr = 0, */
301  /* const bool corrFlag = false); */
302  bool parseCalo(L1TUtmCondition condCalo, unsigned int chipNr = 0, const bool corrFlag = false);
303 
304  bool parseCaloCorr(const L1TUtmObject* corrCalo, unsigned int chipNr = 0);
305 
307  /* bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode* node, */
308  /* const std::string& name, unsigned int chipNr = 0, */
309  /* const bool corrFlag = false); */
310 
311  bool parseEnergySum(L1TUtmCondition condEnergySums, unsigned int chipNr = 0, const bool corrFlag = false);
312 
313  bool parseEnergySumZdc(L1TUtmCondition condEnergySumZdcs, unsigned int chipNr = 0, const bool corrFlag = false);
314 
315  bool parseAXOL1TL(L1TUtmCondition condAXOL1TL, unsigned int chipNr = 0);
316 
317  bool parseCICADA(L1TUtmCondition condCICADA, unsigned int chipNr = 0);
318 
319  bool parseEnergySumCorr(const L1TUtmObject* corrESum, unsigned int chipNr = 0);
320 
321  bool parseExternal(L1TUtmCondition condExt, unsigned int chipNr = 0);
322 
324  bool parseCorrelation(L1TUtmCondition corrCond, unsigned int chipNr = 0);
325 
327  bool parseCorrelationThreeBody(L1TUtmCondition corrCond, unsigned int chipNr = 0);
328 
330  bool parseCorrelationWithOverlapRemoval(const L1TUtmCondition& corrCond, unsigned int chipNr = 0);
331 
333  //bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser* parser);
334  bool parseAlgorithm(L1TUtmAlgorithm algorithm, unsigned int chipNr = 0);
335 
336  // Parse LUT for Cal Mu Eta
337  void parseCalMuEta_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
338 
339  // Parse LUT for Cal Mu Phi
340  void parseCalMuPhi_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
341 
342  // Parse LUT for Pt LUT in Mass calculation
343  void parsePt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
344  std::string lutpfx,
345  std::string obj1,
346  unsigned int prec);
347 
348  // Parse LUT for Upt LUT in Mass calculation for displaced muons
349  void parseUpt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
350  std::string lutpfx,
351  std::string obj1,
352  unsigned int prec);
353 
354  // Parse LUT for Delta Eta and Cosh
355  void parseDeltaEta_Cosh_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
356  std::string obj1,
357  std::string obj2,
358  unsigned int prec1,
359  unsigned int prec2);
360 
361  // Parse LUT for Delta Eta and Cosh
362  void parseDeltaPhi_Cos_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
363  const std::string& obj1,
364  const std::string& obj2,
365  unsigned int prec1,
366  unsigned int prec2);
367 
368  // Parse LUT for Sin(Phi),Cos(Phi) in TwoBodyPt algorithm calculation
369  void parsePhi_Trig_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
370  const std::string& obj,
372  unsigned int prec);
373 
374  private:
376 
379 
381  unsigned int m_pinsOnConditionChip;
382 
385  std::vector<int> m_orderConditionChip;
386 
388  unsigned int m_numberPhysTriggers;
389 
391  //unsigned int m_numberTechTriggers;
392 
393  private:
397 
401 
403 
404  private:
406  std::vector<ConditionMap> m_conditionMap;
407 
408  private:
413  unsigned long m_triggerMenuUUID;
414 
417 
420  std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
421  std::vector<std::vector<MuonShowerTemplate> > m_vecMuonShowerTemplate;
422  std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
423  std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
424  std::vector<std::vector<EnergySumZdcTemplate> > m_vecEnergySumZdcTemplate;
425  std::vector<std::vector<AXOL1TLTemplate> > m_vecAXOL1TLTemplate;
426  std::vector<std::vector<CICADATemplate> > m_vecCICADATemplate;
427  std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
428 
429  std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
430  std::vector<std::vector<CorrelationThreeBodyTemplate> > m_vecCorrelationThreeBodyTemplate;
431  std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
432  std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
433  std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
434  std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
435 
438 
441 
442  // class containing the scales from the L1 Menu XML
444  };
445 
446 } // namespace l1t
447 #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
std::vector< std::vector< CICADATemplate > > m_vecCICADATemplate
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
const std::vector< std::vector< CICADATemplate > > & vecCICADATemplate() const
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 parseCICADA(L1TUtmCondition condCICADA, unsigned int chipNr=0)
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 &)
void setVecCICADATemplate(const std::vector< std::vector< CICADATemplate > > &)