File indexing completed on 2024-04-06 11:58:11
0001 #ifndef CALIBFORMATS_CALOTPG_CALOTPGTRANSCODER_H
0002 #define CALIBFORMATS_CALOTPG_CALOTPGTRANSCODER_H 1
0003
0004 #include "DataFormats/HcalDetId/interface/HcalTrigTowerDetId.h"
0005 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
0006 #include "DataFormats/HcalDigi/interface/HcalTriggerPrimitiveSample.h"
0007 #include "DataFormats/EcalDigi/interface/EcalTriggerPrimitiveSample.h"
0008 #include <memory>
0009
0010 class HcalTPGCompressor;
0011 class EcalTPGCompressor;
0012
0013 namespace edm {
0014 class EventSetup;
0015 }
0016
0017
0018
0019
0020
0021
0022
0023
0024 class CaloTPGTranscoder {
0025 public:
0026 CaloTPGTranscoder();
0027 virtual ~CaloTPGTranscoder();
0028
0029 enum Mode { All = 0, RCT = 1, HcalTPG = 2, EcalTPG = 3 };
0030
0031 virtual HcalTriggerPrimitiveSample hcalCompress(const HcalTrigTowerDetId& id,
0032 unsigned int sample,
0033 int fineGrain) const = 0;
0034
0035 virtual EcalTriggerPrimitiveSample ecalCompress(const EcalTrigTowerDetId& id,
0036 unsigned int sample,
0037 bool fineGrain) const = 0;
0038
0039 virtual void rctEGammaUncompress(const HcalTrigTowerDetId& hid,
0040 const HcalTriggerPrimitiveSample& hc,
0041 const EcalTrigTowerDetId& eid,
0042 const EcalTriggerPrimitiveSample& ec,
0043 unsigned int& et,
0044 bool& egVeto,
0045 bool& activity) const = 0;
0046
0047 virtual void rctJetUncompress(const HcalTrigTowerDetId& hid,
0048 const HcalTriggerPrimitiveSample& hc,
0049 const EcalTrigTowerDetId& eid,
0050 const EcalTriggerPrimitiveSample& ec,
0051 unsigned int& et) const = 0;
0052
0053 virtual double hcaletValue(const int& ieta, const int& iphi, const int& version, const int& compressedValue) const = 0;
0054 virtual double hcaletValue(const HcalTrigTowerDetId& hid, const HcalTriggerPrimitiveSample& hc) const = 0;
0055 std::shared_ptr<const HcalTPGCompressor> getHcalCompressor() const { return hccompress_; }
0056 std::shared_ptr<const EcalTPGCompressor> getEcalCompressor() const { return eccompress_; }
0057
0058 private:
0059 std::shared_ptr<const HcalTPGCompressor> hccompress_;
0060 std::shared_ptr<const EcalTPGCompressor> eccompress_;
0061 };
0062
0063 #endif