CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/RecoLocalMuon/CSCRecHitD/src/CSCStripData.h

Go to the documentation of this file.
00001 #ifndef CSCRecHitD_CSCStripData_h
00002 #define CSCRecHitD_CSCStripData_h
00003 
00010 #include <algorithm>
00011 #include <functional>
00012 #include <vector>
00013 #include <iosfwd>
00014 
00015 class CSCStripData
00016 {       
00017  public:
00018                 
00025   CSCStripData() : istrip_(-1), phmax_(0.), tmax_(-1), phRaw_( ntbins_ ), ph_( ntbins_ ) {};
00026   CSCStripData( int istrip,  float phmax,  int tmax, const std::vector<int>& phRaw, const std::vector<float>& ph ) :
00027       istrip_(istrip), phmax_(phmax), tmax_(tmax), phRaw_(phRaw), ph_(ph) {};
00028    
00030   int   strip() const {return istrip_;}
00032   float phmax() const {return phmax_;}
00034   int   tmax()  const {return tmax_;}
00035 
00039   const std::vector<float>& ph() const {return ph_;}
00040         
00044   const std::vector<int>& phRaw() const {return phRaw_;}
00045 
00049   void operator*=( float factor) {
00050     // scale all elements of ph by 'factor'. Leaves phRaw_ unchanged.
00051     std::transform( ph_.begin(), ph_.end(), ph_.begin(), 
00052                    std::bind2nd( std::multiplies<float>(), factor ) );
00053     phmax_ *= factor;
00054   }
00055 
00056   bool operator<( const CSCStripData & data ) const { return phmax_ < data.phmax_; }
00057 
00059   friend std::ostream & operator<<(std::ostream &, const CSCStripData &);
00060 
00061  private:
00062 
00063   static const int ntbins_ = 8; //@@ Number of time bins & hence length of ph vectors
00064   int istrip_;
00065   float phmax_;
00066   int tmax_;
00067   std::vector<int> phRaw_;
00068   std::vector<float> ph_;
00069 
00070 };
00071 
00072 #endif
00073