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