CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/DataFormats/HcalDigi/interface/HBHEDataFrame.h

Go to the documentation of this file.
00001 #ifndef DIGIHCAL_HBHEDATAFRAME_H
00002 #define DIGIHCAL_HBHEDATAFRAME_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 
00015 class HBHEDataFrame {
00016 public:
00017   typedef HcalDetId key_type; 
00018 
00019   HBHEDataFrame(); // for persistence
00020   explicit HBHEDataFrame(const HcalDetId& id);
00021   
00022   const HcalDetId& 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   HcalDetId id_;
00057   HcalElectronicsId electronicsId_; 
00058   int size_;
00059   int hcalPresamples_;
00060   HcalQIESample data_[MAXSAMPLES];    
00061 };
00062 
00063 std::ostream& operator<<(std::ostream&, const HBHEDataFrame&);
00064 
00065 
00066 #endif