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::setLayer1ECalScalePhiBins(), l1t::CaloParamsHelper::setLayer1HCalScaleETBins(), l1t::CaloParamsHelper::setLayer1HCalScaleFactors(), l1t::CaloParamsHelper::setLayer1HCalScalePhiBins(), l1t::CaloParamsHelper::setLayer1HFScaleETBins(), l1t::CaloParamsHelper::setLayer1HFScaleFactors(), and l1t::CaloParamsHelper::setLayer1HFScalePhiBins().

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  paramsHelper.setLayer1ECalScalePhiBins(conf.find("layer1ECalScalePhiBins") != conf.end() ? conf["layer1ECalScalePhiBins"].getVector<unsigned int>() : std::vector<unsigned>(36,0));
52  paramsHelper.setLayer1HCalScalePhiBins(conf.find("layer1HCalScalePhiBins") != conf.end() ? conf["layer1HCalScalePhiBins"].getVector<unsigned int>() : std::vector<unsigned>(36,0));
53  paramsHelper.setLayer1HFScalePhiBins (conf.find("layer1HFScalePhiBins") != conf.end() ? conf["layer1HFScalePhiBins"] .getVector<unsigned int>() : std::vector<unsigned>(36,0));
54 
55  return true;
56 }
void setLayer1HCalScaleETBins(const std::vector< int > params)
void setLayer1ECalScalePhiBins(const std::vector< unsigned > 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)
void setLayer1HCalScalePhiBins(const std::vector< unsigned > params)
void setLayer1HFScalePhiBins(const std::vector< unsigned > params)
bool readCaloLayer2OnlineSettings ( l1t::CaloParamsHelper paramsHelper,
std::map< std::string, l1t::Parameter > &  conf,
std::map< std::string, l1t::Mask > &   
)

Definition at line 59 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::setEtSumEcalSumCalibrationLUT(), l1t::CaloParamsHelper::setEtSumEtaMax(), l1t::CaloParamsHelper::setEtSumEttCalibrationLUT(), l1t::CaloParamsHelper::setEtSumEtThreshold(), l1t::CaloParamsHelper::setEtSumXCalibrationLUT(), 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().

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