CMS 3D CMS Logo

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

#include <CaloTPGTranscoderULUT.h>

Inheritance diagram for CaloTPGTranscoderULUT:
CaloTPGTranscoder

Public Member Functions

 CaloTPGTranscoderULUT (const std::string &compressionFile="", const std::string &decompressionFile="")
 
EcalTriggerPrimitiveSample ecalCompress (const EcalTrigTowerDetId &id, unsigned int sample, bool fineGrain) const override
 Compression from linear samples+fine grain in the ECAL. More...
 
virtual const std::vector< unsigned int > getCompressionLUT (const HcalTrigTowerDetId &id) const
 
virtual int getOutputLUTId (const HcalTrigTowerDetId &id) const
 
virtual int getOutputLUTId (const int ieta, const int iphi, const int version) const
 
HcalTriggerPrimitiveSample hcalCompress (const HcalTrigTowerDetId &id, unsigned int sample, int fineGrain) const override
 Compression from linear samples+fine grain in the HTR. More...
 
double hcaletValue (const HcalTrigTowerDetId &hid, const HcalTriggerPrimitiveSample &hc) const override
 
double hcaletValue (const int &ieta, const int &iphi, const int &version, const int &compressedValue) const override
 
virtual bool HTvalid (const int ieta, const int iphi, const int version) const
 
void rctEGammaUncompress (const HcalTrigTowerDetId &hid, const HcalTriggerPrimitiveSample &hc, const EcalTrigTowerDetId &eid, const EcalTriggerPrimitiveSample &ec, unsigned int &et, bool &egVecto, bool &activity) const override
 Uncompression for the Electron/Photon path in the RCT. More...
 
void rctJetUncompress (const HcalTrigTowerDetId &hid, const HcalTriggerPrimitiveSample &hc, const EcalTrigTowerDetId &eid, const EcalTriggerPrimitiveSample &ec, unsigned int &et) const override
 Uncompression for the JET path in the RCT. More...
 
virtual void setup (HcalLutMetadata const &, HcalTrigTowerGeometry const &, int nctScaleShift, int rctScaleShift, double lsbQIE8, double lsbQIE11, bool allLinear)
 
 ~CaloTPGTranscoderULUT () override
 
- Public Member Functions inherited from CaloTPGTranscoder
 CaloTPGTranscoder ()
 
std::shared_ptr< const EcalTPGCompressorgetEcalCompressor () const
 
std::shared_ptr< const HcalTPGCompressorgetHcalCompressor () const
 
virtual ~CaloTPGTranscoder ()
 

Private Types

typedef uint8_t LUT
 
typedef std::array< float, TPGMAXRCTdecompression
 

Private Member Functions

unsigned int getOutputLUTSize (const HcalTrigTowerDetId &id) const
 
bool isOnlyQIE11 (const HcalTrigTowerDetId &id) const
 
void loadHCALCompress (HcalLutMetadata const &, HcalTrigTowerGeometry const &)
 

Private Attributes

bool allLinear_ = false
 
const std::string compressionFile_
 
const std::string decompressionFile_
 
std::vector< RCTdecompressionhcaluncomp_
 
std::vector< int > ietah
 
std::vector< int > ietal
 
double lin11_factor_
 
double lin8_factor_
 
double lsb_factor_
 
std::vector< int > LUTfactor
 
double nct_factor_
 
double nominal_gain_
 
std::vector< std::vector< LUT > > outputLUT_
 
std::set< HcalDetIdplan1_towers_
 
double rct_factor_
 
const HcalTopologytheTopology
 
std::vector< int > ZS
 

Static Private Attributes

static const bool newHFphi = true
 
static const int NOUTLUTS = 4176
 
static const unsigned int OUTPUT_LUT_SIZE
 
static const unsigned int QIE10_OUTPUT_LUT_SIZE = REDUCE11BIT
 
static const unsigned int QIE11_OUTPUT_LUT_SIZE = REDUCE11BIT
 
static const unsigned int QIE8_OUTPUT_LUT_SIZE = REDUCE10BIT
 
static const unsigned int REDUCE10BIT = 1024
 
static const unsigned int REDUCE11BIT = 2048
 
static const unsigned int TPGMAX = 256
 

Additional Inherited Members

- Public Types inherited from CaloTPGTranscoder
enum  Mode { All = 0, RCT = 1, HcalTPG = 2, EcalTPG = 3 }
 

Detailed Description

Author
J. Mans - Minnesota

Definition at line 18 of file CaloTPGTranscoderULUT.h.

Member Typedef Documentation

◆ LUT

typedef uint8_t CaloTPGTranscoderULUT::LUT
private

Definition at line 72 of file CaloTPGTranscoderULUT.h.

◆ RCTdecompression

typedef std::array<float, TPGMAX> CaloTPGTranscoderULUT::RCTdecompression
private

Definition at line 73 of file CaloTPGTranscoderULUT.h.

Constructor & Destructor Documentation

