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