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::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

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 (const ESProducer &)=delete
 
 ESProducer (ESProducer &&)=delete
 
ESResolverIndex const * getTokenIndices (unsigned int iIndex) const
 
ESRecordIndex const * getTokenRecordIndices (unsigned int iIndex) const
 
bool hasMayConsumes () const noexcept
 
size_t numberOfTokenIndices (unsigned int iIndex) const
 
ESProduceroperator= (const ESProducer &)=delete
 
ESProduceroperator= (ESProducer &&)=delete
 
SerialTaskQueueChainqueue ()
 
template<typename Record >
std::optional< std::vector< ESResolverIndex > > updateFromMayConsumes (unsigned int iIndex, const Record &iRecord) const
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &) final
 
 ~ESProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::ESProductResolverFactoryProducer
 ESProductResolverFactoryProducer ()
 
 ESProductResolverFactoryProducer (const ESProductResolverFactoryProducer &)=delete
 
const ESProductResolverFactoryProduceroperator= (const ESProductResolverFactoryProducer &)=delete
 
 ~ESProductResolverFactoryProducer () noexcept(false) override
 
- Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
void createKeyedResolvers (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
const ComponentDescriptiondescription () const
 
 ESProductResolverProvider ()
 
 ESProductResolverProvider (const ESProductResolverProvider &)=delete
 
void fillRecordsNotAllowingConcurrentIOVs (std::set< EventSetupRecordKey > &recordsNotAllowingConcurrentIOVs) const
 
virtual void initConcurrentIOVs (EventSetupRecordKey const &key, unsigned int nConcurrentIOVs)
 
bool isUsingRecord (const EventSetupRecordKey &key) const
 
KeyedResolverskeyedResolvers (const EventSetupRecordKey &iRecordKey, unsigned int iovIndex=0)
 
const ESProductResolverProvideroperator= (const ESProductResolverProvider &)=delete
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~ESProductResolverProvider () noexcept(false)
 

Private Attributes

unsigned int m_nBins
 
unsigned int m_nbitsPacking
 
bool m_signedPacking
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::eventsetup::ESProductResolverProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Types inherited from edm::ESProductResolverFactoryProducer
using EventSetupRecordKey = eventsetup::EventSetupRecordKey
 
- Protected Types inherited from edm::eventsetup::ESProductResolverProvider
using KeyedResolversVector = std::vector< std::pair< DataKey, std::shared_ptr< ESProductResolver > >>
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >
bool getObjectKey (const L1MuTriggerPtScaleRcd &record, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
ESConsumesInfoconsumesInfoPushBackNew ()
 
unsigned int consumesInfoSize () const
 
template<typename CallbackT , typename TList , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>> iCallback, const TList *, const TRecord *iRecord, const es::Label &iLabel)
 
template<typename CallbackT , typename TRecord >
void registerProducts (std::shared_ptr< std::pair< unsigned int, std::shared_ptr< CallbackT >>>, const eventsetup::produce::Null *, const TRecord *, const es::Label &)
 
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 TDecorator >
auto setWhatProduced (T *iThis, TReturn(T ::*iMethod)(const TRecord &), const TDecorator &iDec, const es::Label &iLabel={})
 
template<typename TFunc >
auto setWhatProduced (TFunc &&func, const es::Label &iLabel={})
 
template<typename TReturn , typename TRecord , typename TFunc , typename TDecorator >
ESConsumesCollectorT< TRecord > setWhatProduced (TFunc &&func, TDecorator &&iDec, const es::Label &iLabel={})
 
void usesResources (std::vector< std::string > const &)
 
- Protected Member Functions inherited from edm::ESProductResolverFactoryProducer
template<class TFactory >
void registerFactory (std::unique_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const EventSetupRecordKey &iRecord, std::unique_ptr< eventsetup::ESProductResolverFactoryBase > iFactory, const std::string &iLabel=std::string())
 
KeyedResolversVector registerResolvers (const EventSetupRecordKey &, unsigned int iovIndex) override
 
- Protected Member Functions inherited from edm::eventsetup::ESProductResolverProvider
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &key)
 
- Protected Attributes inherited from L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >
std::optional< edm::ESConsumesCollectorT< L1MuTriggerPtScaleRcd > > m_consumesCollector
 
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Definition at line 32 of file L1MuTriggerPtScaleOnlineProducer.h.

Constructor & Destructor Documentation

◆ L1MuTriggerPtScaleOnlineProducer()

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

◆ ~L1MuTriggerPtScaleOnlineProducer()

L1MuTriggerPtScaleOnlineProducer::~L1MuTriggerPtScaleOnlineProducer ( )
override

Definition at line 29 of file L1MuTriggerPtScaleOnlineProducer.cc.

29 {}

Member Function Documentation

◆ newObject()

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

Implements L1ConfigOnlineProdBase< L1MuTriggerPtScaleRcd, L1MuTriggerPtScale >.

Definition at line 36 of file L1MuTriggerPtScaleOnlineProducer.cc.

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

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

Member Data Documentation

◆ m_nBins

unsigned int L1MuTriggerPtScaleOnlineProducer::m_nBins
private

Definition at line 44 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().

◆ m_nbitsPacking

unsigned int L1MuTriggerPtScaleOnlineProducer::m_nbitsPacking
private

Definition at line 43 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().

◆ m_signedPacking

bool L1MuTriggerPtScaleOnlineProducer::m_signedPacking
private

Definition at line 42 of file L1MuTriggerPtScaleOnlineProducer.h.

Referenced by newObject().