CMS 3D CMS Logo

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/lexical_cast.hpp"
20 
21 #include <memory>
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  std::unique_ptr<L1GtTriggerMenu> newObject(const std::string& objectKey) override;
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  // Oracle / Coral pretends that chargeCorrelation is bool in OMDS
102  // can not be - it has three values...
103  // but it reads/writes correctly the numerical value from OMDS (1, 2...)
111  };
112 
117  bool enableMip;
118  bool enableIso;
121  float etThreshold;
124  short phiHigh;
125  short phiLow;
127  bool charge;
128 
129  };
130 
132  short bitNumberSh;
134  };
135 
137 
139  bool tableMenuGeneralFromDB(const std::string& gtSchema, const std::string& objKey);
140 
142  bool tableMenuAlgoFromDB(const std::string& gtSchema, const std::string& objKey);
143 
145  bool tableMenuAlgoCondFromDB(const std::string& gtSchema, const std::string& objKey);
146 
148  bool tableMenuCondFromDB(const std::string& gtSchema, const std::string& objKey);
149 
151  bool tableMenuObjectParametersFromDB(const std::string& gtSchema, const std::string& objKey);
152 
154  bool tableMenuTechTrigFromDB(const std::string& gtSchema, const std::string& objKey);
155 
156 private:
157 
160  const std::map<int, std::string> condIndexNameMap(const short bitNr) const;
161 
163  std::string convertLogicalExpression(const std::string&, const std::map<int, std::string>&) const;
164 
166  int chipNumber(short) const;
167 
169  void buildAlgorithmMap();
170 
173 
176 
179 
181  L1GtObject strToEnumL1GtObject(const std::string& strObject);
182 
185  const std::string& hexStr, std::string& hex0WordStr, std::string& hex1WordStr);
186 
188  std::list<int> listChipNumber(const std::string&);
189 
191  void addMuonCondition(const TableMenuCond&);
192 
194  void addCaloCondition(const TableMenuCond&);
195 
199 
203  void addCastorCondition(const TableMenuCond&);
204  void addBptxCondition(const TableMenuCond&);
205  void addExternalCondition(const TableMenuCond&);
207 
209  void addConditions();
210 
211 
212 private:
213  template<typename Result, typename Source>
214  Result lexical_cast_from_hex(Source & value) const;
215 
216 
217 private:
218 
220 
222  std::vector<TableMenuAlgo> m_tableMenuAlgo;
223  std::vector<TableMenuAlgoCond> m_tableMenuAlgoCond;
224  std::vector<TableMenuCond> m_tableMenuCond;
225  std::vector<TableMenuObjectParameters> m_tableMenuObjectParameters;
226  std::vector<TableMenuTechTrig> m_tableMenuTechTrig;
227 
228 private:
229 
231 
236 
239 
242  std::vector<std::vector<L1GtMuonTemplate> > m_vecMuonTemplate;
243  std::vector<std::vector<L1GtCaloTemplate> > m_vecCaloTemplate;
244  std::vector<std::vector<L1GtEnergySumTemplate> > m_vecEnergySumTemplate;
245  std::vector<std::vector<L1GtJetCountsTemplate> > m_vecJetCountsTemplate;
246  std::vector<std::vector<L1GtCastorTemplate> > m_vecCastorTemplate;
247  std::vector<std::vector<L1GtHfBitCountsTemplate> > m_vecHfBitCountsTemplate;
248  std::vector<std::vector<L1GtHfRingEtSumsTemplate> > m_vecHfRingEtSumsTemplate;
249  std::vector<std::vector<L1GtBptxTemplate> > m_vecBptxTemplate;
250  std::vector<std::vector<L1GtExternalTemplate> > m_vecExternalTemplate;
251 
252  std::vector<std::vector<L1GtCorrelationTemplate> > m_vecCorrelationTemplate;
253  std::vector<std::vector<L1GtMuonTemplate> > m_corMuonTemplate;
254  std::vector<std::vector<L1GtCaloTemplate> > m_corCaloTemplate;
255  std::vector<std::vector<L1GtEnergySumTemplate> > m_corEnergySumTemplate;
256 
259 
262 
265 
266 private:
267 
269 
270 
271 };
272 
273 
274 
275 template<typename Result, typename Source>
277 
278  std::stringstream convertor;
279  convertor << value;
280 
281  Result result;
282  if (! ( convertor >> std::hex >> result ) || !convertor.eof()) {
283  throw boost::bad_lexical_cast();
284  }
285 
286  return result;
287 }
288 
289 
290 #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
std::unique_ptr< L1GtTriggerMenu > newObject(const std::string &objectKey) override
public methods
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
L1GtConditionType strToEnumCondType(const std::string &strType)
string to enum L1GtConditionType conversion
void buildAlgorithmMap()
build the algorithm map in the menu
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
Definition: value.py:1
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