CMS 3D CMS Logo

List of all members | Public Member Functions
L1EmEtScaleOnlineProd Class Reference
Inheritance diagram for L1EmEtScaleOnlineProd:
L1ConfigOnlineProdBase< L1EmEtScaleRcd, L1CaloEtScale > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1EmEtScaleOnlineProd (const edm::ParameterSet &)
 
std::unique_ptr< L1CaloEtScalenewObject (const std::string &objectKey) override
 
 ~L1EmEtScaleOnlineProd () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1EmEtScaleRcd, L1CaloEtScale >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1CaloEtScaleproduce (const L1EmEtScaleRcd &iRecord)
 
 ~L1ConfigOnlineProdBase () override
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
ESProxyIndex const * getTokenIndices (unsigned int iIndex) const
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &) final
 
 ~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)
 

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< L1EmEtScaleRcd, L1CaloEtScale >
bool getObjectKey (const L1EmEtScaleRcd &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 >
ESConsumesCollectorT< TRecord > 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< L1EmEtScaleRcd, L1CaloEtScale >
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 33 of file L1EmEtScaleOnlineProd.cc.

Constructor & Destructor Documentation

L1EmEtScaleOnlineProd::L1EmEtScaleOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 58 of file L1EmEtScaleOnlineProd.cc.

61 {
62  //the following line is needed to tell the framework what
63  // data is being produced
64 
65  //now do what ever other initialization is needed
66 }
L1EmEtScaleOnlineProd::~L1EmEtScaleOnlineProd ( )
override

Definition at line 69 of file L1EmEtScaleOnlineProd.cc.

70 {
71 
72  // do anything here that needs to be done at desctruction time
73  // (e.g. close files, deallocate resources etc.)
74 
75 }

Member Function Documentation

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

Implements L1ConfigOnlineProdBase< L1EmEtScaleRcd, L1CaloEtScale >.

Definition at line 78 of file L1EmEtScaleOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), DEFINE_FWK_EVENTSETUP_MODULE, l1t::OMDSReader::QueryResults::fillVariable(), L1ConfigOnlineProdBase< L1EmEtScaleRcd, L1CaloEtScale >::m_omdsReader, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), and scrapingFilter_cfi::thresh.

