42 virtual boost::shared_ptr< L1RCTParameters >
newObject(
47 std::vector< double >&
output,
int nfactor = 1 ) ;
88 boost::shared_ptr< L1RCTParameters >
91 using namespace edm::es;
108 std::vector< std::string > queryStrings ;
109 queryStrings.push_back(
"EGAMMA_LSB" ) ;
110 queryStrings.push_back(
"JETMET_LSB" ) ;
111 queryStrings.push_back(
"E_MIN_FOR_FG_CUT" ) ;
112 queryStrings.push_back(
"E_MAX_FOR_FG_CUT" ) ;
113 queryStrings.push_back(
"H_OVER_E_CUT" ) ;
114 queryStrings.push_back(
"E_MIN_FOR_H_OVER_E_CUT" ) ;
115 queryStrings.push_back(
"E_MAX_FOR_H_OVER_E_CUT" ) ;
116 queryStrings.push_back(
"H_MIN_FOR_H_OVER_E_CUT" ) ;
117 queryStrings.push_back(
"E_ACTIVITY_CUT" ) ;
118 queryStrings.push_back(
"H_ACTIVITY_CUT" ) ;
119 queryStrings.push_back(
"EIC_ISOLATION_THRESHOLD" ) ;
120 queryStrings.push_back(
"JSC_QUIET_THRESHOLD_BARREL" ) ;
121 queryStrings.push_back(
"JSC_QUIET_THRESHOLD_ENDCAP" ) ;
122 queryStrings.push_back(
"NOISEVETOHB" ) ;
123 queryStrings.push_back(
"NOISEVETOHEPLUS" ) ;
124 queryStrings.push_back(
"NOISEVETOHEMINUS" ) ;
125 queryStrings.push_back(
"USECORR" );
130 "PAREM_CONF.PAREM_KEY",
133 if( paremResults.queryFailed() ||
134 paremResults.numberRows() != 1 )
136 edm::LogError(
"L1-O2O" ) <<
"Problem with L1RCTParameters key." ;
137 return boost::shared_ptr< L1RCTParameters >() ;
140 double eGammaLSB, jetMETLSB, eMinForFGCut, eMaxForFGCut, hOeCut ;
141 double eMinForHoECut, eMaxForHoECut, hMinForHoECut ;
142 double eActivityCut, hActivityCut ;
143 double jscQuietThreshBarrel, jscQuietThreshEndcap, eicIsolationThreshold ;
144 bool noiseVetoHB, noiseVetoHEplus, noiseVetoHEminus, useCorr ;
146 paremResults.fillVariable(
"EGAMMA_LSB", eGammaLSB ) ;
147 paremResults.fillVariable(
"JETMET_LSB", jetMETLSB ) ;
148 paremResults.fillVariable(
"E_MIN_FOR_FG_CUT", eMinForFGCut ) ;
149 paremResults.fillVariable(
"E_MAX_FOR_FG_CUT", eMaxForFGCut ) ;
150 paremResults.fillVariable(
"H_OVER_E_CUT", hOeCut ) ;
151 paremResults.fillVariable(
"E_MIN_FOR_H_OVER_E_CUT", eMinForHoECut ) ;
152 paremResults.fillVariable(
"E_MAX_FOR_H_OVER_E_CUT", eMaxForHoECut ) ;
153 paremResults.fillVariable(
"H_MIN_FOR_H_OVER_E_CUT", hMinForHoECut ) ;
154 paremResults.fillVariable(
"E_ACTIVITY_CUT", eActivityCut ) ;
155 paremResults.fillVariable(
"H_ACTIVITY_CUT", hActivityCut ) ;
156 paremResults.fillVariable(
"JSC_QUIET_THRESHOLD_BARREL",
157 jscQuietThreshBarrel ) ;
158 paremResults.fillVariable(
"JSC_QUIET_THRESHOLD_ENDCAP",
159 jscQuietThreshEndcap ) ;
160 paremResults.fillVariable(
"EIC_ISOLATION_THRESHOLD",
161 eicIsolationThreshold ) ;
162 paremResults.fillVariable(
"NOISEVETOHB", noiseVetoHB ) ;
163 paremResults.fillVariable(
"NOISEVETOHEPLUS", noiseVetoHEplus ) ;
164 paremResults.fillVariable(
"NOISEVETOHEMINUS", noiseVetoHEminus ) ;
165 paremResults.fillVariable(
"USECORR", useCorr ) ;
191 std::vector< std::string > scaleFactorQueryStrings ;
192 scaleFactorQueryStrings.push_back(
"SCALEFACTOR" ) ;
193 scaleFactorQueryStrings.push_back(
"FK_RCT_ETA" ) ;
197 scaleFactorQueryStrings,
199 "EGAMMA_ECAL_SCALEFACTOR",
200 "EGAMMA_ECAL_SCALEFACTOR.FK_VERSION",
204 "PAREM_CONF.PAREM_KEY",
205 paremKeyResults ) ) ;
207 if( egammaEcalResults.queryFailed() )
209 edm::LogError(
"L1-O2O" ) <<
"Problem with EgammaEcal key." ;
210 return boost::shared_ptr< L1RCTParameters >() ;
214 std::vector< double > egammaEcalScaleFactors ;
227 scaleFactorQueryStrings,
229 "EGAMMA_HCAL_SCALEFACTOR",
230 "EGAMMA_HCAL_SCALEFACTOR.FK_VERSION",
234 "PAREM_CONF.PAREM_KEY",
235 paremKeyResults ) ) ;
237 if( egammaHcalResults.queryFailed() )
239 edm::LogError(
"L1-O2O" ) <<
"Problem with EgammaHcal key." ;
240 return boost::shared_ptr< L1RCTParameters >() ;
244 std::vector< double > egammaHcalScaleFactors ;
257 scaleFactorQueryStrings,
259 "JETMET_ECAL_SCALEFACTOR",
260 "JETMET_ECAL_SCALEFACTOR.FK_VERSION",
264 "PAREM_CONF.PAREM_KEY",
265 paremKeyResults ) ) ;
267 if( jetmetEcalResults.queryFailed() )
269 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetEcal key." ;
270 return boost::shared_ptr< L1RCTParameters >() ;
274 std::vector< double > jetmetEcalScaleFactors ;
287 scaleFactorQueryStrings,
289 "JETMET_HCAL_SCALEFACTOR",
290 "JETMET_HCAL_SCALEFACTOR.FK_VERSION",
294 "PAREM_CONF.PAREM_KEY",
295 paremKeyResults ) ) ;
297 if( jetmetHcalResults.queryFailed() )
299 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetHcal key." ;
300 return boost::shared_ptr< L1RCTParameters >() ;
304 std::vector< double > jetmetHcalScaleFactors ;
317 std::vector< double > lowHoverE_smear, highHoverE_smear ;
318 std::vector< double > hcalCalibScaleFactors,ecalCalibScaleFactors;
319 std::vector< double > hcalCalibHighScaleFactors,crossTermsScaleFactors;
323 std::vector< std::string > scaleFactorQuery3Strings ;
324 scaleFactorQuery3Strings.push_back(
"SCALEFACTOR" ) ;
325 scaleFactorQuery3Strings.push_back(
"SF2" ) ;
326 scaleFactorQuery3Strings.push_back(
"SF3" ) ;
327 scaleFactorQuery3Strings.push_back(
"FK_RCT_ETA" ) ;
331 scaleFactorQuery3Strings,
334 "HCAL_CALIB_FACTOR.VERSION",
338 "PAREM_CONF.PAREM_KEY",
339 paremKeyResults ) ) ;
343 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetHcal key." ;
344 return boost::shared_ptr< L1RCTParameters >() ;
353 scaleFactorQuery3Strings,
355 "HCAL_CALIB_HIGH_FACTOR",
356 "HCAL_CALIB_HIGH_FACTOR.VERSION",
360 "PAREM_CONF.PAREM_KEY",
361 paremKeyResults ) ) ;
366 return boost::shared_ptr< L1RCTParameters >() ;
375 scaleFactorQuery3Strings,
378 "ECAL_CALIB_FACTOR.VERSION",
382 "PAREM_CONF.PAREM_KEY",
383 paremKeyResults ) ) ;
387 edm::LogError(
"L1-O2O" ) <<
"Problem with ecal calib key." ;
388 return boost::shared_ptr< L1RCTParameters >() ;
395 std::vector< std::string > scaleFactorQuery6Strings ;
396 scaleFactorQuery6Strings.push_back(
"SCALEFACTOR" ) ;
397 scaleFactorQuery6Strings.push_back(
"SF2" ) ;
398 scaleFactorQuery6Strings.push_back(
"SF3" ) ;
399 scaleFactorQuery6Strings.push_back(
"SF4" ) ;
400 scaleFactorQuery6Strings.push_back(
"SF5" ) ;
401 scaleFactorQuery6Strings.push_back(
"SF6" ) ;
402 scaleFactorQuery6Strings.push_back(
"FK_RCT_ETA" ) ;
405 scaleFactorQuery6Strings,
407 "CROSS_TERMS_FACTOR",
408 "CROSS_TERMS_FACTOR.VERSION",
412 "PAREM_CONF.PAREM_KEY",
413 paremKeyResults ) ) ;
417 edm::LogError(
"L1-O2O" ) <<
"Problem with crossTerms key." ;
418 return boost::shared_ptr< L1RCTParameters >() ;
425 scaleFactorQueryStrings,
427 "H_OVER_E_SMEAR_HIGH_FACTOR",
428 "H_OVER_E_SMEAR_HIGH_FACTOR.FK_VERSION",
432 "PAREM_CONF.PAREM_KEY",
433 paremKeyResults ) ) ;
437 edm::LogError(
"L1-O2O" ) <<
"Problem with low h over e smear key." ;
438 return boost::shared_ptr< L1RCTParameters >() ;
447 scaleFactorQueryStrings,
449 "H_OVER_E_SMEAR_LOW_FACTOR",
450 "H_OVER_E_SMEAR_LOW_FACTOR.FK_VERSION",
454 "PAREM_CONF.PAREM_KEY",
455 paremKeyResults ) ) ;
459 edm::LogError(
"L1-O2O" ) <<
"Problem with low h over e smear key." ;
460 return boost::shared_ptr< L1RCTParameters >() ;
472 return boost::shared_ptr< L1RCTParameters >(
483 (
unsigned int) eicIsolationThreshold,
484 (
int) jscQuietThreshBarrel,
485 (
int) jscQuietThreshEndcap,
490 egammaEcalScaleFactors,
491 egammaHcalScaleFactors,
492 jetmetEcalScaleFactors,
493 jetmetHcalScaleFactors,
494 ecalCalibScaleFactors,
495 hcalCalibScaleFactors,
496 hcalCalibHighScaleFactors,
497 crossTermsScaleFactors,
510 std::vector< double >&
output,
int nfactors )
512 if( (nfactors < 1) || (nfactors > 6)){
513 edm::LogError(
"L1-O2O" ) <<
"invalid number of factors in scale factors fill";
517 std::vector< std::string > scaleFactorQuery6Strings ;
518 scaleFactorQuery6Strings.push_back(
"SCALEFACTOR" ) ;
519 scaleFactorQuery6Strings.push_back(
"SF2" ) ;
520 scaleFactorQuery6Strings.push_back(
"SF3" ) ;
521 scaleFactorQuery6Strings.push_back(
"SF4" ) ;
522 scaleFactorQuery6Strings.push_back(
"SF5" ) ;
523 scaleFactorQuery6Strings.push_back(
"SF6" ) ;
528 std::vector <double> sfTmp[100] ;
539 for(
int nf = 0; nf < nfactors; nf++){
545 for(
int nf = 0; nf< nfactors; nf++)
547 sfTmp[ieta-1].push_back(sf[nf]);
556 for(
short i = 0 ;
i < maxBin ; ++
i )
558 for(
short nf = 0; nf < nfactors; nf++)
559 output.push_back( sfTmp[
i ].at(nf) ) ;
const QueryResults singleAttribute(const T &data) const
~L1RCTParametersOnlineProd()
virtual boost::shared_ptr< L1RCTParameters > newObject(const std::string &objectKey)
void fillScaleFactors(const l1t::OMDSReader::QueryResults &results, std::vector< double > &output, int nfactor=1)
bool fillVariableFromRow(const std::string &columnName, int rowNumber, T &outputVariable) const
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
l1t::OMDSReader m_omdsReader
L1RCTParametersOnlineProd(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)