CMS 3D CMS Logo

HcaluLUTTPGCoder.cc
Go to the documentation of this file.
1 #include <iostream>
2 #include <fstream>
3 #include <cmath>
4 #include <string>
32 
33 const float HcaluLUTTPGCoder::lsb_=1./16;
34 
38 
39 constexpr double MaximumFractionalError = 0.002; // 0.2% error allowed from this source
40 
41 HcaluLUTTPGCoder::HcaluLUTTPGCoder(const HcalTopology* top, const edm::ESHandle<HcalTimeSlew>& delay) : topo_(top), delay_(delay), LUTGenerationMode_(true), bitToMask_(0), allLinear_(false), linearLSB_QIE8_(1.), linearLSB_QIE11_(1.), pulseCorr_(std::make_unique<HcalPulseContainmentManager>(MaximumFractionalError)) {
57  size_t nluts= (size_t)(sizeHB_+sizeHE_+sizeHF_+1);
58  inputLUT_ = std::vector<HcaluLUTTPGCoder::Lut>(nluts);
59  gain_ = std::vector<float>(nluts, 0.);
60  ped_ = std::vector<float>(nluts, 0.);
62 }
63 
64 void HcaluLUTTPGCoder::compress(const IntegerCaloSamples& ics, const std::vector<bool>& featureBits, HcalTriggerPrimitiveDigi& tp) const {
65  throw cms::Exception("PROBLEM: This method should never be invoked!");
66 }
67 
69 }
70 
71 int HcaluLUTTPGCoder::getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const {
72  int retval(0);
73  if (id == HcalBarrel) {
74  retval = (depth-1)+maxDepthHB_*(iphi-1);
75  if (ieta>0) retval+=maxDepthHB_*nFi_*(ieta-firstHBEta_);
76  else retval+=maxDepthHB_*nFi_*(ieta+lastHBEta_+nHBEta_);
77  } else if (id == HcalEndcap) {
78  retval = sizeHB_;
79  retval+= (depth-1)+maxDepthHE_*(iphi-1);
80  if (ieta>0) retval+=maxDepthHE_*nFi_*(ieta-firstHEEta_);
81  else retval+=maxDepthHE_*nFi_*(ieta+lastHEEta_+nHEEta_);
82  } else if (id == HcalForward) {
83  retval = sizeHB_+sizeHE_;
84  retval+= (depth-1)+maxDepthHF_*(iphi-1);
85  if (ieta>0) retval+=maxDepthHF_*nFi_*(ieta-firstHFEta_);
86  else retval+=maxDepthHF_*nFi_*(ieta+lastHFEta_+nHFEta_);
87  }
88  return retval;
89 }
90 
91 int HcaluLUTTPGCoder::getLUTId(uint32_t rawid) const {
92  HcalDetId detid(rawid);
93  return getLUTId(detid.subdet(), detid.ieta(), detid.iphi(), detid.depth());
94 }
95 
96 int HcaluLUTTPGCoder::getLUTId(const HcalDetId& detid) const {
97  return getLUTId(detid.subdet(), detid.ieta(), detid.iphi(), detid.depth());
98 }
99 
100 void HcaluLUTTPGCoder::update(const char* filename, bool appendMSB) {
101 
102  std::ifstream file(filename, std::ios::in);
103  assert(file.is_open());
104 
105  std::vector<HcalSubdetector> subdet;
107 
108  // Drop first (comment) line
109  std::getline(file, buffer);
110  std::getline(file, buffer);
111 
112  unsigned int index = buffer.find("H", 0);
113  while (index < buffer.length()){
114  std::string subdetStr = buffer.substr(index, 2);
115  if (subdetStr == "HB") subdet.push_back(HcalBarrel);
116  else if (subdetStr == "HE") subdet.push_back(HcalEndcap);
117  else if (subdetStr == "HF") subdet.push_back(HcalForward);
118  //TODO Check subdet
119  //else exception
120  index += 2;
121  index = buffer.find("H", index);
122  }
123 
124  // Get upper/lower ranges for ieta/iphi/depth
125  size_t nCol = subdet.size();
126  assert(nCol > 0);
127 
128  std::vector<int> ietaU;
129  std::vector<int> ietaL;
130  std::vector<int> iphiU;
131  std::vector<int> iphiL;
132  std::vector<int> depU;
133  std::vector<int> depL;
134  std::vector< Lut > lutFromFile(nCol);
135  LutElement lutValue;
136 
137  for (size_t i=0; i<nCol; ++i) {
138  int ieta;
139  file >> ieta;
140  ietaL.push_back(ieta);
141  }
142 
143  for (size_t i=0; i<nCol; ++i) {
144  int ieta;
145  file >> ieta;
146  ietaU.push_back(ieta);
147  }
148 
149  for (size_t i=0; i<nCol; ++i) {
150  int iphi;
151  file >> iphi;
152  iphiL.push_back(iphi);
153  }
154 
155  for (size_t i=0; i<nCol; ++i) {
156  int iphi;
157  file >> iphi;
158  iphiU.push_back(iphi);
159  }
160 
161  for (size_t i=0; i<nCol; ++i) {
162  int dep;
163  file >> dep;
164  depL.push_back(dep);
165  }
166 
167  for (size_t i=0; i<nCol; ++i) {
168  int dep;
169  file >> dep;
170  depU.push_back(dep);
171  }
172 
173  // Read Lut Entry
174  for (size_t i=0; file >> lutValue; i = (i+1) % nCol){
175  lutFromFile[i].push_back(lutValue);
176  }
177 
178  // Check lut size
179  for (size_t i=0; i<nCol; ++i) assert(lutFromFile[i].size() == INPUT_LUT_SIZE);
180 
181  for (size_t i=0; i<nCol; ++i){
182  for (int ieta = ietaL[i]; ieta <= ietaU[i]; ++ieta){
183  for (int iphi = iphiL[i]; iphi <= iphiU[i]; ++iphi){
184  for (int depth = depL[i]; depth <= depU[i]; ++depth){
185 
186  HcalDetId id(subdet[i], ieta, iphi, depth);
187  if (!topo_->valid(id)) continue;
188 
189  int lutId = getLUTId(id);
190  for (size_t adc = 0; adc < INPUT_LUT_SIZE; ++adc){
191  if (appendMSB){
192  // Append FG bit LUT to MSB
193  // MSB = Most Significant Bit = bit 10
194  // Overwrite bit 10
195  LutElement msb = (lutFromFile[i][adc] != 0 ? QIE8_LUT_MSB : 0);
196  inputLUT_[lutId][adc] = (msb | (inputLUT_[lutId][adc] & QIE8_LUT_BITMASK));
197  }
198  else inputLUT_[lutId][adc] = lutFromFile[i][adc];
199  }// for adc
200  }// for depth
201  }// for iphi
202  }// for ieta
203  }// for nCol
204 }
205 
207  LutXml * _xml = new LutXml(filename);
208  _xml->create_lut_map();
210  for (int ieta = -HcalDetId::kHcalEtaMask2;
211  ieta <= HcalDetId::kHcalEtaMask2; ++ieta) {
212  for (int iphi = 0; iphi <= HcalDetId::kHcalPhiMask2; ++iphi) {
213  for (int depth = 1; depth < HcalDetId::kHcalDepthMask2; ++depth) {
214  for (int isub=0; isub<3; ++isub) {
215  HcalDetId detid(subdet[isub], ieta, iphi, depth);
216  if (!topo_->valid(detid)) continue;
217  int id = getLUTId(subdet[isub], ieta, iphi, depth);
218  std::vector<unsigned int>* lut = _xml->getLutFast(detid);
219  if (lut==nullptr) throw cms::Exception("PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
220  if (lut->size()!=INPUT_LUT_SIZE) throw cms::Exception ("PROBLEM: Wrong inputLUT_ size in xml file for ") << detid << std::endl;
221  for (unsigned int i=0; i<INPUT_LUT_SIZE; ++i) inputLUT_[id][i] = (LutElement)lut->at(i);
222  }
223  }
224  }
225  }
226  delete _xml;
228 }
229 
230 double HcaluLUTTPGCoder::cosh_ieta(int ieta, int depth, HcalSubdetector subdet) {
231  // ieta = 28 and 29 are both associated with trigger tower 28
232  // so special handling is required. HF ieta=29 channels included in TT30
233  // are already handled correctly in cosh_ieta_
234  if (abs(ieta) >= 28 && subdet == HcalEndcap && allLinear_) {
235  if (abs(ieta) == 29) return cosh_ieta_29_HE_;
236  if (abs(ieta) == 28) {
237  if (depth <= 3) return cosh_ieta_28_HE_low_depths_;
238  else return cosh_ieta_28_HE_high_depths_;
239  }
240  }
241 
242  return cosh_ieta_[ieta];
243 }
244 
246 
247  cosh_ieta_ = std::vector<double>(lastHFEta_ + 1, -1.0);
248 
249  HcalTrigTowerGeometry triggeo(topo_);
250 
251  for (int i = 1; i <= firstHFEta_; ++i) {
252  double eta_low = 0., eta_high = 0.;
253  triggeo.towerEtaBounds(i, 0, eta_low, eta_high);
254  cosh_ieta_[i] = cosh((eta_low + eta_high)/2.);
255  }
256  for (int i = firstHFEta_; i <= lastHFEta_; ++i){
257  std::pair<double,double> etas = topo_->etaRange(HcalForward,i);
258  double eta1 = etas.first;
259  double eta2 = etas.second;
260  cosh_ieta_[i] = cosh((eta1 + eta2)/2.);
261  }
262 
263  // trigger tower 28 in HE has a more complicated geometry
264  std::pair<double, double> eta28 = topo_->etaRange(HcalEndcap, 28);
265  std::pair<double, double> eta29 = topo_->etaRange(HcalEndcap, 29);
266  cosh_ieta_29_HE_ = cosh((eta29.first + eta29.second)/2.);
267  cosh_ieta_28_HE_low_depths_ = cosh((eta28.first + eta28.second)/2.);
268  // for higher depths in ieta = 28, the trigger tower extends past
269  // the ieta = 29 channels
270  cosh_ieta_28_HE_high_depths_ = cosh((eta28.first + eta29.second)/2.);
271 }
272 
273 void HcaluLUTTPGCoder::update(const HcalDbService& conditions) {
274 
275  const HcalLutMetadata *metadata = conditions.getHcalLutMetadata();
276  assert(metadata !=nullptr);
277  float nominalgain_ = metadata->getNominalGain();
278 
279  pulseCorr_->beginRun(&conditions, delay_);
280 
282 
283  for (const auto& id: metadata->getAllChannels()) {
284 
285  if (not (id.det() == DetId::Hcal and topo_->valid(id))) continue;
286 
287  HcalDetId cell(id);
288  HcalSubdetector subdet = cell.subdet();
289 
290  if (subdet != HcalBarrel and subdet != HcalEndcap and subdet != HcalForward) continue;
291 
292  const HcalQIECoder* channelCoder = conditions.getHcalCoder (cell);
293  const HcalQIEShape* shape = conditions.getHcalShape(cell);
294  HcalCoderDb coder (*channelCoder, *shape);
295  const HcalLutMetadatum *meta = metadata->getValues(cell);
296 
297  unsigned int mipMax = 0;
298  unsigned int mipMin = 0;
299 
300  bool is2018OrLater = topo_->triggerMode() >= HcalTopologyMode::TriggerMode_2018 or
302  if (is2018OrLater or topo_->dddConstants()->isPlan1(cell)) {
303  const HcalTPChannelParameter *channelParameters = conditions.getHcalTPChannelParameter(cell);
304  mipMax = channelParameters->getFGBitInfo() >> 16;
305  mipMin = channelParameters->getFGBitInfo() & 0xFFFF;
306  }
307 
308  int lutId = getLUTId(cell);
309  Lut &lut=inputLUT_[lutId];
310  float ped = 0;
311  float gain = 0;
312  uint32_t status = 0;
313 
314  if (LUTGenerationMode_){
315  const HcalCalibrations& calibrations = conditions.getHcalCalibrations(cell);
316  for (auto capId : {0,1,2,3}){
317  ped += calibrations.effpedestal(capId);
318  gain += calibrations.LUTrespcorrgain(capId);
319  }
320  ped /= 4.0;
321  gain /= 4.0;
322 
323  //Get Channel Quality
324  const HcalChannelStatus* channelStatus = conditions.getHcalChannelStatus(cell);
325  status = channelStatus->getValue();
326 
327  } else {
328  const HcalL1TriggerObject* myL1TObj = conditions.getHcalL1TriggerObject(cell);
329  ped = myL1TObj->getPedestal();
330  gain = myL1TObj->getRespGain();
331  status = myL1TObj->getFlag();
332  } // LUTGenerationMode_
333 
334  ped_[lutId] = ped;
335  gain_[lutId] = gain;
336  bool isMasked = ( (status & bitToMask_) > 0 );
337  float rcalib = meta->getRCalib();
338 
339  auto adc2fC = [channelCoder, shape](unsigned int adc){
340  float fC = 0;
341  for (auto capId : {0,1,2,3}) fC += channelCoder->charge(*shape, adc, capId);
342  return fC/4;
343  };
344 
345  int qieType =conditions.getHcalQIEType(cell)->getValue();
346 
347  const size_t SIZE = qieType==QIE8 ? INPUT_LUT_SIZE : UPGRADE_LUT_SIZE;
348  const int MASK = qieType==QIE8 ? QIE8_LUT_BITMASK :
350  double linearLSB = linearLSB_QIE8_;
351  if (qieType == QIE11 and cell.ietaAbs() == topo_->lastHBRing())
352  linearLSB = linearLSB_QIE11Overlap_;
353  else if (qieType == QIE11)
354  linearLSB = linearLSB_QIE11_;
355 
356  lut.resize(SIZE, 0);
357 
358  // Input LUT for HB/HE/HF
359  if (subdet == HcalBarrel || subdet == HcalEndcap){
360 
361  int granularity = meta->getLutGranularity();
362 
363  double correctionPhaseNS = conditions.getHcalRecoParam(cell)->correctionPhaseNS();
364  for (unsigned int adc = 0; adc < SIZE; ++adc) {
365  if (isMasked) lut[adc] = 0;
366  else {
367  double nonlinearityCorrection = 1.0;
368  double containmentCorrection2TSCorrected = 1.0;
369  // SiPM nonlinearity was not corrected in 2017
370  // and containment corrections were not
371  // ET-dependent prior to 2018
372  if(is2018OrLater) {
373  double containmentCorrection1TS = pulseCorr_->correction(cell, 1, correctionPhaseNS, adc2fC(adc));
374  // Use the 1-TS containment correction to estimate the charge of the pulse
375  // from the individual samples
376  double correctedCharge = containmentCorrection1TS*adc2fC(adc);
377  containmentCorrection2TSCorrected = pulseCorr_->correction(cell, 2, correctionPhaseNS, correctedCharge);
378  if(qieType==QIE11) {
379  const HcalSiPMParameter& siPMParameter(*conditions.getHcalSiPMParameter(cell));
380  HcalSiPMnonlinearity corr(conditions.getHcalSiPMCharacteristics()->getNonLinearities(siPMParameter.getType()));
381  const double fcByPE = siPMParameter.getFCByPE();
382  const double effectivePixelsFired = correctedCharge/fcByPE;
383  nonlinearityCorrection = corr.getRecoCorrectionFactor(effectivePixelsFired);
384  }
385  }
386  if (allLinear_)
387  lut[adc] = (LutElement) std::min(std::max(0, int((adc2fC(adc) - ped) * gain * rcalib * nonlinearityCorrection * containmentCorrection2TSCorrected / linearLSB / cosh_ieta(cell.ietaAbs(), cell.depth(), HcalEndcap))), MASK);
388  else
389  lut[adc] = (LutElement) std::min(std::max(0, int((adc2fC(adc) - ped) * gain * rcalib * nonlinearityCorrection * containmentCorrection2TSCorrected / nominalgain_ / granularity)), MASK);
390 
391  if(qieType==QIE11){
392  if (adc >= mipMin and adc < mipMax) lut[adc] |= QIE11_LUT_MSB0;
393  else if (adc >= mipMax) lut[adc] |= QIE11_LUT_MSB1;
394  }
395  }
396  }
397  }
398  else if (subdet == HcalForward){
399  for (unsigned int adc = 0; adc < SIZE; ++adc) {
400  if (isMasked) lut[adc] = 0;
401  else {
402  lut[adc] = std::min(std::max(0,int((adc2fC(adc) - ped) * gain * rcalib / lsb_ / cosh_ieta_[cell.ietaAbs()])), MASK);
403  if(adc>FG_HF_thresholds_[0]) lut[adc] |= QIE10_LUT_MSB0;
404  if(adc>FG_HF_thresholds_[1]) lut[adc] |= QIE10_LUT_MSB1;
405  }
406  }
407  }
408  }
409 }
410 
412  int lutId = getLUTId(df.id());
413  const Lut& lut = inputLUT_.at(lutId);
414  for (int i=0; i<df.size(); i++){
415  ics[i] = (lut.at(df[i].adc()) & QIE8_LUT_BITMASK);
416  }
417 }
418 
420  int lutId = getLUTId(df.id());
421  const Lut& lut = inputLUT_.at(lutId);
422  for (int i=0; i<df.size(); i++){
423  ics[i] = (lut.at(df[i].adc()) & QIE8_LUT_BITMASK);
424  }
425 }
426 
428  int lutId = getLUTId(HcalDetId(df.id()));
429  const Lut& lut = inputLUT_.at(lutId);
430  for (int i=0; i<df.samples(); i++){
431  ics[i] = (lut.at(df[i].adc()) & QIE10_LUT_BITMASK);
432  }
433 }
434 
436  int lutId = getLUTId(HcalDetId(df.id()));
437  const Lut& lut = inputLUT_.at(lutId);
438  for (int i=0; i<df.samples(); i++){
439  ics[i] = (lut.at(df[i].adc()) & QIE11_LUT_BITMASK);
440  }
441 }
442 
444  int lutId = getLUTId(id);
445  return ((inputLUT_.at(lutId)).at(sample.adc()) & QIE8_LUT_BITMASK);
446 }
447 
449  int lutId = getLUTId(id);
450  return ped_.at(lutId);
451 }
452 
454  int lutId = getLUTId(id);
455  return gain_.at(lutId);
456 }
457 
458 std::vector<unsigned short> HcaluLUTTPGCoder::getLinearizationLUT(HcalDetId id) const{
459  int lutId = getLUTId(id);
460  return inputLUT_.at(lutId);
461 }
462 
463 void HcaluLUTTPGCoder::lookupMSB(const HBHEDataFrame& df, std::vector<bool>& msb) const{
464  msb.resize(df.size());
465  for (int i=0; i<df.size(); ++i)
466  msb[i] = getMSB(df.id(), df.sample(i).adc());
467 }
468 
469 bool HcaluLUTTPGCoder::getMSB(const HcalDetId& id, int adc) const{
470  int lutId = getLUTId(id);
471  const Lut& lut = inputLUT_.at(lutId);
472  return (lut.at(adc) & QIE8_LUT_MSB);
473 }
474 
475 void HcaluLUTTPGCoder::lookupMSB(const QIE10DataFrame& df, std::vector<std::bitset<2>>& msb) const{
476  msb.resize(df.samples());
477  int lutId = getLUTId(HcalDetId(df.id()));
478  const Lut& lut = inputLUT_.at(lutId);
479  for (int i = 0; i < df.samples(); ++i) {
480  msb[i][0] = lut.at(df[i].adc()) & QIE10_LUT_MSB0;
481  msb[i][1] = lut.at(df[i].adc()) & QIE10_LUT_MSB1;
482  }
483 }
484 
485 void
486 HcaluLUTTPGCoder::lookupMSB(const QIE11DataFrame& df, std::vector<std::bitset<2>>& msb) const
487 {
488  int lutId = getLUTId(HcalDetId(df.id()));
489  const Lut& lut = inputLUT_.at(lutId);
490  for (int i = 0; i < df.samples(); ++i) {
491  msb[i][0] = lut.at(df[i].adc()) & QIE11_LUT_MSB0;
492  msb[i][1] = lut.at(df[i].adc()) & QIE11_LUT_MSB1;
493  }
494 }
int adc(sample_type sample)
get the ADC sample (12 bits)
std::vector< uint32_t > FG_HF_thresholds_
int samples() const
total number of samples in the digi
size
Write out results.
uint32_t getFlag() const
int firstHFRing() const
Definition: HcalTopology.h:91
float getPedestal() const
static const int nFi_
void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:167
double cosh_ieta_28_HE_high_depths_
int getValue() const
Definition: HcalQIEType.h:20
Definition: LutXml.h:27
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:142
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId) const
bool valid(const DetId &id) const override
double linearLSB_QIE11Overlap_
const HcalRecoParam * getHcalRecoParam(const HcalGenericDetId &fId) const
static const int QIE11_LUT_MSB1
static const int QIE11_LUT_BITMASK
const HcalChannelStatus * getHcalChannelStatus(const HcalGenericDetId &fId) const
Definition: HcalQIENum.h:4
float getLUTGain(HcalDetId id) const override
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:31
int create_lut_map(void)
Definition: LutXml.cc:375
const HcalTopology * topo_
int firstHBRing() const
Definition: HcalTopology.h:87
edm::DataFrame::id_type id() const
int lastHBRing() const
Definition: HcalTopology.h:88
static const int QIE11_LUT_MSB0
static const float lsb_
void towerEtaBounds(int ieta, int version, double &eta1, double &eta2) const
where this tower begins and ends in eta
const Item * getValues(DetId fId, bool throwOnFail=true) const
double cosh_ieta_28_HE_low_depths_
static const int QIE8_LUT_BITMASK
uint8_t getLutGranularity() const
HcalTopologyMode::TriggerMode triggerMode() const
Definition: HcalTopology.h:32
#define constexpr
unsigned short LutElement
void update(const HcalDbService &conditions)
static const int kHcalDepthMask2
Definition: HcalDetId.h:27
void updateXML(const char *filename)
static const int QIE10_LUT_MSB0
static const size_t UPGRADE_LUT_SIZE
int depth() const
get the tower depth
Definition: HcalDetId.h:162
void lookupMSB(const HBHEDataFrame &df, std::vector< bool > &msb) const
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
float getRespGain() const
double MaximumFractionalError
HcalDetId const & id() const
Definition: HFDataFrame.h:26
int terminate(void)
std::vector< DetId > getAllChannels() const
constexpr float correctionPhaseNS() const
Definition: HcalRecoParam.h:31
int maxDepth(HcalSubdetector subdet) const
float getNominalGain() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
float getRCalib() const
const HcalL1TriggerObject * getHcalL1TriggerObject(const HcalGenericDetId &fId) const
constexpr double effpedestal(int fCapId) const
get effective pedestal for capid=0..3
int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
int lastHFRing() const
Definition: HcalTopology.h:92
edm::DataFrame::id_type id() const
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
const HcalLutMetadata * getHcalLutMetadata() const
T min(T a, T b)
Definition: MathUtil.h:58
HcaluLUTTPGCoder(const HcalTopology *topo, const edm::ESHandle< HcalTimeSlew > &delay)
static const int QIE8_LUT_MSB
constexpr int adc() const
get the ADC sample
Definition: HcalQIESample.h:59
JetCorrectorParameters corr
Definition: classes.h:5
static const int QIE10_LUT_BITMASK
int ietaAbs() const
get the absolute value of the cell ieta
Definition: HcalDetId.h:150
const HcalQIEType * getHcalQIEType(const HcalGenericDetId &fId) const
std::vector< double > cosh_ieta_
double const adc2fC[256]
Definition: Constants.h:271
int iphi() const
get the cell iphi
Definition: HcalDetId.h:157
static const int kHcalPhiMask2
Definition: HcalDetId.h:17
std::vector< float > ped_
double cosh_ieta(int ieta, int depth, HcalSubdetector subdet)
std::vector< float > gain_
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:30
HcalQIESample const & sample(int i) const
access a sample
Definition: HBHEDataFrame.h:44
~HcaluLUTTPGCoder() override
int firstHERing() const
Definition: HcalTopology.h:89
constexpr double LUTrespcorrgain(int fCapId) const
get LUT corrected and response corrected gain for capid=0..3
const HcalSiPMCharacteristics * getHcalSiPMCharacteristics() const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:88
static const size_t INPUT_LUT_SIZE
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
const edm::ESHandle< HcalTimeSlew > & delay_
bool getMSB(const HcalDetId &id, int adc) const
float getLUTPedestal(HcalDetId id) const override
static const int kHcalEtaMask2
Definition: HcalDetId.h:21
uint32_t getFGBitInfo() const
get FG bit information
const HcalDetId & id() const
Definition: HBHEDataFrame.h:27
bool isPlan1(const HcalDetId &id) const
void make_cosh_ieta_map(void)
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
int samples() const
total number of samples in the digi
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
static const int QIE10_LUT_MSB1
static XMLProcessor * getInstance()
Definition: XMLProcessor.h:145
int lastHERing() const
Definition: HcalTopology.h:90
Definition: Lut.h:32
void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const override
std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const override
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
std::vector< Lut > inputLUT_
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:22