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 
20 #include <memory>
21 #include <string>
22 #include <vector>
23 #include <iomanip>
24 #include <iostream>
25 
26 // user include files
27 // base class
29 
32 
43 
44 // forward declarations
45 
46 // class declaration
47 class L1GtTriggerMenuConfigOnlineProd : public L1ConfigOnlineProdBase<L1GtTriggerMenuRcd, L1GtTriggerMenu> {
48 public:
51 
54 
56  std::unique_ptr<L1GtTriggerMenu> newObject(const std::string& objectKey) override;
57 
59  void init(const int numberConditionChips);
60 
61 private:
63 
69  };
70 
71  struct TableMenuAlgo {
72  short bitNumberSh;
76  };
77 
79  short bitNumberSh;
80  float condIndexF;
82  };
83 
84  struct TableMenuCond {
90  bool condGEq;
91  short countIndex;
93 
94  // Oracle / Coral pretends that chargeCorrelation is bool in OMDS
95  // can not be - it has three values...
96  // but it reads/writes correctly the numerical value from OMDS (1, 2...)
104  };
105 
110  bool enableMip;
111  bool enableIso;
114  float etThreshold;
117  short phiHigh;
118  short phiLow;
120  bool charge;
121  };
122 
124  short bitNumberSh;
126  };
127 
129 
131  bool tableMenuGeneralFromDB(const std::string& gtSchema, const std::string& objKey);
132 
134  bool tableMenuAlgoFromDB(const std::string& gtSchema, const std::string& objKey);
135 
137  bool tableMenuAlgoCondFromDB(const std::string& gtSchema, const std::string& objKey);
138 
140  bool tableMenuCondFromDB(const std::string& gtSchema, const std::string& objKey);
141 
143  bool tableMenuObjectParametersFromDB(const std::string& gtSchema, const std::string& objKey);
144 
146  bool tableMenuTechTrigFromDB(const std::string& gtSchema, const std::string& objKey);
147 
148 private:
151  const std::map<int, std::string> condIndexNameMap(const short bitNr) const;
152 
154  std::string convertLogicalExpression(const std::string&, const std::map<int, std::string>&) const;
155 
157  int chipNumber(short) const;
158 
160  void buildAlgorithmMap();
161 
164 
167 
170 
172  L1GtObject strToEnumL1GtObject(const std::string& strObject);
173 
175  void splitHexStringInTwo64bitWords(const std::string& hexStr, std::string& hex0WordStr, std::string& hex1WordStr);
176 
178  std::list<int> listChipNumber(const std::string&);
179 
181  void addMuonCondition(const TableMenuCond&);
182 
184  void addCaloCondition(const TableMenuCond&);
185 
186  void fillEnergySumObjectParameter(const std::string& opFK,
188  const L1GtObject&);
190 
194  void addCastorCondition(const TableMenuCond&);
195  void addBptxCondition(const TableMenuCond&);
196  void addExternalCondition(const TableMenuCond&);
198 
200  void addConditions();
201 
202 private:
203  template <typename Result, typename Source>
204  Result lexical_cast_from_hex(Source& value) const;
205 
206 private:
208 
210  std::vector<TableMenuAlgo> m_tableMenuAlgo;
211  std::vector<TableMenuAlgoCond> m_tableMenuAlgoCond;
212  std::vector<TableMenuCond> m_tableMenuCond;
213  std::vector<TableMenuObjectParameters> m_tableMenuObjectParameters;
214  std::vector<TableMenuTechTrig> m_tableMenuTechTrig;
215 
216 private:
218 
223 
226 
229  std::vector<std::vector<L1GtMuonTemplate> > m_vecMuonTemplate;
230  std::vector<std::vector<L1GtCaloTemplate> > m_vecCaloTemplate;
231  std::vector<std::vector<L1GtEnergySumTemplate> > m_vecEnergySumTemplate;
232  std::vector<std::vector<L1GtJetCountsTemplate> > m_vecJetCountsTemplate;
233  std::vector<std::vector<L1GtCastorTemplate> > m_vecCastorTemplate;
234  std::vector<std::vector<L1GtHfBitCountsTemplate> > m_vecHfBitCountsTemplate;
235  std::vector<std::vector<L1GtHfRingEtSumsTemplate> > m_vecHfRingEtSumsTemplate;
236  std::vector<std::vector<L1GtBptxTemplate> > m_vecBptxTemplate;
237  std::vector<std::vector<L1GtExternalTemplate> > m_vecExternalTemplate;
238 
239  std::vector<std::vector<L1GtCorrelationTemplate> > m_vecCorrelationTemplate;
240  std::vector<std::vector<L1GtMuonTemplate> > m_corMuonTemplate;
241  std::vector<std::vector<L1GtCaloTemplate> > m_corCaloTemplate;
242  std::vector<std::vector<L1GtEnergySumTemplate> > m_corEnergySumTemplate;
243 
246 
249 
252 
253 private:
255 };
256 
257 template <typename Result, typename Source>
259  std::stringstream convertor;
260  convertor << value;
261 
262  Result result;
263  if (!(convertor >> std::hex >> result) || !convertor.eof()) {
264  throw std::exception();
265  }
266 
267  return result;
268 }
269 
270 #endif
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
const std::map< int, std::string > condIndexNameMap(const short bitNr) const
bool tableMenuAlgoFromDB(const std::string &gtSchema, const std::string &objKey)
retrieve table with physics algorithms from DB
Result lexical_cast_from_hex(Source &value) const
void fillCaloObjectParameter(const std::string &opFK, L1GtCaloTemplate::ObjectParameter &)
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
L1GtConditionType
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
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
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
int chipNumber(short) const
return the chip number for an algorithm with index bitNumberSh
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
std::vector< TableMenuTechTrig > m_tableMenuTechTrig
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
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)
L1GtConditionCategory
condition categories
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