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 &)
 
virtual std::shared_ptr< L1MuTriggerScalesnewObject (const std::string &objectKey)
 
 ~L1MuTriggerScalesOnlineProducer ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::shared_ptr< L1MuTriggerScalesproduce (const L1MuTriggerScalesRcd &iRecord)
 
 ~L1ConfigOnlineProdBase ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()(false)
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer () noexcept(false)
 
- 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::shared_ptr< L1MuTriggerScales > data, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- 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())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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 ( )

Definition at line 71 of file L1MuTriggerScalesOnlineProducer.cc.

71 {}

Member Function Documentation

std::shared_ptr< L1MuTriggerScales > L1MuTriggerScalesOnlineProducer::newObject ( const std::string &  objectKey)
virtual

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