StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuTrack.cxx
1 /***************************************************************************
2  *
3  * $Id: StMuTrack.cxx,v 1.55 2019/03/20 19:36:11 jdb Exp $
4  *
5  * Author: Frank Laue, BNL, laue@bnl.gov
6  ***************************************************************************/
7 
8 #include "StMuTrack.h"
9 #include "StMuDebug.h"
10 #include "StMuException.hh"
11 #include "StEvent/StEventTypes.h"
12 #include "StEvent/StTrackGeometry.h"
13 #include "StEvent/StPrimaryVertex.h"
14 #include "StEvent/StDcaGeometry.h"
16 #include "StEvent/StBTofHit.h"
17 #include "StEvent/StBTofPidTraits.h"
18 #include "StEvent/StETofHit.h"
19 #include "StEvent/StETofPidTraits.h"
20 #include "StEvent/StMtdHit.h"
21 #include "StEvent/StMtdPidTraits.h"
22 #include "StarClassLibrary/SystemOfUnits.h"
23 #include "StEvent/StTpcDedxPidAlgorithm.h"
24 #include "StarClassLibrary/StThreeVectorD.hh"
25 #include "StarClassLibrary/StPhysicalHelixD.hh"
26 #include "StarClassLibrary/StParticleTypes.hh"
27 #include "StEventUtilities/StuProbabilityPidAlgorithm.h"
28 #include "StMuDSTMaker/COMMON/StMuPrimaryVertex.h"
29 #include "StEmcUtil/projection/StEmcPosition.h"
30 #include "StEmcUtil/geometry/StEmcGeom.h"
31 #include "StBichsel/Bichsel.h"
32 #include "StBichsel/StdEdxModel.h"
33 #include "THelixTrack.h"
34 #include "TMath.h"
35 #include "TString.h"
36 namespace {
37  const StThreeVectorF gDummy(-999,-999,-999);
38 }
39 
42 
43 //----------------------------------------------------------------------------
44 //----------------------------------------------------------------------------
45 //----------------------------------------------------------------------------
46 StMuTrack::StMuTrack(const StEvent* event, const StTrack* track, const StVertex *vertex, Int_t index2Global, Int_t index2RichSpectra, Bool_t l3, TObjArray *vtxList) :
47  mId(0), mType(0), mFlag(0), mFlagExtension(0), mIndex2Global(index2Global), mIndex2RichSpectra(index2RichSpectra), mNHits(0), mNHitsPoss(0), mNHitsDedx(0),mNHitsFit(0),
48  mPidProbElectron(0), mPidProbPion(0),mPidProbKaon(0),mPidProbProton(0),
49  /* mNSigmaElectron(__NOVALUE__), mNSigmaPion(__NOVALUE__), mNSigmaKaon(__NOVALUE__), mNSigmaProton(__NOVALUE__) ,*/
50  mdEdx(0.), mPt(0.), mEta(0.), mPhi(0.), mIndex2Cov(-1), mIdTruth(0), mQuality(0), mIdParentVx(0)
51 {
52  const StGlobalTrack* globalTrack = dynamic_cast<const StGlobalTrack*>(track->node()->track(global));
53 
54  mId = track->key();
55  mType = track->type();
56  mFlag = track->flag();
57  mFlagExtension = track->flagExtension();
58  mTopologyMap = track->topologyMap();
59  mIdTruth = track->idTruth();
60  mQuality = track->qaTruth();
61  mIdParentVx = track->idParentVx();
62  // while getting the bestGuess, the pidAlgorithm (StTpcDedxPidAlgorithm) is set up.
63  // pointers to track and pidTraits are set
64  // So, even though BestGuess will generate a "variable not used" warning, DO NOT DELETE THE NEXT LINES
65  static StTpcDedxPidAlgorithm PidAlgorithm;
66  static StElectron* Electron = StElectron::instance();
67  static StPionPlus* Pion = StPionPlus::instance();
68  static StKaonPlus* Kaon = StKaonPlus::instance();
69  static StProton* Proton = StProton::instance();
70  const StParticleDefinition* pd = track->pidTraits(PidAlgorithm);
71  if (pd) {
72  mNSigmaElectron = pack2Int( fabsMin(PidAlgorithm.numberOfSigma(Electron),__SIGMA_SCALE__), __SIGMA_SCALE__ );
73  mNSigmaPion = pack2Int( fabsMin(PidAlgorithm.numberOfSigma(Pion),__SIGMA_SCALE__), __SIGMA_SCALE__ );
74  mNSigmaKaon = pack2Int( fabsMin(PidAlgorithm.numberOfSigma(Kaon),__SIGMA_SCALE__), __SIGMA_SCALE__ );
75  mNSigmaProton = pack2Int( fabsMin(PidAlgorithm.numberOfSigma(Proton),__SIGMA_SCALE__), __SIGMA_SCALE__ );
76  } else {
77  // BEWARE : Data members initialized to __NOVALUE__ was an hazardous
78  // bunsiness as both NOVALUE and SIGMA_SCALE would have to be changed
79  // simultaneously (error prone). The above is equivalent while safer ...
80  mNSigmaElectron = int(__NOVALUE__*__SIGMA_SCALE__); // pack2Int( fabsMin(__NOVALUE__*1.0,__SIGMA_SCALE__), __SIGMA_SCALE__ );
81  mNSigmaPion = int(__NOVALUE__*__SIGMA_SCALE__); // pack2Int( fabsMin(__NOVALUE__*1.0,__SIGMA_SCALE__), __SIGMA_SCALE__ );
82  mNSigmaKaon = int(__NOVALUE__*__SIGMA_SCALE__); // pack2Int( fabsMin(__NOVALUE__*1.0,__SIGMA_SCALE__), __SIGMA_SCALE__ );
83  mNSigmaProton = int(__NOVALUE__*__SIGMA_SCALE__); // pack2Int( fabsMin(__NOVALUE__*1.0,__SIGMA_SCALE__), __SIGMA_SCALE__ );
84  }
85 
86  // if we have pid traits
87  if ( PidAlgorithm.traits() ) {
88  mdEdx = PidAlgorithm.traits()->mean();
89  mNHitsDedx = PidAlgorithm.traits()->numberOfPoints();
90  }
91 
92  // the following just point to particle definitions in StEvent
93  if ( track->detectorInfo() ) {
94  mFirstPoint = track->detectorInfo()->firstPoint();
95  mLastPoint = track->detectorInfo()->lastPoint();
96  mNHits = track->detectorInfo()->numberOfPoints();
97  }
98 
99  mNHitsPoss = track->numberOfPossiblePoints();
100 
101  Int_t tpc_hits;
102  mNHitsPossTpc=0;
103  if (track->numberOfPossiblePoints(kTpcId)==track->numberOfPossiblePoints(kFtpcEastId)) {
104  // backward compatibility mode, figure out which TPC points are in
105  if (track->topologyMap().hasHitInDetector(kTpcId))
106  mNHitsPossTpc=track->numberOfPossiblePoints(kTpcId);
107  else if (track->topologyMap().hasHitInDetector(kFtpcEastId))
108  mNHitsPossTpc=(1 << 6) + track->numberOfPossiblePoints(kFtpcEastId);
109  else if (track->topologyMap().hasHitInDetector(kFtpcWestId))
110  mNHitsPossTpc=(2 << 6) + track->numberOfPossiblePoints(kFtpcWestId);
111  } else {
112  // new Ittf chain distinguishes the three TPCs properly
113  if ( (tpc_hits=track->numberOfPossiblePoints(kTpcId)) )
114  mNHitsPossTpc=tpc_hits;
115  else if ( (tpc_hits=track->numberOfPossiblePoints(kFtpcEastId)) )
116  mNHitsPossTpc=(1 << 6) + tpc_hits;
117  else if ( (tpc_hits=track->numberOfPossiblePoints(kFtpcWestId)) )
118  mNHitsPossTpc=(2 << 6) + tpc_hits;
119  }
120 
121  mNHitsPossInner=track->numberOfPossiblePoints(kSvtId) & 0x7;
122  if (! mNHitsPossInner) mNHitsPossInner=track->numberOfPossiblePoints(kIstId) & 0x7;
123  mNHitsPossInner|=(track->numberOfPossiblePoints(kSsdId) & 0x3) << 3;
124  mNHitsPossInner|=(track->numberOfPossiblePoints(kPxlId) & 0x7) << 5;
125 
126  mNHitsFit = track->fitTraits().numberOfFitPoints();
127  mNHitsFitTpc=0;
128  if (track->numberOfPossiblePoints(kTpcId)==track->numberOfPossiblePoints(kFtpcEastId)) {
129  // backward compatibility mode, figure out which TPC points are in
130  if (track->topologyMap().hasHitInDetector(kTpcId))
131  mNHitsFitTpc=track->fitTraits().numberOfFitPoints(kTpcId);
132  else if (track->topologyMap().hasHitInDetector(kFtpcEastId))
133  mNHitsFitTpc=(1 << 6) + track->fitTraits().numberOfFitPoints(kFtpcEastId);
134  else if (track->topologyMap().hasHitInDetector(kFtpcWestId))
135  mNHitsFitTpc=(2 << 6) + track->fitTraits().numberOfFitPoints(kFtpcWestId);
136  } else {
137  // new Ittf chain distinguishes the three TPCs properly
138  if ( (tpc_hits=track->fitTraits().numberOfFitPoints(kTpcId)) )
139  mNHitsFitTpc=tpc_hits;
140  else if ( (tpc_hits=track->fitTraits().numberOfFitPoints(kFtpcEastId)) )
141  mNHitsFitTpc=(1 << 6) + tpc_hits;
142  else if ( (tpc_hits=track->fitTraits().numberOfFitPoints(kFtpcWestId)) )
143  mNHitsFitTpc=(2 << 6) + tpc_hits;
144  }
145  mNHitsFitInner=track->fitTraits().numberOfFitPoints(kSvtId) & 0x7;
146  if (! mNHitsFitInner) mNHitsFitInner=track->fitTraits().numberOfFitPoints(kIstId) & 0x7;
147  mNHitsFitInner|=(track->fitTraits().numberOfFitPoints(kSsdId) & 0x3) << 3;
148  mNHitsFitInner|=(track->fitTraits().numberOfFitPoints(kPxlId) & 0x7) << 5;
149 
150  mChiSqXY = track->fitTraits().chi2(0);
151  mChiSqZ = track->fitTraits().chi2(1);
152 
153  if ( track->geometry() && track->geometry()->charge()) {
154  mHelix = StMuHelix(track->geometry()->helix(),event->runInfo()->magneticField());
155  //if (event->primaryVertex()) {
156  if (vertex) {
157  mP = momentumAtPrimaryVertex(event,track,vertex);
158  Int_t vtx_id=vtxList->IndexOf(vertex);
159  if (vtx_id >= 0) {
160  mVertexIndex=vtx_id;
161  }
162  else {
163  gMessMgr->Warning() << "Track does not point to a primary vertex" << endm;
164  mVertexIndex = -1;
165  mDCA = StThreeVectorF(-999,-999,-999);
166  mDCAGlobal = StThreeVectorF(-999,-999,-999);
167  }
168  mDCA = dca(track, vertex);
169  if (globalTrack) {
170  if (globalTrack->dcaGeometry()) {
171  const StDcaGeometry *dcaGeometry = globalTrack->dcaGeometry();
172  const StThreeVectorF &pvert = vertex->position();
173  Double_t vtx[3] = {pvert[0],pvert[1],pvert[2]};
174  THelixTrack thelix = dcaGeometry->thelix();
175  thelix.Move(thelix.Path(vtx));
176  const Double_t *pos = thelix.Pos();
177  const Double_t *mom = thelix.Dir();
178  mDCAGlobal = StThreeVectorF(pos[0],pos[1],pos[2]) - vertex->position();
179  if (track->type() == global) {
180  mDCA = mDCAGlobal;
181  mP = StThreeVectorF(mom[0],mom[1],mom[2]);
182  mP *= dcaGeometry->momentum().mag();
183  }
184  }
185  else { // No StDcaGeometry; use helix
186  mDCAGlobal = dca(globalTrack, vertex);
187  }
188  }
189  else { // No global track available
190  mDCAGlobal = StThreeVectorF(-999,-999,-999);
191  }
192 
193  mPt = mP.perp();
194  mPhi = mP.phi();
195  mEta = mP.pseudoRapidity();
196 
197  if (!l3) { // L3TRACKS seem to break pid
198  Int_t charge = track->geometry()->charge();
199  // StParticleDefinition* pc = (*mProbabilityPidAlgorithm)( *track, track->pidTraits() );
200  mProbabilityPidAlgorithm->processPIDAsFunction(mProbabilityPidCentrality, mDCA.mag(), charge, mP.mag()/charge, mEta, mNHitsDedx, mdEdx);
201  mPidProbElectron= pack2UnsignedShort( (charge>0) ? mProbabilityPidAlgorithm->beingPositronProb() : mProbabilityPidAlgorithm->beingElectronProb(), __PROB_SCALE__) ;
202  mPidProbPion= pack2UnsignedShort( (charge>0) ? mProbabilityPidAlgorithm->beingPionPlusProb() : mProbabilityPidAlgorithm->beingPionMinusProb(), __PROB_SCALE__);
203  mPidProbKaon= pack2UnsignedShort( (charge>0) ? mProbabilityPidAlgorithm->beingKaonPlusProb() : mProbabilityPidAlgorithm->beingKaonMinusProb(), __PROB_SCALE__);
204  mPidProbProton= pack2UnsignedShort( (charge>0) ? mProbabilityPidAlgorithm->beingProtonProb() : mProbabilityPidAlgorithm->beingAntiProtonProb(), __PROB_SCALE__);
205  }
206  }
207  else { // vertex == 0
208  mVertexIndex = -1;
209  mDCA = StThreeVectorF(-999,-999,-999);
210  mDCAGlobal = StThreeVectorF(-999,-999,-999);
211  if (globalTrack) {
212  if (globalTrack->dcaGeometry()) {
213  const StDcaGeometry *dcaGeometry = globalTrack->dcaGeometry();
214  THelixTrack thelix = dcaGeometry->thelix();
215  const Double_t *mom = thelix.Dir();
216  if (track->type() == global) {
217  mP = StThreeVectorF(mom[0],mom[1],mom[2]);
218  mP *= dcaGeometry->momentum().mag();
219  }
220  }
221  }
222  mPt = mP.perp();
223  mPhi = mP.phi();
224  mEta = mP.pseudoRapidity();
225  }
226  }
227  fillMuProbPidTraits(event,track);
229  mIndex2BTofHit = -1; // filled later
230  fillMuBTofPidTraits(track);
231 
232  mIndex2ETofHit = -1;
233  fillMuETofPidTraits(track);
234 
235  mIndex2MtdHit = -1;
236  fillMuMtdPidTraits(track);
237 
238  if ( track->outerGeometry() )
239  mOuterHelix = StMuHelix(track->outerGeometry()->helix(),event->runInfo()->magneticField());
240 }
241 
242 UShort_t StMuTrack::nHitsPoss() const {
243  // Add 1 for primary tracks in old files
244  if (mNHitsPossTpc==255 && type()==primary)
245  return mNHitsPoss+1;
246 
247  return mNHitsPoss;
248 }
249 
250 UShort_t StMuTrack::nHitsPoss(StDetectorId det) const {
251 
252  // Backward compatibility for old files
253  if (mNHitsPossTpc==255) {
254  if (det==kFtpcEastId || det==kFtpcWestId)
255  return mTopologyMap.hasHitInDetector(det)*mNHitsPoss;
256  else if (det==kTpcId)
257  return (mTopologyMap.hasHitInDetector(det) || mTopologyMap.hasHitInDetector(kiTpcId) ? mNHitsPoss : 0);
258  else
259  return 0;
260  }
261 
262  // New situation: decode point counts
263  switch (det) {
264  case kTpcId:
265  return mNHitsPossTpc;
266  // previously we had a mask on the 7 & 8th bit to distinguish FTPC hits packed into the last two bits. This is should not be needed since no track will have TPC and FTPC hits.
267  // removed to make incusion of iTPC hits work, since it can be larger than 63
268  // changed from : return ((mNHitsPossTpc & 0xC0)==0)*mNHitsPossTpc;
269  break;
270  case kFtpcEastId:
271  return ((mNHitsPossTpc & 0xC0)==0x40)*(mNHitsPossTpc & 0x3F);
272  break;
273  case kFtpcWestId:
274  return ((mNHitsPossTpc & 0xC0)==0x80)*(mNHitsPossTpc & 0x3F);
275  break;
276  case kSvtId:
277  case kIstId:
278  return (mNHitsPossInner & 0x7);
279  break;
280  case kSsdId:
281  return ((mNHitsPossInner >> 3) & 0x3);
282  break;
283  case kPxlId:
284  return ((mNHitsPossInner >> 5) & 0x7);
285  break;
286  default:
287  return 0;
288  }
289 
290 }
291 
292 UShort_t StMuTrack::nHitsFit(StDetectorId det) const {
293  // Backward compatibility for old files
294  if (mNHitsFitTpc==255) {
295  if (det==kFtpcEastId || det==kFtpcWestId)
296  return mTopologyMap.hasHitInDetector(det)*mNHitsFit;
297  else if (det==kTpcId)
298  return (mTopologyMap.hasHitInDetector(det) || mTopologyMap.hasHitInDetector(kiTpcId) ? mNHitsFit : 0);
299  else
300  return 0;
301  }
302 
303  // New situation: decode point counts
304  switch (det) {
305  case kTpcId:
306  return mNHitsFitTpc;
307  // previously we had a mask on the 7 & 8th bit to distinguish FTPC hits packed into the last two bits. This is should not be needed since no track will have TPC and FTPC hits.
308  // removed to make incusion of iTPC hits work, since it can be larger than 63
309  // changed from : return ((mNHitsFitTpc & 0xC0)==0)*mNHitsFitTpc;
310  break;
311  case kFtpcEastId:
312  return ((mNHitsFitTpc & 0xC0)==0x40)*(mNHitsFitTpc & 0x3F);
313  break;
314  case kFtpcWestId:
315  return ((mNHitsFitTpc & 0xC0)==0x80)*(mNHitsFitTpc & 0x3F);
316  break;
317  case kSvtId:
318  case kIstId:
319  return (mNHitsFitInner & 0x7);
320  break;
321  case kSsdId:
322  return ((mNHitsFitInner >> 3) & 0x3);
323  break;
324  case kPxlId:
325  return ((mNHitsFitInner >> 5) & 0x7);
326  break;
327  default:
328  return 0;
329  }
330 }
331 
332 Float_t StMuTrack::dcaD(Int_t vtx_id) const {
333  if ((vtx_id == -1 && mVertexIndex == StMuDst::currentVertexIndex()) ||
334  vtx_id == mVertexIndex) {
335  StThreeVectorF dir;
336  if (mType == global)
337  dir = mP;
338  else if (globalTrack())
339  dir = globalTrack()->p();
340  else
341  return -999;
342  if (dir.mag() == 0)
343  return -999;
344  dir /= dir.mag();
345  Float_t cosl = dir.perp();
346  return -dir[1]/cosl * mDCAGlobal[0] + dir[0]/cosl * mDCAGlobal[1];
347  }
348  else return -999;
349 }
350 
351 Float_t StMuTrack::dcaZ(Int_t vtx_id) const {
352  if ((vtx_id == -1 && mVertexIndex == StMuDst::currentVertexIndex()) ||
353  vtx_id == mVertexIndex) {
354  return mDCAGlobal.z();
355  }
356  else return -999;
357 }
358 
359 StThreeVectorF StMuTrack::dca(Int_t vtx_id) const {
360  if (vtx_id == -1)
361  vtx_id = StMuDst::currentVertexIndex();
362  if (vtx_id==mVertexIndex)
363  return mDCA;
364  else if (mVertexIndex == -1) // should not happen
365  return gDummy;
366  if(((StMuPrimaryVertex*)StMuDst::array(muPrimaryVertex)->UncheckedAt(vtx_id)))
367  return dca(((StMuPrimaryVertex*)StMuDst::array(muPrimaryVertex)->UncheckedAt(vtx_id))->position());
368  else return gDummy;
369 }
370 
372  if (vtx_id == -1)
373  vtx_id = StMuDst::currentVertexIndex();
374  if (vtx_id==mVertexIndex) {
375  return mDCAGlobal;
376  }
377  else if (mVertexIndex == -1) { // should not happen
378  return gDummy;
379  }
380 
381  const StMuTrack *gTrack = (mType == global) ? this : globalTrack();
382 
383  if (gTrack && ((StMuPrimaryVertex*)StMuDst::array(muPrimaryVertex)->UncheckedAt(vtx_id))){
384  return gTrack->dca(((StMuPrimaryVertex*)StMuDst::array(muPrimaryVertex)->UncheckedAt(vtx_id))->position());
385  }
386  else {
387  return gDummy;
388  }
389 }
390 
392  const StPhysicalHelixD &hlx = helix();
393  double pathlength = hlx.pathLength(pos, false); // do not scan periods
394  return hlx.at(pathlength)-pos;
395 }
396 
398  double pathlength = track->geometry()->helix().pathLength( vertex->position(), false ); // do not scan periods
399  return track->geometry()->helix().at(pathlength)-vertex->position();
400 }
401 
403  double pathlength = track->geometry()->helix().pathLength( vertex->position() );
404  return track->geometry()->helix().momentumAt(pathlength,event->runInfo()->magneticField()*kilogauss);
405 }
406 
408 {
409  return StPhysicalHelixD(mHelix.p(),mHelix.origin(), mHelix.b()*kilogauss, mHelix.q());
410 }
411 
413  return StPhysicalHelixD(mOuterHelix.p(),mOuterHelix.origin(), mOuterHelix.b()*kilogauss, mOuterHelix.q());
414 }
415 
416 double StMuTrack::length() const {
417  return fabs( helix().pathLength(StThreeVectorD(mLastPoint)) ); }
418 double StMuTrack::lengthMeasured() const {
419  return fabs( helix().pathLength(StThreeVectorD(mLastPoint)) - helix().pathLength(StThreeVectorD(mFirstPoint)) ); }
420 
421 Int_t StMuTrack::bad() const
422 {
423  if (mFlag <= 0 ) return 10;
424  if (mHelix.bad()) return 20;
425  if (mOuterHelix.bad()) return 30;
426  return 0;
427 }
428 #include "StEvent/StProbPidTraits.h"
430  // get vector of traits;
431  StPtrVecTrackPidTraits traits = t->pidTraits(kTpcId);
432  // get the StDedxPidTraits
433  StDedxPidTraits* dedxPidTraits =0;
434  UInt_t size = traits.size();
435 
436  if (StMuDebug::level()>=3) {
437  cout << " dedxPidTraits->method() ";
438  }
439  for (UInt_t i = 0; i < size; i++) {
440  if ( !(dedxPidTraits=dynamic_cast<StDedxPidTraits*>(traits[i])) ) continue;
441  if (StMuDebug::level()>=3) {
442  cout << " " << dedxPidTraits->method();
443  }
444  if (dedxPidTraits->method() == kTruncatedMeanIdentifier) {
445  mProbPidTraits.setdEdxTruncated( dedxPidTraits->mean() );
446  mProbPidTraits.setdEdxErrorTruncated( dedxPidTraits->errorOnMean() );
447  mProbPidTraits.setLog2dX( dedxPidTraits->log2dX() );
448  }
449  if (dedxPidTraits->method() == kLikelihoodFitIdentifier) {
450  mProbPidTraits.setdEdxFit( dedxPidTraits->mean() );
451  mProbPidTraits.setdEdxErrorFit( dedxPidTraits->errorOnMean() );
452  mProbPidTraits.setdEdxTrackLength( dedxPidTraits->length() );
453  mProbPidTraits.setLog2dX( dedxPidTraits->log2dX() );
454  }
455  if (dedxPidTraits->method() == kOtherMethodIdentifier) {
456  mProbPidTraits.setdNdxFit( dedxPidTraits->mean() );
457  mProbPidTraits.setdNdxErrorFit( dedxPidTraits->errorOnMean() );
458  mProbPidTraits.setdEdxTrackLength( dedxPidTraits->length() );
459  mProbPidTraits.setLog2dX( dedxPidTraits->log2dX() );
460  }
461  }
462  if (StMuDebug::level()>=3) {
463  cout << endl;
464  }
465 
466  // get the StProbPidTraits
468  size = traits.size();
469  for (UInt_t i = 0; i < size; i++) {
470  if ( (probPidTraits=dynamic_cast<StProbPidTraits*>(traits[i])) ) {
471  for (Int_t i=0; i<mProbPidTraits.numberOfParticles(); i++) mProbPidTraits.setProbability(i,probPidTraits->GetProbability(i));
472  mProbPidTraits.setNdf(probPidTraits->GetNDF());
473  }
474  }
475 
476 }
477 
478 void StMuTrack::fillMuBTofPidTraits(const StTrack* t) {
479  StBTofPidTraits* btofPidTraits = 0;
480  StPtrVecTrackPidTraits traits = t->pidTraits(kTofId);
481  UInt_t size = traits.size();
482  for (UInt_t i = 0; i < size; i++) {
483  if ( (btofPidTraits=dynamic_cast<StBTofPidTraits*>(traits[i])) ) {
484  mBTofPidTraits.setBTofPidTraits(btofPidTraits);
485  }
486  }
487 }
488 
490  StETofPidTraits* etofPidTraits = nullptr;
491 
492  // set etof pid traits per default to 0 ...
493  mETofPidTraits.setETofPidTraits( etofPidTraits );
494 
495  StPtrVecTrackPidTraits traits = t->pidTraits( kETofId );
496  UInt_t size = traits.size();
497  for( UInt_t i = 0; i < size; i++ ) {
498  if( ( etofPidTraits = dynamic_cast< StETofPidTraits* >( traits[ i ] ) ) ) {
499  mETofPidTraits.setETofPidTraits( etofPidTraits );
500  }
501  }
502 }
503 
504 
505 void StMuTrack::fillMuMtdPidTraits(const StTrack* t) {
506  StMtdPidTraits* mtdPidTraits = 0;
507  StPtrVecTrackPidTraits traits = t->pidTraits(kMtdId);
508  UInt_t size = traits.size();
509  for (UInt_t i = 0; i < size; i++) {
510  if ( (mtdPidTraits=dynamic_cast<StMtdPidTraits*>(traits[i])) ) {
511  mMtdPidTraits.setMtdPidTraits(mtdPidTraits);
512  }
513  }
514 }
515 
516 #if 0
517 void StMuTrack::Print(Option_t *option) const {
518  //
519  // Print out some of the essential track info.
520  // Note: more is stored in the track; may expand printout
521  // or specify options some time
522  //
523 
524 
525  if (mType == global)
526  cout << "Global ";
527  else if (mType == primary)
528  cout << "Primary ";
529  else
530  cout << "Other type ";
531  cout << "track, id " << mId << ", flag " << mFlag << " (>0 is OK)" << endl;
532 
533  if (mVertexIndex != 0)
534  cout << "Not assigned to primary vertex ( vertex Index " << mVertexIndex << " )" << endl;
535 
536  cout << "momentum " << mP << endl;
537  cout << "eta " << mEta << ", phi " << mPhi << ", pt " << mPt << endl;
538  cout << "DCA " << mDCA << endl;
539  cout << "\t radial " << dcaD() << ", z " << dcaZ() << endl;
540  cout << "global DCA " << mDCAGlobal << endl;
541  cout << "Total hits: " << nHits() << ", fitted " << nHitsFit()
542  << "\t ( TPC "
543  << nHitsFit(kTpcId) << ", FTPC "
544  << nHitsFit(kFtpcEastId) + nHitsFit(kFtpcWestId) << ", SVT "
545  << nHitsFit(kSvtId) << ", SSD "
546  << nHitsFit(kSsdId) << " ) " << endl;
547 
548  cout << "Possible points: " << nHitsPoss() << " \t( TPC "
549  << nHitsPoss(kTpcId) << ", FTPC "
550  << nHitsPoss(kFtpcEastId) + nHitsPoss(kFtpcWestId) << ", SVT "
551  << nHitsPoss(kSvtId) << ", SSD "
552  << nHitsPoss(kSsdId) << " ) " << endl;
553 
554  cout << "\t first point " << mFirstPoint << endl;
555  cout << "\t last point " << mLastPoint << endl;
556  //cout << "\t inner helix origin " << pr_track->helix().origin() << endl;
557 
558 }
559 #endif
560 ostream& operator<<(ostream& os, const StMuTrack& v) {
561  if (v.type() == global) os << "Gl ";
562  else if (v.type() == primary) os << "Pr ";
563  else os << " ";
564  os << Form("id:%5i fl:%5i vx:%3i p:%8.3f %8.3f %8.3f",v.id(),v.flag(),v.vertexIndex(), v.p().x(), v.p().y(), v.p().z());
565  os << Form(" q:%2i eta:%6.3f phi:%6.3f pT: %6.3f",v.charge(),v.eta(),v.phi(),v.pt());
566  os << Form(" DCA [%d]:%6.3f %6.3f %6.3f", v.index2Cov(), v.dca().x(),v.dca().y(),v.dca().z());
567  os << Form(" Total hits:%2i fitted:%2i poss:%2i",v.nHits(),v.nHitsFit(),v.nHitsPoss());
568  os << Form(" Points F: %6.3f %6.3f %6.3f L: %6.3f %6.3f %6.3f",
569  v.firstPoint().x(),v.firstPoint().y(),v.firstPoint().z(),
570  v.lastPoint().x(),v.lastPoint().y(),v.lastPoint().z());
571  os << Form(" idT %4i qa %2i",v.idTruth(), v.qaTruth());
572  os << Form(" idParentVx %d", v.idParentVx());
573  return os;
574 }
575 
576 void StMuTrack::Print(Option_t *option) const {cout << *this << endl;}
577 
579 
580  if(mType==1) return this;
581  const StMuTrack *prim = 0;
582 
583 // StMuDst *tMuDst =
584 
585  //For old MuDsts where there was one vertex per event
586  if(mIndex2Global==-1){
587  Int_t nVer = StMuDst::numberOfPrimaryVertices();
589  }
590  if(mIndex2Global < 0 ) return prim;
591 
592  if(StMuDst::numberOfPrimaryVertices()==0) return StMuDst::primaryTracks(mIndex2Global);
593  Int_t curVer = StMuDst::currentVertexIndex();
594  StMuDst::setVertexIndex(mVertexIndex);
595  prim = StMuDst::primaryTracks(mIndex2Global);
596  StMuDst::setVertexIndex(curVer);
597  return prim;
598 }
599 
600 Int_t StMuTrack::vertexIndex() const {
601 
602  //For old MuDsts where there was one vertex per event
603  if (StMuDst::numberOfPrimaryVertices()==0){
604  if(!(fabs(StMuDst::event()->primaryVertexPosition().x()) < 1.e-5 && fabs(StMuDst::event()->primaryVertexPosition().y()) < 1.e-5 && fabs(StMuDst::event()->primaryVertexPosition().z()) < 1.e-5)){
605  if(primaryTrack()!=0) return 0;
606  }
607  else return -1;
608  }
609  if(this->type()==1) return mVertexIndex;
610  if(primaryTrack()!=0) {
611  Int_t index = primaryTrack()->vertexIndex();
612  return index;
613  }
614  else return -1;
615 }
616 
617 TArrayI StMuTrack::getTower(Bool_t useExitRadius,Int_t det) const{ //1=BTOW, 3=BSMDE, 4=BSMDP... Returns TVector tower. tower[0] is module, tower[1] is eta, tower[2] is sub, and tower[3] is id
618 
619 // StMuTrack* track = this;
620  TArrayI tower(4);
621  tower[0] = -10;
622  tower[1] = -10;
623  tower[2] = -10;
624  tower[3] = -10;
625 
626  StThreeVectorD momentum,position;
627  Double_t radius;
628 
629  StEmcGeom* mEmcGeom = StEmcGeom::instance("bemc");
630  StEmcGeom* mSmdEGeom= StEmcGeom::instance("bsmde");
631  StEmcGeom* mSmdPGeom= StEmcGeom::instance("bsmdp");
632 
633  if(det==1) radius = mEmcGeom->Radius();
634  if(det==2) radius = mEmcGeom->Radius();
635  if(det==3) radius = mSmdEGeom->Radius();
636  if(det==4) radius = mSmdPGeom->Radius();
637 
638  StEventSummary& evtSummary = StMuDst::event()->eventSummary();
639  Double_t mField = evtSummary.magneticField()/10;
640 
641  //add 30 cm to radius to find out if track left same tower
642  if(useExitRadius) radius += 30.0;
643 
644  StEmcPosition mEmcPosition;
645  Bool_t goodProjection;
646  if(this) goodProjection = mEmcPosition.trackOnEmc(&position,&momentum,this,mField,radius);
647  else return tower;
648  if(goodProjection){
649  Int_t m,e,s,id=0;
650  Float_t eta=position.pseudoRapidity();
651  Float_t phi=position.phi();
652  if(det==1){
653  mEmcGeom->getBin(phi,eta,m,e,s);
654 // s = abs(s);
655  if(mEmcGeom->getId(m,e,s,id)==0){
656  tower[0] = m;
657  tower[1] = e;
658  tower[2] = s;
659  tower[3] = id;
660  }
661  }
662  else if(det==3){
663  Int_t check=mSmdEGeom->getBin(phi,eta,m,e,s);
664  if(!check){
665  s = abs(s);
666  if(mSmdEGeom->getId(m,e,s,id)==0){
667  tower[0] = m;
668  tower[1] = e;
669  tower[2] = s;
670  tower[3] = id; }
671  }
672  }
673  else if(det==4){
674  Int_t check=mSmdPGeom->getBin(phi,eta,m,e,s);
675  s = abs(s);
676  if(!check){
677  if(mSmdPGeom->getId(m,e,s,id)==0){
678  tower[0] = m;
679  tower[1] = e;
680  tower[2] = s;
681  tower[3] = s; }
682  }
683  }
684  }
685  return tower;
686 }
687 
688 double StMuTrack::energyBEMC() const { //Return energy of negative 100 GeV is no BEMC hit is matched...
689 
690  double hitEnergy;
691  TArrayI tower = getTower();
692  UInt_t iMod = tower[0];
693  UInt_t iEta = tower[1];
694  Int_t iSub = tower[2];
695  if(iMod < 1 ||iMod > 120) return -100.0;
696 
697  if (StMuDst::emcCollection()) {
698  StEmcDetector *bemcDet = StMuDst::emcCollection()->detector(kBarrelEmcTowerId);
699  StEmcModule *mod = bemcDet->module(iMod);
700  StSPtrVecEmcRawHit& hits = mod->hits();
701  for(UInt_t i=0; i<hits.size();i++){
702  if(hits[i]){
703  if((hits[i]->eta() == iEta) && (hits[i]->sub() == iSub)) {
704  hitEnergy = hits[i]->energy();
705  if(hitEnergy > 0) return hitEnergy;
706  else return -100.0;
707  }
708  }
709  }
710  }
711  return -100.0;
712 }
713 
714 Bool_t StMuTrack::matchBEMC() const {
715  double mEmcThres = 0.15;
716  if (energyBEMC() > mEmcThres) return true;
717  return false;
718 }
719 //________________________________________________________________________________
720 Double_t StMuTrack::dEdxPull(Double_t mass, Bool_t fit, Int_t charge) const {
721  Double_t z = -999.;
722  if (probPidTraits().dEdxTrackLength() > 0 ) {
723  const StMuHelix &mh = muHelix();
724  Double_t momentum = mh.p().mag();
725  Double_t log2dX = probPidTraits().log2dX();
726  if (log2dX <= 0) log2dX = 1;
727  Double_t dedx_measured, dedx_expected, dedx_resolution = -1;
728  if (! fit) { // I70
729  dedx_measured = probPidTraits().dEdxTruncated();
730  dedx_expected = 1.e-6*charge*charge*Bichsel::Instance()->GetI70M(TMath::Log10(momentum*TMath::Abs(charge)/mass));
731  dedx_resolution = probPidTraits().dEdxErrorTruncated();
732  } else if ( fit == 1) { // Ifit
733  dedx_measured = probPidTraits().dEdxFit();
734  dedx_expected = 1.e-6*charge*charge*TMath::Exp(Bichsel::Instance()->GetMostProbableZ(TMath::Log10(momentum*TMath::Abs(charge)/mass)));
735  dedx_resolution = probPidTraits().dEdxErrorFit();
736  } else { // dNdx
737  dedx_measured = probPidTraits().dNdxFit();
738  dedx_expected = StdEdxModel::instance()->dNdx(momentum*TMath::Abs(charge)/mass,charge);
739  dedx_resolution = probPidTraits().dNdxErrorFit();
740  }
741  if (dedx_resolution > 0)
742  z = TMath::Log(dedx_measured/dedx_expected)/dedx_resolution;
743  }
744  return z;
745 }
746 //________________________________________________________________________________
747 
748 ClassImp(StMuTrack)
749 
750 /***************************************************************************
751  *
752  * $Log: StMuTrack.cxx,v $
753  * Revision 1.55 2019/03/20 19:36:11 jdb
754  * Update to StMuTrack for nHitsFit and nHitsPoss to handle the iTPC hits correctly
755  *
756  * Revision 1.54 2019/02/21 13:32:54 jdb
757  * Inclusion of ETOF MuDst code. This code adds support for the full set of ETOF data which includes EtofDigi, EtofHit, EtofHeader. The code essentially copies similar structures from StEvent and additionally rebuilds the maps between Digis and Hits. Accessor methods are added based on the pattern from BTOF to provide access to data at various levels. The code for accessing the PID traits provided by ETOF is also provided
758  *
759  * Revision 1.53 2017/04/17 20:41:07 smirnovd
760  * StMuTrack: Add additional info to Print()
761  *
762  * Revision 1.52 2017/04/17 19:19:43 smirnovd
763  * [Cosmetic] Whitespace adjustments
764  *
765  * Revision 1.51 2016/09/18 23:00:49 fisyak
766  * Add dNdx
767  *
768  * Revision 1.50 2014/01/15 22:00:04 fisyak
769  * Add method to calculate dE/dx pulls for I70 and Ifit
770  *
771  * Revision 1.3 2014/01/15 21:11:08 fisyak
772  * Add dE/dx pulls calculations
773  *
774  * Revision 1.2 2013/08/19 15:03:16 fisyak
775  * Add calculation dE/dx pulls
776  *
777  * Revision 1.1.1.1 2013/07/23 14:14:48 fisyak
778  *
779  *
780  * Revision 1.48 2012/05/07 14:47:06 fisyak
781  * Add handles for track to fast detector matching
782  *
783  * Revision 1.47 2011/10/17 00:19:14 fisyak
784  * Active handing of IdTruth
785  *
786  * Revision 1.46 2011/04/08 01:25:51 fisyak
787  * Add branches for MC track and vertex information, add IdTruth to tracks and vertices, reserve a possiblity to remove Strange MuDst
788  *
789  * Revision 1.45 2010/06/02 18:53:13 tone421
790  * Fixed a bug. Previously, only events where a vertex was found had global tracks with pt and eta filled properly...
791  *
792  * Revision 1.44 2010/04/27 20:47:17 tone421
793  * Added extra functions for BEMC matching. See this post for more details:
794  *
795  * http://www.star.bnl.gov/HyperNews-star/get/starsofi/7816.html
796  *
797  * Revision 1.43 2010/03/08 19:06:51 tone421
798  * Two things. Global tracks how are filled with an index to primary at birth. Added StMuDst::fixTrackIndicesG(), which is used for matching the primary track indices to global tracks. Previously, this was quite slow - see this post:
799  *
800  * http://www.star.bnl.gov/HyperNews-star/protected/get/starsoft/8092/1/1/1.html
801  *
802  * for more details.
803  *
804  * Revision 1.42 2009/12/01 21:56:35 tone421
805  * Implemented changes as per http://www.star.bnl.gov/rt2/Ticket/Display.html?id=1734
806  *
807  * Revision 1.38 2009/02/20 16:37:44 tone421
808  * *** empty log message ***
809  *
810  * Revision 1.36 2009/01/07 20:50:59 tone421
811  * Added more pointer protection in dcaGlobal(int) and dca(int)
812  *
813  * Revision 1.35 2008/05/01 20:53:59 mvl
814  * Changed/fixed handling of DCA for global tracks without StDcaGeometry: now calculate DCA based on helix (previous behaviour was to default to (0,0,0); only affected globals without primaries).
815  * Changed globalDca() function to also work for globals that are attached to a different primary vertex. Used to return -999, now use helix to calculate.
816  *
817  * Revision 1.34 2008/03/19 14:51:04 fisyak
818  * Add two clone arrays for global and primary track covariance matrices, remove mSigmaDcaD and mSigmaDcaZ
819  *
820  * Revision 1.33 2007/10/18 03:44:23 mvl
821  * Added Ist and Pixel hits to mNPossInner and mNFitInner
822  *
823  * Revision 1.32 2007/09/18 02:29:58 mvl
824  * Added basic printing functionality. For convenience and to assist data consistency checks
825  *
826  * Revision 1.31 2007/07/12 19:46:20 fisyak
827  * Add includes for ROOT 5.16
828  *
829  * Revision 1.30 2007/04/20 06:23:46 mvl
830  * Removed Q-vector flag (will implement utility class)
831  *
832  * Revision 1.28 2007/01/29 18:34:44 mvl
833  * Updates to use StDcaGeometry for global DCA and momentum.
834  * Added helper functions for radial and Z component: dcaD and dcaZ.
835  * Uncertainties on those are stored in sigmaDcaD and sigmaDcaZ.
836  * dcaD and dcaZ only work for the primary vertex to which the track belongs (avoid long extrapolations).
837  *
838  * Revision 1.27 2007/01/05 20:19:44 jeromel
839  * helix(helix()) cannot be interpreted by gcc 3.4.6
840  *
841  * Revision 1.26 2006/07/27 18:55:41 fisyak
842  * Remove DCA hack used in SSD+SVT test production (P06id)
843  *
844  * Revision 1.24 2005/08/19 19:46:06 mvl
845  * Further updates for multiple vertices. The main changes are:
846  * 1) StMudst::primaryTracks() now returns a list (TObjArray*) of tracks
847  * belonging to the 'current' primary vertex. The index number of the
848  * 'current' vertex can be set using StMuDst::setCurrentVertex().
849  * This also affects StMuDst::primaryTracks(Int_t i) and
850  * StMuDst::numberOfprimaryTracks().
851  * 2) refMult is now stored for all vertices, in StMuPrimaryVertex. The
852  * obvious way to access these numbers is from the StMuprimaryVertex structures,
853  * but for ebakcward compatibility a function is provided in StMuEvent as well
854  * (this is the only function taht works for existing MuDst)
855  *
856  * As an aside, I've also changes the internals of StMuDst::createStEvent and
857  * StMuDst::fixTrackIndices() to be able to deal with a larger range of index numbers for tracks as generated by Ittf.
858  *
859  * BIG FAT WARNING: StMudst2StEventMaker and StMuDstFilterMaker
860  * do not fully support the multiple vertex functionality yet.
861  *
862  * Revision 1.23 2005/07/20 04:08:47 mvl
863  * Now also changed dca calculation in the other function (StMuTrack::dca(StThreeVectorF))
864  * instead of only the helper function for StTrack, StVertex.
865  *
866  * Revision 1.22 2005/07/20 03:48:06 mvl
867  * Changed dca calculation: no longer scan period of helix to get DCA.
868  * This mainly affects tracks with large dcas in events with multiple vertices.
869  *
870  * Revision 1.21 2005/07/15 21:45:08 mvl
871  * Added support for multiple primary vertices (StMuPrimaryVertex). Track Dcas are now calculated with repect to the first vertex in the list (highest rank), but another vertex number can be specified. Tarcks also store the index of the vertex they belong to (StMuTrack::vertexIndex())
872  *
873  * Revision 1.20 2005/03/17 21:55:00 mvl
874  * Added StMuMomentumShiftMaker for applying a magnetic field scaling to the reconstructed MuDst. This class accesses StMuTrack, StMuEvent and StMuHelix and some Strangeness MuDst data members as 'friend'
875  *
876  * Revision 1.19 2005/02/05 01:08:12 perev
877  * zero charge skip
878  *
879  * Revision 1.18 2004/12/15 21:35:06 mvl
880  * Added initialisaion of eta, phi and pt. Affects events without main vertex.
881  *
882  * Revision 1.17 2004/08/14 00:53:41 mvl
883  * Added 1 to possibel points for primary tracks, like in StEvent
884  *
885  * Revision 1.16 2004/08/12 01:34:25 mvl
886  * Fixed typo when extracting number of fitted, possible points per tpc
887  *
888  * Revision 1.15 2004/08/11 00:51:54 mvl
889  * Added topologyMap check for nHitsFit(StDetectorId) and nHitsPoss(StDetectorId) to better handle existing MuDst
890  *
891  * Revision 1.14 2004/08/10 22:38:30 mvl
892  * Extended support for fitspoints in Svt and Tpc to work for old files + fixed some types in previous version.
893  *
894  * Revision 1.13 2004/08/07 02:44:05 mvl
895  * Added support for fitted and possible points in different detectors, for ITTF
896  *
897  * Revision 1.12 2004/04/14 14:21:53 jeromel
898  * Not sure why I made it - but better to preserve the sign
899  *
900  * Revision 1.11 2004/04/14 03:27:30 jeromel
901  * Change init of mNSigma
902  *
903  * Revision 1.10 2004/04/08 16:21:57 subhasis
904  * Initialization ,as suggested by Yuri
905  *
906  * Revision 1.9 2003/11/07 15:23:26 laue
907  * added error on dEdx measurements to the StMuProbPidTraits
908  *
909  * Revision 1.8 2003/10/30 20:08:13 perev
910  * Check of quality added
911  *
912  * Revision 1.7 2003/10/28 18:57:56 perev
913  * BadData protection added
914  *
915  * Revision 1.6 2003/02/21 14:32:47 laue
916  * Yuri's updates to the PID probabilities. dE/dx track length in TPC added
917  *
918  * Revision 1.5 2002/11/22 18:08:53 laue
919  * Bug in logic fixed. Checking for null pointers was wrong.
920  *
921  * Revision 1.4 2002/11/18 14:29:31 laue
922  * update for Yuri's new StProbPidTraits
923  *
924  * Revision 1.3 2002/09/19 21:54:01 laue
925  * fix bug in length() method
926  *
927  * Revision 1.2 2002/08/20 19:55:49 laue
928  * Doxygen comments added
929  *
930  * Revision 1.1 2002/03/08 17:04:18 laue
931  * initial revision
932  *
933  *
934  **************************************************************************/
Double_t lengthMeasured() const
Returns length of track (cm) from first to last measured point.
Definition: StMuTrack.cxx:418
const StMuHelix & muHelix() const
Returns inner helix (first measured point)
Definition: StMuTrack.h:133
short type() const
Returns the track type: 0=global, 1=primary, etc (see StEvent manual for type information) ...
Definition: StMuTrack.h:229
Bool_t trackOnEmc(StThreeVectorD *position, StThreeVectorD *momentum, const StTrack *const track, Double_t magField, Double_t emcRadius=225.405) const
Track projection utility.
Int_t vertexIndex() const
Returns index of associated primary vertex.
Definition: StMuTrack.cxx:600
void setdEdxTrackLength(double dedx)
sets the track length in TPC used for dE/dx calculations
void fillMuProbPidTraits(const StEvent *, const StTrack *)
Helper function to fill all the different pid values.
Definition: StMuTrack.cxx:429
void setdEdxTruncated(double dedx)
sets the truncated dEdx value;
Double_t pt() const
Returns pT at point of dca to primary vertex.
Definition: StMuTrack.h:256
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
void setdEdxErrorFit(double dedx)
sets the fitted dEdx error value;
Double_t length() const
Returns length of track (cm) from primary vertex to last measured point.
Definition: StMuTrack.cxx:416
Float_t dcaZ(Int_t vtx_id=-1) const
Z component of global DCA.
Definition: StMuTrack.cxx:351
double dEdxFit() const
returns the fitted dEdx value
void setETofPidTraits(const StETofPidTraits *)
PID functions – to be added (?)
const StMuETofPidTraits & etofPidTraits() const
dongx
Definition: StMuTrack.h:265
void setdNdxErrorFit(double dedx)
sets the fitted dNdx error value;
static void fixTrackIndicesG(int mult=1)
Definition: StMuDst.cxx:338
StMuMtdPidTraits mMtdPidTraits
dongx
Definition: StMuTrack.h:203
void fillMuETofPidTraits(const StTrack *)
dongx
Definition: StMuTrack.cxx:489
static StuProbabilityPidAlgorithm * mProbabilityPidAlgorithm
Bingchu.
Definition: StMuTrack.h:220
int numberOfParticles() const
returns the number of particles avaiable
pair< double, double > pathLength(double r) const
path length at given r (cylindrical r)
Definition: StHelix.cc:351
void setMtdPidTraits(const StMtdPidTraits *)
Setters.
StPhysicalHelixD helix() const
Returns inner helix (first measured point)
Definition: StMuTrack.cxx:407
UShort_t nHitsFit() const
Return total number of hits used in fit.
Definition: StMuTrack.h:239
short flag() const
Returns flag, (see StEvent manual for type information)
Definition: StMuTrack.h:230
Short_t charge() const
Returns charge.
Definition: StMuTrack.h:255
void setdEdxErrorTruncated(double dedx)
sets the truncated dEdx error value;
const StThreeVectorF & p() const
Returns 3-momentum at dca to primary vertex.
Definition: StMuTrack.h:259
double dNdxErrorFit() const
returns the fitted dNdx resolution value
Double_t eta() const
Returns pseudo rapidity at point of dca to primary vertex.
Definition: StMuTrack.h:257
const StThreeVectorF & firstPoint() const
Returns positions of first measured point.
Definition: StMuTrack.h:261
const StMuProbPidTraits & probPidTraits() const
Returns Yuri Fisyak new pid probabilities.
Definition: StMuTrack.h:263
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
Definition: StMuDst.h:301
virtual void Print(Option_t *option="") const
Print track info.
Definition: StMuTrack.cxx:576
StThreeVectorD momentumAtPrimaryVertex(const StEvent *event, const StTrack *track, const StVertex *vertex) const
Helper function: Calculates the momentum at dca a given StTrack and the primary vertex taken from StE...
Definition: StMuTrack.cxx:402
void setProbability(unsigned int, double)
set the probability for particle i
UShort_t nHitsPoss() const
Return number of possible hits on track.
Definition: StMuTrack.cxx:242
void setNdf(unsigned int)
set number of degrees of freedom
static Double_t mProbabilityPidCentrality
Centrality for Aihong&#39;s pid prob calculations. Will set when new StMuEvent is made from StEvent...
Definition: StMuTrack.h:221
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
static int level()
returns debug level
Definition: StMuDebug.h:78
const StThreeVectorF & momentum() const
Returns 3-momentum at dca to primary vertex.
Definition: StMuTrack.h:260
UShort_t nHits() const
Bingchu.
Definition: StMuTrack.h:237
StThreeVectorF dca(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex.
Definition: StMuTrack.cxx:359
StMuProbPidTraits mProbPidTraits
Class holding the new Yuri Fisyak pid probabilities.
Definition: StMuTrack.h:201
const StThreeVectorF & lastPoint() const
Returns positions of last measured point.
Definition: StMuTrack.h:262
double dEdxErrorFit() const
returns the fitted dEdx resolution value
double dEdxErrorTruncated() const
returns the truncated 70% dEdx resolution value
void setdNdxFit(double dedx)
sets the fitted dNdx value;
static TClonesArray * array(int type)
returns pointer to the n-th TClonesArray
Definition: StMuDst.h:262
Double_t phi() const
Returns phi at point of dca to primary vertex.
Definition: StMuTrack.h:258
const StMuTrack * primaryTrack() const
Returns pointer to associated primary track. Null pointer if no global track available.
Definition: StMuTrack.cxx:578
Int_t getBin(const Float_t phi, const Float_t eta, Int_t &m, Int_t &e, Int_t &s) const
Definition: StEmcGeom.h:321
static StEmcCollection * emcCollection()
returns pointer to current StEmcCollection
Definition: StMuDst.h:405
double dNdxFit() const
returns the fitted dNdx value
Float_t dcaD(Int_t vtx_id=-1) const
Signed radial component of global DCA (projected)
Definition: StMuTrack.cxx:332
static Int_t currentVertexIndex()
Get the index number of the current primary vertex.
Definition: StMuDst.h:260
const StMuTrack * globalTrack() const
Returns pointer to associated global track. Null pointer if no global track available.
Definition: StMuTrack.h:272
double dEdxTruncated() const
returns the truncated 70% dEdx value
StThreeVectorF dcaGlobal(Int_t vtx_id=-1) const
Returns 3D distance of closest approach to primary vertex of associated global track.
Definition: StMuTrack.cxx:371
double Move(double step)
Move along helix.
StPhysicalHelixD outerHelix() const
Returns outer helix (last measured point)
Definition: StMuTrack.cxx:412
static void setVertexIndex(Int_t vtx_id)
Set the index number of the current primary vertex (used by both primaryTracks() functions and for St...
Definition: StMuDst.cxx:273
void setdEdxFit(double dedx)
sets the fitted dEdx value;