test
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  static const float lsb_;
32 
33  HcaluLUTTPGCoder(const HcalTopology* topo);
34  virtual ~HcaluLUTTPGCoder();
35  virtual void adc2Linear(const HBHEDataFrame& df, IntegerCaloSamples& ics) const;
36  virtual void adc2Linear(const HFDataFrame& df, IntegerCaloSamples& ics) const;
37  virtual void compress(const IntegerCaloSamples& ics, const std::vector<bool>& featureBits, HcalTriggerPrimitiveDigi& tp) const;
38  virtual unsigned short adc2Linear(HcalQIESample sample,HcalDetId id) const;
39  virtual float getLUTPedestal(HcalDetId id) const;
40  virtual float getLUTGain(HcalDetId id) const;
41 
42  void update(const HcalDbService& conditions);
43  void update(const char* filename, bool appendMSB = false);
44  void updateXML(const char* filename);
46  void setMaskBit(int bit){ bitToMask_ = bit; };
47  std::vector<unsigned short> getLinearizationLUTWithMSB(const HcalDetId& id) const;
48  void lookupMSB(const HBHEDataFrame& df, std::vector<bool>& msb) const;
49  bool getMSB(const HcalDetId& id, int adc) const;
50  int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const;
51  int getLUTId(uint32_t rawid) const;
52  int getLUTId(const HcalDetId& detid) const;
53 
54 private:
55  // typedef
56  typedef unsigned short LutElement;
57  typedef std::vector<LutElement> Lut;
58 
59  // constants
60  static const size_t INPUT_LUT_SIZE = 128;
61  static const int nFi_ = 72;
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)
def gen
run2 Cosmic #### Run 256259 @ 0T 2015C### Run 272133 @ 3.8T 2016B###
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_