CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/DataFormats/HcalDigi/interface/HcalCalibDataFrame.h

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