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 
42 
44 
46 
47 #include "tmEventSetup/esTriggerMenu.hh"
48 #include "tmEventSetup/esAlgorithm.hh"
49 #include "tmEventSetup/esCondition.hh"
50 #include "tmEventSetup/esObject.hh"
51 #include "tmEventSetup/esCut.hh"
52 #include "tmEventSetup/esScale.hh"
53 
54 // forward declarations
55 class GlobalCondition;
56 class GlobalAlgorithm;
57 
58 namespace l1t {
59 
60  typedef enum { COS, SIN } TrigFunc_t;
61 
62  // class declaration
64  public:
68 
70  virtual ~TriggerMenuParser();
71 
72  public:
74  inline const unsigned int gtNumberConditionChips() const { return m_numberConditionChips; }
75 
76  void setGtNumberConditionChips(const unsigned int&);
77 
79  inline const unsigned int gtPinsOnConditionChip() const { return m_pinsOnConditionChip; }
80 
81  void setGtPinsOnConditionChip(const unsigned int&);
82 
85  inline std::vector<int> gtOrderConditionChip() const { return m_orderConditionChip; }
86 
87  void setGtOrderConditionChip(const std::vector<int>&);
88 
90  inline const unsigned int gtNumberPhysTriggers() const { return m_numberPhysTriggers; }
91 
92  void setGtNumberPhysTriggers(const unsigned int&);
93 
94  public:
96  inline const std::vector<ConditionMap>& gtConditionMap() const { return m_conditionMap; }
97 
98  void setGtConditionMap(const std::vector<ConditionMap>&);
99 
102 
104 
105  //
106  inline const std::string& gtTriggerMenuName() const { return m_triggerMenuName; }
107 
108  void setGtTriggerMenuName(const std::string&);
109 
110  //
111  inline const unsigned long gtTriggerMenuImplementation() const { return m_triggerMenuImplementation; }
112 
113  void setGtTriggerMenuImplementation(const unsigned long&);
114 
116  inline const std::string& gtScaleDbKey() const { return m_scaleDbKey; }
117 
119  inline const GlobalScales& gtScales() const { return m_gtScales; }
120 
121  void setGtScaleDbKey(const std::string&);
122 
124  inline const std::vector<std::vector<MuonTemplate> >& vecMuonTemplate() const { return m_vecMuonTemplate; }
125  void setVecMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
126 
127  //
128  inline const std::vector<std::vector<CaloTemplate> >& vecCaloTemplate() const { return m_vecCaloTemplate; }
129 
130  void setVecCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
131 
132  //
133  inline const std::vector<std::vector<EnergySumTemplate> >& vecEnergySumTemplate() const {
134  return m_vecEnergySumTemplate;
135  }
136 
137  void setVecEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
138 
139  //
140  inline const std::vector<std::vector<ExternalTemplate> >& vecExternalTemplate() const {
141  return m_vecExternalTemplate;
142  }
143 
144  void setVecExternalTemplate(const std::vector<std::vector<ExternalTemplate> >&);
145 
146  //
147  inline const std::vector<std::vector<CorrelationTemplate> >& vecCorrelationTemplate() const {
149  }
150 
151  void setVecCorrelationTemplate(const std::vector<std::vector<CorrelationTemplate> >&);
152 
153  //
154  inline const std::vector<std::vector<CorrelationThreeBodyTemplate> >& vecCorrelationThreeBodyTemplate() const {
156  }
157 
158  void setVecCorrelationThreeBodyTemplate(const std::vector<std::vector<CorrelationThreeBodyTemplate> >&);
159 
160  //
161  inline const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&
164  }
165 
167  const std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> >&);
168 
169  // get / set the vectors containing the conditions for correlation templates
170  //
171  inline const std::vector<std::vector<MuonTemplate> >& corMuonTemplate() const { return m_corMuonTemplate; }
172 
173  void setCorMuonTemplate(const std::vector<std::vector<MuonTemplate> >&);
174 
175  //
176  inline const std::vector<std::vector<CaloTemplate> >& corCaloTemplate() const { return m_corCaloTemplate; }
177 
178  void setCorCaloTemplate(const std::vector<std::vector<CaloTemplate> >&);
179 
180  //
181  inline const std::vector<std::vector<EnergySumTemplate> >& corEnergySumTemplate() const {
182  return m_corEnergySumTemplate;
183  }
184 
185  void setCorEnergySumTemplate(const std::vector<std::vector<EnergySumTemplate> >&);
186 
188  inline const AlgorithmMap& gtAlgorithmMap() const { return m_algorithmMap; }
189 
190  void setGtAlgorithmMap(const AlgorithmMap&);
191 
193  inline const AlgorithmMap& gtAlgorithmAliasMap() const { return m_algorithmAliasMap; }
194 
196 
197  public:
198  void parseCondFormats(const L1TUtmTriggerMenu* utmMenu);
199 
200  std::map<std::string, unsigned int> getExternalSignals(const L1TUtmTriggerMenu* utmMenu);
201 
202  public:
205 
207 
209 
211 
213 
215 
216  //
217 
218  inline const int gtTriggerMenuUUID() const { return m_triggerMenuUUID; }
219 
220  void setGtTriggerMenuUUID(const int);
221 
222  inline const std::string& gtTriggerMenuDate() const { return m_triggerMenuDate; }
223 
224  void setGtTriggerMenuDate(const std::string&);
225 
226  inline const std::string& gtTriggerMenuAuthor() const { return m_triggerMenuAuthor; }
227 
228  void setGtTriggerMenuAuthor(const std::string&);
229 
231 
233 
235 
237 
238  private:
239  // methods for conditions and algorithms
240 
243  void clearMaps();
244 
247  bool insertConditionIntoMap(GlobalCondition& cond, const int chipNr);
248 
250  bool insertAlgorithmIntoMap(const GlobalAlgorithm& alg);
251 
252  template <typename T>
254  int l1tstr2int(const std::string data);
255 
257  /* bool parseScale(tmeventsetup::esScale scale); */
258  // bool parseScales( tmeventsetup::esScale scale);
259  bool parseScales(std::map<std::string, tmeventsetup::esScale> scaleMap);
260 
262  /* bool parseMuon(XERCES_CPP_NAMESPACE::DOMNode* node, */
263  /* const std::string& name, unsigned int chipNr = 0, */
264  /* const bool corrFlag = false); */
265  bool parseMuon(tmeventsetup::esCondition condMu, unsigned int chipNr = 0, const bool corrFlag = false);
266 
267  bool parseMuonCorr(const tmeventsetup::esObject* condMu, unsigned int chipNr = 0);
268 
270  /* bool parseCalo(XERCES_CPP_NAMESPACE::DOMNode* node, */
271  /* const std::string& name, unsigned int chipNr = 0, */
272  /* const bool corrFlag = false); */
273  bool parseCalo(tmeventsetup::esCondition condCalo, unsigned int chipNr = 0, const bool corrFlag = false);
274 
275  bool parseCaloCorr(const tmeventsetup::esObject* corrCalo, unsigned int chipNr = 0);
276 
278  /* bool parseEnergySum(XERCES_CPP_NAMESPACE::DOMNode* node, */
279  /* const std::string& name, unsigned int chipNr = 0, */
280  /* const bool corrFlag = false); */
281 
282  bool parseEnergySum(tmeventsetup::esCondition condEnergySums, unsigned int chipNr = 0, const bool corrFlag = false);
283 
284  bool parseEnergySumCorr(const tmeventsetup::esObject* corrESum, unsigned int chipNr = 0);
285 
286  bool parseExternal(tmeventsetup::esCondition condExt, unsigned int chipNr = 0);
287 
289  bool parseCorrelation(tmeventsetup::esCondition corrCond, unsigned int chipNr = 0);
290 
292  bool parseCorrelationThreeBody(tmeventsetup::esCondition corrCond, unsigned int chipNr = 0);
293 
295  bool parseCorrelationWithOverlapRemoval(const tmeventsetup::esCondition& corrCond, unsigned int chipNr = 0);
296 
298  //bool parseAlgorithms(XERCES_CPP_NAMESPACE::XercesDOMParser* parser);
299  bool parseAlgorithm(tmeventsetup::esAlgorithm algorithm, unsigned int chipNr = 0);
300 
301  // Parse LUT for Cal Mu Eta
302  void parseCalMuEta_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
303 
304  // Parse LUT for Cal Mu Phi
305  void parseCalMuPhi_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap, std::string obj1, std::string obj2);
306 
307  // Parse LUT for Pt LUT in Mass calculation
308  void parsePt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
309  std::string lutpfx,
310  std::string obj1,
311  unsigned int prec);
312 
313  // Parse LUT for Upt LUT in Mass calculation for displaced muons
314  void parseUpt_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
315  std::string lutpfx,
316  std::string obj1,
317  unsigned int prec);
318 
319  // Parse LUT for Delta Eta and Cosh
320  void parseDeltaEta_Cosh_LUTS(std::map<std::string, tmeventsetup::esScale> scaleMap,
321  std::string obj1,
322  std::string obj2,
323  unsigned int prec1,
324  unsigned int prec2);
325 
326  // Parse LUT for Delta Eta and Cosh
327  void parseDeltaPhi_Cos_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
328  const std::string& obj1,
329  const std::string& obj2,
330  unsigned int prec1,
331  unsigned int prec2);
332 
333  // Parse LUT for Sin(Phi),Cos(Phi) in TwoBodyPt algorithm calculation
334  void parsePhi_Trig_LUTS(const std::map<std::string, tmeventsetup::esScale>& scaleMap,
335  const std::string& obj,
337  unsigned int prec);
338 
339  private:
341 
344 
346  unsigned int m_pinsOnConditionChip;
347 
350  std::vector<int> m_orderConditionChip;
351 
353  unsigned int m_numberPhysTriggers;
354 
356  //unsigned int m_numberTechTriggers;
357 
358  private:
362 
366 
368 
369  private:
371  std::vector<ConditionMap> m_conditionMap;
372 
373  private:
378  unsigned long m_triggerMenuUUID;
379 
382 
385  std::vector<std::vector<MuonTemplate> > m_vecMuonTemplate;
386  std::vector<std::vector<CaloTemplate> > m_vecCaloTemplate;
387  std::vector<std::vector<EnergySumTemplate> > m_vecEnergySumTemplate;
388  std::vector<std::vector<ExternalTemplate> > m_vecExternalTemplate;
389 
390  std::vector<std::vector<CorrelationTemplate> > m_vecCorrelationTemplate;
391  std::vector<std::vector<CorrelationThreeBodyTemplate> > m_vecCorrelationThreeBodyTemplate;
392  std::vector<std::vector<CorrelationWithOverlapRemovalTemplate> > m_vecCorrelationWithOverlapRemovalTemplate;
393  std::vector<std::vector<MuonTemplate> > m_corMuonTemplate;
394  std::vector<std::vector<CaloTemplate> > m_corCaloTemplate;
395  std::vector<std::vector<EnergySumTemplate> > m_corEnergySumTemplate;
396 
399 
402 
403  // class containing the scales from the L1 Menu XML
405  };
406 
407 } // namespace l1t
408 #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 > &)
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< 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
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