StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFttCluster.h
1 #ifndef STFTTCLUSTER_H
2 #define STFTTCLUSTER_H
3 
4 #include "StObject.h"
5 #include <Stiostream.h>
6 #include "StContainers.h" // For StPtrVecFttRawHit
7 #include "StEnumerations.h"
8 
9 class StFttRawHit;
10 class StFttPoint;
11 class StFttDb;
12 
13 class StFttCluster : public StObject {
14 public:
15  StFttCluster();
16  ~StFttCluster();
17 
18  int id() const; // Cluster ID
19  UChar_t plane() const; // Detector plane.
20  UChar_t quadrant() const; // detector quadrant.
21  UChar_t row() const; // detector row.
22  UChar_t orientation() const;
23  int nStrips() const;
24  int nPoints() const;
25  int nRawHits() const; // == nStrips?? need both?
26  int nNeighbors() const;
27  float sumAdc() const;
28  float x() const; // Mean x ("center of gravity") in local grid coordinate (1st moment).
29  float sigma() const; // Maximum 2nd moment (along major axis).
30  UShort_t idTruth() const { return mIdTruth; } // Get the truth ID
31  UShort_t qaTruth() const { return mQaTruth; } // Get the truth quality
32 
33  void setId(int cluid);
34  void setPlane(UChar_t plane);
35  void setQuadrant(UChar_t quad);
36  void setRow(UChar_t row);
37  void setOrientation( UChar_t );
38  void setNStrips(int numStrips);
39  void setSumAdc(int theSumAdc);
40  void setX(float x0);
41  void setSigma(float sigma);
42  void setIdTruth(UShort_t id) { mIdTruth = id; }
43  void setQaTruth(UShort_t qa) { mQaTruth = qa; }
44 
45  StPtrVecFttRawHit& rawHits();
46  const StPtrVecFttRawHit& rawHits() const;
47  void addRawHit(StFttRawHit* p);
48  void addNeighbor(StFttCluster* neighbor);
49  StPtrVecFttCluster& neighbor();
50  const StPtrVecFttCluster& neighbor() const;
51  StPtrVecFttPoint& points();
52  const StPtrVecFttPoint& points() const;
53  void addPoint(StFttPoint* p);
54  // void print(Option_t *option="") const;
55 
56 private:
57  Int_t mId=-1; // Eventwise cluster ID
58  UChar_t mPlane;
59  UChar_t mQuadrant;
60  UChar_t mRow;
61  UChar_t mOrientation = kFttUnknownOrientation; // Orientation of cluster
62  Int_t mNStrips=0; // Number of strips
63  Float_t mSumAdc=0.0; // Total ADC (0th moment)
64  Float_t mX=0.0; // Mean x ("center of gravity") in local grid coordinate (1st moment)
65  Float_t mSigma=0.0; // 2nd moment
66  StPtrVecFttRawHit mRawHits; // Tower hits of the current cluster
67  StPtrVecFttCluster mNeighbors; // Neighbor clusters
68  StPtrVecFttPoint mPoints; // Fitted points (photons) in the cluster
69  UShort_t mIdTruth=0; // Truth ID
70  UShort_t mQaTruth=0; // Truth Quality
71 
72  ClassDef(StFttCluster, 4)
73 };
74 
75 std::ostream& operator << ( std::ostream&, const StFttCluster& clu ); // Printing operator
76 
77 
78 inline int StFttCluster::id() const { return mId; } // Cluster ID
79 inline UChar_t StFttCluster::plane() const { return mPlane; }
80 inline UChar_t StFttCluster::quadrant() const { return mQuadrant; }
81 inline UChar_t StFttCluster::row() const { return mRow; }
82 inline UChar_t StFttCluster::orientation() const { return mOrientation; }
83 inline int StFttCluster::nStrips() const { return mNStrips; }
84 inline int StFttCluster::nRawHits() const { return mRawHits.size(); }
85 inline int StFttCluster::nNeighbors() const { return mNeighbors.size(); }
86 inline int StFttCluster::nPoints() const { return mPoints.size(); }
87 inline float StFttCluster::sumAdc() const { return mSumAdc; }
88 inline float StFttCluster::x() const { return mX; } // Mean x ("center of gravity") in local grid coordinate (1st moment).
89 inline float StFttCluster::sigma() const { return mSigma; } // 2nd moment
90 
91 inline void StFttCluster::setPlane(UChar_t plane) { mPlane = plane; }
92 inline void StFttCluster::setQuadrant(UChar_t quadrant) { mQuadrant = quadrant; }
93 inline void StFttCluster::setRow(UChar_t row) { mRow = row; }
94 inline void StFttCluster::setOrientation( UChar_t so ) { mOrientation = so; }
95 inline void StFttCluster::setNStrips(int numStrips) { mNStrips = numStrips; }
96 inline void StFttCluster::setSumAdc(int theSumAdc) { mSumAdc = theSumAdc; }
97 inline void StFttCluster::setX(float x0) { mX = x0; }
98 inline void StFttCluster::setSigma(float sigma) { mSigma = sigma; }
99 
100 inline void StFttCluster::setId(int cluid) { mId = cluid; }
101 
102 inline StPtrVecFttRawHit& StFttCluster::rawHits() { return mRawHits; }
103 inline const StPtrVecFttRawHit& StFttCluster::rawHits() const { return mRawHits; }
104 inline StPtrVecFttCluster& StFttCluster::neighbor() { return mNeighbors; }
105 inline const StPtrVecFttCluster& StFttCluster::neighbor() const { return mNeighbors; }
106 inline StPtrVecFttPoint& StFttCluster::points() { return mPoints; }
107 inline const StPtrVecFttPoint& StFttCluster::points() const { return mPoints; }
108 
109 #endif // STFTTCLUSTER_H