CMS 3D CMS Logo

CaloTPGTranscoderULUT.h
Go to the documentation of this file.
1 #ifndef CALOTPGTRANSCODERULUT_H
2 #define CALOTPGTRANSCODERULUT_H 1
3 
4 #include <memory>
5 #include <vector>
6 #include <set>
10 
17 
19 public:
20  CaloTPGTranscoderULUT(const std::string& compressionFile = "", const std::string& decompressionFile = "");
21  ~CaloTPGTranscoderULUT() override;
23  unsigned int sample,
24  int fineGrain) const override;
26  unsigned int sample,
27  bool fineGrain) const override;
28 
31  const EcalTrigTowerDetId& eid,
33  unsigned int& et,
34  bool& egVecto,
35  bool& activity) const override;
36  void rctJetUncompress(const HcalTrigTowerDetId& hid,
38  const EcalTrigTowerDetId& eid,
40  unsigned int& et) const override;
41  double hcaletValue(const int& ieta, const int& iphi, const int& version, const int& compressedValue) const override;
42  double hcaletValue(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc) const override;
43  virtual bool HTvalid(const int ieta, const int iphi, const int version) const;
44  virtual const std::vector<unsigned int> getCompressionLUT(const HcalTrigTowerDetId& id) const;
45  virtual void setup(HcalLutMetadata const&,
46  HcalTrigTowerGeometry const&,
47  int nctScaleShift,
48  int rctScaleShift,
49  double lsbQIE8,
50  double lsbQIE11,
51  bool allLinear);
52  virtual int getOutputLUTId(const HcalTrigTowerDetId& id) const;
53  virtual int getOutputLUTId(const int ieta, const int iphi, const int version) const;
54 
55 private:
56  // Constant
57  static const int NOUTLUTS = 4176;
58 
59  // Two possible linearization scales
60  static const unsigned int REDUCE10BIT = 1024;
61  static const unsigned int REDUCE11BIT = 2048;
62 
63  // Map different QIE to the right linearization
64  static const unsigned int QIE8_OUTPUT_LUT_SIZE = REDUCE10BIT;
65  static const unsigned int QIE10_OUTPUT_LUT_SIZE = REDUCE11BIT;
66  static const unsigned int QIE11_OUTPUT_LUT_SIZE = REDUCE11BIT;
67  static const unsigned int OUTPUT_LUT_SIZE =
69  static const unsigned int TPGMAX = 256;
70 
71  // Typedef
72  typedef uint8_t LUT;
73  typedef std::array<float, TPGMAX> RCTdecompression;
74 
76  static const bool newHFphi = true;
77 
78  // Member functions
79  unsigned int getOutputLUTSize(const HcalTrigTowerDetId& id) const;
80  bool isOnlyQIE11(const HcalTrigTowerDetId& id) const;
81  void loadHCALCompress(HcalLutMetadata const&, HcalTrigTowerGeometry const&); //Analytical compression tables
82 
83  // Member Variables
84  bool allLinear_ = false;
85  double nominal_gain_;
86  double lsb_factor_;
87  double rct_factor_;
88  double nct_factor_;
89  double lin8_factor_;
90  double lin11_factor_;
93  std::vector<int> ietal;
94  std::vector<int> ietah;
95  std::vector<int> ZS;
96  std::vector<int> LUTfactor;
97 
98  std::vector<std::vector<LUT>> outputLUT_;
99  std::vector<RCTdecompression> hcaluncomp_;
100 
101  std::set<HcalDetId> plan1_towers_;
102 };
103 #endif
static const unsigned int REDUCE10BIT
std::vector< int > ietah
std::vector< int > LUTfactor
std::vector< RCTdecompression > hcaluncomp_
std::vector< std::vector< LUT > > outputLUT_
std::set< HcalDetId > plan1_towers_
static const unsigned int QIE8_OUTPUT_LUT_SIZE
virtual bool HTvalid(const int ieta, const int iphi, const int version) const
std::vector< int > ietal
virtual void setup(HcalLutMetadata const &, HcalTrigTowerGeometry const &, int nctScaleShift, int rctScaleShift, double lsbQIE8, double lsbQIE11, bool allLinear)
CaloTPGTranscoderULUT(const std::string &compressionFile="", const std::string &decompressionFile="")
const std::string decompressionFile_
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 const std::vector< unsigned int > getCompressionLUT(const HcalTrigTowerDetId &id) const
std::array< float, TPGMAX > RCTdecompression
HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId &id, unsigned int sample, int fineGrain) const override
Compression from linear samples+fine grain in the HTR.
const HcalTopology * theTopology
static const unsigned int QIE10_OUTPUT_LUT_SIZE
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.
static const unsigned int OUTPUT_LUT_SIZE
static const unsigned int REDUCE11BIT
void loadHCALCompress(HcalLutMetadata const &, HcalTrigTowerGeometry const &)
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
const std::string compressionFile_
static const unsigned int TPGMAX
unsigned int getOutputLUTSize(const HcalTrigTowerDetId &id) const
static const bool newHFphi
double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const override
bool isOnlyQIE11(const HcalTrigTowerDetId &id) const
virtual int getOutputLUTId(const HcalTrigTowerDetId &id) const