CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1MuTriggerScalesOnlineProducer Class Reference

#include <L1MuTriggerScalesOnlineProducer.h>

Inheritance diagram for L1MuTriggerScalesOnlineProducer:
L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales > edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

 L1MuTriggerScalesOnlineProducer (const edm::ParameterSet &)
 
std::unique_ptr< L1MuTriggerScalesnewObject (const std::string &objectKey) override
 
 ~L1MuTriggerScalesOnlineProducer () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1MuTriggerScalesproduce (const L1MuTriggerScalesRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ESProducer (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Attributes

unsigned int m_nbinsEta
 
unsigned int m_nbitPackingEta
 
unsigned int m_nbitPackingPhi
 
L1MuTriggerScales m_scales
 
bool m_signedPackingPhi
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >
bool getObjectKey (const L1MuTriggerScalesRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
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::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >
std::optional< edm::ESConsumesCollectorT< L1MuTriggerScalesRcd > > m_consumesCollector
 
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 34 of file L1MuTriggerScalesOnlineProducer.h.

Constructor & Destructor Documentation

◆ L1MuTriggerScalesOnlineProducer()

L1MuTriggerScalesOnlineProducer::L1MuTriggerScalesOnlineProducer ( const edm::ParameterSet ps)

Definition at line 19 of file L1MuTriggerScalesOnlineProducer.cc.

21  m_scales(ps.getParameter<int>("nbitPackingDTEta"),
22  ps.getParameter<bool>("signedPackingDTEta"),
23  ps.getParameter<int>("nbinsDTEta"),
24  ps.getParameter<double>("minDTEta"),
25  ps.getParameter<double>("maxDTEta"),
26  ps.getParameter<int>("offsetDTEta"),
27 
28  ps.getParameter<int>("nbitPackingCSCEta"),
29  ps.getParameter<int>("nbinsCSCEta"),
30  ps.getParameter<double>("minCSCEta"),
31  ps.getParameter<double>("maxCSCEta"),
32 
33  ps.getParameter<std::vector<double> >("scaleRPCEta"),
34  ps.getParameter<int>("nbitPackingBrlRPCEta"),
35  ps.getParameter<bool>("signedPackingBrlRPCEta"),
36  ps.getParameter<int>("nbinsBrlRPCEta"),
37  ps.getParameter<int>("offsetBrlRPCEta"),
38  ps.getParameter<int>("nbitPackingFwdRPCEta"),
39  ps.getParameter<bool>("signedPackingFwdRPCEta"),
40  ps.getParameter<int>("nbinsFwdRPCEta"),
41  ps.getParameter<int>("offsetFwdRPCEta"),
42  // Fields that should now be generated from OMDS:
43  // TODO: Adjust m_scales's definition to be a bit
44  // more accessible for the partial initialization.
45  //ps.getParameter<int>("nbitPackingGMTEta"),
46  0,
47  //ps.getParameter<int>("nbinsGMTEta"),
48  0,
49  //ps.getParameter<std::vector<double> >("scaleGMTEta"),
50  std::vector<double>(1),
51  //ps.getParameter<int>("nbitPackingPhi"),
52  0,
53  //ps.getParameter<bool>("signedPackingPhi"),
54  false,
55  //ps.getParameter<int>("nbinsPhi"),
56  0,
57  //ps.getParameter<double>("minPhi"),
58  0,
59  //ps.getParameter<double>("maxPhi")
60  0),
61  /* Metadata that's not yet in the database. */
62  m_nbitPackingPhi(ps.getParameter<int>("nbitPackingPhi")),
63  m_nbitPackingEta(ps.getParameter<int>("nbitPackingGMTEta")),
64  m_nbinsEta(ps.getParameter<int>("nbinsGMTEta")),
65  m_signedPackingPhi(ps.getParameter<bool>("signedPackingPhi")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ ~L1MuTriggerScalesOnlineProducer()

L1MuTriggerScalesOnlineProducer::~L1MuTriggerScalesOnlineProducer ( )
override

Definition at line 67 of file L1MuTriggerScalesOnlineProducer.cc.

67 {}

Member Function Documentation

◆ newObject()

std::unique_ptr< L1MuTriggerScales > L1MuTriggerScalesOnlineProducer::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >.

Definition at line 105 of file L1MuTriggerScalesOnlineProducer.cc.

References l1t::OMDSReader::basicQuery(), mps_check::columns, ScaleRecordHelper::extractScales(), l1t::OMDSReader::QueryResults::fillVariable(), m_nbinsEta, m_nbitPackingEta, m_nbitPackingPhi, L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >::m_omdsReader, m_scales, m_signedPackingPhi, PhiScaleHelper::makeBinnedScale(), l1t::OMDSReader::QueryResults::numberRows(), L1TriggerKeyDummy_cfi::objectKey, ScaleRecordHelper::pushColumnNames(), L1MuTriggerScales::setGMTEtaScale(), L1MuTriggerScales::setPhiScale(), l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

105  {
106  // The key we get from the O2O subsystem is the CMS_GMT.L1T_SCALES key,
107  // but the eta/phi scales have their own subtables, so let's find
108  // out.
109  vector<string> foreignKeys;
110 
111  const std::string etaKeyColumn("SC_MUON_ETA_FK");
112  const std::string phiKeyColumn("SC_MUON_PHI_FK");
113 
114  foreignKeys.push_back(etaKeyColumn);
115  foreignKeys.push_back(phiKeyColumn);
116 
118  // SELECTed columns
119  foreignKeys,
120  // schema name
121  "CMS_GT",
122  // table name
123  "L1T_SCALES",
124  // WHERE lhs
125  "L1T_SCALES.ID",
126  // WHERE rhs
128 
129  if (keysRecord.numberRows() != 1) // check if query was successful
130  {
131  throw cond::Exception(
132  "Problem finding L1MuTriggerScales associated "
133  "with scales key `" +
134  objectKey + "'");
135  }
136 
137  std::string etaKeyValue;
138  std::string phiKeyValue;
139  keysRecord.fillVariable(etaKeyColumn, etaKeyValue);
140  keysRecord.fillVariable(phiKeyColumn, phiKeyValue);
141 
142  vector<string> columns;
143 
144  // get the eta scales from the database
145  ScaleRecordHelper etaHelper("ETA_BIN_LOW", m_nbinsEta);
146  etaHelper.pushColumnNames(columns);
147 
149  // SELECTed columns
150  columns,
151  // schema name
152  "CMS_GT",
153  // table name
154  "L1T_SCALE_MUON_ETA",
155  // WHERE lhs
156  "L1T_SCALE_MUON_ETA.ID",
157  // WHERE rhs
158  m_omdsReader.singleAttribute(etaKeyValue));
159 
160  vector<double> etaScales;
161  etaHelper.extractScales(etaRecord, etaScales);
162 
163  unique_ptr<L1MuSymmetricBinnedScale> ptrEtaScale(
165  m_scales.setGMTEtaScale(*ptrEtaScale);
166 
167  columns.clear();
168 
169  // get the phi scales from the database
170  PhiScaleHelper phiHelper;
171 
173  // SELECTed columns
174  columns,
175  // schema name
176  "CMS_GT",
177  // table name
178  "L1T_SCALE_MUON_PHI",
179  // WHERE lhs
180  "L1T_SCALE_MUON_PHI.ID",
181  // WHERE rhs
182  m_omdsReader.singleAttribute(phiKeyValue));
183 
184  unique_ptr<L1MuBinnedScale> ptrPhiScale(phiHelper.makeBinnedScale(phiRecord, m_nbitPackingPhi, m_signedPackingPhi));
185 
186  m_scales.setPhiScale(*ptrPhiScale);
187 
188  return std::make_unique<L1MuTriggerScales>(m_scales);
189 }
persistency::Exception Exception
Definition: Exception.h:25
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
void setGMTEtaScale(const L1MuSymmetricBinnedScale &scale)
set the GMT eta scale
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
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
void setPhiScale(const L1MuBinnedScale &scale)
set the phi scale
static L1MuBinnedScale * makeBinnedScale(l1t::OMDSReader::QueryResults &record, int nBits, bool signedPacking)

Member Data Documentation

◆ m_nbinsEta

unsigned int L1MuTriggerScalesOnlineProducer::m_nbinsEta
private

Definition at line 46 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

◆ m_nbitPackingEta

unsigned int L1MuTriggerScalesOnlineProducer::m_nbitPackingEta
private

Definition at line 45 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

◆ m_nbitPackingPhi

unsigned int L1MuTriggerScalesOnlineProducer::m_nbitPackingPhi
private

Definition at line 44 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

◆ m_scales

L1MuTriggerScales L1MuTriggerScalesOnlineProducer::m_scales
private

Definition at line 43 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

◆ m_signedPackingPhi

bool L1MuTriggerScalesOnlineProducer::m_signedPackingPhi
private

Definition at line 47 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().