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 
18 // system include files
19 #include "boost/shared_ptr.hpp"
20 #include "boost/lexical_cast.hpp"
21 
22 #include <string>
23 #include <vector>
24 #include <iomanip>
25 #include <iostream>
26 
27 // user include files
28 // base class
30 
33 
44 
45 // forward declarations
46 
47 // class declaration
49  public L1ConfigOnlineProdBase<L1GtTriggerMenuRcd, L1GtTriggerMenu>
50 {
51 
52 public:
53 
56 
59 
61  virtual boost::shared_ptr<L1GtTriggerMenu> newObject(const std::string& objectKey);
62 
64  void init(const int numberConditionChips);
65 
66 
67 private:
68 
70 
76  };
77 
78  struct TableMenuAlgo {
79  short bitNumberSh;
83  };
84 
86  short bitNumberSh;
87  float condIndexF;
89  };
90 
91  struct TableMenuCond {
97  bool condGEq;
98  short countIndex;
100 
101  // FIXME - Oracle / Coral pretends that chargeCorrelation is bool in OMDS
102  // can not be - it has three values...
110  };
111 
116  bool enableMip;
117  bool enableIso;
120  float etThreshold;
123  short phiHigh;
124  short phiLow;
126  bool charge;
127 
128  };
129 
131  short bitNumberSh;
133  };
134 
136 
138  bool tableMenuGeneralFromDB(const std::string& gtSchema, const std::string& objKey);
139 
141  bool tableMenuAlgoFromDB(const std::string& gtSchema, const std::string& objKey);
142 
144  bool tableMenuAlgoCondFromDB(const std::string& gtSchema, const std::string& objKey);
145 
147  bool tableMenuCondFromDB(const std::string& gtSchema, const std::string& objKey);
148 
150  bool tableMenuObjectParametersFromDB(const std::string& gtSchema, const std::string& objKey);
151 
153  bool tableMenuTechTrigFromDB(const std::string& gtSchema, const std::string& objKey);
154 
155 private:
156 
159  const std::map<int, std::string> condIndexNameMap(const short bitNr) const;
160 
162  std::string convertLogicalExpression(const std::string&, const std::map<int, std::string>&) const;
163 
165  int chipNumber(short) const;
166 
168  void buildAlgorithmMap();
169 
172 
175 
178 
180  L1GtObject strToEnumL1GtObject(const std::string& strObject);
181 
184  const std::string& hexStr, std::string& hex0WordStr, std::string& hex1WordStr);
185 
187  std::list<int> listChipNumber(const std::string&);
188 
190  void addMuonCondition(const TableMenuCond&);
191 
193  void addCaloCondition(const TableMenuCond&);
194 
198 
202  void addCastorCondition(const TableMenuCond&);
203  void addBptxCondition(const TableMenuCond&);
204  void addExternalCondition(const TableMenuCond&);
206 
208  void addConditions();
209 
210 
211 private:
212  template<typename Result, typename Source>
213  Result lexical_cast_from_hex(Source & value) const;
214 
215 
216 private:
217 
219 
221  std::vector<TableMenuAlgo> m_tableMenuAlgo;
222  std::vector<TableMenuAlgoCond> m_tableMenuAlgoCond;
223  std::vector<TableMenuCond> m_tableMenuCond;
224  std::vector<TableMenuObjectParameters> m_tableMenuObjectParameters;
225  std::vector<TableMenuTechTrig> m_tableMenuTechTrig;
226 
227 private:
228 
230 
235 
238 
241  std::vector<std::vector<L1GtMuonTemplate> > m_vecMuonTemplate;
242  std::vector<std::vector<L1GtCaloTemplate> > m_vecCaloTemplate;
243  std::vector<std::vector<L1GtEnergySumTemplate> > m_vecEnergySumTemplate;
244  std::vector<std::vector<L1GtJetCountsTemplate> > m_vecJetCountsTemplate;
245  std::vector<std::vector<L1GtCastorTemplate> > m_vecCastorTemplate;
246  std::vector<std::vector<L1GtHfBitCountsTemplate> > m_vecHfBitCountsTemplate;
247  std::vector<std::vector<L1GtHfRingEtSumsTemplate> > m_vecHfRingEtSumsTemplate;
248  std::vector<std::vector<L1GtBptxTemplate> > m_vecBptxTemplate;
249  std::vector<std::vector<L1GtExternalTemplate> > m_vecExternalTemplate;
250 
251  std::vector<std::vector<L1GtCorrelationTemplate> > m_vecCorrelationTemplate;
252  std::vector<std::vector<L1GtMuonTemplate> > m_corMuonTemplate;
253  std::vector<std::vector<L1GtCaloTemplate> > m_corCaloTemplate;
254  std::vector<std::vector<L1GtEnergySumTemplate> > m_corEnergySumTemplate;
255 
258 
261 
264 
265 private:
266 
268 
269 
270 };
271 
272 
273 
274 template<typename Result, typename Source>
276 
277  std::stringstream convertor;
278  convertor << value;
279 
280  Result result;
281  if (! ( convertor >> std::hex >> result ) || !convertor.eof()) {
282  throw boost::bad_lexical_cast();
283  }
284 
285  return result;
286 }
287 
288 
289 #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