]>
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 | ||
030b4415 | 16 | /* $Id$ */ |
17 | ||
18 | //////////////////////////////////////////////////////////////////////////// | |
19 | // // | |
20 | // TRD MC track // | |
21 | // Used for efficiency estimates and matching of reconstructed tracks // | |
22 | // to MC particles // | |
23 | // // | |
24 | //////////////////////////////////////////////////////////////////////////// | |
88cb7938 | 25 | |
16bf9884 | 26 | #include "AliTRDmcTrack.h" |
27 | #include "AliTRDgeometry.h" | |
28 | ||
29 | ClassImp(AliTRDmcTrack) | |
30 | ||
31 | //_____________________________________________________________________________ | |
32 | AliTRDmcTrack::AliTRDmcTrack() | |
030b4415 | 33 | :TObject() |
34 | ,fLab(-1) | |
35 | ,fSeedLab(-1) | |
36 | ,fPrimary(kFALSE) | |
37 | ,fMass(0) | |
38 | ,fCharge(0) | |
39 | ,fPDG(0) | |
40 | ,fN(0) | |
16bf9884 | 41 | { |
16bf9884 | 42 | // |
43 | // Default constructor | |
44 | // | |
45 | ||
acc49af9 | 46 | for (Int_t ltb = 0; ltb < kMAXTB; ltb++) { |
030b4415 | 47 | for (Int_t plane = 0; plane < 6; plane++) { |
517ac658 | 48 | fIndex[ltb][plane][0] = -1; |
49 | fIndex[ltb][plane][1] = -1; | |
50 | } | |
51 | } | |
52 | ||
030b4415 | 53 | for (Int_t i = 0; i < 6; i++) { |
54 | for (Int_t j = 0; j < 3; j++) { | |
acc49af9 | 55 | fPin[i][j] = 0.0; |
56 | fPout[i][j] = 0.0; | |
57 | fXYZin[i][j] = 0.0; | |
58 | fXYZout[i][j] = 0.0; | |
16bf9884 | 59 | } |
60 | } | |
61 | ||
62 | } | |
63 | ||
64 | //_____________________________________________________________________________ | |
030b4415 | 65 | AliTRDmcTrack::AliTRDmcTrack(Int_t label, Int_t seedLabel, Bool_t primary |
66 | , Float_t mass, Int_t charge, Int_t pdg) | |
67 | :TObject() | |
68 | ,fLab(label) | |
69 | ,fSeedLab(seedLabel) | |
70 | ,fPrimary(primary) | |
71 | ,fMass(mass) | |
72 | ,fCharge(charge) | |
73 | ,fPDG(pdg) | |
74 | ,fN(0) | |
16bf9884 | 75 | { |
16bf9884 | 76 | // |
77 | // Main constructor | |
78 | // | |
16bf9884 | 79 | |
acc49af9 | 80 | for (Int_t ltb = 0; ltb < kMAXTB; ltb++) { |
030b4415 | 81 | for (Int_t plane = 0; plane < 6; plane++) { |
517ac658 | 82 | fIndex[ltb][plane][0] = -1; |
83 | fIndex[ltb][plane][1] = -1; | |
84 | } | |
85 | } | |
16bf9884 | 86 | |
030b4415 | 87 | for (Int_t i = 0; i < 6; i++) { |
88 | for (Int_t j = 0; j < 3; j++) { | |
acc49af9 | 89 | fPin[i][j] = 0.0; |
90 | fPout[i][j] = 0.0; | |
91 | fXYZin[i][j] = 0.0; | |
92 | fXYZout[i][j] = 0.0; | |
16bf9884 | 93 | } |
94 | } | |
95 | ||
96 | } | |
97 | ||
98 | //_____________________________________________________________________________ | |
030b4415 | 99 | void AliTRDmcTrack::GetPxPyPzXYZ(Double_t& px, Double_t& py, Double_t& pz |
100 | , Double_t& x, Double_t& y, Double_t& z | |
101 | , Int_t opt) const | |
16bf9884 | 102 | { |
103 | // | |
fd621f36 | 104 | // Returns track momentum components and coordinates at the entrance |
105 | // (opt >= 0), or exit (opt < 0) of TRD. | |
16bf9884 | 106 | // |
107 | ||
030b4415 | 108 | Int_t i = 0; |
16bf9884 | 109 | |
030b4415 | 110 | if (opt >= 0) { |
111 | ||
112 | for (i = 0; i < AliTRDgeometry::Nplan(); i++) { | |
acc49af9 | 113 | if ((fPin[i][0]*fPin[i][0] |
114 | + fPin[i][1]*fPin[i][1] | |
115 | + fPin[i][2]*fPin[i][2]) > 0.0005) { | |
030b4415 | 116 | break; |
117 | } | |
16bf9884 | 118 | } |
030b4415 | 119 | |
acc49af9 | 120 | px = fPin[i][0]; |
121 | py = fPin[i][1]; | |
122 | pz = fPin[i][2]; | |
123 | x = fXYZin[i][0]; | |
124 | y = fXYZin[i][1]; | |
125 | z = fXYZin[i][2]; | |
030b4415 | 126 | |
16bf9884 | 127 | } |
128 | else { | |
030b4415 | 129 | |
130 | for (i = AliTRDgeometry::Nplan() - 1; i >= 0; i--) { | |
acc49af9 | 131 | if ((fPout[i][0]*fPout[i][0] |
132 | + fPout[i][1]*fPout[i][1] | |
133 | + fPout[i][2]*fPout[i][2]) > 0.0005) { | |
030b4415 | 134 | break; |
135 | } | |
16bf9884 | 136 | } |
030b4415 | 137 | |
acc49af9 | 138 | px = fPout[i][0]; |
139 | py = fPout[i][1]; | |
140 | pz = fPout[i][2]; | |
141 | x = fXYZout[i][0]; | |
142 | y = fXYZout[i][1]; | |
143 | z = fXYZout[i][2]; | |
030b4415 | 144 | |
16bf9884 | 145 | } |
030b4415 | 146 | |
16bf9884 | 147 | return; |
16bf9884 | 148 | } |
149 | ||
150 | //_____________________________________________________________________________ | |
030b4415 | 151 | void AliTRDmcTrack::GetPlanePxPyPz(Double_t& px, Double_t& py, Double_t& pz |
152 | , Int_t plane, Int_t opt) const | |
16bf9884 | 153 | { |
154 | // | |
155 | // Returns momentum components at the entrance (opt >= 0), or | |
156 | // exit (opt < 0) of TRD plane <plane>. | |
157 | // | |
158 | ||
030b4415 | 159 | if (opt >= 0) { |
acc49af9 | 160 | px = fPin[plane][0]; |
161 | py = fPin[plane][1]; | |
162 | pz = fPin[plane][2]; | |
16bf9884 | 163 | } |
164 | else { | |
acc49af9 | 165 | px = fPout[plane][0]; |
166 | py = fPout[plane][1]; | |
167 | pz = fPout[plane][2]; | |
16bf9884 | 168 | } |
030b4415 | 169 | |
16bf9884 | 170 | return; |
030b4415 | 171 | |
16bf9884 | 172 | } |