]>
Commit | Line | Data |
---|---|---|
16bf9884 | 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 | ||
16 | #include "AliTRDmcTrack.h" | |
17 | #include "AliTRDgeometry.h" | |
18 | ||
fd621f36 | 19 | |
16bf9884 | 20 | ClassImp(AliTRDmcTrack) |
21 | ||
22 | //_____________________________________________________________________________ | |
23 | AliTRDmcTrack::AliTRDmcTrack() | |
24 | { | |
25 | ||
26 | // | |
27 | // Default constructor | |
28 | // | |
29 | ||
30 | fLab = -1; | |
31 | fPrimary = kFALSE; | |
32 | fMass = 0; | |
33 | fCharge = 0; | |
34 | fN = 0; | |
35 | ||
517ac658 | 36 | for(Int_t ltb=0; ltb<kMAX_TB; ltb++) { |
37 | for(Int_t plane=0; plane < 6; plane++) { | |
38 | fIndex[ltb][plane][0] = -1; | |
39 | fIndex[ltb][plane][1] = -1; | |
40 | } | |
41 | } | |
42 | ||
16bf9884 | 43 | for(Int_t i=0; i<6; i++) { |
44 | for(Int_t j=0; j<3; j++) { | |
fd621f36 | 45 | Pin[i][j]=0.; |
46 | Pout[i][j] = 0.; | |
47 | XYZin[i][j]=0.; | |
48 | XYZout[i][j] = 0.; | |
16bf9884 | 49 | } |
50 | } | |
51 | ||
52 | } | |
53 | ||
54 | //_____________________________________________________________________________ | |
517ac658 | 55 | AliTRDmcTrack::AliTRDmcTrack(Int_t label, Int_t seedLabel, Bool_t primary, |
56 | Float_t mass, Int_t charge, Int_t pdg) | |
16bf9884 | 57 | { |
58 | ||
59 | // | |
60 | // Main constructor | |
61 | // | |
62 | ||
63 | fLab = label; | |
517ac658 | 64 | fSeedLab = seedLabel; |
16bf9884 | 65 | fPrimary = primary; |
66 | fMass = mass; | |
67 | fCharge = charge; | |
68 | fPDG = pdg; | |
69 | fN = 0; | |
70 | ||
517ac658 | 71 | for(Int_t ltb=0; ltb<kMAX_TB; ltb++) { |
72 | for(Int_t plane=0; plane < 6; plane++) { | |
73 | fIndex[ltb][plane][0] = -1; | |
74 | fIndex[ltb][plane][1] = -1; | |
75 | } | |
76 | } | |
16bf9884 | 77 | |
78 | for(Int_t i=0; i<6; i++) { | |
79 | for(Int_t j=0; j<3; j++) { | |
fd621f36 | 80 | Pin[i][j]=0.; |
81 | Pout[i][j] = 0.; | |
82 | XYZin[i][j]=0.; | |
83 | XYZout[i][j] = 0.; | |
16bf9884 | 84 | } |
85 | } | |
86 | ||
87 | } | |
88 | ||
89 | //_____________________________________________________________________________ | |
fd621f36 | 90 | void AliTRDmcTrack::GetPxPyPzXYZ(Double_t& px, Double_t& py, Double_t& pz, |
91 | Double_t& x, Double_t& y, Double_t& z, | |
92 | Int_t opt) const | |
16bf9884 | 93 | { |
94 | // | |
fd621f36 | 95 | // Returns track momentum components and coordinates at the entrance |
96 | // (opt >= 0), or exit (opt < 0) of TRD. | |
16bf9884 | 97 | // |
98 | ||
99 | Int_t i; | |
100 | ||
101 | if(opt >= 0) { | |
102 | for(i = 0; i < AliTRDgeometry::Nplan(); i++) { | |
fd621f36 | 103 | if( Pin[i][0] * Pin[i][0] |
104 | + Pin[i][1] * Pin[i][1] | |
105 | + Pin[i][2] * Pin[i][2] > 0.0005) break; | |
16bf9884 | 106 | } |
fd621f36 | 107 | px = Pin[i][0]; py = Pin[i][1]; pz = Pin[i][2]; |
108 | x = XYZin[i][0]; y = XYZin[i][1]; z = XYZin[i][2]; | |
16bf9884 | 109 | } |
110 | else { | |
111 | for(i = AliTRDgeometry::Nplan() - 1; i >= 0; i--) { | |
fd621f36 | 112 | if( Pout[i][0] * Pout[i][0] |
113 | + Pout[i][1] * Pout[i][1] | |
114 | + Pout[i][2] * Pout[i][2] > 0.0005) break; | |
16bf9884 | 115 | } |
fd621f36 | 116 | px = Pout[i][0]; py = Pout[i][1]; pz = Pout[i][2]; |
117 | x = XYZout[i][0]; y = XYZout[i][1]; z = XYZout[i][2]; | |
16bf9884 | 118 | } |
16bf9884 | 119 | return; |
16bf9884 | 120 | } |
121 | ||
122 | //_____________________________________________________________________________ | |
123 | void AliTRDmcTrack::GetPlanePxPyPz(Double_t& px, Double_t& py, Double_t& pz, | |
a3d851c2 | 124 | Int_t plane, Int_t opt) const |
16bf9884 | 125 | { |
126 | // | |
127 | // Returns momentum components at the entrance (opt >= 0), or | |
128 | // exit (opt < 0) of TRD plane <plane>. | |
129 | // | |
130 | ||
131 | if(opt >= 0) { | |
fd621f36 | 132 | px = Pin[plane][0]; py = Pin[plane][1]; pz = Pin[plane][2]; |
16bf9884 | 133 | } |
134 | else { | |
fd621f36 | 135 | px = Pout[plane][0]; py = Pout[plane][1]; pz = Pout[plane][2]; |
16bf9884 | 136 | } |
16bf9884 | 137 | return; |
16bf9884 | 138 | } |
fd621f36 | 139 | |
140 | ||
517ac658 | 141 | |
142 |