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 | |
116cbefd |
16 | |
aab9c8d5 |
17 | #include "AliTrackReference.h" |
2cad796f |
18 | #include "TVirtualMC.h" |
2d74ba4f |
19 | #include "TParticle.h" |
20 | #include "AliRun.h" |
21 | #include "TLorentzVector.h" |
22 | |
23 | // |
24 | // Track Reference object is created every time particle is |
25 | // crossing detector bounds. The object is created by Step Manager |
26 | // |
27 | // The class stores the following informations: |
28 | // track label, |
29 | // track position: X,Y,X |
30 | // track momentum px, py, pz |
31 | // track length and time of fligth: both in cm |
32 | // status bits from Monte Carlo |
33 | // |
34 | |
aab9c8d5 |
35 | |
36 | ClassImp(AliTrackReference) |
37 | |
e2afb3b6 |
38 | //_______________________________________________________________________ |
39 | AliTrackReference::AliTrackReference(): |
40 | fTrack(0), |
41 | fX(0), |
42 | fY(0), |
43 | fZ(0), |
44 | fPx(0), |
45 | fPy(0), |
46 | fPz(0), |
47 | fLength(0) |
aab9c8d5 |
48 | { |
49 | // |
50 | // Default constructor |
2d74ba4f |
51 | // Creates empty object |
52 | |
53 | for(Int_t i=0; i<16; i++) ResetBit(BIT(i)); |
54 | } |
55 | |
56 | //_______________________________________________________________________ |
2cad796f |
57 | AliTrackReference::AliTrackReference(Int_t label) { |
2d74ba4f |
58 | // |
59 | // Create Reference object out of label and |
60 | // data in TVirtualMC object |
61 | // |
62 | // Creates an object and fill all parameters |
63 | // from data in VirtualMC |
aab9c8d5 |
64 | // |
2d74ba4f |
65 | // Sylwester Radomski, (S.Radomski@gsi.de) |
66 | // GSI, Jan 31, 2003 |
67 | // |
2cad796f |
68 | |
2d74ba4f |
69 | TLorentzVector vec; |
70 | |
71 | fTrack = label; |
2cad796f |
72 | fLength = gMC->TrackLength(); |
73 | fTime = gMC->TrackTime(); |
2d74ba4f |
74 | |
2cad796f |
75 | gMC->TrackPosition(vec); |
2d74ba4f |
76 | |
77 | fX = vec[0]; |
78 | fY = vec[1]; |
79 | fZ = vec[2]; |
80 | |
2cad796f |
81 | gMC->TrackMomentum(vec); |
2d74ba4f |
82 | |
83 | fPx = vec[0]; |
84 | fPy = vec[1]; |
b745fc4c |
85 | fPz = vec[2]; |
2d74ba4f |
86 | |
87 | // Set Up status code |
88 | // Copy Bits from virtual MC |
89 | |
90 | for(Int_t i=0; i<16; i++) ResetBit(BIT(i)); |
91 | |
2cad796f |
92 | SetBit(BIT(0), gMC->IsNewTrack()); |
93 | SetBit(BIT(1), gMC->IsTrackAlive()); |
94 | SetBit(BIT(2), gMC->IsTrackDisappeared()); |
95 | SetBit(BIT(3), gMC->IsTrackEntering()); |
96 | SetBit(BIT(4), gMC->IsTrackExiting()); |
97 | SetBit(BIT(5), gMC->IsTrackInside()); |
98 | SetBit(BIT(6), gMC->IsTrackOut()); |
99 | SetBit(BIT(7), gMC->IsTrackStop()); |
aab9c8d5 |
100 | } |
2d74ba4f |
101 | //_______________________________________________________________________ |