StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFmsPoint.h
1 /**************************************************************************
2  *
3  * $Id: StFmsPoint.h,v 2.7 2015/10/21 14:46:48 ullrich Exp $
4  *
5  * Author: Thomas Burton, Yuxi Pan, 2014
6  **************************************************************************
7  *
8  * Description: Declaration of StFmsPoint, the StEvent FMS photon structure
9  * Represents a "point" (photon etc) fitted to a cluster of FMS towers.
10  *
11  **************************************************************************
12  *
13  * $Log: StFmsPoint.h,v $
14  * Revision 2.7 2015/10/21 14:46:48 ullrich
15  * Improved comments.
16  *
17  * Revision 2.6 2015/09/14 16:59:22 ullrich
18  * Added comments and modified print out.
19  *
20  * Revision 2.5 2015/09/01 21:01:47 ullrich
21  * Minor changes to format of print statments and \nchange to naming of data member.
22  *
23  * Revision 2.4 2015/09/01 18:29:01 ullrich
24  * Changes due to adding StFpsSlat and interconnection between slats and points.
25  *
26  * Revision 2.3 2015/08/26 16:51:25 ullrich
27  * Fixed bug in cluster() and added print out fct and operator.
28  *
29  * Revision 2.2 2015/08/19 19:22:35 ullrich
30  * Major update (PID) by Akio.
31  **************************************************************************/
32 #ifndef StFmsPoint_h
33 #define StFmsPoint_h
34 
35 #include "StLorentzVectorF.hh"
36 #include "StThreeVectorF.hh"
37 #include "StObject.h"
38 #include "StFmsCluster.h"
39 #include "StEnumerations.h"
40 
41 class StFmsPoint : public StObject {
42 public:
43  StFmsPoint();
44  ~StFmsPoint();
45 
46  enum StFmsPointPidFlag {
47  kFpsPidNoFps=0, // hit no slat
48  kFpsPidBad=1, // hit status bad slat
49  kFpsPidGamma1=10, // L1==0 L2==0 L3==0 gamma which did not convert
50  kFpsPidGamma2=11, // L1==0 L2==0 L3>=1 golden gamma
51  kFpsPidGamma3=12, // L1>=1 L2==0 L3==0 gamma with extra hit in layer1
52  kFpsPidGamma4=13, // L1==0 L2>=1 L3==0 gamma with extra hit in layer2
53  kFpsPidGamma5=14, // L1>=1 L2==0 L3>=1 gamma with extra hit in layer1
54  kFpsPidGamma6=15, // L1==0 L2>=1 L3>=1 gamma with extra hit in layer2
55  kFpsPidGamma7=16, // L1>=2 L2>=2 L3>=5 gamma converted to e+e-
56  kFpsPidMip=20, // L1==1 L2==1 L3==1 MIP (charged hadron or muon)
57  kFpsPidElectron1=30, // L1==1 L2==1 L3>=5 golden electron/positron
58  kFpsPidElectron2=31, // L1==1 L2>=2 L3>=5 electron
59  kFpsPidElectron3=32, // L1>=2 L2==1 L3>=5 electron
60  kFpsPidUnknown=40 // L1>=1 L2>=1 L3==0 not sure what to do
61  };
62 
63  const char* pidName(int i);
64  unsigned short detectorId() const;
65  float energy() const;
66  float x() const; // x position in cm at which point intersects the sub-detector in local coordinate
67  float y() const; // y position in cm at which point intersects the sub-detector in local coordinate
68  int id() const; // ID of the point in the current event.
69  StFmsCluster* cluster(); // Parent cluster of the photon.
70  const StFmsCluster* cluster() const; // Parent cluster of the photon.
71  int parentClusterId() const; // ID of the parent cluster containing this point.
72  int nParentClusterPhotons() const; // Number of points in the parent cluster.
73  const StThreeVectorF& XYZ() const; // XYZ position in global STAR coordinate
74  const StLorentzVectorF& fourMomentum() const;
75  void setDetectorId(unsigned short detector);
76  void setEnergy(float energy);
77  void setX(float xpos);
78  void setY(float ypos);
79  void setId(int phid);
80  void setCluster(StFmsCluster* cluster);
81  void setParentClusterId(int cluid);
82  void setNParentClusterPhotons(int nclph);
83  void setXYZ(const StThreeVectorF& p3);
84  void setFourMomentum(const StLorentzVectorF& p4);
85 
86  int fpsPid(); //PID see enum above
87  int fpsNCandidate(int layer);
88  float fpsMip(int layer, int candidate=0);
89  int fpsSlatId(int layer, int candidate=0);
90  float fpsDistance(int layer, int candidate=0); // distance from edge to projected
91  // location (negative means inside, positive outside)
92  void setFpsPid(int v);
93  void setFps(int layer, float mip, int slatid, float dist);
94  void resetFps();
95  void orderFpsCandidates(int layer=0); //order Fps hit candidates from near to far (layer=0 for sorting all layers)
96 
97  void print(int option=0);
98 
99 private:
100  UShort_t mDetectorId;
101  Float_t mEnergy;
102  Float_t mX;
103  Float_t mY;
104  Int_t mId;
105  Int_t mParentClusterId;
106  Int_t mNParentClusterPhotons;
107 #ifdef __CINT__
108  StObjLink mCluster; // Parent cluster of this photon
109 #else
110  StLink<StFmsCluster> mCluster;
111 #endif //__CINT__
112  StLorentzVectorF mFourMomentum;
113  StThreeVectorF mXYZ; //Photon position in STAR coordinate
114 
115  Int_t mFpsPid; // see enum above
116  Int_t mFpsNCandidate[kFpsNLayer]; // # of possible slat related to this point
117  Float_t mFpsMip[kFpsNLayer][kFpsNCandidate]; // # of MIPs
118  Int_t mFpsSlatId[kFpsNLayer][kFpsNCandidate]; // slatid
119  Float_t mFpsDistance[kFpsNLayer][kFpsNCandidate]; // distance from edge to projected location
120  // (negative means inside, positive outside)
121  ClassDef(StFmsPoint, 3)
122 };
123 
124 inline unsigned short StFmsPoint::detectorId() const { return mDetectorId; }
125 inline float StFmsPoint::energy() const { return mEnergy; }
126 inline float StFmsPoint::x() const { return mX; } // x position in cm at which point intersects the sub-detector.
127 inline float StFmsPoint::y() const { return mY; } // y position in cm at which point intersects the sub-detector.
128 inline int StFmsPoint::id() const { return mId; } // ID of the point in the current event.
129 inline StFmsCluster* StFmsPoint::cluster() { return mCluster; } // Parent cluster of the photon.
130 inline const StFmsCluster* StFmsPoint::cluster() const { return mCluster; }
131 inline int StFmsPoint::parentClusterId() const { return mParentClusterId; } // ID of the parent cluster
132  // containing this point.
133 inline int StFmsPoint::nParentClusterPhotons() const { return mNParentClusterPhotons; } // Number of points
134  // in the parent cluster.
135 inline const StThreeVectorF& StFmsPoint::XYZ() const { return mXYZ; }
136 inline const StLorentzVectorF& StFmsPoint::fourMomentum() const { return mFourMomentum; }
137 inline void StFmsPoint::setDetectorId(unsigned short detector) { mDetectorId = detector; }
138 inline void StFmsPoint::setEnergy(float energy) { mEnergy = energy; }
139 inline void StFmsPoint::setX(float xpos) { mX = xpos; }
140 inline void StFmsPoint::setY(float ypos) { mY = ypos; }
141 inline void StFmsPoint::setId(int phid) { mId = phid; }
142 inline void StFmsPoint::setCluster(StFmsCluster* cluster) { mCluster = cluster; }
143 inline void StFmsPoint::setParentClusterId(int cluid) { mParentClusterId = cluid; }
144 inline void StFmsPoint::setNParentClusterPhotons(int nclph) { mNParentClusterPhotons = nclph; }
145 inline void StFmsPoint::setXYZ(const StThreeVectorF& p3) { mXYZ = p3; }
146 inline void StFmsPoint::setFourMomentum(const StLorentzVectorF& p4) { mFourMomentum = p4; }
147 inline int StFmsPoint::fpsPid() {return mFpsPid;}
148 inline void StFmsPoint::setFpsPid(int v) {mFpsPid=v;}
149 inline const char* StFmsPoint::pidName(int i) {
150  switch(i){
151  case kFpsPidNoFps: return "NoDet ";
152  case kFpsPidBad: return "Bad ";
153  case kFpsPidGamma1: return "GNC ";
154  case kFpsPidGamma2: return "GC ";
155  case kFpsPidGamma3: return "GNCwL1H";
156  case kFpsPidGamma4: return "GNCwL2H";
157  case kFpsPidGamma5: return "GCwL1H ";
158  case kFpsPidGamma6: return "GCwL2H ";
159  case kFpsPidGamma7: return "G2e+e- ";
160  case kFpsPidMip: return "MIP ";
161  case kFpsPidElectron1: return "Egolden";
162  case kFpsPidElectron2: return "EwL1H ";
163  case kFpsPidElectron3: return "EwL2H ";
164  case kFpsPidUnknown: return "NOL3 ";
165  default: return "???? ";
166  }
167 }
168 
169 
170 #endif // StFmsPoint_h
171