CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 boost::shared_ptr
< L1MuTriggerScales
newObject (const std::string &objectKey)
 
 ~L1MuTriggerScalesOnlineProducer ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
boost::shared_ptr
< L1MuTriggerScales
produce (const L1MuTriggerScalesRcd &iRecord)
 
 ~L1ConfigOnlineProdBase ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

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, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >
bool getObjectKey (const L1MuTriggerScalesRcd &record, boost::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::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_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::DbConnection m_dbConnection
 
cond::DbSession m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 37 of file L1MuTriggerScalesOnlineProducer.h.

Constructor & Destructor Documentation

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

Definition at line 21 of file L1MuTriggerScalesOnlineProducer.cc.

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

Definition at line 73 of file L1MuTriggerScalesOnlineProducer.cc.

73 {}

Member Function Documentation

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

Implements L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >.

Definition at line 116 of file L1MuTriggerScalesOnlineProducer.cc.

References l1t::OMDSReader::basicQuery(), edm::hlt::Exception, ScaleRecordHelper::extractScales(), L1MuTriggerScales_cfi::L1MuTriggerScales, m_nbinsEta, m_nbitPackingEta, m_nbitPackingPhi, L1ConfigOnlineProdBase< L1MuTriggerScalesRcd, L1MuTriggerScales >::m_omdsReader, m_scales, m_signedPackingPhi, ScaleRecordHelper::pushColumnNames(), L1MuTriggerScales::setGMTEtaScale(), L1MuTriggerScales::setPhiScale(), and l1t::OMDSReader::singleAttribute().

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

Member Data Documentation

unsigned int L1MuTriggerScalesOnlineProducer::m_nbinsEta
private

Definition at line 50 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

unsigned int L1MuTriggerScalesOnlineProducer::m_nbitPackingEta
private

Definition at line 49 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

unsigned int L1MuTriggerScalesOnlineProducer::m_nbitPackingPhi
private

Definition at line 48 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

L1MuTriggerScales L1MuTriggerScalesOnlineProducer::m_scales
private

Definition at line 47 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().

bool L1MuTriggerScalesOnlineProducer::m_signedPackingPhi
private

Definition at line 51 of file L1MuTriggerScalesOnlineProducer.h.

Referenced by newObject().