diff --git a/CalibFormats/HcalObjects/interface/HcalChannelCoder.h b/CalibFormats/HcalObjects/interface/HcalChannelCoder.h deleted file mode 100644 index 176081e87ca43..0000000000000 --- a/CalibFormats/HcalObjects/interface/HcalChannelCoder.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef HCAL_CHANNEL_CODER_H -#define HCAL_CHANNEL_CODER_H - -/** \class HcalChannelCoder - - Container for ADC<->fQ conversion constants for HCAL QIE - $Author: ratnikov -*/ - -class QieShape; - -class HcalChannelCoder { - public: - HcalChannelCoder (const float fOffset [16], const float fSlope [16]); // [CapId][Range] - /// ADC[0..127]+capid[0..3]->fC conversion - double charge (const QieShape& fShape, int fAdc, int fCapId) const; - /// fC + capid[0..3] -> ADC conversion - int adc (const QieShape& fShape, double fCharge, int fCapId) const; - int index (int fCapId, int Range) {return fCapId*4+Range;} - private: - double mOffset [4][4]; - double mSlope [4][4]; -}; - -#endif diff --git a/CalibFormats/HcalObjects/interface/HcalDbService.h b/CalibFormats/HcalObjects/interface/HcalDbService.h index 00ee21a236383..56eec28951267 100644 --- a/CalibFormats/HcalObjects/interface/HcalDbService.h +++ b/CalibFormats/HcalObjects/interface/HcalDbService.h @@ -11,8 +11,6 @@ #include #include "DataFormats/HcalDetId/interface/HcalGenericDetId.h" -#include "CalibFormats/HcalObjects/interface/HcalChannelCoder.h" -#include "CalibFormats/HcalObjects/interface/QieShape.h" #include "CalibFormats/HcalObjects/interface/HcalCoder.h" #include "CalibFormats/HcalObjects/interface/HcalCalibrationsSet.h" #include "CalibFormats/HcalObjects/interface/HcalCalibrationWidthsSet.h" diff --git a/CalibFormats/HcalObjects/interface/QieShape.h b/CalibFormats/HcalObjects/interface/QieShape.h deleted file mode 100644 index ef32353dd4eeb..0000000000000 --- a/CalibFormats/HcalObjects/interface/QieShape.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef QIE_SHAPE_H -#define QIE_SHAPE_H - -/** \class QieShape - - basic linearization function for HCAL QIE - $Author: ratnikov -*/ -class QieShape { - public: - QieShape (const double fAdcShape [32], const double fAdcBin [32]); - // center of the nominal linearized QIE bin - double linearization (int fAdc) const {return mLinearization [fAdc];} - // width of the nominal linearized bin - double binSize (int fAdc) const {return mBinSize [fAdc];} - private: - double mLinearization [128]; - double mBinSize [128]; -}; - -#endif diff --git a/CalibFormats/HcalObjects/src/HcalChannelCoder.cc b/CalibFormats/HcalObjects/src/HcalChannelCoder.cc deleted file mode 100644 index f8f83f9f214bb..0000000000000 --- a/CalibFormats/HcalObjects/src/HcalChannelCoder.cc +++ /dev/null @@ -1,52 +0,0 @@ -/** \class HcalChannelCoder - - Container for ADC<->fQ conversion constants for HCAL QIE - $Author: ratnikov -*/ - -#include - -#include "CalibFormats/HcalObjects/interface/HcalChannelCoder.h" -#include "CalibFormats/HcalObjects/interface/QieShape.h" - -HcalChannelCoder::HcalChannelCoder (const float fOffset [16], const float fSlope [16]) { // [CapId][Range] - for (int range = 0; range < 4; range++) { - for (int capId = 0; capId < 4; capId++) { - mOffset [capId][range] = fOffset [index (capId, range)]; - mSlope [capId][range] = fSlope [index (capId, range)]; - } - } -} - -double HcalChannelCoder::charge (const QieShape& fShape, int fAdc, int fCapId) const { - int range = (fAdc >> 6) & 0x3; - double charge = fShape.linearization (fAdc) / mSlope [fCapId][range] + mOffset [fCapId][range]; -// std::cout << "HcalChannelCoder::charge-> " << fAdc << '/' << fCapId -// << " result: " << charge << std::endl; - return charge; -} - -int HcalChannelCoder::adc (const QieShape& fShape, double fCharge, int fCapId) const { - - int adc = -1; //nothing found yet - // search for the range - for (int range = 0; range < 4; range++) { - double qieCharge = (fCharge - mOffset [fCapId][range]) * mSlope [fCapId][range]; - double qieChargeMax = fShape.linearization (32*range+31) + 0.5 * fShape.binSize (32*range+31); - if (range == 3 && qieCharge > qieChargeMax) adc = 127; // overflow - if (qieCharge > qieChargeMax) continue; // next range - for (int bin = 32*range; bin < 32*(range+1); bin++) { - if (qieCharge < fShape.linearization (bin) + 0.5 * fShape.binSize (bin)) { - adc = bin; - break; - } - } - if (adc >= 0) break; // found - } - if (adc < 0) adc = 0; // underflow - -// std::cout << "HcalChannelCoder::adc-> " << fCharge << '/' << fCapId -// << " result: " << adc << std::endl; - return adc; -} - diff --git a/CalibFormats/HcalObjects/src/QieShape.cc b/CalibFormats/HcalObjects/src/QieShape.cc deleted file mode 100644 index 55bb232767ff3..0000000000000 --- a/CalibFormats/HcalObjects/src/QieShape.cc +++ /dev/null @@ -1,28 +0,0 @@ -/** \class QieShape - - basic linearization function for HCAL QIE - $Author: ratnikov -*/ - -#include - -#include "CalibFormats/HcalObjects/interface/QieShape.h" - -QieShape::QieShape (const double fAdcShape [32], const double fAdcBin [32]) { - for (int i = 0; i < 32; i++) { // initial settings - mLinearization [i] = fAdcShape [i]; - mBinSize [i] = fAdcBin [i]; - // std::cout << "QieShape::QieShape-> #/adc/bin: " << i << '/' << fAdcShape [i] << '/' << fAdcBin [i] << std::endl; - } - double factor = 1; - for (int range = 1; range < 4; range++) { - factor = factor * 5; - int offset = 32 * range; - mLinearization [offset] = mLinearization[offset-2]; // initial overlap - for (int bin = 1; bin < 32; bin++) { - mLinearization [offset+bin] = mLinearization [offset+bin-1] + - factor * (mLinearization [bin] - mLinearization [bin-1]); // scale initial curve - mBinSize [offset+bin] = factor * mBinSize [bin]; - } - } -}