StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFcsCluster.h
1 /****************************************************************************
2  *
3  * $Id: StFcsCluster.h,v 2.1 2021/01/11 20:25:37 ullrich Exp $
4  *
5  * Author: Akio Ogawa 2018
6  ****************************************************************************
7  *
8  * Description: Implementation of StFcsCluster, a group ofadjacent FCS towers.
9  * A cluster is formed by the energy depositions (hits) of one or more
10  * particles over a group of FCS towers.
11  ****************************************************************************
12  *
13  * $Log: StFcsCluster.h,v $
14  * Revision 2.1 2021/01/11 20:25:37 ullrich
15  * Initial Revision
16  *
17  ****************************************************************************/
18 #ifndef STFCSCLUSTER_H
19 #define STFCSCLUSTER_H
20 
21 #include "StLorentzVectorD.hh"
22 
23 #include "StObject.h"
24 
25 #include "StEvent/StContainers.h" // For StPtrVecFcsHit, StPtrVecFcsPoint
26 #include "StEvent/StEnumerations.h"
27 
28 class StFcsPoint;
29 class StFwdTrack;
30 
31 class StFcsCluster : public StObject {
32 public:
33  StFcsCluster();
34  ~StFcsCluster();
35 
36  int id() const; // Cluster ID
37  unsigned short detectorId() const;
38  int category() const;
39  int nTowers() const;
40  int nNeighbor() const;
41  int nPoints() const;
42  float energy() const;
43  float x() const; // Mean x ("center of gravity") in local grid coordinate (1st moment).
44  float y() const; // Mean y ("center of gravity") in local grid coordinate (1st moment).
45  float sigmaMax() const; // Maximum 2nd moment (along major axis).
46  float sigmaMin() const; // Minimum 2nd moment.
47  float theta() const; // Angle in x-y plane that defines the direction of least-2nd-sigma
48  float chi2Ndf1Photon() const; // chi^2/ndf for 1-photon fit to the cluster.
49  float chi2Ndf2Photon() const; // chi^2/ndf for 2-photon fit to the cluster.
50  const StLorentzVectorD& fourMomentum() const; // Cluster four-momentum (px, py, pz, E)
51 
52  void setId(int cluid);
53  void setDetectorId(unsigned short detector);
54  void setCategory(int catag);
55  void setNTowers(int numbTower);
56  void setEnergy(float energy);
57  void setX(float x0);
58  void setY(float y0);
59  void setSigmaMin(float sigmaMax);
60  void setSigmaMax(float sigmaMax);
61  void setTheta(float theta);
62  void setChi2Ndf1Photon(float chi2ndfph1);
63  void setChi2Ndf2Photon(float chi2ndfph2);
64  void setFourMomentum(StLorentzVectorD p4);
65  // Hits
66  StPtrVecFcsHit& hits();
67  const StPtrVecFcsHit& hits() const;
68  // Neighbors
69  void addNeighbor(StFcsCluster* neighbor);
70  StPtrVecFcsCluster& neighbor();
71  const StPtrVecFcsCluster& neighbor() const;
72  // Points
73  StPtrVecFcsPoint& points();
74  const StPtrVecFcsPoint& points() const;
75  void addPoint(StFcsPoint* p);
76  void addPoint(StFcsPoint* p1, StFcsPoint* p2);
77  //Tracks
78  StPtrVecFwdTrack& tracks();
79  const StPtrVecFwdTrack& tracks() const;
80  void addTrack(StFwdTrack* p);
81  void sortTrackByPT();
82 
83  void print(Option_t *option="") const;
84 
85 private:
86  Int_t mId=-1; // Eventwise cluster ID
87  UShort_t mDetectorId=0; // Detector starts from 1
88  Int_t mCategory=0; // Category of cluster (see StFcsClusterCategory)
89  Int_t mNTowers=0; // Number of non-zero-energy tower hits in the cluster
90  Float_t mEnergy=0.0; // Total energy contained in this cluster (0th moment)
91  Float_t mX=0.0; // Mean x ("center of gravity") in local grid coordinate (1st moment)
92  Float_t mY=0.0; // Mean y ("center of gravity") in local grid coordinate (1st moment)
93  Float_t mSigmaMin=0.0; // Minimum 2nd moment
94  Float_t mSigmaMax=0.0; // Maximum 2nd moment (along major axis)
95  Float_t mTheta=0.0; //Angle in x-y plane that defines the direction of least-2nd-sigma
96  Float_t mChi2Ndf1Photon=0.0; // &chi;<sup>2</sup> / ndf for 1-photon fit
97  Float_t mChi2Ndf2Photon=0.0; // &chi;<sup>2</sup> / ndf for 2-photon fit
98  StLorentzVectorD mFourMomentum; // Cluster four momentum
99  StPtrVecFcsHit mHits; // Tower hits of the current cluster
100  StPtrVecFcsCluster mNeighbor; // Neighbor clusters
101  StPtrVecFcsPoint mPoints; // Fitted points (photons) in the cluster
102  StPtrVecFwdTrack mTracks; // Associated Tracks
103 
104  ClassDef(StFcsCluster, 3)
105 };
106 
107 
108 inline int StFcsCluster::id() const { return mId; } // Cluster ID
109 inline unsigned short StFcsCluster::detectorId() const { return mDetectorId; }
110 inline int StFcsCluster::category() const { return mCategory; }
111 inline int StFcsCluster::nTowers() const { return mNTowers; }
112 inline int StFcsCluster::nNeighbor() const { return mNeighbor.size(); }
113 inline int StFcsCluster::nPoints() const { return mPoints.size(); }
114 inline float StFcsCluster::energy() const { return mEnergy; }
115 inline float StFcsCluster::x() const { return mX; } // Mean x ("center of gravity") in local grid coordinate (1st moment).
116 inline float StFcsCluster::y() const { return mY; } // Mean y ("center of gravity") in local grid coordinate (1st moment).
117 inline float StFcsCluster::sigmaMax() const { return mSigmaMax; } // Maximum 2nd moment (along major axis).
118 inline float StFcsCluster::sigmaMin() const { return mSigmaMin; } // Minimum 2nd moment.
119 inline float StFcsCluster::theta() const { return mTheta; } // Angle in x-y plane that defines the direction of least-2nd-sigma
120 inline float StFcsCluster::chi2Ndf1Photon() const { return mChi2Ndf1Photon; } // chi^2/ndf for 1-photon fit to the cluster.
121 inline float StFcsCluster::chi2Ndf2Photon() const { return mChi2Ndf2Photon; } // chi^2/ndf for 2-photon fit to the cluster.
122 inline const StLorentzVectorD& StFcsCluster::fourMomentum() const { return mFourMomentum; } // Cluster four-momentum (px, py, pz, E)
123 inline void StFcsCluster::setDetectorId(unsigned short detector) { mDetectorId = detector; }
124 inline void StFcsCluster::setCategory(int catag) { mCategory = catag; }
125 inline void StFcsCluster::setNTowers(int numbTower) { mNTowers = numbTower; }
126 inline void StFcsCluster::setEnergy(float energy) { mEnergy = energy; }
127 inline void StFcsCluster::setX(float x0) { mX = x0; }
128 inline void StFcsCluster::setY(float y0) { mY = y0; }
129 inline void StFcsCluster::setSigmaMin(float sigmaMax) { mSigmaMin = sigmaMax; }
130 inline void StFcsCluster::setSigmaMax(float sigmaMax) { mSigmaMax = sigmaMax; }
131 inline void StFcsCluster::setTheta(float theta) { mTheta = theta; }
132 inline void StFcsCluster::setChi2Ndf1Photon(float chi2ndfph1) { mChi2Ndf1Photon = chi2ndfph1; }
133 inline void StFcsCluster::setChi2Ndf2Photon(float chi2ndfph2) { mChi2Ndf2Photon = chi2ndfph2; }
134 inline void StFcsCluster::setId(int cluid) { mId = cluid; }
135 inline void StFcsCluster::setFourMomentum(StLorentzVectorD p4) { mFourMomentum = p4; }
136 inline StPtrVecFcsHit& StFcsCluster::hits() { return mHits; }
137 inline const StPtrVecFcsHit& StFcsCluster::hits() const { return mHits; }
138 inline StPtrVecFcsCluster& StFcsCluster::neighbor() { return mNeighbor; }
139 inline const StPtrVecFcsCluster& StFcsCluster::neighbor() const { return mNeighbor; }
140 inline StPtrVecFcsPoint& StFcsCluster::points() { return mPoints; }
141 inline const StPtrVecFcsPoint& StFcsCluster::points() const { return mPoints; }
142 inline StPtrVecFwdTrack& StFcsCluster::tracks() { return mTracks; }
143 inline const StPtrVecFwdTrack& StFcsCluster::tracks() const { return mTracks; }
144 
145 #endif // STFCSCLUSTER_H