Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:20

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