CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1GtTriggerMenuConfigOnlineProd.h
Go to the documentation of this file.
1 #ifndef L1GtConfigProducers_L1GtTriggerMenuConfigOnlineProd_h
2 #define L1GtConfigProducers_L1GtTriggerMenuConfigOnlineProd_h
3 
20 // system include files
21 #include "boost/shared_ptr.hpp"
22 #include "boost/lexical_cast.hpp"
23 
24 #include <string>
25 #include <vector>
26 #include <iomanip>
27 #include <iostream>
28 
29 // user include files
30 // base class
32 
35 
46 
47 // forward declarations
48 
49 // class declaration
51  public L1ConfigOnlineProdBase<L1GtTriggerMenuRcd, L1GtTriggerMenu>
52 {
53 
54 public:
55 
58 
61 
63  virtual boost::shared_ptr<L1GtTriggerMenu> newObject(const std::string& objectKey);
64 
66  void init(const int numberConditionChips);
67 
68 
69 private:
70 
72 
78  };
79 
80  struct TableMenuAlgo {
81  short bitNumberSh;
85  };
86 
88  short bitNumberSh;
89  float condIndexF;
91  };
92 
93  struct TableMenuCond {
99  bool condGEq;
100  short countIndex;
102 
103  // FIXME - Oracle / Coral pretends that chargeCorrelation is bool in OMDS
104  // can not be - it has three values...
112  };
113 
118  bool enableMip;
119  bool enableIso;
122  float etThreshold;
125  short phiHigh;
126  short phiLow;
128  bool charge;
129 
130  };
131 
133  short bitNumberSh;
135  };
136 
138 
140  bool tableMenuGeneralFromDB(const std::string& gtSchema, const std::string& objKey);
141 
143  bool tableMenuAlgoFromDB(const std::string& gtSchema, const std::string& objKey);
144 
146  bool tableMenuAlgoCondFromDB(const std::string& gtSchema, const std::string& objKey);
147 
149  bool tableMenuCondFromDB(const std::string& gtSchema, const std::string& objKey);
150 
152  bool tableMenuObjectParametersFromDB(const std::string& gtSchema, const std::string& objKey);
153 
155  bool tableMenuTechTrigFromDB(const std::string& gtSchema, const std::string& objKey);
156 
157 private:
158 
161  const std::map<int, std::string> condIndexNameMap(const short bitNr) const;
162 
164  std::string convertLogicalExpression(const std::string&, const std::map<int, std::string>&) const;
165 
167  int chipNumber(short) const;
168 
170  void buildAlgorithmMap();
171 
174 
177 
180 
182  L1GtObject strToEnumL1GtObject(const std::string& strObject);
183 
186  const std::string& hexStr, std::string& hex0WordStr, std::string& hex1WordStr);
187 
189  std::list<int> listChipNumber(const std::string&);
190 
192  void addMuonCondition(const TableMenuCond&);
193 
195  void addCaloCondition(const TableMenuCond&);
196 
200 
204  void addCastorCondition(const TableMenuCond&);
205  void addBptxCondition(const TableMenuCond&);
206  void addExternalCondition(const TableMenuCond&);
208 
210  void addConditions();
211 
212 
213 private:
214  template<typename Result, typename Source>
215  Result lexical_cast_from_hex(Source & value) const;
216 
217 
218 private:
219 
221 
223  std::vector<TableMenuAlgo> m_tableMenuAlgo;
224  std::vector<TableMenuAlgoCond> m_tableMenuAlgoCond;
225  std::vector<TableMenuCond> m_tableMenuCond;
226  std::vector<TableMenuObjectParameters> m_tableMenuObjectParameters;
227  std::vector<TableMenuTechTrig> m_tableMenuTechTrig;
228 
229 private:
230 
232 
237 
240 
243  std::vector<std::vector<L1GtMuonTemplate> > m_vecMuonTemplate;
244  std::vector<std::vector<L1GtCaloTemplate> > m_vecCaloTemplate;
245  std::vector<std::vector<L1GtEnergySumTemplate> > m_vecEnergySumTemplate;
246  std::vector<std::vector<L1GtJetCountsTemplate> > m_vecJetCountsTemplate;
247  std::vector<std::vector<L1GtCastorTemplate> > m_vecCastorTemplate;
248  std::vector<std::vector<L1GtHfBitCountsTemplate> > m_vecHfBitCountsTemplate;
249  std::vector<std::vector<L1GtHfRingEtSumsTemplate> > m_vecHfRingEtSumsTemplate;
250  std::vector<std::vector<L1GtBptxTemplate> > m_vecBptxTemplate;
251  std::vector<std::vector<L1GtExternalTemplate> > m_vecExternalTemplate;
252 
253  std::vector<std::vector<L1GtCorrelationTemplate> > m_vecCorrelationTemplate;
254  std::vector<std::vector<L1GtMuonTemplate> > m_corMuonTemplate;
255  std::vector<std::vector<L1GtCaloTemplate> > m_corCaloTemplate;
256  std::vector<std::vector<L1GtEnergySumTemplate> > m_corEnergySumTemplate;
257 
260 
263 
266 
267 private:
268 
270 
271 
272 };
273 
274 
275 
276 template<typename Result, typename Source>
278 
279  std::stringstream convertor;
280  convertor << value;
281 
282  Result result;
283  if (! ( convertor >> std::hex >> result ) || !convertor.eof()) {
284  throw boost::bad_lexical_cast();
285  }
286 
287  return result;
288 }
289 
290 
291 #endif
const std::map< int, std::string > condIndexNameMap(const short bitNr) const
L1GtTriggerMenuConfigOnlineProd(const edm::ParameterSet &)
constructor
void fillMuonObjectParameter(const std::string &opFK, L1GtMuonTemplate::ObjectParameter &)
bool tableMenuAlgoCondFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with conditions associated to physics algorithms from DB
Result lexical_cast_from_hex(Source &value) const
bool tableMenuAlgoFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with physics algorithms from DB
void fillCaloObjectParameter(const std::string &opFK, L1GtCaloTemplate::ObjectParameter &)
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
std::vector< std::vector< L1GtCorrelationTemplate > > m_vecCorrelationTemplate
bool tableMenuCondFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with list of conditions in the menu
std::vector< std::vector< L1GtJetCountsTemplate > > m_vecJetCountsTemplate
L1GtConditionType
void fillEnergySumObjectParameter(const std::string &opFK, L1GtEnergySumTemplate::ObjectParameter &, const L1GtObject &)
std::vector< std::vector< L1GtBptxTemplate > > m_vecBptxTemplate
std::vector< std::vector< L1GtCaloTemplate > > m_corCaloTemplate
std::vector< std::vector< L1GtCaloTemplate > > m_vecCaloTemplate
std::vector< std::vector< L1GtExternalTemplate > > m_vecExternalTemplate
AlgorithmMap m_algorithmAliasMap
map containing the physics algorithms (by alias)
std::vector< std::vector< L1GtCastorTemplate > > m_vecCastorTemplate
TableMenuGeneral m_tableMenuGeneral
member to keep various tables retrieved from DB
virtual boost::shared_ptr< L1GtTriggerMenu > newObject(const std::string &objectKey)
public methods
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
void buildAlgorithmMap()
build the algorithm map in the menu
tuple result
Definition: query.py:137
L1GtConditionCategory
condition categories
std::vector< TableMenuTechTrig > m_tableMenuTechTrig
std::string convertLogicalExpression(const std::string &, const std::map< int, std::string > &) const
convert a logical expression with indices to a logical expression with names
typedef for a single object template
void addConditions()
add the conditions from a menu to the corresponding list
std::list< int > listChipNumber(const std::string &)
get a list of chip numbers from the m_tableMenuAlgoCond table for a condition
std::string m_scaleDbKey
menu associated scale key
bool tableMenuTechTrigFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with technical triggers from DB
AlgorithmMap m_technicalTriggerMap
map containing the technical triggers
int chipNumber(short) const
return the chip number for an algorithm with index bitNumberSh
define simple structures to get the tables from DB
bool tableMenuGeneralFromDB(const std::string &gtSchema, const std::string &objKey)
methods to retrieve the tables from DB
std::vector< TableMenuObjectParameters > m_tableMenuObjectParameters
std::vector< std::vector< L1GtMuonTemplate > > m_vecMuonTemplate
void splitHexStringInTwo64bitWords(const std::string &hexStr, std::string &hex0WordStr, std::string &hex1WordStr)
split a hex string in two 64-bit words returned as hex strings
void buildTechnicalTriggerMap()
build the technical trigger map in the menu
void init(const int numberConditionChips)
initialize the class (mainly reserve/resize)
void addHfRingEtSumsCondition(const TableMenuCond &)
std::vector< TableMenuAlgoCond > m_tableMenuAlgoCond
std::string m_triggerMenuInterface
menu representation
std::vector< std::vector< L1GtEnergySumTemplate > > m_vecEnergySumTemplate
std::vector< std::vector< L1GtEnergySumTemplate > > m_corEnergySumTemplate
std::vector< std::vector< L1GtMuonTemplate > > m_corMuonTemplate
AlgorithmMap m_algorithmMap
map containing the physics algorithms (by name)
std::vector< std::vector< L1GtHfBitCountsTemplate > > m_vecHfBitCountsTemplate
std::vector< std::vector< L1GtHfRingEtSumsTemplate > > m_vecHfRingEtSumsTemplate
L1GtConditionCategory strToEnumCondCategory(const std::string &strCategory)
string to enum L1GtConditionCategory conversion
bool tableMenuObjectParametersFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with object parameters from DB
typedef for a single object template
L1GtObject strToEnumL1GtObject(const std::string &strObject)
string to enum L1GtObject conversion