StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEStructTrack.h
1 /**********************************************************************
2  *
3  * $Id: StEStructTrack.h,v 1.11 2012/11/16 21:24:38 prindle Exp $
4  *
5  * Author: Jeff Porter merge of work from Aya Ishihara and Jeff Reid
6  *
7  **********************************************************************
8  *
9  * Description: Estruct Track
10  *
11  ***********************************************************************/
12 
13 #ifndef _StEStructTrack
14 #define _StEStructTrack
15 
16 #include <math.h>
17 #include "TObject.h"
18 #include "StHelixD.hh"
19 #include "StThreeVectorF.hh"
20 #include "StThreeVectorD.hh"
21 #include "StLorentzVectorF.hh"
22 #include "StHelix.hh"
23 #include "StPhysicalHelixD.hh"
24 #include "StPhysicalHelix.hh"
25 
26 class StEStructTrack : public TObject {
27 
28 private:
29 
30  Float_t mPx;
31  Float_t mPy;
32  Float_t mPz;
33 
34  Float_t mEta;
35  Float_t mPhi;
36 
37  Float_t mBxPrimary;
38  Float_t mByPrimary;
39  Float_t mBzPrimary;
40 
41  Float_t mBxGlobal;
42  Float_t mByGlobal;
43  Float_t mBzGlobal;
44 
45  Int_t mPID;
46  Int_t mPID_dEdx;
47  Int_t mPID_ToF;
48  Float_t mDedx;
49  Float_t mPIDe_dEdx;
50  Float_t mPIDpi_dEdx;
51  Float_t mPIDp_dEdx;
52  Float_t mPIDk_dEdx;
53  Float_t mPIDd_dEdx;
54  Float_t mPIDe_ToF;
55  Float_t mPIDpi_ToF;
56  Float_t mPIDp_ToF;
57  Float_t mPIDk_ToF;
58  Float_t mPIDd_ToF;
59  Float_t mBeta;
60  Float_t mMass;
61 
62  Float_t mChi2;
63 
64  Int_t mNFitPoints;
65  Int_t mNFoundPoints;
66  Int_t mNMaxPoints;
67 
68  Int_t mDetectorID;
69  Int_t mFlag;
70 
71  Short_t mCharge;
72  ULong_t mMap[2];
73  UInt_t mTPCNHits;
74 
75  //-> From old StEbye2ptTrack.... note none are persistent
76 
77  Bool_t mIsComplete;
78  StPhysicalHelixD mHelix;
79  Float_t mPt;
80  Float_t mPtot;
81  Float_t mYt;
82  Float_t mXt;
83  Float_t mCurvature;
84  Float_t mAssignedMass;
85  Float_t mMidTPCRadius; //|
86  Float_t mOuterMidTPCRadius; //|
87  Float_t mMaxRadius; //|
88  Float_t mEndCapRadius; //|
89  Int_t mEndCapOuterMid;
90  Int_t mEndCapOuter;
91  StLorentzVectorF mFourMomentum;
92  StThreeVectorF mStartPos;
93  StThreeVectorF mNominalTpcExitPoint;
94  StThreeVectorF mNominalTpcEntrancePoint;
95  StThreeVectorF mMidTpcPoint;
96  StThreeVectorF mOuterMidTpcPoint;
97  int mytbin;
98 
99 
100 public:
101 
102  StEStructTrack() : mIsComplete(false), mAssignedMass(0.1396) {};
104  virtual ~StEStructTrack() {};
105 
106  static StThreeVectorD PrimVertex;
107  static Float_t BField;
108  void FillTransientData();
109  void evalPt();
110  void evalPtot();
111  void evalYt();
112  void evalXt();
113  void evalCurvature();
114  void evalFourMomentum(float mass=0);
115  void evalPID();
116  void evalMass();
117  void evalTrajectory(float primvx, float primvy, float primvz, double bfield);
118  void FillTpcReferencePoints();
119 
120  // functions which simply return data members
121  Float_t Px() const { return mPx; }
122  Float_t Py() const { return mPy; }
123  Float_t Pz() const { return mPz; }
124 
125  Float_t Eta() const { return mEta; }
126  Float_t Phi() const { return mPhi; }
127 
128  Float_t Bx() const { return mBxPrimary; }
129  Float_t By() const { return mByPrimary; }
130  Float_t Bz() const { return mBzPrimary; }
131 
132  Float_t BxPrimary() const { return mBxPrimary; }
133  Float_t ByPrimary() const { return mByPrimary; }
134  Float_t BzPrimary() const { return mBzPrimary; }
135 
136  Float_t BxGlobal() const { return mBxGlobal; }
137  Float_t ByGlobal() const { return mByGlobal; }
138  Float_t BzGlobal() const { return mBzGlobal; }
139 
140  Int_t PID() const { return mPID; }
141  Int_t PID_dEdx() const { return mPID_dEdx; }
142  Int_t PID_ToF() const { return mPID_ToF; }
143 
144  Float_t PIDe_dEdx() const { return mPIDe_dEdx; }
145  Float_t PIDpi_dEdx() const { return mPIDpi_dEdx; }
146  Float_t PIDp_dEdx() const { return mPIDp_dEdx; }
147  Float_t PIDk_dEdx() const { return mPIDk_dEdx; }
148  Float_t PIDd_dEdx() const { return mPIDd_dEdx; }
149 
150  Float_t PIDe_ToF() const { return mPIDe_ToF; }
151  Float_t PIDpi_ToF() const { return mPIDpi_ToF; }
152  Float_t PIDp_ToF() const { return mPIDp_ToF; }
153  Float_t PIDk_ToF() const { return mPIDk_ToF; }
154  Float_t PIDd_ToF() const { return mPIDd_ToF; }
155 
156  Float_t beta() const { return mBeta; }
157  Float_t Dedx() const { return mDedx; }
158  Float_t Mass() const { return mMass; }
159  Float_t Chi2() const { return mChi2; }
160  Float_t AssignedMass() const { return mAssignedMass; };
161  Float_t MidTPCRadius() const { return mMidTPCRadius; };
162  Float_t OuterMidTPCRadius() const { return mOuterMidTPCRadius; };
163  Float_t MaxRadius() const { return mMaxRadius; };
164  Float_t EndCapRadius() const { return mEndCapRadius; };
165  Int_t EndCapOuter() const { return mEndCapOuter; };
166  Int_t EndCapOuterMid() const { return mEndCapOuterMid; };
167 
168  Int_t NFitPoints() const { return mNFitPoints; }
169  Int_t NFoundPoints() const { return mNFoundPoints; }
170  Int_t NMaxPoints() const { return mNMaxPoints; }
171 
172  Int_t DetectorID() const { return mDetectorID; }
173  Int_t Flag() const { return mFlag; }
174 
175  Short_t Charge() const { return mCharge; }
176 
177  ULong_t TopologyMapData(const Int_t word) const { return mMap[word];}
178  UInt_t TopologyMapTPCNHits() const {return mTPCNHits;}
179  int getYtBin() const;
180 
181  // functions which do some simple calculations
182  // using information contained in data members
183  Float_t Pt() const;
184  Float_t Ptot() const;
185  Float_t Mt(Float_t mass) const;
186  Float_t E(Float_t mass) const;
187  Float_t Eta(Float_t mass) const;
188  Float_t Rapidity(Float_t mass) const;
189 
190 
191  Float_t Dca() const;
192  Float_t DcaPrimary() const;
193  Float_t DcaGlobal() const;
194 
195  // accessors to transient data ...
196  Bool_t isComplete() const { return mIsComplete; };
197  const StThreeVectorF& NominalTpcExitPoint() const;
198  const StThreeVectorF& NominalTpcEntrancePoint() const;
199  const StThreeVectorF& MidTpcPoint() const;
200  const StThreeVectorF& OuterMidTpcPoint() const;
201  const StThreeVectorF& StartPos() const;
202  const StLorentzVectorF& FourMomentum() const;
203  const StPhysicalHelixD& Helix() const;
204 
205  Float_t Xt() const;
206  Float_t Yt() const;
207  Float_t Yt(Float_t mass) const;
208  Float_t Curvature() const;
209 
210  // functions used to set data members
211  void SetPx(Float_t px) { mPx = px; }
212  void SetPy(Float_t py) { mPy = py; }
213  void SetPz(Float_t pz) { mPz = pz; }
214 
215  void SetEta(Float_t eta) { mEta = eta; }
216  void SetPhi(Float_t phi) { mPhi = phi; }
217 
218  void SetBx(Float_t bx) { mBxPrimary = bx; }
219  void SetBy(Float_t by) { mByPrimary = by; }
220  void SetBz(Float_t bz) { mBzPrimary = bz; }
221 
222  void SetBxPrimary(Float_t bxp) { mBxPrimary = bxp; }
223  void SetByPrimary(Float_t byp) { mByPrimary = byp; }
224  void SetBzPrimary(Float_t bzp) { mBzPrimary = bzp; }
225 
226  void SetBxGlobal(Float_t bxg) { mBxGlobal = bxg; }
227  void SetByGlobal(Float_t byg) { mByGlobal = byg; }
228  void SetBzGlobal(Float_t bzg) { mBzGlobal = bzg; }
229 
230  void SetPIDe_dEdx(Float_t pide) { mPIDe_dEdx = pide; }
231  void SetPIDpi_dEdx(Float_t pidpi) { mPIDpi_dEdx = pidpi; }
232  void SetPIDp_dEdx(Float_t pidp) { mPIDp_dEdx = pidp; }
233  void SetPIDk_dEdx(Float_t pidk) { mPIDk_dEdx = pidk; }
234  void SetPIDd_dEdx(Float_t pidd) { mPIDd_dEdx = pidd; }
235 
236  void SetPIDe_ToF(Float_t pide) { mPIDe_ToF = pide; }
237  void SetPIDpi_ToF(Float_t pidpi) { mPIDpi_ToF = pidpi; }
238  void SetPIDp_ToF(Float_t pidp) { mPIDp_ToF = pidp; }
239  void SetPIDk_ToF(Float_t pidk) { mPIDk_ToF = pidk; }
240  void SetPIDd_ToF(Float_t pidd) { mPIDd_ToF = pidd; }
241 
242  void SetBeta(Float_t beta) { mBeta = beta; }
243  void SetDedx(Float_t dedx) { mDedx = dedx; }
244  void SetMass(Float_t mass) { mMass = mass; }
245  void SetChi2(Float_t chi2) { mChi2 = chi2; }
246  void SetMassAssignment(float mass){ mAssignedMass=mass; };
247  void SetNFitPoints(Int_t nfit) { mNFitPoints = nfit; }
248  void SetNFoundPoints(Int_t nfound) { mNFoundPoints = nfound; }
249  void SetNMaxPoints(Int_t nmax) { mNMaxPoints = nmax; }
250 
251  void SetDetectorID(Int_t did) { mDetectorID = did; }
252  void SetFlag(Int_t flag) { mFlag = flag; }
253 
254  void SetCharge(Short_t charge) { mCharge = charge; }
255  void SetTopologyMapData(const int word, const ULong_t map){ mMap[word] = map;}
256  void SetTopologyMapTPCNHits(Int_t nhits) {mTPCNHits = nhits;}
257 
258  void SetComplete() { mIsComplete=true; };
259  void SetInComplete() { mIsComplete=false; };
260 
261  void SetHelix(StPhysicalHelixD h) {mHelix=h;}
262 
263  ClassDef(StEStructTrack, 2) // macro for rootcint
264 };
265 
266 inline void StEStructTrack::evalPt(){ mPt=sqrt((mPx*mPx)+(mPy*mPy)); }
267 inline void StEStructTrack::evalPtot(){ mPtot=sqrt((mPx*mPx)+(mPy*mPy)+(mPz*mPz)); }
268 inline void StEStructTrack::evalMass() {
269  if (mBeta >= 1.0) {
270  mMass = -mPtot * sqrt( 1- pow(mBeta,-2));
271  } else if (mBeta > 0) {
272  mMass = mPtot * sqrt( pow(mBeta,-2) - 1);
273  } else {
274  mMass = 0;
275  }
276 }
277 inline const StThreeVectorF& StEStructTrack::NominalTpcExitPoint() const { return mNominalTpcExitPoint; }
278 inline const StThreeVectorF& StEStructTrack::NominalTpcEntrancePoint() const { return mNominalTpcEntrancePoint; };
279 inline const StThreeVectorF& StEStructTrack::MidTpcPoint() const{ return mMidTpcPoint; };
280 inline const StThreeVectorF& StEStructTrack::OuterMidTpcPoint() const{ return mOuterMidTpcPoint; };
281 inline const StThreeVectorF& StEStructTrack::StartPos() const{ return mStartPos; };
282 inline const StLorentzVectorF& StEStructTrack::FourMomentum() const { return mFourMomentum;};
283 inline const StPhysicalHelixD& StEStructTrack::Helix() const{ return mHelix;};
284 
285 inline Float_t StEStructTrack::Xt() const { return mXt;};
286 inline Float_t StEStructTrack::Yt() const { return mYt;};
287 inline Float_t StEStructTrack::Curvature() const { return mCurvature;};
288 inline int StEStructTrack::getYtBin() const { return mytbin; };
289 
290 #endif
291 
292 
293 /***********************************************************************
294  *
295  * $Log: StEStructTrack.h,v $
296  * Revision 1.11 2012/11/16 21:24:38 prindle
297  * Changes to support reading/writing of EStructEvent. Fill helix as transient and
298  * get BField from file (?).
299  *
300  * Revision 1.10 2011/08/02 20:36:57 prindle
301  * Event: modifications for ZDCCoincidence
302  * Track: big changes in evalPID. These should be superseded when TOF-dEdx
303  * space is understood better.
304  *
305  * Revision 1.9 2010/09/02 21:26:29 prindle
306  * Track: Added ToF pid information, modify dEdx, add combined pid code.
307  *
308  * Revision 1.8 2010/03/02 21:47:18 prindle
309  * Support to retrieve track radius when it crosses endplate
310  * Add way to retrieve centrality
311  *
312  * Revision 1.7 2008/12/02 23:45:49 prindle
313  * Added curvature and calculation of OuterMidTpcPoint.
314  *
315  * Revision 1.6 2006/02/22 22:06:09 prindle
316  * Removed all references to multRef (?)
317  *
318  * Revision 1.5 2005/09/14 17:21:20 msd
319  * Simplified helix fitting by taking helix from mudst instead of calculating from scratch
320  *
321  * Revision 1.4 2005/07/07 19:31:13 fisyak
322  * Add default for mHelix
323  *
324  * Revision 1.3 2005/03/03 01:32:03 porter
325  * fixed a bug setting 4-momentum and added data (+accessors)
326  * to the track class
327  *
328  * Revision 1.2 2004/06/28 23:23:14 chunhuih
329  *
330  * add 'const' specification to a set of member functions, including some of
331  * the return types, so that they can be used by a const StEStructTrack object.
332  *
333  * Revision 1.1 2003/10/15 18:20:51 porter
334  * initial check in of Estruct Analysis maker codes.
335  *
336  *
337  *********************************************************************/