CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 "tmEventSetup/esTriggerMenu.hh"
49 #include "tmEventSetup/esAlgorithm.hh"
50 #include "tmEventSetup/esCondition.hh"
51 #include "tmEventSetup/esObject.hh"
52 #include "tmEventSetup/esCut.hh"
53 #include "tmEventSetup/esScale.hh"
54 
55 // forward declarations
56 class GlobalCondition;
57 class GlobalAlgorithm;
58 
59 namespace l1t {
60 
61  typedef enum { COS, SIN } TrigFunc_t;
62 
63  // class declaration
65  public:
69 
71  virtual ~TriggerMenuParser();
72 
73  public:
75  inline const unsigned int gtNumberConditionChips() const { return m_numberConditionChips; }
76 
77  void setGtNumberConditionChips(const unsigned int&);
78 
80  inline const unsigned int gtPinsOnConditionChip() const { return m_pinsOnConditionChip; }
81 
82  void setGtPinsOnConditionChip(const unsigned int&);
83 
86  inline std::vector<int> gtOrderConditionChip() const { return m_orderConditionChip; }
87 
88  void setGtOrderConditionChip(const std::vector<int>&);
89 
91  inline const unsigned int gtNumberPhysTriggers() const { return m_numberPhysTriggers; }
92 
93  void setGtNumberPhysTriggers(const unsigned int&);
94 
95  public:
97  inline const std::vector<ConditionMap>& gtConditionMap() const { return m_conditionMap; }
98 
99  void setGtConditionMap(const std::vector<ConditionMap>&);
100 
103 
105 
106  //
107  inline const std::string& gtTriggerMenuName() const { return m_triggerMenuName; }
108 
109  void setGtTriggerMenuName(const std::string&);
110 
111  //
112  inline const unsigned long gtTriggerMenuImplementation() const { return m_triggerMenuImplementation; }
113 
114  void setGtTriggerMenuImplementation(const unsigned long&);
115 
117  inline const std::string& gtScaleDbKey() const { return m_scaleDbKey; }
118 
120  inline const GlobalScales& gtScales() const { return m_gtScales; }
121 
122  void setGtScaleDbKey(const std::string&);
123 
125  inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const { return m_vecMuonTemplate; }
126  void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
127 
128  //
129  inline const std::vector<std::vector<MuonShowerTemplate> >& vecMuonShowerTemplate() const {
131  }
132  void setVecMuonShowerTemplate(const std::vector<std::vector<MuonShowerTemplate> >&);
133 
134  //
135  inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const { return m_vecCaloTemplate; }
136 
137  void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
138 
139  //
140  inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
141  return m_vecEnergySumTemplate;
142  }
143 
144  void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
145 
146  //
147  inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
148  return m_vecExternalTemplate;
149  }
150 
151  void setVecExternalTemplate(const std::vector<std::vector<ExternalTemplate> >&);
152 
153  //
154  inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
156  }
157 
158  void setVecCorrelationTemplate(const std::vector<std::vector<CorrelationTemplate> >&);
159 
160  //
161  inline const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTemplate() const {
163  }
164 
165  void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);
166 
167  //
168  inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
171  }
172 
174  const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
175 
176  // get / set the vectors containing the conditions for correlation templates
177  //
178  inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
179 
180  void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
181 
182  //
183  inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const { return m_corCaloTemplate; }
184 
185  void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
186 
187  //
188  inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
189  return m_corEnergySumTemplate;
190  }
191 
192  void setCorEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
193 
195  inline const AlgorithmMap& gtAlgorithmMap() const { return m_algorithmMap; }
196 
197  void setGtAlgorithmMap(const AlgorithmMap&);
198 
200  inline const AlgorithmMap& gtAlgorithmAliasMap() const { return m_algorithmAliasMap; }
201 
203 
204  public:
205  void parseCondFormats(const L1TUtmTriggerMenu* utmMenu);
206 
207  std::map<std::string, unsigned int> getExternalSignals(const L1TUtmTriggerMenu* utmMenu);
208 
209  public:
212 
214 
216 
218 
220 
222 
223  //
224 
225  inline const int gtTriggerMenuUUID() const { return m_triggerMenuUUID; }
226 
227  void setGtTriggerMenuUUID(const int);
228 
229  inline const std::string& gtTriggerMenuDate() const { return m_triggerMenuDate; }
230 
231  void setGtTriggerMenuDate(const std::string&);
232 
233  inline const std::string& gtTriggerMenuAuthor() const { return m_triggerMenuAuthor; }
234 
235  void setGtTriggerMenuAuthor(const std::string&);
236 
238 
240 
242 
244 
245  private:
246  // methods for conditions and algorithms
247 
250  void clearMaps();
251 
254  bool insertConditionIntoMap(GlobalCondition& cond, const int chipNr);
255 
257  bool insertAlgorithmIntoMap(const GlobalAlgorithm& alg);
258 
259  template <typename T>
261  int l1tstr2int(const std::string data);
262 
264  /* bool parseScale(tmeventsetup::esScale scale); */
265  // bool parseScales( tmeventsetup::esScale scale);
266  bool parseScales(std::map<std::string, tmeventsetup::esScale> scaleMap);
267 
269  /* bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode* node, */
270  /* const std::string& name, unsigned int chipNr = 0, */
271  /* const bool corrFlag = false); */
272  bool parseMuon(tmeventsetup::esCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
273 
274  bool parseMuonCorr(const tmeventsetup::esObject* condMu, unsigned int chipNr = 0);
275 
277  bool parseMuonShower(tmeventsetup::esCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
278 
280  /* bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode* node, */
281  /* const std::string& name, unsigned int chipNr = 0, */
282  /* const bool corrFlag = false); */
283  bool parseCalo(tmeventsetup::esCondition condCalo, unsigned int chipNr = 0, const bool corrFlag = false);
284 
285  bool parseCaloCorr(const tmeventsetup::esObject* corrCalo, unsigned int chipNr = 0);
286 
288  /* bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode* node, */
289  /* const std::string& name, unsigned int chipNr = 0, */
290  /* const bool corrFlag = false); */
291 
292  bool parseEnergySum(tmeventsetup::esCondition condEnergySums, unsigned int chipNr = 0, const bool corrFlag = false);
293 
294  bool parseEnergySumCorr(const tmeventsetup::esObject* corrESum, unsigned int chipNr = 0);
295 
296  bool parseExternal(tmeventsetup::esCondition condExt, unsigned int chipNr = 0);
297 
299  bool parseCorrelation(tmeventsetup::esCondition corrCond, unsigned int chipNr = 0);
300 
302  bool parseCorrelationThreeBody(tmeventsetup::esCondition corrCond, unsigned int chipNr = 0);
303 
305  bool parseCorrelationWithOverlapRemoval(const tmeventsetup::esCondition& corrCond, unsigned int chipNr = 0);
306 
308  //bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser* parser);
309  bool parseAlgorithm(tmeventsetup::esAlgorithm algorithm, unsigned int chipNr = 0);
310 
311  // Parse LUT for Cal Mu Eta
312  void parseCalMuEta_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
313 
314  // Parse LUT for Cal Mu Phi
315  void parseCalMuPhi_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
316 
317  // Parse LUT for Pt LUT in Mass calculation
318  void parsePt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
319  std::string lutpfx,
320  std::string obj1,
321  unsigned int prec);
322 
323  // Parse LUT for Upt LUT in Mass calculation for displaced muons
324  void parseUpt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
325  std::string lutpfx,
326  std::string obj1,
327  unsigned int prec);
328 
329  // Parse LUT for Delta Eta and Cosh
330  void parseDeltaEta_Cosh_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
331  std::string obj1,
332  std::string obj2,
333  unsigned int prec1,
334  unsigned int prec2);
335 
336  // Parse LUT for Delta Eta and Cosh
337  void parseDeltaPhi_Cos_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
338  const std::string& obj1,
339  const std::string& obj2,
340  unsigned int prec1,
341  unsigned int prec2);
342 
343  // Parse LUT for Sin(Phi),Cos(Phi) in TwoBodyPt algorithm calculation
344  void parsePhi_Trig_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
345  const std::string& obj,
347  unsigned int prec);
348 
349  private:
351 
354 
356  unsigned int m_pinsOnConditionChip;
357 
360  std::vector<int> m_orderConditionChip;
361 
363  unsigned int m_numberPhysTriggers;
364 
366  //unsigned int m_numberTechTriggers;
367 
368  private:
372 
376 
378 
379  private:
381  std::vector<ConditionMap> m_conditionMap;
382 
383  private:
388  unsigned long m_triggerMenuUUID;
389 
392 
395  std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
396  std::vector<std::vector<MuonShowerTemplate> > m_vecMuonShowerTemplate;
397  std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
398  std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
399  std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
400 
401  std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
402  std::vector<std::vector<CorrelationThreeBodyTemplate> > m_vecCorrelationThreeBodyTemplate;
403  std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
404  std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
405  std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
406  std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
407 
410 
413 
414  // class containing the scales from the L1 Menu XML
416  };
417 
418 } // namespace l1t
419 #endif /*L1TGlobal_TriggerMenuParser_h*/
std::vector< std::vector< MuonShowerTemplate > > m_vecMuonShowerTemplate
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
bool parseMuonShower(tmeventsetup::esCondition condMu, unsigned int chipNr=0, const bool corrFlag=false)
parse a muon shower condition
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 > &)
void parseUpt_LUTS(std::map< std::string, tmeventsetup::esScale > scaleMap, std::string lutpfx, std::string obj1, unsigned int prec)
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)
bool parseCorrelationThreeBody(tmeventsetup::esCondition corrCond, unsigned int chipNr=0)
parse a three-body correlation condition
unsigned int m_numberConditionChips
hardware limits
const std::vector< std::vector< MuonShowerTemplate > > & vecMuonShowerTemplate() const
const std::vector< std::vector< CorrelationWithOverlapRemovalTemplate > > & vecCorrelationWithOverlapRemovalTemplate() const
std::vector< std::vector< CaloTemplate > > m_vecCaloTemplate
void setGtAlgorithmMap(const AlgorithmMap &)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t Func __host__ __device__ V int Func func
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
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
std::vector< std::vector< CorrelationThreeBodyTemplate > > m_vecCorrelationThreeBodyTemplate
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
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 &)
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 &quot;energy sum&quot; 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
const std::vector< std::vector< CorrelationThreeBodyTemplate > > & vecCorrelationThreeBodyTemplate() const
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
bool parseCorrelationWithOverlapRemoval(const tmeventsetup::esCondition &corrCond, unsigned int chipNr=0)
parse a correlation condition with overlap removal
void setVecMuonShowerTemplate(const std::vector< std::vector< MuonShowerTemplate > > &)
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