00001 #ifndef DIGIHCAL_ZDCDATAFRAME_H 00002 #define DIGIHCAL_ZDCDATAFRAME_H 00003 00004 #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h" 00005 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h" 00006 #include "DataFormats/HcalDigi/interface/HcalQIESample.h" 00007 #include <vector> 00008 #include <ostream> 00009 00015 class ZDCDataFrame { 00016 public: 00017 typedef HcalZDCDetId key_type; 00018 00019 ZDCDataFrame(); // for persistence 00020 explicit ZDCDataFrame(const HcalZDCDetId& id); 00021 00022 const HcalZDCDetId& id() const { return id_; } 00023 const HcalElectronicsId& elecId() const { return electronicsId_; } 00024 00026 int size() const { return size_&0xF; } 00028 int presamples() const { return hcalPresamples_&0xF; } 00030 bool zsMarkAndPass() const { return (hcalPresamples_&0x10); } 00032 bool zsUnsuppressed() const { return (hcalPresamples_&0x20); } 00033 00035 const HcalQIESample& operator[](int i) const { return data_[i]; } 00037 const HcalQIESample& sample(int i) const { return data_[i]; } 00038 00040 bool validate(int firstSample=0, int nSamples=100) const; 00041 00042 void setSize(int size); 00043 void setPresamples(int ps); 00044 void setZSInfo(bool unsuppressed, bool markAndPass); 00045 void setSample(int i, const HcalQIESample& sam) { data_[i]=sam; } 00046 void setReadoutIds(const HcalElectronicsId& eid); 00047 00048 static const int MAXSAMPLES = 10; 00049 private: 00050 HcalZDCDetId id_; 00051 HcalElectronicsId electronicsId_; 00052 int size_; 00053 int hcalPresamples_; // also contains information about ZS MarkAndPass 00054 HcalQIESample data_[MAXSAMPLES]; 00055 }; 00056 00057 std::ostream& operator<<(std::ostream&, const ZDCDataFrame&); 00058 00059 #endif