CMS 3D CMS Logo

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 &)
 
std::unique_ptr< L1MuTriggerPtScalenewObject (const std::string &objectKey) override
 
 ~L1MuTriggerPtScaleOnlineProducer () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1MuTriggerPtScaleproduce (const L1MuTriggerPtScaleRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
 ~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_nBins
 
unsigned int m_nbitsPacking
 
bool m_signedPacking
 

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

Detailed Description

Definition at line 33 of file L1MuTriggerPtScaleOnlineProducer.h.

Constructor & Destructor Documentation

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

Definition at line 31 of file L1MuTriggerPtScaleOnlineProducer.cc.

31 {}

Member Function Documentation

std::unique_ptr< L1MuTriggerPtScale > L1MuTriggerPtScaleOnlineProducer::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >.

Definition at line 40 of file L1MuTriggerPtScaleOnlineProducer.cc.

References l1t::OMDSReader::basicQuery(), mps_check::columns, gather_cfg::cout, ScaleRecordHelper::extractScales(), h, m_nBins, m_nbitsPacking, L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >::m_omdsReader, m_signedPacking, l1t::OMDSReader::QueryResults::numberRows(), ScaleRecordHelper::pushColumnNames(), mps_fire::result, and l1t::OMDSReader::singleAttribute().

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

Member Data Documentation

unsigned int L1MuTriggerPtScaleOnlineProducer::m_nBins
private

Definition at line 45 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().

unsigned int L1MuTriggerPtScaleOnlineProducer::m_nbitsPacking
private

Definition at line 44 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().

bool L1MuTriggerPtScaleOnlineProducer::m_signedPacking
private

Definition at line 43 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().