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,
79  };
80 
84 
85  bool isValidForStage1() const { return true; }
86  bool isValidForStage2() const { return (version_ >= 2); }
87 
88  L1CaloEtScale emScale() const { return emScale_; }
90  L1CaloEtScale jetScale() const { return jetScale_; }
96 
97  // towers
98  double towerLsbH() const { return towerp_.lsbH_; }
99  double towerLsbE() const { return towerp_.lsbE_; }
100  double towerLsbSum() const { return towerp_.lsbSum_; }
101  int towerNBitsH() const { return towerp_.nBitsH_; }
102  int towerNBitsE() const { return towerp_.nBitsE_; }
103  int towerNBitsSum() const { return towerp_.nBitsSum_; }
104  int towerNBitsRatio() const { return towerp_.nBitsRatio_; }
105  int towerMaskE() const { return towerp_.maskE_; }
106  int towerMaskH() const { return towerp_.maskH_; }
107  int towerMaskSum() const { return towerp_.maskSum_; }
108  int towerMaskRatio() const { return towerp_.maskRatio_; }
109  bool doTowerEncoding() const { return towerp_.doEncoding_; }
110 
111  void setTowerLsbH(double lsb) { towerp_.lsbH_ = lsb; }
112  void setTowerLsbE(double lsb) { towerp_.lsbE_ = lsb; }
113  void setTowerLsbSum(double lsb) { towerp_.lsbSum_ = lsb; }
114  void setTowerNBitsH(int n) {
115  towerp_.nBitsH_ = n;
116  towerp_.maskH_ = std::pow(2, n) - 1;
117  }
118  void setTowerNBitsE(int n) {
119  towerp_.nBitsE_ = n;
120  towerp_.maskE_ = std::pow(2, n) - 1;
121  }
122  void setTowerNBitsSum(int n) {
123  towerp_.nBitsSum_ = n;
124  towerp_.maskSum_ = std::pow(2, n) - 1;
125  }
126  void setTowerNBitsRatio(int n) {
128  towerp_.maskRatio_ = std::pow(2, n) - 1;
129  }
130  void setTowerEncoding(bool doit) { towerp_.doEncoding_ = doit; }
131 
132  // regions
133  double regionLsb() const { return regionLsb_; }
134  std::string const& regionPUSType() const { return pnode_[regionPUS].type_; }
135  std::vector<double> const& regionPUSParams() const { return pnode_[regionPUS].dparams_; }
136  l1t::LUT* regionPUSLUT() { return &pnode_[regionPUS].LUT_; }
137  l1t::LUT const* regionPUSLUT() const { return &pnode_[regionPUS].LUT_; }
138 
139  int regionPUSValue(int PUM0, int eta) const {
140  int puSub = ceil(regionPUSParams()[18 * eta + PUM0] * 2);
141  return puSub;
142  }
143 
144  void setRegionLsb(double lsb) { regionLsb_ = lsb; }
146  void setRegionPUSParams(const std::vector<double>& params) { pnode_[regionPUS].dparams_ = params; }
147  void setRegionPUSLUT(const l1t::LUT& lut) { pnode_[regionPUS].LUT_ = lut; }
148 
149  int pileUpTowerThreshold() const { return pnode_[PUTowerThreshold].iparams_[0]; }
151  pnode_[PUTowerThreshold].iparams_.resize(1);
152  pnode_[PUTowerThreshold].iparams_[0] = thresh;
153  }
154 
155  // EG
156  int egEtaCut() const {
157  if (pnode_[egPUS].version_ == 1)
158  return pnode_[egPUS].iparams_[0];
159  else
160  return 0;
161  }
162  double egLsb() const { return egp_.lsb_; }
163  double egSeedThreshold() const { return egp_.seedThreshold_; }
164  double egNeighbourThreshold() const { return egp_.neighbourThreshold_; }
165  double egHcalThreshold() const { return egp_.hcalThreshold_; }
166  l1t::LUT* egTrimmingLUT() { return &pnode_[egTrimming].LUT_; }
167  l1t::LUT const* egTrimmingLUT() const { return &pnode_[egTrimming].LUT_; }
168  double egMaxHcalEt() const { return egp_.maxHcalEt_; }
169  double egMaxPtHOverE() const { return egp_.maxPtHOverE_; }
171  l1t::LUT const* egMaxHOverELUT() const { return &pnode_[egMaxHOverE].LUT_; }
173  l1t::LUT const* egCompressShapesLUT() const { return &pnode_[egCompressShapes].LUT_; }
174  l1t::LUT* egShapeIdLUT() { return &pnode_[egShapeId].LUT_; }
175  l1t::LUT const* egShapeIdLUT() const { return &pnode_[egShapeId].LUT_; }
180  unsigned egBypassEGVetos() const { return pnode_[egBypassEGVetosFlag].uparams_[0]; }
181  unsigned egBypassExtHOverE() const { return pnode_[egBypassExtHoE].uparams_[0]; }
182  unsigned egBypassShape() const {
183  if (pnode_[egBypassShapeFlag].uparams_.empty())
184  return 0;
185  else
186  return pnode_[egBypassShapeFlag].uparams_[0];
187  }
188  unsigned egBypassECALFG() const {
189  if (pnode_[egBypassECALFGFlag].uparams_.empty())
190  return 0;
191  else
192  return pnode_[egBypassECALFGFlag].uparams_[0];
193  }
194  unsigned egBypassHoE() const {
195  if (pnode_[egBypassHoEFlag].uparams_.empty())
196  return 0;
197  else
198  return pnode_[egBypassHoEFlag].uparams_[0];
199  }
200 
201  int egHOverEcutBarrel() const { return pnode_[egHOverEBarrel].iparams_[0]; }
202  int egHOverEcutEndcap() const { return pnode_[egHOverEEndcap].iparams_[0]; }
203 
204  unsigned egIsoAreaNrTowersEta() const { return egp_.isoAreaNrTowersEta_; }
205  unsigned egIsoAreaNrTowersPhi() const { return egp_.isoAreaNrTowersPhi_; }
206  unsigned egIsoVetoNrTowersPhi() const { return egp_.isoVetoNrTowersPhi_; }
207  const std::string& egPUSType() const { return pnode_[egPUS].type_; }
208  const std::vector<double>& egPUSParams() const { return pnode_[egPUS].dparams_; }
209  double egPUSParam(int ipar) const { return pnode_[egPUS].dparams_.at(ipar); }
210 
211  std::string const& egIsolationType() const { return pnode_[egIsolation].type_; }
212  l1t::LUT const* egIsolationLUT() const { return &pnode_[egIsolation].LUT_; }
214  l1t::LUT const* egIsolationLUT2() const { return &pnode_[egIsolation2].LUT_; }
216  std::string const& egCalibrationType() const { return pnode_[egCalibration].type_; }
217  std::vector<double> const& egCalibrationParams() const { return pnode_[egCalibration].dparams_; }
218  l1t::LUT const* egCalibrationLUT() const { return &pnode_[egCalibration].LUT_; }
220 
221  void setEgEtaCut(int mask) {
222  pnode_[egPUS].iparams_.resize(1);
223  pnode_[egPUS].iparams_[0] = mask;
224  }
225  void setEgLsb(double lsb) { egp_.lsb_ = lsb; }
229  void setEgTrimmingLUT(const l1t::LUT& lut) { pnode_[egTrimming].LUT_ = lut; }
230  void setEgMaxHcalEt(double cut) { egp_.maxHcalEt_ = cut; }
232  void setEgMaxHOverELUT(const l1t::LUT& lut) { pnode_[egMaxHOverE].LUT_ = lut; }
233  void setEgCompressShapesLUT(const l1t::LUT& lut) { pnode_[egCompressShapes].LUT_ = lut; }
234  void setEgShapeIdLUT(const l1t::LUT& lut) { pnode_[egShapeId].LUT_ = lut; }
235  void setEgMinPtJetIsolation(int cutValue) { egp_.minPtJetIsolation_ = cutValue; }
236  void setEgMaxPtJetIsolation(int cutValue) { egp_.maxPtJetIsolation_ = cutValue; }
237  void setEgMinPtHOverEIsolation(int cutValue) { egp_.minPtHOverEIsolation_ = cutValue; }
238  void setEgMaxPtHOverEIsolation(int cutValue) { egp_.maxPtHOverEIsolation_ = cutValue; }
239  void setEgBypassEGVetos(unsigned flag) {
240  pnode_[egBypassEGVetosFlag].uparams_.resize(1);
241  pnode_[egBypassEGVetosFlag].uparams_[0] = flag;
242  }
243  void setEgBypassExtHOverE(unsigned flag) {
244  pnode_[egBypassExtHoE].uparams_.resize(1);
245  pnode_[egBypassExtHoE].uparams_[0] = flag;
246  }
247  void setEgBypassShape(unsigned flag) {
248  pnode_[egBypassShapeFlag].uparams_.resize(1);
249  pnode_[egBypassShapeFlag].uparams_[0] = flag;
250  }
251  void setEgBypassECALFG(unsigned flag) {
252  pnode_[egBypassECALFGFlag].uparams_.resize(1);
253  pnode_[egBypassECALFGFlag].uparams_[0] = flag;
254  }
255  void setEgBypassHoE(unsigned flag) {
256  pnode_[egBypassHoEFlag].uparams_.resize(1);
257  pnode_[egBypassHoEFlag].uparams_[0] = flag;
258  }
260  pnode_[egHOverEBarrel].iparams_.resize(1);
261  pnode_[egHOverEBarrel].iparams_[0] = cut;
262  }
264  pnode_[egHOverEEndcap].iparams_.resize(1);
265  pnode_[egHOverEEndcap].iparams_[0] = cut;
266  }
267 
268  void setEgIsoAreaNrTowersEta(unsigned iEgIsoAreaNrTowersEta) { egp_.isoAreaNrTowersEta_ = iEgIsoAreaNrTowersEta; }
269  void setEgIsoAreaNrTowersPhi(unsigned iEgIsoAreaNrTowersPhi) { egp_.isoAreaNrTowersPhi_ = iEgIsoAreaNrTowersPhi; }
270  void setEgIsoVetoNrTowersPhi(unsigned iEgIsoVetoNrTowersPhi) { egp_.isoVetoNrTowersPhi_ = iEgIsoVetoNrTowersPhi; }
272  void setEgPUSParams(const std::vector<double>& params) { pnode_[egPUS].dparams_ = params; }
274  void setEgIsolationLUT(const l1t::LUT& lut) { pnode_[egIsolation].LUT_ = lut; }
275  void setEgIsolationLUT2(const l1t::LUT& lut) { pnode_[egIsolation2].LUT_ = lut; }
277  void setEgCalibrationParams(std::vector<double> params) { pnode_[egCalibration].dparams_ = params; }
278  void setEgCalibrationLUT(const l1t::LUT& lut) { pnode_[egCalibration].LUT_ = lut; }
279 
280  // - recently imported:
281  std::string const& egShapeIdType() const { return pnode_[egShapeId].type_; }
283  unsigned egShapeIdVersion() const { return pnode_[egShapeId].version_; }
284  void setEgShapeIdVersion(unsigned version) { pnode_[egShapeId].version_ = version; }
285  unsigned egCalibrationVersion() const { return pnode_[egCalibration].version_; }
287 
288  // tau
289  int tauRegionMask() const {
290  if (pnode_[tauPUS].version_ == 1)
291  return pnode_[tauPUS].iparams_[0];
292  else
293  return 0;
294  }
295  double tauLsb() const { return taup_.lsb_; }
296  double tauSeedThreshold() const { return taup_.seedThreshold_; }
298  double tauMaxPtTauVeto() const { return taup_.maxPtTauVeto_; }
300  double tauMaxJetIsolationB() const { return taup_.maxJetIsolationB_; }
301  double tauMaxJetIsolationA() const { return taup_.maxJetIsolationA_; }
302  int isoTauEtaMin() const { return taup_.isoEtaMin_; }
303  int isoTauEtaMax() const { return taup_.isoEtaMax_; }
304  std::string tauPUSType() const { return pnode_[tauPUS].type_; }
305  const std::vector<double>& tauPUSParams() const { return pnode_[tauPUS].dparams_; }
306  double tauPUSParam(int ipar) const { return pnode_[tauPUS].dparams_.at(ipar); }
307 
309  l1t::LUT const* tauIsolationLUT() const { return &pnode_[tauIsolation].LUT_; }
311  l1t::LUT const* tauIsolationLUT2() const { return &pnode_[tauIsolation2].LUT_; }
314 
315  std::string const& tauCalibrationType() const { return pnode_[tauCalibration].type_; }
316  std::vector<double> const& tauCalibrationParams() const { return pnode_[tauCalibration].dparams_; }
318  l1t::LUT const* tauCalibrationLUT() const { return &pnode_[tauCalibration].LUT_; }
320  l1t::LUT const* tauCompressLUT() const { return &pnode_[tauCompress].LUT_; }
321 
322  l1t::LUT const* tauEtToHFRingEtLUT() const { return &pnode_[tauEtToHFRingEt].LUT_; }
324 
325  unsigned tauIsoAreaNrTowersEta() const { return taup_.isoAreaNrTowersEta_; }
326  unsigned tauIsoAreaNrTowersPhi() const { return taup_.isoAreaNrTowersPhi_; }
327  unsigned tauIsoVetoNrTowersPhi() const { return taup_.isoVetoNrTowersPhi_; }
328 
329  void setTauRegionMask(int mask) {
330  pnode_[tauPUS].iparams_.resize(1);
331  pnode_[tauPUS].iparams_[0] = mask;
332  }
333  void setTauLsb(double lsb) { taup_.lsb_ = lsb; }
339  void setTauMaxJetIsolationA(double cutValue) { taup_.maxJetIsolationA_ = cutValue; }
343  void setTauIsolationLUT(const l1t::LUT& lut) { pnode_[tauIsolation].LUT_ = lut; }
344  void setTauIsolationLUT2(const l1t::LUT& lut) { pnode_[tauIsolation2].LUT_ = lut; }
346 
348  void setTauIsoAreaNrTowersEta(unsigned iTauIsoAreaNrTowersEta) {
349  taup_.isoAreaNrTowersEta_ = iTauIsoAreaNrTowersEta;
350  }
351  void setTauIsoAreaNrTowersPhi(unsigned iTauIsoAreaNrTowersPhi) {
352  taup_.isoAreaNrTowersPhi_ = iTauIsoAreaNrTowersPhi;
353  }
354  void setTauIsoVetoNrTowersPhi(unsigned iTauIsoVetoNrTowersPhi) {
355  taup_.isoVetoNrTowersPhi_ = iTauIsoVetoNrTowersPhi;
356  }
357 
358  void setTauCalibrationParams(std::vector<double> params) { pnode_[tauCalibration].dparams_ = params; }
359  void setTauCalibrationLUT(const l1t::LUT& lut) { pnode_[tauCalibration].LUT_ = lut; }
360  void setTauCompressLUT(const l1t::LUT& lut) { pnode_[tauCompress].LUT_ = lut; }
361  void setTauPUSParams(const std::vector<double>& params) { pnode_[tauPUS].dparams_ = params; }
362 
363  void setTauEtToHFRingEtLUT(const l1t::LUT& lut) { pnode_[tauEtToHFRingEt].LUT_ = lut; }
364 
365  // jets
366  double jetLsb() const { return jetp_.lsb_; }
367  double jetSeedThreshold() const { return jetp_.seedThreshold_; }
369  int jetRegionMask() const {
370  if (pnode_[jetPUS].version_ == 1)
371  return pnode_[jetPUS].iparams_[0];
372  else
373  return 0;
374  }
375 
376  unsigned jetBypassPUS() const { return pnode_[jetBypassPUSFlag].uparams_[0]; }
377  unsigned jetPUSUsePhiRing() const {
378  if (pnode_[jetPUSUsePhiRingFlag].uparams_.empty())
379  return 0;
380  else
381  return pnode_[jetPUSUsePhiRingFlag].uparams_[0];
382  }
383 
384  std::string jetPUSType() const { return pnode_[jetPUS].type_; }
385  std::vector<double> const& jetPUSParams() const { return pnode_[jetPUS].dparams_; }
386  std::string const& jetCalibrationType() const { return pnode_[jetCalibration].type_; }
387  std::vector<double> const& jetCalibrationParams() const { return pnode_[jetCalibration].dparams_; }
388 
390  l1t::LUT const* jetCalibrationLUT() const { return &pnode_[jetCalibration].LUT_; }
392  l1t::LUT const* jetCompressPtLUT() const { return &pnode_[jetCompressPt].LUT_; }
394  l1t::LUT const* jetCompressEtaLUT() const { return &pnode_[jetCompressEta].LUT_; }
395 
396  void setJetLsb(double lsb) { jetp_.lsb_ = lsb; }
399  void setJetRegionMask(int mask) {
400  pnode_[jetPUS].iparams_.resize(1);
401  pnode_[jetPUS].iparams_[0] = mask;
402  }
404  void setJetPUSParams(std::vector<double> params) { pnode_[jetPUS].dparams_ = params; }
406  void setJetCalibrationParams(std::vector<double> params) { pnode_[jetCalibration].dparams_ = params; }
407  void setJetCalibrationLUT(const l1t::LUT& lut) { pnode_[jetCalibration].LUT_ = lut; }
408  void setJetCompressEtaLUT(const l1t::LUT& lut) { pnode_[jetCompressEta].LUT_ = lut; }
409  void setJetCompressPtLUT(const l1t::LUT& lut) { pnode_[jetCompressPt].LUT_ = lut; }
410  void setJetBypassPUS(unsigned flag) {
411  pnode_[jetBypassPUSFlag].uparams_.resize(1);
412  pnode_[jetBypassPUSFlag].uparams_[0] = flag;
413  }
414  void setJetPUSUsePhiRing(unsigned flag) {
415  pnode_[jetPUSUsePhiRingFlag].uparams_.resize(1);
416  pnode_[jetPUSUsePhiRingFlag].uparams_[0] = flag;
417  }
418 
419  // sums
420 
421  double etSumLsb() const { return etSumLsb_; }
422  int etSumEtaMin(unsigned isum) const;
423  int etSumEtaMax(unsigned isum) const;
424  double etSumEtThreshold(unsigned isum) const;
425  unsigned etSumBypassMetPUS() const { return pnode_[etSumBypassMetPUSFlag].uparams_[0]; }
426  unsigned etSumBypassEttPUS() const { return pnode_[etSumBypassEttPUSFlag].uparams_[0]; }
427  unsigned etSumBypassEcalSumPUS() const { return pnode_[etSumBypassEcalSumPUSFlag].uparams_[0]; }
428  std::string const& etSumMetPUSType() const { return pnode_[etSumMetPUS].type_; }
429  std::string const& etSumEttPUSType() const { return pnode_[etSumEttPUS].type_; }
430  std::string const& etSumEcalSumPUSType() const { return pnode_[etSumEcalSumPUS].type_; }
431  std::string const& metCalibrationType() const { return pnode_[metCalibration].type_; }
432  std::string const& metHFCalibrationType() const { return pnode_[metHFCalibration].type_; }
435 
437  l1t::LUT const* etSumMetPUSLUT() const { return &pnode_[etSumMetPUS].LUT_; }
439  l1t::LUT const* etSumEttPUSLUT() const { return &pnode_[etSumEttPUS].LUT_; }
441  l1t::LUT const* etSumEcalSumPUSLUT() const { return &pnode_[etSumEcalSumPUS].LUT_; }
443  l1t::LUT const* metCalibrationLUT() const { return &pnode_[metCalibration].LUT_; }
445  l1t::LUT const* metHFCalibrationLUT() const { return &pnode_[metHFCalibration].LUT_; }
447  l1t::LUT const* etSumEttCalibrationLUT() const { return &pnode_[etSumEttCalibration].LUT_; }
451  l1t::LUT const* metPhiCalibrationLUT() const { return &pnode_[metPhiCalibration].LUT_; }
453  l1t::LUT const* metHFPhiCalibrationLUT() const { return &pnode_[metHFPhiCalibration].LUT_; }
454 
455  void setEtSumLsb(double lsb) { etSumLsb_ = lsb; }
456  void setEtSumEtaMin(unsigned isum, int eta);
457  void setEtSumEtaMax(unsigned isum, int eta);
458  void setEtSumEtThreshold(unsigned isum, double thresh);
466  void setEtSumBypassMetPUS(unsigned flag) {
467  pnode_[etSumBypassMetPUSFlag].uparams_.resize(1);
468  pnode_[etSumBypassMetPUSFlag].uparams_[0] = flag;
469  }
470  void setEtSumBypassEttPUS(unsigned flag) {
471  pnode_[etSumBypassEttPUSFlag].uparams_.resize(1);
472  pnode_[etSumBypassEttPUSFlag].uparams_[0] = flag;
473  }
475  pnode_[etSumBypassEcalSumPUSFlag].uparams_.resize(1);
476  pnode_[etSumBypassEcalSumPUSFlag].uparams_[0] = flag;
477  }
478 
479  void setEtSumMetPUSLUT(const l1t::LUT& lut) { pnode_[etSumMetPUS].LUT_ = lut; }
480  void setEtSumEttPUSLUT(const l1t::LUT& lut) { pnode_[etSumEttPUS].LUT_ = lut; }
481  void setEtSumEcalSumPUSLUT(const l1t::LUT& lut) { pnode_[etSumEcalSumPUS].LUT_ = lut; }
482  void setMetCalibrationLUT(const l1t::LUT& lut) { pnode_[metCalibration].LUT_ = lut; }
483  void setMetHFCalibrationLUT(const l1t::LUT& lut) { pnode_[metHFCalibration].LUT_ = lut; }
486  void setMetPhiCalibrationLUT(const l1t::LUT& lut) { pnode_[metPhiCalibration].LUT_ = lut; }
488 
489  // HI centrality
490  int centralityRegionMask() const {
491  if (pnode_[hiCentrality].version_ == 1)
492  return pnode_[hiCentrality].iparams_[0];
493  else
494  return 0;
495  }
496  std::vector<int> minimumBiasThresholds() const {
497  if (pnode_[hiCentrality].version_ == 1 && pnode_[hiCentrality].iparams_.size() == 5) {
498  std::vector<int> newVec;
499  newVec.reserve(4);
500  for (int i = 0; i < 4; i++) {
501  newVec.push_back(pnode_[hiCentrality].iparams_.at(i + 1));
502  }
503  return newVec;
504  } else {
505  std::vector<int> newVec;
506  return newVec;
507  }
508  }
510  l1t::LUT const* centralityLUT() const { return &pnode_[hiCentrality].LUT_; }
512  pnode_[hiCentrality].iparams_.resize(5);
513  pnode_[hiCentrality].iparams_[0] = mask;
514  }
515  void setMinimumBiasThresholds(std::vector<int> thresholds) {
516  pnode_[hiCentrality].iparams_.resize(5);
517  for (int i = 0; i < 4; i++) {
518  pnode_[hiCentrality].iparams_[i + 1] = thresholds.at(i);
519  }
520  }
521  void setCentralityLUT(const l1t::LUT& lut) { pnode_[hiCentrality].LUT_ = lut; }
522 
523  // HI Q2
524  l1t::LUT* q2LUT() { return &pnode_[hiQ2].LUT_; }
525  l1t::LUT const* q2LUT() const { return &pnode_[hiQ2].LUT_; }
526  void setQ2LUT(const l1t::LUT& lut) { pnode_[hiQ2].LUT_ = lut; }
527 
528  // HI parameters
529  double etSumCentLower(unsigned centClass) const {
530  if (pnode_[etSumCentralityLower].dparams_.size() > centClass)
531  return pnode_[etSumCentralityLower].dparams_.at(centClass);
532  else
533  return 0.;
534  }
535  double etSumCentUpper(unsigned centClass) const {
536  if (pnode_[etSumCentralityUpper].dparams_.size() > centClass)
537  return pnode_[etSumCentralityUpper].dparams_.at(centClass);
538  else
539  return 0.;
540  }
541  void setEtSumCentLower(unsigned centClass, double loBound) {
542  if (pnode_[etSumCentralityLower].dparams_.size() <= centClass)
543  pnode_[etSumCentralityLower].dparams_.resize(centClass + 1);
544  pnode_[etSumCentralityLower].dparams_.at(centClass) = loBound;
545  }
546  void setEtSumCentUpper(unsigned centClass, double upBound) {
547  if (pnode_[etSumCentralityUpper].dparams_.size() <= centClass)
548  pnode_[etSumCentralityUpper].dparams_.resize(centClass + 1);
549  pnode_[etSumCentralityUpper].dparams_.at(centClass) = upBound;
550  }
551 
552  // Layer 1 LUT specification
553  std::vector<double> const& layer1ECalScaleFactors() const { return pnode_[layer1ECal].dparams_; }
554  std::vector<double> const& layer1HCalScaleFactors() const { return pnode_[layer1HCal].dparams_; }
555  std::vector<double> const& layer1HFScaleFactors() const { return pnode_[layer1HF].dparams_; }
556  std::vector<unsigned> const& layer1HCalFBLUTUpper() const { return pnode_[layer1HCalFBUpper].uparams_; }
557  std::vector<unsigned> const& layer1HCalFBLUTLower() const { return pnode_[layer1HCalFBLower].uparams_; }
558  std::vector<int> const& layer1ECalScaleETBins() const { return pnode_[layer1ECal].iparams_; }
559  std::vector<int> const& layer1HCalScaleETBins() const { return pnode_[layer1HCal].iparams_; }
560  std::vector<int> const& layer1HFScaleETBins() const { return pnode_[layer1HF].iparams_; }
561  std::vector<unsigned> const& layer1ECalScalePhiBins() const { return pnode_[layer1ECal].uparams_; }
562  std::vector<unsigned> const& layer1HCalScalePhiBins() const { return pnode_[layer1HCal].uparams_; }
563  std::vector<unsigned> const& layer1HFScalePhiBins() const { return pnode_[layer1HF].uparams_; }
564  void setLayer1ECalScaleFactors(std::vector<double> params) { pnode_[layer1ECal].dparams_ = std::move(params); }
565  void setLayer1HCalScaleFactors(std::vector<double> params) { pnode_[layer1HCal].dparams_ = std::move(params); }
566  void setLayer1HFScaleFactors(std::vector<double> params) { pnode_[layer1HF].dparams_ = std::move(params); }
567  void setLayer1HCalFBLUTUpper(std::vector<unsigned> params) {
569  }
570  void setLayer1HCalFBLUTLower(std::vector<unsigned> params) {
572  }
573  void setLayer1ECalScaleETBins(std::vector<int> params) { pnode_[layer1ECal].iparams_ = std::move(params); }
574  void setLayer1HCalScaleETBins(std::vector<int> params) { pnode_[layer1HCal].iparams_ = std::move(params); }
575  void setLayer1HFScaleETBins(std::vector<int> params) { pnode_[layer1HF].iparams_ = std::move(params); }
576  void setLayer1ECalScalePhiBins(std::vector<unsigned> params) { pnode_[layer1ECal].uparams_ = std::move(params); }
577  void setLayer1HCalScalePhiBins(std::vector<unsigned> params) { pnode_[layer1HCal].uparams_ = std::move(params); }
578  void setLayer1HFScalePhiBins(std::vector<unsigned> params) { pnode_[layer1HF].uparams_ = std::move(params); }
579 
580  std::vector<unsigned> const& layer1SecondStageLUT() const { return pnode_[layer1HOverE].uparams_; }
581  void setLayer1SecondStageLUT(const std::vector<unsigned>& lut) { pnode_[layer1HOverE].uparams_ = lut; }
582 
583  void setNode(int pos, const Node& n) { pnode_[pos] = n; }
584  const std::vector<Node>& getNodes(void) const { return pnode_; }
585 
586  private:
591  friend std::ostream& operator<<(std::ostream& os, const CaloParamsHelper& h);
592  };
593 
594  std::ostream& operator<<(std::ostream& os, const l1t::CaloParamsHelper& p);
595 
596 } // namespace l1t
597 
598 #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 setLayer1HCalFBLUTLower(std::vector< unsigned > params)
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 setLayer1HCalFBLUTUpper(std::vector< unsigned > params)
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()
std::vector< unsigned > const & layer1HCalFBLUTLower() const
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()
std::vector< unsigned > const & layer1HCalFBLUTUpper() const
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)