]>
Commit | Line | Data |
---|---|---|
aab9c8d5 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
0742d588 | 16 | /* $Id$ */ |
116cbefd | 17 | |
2cad796f | 18 | #include "TVirtualMC.h" |
0742d588 | 19 | |
2d74ba4f | 20 | #include "AliRun.h" |
0742d588 | 21 | #include "AliTrackReference.h" |
ac3eaff4 | 22 | #include "AliExternalTrackParam.h" |
23 | #include "AliKalmanTrack.h" | |
2d74ba4f | 24 | |
25 | // | |
26 | // Track Reference object is created every time particle is | |
27 | // crossing detector bounds. The object is created by Step Manager | |
28 | // | |
29 | // The class stores the following informations: | |
30 | // track label, | |
31 | // track position: X,Y,X | |
32 | // track momentum px, py, pz | |
33 | // track length and time of fligth: both in cm | |
34 | // status bits from Monte Carlo | |
35 | // | |
36 | ||
aab9c8d5 | 37 | |
38 | ClassImp(AliTrackReference) | |
39 | ||
e2afb3b6 | 40 | //_______________________________________________________________________ |
41 | AliTrackReference::AliTrackReference(): | |
448312df | 42 | TObject(), |
e2afb3b6 | 43 | fTrack(0), |
44 | fX(0), | |
45 | fY(0), | |
46 | fZ(0), | |
47 | fPx(0), | |
48 | fPy(0), | |
49 | fPz(0), | |
448312df | 50 | fLength(0), |
51 | fTime(0) | |
aab9c8d5 | 52 | { |
53 | // | |
54 | // Default constructor | |
2d74ba4f | 55 | // Creates empty object |
56 | ||
57 | for(Int_t i=0; i<16; i++) ResetBit(BIT(i)); | |
58 | } | |
59 | ||
60 | //_______________________________________________________________________ | |
448312df | 61 | AliTrackReference::AliTrackReference(Int_t label) : |
90e48c0c | 62 | TObject(), |
63 | fTrack(label), | |
64 | fX(0), | |
65 | fY(0), | |
66 | fZ(0), | |
67 | fPx(0), | |
68 | fPy(0), | |
69 | fPz(0), | |
70 | fLength(gMC->TrackLength()), | |
71 | fTime(gMC->TrackTime()) | |
448312df | 72 | { |
2d74ba4f | 73 | // |
74 | // Create Reference object out of label and | |
75 | // data in TVirtualMC object | |
76 | // | |
77 | // Creates an object and fill all parameters | |
78 | // from data in VirtualMC | |
aab9c8d5 | 79 | // |
2d74ba4f | 80 | // Sylwester Radomski, (S.Radomski@gsi.de) |
81 | // GSI, Jan 31, 2003 | |
82 | // | |
2cad796f | 83 | |
90e48c0c | 84 | Double_t vec[4]; |
2d74ba4f | 85 | |
90e48c0c | 86 | gMC->TrackPosition(vec[0],vec[1],vec[2]); |
2d74ba4f | 87 | |
88 | fX = vec[0]; | |
89 | fY = vec[1]; | |
90 | fZ = vec[2]; | |
91 | ||
90e48c0c | 92 | gMC->TrackMomentum(vec[0],vec[1],vec[2],vec[3]); |
2d74ba4f | 93 | |
94 | fPx = vec[0]; | |
95 | fPy = vec[1]; | |
b745fc4c | 96 | fPz = vec[2]; |
2d74ba4f | 97 | |
98 | // Set Up status code | |
99 | // Copy Bits from virtual MC | |
100 | ||
101 | for(Int_t i=0; i<16; i++) ResetBit(BIT(i)); | |
102 | ||
2cad796f | 103 | SetBit(BIT(0), gMC->IsNewTrack()); |
104 | SetBit(BIT(1), gMC->IsTrackAlive()); | |
105 | SetBit(BIT(2), gMC->IsTrackDisappeared()); | |
106 | SetBit(BIT(3), gMC->IsTrackEntering()); | |
107 | SetBit(BIT(4), gMC->IsTrackExiting()); | |
108 | SetBit(BIT(5), gMC->IsTrackInside()); | |
109 | SetBit(BIT(6), gMC->IsTrackOut()); | |
110 | SetBit(BIT(7), gMC->IsTrackStop()); | |
aab9c8d5 | 111 | } |
2d74ba4f | 112 | //_______________________________________________________________________ |
ac3eaff4 | 113 | AliExternalTrackParam * AliTrackReference::MakeTrack(const AliTrackReference *ref, Double_t mass) |
114 | { | |
115 | // | |
116 | // Make dummy track from the track reference | |
117 | // negative mass means opposite charge | |
118 | // | |
119 | Double_t xx[5]; | |
120 | Double_t cc[15]; | |
121 | for (Int_t i=0;i<15;i++) cc[i]=0; | |
122 | Double_t x = ref->X(), y = ref->Y(), z = ref->Z(); | |
123 | Double_t alpha = TMath::ATan2(y,x); | |
124 | Double_t xr = TMath::Sqrt(x*x+y*y); | |
125 | xx[0] = 0; | |
126 | xx[1] = z; | |
127 | xx[3] = ref->Pz()/ref->Pt(); | |
128 | Float_t b[3]; | |
129 | Float_t xyz[3]={x,y,z}; | |
130 | Float_t convConst = 0; | |
131 | (AliKalmanTrack::GetFieldMap())->Field(xyz,b); | |
132 | convConst=1000/0.299792458/(1e-13 - b[2]); | |
133 | xx[4] = 1./(convConst*ref->Pt()); // curvature rpresentation | |
134 | if (mass<0) xx[4]*=-1.; // negative mass - negative direction | |
135 | Double_t alphap = TMath::ATan2(ref->Py(),ref->Px())-alpha; | |
136 | if (alphap> TMath::Pi()) alphap-=TMath::Pi(); | |
137 | if (alphap<-TMath::Pi()) alphap+=TMath::Pi(); | |
138 | xx[2] = TMath::Sin(alphap); | |
139 | xx[4]*=convConst; // 1/pt representation | |
140 | // AliExternalTrackParam * track = new AliExternalTrackParam(xx,cc,xr,alpha); | |
141 | AliExternalTrackParam * track = new AliExternalTrackParam(xr,alpha,xx,cc); | |
142 | track->SetMass(TMath::Abs(mass)); | |
143 | //track->StartTimeIntegral(); | |
144 | track->SaveLocalConvConst(); | |
145 | return track; | |
146 | } | |
147 | ||
148 |