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