CMS 3D CMS Logo

ClusterFP420.h
Go to the documentation of this file.
1 #ifndef ClusterFP420_h
2 #define ClusterFP420_h
3 
4 #include <vector>
5 class HDigiFP420;
6 
7 class ClusterFP420 {
8 public:
9 
10  typedef std::vector<HDigiFP420>::const_iterator HDigiFP420Iter;
11  typedef std::pair<HDigiFP420Iter,HDigiFP420Iter> HDigiFP420Range;
12 
13  //ClusterFP420() : detId_(0) , xytype_(0) {}
14  ClusterFP420() : detId_(0) {}
15 
16  //The range is assumed to be non-empty.
17  ClusterFP420( unsigned int, unsigned int, const HDigiFP420Range&, float&, float&);
18  // ClusterFP420( unsigned int detid, const HDigiFP420Range& range, float& cog, float& err);// work also
19 
20  // number of the first strip in the cluster
21  short firstStrip() const {return firstStrip_;}
22 
23  //global ID of the corresponding DetUnit --> iu index
24  unsigned int globalId() const {return detId_;}
25 
26  // since xytype=2 all the time, no sense to record it into collection, so do comment the next line:
27  //unsigned int globalType() const {return xytype_;}
28 
29  const std::vector<short>& amplitudes() const {return amplitudes_;}
30 
31  float barycenter() const {return barycenter_;}
32  float barycerror() const {return barycerror_;}
33 
34  float barycenterW() const {return barycenterW_;}
35  float barycerrorW() const {return barycerrorW_;}
36 
37 private:
38 
39  unsigned int detId_;
40  // unsigned int xytype_;
41  short firstStrip_;
42  std::vector<short> amplitudes_;
43  float barycenter_;
44  float barycerror_;
45  float barycenterW_;
46  float barycerrorW_;
47 
48 
49 };
50 
51 // Comparison operators
52 inline bool operator<( const ClusterFP420& one, const ClusterFP420& other) {
53  if(one.globalId() == other.globalId()) {
54  return one.firstStrip() < other.firstStrip();
55  }
56  return one.globalId() < other.globalId();
57 }
58 #endif
std::vector< HDigiFP420 >::const_iterator HDigiFP420Iter
Definition: ClusterFP420.h:10
float barycerror() const
Definition: ClusterFP420.h:32
bool operator<(const ClusterFP420 &one, const ClusterFP420 &other)
Definition: ClusterFP420.h:52
const std::vector< short > & amplitudes() const
Definition: ClusterFP420.h:29
float barycenter() const
Definition: ClusterFP420.h:31
float barycerror_
Definition: ClusterFP420.h:44
short firstStrip() const
Definition: ClusterFP420.h:21
float barycerrorW() const
Definition: ClusterFP420.h:35
float barycenterW() const
Definition: ClusterFP420.h:34
std::pair< HDigiFP420Iter, HDigiFP420Iter > HDigiFP420Range
Definition: ClusterFP420.h:11
float barycerrorW_
Definition: ClusterFP420.h:46
std::vector< short > amplitudes_
Definition: ClusterFP420.h:42
float barycenterW_
Definition: ClusterFP420.h:45
unsigned int globalId() const
Definition: ClusterFP420.h:24
short firstStrip_
Definition: ClusterFP420.h:41
float barycenter_
Definition: ClusterFP420.h:43
unsigned int detId_
Definition: ClusterFP420.h:39