CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCStripData.h
Go to the documentation of this file.
1 #ifndef CSCRecHitD_CSCStripData_h
2 #define CSCRecHitD_CSCStripData_h
3 
10 #include <algorithm>
11 #include <functional>
12 #include <vector>
13 #include <iosfwd>
14 
16 {
17  public:
18 
25  CSCStripData() : istrip_(-1), phmax_(0.), tmax_(-1), phRaw_( ntbins_ ), ph_( ntbins_ ) {};
26  CSCStripData( int istrip, float phmax, int tmax, const std::vector<int>& phRaw, const std::vector<float>& ph ) :
27  istrip_(istrip), phmax_(phmax), tmax_(tmax), phRaw_(phRaw), ph_(ph) {};
28 
30  int strip() const {return istrip_;}
32  float phmax() const {return phmax_;}
34  int tmax() const {return tmax_;}
35 
39  const std::vector<float>& ph() const {return ph_;}
40 
44  const std::vector<int>& phRaw() const {return phRaw_;}
45 
49  void operator*=( float factor) {
50  // scale all elements of ph by 'factor'. Leaves phRaw_ unchanged.
51  std::transform( ph_.begin(), ph_.end(), ph_.begin(),
52  std::bind2nd( std::multiplies<float>(), factor ) );
53  phmax_ *= factor;
54  }
55 
56  bool operator<( const CSCStripData & data ) const { return phmax_ < data.phmax_; }
57 
59  friend std::ostream & operator<<(std::ostream &, const CSCStripData &);
60 
61  private:
62 
63  static const int ntbins_ = 8; //@@ Number of time bins & hence length of ph vectors
64  int istrip_;
65  float phmax_;
66  int tmax_;
67  std::vector<int> phRaw_;
68  std::vector<float> ph_;
69 
70 };
71 
72 #endif
73 
int tmax() const
the time bin in which the maximum pulseheight occurs (counts from 0)
Definition: CSCStripData.h:34
std::vector< float > ph_
Definition: CSCStripData.h:68
const std::vector< int > & phRaw() const
Definition: CSCStripData.h:44
std::vector< int > phRaw_
Definition: CSCStripData.h:67
friend std::ostream & operator<<(std::ostream &, const CSCStripData &)
for debugging purposes
Definition: CSCStripData.cc:9
float phmax() const
maximum pulseheight in one SCA time bin
Definition: CSCStripData.h:32
void operator*=(float factor)
Definition: CSCStripData.h:49
int strip() const
strip to which these data belong (counts from 1)
Definition: CSCStripData.h:30
bool operator<(const CSCStripData &data) const
Definition: CSCStripData.h:56
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static const int ntbins_
Definition: CSCStripData.h:63
CSCStripData(int istrip, float phmax, int tmax, const std::vector< int > &phRaw, const std::vector< float > &ph)
Definition: CSCStripData.h:26
const std::vector< float > & ph() const
Definition: CSCStripData.h:39