StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StHbtTrack.cc
1 /***************************************************************************
2  *
3  * $Id: StHbtTrack.cc,v 1.19 2005/07/15 17:41:43 kopytin Exp $
4  *
5  * Author: Frank Laue, Ohio State, laue@mps.ohio-state.edu
6  ***************************************************************************
7  *
8  * Description: part of STAR HBT Framework: StHbtMaker package
9  * Implementation of methods
10  *
11  ***************************************************************************
12  * $Log: StHbtTrack.cc,v $
13  * Revision 1.19 2005/07/15 17:41:43 kopytin
14  * initialized mHiddenInfo in StHbtTrack() to null
15  *
16  * Revision 1.18 2005/07/10 02:17:21 chajecki
17  * Ftpc (Eeat+West) hits included in nHits()
18  *
19  * Revision 1.17 2005/06/17 21:41:12 chajecki
20  * Two bugs fixed:
21  * 1. wrong value of mNHits set in one of the constructors
22  * StHbtTrack::StHbtTrack(const StTrack* ST, StHbtThreeVector PrimaryVertex)
23  *
24  * 2. since year 4 the StMuTrack::nHits() returns the total number of hits.
25  * We're interested in TPC hits only so this value can be taken by
26  * StMuTrack::topologyMap().numberOfHits(kTpcId);
27  * This change is backwards compatible so the code should work also
28  * for data <=Y3
29  *
30  * Revision 1.16 2003/03/18 14:41:48 kisiel
31  * Bugfix update for the theoretical part of the code. Reverts the changes to the Lednicky weight calculator, as the previuos one had problems with strong interaction
32  *
33  * Revision 1.15 2003/01/31 19:57:15 magestro
34  * Cleared up simple compiler warnings on i386_linux24
35  *
36  * Revision 1.14 2003/01/21 17:26:33 magestro
37  * Added condition to globalTrack() call so GlobalTracks branch in MuDst can be disabled
38  *
39  * Revision 1.13 2002/03/21 18:49:31 laue
40  * updated for new MuDst reader
41  *
42  * Revision 1.12 2002/02/04 18:58:33 laue
43  * *** empty log message ***
44  *
45  * Revision 1.11 2001/12/14 23:11:30 fretiere
46  * Add class HitMergingCut. Add class fabricesPairCut = HitMerginCut + pair purity cuts. Add TpcLocalTransform function which convert to local tpc coord (not pretty). Modify StHbtTrack, StHbtParticle, StHbtHiddenInfo, StHbtPair to handle the hit information and cope with my code
47  *
48  * Revision 1.4 2001/06/21 19:15:48 laue
49  * Modified fiels:
50  * CTH.hh : new constructor added
51  * StHbtEvent, StHbtKink, StHbtTrack : constructors from the persistent
52  * (TTree) classes added
53  * StHbtLikeSignAnalysis : minor changes, for debugging
54  * StHbtTypes: split into different files
55  * Added files: for the new TTree muDst's
56  * StExceptions.cxx StExceptions.hh StHbtEnumeration.hh
57  * StHbtHelix.hh StHbtHisto.hh StHbtString.hh StHbtTFile.hh
58  * StHbtTTreeEvent.cxx StHbtTTreeEvent.h StHbtTTreeKink.cxx
59  * StHbtTTreeKink.h StHbtTTreeTrack.cxx StHbtTTreeTrack.h
60  * StHbtTTreeV0.cxx StHbtTTreeV0.h StHbtVector.hh
61  *
62  * Revision 1.3 2001/05/25 23:23:59 lisa
63  * Added in StHbtKink stuff
64  *
65  *
66  ****************************************************************************/
67 
68 #include "StHbtMaker/Infrastructure/StHbtTrack.hh"
69 #ifdef __ROOT__
70 #include "StHbtMaker/Infrastructure/StHbtTTreeEvent.h"
71 #include "StHbtMaker/Infrastructure/StHbtTTreeTrack.h"
72 #include "StEvent/StEnumerations.h"
73 #include "StHbtMaker/Infrastructure/StHbtAihongPid.h"
74 #include "StEventUtilities/StuProbabilityPidAlgorithm.h"
75 #endif
76 
77 StHbtTrack::StHbtTrack()
78 {
79  mHiddenInfo = NULL;
80 }
81 
82 
83 StHbtTrack::StHbtTrack(const StHbtTrack& t) { // copy constructor
84  mTrackType = t.mTrackType;
85  mCharge = t.mCharge;
86  mNHits = t.mNHits;
87  mNHitsPoss = t.mNHitsPoss;
88  mNHitsDedx = t.mNHitsDedx;
89  mNSigmaElectron = t.mNSigmaElectron;
90  mNSigmaPion = t.mNSigmaPion;
91  mNSigmaKaon = t.mNSigmaKaon;
92  mNSigmaProton = t.mNSigmaProton;
93  mPidProbElectron = t.mPidProbElectron;
94  mPidProbPion = t.mPidProbPion;
95  mPidProbKaon = t.mPidProbKaon;
96  mPidProbProton = t.mPidProbProton;
97  mdEdx = t.mdEdx;
98  mDCAxy = t.mDCAxy;
99  mDCAz = t.mDCAz;
100  mDCAxyGlobal = t.mDCAxyGlobal;
101  mDCAzGlobal = t.mDCAzGlobal;
102  mChiSqXY = t.mChiSqXY;
103  mChiSqZ = t.mChiSqZ;
104  mP = t.mP;
105  mPt = t.mPt;
106  mPGlobal = t.mPGlobal;
107  mPtGlobal = t.mPtGlobal;
108  mHelix = t.mHelix;
109  mHelixGlobal = t.mHelixGlobal;
110  mMap[0] = t.mMap[0];
111  mMap[1] = t.mMap[1];
112  mTrackId = t.mTrackId;
113  if (t.ValidHiddenInfo())
114  mHiddenInfo = t.getHiddenInfo()->clone();
115  else
116  mHiddenInfo = NULL;
117 };
118 //___________________________________________________
119 #ifdef __ROOT__
120 #include "StEventTypes.h"
121 #include "StEvent/StTpcDedxPidAlgorithm.h"
122 #include "StEventUtilities/StuRefMult.hh"
123 #include "StEvent/StEnumerations.h"
124 #include "StarClassLibrary/SystemOfUnits.h" // has "tesla" in it
125 #include "StarClassLibrary/StParticleTypes.hh"
126 #include "StHbtMaker/Infrastructure/StHbtTTreeEvent.h"
127 #include "StHbtMaker/Infrastructure/StHbtTTreeTrack.h"
128 
129 StHbtTrack::StHbtTrack(const StTrack* ST, StHbtThreeVector PrimaryVertex)
130 {
131  StTpcDedxPidAlgorithm PidAlgorithm;
132 
133  // while getting the bestGuess, the pidAlgorithm (StTpcDedxPidAlgorithm) is set up.
134  // pointers to track and pidTraits are set
135  // So, even though BestGuess will generate a "variable not used" warning, DO NOT DELETE THE NEXT LINE
136  // StParticleDefinition* BestGuess = (StParticleDefinition*)ST->pidTraits(PidAlgorithm);
137 
138  // the following just point to particle definitions in StEvent
139  StElectron* Electron = StElectron::instance();
140  StPionPlus* Pion = StPionPlus::instance();
141  StKaonPlus* Kaon = StKaonPlus::instance();
142  StProton* Proton = StProton::instance();
143 
144  // OK let's go...
145  mHiddenInfo = 0;
146  mTrackType = ST->type();
147  mCharge = ST->geometry()->charge();
148  mNHits = ST->detectorInfo()->numberOfPoints(kTpcId);
149  mNHitsPoss = ST->numberOfPossiblePoints(kTpcId);
150  mNHitsDedx = ST->fitTraits().numberOfFitPoints(kTpcId);
151 
152  mNSigmaElectron = PidAlgorithm.numberOfSigma(Electron);
153  mNSigmaPion = PidAlgorithm.numberOfSigma(Pion);
154  mNSigmaKaon = PidAlgorithm.numberOfSigma(Kaon);
155  mNSigmaProton = PidAlgorithm.numberOfSigma(Proton);
156  if ( PidAlgorithm.traits() )
157  mdEdx = PidAlgorithm.traits()->mean();
158  else
159  cout << "StHbtTrack(const StTrack* ST, StHbtThreeVector PrimaryVertex) - no traits " << endl;
160 
161  mChiSqXY = ST->fitTraits().chi2(0);
162  mChiSqZ = ST->fitTraits().chi2(1);
163 
164  mP = ST->geometry()->momentum();
165  mPt = mP.perp();
166  mHelix = ST->geometry()->helix();
167  double pathlength = ST->geometry()->helix().pathLength(PrimaryVertex);
168  StHbtThreeVector DCAxyz = ST->geometry()->helix().at(pathlength)-PrimaryVertex;
169  mDCAxy = DCAxyz.perp();
170  mDCAz = DCAxyz.z();
171 
172  mHelixGlobal = ST->node()->track(global)->geometry()->helix();
173  double pathlengthGlobal = mHelixGlobal.pathLength(PrimaryVertex);
174  StHbtThreeVector DCAxyzGlobal = mHelixGlobal.at(pathlengthGlobal)-PrimaryVertex;
175  mDCAxyGlobal = DCAxyzGlobal.perp();
176  mDCAzGlobal = DCAxyzGlobal.z();
177  mPGlobal = ST->node()->track(global)->geometry()->momentum();
178  mPtGlobal = mPGlobal.perp();
179 
180  mMap[0] = ST->topologyMap().data(0);
181  mMap[1] = ST->topologyMap().data(1);
182  mTrackId = ST->key();
183 }
184 
185 StHbtTrack::StHbtTrack(const StEvent* EV, const StTrack* ST) {
186  StTpcDedxPidAlgorithm PidAlgorithm;
187  // while getting the bestGuess, the pidAlgorithm (StTpcDedxPidAlgorithm) is set up.
188  // pointers to track and pidTraits are set
189  // So, even though BestGuess will generate a "variable not used" warning, DO NOT DELETE THE NEXT LINE
190  ST->pidTraits(PidAlgorithm);
191 
192  // the following just point to particle definitions in StEvent
193  StElectron* Electron = StElectron::instance();
194  StPionPlus* Pion = StPionPlus::instance();
195  StKaonPlus* Kaon = StKaonPlus::instance();
196  StProton* Proton = StProton::instance();
197 
198  // OK let's go...
199  mHiddenInfo = 0;
200  mTrackType = ST->type();
201  mCharge = ST->geometry()->charge();
202  mNHits = ST->detectorInfo()->numberOfPoints(kTpcId);
203  mNHitsPoss = ST->numberOfPossiblePoints(kTpcId);
204  mNHitsDedx = ST->fitTraits().numberOfFitPoints(kTpcId);
205 
206  mNSigmaElectron = PidAlgorithm.numberOfSigma(Electron);
207  mNSigmaPion = PidAlgorithm.numberOfSigma(Pion);
208  mNSigmaKaon = PidAlgorithm.numberOfSigma(Kaon);
209  mNSigmaProton = PidAlgorithm.numberOfSigma(Proton);
210  mdEdx = PidAlgorithm.traits()->mean();
211 
212 
213  mChiSqXY = ST->fitTraits().chi2(0);
214  mChiSqZ = ST->fitTraits().chi2(1);
215 
216  StHbtThreeVector primaryVertex = EV->primaryVertex()->position();
217 
218  mHelix = ST->geometry()->helix();
219  double pathlength = mHelix.pathLength(primaryVertex);
220  StHbtThreeVector DCAxyz = mHelix.at(pathlength)-primaryVertex;
221  mDCAxy = DCAxyz.perp();
222  mDCAz = DCAxyz.z();
223  mP = mHelix.momentumAt(pathlength,EV->summary()->magneticField()*kilogauss);
224  mPt = mP.perp();
225 
226  if(dynamic_cast<const StPrimaryTrack*>(ST)){
227  mHelixGlobal = ST->node()->track(global)->geometry()->helix();
228  }
229  else{
230  mHelixGlobal = mHelix;
231  }
232  double pathlengthGlobal = mHelixGlobal.pathLength(primaryVertex);
233  StHbtThreeVector DCAxyzGlobal = mHelixGlobal.at(pathlengthGlobal)-primaryVertex;
234  mDCAxyGlobal = DCAxyzGlobal.perp();
235  mDCAzGlobal = DCAxyzGlobal.z();
236  mPGlobal = mHelixGlobal.momentumAt(pathlengthGlobal,EV->summary()->magneticField()*kilogauss);
237  mPtGlobal = mPGlobal.perp();
238 
239  mMap[0] = ST->topologyMap().data(0);
240  mMap[1] = ST->topologyMap().data(1);
241  mTrackId = ST->key();
242 
243  // On the fly pid probability calculation
244  static int previousEventNumber = 0;
245  static StHbtAihongPid* hbtAihongPid = StHbtAihongPid::Instance();
246  static StuProbabilityPidAlgorithm* aihongPid = hbtAihongPid->aihongPid();
247  if( (mPidProbElectron+mPidProbPion+mPidProbKaon+mPidProbProton) <= 0.){
248  if (previousEventNumber != EV->info()->id()) {
249  // must do the below because uncorrectedNumberOfPositivePrimaries() function does not have const argument
250  StEvent* TempEv = (StEvent*)EV;
251  hbtAihongPid->updateEvent(uncorrectedNumberOfPositivePrimaries(*TempEv));
252  // hbtAihongPid->updateEvent(uncorrectedNumberOfPositivePrimaries(*EV));
253  previousEventNumber = EV->info()->id();
254  }
255  hbtAihongPid->updateTrack( (int)mCharge, mP.mag(), mP.pseudoRapidity(), mNHitsDedx, mdEdx);
256  mPidProbElectron= (mCharge>0) ? aihongPid->beingPositronProb() : aihongPid->beingElectronProb() ;
257  mPidProbPion= (mCharge>0) ? aihongPid->beingPionPlusProb() : aihongPid->beingPionMinusProb();
258  mPidProbKaon= (mCharge>0) ? aihongPid->beingKaonPlusProb() : aihongPid->beingKaonMinusProb();
259  mPidProbProton= (mCharge>0) ? aihongPid->beingProtonProb() : aihongPid->beingAntiProtonProb();
260  }
261 }
262 
263 // StHbtTrack::StHbtTrack(const StTrack* ST, StHbtThreeVector PrimaryVertex)
264 // {
265 // StTpcDedxPidAlgorithm* PidAlgorithm = new StTpcDedxPidAlgorithm();
266 // if (!PidAlgorithm) cout << " StHbtTrack::StHbtTrack(StTrack*) - Whoa!! No PidAlgorithm!! " << endl;
267 // // while getting the bestGuess, the pidAlgorithm (StTpcDedxPidAlgorithm) is set up.
268 // // pointers to track and pidTraits are set
269 // // So, even though BestGuess will generate a "variable not used" warning, DO NOT DELETE THE NEXT LINE
270 // StParticleDefinition* BestGuess = (StParticleDefinition*)ST->pidTraits(*PidAlgorithm);
271 
272 // // the following just point to particle definitions in StEvent
273 // StElectron* Electron = StElectron::instance();
274 // StPionPlus* Pion = StPionPlus::instance();
275 // StKaonPlus* Kaon = StKaonPlus::instance();
276 // StProton* Proton = StProton::instance();
277 
278 
279 
280 // // OK let's go...
281 // mHiddenInfo = 0;
282 // mTrackType = ST->type();
283 // mCharge = ST->geometry()->charge();
284 // mNHits = ST->detectorInfo()->numberOfPoints(kTpcId);
285 // mNHitsPoss = ST->numberOfPossiblePoints(kTpcId);
286 // mNSigmaElectron = PidAlgorithm->numberOfSigma(Electron);
287 // mNSigmaPion = PidAlgorithm->numberOfSigma(Pion);
288 // mNSigmaKaon = PidAlgorithm->numberOfSigma(Kaon);
289 // mNSigmaProton = PidAlgorithm->numberOfSigma(Proton);
290 // const StDedxPidTraits* tTrait = PidAlgorithm->traits();
291 // if(tTrait) {mdEdx = tTrait->mean();}
292 // else{
293 // mdEdx = 0;
294 // cerr << "No pid trait!!!" << endl;
295 // }
296 
297 // mP = ST->geometry()->momentum();
298 // mPt = mP.perp();
299 
300 // double pathlength = ST->geometry()->helix().pathLength(PrimaryVertex);
301 // StHbtThreeVector DCAxyz = ST->geometry()->helix().at(pathlength)-PrimaryVertex;
302 // mDCAxy = DCAxyz.perp();
303 // mDCAz = DCAxyz.z();
304 
305 // mChiSqXY = ST->fitTraits().chi2(0);
306 // mChiSqZ = ST->fitTraits().chi2(1);
307 // mHelix = ST->geometry()->helix();
308 // mHelixGlobal = ST->node()->track(global)->geometry()->helix();
309 // mMap[0] = ST->topologyMap().data(0);
310 // mMap[1] = ST->topologyMap().data(1);
311 // mTrackId = ST->key();
312 
313 // }
314 
315 StHbtTrack::StHbtTrack(const StHbtTTreeEvent* ev, const StHbtTTreeTrack* t) { // copy constructor
316  mTrackType = t->mTrackType;
317  mTrackId = t->mTrackId;
318  mNHits = t->mNHits;
319  mNHitsPoss = t->mNHitsPoss;
320  mNHitsDedx = t->mNHitsDedx;
321  mNSigmaElectron = t->mNSigmaElectron;
322  mNSigmaPion = t->mNSigmaPion;
323  mNSigmaKaon = t->mNSigmaKaon;
324  mNSigmaProton = t->mNSigmaProton;
325  mPidProbElectron = t->mPidProbElectron/1000.;
326  mPidProbPion = t->mPidProbPion/1000.;
327  mPidProbKaon = t->mPidProbKaon/1000.;
328  mPidProbProton = t->mPidProbProton/1000.;
329 
330  mdEdx = t->mdEdx;
331  mChiSqXY = t->mChiSqXY;
332  mChiSqZ = t->mChiSqZ;
333  mMap[0] = t->mMap[0];
334  mMap[1] = t->mMap[1];
335 
336  mHelix = StPhysicalHelixD(t->mHelixC,t->mHelixDip,t->mHelixPhase,
337  StThreeVectorD(t->mHelixX,t->mHelixY,t->mHelixZ),
338  t->mHelixH);
339  mHelixGlobal = StPhysicalHelixD(t->mHelixGlobalC,t->mHelixGlobalDip,t->mHelixGlobalPhase,
340  StThreeVectorD(t->mHelixGlobalX,t->mHelixGlobalY,t->mHelixGlobalZ),
341  t->mHelixGlobalH);
342  //ev->mMagneticField
343  // cout << mHelix << endl;
344  mCharge =mHelix.charge(ev->mMagneticField*kilogauss);
345  StHbtThreeVector vertex(ev->mVertexX,ev->mVertexY,ev->mVertexZ);
346  double pathlength = mHelix.pathLength(vertex);
347  // cout << pathlength << endl;
348  mP = mHelix.momentumAt(pathlength,ev->mMagneticField*kilogauss);
349  mPt = mP.perp();
350  // cout << mP << endl;
351  mDCAxy = (mHelix.at(pathlength) - vertex).perp();
352  mDCAz = (mHelix.at(pathlength) - vertex).z();
353 
354  double pathlengthGlobal = mHelixGlobal.pathLength(vertex);
355  mDCAxyGlobal = (mHelixGlobal.at(pathlengthGlobal) - vertex).perp();
356  mDCAzGlobal = (mHelixGlobal.at(pathlengthGlobal) - vertex).z();
357  mPGlobal = mHelixGlobal.momentumAt(pathlengthGlobal,ev->mMagneticField*kilogauss);
358  mPtGlobal = mPGlobal.perp();
359 
360  // On the fly pid probability calculation
361  static unsigned int previousEventNumber = 0;
362  static StHbtAihongPid* hbtAihongPid = StHbtAihongPid::Instance();
363  static StuProbabilityPidAlgorithm* aihongPid = hbtAihongPid->aihongPid();
364  if( (mPidProbElectron+mPidProbPion+mPidProbKaon+mPidProbProton) <= 0.){
365  if (previousEventNumber != ev->mEventNumber) {
366  hbtAihongPid->updateEvent((int)ev->mUncorrectedNumberOfNegativePrimaries);
367  previousEventNumber = ev->mEventNumber;
368  }
369  hbtAihongPid->updateTrack( (int)mCharge, mP.mag(), mP.pseudoRapidity(), mNHitsDedx, mdEdx);
370  mPidProbElectron= (mCharge>0) ? aihongPid->beingPositronProb() : aihongPid->beingElectronProb() ;
371  mPidProbPion= (mCharge>0) ? aihongPid->beingPionPlusProb() : aihongPid->beingPionMinusProb();
372  mPidProbKaon= (mCharge>0) ? aihongPid->beingKaonPlusProb() : aihongPid->beingKaonMinusProb();
373  mPidProbProton= (mCharge>0) ? aihongPid->beingProtonProb() : aihongPid->beingAntiProtonProb();
374  }
375 
376 
377  // Onfly pid probability calculation
378  int dontskip=0;
379  if(dontskip &&
380  (mPidProbElectron+mPidProbPion+mPidProbKaon+mPidProbProton) <= 0.){
381  static int NotFirst;
382  static StuProbabilityPidAlgorithm AihongsPID;
383  if(!NotFirst){
384  NotFirst=1;
385  StuProbabilityPidAlgorithm::readParametersFromFile("PIDTable.root");
386  }
387  static const StHbtTTreeEvent* evPrev;
388  if(evPrev!=ev){
389  // to be changed
390  int tRefMult = ev->mUncorrectedNumberOfNegativePrimaries;
391  double tCent;
392  if (tRefMult > 225 ) tCent = 0.03;
393  else if (tRefMult > 215 ) tCent = 0.05;
394  else if (tRefMult > 200 ) tCent = 0.07;
395  else if (tRefMult > 180 ) tCent = 0.10;
396  else if (tRefMult > 140 ) tCent = 0.18;
397  else if (tRefMult > 130 ) tCent = 0.20;
398  else if (tRefMult > 120 ) tCent = 0.23;
399  else if (tRefMult > 115 ) tCent = 0.24;
400  else if (tRefMult > 100 ) tCent = 0.28;
401  else tCent = 0.99;
402  evPrev=ev;
403  }
404  // AihongsPID.processPIDAsFunction(tCent, 0., (int) mCharge,mP.mag(),
405  // mP.pseudoRapidity(),mNHitsDedx,mdEdx);
406  mPidProbElectron= mCharge>0 ? AihongsPID.beingPositronProb() :
407  AihongsPID.beingElectronProb();
408  mPidProbPion= mCharge>0 ? AihongsPID.beingPionPlusProb():
409  AihongsPID.beingPionMinusProb();
410  mPidProbKaon= mCharge>0 ? AihongsPID.beingKaonPlusProb():
411  AihongsPID.beingKaonMinusProb();
412  mPidProbProton= mCharge>0 ? AihongsPID.beingProtonProb():
413  AihongsPID.beingAntiProtonProb();
414  }
415  mHiddenInfo = 0;
416 };
417 
418 #include "StMuDSTMaker/COMMON/StMuDst.h"
419 #include "StMuDSTMaker/COMMON/StMuEvent.h"
420 #include "StMuDSTMaker/COMMON/StMuTrack.h"
421 StHbtTrack::StHbtTrack(const StMuDst* dst, const StMuTrack* t) { // copy constructor
422  StMuEvent* ev = dst->event();
423  mTrackType = t->type();
424  mTrackId = t->id();
425 
426 
427  mNHits = t->topologyMap().numberOfHits(kTpcId) + t->topologyMap().numberOfHits(kFtpcEastId) + t->topologyMap().numberOfHits(kFtpcWestId);
428 
429  mNHitsPoss = t->nHitsPoss();
430  mNHitsDedx = t->nHitsDedx();
431  mNSigmaElectron = t->nSigmaElectron();
432  mNSigmaPion = t->nSigmaPion();
433  mNSigmaKaon = t->nSigmaKaon();
434  mNSigmaProton = t->nSigmaProton();
435  mPidProbElectron = t->pidProbElectron();
436  mPidProbPion = t->pidProbPion();
437  mPidProbKaon = t->pidProbKaon();
438  mPidProbProton = t->pidProbProton();
439  mdEdx = t->dEdx();
440  mChiSqXY = t->chi2xy();
441  mChiSqZ = t->chi2z();
442  mMap[0] = t->topologyMap().data(0);
443  mMap[1] = t->topologyMap().data(1);
444  mHelix = t->helix();
445  if(t->globalTrack()) mHelixGlobal = t->globalTrack()->helix();
446  mCharge = t->charge();
447 
448 
449  double pathlength = mHelix.pathLength(ev->primaryVertexPosition());
450  mP = mHelix.momentumAt(pathlength,ev->magneticField()*kilogauss);
451  mPt = mP.perp();
452  StThreeVectorD dca(mHelix.at(pathlength) - ev->primaryVertexPosition());
453  mDCAxy = dca.perp();
454  mDCAz = dca.z();
455 
456  if(t->globalTrack()) {
457  double pathlengthGlobal = mHelixGlobal.pathLength(ev->primaryVertexPosition());
458  mPGlobal = mHelixGlobal.momentumAt(pathlengthGlobal,ev->magneticField()*kilogauss);
459  mPtGlobal = mPGlobal.perp();
460  StThreeVectorD dcaGlobal(mHelixGlobal.at(pathlengthGlobal) - ev->primaryVertexPosition());
461  mDCAxyGlobal = dcaGlobal.perp();
462  mDCAzGlobal = dcaGlobal.z();
463  }
464 
465 // cout << "*******************" << endl;
466 // cout << " vertex " << ev->primaryVertexPosition() << endl;
467 // cout << " helix " << mHelix << endl;
468 // cout << " helix " << mHelixGlobal << endl;
469 // cout << " p " << mP << " pmag " << mP.mag() << " " << t->p() << endl;
470 // cout << " p " << mPGlobal << " pmag " << mPGlobal.mag() << endl;
471 // cout << " l " << pathlength << " dca " << dca << " dcamag " << dca.mag() << endl;
472 // cout << " l " << pathlengthGlobal << " dca " << dcaGlobal << " dcamag " << dcaGlobal.mag() << endl;
473 
474 
475  mHiddenInfo = 0;
476 };
477 
478 #endif
479 
480 void StHbtTrack::SetTrackType(const short& t){mTrackType=t;}
481 void StHbtTrack::SetCharge(const short& ch){mCharge=ch;}
482 void StHbtTrack::SetNHits(const short& nh){mNHits=nh;}
483 void StHbtTrack::SetNHitsPossible(const short& nh){mNHitsPoss=nh;}
484 void StHbtTrack::SetNHitsDedx(const short& nh){mNHitsDedx=nh;}
485 void StHbtTrack::SetNSigmaElectron(const float& x){mNSigmaElectron = x;}
486 void StHbtTrack::SetNSigmaPion(const float& x){mNSigmaPion = x;}
487 void StHbtTrack::SetNSigmaKaon(const float& x){mNSigmaKaon = x;}
488 void StHbtTrack::SetNSigmaProton(const float& x){mNSigmaProton = x;}
489 void StHbtTrack::SetPidProbElectron(const float& x){mPidProbElectron = x;}
490 void StHbtTrack::SetPidProbPion(const float& x){mPidProbPion = x;}
491 void StHbtTrack::SetPidProbKaon(const float& x){mPidProbKaon = x;}
492 void StHbtTrack::SetPidProbProton(const float& x){mPidProbProton = x;}
493 
494 void StHbtTrack::SetdEdx(const float& x){mdEdx = x;}
495 
496 void StHbtTrack::SetDCAxy(const float& x){mDCAxy = x;}
497 void StHbtTrack::SetDCAz(const float& x){mDCAz = x;}
498 void StHbtTrack::SetDCAxyGlobal(const float& x){mDCAxyGlobal = x;}
499 void StHbtTrack::SetDCAzGlobal(const float& x){mDCAzGlobal = x;}
500 void StHbtTrack::SetChiSquaredXY(const float& x){mChiSqXY = x;}
501 void StHbtTrack::SetChiSquaredZ(const float& x){mChiSqZ = x;}
502 void StHbtTrack::SetP(const StHbtThreeVector& p){mP = p;}
503 void StHbtTrack::SetPt(const float& pt){mPt = pt;}
504 void StHbtTrack::SetPGlobal(const StHbtThreeVector& p){mP = p;}
505 void StHbtTrack::SetPtGlobal(const float& pt){mPt = pt;}
506 void StHbtTrack::SetHelix(const StPhysicalHelixD& h){mHelix = h;}
507 void StHbtTrack::SetHelixGlobal(const StPhysicalHelixD& h){mHelixGlobal = h;}
508 void StHbtTrack::SetTopologyMap(const int word, const unsigned int map) { mMap[word]=map;}
509 void StHbtTrack::SetTrackId(const short & id) { mTrackId=id;}
510 
511 short StHbtTrack::TrackType() const {return mTrackType;}
512 short StHbtTrack::Charge() const {return mCharge;}
513 short StHbtTrack::NHits() const {return mNHits;}
514 short StHbtTrack::NHitsPossible() const {return mNHitsPoss;}
515 short StHbtTrack::NHitsDedx() const {return mNHitsDedx;}
516 float StHbtTrack::NSigmaElectron() const {return mNSigmaElectron;}
517 float StHbtTrack::NSigmaPion() const {return mNSigmaPion;}
518 float StHbtTrack::NSigmaKaon() const {return mNSigmaKaon;}
519 float StHbtTrack::NSigmaProton() const {return mNSigmaProton;}
520 float StHbtTrack::dEdx() const {return mdEdx;}
521 
522 float StHbtTrack::DCAxy() const {return mDCAxy;}
523 float StHbtTrack::DCAz() const {return mDCAz;}
524 float StHbtTrack::DCAxyGlobal() const {return mDCAxyGlobal;}
525 float StHbtTrack::DCAzGlobal() const {return mDCAzGlobal;}
526 float StHbtTrack::ChiSquaredXY() const {return mChiSqXY;}
527 float StHbtTrack::ChiSquaredZ() const {return mChiSqZ;}
528 StHbtThreeVector StHbtTrack::P() const {return mP;}
529 float StHbtTrack::Pt() const {return mPt;}
530 const StPhysicalHelixD& StHbtTrack::Helix() const {return mHelix;}
531 const StPhysicalHelixD& StHbtTrack::HelixGlobal() const {return mHelixGlobal;}
532 unsigned int StHbtTrack::TopologyMap(const unsigned int word) const { return mMap[word];}
533 short StHbtTrack::TrackId() const { return mTrackId; }
534 
535 void StHbtTrack::SetHiddenInfo(StHbtHiddenInfo* aHiddenInfo) {mHiddenInfo=aHiddenInfo;}
536 bool StHbtTrack::ValidHiddenInfo() const { if (mHiddenInfo) return true; else return false; }
537 StHbtHiddenInfo* StHbtTrack::getHiddenInfo() const {return mHiddenInfo;}
538 
539 StHbtTrack::~StHbtTrack()
540 {
541  if (mHiddenInfo)
542  delete mHiddenInfo;
543 }
Double_t pidProbKaon() const
Returns Aihong&#39;s probability of being a kaon.
Definition: StMuTrack.h:242
short type() const
Returns the track type: 0=global, 1=primary, etc (see StEvent manual for type information) ...
Definition: StMuTrack.h:229
StThreeVectorF primaryVertexPosition(int vtx_id=-1) const
The StMuDst is supposed to be structured in &#39;physical events&#39;. Therefore there is only 1 primary vert...
Definition: StMuEvent.cxx:221
Double_t pidProbElectron() const
Returns Aihong&#39;s probability of being an electron.
Definition: StMuTrack.h:240
short id() const
Returns the track id(or key), is unique for a track node, i.e. global and primary tracks have the sam...
Definition: StMuTrack.h:228
UShort_t nHitsDedx() const
Return number of hits used for dEdx.
Definition: StMuTrack.h:238
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
Definition: StHelix.cc:351
StPhysicalHelixD helix() const
Returns inner helix (first measured point)
Definition: StMuTrack.cxx:407
Short_t charge() const
Returns charge.
Definition: StMuTrack.h:255
Double_t nSigmaPion() const
Returns Craig&#39;s distance to the calculated dE/dx band for pions in units of sigma.
Definition: StMuTrack.h:245
Double_t pidProbProton() const
Returns Aihong&#39;s probability of being a proton.
Definition: StMuTrack.h:243
Double_t chi2z() const
Returns probability of fit. ATTENTIONS: does not return z chi2 (historic)
Definition: StMuTrack.h:250
Double_t nSigmaElectron() const
Returns Craig&#39;s distance to the calculated dE/dx band for electrons in units of sigma.
Definition: StMuTrack.h:244
UShort_t nHitsPoss() const
Return number of possible hits on track.
Definition: StMuTrack.cxx:242
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
Double_t chi2xy() const
Returns chi2 of fit. ATTENTIONS: does not return xy chi2 (historic)
Definition: StMuTrack.h:249
Double_t dEdx() const
Returns measured dE/dx value.
Definition: StMuTrack.h:248
Double_t nSigmaProton() const
Returns Craig&#39;s distance to the calculated dE/dx band for protons in units of sigma.
Definition: StMuTrack.h:247
const StMuTrack * globalTrack() const
Returns pointer to associated global track. Null pointer if no global track available.
Definition: StMuTrack.h:272
Double_t nSigmaKaon() const
Returns Craig&#39;s distance to the calculated dE/dx band for kaons in units of sigma.
Definition: StMuTrack.h:246
Double_t pidProbPion() const
Returns Aihong&#39;s probability of being a pion.
Definition: StMuTrack.h:241
StTrackTopologyMap topologyMap() const
Returns topology map.
Definition: StMuTrack.h:254