]>
Commit | Line | Data |
---|---|---|
f7336fa3 | 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 | /* | |
17 | $Log$ | |
52052b58 | 18 | Revision 1.12 2001/05/21 16:45:47 hristov |
19 | Last minute changes (C.Blume) | |
20 | ||
db30bf0f | 21 | Revision 1.11 2001/05/11 07:56:12 hristov |
22 | Consistent declarations needed on Alpha | |
23 | ||
ff821236 | 24 | Revision 1.10 2001/05/07 08:08:05 cblume |
25 | Update of TRD code | |
26 | ||
a2b90f83 | 27 | Revision 1.9 2001/03/27 12:48:33 cblume |
28 | Correct for volume overlaps | |
29 | ||
b42a9f88 | 30 | Revision 1.8 2001/03/13 09:30:35 cblume |
31 | Update of digitization. Moved digit branch definition to AliTRD | |
32 | ||
6244debe | 33 | Revision 1.7 2001/02/14 18:22:26 cblume |
34 | Change in the geometry of the padplane | |
35 | ||
71d9fa7b | 36 | Revision 1.6 2000/11/01 14:53:20 cblume |
37 | Merge with TRD-develop | |
38 | ||
793ff80c | 39 | Revision 1.1.4.7 2000/10/16 01:16:53 cblume |
40 | Changed timebin 0 to be the one closest to the readout | |
41 | ||
42 | Revision 1.1.4.6 2000/10/15 23:35:57 cblume | |
43 | Include geometry constants as static member | |
44 | ||
45 | Revision 1.1.4.5 2000/10/06 16:49:46 cblume | |
46 | Made Getters const | |
47 | ||
48 | Revision 1.1.4.4 2000/10/04 16:34:58 cblume | |
49 | Replace include files by forward declarations | |
50 | ||
51 | Revision 1.1.4.3 2000/09/22 14:43:40 cblume | |
52 | Allow the pad/timebin-dimensions to be changed after initialization | |
53 | ||
54 | Revision 1.1.4.2 2000/09/18 13:37:01 cblume | |
55 | Minor coding corrections | |
56 | ||
57 | Revision 1.5 2000/10/02 21:28:19 fca | |
58 | Removal of useless dependecies via forward declarations | |
59 | ||
60 | Revision 1.4 2000/06/08 18:32:58 cblume | |
61 | Make code compliant to coding conventions | |
62 | ||
63 | Revision 1.3 2000/06/07 16:25:37 cblume | |
64 | Try to remove compiler warnings on Sun and HP | |
65 | ||
66 | Revision 1.2 2000/05/08 16:17:27 cblume | |
67 | Merge TRD-develop | |
68 | ||
69 | Revision 1.1.4.1 2000/05/08 14:45:55 cblume | |
70 | Bug fix in RotateBack(). Geometry update | |
71 | ||
94de3818 | 72 | Revision 1.4 2000/06/08 18:32:58 cblume |
73 | Make code compliant to coding conventions | |
74 | ||
8230f242 | 75 | Revision 1.3 2000/06/07 16:25:37 cblume |
76 | Try to remove compiler warnings on Sun and HP | |
77 | ||
9d0b222b | 78 | Revision 1.2 2000/05/08 16:17:27 cblume |
79 | Merge TRD-develop | |
80 | ||
6f1e466d | 81 | Revision 1.1.4.1 2000/05/08 14:45:55 cblume |
82 | Bug fix in RotateBack(). Geometry update | |
83 | ||
84 | Revision 1.1 2000/02/28 19:00:44 cblume | |
85 | Add new TRD classes | |
86 | ||
f7336fa3 | 87 | */ |
88 | ||
89 | /////////////////////////////////////////////////////////////////////////////// | |
90 | // // | |
91 | // TRD geometry class // | |
92 | // // | |
93 | /////////////////////////////////////////////////////////////////////////////// | |
94 | ||
793ff80c | 95 | #include "AliMC.h" |
96 | ||
f7336fa3 | 97 | #include "AliTRDgeometry.h" |
98 | #include "AliTRDrecPoint.h" | |
94de3818 | 99 | #include "AliMC.h" |
f7336fa3 | 100 | |
101 | ClassImp(AliTRDgeometry) | |
102 | ||
793ff80c | 103 | //_____________________________________________________________________________ |
104 | ||
105 | // | |
106 | // The geometry constants | |
107 | // | |
108 | const Int_t AliTRDgeometry::fgkNsect = kNsect; | |
109 | const Int_t AliTRDgeometry::fgkNplan = kNplan; | |
110 | const Int_t AliTRDgeometry::fgkNcham = kNcham; | |
111 | const Int_t AliTRDgeometry::fgkNdet = kNdet; | |
112 | ||
113 | // | |
114 | // Dimensions of the detector | |
115 | // | |
116 | const Float_t AliTRDgeometry::fgkRmin = 294.0; | |
117 | const Float_t AliTRDgeometry::fgkRmax = 368.0; | |
118 | ||
119 | const Float_t AliTRDgeometry::fgkZmax1 = 378.35; | |
120 | const Float_t AliTRDgeometry::fgkZmax2 = 302.0; | |
121 | ||
122 | const Float_t AliTRDgeometry::fgkSheight = 74.0; | |
123 | const Float_t AliTRDgeometry::fgkSwidth1 = 99.613; | |
124 | const Float_t AliTRDgeometry::fgkSwidth2 = 125.707; | |
125 | const Float_t AliTRDgeometry::fgkSlenTR1 = 751.0; | |
126 | const Float_t AliTRDgeometry::fgkSlenTR2 = 313.5; | |
127 | const Float_t AliTRDgeometry::fgkSlenTR3 = 159.5; | |
128 | ||
129 | const Float_t AliTRDgeometry::fgkCheight = 11.0; | |
130 | const Float_t AliTRDgeometry::fgkCspace = 1.6; | |
131 | const Float_t AliTRDgeometry::fgkCathick = 1.0; | |
132 | const Float_t AliTRDgeometry::fgkCcthick = 1.0; | |
133 | const Float_t AliTRDgeometry::fgkCaframe = 2.675; | |
134 | const Float_t AliTRDgeometry::fgkCcframe = AliTRDgeometry::fgkCheight | |
135 | - AliTRDgeometry::fgkCaframe; | |
136 | ||
137 | // | |
138 | // Thickness of the the material layers | |
139 | // | |
db30bf0f | 140 | const Float_t AliTRDgeometry::fgkRaThick = 0.3646; |
793ff80c | 141 | const Float_t AliTRDgeometry::fgkMyThick = 0.005; |
142 | const Float_t AliTRDgeometry::fgkXeThick = 3.5; | |
143 | const Float_t AliTRDgeometry::fgkDrThick = 3.0; | |
144 | const Float_t AliTRDgeometry::fgkAmThick = AliTRDgeometry::fgkXeThick | |
145 | - AliTRDgeometry::fgkDrThick; | |
146 | const Float_t AliTRDgeometry::fgkCuThick = 0.001; | |
147 | const Float_t AliTRDgeometry::fgkSuThick = 0.06; | |
148 | const Float_t AliTRDgeometry::fgkFeThick = 0.0044; | |
149 | const Float_t AliTRDgeometry::fgkCoThick = 0.02; | |
db30bf0f | 150 | //const Float_t AliTRDgeometry::fgkWaThick = 0.01; |
151 | const Float_t AliTRDgeometry::fgkWaThick = 0.02; | |
793ff80c | 152 | |
153 | // | |
154 | // Position of the material layers | |
155 | // | |
b42a9f88 | 156 | const Float_t AliTRDgeometry::fgkRaZpos = -1.74; |
b42a9f88 | 157 | const Float_t AliTRDgeometry::fgkMyZpos = 0.6550; |
158 | const Float_t AliTRDgeometry::fgkDrZpos = 2.1600; | |
159 | const Float_t AliTRDgeometry::fgkAmZpos = 3.9100; | |
793ff80c | 160 | const Float_t AliTRDgeometry::fgkCuZpos = -1.3370; |
161 | const Float_t AliTRDgeometry::fgkSuZpos = 0.0000; | |
52052b58 | 162 | //const Float_t AliTRDgeometry::fgkFeZpos = 1.3053; |
163 | //const Float_t AliTRDgeometry::fgkCoZpos = 1.3175; | |
164 | //const Float_t AliTRDgeometry::fgkWaZpos = 1.3325; | |
165 | const Float_t AliTRDgeometry::fgkFeZpos = 1.2853; | |
166 | const Float_t AliTRDgeometry::fgkCoZpos = 1.2975; | |
167 | const Float_t AliTRDgeometry::fgkWaZpos = 1.3175; | |
793ff80c | 168 | |
f7336fa3 | 169 | //_____________________________________________________________________________ |
170 | AliTRDgeometry::AliTRDgeometry():AliGeometry() | |
171 | { | |
172 | // | |
173 | // AliTRDgeometry default constructor | |
174 | // | |
175 | ||
176 | Init(); | |
177 | ||
178 | } | |
179 | ||
180 | //_____________________________________________________________________________ | |
181 | AliTRDgeometry::~AliTRDgeometry() | |
182 | { | |
8230f242 | 183 | // |
184 | // AliTRDgeometry destructor | |
185 | // | |
f7336fa3 | 186 | |
187 | } | |
188 | ||
189 | //_____________________________________________________________________________ | |
190 | void AliTRDgeometry::Init() | |
191 | { | |
192 | // | |
193 | // Initializes the geometry parameter | |
194 | // | |
195 | ||
793ff80c | 196 | Int_t isect; |
f7336fa3 | 197 | |
198 | // The width of the chambers | |
793ff80c | 199 | fCwidth[0] = 99.6; |
200 | fCwidth[1] = 104.1; | |
201 | fCwidth[2] = 108.5; | |
202 | fCwidth[3] = 112.9; | |
203 | fCwidth[4] = 117.4; | |
204 | fCwidth[5] = 121.8; | |
f7336fa3 | 205 | |
206 | // The maximum number of pads | |
207 | // and the position of pad 0,0,0 | |
208 | // | |
209 | // chambers seen from the top: | |
210 | // +----------------------------+ | |
211 | // | | | |
793ff80c | 212 | // | | ^ |
213 | // | | rphi| | |
214 | // | | | | |
215 | // |0 | | | |
216 | // +----------------------------+ +------> | |
f7336fa3 | 217 | // z |
793ff80c | 218 | // chambers seen from the side: ^ |
219 | // +----------------------------+ drift| | |
220 | // |0 | | | |
221 | // | | | | |
222 | // +----------------------------+ +------> | |
f7336fa3 | 223 | // z |
224 | // | |
a2b90f83 | 225 | // IMPORTANT: time bin 0 is now the first one in the drift region |
226 | // closest to the readout !!! | |
793ff80c | 227 | // |
f7336fa3 | 228 | |
229 | // The pad column (rphi-direction) | |
71d9fa7b | 230 | SetNColPad(96); |
793ff80c | 231 | |
a2b90f83 | 232 | // The number of time bins. Default is 100 ns timbin size |
6244debe | 233 | SetNTimeBin(15); |
793ff80c | 234 | |
a2b90f83 | 235 | // Additional time bins before and after the drift region. |
236 | // Default is to only sample the drift region | |
237 | SetExpandTimeBin(0,0); | |
238 | ||
793ff80c | 239 | // The rotation matrix elements |
240 | Float_t phi = 0; | |
241 | for (isect = 0; isect < fgkNsect; isect++) { | |
242 | phi = -2.0 * kPI / (Float_t) fgkNsect * ((Float_t) isect + 0.5); | |
243 | fRotA11[isect] = TMath::Cos(phi); | |
244 | fRotA12[isect] = TMath::Sin(phi); | |
245 | fRotA21[isect] = TMath::Sin(phi); | |
246 | fRotA22[isect] = TMath::Cos(phi); | |
247 | phi = -1.0 * phi; | |
248 | fRotB11[isect] = TMath::Cos(phi); | |
249 | fRotB12[isect] = TMath::Sin(phi); | |
250 | fRotB21[isect] = TMath::Sin(phi); | |
251 | fRotB22[isect] = TMath::Cos(phi); | |
252 | } | |
253 | ||
254 | } | |
255 | ||
256 | //_____________________________________________________________________________ | |
a2b90f83 | 257 | void AliTRDgeometry::SetNColPad(const Int_t npad) |
793ff80c | 258 | { |
259 | // | |
71d9fa7b | 260 | // Redefines the number of pads in column direction |
793ff80c | 261 | // |
262 | ||
793ff80c | 263 | for (Int_t iplan = 0; iplan < fgkNplan; iplan++) { |
71d9fa7b | 264 | fColMax[iplan] = npad; |
265 | fColPadSize[iplan] = (fCwidth[iplan] - 2. * fgkCcthick) / fColMax[iplan]; | |
266 | fCol0[iplan] = -fCwidth[iplan]/2. + fgkCcthick; | |
f7336fa3 | 267 | } |
268 | ||
793ff80c | 269 | } |
270 | ||
271 | //_____________________________________________________________________________ | |
a2b90f83 | 272 | void AliTRDgeometry::SetNTimeBin(const Int_t nbin) |
793ff80c | 273 | { |
274 | // | |
a2b90f83 | 275 | // Redefines the number of time bins in the drift region. |
276 | // The time bin width is defined by the length of the | |
277 | // drift region divided by <nbin>. | |
793ff80c | 278 | // |
279 | ||
71d9fa7b | 280 | fTimeMax = nbin; |
281 | fTimeBinSize = fgkDrThick / ((Float_t) fTimeMax); | |
793ff80c | 282 | for (Int_t iplan = 0; iplan < fgkNplan; iplan++) { |
283 | fTime0[iplan] = fgkRmin + fgkCcframe/2. + fgkDrZpos + 0.5 * fgkDrThick | |
284 | + iplan * (fgkCheight + fgkCspace); | |
285 | } | |
f7336fa3 | 286 | |
287 | } | |
288 | ||
289 | //_____________________________________________________________________________ | |
290 | void AliTRDgeometry::CreateGeometry(Int_t *idtmed) | |
291 | { | |
292 | // | |
293 | // Create the TRD geometry | |
294 | // | |
295 | // Author: Christoph Blume (C.Blume@gsi.de) 20/07/99 | |
296 | // | |
297 | // The volumes: | |
298 | // TRD1-3 (Air) --- The TRD mother volumes for one sector. | |
299 | // To be placed into the spaceframe. | |
300 | // | |
301 | // UAFI(/M/O) (Al) --- The aluminum frame of the inner(/middle/outer) chambers (readout) | |
302 | // UCFI(/M/O) (C) --- The carbon frame of the inner(/middle/outer) chambers | |
303 | // (driftchamber + radiator) | |
304 | // UAII(/M/O) (Air) --- The inner part of the readout of the inner(/middle/outer) chambers | |
305 | // UFII(/M/O) (Air) --- The inner part of the chamner and radiator of the | |
306 | // inner(/middle/outer) chambers | |
307 | // | |
308 | // The material layers in one chamber: | |
db30bf0f | 309 | // UL03 (Rohacell) --- The radiator |
310 | // UL04 (Mylar) --- Entrance window to the driftvolume and HV-cathode | |
311 | // UL05 (Xe) --- The driftvolume | |
312 | // UL06 (Xe) --- The amplification region | |
f7336fa3 | 313 | // |
db30bf0f | 314 | // UL07 (Cu) --- The pad plane |
315 | // UL08 (G10) --- The Nomex honeycomb support structure | |
316 | // UL09 (Cu) --- FEE and signal lines | |
317 | // UL10 (Al) --- The cooling devices | |
318 | // UL11 (Water) --- The cooling water | |
f7336fa3 | 319 | |
8230f242 | 320 | const Int_t kNparCha = 3; |
f7336fa3 | 321 | |
8230f242 | 322 | Float_t parDum[3]; |
323 | Float_t parCha[kNparCha]; | |
f7336fa3 | 324 | |
325 | Float_t xpos, ypos, zpos; | |
326 | ||
327 | // The aluminum frames - readout + electronics (Al) | |
328 | // The inner chambers | |
8230f242 | 329 | gMC->Gsvolu("UAFI","BOX ",idtmed[1301-1],parDum,0); |
f7336fa3 | 330 | // The middle chambers |
8230f242 | 331 | gMC->Gsvolu("UAFM","BOX ",idtmed[1301-1],parDum,0); |
f7336fa3 | 332 | // The outer chambers |
8230f242 | 333 | gMC->Gsvolu("UAFO","BOX ",idtmed[1301-1],parDum,0); |
f7336fa3 | 334 | |
335 | // The inner part of the aluminum frames (Air) | |
336 | // The inner chambers | |
8230f242 | 337 | gMC->Gsvolu("UAII","BOX ",idtmed[1302-1],parDum,0); |
f7336fa3 | 338 | // The middle chambers |
8230f242 | 339 | gMC->Gsvolu("UAIM","BOX ",idtmed[1302-1],parDum,0); |
f7336fa3 | 340 | // The outer chambers |
8230f242 | 341 | gMC->Gsvolu("UAIO","BOX ",idtmed[1302-1],parDum,0); |
f7336fa3 | 342 | |
343 | // The carbon frames - radiator + driftchamber (C) | |
344 | // The inner chambers | |
8230f242 | 345 | gMC->Gsvolu("UCFI","BOX ",idtmed[1307-1],parDum,0); |
f7336fa3 | 346 | // The middle chambers |
8230f242 | 347 | gMC->Gsvolu("UCFM","BOX ",idtmed[1307-1],parDum,0); |
f7336fa3 | 348 | // The outer chambers |
8230f242 | 349 | gMC->Gsvolu("UCFO","BOX ",idtmed[1307-1],parDum,0); |
f7336fa3 | 350 | |
351 | // The inner part of the carbon frames (Air) | |
352 | // The inner chambers | |
8230f242 | 353 | gMC->Gsvolu("UCII","BOX ",idtmed[1302-1],parDum,0); |
f7336fa3 | 354 | // The middle chambers |
8230f242 | 355 | gMC->Gsvolu("UCIM","BOX ",idtmed[1302-1],parDum,0); |
f7336fa3 | 356 | // The outer chambers |
8230f242 | 357 | gMC->Gsvolu("UCIO","BOX ",idtmed[1302-1],parDum,0); |
f7336fa3 | 358 | |
359 | // The material layers inside the chambers | |
8230f242 | 360 | parCha[0] = -1.; |
361 | parCha[1] = -1.; | |
db30bf0f | 362 | // Rohacell layer (radiator) |
793ff80c | 363 | parCha[2] = fgkRaThick/2; |
db30bf0f | 364 | gMC->Gsvolu("UL03","BOX ",idtmed[1315-1],parCha,kNparCha); |
f7336fa3 | 365 | // Mylar layer (entrance window + HV cathode) |
793ff80c | 366 | parCha[2] = fgkMyThick/2; |
8230f242 | 367 | gMC->Gsvolu("UL04","BOX ",idtmed[1308-1],parCha,kNparCha); |
db30bf0f | 368 | // Xe/Isobutane layer (drift volume) |
793ff80c | 369 | parCha[2] = fgkDrThick/2.; |
8230f242 | 370 | gMC->Gsvolu("UL05","BOX ",idtmed[1309-1],parCha,kNparCha); |
db30bf0f | 371 | // Xe/Isobutane layer (amplification volume) |
793ff80c | 372 | parCha[2] = fgkAmThick/2.; |
8230f242 | 373 | gMC->Gsvolu("UL06","BOX ",idtmed[1309-1],parCha,kNparCha); |
f7336fa3 | 374 | |
375 | // Cu layer (pad plane) | |
793ff80c | 376 | parCha[2] = fgkCuThick/2; |
8230f242 | 377 | gMC->Gsvolu("UL07","BOX ",idtmed[1305-1],parCha,kNparCha); |
f7336fa3 | 378 | // G10 layer (support structure) |
793ff80c | 379 | parCha[2] = fgkSuThick/2; |
8230f242 | 380 | gMC->Gsvolu("UL08","BOX ",idtmed[1313-1],parCha,kNparCha); |
f7336fa3 | 381 | // Cu layer (FEE + signal lines) |
793ff80c | 382 | parCha[2] = fgkFeThick/2; |
8230f242 | 383 | gMC->Gsvolu("UL09","BOX ",idtmed[1305-1],parCha,kNparCha); |
db30bf0f | 384 | // Al layer (cooling devices) |
793ff80c | 385 | parCha[2] = fgkCoThick/2; |
db30bf0f | 386 | gMC->Gsvolu("UL10","BOX ",idtmed[1301-1],parCha,kNparCha); |
f7336fa3 | 387 | // Water layer (cooling) |
793ff80c | 388 | parCha[2] = fgkWaThick/2; |
8230f242 | 389 | gMC->Gsvolu("UL11","BOX ",idtmed[1314-1],parCha,kNparCha); |
f7336fa3 | 390 | |
391 | // Position the layers in the chambers | |
392 | xpos = 0; | |
393 | ypos = 0; | |
394 | ||
db30bf0f | 395 | // Rohacell layer (radiator) |
793ff80c | 396 | zpos = fgkRaZpos; |
db30bf0f | 397 | gMC->Gspos("UL03",1,"UCII",xpos,ypos,zpos,0,"ONLY"); |
398 | gMC->Gspos("UL03",2,"UCIM",xpos,ypos,zpos,0,"ONLY"); | |
399 | gMC->Gspos("UL03",3,"UCIO",xpos,ypos,zpos,0,"ONLY"); | |
f7336fa3 | 400 | // Mylar layer (entrance window + HV cathode) |
793ff80c | 401 | zpos = fgkMyZpos; |
f7336fa3 | 402 | gMC->Gspos("UL04",1,"UCII",xpos,ypos,zpos,0,"ONLY"); |
403 | gMC->Gspos("UL04",2,"UCIM",xpos,ypos,zpos,0,"ONLY"); | |
404 | gMC->Gspos("UL04",3,"UCIO",xpos,ypos,zpos,0,"ONLY"); | |
405 | // Xe/Isobutane layer (drift volume) | |
793ff80c | 406 | zpos = fgkDrZpos; |
f7336fa3 | 407 | gMC->Gspos("UL05",1,"UCII",xpos,ypos,zpos,0,"ONLY"); |
408 | gMC->Gspos("UL05",2,"UCIM",xpos,ypos,zpos,0,"ONLY"); | |
409 | gMC->Gspos("UL05",3,"UCIO",xpos,ypos,zpos,0,"ONLY"); | |
410 | // Xe/Isobutane layer (amplification volume) | |
793ff80c | 411 | zpos = fgkAmZpos; |
f7336fa3 | 412 | gMC->Gspos("UL06",1,"UCII",xpos,ypos,zpos,0,"ONLY"); |
413 | gMC->Gspos("UL06",2,"UCIM",xpos,ypos,zpos,0,"ONLY"); | |
414 | gMC->Gspos("UL06",3,"UCIO",xpos,ypos,zpos,0,"ONLY"); | |
f7336fa3 | 415 | // Cu layer (pad plane) |
793ff80c | 416 | zpos = fgkCuZpos; |
f7336fa3 | 417 | gMC->Gspos("UL07",1,"UAII",xpos,ypos,zpos,0,"ONLY"); |
418 | gMC->Gspos("UL07",2,"UAIM",xpos,ypos,zpos,0,"ONLY"); | |
419 | gMC->Gspos("UL07",3,"UAIO",xpos,ypos,zpos,0,"ONLY"); | |
420 | // G10 layer (support structure) | |
793ff80c | 421 | zpos = fgkSuZpos; |
f7336fa3 | 422 | gMC->Gspos("UL08",1,"UAII",xpos,ypos,zpos,0,"ONLY"); |
423 | gMC->Gspos("UL08",2,"UAIM",xpos,ypos,zpos,0,"ONLY"); | |
424 | gMC->Gspos("UL08",3,"UAIO",xpos,ypos,zpos,0,"ONLY"); | |
425 | // Cu layer (FEE + signal lines) | |
793ff80c | 426 | zpos = fgkFeZpos; |
f7336fa3 | 427 | gMC->Gspos("UL09",1,"UAII",xpos,ypos,zpos,0,"ONLY"); |
428 | gMC->Gspos("UL09",2,"UAIM",xpos,ypos,zpos,0,"ONLY"); | |
429 | gMC->Gspos("UL09",3,"UAIO",xpos,ypos,zpos,0,"ONLY"); | |
db30bf0f | 430 | // Al layer (cooling devices) |
793ff80c | 431 | zpos = fgkCoZpos; |
f7336fa3 | 432 | gMC->Gspos("UL10",1,"UAII",xpos,ypos,zpos,0,"ONLY"); |
433 | gMC->Gspos("UL10",2,"UAIM",xpos,ypos,zpos,0,"ONLY"); | |
434 | gMC->Gspos("UL10",3,"UAIO",xpos,ypos,zpos,0,"ONLY"); | |
435 | // Water layer (cooling) | |
793ff80c | 436 | zpos = fgkWaZpos; |
f7336fa3 | 437 | gMC->Gspos("UL11",1,"UAII",xpos,ypos,zpos,0,"ONLY"); |
438 | gMC->Gspos("UL11",1,"UAIM",xpos,ypos,zpos,0,"ONLY"); | |
439 | gMC->Gspos("UL11",1,"UAIO",xpos,ypos,zpos,0,"ONLY"); | |
440 | ||
441 | } | |
442 | ||
443 | //_____________________________________________________________________________ | |
94de3818 | 444 | Bool_t AliTRDgeometry::Local2Global(Int_t idet, Float_t *local, Float_t *global) const |
f7336fa3 | 445 | { |
446 | // | |
447 | // Converts local pad-coordinates (row,col,time) into | |
448 | // global ALICE reference frame coordinates (x,y,z) | |
449 | // | |
450 | ||
793ff80c | 451 | Int_t icham = GetChamber(idet); // Chamber info (0-4) |
452 | Int_t isect = GetSector(idet); // Sector info (0-17) | |
453 | Int_t iplan = GetPlane(idet); // Plane info (0-5) | |
f7336fa3 | 454 | |
6f1e466d | 455 | return Local2Global(iplan,icham,isect,local,global); |
f7336fa3 | 456 | |
457 | } | |
458 | ||
459 | //_____________________________________________________________________________ | |
460 | Bool_t AliTRDgeometry::Local2Global(Int_t iplan, Int_t icham, Int_t isect | |
94de3818 | 461 | , Float_t *local, Float_t *global) const |
f7336fa3 | 462 | { |
463 | // | |
464 | // Converts local pad-coordinates (row,col,time) into | |
465 | // global ALICE reference frame coordinates (x,y,z) | |
466 | // | |
467 | ||
793ff80c | 468 | Int_t idet = GetDetector(iplan,icham,isect); // Detector number |
f7336fa3 | 469 | |
793ff80c | 470 | Float_t padRow = local[0]; // Pad Row position |
471 | Float_t padCol = local[1]; // Pad Column position | |
472 | Float_t timeSlice = local[2]; // Time "position" | |
f7336fa3 | 473 | |
793ff80c | 474 | Float_t row0 = GetRow0(iplan,icham,isect); |
475 | Float_t col0 = GetCol0(iplan); | |
476 | Float_t time0 = GetTime0(iplan); | |
f7336fa3 | 477 | |
793ff80c | 478 | Float_t rot[3]; |
f7336fa3 | 479 | |
480 | // calculate (x,y,z) position in rotated chamber | |
a2b90f83 | 481 | rot[0] = time0 - (timeSlice - fTimeBefore) * fTimeBinSize; |
482 | rot[1] = col0 + padCol * fColPadSize[iplan]; | |
483 | rot[2] = row0 + padRow * fRowPadSize[iplan][icham][isect]; | |
f7336fa3 | 484 | |
485 | // Rotate back to original position | |
486 | return RotateBack(idet,rot,global); | |
487 | ||
488 | } | |
489 | ||
490 | //_____________________________________________________________________________ | |
793ff80c | 491 | Bool_t AliTRDgeometry::Rotate(Int_t d, Float_t *pos, Float_t *rot) const |
f7336fa3 | 492 | { |
493 | // | |
494 | // Rotates all chambers in the position of sector 0 and transforms | |
495 | // the coordinates in the ALICE restframe <pos> into the | |
496 | // corresponding local frame <rot>. | |
497 | // | |
498 | ||
793ff80c | 499 | Int_t sector = GetSector(d); |
f7336fa3 | 500 | |
793ff80c | 501 | rot[0] = pos[0] * fRotA11[sector] + pos[1] * fRotA12[sector]; |
502 | rot[1] = -pos[0] * fRotA21[sector] + pos[1] * fRotA22[sector]; | |
f7336fa3 | 503 | rot[2] = pos[2]; |
504 | ||
505 | return kTRUE; | |
506 | ||
507 | } | |
508 | ||
509 | //_____________________________________________________________________________ | |
94de3818 | 510 | Bool_t AliTRDgeometry::RotateBack(Int_t d, Float_t *rot, Float_t *pos) const |
f7336fa3 | 511 | { |
512 | // | |
513 | // Rotates a chambers from the position of sector 0 into its | |
514 | // original position and transforms the corresponding local frame | |
515 | // coordinates <rot> into the coordinates of the ALICE restframe <pos>. | |
516 | // | |
517 | ||
793ff80c | 518 | Int_t sector = GetSector(d); |
f7336fa3 | 519 | |
793ff80c | 520 | pos[0] = rot[0] * fRotB11[sector] + rot[1] * fRotB12[sector]; |
521 | pos[1] = -rot[0] * fRotB21[sector] + rot[1] * fRotB22[sector]; | |
6f1e466d | 522 | pos[2] = rot[2]; |
f7336fa3 | 523 | |
524 | return kTRUE; | |
525 | ||
526 | } | |
527 | ||
528 | //_____________________________________________________________________________ | |
ff821236 | 529 | Int_t AliTRDgeometry::GetDetector(const Int_t p, const Int_t c, const Int_t s) const |
f7336fa3 | 530 | { |
531 | // | |
532 | // Convert plane / chamber / sector into detector number | |
533 | // | |
534 | ||
793ff80c | 535 | return (p + c * fgkNplan + s * fgkNplan * fgkNcham); |
f7336fa3 | 536 | |
537 | } | |
538 | ||
539 | //_____________________________________________________________________________ | |
ff821236 | 540 | Int_t AliTRDgeometry::GetPlane(const Int_t d) const |
f7336fa3 | 541 | { |
542 | // | |
543 | // Reconstruct the plane number from the detector number | |
544 | // | |
545 | ||
793ff80c | 546 | return ((Int_t) (d % fgkNplan)); |
f7336fa3 | 547 | |
548 | } | |
549 | ||
550 | //_____________________________________________________________________________ | |
ff821236 | 551 | Int_t AliTRDgeometry::GetChamber(const Int_t d) const |
f7336fa3 | 552 | { |
553 | // | |
554 | // Reconstruct the chamber number from the detector number | |
555 | // | |
556 | ||
793ff80c | 557 | return ((Int_t) (d % (fgkNplan * fgkNcham)) / fgkNplan); |
f7336fa3 | 558 | |
559 | } | |
560 | ||
561 | //_____________________________________________________________________________ | |
ff821236 | 562 | Int_t AliTRDgeometry::GetSector(const Int_t d) const |
f7336fa3 | 563 | { |
564 | // | |
565 | // Reconstruct the sector number from the detector number | |
566 | // | |
567 | ||
793ff80c | 568 | return ((Int_t) (d / (fgkNplan * fgkNcham))); |
f7336fa3 | 569 | |
570 | } | |
571 | ||
572 | //_____________________________________________________________________________ | |
793ff80c | 573 | void AliTRDgeometry::GetGlobal(const AliRecPoint *p, TVector3 &pos |
574 | , TMatrix &mat) const | |
f7336fa3 | 575 | { |
576 | // | |
577 | // Returns the global coordinate and error matrix of a AliTRDrecPoint | |
578 | // | |
579 | ||
580 | GetGlobal(p,pos); | |
9d0b222b | 581 | mat.Zero(); |
f7336fa3 | 582 | |
583 | } | |
584 | ||
585 | //_____________________________________________________________________________ | |
94de3818 | 586 | void AliTRDgeometry::GetGlobal(const AliRecPoint *p, TVector3 &pos) const |
f7336fa3 | 587 | { |
588 | // | |
589 | // Returns the global coordinate and error matrix of a AliTRDrecPoint | |
590 | // | |
591 | ||
592 | Int_t detector = ((AliTRDrecPoint *) p)->GetDetector(); | |
593 | ||
594 | Float_t global[3]; | |
595 | Float_t local[3]; | |
6f1e466d | 596 | local[0] = ((AliTRDrecPoint *) p)->GetLocalRow(); |
597 | local[1] = ((AliTRDrecPoint *) p)->GetLocalCol(); | |
598 | local[2] = ((AliTRDrecPoint *) p)->GetLocalTime(); | |
f7336fa3 | 599 | |
600 | if (Local2Global(detector,local,global)) { | |
601 | pos.SetX(global[0]); | |
602 | pos.SetY(global[1]); | |
603 | pos.SetZ(global[2]); | |
604 | } | |
605 | else { | |
606 | pos.SetX(0.0); | |
607 | pos.SetY(0.0); | |
608 | pos.SetZ(0.0); | |
609 | } | |
610 | ||
611 | } |