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