Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:18

0001 ///
0002 /// \class L1TCaloParamsESProducer
0003 ///
0004 /// Description: Produces configuration parameters for the fictitious Yellow trigger.
0005 ///
0006 /// Implementation:
0007 ///    Dummy producer for L1 calo upgrade configuration parameters
0008 ///
0009 /// \author: Jim Brooke, University of Bristol
0010 ///
0011 
0012 //
0013 //
0014 
0015 // system include files
0016 #include <memory>
0017 #include <iostream>
0018 #include <fstream>
0019 
0020 // user include files
0021 #include "FWCore/Framework/interface/ModuleFactory.h"
0022 #include "FWCore/Framework/interface/ESProducer.h"
0023 #include "FWCore/Framework/interface/ESHandle.h"
0024 #include "FWCore/Framework/interface/ESProducts.h"
0025 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0026 
0027 #include "FWCore/ParameterSet/interface/FileInPath.h"
0028 
0029 #include "CondFormats/L1TObjects/interface/CaloParams.h"
0030 #include "L1Trigger/L1TCalorimeter/interface/CaloParamsHelper.h"
0031 #include "CondFormats/DataRecord/interface/L1TCaloParamsRcd.h"
0032 
0033 using namespace std;
0034 
0035 //
0036 // class declaration
0037 //
0038 
0039 using namespace l1t;
0040 
0041 class L1TCaloParamsESProducer : public edm::ESProducer {
0042 public:
0043   L1TCaloParamsESProducer(const edm::ParameterSet&);
0044   ~L1TCaloParamsESProducer() override;
0045 
0046   using ReturnType = std::unique_ptr<CaloParams>;
0047 
0048   ReturnType produce(const L1TCaloParamsRcd&);
0049 
0050 private:
0051   CaloParams m_params;
0052   std::string m_label;
0053 };
0054 
0055 //
0056 // constants, enums and typedefs
0057 //
0058 
0059 //
0060 // static data member definitions
0061 //
0062 
0063 //
0064 // constructors and destructor
0065 //
0066 L1TCaloParamsESProducer::L1TCaloParamsESProducer(const edm::ParameterSet& conf) {
0067   //the following line is needed to tell the framework what
0068   // data is being produced
0069   setWhatProduced(this);
0070   //setWhatProduced(this, conf.getParameter<std::string>("label"));
0071 
0072   CaloParamsHelper m_params_helper;
0073 
0074   // towers
0075   m_params_helper.setTowerLsbH(conf.getParameter<double>("towerLsbH"));
0076   m_params_helper.setTowerLsbE(conf.getParameter<double>("towerLsbE"));
0077   m_params_helper.setTowerLsbSum(conf.getParameter<double>("towerLsbSum"));
0078   m_params_helper.setTowerNBitsH(conf.getParameter<int>("towerNBitsH"));
0079   m_params_helper.setTowerNBitsE(conf.getParameter<int>("towerNBitsE"));
0080   m_params_helper.setTowerNBitsSum(conf.getParameter<int>("towerNBitsSum"));
0081   m_params_helper.setTowerNBitsRatio(conf.getParameter<int>("towerNBitsRatio"));
0082   m_params_helper.setTowerEncoding(conf.getParameter<bool>("towerEncoding"));
0083 
0084   // regions
0085   m_params_helper.setRegionLsb(conf.getParameter<double>("regionLsb"));
0086   m_params_helper.setRegionPUSType(conf.getParameter<std::string>("regionPUSType"));
0087   m_params_helper.setRegionPUSParams(conf.getParameter<std::vector<double>>("regionPUSParams"));
0088 
0089   // EG
0090   m_params_helper.setEgEtaCut(conf.getParameter<int>("egEtaCut"));
0091 
0092   m_params_helper.setEgLsb(conf.getParameter<double>("egLsb"));
0093   m_params_helper.setEgSeedThreshold(conf.getParameter<double>("egSeedThreshold"));
0094   m_params_helper.setEgNeighbourThreshold(conf.getParameter<double>("egNeighbourThreshold"));
0095   m_params_helper.setEgHcalThreshold(conf.getParameter<double>("egHcalThreshold"));
0096 
0097   edm::FileInPath egTrimmingLUTFile = conf.getParameter<edm::FileInPath>("egTrimmingLUTFile");
0098   std::ifstream egTrimmingLUTStream(egTrimmingLUTFile.fullPath());
0099   auto egTrimmingLUT = std::make_shared<LUT>(egTrimmingLUTStream);
0100   m_params_helper.setEgTrimmingLUT(*egTrimmingLUT);
0101 
0102   m_params_helper.setEgMaxHcalEt(conf.getParameter<double>("egMaxHcalEt"));
0103   m_params_helper.setEgMaxPtHOverE(conf.getParameter<double>("egMaxPtHOverE"));
0104   m_params_helper.setEgHOverEcutBarrel(conf.getParameter<int>("egHOverEcutBarrel"));
0105   m_params_helper.setEgHOverEcutEndcap(conf.getParameter<int>("egHOverEcutEndcap"));
0106   m_params_helper.setEgMinPtJetIsolation(conf.getParameter<int>("egMinPtJetIsolation"));
0107   m_params_helper.setEgMaxPtJetIsolation(conf.getParameter<int>("egMaxPtJetIsolation"));
0108   m_params_helper.setEgMinPtHOverEIsolation(conf.getParameter<int>("egMinPtHOverEIsolation"));
0109   m_params_helper.setEgMaxPtHOverEIsolation(conf.getParameter<int>("egMaxPtHOverEIsolation"));
0110   m_params_helper.setEgBypassEGVetos(conf.getParameter<unsigned>("egBypassEGVetos"));
0111   m_params_helper.setEgBypassExtHOverE(conf.getParameter<unsigned>("egBypassExtHOverE"));
0112   m_params_helper.setEgBypassShape(conf.getParameter<unsigned>("egBypassShape"));
0113   m_params_helper.setEgBypassECALFG(conf.getParameter<unsigned>("egBypassECALFG"));
0114   m_params_helper.setEgBypassHoE(conf.getParameter<unsigned>("egBypassHoE"));
0115 
0116   edm::FileInPath egMaxHOverELUTFile = conf.getParameter<edm::FileInPath>("egMaxHOverELUTFile");
0117   std::ifstream egMaxHOverELUTStream(egMaxHOverELUTFile.fullPath());
0118   auto egMaxHOverELUT = std::make_shared<LUT>(egMaxHOverELUTStream);
0119   m_params_helper.setEgMaxHOverELUT(*egMaxHOverELUT);
0120 
0121   edm::FileInPath egCompressShapesLUTFile = conf.getParameter<edm::FileInPath>("egCompressShapesLUTFile");
0122   std::ifstream egCompressShapesLUTStream(egCompressShapesLUTFile.fullPath());
0123   auto egCompressShapesLUT = std::make_shared<LUT>(egCompressShapesLUTStream);
0124   m_params_helper.setEgCompressShapesLUT(*egCompressShapesLUT);
0125 
0126   m_params_helper.setEgShapeIdType(conf.getParameter<std::string>("egShapeIdType"));
0127   m_params_helper.setEgShapeIdVersion(conf.getParameter<unsigned>("egShapeIdVersion"));
0128   edm::FileInPath egShapeIdLUTFile = conf.getParameter<edm::FileInPath>("egShapeIdLUTFile");
0129   std::ifstream egShapeIdLUTStream(egShapeIdLUTFile.fullPath());
0130   auto egShapeIdLUT = std::make_shared<LUT>(egShapeIdLUTStream);
0131   m_params_helper.setEgShapeIdLUT(*egShapeIdLUT);
0132 
0133   m_params_helper.setEgPUSType(conf.getParameter<std::string>("egPUSType"));
0134 
0135   m_params_helper.setEgIsolationType(conf.getParameter<std::string>("egIsolationType"));
0136   edm::FileInPath egIsoLUTFile = conf.getParameter<edm::FileInPath>("egIsoLUTFile");
0137   std::ifstream egIsoLUTStream(egIsoLUTFile.fullPath());
0138   auto egIsoLUT = std::make_shared<LUT>(egIsoLUTStream);
0139   m_params_helper.setEgIsolationLUT(*egIsoLUT);
0140   edm::FileInPath egIsoLUTFile2 = conf.getParameter<edm::FileInPath>("egIsoLUTFile2");
0141   std::ifstream egIsoLUTStream2(egIsoLUTFile2.fullPath());
0142   auto egIsoLUT2 = std::make_shared<LUT>(egIsoLUTStream2);
0143   m_params_helper.setEgIsolationLUT2(*egIsoLUT2);
0144 
0145   //edm::FileInPath egIsoLUTFileBarrel = conf.getParameter<edm::FileInPath>("egIsoLUTFileBarrel");
0146   //std::ifstream egIsoLUTBarrelStream(egIsoLUTFileBarrel.fullPath());
0147   //auto egIsoLUTBarrel = std::make_shared<LUT>(egIsoLUTBarrelStream);
0148   //m_params_helper.setEgIsolationLUTBarrel(egIsoLUTBarrel);
0149 
0150   //edm::FileInPath egIsoLUTFileEndcaps = conf.getParameter<edm::FileInPath>("egIsoLUTFileEndcaps");
0151   //std::ifstream egIsoLUTEndcapsStream(egIsoLUTFileEndcaps.fullPath());
0152   //auto egIsoLUTEndcaps = std::make_shared<LUT>(egIsoLUTEndcapsStream);
0153   //m_params_helper.setEgIsolationLUTEndcaps(egIsoLUTEndcaps);
0154 
0155   m_params_helper.setEgIsoAreaNrTowersEta(conf.getParameter<unsigned int>("egIsoAreaNrTowersEta"));
0156   m_params_helper.setEgIsoAreaNrTowersPhi(conf.getParameter<unsigned int>("egIsoAreaNrTowersPhi"));
0157   m_params_helper.setEgIsoVetoNrTowersPhi(conf.getParameter<unsigned int>("egIsoVetoNrTowersPhi"));
0158   //m_params_helper.setEgIsoPUEstTowerGranularity(conf.getParameter<unsigned int>("egIsoPUEstTowerGranularity"));
0159   //m_params_helper.setEgIsoMaxEtaAbsForTowerSum(conf.getParameter<unsigned int>("egIsoMaxEtaAbsForTowerSum"));
0160   //m_params_helper.setEgIsoMaxEtaAbsForIsoSum(conf.getParameter<unsigned int>("egIsoMaxEtaAbsForIsoSum"));
0161   m_params_helper.setEgPUSParams(conf.getParameter<std::vector<double>>("egPUSParams"));
0162 
0163   m_params_helper.setEgCalibrationType(conf.getParameter<std::string>("egCalibrationType"));
0164   m_params_helper.setEgCalibrationVersion(conf.getParameter<unsigned>("egCalibrationVersion"));
0165   edm::FileInPath egCalibrationLUTFile = conf.getParameter<edm::FileInPath>("egCalibrationLUTFile");
0166   std::ifstream egCalibrationLUTStream(egCalibrationLUTFile.fullPath());
0167   auto egCalibrationLUT = std::make_shared<LUT>(egCalibrationLUTStream);
0168   m_params_helper.setEgCalibrationLUT(*egCalibrationLUT);
0169 
0170   // tau
0171   m_params_helper.setTauRegionMask(conf.getParameter<int>("tauRegionMask"));
0172   m_params_helper.setTauLsb(conf.getParameter<double>("tauLsb"));
0173   m_params_helper.setTauSeedThreshold(conf.getParameter<double>("tauSeedThreshold"));
0174   m_params_helper.setTauNeighbourThreshold(conf.getParameter<double>("tauNeighbourThreshold"));
0175   m_params_helper.setTauMaxPtTauVeto(conf.getParameter<double>("tauMaxPtTauVeto"));
0176   m_params_helper.setTauMinPtJetIsolationB(conf.getParameter<double>("tauMinPtJetIsolationB"));
0177   m_params_helper.setTauPUSType(conf.getParameter<std::string>("tauPUSType"));
0178   m_params_helper.setTauMaxJetIsolationB(conf.getParameter<double>("tauMaxJetIsolationB"));
0179   m_params_helper.setTauMaxJetIsolationA(conf.getParameter<double>("tauMaxJetIsolationA"));
0180   m_params_helper.setTauIsoAreaNrTowersEta(conf.getParameter<unsigned int>("tauIsoAreaNrTowersEta"));
0181   m_params_helper.setTauIsoAreaNrTowersPhi(conf.getParameter<unsigned int>("tauIsoAreaNrTowersPhi"));
0182   m_params_helper.setTauIsoVetoNrTowersPhi(conf.getParameter<unsigned int>("tauIsoVetoNrTowersPhi"));
0183 
0184   edm::FileInPath tauIsoLUTFile = conf.getParameter<edm::FileInPath>("tauIsoLUTFile");
0185   std::ifstream tauIsoLUTStream(tauIsoLUTFile.fullPath());
0186   auto tauIsoLUT = std::make_shared<LUT>(tauIsoLUTStream);
0187   m_params_helper.setTauIsolationLUT(*tauIsoLUT);
0188 
0189   edm::FileInPath tauIsoLUTFile2 = conf.getParameter<edm::FileInPath>("tauIsoLUTFile2");
0190   std::ifstream tauIsoLUTStream2(tauIsoLUTFile2.fullPath());
0191   std::shared_ptr<LUT> tauIsoLUT2(new LUT(tauIsoLUTStream2));
0192   m_params_helper.setTauIsolationLUT2(*tauIsoLUT2);
0193 
0194   edm::FileInPath tauTrimmingShapeVetoLUTFile = conf.getParameter<edm::FileInPath>("tauTrimmingShapeVetoLUTFile");
0195   std::ifstream tauTrimmingShapeVetoLUTStream(tauTrimmingShapeVetoLUTFile.fullPath());
0196   std::shared_ptr<LUT> tauTrimmingShapeVetoLUT(new LUT(tauTrimmingShapeVetoLUTStream));
0197   m_params_helper.setTauTrimmingShapeVetoLUT(*tauTrimmingShapeVetoLUT);
0198 
0199   edm::FileInPath tauCalibrationLUTFile = conf.getParameter<edm::FileInPath>("tauCalibrationLUTFile");
0200   std::ifstream tauCalibrationLUTStream(tauCalibrationLUTFile.fullPath());
0201   auto tauCalibrationLUT = std::make_shared<LUT>(tauCalibrationLUTStream);
0202   m_params_helper.setTauCalibrationLUT(*tauCalibrationLUT);
0203 
0204   edm::FileInPath tauCompressLUTFile = conf.getParameter<edm::FileInPath>("tauCompressLUTFile");
0205   std::ifstream tauCompressLUTStream(tauCompressLUTFile.fullPath());
0206   auto tauCompressLUT = std::make_shared<LUT>(tauCompressLUTStream);
0207   m_params_helper.setTauCompressLUT(*tauCompressLUT);
0208 
0209   edm::FileInPath tauEtToHFRingEtLUTFile = conf.getParameter<edm::FileInPath>("tauEtToHFRingEtLUTFile");
0210   std::ifstream tauEtToHFRingEtLUTStream(tauEtToHFRingEtLUTFile.fullPath());
0211   auto tauEtToHFRingEtLUT = std::make_shared<LUT>(tauEtToHFRingEtLUTStream);
0212   m_params_helper.setTauEtToHFRingEtLUT(*tauEtToHFRingEtLUT);
0213 
0214   m_params_helper.setIsoTauEtaMin(conf.getParameter<int>("isoTauEtaMin"));
0215   m_params_helper.setIsoTauEtaMax(conf.getParameter<int>("isoTauEtaMax"));
0216 
0217   m_params_helper.setTauPUSParams(conf.getParameter<std::vector<double>>("tauPUSParams"));
0218 
0219   // jets
0220   m_params_helper.setJetLsb(conf.getParameter<double>("jetLsb"));
0221   m_params_helper.setJetSeedThreshold(conf.getParameter<double>("jetSeedThreshold"));
0222   m_params_helper.setJetNeighbourThreshold(conf.getParameter<double>("jetNeighbourThreshold"));
0223   m_params_helper.setJetRegionMask(conf.getParameter<int>("jetRegionMask"));
0224   m_params_helper.setJetPUSType(conf.getParameter<std::string>("jetPUSType"));
0225   m_params_helper.setJetBypassPUS(conf.getParameter<unsigned>("jetBypassPUS"));
0226   m_params_helper.setJetPUSUsePhiRing(conf.getParameter<unsigned>("jetPUSUsePhiRing"));
0227   m_params_helper.setJetCalibrationType(conf.getParameter<std::string>("jetCalibrationType"));
0228   m_params_helper.setJetCalibrationParams(conf.getParameter<std::vector<double>>("jetCalibrationParams"));
0229   edm::FileInPath jetCalibrationLUTFile = conf.getParameter<edm::FileInPath>("jetCalibrationLUTFile");
0230   std::ifstream jetCalibrationLUTStream(jetCalibrationLUTFile.fullPath());
0231   auto jetCalibrationLUT = std::make_shared<LUT>(jetCalibrationLUTStream);
0232   m_params_helper.setJetCalibrationLUT(*jetCalibrationLUT);
0233   edm::FileInPath jetCompressEtaLUTFile = conf.getParameter<edm::FileInPath>("jetCompressEtaLUTFile");
0234   std::ifstream jetCompressEtaLUTStream(jetCompressEtaLUTFile.fullPath());
0235   std::shared_ptr<LUT> jetCompressEtaLUT(new LUT(jetCompressEtaLUTStream));
0236   m_params_helper.setJetCompressEtaLUT(*jetCompressEtaLUT);
0237   edm::FileInPath jetCompressPtLUTFile = conf.getParameter<edm::FileInPath>("jetCompressPtLUTFile");
0238   std::ifstream jetCompressPtLUTStream(jetCompressPtLUTFile.fullPath());
0239   std::shared_ptr<LUT> jetCompressPtLUT(new LUT(jetCompressPtLUTStream));
0240   m_params_helper.setJetCompressPtLUT(*jetCompressPtLUT);
0241 
0242   // sums
0243   m_params_helper.setEtSumLsb(conf.getParameter<double>("etSumLsb"));
0244 
0245   std::vector<int> etSumEtaMin = conf.getParameter<std::vector<int>>("etSumEtaMin");
0246   std::vector<int> etSumEtaMax = conf.getParameter<std::vector<int>>("etSumEtaMax");
0247   std::vector<double> etSumEtThreshold = conf.getParameter<std::vector<double>>("etSumEtThreshold");
0248   m_params_helper.setEtSumBypassMetPUS(conf.getParameter<unsigned>("etSumBypassMetPUS"));
0249   m_params_helper.setEtSumBypassEttPUS(conf.getParameter<unsigned>("etSumBypassEttPUS"));
0250   m_params_helper.setEtSumBypassEcalSumPUS(conf.getParameter<unsigned>("etSumBypassEcalSumPUS"));
0251   m_params_helper.setEtSumMetPUSType(conf.getParameter<std::string>("etSumMetPUSType"));
0252   m_params_helper.setEtSumEttPUSType(conf.getParameter<std::string>("etSumEttPUSType"));
0253   m_params_helper.setEtSumEcalSumPUSType(conf.getParameter<std::string>("etSumEcalSumPUSType"));
0254   m_params_helper.setMetCalibrationType(conf.getParameter<std::string>("metCalibrationType"));
0255   m_params_helper.setMetHFCalibrationType(conf.getParameter<std::string>("metHFCalibrationType"));
0256   m_params_helper.setEtSumEttCalibrationType(conf.getParameter<std::string>("etSumEttCalibrationType"));
0257   m_params_helper.setEtSumEcalSumCalibrationType(conf.getParameter<std::string>("etSumEcalSumCalibrationType"));
0258 
0259   if ((etSumEtaMin.size() == etSumEtaMax.size()) && (etSumEtaMin.size() == etSumEtThreshold.size())) {
0260     for (unsigned i = 0; i < etSumEtaMin.size(); ++i) {
0261       m_params_helper.setEtSumEtaMin(i, etSumEtaMin.at(i));
0262       m_params_helper.setEtSumEtaMax(i, etSumEtaMax.at(i));
0263       m_params_helper.setEtSumEtThreshold(i, etSumEtThreshold.at(i));
0264     }
0265   } else {
0266     edm::LogError("l1t|calo") << "Inconsistent number of EtSum parameters" << std::endl;
0267   }
0268 
0269   edm::FileInPath etSumMetPUSLUTFile = conf.getParameter<edm::FileInPath>("etSumMetPUSLUTFile");
0270   std::ifstream etSumMetPUSLUTStream(etSumMetPUSLUTFile.fullPath());
0271   std::shared_ptr<LUT> etSumMetPUSLUT(new LUT(etSumMetPUSLUTStream));
0272   m_params_helper.setEtSumMetPUSLUT(*etSumMetPUSLUT);
0273 
0274   edm::FileInPath etSumEttPUSLUTFile = conf.getParameter<edm::FileInPath>("etSumEttPUSLUTFile");
0275   std::ifstream etSumEttPUSLUTStream(etSumEttPUSLUTFile.fullPath());
0276   std::shared_ptr<LUT> etSumEttPUSLUT(new LUT(etSumEttPUSLUTStream));
0277   m_params_helper.setEtSumEttPUSLUT(*etSumEttPUSLUT);
0278 
0279   edm::FileInPath etSumEcalSumPUSLUTFile = conf.getParameter<edm::FileInPath>("etSumEcalSumPUSLUTFile");
0280   std::ifstream etSumEcalSumPUSLUTStream(etSumEcalSumPUSLUTFile.fullPath());
0281   std::shared_ptr<LUT> etSumEcalSumPUSLUT(new LUT(etSumEcalSumPUSLUTStream));
0282   m_params_helper.setEtSumEcalSumPUSLUT(*etSumEcalSumPUSLUT);
0283 
0284   edm::FileInPath metCalibrationLUTFile = conf.getParameter<edm::FileInPath>("metCalibrationLUTFile");
0285   std::ifstream metCalibrationLUTStream(metCalibrationLUTFile.fullPath());
0286   std::shared_ptr<LUT> metCalibrationLUT(new LUT(metCalibrationLUTStream));
0287   m_params_helper.setMetCalibrationLUT(*metCalibrationLUT);
0288 
0289   edm::FileInPath metHFCalibrationLUTFile = conf.getParameter<edm::FileInPath>("metHFCalibrationLUTFile");
0290   std::ifstream metHFCalibrationLUTStream(metHFCalibrationLUTFile.fullPath());
0291   std::shared_ptr<LUT> metHFCalibrationLUT(new LUT(metHFCalibrationLUTStream));
0292   m_params_helper.setMetHFCalibrationLUT(*metHFCalibrationLUT);
0293 
0294   edm::FileInPath etSumEttCalibrationLUTFile = conf.getParameter<edm::FileInPath>("etSumEttCalibrationLUTFile");
0295   std::ifstream etSumEttCalibrationLUTStream(etSumEttCalibrationLUTFile.fullPath());
0296   std::shared_ptr<LUT> etSumEttCalibrationLUT(new LUT(etSumEttCalibrationLUTStream));
0297   m_params_helper.setEtSumEttCalibrationLUT(*etSumEttCalibrationLUT);
0298 
0299   edm::FileInPath etSumEcalSumCalibrationLUTFile = conf.getParameter<edm::FileInPath>("etSumEcalSumCalibrationLUTFile");
0300   std::ifstream etSumEcalSumCalibrationLUTStream(etSumEcalSumCalibrationLUTFile.fullPath());
0301   std::shared_ptr<LUT> etSumEcalSumCalibrationLUT(new LUT(etSumEcalSumCalibrationLUTStream));
0302   m_params_helper.setEtSumEcalSumCalibrationLUT(*etSumEcalSumCalibrationLUT);
0303 
0304   edm::FileInPath metPhiCalibrationLUTFile = conf.getParameter<edm::FileInPath>("metPhiCalibrationLUTFile");
0305   std::ifstream metPhiCalibrationLUTStream(metPhiCalibrationLUTFile.fullPath());
0306   std::shared_ptr<LUT> metPhiCalibrationLUT(new LUT(metPhiCalibrationLUTStream));
0307   m_params_helper.setMetPhiCalibrationLUT(*metPhiCalibrationLUT);
0308 
0309   edm::FileInPath metHFPhiCalibrationLUTFile = conf.getParameter<edm::FileInPath>("metHFPhiCalibrationLUTFile");
0310   std::ifstream metHFPhiCalibrationLUTStream(metHFPhiCalibrationLUTFile.fullPath());
0311   std::shared_ptr<LUT> metHFPhiCalibrationLUT(new LUT(metHFPhiCalibrationLUTStream));
0312   m_params_helper.setMetHFPhiCalibrationLUT(*metHFPhiCalibrationLUT);
0313 
0314   // HI centrality trigger
0315   std::vector<double> etSumCentLower = conf.getParameter<std::vector<double>>("etSumCentralityLower");
0316   std::vector<double> etSumCentUpper = conf.getParameter<std::vector<double>>("etSumCentralityUpper");
0317   if (etSumCentLower.size() == etSumCentUpper.size()) {
0318     for (unsigned i = 0; i < etSumCentLower.size(); ++i) {
0319       m_params_helper.setEtSumCentLower(i, etSumCentLower.at(i));
0320       m_params_helper.setEtSumCentUpper(i, etSumCentUpper.at(i));
0321     }
0322   } else {
0323     edm::LogError("l1t|calo") << "Inconsistent number of Centrality boundaries" << std::endl;
0324   }
0325 
0326   edm::FileInPath centralityLUTFile = conf.getParameter<edm::FileInPath>("centralityLUTFile");
0327   std::ifstream centralityLUTStream(centralityLUTFile.fullPath());
0328   auto centralityLUT = std::make_shared<LUT>(centralityLUTStream);
0329   m_params_helper.setCentralityLUT(*centralityLUT);
0330   m_params_helper.setCentralityRegionMask(conf.getParameter<int>("centralityRegionMask"));
0331   std::vector<int> minbiasThresholds = conf.getParameter<std::vector<int>>("minimumBiasThresholds");
0332   if (minbiasThresholds.size() == 4) {
0333     m_params_helper.setMinimumBiasThresholds(minbiasThresholds);
0334   } else {
0335     edm::LogError("l1t|calo") << "Incorrect number of minimum bias thresholds set.";
0336   }
0337 
0338   // HI Q2 trigger
0339   edm::FileInPath q2LUTFile = conf.getParameter<edm::FileInPath>("q2LUTFile");
0340   std::ifstream q2LUTStream(q2LUTFile.fullPath());
0341   auto q2LUT = std::make_shared<LUT>(q2LUTStream);
0342   m_params_helper.setQ2LUT(*q2LUT);
0343 
0344   // Layer 1 LUT specification
0345   m_params_helper.setLayer1ECalScaleFactors(conf.getParameter<std::vector<double>>("layer1ECalScaleFactors"));
0346   m_params_helper.setLayer1HCalScaleFactors(conf.getParameter<std::vector<double>>("layer1HCalScaleFactors"));
0347   m_params_helper.setLayer1HFScaleFactors(conf.getParameter<std::vector<double>>("layer1HFScaleFactors"));
0348   m_params_helper.setLayer1HCalFBLUTUpper(conf.getParameter<std::vector<unsigned>>("layer1HCalFBLUTUpper"));
0349   m_params_helper.setLayer1HCalFBLUTLower(conf.getParameter<std::vector<unsigned>>("layer1HCalFBLUTLower"));
0350 
0351   m_params_helper.setLayer1ECalScaleETBins(conf.getParameter<std::vector<int>>("layer1ECalScaleETBins"));
0352   m_params_helper.setLayer1HCalScaleETBins(conf.getParameter<std::vector<int>>("layer1HCalScaleETBins"));
0353   m_params_helper.setLayer1HFScaleETBins(conf.getParameter<std::vector<int>>("layer1HFScaleETBins"));
0354 
0355   m_params_helper.setLayer1ECalScalePhiBins(conf.getParameter<std::vector<unsigned>>("layer1ECalScalePhiBins"));
0356   m_params_helper.setLayer1HCalScalePhiBins(conf.getParameter<std::vector<unsigned>>("layer1HCalScalePhiBins"));
0357   m_params_helper.setLayer1HFScalePhiBins(conf.getParameter<std::vector<unsigned>>("layer1HFScalePhiBins"));
0358 
0359   if (conf.existsAs<std::vector<unsigned>>("layer1SecondStageLUT")) {
0360     m_params_helper.setLayer1SecondStageLUT(conf.getParameter<std::vector<unsigned>>("layer1SecondStageLUT"));
0361   }
0362 
0363   m_params = (CaloParams)m_params_helper;
0364 }
0365 
0366 L1TCaloParamsESProducer::~L1TCaloParamsESProducer() {
0367   // do anything here that needs to be done at desctruction time
0368   // (e.g. close files, deallocate resources etc.)
0369 }
0370 
0371 //
0372 // member functions
0373 //
0374 
0375 // ------------ method called to produce the data  ------------
0376 L1TCaloParamsESProducer::ReturnType L1TCaloParamsESProducer::produce(const L1TCaloParamsRcd& iRecord) {
0377   return std::make_unique<CaloParams>(m_params);
0378 }
0379 
0380 //define this as a plug-in
0381 DEFINE_FWK_EVENTSETUP_MODULE(L1TCaloParamsESProducer);