]>
Commit | Line | Data |
---|---|---|
d54804bf | 1 | // $Id$ |
2 | //*************************************************************************** | |
3 | // This file is property of and copyright by the ALICE HLT Project * | |
4 | // ALICE Experiment at CERN, All rights reserved. * | |
5 | // * | |
6 | // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> * | |
7 | // Ivan Kisel <kisel@kip.uni-heidelberg.de> * | |
8 | // for The ALICE HLT Project. * | |
9 | // * | |
10 | // Permission to use, copy, modify and distribute this software and its * | |
11 | // documentation strictly for non-commercial purposes is hereby granted * | |
12 | // without fee, provided that the above copyright notice appears in all * | |
13 | // copies and that both the copyright notice and this permission notice * | |
14 | // appear in the supporting documentation. The authors make no claims * | |
15 | // about the suitability of this software for any purpose. It is * | |
16 | // provided "as is" without express or implied warranty. * | |
17 | //*************************************************************************** | |
18 | ||
19 | #include "AliHLTTPCCAMCTrack.h" | |
20 | #include "TParticle.h" | |
21 | #include "TDatabasePDG.h" | |
22 | #include "TMath.h" | |
23 | ||
24 | ||
25 | AliHLTTPCCAMCTrack::AliHLTTPCCAMCTrack() | |
26 | : fP(0), fPt(0), fNHits(0), fNReconstructed(0), fSet(0), fNTurns(0) | |
27 | { | |
28 | //* Default constructor | |
29 | } | |
30 | ||
31 | ||
32 | AliHLTTPCCAMCTrack::AliHLTTPCCAMCTrack( const TParticle *part ) | |
33 | : fP(0), fPt(0), fNHits(0), fNReconstructed(0), fSet(0), fNTurns(0) | |
34 | { | |
35 | //* Constructor from TParticle | |
36 | ||
37 | for( Int_t i=0; i<7; i++ ) fPar[i] = 0; | |
38 | fP = 0; | |
39 | fPt = 0; | |
40 | ||
41 | if( !part ) return; | |
42 | TLorentzVector mom, vtx; | |
43 | part->ProductionVertex(vtx); | |
44 | part->Momentum(mom); | |
45 | fPar[0] = part->Vx(); | |
46 | fPar[1] = part->Vy(); | |
47 | fPar[2] = part->Vz(); | |
48 | fP = part->P(); | |
49 | fPt = part->Pt(); | |
50 | Double_t pi = ( fP >1.e-4 ) ?1./fP :0; | |
51 | fPar[3] = part->Px()*pi; | |
52 | fPar[4] = part->Py()*pi; | |
53 | fPar[5] = part->Pz()*pi; | |
54 | fPar[6] = 0; | |
55 | Int_t pdg = part->GetPdgCode(); | |
56 | if ( TMath::Abs(pdg) < 100000 ){ | |
57 | TParticlePDG *pPDG = TDatabasePDG::Instance()->GetParticle(pdg); | |
58 | if( pPDG ) fPar[6] = pPDG->Charge()/3.0*pi; | |
59 | } | |
60 | } |