79 {
80  // ~~~~~~~~~ Cut values ~~~~~~~~~
81 
82 
83  std::vector< std::string > queryStrings ;
84  queryStrings.push_back( "ET_GEV_BIN_LOW_0");
85  queryStrings.push_back( "ET_GEV_BIN_LOW_1");
86  queryStrings.push_back( "ET_GEV_BIN_LOW_2");
87  queryStrings.push_back( "ET_GEV_BIN_LOW_3");
88  queryStrings.push_back( "ET_GEV_BIN_LOW_4");
89  queryStrings.push_back( "ET_GEV_BIN_LOW_5");
90  queryStrings.push_back( "ET_GEV_BIN_LOW_6");
91  queryStrings.push_back( "ET_GEV_BIN_LOW_7");
92  queryStrings.push_back( "ET_GEV_BIN_LOW_8");
93  queryStrings.push_back( "ET_GEV_BIN_LOW_9");
94  queryStrings.push_back( "ET_GEV_BIN_LOW_10");
95  queryStrings.push_back( "ET_GEV_BIN_LOW_11");
96  queryStrings.push_back( "ET_GEV_BIN_LOW_12");
97  queryStrings.push_back( "ET_GEV_BIN_LOW_13");
98  queryStrings.push_back( "ET_GEV_BIN_LOW_14");
99  queryStrings.push_back( "ET_GEV_BIN_LOW_15");
100  queryStrings.push_back( "ET_GEV_BIN_LOW_16");
101  queryStrings.push_back( "ET_GEV_BIN_LOW_17");
102  queryStrings.push_back( "ET_GEV_BIN_LOW_18");
103  queryStrings.push_back( "ET_GEV_BIN_LOW_19");
104  queryStrings.push_back( "ET_GEV_BIN_LOW_20");
105  queryStrings.push_back( "ET_GEV_BIN_LOW_21");
106  queryStrings.push_back( "ET_GEV_BIN_LOW_22");
107  queryStrings.push_back( "ET_GEV_BIN_LOW_23");
108  queryStrings.push_back( "ET_GEV_BIN_LOW_24");
109  queryStrings.push_back( "ET_GEV_BIN_LOW_25");
110  queryStrings.push_back( "ET_GEV_BIN_LOW_26");
111  queryStrings.push_back( "ET_GEV_BIN_LOW_27");
112  queryStrings.push_back( "ET_GEV_BIN_LOW_28");
113  queryStrings.push_back( "ET_GEV_BIN_LOW_29");
114  queryStrings.push_back( "ET_GEV_BIN_LOW_30");
115  queryStrings.push_back( "ET_GEV_BIN_LOW_31");
116  queryStrings.push_back( "ET_GEV_BIN_LOW_32");
117  queryStrings.push_back( "ET_GEV_BIN_LOW_33");
118  queryStrings.push_back( "ET_GEV_BIN_LOW_34");
119  queryStrings.push_back( "ET_GEV_BIN_LOW_35");
120  queryStrings.push_back( "ET_GEV_BIN_LOW_36");
121  queryStrings.push_back( "ET_GEV_BIN_LOW_37");
122  queryStrings.push_back( "ET_GEV_BIN_LOW_38");
123  queryStrings.push_back( "ET_GEV_BIN_LOW_39");
124  queryStrings.push_back( "ET_GEV_BIN_LOW_40");
125  queryStrings.push_back( "ET_GEV_BIN_LOW_41");
126  queryStrings.push_back( "ET_GEV_BIN_LOW_42");
127  queryStrings.push_back( "ET_GEV_BIN_LOW_43");
128  queryStrings.push_back( "ET_GEV_BIN_LOW_44");
129  queryStrings.push_back( "ET_GEV_BIN_LOW_45");
130  queryStrings.push_back( "ET_GEV_BIN_LOW_46");
131  queryStrings.push_back( "ET_GEV_BIN_LOW_47");
132  queryStrings.push_back( "ET_GEV_BIN_LOW_48");
133  queryStrings.push_back( "ET_GEV_BIN_LOW_49");
134  queryStrings.push_back( "ET_GEV_BIN_LOW_50");
135  queryStrings.push_back( "ET_GEV_BIN_LOW_51");
136  queryStrings.push_back( "ET_GEV_BIN_LOW_52");
137  queryStrings.push_back( "ET_GEV_BIN_LOW_53");
138  queryStrings.push_back( "ET_GEV_BIN_LOW_54");
139  queryStrings.push_back( "ET_GEV_BIN_LOW_55");
140  queryStrings.push_back( "ET_GEV_BIN_LOW_56");
141  queryStrings.push_back( "ET_GEV_BIN_LOW_57");
142  queryStrings.push_back( "ET_GEV_BIN_LOW_58");
143  queryStrings.push_back( "ET_GEV_BIN_LOW_59");
144  queryStrings.push_back( "ET_GEV_BIN_LOW_60");
145  queryStrings.push_back( "ET_GEV_BIN_LOW_61");
146  queryStrings.push_back( "ET_GEV_BIN_LOW_62");
147  queryStrings.push_back( "ET_GEV_BIN_LOW_63");
148 
149  const l1t::OMDSReader::QueryResults scaleKeyResults =
150  m_omdsReader.singleAttribute( objectKey ) ;
151 
152 
153  l1t::OMDSReader::QueryResults scaleResults =
154  m_omdsReader.basicQuery( queryStrings,
155  "CMS_GT",
156  "L1T_SCALE_CALO_ET_THRESHOLD",
157  "L1T_SCALE_CALO_ET_THRESHOLD.ID",
158  m_omdsReader.basicQuery( "L1T_SCALE_CALO_ET_THRESHOLD_ID",
159  "CMS_RCT",
160  "L1CALOEMETTHRESH",
161  "L1CALOEMETTHRESH.NAME",
162  scaleKeyResults
163  ));
164 
165 
166 
167  if( scaleResults.queryFailed() ||
168  scaleResults.numberRows() != 1 ) // check query successful
169  {
170  edm::LogError( "L1-O2O" ) << "Problem with L1EmEtScale key." ;
171  return std::unique_ptr< L1CaloEtScale >() ;
172  }
173  std::vector<double> m_thresholds;
174 
175  for( std::vector< std::string >::iterator thresh = queryStrings.begin();
176  thresh != queryStrings.end(); ++thresh) {
177  float tempScale = 0.0;
178  scaleResults.fillVariable(*thresh,tempScale);
179  m_thresholds.push_back(tempScale);
180  }
181 
182  l1t::OMDSReader::QueryResults lsbResults =
183  m_omdsReader.basicQuery("INPUTLSB",
184  "CMS_RCT",
185  "L1CALOEMETTHRESH",
186  "L1CALOEMETTHRESH.NAME",
187  scaleKeyResults
188  );
189  if( lsbResults.queryFailed() ||
190  lsbResults.numberRows() != 1 ) // check query successful
191  {
192  edm::LogError( "L1-O2O" ) << "Problem with L1EmEtScale key." ;
193  return std::unique_ptr< L1CaloEtScale >() ;
194  }
195 
196  double m_lsb = 0.;
197  lsbResults.fillVariable(m_lsb);
198 
199  // std::cout << " input lsb " << m_lsb <<std::endl;
200 
201  //~~~~~~~~~ Instantiate new L1EmEtScale object. ~~~~~~~~~
202 
203  // Default objects for Lindsey
204 
205  return std::make_unique<L1CaloEtScale>(m_lsb,m_thresholds);
206 }
bool fillVariable(const std::string &columnName, T &outputVariable) const
Definition: OMDSReader.h:311
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