test
CMS 3D CMS Logo

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

Public Member Functions

void fillScaleFactors (const l1t::OMDSReader::QueryResults &results, std::vector< double > &output, int nfactor=1)
 
 L1RCTParametersOnlineProd (const edm::ParameterSet &)
 
virtual boost::shared_ptr
< L1RCTParameters
newObject (const std::string &objectKey) override
 
 ~L1RCTParametersOnlineProd ()
 
- Public Member Functions inherited from L1ConfigOnlineProdBase< L1RCTParametersRcd, L1RCTParameters >
 L1ConfigOnlineProdBase (const edm::ParameterSet &)
 
virtual boost::shared_ptr
< L1RCTParameters
produce (const L1RCTParametersRcd &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,
edm::propagate_const
< std::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< L1RCTParametersRcd, L1RCTParameters >
bool getObjectKey (const L1RCTParametersRcd &record, boost::shared_ptr< L1RCTParameters > 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< L1RCTParametersRcd, L1RCTParameters >
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 35 of file L1RCTParametersOnlineProd.cc.

Constructor & Destructor Documentation

L1RCTParametersOnlineProd::L1RCTParametersOnlineProd ( const edm::ParameterSet iConfig)

Definition at line 68 of file L1RCTParametersOnlineProd.cc.

71 {
72  //the following line is needed to tell the framework what
73  // data is being produced
74 
75  //now do what ever other initialization is needed
76 }
L1RCTParametersOnlineProd::~L1RCTParametersOnlineProd ( )

Definition at line 79 of file L1RCTParametersOnlineProd.cc.

80 {
81 
82  // do anything here that needs to be done at desctruction time
83  // (e.g. close files, deallocate resources etc.)
84 
85 }

Member Function Documentation

void L1RCTParametersOnlineProd::fillScaleFactors ( const l1t::OMDSReader::QueryResults results,
std::vector< double > &  output,
int  nfactor = 1 
)

Definition at line 507 of file L1RCTParametersOnlineProd.cc.

References l1t::OMDSReader::QueryResults::fillVariableFromRow(), i, and l1t::OMDSReader::QueryResults::numberRows().

Referenced by newObject().

510 {
511  if( (nfactors < 1) || (nfactors > 6)){
512  edm::LogError( "L1-O2O" ) <<"invalid number of factors in scale factors fill";
513  return;
514  }
515 
516  std::vector< std::string > scaleFactorQuery6Strings ;
517  scaleFactorQuery6Strings.push_back( "SCALEFACTOR" ) ;
518  scaleFactorQuery6Strings.push_back( "SF2" ) ;
519  scaleFactorQuery6Strings.push_back( "SF3" ) ;
520  scaleFactorQuery6Strings.push_back( "SF4" ) ;
521  scaleFactorQuery6Strings.push_back( "SF5" ) ;
522  scaleFactorQuery6Strings.push_back( "SF6" ) ;
523  // Store scale factors in temporary array to get ordering right.
524  // Reserve space for 100 bins.
525 
526  // static const int reserve = 100 ;
527  std::vector <double> sfTmp[100] ;
528  /*
529  for( int i = 0 ; i < reserve ; ++i )
530  {
531  sfTmp[ i ] = 0. ;
532  }
533  */
534  short maxBin = 0 ;
535  for( int i = 0 ; i < results.numberRows() ; ++i )
536  {
537  double sf[6] ;
538  for(int nf = 0; nf < nfactors; nf++){
539  results.fillVariableFromRow( scaleFactorQuery6Strings.at(nf), i, sf[nf] ) ;
540  }
541  short ieta = 0;
542  results.fillVariableFromRow( "FK_RCT_ETA", i, ieta ) ;
543 
544  for(int nf = 0; nf< nfactors; nf++)
545  // sfTmp[ ieta-1 ] = sf ; // eta bins start at 1.
546  sfTmp[ieta-1].push_back(sf[nf]);
547 
548  if( ieta > maxBin )
549  {
550  maxBin = ieta ;
551  }
552  }
553 
554 
555  for( short i = 0 ; i < maxBin ; ++i )
556  {
557  for( short nf = 0; nf < nfactors; nf++)
558  output.push_back( sfTmp[ i ].at(nf) ) ;
559 
560  }
561 }
int i
Definition: DBlmapReader.cc:9
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
Definition: OMDSReader.h:320
boost::shared_ptr< L1RCTParameters > L1RCTParametersOnlineProd::newObject ( const std::string &  objectKey)
overridevirtual

Implements L1ConfigOnlineProdBase< L1RCTParametersRcd, L1RCTParameters >.

Definition at line 88 of file L1RCTParametersOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), fillScaleFactors(), L1ConfigOnlineProdBase< L1RCTParametersRcd, L1RCTParameters >::m_omdsReader, l1t::OMDSReader::QueryResults::queryFailed(), l1t::OMDSReader::singleAttribute(), and AlCaHLTBitMon_QueryRunRegistry::string.

89 {
90  using namespace edm::es;
91 
92  std::string rctSchema = "CMS_RCT" ;
93  const l1t::OMDSReader::QueryResults paremKeyResults =
94  m_omdsReader.singleAttribute( objectKey ) ;
95 
96  // ~~~~~~~~~ Cut values ~~~~~~~~~
97 
98  // select egamma_lsb, jetmet_lsb, e_min_for_fg_cut, e_max_for_fg_cut,
99  // h_ove r_e_cut, e_min_for_h_over_e_cut, e_max_for_h_over_e_cut,
100  // h_min_for_h_over_e_cut, e_activity_cut, h_activity_cut,
101  // eic_isolation_threshold, jsc_quiet_threshold_barrel,
102  // jsc_quiet_threshold_endcap, noisevetohb, noisevetoheplus,
103  // noisevetoheminus from parem_conf where parem_conf.parem_key =
104  // (select rct_parameter from rct_conf where rct_conf.rct_key =
105  // 'rct_cmssw_def');
106 
107  std::vector< std::string > queryStrings ;
108  queryStrings.push_back( "EGAMMA_LSB" ) ;
109  queryStrings.push_back( "JETMET_LSB" ) ;
110  queryStrings.push_back( "E_MIN_FOR_FG_CUT" ) ;
111  queryStrings.push_back( "E_MAX_FOR_FG_CUT" ) ;
112  queryStrings.push_back( "H_OVER_E_CUT" ) ;
113  queryStrings.push_back( "E_MIN_FOR_H_OVER_E_CUT" ) ;
114  queryStrings.push_back( "E_MAX_FOR_H_OVER_E_CUT" ) ;
115  queryStrings.push_back( "H_MIN_FOR_H_OVER_E_CUT" ) ;
116  queryStrings.push_back( "E_ACTIVITY_CUT" ) ;
117  queryStrings.push_back( "H_ACTIVITY_CUT" ) ;
118  queryStrings.push_back( "EIC_ISOLATION_THRESHOLD" ) ;
119  queryStrings.push_back( "JSC_QUIET_THRESHOLD_BARREL" ) ;
120  queryStrings.push_back( "JSC_QUIET_THRESHOLD_ENDCAP" ) ;
121  queryStrings.push_back( "NOISEVETOHB" ) ;
122  queryStrings.push_back( "NOISEVETOHEPLUS" ) ;
123  queryStrings.push_back( "NOISEVETOHEMINUS" ) ;
124  queryStrings.push_back( "USECORR" );
125  l1t::OMDSReader::QueryResults paremResults =
126  m_omdsReader.basicQuery( queryStrings,
127  rctSchema,
128  "PAREM_CONF",
129  "PAREM_CONF.PAREM_KEY",
130  paremKeyResults ) ;
131 
132  if( paremResults.queryFailed() ||
133  paremResults.numberRows() != 1 ) // check query successful
134  {
135  edm::LogError( "L1-O2O" ) << "Problem with L1RCTParameters key." ;
136  return boost::shared_ptr< L1RCTParameters >() ;
137  }
138 
139  double eGammaLSB, jetMETLSB, eMinForFGCut, eMaxForFGCut, hOeCut ;
140  double eMinForHoECut, eMaxForHoECut, hMinForHoECut ;
141  double eActivityCut, hActivityCut ;
142  double jscQuietThreshBarrel, jscQuietThreshEndcap, eicIsolationThreshold ;
143  bool noiseVetoHB, noiseVetoHEplus, noiseVetoHEminus, useCorr ;
144 
145  paremResults.fillVariable( "EGAMMA_LSB", eGammaLSB ) ;
146  paremResults.fillVariable( "JETMET_LSB", jetMETLSB ) ;
147  paremResults.fillVariable( "E_MIN_FOR_FG_CUT", eMinForFGCut ) ;
148  paremResults.fillVariable( "E_MAX_FOR_FG_CUT", eMaxForFGCut ) ;
149  paremResults.fillVariable( "H_OVER_E_CUT", hOeCut ) ;
150  paremResults.fillVariable( "E_MIN_FOR_H_OVER_E_CUT", eMinForHoECut ) ;
151  paremResults.fillVariable( "E_MAX_FOR_H_OVER_E_CUT", eMaxForHoECut ) ;
152  paremResults.fillVariable( "H_MIN_FOR_H_OVER_E_CUT", hMinForHoECut ) ;
153  paremResults.fillVariable( "E_ACTIVITY_CUT", eActivityCut ) ;
154  paremResults.fillVariable( "H_ACTIVITY_CUT", hActivityCut ) ;
155  paremResults.fillVariable( "JSC_QUIET_THRESHOLD_BARREL",
156  jscQuietThreshBarrel ) ;
157  paremResults.fillVariable( "JSC_QUIET_THRESHOLD_ENDCAP",
158  jscQuietThreshEndcap ) ;
159  paremResults.fillVariable( "EIC_ISOLATION_THRESHOLD",
160  eicIsolationThreshold ) ;
161  paremResults.fillVariable( "NOISEVETOHB", noiseVetoHB ) ;
162  paremResults.fillVariable( "NOISEVETOHEPLUS", noiseVetoHEplus ) ;
163  paremResults.fillVariable( "NOISEVETOHEMINUS", noiseVetoHEminus ) ;
164  paremResults.fillVariable( "USECORR", useCorr ) ;
165 // std::cout << "eGammaLSB = " << eGammaLSB << std::endl ;
166 // std::cout << "jetMETLSB = " << jetMETLSB << std::endl ;
167 // std::cout << "eMinForFGCut = " << eMinForFGCut << std::endl ;
168 // std::cout << "eMaxForFGCut = " << eMaxForFGCut << std::endl ;
169 // std::cout << "hOeCut = " << hOeCut << std::endl ;
170 // std::cout << "eMinForHoECut = " << eMinForHoECut << std::endl ;
171 // std::cout << "eMaxForHoECut = " << eMaxForHoECut << std::endl ;
172 // std::cout << "hMinForHoECut = " << hMinForHoECut << std::endl ;
173 // std::cout << "eActivityCut = " << eActivityCut << std::endl ;
174 // std::cout << "hActivityCut = " << hActivityCut << std::endl ;
175 // std::cout << "eicIsolationThreshold = " << eicIsolationThreshold << std::endl ;
176 // std::cout << "jscQuietThreshBarrel = " << jscQuietThreshBarrel << std::endl ;
177 // std::cout << "jscQuietThreshEndcap = " << jscQuietThreshEndcap << std::endl ;
178 // std::cout << "noiseVetoHB = " << noiseVetoHB << std::endl ;
179 // std::cout << "noiseVetoHEplus = " << noiseVetoHEplus << std::endl ;
180 // std::cout << "noiseVetoHEminus = " << noiseVetoHEminus << std::endl ;
181 
182  // ~~~~~~~~~ EGamma ECAL scale factors ~~~~~~~~~
183 
184  // select scalefactor, fk_rct_eta from egamma_ecal_scalefactor where
185  // egamma_ecal_scalefactor.fk_version =
186  // (select egamma_ecal from parem_conf where parem_conf.parem_key =
187  // (select rct_parameter from rct_conf where rct_conf.rct_key=
188  // 'rct_cmssw_def'));
189 
190  std::vector< std::string > scaleFactorQueryStrings ;
191  scaleFactorQueryStrings.push_back( "SCALEFACTOR" ) ;
192  scaleFactorQueryStrings.push_back( "FK_RCT_ETA" ) ;
193 
194  l1t::OMDSReader::QueryResults egammaEcalResults =
196  scaleFactorQueryStrings,
197  rctSchema,
198  "EGAMMA_ECAL_SCALEFACTOR",
199  "EGAMMA_ECAL_SCALEFACTOR.FK_VERSION",
200  m_omdsReader.basicQuery( "EGAMMA_ECAL",
201  rctSchema,
202  "PAREM_CONF",
203  "PAREM_CONF.PAREM_KEY",
204  paremKeyResults ) ) ;
205 
206  if( egammaEcalResults.queryFailed() ) // check query successful
207  {
208  edm::LogError( "L1-O2O" ) << "Problem with EgammaEcal key." ;
209  return boost::shared_ptr< L1RCTParameters >() ;
210  }
211 
212 // std::cout << "egammaEcal " ;
213  std::vector< double > egammaEcalScaleFactors ;
214  fillScaleFactors( egammaEcalResults, egammaEcalScaleFactors ) ;
215 
216  // ~~~~~~~~~ EGamma HCAL scale factors ~~~~~~~~~
217 
218  // select scalefactor, fk_rct_eta from egamma_hcal_scalefactor where
219  // egamma_hcal_scalefactor.fk_version =
220  // (select egamma_hcal from parem_conf where parem_conf.parem_key =
221  // (select rct_parameter from rct_conf where rct_conf.rct_key=
222  // 'rct_cmssw_def'));
223 
224  l1t::OMDSReader::QueryResults egammaHcalResults =
226  scaleFactorQueryStrings,
227  rctSchema,
228  "EGAMMA_HCAL_SCALEFACTOR",
229  "EGAMMA_HCAL_SCALEFACTOR.FK_VERSION",
230  m_omdsReader.basicQuery( "EGAMMA_HCAL",
231  rctSchema,
232  "PAREM_CONF",
233  "PAREM_CONF.PAREM_KEY",
234  paremKeyResults ) ) ;
235 
236  if( egammaHcalResults.queryFailed() ) // check query successful
237  {
238  edm::LogError( "L1-O2O" ) << "Problem with EgammaHcal key." ;
239  return boost::shared_ptr< L1RCTParameters >() ;
240  }
241 
242 // std::cout << "egammaHcal " ;
243  std::vector< double > egammaHcalScaleFactors ;
244  fillScaleFactors( egammaHcalResults, egammaHcalScaleFactors ) ;
245 
246  // ~~~~~~~~~ JetMET ECAL scale factors ~~~~~~~~~
247 
248  // select scalefactor, fk_rct_eta from jetmet_ecal_scalefactor where
249  // jetmet_ecal_scalefactor.fk_version =
250  // (select jetmet_ecal from parem_conf where parem_conf.parem_key =
251  // (select rct_parameter from rct_conf where rct_conf.rct_key=
252  // 'rct_cmssw_def'));
253 
254  l1t::OMDSReader::QueryResults jetmetEcalResults =
256  scaleFactorQueryStrings,
257  rctSchema,
258  "JETMET_ECAL_SCALEFACTOR",
259  "JETMET_ECAL_SCALEFACTOR.FK_VERSION",
260  m_omdsReader.basicQuery( "JETMET_ECAL",
261  rctSchema,
262  "PAREM_CONF",
263  "PAREM_CONF.PAREM_KEY",
264  paremKeyResults ) ) ;
265 
266  if( jetmetEcalResults.queryFailed() ) // check query successful
267  {
268  edm::LogError( "L1-O2O" ) << "Problem with JetmetEcal key." ;
269  return boost::shared_ptr< L1RCTParameters >() ;
270  }
271 
272 // std::cout << "jetmetEcal " ;
273  std::vector< double > jetmetEcalScaleFactors ;
274  fillScaleFactors( jetmetEcalResults, jetmetEcalScaleFactors ) ;
275 
276  // ~~~~~~~~~ JetMET HCAL scale factors ~~~~~~~~~
277 
278  // select scalefactor, fk_rct_eta from jetmet_hcal_scalefactor where
279  // jetmet_hcal_scalefactor.fk_version =
280  // (select jetmet_hcal from parem_conf where parem_conf.parem_key =
281  // (select rct_parameter from rct_conf where rct_conf.rct_key=
282  // 'rct_cmssw_def'));
283 
284  l1t::OMDSReader::QueryResults jetmetHcalResults =
286  scaleFactorQueryStrings,
287  rctSchema,
288  "JETMET_HCAL_SCALEFACTOR",
289  "JETMET_HCAL_SCALEFACTOR.FK_VERSION",
290  m_omdsReader.basicQuery( "JETMET_HCAL",
291  rctSchema,
292  "PAREM_CONF",
293  "PAREM_CONF.PAREM_KEY",
294  paremKeyResults ) ) ;
295 
296  if( jetmetHcalResults.queryFailed() ) // check query successful
297  {
298  edm::LogError( "L1-O2O" ) << "Problem with JetmetHcal key." ;
299  return boost::shared_ptr< L1RCTParameters >() ;
300  }
301 
302 // std::cout << "jetmetHcal " ;
303  std::vector< double > jetmetHcalScaleFactors ;
304  fillScaleFactors( jetmetHcalResults, jetmetHcalScaleFactors ) ;
305 
306 
307 
308  //Lindsay variables
309 
310  /*
311  std::vector< std::vector< double > > hcalCalibScaleFactors ;
312  std::vector< std::vector< double > > hcalCalibHighScaleFactors ;
313  std::vector< std::vector< double > > ecalCalibScaleFactors ;
314  std::vector< std::vector< double > > crossTermsScaleFactors ;
315  */
316  std::vector< double > lowHoverE_smear, highHoverE_smear ;
317  std::vector< double > hcalCalibScaleFactors,ecalCalibScaleFactors;
318  std::vector< double > hcalCalibHighScaleFactors,crossTermsScaleFactors;
319 
320  if(useCorr) { //lindsay corrections
321 
322  std::vector< std::string > scaleFactorQuery3Strings ;
323  scaleFactorQuery3Strings.push_back( "SCALEFACTOR" ) ;
324  scaleFactorQuery3Strings.push_back( "SF2" ) ;
325  scaleFactorQuery3Strings.push_back( "SF3" ) ;
326  scaleFactorQuery3Strings.push_back( "FK_RCT_ETA" ) ;
327 
328  l1t::OMDSReader::QueryResults hcalCalibResults =
330  scaleFactorQuery3Strings,
331  rctSchema,
332  "HCAL_CALIB_FACTOR",
333  "HCAL_CALIB_FACTOR.VERSION",
334  m_omdsReader.basicQuery( "HCAL_CALIB_VERSION",
335  rctSchema,
336  "PAREM_CONF",
337  "PAREM_CONF.PAREM_KEY",
338  paremKeyResults ) ) ;
339 
340  if( hcalCalibResults.queryFailed() ) {// check query successful
341 
342  edm::LogError( "L1-O2O" ) << "Problem with JetmetHcal key." ;
343  return boost::shared_ptr< L1RCTParameters >() ;
344  }
345 
346 // std::cout << "jetmetHcal " ;
347 
348  fillScaleFactors( hcalCalibResults, hcalCalibScaleFactors, 3 ) ;
349 
350  l1t::OMDSReader::QueryResults hcalCalibHighResults =
352  scaleFactorQuery3Strings,
353  rctSchema,
354  "HCAL_CALIB_HIGH_FACTOR",
355  "HCAL_CALIB_HIGH_FACTOR.VERSION",
356  m_omdsReader.basicQuery( "HCAL_CALIB_HIGH_VERSION",
357  rctSchema,
358  "PAREM_CONF",
359  "PAREM_CONF.PAREM_KEY",
360  paremKeyResults ) ) ;
361 
362  if( hcalCalibHighResults.queryFailed() ) // check query successful
363  {
364  edm::LogError( "L1-O2O" ) << "Problem with hcalHigh key." ;
365  return boost::shared_ptr< L1RCTParameters >() ;
366  }
367 
368 
369 
370  fillScaleFactors( hcalCalibHighResults, hcalCalibHighScaleFactors,3 ) ;
371 
372  l1t::OMDSReader::QueryResults ecalCalibResults =
374  scaleFactorQuery3Strings,
375  rctSchema,
376  "ECAL_CALIB_FACTOR",
377  "ECAL_CALIB_FACTOR.VERSION",
378  m_omdsReader.basicQuery( "ECAL_CALIB_VERSION",
379  rctSchema,
380  "PAREM_CONF",
381  "PAREM_CONF.PAREM_KEY",
382  paremKeyResults ) ) ;
383 
384  if( ecalCalibResults.queryFailed() ) // check query successful
385  {
386  edm::LogError( "L1-O2O" ) << "Problem with ecal calib key." ;
387  return boost::shared_ptr< L1RCTParameters >() ;
388  }
389 
390 
391  fillScaleFactors( ecalCalibResults, ecalCalibScaleFactors,3 ) ;
392 
393 
394  std::vector< std::string > scaleFactorQuery6Strings ;
395  scaleFactorQuery6Strings.push_back( "SCALEFACTOR" ) ;
396  scaleFactorQuery6Strings.push_back( "SF2" ) ;
397  scaleFactorQuery6Strings.push_back( "SF3" ) ;
398  scaleFactorQuery6Strings.push_back( "SF4" ) ;
399  scaleFactorQuery6Strings.push_back( "SF5" ) ;
400  scaleFactorQuery6Strings.push_back( "SF6" ) ;
401  scaleFactorQuery6Strings.push_back( "FK_RCT_ETA" ) ;
402  l1t::OMDSReader::QueryResults crossTermResults =
404  scaleFactorQuery6Strings,
405  rctSchema,
406  "CROSS_TERMS_FACTOR",
407  "CROSS_TERMS_FACTOR.VERSION",
408  m_omdsReader.basicQuery( "CROSS_TERMS_VERSION",
409  rctSchema,
410  "PAREM_CONF",
411  "PAREM_CONF.PAREM_KEY",
412  paremKeyResults ) ) ;
413 
414  if( crossTermResults.queryFailed() ) // check query successful
415  {
416  edm::LogError( "L1-O2O" ) << "Problem with crossTerms key." ;
417  return boost::shared_ptr< L1RCTParameters >() ;
418  }
419 
420  fillScaleFactors( crossTermResults, crossTermsScaleFactors,6 ) ;
421 
422  l1t::OMDSReader::QueryResults hoveresmearhighResults =
424  scaleFactorQueryStrings,
425  rctSchema,
426  "H_OVER_E_SMEAR_HIGH_FACTOR",
427  "H_OVER_E_SMEAR_HIGH_FACTOR.FK_VERSION",
428  m_omdsReader.basicQuery( "H_OVER_E_SMEAR_HIGH_VERSION",
429  rctSchema,
430  "PAREM_CONF",
431  "PAREM_CONF.PAREM_KEY",
432  paremKeyResults ) ) ;
433 
434  if( hoveresmearhighResults.queryFailed() ) // check query successful
435  {
436  edm::LogError( "L1-O2O" ) << "Problem with low h over e smear key." ;
437  return boost::shared_ptr< L1RCTParameters >() ;
438  }
439 
440 // std::cout << "egammaEcal " ;
441  fillScaleFactors( hoveresmearhighResults, highHoverE_smear ) ;
442 
443 
444  l1t::OMDSReader::QueryResults hoveresmearlowResults =
446  scaleFactorQueryStrings,
447  rctSchema,
448  "H_OVER_E_SMEAR_LOW_FACTOR",
449  "H_OVER_E_SMEAR_LOW_FACTOR.FK_VERSION",
450  m_omdsReader.basicQuery( "H_OVER_E_SMEAR_LOW_VERSION",
451  rctSchema,
452  "PAREM_CONF",
453  "PAREM_CONF.PAREM_KEY",
454  paremKeyResults ) ) ;
455 
456  if( hoveresmearlowResults.queryFailed() ) // check query successful
457  {
458  edm::LogError( "L1-O2O" ) << "Problem with low h over e smear key." ;
459  return boost::shared_ptr< L1RCTParameters >() ;
460  }
461 
462 // std::cout << "egammaEcal " ;
463  fillScaleFactors( hoveresmearlowResults, lowHoverE_smear ) ;
464  }
465 
466 
467  //~~~~~~~~~ Instantiate new L1RCTParameters object. ~~~~~~~~~
468 
469  // Default objects for Lindsey
470 
471  return boost::shared_ptr< L1RCTParameters >(
472  new L1RCTParameters( eGammaLSB,
473  jetMETLSB,
474  eMinForFGCut,
475  eMaxForFGCut,
476  hOeCut,
477  eMinForHoECut,
478  eMaxForHoECut,
479  hMinForHoECut,
480  eActivityCut,
481  hActivityCut,
482  (unsigned int) eicIsolationThreshold,
483  (int) jscQuietThreshBarrel,
484  (int) jscQuietThreshEndcap,
485  noiseVetoHB,
486  noiseVetoHEplus,
487  noiseVetoHEminus,
488  useCorr, // useLindsey
489  egammaEcalScaleFactors,
490  egammaHcalScaleFactors,
491  jetmetEcalScaleFactors,
492  jetmetHcalScaleFactors,
493  ecalCalibScaleFactors,
494  hcalCalibScaleFactors,
495  hcalCalibHighScaleFactors,
496  crossTermsScaleFactors,
497  lowHoverE_smear,
498  highHoverE_smear
499  ) ) ;
500 }
const QueryResults singleAttribute(const T &data) const
Definition: OMDSReader.h:296
void fillScaleFactors(const l1t::OMDSReader::QueryResults &results, std::vector< double > &output, int nfactor=1)
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