CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Types | Private Attributes | Static Private Attributes
HcaluLUTTPGCoder Class Reference

#include <HcaluLUTTPGCoder.h>

Inheritance diagram for HcaluLUTTPGCoder:
HcalTPGCoder

Public Member Functions

void adc2Linear (const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
 
void adc2Linear (const HFDataFrame &df, IntegerCaloSamples &ics) const override
 
void adc2Linear (const QIE10DataFrame &df, IntegerCaloSamples &ics) const override
 
void adc2Linear (const QIE11DataFrame &df, IntegerCaloSamples &ics) const override
 
unsigned short adc2Linear (HcalQIESample sample, HcalDetId id) const override
 
void compress (const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const override
 
double cosh_ieta (int ieta, int depth, HcalSubdetector subdet)
 
std::vector< unsigned short > getLinearizationLUT (HcalDetId id) const override
 Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all values. More...
 
float getLUTGain (HcalDetId id) const override
 
int getLUTId (HcalSubdetector id, int ieta, int iphi, int depth) const
 
int getLUTId (uint32_t rawid) const
 
int getLUTId (const HcalDetId &detid) const
 
float getLUTPedestal (HcalDetId id) const override
 
bool getMSB (const HcalDetId &id, int adc) const
 
 HcaluLUTTPGCoder (const HcalTopology *topo, const edm::ESHandle< HcalTimeSlew > &delay)
 
void lookupMSB (const HBHEDataFrame &df, std::vector< bool > &msb) const
 
void lookupMSB (const QIE10DataFrame &df, std::vector< bool > &msb) const
 
void lookupMSB (const QIE11DataFrame &df, std::vector< std::bitset< 2 >> &msb) const
 
void make_cosh_ieta_map (void)
 
void setAllLinear (bool linear, double lsb8, double lsb11, double lsb11overlap)
 
void setFGHFthreshold (unsigned int fgthreshold)
 
void setLUTGenerationMode (bool gen)
 
void setMaskBit (int bit)
 
void update (const HcalDbService &conditions)
 
void update (const char *filename, bool appendMSB=false)
 
void updateXML (const char *filename)
 
 ~HcaluLUTTPGCoder () override
 
- Public Member Functions inherited from HcalTPGCoder
unsigned short adc2Linear (unsigned char adc, HcalDetId id) const
 
virtual ~HcalTPGCoder ()=default
 

Static Public Attributes

static const float lsb_ =1./16
 
static const int QIE10_LUT_BITMASK = 0x7FF
 
static const int QIE11_LUT_BITMASK = 0x7FF
 
static const int QIE11_LUT_BITMASK_2017 = 0x3FF
 
static const int QIE8_LUT_BITMASK = 0x3FF
 

Private Types

typedef std::vector< LutElementLut
 
typedef unsigned short LutElement
 

Private Attributes

bool allLinear_
 
int bitToMask_
 
std::vector< double > cosh_ieta_
 
double cosh_ieta_28_HE_high_depths_
 
double cosh_ieta_28_HE_low_depths_
 
double cosh_ieta_29_HE_
 
const edm::ESHandle< HcalTimeSlew > & delay_
 
unsigned int FG_HF_threshold_
 
int firstHBEta_
 
int firstHEEta_
 
int firstHFEta_
 
std::vector< float > gain_
 
std::vector< LutinputLUT_
 
int lastHBEta_
 
int lastHEEta_
 
int lastHFEta_
 
double linearLSB_QIE11_
 
double linearLSB_QIE11Overlap_
 
double linearLSB_QIE8_
 
bool LUTGenerationMode_
 
int maxDepthHB_
 
int maxDepthHE_
 
int maxDepthHF_
 
int nHBEta_
 
int nHEEta_
 
int nHFEta_
 
std::vector< float > ped_
 
std::unique_ptr< HcalPulseContainmentManagerpulseCorr_
 
int sizeHB_
 
int sizeHE_
 
int sizeHF_
 
const HcalTopologytopo_
 

Static Private Attributes

static const size_t INPUT_LUT_SIZE = 128
 
static const int nFi_ = 72
 
static const int QIE10_LUT_MSB = 0x1000
 
static const int QIE11_LUT_MSB0 = 0x800
 
static const int QIE11_LUT_MSB1 = 0x1000
 
static const int QIE8_LUT_MSB = 0x400
 
static const size_t UPGRADE_LUT_SIZE = 256
 

Detailed Description

The nominal coder uses a user-supplied table to linearize the ADC values.

[number of ieta slices]
[low tower 1] [low tower 2] ...
[high tower 1] [ high tower 2] ...
[LUT 1(0)] [LUT 2(0)] ...
[LUT 1(1)] [LUT 2(1)] ...
. . .
[LUT 1(127)] [LUT 2(127)] ...
Author
M. Weinberger – TAMU
Tulika Bose and Greg Landsberg – Brown

Definition at line 32 of file HcaluLUTTPGCoder.h.

Member Typedef Documentation

typedef std::vector<LutElement> HcaluLUTTPGCoder::Lut
private

Definition at line 74 of file HcaluLUTTPGCoder.h.

typedef unsigned short HcaluLUTTPGCoder::LutElement
private

Definition at line 73 of file HcaluLUTTPGCoder.h.

Constructor & Destructor Documentation

HcaluLUTTPGCoder::HcaluLUTTPGCoder ( const HcalTopology topo,
const edm::ESHandle< HcalTimeSlew > &  delay 
)

Definition at line 42 of file HcaluLUTTPGCoder.cc.

References firstHBEta_, HcalTopology::firstHBRing(), firstHEEta_, HcalTopology::firstHERing(), firstHFEta_, HcalTopology::firstHFRing(), gain_, HcalBarrel, HcalEndcap, HcalForward, inputLUT_, lastHBEta_, HcalTopology::lastHBRing(), lastHEEta_, HcalTopology::lastHERing(), lastHFEta_, HcalTopology::lastHFRing(), make_cosh_ieta_map(), HcalTopology::maxDepth(), maxDepthHB_, maxDepthHE_, maxDepthHF_, nFi_, nHBEta_, nHEEta_, nHFEta_, ped_, sizeHB_, sizeHE_, sizeHF_, and topo_.

42  : topo_(top), delay_(delay), LUTGenerationMode_(true), bitToMask_(0), allLinear_(false), linearLSB_QIE8_(1.), linearLSB_QIE11_(1.), pulseCorr_(std::make_unique<HcalPulseContainmentManager>(MaximumFractionalError)) {
58  size_t nluts= (size_t)(sizeHB_+sizeHE_+sizeHF_+1);
59  inputLUT_ = std::vector<HcaluLUTTPGCoder::Lut>(nluts);
60  gain_ = std::vector<float>(nluts, 0.);
61  ped_ = std::vector<float>(nluts, 0.);
63 }
int firstHFRing() const
Definition: HcalTopology.h:91
static const int nFi_
const HcalTopology * topo_
int firstHBRing() const
Definition: HcalTopology.h:87
int lastHBRing() const
Definition: HcalTopology.h:88
double MaximumFractionalError
int maxDepth(HcalSubdetector subdet) const
int lastHFRing() const
Definition: HcalTopology.h:92
std::vector< float > ped_
std::vector< float > gain_
int firstHERing() const
Definition: HcalTopology.h:89
const edm::ESHandle< HcalTimeSlew > & delay_
void make_cosh_ieta_map(void)
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
int lastHERing() const
Definition: HcalTopology.h:90
std::vector< Lut > inputLUT_
HcaluLUTTPGCoder::~HcaluLUTTPGCoder ( )
override

Definition at line 69 of file HcaluLUTTPGCoder.cc.

69  {
70 }

Member Function Documentation

void HcaluLUTTPGCoder::adc2Linear ( const HBHEDataFrame df,
IntegerCaloSamples ics 
) const
overridevirtual

Implements HcalTPGCoder.

Definition at line 413 of file HcaluLUTTPGCoder.cc.

References ecalMGPA::adc(), getLUTId(), mps_fire::i, HBHEDataFrame::id(), inputLUT_, lumiPlot::lut, QIE8_LUT_BITMASK, and HBHEDataFrame::size().

Referenced by HcalTriggerPrimitiveAlgo::addSignal().

413  {
414  int lutId = getLUTId(df.id());
415  const Lut& lut = inputLUT_.at(lutId);
416  for (int i=0; i<df.size(); i++){
417  ics[i] = (lut.at(df[i].adc()) & QIE8_LUT_BITMASK);
418  }
419 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
static const int QIE8_LUT_BITMASK
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
Definition: Lut.h:32
std::vector< Lut > inputLUT_
void HcaluLUTTPGCoder::adc2Linear ( const HFDataFrame df,
IntegerCaloSamples ics 
) const
overridevirtual

Implements HcalTPGCoder.

Definition at line 421 of file HcaluLUTTPGCoder.cc.

References ecalMGPA::adc(), getLUTId(), mps_fire::i, HFDataFrame::id(), inputLUT_, lumiPlot::lut, QIE8_LUT_BITMASK, and HFDataFrame::size().

421  {
422  int lutId = getLUTId(df.id());
423  const Lut& lut = inputLUT_.at(lutId);
424  for (int i=0; i<df.size(); i++){
425  ics[i] = (lut.at(df[i].adc()) & QIE8_LUT_BITMASK);
426  }
427 }
int adc(sample_type sample)
get the ADC sample (12 bits)
static const int QIE8_LUT_BITMASK
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
int size() const
total number of samples in the digi
Definition: HFDataFrame.h:26
const HcalDetId & id() const
Definition: HFDataFrame.h:22
Definition: Lut.h:32
std::vector< Lut > inputLUT_
void HcaluLUTTPGCoder::adc2Linear ( const QIE10DataFrame df,
IntegerCaloSamples ics 
) const
overridevirtual

Implements HcalTPGCoder.

Definition at line 429 of file HcaluLUTTPGCoder.cc.

References ecalMGPA::adc(), getLUTId(), mps_fire::i, QIE10DataFrame::id(), inputLUT_, lumiPlot::lut, QIE10_LUT_BITMASK, and QIE10DataFrame::samples().

429  {
430  int lutId = getLUTId(HcalDetId(df.id()));
431  const Lut& lut = inputLUT_.at(lutId);
432  for (int i=0; i<df.samples(); i++){
433  ics[i] = (lut.at(df[i].adc()) & QIE10_LUT_BITMASK);
434  }
435 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int samples() const
total number of samples in the digi
edm::DataFrame::id_type id() const
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
static const int QIE10_LUT_BITMASK
Definition: Lut.h:32
std::vector< Lut > inputLUT_
void HcaluLUTTPGCoder::adc2Linear ( const QIE11DataFrame df,
IntegerCaloSamples ics 
) const
overridevirtual

Implements HcalTPGCoder.

Definition at line 437 of file HcaluLUTTPGCoder.cc.

References ecalMGPA::adc(), getLUTId(), mps_fire::i, QIE11DataFrame::id(), inputLUT_, lumiPlot::lut, QIE11_LUT_BITMASK, and QIE11DataFrame::samples().

437  {
438  int lutId = getLUTId(HcalDetId(df.id()));
439  const Lut& lut = inputLUT_.at(lutId);
440  for (int i=0; i<df.samples(); i++){
441  ics[i] = (lut.at(df[i].adc()) & QIE11_LUT_BITMASK);
442  }
443 }
int adc(sample_type sample)
get the ADC sample (12 bits)
static const int QIE11_LUT_BITMASK
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
edm::DataFrame::id_type id() const
int samples() const
total number of samples in the digi
Definition: Lut.h:32
std::vector< Lut > inputLUT_
unsigned short HcaluLUTTPGCoder::adc2Linear ( HcalQIESample  sample,
HcalDetId  id 
) const
overridevirtual

Implements HcalTPGCoder.

Definition at line 445 of file HcaluLUTTPGCoder.cc.

References HcalQIESample::adc(), getLUTId(), inputLUT_, and QIE8_LUT_BITMASK.

445  {
446  int lutId = getLUTId(id);
447  return ((inputLUT_.at(lutId)).at(sample.adc()) & QIE8_LUT_BITMASK);
448 }
int adc() const
get the ADC sample
Definition: HcalQIESample.h:22
static const int QIE8_LUT_BITMASK
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
std::vector< Lut > inputLUT_
void HcaluLUTTPGCoder::compress ( const IntegerCaloSamples ics,
const std::vector< bool > &  featureBits,
HcalTriggerPrimitiveDigi tp 
) const
overridevirtual

Implements HcalTPGCoder.

Definition at line 65 of file HcaluLUTTPGCoder.cc.

References Exception.

65  {
66  throw cms::Exception("PROBLEM: This method should never be invoked!");
67 }
double HcaluLUTTPGCoder::cosh_ieta ( int  ieta,
int  depth,
HcalSubdetector  subdet 
)

Definition at line 231 of file HcaluLUTTPGCoder.cc.

References funct::abs(), allLinear_, cosh_ieta_, cosh_ieta_28_HE_high_depths_, cosh_ieta_28_HE_low_depths_, cosh_ieta_29_HE_, and HcalEndcap.

Referenced by update().

231  {
232  // ieta = 28 and 29 are both associated with trigger tower 28
233  // so special handling is required. HF ieta=29 channels included in TT30
234  // are already handled correctly in cosh_ieta_
235  if (abs(ieta) >= 28 && subdet == HcalEndcap && allLinear_) {
236  if (abs(ieta) == 29) return cosh_ieta_29_HE_;
237  if (abs(ieta) == 28) {
238  if (depth <= 3) return cosh_ieta_28_HE_low_depths_;
239  else return cosh_ieta_28_HE_high_depths_;
240  }
241  }
242 
243  return cosh_ieta_[ieta];
244 }
double cosh_ieta_28_HE_high_depths_
double cosh_ieta_28_HE_low_depths_
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< double > cosh_ieta_
std::vector< unsigned short > HcaluLUTTPGCoder::getLinearizationLUT ( HcalDetId  id) const
overridevirtual

Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all values.

Reimplemented from HcalTPGCoder.

Definition at line 460 of file HcaluLUTTPGCoder.cc.

References getLUTId(), and inputLUT_.

460  {
461  int lutId = getLUTId(id);
462  return inputLUT_.at(lutId);
463 }
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
std::vector< Lut > inputLUT_
float HcaluLUTTPGCoder::getLUTGain ( HcalDetId  id) const
overridevirtual

Implements HcalTPGCoder.

Definition at line 455 of file HcaluLUTTPGCoder.cc.

References gain_, and getLUTId().

455  {
456  int lutId = getLUTId(id);
457  return gain_.at(lutId);
458 }
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
std::vector< float > gain_
int HcaluLUTTPGCoder::getLUTId ( HcalSubdetector  id,
int  ieta,
int  iphi,
int  depth 
) const

Definition at line 72 of file HcaluLUTTPGCoder.cc.

References firstHBEta_, firstHEEta_, firstHFEta_, HcalBarrel, HcalEndcap, HcalForward, lastHBEta_, lastHEEta_, lastHFEta_, maxDepthHB_, maxDepthHE_, maxDepthHF_, nFi_, nHBEta_, nHEEta_, nHFEta_, sizeHB_, and sizeHE_.

Referenced by adc2Linear(), getLinearizationLUT(), getLUTGain(), getLUTId(), getLUTPedestal(), getMSB(), lookupMSB(), setAllLinear(), update(), and updateXML().

72  {
73  int retval(0);
74  if (id == HcalBarrel) {
75  retval = (depth-1)+maxDepthHB_*(iphi-1);
76  if (ieta>0) retval+=maxDepthHB_*nFi_*(ieta-firstHBEta_);
77  else retval+=maxDepthHB_*nFi_*(ieta+lastHBEta_+nHBEta_);
78  } else if (id == HcalEndcap) {
79  retval = sizeHB_;
80  retval+= (depth-1)+maxDepthHE_*(iphi-1);
81  if (ieta>0) retval+=maxDepthHE_*nFi_*(ieta-firstHEEta_);
82  else retval+=maxDepthHE_*nFi_*(ieta+lastHEEta_+nHEEta_);
83  } else if (id == HcalForward) {
84  retval = sizeHB_+sizeHE_;
85  retval+= (depth-1)+maxDepthHF_*(iphi-1);
86  if (ieta>0) retval+=maxDepthHF_*nFi_*(ieta-firstHFEta_);
87  else retval+=maxDepthHF_*nFi_*(ieta+lastHFEta_+nHFEta_);
88  }
89  return retval;
90 }
static const int nFi_
int HcaluLUTTPGCoder::getLUTId ( uint32_t  rawid) const

Definition at line 92 of file HcaluLUTTPGCoder.cc.

References HcalDetId::depth(), getLUTId(), HcalDetId::ieta(), HcalDetId::iphi(), and HcalDetId::subdet().

92  {
93  HcalDetId detid(rawid);
94  return getLUTId(detid.subdet(), detid.ieta(), detid.iphi(), detid.depth());
95 }
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
int HcaluLUTTPGCoder::getLUTId ( const HcalDetId detid) const

Definition at line 97 of file HcaluLUTTPGCoder.cc.

References HcalDetId::depth(), getLUTId(), HcalDetId::ieta(), HcalDetId::iphi(), and HcalDetId::subdet().

97  {
98  return getLUTId(detid.subdet(), detid.ieta(), detid.iphi(), detid.depth());
99 }
HcalSubdetector subdet() const
get the subdetector
Definition: HcalDetId.h:49
int depth() const
get the tower depth
Definition: HcalDetId.cc:108
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:103
float HcaluLUTTPGCoder::getLUTPedestal ( HcalDetId  id) const
overridevirtual

Implements HcalTPGCoder.

Definition at line 450 of file HcaluLUTTPGCoder.cc.

References getLUTId(), and ped_.

450  {
451  int lutId = getLUTId(id);
452  return ped_.at(lutId);
453 }
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
std::vector< float > ped_
bool HcaluLUTTPGCoder::getMSB ( const HcalDetId id,
int  adc 
) const

Definition at line 471 of file HcaluLUTTPGCoder.cc.

References getLUTId(), inputLUT_, lumiPlot::lut, and QIE8_LUT_MSB.

Referenced by lookupMSB(), and setAllLinear().

471  {
472  int lutId = getLUTId(id);
473  const Lut& lut = inputLUT_.at(lutId);
474  return (lut.at(adc) & QIE8_LUT_MSB);
475 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
static const int QIE8_LUT_MSB
Definition: Lut.h:32
std::vector< Lut > inputLUT_
void HcaluLUTTPGCoder::lookupMSB ( const HBHEDataFrame df,
std::vector< bool > &  msb 
) const

Definition at line 465 of file HcaluLUTTPGCoder.cc.

References HcalQIESample::adc(), getMSB(), mps_fire::i, HBHEDataFrame::id(), HBHEDataFrame::sample(), and HBHEDataFrame::size().

Referenced by HcalTriggerPrimitiveAlgo::addSignal(), and setAllLinear().

465  {
466  msb.resize(df.size());
467  for (int i=0; i<df.size(); ++i)
468  msb[i] = getMSB(df.id(), df.sample(i).adc());
469 }
int adc() const
get the ADC sample
Definition: HcalQIESample.h:22
int size() const
total number of samples in the digi
Definition: HBHEDataFrame.h:26
const HcalQIESample & sample(int i) const
access a sample
Definition: HBHEDataFrame.h:39
bool getMSB(const HcalDetId &id, int adc) const
const HcalDetId & id() const
Definition: HBHEDataFrame.h:22
void HcaluLUTTPGCoder::lookupMSB ( const QIE10DataFrame df,
std::vector< bool > &  msb 
) const

Definition at line 477 of file HcaluLUTTPGCoder.cc.

References ecalMGPA::adc(), getLUTId(), mps_fire::i, QIE10DataFrame::id(), inputLUT_, lumiPlot::lut, QIE10_LUT_MSB, and QIE10DataFrame::samples().

477  {
478  msb.resize(df.samples());
479  int lutId = getLUTId(HcalDetId(df.id()));
480  const Lut& lut = inputLUT_.at(lutId);
481  for (int i = 0; i < df.samples(); ++i) {
482  msb[i] = lut.at(df[i].adc()) & QIE10_LUT_MSB;
483  }
484 }
int adc(sample_type sample)
get the ADC sample (12 bits)
int samples() const
total number of samples in the digi
edm::DataFrame::id_type id() const
static const int QIE10_LUT_MSB
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
Definition: Lut.h:32
std::vector< Lut > inputLUT_
void HcaluLUTTPGCoder::lookupMSB ( const QIE11DataFrame df,
std::vector< std::bitset< 2 >> &  msb 
) const

Definition at line 487 of file HcaluLUTTPGCoder.cc.

References ecalMGPA::adc(), getLUTId(), mps_fire::i, QIE11DataFrame::id(), inputLUT_, lumiPlot::lut, QIE11_LUT_MSB0, QIE11_LUT_MSB1, and QIE11DataFrame::samples().

488 {
489  int lutId = getLUTId(HcalDetId(df.id()));
490  const Lut& lut = inputLUT_.at(lutId);
491  for (int i = 0; i < df.samples(); ++i) {
492  msb[i][0] = lut.at(df[i].adc()) & QIE11_LUT_MSB0;
493  msb[i][1] = lut.at(df[i].adc()) & QIE11_LUT_MSB1;
494  }
495 }
int adc(sample_type sample)
get the ADC sample (12 bits)
static const int QIE11_LUT_MSB1
static const int QIE11_LUT_MSB0
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
edm::DataFrame::id_type id() const
int samples() const
total number of samples in the digi
Definition: Lut.h:32
std::vector< Lut > inputLUT_
void HcaluLUTTPGCoder::make_cosh_ieta_map ( void  )

Definition at line 246 of file HcaluLUTTPGCoder.cc.

References cosh_ieta_, cosh_ieta_28_HE_high_depths_, cosh_ieta_28_HE_low_depths_, cosh_ieta_29_HE_, HcalTopology::etaRange(), EnergyCorrector::etas, firstHFEta_, HcalEndcap, HcalForward, mps_fire::i, lastHFEta_, topo_, and HcalTrigTowerGeometry::towerEtaBounds().

Referenced by HcaluLUTTPGCoder(), and update().

246  {
247 
248  cosh_ieta_ = std::vector<double>(lastHFEta_ + 1, -1.0);
249 
250  HcalTrigTowerGeometry triggeo(topo_);
251 
252  for (int i = 1; i <= firstHFEta_; ++i) {
253  double eta_low = 0., eta_high = 0.;
254  triggeo.towerEtaBounds(i, 0, eta_low, eta_high);
255  cosh_ieta_[i] = cosh((eta_low + eta_high)/2.);
256  }
257  for (int i = firstHFEta_; i <= lastHFEta_; ++i){
258  std::pair<double,double> etas = topo_->etaRange(HcalForward,i);
259  double eta1 = etas.first;
260  double eta2 = etas.second;
261  cosh_ieta_[i] = cosh((eta1 + eta2)/2.);
262  }
263 
264  // trigger tower 28 in HE has a more complicated geometry
265  std::pair<double, double> eta28 = topo_->etaRange(HcalEndcap, 28);
266  std::pair<double, double> eta29 = topo_->etaRange(HcalEndcap, 29);
267  cosh_ieta_29_HE_ = cosh((eta29.first + eta29.second)/2.);
268  cosh_ieta_28_HE_low_depths_ = cosh((eta28.first + eta28.second)/2.);
269  // for higher depths in ieta = 28, the trigger tower extends past
270  // the ieta = 29 channels
271  cosh_ieta_28_HE_high_depths_ = cosh((eta28.first + eta29.second)/2.);
272 }
double cosh_ieta_28_HE_high_depths_
const HcalTopology * topo_
double cosh_ieta_28_HE_low_depths_
std::vector< double > cosh_ieta_
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
void HcaluLUTTPGCoder::setAllLinear ( bool  linear,
double  lsb8,
double  lsb11,
double  lsb11overlap 
)
inline
void HcaluLUTTPGCoder::setFGHFthreshold ( unsigned int  fgthreshold)
inline

Definition at line 54 of file HcaluLUTTPGCoder.h.

References FG_HF_threshold_.

Referenced by HcalTPGCoderULUT::buildCoder().

54 { FG_HF_threshold_ = fgthreshold; };
unsigned int FG_HF_threshold_
void HcaluLUTTPGCoder::setLUTGenerationMode ( bool  gen)
inline

Definition at line 53 of file HcaluLUTTPGCoder.h.

References relval_steps::gen(), and LUTGenerationMode_.

Referenced by HcalTPGCoderULUT::buildCoder().

53 { LUTGenerationMode_ = gen; };
def gen(fragment, howMuch)
Production test section ####.
void HcaluLUTTPGCoder::setMaskBit ( int  bit)
inline

Definition at line 55 of file HcaluLUTTPGCoder.h.

References bitToMask_.

Referenced by HcalTPGCoderULUT::buildCoder().

55 { bitToMask_ = bit; };
void HcaluLUTTPGCoder::update ( const HcalDbService conditions)

Definition at line 274 of file HcaluLUTTPGCoder.cc.

References ecalMGPA::adc(), hcaldqm::constants::adc2fC, allLinear_, bitToMask_, AlignmentProducer_cff::calibrations, HcalQIECoder::charge(), corr, CastorSimpleReconstructor_cfi::correctionPhaseNS, HcalRecoParam::correctionPhaseNS(), cosh_ieta(), cosh_ieta_, HcalTopology::dddConstants(), delay_, HcalDetId::depth(), HcalCalibrations::effpedestal(), FG_HF_threshold_, muonCSCDigis_cfi::gain, gain_, HcalCondObjectContainer< Item >::getAllChannels(), HcalTPChannelParameter::getFGBitInfo(), HcalL1TriggerObject::getFlag(), HcalDbService::getHcalCalibrations(), HcalDbService::getHcalChannelStatus(), HcalDbService::getHcalCoder(), HcalDbService::getHcalL1TriggerObject(), HcalDbService::getHcalLutMetadata(), HcalDbService::getHcalQIEType(), HcalDbService::getHcalRecoParam(), HcalDbService::getHcalShape(), HcalDbService::getHcalSiPMCharacteristics(), HcalDbService::getHcalSiPMParameter(), HcalDbService::getHcalTPChannelParameter(), HcalLutMetadatum::getLutGranularity(), getLUTId(), HcalLutMetadata::getNominalGain(), HcalSiPMCharacteristics::getNonLinearities(), HcalL1TriggerObject::getPedestal(), HcalLutMetadatum::getRCalib(), HcalL1TriggerObject::getRespGain(), HcalQIEType::getValue(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), DetId::Hcal, HcalBarrel, HcalEndcap, HcalForward, HcalDetId::ietaAbs(), INPUT_LUT_SIZE, inputLUT_, HcalDDDRecConstants::isPlan1(), HcalTopology::lastHBRing(), linearLSB_QIE11_, linearLSB_QIE11Overlap_, linearLSB_QIE8_, lsb_, lumiPlot::lut, LUTGenerationMode_, HcalCalibrations::LUTrespcorrgain(), make_cosh_ieta_map(), SiStripPI::max, min(), or, ped_, pulseCorr_, QIE10, QIE10_LUT_BITMASK, QIE10_LUT_MSB, QIE11, QIE11_LUT_BITMASK, QIE11_LUT_BITMASK_2017, QIE11_LUT_MSB0, QIE11_LUT_MSB1, QIE8, QIE8_LUT_BITMASK, SIZE, mps_update::status, HcalDetId::subdet(), topo_, HcalTopology::triggerMode(), HcalTopologyMode::TriggerMode_2018, HcalTopologyMode::TriggerMode_2018legacy, UPGRADE_LUT_SIZE, and HcalTopology::valid().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), HcalTPGCoderULUT::buildCoder(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), HcalTPGCoderULUT::dbRecordCallback(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

274  {
275 
277  const HcalLutMetadata *metadata = conditions.getHcalLutMetadata();
278  assert(metadata !=nullptr);
279  float nominalgain_ = metadata->getNominalGain();
280 
281  pulseCorr_->beginRun(&conditions, delay_);
282 
284 
285  for (const auto& id: metadata->getAllChannels()) {
286 
287  if (not (id.det() == DetId::Hcal and topo_->valid(id))) continue;
288 
289  HcalDetId cell(id);
290  HcalSubdetector subdet = cell.subdet();
291 
292  if (subdet != HcalBarrel and subdet != HcalEndcap and subdet != HcalForward) continue;
293 
294  const HcalQIECoder* channelCoder = conditions.getHcalCoder (cell);
295  const HcalQIEShape* shape = conditions.getHcalShape(cell);
296  HcalCoderDb coder (*channelCoder, *shape);
297  const HcalLutMetadatum *meta = metadata->getValues(cell);
298 
299  unsigned int mipMax = 0;
300  unsigned int mipMin = 0;
301 
302  bool is2018OrLater = topo_->triggerMode() >= HcalTopologyMode::TriggerMode_2018 or
304  if (is2018OrLater or topo_->dddConstants()->isPlan1(cell)) {
305  const HcalTPChannelParameter *channelParameters = conditions.getHcalTPChannelParameter(cell);
306  mipMax = channelParameters->getFGBitInfo() >> 16;
307  mipMin = channelParameters->getFGBitInfo() & 0xFFFF;
308  }
309 
310  int lutId = getLUTId(cell);
311  Lut &lut=inputLUT_[lutId];
312  float ped = 0;
313  float gain = 0;
314  uint32_t status = 0;
315 
316  if (LUTGenerationMode_){
317  const HcalCalibrations& calibrations = conditions.getHcalCalibrations(cell);
318  for (auto capId : {0,1,2,3}){
319  ped += calibrations.effpedestal(capId);
320  gain += calibrations.LUTrespcorrgain(capId);
321  }
322  ped /= 4.0;
323  gain /= 4.0;
324 
325  //Get Channel Quality
326  const HcalChannelStatus* channelStatus = conditions.getHcalChannelStatus(cell);
327  status = channelStatus->getValue();
328 
329  } else {
330  const HcalL1TriggerObject* myL1TObj = conditions.getHcalL1TriggerObject(cell);
331  ped = myL1TObj->getPedestal();
332  gain = myL1TObj->getRespGain();
333  status = myL1TObj->getFlag();
334  } // LUTGenerationMode_
335 
336  ped_[lutId] = ped;
337  gain_[lutId] = gain;
338  bool isMasked = ( (status & bitToMask_) > 0 );
339  float rcalib = meta->getRCalib();
340 
341  auto adc2fC = [channelCoder, shape](unsigned int adc){
342  float fC = 0;
343  for (auto capId : {0,1,2,3}) fC += channelCoder->charge(*shape, adc, capId);
344  return fC/4;
345  };
346 
347  int qieType =conditions.getHcalQIEType(cell)->getValue();
348 
349  const size_t SIZE = qieType==QIE8 ? INPUT_LUT_SIZE : UPGRADE_LUT_SIZE;
350  const int MASK = qieType==QIE8 ? QIE8_LUT_BITMASK :
351  qieType==QIE10 ? QIE10_LUT_BITMASK :
352  is2018OrLater ? QIE11_LUT_BITMASK : QIE11_LUT_BITMASK_2017;
353  double linearLSB = linearLSB_QIE8_;
354  if (qieType == QIE11 and cell.ietaAbs() == topo_->lastHBRing())
355  linearLSB = linearLSB_QIE11Overlap_;
356  else if (qieType == QIE11)
357  linearLSB = linearLSB_QIE11_;
358 
359  lut.resize(SIZE, 0);
360 
361  // Input LUT for HB/HE/HF
362  if (subdet == HcalBarrel || subdet == HcalEndcap){
363 
364  int granularity = meta->getLutGranularity();
365 
366  double correctionPhaseNS = conditions.getHcalRecoParam(cell)->correctionPhaseNS();
367  for (unsigned int adc = 0; adc < SIZE; ++adc) {
368  if (isMasked) lut[adc] = 0;
369  else {
370  double nonlinearityCorrection = 1.0;
371  double containmentCorrection2TSCorrected = 1.0;
372  // SiPM nonlinearity was not corrected in 2017
373  // and containment corrections were not
374  // ET-dependent prior to 2018
375  if(is2018OrLater) {
376  double containmentCorrection1TS = pulseCorr_->correction(cell, 1, correctionPhaseNS, adc2fC(adc));
377  // Use the 1-TS containment correction to estimate the charge of the pulse
378  // from the individual samples
379  double correctedCharge = containmentCorrection1TS*adc2fC(adc);
380  containmentCorrection2TSCorrected = pulseCorr_->correction(cell, 2, correctionPhaseNS, correctedCharge);
381  if(qieType==QIE11) {
382  const HcalSiPMParameter& siPMParameter(*conditions.getHcalSiPMParameter(cell));
383  HcalSiPMnonlinearity corr(conditions.getHcalSiPMCharacteristics()->getNonLinearities(siPMParameter.getType()));
384  const double fcByPE = siPMParameter.getFCByPE();
385  const double effectivePixelsFired = correctedCharge/fcByPE;
386  nonlinearityCorrection = corr.getRecoCorrectionFactor(effectivePixelsFired);
387  }
388  }
389  if (allLinear_)
390  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);
391  else
392  lut[adc] = (LutElement) std::min(std::max(0, int((adc2fC(adc) - ped) * gain * rcalib * nonlinearityCorrection * containmentCorrection2TSCorrected / nominalgain_ / granularity)), MASK);
393 
394  if(qieType==QIE11){
395  if (adc >= mipMin and adc < mipMax) lut[adc] |= QIE11_LUT_MSB0;
396  else if (adc >= mipMax) lut[adc] |= QIE11_LUT_MSB1;
397  }
398  }
399  }
400  }
401  else if (subdet == HcalForward){
402  for (unsigned int adc = 0; adc < SIZE; ++adc) {
403  if (isMasked) lut[adc] = 0;
404  else {
405  lut[adc] = std::min(std::max(0,int((adc2fC(adc) - ped) * gain * rcalib / lsb_ / cosh_ieta_[cell.ietaAbs()])), MASK);
407  }
408  }
409  }
410  }
411 }
int adc(sample_type sample)
get the ADC sample (12 bits)
uint32_t getFlag() const
float getPedestal() const
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:167
int getValue() const
Definition: HcalQIEType.h:20
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
const HcalTopology * topo_
int lastHBRing() const
Definition: HcalTopology.h:88
static const int QIE11_LUT_MSB0
static const float lsb_
const Item * getValues(DetId fId, bool throwOnFail=true) const
static const int QIE8_LUT_BITMASK
uint8_t getLutGranularity() const
HcalTopologyMode::TriggerMode triggerMode() const
Definition: HcalTopology.h:32
unsigned short LutElement
static const int QIE10_LUT_MSB
double effpedestal(int fCapId) const
get effective pedestal for capid=0..3
static const size_t UPGRADE_LUT_SIZE
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
float getRespGain() const
std::vector< DetId > getAllChannels() 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
HcalSubdetector
Definition: HcalAssistant.h:31
const HcalLutMetadata * getHcalLutMetadata() const
unsigned int FG_HF_threshold_
T min(T a, T b)
Definition: MathUtil.h:58
float correctionPhaseNS() const
Definition: HcalRecoParam.h:31
JetCorrectorParameters corr
Definition: classes.h:5
static const int QIE10_LUT_BITMASK
std::vector< double > cosh_ieta_
const HcalQIEType * getHcalQIEType(const HcalGenericDetId &fId) const
double const adc2fC[256]
Definition: Constants.h:272
double LUTrespcorrgain(int fCapId) const
get LUT corrected and response corrected gain for capid=0..3
std::vector< float > ped_
double cosh_ieta(int ieta, int depth, HcalSubdetector subdet)
std::vector< float > gain_
const HcalSiPMCharacteristics * getHcalSiPMCharacteristics() const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
static const int QIE11_LUT_BITMASK_2017
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
static const size_t INPUT_LUT_SIZE
const edm::ESHandle< HcalTimeSlew > & delay_
uint32_t getFGBitInfo() const
get FG bit information
bool isPlan1(const HcalDetId &id) const
void make_cosh_ieta_map(void)
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
Definition: Lut.h:32
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
void HcaluLUTTPGCoder::update ( const char *  filename,
bool  appendMSB = false 
)

Definition at line 101 of file HcaluLUTTPGCoder.cc.

References ecalMGPA::adc(), edmScanValgrind::buffer, egammaForCoreTracking_cff::depth, FrontierConditions_GlobalTag_cff::file, getLUTId(), HcalBarrel, HcalEndcap, HcalForward, mps_fire::i, triggerObjects_cff::id, recoMuon::in, INPUT_LUT_SIZE, inputLUT_, QIE8_LUT_BITMASK, QIE8_LUT_MSB, findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, topo_, and HcalTopology::valid().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

101  {
102 
103  std::ifstream file(filename, std::ios::in);
104  assert(file.is_open());
105 
106  std::vector<HcalSubdetector> subdet;
108 
109  // Drop first (comment) line
110  std::getline(file, buffer);
111  std::getline(file, buffer);
112 
113  unsigned int index = buffer.find("H", 0);
114  while (index < buffer.length()){
115  std::string subdetStr = buffer.substr(index, 2);
116  if (subdetStr == "HB") subdet.push_back(HcalBarrel);
117  else if (subdetStr == "HE") subdet.push_back(HcalEndcap);
118  else if (subdetStr == "HF") subdet.push_back(HcalForward);
119  //TODO Check subdet
120  //else exception
121  index += 2;
122  index = buffer.find("H", index);
123  }
124 
125  // Get upper/lower ranges for ieta/iphi/depth
126  size_t nCol = subdet.size();
127  assert(nCol > 0);
128 
129  std::vector<int> ietaU;
130  std::vector<int> ietaL;
131  std::vector<int> iphiU;
132  std::vector<int> iphiL;
133  std::vector<int> depU;
134  std::vector<int> depL;
135  std::vector< Lut > lutFromFile(nCol);
136  LutElement lutValue;
137 
138  for (size_t i=0; i<nCol; ++i) {
139  int ieta;
140  file >> ieta;
141  ietaL.push_back(ieta);
142  }
143 
144  for (size_t i=0; i<nCol; ++i) {
145  int ieta;
146  file >> ieta;
147  ietaU.push_back(ieta);
148  }
149 
150  for (size_t i=0; i<nCol; ++i) {
151  int iphi;
152  file >> iphi;
153  iphiL.push_back(iphi);
154  }
155 
156  for (size_t i=0; i<nCol; ++i) {
157  int iphi;
158  file >> iphi;
159  iphiU.push_back(iphi);
160  }
161 
162  for (size_t i=0; i<nCol; ++i) {
163  int dep;
164  file >> dep;
165  depL.push_back(dep);
166  }
167 
168  for (size_t i=0; i<nCol; ++i) {
169  int dep;
170  file >> dep;
171  depU.push_back(dep);
172  }
173 
174  // Read Lut Entry
175  for (size_t i=0; file >> lutValue; i = (i+1) % nCol){
176  lutFromFile[i].push_back(lutValue);
177  }
178 
179  // Check lut size
180  for (size_t i=0; i<nCol; ++i) assert(lutFromFile[i].size() == INPUT_LUT_SIZE);
181 
182  for (size_t i=0; i<nCol; ++i){
183  for (int ieta = ietaL[i]; ieta <= ietaU[i]; ++ieta){
184  for (int iphi = iphiL[i]; iphi <= iphiU[i]; ++iphi){
185  for (int depth = depL[i]; depth <= depU[i]; ++depth){
186 
187  HcalDetId id(subdet[i], ieta, iphi, depth);
188  if (!topo_->valid(id)) continue;
189 
190  int lutId = getLUTId(id);
191  for (size_t adc = 0; adc < INPUT_LUT_SIZE; ++adc){
192  if (appendMSB){
193  // Append FG bit LUT to MSB
194  // MSB = Most Significant Bit = bit 10
195  // Overwrite bit 10
196  LutElement msb = (lutFromFile[i][adc] != 0 ? QIE8_LUT_MSB : 0);
197  inputLUT_[lutId][adc] = (msb | (inputLUT_[lutId][adc] & QIE8_LUT_BITMASK));
198  }
199  else inputLUT_[lutId][adc] = lutFromFile[i][adc];
200  }// for adc
201  }// for depth
202  }// for iphi
203  }// for ieta
204  }// for nCol
205 }
int adc(sample_type sample)
get the ADC sample (12 bits)
size
Write out results.
bool valid(const DetId &id) const override
const HcalTopology * topo_
static const int QIE8_LUT_BITMASK
unsigned short LutElement
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
static const int QIE8_LUT_MSB
static const size_t INPUT_LUT_SIZE
std::vector< Lut > inputLUT_
void HcaluLUTTPGCoder::updateXML ( const char *  filename)

Definition at line 207 of file HcaluLUTTPGCoder.cc.

References LutXml::create_lut_map(), egammaForCoreTracking_cff::depth, Exception, XMLProcessor::getInstance(), LutXml::getLutFast(), getLUTId(), HcalBarrel, HcalEndcap, HcalForward, mps_fire::i, INPUT_LUT_SIZE, inputLUT_, HcalDetId::kHcalDepthMask2, HcalDetId::kHcalEtaMask2, HcalDetId::kHcalPhiMask2, lumiPlot::lut, XMLProcessor::terminate(), topo_, and HcalTopology::valid().

Referenced by HcalTPGCoderULUT::buildCoder().

207  {
208  LutXml * _xml = new LutXml(filename);
209  _xml->create_lut_map();
211  for (int ieta = -HcalDetId::kHcalEtaMask2;
212  ieta <= HcalDetId::kHcalEtaMask2; ++ieta) {
213  for (int iphi = 0; iphi <= HcalDetId::kHcalPhiMask2; ++iphi) {
214  for (int depth = 1; depth < HcalDetId::kHcalDepthMask2; ++depth) {
215  for (int isub=0; isub<3; ++isub) {
216  HcalDetId detid(subdet[isub], ieta, iphi, depth);
217  if (!topo_->valid(detid)) continue;
218  int id = getLUTId(subdet[isub], ieta, iphi, depth);
219  std::vector<unsigned int>* lut = _xml->getLutFast(detid);
220  if (lut==nullptr) throw cms::Exception("PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
221  if (lut->size()!=INPUT_LUT_SIZE) throw cms::Exception ("PROBLEM: Wrong inputLUT_ size in xml file for ") << detid << std::endl;
222  for (unsigned int i=0; i<INPUT_LUT_SIZE; ++i) inputLUT_[id][i] = (LutElement)lut->at(i);
223  }
224  }
225  }
226  }
227  delete _xml;
229 }
Definition: LutXml.h:27
bool valid(const DetId &id) const override
int create_lut_map(void)
Definition: LutXml.cc:375
const HcalTopology * topo_
unsigned short LutElement
static const int kHcalDepthMask2
Definition: HcalDetId.h:26
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
int terminate(void)
HcalSubdetector
Definition: HcalAssistant.h:31
static const int kHcalPhiMask2
Definition: HcalDetId.h:16
std::vector< unsigned int > * getLutFast(uint32_t det_id)
Definition: LutXml.cc:88
static const size_t INPUT_LUT_SIZE
static const int kHcalEtaMask2
Definition: HcalDetId.h:20
static XMLProcessor * getInstance()
Definition: XMLProcessor.h:145
std::vector< Lut > inputLUT_

Member Data Documentation

bool HcaluLUTTPGCoder::allLinear_
private

Definition at line 101 of file HcaluLUTTPGCoder.h.

Referenced by cosh_ieta(), setAllLinear(), and update().

int HcaluLUTTPGCoder::bitToMask_
private

Definition at line 91 of file HcaluLUTTPGCoder.h.

Referenced by setMaskBit(), and update().

std::vector<double> HcaluLUTTPGCoder::cosh_ieta_
private

Definition at line 98 of file HcaluLUTTPGCoder.h.

Referenced by cosh_ieta(), make_cosh_ieta_map(), and update().

double HcaluLUTTPGCoder::cosh_ieta_28_HE_high_depths_
private

Definition at line 100 of file HcaluLUTTPGCoder.h.

Referenced by cosh_ieta(), and make_cosh_ieta_map().

double HcaluLUTTPGCoder::cosh_ieta_28_HE_low_depths_
private

Definition at line 100 of file HcaluLUTTPGCoder.h.

Referenced by cosh_ieta(), and make_cosh_ieta_map().

double HcaluLUTTPGCoder::cosh_ieta_29_HE_
private

Definition at line 100 of file HcaluLUTTPGCoder.h.

Referenced by cosh_ieta(), and make_cosh_ieta_map().

const edm::ESHandle<HcalTimeSlew>& HcaluLUTTPGCoder::delay_
private

Definition at line 88 of file HcaluLUTTPGCoder.h.

Referenced by update().

unsigned int HcaluLUTTPGCoder::FG_HF_threshold_
private

Definition at line 90 of file HcaluLUTTPGCoder.h.

Referenced by setFGHFthreshold(), and update().

int HcaluLUTTPGCoder::firstHBEta_
private

Definition at line 92 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::firstHEEta_
private

Definition at line 93 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::firstHFEta_
private

Definition at line 94 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), HcaluLUTTPGCoder(), and make_cosh_ieta_map().

std::vector<float> HcaluLUTTPGCoder::gain_
private

Definition at line 96 of file HcaluLUTTPGCoder.h.

Referenced by getLUTGain(), HcaluLUTTPGCoder(), and update().

const size_t HcaluLUTTPGCoder::INPUT_LUT_SIZE = 128
staticprivate

Definition at line 77 of file HcaluLUTTPGCoder.h.

Referenced by update(), and updateXML().

std::vector< Lut > HcaluLUTTPGCoder::inputLUT_
private
int HcaluLUTTPGCoder::lastHBEta_
private

Definition at line 92 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::lastHEEta_
private

Definition at line 93 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::lastHFEta_
private

Definition at line 94 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), HcaluLUTTPGCoder(), and make_cosh_ieta_map().

double HcaluLUTTPGCoder::linearLSB_QIE11_
private

Definition at line 102 of file HcaluLUTTPGCoder.h.

Referenced by setAllLinear(), and update().

double HcaluLUTTPGCoder::linearLSB_QIE11Overlap_
private

Definition at line 102 of file HcaluLUTTPGCoder.h.

Referenced by setAllLinear(), and update().

double HcaluLUTTPGCoder::linearLSB_QIE8_
private

Definition at line 102 of file HcaluLUTTPGCoder.h.

Referenced by setAllLinear(), and update().

const float HcaluLUTTPGCoder::lsb_ =1./16
static

Definition at line 34 of file HcaluLUTTPGCoder.h.

Referenced by CaloTPGTranscoderULUT::setup(), and update().

bool HcaluLUTTPGCoder::LUTGenerationMode_
private

Definition at line 89 of file HcaluLUTTPGCoder.h.

Referenced by setLUTGenerationMode(), and update().

int HcaluLUTTPGCoder::maxDepthHB_
private

Definition at line 92 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::maxDepthHE_
private

Definition at line 93 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::maxDepthHF_
private

Definition at line 94 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

const int HcaluLUTTPGCoder::nFi_ = 72
staticprivate

Definition at line 79 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::nHBEta_
private

Definition at line 92 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::nHEEta_
private

Definition at line 93 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::nHFEta_
private

Definition at line 94 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

std::vector<float> HcaluLUTTPGCoder::ped_
private

Definition at line 97 of file HcaluLUTTPGCoder.h.

Referenced by getLUTPedestal(), HcaluLUTTPGCoder(), and update().

std::unique_ptr<HcalPulseContainmentManager> HcaluLUTTPGCoder::pulseCorr_
private

Definition at line 103 of file HcaluLUTTPGCoder.h.

Referenced by update().

const int HcaluLUTTPGCoder::QIE10_LUT_BITMASK = 0x7FF
static

Definition at line 66 of file HcaluLUTTPGCoder.h.

Referenced by adc2Linear(), and update().

const int HcaluLUTTPGCoder::QIE10_LUT_MSB = 0x1000
staticprivate

Definition at line 84 of file HcaluLUTTPGCoder.h.

Referenced by lookupMSB(), and update().

const int HcaluLUTTPGCoder::QIE11_LUT_BITMASK = 0x7FF
static

Definition at line 67 of file HcaluLUTTPGCoder.h.

Referenced by adc2Linear(), and update().

const int HcaluLUTTPGCoder::QIE11_LUT_BITMASK_2017 = 0x3FF
static

Definition at line 69 of file HcaluLUTTPGCoder.h.

Referenced by update().

const int HcaluLUTTPGCoder::QIE11_LUT_MSB0 = 0x800
staticprivate

Definition at line 82 of file HcaluLUTTPGCoder.h.

Referenced by lookupMSB(), and update().

const int HcaluLUTTPGCoder::QIE11_LUT_MSB1 = 0x1000
staticprivate

Definition at line 83 of file HcaluLUTTPGCoder.h.

Referenced by lookupMSB(), and update().

const int HcaluLUTTPGCoder::QIE8_LUT_BITMASK = 0x3FF
static

Definition at line 65 of file HcaluLUTTPGCoder.h.

Referenced by adc2Linear(), and update().

const int HcaluLUTTPGCoder::QIE8_LUT_MSB = 0x400
staticprivate

Definition at line 81 of file HcaluLUTTPGCoder.h.

Referenced by getMSB(), and update().

int HcaluLUTTPGCoder::sizeHB_
private

Definition at line 92 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::sizeHE_
private

Definition at line 93 of file HcaluLUTTPGCoder.h.

Referenced by getLUTId(), and HcaluLUTTPGCoder().

int HcaluLUTTPGCoder::sizeHF_
private

Definition at line 94 of file HcaluLUTTPGCoder.h.

Referenced by HcaluLUTTPGCoder().

const HcalTopology* HcaluLUTTPGCoder::topo_
private

Definition at line 87 of file HcaluLUTTPGCoder.h.

Referenced by HcaluLUTTPGCoder(), make_cosh_ieta_map(), update(), and updateXML().

const size_t HcaluLUTTPGCoder::UPGRADE_LUT_SIZE = 256
staticprivate

Definition at line 78 of file HcaluLUTTPGCoder.h.

Referenced by update().