41 virtual boost::shared_ptr< L1RCTParameters >
newObject(
46 std::vector< double >&
output,
int nfactor = 1 ) ;
87 boost::shared_ptr< L1RCTParameters >
90 using namespace edm::es;
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" );
129 "PAREM_CONF.PAREM_KEY",
132 if( paremResults.queryFailed() ||
133 paremResults.numberRows() != 1 )
135 edm::LogError(
"L1-O2O" ) <<
"Problem with L1RCTParameters key." ;
136 return boost::shared_ptr< L1RCTParameters >() ;
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 ;
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 ) ;
190 std::vector< std::string > scaleFactorQueryStrings ;
191 scaleFactorQueryStrings.push_back(
"SCALEFACTOR" ) ;
192 scaleFactorQueryStrings.push_back(
"FK_RCT_ETA" ) ;
196 scaleFactorQueryStrings,
198 "EGAMMA_ECAL_SCALEFACTOR",
199 "EGAMMA_ECAL_SCALEFACTOR.FK_VERSION",
203 "PAREM_CONF.PAREM_KEY",
204 paremKeyResults ) ) ;
206 if( egammaEcalResults.queryFailed() )
208 edm::LogError(
"L1-O2O" ) <<
"Problem with EgammaEcal key." ;
209 return boost::shared_ptr< L1RCTParameters >() ;
213 std::vector< double > egammaEcalScaleFactors ;
226 scaleFactorQueryStrings,
228 "EGAMMA_HCAL_SCALEFACTOR",
229 "EGAMMA_HCAL_SCALEFACTOR.FK_VERSION",
233 "PAREM_CONF.PAREM_KEY",
234 paremKeyResults ) ) ;
236 if( egammaHcalResults.queryFailed() )
238 edm::LogError(
"L1-O2O" ) <<
"Problem with EgammaHcal key." ;
239 return boost::shared_ptr< L1RCTParameters >() ;
243 std::vector< double > egammaHcalScaleFactors ;
256 scaleFactorQueryStrings,
258 "JETMET_ECAL_SCALEFACTOR",
259 "JETMET_ECAL_SCALEFACTOR.FK_VERSION",
263 "PAREM_CONF.PAREM_KEY",
264 paremKeyResults ) ) ;
266 if( jetmetEcalResults.queryFailed() )
268 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetEcal key." ;
269 return boost::shared_ptr< L1RCTParameters >() ;
273 std::vector< double > jetmetEcalScaleFactors ;
286 scaleFactorQueryStrings,
288 "JETMET_HCAL_SCALEFACTOR",
289 "JETMET_HCAL_SCALEFACTOR.FK_VERSION",
293 "PAREM_CONF.PAREM_KEY",
294 paremKeyResults ) ) ;
296 if( jetmetHcalResults.queryFailed() )
298 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetHcal key." ;
299 return boost::shared_ptr< L1RCTParameters >() ;
303 std::vector< double > jetmetHcalScaleFactors ;
316 std::vector< double > lowHoverE_smear, highHoverE_smear ;
317 std::vector< double > hcalCalibScaleFactors,ecalCalibScaleFactors;
318 std::vector< double > hcalCalibHighScaleFactors,crossTermsScaleFactors;
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" ) ;
330 scaleFactorQuery3Strings,
333 "HCAL_CALIB_FACTOR.VERSION",
337 "PAREM_CONF.PAREM_KEY",
338 paremKeyResults ) ) ;
342 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetHcal key." ;
343 return boost::shared_ptr< L1RCTParameters >() ;
352 scaleFactorQuery3Strings,
354 "HCAL_CALIB_HIGH_FACTOR",
355 "HCAL_CALIB_HIGH_FACTOR.VERSION",
359 "PAREM_CONF.PAREM_KEY",
360 paremKeyResults ) ) ;
365 return boost::shared_ptr< L1RCTParameters >() ;
374 scaleFactorQuery3Strings,
377 "ECAL_CALIB_FACTOR.VERSION",
381 "PAREM_CONF.PAREM_KEY",
382 paremKeyResults ) ) ;
386 edm::LogError(
"L1-O2O" ) <<
"Problem with ecal calib key." ;
387 return boost::shared_ptr< L1RCTParameters >() ;
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" ) ;
404 scaleFactorQuery6Strings,
406 "CROSS_TERMS_FACTOR",
407 "CROSS_TERMS_FACTOR.VERSION",
411 "PAREM_CONF.PAREM_KEY",
412 paremKeyResults ) ) ;
416 edm::LogError(
"L1-O2O" ) <<
"Problem with crossTerms key." ;
417 return boost::shared_ptr< L1RCTParameters >() ;
424 scaleFactorQueryStrings,
426 "H_OVER_E_SMEAR_HIGH_FACTOR",
427 "H_OVER_E_SMEAR_HIGH_FACTOR.FK_VERSION",
431 "PAREM_CONF.PAREM_KEY",
432 paremKeyResults ) ) ;
436 edm::LogError(
"L1-O2O" ) <<
"Problem with low h over e smear key." ;
437 return boost::shared_ptr< L1RCTParameters >() ;
446 scaleFactorQueryStrings,
448 "H_OVER_E_SMEAR_LOW_FACTOR",
449 "H_OVER_E_SMEAR_LOW_FACTOR.FK_VERSION",
453 "PAREM_CONF.PAREM_KEY",
454 paremKeyResults ) ) ;
458 edm::LogError(
"L1-O2O" ) <<
"Problem with low h over e smear key." ;
459 return boost::shared_ptr< L1RCTParameters >() ;
471 return boost::shared_ptr< L1RCTParameters >(
482 (
unsigned int) eicIsolationThreshold,
483 (
int) jscQuietThreshBarrel,
484 (
int) jscQuietThreshEndcap,
489 egammaEcalScaleFactors,
490 egammaHcalScaleFactors,
491 jetmetEcalScaleFactors,
492 jetmetHcalScaleFactors,
493 ecalCalibScaleFactors,
494 hcalCalibScaleFactors,
495 hcalCalibHighScaleFactors,
496 crossTermsScaleFactors,
509 std::vector< double >&
output,
int nfactors )
511 if( (nfactors < 1) || (nfactors > 6)){
512 edm::LogError(
"L1-O2O" ) <<
"invalid number of factors in scale factors fill";
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" ) ;
527 std::vector <double> sfTmp[100] ;
538 for(
int nf = 0; nf < nfactors; nf++){
544 for(
int nf = 0; nf< nfactors; nf++)
546 sfTmp[ieta-1].push_back(sf[nf]);
555 for(
short i = 0 ;
i < maxBin ; ++
i )
557 for(
short nf = 0; nf < nfactors; nf++)
558 output.push_back( sfTmp[
i ].at(nf) ) ;
const QueryResults singleAttribute(const T &data) const
~L1RCTParametersOnlineProd()
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="")
l1t::OMDSReader m_omdsReader
L1RCTParametersOnlineProd(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
virtual boost::shared_ptr< L1RCTParameters > newObject(const std::string &objectKey) override