StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StChargedPionTrack.h
1 #ifndef ST_CHARGED_PION_TRACK_HH
2 #define ST_CHARGED_PION_TRACK_HH
3 
4 // $Id: StChargedPionTrack.h,v 1.6 2012/11/09 03:31:34 perev Exp $
5 
6 #include "StPhysicalHelixD.hh"
7 #include "StThreeVectorF.hh"
8 
9 #include "TObject.h"
10 #include "TLorentzVector.h"
11 
12 class StChargedPionTrack : public TLorentzVector
13 {
14 public:
16  virtual ~StChargedPionTrack();
18 
19  short id() const;
20  short flag() const;
21 
22  short vertexIndex() const;
23  StThreeVectorF vertex() const;
24 
25  unsigned short nHits() const;
26  unsigned short nHitsPoss() const;
27  unsigned short nHitsDedx() const;
28  unsigned short nHitsFit() const;
29 
30  float nSigmaElectron() const;
31  float nSigmaPion() const;
32  float nSigmaKaon() const;
33  float nSigmaProton() const;
34  float dEdx() const;
35 
36  float chi2() const;
37  float chi2prob() const;
38 
39  float pt() const;
40  float phi() const;
41  float eta() const;
42 
43  short charge() const;
44  double B() const;
45 
46  //some random stuff
47  double length() const;
48  double lengthMeasured() const;
49 
50  //global track properties
54 
55  //these are calculated using first measured point
56  double globalPt() const;
57  double globalPhi() const;
58  double globalEta() const;
59  TLorentzVector globalP() const;
60 
61  //can choose a different point if you like ... specify vertex to recover StMuTrack global kinematics
62  double globalPt(StThreeVectorF position) const;
63  double globalPhi(StThreeVectorF position) const;
64  double globalEta(StThreeVectorF position) const;
65  TLorentzVector globalP(StThreeVectorF position) const;
66 
67  StThreeVectorF globalDca() const;
68  StThreeVectorF globalDca(StThreeVectorF position) const;
69 
70  //setters
71  void setId(short aId) {mId = aId;}
72  void setFlag(short aFlag) {mFlag = aFlag;}
73 
74  void setVertexIndex(int aVertexIndex) {mVertexIndex = aVertexIndex;}
75  void setVertex(StThreeVectorF aPosition) {mVertex = aPosition;}
76 
77  void setNHits(unsigned short aNHits) {mNHits = aNHits;}
78  void setNHitsPoss(unsigned short aNHitsPoss) {mNHitsPoss = aNHitsPoss;}
79  void setNHitsDedx(unsigned short aNHitsDedx) {mNHitsDedx = aNHitsDedx;}
80  void setNHitsFit(unsigned short aNHitsFit) {mNHitsFit = aNHitsFit;}
81 
82  void setNSigmaElectron(float aNSigmaElectron) {mNSigmaElectron = aNSigmaElectron;}
83  void setNSigmaPion(float aNSigmaPion) {mNSigmaPion = aNSigmaPion;}
84  void setNSigmaKaon(float aNSigmaKaon) {mNSigmaKaon = aNSigmaKaon;}
85  void setNSigmaProton(float aNSigmaProton) {mNSigmaProton = aNSigmaProton;}
86  void setDedx(float aDedx) {mdEdx = aDedx;}
87 
88  void setChi2(float aChi2) {mChi2 = aChi2;}
89  void setChi2prob(float aChi2Prob) {mChi2Prob = aChi2Prob;}
90 
91  void setPtEtaPhi(float aPt, float aEta, float aPhi);
92  void setPt(float aPt);
93  void setPhi(float aPhi);
94  void setEta(float aEta);
95 
96  void setCharge(short aCharge) {mCharge = aCharge;}
97  void setB(double aMagneticField) {mB = aMagneticField;}
98 
99  void setGlobalLastPoint(StThreeVectorF aLastPoint) {mGlobalLastPoint = aLastPoint;}
100  void setGlobalHelix(StPhysicalHelixD aHelix) {mGlobalHelix = aHelix;}
101 
102 protected:
103  //basic QA -- could also use fBits to store online sanity checks
104  Short_t mId;
105  Short_t mFlag;
106 
107  Char_t mVertexIndex;
108  StThreeVectorF mVertex; //stored for convenience of DCA calculation
109 
110  UChar_t mNHits;
111  UChar_t mNHitsPoss;
112  UChar_t mNHitsDedx;
113  UChar_t mNHitsFit;
114 
115  Float_t mNSigmaElectron;
116  Float_t mNSigmaPion;
117  Float_t mNSigmaKaon;
118  Float_t mNSigmaProton;
119  Float_t mdEdx;
120 
121  Float_t mChi2;
122  Float_t mChi2Prob;
123 
124  Char_t mCharge;
125  Double_t mB;
126 
127  //global track properties -- most can be recalculated from helix
128  StThreeVectorF mGlobalLastPoint;
129  StPhysicalHelixD mGlobalHelix;
130 
131  ClassDef(StChargedPionTrack,2)
132 };
133 
134 inline short StChargedPionTrack::id() const {return mId;}
135 inline short StChargedPionTrack::flag() const {return mFlag;}
136 
137 inline short StChargedPionTrack::vertexIndex() const {return mVertexIndex;}
138 inline StThreeVectorF StChargedPionTrack::vertex() const {return mVertex;}
139 
140 inline unsigned short StChargedPionTrack::nHits() const {return mNHits;}
141 inline unsigned short StChargedPionTrack::nHitsPoss() const {return mNHitsPoss;}
142 inline unsigned short StChargedPionTrack::nHitsDedx() const {return mNHitsDedx;}
143 inline unsigned short StChargedPionTrack::nHitsFit() const {return mNHitsFit;}
144 
145 inline float StChargedPionTrack::nSigmaElectron() const {return mNSigmaElectron;}
146 inline float StChargedPionTrack::nSigmaPion() const {return mNSigmaPion;}
147 inline float StChargedPionTrack::nSigmaKaon() const {return mNSigmaKaon;}
148 inline float StChargedPionTrack::nSigmaProton() const {return mNSigmaProton;}
149 inline float StChargedPionTrack::dEdx() const {return mdEdx;}
150 
151 inline float StChargedPionTrack::chi2() const {return mChi2;}
152 inline float StChargedPionTrack::chi2prob() const {return mChi2Prob;}
153 
154 inline float StChargedPionTrack::pt() const {return this->Pt();}
155 inline float StChargedPionTrack::phi() const {return this->Phi();}
156 inline float StChargedPionTrack::eta() const {return this->Eta();}
157 
158 inline short StChargedPionTrack::charge() const {return mCharge;}
159 inline double StChargedPionTrack::B() const {return mB;}
160 
161 inline StThreeVectorF StChargedPionTrack::globalLastPoint() const {return mGlobalLastPoint;}
162 inline StPhysicalHelixD StChargedPionTrack::globalHelix() const {return mGlobalHelix;}
164 
165 #endif
166 
167 /*****************************************************************************
168  * $Log: StChargedPionTrack.h,v $
169  * Revision 1.6 2012/11/09 03:31:34 perev
170  * Cleanup
171  *
172  * Revision 1.5 2008/12/29 15:58:31 kocolosk
173  * removed commented code and added $Id: StChargedPionTrack.h,v 1.6 2012/11/09 03:31:34 perev Exp $/$Log: StChargedPionTrack.h,v $
174  * removed commented code and added $Id$/Revision 1.6 2012/11/09 03:31:34 perev
175  * removed commented code and added $Id$/Cleanup
176  * removed commented code and added $Id$/ as needed
177  *
178  *****************************************************************************/
StThreeVector< double > globalFirstPoint() const
Returns positions of first measured point on global track.
float nSigmaElectron() const
Returns Craig&#39;s distance to the calculated dE/dx band for electrons in units of sigma.
short charge() const
Returns charge.
StThreeVectorF vertex() const
Position of vertex for this track.
float nSigmaKaon() const
Returns Craig&#39;s distance to the calculated dE/dx band for kaons in units of sigma.
StThreeVectorF globalLastPoint() const
Returns positions of last measured point on global track.
StPhysicalHelixD globalHelix() const
Returns inner helix (first measured point on global track).
double lengthMeasured() const
Returns length of track (cm) from first to last measured point.
float phi() const
Returns phi at point of dca to primary vertex.
unsigned short nHitsDedx() const
Return number of hits used for dEdx.
float chi2prob() const
Returns probability of fit.
double length() const
Returns length of track (cm) from primary vertex to last measured point.
short flag() const
Returns flag, (see StEvent manual for type information)
double B() const
Returns signed magnetic field.
float nSigmaPion() const
Returns Craig&#39;s distance to the calculated dE/dx band for pions in units of sigma.
unsigned short nHits() const
Return total number of hits on track.
short id() const
Returns the track id(or key), is unique for a track node, i.e. global and primary tracks have the sam...
float pt() const
Returns pT at point of dca to primary vertex.
float eta() const
Returns pseudo rapidity at point of dca to primary vertex.
float dEdx() const
Returns measured dE/dx value.
const StThreeVector< double > & origin() const
-sign(q*B);
Definition: StHelix.hh:224
unsigned short nHitsFit() const
Return total number of hits used in fit.
StThreeVectorF globalDca() const
Returns 3D distance of closest approach to primary vertex.
short vertexIndex() const
Returns index of associated primary vertex.
unsigned short nHitsPoss() const
Return number of possible hits on track.
float nSigmaProton() const
Returns Craig&#39;s distance to the calculated dE/dx band for protons in units of sigma.
float chi2() const
Returns chi2 of fit.