CMS 3D CMS Logo

HcaluLUTTPGCoder.h
Go to the documentation of this file.
1 #ifndef CALIBCALORIMETRY_HCALTPGALGOS_HCALNOMINALTPGCODER_H
2 #define CALIBCALORIMETRY_HCALTPGALGOS_HCALNOMINALTPGCODER_H 1
3 
9 
10 #include <bitset>
11 #include <vector>
12 
13 class HcalDbService;
14 
33 public:
34  static const float lsb_;
35 
37  HcaluLUTTPGCoder(const HcalTopology* topo, const HcalTimeSlew* delay);
38  ~HcaluLUTTPGCoder() override;
39 
40  void init(const HcalTopology* top, const HcalTimeSlew* delay);
41 
42  void adc2Linear(const HBHEDataFrame& df, IntegerCaloSamples& ics) const override;
43  void adc2Linear(const HFDataFrame& df, IntegerCaloSamples& ics) const override;
44  void adc2Linear(const QIE10DataFrame& df, IntegerCaloSamples& ics) const override;
45  void adc2Linear(const QIE11DataFrame& df, IntegerCaloSamples& ics) const override;
46  void compress(const IntegerCaloSamples& ics,
47  const std::vector<bool>& featureBits,
48  HcalTriggerPrimitiveDigi& tp) const override;
49  unsigned short adc2Linear(HcalQIESample sample, HcalDetId id) const override;
50  float getLUTPedestal(HcalDetId id) const override;
51  float getLUTGain(HcalDetId id) const override;
52  std::vector<unsigned short> getLinearizationLUT(HcalDetId id) const override;
53 
54  double cosh_ieta(int ieta, int depth, HcalSubdetector subdet);
55  void make_cosh_ieta_map(void);
56  void update(const HcalDbService& conditions);
57  void update(const char* filename, bool appendMSB = false);
58  void updateXML(const char* filename);
60  void setFGHFthresholds(const std::vector<uint32_t>& fgthresholds) { FG_HF_thresholds_ = fgthresholds; };
61  void setMaskBit(int bit) { bitToMask_ = bit; };
62  void setAllLinear(bool linear, double lsb8, double lsb11, double lsb11overlap) {
64  linearLSB_QIE8_ = lsb8;
65  linearLSB_QIE11_ = lsb11;
66  linearLSB_QIE11Overlap_ = lsb11overlap;
67  };
74  }
77  }
78  void lookupMSB(const HBHEDataFrame& df, std::vector<bool>& msb) const;
79  void lookupMSB(const QIE10DataFrame& df, std::vector<std::bitset<2>>& msb) const;
80  void lookupMSB(const QIE11DataFrame& df, std::vector<std::bitset<2>>& msb) const;
81  bool getMSB(const HcalDetId& id, int adc) const;
82  int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const;
83  int getLUTId(uint32_t rawid) const;
84  int getLUTId(const HcalDetId& detid) const;
85 
86  static const int QIE8_LUT_BITMASK = 0x3FF;
87  static const int QIE10_LUT_BITMASK = 0x7FF;
88  static const int QIE11_LUT_BITMASK = 0x3FF;
89 
90 private:
91  // typedef
92  typedef unsigned short LutElement;
93  typedef std::vector<LutElement> Lut;
94 
95  // constants
96  static const size_t INPUT_LUT_SIZE = 128;
97  static const size_t UPGRADE_LUT_SIZE = 256;
98  static const int nFi_ = 72;
99 
100  static const int QIE8_LUT_MSB = 0x400;
101  static const int QIE11_LUT_MSB0 = 0x400;
102  static const int QIE11_LUT_MSB1 = 0x800;
103  static const int QIE10_LUT_MSB0 = 0x1000;
104  static const int QIE10_LUT_MSB1 = 0x2000;
105 
106  // member variables
110  std::vector<uint32_t> FG_HF_thresholds_;
115  std::vector<Lut> inputLUT_;
116  std::vector<float> gain_;
117  std::vector<float> ped_;
118  std::vector<double> cosh_ieta_;
119  // edge cases not covered by the cosh_ieta_ map
123  double containPhaseNSHB_ = 6.0;
124  double containPhaseNSHE_ = 6.0;
126  std::unique_ptr<HcalPulseContainmentManager> pulseCorr_;
129 };
130 
131 #endif
HcaluLUTTPGCoder::bitToMask_
int bitToMask_
Definition: HcaluLUTTPGCoder.h:111
HcaluLUTTPGCoder::update
void update(const HcalDbService &conditions)
Definition: HcaluLUTTPGCoder.cc:331
HcaluLUTTPGCoder::cosh_ieta_29_HE_
double cosh_ieta_29_HE_
Definition: HcaluLUTTPGCoder.h:120
HcaluLUTTPGCoder::sizeHF_
int sizeHF_
Definition: HcaluLUTTPGCoder.h:114
HcaluLUTTPGCoder::nHEEta_
int nHEEta_
Definition: HcaluLUTTPGCoder.h:113
HcaluLUTTPGCoder::ped_
std::vector< float > ped_
Definition: HcaluLUTTPGCoder.h:117
HcaluLUTTPGCoder::contain1TSHE_
bool contain1TSHE_
Definition: HcaluLUTTPGCoder.h:122
HcalPulseContainmentManager.h
HcaluLUTTPGCoder::set1TSContainHE
void set1TSContainHE(bool contain1TSHE)
Definition: HcaluLUTTPGCoder.h:69
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
HcaluLUTTPGCoder::linearLSB_QIE11_
double linearLSB_QIE11_
Definition: HcaluLUTTPGCoder.h:125
HcaluLUTTPGCoder::QIE8_LUT_BITMASK
static const int QIE8_LUT_BITMASK
Definition: HcaluLUTTPGCoder.h:86
HcaluLUTTPGCoder::overrideDBweightsAndFilterHE_
bool overrideDBweightsAndFilterHE_
Definition: HcaluLUTTPGCoder.h:128
HcaluLUTTPGCoder::allLinear_
bool allLinear_
Definition: HcaluLUTTPGCoder.h:121
HcaluLUTTPGCoder::cosh_ieta
double cosh_ieta(int ieta, int depth, HcalSubdetector subdet)
Definition: HcaluLUTTPGCoder.cc:286
gpuClustering::adc
uint16_t *__restrict__ uint16_t const *__restrict__ adc
Definition: gpuClusterChargeCut.h:20
HcaluLUTTPGCoder::QIE10_LUT_BITMASK
static const int QIE10_LUT_BITMASK
Definition: HcaluLUTTPGCoder.h:87
HcaluLUTTPGCoder::nHFEta_
int nHFEta_
Definition: HcaluLUTTPGCoder.h:114
HcaluLUTTPGCoder::QIE11_LUT_MSB1
static const int QIE11_LUT_MSB1
Definition: HcaluLUTTPGCoder.h:102
HcaluLUTTPGCoder::updateXML
void updateXML(const char *filename)
Definition: HcaluLUTTPGCoder.cc:259
HcalTopology
Definition: HcalTopology.h:26
HcaluLUTTPGCoder::sizeHE_
int sizeHE_
Definition: HcaluLUTTPGCoder.h:113
HcaluLUTTPGCoder::Lut
std::vector< LutElement > Lut
Definition: HcaluLUTTPGCoder.h:93
HcaluLUTTPGCoder::compress
void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const override
Definition: HcaluLUTTPGCoder.cc:107
HcaluLUTTPGCoder::INPUT_LUT_SIZE
static const size_t INPUT_LUT_SIZE
Definition: HcaluLUTTPGCoder.h:96
HcaluLUTTPGCoder::lastHBEta_
int lastHBEta_
Definition: HcaluLUTTPGCoder.h:112
HcaluLUTTPGCoder::sizeHB_
int sizeHB_
Definition: HcaluLUTTPGCoder.h:112
HcaluLUTTPGCoder::nFi_
static const int nFi_
Definition: HcaluLUTTPGCoder.h:98
HcaluLUTTPGCoder::maxDepthHE_
int maxDepthHE_
Definition: HcaluLUTTPGCoder.h:113
IntegerCaloSamples
Definition: IntegerCaloSamples.h:16
HcalTimeSlew
Definition: HcalTimeSlew.h:19
HcalQIESample
Definition: HcalQIESample.h:32
HcaluLUTTPGCoder::LUTGenerationMode_
bool LUTGenerationMode_
Definition: HcaluLUTTPGCoder.h:109
HcaluLUTTPGCoder::setOverrideDBweightsAndFilterHB
void setOverrideDBweightsAndFilterHB(bool overrideDBweightsAndFilterHB)
Definition: HcaluLUTTPGCoder.h:72
HcaluLUTTPGCoder::FG_HF_thresholds_
std::vector< uint32_t > FG_HF_thresholds_
Definition: HcaluLUTTPGCoder.h:110
HcalTPGCoder
Definition: HcalTPGCoder.h:26
HcaluLUTTPGCoder::UPGRADE_LUT_SIZE
static const size_t UPGRADE_LUT_SIZE
Definition: HcaluLUTTPGCoder.h:97
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
hcaltpdigi_cff.containPhaseNSHE
containPhaseNSHE
Definition: hcaltpdigi_cff.py:20
HcaluLUTTPGCoder::cosh_ieta_28_HE_low_depths_
double cosh_ieta_28_HE_low_depths_
Definition: HcaluLUTTPGCoder.h:120
HcaluLUTTPGCoder::containPhaseNSHB_
double containPhaseNSHB_
Definition: HcaluLUTTPGCoder.h:123
HcaluLUTTPGCoder::setContainPhaseHE
void setContainPhaseHE(double containPhaseNSHE)
Definition: HcaluLUTTPGCoder.h:71
hcaltpdigi_cff.overrideDBweightsAndFilterHB
overrideDBweightsAndFilterHB
Definition: hcaltpdigi_cff.py:22
HcaluLUTTPGCoder::HcaluLUTTPGCoder
HcaluLUTTPGCoder()
Definition: HcaluLUTTPGCoder.cc:39
HcaluLUTTPGCoder::lsb_
static const float lsb_
Definition: HcaluLUTTPGCoder.h:34
HcaluLUTTPGCoder::setLUTGenerationMode
void setLUTGenerationMode(bool gen)
Definition: HcaluLUTTPGCoder.h:59
HcalNominalCoder.h
HcaluLUTTPGCoder::gain_
std::vector< float > gain_
Definition: HcaluLUTTPGCoder.h:116
HcaluLUTTPGCoder::setOverrideDBweightsAndFilterHE
void setOverrideDBweightsAndFilterHE(bool overrideDBweightsAndFilterHE)
Definition: HcaluLUTTPGCoder.h:75
hcaltpdigi_cff.contain1TSHE
contain1TSHE
Definition: hcaltpdigi_cff.py:19
HcaluLUTTPGCoder::getLUTPedestal
float getLUTPedestal(HcalDetId id) const override
Definition: HcaluLUTTPGCoder.cc:574
HcaluLUTTPGCoder::lastHEEta_
int lastHEEta_
Definition: HcaluLUTTPGCoder.h:113
corrVsCorr.filename
filename
Definition: corrVsCorr.py:123
HcaluLUTTPGCoder::setMaskBit
void setMaskBit(int bit)
Definition: HcaluLUTTPGCoder.h:61
hcaltpdigi_cff.contain1TSHB
contain1TSHB
Definition: hcaltpdigi_cff.py:18
HcaluLUTTPGCoder::lastHFEta_
int lastHFEta_
Definition: HcaluLUTTPGCoder.h:114
gen
Definition: PythiaDecays.h:13
HcaluLUTTPGCoder::nHBEta_
int nHBEta_
Definition: HcaluLUTTPGCoder.h:112
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
HcaluLUTTPGCoder::cosh_ieta_28_HE_high_depths_
double cosh_ieta_28_HE_high_depths_
Definition: HcaluLUTTPGCoder.h:120
hcaltpdigi_cff.overrideDBweightsAndFilterHE
overrideDBweightsAndFilterHE
Definition: hcaltpdigi_cff.py:23
HBHEDataFrame
Definition: HBHEDataFrame.h:14
HcaluLUTTPGCoder::getLUTGain
float getLUTGain(HcalDetId id) const override
Definition: HcaluLUTTPGCoder.cc:579
HcaluLUTTPGCoder::containPhaseNSHE_
double containPhaseNSHE_
Definition: HcaluLUTTPGCoder.h:124
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HcaluLUTTPGCoder::firstHEEta_
int firstHEEta_
Definition: HcaluLUTTPGCoder.h:113
HcalTriggerPrimitiveDigi
Definition: HcalTriggerPrimitiveDigi.h:13
HcaluLUTTPGCoder::linearLSB_QIE11Overlap_
double linearLSB_QIE11Overlap_
Definition: HcaluLUTTPGCoder.h:125
HcaluLUTTPGCoder::linearLSB_QIE8_
double linearLSB_QIE8_
Definition: HcaluLUTTPGCoder.h:125
HcaluLUTTPGCoder
Definition: HcaluLUTTPGCoder.h:32
HcalDetId.h
HcaluLUTTPGCoder::init
void init(const HcalTopology *top, const HcalTimeSlew *delay)
Definition: HcaluLUTTPGCoder.cc:72
HcaluLUTTPGCoder::LutElement
unsigned short LutElement
Definition: HcaluLUTTPGCoder.h:92
HcaluLUTTPGCoder::lookupMSB
void lookupMSB(const HBHEDataFrame &df, std::vector< bool > &msb) const
Definition: HcaluLUTTPGCoder.cc:589
HcalDetId
Definition: HcalDetId.h:12
HFDataFrame
Definition: HFDataFrame.h:14
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HcaluLUTTPGCoder::set1TSContainHB
void set1TSContainHB(bool contain1TSHB)
Definition: HcaluLUTTPGCoder.h:68
HcaluLUTTPGCoder::topo_
const HcalTopology * topo_
Definition: HcaluLUTTPGCoder.h:107
hcaltpdigi_cff.containPhaseNSHB
containPhaseNSHB
Definition: hcaltpdigi_cff.py:21
HcaluLUTTPGCoder::maxDepthHB_
int maxDepthHB_
Definition: HcaluLUTTPGCoder.h:112
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcaluLUTTPGCoder::firstHBEta_
int firstHBEta_
Definition: HcaluLUTTPGCoder.h:112
linear
float linear(float x)
Definition: OccupancyPlotMacros.cc:26
HcaluLUTTPGCoder::QIE11_LUT_BITMASK
static const int QIE11_LUT_BITMASK
Definition: HcaluLUTTPGCoder.h:88
HcalTopology.h
HcaluLUTTPGCoder::getMSB
bool getMSB(const HcalDetId &id, int adc) const
Definition: HcaluLUTTPGCoder.cc:595
HcalDbService
Definition: HcalDbService.h:23
HcaluLUTTPGCoder::cosh_ieta_
std::vector< double > cosh_ieta_
Definition: HcaluLUTTPGCoder.h:118
submitPVValidationJobs.conditions
list conditions
Definition: submitPVValidationJobs.py:674
HcaluLUTTPGCoder::setAllLinear
void setAllLinear(bool linear, double lsb8, double lsb11, double lsb11overlap)
Definition: HcaluLUTTPGCoder.h:62
hgcalPerformanceValidation.df
df
Definition: hgcalPerformanceValidation.py:733
HcaluLUTTPGCoder::overrideDBweightsAndFilterHB_
bool overrideDBweightsAndFilterHB_
Definition: HcaluLUTTPGCoder.h:127
QIE10DataFrame
Definition: QIE10DataFrame.h:11
HcaluLUTTPGCoder::~HcaluLUTTPGCoder
~HcaluLUTTPGCoder() override
Definition: HcaluLUTTPGCoder.cc:113
QIE11DataFrame
Definition: QIE11DataFrame.h:11
HcaluLUTTPGCoder::getLinearizationLUT
std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const override
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
Definition: HcaluLUTTPGCoder.cc:584
HcaluLUTTPGCoder::setContainPhaseHB
void setContainPhaseHB(double containPhaseNSHB)
Definition: HcaluLUTTPGCoder.h:70
HcaluLUTTPGCoder::contain1TSHB_
bool contain1TSHB_
Definition: HcaluLUTTPGCoder.h:122
HcaluLUTTPGCoder::QIE10_LUT_MSB1
static const int QIE10_LUT_MSB1
Definition: HcaluLUTTPGCoder.h:104
HcaluLUTTPGCoder::QIE10_LUT_MSB0
static const int QIE10_LUT_MSB0
Definition: HcaluLUTTPGCoder.h:103
HcaluLUTTPGCoder::make_cosh_ieta_map
void make_cosh_ieta_map(void)
Definition: HcaluLUTTPGCoder.cc:304
HcaluLUTTPGCoder::inputLUT_
std::vector< Lut > inputLUT_
Definition: HcaluLUTTPGCoder.h:115
relval_steps.gen
def gen(fragment, howMuch)
Production test section ####.
Definition: relval_steps.py:506
Ecal07UnpackerData_cfi.ics
ics
Definition: Ecal07UnpackerData_cfi.py:55
HcaluLUTTPGCoder::getLUTId
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
Definition: HcaluLUTTPGCoder.cc:115
HcaluLUTTPGCoder::QIE11_LUT_MSB0
static const int QIE11_LUT_MSB0
Definition: HcaluLUTTPGCoder.h:101
phase2TrackerDigitizer_cfi.delay
delay
Definition: phase2TrackerDigitizer_cfi.py:49
HcaluLUTTPGCoder::firstHFEta_
int firstHFEta_
Definition: HcaluLUTTPGCoder.h:114
HcaluLUTTPGCoder::QIE8_LUT_MSB
static const int QIE8_LUT_MSB
Definition: HcaluLUTTPGCoder.h:100
HcaluLUTTPGCoder::delay_
const HcalTimeSlew * delay_
Definition: HcaluLUTTPGCoder.h:108
HcaluLUTTPGCoder::pulseCorr_
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
Definition: HcaluLUTTPGCoder.h:126
HcaluLUTTPGCoder::adc2Linear
void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
Definition: HcaluLUTTPGCoder.cc:537
HcalTPGCoder.h
HcaluLUTTPGCoder::setFGHFthresholds
void setFGHFthresholds(const std::vector< uint32_t > &fgthresholds)
Definition: HcaluLUTTPGCoder.h:60
HcaluLUTTPGCoder::maxDepthHF_
int maxDepthHF_
Definition: HcaluLUTTPGCoder.h:114