CMS 3D CMS Logo

List of all members | Public Member Functions
L1HfRingEtScaleOnlineProd Class Reference
Inheritance diagram for L1HfRingEtScaleOnlineProd:
L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale > edm::ESProducer edm::ESProductResolverFactoryProducer edm::eventsetup::ESProductResolverProvider

Public Member Functions

 L1HfRingEtScaleOnlineProd (const edm::ParameterSet &)
 
std::unique_ptr< L1CaloEtScalenewObject (const std::string &objectKey) override
 
 ~L1HfRingEtScaleOnlineProd () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1CaloEtScaleproduce (const L1HfRingEtScaleRcd &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)
 

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< L1HfRingEtScaleRcd, L1CaloEtScale >
bool getObjectKey (const L1HfRingEtScaleRcd &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< L1HfRingEtScaleRcd, L1CaloEtScale >
std::optional< edm::ESConsumesCollectorT< L1HfRingEtScaleRcd > > m_consumesCollector
 
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 31 of file L1HfRingEtScaleOnlineProd.cc.

Constructor & Destructor Documentation

◆ L1HfRingEtScaleOnlineProd()

L1HfRingEtScaleOnlineProd::L1HfRingEtScaleOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 53 of file L1HfRingEtScaleOnlineProd.cc.

55  //the following line is needed to tell the framework what
56  // data is being produced
57 
58  //now do what ever other initialization is needed
59 }

◆ ~L1HfRingEtScaleOnlineProd()

L1HfRingEtScaleOnlineProd::~L1HfRingEtScaleOnlineProd ( )
override

Definition at line 61 of file L1HfRingEtScaleOnlineProd.cc.

61  {
62  // do anything here that needs to be done at desctruction time
63  // (e.g. close files, deallocate resources etc.)
64 }

Member Function Documentation

◆ newObject()

std::unique_ptr< L1CaloEtScale > L1HfRingEtScaleOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale >.

Definition at line 66 of file L1HfRingEtScaleOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), l1t::OMDSReader::QueryResults::fillVariable(), L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale >::m_omdsReader, l1t::OMDSReader::QueryResults::numberRows(), L1TriggerKeyDummy_cfi::objectKey, l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), AlCaHLTBitMon_QueryRunRegistry::string, DMR_cfg::thresh, and particleFlowZeroSuppressionECAL_cff::thresholds.

66  {
67  // get scales keys
68  l1t::OMDSReader::QueryResults scalesKeyResults = m_omdsReader.basicQuery("GCT_SCALES_KEY",
69  "CMS_GCT",
70  "GCT_PHYS_PARAMS",
71  "GCT_PHYS_PARAMS.CONFIG_KEY",
73 
74  std::string scalesKey;
75 
76  if (scalesKeyResults.queryFailed()) {
77  edm::LogError("L1-O2O") << "Problem with key for L1JetEtScaleRcd : GCT scales key query failed ";
78  } else if (scalesKeyResults.numberRows() != 1) {
79  edm::LogError("L1-O2O") << "Problem with key for L1JetEtScaleRcd : " << (scalesKeyResults.numberRows())
80  << " rows were returned when getting GCT scales key";
81  } else {
82  scalesKeyResults.fillVariable(scalesKey);
83  }
84 
85  // get ring scale key
86  l1t::OMDSReader::QueryResults hfRingScaleKeyResults =
87  m_omdsReader.basicQuery("SC_HF_ET_SUM_FK", "CMS_GT", "L1T_SCALES", "L1T_SCALES.ID", scalesKeyResults);
88 
89  std::string hfRingScaleKey;
90 
91  if (hfRingScaleKeyResults.queryFailed()) {
92  edm::LogError("L1-O2O") << "Problem with key for L1HfRingEtScaleRcd : HF ring Et scale key query failed ";
93  } else if (hfRingScaleKeyResults.numberRows() != 1) {
94  edm::LogError("L1-O2O") << "Problem with key for L1HfRingEtScaleRcd : " << (hfRingScaleKeyResults.numberRows())
95  << " rows were returned when getting HF ring Et scale key";
96  } else {
97  hfRingScaleKeyResults.fillVariable(hfRingScaleKey);
98  }
99 
100  // get thresholds
101  std::vector<std::string> queryStrings;
102  queryStrings.push_back("E_GEV_BIN_LOW_0");
103  queryStrings.push_back("E_GEV_BIN_LOW_1");
104  queryStrings.push_back("E_GEV_BIN_LOW_2");
105  queryStrings.push_back("E_GEV_BIN_LOW_3");
106  queryStrings.push_back("E_GEV_BIN_LOW_4");
107  queryStrings.push_back("E_GEV_BIN_LOW_5");
108  queryStrings.push_back("E_GEV_BIN_LOW_6");
109  queryStrings.push_back("E_GEV_BIN_LOW_7");
110 
112  queryStrings, "CMS_GT", "L1T_SCALE_HF_ET_SUM", "L1T_SCALE_HF_ET_SUM.ID", hfRingScaleKeyResults);
113 
114  std::vector<double> thresholds;
115 
116  if (scaleResults.queryFailed()) {
117  edm::LogError("L1-O2O") << "Problem with L1HfRingEtScale key : scale query failed.";
118  } else if (scaleResults.numberRows() != 1) {
119  edm::LogError("L1-O2O") << "Problem with L1HfRingEtScale key : scale query failed.";
120  } else {
121  for (std::vector<std::string>::iterator thresh = queryStrings.begin(); thresh != queryStrings.end(); ++thresh) {
122  float tempScale = 0.;
123  scaleResults.fillVariable(*thresh, tempScale);
124  thresholds.push_back(tempScale);
125  }
126  }
127 
128  // get region LSB
129  double rgnEtLsb = 0.;
130 
131  l1t::OMDSReader::QueryResults lsbResults = m_omdsReader.basicQuery("GCT_RGN_ET_LSB",
132  "CMS_GCT",
133  "GCT_PHYS_PARAMS",
134  "GCT_PHYS_PARAMS.CONFIG_KEY",
136 
137  if (lsbResults.queryFailed()) {
138  edm::LogError("L1-O2O") << "Problem with L1JetEtScale key.";
139  } else {
140  lsbResults.fillVariable("GCT_RGN_ET_LSB", rgnEtLsb);
141  }
142 
143  //~~~~~~~~~ Instantiate new L1HfRingEtScale object. ~~~~~~~~~
144  return std::make_unique<L1CaloEtScale>(0xff, 0x7, rgnEtLsb, thresholds);
145 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:259
Log< level::Error, false > LogError
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
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:274