41 std::unique_ptr< L1RCTParameters >
newObject(
46 std::vector< double >&
output,
int nfactor = 1 ) ;
87 std::unique_ptr< L1RCTParameters >
105 std::vector< std::string > queryStrings ;
106 queryStrings.push_back(
"EGAMMA_LSB" ) ;
107 queryStrings.push_back(
"JETMET_LSB" ) ;
108 queryStrings.push_back(
"E_MIN_FOR_FG_CUT" ) ;
109 queryStrings.push_back(
"E_MAX_FOR_FG_CUT" ) ;
110 queryStrings.push_back(
"H_OVER_E_CUT" ) ;
111 queryStrings.push_back(
"E_MIN_FOR_H_OVER_E_CUT" ) ;
112 queryStrings.push_back(
"E_MAX_FOR_H_OVER_E_CUT" ) ;
113 queryStrings.push_back(
"H_MIN_FOR_H_OVER_E_CUT" ) ;
114 queryStrings.push_back(
"E_ACTIVITY_CUT" ) ;
115 queryStrings.push_back(
"H_ACTIVITY_CUT" ) ;
116 queryStrings.push_back(
"EIC_ISOLATION_THRESHOLD" ) ;
117 queryStrings.push_back(
"JSC_QUIET_THRESHOLD_BARREL" ) ;
118 queryStrings.push_back(
"JSC_QUIET_THRESHOLD_ENDCAP" ) ;
119 queryStrings.push_back(
"NOISEVETOHB" ) ;
120 queryStrings.push_back(
"NOISEVETOHEPLUS" ) ;
121 queryStrings.push_back(
"NOISEVETOHEMINUS" ) ;
122 queryStrings.push_back(
"USECORR" );
127 "PAREM_CONF.PAREM_KEY",
133 edm::LogError(
"L1-O2O" ) <<
"Problem with L1RCTParameters key." ;
134 return std::unique_ptr< L1RCTParameters >() ;
137 double eGammaLSB, jetMETLSB, eMinForFGCut, eMaxForFGCut, hOeCut ;
138 double eMinForHoECut, eMaxForHoECut, hMinForHoECut ;
139 double eActivityCut, hActivityCut ;
140 double jscQuietThreshBarrel, jscQuietThreshEndcap, eicIsolationThreshold ;
141 bool noiseVetoHB, noiseVetoHEplus, noiseVetoHEminus, useCorr ;
145 paremResults.
fillVariable(
"E_MIN_FOR_FG_CUT", eMinForFGCut ) ;
146 paremResults.
fillVariable(
"E_MAX_FOR_FG_CUT", eMaxForFGCut ) ;
148 paremResults.
fillVariable(
"E_MIN_FOR_H_OVER_E_CUT", eMinForHoECut ) ;
149 paremResults.
fillVariable(
"E_MAX_FOR_H_OVER_E_CUT", eMaxForHoECut ) ;
150 paremResults.
fillVariable(
"H_MIN_FOR_H_OVER_E_CUT", hMinForHoECut ) ;
151 paremResults.
fillVariable(
"E_ACTIVITY_CUT", eActivityCut ) ;
152 paremResults.
fillVariable(
"H_ACTIVITY_CUT", hActivityCut ) ;
153 paremResults.
fillVariable(
"JSC_QUIET_THRESHOLD_BARREL",
154 jscQuietThreshBarrel ) ;
155 paremResults.
fillVariable(
"JSC_QUIET_THRESHOLD_ENDCAP",
156 jscQuietThreshEndcap ) ;
158 eicIsolationThreshold ) ;
159 paremResults.
fillVariable(
"NOISEVETOHB", noiseVetoHB ) ;
160 paremResults.
fillVariable(
"NOISEVETOHEPLUS", noiseVetoHEplus ) ;
161 paremResults.
fillVariable(
"NOISEVETOHEMINUS", noiseVetoHEminus ) ;
188 std::vector< std::string > scaleFactorQueryStrings ;
189 scaleFactorQueryStrings.push_back(
"SCALEFACTOR" ) ;
190 scaleFactorQueryStrings.push_back(
"FK_RCT_ETA" ) ;
194 scaleFactorQueryStrings,
196 "EGAMMA_ECAL_SCALEFACTOR",
197 "EGAMMA_ECAL_SCALEFACTOR.FK_VERSION",
201 "PAREM_CONF.PAREM_KEY",
202 paremKeyResults ) ) ;
206 edm::LogError(
"L1-O2O" ) <<
"Problem with EgammaEcal key." ;
207 return std::unique_ptr< L1RCTParameters >() ;
211 std::vector< double > egammaEcalScaleFactors ;
224 scaleFactorQueryStrings,
226 "EGAMMA_HCAL_SCALEFACTOR",
227 "EGAMMA_HCAL_SCALEFACTOR.FK_VERSION",
231 "PAREM_CONF.PAREM_KEY",
232 paremKeyResults ) ) ;
236 edm::LogError(
"L1-O2O" ) <<
"Problem with EgammaHcal key." ;
237 return std::unique_ptr< L1RCTParameters >() ;
241 std::vector< double > egammaHcalScaleFactors ;
254 scaleFactorQueryStrings,
256 "JETMET_ECAL_SCALEFACTOR",
257 "JETMET_ECAL_SCALEFACTOR.FK_VERSION",
261 "PAREM_CONF.PAREM_KEY",
262 paremKeyResults ) ) ;
266 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetEcal key." ;
267 return std::unique_ptr< L1RCTParameters >() ;
271 std::vector< double > jetmetEcalScaleFactors ;
284 scaleFactorQueryStrings,
286 "JETMET_HCAL_SCALEFACTOR",
287 "JETMET_HCAL_SCALEFACTOR.FK_VERSION",
291 "PAREM_CONF.PAREM_KEY",
292 paremKeyResults ) ) ;
296 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetHcal key." ;
297 return std::unique_ptr< L1RCTParameters >() ;
301 std::vector< double > jetmetHcalScaleFactors ;
314 std::vector< double > lowHoverE_smear, highHoverE_smear ;
315 std::vector< double > hcalCalibScaleFactors,ecalCalibScaleFactors;
316 std::vector< double > hcalCalibHighScaleFactors,crossTermsScaleFactors;
320 std::vector< std::string > scaleFactorQuery3Strings ;
321 scaleFactorQuery3Strings.push_back(
"SCALEFACTOR" ) ;
322 scaleFactorQuery3Strings.push_back(
"SF2" ) ;
323 scaleFactorQuery3Strings.push_back(
"SF3" ) ;
324 scaleFactorQuery3Strings.push_back(
"FK_RCT_ETA" ) ;
328 scaleFactorQuery3Strings,
331 "HCAL_CALIB_FACTOR.VERSION",
335 "PAREM_CONF.PAREM_KEY",
336 paremKeyResults ) ) ;
340 edm::LogError(
"L1-O2O" ) <<
"Problem with JetmetHcal key." ;
341 return std::unique_ptr< L1RCTParameters >() ;
350 scaleFactorQuery3Strings,
352 "HCAL_CALIB_HIGH_FACTOR",
353 "HCAL_CALIB_HIGH_FACTOR.VERSION",
357 "PAREM_CONF.PAREM_KEY",
358 paremKeyResults ) ) ;
363 return std::unique_ptr< L1RCTParameters >() ;
372 scaleFactorQuery3Strings,
375 "ECAL_CALIB_FACTOR.VERSION",
379 "PAREM_CONF.PAREM_KEY",
380 paremKeyResults ) ) ;
384 edm::LogError(
"L1-O2O" ) <<
"Problem with ecal calib key." ;
385 return std::unique_ptr< L1RCTParameters >() ;
392 std::vector< std::string > scaleFactorQuery6Strings ;
393 scaleFactorQuery6Strings.push_back(
"SCALEFACTOR" ) ;
394 scaleFactorQuery6Strings.push_back(
"SF2" ) ;
395 scaleFactorQuery6Strings.push_back(
"SF3" ) ;
396 scaleFactorQuery6Strings.push_back(
"SF4" ) ;
397 scaleFactorQuery6Strings.push_back(
"SF5" ) ;
398 scaleFactorQuery6Strings.push_back(
"SF6" ) ;
399 scaleFactorQuery6Strings.push_back(
"FK_RCT_ETA" ) ;
402 scaleFactorQuery6Strings,
404 "CROSS_TERMS_FACTOR",
405 "CROSS_TERMS_FACTOR.VERSION",
409 "PAREM_CONF.PAREM_KEY",
410 paremKeyResults ) ) ;
414 edm::LogError(
"L1-O2O" ) <<
"Problem with crossTerms key." ;
415 return std::unique_ptr< L1RCTParameters >() ;
422 scaleFactorQueryStrings,
424 "H_OVER_E_SMEAR_HIGH_FACTOR",
425 "H_OVER_E_SMEAR_HIGH_FACTOR.FK_VERSION",
429 "PAREM_CONF.PAREM_KEY",
430 paremKeyResults ) ) ;
434 edm::LogError(
"L1-O2O" ) <<
"Problem with low h over e smear key." ;
435 return std::unique_ptr< L1RCTParameters >() ;
444 scaleFactorQueryStrings,
446 "H_OVER_E_SMEAR_LOW_FACTOR",
447 "H_OVER_E_SMEAR_LOW_FACTOR.FK_VERSION",
451 "PAREM_CONF.PAREM_KEY",
452 paremKeyResults ) ) ;
456 edm::LogError(
"L1-O2O" ) <<
"Problem with low h over e smear key." ;
457 return std::unique_ptr< L1RCTParameters >() ;
469 return std::make_unique< L1RCTParameters >(
480 (
unsigned int) eicIsolationThreshold,
481 (
int) jscQuietThreshBarrel,
482 (
int) jscQuietThreshEndcap,
487 egammaEcalScaleFactors,
488 egammaHcalScaleFactors,
489 jetmetEcalScaleFactors,
490 jetmetHcalScaleFactors,
491 ecalCalibScaleFactors,
492 hcalCalibScaleFactors,
493 hcalCalibHighScaleFactors,
494 crossTermsScaleFactors,
507 std::vector< double >&
output,
int nfactors )
509 if( (nfactors < 1) || (nfactors > 6)){
510 edm::LogError(
"L1-O2O" ) <<
"invalid number of factors in scale factors fill";
514 std::vector< std::string > scaleFactorQuery6Strings ;
515 scaleFactorQuery6Strings.push_back(
"SCALEFACTOR" ) ;
516 scaleFactorQuery6Strings.push_back(
"SF2" ) ;
517 scaleFactorQuery6Strings.push_back(
"SF3" ) ;
518 scaleFactorQuery6Strings.push_back(
"SF4" ) ;
519 scaleFactorQuery6Strings.push_back(
"SF5" ) ;
520 scaleFactorQuery6Strings.push_back(
"SF6" ) ;
525 std::vector <double> sfTmp[100] ;
536 for(
int nf = 0; nf < nfactors; nf++){
542 for(
int nf = 0; nf< nfactors; nf++)
544 sfTmp[ieta-1].push_back(sf[nf]);
553 for(
short i = 0 ;
i < maxBin ; ++
i )
555 for(
short nf = 0; nf < nfactors; nf++)
556 output.push_back( sfTmp[
i ].at(nf) ) ;
bool fillVariable(const std::string &columnName, T &outputVariable) const
const QueryResults singleAttribute(const T &data) const
~L1RCTParametersOnlineProd() override
void fillScaleFactors(const l1t::OMDSReader::QueryResults &results, std::vector< double > &output, int nfactor=1)
std::unique_ptr< L1RCTParameters > newObject(const std::string &objectKey) override
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)