CMS 3D CMS Logo

L1TCaloStage2ParamsESProducer.cc
Go to the documentation of this file.
1 
12 //
13 //
14 
15 
16 
17 
18 // system include files
19 #include <memory>
20 #include <iostream>
21 #include <fstream>
22 
23 // user include files
29 
31 
35 
36 using namespace std;
37 
38 //
39 // class declaration
40 //
41 
42 using namespace l1t;
43 
45 public:
48 
49  using ReturnType = std::unique_ptr<CaloParams>;
50 
51  ReturnType produce(const L1TCaloParamsRcd&);
52 
53 private:
56 };
57 
58 //
59 // constants, enums and typedefs
60 //
61 
62 //
63 // static data member definitions
64 //
65 
66 //
67 // constructors and destructor
68 //
70 {
71 
72  //the following line is needed to tell the framework what
73  // data is being produced
74  setWhatProduced(this);
75  //setWhatProduced(this, conf.getParameter<std::string>("label"));
76 
77  CaloParamsHelper m_params_helper;
78 
79  // towers
80  m_params_helper.setTowerLsbH(conf.getParameter<double>("towerLsbH"));
81  m_params_helper.setTowerLsbE(conf.getParameter<double>("towerLsbE"));
82  m_params_helper.setTowerLsbSum(conf.getParameter<double>("towerLsbSum"));
83  m_params_helper.setTowerNBitsH(conf.getParameter<int>("towerNBitsH"));
84  m_params_helper.setTowerNBitsE(conf.getParameter<int>("towerNBitsE"));
85  m_params_helper.setTowerNBitsSum(conf.getParameter<int>("towerNBitsSum"));
86  m_params_helper.setTowerNBitsRatio(conf.getParameter<int>("towerNBitsRatio"));
87  m_params_helper.setTowerEncoding(conf.getParameter<bool>("towerEncoding"));
88 
89  // regions
90  m_params_helper.setRegionLsb(conf.getParameter<double>("regionLsb"));
91  m_params_helper.setRegionPUSType(conf.getParameter<std::string>("regionPUSType"));
92  m_params_helper.setRegionPUSParams(conf.getParameter<std::vector<double> >("regionPUSParams"));
93 
94  m_params_helper.setPileUpTowerThreshold(conf.getParameter<int>("pileUpTowerThreshold"));
95 
96 
97  // EG
98  m_params_helper.setEgEtaCut(conf.getParameter<int>("egEtaCut"));
99 
100  m_params_helper.setEgLsb(conf.getParameter<double>("egLsb"));
101  m_params_helper.setEgSeedThreshold(conf.getParameter<double>("egSeedThreshold"));
102  m_params_helper.setEgNeighbourThreshold(conf.getParameter<double>("egNeighbourThreshold"));
103  m_params_helper.setEgHcalThreshold(conf.getParameter<double>("egHcalThreshold"));
104 
105  edm::FileInPath egTrimmingLUTFile = conf.getParameter<edm::FileInPath>("egTrimmingLUTFile");
106  std::ifstream egTrimmingLUTStream(egTrimmingLUTFile.fullPath());
107  std::shared_ptr<LUT> egTrimmingLUT( new LUT(egTrimmingLUTStream) );
108  m_params_helper.setEgTrimmingLUT(*egTrimmingLUT);
109 
110  m_params_helper.setEgMaxHcalEt(conf.getParameter<double>("egMaxHcalEt"));
111  m_params_helper.setEgMaxPtHOverE(conf.getParameter<double>("egMaxPtHOverE"));
112  m_params_helper.setEgHOverEcutBarrel(conf.getParameter<int>("egHOverEcutBarrel"));
113  m_params_helper.setEgHOverEcutEndcap(conf.getParameter<int>("egHOverEcutEndcap"));
114 
115  m_params_helper.setEgMinPtJetIsolation(conf.getParameter<int>("egMinPtJetIsolation"));
116  m_params_helper.setEgMaxPtJetIsolation(conf.getParameter<int>("egMaxPtJetIsolation"));
117  m_params_helper.setEgMinPtHOverEIsolation(conf.getParameter<int>("egMinPtHOverEIsolation"));
118  m_params_helper.setEgMaxPtHOverEIsolation(conf.getParameter<int>("egMaxPtHOverEIsolation"));
119  m_params_helper.setEgBypassEGVetos(conf.getParameter<unsigned>("egBypassEGVetos"));
120  m_params_helper.setEgBypassExtHOverE(conf.getParameter<unsigned>("egBypassExtHOverE"));
121  m_params_helper.setEgBypassShape(conf.getParameter<unsigned>("egBypassShape"));
122  m_params_helper.setEgBypassECALFG(conf.getParameter<unsigned>("egBypassECALFG"));
123  m_params_helper.setEgBypassHoE(conf.getParameter<unsigned>("egBypassHoE"));
124 
125 
126  edm::FileInPath egMaxHOverELUTFile = conf.getParameter<edm::FileInPath>("egMaxHOverELUTFile");
127  std::ifstream egMaxHOverELUTStream(egMaxHOverELUTFile.fullPath());
128  std::shared_ptr<LUT> egMaxHOverELUT( new LUT(egMaxHOverELUTStream) );
129  m_params_helper.setEgMaxHOverELUT(*egMaxHOverELUT);
130 
131  edm::FileInPath egCompressShapesLUTFile = conf.getParameter<edm::FileInPath>("egCompressShapesLUTFile");
132  std::ifstream egCompressShapesLUTStream(egCompressShapesLUTFile.fullPath());
133  std::shared_ptr<LUT> egCompressShapesLUT( new LUT(egCompressShapesLUTStream) );
134  m_params_helper.setEgCompressShapesLUT(*egCompressShapesLUT);
135 
136  m_params_helper.setEgShapeIdType(conf.getParameter<std::string>("egShapeIdType"));
137  m_params_helper.setEgShapeIdVersion(conf.getParameter<unsigned>("egShapeIdVersion"));
138  edm::FileInPath egShapeIdLUTFile = conf.getParameter<edm::FileInPath>("egShapeIdLUTFile");
139  std::ifstream egShapeIdLUTStream(egShapeIdLUTFile.fullPath());
140  std::shared_ptr<LUT> egShapeIdLUT( new LUT(egShapeIdLUTStream) );
141  m_params_helper.setEgShapeIdLUT(*egShapeIdLUT);
142 
143  m_params_helper.setEgPUSType(conf.getParameter<std::string>("egPUSType"));
144 
145  m_params_helper.setEgIsolationType(conf.getParameter<std::string>("egIsolationType"));
146  edm::FileInPath egIsoLUTFile = conf.getParameter<edm::FileInPath>("egIsoLUTFile");
147  std::ifstream egIsoLUTStream(egIsoLUTFile.fullPath());
148  std::shared_ptr<LUT> egIsoLUT( new LUT(egIsoLUTStream) );
149  m_params_helper.setEgIsolationLUT(*egIsoLUT);
150  edm::FileInPath egIsoLUTFile2 = conf.getParameter<edm::FileInPath>("egIsoLUTFile2");
151  std::ifstream egIsoLUTStream2(egIsoLUTFile2.fullPath());
152  auto egIsoLUT2 = std::make_shared<LUT>(egIsoLUTStream2);
153  m_params_helper.setEgIsolationLUT2(*egIsoLUT2);
154 
155  //edm::FileInPath egIsoLUTFileBarrel = conf.getParameter<edm::FileInPath>("egIsoLUTFileBarrel");
156  //std::ifstream egIsoLUTBarrelStream(egIsoLUTFileBarrel.fullPath());
157  //std::shared_ptr<LUT> egIsoLUTBarrel( new LUT(egIsoLUTBarrelStream) );
158  //m_params_helper.setEgIsolationLUTBarrel(egIsoLUTBarrel);
159 
160  //edm::FileInPath egIsoLUTFileEndcaps = conf.getParameter<edm::FileInPath>("egIsoLUTFileEndcaps");
161  //std::ifstream egIsoLUTEndcapsStream(egIsoLUTFileEndcaps.fullPath());
162  //std::shared_ptr<LUT> egIsoLUTEndcaps( new LUT(egIsoLUTEndcapsStream) );
163  //m_params_helper.setEgIsolationLUTEndcaps(egIsoLUTEndcaps);
164 
165 
166  m_params_helper.setEgIsoAreaNrTowersEta(conf.getParameter<unsigned int>("egIsoAreaNrTowersEta"));
167  m_params_helper.setEgIsoAreaNrTowersPhi(conf.getParameter<unsigned int>("egIsoAreaNrTowersPhi"));
168  m_params_helper.setEgIsoVetoNrTowersPhi(conf.getParameter<unsigned int>("egIsoVetoNrTowersPhi"));
169  //m_params_helper.setEgIsoPUEstTowerGranularity(conf.getParameter<unsigned int>("egIsoPUEstTowerGranularity"));
170  //m_params_helper.setEgIsoMaxEtaAbsForTowerSum(conf.getParameter<unsigned int>("egIsoMaxEtaAbsForTowerSum"));
171  //m_params_helper.setEgIsoMaxEtaAbsForIsoSum(conf.getParameter<unsigned int>("egIsoMaxEtaAbsForIsoSum"));
172  m_params_helper.setEgPUSParams(conf.getParameter<std::vector<double>>("egPUSParams"));
173 
174  m_params_helper.setEgCalibrationType(conf.getParameter<std::string>("egCalibrationType"));
175  m_params_helper.setEgCalibrationVersion(conf.getParameter<unsigned>("egCalibrationVersion"));
176  edm::FileInPath egCalibrationLUTFile = conf.getParameter<edm::FileInPath>("egCalibrationLUTFile");
177  std::ifstream egCalibrationLUTStream(egCalibrationLUTFile.fullPath());
178  std::shared_ptr<LUT> egCalibrationLUT( new LUT(egCalibrationLUTStream) );
179  m_params_helper.setEgCalibrationLUT(*egCalibrationLUT);
180 
181  // tau
182  m_params_helper.setTauRegionMask(conf.getParameter<int>("tauRegionMask"));
183  m_params_helper.setTauLsb(conf.getParameter<double>("tauLsb"));
184  m_params_helper.setTauSeedThreshold(conf.getParameter<double>("tauSeedThreshold"));
185  m_params_helper.setTauNeighbourThreshold(conf.getParameter<double>("tauNeighbourThreshold"));
186  m_params_helper.setTauMaxPtTauVeto(conf.getParameter<double>("tauMaxPtTauVeto"));
187  m_params_helper.setTauMinPtJetIsolationB(conf.getParameter<double>("tauMinPtJetIsolationB"));
188  m_params_helper.setTauPUSType(conf.getParameter<std::string>("tauPUSType"));
189  m_params_helper.setTauMaxJetIsolationB(conf.getParameter<double>("tauMaxJetIsolationB"));
190  m_params_helper.setTauMaxJetIsolationA(conf.getParameter<double>("tauMaxJetIsolationA"));
191  m_params_helper.setTauIsoAreaNrTowersEta(conf.getParameter<unsigned int>("tauIsoAreaNrTowersEta"));
192  m_params_helper.setTauIsoAreaNrTowersPhi(conf.getParameter<unsigned int>("tauIsoAreaNrTowersPhi"));
193  m_params_helper.setTauIsoVetoNrTowersPhi(conf.getParameter<unsigned int>("tauIsoVetoNrTowersPhi"));
194 
195  edm::FileInPath tauIsoLUTFile = conf.getParameter<edm::FileInPath>("tauIsoLUTFile");
196  std::ifstream tauIsoLUTStream(tauIsoLUTFile.fullPath());
197  std::shared_ptr<LUT> tauIsoLUT( new LUT(tauIsoLUTStream) );
198  m_params_helper.setTauIsolationLUT(*tauIsoLUT);
199 
200  edm::FileInPath tauIsoLUTFile2 = conf.getParameter<edm::FileInPath>("tauIsoLUTFile2");
201  std::ifstream tauIsoLUTStream2(tauIsoLUTFile2.fullPath());
202  std::shared_ptr<LUT> tauIsoLUT2( new LUT(tauIsoLUTStream2) );
203  m_params_helper.setTauIsolationLUT2(*tauIsoLUT2);
204 
205  edm::FileInPath tauTrimmingShapeVetoLUTFile = conf.getParameter<edm::FileInPath>("tauTrimmingShapeVetoLUTFile");
206  std::ifstream tauTrimmingShapeVetoLUTStream(tauTrimmingShapeVetoLUTFile.fullPath());
207  std::shared_ptr<LUT> tauTrimmingShapeVetoLUT( new LUT(tauTrimmingShapeVetoLUTStream) );
208  m_params_helper.setTauTrimmingShapeVetoLUT(*tauTrimmingShapeVetoLUT);
209 
210  edm::FileInPath tauCalibrationLUTFile = conf.getParameter<edm::FileInPath>("tauCalibrationLUTFile");
211  std::ifstream tauCalibrationLUTStream(tauCalibrationLUTFile.fullPath());
212  std::shared_ptr<LUT> tauCalibrationLUT( new LUT(tauCalibrationLUTStream) );
213  m_params_helper.setTauCalibrationLUT(*tauCalibrationLUT);
214 
215  edm::FileInPath tauCompressLUTFile = conf.getParameter<edm::FileInPath>("tauCompressLUTFile");
216  std::ifstream tauCompressLUTStream(tauCompressLUTFile.fullPath());
217  std::shared_ptr<LUT> tauCompressLUT( new LUT(tauCompressLUTStream) );
218  m_params_helper.setTauCompressLUT(*tauCompressLUT);
219 
220  edm::FileInPath tauEtToHFRingEtLUTFile = conf.getParameter<edm::FileInPath>("tauEtToHFRingEtLUTFile");
221  std::ifstream tauEtToHFRingEtLUTStream(tauEtToHFRingEtLUTFile.fullPath());
222  std::shared_ptr<LUT> tauEtToHFRingEtLUT( new LUT(tauEtToHFRingEtLUTStream) );
223  m_params_helper.setTauEtToHFRingEtLUT(*tauEtToHFRingEtLUT);
224 
225  m_params_helper.setIsoTauEtaMin(conf.getParameter<int> ("isoTauEtaMin"));
226  m_params_helper.setIsoTauEtaMax(conf.getParameter<int> ("isoTauEtaMax"));
227 
228  m_params_helper.setTauPUSParams(conf.getParameter<std::vector<double>>("tauPUSParams"));
229 
230  // jets
231  m_params_helper.setJetLsb(conf.getParameter<double>("jetLsb"));
232  m_params_helper.setJetSeedThreshold(conf.getParameter<double>("jetSeedThreshold"));
233  m_params_helper.setJetNeighbourThreshold(conf.getParameter<double>("jetNeighbourThreshold"));
234  m_params_helper.setJetRegionMask(conf.getParameter<int>("jetRegionMask"));
235  m_params_helper.setJetPUSType(conf.getParameter<std::string>("jetPUSType"));
236  m_params_helper.setJetBypassPUS(conf.getParameter<unsigned>("jetBypassPUS"));
237  m_params_helper.setJetPUSUsePhiRing(conf.getParameter<unsigned>("jetPUSUsePhiRing"));
238  m_params_helper.setJetCalibrationType(conf.getParameter<std::string>("jetCalibrationType"));
239  m_params_helper.setJetCalibrationParams(conf.getParameter<std::vector<double> >("jetCalibrationParams"));
240  edm::FileInPath jetCalibrationLUTFile = conf.getParameter<edm::FileInPath>("jetCalibrationLUTFile");
241  std::ifstream jetCalibrationLUTStream(jetCalibrationLUTFile.fullPath());
242  std::shared_ptr<LUT> jetCalibrationLUT( new LUT(jetCalibrationLUTStream) );
243  m_params_helper.setJetCalibrationLUT(*jetCalibrationLUT);
244  edm::FileInPath jetCompressEtaLUTFile = conf.getParameter<edm::FileInPath>("jetCompressEtaLUTFile");
245  std::ifstream jetCompressEtaLUTStream(jetCompressEtaLUTFile.fullPath());
246  std::shared_ptr<LUT> jetCompressEtaLUT( new LUT(jetCompressEtaLUTStream) );
247  m_params_helper.setJetCompressEtaLUT(*jetCompressEtaLUT);
248  edm::FileInPath jetCompressPtLUTFile = conf.getParameter<edm::FileInPath>("jetCompressPtLUTFile");
249  std::ifstream jetCompressPtLUTStream(jetCompressPtLUTFile.fullPath());
250  std::shared_ptr<LUT> jetCompressPtLUT( new LUT(jetCompressPtLUTStream) );
251  m_params_helper.setJetCompressPtLUT(*jetCompressPtLUT);
252 
253  // sums
254  m_params_helper.setEtSumLsb(conf.getParameter<double>("etSumLsb"));
255 
256  std::vector<int> etSumEtaMin = conf.getParameter<std::vector<int> >("etSumEtaMin");
257  std::vector<int> etSumEtaMax = conf.getParameter<std::vector<int> >("etSumEtaMax");
258  std::vector<double> etSumEtThreshold = conf.getParameter<std::vector<double> >("etSumEtThreshold");
259  m_params_helper.setEtSumBypassMetPUS(conf.getParameter<unsigned>("etSumBypassMetPUS"));
260  m_params_helper.setEtSumBypassEttPUS(conf.getParameter<unsigned>("etSumBypassEttPUS"));
261  m_params_helper.setEtSumBypassEcalSumPUS(conf.getParameter<unsigned>("etSumBypassEcalSumPUS"));
262  m_params_helper.setEtSumMetPUSType(conf.getParameter<std::string>("etSumMetPUSType"));
263  m_params_helper.setEtSumEttPUSType(conf.getParameter<std::string>("etSumEttPUSType"));
264  m_params_helper.setEtSumEcalSumPUSType(conf.getParameter<std::string>("etSumEcalSumPUSType"));
265  m_params_helper.setMetCalibrationType(conf.getParameter<std::string>("metCalibrationType"));
266  m_params_helper.setMetHFCalibrationType(conf.getParameter<std::string>("metHFCalibrationType"));
267  m_params_helper.setEtSumEttCalibrationType(conf.getParameter<std::string>("etSumEttCalibrationType"));
268  m_params_helper.setEtSumEcalSumCalibrationType(conf.getParameter<std::string>("etSumEcalSumCalibrationType"));
269 
270 
271  if ((etSumEtaMin.size() == etSumEtaMax.size()) && (etSumEtaMin.size() == etSumEtThreshold.size())) {
272  for (unsigned i=0; i<etSumEtaMin.size(); ++i) {
273  m_params_helper.setEtSumEtaMin(i, etSumEtaMin.at(i));
274  m_params_helper.setEtSumEtaMax(i, etSumEtaMax.at(i));
275  m_params_helper.setEtSumEtThreshold(i, etSumEtThreshold.at(i));
276  }
277  }
278  else {
279  edm::LogError("l1t|calo") << "Inconsistent number of EtSum parameters" << std::endl;
280  }
281 
282  edm::FileInPath etSumMetPUSLUTFile = conf.getParameter<edm::FileInPath>("etSumMetPUSLUTFile");
283  std::ifstream etSumMetPUSLUTStream(etSumMetPUSLUTFile.fullPath());
284  std::shared_ptr<LUT> etSumMetPUSLUT( new LUT(etSumMetPUSLUTStream) );
285  m_params_helper.setEtSumMetPUSLUT(*etSumMetPUSLUT);
286 
287  edm::FileInPath etSumEttPUSLUTFile = conf.getParameter<edm::FileInPath>("etSumEttPUSLUTFile");
288  std::ifstream etSumEttPUSLUTStream(etSumEttPUSLUTFile.fullPath());
289  std::shared_ptr<LUT> etSumEttPUSLUT( new LUT(etSumEttPUSLUTStream) );
290  m_params_helper.setEtSumEttPUSLUT(*etSumEttPUSLUT);
291 
292  edm::FileInPath etSumEcalSumPUSLUTFile = conf.getParameter<edm::FileInPath>("etSumEcalSumPUSLUTFile");
293  std::ifstream etSumEcalSumPUSLUTStream(etSumEcalSumPUSLUTFile.fullPath());
294  std::shared_ptr<LUT> etSumEcalSumPUSLUT( new LUT(etSumEcalSumPUSLUTStream) );
295  m_params_helper.setEtSumEcalSumPUSLUT(*etSumEcalSumPUSLUT);
296 
297 
298  edm::FileInPath metCalibrationLUTFile = conf.getParameter<edm::FileInPath>("metCalibrationLUTFile");
299  std::ifstream metCalibrationLUTStream(metCalibrationLUTFile.fullPath());
300  std::shared_ptr<LUT> metCalibrationLUT( new LUT(metCalibrationLUTStream) );
301  m_params_helper.setMetCalibrationLUT(*metCalibrationLUT);
302 
303  edm::FileInPath metHFCalibrationLUTFile = conf.getParameter<edm::FileInPath>("metHFCalibrationLUTFile");
304  std::ifstream metHFCalibrationLUTStream(metHFCalibrationLUTFile.fullPath());
305  std::shared_ptr<LUT> metHFCalibrationLUT( new LUT(metHFCalibrationLUTStream) );
306  m_params_helper.setMetHFCalibrationLUT(*metHFCalibrationLUT);
307 
308  edm::FileInPath etSumEttCalibrationLUTFile = conf.getParameter<edm::FileInPath>("etSumEttCalibrationLUTFile");
309  std::ifstream etSumEttCalibrationLUTStream(etSumEttCalibrationLUTFile.fullPath());
310  std::shared_ptr<LUT> etSumEttCalibrationLUT( new LUT(etSumEttCalibrationLUTStream) );
311  m_params_helper.setEtSumEttCalibrationLUT(*etSumEttCalibrationLUT);
312 
313  edm::FileInPath etSumEcalSumCalibrationLUTFile = conf.getParameter<edm::FileInPath>("etSumEcalSumCalibrationLUTFile");
314  std::ifstream etSumEcalSumCalibrationLUTStream(etSumEcalSumCalibrationLUTFile.fullPath());
315  std::shared_ptr<LUT> etSumEcalSumCalibrationLUT( new LUT(etSumEcalSumCalibrationLUTStream) );
316  m_params_helper.setEtSumEcalSumCalibrationLUT(*etSumEcalSumCalibrationLUT);
317 
318  edm::FileInPath metPhiCalibrationLUTFile = conf.getParameter<edm::FileInPath>("metPhiCalibrationLUTFile");
319  std::ifstream metPhiCalibrationLUTStream(metPhiCalibrationLUTFile.fullPath());
320  std::shared_ptr<LUT> metPhiCalibrationLUT( new LUT(metPhiCalibrationLUTStream) );
321  m_params_helper.setMetPhiCalibrationLUT(*metPhiCalibrationLUT);
322 
323  edm::FileInPath metHFPhiCalibrationLUTFile = conf.getParameter<edm::FileInPath>("metHFPhiCalibrationLUTFile");
324  std::ifstream metHFPhiCalibrationLUTStream(metHFPhiCalibrationLUTFile.fullPath());
325  std::shared_ptr<LUT> metHFPhiCalibrationLUT( new LUT(metHFPhiCalibrationLUTStream) );
326  m_params_helper.setMetHFPhiCalibrationLUT(*metHFPhiCalibrationLUT);
327 
328 
329  // HI centrality trigger
330  std::vector<double> etSumCentLower = conf.getParameter<std::vector<double>>("etSumCentralityLower");
331  std::vector<double> etSumCentUpper = conf.getParameter<std::vector<double>>("etSumCentralityUpper");
332  if (etSumCentLower.size() == etSumCentUpper.size()){
333  for (unsigned i=0; i<etSumCentLower.size(); ++i) {
334  m_params_helper.setEtSumCentLower(i, etSumCentLower.at(i));
335  m_params_helper.setEtSumCentUpper(i, etSumCentUpper.at(i));
336  }
337  }
338  else {
339  edm::LogError("l1t|calo") << "Inconsistent number of Centrality boundaries" << std::endl;
340  }
341 
342  // HI centrality trigger
343  edm::FileInPath centralityLUTFile = conf.getParameter<edm::FileInPath>("centralityLUTFile");
344  std::ifstream centralityLUTStream(centralityLUTFile.fullPath());
345  std::shared_ptr<LUT> centralityLUT( new LUT(centralityLUTStream) );
346  m_params_helper.setCentralityLUT(*centralityLUT);
347  m_params_helper.setCentralityRegionMask(conf.getParameter<int>("centralityRegionMask"));
348  std::vector<int> minbiasThresholds = conf.getParameter<std::vector<int> >("minimumBiasThresholds");
349  if(minbiasThresholds.size() == 4) {
350  m_params_helper.setMinimumBiasThresholds(minbiasThresholds);
351  } else {
352  edm::LogError("l1t|calo") << "Incorrect number of minimum bias thresholds set.";
353  }
354 
355  // HI Q2 trigger
356  edm::FileInPath q2LUTFile = conf.getParameter<edm::FileInPath>("q2LUTFile");
357  std::ifstream q2LUTStream(q2LUTFile.fullPath());
358  std::shared_ptr<LUT> q2LUT( new LUT(q2LUTStream) );
359  m_params_helper.setQ2LUT(*q2LUT);
360 
361  // Layer 1 LUT specification
362  m_params_helper.setLayer1ECalScaleFactors(conf.getParameter<std::vector<double>>("layer1ECalScaleFactors"));
363  m_params_helper.setLayer1HCalScaleFactors(conf.getParameter<std::vector<double>>("layer1HCalScaleFactors"));
364  m_params_helper.setLayer1HFScaleFactors (conf.getParameter<std::vector<double>>("layer1HFScaleFactors"));
365 
366  m_params_helper.setLayer1ECalScaleETBins(conf.getParameter<std::vector<int>>("layer1ECalScaleETBins"));
367  m_params_helper.setLayer1HCalScaleETBins(conf.getParameter<std::vector<int>>("layer1HCalScaleETBins"));
368  m_params_helper.setLayer1HFScaleETBins (conf.getParameter<std::vector<int>>("layer1HFScaleETBins"));
369 
370  m_params_helper.setLayer1ECalScalePhiBins(conf.exists("layer1ECalScalePhiBins") ? conf.getParameter<std::vector<unsigned>>("layer1ECalScalePhiBins") : std::vector<unsigned>(36,0));
371  m_params_helper.setLayer1HCalScalePhiBins(conf.exists("layer1HCalScalePhiBins") ? conf.getParameter<std::vector<unsigned>>("layer1HCalScalePhiBins") : std::vector<unsigned>(36,0));
372  m_params_helper.setLayer1HFScalePhiBins (conf.exists("layer1HFScalePhiBins") ? conf.getParameter<std::vector<unsigned>>("layer1HFScalePhiBins") : std::vector<unsigned>(36,0));
373 
374  if (conf.existsAs<std::vector<unsigned>>("layer1SecondStageLUT")) {
375  m_params_helper.setLayer1SecondStageLUT(conf.getParameter<std::vector<unsigned>>("layer1SecondStageLUT"));
376  }
377 
378  m_params = (CaloParams)m_params_helper;
379 }
380 
381 
383 {
384 
385  // do anything here that needs to be done at desctruction time
386  // (e.g. close files, deallocate resources etc.)
387 
388 }
389 
390 
391 //
392 // member functions
393 //
394 
395 // ------------ method called to produce the data ------------
398 {
399  return std::make_unique<CaloParams>(m_params);
400 }
401 
402 //define this as a plug-in
void setEtSumEtaMax(unsigned isum, int eta)
void setEtSumEcalSumCalibrationLUT(const l1t::LUT &lut)
void setEtSumEcalSumPUSType(std::string type)
T getParameter(std::string const &) const
void setMetPhiCalibrationLUT(const l1t::LUT &lut)
void setTauMaxJetIsolationA(double cutValue)
void setEgCalibrationVersion(unsigned version)
void setCentralityLUT(const l1t::LUT &lut)
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:161
void setLayer1HFScaleFactors(std::vector< double > params)
void setIsoTauEtaMax(int value)
void setTauMinPtJetIsolationB(double limit)
void setRegionPUSType(std::string type)
void setEtSumBypassMetPUS(unsigned flag)
void setEgNeighbourThreshold(double thresh)
void setEgMinPtHOverEIsolation(int cutValue)
void setEgLsb(double lsb)
void setJetCalibrationParams(std::vector< double > params)
void setTauEtToHFRingEtLUT(const l1t::LUT &lut)
void setTauCalibrationLUT(const l1t::LUT &lut)
void setTauLsb(double lsb)
void setTauIsolationLUT(const l1t::LUT &lut)
void setJetCalibrationLUT(const l1t::LUT &lut)
void setEtSumBypassEcalSumPUS(unsigned flag)
void setTauNeighbourThreshold(double thresh)
void setEgMaxPtJetIsolation(int cutValue)
void setEtSumMetPUSLUT(const l1t::LUT &lut)
void setEgHOverEcutEndcap(int cut)
void setEgHcalThreshold(double thresh)
void setTauIsoAreaNrTowersPhi(unsigned iTauIsoAreaNrTowersPhi)
std::unique_ptr< CaloParams > ReturnType
bool exists(std::string const &parameterName) const
checks if a parameter exists
void setEgBypassExtHOverE(unsigned flag)
void setEtSumEttCalibrationLUT(const l1t::LUT &lut)
void setLayer1ECalScalePhiBins(std::vector< unsigned > params)
void setCentralityRegionMask(int mask)
L1TCaloStage2ParamsESProducer(const edm::ParameterSet &)
delete x;
Definition: CaloConfig.h:22
void setJetCompressEtaLUT(const l1t::LUT &lut)
ReturnType produce(const L1TCaloParamsRcd &)
void setTauIsoAreaNrTowersEta(unsigned iTauIsoAreaNrTowersEta)
void setEgCalibrationLUT(const l1t::LUT &lut)
void setLayer1HCalScalePhiBins(std::vector< unsigned > params)
void setEgShapeIdLUT(const l1t::LUT &lut)
void setEtSumEttPUSLUT(const l1t::LUT &lut)
void setJetCompressPtLUT(const l1t::LUT &lut)
void setEgHOverEcutBarrel(int cut)
void setEtSumEcalSumCalibrationType(std::string type)
void setEgBypassECALFG(unsigned flag)
void setEtSumEtaMin(unsigned isum, int eta)
void setEtSumCentLower(unsigned centClass, double loBound)
void setTauMaxPtTauVeto(double limit)
void setRegionLsb(double lsb)
void setJetCalibrationType(std::string type)
void setEtSumMetPUSType(std::string type)
void setJetPUSUsePhiRing(unsigned flag)
void setTowerLsbH(double lsb)
void setLayer1HCalScaleFactors(std::vector< double > params)
void setEgMinPtJetIsolation(int cutValue)
void setEgBypassEGVetos(unsigned flag)
void setEtSumCentUpper(unsigned centClass, double upBound)
void setEgIsolationLUT2(const l1t::LUT &lut)
void setTauCompressLUT(const l1t::LUT &lut)
void setLayer1HCalScaleETBins(std::vector< int > params)
void setPileUpTowerThreshold(int thresh)
void setEtSumEtThreshold(unsigned isum, double thresh)
void setTauPUSType(std::string type)
void setEgPUSType(std::string type)
void setLayer1ECalScaleETBins(std::vector< int > params)
void setTauSeedThreshold(double thresh)
void setTowerEncoding(bool doit)
void setTauMaxJetIsolationB(double limit)
void setEgIsoAreaNrTowersPhi(unsigned iEgIsoAreaNrTowersPhi)
void setEgBypassShape(unsigned flag)
void setJetNeighbourThreshold(double thresh)
void setEgShapeIdVersion(unsigned version)
void setTauRegionMask(int mask)
void setJetRegionMask(int mask)
void setEgEtaCut(int mask)
void setEgMaxHcalEt(double cut)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void setLayer1SecondStageLUT(const std::vector< unsigned > &lut)
void setLayer1HFScalePhiBins(std::vector< unsigned > params)
void setJetLsb(double lsb)
void setTauPUSParams(const std::vector< double > &params)
void setLayer1HFScaleETBins(std::vector< int > params)
void setEtSumEttCalibrationType(std::string type)
void setQ2LUT(const l1t::LUT &lut)
void setEtSumBypassEttPUS(unsigned flag)
void setEgMaxHOverELUT(const l1t::LUT &lut)
void setMinimumBiasThresholds(std::vector< int > thresholds)
void setMetCalibrationType(std::string type)
void setJetSeedThreshold(double thresh)
void setMetHFCalibrationType(std::string type)
void setEgMaxPtHOverE(double thresh)
void setLayer1ECalScaleFactors(std::vector< double > params)
void setEgTrimmingLUT(const l1t::LUT &lut)
void setRegionPUSParams(const std::vector< double > &params)
void setEgIsolationLUT(const l1t::LUT &lut)
void setEgMaxPtHOverEIsolation(int cutValue)
void setTauIsolationLUT2(const l1t::LUT &lut)
void setJetBypassPUS(unsigned flag)
void setTauTrimmingShapeVetoLUT(const l1t::LUT &lut)
void setMetHFPhiCalibrationLUT(const l1t::LUT &lut)
void setEgBypassHoE(unsigned flag)
void setMetHFCalibrationLUT(const l1t::LUT &lut)
void setEtSumEttPUSType(std::string type)
std::string fullPath() const
Definition: FileInPath.cc:163
void setEgSeedThreshold(double thresh)
void setTauIsoVetoNrTowersPhi(unsigned iTauIsoVetoNrTowersPhi)
void setMetCalibrationLUT(const l1t::LUT &lut)
void setJetPUSType(std::string type)
void setEgIsoVetoNrTowersPhi(unsigned iEgIsoVetoNrTowersPhi)
void setEtSumLsb(double lsb)
void setEgIsoAreaNrTowersEta(unsigned iEgIsoAreaNrTowersEta)
std::vector< unsigned short int > LUT
Definition: DTTracoLUTs.h:31
void setEgShapeIdType(std::string type)
void setIsoTauEtaMin(int value)
void setTowerLsbSum(double lsb)
void setEgPUSParams(const std::vector< double > &params)
void setTowerLsbE(double lsb)
void setEgCalibrationType(std::string type)
void setEtSumEcalSumPUSLUT(const l1t::LUT &lut)
void setEgCompressShapesLUT(const l1t::LUT &lut)
void setTowerNBitsRatio(int n)
void setEgIsolationType(std::string type)