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 
20 
22 public:
23  CaloTPGTranscoderULUT(const std::string& compressionFile="",
24  const std::string& decompressionFile="");
25  virtual ~CaloTPGTranscoderULUT();
26  virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const;
27  virtual EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const;
28 
29  virtual void rctEGammaUncompress(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc,
30  const EcalTrigTowerDetId& eid, const EcalTriggerPrimitiveSample& ec,
31  unsigned int& et, bool& egVecto, bool& activity) const;
32  virtual void rctJetUncompress(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc,
33  const EcalTrigTowerDetId& eid, const EcalTriggerPrimitiveSample& ec,
34  unsigned int& et) const;
35  virtual double hcaletValue(const int& ieta, const int& compressedValue) const;
36  virtual double hcaletValue(const int& ieta, const int& iphi, const int& compressedValue) const;
37  virtual double hcaletValue(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc) const;
38  virtual bool HTvalid(const int ieta, const int iphi) const;
39  virtual std::vector<unsigned char> getCompressionLUT(HcalTrigTowerDetId id) const;
40  virtual void setup(const edm::EventSetup& es, Mode) const;
41  virtual int getOutputLUTId(const int ieta, const int iphi) const;
42  void printDecompression() const;
43 
44  private:
45  // Typedef
46  typedef unsigned int LUT;
47  typedef std::vector<double> RCTdecompression;
48 
49  // Constant
50  // TODO prefix k
51  static const int NOUTLUTS = 4176;
52  static const unsigned int OUTPUT_LUT_SIZE = 1024;
53  static const int TPGMAX = 256;
54  static const bool newHFphi = true;
55 
56  // Member functions
57  void loadHCALCompress(void) const; //Analytical compression tables
58  void loadHCALCompress(const std::string& filename) const; //Compression tables from file
59  void loadHCALUncompress(void) const; //Analytical decompression
60  void loadHCALUncompress(const std::string& filename) const; //Decompression tables from file
61  //int getLutGranularity(const DetId& id) const;
62  //int getLutThreshold(const DetId& id) const;
63 
64  // Member Variables
65  mutable bool isLoaded_;
66  mutable double nominal_gain_;
67  mutable double rctlsb_factor_;
70  std::vector<int> ietal;
71  std::vector<int> ietah;
72  std::vector<int> ZS;
73  std::vector<int> LUTfactor;
74 
75  mutable LUT *outputLUT_[NOUTLUTS];
76  mutable std::vector<RCTdecompression> hcaluncomp_;
79 };
80 #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
edm::ESHandle< HcalTrigTowerGeometry > theTrigTowerGeometry
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.