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 
32  HcaluLUTTPGCoder(const HcalTopology* topo);
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, bool appendMSB = false);
43  void updateXML(const char* filename);
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 INPUT_LUT_SIZE = 128;
60  static const int nFi_ = 72;
61  static const float lsb_;
62 
63  // member variables
70  std::vector< Lut > inputLUT_;
71  std::vector<float> gain_;
72  std::vector<float> ped_;
73 };
74 
75 #endif
int adc(sample_type sample)
get the ADC sample (12 bits)
static const int nFi_
virtual ~HcaluLUTTPGCoder()
const HcalTopology * topo_
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:31
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
HcaluLUTTPGCoder(const HcalTopology *topo)
bool getMSB(const HcalDetId &id, int adc) const
tuple filename
Definition: lut2db_cfg.py:20
virtual void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const
virtual void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const
std::vector< Lut > inputLUT_