98 inputLUT_ = std::vector<HcaluLUTTPGCoder::Lut>(nluts);
99 gain_ = std::vector<float>(nluts, 0.);
100 ped_ = std::vector<float>(nluts, 0.);
105 const std::vector<bool>& featureBits,
107 throw cms::Exception(
"PROBLEM: This method should never be invoked!");
149 assert(file.is_open());
151 std::vector<HcalSubdetector> subdet;
155 std::getline(file, buffer);
156 std::getline(file, buffer);
158 unsigned int index = buffer.find(
"H", 0);
159 while (index < buffer.length()) {
161 if (subdetStr ==
"HB")
163 else if (subdetStr ==
"HE")
165 else if (subdetStr ==
"HF")
170 index = buffer.find(
"H", index);
174 size_t nCol = subdet.size();
177 std::vector<int> ietaU;
178 std::vector<int> ietaL;
179 std::vector<int> iphiU;
180 std::vector<int> iphiL;
181 std::vector<int> depU;
182 std::vector<int> depL;
183 std::vector<Lut> lutFromFile(nCol);
186 for (
size_t i = 0;
i < nCol; ++
i) {
189 ietaL.push_back(ieta);
192 for (
size_t i = 0;
i < nCol; ++
i) {
195 ietaU.push_back(ieta);
198 for (
size_t i = 0;
i < nCol; ++
i) {
201 iphiL.push_back(iphi);
204 for (
size_t i = 0;
i < nCol; ++
i) {
207 iphiU.push_back(iphi);
210 for (
size_t i = 0;
i < nCol; ++
i) {
216 for (
size_t i = 0;
i < nCol; ++
i) {
223 for (
size_t i = 0; file >> lutValue;
i = (
i + 1) % nCol) {
224 lutFromFile[
i].push_back(lutValue);
228 for (
size_t i = 0;
i < nCol; ++
i)
231 for (
size_t i = 0;
i < nCol; ++
i) {
263 for (
int isub = 0; isub < 3; ++isub) {
268 std::vector<unsigned int>* lut = _xml->
getLutFast(detid);
270 throw cms::Exception(
"PROBLEM: No inputLUT_ in xml file for ") << detid << std::endl;
272 throw cms::Exception(
"PROBLEM: Wrong inputLUT_ size in xml file for ") << detid << std::endl;
290 if (
abs(ieta) == 28) {
307 double eta_low = 0., eta_high = 0.;
313 double eta1 = etas.first;
314 double eta2 = etas.second;
330 assert(metadata !=
nullptr);
352 unsigned int mipMax = 0;
353 unsigned int mipMin = 0;
371 for (
auto capId : {0, 1, 2, 3}) {
394 auto adc2fC = [channelCoder, shape](
unsigned int adc) {
396 for (
auto capId : {0, 1, 2, 3})
397 fC += channelCoder->
charge(*shape,
adc, capId);
408 else if (qieType ==
QIE11)
422 double nonlinearityCorrection = 1.0;
423 double containmentCorrection2TSCorrected = 1.0;
428 double containmentCorrection1TS =
pulseCorr_->correction(cell, 1, correctionPhaseNS,
adc2fC(
adc));
431 double correctedCharge = containmentCorrection1TS *
adc2fC(
adc);
432 containmentCorrection2TSCorrected =
pulseCorr_->correction(cell, 2, correctionPhaseNS, correctedCharge);
433 if (qieType ==
QIE11) {
437 const double fcByPE = siPMParameter.getFCByPE();
438 const double effectivePixelsFired = correctedCharge / fcByPE;
439 nonlinearityCorrection = corr.getRecoCorrectionFactor(effectivePixelsFired);
444 int((
adc2fC(
adc) - ped) * gain * rcalib * nonlinearityCorrection *
445 containmentCorrection2TSCorrected / linearLSB /
451 int((
adc2fC(
adc) - ped) * gain * rcalib * nonlinearityCorrection *
452 containmentCorrection2TSCorrected / nominalgain_ / granularity)),
455 if (qieType ==
QIE11) {
456 if (
adc >= mipMin and
adc < mipMax)
458 else if (
adc >= mipMax)
483 for (
int i = 0;
i < df.
size();
i++) {
491 for (
int i = 0;
i < df.
size();
i++) {
519 return ped_.at(lutId);
524 return gain_.at(lutId);
533 msb.resize(df.
size());
534 for (
int i = 0;
i < df.
size(); ++
i)
std::vector< uint32_t > FG_HF_thresholds_
int samples() const
total number of samples in the digi
float getPedestal() const
void adc2Linear(const HBHEDataFrame &df, IntegerCaloSamples &ics) const override
const HcalDDDRecConstants * dddConstants() const
double cosh_ieta_28_HE_high_depths_
HcalSubdetector subdet() const
get the subdetector
const HcalTPChannelParameter * getHcalTPChannelParameter(const HcalGenericDetId &fId) const
bool valid(const DetId &id) const override
double linearLSB_QIE11Overlap_
static uint32_t kHcalEtaMask2
const HcalRecoParam * getHcalRecoParam(const HcalGenericDetId &fId) const
static const int QIE11_LUT_MSB1
static const int QIE11_LUT_BITMASK
const HcalChannelStatus * getHcalChannelStatus(const HcalGenericDetId &fId) const
float getLUTGain(HcalDetId id) const override
int size() const
total number of samples in the digi
const HcalTopology * topo_
edm::DataFrame::id_type id() const
static const int QIE11_LUT_MSB0
void towerEtaBounds(int ieta, int version, double &eta1, double &eta2) const
where this tower begins and ends in eta
const Item * getValues(DetId fId, bool throwOnFail=true) const
double cosh_ieta_28_HE_low_depths_
void init(const HcalTopology *top, const HcalTimeSlew *delay)
static const int QIE8_LUT_BITMASK
HcalTopologyMode::TriggerMode triggerMode() const
unsigned short LutElement
void update(const HcalDbService &conditions)
void updateXML(const char *filename)
static const int QIE10_LUT_MSB0
static const size_t UPGRADE_LUT_SIZE
int depth() const
get the tower depth
std::vector< Lut > inputLUT_
void lookupMSB(const HBHEDataFrame &df, std::vector< bool > &msb) const
int getLUTId(HcalSubdetector id, int ieta, int iphi, int depth) const
float getRespGain() const
double MaximumFractionalError
HcalDetId const & id() const
std::vector< DetId > getAllChannels() const
constexpr float correctionPhaseNS() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
static uint32_t kHcalDepthMask2
const HcalTimeSlew * delay_
const HcalL1TriggerObject * getHcalL1TriggerObject(const HcalGenericDetId &fId) const
constexpr double effpedestal(int fCapId) const
get effective pedestal for capid=0..3
int ieta() const
get the cell ieta
edm::DataFrame::id_type id() const
Abs< T >::type abs(const T &t)
const HcalLutMetadata * getHcalLutMetadata() const
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
static const int QIE8_LUT_MSB
constexpr int adc() const
get the ADC sample
static const int QIE10_LUT_BITMASK
int ietaAbs() const
get the absolute value of the cell ieta
const HcalQIEType * getHcalQIEType(const HcalGenericDetId &fId) const
std::vector< double > cosh_ieta_
int iphi() const
get the cell iphi
std::vector< float > ped_
double cosh_ieta(int ieta, int depth, HcalSubdetector subdet)
std::vector< float > gain_
int size() const
total number of samples in the digi
HcalQIESample const & sample(int i) const
access a sample
static uint32_t kHcalPhiMask2
~HcaluLUTTPGCoder() override
constexpr double LUTrespcorrgain(int fCapId) const
get LUT corrected and response corrected gain for capid=0..3
const HcalSiPMCharacteristics * getHcalSiPMCharacteristics() const
const HcalQIECoder * getHcalCoder(const HcalGenericDetId &fId) const
std::vector< float > getNonLinearities(int type) const
get nonlinearity constants
const HcalQIEShape * getHcalShape(const HcalGenericDetId &fId) const
std::vector< unsigned int > * getLutFast(uint32_t det_id)
static const size_t INPUT_LUT_SIZE
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
bool getMSB(const HcalDetId &id, int adc) const
float getLUTPedestal(HcalDetId id) const override
uint32_t getFGBitInfo() const
get FG bit information
const HcalDetId & id() const
bool isPlan1(const HcalDetId &id) const
void make_cosh_ieta_map(void)
uint32_t getValue() const
const HcalCalibrations & getHcalCalibrations(const HcalGenericDetId &fId) const
int samples() const
total number of samples in the digi
std::unique_ptr< HcalPulseContainmentManager > pulseCorr_
const HcalSiPMParameter * getHcalSiPMParameter(const HcalGenericDetId &fId) const
static const int QIE10_LUT_MSB1
static XMLProcessor * getInstance()
void compress(const IntegerCaloSamples &ics, const std::vector< bool > &featureBits, HcalTriggerPrimitiveDigi &tp) const override
std::vector< unsigned short > getLinearizationLUT(HcalDetId id) const override
Get the full linearization LUT (128 elements). Default implementation just uses adc2Linear to get all...
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.