StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFttPoint.h
1 /**************************************************************************
2  *
3  * StFttPoint.h
4  *
5  * Author: jdb 2021
6  **************************************************************************
7  *
8  * Description: Declaration of StFttPoint, the StEvent FTT point structure
9  * Represents a "point" (cluster centroid etc) via cluster finding.
10  *
11  **************************************************************************/
12 #ifndef StFttPoint_h
13 #define StFttPoint_h
14 
15 #include "StThreeVectorD.hh"
16 #include "StObject.h"
17 #include "StEnumerations.h"
18 #include "StContainers.h"
19 
20 class StFttCluster;
21 
22 class StFttPoint : public StObject {
23 public:
24  StFttPoint();
25  ~StFttPoint();
26 
27  UChar_t plane() const; // Detector plane.
28  UChar_t quadrant() const; // detector quadrant.
29  float x() const; // x position in cell unit at which point intersects the sub-detector in local coordinate
30  float y() const; // y position in cell unit at which point intersects the sub-detector in local coordinate
31  size_t nClusters() const; // Number of points in the parent cluster.
32  StFttCluster* cluster( size_t i); // Parent cluster of the photon.
33  const StThreeVectorD& xyz() const; // XYZ position in global STAR coordinate
34  UShort_t idTruth() const { return mIdTruth; } // Get the truth ID
35  UShort_t qaTruth() const { return mQaTruth; } // Get the truth quality
36 
37  void setPlane(UChar_t plane);
38  void setQuadrant(UChar_t quad);
39  void setX(float x);
40  void setY(float y);
41  void addCluster(StFttCluster* cluster, UChar_t dir);
42  void setXYZ(const StThreeVectorD& p3);
43  void setIdTruth(UShort_t id) { mIdTruth = id; }
44  void setQaTruth(UShort_t qa) { mQaTruth = qa; }
45 
46  void print(int option=0);
47 
48 private:
49  UChar_t mPlane;
50  UChar_t mQuadrant;
51  Float_t mX=0.0; // x-position in local coordinate
52  Float_t mY=0.0; // y-position in local coordinate
53  StFttCluster *mClusters[4];
54  StThreeVectorD mXYZ; // Photon position in STAR coordinate
55  UShort_t mIdTruth=0; // Truth ID
56  UShort_t mQaTruth=0; // Truth quality
57 
58  ClassDef(StFttPoint, 3)
59 };
60 
61 inline UChar_t StFttPoint::plane() const { return mPlane; }
62 inline UChar_t StFttPoint::quadrant() const { return mQuadrant; }
63 inline float StFttPoint::x() const { return mX; } // x position (cm) in local coords.
64 inline float StFttPoint::y() const { return mY; } // y position (cm) in local coords.
65 inline StFttCluster* StFttPoint::cluster( size_t i ) { if ( i < 4 ) return mClusters[i]; return nullptr; } // Parent cluster of the photon.
66 inline const StThreeVectorD& StFttPoint::xyz() const { return mXYZ; }
67 inline void StFttPoint::setPlane(UChar_t plane) { mPlane = plane; }
68 inline void StFttPoint::setQuadrant(UChar_t quadrant) { mQuadrant = quadrant; }
69 inline void StFttPoint::setX(float xpos) { mX = xpos; }
70 inline void StFttPoint::setY(float ypos) { mY = ypos; }
71 inline void StFttPoint::addCluster(StFttCluster* cluster, UChar_t dir) { mClusters[dir] = (cluster); }
72 inline void StFttPoint::setXYZ(const StThreeVectorD& p3) { mXYZ = p3; }
73 
74 #endif // StFttPoint_h
75