CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/DataFormats/HcalDigi/interface/HODataFrame.h

Go to the documentation of this file.
00001 #ifndef DIGIHCAL_HODATAFRAME_H
00002 #define DIGIHCAL_HODATAFRAME_H
00003 
00004 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00005 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
00006 #include "DataFormats/HcalDigi/interface/HcalQIESample.h"
00007 #include <vector>
00008 #include <ostream>
00009 
00010 
00016 class HODataFrame {
00017 public:
00018   typedef HcalDetId key_type; 
00019 
00020   HODataFrame(); // for persistence
00021   explicit HODataFrame(const HcalDetId& id);
00022   
00023   const HcalDetId& id() const { return id_; }
00024   const HcalElectronicsId& elecId() const { return electronicsId_; }
00025   
00027   int size() const { return size_&0xF; }
00029   int presamples() const { return hcalPresamples_&0xF; }
00031   bool zsMarkAndPass() const { return (hcalPresamples_&0x10); }
00033   bool zsUnsuppressed() const { return (hcalPresamples_&0x20); }
00035   uint32_t zsCrossingMask() const { return (hcalPresamples_&0x3FF000)>>12; }
00036  
00038   const HcalQIESample& operator[](int i) const { return data_[i]; }
00040   const HcalQIESample& sample(int i) const { return data_[i]; }
00041  
00043   int fiberIdleOffset() const;
00044  
00046   bool validate(int firstSample=0, int nSamples=100) const;
00047   
00048   void setSize(int size);
00049   void setPresamples(int ps);
00050   void setZSInfo(bool unsuppressed, bool markAndPass, uint32_t crossingMask=0);
00051   void setSample(int i, const HcalQIESample& sam) { data_[i]=sam; }
00052   void setReadoutIds(const HcalElectronicsId& eid);
00053   void setFiberIdleOffset(int offset);
00054   
00055   static const int MAXSAMPLES = 10;
00056 private:
00057   HcalDetId id_;
00058   HcalElectronicsId electronicsId_; 
00059   int size_;
00060   int hcalPresamples_;
00061   HcalQIESample data_[MAXSAMPLES];
00062 };
00063 
00064 std::ostream& operator<<(std::ostream&, const HODataFrame&);
00065 
00066 
00067 #endif