CMS 3D CMS Logo

Classes | Functions
L1TCaloParamsOnlineProd.cc File Reference
#include <iostream>
#include <fstream>
#include <stdexcept>
#include <sstream>
#include "CondTools/L1TriggerExt/interface/L1ConfigOnlineProdBaseExt.h"
#include "CondFormats/L1TObjects/interface/CaloParams.h"
#include "CondFormats/DataRecord/interface/L1TCaloStage2ParamsRcd.h"
#include "CondFormats/DataRecord/interface/L1TCaloParamsO2ORcd.h"
#include "L1Trigger/L1TCommon/interface/TriggerSystem.h"
#include "L1Trigger/L1TCommon/interface/XmlConfigParser.h"
#include "L1Trigger/L1TCommon/interface/ConvertToLUT.h"
#include "L1Trigger/L1TCalorimeter/interface/CaloParamsHelper.h"
#include "OnlineDBqueryHelper.h"
#include "xercesc/util/PlatformUtils.hpp"

Go to the source code of this file.

Classes

class  L1TCaloParamsOnlineProd
 

Functions

bool readCaloLayer1OnlineSettings (l1t::CaloParamsHelper &paramsHelper, std::map< std::string, l1t::Parameter > &conf, std::map< std::string, l1t::Mask > &)
 
bool readCaloLayer2OnlineSettings (l1t::CaloParamsHelper &paramsHelper, std::map< std::string, l1t::Parameter > &conf, std::map< std::string, l1t::Mask > &)
 
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker< edm::DescriptionFillerForESProducers< L1TCaloParamsOnlineProd > > s_filler__LINE__ ("L1TCaloParamsOnlineProd")
 
static const edm::eventsetup::ModulePluginFactory::PMaker< edm::eventsetup::ModuleMaker< L1TCaloParamsOnlineProd > > s_maker__LINE__ ("L1TCaloParamsOnlineProd")
 

Function Documentation

bool readCaloLayer1OnlineSettings ( l1t::CaloParamsHelper paramsHelper,
std::map< std::string, l1t::Parameter > &  conf,
std::map< std::string, l1t::Mask > &   
)

Definition at line 29 of file L1TCaloParamsOnlineProd.cc.

References MessageLogger_cfi::cerr, l1t::CaloParamsHelper::setLayer1ECalScaleETBins(), l1t::CaloParamsHelper::setLayer1ECalScaleFactors(), l1t::CaloParamsHelper::setLayer1HCalScaleETBins(), l1t::CaloParamsHelper::setLayer1HCalScaleFactors(), l1t::CaloParamsHelper::setLayer1HFScaleETBins(), and l1t::CaloParamsHelper::setLayer1HFScaleFactors().

Referenced by L1TCaloParamsOnlineProd::newObject().

29  {
30  const char * expectedParams[] = {
31  "layer1ECalScaleFactors",
32  "layer1HCalScaleFactors",
33  "layer1HFScaleFactors",
34  "layer1ECalScaleETBins",
35  "layer1HCalScaleETBins",
36  "layer1HFScaleETBins"
37  };
38  for (const auto param : expectedParams) {
39  if ( conf.find(param) == conf.end() ) {
40  std::cerr << "Unable to locate expected CaloLayer1 parameter: " << param << " in L1 settings payload!";
41  return false;
42  }
43  }
44  // Layer 1 LUT specification
45  paramsHelper.setLayer1ECalScaleFactors((conf["layer1ECalScaleFactors"].getVector<double>()));
46  paramsHelper.setLayer1HCalScaleFactors((conf["layer1HCalScaleFactors"].getVector<double>()));
47  paramsHelper.setLayer1HFScaleFactors ((conf["layer1HFScaleFactors"] .getVector<double>()));
48  paramsHelper.setLayer1ECalScaleETBins(conf["layer1ECalScaleETBins"].getVector<int>());
49  paramsHelper.setLayer1HCalScaleETBins(conf["layer1HCalScaleETBins"].getVector<int>());
50  paramsHelper.setLayer1HFScaleETBins (conf["layer1HFScaleETBins"] .getVector<int>());
51 
52  return true;
53 }
void setLayer1HCalScaleETBins(const std::vector< int > params)
void setLayer1HFScaleETBins(const std::vector< int > params)
void setLayer1ECalScaleETBins(const std::vector< int > params)
void setLayer1HCalScaleFactors(const std::vector< double > params)
void setLayer1HFScaleFactors(const std::vector< double > params)
void setLayer1ECalScaleFactors(const std::vector< double > params)
bool readCaloLayer2OnlineSettings ( l1t::CaloParamsHelper paramsHelper,
std::map< std::string, l1t::Parameter > &  conf,
std::map< std::string, l1t::Mask > &   
)

Definition at line 56 of file L1TCaloParamsOnlineProd.cc.

