00001 #ifndef DIGIHCAL_HCALUpgradeDATAFRAME_H 00002 #define DIGIHCAL_HCALUpgradeDATAFRAME_H 00003 00004 #include <vector> 00005 #include <ostream> 00006 #include "DataFormats/HcalDetId/interface/HcalDetId.h" 00007 00008 00014 class HcalUpgradeDataFrame { 00015 public: 00016 typedef HcalDetId key_type; 00017 00018 HcalUpgradeDataFrame(); 00019 HcalUpgradeDataFrame(HcalDetId id, int capId, int samples, int presamples) ; 00020 00021 const HcalDetId& id() const { return id_; } 00022 00023 int size() const { return size_ ; } 00024 int presamples() const { return presamples_ ; } 00025 int startingCapId() const { return capId_ ; } 00026 int capId(int iSample=0) const { return (capId_+iSample)%4; } 00027 00028 bool valid(int iSample=0) const { return dv_[iSample] ; } 00029 uint16_t adc(int iSample=0) const { return adc_[iSample] ; } 00030 uint8_t tdc(int iSample=0) const { return tdc_[iSample] ; } 00031 00032 void setSize(int size) ; 00033 void setPresamples(int presamples) ; 00034 void setStartingCapId(int capId) { capId_ = capId ; } 00035 void setSample(int relSample, const uint16_t adc, const uint8_t tdc, const bool dv) ; 00036 00037 static const int MAXSAMPLES = 10 ; 00038 private: 00039 HcalDetId id_; 00040 int capId_ ; 00041 int size_, presamples_ ; 00042 bool dv_[MAXSAMPLES] ; 00043 uint16_t adc_[MAXSAMPLES]; 00044 uint8_t tdc_[MAXSAMPLES] ; 00045 }; 00046 00047 std::ostream& operator<<(std::ostream&, const HcalUpgradeDataFrame&) ; 00048 00049 #include "DataFormats/Common/interface/SortedCollection.h" 00050 typedef edm::SortedCollection<HcalUpgradeDataFrame> HcalUpgradeDigiCollection; 00051 00052 00053 #endif