CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
7 
13 
14 #ifndef CaloParamsHelper_h
15 #define CaloParamsHelper_h
16 
17 namespace l1t {
18 
19  class CaloParamsHelper : public CaloParams {
20 
21  public:
25 
34 
35  // towers
36  double towerLsbH() const { return towerp_.lsbH_; }
37  double towerLsbE() const { return towerp_.lsbE_; }
38  double towerLsbSum() const { return towerp_.lsbSum_; }
39  int towerNBitsH() const { return towerp_.nBitsH_; }
40  int towerNBitsE() const { return towerp_.nBitsE_; }
41  int towerNBitsSum() const { return towerp_.nBitsSum_; }
42  int towerNBitsRatio() const { return towerp_.nBitsRatio_; }
43  int towerMaskE() const { return towerp_.maskE_; }
44  int towerMaskH() const { return towerp_.maskH_; }
45  int towerMaskSum() const { return towerp_.maskSum_; }
46  int towerMaskRatio() const { return towerp_.maskRatio_; }
47  bool doTowerEncoding() const { return towerp_.doEncoding_; }
48 
49  void setTowerLsbH(double lsb) { towerp_.lsbH_ = lsb; }
50  void setTowerLsbE(double lsb) { towerp_.lsbE_ = lsb; }
51  void setTowerLsbSum(double lsb) { towerp_.lsbSum_ = lsb; }
52  void setTowerNBitsH(int n) { towerp_.nBitsH_ = n; towerp_.maskH_ = std::pow(2,n)-1; }
53  void setTowerNBitsE(int n) { towerp_.nBitsE_ = n; towerp_.maskE_ = std::pow(2,n)-1; }
56  void setTowerEncoding(bool doit) { towerp_.doEncoding_ = doit; }
57 
58 
59  // regions
60  double regionLsb() const { return regionLsb_; }
61  std::string regionPUSType() const { return pnode_[regionPUS].type_; }
62  std::vector<double> regionPUSParams() { return pnode_[regionPUS].dparams_; }
63  l1t::LUT* regionPUSLUT() {return &pnode_[regionPUS].LUT_; }
64 
65  int regionPUSValue(int PUM0, int eta)
66  {
67  int puSub = ceil(regionPUSParams()[18*eta+PUM0]*2);
68  return puSub;
69  }
70 
71  void setRegionLsb(double lsb) { regionLsb_ = lsb; }
73  void setRegionPUSParams(const std::vector<double> & params) { pnode_[regionPUS].dparams_ = params; }
74  void setRegionPUSLUT(const l1t::LUT & lut) { pnode_[regionPUS].LUT_ = lut; }
75 
76  // EG
77  int egEtaCut() const {
78  if (pnode_[egPUS].version_ ==1)
79  return pnode_[egPUS].iparams_[0];
80  else
81  return 0;
82  }
83  double egLsb() const { return egp_.lsb_; }
84  double egSeedThreshold() const { return egp_.seedThreshold_; }
85  double egNeighbourThreshold() const { return egp_.neighbourThreshold_; }
86  double egHcalThreshold() const { return egp_.hcalThreshold_; }
87  l1t::LUT* egTrimmingLUT() { return &pnode_[egTrimming].LUT_; }
88  double egMaxHcalEt() const { return egp_.maxHcalEt_; }
89  double egMaxPtHOverE() const {return egp_.maxPtHOverE_;}
90  l1t::LUT* egMaxHOverELUT() { return &pnode_[egMaxHOverE].LUT_; }
92  l1t::LUT* egShapeIdLUT() { return &pnode_[egShapeId].LUT_; }
97 
101  const std::string & egPUSType() const { return pnode_[egPUS].type_; }
102  const std::vector<double> & egPUSParams() const { return pnode_[egPUS].dparams_; }
103  double egPUSParam(int ipar) const { return pnode_[egPUS].dparams_.at(ipar); }
104 
107  std::vector<double> egCalibrationParams() { return pnode_[egCalibration].dparams_; }
109 
110  void setEgEtaCut(int mask) {
111  pnode_[egPUS].iparams_.resize(1);
112  pnode_[egPUS].iparams_[0] = mask;
113  }
114  void setEgLsb(double lsb) { egp_.lsb_ = lsb; }
118  void setEgTrimmingLUT(const l1t::LUT & lut) { pnode_[egTrimming].LUT_ = lut; }
119  void setEgMaxHcalEt(double cut) { egp_.maxHcalEt_ = cut; }
121  void setEgMaxHOverELUT(const l1t::LUT & lut) { pnode_[egMaxHOverE].LUT_ = lut; }
123  void setEgShapeIdLUT(const l1t::LUT & lut) { pnode_[egShapeId].LUT_ = lut; }
124  void setEgMinPtJetIsolation(int cutValue) { egp_.minPtJetIsolation_ = cutValue; }
125  void setEgMaxPtJetIsolation(int cutValue) { egp_.maxPtJetIsolation_ = cutValue; }
126  void setEgMinPtHOverEIsolation(int cutValue) { egp_.minPtHOverEIsolation_ = cutValue; }
127  void setEgMaxPtHOverEIsolation(int cutValue) { egp_.maxPtHOverEIsolation_ = cutValue; }
128 
129  void setEgIsoAreaNrTowersEta(unsigned iEgIsoAreaNrTowersEta){egp_.isoAreaNrTowersEta_=iEgIsoAreaNrTowersEta;}
130  void setEgIsoAreaNrTowersPhi(unsigned iEgIsoAreaNrTowersPhi){egp_.isoAreaNrTowersPhi_=iEgIsoAreaNrTowersPhi;}
131  void setEgIsoVetoNrTowersPhi(unsigned iEgIsoVetoNrTowersPhi){egp_.isoVetoNrTowersPhi_=iEgIsoVetoNrTowersPhi;}
133  void setEgPUSParams(const std::vector<double> & params) { pnode_[egPUS].dparams_ = params; }
134  void setEgIsolationLUT(const l1t::LUT & lut) { pnode_[egIsolation].LUT_ = lut; }
136  void setEgCalibrationParams(std::vector<double> params) { pnode_[egCalibration].dparams_ = params; }
138 
139  // tau
140  int tauRegionMask() const {
141  if (pnode_[tauPUS].version_ ==1)
142  return pnode_[tauPUS].iparams_[0];
143  else
144  return 0;
145  }
146  double tauLsb() const { return taup_.lsb_; }
147  double tauSeedThreshold() const { return taup_.seedThreshold_; }
149  double tauMaxPtTauVeto() const { return taup_.maxPtTauVeto_;}
151  double tauMaxJetIsolationB() const { return taup_.maxJetIsolationB_; }
152  double tauMaxJetIsolationA() const { return taup_.maxJetIsolationA_; }
153  int isoTauEtaMin() const { return taup_.isoEtaMin_; }
154  int isoTauEtaMax() const { return taup_.isoEtaMax_; }
155  std::string tauPUSType() const { return pnode_[tauPUS].type_; }
156  const std::vector<double> & tauPUSParams() const { return pnode_[tauPUS].dparams_; }
157  double tauPUSParam(int ipar) const { return pnode_[tauPUS].dparams_.at(ipar); }
158 
160 
162  std::vector<double> tauCalibrationParams() { return pnode_[tauCalibration].dparams_; }
164 
166 
170 
171  void setTauRegionMask(int mask) {
172  pnode_[tauPUS].iparams_.resize(1);
173  pnode_[tauPUS].iparams_[0] = mask;
174  }
175  void setTauLsb(double lsb) { taup_.lsb_ = lsb; }
181  void setTauMaxJetIsolationA(double cutValue) { taup_.maxJetIsolationA_ = cutValue; }
186 
188  void setTauIsoAreaNrTowersEta(unsigned iTauIsoAreaNrTowersEta){taup_.isoAreaNrTowersEta_=iTauIsoAreaNrTowersEta;}
189  void setTauIsoAreaNrTowersPhi(unsigned iTauIsoAreaNrTowersPhi){taup_.isoAreaNrTowersPhi_=iTauIsoAreaNrTowersPhi;}
190  void setTauIsoVetoNrTowersPhi(unsigned iTauIsoVetoNrTowersPhi){taup_.isoVetoNrTowersPhi_=iTauIsoVetoNrTowersPhi;}
191 
192  void setTauCalibrationParams(std::vector<double> params) { pnode_[tauCalibration].dparams_ = params; }
194  void setTauPUSParams(const std::vector<double> & params) { pnode_[tauPUS].dparams_ = params; }
195 
197 
198  // jets
199  double jetLsb() const { return jetp_.lsb_; }
200  double jetSeedThreshold() const { return jetp_.seedThreshold_; }
202  int jetRegionMask() const {
203  if (pnode_[jetPUS].version_ ==1)
204  return pnode_[jetPUS].iparams_[0];
205  else
206  return 0;
207  }
208  std::string jetPUSType() const { return pnode_[jetPUS].type_; }
209  std::vector<double> jetPUSParams() { return pnode_[jetPUS].dparams_; }
211  std::vector<double> jetCalibrationParams() { return pnode_[jetCalibration].dparams_; }
213 
214  void setJetLsb(double lsb) { jetp_.lsb_ = lsb; }
217  void setJetRegionMask(int mask) {
218  pnode_[jetPUS].iparams_.resize(1);
219  pnode_[jetPUS].iparams_[0] = mask;
220  }
222  void setJetPUSParams(std::vector<double> params) { pnode_[jetPUS].dparams_ = params; }
224  void setJetCalibrationParams(std::vector<double> params) { pnode_[jetCalibration].dparams_ = params; }
226 
227  // sums
228  double etSumLsb() const { return etSumLsb_; }
229  int etSumEtaMin(unsigned isum) const;
230  int etSumEtaMax(unsigned isum) const;
231  double etSumEtThreshold(unsigned isum) const;
232 
233  void setEtSumLsb(double lsb) { etSumLsb_ = lsb; }
234  void setEtSumEtaMin(unsigned isum, int eta);
235  void setEtSumEtaMax(unsigned isum, int eta);
236  void setEtSumEtThreshold(unsigned isum, double thresh);
237 
238  // HI centrality
239  int centralityRegionMask() const {
240  if(pnode_[hiCentrality].version_ == 1)
241  return pnode_[hiCentrality].iparams_[0] ;
242  else
243  return 0;
244  }
245  std::vector<int> minimumBiasThresholds() const {
246  if(pnode_[hiCentrality].version_ == 1 && pnode_[hiCentrality].iparams_.size()==5) {
247  std::vector<int> newVec;
248  for(int i = 0; i<4; i++) {
249  newVec.push_back(pnode_[hiCentrality].iparams_.at(i+1));
250  }
251  return newVec;
252  } else {
253  std::vector<int> newVec;
254  return newVec;
255  }
256  }
257  l1t::LUT * centralityLUT() { return &pnode_[hiCentrality].LUT_; }
258  void setCentralityRegionMask(int mask) {
259  pnode_[hiCentrality].iparams_.resize(5);
260  pnode_[hiCentrality].iparams_[0] = mask;
261  }
262  void setMinimumBiasThresholds(std::vector<int> thresholds) {
263  pnode_[hiCentrality].iparams_.resize(5);
264  for(int i = 0; i<4; i++) {
265  pnode_[hiCentrality].iparams_[i+1] = thresholds.at(i);
266  }
267  }
268  void setCentralityLUT(const l1t::LUT & lut) { pnode_[hiCentrality].LUT_ = lut; }
269 
270  // HI Q2
271  l1t::LUT * q2LUT() { return &pnode_[hiQ2].LUT_; }
272  void setQ2LUT(const l1t::LUT & lut) { pnode_[hiQ2].LUT_ = lut; }
273 
274  // HI parameters
275 
276 
277 
278  private:
283 
284  };
285 }
286 
287 #endif
void setEtSumEtaMax(unsigned isum, int eta)
const std::string & egPUSType() const
L1CaloEtScale jetScale()
int egMinPtHOverEIsolation() const
type
Definition: HCALResponse.h:21
std::vector< double > jetCalibrationParams()
bool doTowerEncoding() const
const std::vector< double > & tauPUSParams() const
int i
Definition: DBlmapReader.cc:9
void setTauMaxJetIsolationA(double cutValue)
int centralityRegionMask() const
std::string tauCalibrationType() const
void setCentralityLUT(const l1t::LUT &lut)
double tauMaxJetIsolationB() const
void setIsoTauEtaMax(int value)
void setTauMinPtJetIsolationB(double limit)
l1t::LUT * jetCalibrationLUT()
void setRegionPUSType(std::string type)
void setEgNeighbourThreshold(double thresh)
void setEgMinPtHOverEIsolation(int cutValue)
EgParams egp_
Definition: CaloParams.h:229
void setEgLsb(double lsb)
void setJetCalibrationParams(std::vector< double > params)
void setTauEtToHFRingEtLUT(const l1t::LUT &lut)
void setTauCalibrationLUT(const l1t::LUT &lut)
double tauMaxPtTauVeto() const
void setTauLsb(double lsb)
std::string jetPUSType() const
double tauMinPtJetIsolationB() const
void setTauIsolationLUT(const l1t::LUT &lut)
void setJetCalibrationLUT(const l1t::LUT &lut)
void setTauNeighbourThreshold(double thresh)
void setEgMaxPtJetIsolation(int cutValue)
double tauNeighbourThreshold() const
double etSumLsb() const
double etSumEtThreshold(unsigned isum) const
void setEgHcalThreshold(double thresh)
void setTauIsoAreaNrTowersPhi(unsigned iTauIsoAreaNrTowersPhi)
int egMinPtJetIsolation() const
double egMaxHcalEt() const
std::vector< Node > pnode_
Definition: CaloParams.h:222
void setJetScale(L1CaloEtScale jetScale)
unsigned egIsoAreaNrTowersPhi() const
unsigned tauIsoAreaNrTowersPhi() const
void setCentralityRegionMask(int mask)
TowerParams towerp_
Definition: CaloParams.h:224
double isum
unsigned tauIsoAreaNrTowersEta() const
int etSumEtaMax(unsigned isum) const
int towerNBitsSum() const
void setHfRingScale(L1CaloEtScale HfRingScale)
void setTauIsoAreaNrTowersEta(unsigned iTauIsoAreaNrTowersEta)
void setEgCalibrationLUT(const l1t::LUT &lut)
int egMaxPtHOverEIsolation() const
void setRegionPUSLUT(const l1t::LUT &lut)
void setEgShapeIdLUT(const l1t::LUT &lut)
double egLsb() const
L1CaloEtScale HtMissScale_
double regionLsb_
Definition: CaloParams.h:227
void setHtMissScale(L1CaloEtScale HtMissScale)
l1t::LUT * egCompressShapesLUT()
double egSeedThreshold() const
void setEtSumEtaMin(unsigned isum, int eta)
void setTauMaxPtTauVeto(double limit)
void setRegionLsb(double lsb)
std::string jetCalibrationType() const
void setJetCalibrationType(std::string type)
std::string egCalibrationType() const
unsigned egIsoVetoNrTowersPhi() const
JetParams jetp_
Definition: CaloParams.h:231
void setTowerLsbH(double lsb)
std::vector< int > minimumBiasThresholds() const
void setEgMinPtJetIsolation(int cutValue)
int etSumEtaMin(unsigned isum) const
double jetLsb() const
std::vector< double > tauCalibrationParams()
l1t::LUT * tauEtToHFRingEtLUT()
double tauLsb() const
void setEtSumEtThreshold(unsigned isum, double thresh)
int egMaxPtJetIsolation() const
void setTauPUSType(std::string type)
std::string tauPUSType() const
void setEgPUSType(std::string type)
tuple lut
Definition: lumiPlot.py:244
l1t::LUT * egTrimmingLUT()
double regionLsb() const
std::vector< double > egCalibrationParams()
void setTauSeedThreshold(double thresh)
void setTowerEncoding(bool doit)
void setTauMaxJetIsolationB(double limit)
void setTauCalibrationType(std::string type)
double egHcalThreshold() const
void setEgIsoAreaNrTowersPhi(unsigned iEgIsoAreaNrTowersPhi)
double egNeighbourThreshold() const
void setTowerNBitsSum(int n)
void setJetNeighbourThreshold(double thresh)
l1t::LUT * egMaxHOverELUT()
double egPUSParam(int ipar) const
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:220
std::string regionPUSType() const
Definition: LUT.h:29
TauParams taup_
Definition: CaloParams.h:230
double jetNeighbourThreshold() const
void setJetLsb(double lsb)
double egMaxPtHOverE() const
L1CaloEtScale HfRingScale_
void setTauPUSParams(const std::vector< double > &params)
void setQ2LUT(const l1t::LUT &lut)
double tauPUSParam(int ipar) const
double etSumLsb_
Definition: CaloParams.h:236
void setEgMaxHOverELUT(const l1t::LUT &lut)
int towerNBitsRatio() const
void setEgCalibrationParams(std::vector< double > params)
void setTauCalibrationParams(std::vector< double > params)
l1t::LUT * egCalibrationLUT()
void setMinimumBiasThresholds(std::vector< int > thresholds)
void setJetSeedThreshold(double thresh)
double tauSeedThreshold() const
void setEgMaxPtHOverE(double thresh)
void setEgTrimmingLUT(const l1t::LUT &lut)
void setEmScale(L1CaloEtScale emScale)
double towerLsbSum() const
void setRegionPUSParams(const std::vector< double > &params)
int towerMaskRatio() const
unsigned tauIsoVetoNrTowersPhi() const
l1t::LUT * tauCalibrationLUT()
void setEgIsolationLUT(const l1t::LUT &lut)
void setEgMaxPtHOverEIsolation(int cutValue)
double towerLsbE() const
void setEgSeedThreshold(double thresh)
void setTauIsoVetoNrTowersPhi(unsigned iTauIsoVetoNrTowersPhi)
void setJetPUSType(std::string type)
void setEgIsoVetoNrTowersPhi(unsigned iEgIsoVetoNrTowersPhi)
void setEtSumLsb(double lsb)
L1CaloEtScale HfRingScale()
double jetSeedThreshold() const
L1CaloEtScale HtMissScale()
void setEgIsoAreaNrTowersEta(unsigned iEgIsoAreaNrTowersEta)
l1t::LUT * tauIsolationLUT()
L1CaloEtScale emScale()
void setIsoTauEtaMin(int value)
void setTowerLsbSum(double lsb)
void setEgPUSParams(const std::vector< double > &params)
std::vector< double > regionPUSParams()
std::vector< double > jetPUSParams()
void setTowerLsbE(double lsb)
int regionPUSValue(int PUM0, int eta)
unsigned egIsoAreaNrTowersEta() const
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void setEgCalibrationType(std::string type)
const std::vector< double > & egPUSParams() const
void setEgCompressShapesLUT(const l1t::LUT &lut)
double tauMaxJetIsolationA() const
void setTowerNBitsRatio(int n)
double towerLsbH() const