◆ CaloTPGTranscoderULUT()

CaloTPGTranscoderULUT::CaloTPGTranscoderULUT ( const std::string &  compressionFile = "",
const std::string &  decompressionFile = "" 
)

Definition at line 19 of file CaloTPGTranscoderULUT.cc.

20  : theTopology(nullptr),
21  nominal_gain_(0.),
22  lsb_factor_(0.),
23  rct_factor_(1.),
24  nct_factor_(1.),
25  lin8_factor_(1.),
26  lin11_factor_(1.),
27  compressionFile_(compressionFile),
28  decompressionFile_(decompressionFile) {}

◆ ~CaloTPGTranscoderULUT()

CaloTPGTranscoderULUT::~CaloTPGTranscoderULUT ( )
override

Definition at line 30 of file CaloTPGTranscoderULUT.cc.

30 {}

Member Function Documentation

◆ ecalCompress()

EcalTriggerPrimitiveSample CaloTPGTranscoderULUT::ecalCompress ( const EcalTrigTowerDetId id,
unsigned int  sample,
bool  fineGrain 
) const
overridevirtual

Compression from linear samples+fine grain in the ECAL.

Implements CaloTPGTranscoder.

Definition at line 175 of file CaloTPGTranscoderULUT.cc.

177  {
178  throw cms::Exception("Not Implemented") << "CaloTPGTranscoderULUT::ecalCompress";
179 }

References Exception.

◆ getCompressionLUT()

const std::vector< unsigned int > CaloTPGTranscoderULUT::getCompressionLUT ( const HcalTrigTowerDetId id) const
virtual

Definition at line 282 of file CaloTPGTranscoderULUT.cc.

282  {
283  int itower = getOutputLUTId(id);
284  auto lut = outputLUT_[itower];
285  std::vector<unsigned int> result(lut.begin(), lut.end());
286  return result;
287 }

References getOutputLUTId(), outputLUT_, and mps_fire::result.

Referenced by HcalLutManager::getCompressionLutXmlFromCoder().

◆ getOutputLUTId() [1/2]

int CaloTPGTranscoderULUT::getOutputLUTId ( const HcalTrigTowerDetId id) const
virtual

Definition at line 207 of file CaloTPGTranscoderULUT.cc.

207  {
208  if (!theTopology) {
209  throw cms::Exception("CaloTPGTranscoderULUT") << "Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
210  }
211  return theTopology->detId2denseIdHT(id);
212 }

References HcalTopology::detId2denseIdHT(), Exception, and theTopology.

Referenced by getCompressionLUT(), hcalCompress(), hcaletValue(), loadHCALCompress(), and L1CaloHcalScaleConfigOnlineProd::newObject().

◆ getOutputLUTId() [2/2]

int CaloTPGTranscoderULUT::getOutputLUTId ( const int  ieta,
const int  iphi,
const int  version 
) const
virtual

Definition at line 214 of file CaloTPGTranscoderULUT.cc.

214  {
215  if (!theTopology) {
216  throw cms::Exception("CaloTPGTranscoderULUT") << "Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
217  }
218  HcalTrigTowerDetId id(ieta, iphiin);
219  id.setVersion(version);
220  return theTopology->detId2denseIdHT(id);
221 }

References HcalTopology::detId2denseIdHT(), Exception, triggerObjects_cff::id, LEDCalibrationChannels::ieta, theTopology, and BeamSplash_cfg::version.

◆ getOutputLUTSize()

unsigned int CaloTPGTranscoderULUT::getOutputLUTSize ( const HcalTrigTowerDetId id) const
private

Definition at line 223 of file CaloTPGTranscoderULUT.cc.

223  {
224  if (!theTopology)
225  throw cms::Exception("CaloTPGTranscoderULUT") << "Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
226 
227  switch (theTopology->triggerMode()) {
230  return QIE8_OUTPUT_LUT_SIZE;
232  if (id.ietaAbs() <= theTopology->lastHERing())
233  return QIE8_OUTPUT_LUT_SIZE;
234  else
235  return QIE10_OUTPUT_LUT_SIZE;
237  if (plan1_towers_.find(id) != plan1_towers_.end())
238  return QIE11_OUTPUT_LUT_SIZE;
239  else if (id.ietaAbs() <= theTopology->lastHERing())
240  return QIE8_OUTPUT_LUT_SIZE;
241  else
242  return QIE10_OUTPUT_LUT_SIZE;
245  if (id.ietaAbs() <= theTopology->lastHBRing())
246  return QIE8_OUTPUT_LUT_SIZE;
247  else if (id.ietaAbs() <= theTopology->lastHERing())
248  return QIE11_OUTPUT_LUT_SIZE;
249  else
250  return QIE10_OUTPUT_LUT_SIZE;
252  if (id.ietaAbs() <= theTopology->lastHBHERing())
253  return QIE11_OUTPUT_LUT_SIZE;
254  else
255  return QIE10_OUTPUT_LUT_SIZE;
256  default:
257  throw cms::Exception("CaloTPGTranscoderULUT") << "Unknown trigger mode used by the topology!";
258  }
259 }

