Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:15

0001 // -*- C++ -*-
0002 //
0003 // Package:    L1RCTParametersOnlineProd
0004 // Class:      L1RCTParametersOnlineProd
0005 //
0006 /**\class L1RCTParametersOnlineProd L1RCTParametersOnlineProd.h L1Trigger/L1RCTParametersProducers/src/L1RCTParametersOnlineProd.cc
0007 
0008  Description: <one line class summary>
0009 
0010  Implementation:
0011      <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Werner Man-Li Sun
0015 //         Created:  Tue Sep 16 22:43:22 CEST 2008
0016 //
0017 //
0018 
0019 // system include files
0020 
0021 // user include files
0022 #include "CondTools/L1Trigger/interface/L1ConfigOnlineProdBase.h"
0023 
0024 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
0025 #include "CondFormats/DataRecord/interface/L1RCTParametersRcd.h"
0026 
0027 // #include "FWCore/Framework/interface/HCTypeTagTemplate.h"
0028 // #include "FWCore/Framework/interface/EventSetup.h"
0029 
0030 //
0031 // class declaration
0032 //
0033 
0034 class L1RCTParametersOnlineProd : public L1ConfigOnlineProdBase<L1RCTParametersRcd, L1RCTParameters> {
0035 public:
0036   L1RCTParametersOnlineProd(const edm::ParameterSet&);
0037   ~L1RCTParametersOnlineProd() override;
0038 
0039   std::unique_ptr<L1RCTParameters> newObject(const std::string& objectKey) override;
0040 
0041   void fillScaleFactors(const l1t::OMDSReader::QueryResults& results, std::vector<double>& output, int nfactor = 1);
0042   /*
0043 
0044   void fillScaleFactors(
0045     const l1t::OMDSReader::QueryResults& results,
0046     std::vector< std::vector< double  > >& output ) ;
0047   */
0048 private:
0049   // ----------member data ---------------------------
0050 };
0051 
0052 //
0053 // constants, enums and typedefs
0054 //
0055 
0056 //
0057 // static data member definitions
0058 //
0059 
0060 //
0061 // constructors and destructor
0062 //
0063 L1RCTParametersOnlineProd::L1RCTParametersOnlineProd(const edm::ParameterSet& iConfig)
0064     : L1ConfigOnlineProdBase<L1RCTParametersRcd, L1RCTParameters>(iConfig) {
0065   //the following line is needed to tell the framework what
0066   // data is being produced
0067 
0068   //now do what ever other initialization is needed
0069 }
0070 
0071 L1RCTParametersOnlineProd::~L1RCTParametersOnlineProd() {
0072   // do anything here that needs to be done at desctruction time
0073   // (e.g. close files, deallocate resources etc.)
0074 }
0075 
0076 std::unique_ptr<L1RCTParameters> L1RCTParametersOnlineProd::newObject(const std::string& objectKey) {
0077   std::string rctSchema = "CMS_RCT";
0078   const l1t::OMDSReader::QueryResults paremKeyResults = m_omdsReader.singleAttribute(objectKey);
0079 
0080   // ~~~~~~~~~ Cut values ~~~~~~~~~
0081 
0082   // select egamma_lsb, jetmet_lsb, e_min_for_fg_cut, e_max_for_fg_cut,
0083   // h_ove r_e_cut, e_min_for_h_over_e_cut, e_max_for_h_over_e_cut,
0084   // h_min_for_h_over_e_cut, e_activity_cut, h_activity_cut,
0085   // eic_isolation_threshold, jsc_quiet_threshold_barrel,
0086   // jsc_quiet_threshold_endcap, noisevetohb, noisevetoheplus,
0087   // noisevetoheminus from parem_conf where parem_conf.parem_key =
0088   // (select rct_parameter from rct_conf where rct_conf.rct_key =
0089   // 'rct_cmssw_def');
0090 
0091   std::vector<std::string> queryStrings;
0092   queryStrings.push_back("EGAMMA_LSB");
0093   queryStrings.push_back("JETMET_LSB");
0094   queryStrings.push_back("E_MIN_FOR_FG_CUT");
0095   queryStrings.push_back("E_MAX_FOR_FG_CUT");
0096   queryStrings.push_back("H_OVER_E_CUT");
0097   queryStrings.push_back("E_MIN_FOR_H_OVER_E_CUT");
0098   queryStrings.push_back("E_MAX_FOR_H_OVER_E_CUT");
0099   queryStrings.push_back("H_MIN_FOR_H_OVER_E_CUT");
0100   queryStrings.push_back("E_ACTIVITY_CUT");
0101   queryStrings.push_back("H_ACTIVITY_CUT");
0102   queryStrings.push_back("EIC_ISOLATION_THRESHOLD");
0103   queryStrings.push_back("JSC_QUIET_THRESHOLD_BARREL");
0104   queryStrings.push_back("JSC_QUIET_THRESHOLD_ENDCAP");
0105   queryStrings.push_back("NOISEVETOHB");
0106   queryStrings.push_back("NOISEVETOHEPLUS");
0107   queryStrings.push_back("NOISEVETOHEMINUS");
0108   queryStrings.push_back("USECORR");
0109   l1t::OMDSReader::QueryResults paremResults =
0110       m_omdsReader.basicQuery(queryStrings, rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults);
0111 
0112   if (paremResults.queryFailed() || paremResults.numberRows() != 1)  // check query successful
0113   {
0114     edm::LogError("L1-O2O") << "Problem with L1RCTParameters key.";
0115     return std::unique_ptr<L1RCTParameters>();
0116   }
0117 
0118   double eGammaLSB, jetMETLSB, eMinForFGCut, eMaxForFGCut, hOeCut;
0119   double eMinForHoECut, eMaxForHoECut, hMinForHoECut;
0120   double eActivityCut, hActivityCut;
0121   double jscQuietThreshBarrel, jscQuietThreshEndcap, eicIsolationThreshold;
0122   bool noiseVetoHB, noiseVetoHEplus, noiseVetoHEminus, useCorr;
0123 
0124   paremResults.fillVariable("EGAMMA_LSB", eGammaLSB);
0125   paremResults.fillVariable("JETMET_LSB", jetMETLSB);
0126   paremResults.fillVariable("E_MIN_FOR_FG_CUT", eMinForFGCut);
0127   paremResults.fillVariable("E_MAX_FOR_FG_CUT", eMaxForFGCut);
0128   paremResults.fillVariable("H_OVER_E_CUT", hOeCut);
0129   paremResults.fillVariable("E_MIN_FOR_H_OVER_E_CUT", eMinForHoECut);
0130   paremResults.fillVariable("E_MAX_FOR_H_OVER_E_CUT", eMaxForHoECut);
0131   paremResults.fillVariable("H_MIN_FOR_H_OVER_E_CUT", hMinForHoECut);
0132   paremResults.fillVariable("E_ACTIVITY_CUT", eActivityCut);
0133   paremResults.fillVariable("H_ACTIVITY_CUT", hActivityCut);
0134   paremResults.fillVariable("JSC_QUIET_THRESHOLD_BARREL", jscQuietThreshBarrel);
0135   paremResults.fillVariable("JSC_QUIET_THRESHOLD_ENDCAP", jscQuietThreshEndcap);
0136   paremResults.fillVariable("EIC_ISOLATION_THRESHOLD", eicIsolationThreshold);
0137   paremResults.fillVariable("NOISEVETOHB", noiseVetoHB);
0138   paremResults.fillVariable("NOISEVETOHEPLUS", noiseVetoHEplus);
0139   paremResults.fillVariable("NOISEVETOHEMINUS", noiseVetoHEminus);
0140   paremResults.fillVariable("USECORR", useCorr);
0141   //      std::cout << "eGammaLSB = " << eGammaLSB << std::endl ;
0142   //      std::cout << "jetMETLSB = " << jetMETLSB << std::endl ;
0143   //      std::cout << "eMinForFGCut = " << eMinForFGCut << std::endl ;
0144   //      std::cout << "eMaxForFGCut = " << eMaxForFGCut << std::endl ;
0145   //      std::cout << "hOeCut = " << hOeCut << std::endl ;
0146   //      std::cout << "eMinForHoECut = " << eMinForHoECut << std::endl ;
0147   //      std::cout << "eMaxForHoECut = " << eMaxForHoECut << std::endl ;
0148   //      std::cout << "hMinForHoECut = " << hMinForHoECut << std::endl ;
0149   //      std::cout << "eActivityCut = " << eActivityCut << std::endl ;
0150   //      std::cout << "hActivityCut = " << hActivityCut << std::endl ;
0151   //      std::cout << "eicIsolationThreshold = " << eicIsolationThreshold << std::endl ;
0152   //      std::cout << "jscQuietThreshBarrel = " << jscQuietThreshBarrel << std::endl ;
0153   //      std::cout << "jscQuietThreshEndcap = " << jscQuietThreshEndcap << std::endl ;
0154   //      std::cout << "noiseVetoHB = " << noiseVetoHB << std::endl ;
0155   //      std::cout << "noiseVetoHEplus = " << noiseVetoHEplus << std::endl ;
0156   //      std::cout << "noiseVetoHEminus = " << noiseVetoHEminus << std::endl ;
0157 
0158   // ~~~~~~~~~ EGamma ECAL scale factors ~~~~~~~~~
0159 
0160   // select scalefactor, fk_rct_eta from egamma_ecal_scalefactor where
0161   // egamma_ecal_scalefactor.fk_version =
0162   // (select egamma_ecal from parem_conf where parem_conf.parem_key =
0163   // (select rct_parameter from rct_conf where rct_conf.rct_key=
0164   // 'rct_cmssw_def'));
0165 
0166   std::vector<std::string> scaleFactorQueryStrings;
0167   scaleFactorQueryStrings.push_back("SCALEFACTOR");
0168   scaleFactorQueryStrings.push_back("FK_RCT_ETA");
0169 
0170   l1t::OMDSReader::QueryResults egammaEcalResults = m_omdsReader.basicQuery(
0171       scaleFactorQueryStrings,
0172       rctSchema,
0173       "EGAMMA_ECAL_SCALEFACTOR",
0174       "EGAMMA_ECAL_SCALEFACTOR.FK_VERSION",
0175       m_omdsReader.basicQuery("EGAMMA_ECAL", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0176 
0177   if (egammaEcalResults.queryFailed())  // check query successful
0178   {
0179     edm::LogError("L1-O2O") << "Problem with EgammaEcal key.";
0180     return std::unique_ptr<L1RCTParameters>();
0181   }
0182 
0183   //      std::cout << "egammaEcal " ;
0184   std::vector<double> egammaEcalScaleFactors;
0185   fillScaleFactors(egammaEcalResults, egammaEcalScaleFactors);
0186 
0187   // ~~~~~~~~~ EGamma HCAL scale factors ~~~~~~~~~
0188 
0189   // select scalefactor, fk_rct_eta from egamma_hcal_scalefactor where
0190   // egamma_hcal_scalefactor.fk_version =
0191   // (select egamma_hcal from parem_conf where parem_conf.parem_key =
0192   // (select rct_parameter from rct_conf where rct_conf.rct_key=
0193   // 'rct_cmssw_def'));
0194 
0195   l1t::OMDSReader::QueryResults egammaHcalResults = m_omdsReader.basicQuery(
0196       scaleFactorQueryStrings,
0197       rctSchema,
0198       "EGAMMA_HCAL_SCALEFACTOR",
0199       "EGAMMA_HCAL_SCALEFACTOR.FK_VERSION",
0200       m_omdsReader.basicQuery("EGAMMA_HCAL", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0201 
0202   if (egammaHcalResults.queryFailed())  // check query successful
0203   {
0204     edm::LogError("L1-O2O") << "Problem with EgammaHcal key.";
0205     return std::unique_ptr<L1RCTParameters>();
0206   }
0207 
0208   //      std::cout << "egammaHcal " ;
0209   std::vector<double> egammaHcalScaleFactors;
0210   fillScaleFactors(egammaHcalResults, egammaHcalScaleFactors);
0211 
0212   // ~~~~~~~~~ JetMET ECAL scale factors ~~~~~~~~~
0213 
0214   // select scalefactor, fk_rct_eta from jetmet_ecal_scalefactor where
0215   // jetmet_ecal_scalefactor.fk_version =
0216   // (select jetmet_ecal from parem_conf where parem_conf.parem_key =
0217   // (select rct_parameter from rct_conf where rct_conf.rct_key=
0218   // 'rct_cmssw_def'));
0219 
0220   l1t::OMDSReader::QueryResults jetmetEcalResults = m_omdsReader.basicQuery(
0221       scaleFactorQueryStrings,
0222       rctSchema,
0223       "JETMET_ECAL_SCALEFACTOR",
0224       "JETMET_ECAL_SCALEFACTOR.FK_VERSION",
0225       m_omdsReader.basicQuery("JETMET_ECAL", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0226 
0227   if (jetmetEcalResults.queryFailed())  // check query successful
0228   {
0229     edm::LogError("L1-O2O") << "Problem with JetmetEcal key.";
0230     return std::unique_ptr<L1RCTParameters>();
0231   }
0232 
0233   //      std::cout << "jetmetEcal " ;
0234   std::vector<double> jetmetEcalScaleFactors;
0235   fillScaleFactors(jetmetEcalResults, jetmetEcalScaleFactors);
0236 
0237   // ~~~~~~~~~ JetMET HCAL scale factors ~~~~~~~~~
0238 
0239   // select scalefactor, fk_rct_eta from jetmet_hcal_scalefactor where
0240   // jetmet_hcal_scalefactor.fk_version =
0241   // (select jetmet_hcal from parem_conf where parem_conf.parem_key =
0242   // (select rct_parameter from rct_conf where rct_conf.rct_key=
0243   // 'rct_cmssw_def'));
0244 
0245   l1t::OMDSReader::QueryResults jetmetHcalResults = m_omdsReader.basicQuery(
0246       scaleFactorQueryStrings,
0247       rctSchema,
0248       "JETMET_HCAL_SCALEFACTOR",
0249       "JETMET_HCAL_SCALEFACTOR.FK_VERSION",
0250       m_omdsReader.basicQuery("JETMET_HCAL", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0251 
0252   if (jetmetHcalResults.queryFailed())  // check query successful
0253   {
0254     edm::LogError("L1-O2O") << "Problem with JetmetHcal key.";
0255     return std::unique_ptr<L1RCTParameters>();
0256   }
0257 
0258   //      std::cout << "jetmetHcal " ;
0259   std::vector<double> jetmetHcalScaleFactors;
0260   fillScaleFactors(jetmetHcalResults, jetmetHcalScaleFactors);
0261 
0262   //Lindsay variables
0263 
0264   /*
0265     std::vector< std::vector< double > > hcalCalibScaleFactors ;
0266        std::vector< std::vector< double > > hcalCalibHighScaleFactors ;
0267        std::vector< std::vector< double > > ecalCalibScaleFactors ;
0268        std::vector< std::vector< double > > crossTermsScaleFactors ;
0269      */
0270   std::vector<double> lowHoverE_smear, highHoverE_smear;
0271   std::vector<double> hcalCalibScaleFactors, ecalCalibScaleFactors;
0272   std::vector<double> hcalCalibHighScaleFactors, crossTermsScaleFactors;
0273 
0274   if (useCorr) {  //lindsay corrections
0275 
0276     std::vector<std::string> scaleFactorQuery3Strings;
0277     scaleFactorQuery3Strings.push_back("SCALEFACTOR");
0278     scaleFactorQuery3Strings.push_back("SF2");
0279     scaleFactorQuery3Strings.push_back("SF3");
0280     scaleFactorQuery3Strings.push_back("FK_RCT_ETA");
0281 
0282     l1t::OMDSReader::QueryResults hcalCalibResults = m_omdsReader.basicQuery(
0283         scaleFactorQuery3Strings,
0284         rctSchema,
0285         "HCAL_CALIB_FACTOR",
0286         "HCAL_CALIB_FACTOR.VERSION",
0287         m_omdsReader.basicQuery(
0288             "HCAL_CALIB_VERSION", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0289 
0290     if (hcalCalibResults.queryFailed()) {  // check query successful
0291 
0292       edm::LogError("L1-O2O") << "Problem with JetmetHcal key.";
0293       return std::unique_ptr<L1RCTParameters>();
0294     }
0295 
0296     //      std::cout << "jetmetHcal " ;
0297 
0298     fillScaleFactors(hcalCalibResults, hcalCalibScaleFactors, 3);
0299 
0300     l1t::OMDSReader::QueryResults hcalCalibHighResults = m_omdsReader.basicQuery(
0301         scaleFactorQuery3Strings,
0302         rctSchema,
0303         "HCAL_CALIB_HIGH_FACTOR",
0304         "HCAL_CALIB_HIGH_FACTOR.VERSION",
0305         m_omdsReader.basicQuery(
0306             "HCAL_CALIB_HIGH_VERSION", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0307 
0308     if (hcalCalibHighResults.queryFailed())  // check query successful
0309     {
0310       edm::LogError("L1-O2O") << "Problem with hcalHigh key.";
0311       return std::unique_ptr<L1RCTParameters>();
0312     }
0313 
0314     fillScaleFactors(hcalCalibHighResults, hcalCalibHighScaleFactors, 3);
0315 
0316     l1t::OMDSReader::QueryResults ecalCalibResults = m_omdsReader.basicQuery(
0317         scaleFactorQuery3Strings,
0318         rctSchema,
0319         "ECAL_CALIB_FACTOR",
0320         "ECAL_CALIB_FACTOR.VERSION",
0321         m_omdsReader.basicQuery(
0322             "ECAL_CALIB_VERSION", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0323 
0324     if (ecalCalibResults.queryFailed())  // check query successful
0325     {
0326       edm::LogError("L1-O2O") << "Problem with ecal calib key.";
0327       return std::unique_ptr<L1RCTParameters>();
0328     }
0329 
0330     fillScaleFactors(ecalCalibResults, ecalCalibScaleFactors, 3);
0331 
0332     std::vector<std::string> scaleFactorQuery6Strings;
0333     scaleFactorQuery6Strings.push_back("SCALEFACTOR");
0334     scaleFactorQuery6Strings.push_back("SF2");
0335     scaleFactorQuery6Strings.push_back("SF3");
0336     scaleFactorQuery6Strings.push_back("SF4");
0337     scaleFactorQuery6Strings.push_back("SF5");
0338     scaleFactorQuery6Strings.push_back("SF6");
0339     scaleFactorQuery6Strings.push_back("FK_RCT_ETA");
0340     l1t::OMDSReader::QueryResults crossTermResults = m_omdsReader.basicQuery(
0341         scaleFactorQuery6Strings,
0342         rctSchema,
0343         "CROSS_TERMS_FACTOR",
0344         "CROSS_TERMS_FACTOR.VERSION",
0345         m_omdsReader.basicQuery(
0346             "CROSS_TERMS_VERSION", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0347 
0348     if (crossTermResults.queryFailed())  // check query successful
0349     {
0350       edm::LogError("L1-O2O") << "Problem with crossTerms key.";
0351       return std::unique_ptr<L1RCTParameters>();
0352     }
0353 
0354     fillScaleFactors(crossTermResults, crossTermsScaleFactors, 6);
0355 
0356     l1t::OMDSReader::QueryResults hoveresmearhighResults = m_omdsReader.basicQuery(
0357         scaleFactorQueryStrings,
0358         rctSchema,
0359         "H_OVER_E_SMEAR_HIGH_FACTOR",
0360         "H_OVER_E_SMEAR_HIGH_FACTOR.FK_VERSION",
0361         m_omdsReader.basicQuery(
0362             "H_OVER_E_SMEAR_HIGH_VERSION", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0363 
0364     if (hoveresmearhighResults.queryFailed())  // check query successful
0365     {
0366       edm::LogError("L1-O2O") << "Problem with low h over e smear key.";
0367       return std::unique_ptr<L1RCTParameters>();
0368     }
0369 
0370     //      std::cout << "egammaEcal " ;
0371     fillScaleFactors(hoveresmearhighResults, highHoverE_smear);
0372 
0373     l1t::OMDSReader::QueryResults hoveresmearlowResults = m_omdsReader.basicQuery(
0374         scaleFactorQueryStrings,
0375         rctSchema,
0376         "H_OVER_E_SMEAR_LOW_FACTOR",
0377         "H_OVER_E_SMEAR_LOW_FACTOR.FK_VERSION",
0378         m_omdsReader.basicQuery(
0379             "H_OVER_E_SMEAR_LOW_VERSION", rctSchema, "PAREM_CONF", "PAREM_CONF.PAREM_KEY", paremKeyResults));
0380 
0381     if (hoveresmearlowResults.queryFailed())  // check query successful
0382     {
0383       edm::LogError("L1-O2O") << "Problem with low h over e smear key.";
0384       return std::unique_ptr<L1RCTParameters>();
0385     }
0386 
0387     //      std::cout << "egammaEcal " ;
0388     fillScaleFactors(hoveresmearlowResults, lowHoverE_smear);
0389   }
0390 
0391   //~~~~~~~~~ Instantiate new L1RCTParameters object. ~~~~~~~~~
0392 
0393   // Default objects for Lindsey
0394 
0395   return std::make_unique<L1RCTParameters>(eGammaLSB,
0396                                            jetMETLSB,
0397                                            eMinForFGCut,
0398                                            eMaxForFGCut,
0399                                            hOeCut,
0400                                            eMinForHoECut,
0401                                            eMaxForHoECut,
0402                                            hMinForHoECut,
0403                                            eActivityCut,
0404                                            hActivityCut,
0405                                            (unsigned int)eicIsolationThreshold,
0406                                            (int)jscQuietThreshBarrel,
0407                                            (int)jscQuietThreshEndcap,
0408                                            noiseVetoHB,
0409                                            noiseVetoHEplus,
0410                                            noiseVetoHEminus,
0411                                            useCorr,  // useLindsey
0412                                            egammaEcalScaleFactors,
0413                                            egammaHcalScaleFactors,
0414                                            jetmetEcalScaleFactors,
0415                                            jetmetHcalScaleFactors,
0416                                            ecalCalibScaleFactors,
0417                                            hcalCalibScaleFactors,
0418                                            hcalCalibHighScaleFactors,
0419                                            crossTermsScaleFactors,
0420                                            lowHoverE_smear,
0421                                            highHoverE_smear);
0422 }
0423 
0424 //
0425 // member functions
0426 //
0427 
0428 void L1RCTParametersOnlineProd::fillScaleFactors(const l1t::OMDSReader::QueryResults& results,
0429                                                  std::vector<double>& output,
0430                                                  int nfactors) {
0431   if ((nfactors < 1) || (nfactors > 6)) {
0432     edm::LogError("L1-O2O") << "invalid number of factors in scale factors fill";
0433     return;
0434   }
0435 
0436   std::vector<std::string> scaleFactorQuery6Strings;
0437   scaleFactorQuery6Strings.push_back("SCALEFACTOR");
0438   scaleFactorQuery6Strings.push_back("SF2");
0439   scaleFactorQuery6Strings.push_back("SF3");
0440   scaleFactorQuery6Strings.push_back("SF4");
0441   scaleFactorQuery6Strings.push_back("SF5");
0442   scaleFactorQuery6Strings.push_back("SF6");
0443   // Store scale factors in temporary array to get ordering right.
0444   // Reserve space for 100 bins.
0445 
0446   //  static const int reserve = 100 ;
0447   std::vector<double> sfTmp[100];
0448   /*  
0449   for( int i = 0 ; i < reserve ; ++i )
0450     {
0451       sfTmp[ i ] = 0. ;
0452     }
0453   */
0454   short maxBin = 0;
0455   for (int i = 0; i < results.numberRows(); ++i) {
0456     double sf[6];
0457     for (int nf = 0; nf < nfactors; nf++) {
0458       results.fillVariableFromRow(scaleFactorQuery6Strings.at(nf), i, sf[nf]);
0459     }
0460     short ieta = 0;
0461     results.fillVariableFromRow("FK_RCT_ETA", i, ieta);
0462 
0463     for (int nf = 0; nf < nfactors; nf++)
0464       //      sfTmp[ ieta-1 ] = sf ; // eta bins start at 1.
0465       sfTmp[ieta - 1].push_back(sf[nf]);
0466 
0467     if (ieta > maxBin) {
0468       maxBin = ieta;
0469     }
0470   }
0471 
0472   for (short i = 0; i < maxBin; ++i) {
0473     for (short nf = 0; nf < nfactors; nf++)
0474       output.push_back(sfTmp[i].at(nf));
0475   }
0476 }
0477 
0478 // ------------ method called to produce the data  ------------
0479 
0480 //define this as a plug-in
0481 DEFINE_FWK_EVENTSETUP_MODULE(L1RCTParametersOnlineProd);