File indexing completed on 2024-04-06 12:04:17
0001 #ifndef DIGIHCAL_CASTORDATAFRAME_H
0002 #define DIGIHCAL_CASTORDATAFRAME_H
0003
0004 #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h"
0005 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
0006 #include "DataFormats/HcalDigi/interface/HcalQIESample.h"
0007 #include <vector>
0008 #include <ostream>
0009
0010
0011
0012
0013
0014
0015 class CastorDataFrame {
0016 public:
0017 typedef HcalCastorDetId key_type;
0018
0019 CastorDataFrame();
0020 explicit CastorDataFrame(const HcalCastorDetId& id);
0021
0022 const HcalCastorDetId& id() const { return id_; }
0023
0024
0025
0026 int size() const { return size_ & 0xF; }
0027
0028 int presamples() const { return hcalPresamples_ & 0xF; }
0029
0030 bool zsMarkAndPass() const { return (hcalPresamples_ & 0x10); }
0031
0032 bool zsUnsuppressed() const { return (hcalPresamples_ & 0x20); }
0033
0034 uint32_t zsCrossingMask() const { return (hcalPresamples_ & 0x3FF000) >> 12; }
0035
0036
0037 const HcalQIESample& operator[](int i) const { return data_[i]; }
0038
0039 const HcalQIESample& sample(int i) const { return data_[i]; }
0040
0041 int fiberIdleOffset() const;
0042
0043
0044 bool validate(int firstSample = 0, int nSamples = 100) const;
0045
0046 void setSize(int size);
0047 void setPresamples(int ps);
0048 void setZSInfo(bool unsuppressed, bool markAndPass, uint32_t crossingMask = 0);
0049 void setSample(int i, const HcalQIESample& sam) { data_[i] = sam; }
0050 void setFiberIdleOffset(int offset);
0051
0052
0053
0054 static const int MAXSAMPLES = 10;
0055
0056 private:
0057 HcalCastorDetId id_;
0058
0059 int size_;
0060 int hcalPresamples_;
0061 HcalQIESample data_[MAXSAMPLES];
0062 };
0063
0064 std::ostream& operator<<(std::ostream&, const CastorDataFrame&);
0065
0066 #endif