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  ~CaloTPGTranscoderULUT() override;
24  HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId& id, unsigned int sample, int fineGrain) const override;
25  EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const override;
26 
29  unsigned int& et, bool& egVecto, bool& activity) const override;
31  const EcalTrigTowerDetId& eid, const EcalTriggerPrimitiveSample& ec,
32  unsigned int& et) const override;
33  double hcaletValue(const int& ieta, const int& iphi, const int& version, const int& compressedValue) const override;
34  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&,
38  int nctScaleShift, int rctScaleShift,
39  double lsbQIE8, double lsbQIE11, bool allLinear);
40  virtual int getOutputLUTId(const HcalTrigTowerDetId& id) const;
41  virtual int getOutputLUTId(const int ieta, const int iphi, const int version) const;
42 
43  private:
44  // Constant
45  static const int NOUTLUTS = 4176;
46 
47  // Two possible linearization scales
48  static const unsigned int REDUCE10BIT = 1024;
49  static const unsigned int REDUCE11BIT = 2048;
50 
51  // Map different QIE to the right linearization
52  static const unsigned int QIE8_OUTPUT_LUT_SIZE = REDUCE10BIT;
53  static const unsigned int QIE10_OUTPUT_LUT_SIZE = REDUCE11BIT;
54  static const unsigned int QIE11_OUTPUT_LUT_SIZE = REDUCE11BIT;
55  static const unsigned int OUTPUT_LUT_SIZE = std::max({QIE8_OUTPUT_LUT_SIZE, QIE10_OUTPUT_LUT_SIZE, QIE11_OUTPUT_LUT_SIZE});
56  static const unsigned int TPGMAX = 256;
57 
58  // Typedef
59  typedef uint8_t LUT;
60  typedef std::array<float, TPGMAX> RCTdecompression;
61 
63  static const bool newHFphi = true;
64 
65  // Member functions
66  unsigned int getOutputLUTSize(const HcalTrigTowerDetId& id) const;
67  bool isOnlyQIE11(const HcalTrigTowerDetId& id) const;
68  void loadHCALCompress(HcalLutMetadata const&, HcalTrigTowerGeometry const&) ; //Analytical compression tables
69 
70  // Member Variables
71  bool allLinear_ = false;
72  double nominal_gain_;
73  double lsb_factor_;
74  double rct_factor_;
75  double nct_factor_;
76  double lin8_factor_;
77  double lin11_factor_;
80  std::vector<int> ietal;
81  std::vector<int> ietah;
82  std::vector<int> ZS;
83  std::vector<int> LUTfactor;
84 
85  std::vector<std::vector<LUT>> outputLUT_;
86  std::vector<RCTdecompression> hcaluncomp_;
87 
88  std::set<HcalDetId> plan1_towers_;
89 };
90 #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)
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="")
const std::string decompressionFile_
bool isOnlyQIE11(const HcalTrigTowerDetId &id) const
HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId &id, unsigned int sample, int fineGrain) const override
Compression from linear samples+fine grain in the HTR.
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.
std::array< float, TPGMAX > RCTdecompression
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 &)
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
double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const override
const std::string compressionFile_
static const unsigned int TPGMAX
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