CMS 3D CMS Logo

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

Public Member Functions

 L1JetEtScaleOnlineProd (const edm::ParameterSet &)
 
std::unique_ptr< L1CaloEtScalenewObject (const std::string &objectKey) override
 
 ~L1JetEtScaleOnlineProd () override
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1JetEtScaleRcd, L1CaloEtScale >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual std::unique_ptr< L1CaloEtScaleproduce (const L1JetEtScaleRcd &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< L1JetEtScaleRcd, L1CaloEtScale >
bool getObjectKey (const L1JetEtScaleRcd &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< L1JetEtScaleRcd, L1CaloEtScale >
bool m_copyFromCondDB
 
cond::persistency::Session m_dbSession
 
bool m_forceGeneration
 
l1t::OMDSReader m_omdsReader
 

Detailed Description

Description: Online producer for L1 jet Et scales

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

Definition at line 33 of file L1JetEtScaleOnlineProd.cc.

Constructor & Destructor Documentation

L1JetEtScaleOnlineProd::L1JetEtScaleOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 58 of file L1JetEtScaleOnlineProd.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 }
L1JetEtScaleOnlineProd::~L1JetEtScaleOnlineProd ( )
override

Definition at line 69 of file L1JetEtScaleOnlineProd.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 > L1JetEtScaleOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1JetEtScaleRcd, L1CaloEtScale >.

Definition at line 78 of file L1JetEtScaleOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), DEFINE_FWK_EVENTSETUP_MODULE, l1t::OMDSReader::QueryResults::fillVariable(), L1ConfigOnlineProdBase< L1JetEtScaleRcd, L1CaloEtScale >::m_omdsReader, l1t::OMDSReader::QueryResults::numberRows(), l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), AlCaHLTBitMon_QueryRunRegistry::string, scrapingFilter_cfi::thresh, and particleFlowZeroSuppressionECAL_cff::thresholds.

