Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CALIBFORMATS_CASTOROBJECTS_CASTORTPGCODER_H
0002 #define CALIBFORMATS_CASTOROBJECTS_CASTORTPGCODER_H 1
0003 
0004 #include "CalibFormats/CaloObjects/interface/IntegerCaloSamples.h"
0005 #include "DataFormats/HcalDigi/interface/CastorDataFrame.h"
0006 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0007 
0008 // forward declaration of EventSetup is all that is needed here
0009 namespace edm {
0010   class EventSetup;
0011 }
0012 
0013 /** \class CastorTPGCoder
0014   *  
0015   * Converts ADC to linear E or ET for use in the TPG path
0016   * Also compresses linear scale for transmission to RCT
0017   * 
0018   * Note : whether the coder produces E or ET is determined by the specific
0019   * implementation of the coder.
0020   *
0021   * \author J. Mans - Minnesota
0022   */
0023 class CastorTPGCoder {
0024 public:
0025   virtual ~CastorTPGCoder() = default;
0026   //  virtual void adc2Linear(const CastorDataFrame& df, IntegerCaloSamples& ics) const = 0;
0027 
0028   virtual unsigned short adc2Linear(HcalQIESample sample, HcalDetId id) const = 0;
0029   unsigned short adc2Linear(unsigned char adc, HcalDetId id) const {
0030     return adc2Linear(HcalQIESample(adc, 0, 0, 0), id);
0031   }
0032   virtual float getLUTPedestal(HcalDetId id) const = 0;
0033   virtual float getLUTGain(HcalDetId id) const = 0;
0034   /** \brief Get the full linearization LUT (128 elements).
0035       Default implementation just uses adc2Linear to get all values
0036   */
0037   virtual std::vector<unsigned short> getLinearizationLUT(HcalDetId id) const;
0038 };
0039 
0040 #endif