References MessageLogger_cfi::cerr, l1t::convertToLUT(), mps_fire::i, l1t::CaloParamsHelper::setEgBypassEGVetos(), l1t::CaloParamsHelper::setEgCalibrationLUT(), l1t::CaloParamsHelper::setEgEtaCut(), l1t::CaloParamsHelper::setEgHOverEcutBarrel(), l1t::CaloParamsHelper::setEgHOverEcutEndcap(), l1t::CaloParamsHelper::setEgIsolationLUT(), l1t::CaloParamsHelper::setEgMaxPtHOverE(), l1t::CaloParamsHelper::setEgNeighbourThreshold(), l1t::CaloParamsHelper::setEgSeedThreshold(), l1t::CaloParamsHelper::setEtSumEcalSumPUSLUT(), l1t::CaloParamsHelper::setEtSumEtaMax(), l1t::CaloParamsHelper::setEtSumEtThreshold(), l1t::CaloParamsHelper::setEtSumEttPUSLUT(), l1t::CaloParamsHelper::setEtSumXPUSLUT(), l1t::CaloParamsHelper::setIsoTauEtaMax(), l1t::CaloParamsHelper::setJetBypassPUS(), l1t::CaloParamsHelper::setJetCalibrationLUT(), l1t::CaloParamsHelper::setJetSeedThreshold(), l1t::CaloParamsHelper::setTauCalibrationLUT(), l1t::CaloParamsHelper::setTauIsolationLUT(), l1t::CaloParamsHelper::setTauIsolationLUT2(), l1t::CaloParamsHelper::setTauNeighbourThreshold(), and l1t::CaloParamsHelper::setTauSeedThreshold().

Referenced by L1TCaloParamsOnlineProd::newObject().

