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
L1MuTriggerPtScaleOnlineProducer Class Reference

#include <L1MuTriggerPtScaleOnlineProducer.h>

Inheritance diagram for L1MuTriggerPtScaleOnlineProducer:
L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1MuTriggerPtScaleOnlineProducer (const edm::ParameterSet &)
 
boost::shared_ptr
< L1MuTriggerPtScale
newObject (const std::string &objectKey)
 
 ~L1MuTriggerPtScaleOnlineProducer ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
boost::shared_ptr
< L1MuTriggerPtScale
produce (const L1MuTriggerPtScaleRcd &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_nBins
 
unsigned int m_nbitsPacking
 
bool m_signedPacking
 

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
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >
bool getObjectKey (const L1MuTriggerPtScaleRcd &record, boost::shared_ptr< L1MuTriggerPtScale > 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< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >
bool m_copyFromCondDB
 
cond::DbConnection m_dbConnection
 
cond::DbSession m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 35 of file L1MuTriggerPtScaleOnlineProducer.h.

Constructor & Destructor Documentation

L1MuTriggerPtScaleOnlineProducer::L1MuTriggerPtScaleOnlineProducer ( const edm::ParameterSet ps)
L1MuTriggerPtScaleOnlineProducer::~L1MuTriggerPtScaleOnlineProducer ( )

Definition at line 33 of file L1MuTriggerPtScaleOnlineProducer.cc.

33 {}

Member Function Documentation

boost::shared_ptr< L1MuTriggerPtScale > L1MuTriggerPtScaleOnlineProducer::newObject ( const std::string &  objectKey)
virtual

Implements L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >.

Definition at line 42 of file L1MuTriggerPtScaleOnlineProducer.cc.

References l1t::OMDSReader::basicQuery(), gather_cfg::cout, edm::hlt::Exception, ScaleRecordHelper::extractScales(), h, L1MuTriggerPtScale_cfi::L1MuTriggerPtScale, m_nBins, m_nbitsPacking, L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >::m_omdsReader, m_signedPacking, ScaleRecordHelper::pushColumnNames(), query::result, and l1t::OMDSReader::singleAttribute().

43 {
44  using namespace edm::es;
45 
46  // find Pt key from main scales key
47  l1t::OMDSReader::QueryResults keysRecord =
49  // SELECTed columns
50  "SC_MUON_PT_FK",
51  // schema name
52  "CMS_GT",
53  // table name
54  "L1T_SCALES",
55  // WHERE lhs
56  "L1T_SCALES.ID",
57  // WHERE rhs
58  m_omdsReader.singleAttribute( objectKey ) );
59 
60  if( keysRecord.numberRows() != 1 ) // check if query was successful
61  {
62  throw cond::Exception("Problem finding L1MuTriggerScales associated "
63  "with scales key " + objectKey);
64  }
65 
66 
67  /*
68 SQL> describe cms_gt.l1t_scale_muon_pt;
69  Name Null? Type
70  ----------------------------------------- -------- ----------------------------
71  ID NOT NULL VARCHAR2(300)
72  PT_GEV_BIN_LOW_0 NUMBER
73  [...]
74  PT_GEV_BIN_LOW_32 NUMBER
75  */
76 
77  ScaleRecordHelper h("PT_GEV_BIN_LOW", m_nBins );
78 
79  vector<string> columns;
80  h.pushColumnNames(columns);
81 
82  l1t::OMDSReader::QueryResults resultRecord =
84  // SELECTed columns
85  columns,
86  // schema name
87  "CMS_GT",
88  // table name
89  "L1T_SCALE_MUON_PT",
90  // WHERE lhs
91  "L1T_SCALE_MUON_PT.ID",
92  // WHERE rhs
93  keysRecord);
94 
95  if(resultRecord.numberRows() != 1) {
96  throw cond::Exception("Couldn't find Pt scale record for scales key `"
97  + objectKey + "'") ;
98  }
99 
100  vector<double> scales;
101  h.extractScales(resultRecord, scales);
102 
103  boost::shared_ptr<L1MuTriggerPtScale> result( new L1MuTriggerPtScale(m_nbitsPacking, m_signedPacking, m_nBins, scales) );
104 
105 #ifdef DEBUG_PT_SCALE
106  cout << "PT scale:" << endl << result->getPtScale()->print() << endl;
107 #endif
108 
109 
110  return result ;
111 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
tuple result
Definition: query.py:137
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
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

unsigned int L1MuTriggerPtScaleOnlineProducer::m_nBins
private

Definition at line 47 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().

unsigned int L1MuTriggerPtScaleOnlineProducer::m_nbitsPacking
private

Definition at line 46 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().

bool L1MuTriggerPtScaleOnlineProducer::m_signedPacking
private

Definition at line 45 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().