CMS 3D CMS Logo

CaloParamsHelper.h
Go to the documentation of this file.
1 // CaloParamsHelper.h
2 // Author: R. Alex Barbieri
3 //
4 // Wrapper class for CaloParams and Et scales
5 
6 #include <iostream>
7 
9 
15 
16 #ifndef CaloParamsHelper_h
17 #define CaloParamsHelper_h
18 
19 namespace l1t {
20 
21  class CaloParamsHelper : public CaloParams {
22  public:
23  // DO NOT ADD ENTRIES ANYWHERE BUT DIRECTLY BEFORE "NUM_CALOPARAMNODES"
24  // DO NOT CHANGE NUMERICAL VALUES OF ANY ALREADY EXISTING FIELDS, YOU CAN ONLY EXTEND, AT THE END.
25  enum {
26  regionPUS = 0,
30  egShapeId = 4,
32  egPUS = 6,
35  tauPUS = 9,
37  jetPUS = 11,
40  hiQ2 = 14,
43  layer1ECal = 17,
44  layer1HCal = 18,
45  layer1HF = 19,
77  };
78 
82 
83  bool isValidForStage1() const { return true; }
84  bool isValidForStage2() const { return (version_ >= 2); }
85 
86  L1CaloEtScale emScale() const { return emScale_; }
88  L1CaloEtScale jetScale() const { return jetScale_; }
94 
95  // towers
96  double towerLsbH() const { return towerp_.lsbH_; }
97  double towerLsbE() const { return towerp_.lsbE_; }
98  double towerLsbSum() const { return towerp_.lsbSum_; }
99  int towerNBitsH() const { return towerp_.nBitsH_; }
100  int towerNBitsE() const { return towerp_.nBitsE_; }
101  int towerNBitsSum() const { return towerp_.nBitsSum_; }
102  int towerNBitsRatio() const { return towerp_.nBitsRatio_; }
103  int towerMaskE() const { return towerp_.maskE_; }
104  int towerMaskH() const { return towerp_.maskH_; }
105  int towerMaskSum() const { return towerp_.maskSum_; }
106  int towerMaskRatio() const { return towerp_.maskRatio_; }
107  bool doTowerEncoding() const { return towerp_.doEncoding_; }
108 
109  void setTowerLsbH(double lsb) { towerp_.lsbH_ = lsb; }
110  void setTowerLsbE(double lsb) { towerp_.lsbE_ = lsb; }
111  void setTowerLsbSum(double lsb) { towerp_.lsbSum_ = lsb; }
112  void setTowerNBitsH(int n) {
113  towerp_.nBitsH_ = n;
114  towerp_.maskH_ = std::pow(2, n) - 1;
115  }
116  void setTowerNBitsE(int n) {
117  towerp_.nBitsE_ = n;
118  towerp_.maskE_ = std::pow(2, n) - 1;
119  }
120  void setTowerNBitsSum(int n) {
121  towerp_.nBitsSum_ = n;
122  towerp_.maskSum_ = std::pow(2, n) - 1;
123  }
124  void setTowerNBitsRatio(int n) {
126  towerp_.maskRatio_ = std::pow(2, n) - 1;
127  }
128  void setTowerEncoding(bool doit) { towerp_.doEncoding_ = doit; }
129 
130  // regions
131  double regionLsb() const { return regionLsb_; }
132  std::string const& regionPUSType() const { return pnode_[regionPUS].type_; }
133  std::vector<double> const& regionPUSParams() const { return pnode_[regionPUS].dparams_; }
134  l1t::LUT* regionPUSLUT() { return &pnode_[regionPUS].LUT_; }
135  l1t::LUT const* regionPUSLUT() const { return &pnode_[regionPUS].LUT_; }
136 
137  int regionPUSValue(int PUM0, int eta) const {
138  int puSub = ceil(regionPUSParams()[18 * eta + PUM0] * 2);
139  return puSub;
140  }
141 
142  void setRegionLsb(double lsb) { regionLsb_ = lsb; }
144  void setRegionPUSParams(const std::vector<double>& params) { pnode_[regionPUS].dparams_ = params; }
145  void setRegionPUSLUT(const l1t::LUT& lut) { pnode_[regionPUS].LUT_ = lut; }
146 
147  int pileUpTowerThreshold() const { return pnode_[PUTowerThreshold].iparams_[0]; }
149  pnode_[PUTowerThreshold].iparams_.resize(1);
150  pnode_[PUTowerThreshold].iparams_[0] = thresh;
151  }
152 
153  // EG
154  int egEtaCut() const {
155  if (pnode_[egPUS].version_ == 1)
156  return pnode_[egPUS].iparams_[0];
157  else
158  return 0;
159  }
160  double egLsb() const { return egp_.lsb_; }
161  double egSeedThreshold() const { return egp_.seedThreshold_; }
162  double egNeighbourThreshold() const { return egp_.neighbourThreshold_; }
163  double egHcalThreshold() const { return egp_.hcalThreshold_; }
164  l1t::LUT* egTrimmingLUT() { return &pnode_[egTrimming].LUT_; }
165  l1t::LUT const* egTrimmingLUT() const { return &pnode_[egTrimming].LUT_; }
166  double egMaxHcalEt() const { return egp_.maxHcalEt_; }
167  double egMaxPtHOverE() const { return egp_.maxPtHOverE_; }
169  l1t::LUT const* egMaxHOverELUT() const { return &pnode_[egMaxHOverE].LUT_; }
171  l1t::LUT const* egCompressShapesLUT() const { return &pnode_[egCompressShapes].LUT_; }
172  l1t::LUT* egShapeIdLUT() { return &pnode_[egShapeId].LUT_; }
173  l1t::LUT const* egShapeIdLUT() const { return &pnode_[egShapeId].LUT_; }
178  unsigned egBypassEGVetos() const { return pnode_[egBypassEGVetosFlag].uparams_[0]; }
179  unsigned egBypassExtHOverE() const { return pnode_[egBypassExtHoE].uparams_[0]; }
180  unsigned egBypassShape() const {
181  if (pnode_[egBypassShapeFlag].uparams_.empty())
182  return 0;
183  else
184  return pnode_[egBypassShapeFlag].uparams_[0];
185  }
186  unsigned egBypassECALFG() const {
187  if (pnode_[egBypassECALFGFlag].uparams_.empty())
188  return 0;
189  else
190  return pnode_[egBypassECALFGFlag].uparams_[0];
191  }
192  unsigned egBypassHoE() const {
193  if (pnode_[egBypassHoEFlag].uparams_.empty())
194  return 0;
195  else
196  return pnode_[egBypassHoEFlag].uparams_[0];
197  }
198 
199  int egHOverEcutBarrel() const { return pnode_[egHOverEBarrel].iparams_[0]; }
200  int egHOverEcutEndcap() const { return pnode_[egHOverEEndcap].iparams_[0]; }
201 
202  unsigned egIsoAreaNrTowersEta() const { return egp_.isoAreaNrTowersEta_; }
203  unsigned egIsoAreaNrTowersPhi() const { return egp_.isoAreaNrTowersPhi_; }
204  unsigned egIsoVetoNrTowersPhi() const { return egp_.isoVetoNrTowersPhi_; }
205  const std::string& egPUSType() const { return pnode_[egPUS].type_; }
206  const std::vector<double>& egPUSParams() const { return pnode_[egPUS].dparams_; }
207  double egPUSParam(int ipar) const { return pnode_[egPUS].dparams_.at(ipar); }
208 
209  std::string const& egIsolationType() const { return pnode_[egIsolation].type_; }
210  l1t::LUT const* egIsolationLUT() const { return &pnode_[egIsolation].LUT_; }
212  l1t::LUT const* egIsolationLUT2() const { return &pnode_[egIsolation2].LUT_; }
214  std::string const& egCalibrationType() const { return pnode_[egCalibration].type_; }
215  std::vector<double> const& egCalibrationParams() const { return pnode_[egCalibration].dparams_; }
216  l1t::LUT const* egCalibrationLUT() const { return &pnode_[egCalibration].LUT_; }
218 
219  void setEgEtaCut(int mask) {
220  pnode_[egPUS].iparams_.resize(1);
221  pnode_[egPUS].iparams_[0] = mask;
222  }
223  void setEgLsb(double lsb) { egp_.lsb_ = lsb; }
227  void setEgTrimmingLUT(const l1t::LUT& lut) { pnode_[egTrimming].LUT_ = lut; }
228  void setEgMaxHcalEt(double cut) { egp_.maxHcalEt_ = cut; }
230  void setEgMaxHOverELUT(const l1t::LUT& lut) { pnode_[egMaxHOverE].LUT_ = lut; }
231  void setEgCompressShapesLUT(const l1t::LUT& lut) { pnode_[egCompressShapes].LUT_ = lut; }
232  void setEgShapeIdLUT(const l1t::LUT& lut) { pnode_[egShapeId].LUT_ = lut; }
233  void setEgMinPtJetIsolation(int cutValue) { egp_.minPtJetIsolation_ = cutValue; }
234  void setEgMaxPtJetIsolation(int cutValue) { egp_.maxPtJetIsolation_ = cutValue; }
235  void setEgMinPtHOverEIsolation(int cutValue) { egp_.minPtHOverEIsolation_ = cutValue; }
236  void setEgMaxPtHOverEIsolation(int cutValue) { egp_.maxPtHOverEIsolation_ = cutValue; }
237  void setEgBypassEGVetos(unsigned flag) {
238  pnode_[egBypassEGVetosFlag].uparams_.resize(1);
239  pnode_[egBypassEGVetosFlag].uparams_[0] = flag;
240  }
241  void setEgBypassExtHOverE(unsigned flag) {
242  pnode_[egBypassExtHoE].uparams_.resize(1);
243  pnode_[egBypassExtHoE].uparams_[0] = flag;
244  }
245  void setEgBypassShape(unsigned flag) {
246  pnode_[egBypassShapeFlag].uparams_.resize(1);
247  pnode_[egBypassShapeFlag].uparams_[0] = flag;
248  }
249  void setEgBypassECALFG(unsigned flag) {
250  pnode_[egBypassECALFGFlag].uparams_.resize(1);
251  pnode_[egBypassECALFGFlag].uparams_[0] = flag;
252  }
253  void setEgBypassHoE(unsigned flag) {
254  pnode_[egBypassHoEFlag].uparams_.resize(1);
255  pnode_[egBypassHoEFlag].uparams_[0] = flag;
256  }
258  pnode_[egHOverEBarrel].iparams_.resize(1);
259  pnode_[egHOverEBarrel].iparams_[0] = cut;
260  }
262  pnode_[egHOverEEndcap].iparams_.resize(1);
263  pnode_[egHOverEEndcap].iparams_[0] = cut;
264  }
265 
266  void setEgIsoAreaNrTowersEta(unsigned iEgIsoAreaNrTowersEta) { egp_.isoAreaNrTowersEta_ = iEgIsoAreaNrTowersEta; }
267  void setEgIsoAreaNrTowersPhi(unsigned iEgIsoAreaNrTowersPhi) { egp_.isoAreaNrTowersPhi_ = iEgIsoAreaNrTowersPhi; }
268  void setEgIsoVetoNrTowersPhi(unsigned iEgIsoVetoNrTowersPhi) { egp_.isoVetoNrTowersPhi_ = iEgIsoVetoNrTowersPhi; }
270  void setEgPUSParams(const std::vector<double>& params) { pnode_[egPUS].dparams_ = params; }
272  void setEgIsolationLUT(const l1t::LUT& lut) { pnode_[egIsolation].LUT_ = lut; }
273  void setEgIsolationLUT2(const l1t::LUT& lut) { pnode_[egIsolation2].LUT_ = lut; }
275  void setEgCalibrationParams(std::vector<double> params) { pnode_[egCalibration].dparams_ = params; }
276  void setEgCalibrationLUT(const l1t::LUT& lut) { pnode_[egCalibration].LUT_ = lut; }
277 
278  // - recently imported:
279  std::string const& egShapeIdType() const { return pnode_[egShapeId].type_; }
281  unsigned egShapeIdVersion() const { return pnode_[egShapeId].version_; }
282  void setEgShapeIdVersion(unsigned version) { pnode_[egShapeId].version_ = version; }
283  unsigned egCalibrationVersion() const { return pnode_[egCalibration].version_; }
285 
286  // tau
287  int tauRegionMask() const {
288  if (pnode_[tauPUS].version_ == 1)
289  return pnode_[tauPUS].iparams_[0];
290  else
291  return 0;
292  }
293  double tauLsb() const { return taup_.lsb_; }
294  double tauSeedThreshold() const { return taup_.seedThreshold_; }
296  double tauMaxPtTauVeto() const { return taup_.maxPtTauVeto_; }
298  double tauMaxJetIsolationB() const { return taup_.maxJetIsolationB_; }
299  double tauMaxJetIsolationA() const { return taup_.maxJetIsolationA_; }
300  int isoTauEtaMin() const { return taup_.isoEtaMin_; }
301  int isoTauEtaMax() const { return taup_.isoEtaMax_; }
302  std::string tauPUSType() const { return pnode_[tauPUS].type_; }
303  const std::vector<double>& tauPUSParams() const { return pnode_[tauPUS].dparams_; }
304  double tauPUSParam(int ipar) const { return pnode_[tauPUS].dparams_.at(ipar); }
305 
307  l1t::LUT const* tauIsolationLUT() const { return &pnode_[tauIsolation].LUT_; }
309  l1t::LUT const* tauIsolationLUT2() const { return &pnode_[tauIsolation2].LUT_; }
312 
313  std::string const& tauCalibrationType() const { return pnode_[tauCalibration].type_; }
314  std::vector<double> const& tauCalibrationParams() const { return pnode_[tauCalibration].dparams_; }
316  l1t::LUT const* tauCalibrationLUT() const { return &pnode_[tauCalibration].LUT_; }
318  l1t::LUT const* tauCompressLUT() const { return &pnode_[tauCompress].LUT_; }
319 
320  l1t::LUT const* tauEtToHFRingEtLUT() const { return &pnode_[tauEtToHFRingEt].LUT_; }
322 
323  unsigned tauIsoAreaNrTowersEta() const { return taup_.isoAreaNrTowersEta_; }
324  unsigned tauIsoAreaNrTowersPhi() const { return taup_.isoAreaNrTowersPhi_; }
325  unsigned tauIsoVetoNrTowersPhi() const { return taup_.isoVetoNrTowersPhi_; }
326 
327  void setTauRegionMask(int mask) {
328  pnode_[tauPUS].iparams_.resize(1);
329  pnode_[tauPUS].iparams_[0] = mask;
330  }
331  void setTauLsb(double lsb) { taup_.lsb_ = lsb; }
337  void setTauMaxJetIsolationA(double cutValue) { taup_.maxJetIsolationA_ = cutValue; }
341  void setTauIsolationLUT(const l1t::LUT& lut) { pnode_[tauIsolation].LUT_ = lut; }
342  void setTauIsolationLUT2(const l1t::LUT& lut) { pnode_[tauIsolation2].LUT_ = lut; }
344 
346  void setTauIsoAreaNrTowersEta(unsigned iTauIsoAreaNrTowersEta) {
347  taup_.isoAreaNrTowersEta_ = iTauIsoAreaNrTowersEta;
348  }
349  void setTauIsoAreaNrTowersPhi(unsigned iTauIsoAreaNrTowersPhi) {
350  taup_.isoAreaNrTowersPhi_ = iTauIsoAreaNrTowersPhi;
351  }
352  void setTauIsoVetoNrTowersPhi(unsigned iTauIsoVetoNrTowersPhi) {
353  taup_.isoVetoNrTowersPhi_ = iTauIsoVetoNrTowersPhi;
354  }
355 
356  void setTauCalibrationParams(std::vector<double> params) { pnode_[tauCalibration].dparams_ = params; }
357  void setTauCalibrationLUT(const l1t::LUT& lut) { pnode_[tauCalibration].LUT_ = lut; }
358  void setTauCompressLUT(const l1t::LUT& lut) { pnode_[tauCompress].LUT_ = lut; }
359  void setTauPUSParams(const std::vector<double>& params) { pnode_[tauPUS].dparams_ = params; }
360 
361  void setTauEtToHFRingEtLUT(const l1t::LUT& lut) { pnode_[tauEtToHFRingEt].LUT_ = lut; }
362 
363  // jets
364  double jetLsb() const { return jetp_.lsb_; }
365  double jetSeedThreshold() const { return jetp_.seedThreshold_; }
367  int jetRegionMask() const {
368  if (pnode_[jetPUS].version_ == 1)
369  return pnode_[jetPUS].iparams_[0];
370  else
371  return 0;
372  }
373 
374  unsigned jetBypassPUS() const { return pnode_[jetBypassPUSFlag].uparams_[0]; }
375  unsigned jetPUSUsePhiRing() const {
376  if (pnode_[jetPUSUsePhiRingFlag].uparams_.empty())
377  return 0;
378  else
379  return pnode_[jetPUSUsePhiRingFlag].uparams_[0];
380  }
381 
382  std::string jetPUSType() const { return pnode_[jetPUS].type_; }
383  std::vector<double> const& jetPUSParams() const { return pnode_[jetPUS].dparams_; }
384  std::string const& jetCalibrationType() const { return pnode_[jetCalibration].type_; }
385  std::vector<double> const& jetCalibrationParams() const { return pnode_[jetCalibration].dparams_; }
386 
388  l1t::LUT const* jetCalibrationLUT() const { return &pnode_[jetCalibration].LUT_; }
390  l1t::LUT const* jetCompressPtLUT() const { return &pnode_[jetCompressPt].LUT_; }
392  l1t::LUT const* jetCompressEtaLUT() const { return &pnode_[jetCompressEta].LUT_; }
393 
394  void setJetLsb(double lsb) { jetp_.lsb_ = lsb; }
397  void setJetRegionMask(int mask) {
398  pnode_[jetPUS].iparams_.resize(1);
399  pnode_[jetPUS].iparams_[0] = mask;
400  }
402  void setJetPUSParams(std::vector<double> params) { pnode_[jetPUS].dparams_ = params; }
404  void setJetCalibrationParams(std::vector<double> params) { pnode_[jetCalibration].dparams_ = params; }
405  void setJetCalibrationLUT(const l1t::LUT& lut) { pnode_[jetCalibration].LUT_ = lut; }
406  void setJetCompressEtaLUT(const l1t::LUT& lut) { pnode_[jetCompressEta].LUT_ = lut; }
407  void setJetCompressPtLUT(const l1t::LUT& lut) { pnode_[jetCompressPt].LUT_ = lut; }
408  void setJetBypassPUS(unsigned flag) {
409  pnode_[jetBypassPUSFlag].uparams_.resize(1);
410  pnode_[jetBypassPUSFlag].uparams_[0] = flag;
411  }
412  void setJetPUSUsePhiRing(unsigned flag) {
413  pnode_[jetPUSUsePhiRingFlag].uparams_.resize(1);
414  pnode_[jetPUSUsePhiRingFlag].uparams_[0] = flag;
415  }
416 
417  // sums
418 
419  double etSumLsb() const { return etSumLsb_; }
420  int etSumEtaMin(unsigned isum) const;
421  int etSumEtaMax(unsigned isum) const;
422  double etSumEtThreshold(unsigned isum) const;
423  unsigned etSumBypassMetPUS() const { return pnode_[etSumBypassMetPUSFlag].uparams_[0]; }
424  unsigned etSumBypassEttPUS() const { return pnode_[etSumBypassEttPUSFlag].uparams_[0]; }
425  unsigned etSumBypassEcalSumPUS() const { return pnode_[etSumBypassEcalSumPUSFlag].uparams_[0]; }
426  std::string const& etSumMetPUSType() const { return pnode_[etSumMetPUS].type_; }
427  std::string const& etSumEttPUSType() const { return pnode_[etSumEttPUS].type_; }
428  std::string const& etSumEcalSumPUSType() const { return pnode_[etSumEcalSumPUS].type_; }
429  std::string const& metCalibrationType() const { return pnode_[metCalibration].type_; }
430  std::string const& metHFCalibrationType() const { return pnode_[metHFCalibration].type_; }
433 
435  l1t::LUT const* etSumMetPUSLUT() const { return &pnode_[etSumMetPUS].LUT_; }
437  l1t::LUT const* etSumEttPUSLUT() const { return &pnode_[etSumEttPUS].LUT_; }
439  l1t::LUT const* etSumEcalSumPUSLUT() const { return &pnode_[etSumEcalSumPUS].LUT_; }
441  l1t::LUT const* metCalibrationLUT() const { return &pnode_[metCalibration].LUT_; }
443  l1t::LUT const* metHFCalibrationLUT() const { return &pnode_[metHFCalibration].LUT_; }
445  l1t::LUT const* etSumEttCalibrationLUT() const { return &pnode_[etSumEttCalibration].LUT_; }
449  l1t::LUT const* metPhiCalibrationLUT() const { return &pnode_[metPhiCalibration].LUT_; }
451  l1t::LUT const* metHFPhiCalibrationLUT() const { return &pnode_[metHFPhiCalibration].LUT_; }
452 
453  void setEtSumLsb(double lsb) { etSumLsb_ = lsb; }
454  void setEtSumEtaMin(unsigned isum, int eta);
455  void setEtSumEtaMax(unsigned isum, int eta);
456  void setEtSumEtThreshold(unsigned isum, double thresh);
464  void setEtSumBypassMetPUS(unsigned flag) {
465  pnode_[etSumBypassMetPUSFlag].uparams_.resize(1);
466  pnode_[etSumBypassMetPUSFlag].uparams_[0] = flag;
467  }
468  void setEtSumBypassEttPUS(unsigned flag) {
469  pnode_[etSumBypassEttPUSFlag].uparams_.resize(1);
470  pnode_[etSumBypassEttPUSFlag].uparams_[0] = flag;
471  }
473  pnode_[etSumBypassEcalSumPUSFlag].uparams_.resize(1);
474  pnode_[etSumBypassEcalSumPUSFlag].uparams_[0] = flag;
475  }
476 
477  void setEtSumMetPUSLUT(const l1t::LUT& lut) { pnode_[etSumMetPUS].LUT_ = lut; }
478  void setEtSumEttPUSLUT(const l1t::LUT& lut) { pnode_[etSumEttPUS].LUT_ = lut; }
479  void setEtSumEcalSumPUSLUT(const l1t::LUT& lut) { pnode_[etSumEcalSumPUS].LUT_ = lut; }
480  void setMetCalibrationLUT(const l1t::LUT& lut) { pnode_[metCalibration].LUT_ = lut; }
481  void setMetHFCalibrationLUT(const l1t::LUT& lut) { pnode_[metHFCalibration].LUT_ = lut; }
484  void setMetPhiCalibrationLUT(const l1t::LUT& lut) { pnode_[metPhiCalibration].LUT_ = lut; }
486 
487  // HI centrality
488  int centralityRegionMask() const {
489  if (pnode_[hiCentrality].version_ == 1)
490  return pnode_[hiCentrality].iparams_[0];
491  else
492  return 0;
493  }
494  std::vector<int> minimumBiasThresholds() const {
495  if (pnode_[hiCentrality].version_ == 1 && pnode_[hiCentrality].iparams_.size() == 5) {
496  std::vector<int> newVec;
497  newVec.reserve(4);
498  for (int i = 0; i < 4; i++) {
499  newVec.push_back(pnode_[hiCentrality].iparams_.at(i + 1));
500  }
501  return newVec;
502  } else {
503  std::vector<int> newVec;
504  return newVec;
505  }
506  }
508  l1t::LUT const* centralityLUT() const { return &pnode_[hiCentrality].LUT_; }
510  pnode_[hiCentrality].iparams_.resize(5);
511  pnode_[hiCentrality].iparams_[0] = mask;
512  }
513  void setMinimumBiasThresholds(std::vector<int> thresholds) {
514  pnode_[hiCentrality].iparams_.resize(5);
515  for (int i = 0; i < 4; i++) {
516  pnode_[hiCentrality].iparams_[i + 1] = thresholds.at(i);
517  }
518  }
519  void setCentralityLUT(const l1t::LUT& lut) { pnode_[hiCentrality].LUT_ = lut; }
520 
521  // HI Q2
522  l1t::LUT* q2LUT() { return &pnode_[hiQ2].LUT_; }
523  l1t::LUT const* q2LUT() const { return &pnode_[hiQ2].LUT_; }
524  void setQ2LUT(const l1t::LUT& lut) { pnode_[hiQ2].LUT_ = lut; }
525 
526  // HI parameters
527  double etSumCentLower(unsigned centClass) const {
528  if (pnode_[etSumCentralityLower].dparams_.size() > centClass)
529  return pnode_[etSumCentralityLower].dparams_.at(centClass);
530  else
531  return 0.;
532  }
533  double etSumCentUpper(unsigned centClass) const {
534  if (pnode_[etSumCentralityUpper].dparams_.size() > centClass)
535  return pnode_[etSumCentralityUpper].dparams_.at(centClass);
536  else
537  return 0.;
538  }
539  void setEtSumCentLower(unsigned centClass, double loBound) {
540  if (pnode_[etSumCentralityLower].dparams_.size() <= centClass)
541  pnode_[etSumCentralityLower].dparams_.resize(centClass + 1);
542  pnode_[etSumCentralityLower].dparams_.at(centClass) = loBound;
543  }
544  void setEtSumCentUpper(unsigned centClass, double upBound) {
545  if (pnode_[etSumCentralityUpper].dparams_.size() <= centClass)
546  pnode_[etSumCentralityUpper].dparams_.resize(centClass + 1);
547  pnode_[etSumCentralityUpper].dparams_.at(centClass) = upBound;
548  }
549 
550  // Layer 1 LUT specification
551  std::vector<double> const& layer1ECalScaleFactors() const { return pnode_[layer1ECal].dparams_; }
552  std::vector<double> const& layer1HCalScaleFactors() const { return pnode_[layer1HCal].dparams_; }
553  std::vector<double> const& layer1HFScaleFactors() const { return pnode_[layer1HF].dparams_; }
554  std::vector<int> const& layer1ECalScaleETBins() const { return pnode_[layer1ECal].iparams_; }
555  std::vector<int> const& layer1HCalScaleETBins() const { return pnode_[layer1HCal].iparams_; }
556  std::vector<int> const& layer1HFScaleETBins() const { return pnode_[layer1HF].iparams_; }
557  std::vector<unsigned> const& layer1ECalScalePhiBins() const { return pnode_[layer1ECal].uparams_; }
558  std::vector<unsigned> const& layer1HCalScalePhiBins() const { return pnode_[layer1HCal].uparams_; }
559  std::vector<unsigned> const& layer1HFScalePhiBins() const { return pnode_[layer1HF].uparams_; }
560  void setLayer1ECalScaleFactors(std::vector<double> params) { pnode_[layer1ECal].dparams_ = std::move(params); }
561  void setLayer1HCalScaleFactors(std::vector<double> params) { pnode_[layer1HCal].dparams_ = std::move(params); }
562  void setLayer1HFScaleFactors(std::vector<double> params) { pnode_[layer1HF].dparams_ = std::move(params); }
563  void setLayer1ECalScaleETBins(std::vector<int> params) { pnode_[layer1ECal].iparams_ = std::move(params); }
564  void setLayer1HCalScaleETBins(std::vector<int> params) { pnode_[layer1HCal].iparams_ = std::move(params); }
565  void setLayer1HFScaleETBins(std::vector<int> params) { pnode_[layer1HF].iparams_ = std::move(params); }
566  void setLayer1ECalScalePhiBins(std::vector<unsigned> params) { pnode_[layer1ECal].uparams_ = std::move(params); }
567  void setLayer1HCalScalePhiBins(std::vector<unsigned> params) { pnode_[layer1HCal].uparams_ = std::move(params); }
568  void setLayer1HFScalePhiBins(std::vector<unsigned> params) { pnode_[layer1HF].uparams_ = std::move(params); }
569 
570  std::vector<unsigned> const& layer1SecondStageLUT() const { return pnode_[layer1HOverE].uparams_; }
571  void setLayer1SecondStageLUT(const std::vector<unsigned>& lut) { pnode_[layer1HOverE].uparams_ = lut; }
572 
573  void setNode(int pos, const Node& n) { pnode_[pos] = n; }
574  const std::vector<Node>& getNodes(void) const { return pnode_; }
575 
576  private:
581  friend std::ostream& operator<<(std::ostream& os, const CaloParamsHelper& h);
582  };
583 
584  std::ostream& operator<<(std::ostream& os, const l1t::CaloParamsHelper& p);
585 
586 } // namespace l1t
587 
588 #endif
void setEtSumEtaMax(unsigned isum, int eta)
void setEtSumEcalSumCalibrationLUT(const l1t::LUT &lut)
void setEtSumEcalSumPUSType(std::string type)
unsigned jetBypassPUS() const
friend std::ostream & operator<<(std::ostream &os, const CaloParamsHelper &h)
std::string const & egShapeIdType() const
constexpr int32_t ceil(float num)
double tauMaxJetIsolationB() const
l1t::LUT const * tauCompressLUT() const
std::vector< unsigned > const & layer1HFScalePhiBins() const
void setMetPhiCalibrationLUT(const l1t::LUT &lut)
void setTauMaxJetIsolationA(double cutValue)
unsigned egIsoAreaNrTowersPhi() const
l1t::LUT const * jetCalibrationLUT() const
bool doTowerEncoding() const
void setEgCalibrationVersion(unsigned version)
void setCentralityLUT(const l1t::LUT &lut)
bool isValidForStage2() const
void setLayer1HFScaleFactors(std::vector< double > params)
double etSumCentUpper(unsigned centClass) const
void setIsoTauEtaMax(int value)
void setTauMinPtJetIsolationB(double limit)
l1t::LUT const * metHFPhiCalibrationLUT() const
double etSumCentLower(unsigned centClass) const
l1t::LUT * jetCalibrationLUT()
std::string const & etSumEcalSumPUSType() const
l1t::LUT const * egCompressShapesLUT() const
void setRegionPUSType(std::string type)
void setEtSumBypassMetPUS(unsigned flag)
L1CaloEtScale jetScale() const
void setEgNeighbourThreshold(double thresh)
void setEgMinPtHOverEIsolation(int cutValue)
EgParams egp_
Definition: CaloParams.h:243
void setEgLsb(double lsb)
void setJetCalibrationParams(std::vector< double > params)
void setTauEtToHFRingEtLUT(const l1t::LUT &lut)
L1CaloEtScale emScale() const
unsigned etSumBypassEcalSumPUS() const
l1t::LUT * metCalibrationLUT()
void setTauCalibrationLUT(const l1t::LUT &lut)
const std::vector< double > & tauPUSParams() const
void setTauLsb(double lsb)
void setTauIsolationLUT(const l1t::LUT &lut)
void setJetCalibrationLUT(const l1t::LUT &lut)
double tauPUSParam(int ipar) const
unsigned egCalibrationVersion() const
std::vector< unsigned > const & layer1ECalScalePhiBins() const
std::string jetPUSType() const
double towerLsbE() const
void setEtSumBypassEcalSumPUS(unsigned flag)
unsigned egBypassHoE() const
l1t::LUT const * egIsolationLUT() const
void setTauNeighbourThreshold(double thresh)
void setEgMaxPtJetIsolation(int cutValue)
void setEtSumMetPUSLUT(const l1t::LUT &lut)
void setEgHOverEcutEndcap(int cut)
l1t::LUT * metHFPhiCalibrationLUT()
void setEgHcalThreshold(double thresh)
void setTauIsoAreaNrTowersPhi(unsigned iTauIsoAreaNrTowersPhi)
unsigned tauIsoAreaNrTowersEta() const
std::vector< Node > pnode_
Definition: CaloParams.h:236
void setJetScale(L1CaloEtScale jetScale)
bool isValidForStage1() const
const std::vector< Node > & getNodes(void) const
void setEgBypassExtHOverE(unsigned flag)
void setEtSumEttCalibrationLUT(const l1t::LUT &lut)
void setLayer1ECalScalePhiBins(std::vector< unsigned > params)
void setCentralityRegionMask(int mask)
TowerParams towerp_
Definition: CaloParams.h:238
std::string const & etSumEttCalibrationType() const
delete x;
Definition: CaloConfig.h:22
std::vector< double > const & egCalibrationParams() const
std::vector< double > const & regionPUSParams() const
double isum
double tauMaxPtTauVeto() const
void setJetCompressEtaLUT(const l1t::LUT &lut)
const std::string & egPUSType() const
l1t::LUT const * tauCalibrationLUT() const
int egMinPtJetIsolation() const
l1t::LUT const * egShapeIdLUT() const
std::vector< int > minimumBiasThresholds() const
l1t::LUT * tauTrimmingShapeVetoLUT()
l1t::LUT const * jetCompressEtaLUT() const
void setHfRingScale(L1CaloEtScale HfRingScale)
unsigned egShapeIdVersion() const
std::vector< int > const & layer1ECalScaleETBins() const
void setTauIsoAreaNrTowersEta(unsigned iTauIsoAreaNrTowersEta)
double jetSeedThreshold() const
l1t::LUT const * q2LUT() const
void setEgCalibrationLUT(const l1t::LUT &lut)
void setRegionPUSLUT(const l1t::LUT &lut)
void setLayer1HCalScalePhiBins(std::vector< unsigned > params)
double etSumEtThreshold(unsigned isum) const
std::string const & metCalibrationType() const
constexpr uint32_t mask
Definition: gpuClustering.h:26
void setEgShapeIdLUT(const l1t::LUT &lut)
l1t::LUT const * jetCompressPtLUT() const
L1CaloEtScale HtMissScale_
double regionLsb_
Definition: CaloParams.h:241
void setHtMissScale(L1CaloEtScale HtMissScale)
void setEtSumEttPUSLUT(const l1t::LUT &lut)
l1t::LUT const * metHFCalibrationLUT() const
std::vector< double > const & layer1HCalScaleFactors() const
double egNeighbourThreshold() const
void setJetCompressPtLUT(const l1t::LUT &lut)
l1t::LUT const * tauIsolationLUT() const
double tauSeedThreshold() const
l1t::LUT const * metCalibrationLUT() const
void setEgHOverEcutBarrel(int cut)
unsigned egBypassEGVetos() const
l1t::LUT * egCompressShapesLUT()
void setEtSumEcalSumCalibrationType(std::string type)
double egHcalThreshold() const
std::vector< double > const & tauCalibrationParams() const
L1CaloEtScale HtMissScale() const
void setEgBypassECALFG(unsigned flag)
void setEtSumEtaMin(unsigned isum, int eta)
unsigned egIsoVetoNrTowersPhi() const
l1t::LUT * tauIsolationLUT2()
void setEtSumCentLower(unsigned centClass, double loBound)
void setTauMaxPtTauVeto(double limit)
void setRegionLsb(double lsb)
int egMinPtHOverEIsolation() const
void setJetCalibrationType(std::string type)
std::string const & jetCalibrationType() const
int etSumEtaMax(unsigned isum) const
unsigned etSumBypassMetPUS() const
void setEtSumMetPUSType(std::string type)
void setJetPUSUsePhiRing(unsigned flag)
JetParams jetp_
Definition: CaloParams.h:245
void setTowerLsbH(double lsb)
std::vector< double > const & layer1ECalScaleFactors() const
void setLayer1HCalScaleFactors(std::vector< double > params)
int etSumEtaMin(unsigned isum) const
void setEgMinPtJetIsolation(int cutValue)
unsigned egBypassShape() const
double regionLsb() const
l1t::LUT const * metPhiCalibrationLUT() const
std::string const & etSumEcalSumCalibrationType() const
void setEgBypassEGVetos(unsigned flag)
void setEtSumCentUpper(unsigned centClass, double upBound)
void setEgIsolationLUT2(const l1t::LUT &lut)
void setTauCompressLUT(const l1t::LUT &lut)
std::string const & etSumMetPUSType() const
l1t::LUT const * tauTrimmingShapeVetoLUT() const
void setLayer1HCalScaleETBins(std::vector< int > params)
l1t::LUT * tauEtToHFRingEtLUT()
void setPileUpTowerThreshold(int thresh)
void setEtSumEtThreshold(unsigned isum, double thresh)
double egMaxHcalEt() const
void setNode(int pos, const Node &n)
void setTauPUSType(std::string type)
unsigned egBypassECALFG() const
l1t::LUT const * etSumMetPUSLUT() const
void setEgPUSType(std::string type)
void setLayer1ECalScaleETBins(std::vector< int > params)
Definition: value.py:1
double tauMaxJetIsolationA() const
unsigned egBypassExtHOverE() const
l1t::LUT const * regionPUSLUT() const
std::string const & egCalibrationType() const
l1t::LUT * egIsolationLUT2()
double egSeedThreshold() const
void setTauSeedThreshold(double thresh)
void setTowerEncoding(bool doit)
l1t::LUT * jetCompressPtLUT()
double towerLsbH() const
l1t::LUT const * etSumEttPUSLUT() const
void setTauMaxJetIsolationB(double limit)
void setTauCalibrationType(std::string type)
void setEgIsoAreaNrTowersPhi(unsigned iEgIsoAreaNrTowersPhi)
void setEgBypassShape(unsigned flag)
l1t::LUT const * tauIsolationLUT2() const
l1t::LUT const * tauEtToHFRingEtLUT() const
std::string const & etSumEttPUSType() const
void setJetNeighbourThreshold(double thresh)
void setEgShapeIdVersion(unsigned version)
void setTauRegionMask(int mask)
void setJetRegionMask(int mask)
void setEgEtaCut(int mask)
void setJetPUSParams(std::vector< double > params)
void setEgMaxHcalEt(double cut)
unsigned version_
Definition: CaloParams.h:234
l1t::LUT * etSumEcalSumCalibrationLUT()
std::ostream & operator<<(std::ostream &os, const l1t::CaloParamsHelper &p)
Definition: LUT.h:29
std::vector< double > const & jetPUSParams() const
TauParams taup_
Definition: CaloParams.h:244
l1t::LUT const * etSumEttCalibrationLUT() const
void setLayer1SecondStageLUT(const std::vector< unsigned > &lut)
l1t::LUT const * egCalibrationLUT() const
void setLayer1HFScalePhiBins(std::vector< unsigned > params)
l1t::LUT * metHFCalibrationLUT()
void setJetLsb(double lsb)
std::string const & tauCalibrationType() const
L1CaloEtScale HfRingScale_
std::string tauPUSType() const
void setTauPUSParams(const std::vector< double > &params)
int centralityRegionMask() const
int egMaxPtHOverEIsolation() const
void setLayer1HFScaleETBins(std::vector< int > params)
void setEtSumEttCalibrationType(std::string type)
void setQ2LUT(const l1t::LUT &lut)
void setEtSumBypassEttPUS(unsigned flag)
unsigned tauIsoVetoNrTowersPhi() const
double tauNeighbourThreshold() const
double etSumLsb_
Definition: CaloParams.h:250
void setEgMaxHOverELUT(const l1t::LUT &lut)
unsigned etSumBypassEttPUS() const
void setEgCalibrationParams(std::vector< double > params)
l1t::LUT const * etSumEcalSumCalibrationLUT() const
void setTauCalibrationParams(std::vector< double > params)
l1t::LUT const * etSumEcalSumPUSLUT() const
l1t::LUT * egCalibrationLUT()
int regionPUSValue(int PUM0, int eta) const
l1t::LUT const * centralityLUT() const
void setMinimumBiasThresholds(std::vector< int > thresholds)
l1t::LUT const * egMaxHOverELUT() const
void setMetCalibrationType(std::string type)
std::string const & metHFCalibrationType() const
double egMaxPtHOverE() const
std::vector< int > const & layer1HCalScaleETBins() const
void setJetSeedThreshold(double thresh)
void setMetHFCalibrationType(std::string type)
int egMaxPtJetIsolation() const
std::vector< int > const & layer1HFScaleETBins() const
void setEgMaxPtHOverE(double thresh)
void setLayer1ECalScaleFactors(std::vector< double > params)
void setEgTrimmingLUT(const l1t::LUT &lut)
void setEmScale(L1CaloEtScale emScale)
void setRegionPUSParams(const std::vector< double > &params)
l1t::LUT * tauCalibrationLUT()
void setEgIsolationLUT(const l1t::LUT &lut)
void setEgMaxPtHOverEIsolation(int cutValue)
L1CaloEtScale HfRingScale() const
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)
void setEgSeedThreshold(double thresh)
void setTauIsoVetoNrTowersPhi(unsigned iTauIsoVetoNrTowersPhi)
double towerLsbSum() const
l1t::LUT * etSumEttCalibrationLUT()
void setMetCalibrationLUT(const l1t::LUT &lut)
std::vector< unsigned > const & layer1SecondStageLUT() const
void setJetPUSType(std::string type)
void setEgIsoVetoNrTowersPhi(unsigned iEgIsoVetoNrTowersPhi)
void setEtSumLsb(double lsb)
void setEgIsoAreaNrTowersEta(unsigned iEgIsoAreaNrTowersEta)
l1t::LUT * tauIsolationLUT()
void setEgShapeIdType(std::string type)
void setIsoTauEtaMin(int value)
void setTowerLsbSum(double lsb)
std::vector< double > const & layer1HFScaleFactors() const
std::vector< double > const & jetCalibrationParams() const
unsigned egIsoAreaNrTowersEta() const
l1t::LUT * jetCompressEtaLUT()
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void setEgPUSParams(const std::vector< double > &params)
double tauMinPtJetIsolationB() const
std::vector< unsigned > const & layer1HCalScalePhiBins() const
void setTowerLsbE(double lsb)
l1t::LUT * metPhiCalibrationLUT()
int pileUpTowerThreshold() const
l1t::LUT const * egIsolationLUT2() const
std::string const & egIsolationType() const
double jetNeighbourThreshold() const
const std::vector< double > & egPUSParams() const
std::string const & regionPUSType() const
l1t::LUT * etSumEcalSumPUSLUT()
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
unsigned jetPUSUsePhiRing() const
def move(src, dest)
Definition: eostools.py:511
void setEgCalibrationType(std::string type)
void setEtSumEcalSumPUSLUT(const l1t::LUT &lut)
void setEgCompressShapesLUT(const l1t::LUT &lut)
double egPUSParam(int ipar) const
unsigned tauIsoAreaNrTowersPhi() const
void setTowerNBitsRatio(int n)
l1t::LUT const * egTrimmingLUT() const
void setEgIsolationType(std::string type)