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 ()
 
 ESProducer (const ESProducer &)=delete
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESProxyIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
 ESProxyFactoryProducer (const ESProxyFactoryProducer &)=delete
 
const ESProxyFactoryProduceroperator= (const ESProxyFactoryProducer &)=delete
 
 ~ESProxyFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
void createKeyedProxies (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
 DataProxyProvider ()
 
 DataProxyProvider (const DataProxyProvider &)=delete
 
const ComponentDescriptiondescription () const
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const DataProxyProvideroperator= (const DataProxyProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider () noexcept(false)
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProxyFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::DataProxyProvider
using KeyedProxiesVector = std::vector< std::pair< DataKey, std::shared_ptr< DataProxy > >>
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >
bool getObjectKey (const L1GtParametersRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
auto setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
auto setWhatProduced (T *iThis, const es::Label &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={})
 
void usesResources (std::vector< std::string > const &)
 
- 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 EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ProxyFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedProxiesVector registerProxies (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- 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::L1GtParametersConfigOnlineProd ( const edm::ParameterSet parSet)

constructor

Definition at line 25 of file L1GtParametersConfigOnlineProd.cc.

27  // empty
28 }

◆ ~L1GtParametersConfigOnlineProd()

L1GtParametersConfigOnlineProd::~L1GtParametersConfigOnlineProd ( )
override

destructor

Definition at line 31 of file L1GtParametersConfigOnlineProd.cc.

31  {
32  // empty
33 }

Member Function Documentation

◆ newObject()

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

public methods

Implements L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >.

Definition at line 37 of file L1GtParametersConfigOnlineProd.cc.

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

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

l1t::OMDSReader::QueryResults
Definition: OMDSReader.h:49
L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >::m_omdsReader
l1t::OMDSReader m_omdsReader
Definition: L1ConfigOnlineProdBase.h:65
bookConverter.results
results
Definition: bookConverter.py:144
l1t::OMDSReader::singleAttribute
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
L1ConfigOnlineProdBase< L1GtParametersRcd, L1GtParameters >
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1t::OMDSReader::basicQuery
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:75
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
mps_check.columns
columns
Definition: mps_check.py:244
edm::isDebugEnabled
bool isDebugEnabled()
Definition: MessageLogger.cc:12
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234