References Exception, HcalTopology::lastHBHERing(), HcalTopology::lastHBRing(), HcalTopology::lastHERing(), plan1_towers_, QIE10_OUTPUT_LUT_SIZE, QIE11_OUTPUT_LUT_SIZE, QIE8_OUTPUT_LUT_SIZE, theTopology, HcalTopology::triggerMode(), HcalTopologyMode::TriggerMode_2009, HcalTopologyMode::TriggerMode_2016, HcalTopologyMode::TriggerMode_2017, HcalTopologyMode::TriggerMode_2017plan1, HcalTopologyMode::TriggerMode_2018, HcalTopologyMode::TriggerMode_2018legacy, and HcalTopologyMode::TriggerMode_2021.

Referenced by hcalCompress(), and loadHCALCompress().

◆ hcalCompress()

HcalTriggerPrimitiveSample CaloTPGTranscoderULUT::hcalCompress ( const HcalTrigTowerDetId id,
unsigned int  sample,
int  fineGrain 
) const
overridevirtual

Compression from linear samples+fine grain in the HTR.

Implements CaloTPGTranscoder.

Definition at line 136 of file CaloTPGTranscoderULUT.cc.

138  {
139  unsigned int itower = getOutputLUTId(id);
140 
141  if (sample >= getOutputLUTSize(id))
142  throw cms::Exception("Out of Range") << "LUT has " << getOutputLUTSize(id) << " entries for " << id << " but "
143  << sample << " was requested.";
144 
145  if (itower >= outputLUT_.size())
146  throw cms::Exception("Out of Range") << "No decompression LUT found for " << id;
147 
148  return HcalTriggerPrimitiveSample(outputLUT_[itower][sample], fineGrain);
149 }

References Exception, getOutputLUTId(), getOutputLUTSize(), triggerObjects_cff::id, outputLUT_, and simplePhotonAnalyzer_cfi::sample.

◆ hcaletValue() [1/2]

double CaloTPGTranscoderULUT::hcaletValue ( const HcalTrigTowerDetId hid,
const HcalTriggerPrimitiveSample hc 
) const
overridevirtual

Implements CaloTPGTranscoder.

Definition at line 168 of file CaloTPGTranscoderULUT.cc.

168  {
169  int compET = hc.compressedEt(); // to be within the range by the class
170  int itower = getOutputLUTId(hid);
171  double etvalue = hcaluncomp_[itower][compET];
172  return etvalue;
173 }

References HcalTriggerPrimitiveSample::compressedEt(), getOutputLUTId(), and hcaluncomp_.

◆ hcaletValue() [2/2]

double CaloTPGTranscoderULUT::hcaletValue ( const int &  ieta,
const int &  iphi,
const int &  version,
const int &  compressedValue 
) const
overridevirtual

Implements CaloTPGTranscoder.

Definition at line 151 of file CaloTPGTranscoderULUT.cc.

154  {
155  double etvalue = 0.;
156  int itower = getOutputLUTId(ieta, iphi, version);
157  if (itower < 0) {
158  edm::LogError("CaloTPGTranscoderULUT") << "No decompression LUT found for ieta, iphi = " << ieta << ", " << iphi;
159  } else if (compET < 0 || compET >= (int)TPGMAX) {
160  edm::LogError("CaloTPGTranscoderULUT")
161  << "Compressed value out of range: eta, phi, cET = " << ieta << ", " << iphi << ", " << compET;
162  } else {
163  etvalue = hcaluncomp_[itower][compET];
164  }
165  return (etvalue);
166 }

References getOutputLUTId(), hcaluncomp_, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, TPGMAX, and BeamSplash_cfg::version.

◆ HTvalid()

bool CaloTPGTranscoderULUT::HTvalid ( const int  ieta,
const int  iphi,
const int  version 
) const
virtual

Definition at line 198 of file CaloTPGTranscoderULUT.cc.

198  {
199  HcalTrigTowerDetId id(ieta, iphiin);
200  id.setVersion(version);
201  if (!theTopology) {
202  throw cms::Exception("CaloTPGTranscoderULUT") << "Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
203  }
204  return theTopology->validHT(id);
205 }

References Exception, triggerObjects_cff::id, LEDCalibrationChannels::ieta, theTopology, HcalTopology::validHT(), and BeamSplash_cfg::version.

Referenced by HcalLutManager::getCompressionLutXmlFromAsciiMaster(), HcalLutManager::getCompressionLutXmlFromCoder(), and L1CaloHcalScaleConfigOnlineProd::newObject().

◆ isOnlyQIE11()

bool CaloTPGTranscoderULUT::isOnlyQIE11 ( const HcalTrigTowerDetId id) const
private

Definition at line 261 of file CaloTPGTranscoderULUT.cc.

