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 
11 
18 
20 public:
21  CaloTPGTranscoderULUT(const std::string& compressionFile="",
22  const std::string& decompressionFile="");
23  virtual ~CaloTPGTranscoderULUT();
24  virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId& id, unsigned int sample, int fineGrain) const override;
25  virtual EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const override;
26 
29  unsigned int& et, bool& egVecto, bool& activity) const override;
30  virtual void rctJetUncompress(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc,
31  const EcalTrigTowerDetId& eid, const EcalTriggerPrimitiveSample& ec,
32  unsigned int& et) const override;
33  virtual double hcaletValue(const int& ieta, const int& iphi, const int& version, const int& compressedValue) const override;
34  virtual double hcaletValue(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc) const override;
35  virtual bool HTvalid(const int ieta, const int iphi, const int version) const;
36  virtual const std::vector<unsigned int> getCompressionLUT(const HcalTrigTowerDetId& id) const;
37  virtual void setup(HcalLutMetadata const&, HcalTrigTowerGeometry const&, int, int);
38  virtual int getOutputLUTId(const HcalTrigTowerDetId& id) const;
39  virtual int getOutputLUTId(const int ieta, const int iphi, const int version) const;
40 
41  private:
42  // Constant
43  static const int NOUTLUTS = 4176;
44 
45  // Two possible linearization scales
46  static const unsigned int REDUCE10BIT = 1024;
47  static const unsigned int REDUCE11BIT = 2048;
48 
49  // Map different QIE to the right linearization
50  static const unsigned int QIE8_OUTPUT_LUT_SIZE = REDUCE10BIT;
51  static const unsigned int QIE10_OUTPUT_LUT_SIZE = REDUCE11BIT;
52  static const unsigned int QIE11_OUTPUT_LUT_SIZE = REDUCE11BIT;
53  static const unsigned int OUTPUT_LUT_SIZE = std::max({QIE8_OUTPUT_LUT_SIZE, QIE10_OUTPUT_LUT_SIZE, QIE11_OUTPUT_LUT_SIZE});
54  static const unsigned int TPGMAX = 256;
55 
56  // Typedef
57  typedef unsigned int LUT;
58  typedef std::array<double, TPGMAX> RCTdecompression;
59 
61  static const bool newHFphi = true;
62 
63  // Member functions
64  unsigned int getOutputLUTSize(const HcalTrigTowerDetId& id) const;
65  void loadHCALCompress(HcalLutMetadata const&, HcalTrigTowerGeometry const&) ; //Analytical compression tables
66 
67  // Member Variables
68  double nominal_gain_;
69  double lsb_factor_;
70  double rct_factor_;
71  double nct_factor_;
74  std::vector<int> ietal;
75  std::vector<int> ietah;
76  std::vector<int> ZS;
77  std::vector<int> LUTfactor;
78 
79  std::vector<std::array<LUT, OUTPUT_LUT_SIZE>> outputLUT_;
80  std::vector<RCTdecompression> hcaluncomp_;
81 
82  std::set<HcalDetId> plan1_towers_;
83 };
84 #endif
static const unsigned int REDUCE10BIT
std::vector< int > ietah
std::vector< int > LUTfactor
std::vector< RCTdecompression > hcaluncomp_
std::vector< std::array< LUT, OUTPUT_LUT_SIZE > > 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
unsigned int getOutputLUTSize(const HcalTrigTowerDetId &id) const
virtual const std::vector< unsigned int > getCompressionLUT(const HcalTrigTowerDetId &id) const
CaloTPGTranscoderULUT(const std::string &compressionFile="", const std::string &decompressionFile="")
virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId &id, unsigned int sample, int fineGrain) const override
Compression from linear samples+fine grain in the HTR.
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.
const HcalTopology * theTopology
static const unsigned int QIE10_OUTPUT_LUT_SIZE
virtual int getOutputLUTId(const HcalTrigTowerDetId &id) const
static const unsigned int OUTPUT_LUT_SIZE
static const unsigned int REDUCE11BIT
void loadHCALCompress(HcalLutMetadata const &, HcalTrigTowerGeometry const &)
virtual void setup(HcalLutMetadata const &, HcalTrigTowerGeometry const &, int, int)
std::array< double, TPGMAX > RCTdecompression
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
et
define resolution functions of each parameter
virtual double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const override
static const unsigned int TPGMAX
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.
susybsm::HSCParticleCollection hc
Definition: classes.h:25
static const bool newHFphi