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 
32 public:
33 
35  virtual ~HcaluLUTTPGCoder();
36  virtual void adc2Linear(const HBHEDataFrame& df, IntegerCaloSamples& ics) const;
37  virtual void adc2Linear(const HFDataFrame& df, IntegerCaloSamples& ics) const;
38  virtual void compress(const IntegerCaloSamples& ics, const std::vector<bool>& featureBits, HcalTriggerPrimitiveDigi& tp) const;
39  virtual unsigned short adc2Linear(HcalQIESample sample,HcalDetId id) const;
40  virtual float getLUTPedestal(HcalDetId id) const;
41  virtual float getLUTGain(HcalDetId id) const;
42 
43  void update(const HcalDbService& conditions);
44  void update(const char* filename, bool appendMSB = false);
45  void updateXML(const char* filename);
46  void setLUTGenerationMode(bool gen){ LUTGenerationMode_ = gen; };
47  void setMaskBit(int bit){ bitToMask_ = bit; };
48  std::vector<unsigned short> getLinearizationLUTWithMSB(const HcalDetId& id) const;
49  void lookupMSB(const HBHEDataFrame& df, std::vector<bool>& msb) const;
50  bool getMSB(const HcalDetId& id, int adc) const;
51  int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const;
52  int getLUTId(uint32_t rawid) const;
53  int getLUTId(const HcalDetId& detid) const;
54 
55 private:
56  // typedef
57  typedef unsigned short LutElement;
58  typedef std::vector<LutElement> Lut;
59 
60  // constants
61  static const size_t nluts = 46007, INPUT_LUT_SIZE = 128;
62  static const float lsb_;
63 
64  // member variables
67  std::vector< Lut > inputLUT_;
68  std::vector<float> gain_;
69  std::vector<float> ped_;
70 };
71 
72 #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 updateXML(const char *filename)
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:32
std::vector< unsigned short > getLinearizationLUTWithMSB(const HcalDetId &id) const
std::vector< LutElement > Lut
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_