00001 #ifndef CALIBFORMATS_CALOTPG_CALOTPGTRANSCODER_H 00002 #define CALIBFORMATS_CALOTPG_CALOTPGTRANSCODER_H 1 00003 00004 #include <boost/shared_ptr.hpp> 00005 #include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h" 00006 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h" 00007 #include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveSample.h" 00008 #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveSample.h" 00009 00010 class HcalTPGCompressor; 00011 class EcalTPGCompressor; 00012 00013 namespace edm { 00014 class EventSetup; 00015 } 00016 00026 class CaloTPGTranscoder { 00027 public: 00028 CaloTPGTranscoder(); 00029 virtual ~CaloTPGTranscoder(); 00030 00031 enum Mode { All=0, RCT=1, HcalTPG=2, EcalTPG=3 }; 00033 virtual void setup(const edm::EventSetup& es, Mode mode=All) const; 00035 virtual void releaseSetup() const; 00037 virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const = 0; 00039 virtual EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId& id, unsigned int sample, bool fineGrain) const = 0; 00041 virtual void rctEGammaUncompress(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc, 00042 const EcalTrigTowerDetId& eid, const EcalTriggerPrimitiveSample& ec, 00043 unsigned int& et, bool& egVeto, bool& activity) const = 0; 00045 virtual void rctJetUncompress(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc, 00046 const EcalTrigTowerDetId& eid, const EcalTriggerPrimitiveSample& ec, 00047 unsigned int& et) const = 0; 00048 00049 virtual double hcaletValue(const int& ieta, const int& compET) const = 0; 00050 00051 00052 boost::shared_ptr<HcalTPGCompressor> getHcalCompressor() const { return hccompress_; } 00053 boost::shared_ptr<EcalTPGCompressor> getEcalCompressor() const { return eccompress_; } 00054 private: 00055 boost::shared_ptr<HcalTPGCompressor> hccompress_; 00056 boost::shared_ptr<EcalTPGCompressor> eccompress_; 00057 }; 00058 00059 #endif