CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
L1HfRingEtScaleOnlineProd Class Reference
Inheritance diagram for L1HfRingEtScaleOnlineProd:
L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 L1HfRingEtScaleOnlineProd (const edm::ParameterSet &)
 
virtual boost::shared_ptr
< L1CaloEtScale
newObject (const std::string &objectKey) override
 
 ~L1HfRingEtScaleOnlineProd ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
boost::shared_ptr< L1CaloEtScaleproduce (const L1HfRingEtScaleRcd &iRecord)
 
 ~L1ConfigOnlineProdBase ()
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- 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 ()
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey, boost::shared_ptr
< DataProxy > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale >
bool getObjectKey (const L1HfRingEtScaleRcd &record, boost::shared_ptr< L1CaloEtScale > data, std::string &objectKey)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 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< L1HfRingEtScaleRcd, L1CaloEtScale >
bool m_copyFromCondDB
 
cond::DbConnection m_dbConnection
 
cond::DbSession 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 L1HfRingEtScaleOnlineProd.cc.

Constructor & Destructor Documentation

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

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

Definition at line 69 of file L1HfRingEtScaleOnlineProd.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

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

Implements L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale >.

Definition at line 78 of file L1HfRingEtScaleOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), L1ConfigOnlineProdBase< L1HfRingEtScaleRcd, L1CaloEtScale >::m_omdsReader, l1t::OMDSReader::singleAttribute(), AlCaHLTBitMon_QueryRunRegistry::string, GOODCOLL_filter_cfg::thresh, and fff_deleter::thresholds.

79 {
80  using namespace edm::es;
81 
82  // get scales keys
83  l1t::OMDSReader::QueryResults scalesKeyResults =
85  "GCT_SCALES_KEY",
86  "CMS_GCT",
87  "GCT_PHYS_PARAMS",
88  "GCT_PHYS_PARAMS.CONFIG_KEY",
89  m_omdsReader.singleAttribute( objectKey ) );
90 
91  std::string scalesKey ;
92 
93  if( scalesKeyResults.queryFailed() ) {
94  edm::LogError("L1-O2O")
95  << "Problem with key for L1JetEtScaleRcd : GCT scales key query failed ";
96  }
97  else if( scalesKeyResults.numberRows() != 1 ) {
98  edm::LogError("L1-O2O")
99  << "Problem with key for L1JetEtScaleRcd : "
100  << (scalesKeyResults.numberRows()) << " rows were returned when getting GCT scales key";
101  }
102  else {
103  scalesKeyResults.fillVariable( scalesKey );
104  }
105 
106 
107  // get ring scale key
108  l1t::OMDSReader::QueryResults hfRingScaleKeyResults =
110  "SC_HF_ET_SUM_FK",
111  "CMS_GT",
112  "L1T_SCALES",
113  "L1T_SCALES.ID",
114  scalesKeyResults );
115 
116  std::string hfRingScaleKey ;
117 
118  if( hfRingScaleKeyResults.queryFailed() ) {
119  edm::LogError("L1-O2O")
120  << "Problem with key for L1HfRingEtScaleRcd : HF ring Et scale key query failed ";
121  }
122  else if( hfRingScaleKeyResults.numberRows() != 1 ) {
123  edm::LogError("L1-O2O")
124  << "Problem with key for L1HfRingEtScaleRcd : "
125  << (hfRingScaleKeyResults.numberRows()) << " rows were returned when getting HF ring Et scale key";
126  }
127  else {
128  hfRingScaleKeyResults.fillVariable( hfRingScaleKey ) ;
129  }
130 
131  // get thresholds
132  std::vector< std::string > queryStrings ;
133  queryStrings.push_back( "E_GEV_BIN_LOW_0");
134  queryStrings.push_back( "E_GEV_BIN_LOW_1");
135  queryStrings.push_back( "E_GEV_BIN_LOW_2");
136  queryStrings.push_back( "E_GEV_BIN_LOW_3");
137  queryStrings.push_back( "E_GEV_BIN_LOW_4");
138  queryStrings.push_back( "E_GEV_BIN_LOW_5");
139  queryStrings.push_back( "E_GEV_BIN_LOW_6");
140  queryStrings.push_back( "E_GEV_BIN_LOW_7");
141 
142  l1t::OMDSReader::QueryResults scaleResults =
143  m_omdsReader.basicQuery( queryStrings,
144  "CMS_GT",
145  "L1T_SCALE_HF_ET_SUM",
146  "L1T_SCALE_HF_ET_SUM.ID",
147  hfRingScaleKeyResults
148  );
149 
150  std::vector<double> thresholds;
151 
152  if( scaleResults.queryFailed() ) {
153  edm::LogError( "L1-O2O" ) << "Problem with L1HfRingEtScale key : scale query failed." ;
154  }
155  else if ( scaleResults.numberRows() != 1 ) {
156  edm::LogError( "L1-O2O" ) << "Problem with L1HfRingEtScale key : scale query failed." ;
157  }
158  else {
159  for( std::vector< std::string >::iterator thresh = queryStrings.begin();
160  thresh != queryStrings.end(); ++thresh) {
161  float tempScale = 0.;
162  scaleResults.fillVariable(*thresh,tempScale);
163  thresholds.push_back(tempScale);
164  }
165  }
166 
167  // get region LSB
168  double rgnEtLsb=0.;
169 
170  l1t::OMDSReader::QueryResults lsbResults =
171  m_omdsReader.basicQuery( "GCT_RGN_ET_LSB",
172  "CMS_GCT",
173  "GCT_PHYS_PARAMS",
174  "GCT_PHYS_PARAMS.CONFIG_KEY",
175  m_omdsReader.singleAttribute( objectKey ) ) ;
176 
177  if( lsbResults.queryFailed() ) {
178  edm::LogError( "L1-O2O" ) << "Problem with L1JetEtScale key." ;
179  }
180  else {
181  lsbResults.fillVariable( "GCT_RGN_ET_LSB", rgnEtLsb );
182  }
183 
184  //~~~~~~~~~ Instantiate new L1HfRingEtScale object. ~~~~~~~~~
185  return boost::shared_ptr< L1CaloEtScale >( new L1CaloEtScale(0xff, 0x7, rgnEtLsb, thresholds ) );
186 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:295
dictionary thresholds
Definition: fff_deleter.py:273
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="") const
Definition: OMDSReader.cc:87