Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:11

0001 #ifndef CASTOR_CHANNEL_CODER_H
0002 #define CASTOR_CHANNEL_CODER_H
0003 
0004 /** \class CastorChannelCoder
0005     
0006     Container for ADC<->fQ conversion constants for HCAL/Castor QIE
0007 
0008 */
0009 
0010 namespace reco {
0011   namespace castor {
0012     class QieShape;
0013   }
0014 }  // namespace reco
0015 
0016 class CastorChannelCoder {
0017 public:
0018   CastorChannelCoder(const float fOffset[16], const float fSlope[16]);  // [CapId][Range]
0019   /// ADC[0..127]+capid[0..3]->fC conversion
0020   double charge(const reco::castor::QieShape& fShape, int fAdc, int fCapId) const;
0021   /// fC + capid[0..3] -> ADC conversion
0022   int adc(const reco::castor::QieShape& fShape, double fCharge, int fCapId) const;
0023   int index(int fCapId, int Range) { return fCapId * 4 + Range; }
0024 
0025 private:
0026   double mOffset[4][4];
0027   double mSlope[4][4];
0028 };
0029 
0030 #endif