CMS 3D CMS Logo

HODataFrame.h
Go to the documentation of this file.
1 #ifndef DIGIHCAL_HODATAFRAME_H
2 #define DIGIHCAL_HODATAFRAME_H
3 
7 #include <vector>
8 #include <ostream>
9 
10 
16 class HODataFrame {
17 public:
18  typedef HcalDetId key_type;
19 
20  HODataFrame(); // for persistence
21  explicit HODataFrame(const HcalDetId& id);
22 
23  const HcalDetId& id() const { return id_; }
24  const HcalElectronicsId& elecId() const { return electronicsId_; }
25 
27  int size() const { return size_&0xF; }
29  int presamples() const { return hcalPresamples_&0xF; }
31  bool zsMarkAndPass() const { return (hcalPresamples_&0x10); }
33  bool zsUnsuppressed() const { return (hcalPresamples_&0x20); }
35  uint32_t zsCrossingMask() const { return (hcalPresamples_&0x3FF000)>>12; }
36 
38  const HcalQIESample& operator[](int i) const { return data_[i]; }
40  const HcalQIESample& sample(int i) const { return data_[i]; }
41 
43  int fiberIdleOffset() const;
44 
46  bool validate(int firstSample=0, int nSamples=100) const;
47 
48  void setSize(int size);
49  void setPresamples(int ps);
50  void setZSInfo(bool unsuppressed, bool markAndPass, uint32_t crossingMask=0);
51  void setSample(int i, const HcalQIESample& sam) { data_[i]=sam; }
52  void setReadoutIds(const HcalElectronicsId& eid);
53  void setFiberIdleOffset(int offset);
54 
55  static const int MAXSAMPLES = 10;
56 private:
59  int size_;
62 };
63 
64 std::ostream& operator<<(std::ostream&, const HODataFrame&);
65 
66 
67 #endif
void setSize(int size)
Definition: HODataFrame.cc:18
HcalElectronicsId electronicsId_
Definition: HODataFrame.h:58
int fiberIdleOffset() const
offset of bunch number for this channel relative to nominal set in the unpacker (range is +7->-7...
Definition: HODataFrame.cc:50
bool zsUnsuppressed() const
was ZS unsuppressed?
Definition: HODataFrame.h:33
const HcalQIESample & sample(int i) const
access a sample
Definition: HODataFrame.h:40
const HcalElectronicsId & elecId() const
Definition: HODataFrame.h:24
const HcalDetId & id() const
Definition: HODataFrame.h:23
void setFiberIdleOffset(int offset)
Definition: HODataFrame.cc:55
static const int MAXSAMPLES
Definition: HODataFrame.h:55
bool zsMarkAndPass() const
was ZS MarkAndPass?
Definition: HODataFrame.h:31
void setSample(int i, const HcalQIESample &sam)
Definition: HODataFrame.h:51
int size() const
total number of samples in the digi
Definition: HODataFrame.h:27
std::ostream & operator<<(std::ostream &, const HODataFrame &)
Definition: HODataFrame.cc:63
constexpr size_t nSamples
HcalQIESample data_[MAXSAMPLES]
Definition: HODataFrame.h:61
HcalDetId id_
Definition: HODataFrame.h:57
bool validate(int firstSample=0, int nSamples=100) const
validate appropriate DV and ER bits as well as capid rotation for the specified samples (default is a...
Definition: HODataFrame.cc:30
void setZSInfo(bool unsuppressed, bool markAndPass, uint32_t crossingMask=0)
Definition: HODataFrame.cc:42
int hcalPresamples_
Definition: HODataFrame.h:60
uint32_t zsCrossingMask() const
zs crossing mask (which sums considered)
Definition: HODataFrame.h:35
void setReadoutIds(const HcalElectronicsId &eid)
Definition: HODataFrame.cc:26
Readout chain identification for Hcal.
const HcalQIESample & operator[](int i) const
access a sample
Definition: HODataFrame.h:38
void setPresamples(int ps)
Definition: HODataFrame.cc:23
int presamples() const
number of samples before the sample from the triggered beam crossing (according to the hardware) ...
Definition: HODataFrame.h:29
HcalDetId key_type
For the sorted collection.
Definition: HODataFrame.h:18