00001 #ifndef DIGIHCAL_CASTORDATAFRAME_H 00002 #define DIGIHCAL_CASTORDATAFRAME_H 00003 00004 #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h" 00005 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h" 00006 #include "DataFormats/HcalDigi/interface/HcalQIESample.h" 00007 #include <vector> 00008 #include <ostream> 00009 00015 class CastorDataFrame { 00016 public: 00017 typedef HcalCastorDetId key_type; 00018 00019 CastorDataFrame(); // for persistence 00020 explicit CastorDataFrame(const HcalCastorDetId& id); 00021 00022 const HcalCastorDetId& id() const { return id_; } 00023 // ElecId not yet specified 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]; } 00041 int fiberIdleOffset() const; 00042 00044 bool validate(int firstSample=0, int nSamples=100) const; 00045 00046 void setSize(int size); 00047 void setPresamples(int ps); 00048 void setZSInfo(bool unsuppressed, bool markAndPass, uint32_t crossingMask=0); 00049 void setSample(int i, const HcalQIESample& sam) { data_[i]=sam; } 00050 void setFiberIdleOffset(int offset); 00051 00052 // ElecId not yet specified void setReadoutIds(const HcalElectronicsId& eid); 00053 00054 static const int MAXSAMPLES = 10; 00055 private: 00056 HcalCastorDetId id_; 00057 // ElecId not yet specified HcalElectronicsId electronicsId_; 00058 int size_; 00059 int hcalPresamples_; 00060 HcalQIESample data_[MAXSAMPLES]; 00061 }; 00062 00063 std::ostream& operator<<(std::ostream&, const CastorDataFrame&); 00064 00065 #endif