22 nominal_gain_(0.), lsb_factor_(0.), rct_factor_(1.), nct_factor_(1.),
23 compressionFile_(compressionFile),
24 decompressionFile_(decompressionFile),
37 edm::LogError(
"CaloTPGTranscoderULUT") <<
"Analytic compression expects 10-bit LUT; found LUT with " <<
OUTPUT_LUT_SIZE <<
" entries instead";
40 throw cms::Exception(
"CaloTPGTranscoderULUT") <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
43 std::array<unsigned int, OUTPUT_LUT_SIZE> analyticalLUT;
44 std::array<unsigned int, OUTPUT_LUT_SIZE> linearRctLUT;
45 std::array<unsigned int, OUTPUT_LUT_SIZE> linearNctLUT;
49 analyticalLUT[
i] = (
unsigned int)(
sqrt(14.94*
log(1.+
i/14.94)*
i) + 0.5);
56 for(std::vector<DetId>::iterator
i=allChannels.begin();
i!=allChannels.end(); ++
i){
86 (version==0?linearRctLUT[
i]:linearNctLUT[
i]);
93 double eta_low = 0., eta_high = 0.;
94 theTrigTowerGeometry.
towerEtaBounds(ieta,version,eta_low,eta_high);
95 double cosh_ieta = fabs(cosh((eta_low + eta_high)/2.));
104 unsigned int mid = (low +
i)/2;
129 throw cms::Exception(
"Out of Range") <<
"LUT has 1024 entries for " << itower <<
" but " << sample <<
" was requested.";
134 throw cms::Exception(
"Out of Range") <<
"No decompression LUT found for " << id;
144 edm::LogError(
"CaloTPGTranscoderULUT") <<
"No decompression LUT found for ieta, iphi = " << ieta <<
", " << iphi;
145 }
else if (compET < 0 || compET >= (
int)
TPGMAX) {
146 edm::LogError(
"CaloTPGTranscoderULUT") <<
"Compressed value out of range: eta, phi, cET = " << ieta <<
", " << iphi <<
", " << compET;
161 throw cms::Exception(
"Not Implemented") <<
"CaloTPGTranscoderULUT::ecalCompress";
166 unsigned int& et,
bool& egVecto,
bool& activity)
const {
167 throw cms::Exception(
"Not Implemented") <<
"CaloTPGTranscoderULUT::rctEGammaUncompress";
171 unsigned int& et)
const {
172 throw cms::Exception(
"Not Implemented") <<
"CaloTPGTranscoderULUT::rctJetUncompress";
177 id.setVersion(version);
179 throw cms::Exception(
"CaloTPGTranscoderULUT") <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
186 throw cms::Exception(
"CaloTPGTranscoderULUT") <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
193 throw cms::Exception(
"CaloTPGTranscoderULUT") <<
"Topology not set! Use CaloTPGTranscoderULUT::setup(...) first!";
196 id.setVersion(version);
218 throw cms::Exception(
"Not Implemented") <<
"setup of CaloTPGTranscoderULUT from text files";
virtual double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const
std::vector< RCTdecompression > hcaluncomp_
std::vector< std::vector< LUT > > outputLUT_
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
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 const std::vector< unsigned int > & getCompressionLUT(const HcalTrigTowerDetId &id) const
virtual ~CaloTPGTranscoderULUT()
virtual void rctJetUncompress(const HcalTrigTowerDetId &hid, const HcalTriggerPrimitiveSample &hc, const EcalTrigTowerDetId &eid, const EcalTriggerPrimitiveSample &ec, unsigned int &et) const
Uncompression for the JET path in the RCT.
bool isHcalTrigTowerDetId() const
const HcalTopology * theTopology
std::vector< DetId > getAllChannels() const
virtual int getOutputLUTId(const HcalTrigTowerDetId &id) const
Abs< T >::type abs(const T &t)
static const unsigned int OUTPUT_LUT_SIZE
virtual void rctEGammaUncompress(const HcalTrigTowerDetId &hid, const HcalTriggerPrimitiveSample &hc, const EcalTrigTowerDetId &eid, const EcalTriggerPrimitiveSample &ec, unsigned int &et, bool &egVecto, bool &activity) const
Uncompression for the Electron/Photon path in the RCT.
void loadHCALCompress(HcalLutMetadata const &, HcalTrigTowerGeometry const &)
virtual void setup(HcalLutMetadata const &, HcalTrigTowerGeometry const &, int, int)
std::string compressionFile_
static const unsigned int TPGMAX
int compressedEt() const
get the encoded/compressed Et
virtual EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId &id, unsigned int sample, bool fineGrain) const
Compression from linear samples+fine grain in the ECAL.
virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId &id, unsigned int sample, bool fineGrain) const
Compression from linear samples+fine grain in the HTR.
tuple size
Write out results.
const HcalTopology * topo() const
bool validHT(const HcalTrigTowerDetId &id) const
int firstHFTower(int version) const