StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFmsCluster.h
1 /****************************************************************************
2  *
3  * $Id: StFmsCluster.h,v 2.2 2015/08/26 16:51:59 ullrich Exp $
4  *
5  * Author: Thomas Burton, Yuxi Pan, 2014
6  ****************************************************************************
7  *
8  * Description: Implementation of StFmsCluster, a group of
9  * adjacent FMS towers.
10  * A cluster is formed by the energy depositions (hits) of one or more
11  * particles over a group of FMS towers.
12  ****************************************************************************
13  *
14  * $Log: StFmsCluster.h,v $
15  * Revision 2.2 2015/08/26 16:51:59 ullrich
16  * Added print out fct and operator.
17  *
18  * Revision 2.1 2015/02/14 18:56:00 ullrich
19  * Initial Revision.
20  *
21  *
22  ****************************************************************************/
23 #ifndef STFMSCLUSTER_H
24 #define STFMSCLUSTER_H
25 
26 #include "StLorentzVectorF.hh"
27 
28 #include "StObject.h"
29 
30 #include "StContainers.h" // For StPtrVecFmsHit, StPtrVecFmsPoint
31 #include "StEnumerations.h"
32 
33 
34 class StFmsCluster : public StObject {
35 public:
36  StFmsCluster();
37  ~StFmsCluster();
38 
39  unsigned short detectorId() const;
40  int category() const;
41  int nTowers() const;
42  int nPhotons() const;
43  float energy() const;
44  float x() const; // Mean x ("center of gravity") in local grid coordinate (1st moment).
45  float y() const; // Mean y ("center of gravity") in local grid coordinate (1st moment).
46  float sigmaMax() const; // Maximum 2nd moment (along major axis).
47  float sigmaMin() const; // Minimum 2nd moment.
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  int id() const; // Cluster ID
51  const StLorentzVectorF& fourMomentum() const; // Cluster four-momentum (px, py, pz, E)
52  void setDetectorId(unsigned short detector);
53  void setCategory(int catag);
54  void setNTowers(int numbTower);
55  void setEnergy(float energy);
56  void setX(float x0);
57  void setY(float y0);
58  void setSigmaMin(float sigmaMax);
59  void setSigmaMax(float sigmaMax);
60  void setChi2Ndf1Photon(float chi2ndfph1);
61  void setChi2Ndf2Photon(float chi2ndfph2);
62  void setId(float cluid);
63  void setFourMomentum(StLorentzVectorF p4);
64  StPtrVecFmsHit& hits();
65  const StPtrVecFmsHit& hits() const;
66  StPtrVecFmsPoint& points();
67  const StPtrVecFmsPoint& points() const;
68 
69  void print(Option_t *option="") const;
70 
71 private:
72  UShort_t mDetectorId; // Detector starts from 1
73  Int_t mCategory; // Category of cluster (see StFmsClusterCategory)
74  Int_t mNTowers; // Number of non-zero-energy tower hits in the cluster
75  Float_t mEnergy; // Total energy contained in this cluster (0th moment)
76  Float_t mX; // Mean x ("center of gravity") in local grid coordinate (1st moment)
77  Float_t mY; // Mean y ("center of gravity") in local grid coordinate (1st moment)
78  Float_t mSigmaMin; // Minimum 2nd moment
79  Float_t mSigmaMax; // Maximum 2nd moment (along major axis)
80  Float_t mChi2Ndf1Photon; // &chi;<sup>2</sup> / ndf for 1-photon fit
81  Float_t mChi2Ndf2Photon; // &chi;<sup>2</sup> / ndf for 2-photon fit
82  Int_t mId; // Eventwise cluster ID
83  StLorentzVectorF mFourMomentum; // Cluster four momentum
84  StPtrVecFmsPoint mPhotons; // Fitted points (photons) in the cluster
85  StPtrVecFmsHit mHits; // Tower hits of the current cluster
86 
87  ClassDef(StFmsCluster, 1)
88 };
89 
90 ostream& operator<<(ostream&, const StFmsCluster&);
91 
92 //
93 // Inline functions
94 //
95 inline unsigned short StFmsCluster::detectorId() const { return mDetectorId; }
96 inline int StFmsCluster::category() const { return mCategory; }
97 inline int StFmsCluster::nTowers() const { return mNTowers; }
98 inline int StFmsCluster::nPhotons() const { return mPhotons.size(); }
99 inline float StFmsCluster::energy() const { return mEnergy; }
100 inline float StFmsCluster::x() const { return mX; } // Mean x ("center of gravity") in local grid coordinate (1st moment).
101 inline float StFmsCluster::y() const { return mY; } // Mean y ("center of gravity") in local grid coordinate (1st moment).
102 inline float StFmsCluster::sigmaMax() const { return mSigmaMax; } // Maximum 2nd moment (along major axis).
103 inline float StFmsCluster::sigmaMin() const { return mSigmaMin; } // Minimum 2nd moment.
104 inline float StFmsCluster::chi2Ndf1Photon() const { return mChi2Ndf1Photon; } // chi^2/ndf for 1-photon fit to the cluster.
105 inline float StFmsCluster::chi2Ndf2Photon() const { return mChi2Ndf2Photon; } // chi^2/ndf for 2-photon fit to the cluster.
106 inline int StFmsCluster::id() const { return mId; } // Cluster ID
107 inline const StLorentzVectorF& StFmsCluster::fourMomentum() const { return mFourMomentum; } // Cluster four-momentum (px, py, pz, E)
108 inline void StFmsCluster::setDetectorId(unsigned short detector) { mDetectorId = detector; }
109 inline void StFmsCluster::setCategory(int catag) { mCategory = catag; }
110 inline void StFmsCluster::setNTowers(int numbTower) { mNTowers = numbTower; }
111 inline void StFmsCluster::setEnergy(float energy) { mEnergy = energy; }
112 inline void StFmsCluster::setX(float x0) { mX = x0; }
113 inline void StFmsCluster::setY(float y0) { mY = y0; }
114 inline void StFmsCluster::setSigmaMin(float sigmaMax) { mSigmaMin = sigmaMax; }
115 inline void StFmsCluster::setSigmaMax(float sigmaMax) { mSigmaMax = sigmaMax; }
116 inline void StFmsCluster::setChi2Ndf1Photon(float chi2ndfph1) { mChi2Ndf1Photon = chi2ndfph1; }
117 inline void StFmsCluster::setChi2Ndf2Photon(float chi2ndfph2) { mChi2Ndf2Photon = chi2ndfph2; }
118 inline void StFmsCluster::setId(float cluid) { mId = cluid; }
119 inline void StFmsCluster::setFourMomentum(StLorentzVectorF p4) { mFourMomentum = p4; }
120 inline StPtrVecFmsHit& StFmsCluster::hits() { return mHits; }
121 inline const StPtrVecFmsHit& StFmsCluster::hits() const { return mHits; }
122 inline StPtrVecFmsPoint& StFmsCluster::points() { return mPhotons; }
123 inline const StPtrVecFmsPoint& StFmsCluster::points() const { return mPhotons; }
124 
125 
126 #endif // STFMSCLUSTER_H