56  {
57  const char * expectedParams[] = {
58  "leptonSeedThreshold",
59  "leptonTowerThreshold",
60  "pileUpTowerThreshold",
61  "jetSeedThreshold",
62  "jetMaxEta",
63  "HTMHT_maxJetEta",
64  "HT_jetThreshold",
65  "MHT_jetThreshold",
66  "jetEnergyCalibLUT",
67  "ETMET_maxTowerEta",
68  "ET_energyCalibLUT",
69  "ecalET_energyCalibLUT",
70  "METX_energyCalibLUT",
71  "METY_energyCalibLUT",
72  "egammaRelaxationThreshold",
73  "egammaMaxEta",
74  "egammaEnergyCalibLUT",
75  "egammaIsoLUT",
76  "tauMaxEta",
77  "tauEnergyCalibLUT",
78  "tauIsoLUT1",
79  "tauIsoLUT2",
80  "towerCountThreshold",
81  "towerCountMaxEta",
82  "ET_towerThreshold",
83  "MET_towerThreshold",
84  "jetBypassPileUpSub",
85  "egammaBypassCuts",
86  "egammaHOverECut_iEtaLT15",
87  "egammaHOverECut_iEtaGTEq15"
88  };
89  for (const auto param : expectedParams) {
90  if ( conf.find(param) == conf.end() ) {
91  std::cerr << "Unable to locate expected CaloLayer2 parameter: " << param << " in L1 settings payload!";
92  return false;
93  }
94  }
95  // Layer 2 params specification
96  paramsHelper.setEgSeedThreshold((conf["leptonSeedThreshold"].getValue<int>())/2);
97  paramsHelper.setTauSeedThreshold((conf["leptonSeedThreshold"].getValue<int>())/2);
98  paramsHelper.setEgNeighbourThreshold((conf["leptonTowerThreshold"].getValue<int>())/2);
99  paramsHelper.setTauNeighbourThreshold((conf["leptonTowerThreshold"].getValue<int>())/2);
100  paramsHelper.setJetSeedThreshold((conf["jetSeedThreshold"].getValue<int>())/2);
101  paramsHelper.setJetBypassPUS(conf["jetBypassPileUpSub"].getValue<bool>());
102  paramsHelper.setEgBypassEGVetos(conf["egammaBypassCuts"].getValue<bool>());
103  paramsHelper.setEgHOverEcutBarrel(conf["egammaHOverECut_iEtaLT15"].getValue<int>());
104  paramsHelper.setEgHOverEcutEndcap(conf["egammaHOverECut_iEtaGTEq15"].getValue<int>());
105 
106 
107  // Currently not used // paramsHelper.setEgPileupTowerThresh((conf["pileUpTowerThreshold"].getValue<int>()));
108  // Currently not used // paramsHelper.setTauPileupTowerThresh((conf["pileUpTowerThreshold"].getValue<int>()));
109  // Currently not used // paramsHelper.setJetMaxEta((conf["jetMaxEta"].getValue<int>()));
110 
111  std::vector<int> etSumEtaMax;
112  std::vector<int> etSumEtThresh;
113 
114  etSumEtaMax.push_back(conf["ETMET_maxTowerEta"].getValue<int>());
115  etSumEtaMax.push_back(conf["HTMHT_maxJetEta"].getValue<int>());
116  etSumEtaMax.push_back(conf["ETMET_maxTowerEta"].getValue<int>());
117  etSumEtaMax.push_back(conf["HTMHT_maxJetEta"].getValue<int>());
118  etSumEtaMax.push_back(conf["towerCountMaxEta"].getValue<int>());
119 
120  etSumEtThresh.push_back(conf["ET_towerThreshold"].getValue<int>()/2); // ETT tower threshold
121  etSumEtThresh.push_back(conf["HT_jetThreshold"].getValue<int>()/2);
122  etSumEtThresh.push_back(conf["MET_towerThreshold"].getValue<int>()/2); // ETM tower threshold
123  etSumEtThresh.push_back(conf["MHT_jetThreshold"].getValue<int>()/2);
124  etSumEtThresh.push_back(conf["ET_towerThreshold"].getValue<int>()/2);
125 
126  for (uint i=0; i<5; ++i) {
127  paramsHelper.setEtSumEtaMax(i, etSumEtaMax.at(i));
128  paramsHelper.setEtSumEtThreshold(i, etSumEtThresh.at(i));
129  }
130 
131  paramsHelper.setJetCalibrationLUT ( l1t::convertToLUT( conf["jetEnergyCalibLUT"].getVector<uint32_t>() ) );
132  paramsHelper.setEtSumEttPUSLUT ( l1t::convertToLUT( conf["ET_energyCalibLUT"].getVector<int>() ) );
133  paramsHelper.setEtSumEcalSumPUSLUT( l1t::convertToLUT( conf["ecalET_energyCalibLUT"].getVector<int>() ) );
134  paramsHelper.setEtSumXPUSLUT ( l1t::convertToLUT( conf["METX_energyCalibLUT"].getVector<int>() ) );
135  paramsHelper.setEgMaxPtHOverE((conf["egammaRelaxationThreshold"].getValue<int>())/2.);
136  paramsHelper.setEgEtaCut((conf["egammaMaxEta"].getValue<int>()));
137  paramsHelper.setEgCalibrationLUT ( l1t::convertToLUT( conf["egammaEnergyCalibLUT"].getVector<int>() ) );
138  paramsHelper.setEgIsolationLUT ( l1t::convertToLUT( conf["egammaIsoLUT"].getVector<int>() ) );
139 
140  paramsHelper.setIsoTauEtaMax((conf["tauMaxEta"].getValue<int>()));
141 
142  paramsHelper.setTauCalibrationLUT( l1t::convertToLUT( conf["tauEnergyCalibLUT"].getVector<int>() ) );
143  paramsHelper.setTauIsolationLUT ( l1t::convertToLUT( conf["tauIsoLUT1"].getVector<int>() ) );
144  paramsHelper.setTauIsolationLUT2 ( l1t::convertToLUT( conf["tauIsoLUT2"].getVector<int>() ) );
145 
146  return true;
147 }
void setEtSumEtaMax(unsigned isum, int eta)
void setIsoTauEtaMax(int value)
void setEgNeighbourThreshold(double thresh)
void setTauCalibrationLUT(const l1t::LUT &lut)
void setTauIsolationLUT(const l1t::LUT &lut)
void setJetCalibrationLUT(const l1t::LUT &lut)
void setTauNeighbourThreshold(double thresh)
void setEgHOverEcutEndcap(int cut)
void setEtSumXPUSLUT(const l1t::LUT &lut)
void setEgCalibrationLUT(const l1t::LUT &lut)
void setEtSumEttPUSLUT(const l1t::LUT &lut)
void setEgHOverEcutBarrel(int cut)
void setEgBypassEGVetos(unsigned flag)
void setEtSumEtThreshold(unsigned isum, double thresh)
void setTauSeedThreshold(double thresh)
l1t::LUT convertToLUT(const std::vector< uint64_t > &v, int padding=-1) noexcept
Definition: ConvertToLUT.h:10
void setEgEtaCut(int mask)
void setJetSeedThreshold(double thresh)
void setEgMaxPtHOverE(double thresh)
void setEgIsolationLUT(const l1t::LUT &lut)
void setTauIsolationLUT2(const l1t::LUT &lut)
void setJetBypassPUS(unsigned flag)
void setEgSeedThreshold(double thresh)
void setEtSumEcalSumPUSLUT(const l1t::LUT &lut)
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::DescriptionFillerForESProducers< L1TCaloParamsOnlineProd > > s_filler__LINE__ ( "L1TCaloParamsOnlineProd"  )
static
static const edm::eventsetup::ModulePluginFactory ::PMaker< edm::eventsetup::ModuleMaker< L1TCaloParamsOnlineProd > > s_maker__LINE__ ( "L1TCaloParamsOnlineProd"  )
static