CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual boost::shared_ptr
< L1CaloEtScale
newObject (const std::string &objectKey)
 
 ~L1JetEtScaleOnlineProd ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1JetEtScaleRcd, L1CaloEtScale >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
boost::shared_ptr< L1CaloEtScaleproduce (const L1JetEtScaleRcd &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< L1JetEtScaleRcd, L1CaloEtScale >
bool getObjectKey (const L1JetEtScaleRcd &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< L1JetEtScaleRcd, L1CaloEtScale >
bool m_copyFromCondDB
 
cond::DbConnection m_dbConnection
 
cond::DbSession 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 34 of file L1JetEtScaleOnlineProd.cc.

Constructor & Destructor Documentation

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

Definition at line 59 of file L1JetEtScaleOnlineProd.cc.

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

Definition at line 70 of file L1JetEtScaleOnlineProd.cc.

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

Member Function Documentation

boost::shared_ptr< L1CaloEtScale > L1JetEtScaleOnlineProd::newObject ( const std::string &  objectKey)
virtual

Implements L1ConfigOnlineProdBase< L1JetEtScaleRcd, L1CaloEtScale >.

Definition at line 79 of file L1JetEtScaleOnlineProd.cc.

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

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