StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuFcsCluster.h
1 /*************************************************************************
2  *
3  * $Id: StMuFcsCluster.h,v 1.2 2021/11/17 22:09:58 jdb Exp $
4  *
5  * Author: Daniel Brandenburg, 2021
6  *************************************************************************
7  *
8  * Description: Declaration of StMuFcsCluster, the MuDST FCS cluster class
9  *
10  *************************************************************************/
11 
12 #ifndef StMuFcsCluster_hh
13 #define StMuFcsCluster_hh
14 
15 #include <TObject.h>
16 #include <TRefArray.h>
17 #include <TLorentzVector.h>
18 
19 class StFcsCluster; // Equivalent class in StEvent
20 class StMuFcsPoint;
21 class StMuFcsHit;
22 
25 class StMuFcsCluster : public TObject {
26  public:
28  ~StMuFcsCluster();
29 
30  int id() const; // Cluster ID
31  unsigned short detectorId() const;
32  int category() const;
33  int nTowers() const;
34  int nNeighbor() const;
35  int nPoints() const;
36  float energy() const;
37  float x() const; // Mean x ("center of gravity") in local grid coordinate (1st moment).
38  float y() const; // Mean y ("center of gravity") in local grid coordinate (1st moment).
39  float sigmaMax() const; // Maximum 2nd moment (along major axis).
40  float sigmaMin() const; // Minimum 2nd moment.
41  float theta() const; // Angle in x-y plane that defines the direction of least-2nd-sigma
42  float chi2Ndf1Photon() const; // chi^2/ndf for 1-photon fit to the cluster.
43  float chi2Ndf2Photon() const; // chi^2/ndf for 2-photon fit to the cluster.
44  const TLorentzVector& fourMomentum() const; // Cluster four-momentum (px, py, pz, E)
45 
46  void setId(int cluid);
47  void setDetectorId(unsigned short detector);
48  void setCategory(int catag);
49  void setNTowers(int numbTower);
50  void setEnergy(float energy);
51  void setX(float x0);
52  void setY(float y0);
53  void setSigmaMin(float sigmaMax);
54  void setSigmaMax(float sigmaMax);
55  void setTheta(float theta);
56  void setChi2Ndf1Photon(float chi2ndfph1);
57  void setChi2Ndf2Photon(float chi2ndfph2);
58  void setFourMomentum(TLorentzVector p4);
59 
60  // void addHit( StMuFcsHit* hit ){ mHits.Add( hit ); }
61  TRefArray* hits();
62  const TRefArray* hits() const;
63  void addNeighbor(StMuFcsCluster* neighbor);
64  TRefArray* neighbor();
65  const TRefArray* neighbor() const;
66  TRefArray* points();
67  const TRefArray* points() const;
68  void addPoint(StMuFcsPoint* p);
69  void addPoint(StMuFcsPoint* p1, StMuFcsPoint* p2);
70  void print(Option_t *option="") const;
71 
72 private:
73  Int_t mId=-1; // Eventwise cluster ID
74  UShort_t mDetectorId=0; // Detector starts from 1
75  Int_t mCategory=0; // Category of cluster (see StMuFcsClusterCategory)
76  Int_t mNTowers=0; // Number of non-zero-energy tower hits in the cluster
77  Float_t mEnergy=0.0; // Total energy contained in this cluster (0th moment)
78  Float_t mX=0.0; // Mean x ("center of gravity") in local grid coordinate (1st moment)
79  Float_t mY=0.0; // Mean y ("center of gravity") in local grid coordinate (1st moment)
80  Float_t mSigmaMin=0.0; // Minimum 2nd moment
81  Float_t mSigmaMax=0.0; // Maximum 2nd moment (along major axis)
82  Float_t mTheta=0.0; //Angle in x-y plane that defines the direction of least-2nd-sigma
83  Float_t mChi2Ndf1Photon=0.0; // &chi;<sup>2</sup> / ndf for 1-photon fit
84  Float_t mChi2Ndf2Photon=0.0; // &chi;<sup>2</sup> / ndf for 2-photon fit
85  TLorentzVector mFourMomentum; // Cluster four momentum
86  TRefArray mHits; // Tower hits of the current cluster
87  TRefArray mNeighbor; // Neighbor clusters
88  TRefArray mPoints; // Fitted points (photons) in the cluster
89 
90  ClassDef(StMuFcsCluster, 1)
91 };
92 
93 inline int StMuFcsCluster::id() const { return mId; } // Cluster ID
94 inline unsigned short StMuFcsCluster::detectorId() const { return mDetectorId; }
95 inline int StMuFcsCluster::category() const { return mCategory; }
96 inline int StMuFcsCluster::nTowers() const { return mNTowers; }
97 inline int StMuFcsCluster::nNeighbor() const { return mNeighbor.GetSize(); }
98 inline int StMuFcsCluster::nPoints() const { return mPoints.GetSize(); }
99 inline float StMuFcsCluster::energy() const { return mEnergy; }
100 inline float StMuFcsCluster::x() const { return mX; } // Mean x ("center of gravity") in local grid coordinate (1st moment).
101 inline float StMuFcsCluster::y() const { return mY; } // Mean y ("center of gravity") in local grid coordinate (1st moment).
102 inline float StMuFcsCluster::sigmaMax() const { return mSigmaMax; } // Maximum 2nd moment (along major axis).
103 inline float StMuFcsCluster::sigmaMin() const { return mSigmaMin; } // Minimum 2nd moment.
104 inline float StMuFcsCluster::theta() const { return mTheta; } // Angle in x-y plane that defines the direction of least-2nd-sigma
105 inline float StMuFcsCluster::chi2Ndf1Photon() const { return mChi2Ndf1Photon; } // chi^2/ndf for 1-photon fit to the cluster.
106 inline float StMuFcsCluster::chi2Ndf2Photon() const { return mChi2Ndf2Photon; } // chi^2/ndf for 2-photon fit to the cluster.
107 inline const TLorentzVector& StMuFcsCluster::fourMomentum() const { return mFourMomentum; } // Cluster four-momentum (px, py, pz, E)
108 inline void StMuFcsCluster::setDetectorId(unsigned short detector) { mDetectorId = detector; }
109 inline void StMuFcsCluster::setCategory(int catag) { mCategory = catag; }
110 inline void StMuFcsCluster::setNTowers(int numbTower) { mNTowers = numbTower; }
111 inline void StMuFcsCluster::setEnergy(float energy) { mEnergy = energy; }
112 inline void StMuFcsCluster::setX(float x0) { mX = x0; }
113 inline void StMuFcsCluster::setY(float y0) { mY = y0; }
114 inline void StMuFcsCluster::setSigmaMin(float sigmaMax) { mSigmaMin = sigmaMax; }
115 inline void StMuFcsCluster::setSigmaMax(float sigmaMax) { mSigmaMax = sigmaMax; }
116 inline void StMuFcsCluster::setTheta(float theta) { mTheta = theta; }
117 inline void StMuFcsCluster::setChi2Ndf1Photon(float chi2ndfph1) { mChi2Ndf1Photon = chi2ndfph1; }
118 inline void StMuFcsCluster::setChi2Ndf2Photon(float chi2ndfph2) { mChi2Ndf2Photon = chi2ndfph2; }
119 inline void StMuFcsCluster::setId(int cluid) { mId = cluid; }
120 inline void StMuFcsCluster::setFourMomentum(TLorentzVector p4) { mFourMomentum = p4; }
121 inline TRefArray* StMuFcsCluster::hits() { return &mHits; }
122 inline const TRefArray* StMuFcsCluster::hits() const { return &mHits; }
123 inline TRefArray* StMuFcsCluster::neighbor() { return &mNeighbor; }
124 inline const TRefArray* StMuFcsCluster::neighbor() const { return &mNeighbor; }
125 inline TRefArray* StMuFcsCluster::points() { return &mPoints; }
126 inline const TRefArray* StMuFcsCluster::points() const { return &mPoints; }
127 
128 
129 #endif // StMuFcsCluster_hh