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 ()
 
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)
 

Private Attributes

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

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< L1MuTriggerScalesRcd, L1MuTriggerScales >
bool getObjectKey (const L1MuTriggerScalesRcd &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< L1MuTriggerScalesRcd, L1MuTriggerScales >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 35 of file L1MuTriggerScalesOnlineProducer.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file L1MuTriggerScalesOnlineProducer.cc.

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

Definition at line 71 of file L1MuTriggerScalesOnlineProducer.cc.

71 {}

Member Function Documentation

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

Implements L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >.

Definition at line 114 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.

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

Referenced by newObject().

unsigned int L1MuTriggerScalesOnlineProducer::m_nbitPackingEta
private

Definition at line 47 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

unsigned int L1MuTriggerScalesOnlineProducer::m_nbitPackingPhi
private

Definition at line 46 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

L1MuTriggerScales L1MuTriggerScalesOnlineProducer::m_scales
private

Definition at line 45 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

bool L1MuTriggerScalesOnlineProducer::m_signedPackingPhi
private

Definition at line 49 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().