CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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/TrigSystem.h"
#include "L1Trigger/L1TCommon/interface/XmlConfigReader.h"
#include "L1Trigger/L1TCalorimeter/interface/CaloParamsHelper.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::Setting > &conf, std::map< std::string, l1t::Mask > &)
 
bool readCaloLayer2OnlineSettings (l1t::CaloParamsHelper &paramsHelper, std::map< std::string, l1t::Setting > &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::Setting > &  conf,
std::map< std::string, l1t::Mask > &   
)

Definition at line 27 of file L1TCaloParamsOnlineProd.cc.

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

Referenced by L1TCaloParamsOnlineProd::newObject().

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

Definition at line 54 of file L1TCaloParamsOnlineProd.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, 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().

54  {
55  const char * expectedParams[] = {
56  "leptonSeedThreshold",
57  "leptonTowerThreshold",
58  "pileUpTowerThreshold",
59  "jetSeedThreshold",
60  "jetMaxEta",
61  "HTMHT_maxJetEta",
62  "HT_jetThreshold",
63  "MHT_jetThreshold",
64  "jetEnergyCalibLUT",
65  "ETMET_maxTowerEta",
66  "ET_energyCalibLUT",
67  "ecalET_energyCalibLUT",
68  "METX_energyCalibLUT",
69  "METY_energyCalibLUT",
70  "egammaRelaxationThreshold",
71  "egammaMaxEta",
72  "egammaEnergyCalibLUT",
73  "egammaIsoLUT",
74  "tauMaxEta",
75  "tauEnergyCalibLUT",
76  "tauIsoLUT1",
77  "tauIsoLUT2",
78  "towerCountThreshold",
79  "towerCountMaxEta",
80  "ET_towerThreshold",
81  "MET_towerThreshold",
82  "jetBypassPileUpSub",
83  "egammaBypassCuts",
84  "egammaHOverECut_iEtaLT15",
85  "egammaHOverECut_iEtaGTEq15"
86  };
87  for (const auto param : expectedParams) {
88  if ( conf.find(param) == conf.end() ) {
89  std::cerr << "Unable to locate expected CaloLayer2 parameter: " << param << " in L1 settings payload!";
90  return false;
91  }
92  }
93  // Layer 2 params specification
94  paramsHelper.setEgSeedThreshold((conf["leptonSeedThreshold"].getValue<int>())/2);
95  paramsHelper.setTauSeedThreshold((conf["leptonSeedThreshold"].getValue<int>())/2);
96  paramsHelper.setEgNeighbourThreshold((conf["leptonTowerThreshold"].getValue<int>())/2);
97  paramsHelper.setTauNeighbourThreshold((conf["leptonTowerThreshold"].getValue<int>())/2);
98  paramsHelper.setJetSeedThreshold((conf["jetSeedThreshold"].getValue<int>())/2);
99  paramsHelper.setJetBypassPUS(conf["jetBypassPileUpSub"].getValue<unsigned>()); //these are bools in onlineDB
100  paramsHelper.setEgBypassEGVetos(conf["egammaBypassCuts"].getValue<unsigned>()); //these are bools in onlineDB
101  paramsHelper.setEgHOverEcutBarrel(conf["egammaHOverECut_iEtaLT15"].getValue<int>());
102  paramsHelper.setEgHOverEcutEndcap(conf["egammaHOverECut_iEtaGTEq15"].getValue<int>());
103 
104 
105  // Currently not used // paramsHelper.setEgPileupTowerThresh((conf["pileUpTowerThreshold"].getValue<int>()));
106  // Currently not used // paramsHelper.setTauPileupTowerThresh((conf["pileUpTowerThreshold"].getValue<int>()));
107  // Currently not used // paramsHelper.setJetMaxEta((conf["jetMaxEta"].getValue<int>()));
108 
109  std::vector<int> etSumEtaMax;
110  std::vector<int> etSumEtThresh;
111 
112  etSumEtaMax.push_back(conf["ETMET_maxTowerEta"].getValue<int>());
113  etSumEtaMax.push_back(conf["HTMHT_maxJetEta"].getValue<int>());
114  etSumEtaMax.push_back(conf["ETMET_maxTowerEta"].getValue<int>());
115  etSumEtaMax.push_back(conf["HTMHT_maxJetEta"].getValue<int>());
116  etSumEtaMax.push_back(conf["towerCountMaxEta"].getValue<int>());
117 
118  etSumEtThresh.push_back(conf["ET_towerThreshold"].getValue<int>()); // ETT tower threshold
119  etSumEtThresh.push_back(conf["HT_jetThreshold"].getValue<int>());
120  etSumEtThresh.push_back(conf["MET_towerThreshold"].getValue<int>()); // ETM tower threshold
121  etSumEtThresh.push_back(conf["MHT_jetThreshold"].getValue<int>());
122  etSumEtThresh.push_back(conf["ET_towerThreshold"].getValue<int>());
123 
124  for (uint i=0; i<5; ++i) {
125  paramsHelper.setEtSumEtaMax(i, etSumEtaMax.at(i));
126  paramsHelper.setEtSumEtThreshold(i, etSumEtThresh.at(i));
127  }
128 
129  std::stringstream oss;
130 
131  std::vector<uint32_t> jetEnergyCalibLUT = conf["jetEnergyCalibLUT"].getVector<uint32_t>();
132  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(jetEnergyCalibLUT.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
133  for(unsigned int i=0; i<jetEnergyCalibLUT.size(); i++) oss << i << " " << jetEnergyCalibLUT[i] << std::endl;
134 
135  std::istringstream iss1( oss.str() );
136  paramsHelper.setJetCalibrationLUT( l1t::LUT( (std::istream&)iss1 ) );
137  oss.str("");
138 
139  std::vector<int> etSumEttPUSLUT = conf["ET_energyCalibLUT"].getVector<int>();
140  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(etSumEttPUSLUT.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
141  for(unsigned int i=0; i<etSumEttPUSLUT.size(); i++) oss << i << " " << etSumEttPUSLUT[i] << std::endl;
142 
143  std::istringstream iss2( oss.str() );
144  paramsHelper.setEtSumEttPUSLUT( l1t::LUT( (std::istream&)iss2 ) );
145  oss.str("");
146 
147  std::vector<int> etSumEcalSumPUTLUT = conf["ecalET_energyCalibLUT"].getVector<int>();
148  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(etSumEcalSumPUTLUT.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
149  for(unsigned int i=0; i<etSumEcalSumPUTLUT.size(); i++) oss << i << " " << etSumEcalSumPUTLUT[i] << std::endl;
150 
151  std::istringstream iss3( oss.str() );
152  paramsHelper.setEtSumEcalSumPUSLUT( l1t::LUT( (std::istream&)iss3 ) );
153  oss.str("");
154 
155  std::vector<int> etSumXPUSLUT = conf["METX_energyCalibLUT"].getVector<int>();
156  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(etSumXPUSLUT.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
157  for(unsigned int i=0; i<etSumXPUSLUT.size(); i++) oss << i << " " << etSumXPUSLUT[i] << std::endl;
158 
159  std::istringstream iss4( oss.str() );
160  paramsHelper.setEtSumXPUSLUT( l1t::LUT( (std::istream&)iss4 ) );
161  oss.str("");
162 
163  paramsHelper.setEgMaxPtHOverE((conf["egammaRelaxationThreshold"].getValue<int>()));
164  paramsHelper.setEgEtaCut((conf["egammaMaxEta"].getValue<int>()));
165 
166 
167  std::vector<int> egCalibrationLUT = conf["egammaEnergyCalibLUT"].getVector<int>();
168  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(egCalibrationLUT.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
169  for(unsigned int i=0; i<egCalibrationLUT.size(); i++) oss << i << " " << egCalibrationLUT[i] << std::endl;
170 
171  std::istringstream iss5( oss.str() );
172  paramsHelper.setEgCalibrationLUT( l1t::LUT( (std::istream&)iss5 ) );
173  oss.str("");
174 
175  std::vector<int> egIsolationLUT = conf["egammaIsoLUT"].getVector<int>();
176  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(egIsolationLUT.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
177  for(unsigned int i=0; i<egIsolationLUT.size(); i++) oss << i << " " << egIsolationLUT[i] << std::endl;
178 
179  std::istringstream iss6( oss.str() );
180  paramsHelper.setEgIsolationLUT( l1t::LUT( (std::istream&)iss6 ) );
181  oss.str("");
182 
183  //std::cout<<"egammaIsoLUT: "<<std::endl;
184  //for(unsigned int i=0; i<paramsHelper.egIsolationLUT()->maxSize(); i++) std::cout << std::setprecision(14) << paramsHelper.egIsolationLUT()->data(i) <<", ";
185  //std::cout << std::endl;
186 
187  paramsHelper.setIsoTauEtaMax((conf["tauMaxEta"].getValue<int>()));
188 
189  std::vector<int> tauCalibrationLUT = conf["tauEnergyCalibLUT"].getVector<int>();
190  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(tauCalibrationLUT.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
191  for(unsigned int i=0; i<tauCalibrationLUT.size(); i++) oss << i << " " << tauCalibrationLUT[i] << std::endl;
192 
193  std::istringstream iss7( oss.str() );
194  paramsHelper.setTauCalibrationLUT(l1t::LUT( (std::istream&)iss7 ));
195  oss.str("");
196 
197  std::vector<int> tauIsolationLUT = conf["tauIsoLUT1"].getVector<int>();
198  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(tauIsolationLUT.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
199  for(unsigned int i=0; i<tauIsolationLUT.size(); i++) oss << i << " " << tauIsolationLUT[i] << std::endl;
200 
201  std::istringstream iss8( oss.str() );
202  paramsHelper.setTauIsolationLUT( l1t::LUT((std::istream&)iss8 ) );
203  oss.str("");
204 
205  std::vector<int> tauIsolationLUT2 = conf["tauIsoLUT2"].getVector<int>();
206  oss <<"#<header> V1 "<< ( 32 - __builtin_clz( uint32_t(tauIsolationLUT2.size()-1) ) ) <<" 63 </header> "<<std::endl; // hardcode max bits for data
207  for(unsigned int i=0; i<tauIsolationLUT2.size(); i++) oss << i << " " << tauIsolationLUT2[i] << std::endl;
208 
209  std::istringstream iss9( oss.str() );
210  paramsHelper.setTauIsolationLUT2( l1t::LUT( (std::istream&)iss9 ) );
211  oss.str("");
212 
213  return true;
214 }
void setEtSumEtaMax(unsigned isum, int eta)
int i
Definition: DBlmapReader.cc:9
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)
void setEgEtaCut(int mask)
Definition: LUT.h:29
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