Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:07

0001 #ifndef DIGIECAL_ECALTBHODOSCOPERAWINFO_H
0002 #define DIGIECAL_ECALTBHODOSCOPERAWINFO_H 1
0003 
0004 #include <ostream>
0005 
0006 /** \class EcalTBHodoscopeRawInfo
0007  *  Simple container for plane RawHits 
0008  *
0009  *
0010  */
0011 #include "TBDataFormats/EcalTBObjects/interface/EcalTBHodoscopePlaneRawHits.h"
0012 
0013 class EcalTBHodoscopeRawInfo {
0014 public:
0015   EcalTBHodoscopeRawInfo() : planeHits_(0){};
0016 
0017   EcalTBHodoscopeRawInfo(unsigned int planes) {
0018     planeHits_.reserve(planes);
0019     for (unsigned int i = 0; i < planes; i++)
0020       planeHits_[i] = 0;
0021   }
0022 
0023   /// Get Methods
0024   unsigned int planes() const { return planeHits_.size(); }
0025   unsigned int channels(unsigned int plane) const { return planeHits_[plane].channels(); }
0026   const std::vector<bool>& hits(unsigned int plane) const { return planeHits_[plane].hits(); }
0027   const EcalTBHodoscopePlaneRawHits& getPlaneRawHits(unsigned int i) const { return planeHits_[i]; }
0028   const EcalTBHodoscopePlaneRawHits& operator[](unsigned int i) const { return planeHits_[i]; }
0029 
0030   /// Set methods
0031   void setPlanes(unsigned int size) { planeHits_.resize(size); };
0032 
0033   void setPlane(unsigned int i, const EcalTBHodoscopePlaneRawHits& planeHit) {
0034     if (planeHits_.size() < i + 1)
0035       planeHits_.resize(i + 1);
0036     planeHits_[i] = planeHit;
0037   };
0038 
0039 private:
0040   std::vector<EcalTBHodoscopePlaneRawHits> planeHits_;
0041 };
0042 
0043 std::ostream& operator<<(std::ostream&, const EcalTBHodoscopeRawInfo&);
0044 
0045 #endif