CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/TBDataFormats/EcalTBObjects/interface/EcalTBHodoscopeRawInfo.h

Go to the documentation of this file.
00001 #ifndef DIGIECAL_ECALTBHODOSCOPERAWINFO_H
00002 #define DIGIECAL_ECALTBHODOSCOPERAWINFO_H 1
00003 
00004 
00005 #include <ostream>
00006 #include <boost/cstdint.hpp>
00007 
00014 #include "TBDataFormats/EcalTBObjects/interface/EcalTBHodoscopePlaneRawHits.h"
00015 
00016 class EcalTBHodoscopeRawInfo {
00017  public:
00018   EcalTBHodoscopeRawInfo() : planeHits_(0) {};
00019 
00020   EcalTBHodoscopeRawInfo(unsigned int planes) 
00021     {
00022       planeHits_.reserve(planes);
00023       for (unsigned int i=0;i<planes;i++)
00024         planeHits_[i]=0;
00025     }
00026   
00028   unsigned int planes() const { return planeHits_.size(); } 
00029   unsigned int channels(unsigned int plane) const { return planeHits_[plane].channels(); }
00030   const std::vector<bool>& hits(unsigned int plane) const { return planeHits_[plane].hits(); }
00031   const EcalTBHodoscopePlaneRawHits& getPlaneRawHits(unsigned int i) const { return planeHits_[i]; }
00032   const EcalTBHodoscopePlaneRawHits& operator[](unsigned int i) const { return planeHits_[i]; }
00033 
00035   void setPlanes(unsigned int size)
00036     {
00037         planeHits_.resize(size);
00038     };
00039   
00040   void setPlane(unsigned int i, const EcalTBHodoscopePlaneRawHits& planeHit) 
00041     {
00042       if (planeHits_.size() < i+1 )
00043         planeHits_.resize(i+1);
00044       planeHits_[i]=planeHit; 
00045     };
00046 
00047 
00048  private:
00049   std::vector<EcalTBHodoscopePlaneRawHits> planeHits_;
00050   
00051 };
00052 
00053 std::ostream& operator<<(std::ostream&, const EcalTBHodoscopeRawInfo&);
00054   
00055 #endif