79 {
80  // get scales keys
81  l1t::OMDSReader::QueryResults scalesKeyResults =
83  "GCT_SCALES_KEY",
84  "CMS_GCT",
85  "GCT_PHYS_PARAMS",
86  "GCT_PHYS_PARAMS.CONFIG_KEY",
87  m_omdsReader.singleAttribute( objectKey ) );
88 
89  std::string scalesKey ;
90 
91  if( scalesKeyResults.queryFailed() ) {
92  edm::LogError("L1-O2O")
93  << "Problem with key for L1JetEtScaleRcd : GCT scales key query failed ";
94  }
95  else if( scalesKeyResults.numberRows() != 1 ) {
96  edm::LogError("L1-O2O")
97  << "Problem with key for L1JetEtScaleRcd : "
98  << (scalesKeyResults.numberRows()) << " rows were returned when getting GCT scales key";
99  }
100  else {
101  scalesKeyResults.fillVariable( scalesKey );
102  }
103 
104 
105  // get jet scale key
106  l1t::OMDSReader::QueryResults jetScaleKeyResults =
108  "SC_CENJET_ET_THRESHOLD_FK",
109  "CMS_GT",
110  "L1T_SCALES",
111  "L1T_SCALES.ID",
112  scalesKeyResults );
113 
114  std::string jetScaleKey ;
115 
116  if( jetScaleKeyResults.queryFailed() ) {
117  edm::LogError("L1-O2O")
118  << "Problem with key for L1GctJetEtScaleRcd : jet scale key query failed ";
119  }
120  else if( jetScaleKeyResults.numberRows() != 1 ) {
121  edm::LogError("L1-O2O")
122  << "Problem with key for L1GctJetEtScaleRcd : "
123  << (jetScaleKeyResults.numberRows()) << " rows were returned when getting jet Et scale key";
124  }
125  else {
126  jetScaleKeyResults.fillVariable( jetScaleKey ) ;
127  }
128 
129  // get thresholds
130  std::vector< std::string > queryStrings ;
131  queryStrings.push_back( "ET_GEV_BIN_LOW_0");
132  queryStrings.push_back( "ET_GEV_BIN_LOW_1");
133  queryStrings.push_back( "ET_GEV_BIN_LOW_2");
134  queryStrings.push_back( "ET_GEV_BIN_LOW_3");
135  queryStrings.push_back( "ET_GEV_BIN_LOW_4");
136  queryStrings.push_back( "ET_GEV_BIN_LOW_5");
137  queryStrings.push_back( "ET_GEV_BIN_LOW_6");
138  queryStrings.push_back( "ET_GEV_BIN_LOW_7");
139  queryStrings.push_back( "ET_GEV_BIN_LOW_8");
140  queryStrings.push_back( "ET_GEV_BIN_LOW_9");
141  queryStrings.push_back( "ET_GEV_BIN_LOW_10");
142  queryStrings.push_back( "ET_GEV_BIN_LOW_11");
143  queryStrings.push_back( "ET_GEV_BIN_LOW_12");
144  queryStrings.push_back( "ET_GEV_BIN_LOW_13");
145  queryStrings.push_back( "ET_GEV_BIN_LOW_14");
146  queryStrings.push_back( "ET_GEV_BIN_LOW_15");
147  queryStrings.push_back( "ET_GEV_BIN_LOW_16");
148  queryStrings.push_back( "ET_GEV_BIN_LOW_17");
149  queryStrings.push_back( "ET_GEV_BIN_LOW_18");
150  queryStrings.push_back( "ET_GEV_BIN_LOW_19");
151  queryStrings.push_back( "ET_GEV_BIN_LOW_20");
152  queryStrings.push_back( "ET_GEV_BIN_LOW_21");
153  queryStrings.push_back( "ET_GEV_BIN_LOW_22");
154  queryStrings.push_back( "ET_GEV_BIN_LOW_23");
155  queryStrings.push_back( "ET_GEV_BIN_LOW_24");
156  queryStrings.push_back( "ET_GEV_BIN_LOW_25");
157  queryStrings.push_back( "ET_GEV_BIN_LOW_26");
158  queryStrings.push_back( "ET_GEV_BIN_LOW_27");
159  queryStrings.push_back( "ET_GEV_BIN_LOW_28");
160  queryStrings.push_back( "ET_GEV_BIN_LOW_29");
161  queryStrings.push_back( "ET_GEV_BIN_LOW_30");
162  queryStrings.push_back( "ET_GEV_BIN_LOW_31");
163  queryStrings.push_back( "ET_GEV_BIN_LOW_32");
164  queryStrings.push_back( "ET_GEV_BIN_LOW_33");
165  queryStrings.push_back( "ET_GEV_BIN_LOW_34");
166  queryStrings.push_back( "ET_GEV_BIN_LOW_35");
167  queryStrings.push_back( "ET_GEV_BIN_LOW_36");
168  queryStrings.push_back( "ET_GEV_BIN_LOW_37");
169  queryStrings.push_back( "ET_GEV_BIN_LOW_38");
170  queryStrings.push_back( "ET_GEV_BIN_LOW_39");
171  queryStrings.push_back( "ET_GEV_BIN_LOW_40");
172  queryStrings.push_back( "ET_GEV_BIN_LOW_41");
173  queryStrings.push_back( "ET_GEV_BIN_LOW_42");
174  queryStrings.push_back( "ET_GEV_BIN_LOW_43");
175  queryStrings.push_back( "ET_GEV_BIN_LOW_44");
176  queryStrings.push_back( "ET_GEV_BIN_LOW_45");
177  queryStrings.push_back( "ET_GEV_BIN_LOW_46");
178  queryStrings.push_back( "ET_GEV_BIN_LOW_47");
179  queryStrings.push_back( "ET_GEV_BIN_LOW_48");
180  queryStrings.push_back( "ET_GEV_BIN_LOW_49");
181  queryStrings.push_back( "ET_GEV_BIN_LOW_50");
182  queryStrings.push_back( "ET_GEV_BIN_LOW_51");
183  queryStrings.push_back( "ET_GEV_BIN_LOW_52");
184  queryStrings.push_back( "ET_GEV_BIN_LOW_53");
185  queryStrings.push_back( "ET_GEV_BIN_LOW_54");
186  queryStrings.push_back( "ET_GEV_BIN_LOW_55");
187  queryStrings.push_back( "ET_GEV_BIN_LOW_56");
188  queryStrings.push_back( "ET_GEV_BIN_LOW_57");
189  queryStrings.push_back( "ET_GEV_BIN_LOW_58");
190  queryStrings.push_back( "ET_GEV_BIN_LOW_59");
191  queryStrings.push_back( "ET_GEV_BIN_LOW_60");
192  queryStrings.push_back( "ET_GEV_BIN_LOW_61");
193  queryStrings.push_back( "ET_GEV_BIN_LOW_62");
194  queryStrings.push_back( "ET_GEV_BIN_LOW_63");
195 
196  l1t::OMDSReader::QueryResults scaleResults =
197  m_omdsReader.basicQuery( queryStrings,
198  "CMS_GT",
199  "L1T_SCALE_CALO_ET_THRESHOLD",
200  "L1T_SCALE_CALO_ET_THRESHOLD.ID",
201  jetScaleKeyResults
202  );
203 
204  std::vector<double> thresholds;
205 
206  if( scaleResults.queryFailed() ||
207  scaleResults.numberRows() != 1 ) // check query successful
208  {
209  edm::LogError( "L1-O2O" ) << "Problem with L1JetEtScale key : when reading scale." ;
210  }
211  else {
212  for( std::vector< std::string >::iterator thresh = queryStrings.begin();
213  thresh != queryStrings.end(); ++thresh) {
214  float tempScale = 0.0;
215  scaleResults.fillVariable(*thresh,tempScale);
216  thresholds.push_back(tempScale);
217  }
218  }
219 
220  // get region LSB
221  double rgnEtLsb=0.;
222 
223  l1t::OMDSReader::QueryResults lsbResults =
224  m_omdsReader.basicQuery( "GCT_RGN_ET_LSB",
225  "CMS_GCT",
226  "GCT_PHYS_PARAMS",
227  "GCT_PHYS_PARAMS.CONFIG_KEY",
228  m_omdsReader.singleAttribute( objectKey ) ) ;
229 
230  if( lsbResults.queryFailed() ) {
231  edm::LogError( "L1-O2O" ) << "Problem with L1JetEtScale key." ;
232  }
233  else {
234  lsbResults.fillVariable( "GCT_RGN_ET_LSB", rgnEtLsb );
235  }
236 
237  // return object
238  return std::make_unique<L1CaloEtScale>( rgnEtLsb, thresholds );
239 }
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