22 nominal_gain_(0.), lsb_factor_(0.), rct_factor_(1.), nct_factor_(1.),
23 compressionFile_(compressionFile),
24 decompressionFile_(decompressionFile)
34 throw cms::Exception(
"CaloTPGTranscoderULUT") <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
37 std::array<unsigned int, OUTPUT_LUT_SIZE> analytical10BITLUT;
38 std::array<unsigned int, OUTPUT_LUT_SIZE> analytical11BITLUT;
39 std::array<unsigned int, OUTPUT_LUT_SIZE> linearRctLUT;
40 std::array<unsigned int, OUTPUT_LUT_SIZE> linearNctLUT;
44 analytical10BITLUT[
i] = (
unsigned int)(
sqrt(14.94*
log(1.+
i/14.94)*
i) + 0.5);
45 analytical11BITLUT[
i] = (
unsigned int)(
sqrt(5.32*
log(1.+
i/5.32)*
i) + 0.5);
52 for(std::vector<DetId>::iterator
i=allChannels.begin();
i!=allChannels.end(); ++
i){
80 for (
unsigned int i = threshold;
i < lutsize; ++
i)
83 for (
unsigned int i = threshold;
i < lutsize; ++
i)
86 for (
unsigned int i = threshold;
i < lutsize; ++
i)
87 outputLUT_[index][
i] = version == 0 ? linearRctLUT[
i] : linearNctLUT[
i];
90 double eta_low = 0., eta_high = 0.;
91 theTrigTowerGeometry.
towerEtaBounds(ieta,version,eta_low,eta_high);
92 double cosh_ieta = fabs(cosh((eta_low + eta_high)/2.));
101 unsigned int mid = (low +
i)/2;
127 <<
"LUT has " <<
getOutputLUTSize(
id) <<
" entries for " << itower <<
" but " << sample <<
" was requested.";
130 throw cms::Exception(
"Out of Range") <<
"No decompression LUT found for " << id;
139 edm::LogError(
"CaloTPGTranscoderULUT") <<
"No decompression LUT found for ieta, iphi = " << ieta <<
", " << iphi;
140 }
else if (compET < 0 || compET >= (
int)
TPGMAX) {
141 edm::LogError(
"CaloTPGTranscoderULUT") <<
"Compressed value out of range: eta, phi, cET = " << ieta <<
", " << iphi <<
", " << compET;
156 throw cms::Exception(
"Not Implemented") <<
"CaloTPGTranscoderULUT::ecalCompress";
161 unsigned int& et,
bool& egVecto,
bool& activity)
const {
162 throw cms::Exception(
"Not Implemented") <<
"CaloTPGTranscoderULUT::rctEGammaUncompress";
166 unsigned int& et)
const {
167 throw cms::Exception(
"Not Implemented") <<
"CaloTPGTranscoderULUT::rctJetUncompress";
172 id.setVersion(version);
174 throw cms::Exception(
"CaloTPGTranscoderULUT") <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
181 throw cms::Exception(
"CaloTPGTranscoderULUT") <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
188 throw cms::Exception(
"CaloTPGTranscoderULUT") <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
191 id.setVersion(version);
200 <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
215 <<
"Unknown trigger mode used by the topology!";
222 std::vector<unsigned int>
result(
lut.begin(),
lut.end());
242 throw cms::Exception(
"Not Implemented") <<
"setup of CaloTPGTranscoderULUT from text files";
static const unsigned int REDUCE10BIT
std::vector< RCTdecompression > hcaluncomp_
std::vector< std::array< LUT, OUTPUT_LUT_SIZE > > outputLUT_
bool isHcalZDCDetId() const
static const unsigned int QIE8_OUTPUT_LUT_SIZE
virtual bool HTvalid(const int ieta, const int iphi, const int version) const
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT
unsigned int getOutputLUTSize(const HcalTrigTowerDetId &id) const
virtual const std::vector< unsigned int > getCompressionLUT(const HcalTrigTowerDetId &id) const
std::string decompressionFile_
void towerEtaBounds(int ieta, int version, double &eta1, double &eta2) const
where this tower begins and ends in eta
CaloTPGTranscoderULUT(const std::string &compressionFile="", const std::string &decompressionFile="")
const Item * getValues(DetId fId, bool throwOnFail=true) const
virtual ~CaloTPGTranscoderULUT()
HcalTopologyMode::TriggerMode triggerMode() const
virtual 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.
virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId &id, unsigned int sample, int fineGrain) const override
Compression from linear samples+fine grain in the HTR.
bool isHcalTrigTowerDetId() const
const HcalTopology * theTopology
std::vector< DetId > getAllChannels() const
static const unsigned int QIE10_OUTPUT_LUT_SIZE
virtual int getOutputLUTId(const HcalTrigTowerDetId &id) const
virtual 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.
unsigned int getHTSize() const
Abs< T >::type abs(const T &t)
static const unsigned int OUTPUT_LUT_SIZE
void loadHCALCompress(HcalLutMetadata const &, HcalTrigTowerGeometry const &)
virtual void setup(HcalLutMetadata const &, HcalTrigTowerGeometry const &, int, int)
std::string compressionFile_
virtual EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId &id, unsigned int sample, bool fineGrain) const override
Compression from linear samples+fine grain in the ECAL.
static const unsigned int QIE11_OUTPUT_LUT_SIZE
static const unsigned int TPGMAX
int compressedEt() const
get the encoded/compressed Et
bool isHcalCastorDetId() const
virtual double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const override
const HcalTopology * topo() const
bool validHT(const HcalTrigTowerDetId &id) const
int firstHFTower(int version) const