CMS 3D CMS Logo

List of all members | Public Member Functions
L1GtParametersConfigOnlineProd Class Reference

#include <L1GtParametersConfigOnlineProd.h>

Inheritance diagram for L1GtParametersConfigOnlineProd:
L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1GtParametersConfigOnlineProd (const edm::ParameterSet &)
 constructor More...
 
std::unique_ptr< L1GtParametersnewObject (const std::string &objectKey) override
 public methods More...
 
 ~L1GtParametersConfigOnlineProd () override
 destructor More...
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1GtParametersproduce (const L1GtParametersRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval) override
 overrides DataProxyProvider method More...
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair< DataKey, edm::propagate_const< std::shared_ptr< DataProxy > > > > KeyedProxies
 
typedef std::vector< EventSetupRecordKeyKeys
 
typedef std::map< EventSetupRecordKey, KeyedProxiesRecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >
bool getObjectKey (const L1GtParametersRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
 ESProducer (const ESProducer &)=delete
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &iLabel={})
 
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
auto setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord >
auto setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel={})
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
ESConsumesCollectorT< TRecord > setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel={})
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList) override
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Description: online producer for L1GtParameters.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 32 of file L1GtParametersConfigOnlineProd.h.

Constructor & Destructor Documentation

L1GtParametersConfigOnlineProd::L1GtParametersConfigOnlineProd ( const edm::ParameterSet parSet)
L1GtParametersConfigOnlineProd::~L1GtParametersConfigOnlineProd ( )
override

destructor

Definition at line 33 of file L1GtParametersConfigOnlineProd.cc.

33  {
34 
35  // empty
36 
37 }

Member Function Documentation

std::unique_ptr< L1GtParameters > L1GtParametersConfigOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

public methods

Implements L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >.

Definition at line 41 of file L1GtParametersConfigOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), mps_check::columns, DEFINE_FWK_EVENTSETUP_MODULE, l1t::OMDSReader::QueryResults::fillVariable(), edm::isDebugEnabled(), LogTrace, L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >::m_omdsReader, l1t::OMDSReader::QueryResults::queryFailed(), mps_update::results, l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

