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 
74  std::string menuInterface;
75  std::string menuImplementation;
76  std::string algoImplTag;
77  std::string scalesKey;
78  };
79 
80  struct TableMenuAlgo {
81  short bitNumberSh;
82  std::string algName;
83  std::string algAlias;
84  std::string logExpression;
85  };
86 
88  short bitNumberSh;
89  float condIndexF;
90  std::string condFK;
91  };
92 
93  struct TableMenuCond {
94  std::string cond;
95  std::string condCategory;
96  std::string condType;
97  std::string gtObject1;
98  std::string gtObject2;
99  bool condGEq;
100  float countIndex;
103  std::string objectParameter1FK;
104  std::string objectParameter2FK;
105  std::string objectParameter3FK;
106  std::string objectParameter4FK;
107  std::string deltaEtaRange;
108  std::string deltaPhiRange;
109  };
110 
112  std::string opId;
115  float enableMip;
116  float enableIso;
117  float requestIso;
119  float etThreshold;
120  std::string etaRange;
121  std::string phiRange;
122  float phiHigh;
123  float phiLow;
124  std::string qualityRange;
125  float charge;
126 
127  };
128 
130  short bitNumberSh;
131  std::string techName;
132  };
133 
135 
137  bool tableMenuGeneralFromDB(const std::string& gtSchema, const std::string& objKey);
138 
140  bool tableMenuAlgoFromDB(const std::string& gtSchema, const std::string& objKey);
141 
143  bool tableMenuAlgoCondFromDB(const std::string& gtSchema, const std::string& objKey);
144 
146  bool tableMenuCondFromDB(const std::string& gtSchema, const std::string& objKey);
147 
149  bool tableMenuObjectParametersFromDB(const std::string& gtSchema, const std::string& objKey);
150 
152  bool tableMenuTechTrigFromDB(const std::string& gtSchema, const std::string& objKey);
153 
154 private:
155 
158  const std::map<int, std::string> condIndexNameMap(const short bitNr) const;
159 
161  std::string convertLogicalExpression(const std::string&, const std::map<int, std::string>&) const;
162 
164  int chipNumber(short) const;
165 
167  void buildAlgorithmMap();
168 
171 
173  L1GtConditionCategory strToEnumCondCategory(const std::string& strCategory);
174 
176  L1GtConditionType strToEnumCondType(const std::string& strType);
177 
179  L1GtObject strToEnumL1GtObject(const std::string& strObject);
180 
183  const std::string& hexStr, std::string& hex0WordStr, std::string& hex1WordStr);
184 
186  std::list<int> listChipNumber(const std::string&);
187 
188  void fillMuonObjectParameter(const std::string& opFK, L1GtMuonTemplate::ObjectParameter&);
189  void addMuonCondition(const TableMenuCond&);
190 
191  void fillCaloObjectParameter(const std::string& opFK, L1GtCaloTemplate::ObjectParameter&);
192  void addCaloCondition(const TableMenuCond&);
193 
195  const std::string& opFK, L1GtEnergySumTemplate::ObjectParameter&, const L1GtObject&);
197 
201  void addCastorCondition(const TableMenuCond&);
202  void addBptxCondition(const TableMenuCond&);
203  void addExternalCondition(const TableMenuCond&);
205 
207  void addConditions();
208 
209 
210 private:
211  template<typename Result, typename Source>
212  Result lexical_cast_from_hex(Source & value) const;
213 
214 
215 private:
216 
218 
220  std::vector<TableMenuAlgo> m_tableMenuAlgo;
221  std::vector<TableMenuAlgoCond> m_tableMenuAlgoCond;
222  std::vector<TableMenuCond> m_tableMenuCond;
223  std::vector<TableMenuObjectParameters> m_tableMenuObjectParameters;
224  std::vector<TableMenuTechTrig> m_tableMenuTechTrig;
225 
226 private:
227 
229 
232  std::string m_triggerMenuName;
234 
236  std::string m_scaleDbKey;
237 
240  std::vector<std::vector<L1GtMuonTemplate> > m_vecMuonTemplate;
241  std::vector<std::vector<L1GtCaloTemplate> > m_vecCaloTemplate;
242  std::vector<std::vector<L1GtEnergySumTemplate> > m_vecEnergySumTemplate;
243  std::vector<std::vector<L1GtJetCountsTemplate> > m_vecJetCountsTemplate;
244  std::vector<std::vector<L1GtCastorTemplate> > m_vecCastorTemplate;
245  std::vector<std::vector<L1GtHfBitCountsTemplate> > m_vecHfBitCountsTemplate;
246  std::vector<std::vector<L1GtHfRingEtSumsTemplate> > m_vecHfRingEtSumsTemplate;
247  std::vector<std::vector<L1GtBptxTemplate> > m_vecBptxTemplate;
248  std::vector<std::vector<L1GtExternalTemplate> > m_vecExternalTemplate;
249 
250  std::vector<std::vector<L1GtCorrelationTemplate> > m_vecCorrelationTemplate;
251  std::vector<std::vector<L1GtMuonTemplate> > m_corMuonTemplate;
252  std::vector<std::vector<L1GtCaloTemplate> > m_corCaloTemplate;
253  std::vector<std::vector<L1GtEnergySumTemplate> > m_corEnergySumTemplate;
254 
257 
260 
263 
264 private:
265 
267 
268 
269 };
270 
271 
272 
273 template<typename Result, typename Source>
275 
276  std::stringstream convertor;
277  convertor << value;
278 
279  Result result;
280  if (! ( convertor >> std::hex >> result ) || !convertor.eof()) {
281  throw boost::bad_lexical_cast();
282  }
283 
284  return result;
285 }
286 
287 
288 #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
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
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
L1GtConditionType
Definition: L1GtFwd.h:52
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
L1GtConditionCategory
condition categories
Definition: L1GtFwd.h:63
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
L1GtObject
GT objects.
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