261  {
262  if (!theTopology)
263  throw cms::Exception("CaloTPGTranscoderULUT") << "Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
264 
265  switch (theTopology->triggerMode()) {
267  if (plan1_towers_.find(id) != plan1_towers_.end() and id.ietaAbs() != theTopology->lastHBRing())
268  return true;
269  return false;
272  if (id.ietaAbs() <= theTopology->lastHBRing())
273  return false;
274  return true;
276  return true;
277  default:
278  throw cms::Exception("CaloTPGTranscoderULUT") << "Unknown trigger mode used by the topology!";
279  }
280 }

References Exception, HcalTopology::lastHBRing(), plan1_towers_, theTopology, HcalTopology::triggerMode(), HcalTopologyMode::TriggerMode_2017plan1, HcalTopologyMode::TriggerMode_2018, HcalTopologyMode::TriggerMode_2018legacy, and HcalTopologyMode::TriggerMode_2021.

Referenced by loadHCALCompress().

◆ loadHCALCompress()

void CaloTPGTranscoderULUT::loadHCALCompress ( HcalLutMetadata const &  lutMetadata,
HcalTrigTowerGeometry const &  theTrigTowerGeometry 
)
private

Definition at line 32 of file CaloTPGTranscoderULUT.cc.

33  {
34  if (!theTopology) {
35  throw cms::Exception("CaloTPGTranscoderULUT") << "Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
36  }
37 
38  std::array<unsigned int, OUTPUT_LUT_SIZE> analyticalLUT;
39  std::array<unsigned int, OUTPUT_LUT_SIZE> linearQIE8LUT;
40  std::array<unsigned int, OUTPUT_LUT_SIZE> linearQIE11LUT;
41  std::array<unsigned int, OUTPUT_LUT_SIZE> linearRctLUT;
42  std::array<unsigned int, OUTPUT_LUT_SIZE> linearNctLUT;
43 
44  // Compute compression LUT
45  for (unsigned int i = 0; i < OUTPUT_LUT_SIZE; i++) {
46  analyticalLUT[i] = min(static_cast<unsigned int>(sqrt(14.94 * log(1. + i / 14.94) * i) + 0.5), TPGMAX - 1);
47  linearQIE8LUT[i] = min(static_cast<unsigned int>((i + .5) / lin8_factor_), TPGMAX - 1);
48  linearQIE11LUT[i] = min(static_cast<unsigned int>((i + .5) / lin11_factor_), TPGMAX - 1);
49  linearRctLUT[i] = min(static_cast<unsigned int>((i + .5) / rct_factor_), TPGMAX - 1);
50  linearNctLUT[i] = min(static_cast<unsigned int>((i + .5) / nct_factor_), TPGMAX - 1);
51  }
52 
53  std::vector<DetId> allChannels = lutMetadata.getAllChannels();
54 
55  for (std::vector<DetId>::iterator i = allChannels.begin(); i != allChannels.end(); ++i) {
56  if (not HcalGenericDetId(*i).isHcalTrigTowerDetId()) {
57  if ((not HcalGenericDetId(*i).isHcalDetId()) and (not HcalGenericDetId(*i).isHcalZDCDetId()) and
59  edm::LogWarning("CaloTPGTranscoderULUT") << "Encountered invalid HcalDetId " << HcalGenericDetId(*i);
60  continue;
61  }
62 
64  if (!theTopology->validHT(id))
65  continue;
66 
67  unsigned int index = getOutputLUTId(id);
68 
69  const HcalLutMetadatum* meta = lutMetadata.getValues(id);
70  unsigned int threshold = meta->getOutputLutThreshold();
71 
72  int ieta = id.ieta();
73  int version = id.version();
74  bool isHBHE = (abs(ieta) < theTrigTowerGeometry.firstHFTower(version));
75 
76  unsigned int lutsize = getOutputLUTSize(id);
77  outputLUT_[index].resize(lutsize);
78 
79  for (unsigned int i = 0; i < threshold; ++i)
80  outputLUT_[index][i] = 0;
81 
82  if (isHBHE) {
83  for (unsigned int i = threshold; i < lutsize; ++i)
84  if (allLinear_) {
85  outputLUT_[index][i] = isOnlyQIE11(id) ? linearQIE11LUT[i] : linearQIE8LUT[i];
86  } else {
87  outputLUT_[index][i] = analyticalLUT[i];
88  }
89  } else {
90  for (unsigned int i = threshold; i < lutsize; ++i)
91  outputLUT_[index][i] = version == 1 ? linearNctLUT[i] : linearRctLUT[i];
92  }
93 
94  double eta_low = 0., eta_high = 0.;
95  theTrigTowerGeometry.towerEtaBounds(ieta, version, eta_low, eta_high);
96  double cosh_ieta = fabs(cosh((eta_low + eta_high) / 2.));
97  double granularity = meta->getLutGranularity();
98 
99  if (isHBHE) {
100  if (allLinear_) {
101  LUT tpg = outputLUT_[index][0];
102  hcaluncomp_[index][tpg] = 0;
103  for (unsigned int i = 0; i < lutsize; ++i) {
104  if (outputLUT_[index][i] != tpg) {
105  tpg = outputLUT_[index][i];
107  }
108  }
109  } else {
110  double factor = nominal_gain_ / cosh_ieta * granularity;
111  LUT tpg = outputLUT_[index][0];
112  int low = 0;
113  for (unsigned int i = 0; i < lutsize; ++i) {
114  if (outputLUT_[index][i] != tpg) {
115  unsigned int mid = (low + i) / 2;
116  hcaluncomp_[index][tpg] = (tpg == 0 ? low : factor * mid);
117  low = i;
118  tpg = outputLUT_[index][i];
119  }
120  }
121  hcaluncomp_[index][tpg] = factor * low;
122  }
123  } else {
124  LUT tpg = outputLUT_[index][0];
125  hcaluncomp_[index][tpg] = 0;
126  for (unsigned int i = 0; i < lutsize; ++i) {
127  if (outputLUT_[index][i] != tpg) {
128  tpg = outputLUT_[index][i];
130  }
131  }
132  }
133  }
134 }

References funct::abs(), allLinear_, Exception, DQMScaleToClient_cfi::factor, HcalTrigTowerGeometry::firstHFTower(), HcalCondObjectContainer< Item >::getAllChannels(), HcalLutMetadatum::getLutGranularity(), getOutputLUTId(), getOutputLUTSize(), HcalLutMetadatum::getOutputLutThreshold(), HcalCondObjectContainer< Item >::getValues(), hcaluncomp_, mps_fire::i, triggerObjects_cff::id, LEDCalibrationChannels::ieta, HcalGenericDetId::isHcalCastorDetId(), HcalGenericDetId::isHcalDetId(), HcalGenericDetId::isHcalTrigTowerDetId(), HcalGenericDetId::isHcalZDCDetId(), isOnlyQIE11(), lin11_factor_, lin8_factor_, dqm-mbProfile::log, LaserClient_cfi::low, lsb_factor_, min(), nct_factor_, nominal_gain_, OUTPUT_LUT_SIZE, outputLUT_, rct_factor_, mathSSE::sqrt(), theTopology, remoteMonitoring_LED_IterMethod_cfg::threshold, HcalTrigTowerGeometry::towerEtaBounds(), TPGMAX, HcalTopology::validHT(), and BeamSplash_cfg::version.

Referenced by setup().

◆ rctEGammaUncompress()

void CaloTPGTranscoderULUT::rctEGammaUncompress ( const HcalTrigTowerDetId hid,
const HcalTriggerPrimitiveSample hc,
const EcalTrigTowerDetId eid,
const EcalTriggerPrimitiveSample ec,
unsigned int &  et,
bool &  egVeto,
bool &  activity 
) const
overridevirtual

Uncompression for the Electron/Photon path in the RCT.

Implements CaloTPGTranscoder.

Definition at line 181 of file CaloTPGTranscoderULUT.cc.

187  {
188  throw cms::Exception("Not Implemented") << "CaloTPGTranscoderULUT::rctEGammaUncompress";
189 }

References Exception.

◆ rctJetUncompress()

void CaloTPGTranscoderULUT::rctJetUncompress ( const HcalTrigTowerDetId hid,
const HcalTriggerPrimitiveSample hc,
const EcalTrigTowerDetId eid,
const EcalTriggerPrimitiveSample ec,
unsigned int &  et 
) const
overridevirtual

Uncompression for the JET path in the RCT.

Implements CaloTPGTranscoder.

Definition at line 190 of file CaloTPGTranscoderULUT.cc.

194  {
195  throw cms::Exception("Not Implemented") << "CaloTPGTranscoderULUT::rctJetUncompress";
196 }

References Exception.

◆ setup()

void CaloTPGTranscoderULUT::setup ( HcalLutMetadata const &  lutMetadata,
HcalTrigTowerGeometry const &  theTrigTowerGeometry,
int  nctScaleShift,
int  rctScaleShift,
double  lsbQIE8,
double  lsbQIE11,
bool  allLinear 
)
virtual

Definition at line 289 of file CaloTPGTranscoderULUT.cc.

295  {
296  theTopology = lutMetadata.topo();
297  nominal_gain_ = lutMetadata.getNominalGain();
298  lsb_factor_ = lutMetadata.getRctLsb();
299 
300  allLinear_ = allLinear;
301 
302  rct_factor_ = lsb_factor_ / (HcaluLUTTPGCoder::lsb_ * (1 << rctScaleShift));
303  nct_factor_ = lsb_factor_ / (HcaluLUTTPGCoder::lsb_ * (1 << nctScaleShift));
304  lin8_factor_ = lsb_factor_ / lsbQIE8;
305  lin11_factor_ = lsb_factor_ / lsbQIE11;
306 
307  outputLUT_.resize(theTopology->getHTSize());
308  hcaluncomp_.resize(theTopology->getHTSize());
309 
310  plan1_towers_.clear();
311  for (const auto& id : lutMetadata.getAllChannels()) {
312  if (not(id.det() == DetId::Hcal and theTopology->valid(id)))
313  continue;
314  HcalDetId cell(id);
315  if (not theTopology->dddConstants()->isPlan1(cell))
316  continue;
317  for (const auto& tower : theTrigTowerGeometry.towerIds(cell))
318  plan1_towers_.emplace(tower);
319  }
320 
321  if (compressionFile_.empty() && decompressionFile_.empty()) {
322  loadHCALCompress(lutMetadata, theTrigTowerGeometry);
323  } else {
324  throw cms::Exception("Not Implemented") << "setup of CaloTPGTranscoderULUT from text files";
325  }
326 }

References allLinear_, compressionFile_, HcalTopology::dddConstants(), decompressionFile_, Exception, HcalCondObjectContainer< Item >::getAllChannels(), HcalTopology::getHTSize(), HcalLutMetadata::getNominalGain(), HcalLutMetadata::getRctLsb(), DetId::Hcal, hcaluncomp_, HcalDDDRecConstants::isPlan1(), lin11_factor_, lin8_factor_, loadHCALCompress(), HcaluLUTTPGCoder::lsb_, lsb_factor_, nct_factor_, nominal_gain_, outputLUT_, plan1_towers_, rct_factor_, theTopology, HcalCondObjectContainerBase::topo(), hgcalTowerProducer_cfi::tower, HcalTrigTowerGeometry::towerIds(), and HcalTopology::valid().

Referenced by o2olib.O2OTool::execute().

Member Data Documentation

◆ allLinear_

bool CaloTPGTranscoderULUT::allLinear_ = false
private

Definition at line 84 of file CaloTPGTranscoderULUT.h.

Referenced by loadHCALCompress(), and setup().

◆ compressionFile_

const std::string CaloTPGTranscoderULUT::compressionFile_
private

Definition at line 91 of file CaloTPGTranscoderULUT.h.

Referenced by setup().

◆ decompressionFile_

const std::string CaloTPGTranscoderULUT::decompressionFile_
private

Definition at line 92 of file CaloTPGTranscoderULUT.h.

Referenced by setup().

◆ hcaluncomp_

std::vector<RCTdecompression> CaloTPGTranscoderULUT::hcaluncomp_
private

Definition at line 99 of file CaloTPGTranscoderULUT.h.

Referenced by hcaletValue(), loadHCALCompress(), and setup().

◆ ietah

std::vector<int> CaloTPGTranscoderULUT::ietah
private

Definition at line 94 of file CaloTPGTranscoderULUT.h.

◆ ietal

std::vector<int> CaloTPGTranscoderULUT::ietal
private

Definition at line 93 of file CaloTPGTranscoderULUT.h.

◆ lin11_factor_

double CaloTPGTranscoderULUT::lin11_factor_
private

Definition at line 90 of file CaloTPGTranscoderULUT.h.

Referenced by loadHCALCompress(), and setup().

◆ lin8_factor_

double CaloTPGTranscoderULUT::lin8_factor_
private

Definition at line 89 of file CaloTPGTranscoderULUT.h.

Referenced by loadHCALCompress(), and setup().

◆ lsb_factor_

double CaloTPGTranscoderULUT::lsb_factor_
private

Definition at line 86 of file CaloTPGTranscoderULUT.h.

Referenced by loadHCALCompress(), and setup().

◆ LUTfactor

std::vector<int> CaloTPGTranscoderULUT::LUTfactor
private

Definition at line 96 of file CaloTPGTranscoderULUT.h.

◆ nct_factor_

double CaloTPGTranscoderULUT::nct_factor_
private

Definition at line 88 of file CaloTPGTranscoderULUT.h.

Referenced by loadHCALCompress(), and setup().

◆ newHFphi

const bool CaloTPGTranscoderULUT::newHFphi = true
staticprivate

Definition at line 76 of file CaloTPGTranscoderULUT.h.

◆ nominal_gain_

double CaloTPGTranscoderULUT::nominal_gain_
private

Definition at line 85 of file CaloTPGTranscoderULUT.h.

Referenced by loadHCALCompress(), and setup().

◆ NOUTLUTS

const int CaloTPGTranscoderULUT::NOUTLUTS = 4176
staticprivate

Definition at line 57 of file CaloTPGTranscoderULUT.h.

◆ OUTPUT_LUT_SIZE

const unsigned int CaloTPGTranscoderULUT::OUTPUT_LUT_SIZE
staticprivate

◆ outputLUT_

std::vector<std::vector<LUT> > CaloTPGTranscoderULUT::outputLUT_
private

Definition at line 98 of file CaloTPGTranscoderULUT.h.

Referenced by getCompressionLUT(), hcalCompress(), loadHCALCompress(), and setup().

◆ plan1_towers_

std::set<HcalDetId> CaloTPGTranscoderULUT::plan1_towers_
private

Definition at line 101 of file CaloTPGTranscoderULUT.h.

Referenced by getOutputLUTSize(), isOnlyQIE11(), and setup().

◆ QIE10_OUTPUT_LUT_SIZE

const unsigned int CaloTPGTranscoderULUT::QIE10_OUTPUT_LUT_SIZE = REDUCE11BIT
staticprivate

Definition at line 65 of file CaloTPGTranscoderULUT.h.

Referenced by getOutputLUTSize().

◆ QIE11_OUTPUT_LUT_SIZE

const unsigned int CaloTPGTranscoderULUT::QIE11_OUTPUT_LUT_SIZE = REDUCE11BIT
staticprivate

Definition at line 66 of file CaloTPGTranscoderULUT.h.

Referenced by getOutputLUTSize().

◆ QIE8_OUTPUT_LUT_SIZE

const unsigned int CaloTPGTranscoderULUT::QIE8_OUTPUT_LUT_SIZE = REDUCE10BIT
staticprivate

Definition at line 64 of file CaloTPGTranscoderULUT.h.

Referenced by getOutputLUTSize().

◆ rct_factor_

double CaloTPGTranscoderULUT::rct_factor_
private

Definition at line 87 of file CaloTPGTranscoderULUT.h.

Referenced by loadHCALCompress(), and setup().

◆ REDUCE10BIT

const unsigned int CaloTPGTranscoderULUT::REDUCE10BIT = 1024
staticprivate

Definition at line 60 of file CaloTPGTranscoderULUT.h.

◆ REDUCE11BIT

const unsigned int CaloTPGTranscoderULUT::REDUCE11BIT = 2048
staticprivate

Definition at line 61 of file CaloTPGTranscoderULUT.h.

◆ theTopology

const HcalTopology* CaloTPGTranscoderULUT::theTopology
private

◆ TPGMAX

const unsigned int CaloTPGTranscoderULUT::TPGMAX = 256
staticprivate

Definition at line 69 of file CaloTPGTranscoderULUT.h.

Referenced by hcaletValue(), and loadHCALCompress().

◆ ZS

std::vector<int> CaloTPGTranscoderULUT::ZS
private

Definition at line 95 of file CaloTPGTranscoderULUT.h.

HcalDDDRecConstants::isPlan1
bool isPlan1(const HcalDetId &id) const
Definition: HcalDDDRecConstants.h:110
HcalLutMetadatum
Definition: HcalLutMetadatum.h:12
CaloTPGTranscoderULUT::QIE10_OUTPUT_LUT_SIZE
static const unsigned int QIE10_OUTPUT_LUT_SIZE
Definition: CaloTPGTranscoderULUT.h:65
CaloTPGTranscoderULUT::TPGMAX
static const unsigned int TPGMAX
Definition: CaloTPGTranscoderULUT.h:69
mps_fire.i
i
Definition: mps_fire.py:428
CaloTPGTranscoderULUT::plan1_towers_
std::set< HcalDetId > plan1_towers_
Definition: CaloTPGTranscoderULUT.h:101
CaloTPGTranscoderULUT::nct_factor_
double nct_factor_
Definition: CaloTPGTranscoderULUT.h:88
HcalGenericDetId
Definition: HcalGenericDetId.h:15
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
min
T min(T a, T b)
Definition: MathUtil.h:58
HcalTriggerPrimitiveSample
Definition: HcalTriggerPrimitiveSample.h:11
HcalTopologyMode::TriggerMode_2009
Definition: HcalTopologyMode.h:29
HcalTopology::getHTSize
unsigned int getHTSize() const
Definition: HcalTopology.h:136
DetId::Hcal
Definition: DetId.h:28
HcalTopologyMode::TriggerMode_2021
Definition: HcalTopologyMode.h:35
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:4
CaloTPGTranscoderULUT::hcaluncomp_
std::vector< RCTdecompression > hcaluncomp_
Definition: CaloTPGTranscoderULUT.h:99
CaloTPGTranscoderULUT::lsb_factor_
double lsb_factor_
Definition: CaloTPGTranscoderULUT.h:86
HcalTopologyMode::TriggerMode_2016
Definition: HcalTopologyMode.h:30
CaloTPGTranscoderULUT::nominal_gain_
double nominal_gain_
Definition: CaloTPGTranscoderULUT.h:85
CaloTPGTranscoderULUT::allLinear_
bool allLinear_
Definition: CaloTPGTranscoderULUT.h:84
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
HcalTopologyMode::TriggerMode_2017
Definition: HcalTopologyMode.h:32
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HcalGenericDetId::isHcalZDCDetId
bool isHcalZDCDetId() const
Definition: HcalGenericDetId.cc:79
CaloTPGTranscoderULUT::decompressionFile_
const std::string decompressionFile_
Definition: CaloTPGTranscoderULUT.h:92
HcalTriggerPrimitiveSample::compressedEt
int compressedEt() const
get the encoded/compressed Et
Definition: HcalTriggerPrimitiveSample.h:21
HcaluLUTTPGCoder::lsb_
static const float lsb_
Definition: HcaluLUTTPGCoder.h:34
CaloTPGTranscoderULUT::outputLUT_
std::vector< std::vector< LUT > > outputLUT_
Definition: CaloTPGTranscoderULUT.h:98
HcalTopology::detId2denseIdHT
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT
Definition: HcalTopology.cc:1254
CaloTPGTranscoderULUT::lin11_factor_
double lin11_factor_
Definition: CaloTPGTranscoderULUT.h:90
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
HcalTopologyMode::TriggerMode_2017plan1
Definition: HcalTopologyMode.h:33
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
HcalTopology::validHT
bool validHT(const HcalTrigTowerDetId &id) const
Definition: HcalTopology.cc:239
HcalLutMetadatum::getOutputLutThreshold
uint8_t getOutputLutThreshold() const
Definition: HcalLutMetadatum.h:22
HcalGenericDetId::isHcalTrigTowerDetId
bool isHcalTrigTowerDetId() const
Definition: HcalGenericDetId.cc:74
CaloTPGTranscoderULUT::getOutputLUTId
virtual int getOutputLUTId(const HcalTrigTowerDetId &id) const
Definition: CaloTPGTranscoderULUT.cc:207
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
CaloTPGTranscoderULUT::OUTPUT_LUT_SIZE
static const unsigned int OUTPUT_LUT_SIZE
Definition: CaloTPGTranscoderULUT.h:67
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
HcalTopology::dddConstants
const HcalDDDRecConstants * dddConstants() const
Definition: HcalTopology.h:164
HcalDetId
Definition: HcalDetId.h:12
HcalTopology::triggerMode
HcalTopologyMode::TriggerMode triggerMode() const
Definition: HcalTopology.h:35
CaloTPGTranscoderULUT::loadHCALCompress
void loadHCALCompress(HcalLutMetadata const &, HcalTrigTowerGeometry const &)
Definition: CaloTPGTranscoderULUT.cc:32
CaloTPGTranscoderULUT::rct_factor_
double rct_factor_
Definition: CaloTPGTranscoderULUT.h:87
HcalTopology::lastHERing
int lastHERing() const
Definition: HcalTopology.h:94
CaloTPGTranscoderULUT::QIE8_OUTPUT_LUT_SIZE
static const unsigned int QIE8_OUTPUT_LUT_SIZE
Definition: CaloTPGTranscoderULUT.h:64
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HcalGenericDetId::isHcalCastorDetId
bool isHcalCastorDetId() const
Definition: HcalGenericDetId.cc:84
CaloTPGTranscoderULUT::QIE11_OUTPUT_LUT_SIZE
static const unsigned int QIE11_OUTPUT_LUT_SIZE
Definition: CaloTPGTranscoderULUT.h:66
HcalTopology::valid
bool valid(const DetId &id) const override
Definition: HcalTopology.cc:225
HcalTopologyMode::TriggerMode_2018
Definition: HcalTopologyMode.h:34
HcalGenericDetId::isHcalDetId
bool isHcalDetId() const
Definition: HcalGenericDetId.cc:64
CaloTPGTranscoderULUT::compressionFile_
const std::string compressionFile_
Definition: CaloTPGTranscoderULUT.h:91
LUT
std::vector< unsigned short int > LUT
Definition: DTTracoLUTs.h:31
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
CaloTPGTranscoderULUT::getOutputLUTSize
unsigned int getOutputLUTSize(const HcalTrigTowerDetId &id) const
Definition: CaloTPGTranscoderULUT.cc:223
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HcalTopology::lastHBHERing
int lastHBHERing() const
Definition: HcalTopology.h:95
CaloTPGTranscoderULUT::theTopology
const HcalTopology * theTopology
Definition: CaloTPGTranscoderULUT.h:75
HcalLutMetadatum::getLutGranularity
uint8_t getLutGranularity() const
Definition: HcalLutMetadatum.h:21
remoteMonitoring_LED_IterMethod_cfg.threshold
threshold
Definition: remoteMonitoring_LED_IterMethod_cfg.py:430
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45
HcalTopologyMode::TriggerMode_2018legacy
Definition: HcalTopologyMode.h:31
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
CaloTPGTranscoderULUT::isOnlyQIE11
bool isOnlyQIE11(const HcalTrigTowerDetId &id) const
Definition: CaloTPGTranscoderULUT.cc:261
HcalTopology::lastHBRing
int lastHBRing() const
Definition: HcalTopology.h:92
CaloTPGTranscoderULUT::lin8_factor_
double lin8_factor_
Definition: CaloTPGTranscoderULUT.h:89
HcalTrigTowerDetId
Definition: HcalTrigTowerDetId.h:14