42  {
43 
44  auto pL1GtParameters = std::make_unique<L1GtParameters>();
45 
46  // l1GtParameters: parameters in table GTFE_SETUP_FK
47 
48  const std::string gtSchema = "CMS_GT";
49 
50  // SQL query:
51  // SELECT EVM_INCLUDE_TCS,
52  // EVM_INCLUDE_FDL,
53  // DAQ_INCLUDE_FDL,
54  // DAQ_INCLUDE_PSB0,
55  // DAQ_INCLUDE_PSB1,
56  // DAQ_INCLUDE_PSB2,
57  // DAQ_INCLUDE_PSB3,
58  // DAQ_INCLUDE_PSB4,
59  // DAQ_INCLUDE_PSB5,
60  // DAQ_INCLUDE_PSB6,
61  // DAQ_INCLUDE_GMT,
62  // DAQ_INCLUDE_TIM,
63  // DAQ_NB_BC_PER_EVENT_FDL,
64  // BST_DATA_NB_BYTES
65  // FROM CMS_GT.GT_GTFE_SETUP
66  // WHERE GT_GTFE_SETUP.ID = objectKey
67 
68  std::vector<std::string> columns;
69  columns.push_back("EVM_INCLUDE_TCS");
70  columns.push_back("EVM_INCLUDE_FDL");
71  columns.push_back("DAQ_INCLUDE_FDL");
72  columns.push_back("DAQ_INCLUDE_PSB0");
73  columns.push_back("DAQ_INCLUDE_PSB1");
74  columns.push_back("DAQ_INCLUDE_PSB2");
75  columns.push_back("DAQ_INCLUDE_PSB3");
76  columns.push_back("DAQ_INCLUDE_PSB4");
77  columns.push_back("DAQ_INCLUDE_PSB5");
78  columns.push_back("DAQ_INCLUDE_PSB6");
79  columns.push_back("DAQ_INCLUDE_GMT");
80  columns.push_back("DAQ_INCLUDE_TIM");
81  columns.push_back("DAQ_NB_BC_PER_EVENT_FDL");
82  columns.push_back("DAQ_NB_BC_PER_EVENT_PSB0");
83  columns.push_back("DAQ_NB_BC_PER_EVENT_PSB1");
84  columns.push_back("DAQ_NB_BC_PER_EVENT_PSB2");
85  columns.push_back("DAQ_NB_BC_PER_EVENT_PSB3");
86  columns.push_back("DAQ_NB_BC_PER_EVENT_PSB4");
87  columns.push_back("DAQ_NB_BC_PER_EVENT_PSB5");
88  columns.push_back("DAQ_NB_BC_PER_EVENT_PSB6");
89  columns.push_back("DAQ_NB_BC_PER_EVENT_GMT");
90  columns.push_back("DAQ_NB_BC_PER_EVENT_TIM");
91  columns.push_back("BST_DATA_NB_BYTES");
92 
93 
95  columns, gtSchema, "GT_GTFE_SETUP", "GT_GTFE_SETUP.ID", m_omdsReader.singleAttribute(
96  objectKey));
97 
98  // check if query was successful
99  if (results.queryFailed()) {
100  edm::LogError("L1-O2O") << "Problem with L1GtParameters key:" << objectKey;
101  return pL1GtParameters;
102  }
103 
104  bool activeBoardsEvmTCS = false;
105  results.fillVariable("EVM_INCLUDE_TCS", activeBoardsEvmTCS);
106 
107  bool activeBoardsEvmFDL = false;
108  results.fillVariable("EVM_INCLUDE_FDL", activeBoardsEvmFDL);
109 
110  bool activeBoardsDaqFDL = false;
111  results.fillVariable("DAQ_INCLUDE_FDL", activeBoardsDaqFDL);
112 
113  bool activeBoardsDaqPSB0 = false;
114  results.fillVariable("DAQ_INCLUDE_PSB0", activeBoardsDaqPSB0);
115 
116  bool activeBoardsDaqPSB1 = false;
117  results.fillVariable("DAQ_INCLUDE_PSB1", activeBoardsDaqPSB1);
118 
119  bool activeBoardsDaqPSB2 = false;
120  results.fillVariable("DAQ_INCLUDE_PSB2", activeBoardsDaqPSB2);
121 
122  bool activeBoardsDaqPSB3 = false;
123  results.fillVariable("DAQ_INCLUDE_PSB3", activeBoardsDaqPSB3);
124 
125  bool activeBoardsDaqPSB4;
126  results.fillVariable("DAQ_INCLUDE_PSB4", activeBoardsDaqPSB4);
127 
128  bool activeBoardsDaqPSB5 = false;
129  results.fillVariable("DAQ_INCLUDE_PSB5", activeBoardsDaqPSB5);
130 
131  bool activeBoardsDaqPSB6;
132  results.fillVariable("DAQ_INCLUDE_PSB6", activeBoardsDaqPSB6);
133 
134  bool activeBoardsDaqGMT;
135  results.fillVariable("DAQ_INCLUDE_GMT", activeBoardsDaqGMT);
136 
137  bool activeBoardsDaqTIM = false;
138  results.fillVariable("DAQ_INCLUDE_TIM", activeBoardsDaqTIM);
139 
140  std::string totalBxInEventStr;
141  results.fillVariable("DAQ_NB_BC_PER_EVENT_FDL", totalBxInEventStr);
142 
143  //
144  std::string daqNrBxBoardStrFDL;
145  results.fillVariable("DAQ_NB_BC_PER_EVENT_FDL", daqNrBxBoardStrFDL);
146 
147  std::string daqNrBxBoardStrPSB0;
148  results.fillVariable("DAQ_NB_BC_PER_EVENT_PSB0", daqNrBxBoardStrPSB0);
149 
150  std::string daqNrBxBoardStrPSB1;
151  results.fillVariable("DAQ_NB_BC_PER_EVENT_PSB1", daqNrBxBoardStrPSB1);
152 
153  std::string daqNrBxBoardStrPSB2;
154  results.fillVariable("DAQ_NB_BC_PER_EVENT_PSB2", daqNrBxBoardStrPSB2);
155 
156  std::string daqNrBxBoardStrPSB3;
157  results.fillVariable("DAQ_NB_BC_PER_EVENT_PSB3", daqNrBxBoardStrPSB3);
158 
159  std::string daqNrBxBoardStrPSB4;
160  results.fillVariable("DAQ_NB_BC_PER_EVENT_PSB4", daqNrBxBoardStrPSB4);
161 
162  std::string daqNrBxBoardStrPSB5;
163  results.fillVariable("DAQ_NB_BC_PER_EVENT_PSB5", daqNrBxBoardStrPSB5);
164 
165  std::string daqNrBxBoardStrPSB6;
166  results.fillVariable("DAQ_NB_BC_PER_EVENT_PSB6", daqNrBxBoardStrPSB6);
167 
168  std::string daqNrBxBoardStrGMT;
169  results.fillVariable("DAQ_NB_BC_PER_EVENT_GMT", daqNrBxBoardStrGMT);
170 
171  std::string daqNrBxBoardStrTIM;
172  results.fillVariable("DAQ_NB_BC_PER_EVENT_TIM", daqNrBxBoardStrTIM);
173 
174  std::string bstLengthBytesStr;
175  results.fillVariable("BST_DATA_NB_BYTES", bstLengthBytesStr);
176 
177  // fill the record
178 
179  // total Bx's in the event
180  int totalBxInEventVal = boost::lexical_cast<int>(totalBxInEventStr);
181  pL1GtParameters->setGtTotalBxInEvent(totalBxInEventVal);
182 
183  // FIXME: need board maps in DB, with active bit number...
184  // now, they are hardwired
185 
186  // get the mapping of boards to active bits
187 
188  // active boards in the L1 DAQ record & number of BXs per board
189  boost::uint16_t daqActiveBoardsVal = 0;
190 
191  int daqActiveBoardsLength = 16; // ...hard...
192  std::vector<int> daqNrBxBoard(daqActiveBoardsLength, 0);
193 
194  int iActiveBit = 0;
195  if (activeBoardsDaqFDL) {
196  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
197  }
198  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrFDL);
199 
200  iActiveBit = 1;
201  if (activeBoardsDaqPSB0) {
202  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
203  }
204  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrPSB0);
205 
206  iActiveBit = 2;
207  if (activeBoardsDaqPSB1) {
208  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
209  }
210  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrPSB1);
211 
212  iActiveBit = 3;
213  if (activeBoardsDaqPSB2) {
214  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
215  }
216  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrPSB2);
217 
218  iActiveBit = 4;
219  if (activeBoardsDaqPSB3) {
220  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
221  }
222  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrPSB3);
223 
224  iActiveBit = 5;
225  if (activeBoardsDaqPSB4) {
226  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
227  }
228  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrPSB4);
229 
230  iActiveBit = 6;
231  if (activeBoardsDaqPSB5) {
232  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
233  }
234  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrPSB5);
235 
236  iActiveBit = 7;
237  if (activeBoardsDaqPSB6) {
238  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
239  }
240  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrPSB6);
241 
242  iActiveBit = 8;
243  if (activeBoardsDaqGMT) {
244  daqActiveBoardsVal = daqActiveBoardsVal | ( 1 << iActiveBit );
245  }
246  daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrGMT);
247 
248  // FIXME fix TIM active bit
249  //iActiveBit = 9;
250  //if (activeBoardsDaqTIM) {
251  // daqActiveBoardsVal = daqActiveBoardsVal | (1 << iActiveBit);
252  //}
253  //daqNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrTIM);
254 
255  // active boards in the L1 EVM record
256  boost::uint16_t evmActiveBoardsVal = 0;
257 
258  int evmActiveBoardsLength = 16; // ...hard...
259  std::vector<int> evmNrBxBoard(evmActiveBoardsLength, 0);
260 
261  iActiveBit = 0;
262  if (activeBoardsEvmTCS) {
263  evmActiveBoardsVal = evmActiveBoardsVal | ( 1 << iActiveBit );
264  }
265  // always 1 TCS payload - hardcoded
266  evmNrBxBoard.at(iActiveBit) = 1;
267 
268  iActiveBit = 1;
269  if (activeBoardsEvmFDL) {
270  evmActiveBoardsVal = evmActiveBoardsVal | ( 1 << iActiveBit );
271  }
272  // FDL must have the same length in EVM and DAQ
273  evmNrBxBoard.at(iActiveBit) = boost::lexical_cast<int>(daqNrBxBoardStrFDL);
274 
275 
276  //
277  pL1GtParameters->setGtDaqActiveBoards(daqActiveBoardsVal);
278  pL1GtParameters->setGtEvmActiveBoards(evmActiveBoardsVal);
279  pL1GtParameters->setGtDaqNrBxBoard(daqNrBxBoard);
280  pL1GtParameters->setGtEvmNrBxBoard(evmNrBxBoard);
281 
282  //
283  unsigned int bstLengthBytesVal = boost::lexical_cast<unsigned int>(bstLengthBytesStr);
284  pL1GtParameters->setGtBstLengthBytes(bstLengthBytesVal);
285 
286  if (edm::isDebugEnabled()) {
287  std::ostringstream myCoutStream;
288  pL1GtParameters->print(myCoutStream);
289  LogTrace("L1GtParametersConfigOnlineProd")
290  << "\nThe following L1GtParameters record was read from OMDS: \n"
291  << myCoutStream.str() << "\n" << std::endl;
292  }
293 
294  return pL1GtParameters;
295 }
bool isDebugEnabled()
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
const QueryResults basicQuery(const std::vector< std::string > &columnNames, const std::string &schemaName, const std::string &tableName, const std::string &conditionLHS="", const QueryResults conditionRHS=QueryResults(), const std::string &conditionRHSName="")
Definition: OMDSReader.cc:86
#define LogTrace(id)