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