Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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