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::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

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
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
ESProducer const & operator= (const ESProducer &)=delete
 
template<typename Record >
void updateFromMayConsumes (unsigned int iIndex, const Record &iRecord)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~ESProducer ()(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)
 

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::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< L1MuTriggerScalesRcd, L1MuTriggerScales >
bool getObjectKey (const L1MuTriggerScalesRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
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 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< L1MuTriggerScalesRcd, L1MuTriggerScales >
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 ( 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
L1MuTriggerScalesOnlineProducer::~L1MuTriggerScalesOnlineProducer ( )
override

Definition at line 67 of file L1MuTriggerScalesOnlineProducer.cc.

67 {}

Member Function Documentation

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(), 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
127  m_omdsReader.singleAttribute(objectKey));
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
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274
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
void setPhiScale(const L1MuBinnedScale &scale)
set the phi scale
static L1MuBinnedScale * makeBinnedScale(l1t::OMDSReader::QueryResults &record, int nBits, bool signedPacking)

Member Data Documentation

unsigned int L1MuTriggerScalesOnlineProducer::m_nbinsEta
private

Definition at line 46 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

unsigned int L1MuTriggerScalesOnlineProducer::m_nbitPackingEta
private

Definition at line 45 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

unsigned int L1MuTriggerScalesOnlineProducer::m_nbitPackingPhi
private

Definition at line 44 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

L1MuTriggerScales L1MuTriggerScalesOnlineProducer::m_scales
private

Definition at line 43 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

bool L1MuTriggerScalesOnlineProducer::m_signedPackingPhi
private

Definition at line 47 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().