CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcaluLUTTPGCoder.h
Go to the documentation of this file.
1 #ifndef CALIBCALORIMETRY_HCALTPGALGOS_HCALNOMINALTPGCODER_H
2 #define CALIBCALORIMETRY_HCALTPGALGOS_HCALNOMINALTPGCODER_H 1
3 
8 #include <vector>
9 
10 class HcalDbService;
11 
30 public:
31 
33  virtual ~HcaluLUTTPGCoder();
34  virtual void adc2Linear(const HBHEDataFrame& df, IntegerCaloSamples& ics) const;
35  virtual void adc2Linear(const HFDataFrame& df, IntegerCaloSamples& ics) const;
36  virtual void compress(const IntegerCaloSamples& ics, const std::vector<bool>& featureBits, HcalTriggerPrimitiveDigi& tp) const;
37  virtual unsigned short adc2Linear(HcalQIESample sample,HcalDetId id) const;
38  virtual float getLUTPedestal(HcalDetId id) const;
39  virtual float getLUTGain(HcalDetId id) const;
40 
41  void update(const HcalDbService& conditions);
42  void update(const char* filename, const HcalTopology&, bool appendMSB = false);
43  void updateXML(const char* filename, const HcalTopology&);
45  void setMaskBit(int bit){ bitToMask_ = bit; };
46  std::vector<unsigned short> getLinearizationLUTWithMSB(const HcalDetId& id) const;
47  void lookupMSB(const HBHEDataFrame& df, std::vector<bool>& msb) const;
48  bool getMSB(const HcalDetId& id, int adc) const;
49  int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const;
50  int getLUTId(uint32_t rawid) const;
51  int getLUTId(const HcalDetId& detid) const;
52 
53 private:
54  // typedef
55  typedef unsigned short LutElement;
56  typedef std::vector<LutElement> Lut;
57 
58  // constants
59  static const size_t nluts = 46007, INPUT_LUT_SIZE = 128;
60  static const float lsb_;
61 
62  // member variables
65  std::vector< Lut > inputLUT_;
66  std::vector<float> gain_;
67  std::vector<float> ped_;
68 };
69 
70 #endif
int adc(sample_type sample)
get the ADC sample (12 bits)
virtual ~HcaluLUTTPGCoder()
static const float lsb_
unsigned short LutElement
void update(const HcalDbService &conditions)
virtual float getLUTPedestal(HcalDetId id) const
void setLUTGenerationMode(bool gen)
void lookupMSB(const HBHEDataFrame &df, std::vector< bool > &msb) const
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
HcalSubdetector
Definition: HcalAssistant.h:31
std::vector< unsigned short > getLinearizationLUTWithMSB(const HcalDetId &id) const
std::vector< LutElement > Lut
void updateXML(const char *filename, const HcalTopology &)
virtual float getLUTGain(HcalDetId id) const
std::vector< float > ped_
std::vector< float > gain_
void setMaskBit(int bit)
static const size_t INPUT_LUT_SIZE
bool getMSB(const HcalDetId &id, int adc) const
tuple filename
Definition: lut2db_cfg.py:20
virtual void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const
static const size_t nluts
virtual void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const
std::vector< Lut > inputLUT_