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); } 00034 uint32_t zsCrossingMask() const { return (hcalPresamples_&0x3FF000)>>12; } 00035 00037 const HcalQIESample& operator[](int i) const { return data_[i]; } 00039 const HcalQIESample& sample(int i) const { return data_[i]; } 00040 00042 int fiberIdleOffset() const; 00043 00045 bool validate(int firstSample=0, int nSamples=100) const; 00046 00047 void setSize(int size); 00048 void setPresamples(int ps); 00049 void setZSInfo(bool unsuppressed, bool markAndPass, uint32_t crossingMask=0); 00050 void setSample(int i, const HcalQIESample& sam) { data_[i]=sam; } 00051 void setReadoutIds(const HcalElectronicsId& eid); 00052 void setFiberIdleOffset(int offset); 00053 00054 static const int MAXSAMPLES = 10; 00055 private: 00056 HcalZDCDetId id_; 00057 HcalElectronicsId electronicsId_; 00058 int size_; 00059 int hcalPresamples_; // also contains information about ZS MarkAndPass 00060 HcalQIESample data_[MAXSAMPLES]; 00061 }; 00062 00063 std::ostream& operator<<(std::ostream&, const ZDCDataFrame&); 00064 00065 #endif