CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CaloTPGTranscoderULUT.h
Go to the documentation of this file.
1 #ifndef CALOTPGTRANSCODERULUT_H
2 #define CALOTPGTRANSCODERULUT_H 1
3 
4 #include <vector>
6 
7 // tmp
10 
11 
19 public:
20  CaloTPGTranscoderULUT(const std::string& compressionFile="",
21  const std::string& decompressionFile="");
22  virtual ~CaloTPGTranscoderULUT();
23  virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const;
24  virtual EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const;
25 
26  virtual void rctEGammaUncompress(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc,
27  const EcalTrigTowerDetId& eid, const EcalTriggerPrimitiveSample& ec,
28  unsigned int& et, bool& egVecto, bool& activity) const;
29  virtual void rctJetUncompress(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc,
30  const EcalTrigTowerDetId& eid, const EcalTriggerPrimitiveSample& ec,
31  unsigned int& et) const;
32  virtual double hcaletValue(const int& ieta, const int& compressedValue) const;
33  virtual double hcaletValue(const int& ieta, const int& iphi, const int& compressedValue) const;
34  virtual double hcaletValue(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc) const;
35  virtual bool HTvalid(const int ieta, const int iphi) const;
36  virtual std::vector<unsigned char> getCompressionLUT(HcalTrigTowerDetId id) const;
37  virtual void setup(const edm::EventSetup& es, Mode) const;
38  virtual int getOutputLUTId(const int ieta, const int iphi) const;
39  void printDecompression() const;
40 
41  private:
42  // Typedef
43  typedef unsigned int LUT;
44  typedef std::vector<double> RCTdecompression;
45 
46  // Constant
47  // TODO prefix k
48  static const int NOUTLUTS = 4176;
49  static const unsigned int OUTPUT_LUT_SIZE = 1024;
50  static const int TPGMAX = 256;
51  static const bool newHFphi = true;
52 
53  // Member functions
54  void loadHCALCompress(void) const; //Analytical compression tables
55  void loadHCALCompress(const std::string& filename) const; //Compression tables from file
56  void loadHCALUncompress(void) const; //Analytical decompression
57  void loadHCALUncompress(const std::string& filename) const; //Decompression tables from file
58  //int getLutGranularity(const DetId& id) const;
59  //int getLutThreshold(const DetId& id) const;
60 
61  // Member Variables
62  mutable bool isLoaded_;
63  mutable double nominal_gain_;
64  mutable double rctlsb_factor_;
65  std::string compressionFile_;
66  std::string decompressionFile_;
67  std::vector<int> ietal;
68  std::vector<int> ietah;
69  std::vector<int> ZS;
70  std::vector<int> LUTfactor;
71 
72  mutable LUT *outputLUT_[NOUTLUTS];
73  mutable std::vector<RCTdecompression> hcaluncomp_;
75 };
76 #endif
std::vector< int > ietah
std::vector< int > LUTfactor
std::vector< RCTdecompression > hcaluncomp_
edm::ESHandle< HcalLutMetadata > lutMetadata_
std::vector< int > ietal
virtual void setup(const edm::EventSetup &es, Mode) const
Obtain any needed objects from the EventSetup. Note that any member variables which are changed must ...
CaloTPGTranscoderULUT(const std::string &compressionFile="", const std::string &decompressionFile="")
virtual std::vector< unsigned char > getCompressionLUT(HcalTrigTowerDetId id) const
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.
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.
virtual bool HTvalid(const int ieta, const int iphi) const
std::vector< double > RCTdecompression
virtual double hcaletValue(const int &ieta, const int &compressedValue) const
tuple filename
Definition: lut2db_cfg.py:20
virtual int getOutputLUTId(const int ieta, const int iphi) const
void loadHCALCompress(void) const
virtual EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId &id, unsigned int sample, bool fineGrain) const
Compression from linear samples+fine grain in the ECAL.
static const bool newHFphi
void loadHCALUncompress(void) const
virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId &id, unsigned int sample, bool fineGrain) const
Compression from linear samples+fine grain in the HTR.