New chamber geometry
[u/mrichter/AliRoot.git] / TRD / AliTRDgeometryHole.cxx
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$
18 Revision 1.7  2002/02/11 14:21:16  cblume
19 Update of the geometry. Get rid of MANY
20
21 Revision 1.6  2001/05/11 07:56:12  hristov
22 Consistent declarations needed on Alpha
23
24 Revision 1.5  2001/02/14 18:22:26  cblume
25 Change in the geometry of the padplane
26
27 Revision 1.4  2000/11/01 14:53:21  cblume
28 Merge with TRD-develop
29
30 Revision 1.1.4.4  2000/10/15 23:40:01  cblume
31 Remove AliTRDconst
32
33 Revision 1.1.4.3  2000/10/06 16:49:46  cblume
34 Made Getters const
35
36 Revision 1.1.4.2  2000/10/04 16:34:58  cblume
37 Replace include files by forward declarations
38
39 Revision 1.1.4.1  2000/09/22 14:43:41  cblume
40 Allow the pad/timebin-dimensions to be changed after initialization
41
42 Revision 1.3  2000/10/02 21:28:19  fca
43 Removal of useless dependecies via forward declarations
44
45 Revision 1.2  2000/06/08 18:32:58  cblume
46 Make code compliant to coding conventions
47
48 Revision 1.1  2000/02/28 19:01:42  cblume
49 Add new TRD classes
50
51 */
52
53 ///////////////////////////////////////////////////////////////////////////////
54 //                                                                           //
55 //  TRD geometry with holes                                                  //
56 //                                                                           //
57 ///////////////////////////////////////////////////////////////////////////////
58
59 #include "AliMC.h"
60
61 #include "AliTRDgeometryHole.h"
62
63 ClassImp(AliTRDgeometryHole)
64
65 //_____________________________________________________________________________
66 AliTRDgeometryHole::AliTRDgeometryHole():AliTRDgeometry()
67 {
68   //
69   // AliTRDgeometryHole default constructor
70   //
71
72   Init();
73
74 }
75
76 //_____________________________________________________________________________
77 AliTRDgeometryHole::~AliTRDgeometryHole()
78 {
79   //
80   // AliTRDgeometryHole destructor
81   //
82
83 }
84
85 //_____________________________________________________________________________
86 void AliTRDgeometryHole::Init()
87 {
88   //
89   // Initializes the geometry parameter
90   //
91
92   Int_t iplan;
93   Int_t icham;
94
95   // The outer lengths of the chambers for the sectors with holes for the PHOS
96   Float_t lengthPH[kNplan][kNcham] = { {   0.0,   0.0,   0.0, 117.0, 124.0 }
97                                      , {   0.0,   0.0,   0.0, 124.0, 131.0 }
98                                      , {   0.0,   0.0,   0.0, 131.0, 138.0 }
99                                      , {   0.0,   0.0,   0.0, 138.0, 145.0 }
100                                      , {   0.0,   0.0,   0.0, 140.0, 147.0 }
101                                      , {   0.0,   0.0,   0.0, 140.0, 147.0 } };
102
103   // The outer lengths of the chambers for the sectors with holes for the RICH
104   Float_t lengthRH[kNplan][kNcham] = { {   0.0,   0.0,   0.0,   0.0,  87.5 }
105                                      , {   0.0,   0.0,   0.0,   0.0, 101.5 }
106                                      , {   0.0,   0.0,   0.0,   0.0, 115.5 }
107                                      , {   0.0,   0.0,   0.0,   0.0, 129.5 }
108                                      , {   0.0,   0.0,   0.0,   0.0, 133.5 }
109                                      , {   0.0,   0.0,   0.0,   0.0, 133.5 } };
110
111   for (icham = 0; icham < kNcham; icham++) {
112     for (iplan = 0; iplan < kNplan; iplan++) {
113       fClengthPH[iplan][icham] = lengthPH[iplan][icham];
114       fClengthRH[iplan][icham] = lengthRH[iplan][icham];
115     }
116   }
117
118 }
119
120 //_____________________________________________________________________________
121 void AliTRDgeometryHole::CreateGeometry(Int_t *idtmed)
122 {
123   //
124   // Create the TRD geometry with holes
125   //
126   // Names of the TRD volumina (xx = detector number):
127   //
128   //      Lower part of the readout chambers (gas volume + radiator)
129   //
130   //        UAxx    Aluminum frames             (Al)
131   //        UBxx    G10 frames                  (C)
132   //        UCxx    Inner volumes               (Air)
133   //
134   //      Upper part of the readout chambers (readout plane + fee)
135   //
136   //        UDxx    G10 frames                  (C)
137   //        UExx    Inner volumes of the G10    (Air)
138   //        UFxx    Aluminum frames             (Al)
139   //        UGxx    Inner volumes of the Al     (Air)
140   //
141   //      Inner material layers
142   //
143   //        UHxx    Radiator                    (Rohacell)
144   //        UIxx    Entrance window             (Mylar)
145   //        UJxx    Drift volume                (Xe/CO2)
146   //        UKxx    Amplification volume        (Xe/CO2)
147   //        ULxx    Pad plane                   (Cu)
148   //        UMxx    Support structure           (Rohacell)
149   //        UNxx    FEE + signal lines          (Cu)
150   //        UOxx    Cooling device              (Al)
151   //        UPxx    Cooling device              (Water)
152   //
153
154   const Int_t kNdet    = kNplan * kNcham;
155
156   const Int_t kNparTrd = 4;
157   const Int_t kNparCha = 3;
158
159   Float_t xpos, ypos, zpos;
160
161   Float_t parTrd[kNparTrd];
162   Float_t parCha[kNparCha];
163
164   Char_t  cTagV[5];
165   Char_t  cTagM[5];
166
167   AliTRDgeometry::CreateGeometry(idtmed);
168
169   // The TRD mother volume for one sector (Air), full length in z-direction
170   parTrd[0] = fgkSwidth1/2.;
171   parTrd[1] = fgkSwidth2/2.;
172   parTrd[2] = fgkSlenTR1/2.;
173   parTrd[3] = fgkSheight/2.;
174   gMC->Gsvolu("UTR1","TRD1",idtmed[1302-1],parTrd,kNparTrd);
175
176   // The TRD mother volume for one sector (Air), leaving hole for PHOS
177   parTrd[0] = fgkSwidth1/2.;
178   parTrd[1] = fgkSwidth2/2.;
179   parTrd[2] = fgkSlenTR2/2.;
180   parTrd[3] = fgkSheight/2.;
181   gMC->Gsvolu("UTR2","TRD1",idtmed[1302-1],parTrd,kNparTrd);
182
183   // The TRD mother volume for one sector (Air), leaving hole for RICH
184   parTrd[0] = fgkSwidth1/2.;
185   parTrd[1] = fgkSwidth2/2.;
186   parTrd[2] = fgkSlenTR3/2.;
187   parTrd[3] = fgkSheight/2.;
188   gMC->Gsvolu("UTR3","TRD1",idtmed[1302-1],parTrd,kNparTrd);
189
190   for (Int_t icham = 0; icham < kNcham; icham++) {
191     for (Int_t iplan = 0; iplan < kNplan; iplan++) {  
192
193       Int_t iDet = GetDetectorSec(iplan,icham);
194
195       // The lower part of the readout chambers (gas volume + radiator) 
196       // The aluminum frames 
197       sprintf(cTagV,"UA%02d",iDet);
198       parCha[0] = fCwidth[iplan]/2.;
199       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.;
200       parCha[2] = fgkCraH/2. + fgkCdrH/2.;
201       gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
202       // The G10 frames 
203       sprintf(cTagV,"UB%02d",iDet);
204       parCha[0] = fCwidth[iplan]/2. - fgkCalT; 
205       parCha[1] = -1.;
206       parCha[2] = -1.;
207       gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
208       // The inner part (air)
209       sprintf(cTagV,"UC%02d",iDet);
210       parCha[0] = fCwidth[iplan]/2. - fgkCalT - fgkCclsT; 
211       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.- fgkCclfT;
212       parCha[2] = -1.;
213       gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
214       if (fClengthPH[iplan][icham] > 0.0) {
215         // The aluminum frames 
216         sprintf(cTagV,"UA%02d",iDet+kNdet);
217         parCha[0] = fCwidth[iplan]/2.;
218         parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.;
219         parCha[2] = fgkCraH/2. + fgkCdrH/2.;
220         gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
221         // The G10 frames 
222         sprintf(cTagV,"UB%02d",iDet+kNdet);
223         parCha[0] = fCwidth[iplan]/2. - fgkCalT; 
224         parCha[1] = -1.;
225         parCha[2] = -1.;
226         gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
227         // The inner part (air)
228         sprintf(cTagV,"UC%02d",iDet+kNdet);
229         parCha[0] = fCwidth[iplan]/2. - fgkCalT - fgkCclsT; 
230         parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.- fgkCclfT;
231         parCha[2] = -1.;
232         gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
233       }
234       if (fClengthRH[iplan][icham] > 0.0) {
235         // The aluminum frames 
236         sprintf(cTagV,"UA%02d",iDet+2*kNdet);
237         parCha[0] = fCwidth[iplan]/2.;
238         parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.;
239         parCha[2] = fgkCraH/2. + fgkCdrH/2.;
240         gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
241         // The G10 frames 
242         sprintf(cTagV,"UB%02d",iDet+2*kNdet);
243         parCha[0] = fCwidth[iplan]/2. - fgkCalT; 
244         parCha[1] = -1.;
245         parCha[2] = -1.;
246         gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
247         // The inner part (air)
248         sprintf(cTagV,"UC%02d",iDet+2*kNdet);
249         parCha[0] = fCwidth[iplan]/2. - fgkCalT - fgkCclsT; 
250         parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.- fgkCclfT;
251         parCha[2] = -1.;
252         gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
253       }
254
255       // The upper part of the readout chambers (readout plane + fee)
256       // The G10 frames
257       sprintf(cTagV,"UD%02d",iDet);
258       parCha[0] = fCwidth[iplan]/2. + fgkCroW;
259       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.;
260       parCha[2] = fgkCamH/2.;
261       gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
262       // The inner part of the G10 frame (air)
263       sprintf(cTagV,"UE%02d",iDet);
264       parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCcuT; 
265       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.- fgkCcuT;
266       parCha[2] = -1.;
267       gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
268       // The aluminum frames
269       sprintf(cTagV,"UF%02d",iDet);
270       parCha[0] = fCwidth[iplan]/2. + fgkCroW;
271       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.;
272       parCha[2] = fgkCroH/2.;
273       gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
274       // The inner part of the aluminum frames
275       sprintf(cTagV,"UG%02d",iDet);
276       parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCauT; 
277       parCha[1] = fClength[iplan][icham]/2. - fgkHspace/2.- fgkCauT;
278       parCha[2] = -1.;
279       gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
280       if (fClengthPH[iplan][icham] > 0.0) {
281         sprintf(cTagV,"UD%02d",iDet+kNdet);
282         parCha[0] = fCwidth[iplan]/2. + fgkCroW;
283         parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.;
284         parCha[2] = fgkCamH/2.;
285         gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
286         // The inner part of the G10 frame (air)
287         sprintf(cTagV,"UE%02d",iDet+kNdet);
288         parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCcuT; 
289         parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.- fgkCcuT;
290         parCha[2] = -1.;
291         gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
292         // The aluminum frames
293         sprintf(cTagV,"UF%02d",iDet+kNdet);
294         parCha[0] = fCwidth[iplan]/2. + fgkCroW;
295         parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.;
296         parCha[2] = fgkCroH/2.;
297         gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
298         // The inner part of the aluminum frames
299         sprintf(cTagV,"UG%02d",iDet+kNdet);
300         parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCauT; 
301         parCha[1] = fClengthPH[iplan][icham]/2. - fgkHspace/2.- fgkCauT;
302         parCha[2] = -1.;
303         gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
304       }
305       if (fClengthRH[iplan][icham] > 0.0) {
306         sprintf(cTagV,"UD%02d",iDet+2*kNdet);
307         parCha[0] = fCwidth[iplan]/2. + fgkCroW;
308         parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.;
309         parCha[2] = fgkCamH/2.;
310         gMC->Gsvolu(cTagV,"BOX ",idtmed[1307-1],parCha,kNparCha);
311         // The inner part of the G10 frame (air)
312         sprintf(cTagV,"UE%02d",iDet+2*kNdet);
313         parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCcuT; 
314         parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.- fgkCcuT;
315         parCha[2] = -1.;
316         gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
317         // The aluminum frames
318         sprintf(cTagV,"UF%02d",iDet+2*kNdet);
319         parCha[0] = fCwidth[iplan]/2. + fgkCroW;
320         parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.;
321         parCha[2] = fgkCroH/2.;
322         gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
323         // The inner part of the aluminum frames
324         sprintf(cTagV,"UG%02d",iDet+2*kNdet);
325         parCha[0] = fCwidth[iplan]/2. + fgkCroW - fgkCauT; 
326         parCha[1] = fClengthRH[iplan][icham]/2. - fgkHspace/2.- fgkCauT;
327         parCha[2] = -1.;
328         gMC->Gsvolu(cTagV,"BOX ",idtmed[1302-1],parCha,kNparCha);
329       }
330
331       // The material layers inside the chambers
332       parCha[0] = -1.;
333       parCha[1] = -1.;
334       // Rohacell layer (radiator)
335       parCha[2] = fgkRaThick/2;
336       sprintf(cTagV,"UH%02d",iDet);
337       gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
338       // Mylar layer (entrance window + HV cathode) 
339       parCha[2] = fgkMyThick/2;
340       sprintf(cTagV,"UI%02d",iDet);
341       gMC->Gsvolu(cTagV,"BOX ",idtmed[1308-1],parCha,kNparCha);
342       // Xe/Isobutane layer (drift volume) 
343       parCha[2] = fgkDrThick/2.;
344       sprintf(cTagV,"UJ%02d",iDet);
345       gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
346       // Xe/Isobutane layer (amplification volume)
347       parCha[2] = fgkAmThick/2.;
348       sprintf(cTagV,"UK%02d",iDet);
349       gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);  
350       // Cu layer (pad plane)
351       parCha[2] = fgkCuThick/2;
352       sprintf(cTagV,"UL%02d",iDet);
353       gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
354       // G10 layer (support structure / honeycomb)
355       parCha[2] = fgkSuThick/2;
356       sprintf(cTagV,"UM%02d",iDet);
357       gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
358       // Cu layer (FEE + signal lines)
359       parCha[2] = fgkFeThick/2;
360       sprintf(cTagV,"UN%02d",iDet);
361       gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
362       // Al layer (cooling devices)
363       parCha[2] = fgkCoThick/2;
364       sprintf(cTagV,"UO%02d",iDet);
365       gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
366       // Water layer (cooling)
367       parCha[2] = fgkWaThick/2;
368       sprintf(cTagV,"UP%02d",iDet);
369       gMC->Gsvolu(cTagV,"BOX ",idtmed[1314-1],parCha,kNparCha);
370       if (fClengthPH[iplan][icham] > 0.0) {
371         // Rohacell layer (radiator)
372         parCha[2] = fgkRaThick/2;
373         sprintf(cTagV,"UH%02d",iDet+kNdet);
374         gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
375         // Mylar layer (entrance window + HV cathode) 
376         parCha[2] = fgkMyThick/2;
377         sprintf(cTagV,"UI%02d",iDet+kNdet);
378         gMC->Gsvolu(cTagV,"BOX ",idtmed[1308-1],parCha,kNparCha);
379         // Xe/Isobutane layer (drift volume) 
380         parCha[2] = fgkDrThick/2.;
381         sprintf(cTagV,"UJ%02d",iDet+kNdet);
382         gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
383         // Xe/Isobutane layer (amplification volume)
384         parCha[2] = fgkAmThick/2.;
385         sprintf(cTagV,"UK%02d",iDet+kNdet);
386         gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);  
387         // Cu layer (pad plane)
388         parCha[2] = fgkCuThick/2;
389         sprintf(cTagV,"UL%02d",iDet+kNdet);
390         gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
391         // G10 layer (support structure / honeycomb)
392         parCha[2] = fgkSuThick/2;
393         sprintf(cTagV,"UM%02d",iDet+kNdet);
394         gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
395         // Cu layer (FEE + signal lines)
396         parCha[2] = fgkFeThick/2;
397         sprintf(cTagV,"UN%02d",iDet+kNdet);
398         gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
399         // Al layer (cooling devices)
400         parCha[2] = fgkCoThick/2;
401         sprintf(cTagV,"UO%02d",iDet+kNdet);
402         gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
403         // Water layer (cooling)
404         parCha[2] = fgkWaThick/2;
405         sprintf(cTagV,"UP%02d",iDet+kNdet);
406         gMC->Gsvolu(cTagV,"BOX ",idtmed[1314-1],parCha,kNparCha);
407       }
408       if (fClengthRH[iplan][icham] > 0.0) {
409         // Rohacell layer (radiator)
410         parCha[2] = fgkRaThick/2;
411         sprintf(cTagV,"UH%02d",iDet+2*kNdet);
412         gMC->Gsvolu(cTagV,"BOX ",idtmed[1315-1],parCha,kNparCha);
413         // Mylar layer (entrance window + HV cathode) 
414         parCha[2] = fgkMyThick/2;
415         sprintf(cTagV,"UI%02d",iDet+2*kNdet);
416         gMC->Gsvolu(cTagV,"BOX ",idtmed[1308-1],parCha,kNparCha);
417         // Xe/Isobutane layer (drift volume) 
418         parCha[2] = fgkDrThick/2.;
419         sprintf(cTagV,"UJ%02d",iDet+2*kNdet);
420         gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);
421         // Xe/Isobutane layer (amplification volume)
422         parCha[2] = fgkAmThick/2.;
423         sprintf(cTagV,"UK%02d",iDet+2*kNdet);
424         gMC->Gsvolu(cTagV,"BOX ",idtmed[1309-1],parCha,kNparCha);  
425         // Cu layer (pad plane)
426         parCha[2] = fgkCuThick/2;
427         sprintf(cTagV,"UL%02d",iDet+2*kNdet);
428         gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
429         // G10 layer (support structure / honeycomb)
430         parCha[2] = fgkSuThick/2;
431         sprintf(cTagV,"UM%02d",iDet+2*kNdet);
432         gMC->Gsvolu(cTagV,"BOX ",idtmed[1313-1],parCha,kNparCha);
433         // Cu layer (FEE + signal lines)
434         parCha[2] = fgkFeThick/2;
435         sprintf(cTagV,"UN%02d",iDet+2*kNdet);
436         gMC->Gsvolu(cTagV,"BOX ",idtmed[1305-1],parCha,kNparCha);
437         // Al layer (cooling devices)
438         parCha[2] = fgkCoThick/2.;
439         sprintf(cTagV,"UO%02d",iDet+2*kNdet);
440         gMC->Gsvolu(cTagV,"BOX ",idtmed[1301-1],parCha,kNparCha);
441         // Water layer (cooling)
442         parCha[2] = fgkWaThick/2;
443         sprintf(cTagV,"UP%02d",iDet+2*kNdet);
444         gMC->Gsvolu(cTagV,"BOX ",idtmed[1314-1],parCha,kNparCha);
445       }
446
447       // Position the layers in the chambers
448       xpos = 0;
449       ypos = 0;
450       // Lower part
451       // Rohacell layer (radiator)
452       zpos = fgkRaZpos;
453       sprintf(cTagV,"UH%02d",iDet);
454       sprintf(cTagM,"UC%02d",iDet);
455       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
456       // Mylar layer (entrance window + HV cathode)   
457       zpos = fgkMyZpos;
458       sprintf(cTagV,"UI%02d",iDet);
459       sprintf(cTagM,"UC%02d",iDet);
460       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
461       // Xe/Isobutane layer (drift volume) 
462       zpos = fgkDrZpos;
463       sprintf(cTagV,"UJ%02d",iDet);
464       sprintf(cTagM,"UC%02d",iDet);
465       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
466       // Upper part
467       // Xe/Isobutane layer (amplification volume)
468       zpos = fgkAmZpos;
469       sprintf(cTagV,"UK%02d",iDet);
470       sprintf(cTagM,"UE%02d",iDet);
471       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
472       // Readout part
473       // Cu layer (pad plane)
474       zpos = fgkCuZpos; 
475       sprintf(cTagV,"UL%02d",iDet);
476       sprintf(cTagM,"UG%02d",iDet);
477       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
478       // G10 layer (support structure)
479       zpos = fgkSuZpos;
480       sprintf(cTagV,"UM%02d",iDet);
481       sprintf(cTagM,"UG%02d",iDet);
482       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
483       // Cu layer (FEE + signal lines)
484       zpos = fgkFeZpos; 
485       sprintf(cTagV,"UN%02d",iDet);
486       sprintf(cTagM,"UG%02d",iDet);
487       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
488       // Al layer (cooling devices)
489       zpos = fgkCoZpos;
490       sprintf(cTagV,"UO%02d",iDet);
491       sprintf(cTagM,"UG%02d",iDet);
492       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
493       // Water layer (cooling)
494       zpos = fgkWaZpos;
495       sprintf(cTagV,"UP%02d",iDet);
496       sprintf(cTagM,"UG%02d",iDet);
497       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
498       if (fClengthPH[iplan][icham] > 0.0) {
499         // Lower part
500         // Rohacell layer (radiator)
501         zpos = fgkRaZpos;
502         sprintf(cTagV,"UH%02d",iDet+kNdet);
503         sprintf(cTagM,"UC%02d",iDet+kNdet);
504         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
505         // Mylar layer (entrance window + HV cathode)   
506         zpos = fgkMyZpos;
507         sprintf(cTagV,"UI%02d",iDet+kNdet);
508         sprintf(cTagM,"UC%02d",iDet+kNdet);
509         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
510         // Xe/Isobutane layer (drift volume) 
511         zpos = fgkDrZpos;
512         sprintf(cTagV,"UJ%02d",iDet+kNdet);
513         sprintf(cTagM,"UC%02d",iDet+kNdet);
514         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
515         // Upper part
516         // Xe/Isobutane layer (amplification volume)
517         zpos = fgkAmZpos;
518         sprintf(cTagV,"UK%02d",iDet+kNdet);
519         sprintf(cTagM,"UE%02d",iDet+kNdet);
520         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
521         // Readout part
522         // Cu layer (pad plane)
523         zpos = fgkCuZpos; 
524         sprintf(cTagV,"UL%02d",iDet+kNdet);
525         sprintf(cTagM,"UG%02d",iDet+kNdet);
526         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
527         // G10 layer (support structure)
528         zpos = fgkSuZpos;
529         sprintf(cTagV,"UM%02d",iDet+kNdet);
530         sprintf(cTagM,"UG%02d",iDet+kNdet);
531         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
532         // Cu layer (FEE + signal lines)
533         zpos = fgkFeZpos; 
534         sprintf(cTagV,"UN%02d",iDet+kNdet);
535         sprintf(cTagM,"UG%02d",iDet+kNdet);
536         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
537         // Al layer (cooling devices)
538         zpos = fgkCoZpos;
539         sprintf(cTagV,"UO%02d",iDet+kNdet);
540         sprintf(cTagM,"UG%02d",iDet+kNdet);
541         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
542         // Water layer (cooling)
543         zpos = fgkWaZpos;
544         sprintf(cTagV,"UP%02d",iDet+kNdet);
545         sprintf(cTagM,"UG%02d",iDet+kNdet);
546         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
547       }
548       if (fClengthRH[iplan][icham] > 0.0) {
549         // Lower part
550         // Rohacell layer (radiator)
551         zpos = fgkRaZpos;
552         sprintf(cTagV,"UH%02d",iDet+2*kNdet);
553         sprintf(cTagM,"UC%02d",iDet+2*kNdet);
554         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
555         // Mylar layer (entrance window + HV cathode)   
556         zpos = fgkMyZpos;
557         sprintf(cTagV,"UI%02d",iDet+2*kNdet);
558         sprintf(cTagM,"UC%02d",iDet+2*kNdet);
559         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
560         // Xe/Isobutane layer (drift volume) 
561         zpos = fgkDrZpos;
562         sprintf(cTagV,"UJ%02d",iDet+2*kNdet);
563         sprintf(cTagM,"UC%02d",iDet+2*kNdet);
564         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
565         // Upper part
566         // Xe/Isobutane layer (amplification volume)
567         zpos = fgkAmZpos;
568         sprintf(cTagV,"UK%02d",iDet+2*kNdet);
569         sprintf(cTagM,"UE%02d",iDet+2*kNdet);
570         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
571         // Readout part
572         // Cu layer (pad plane)
573         zpos = fgkCuZpos; 
574         sprintf(cTagV,"UL%02d",iDet+2*kNdet);
575         sprintf(cTagM,"UG%02d",iDet+2*kNdet);
576         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
577         // G10 layer (support structure)
578         zpos = fgkSuZpos;
579         sprintf(cTagV,"UM%02d",iDet+2*kNdet);
580         sprintf(cTagM,"UG%02d",iDet+2*kNdet);
581         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
582         // Cu layer (FEE + signal lines)
583         zpos = fgkFeZpos; 
584         sprintf(cTagV,"UN%02d",iDet+2*kNdet);
585         sprintf(cTagM,"UG%02d",iDet+2*kNdet);
586         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
587         // Al layer (cooling devices)
588         zpos = fgkCoZpos;
589         sprintf(cTagV,"UO%02d",iDet+2*kNdet);
590         sprintf(cTagM,"UG%02d",iDet+2*kNdet);
591         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
592         // Water layer (cooling)
593         zpos = fgkWaZpos;
594         sprintf(cTagV,"UP%02d",iDet+2*kNdet);
595         sprintf(cTagM,"UG%02d",iDet+2*kNdet);
596         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
597       }
598
599       // Position the inner volumes of the chambers in the frames
600       xpos      = 0.0;
601       ypos      = 0.0;
602       zpos      = 0.0;
603       // The inside of the lower G10 frame
604       sprintf(cTagV,"UC%02d",iDet);
605       sprintf(cTagM,"UB%02d",iDet);
606       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
607       // The lower G10 frame inside the aluminum frame
608       sprintf(cTagV,"UB%02d",iDet);
609       sprintf(cTagM,"UA%02d",iDet);
610       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
611       // The inside of the upper G10 frame
612       sprintf(cTagV,"UE%02d",iDet);
613       sprintf(cTagM,"UD%02d",iDet);
614       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
615       // The inside of the upper aluminum frame
616       sprintf(cTagV,"UG%02d",iDet);
617       sprintf(cTagM,"UF%02d",iDet);
618       gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");      
619       if (fClengthPH[iplan][icham] > 0.0) {
620         // The inside of the lower G10 frame
621         sprintf(cTagV,"UC%02d",iDet+kNdet);
622         sprintf(cTagM,"UB%02d",iDet+kNdet);
623         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
624         // The lower G10 frame inside the aluminum frame
625         sprintf(cTagV,"UB%02d",iDet+kNdet);
626         sprintf(cTagM,"UA%02d",iDet+kNdet);
627         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
628         // The inside of the upper G10 frame
629         sprintf(cTagV,"UE%02d",iDet+kNdet);
630         sprintf(cTagM,"UD%02d",iDet+kNdet);
631         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
632         // The inside of the upper aluminum frame
633         sprintf(cTagV,"UG%02d",iDet+kNdet);
634         sprintf(cTagM,"UF%02d",iDet+kNdet);
635         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");      
636       }
637       if (fClengthRH[iplan][icham] > 0.0) {
638         // The inside of the lower G10 frame
639         sprintf(cTagV,"UC%02d",iDet+2*kNdet);
640         sprintf(cTagM,"UB%02d",iDet+2*kNdet);
641         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
642         // The lower G10 frame inside the aluminum frame
643         sprintf(cTagV,"UB%02d",iDet+2*kNdet);
644         sprintf(cTagM,"UA%02d",iDet+2*kNdet);
645         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
646         // The inside of the upper G10 frame
647         sprintf(cTagV,"UE%02d",iDet+2*kNdet);
648         sprintf(cTagM,"UD%02d",iDet+2*kNdet);
649         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");
650         // The inside of the upper aluminum frame
651         sprintf(cTagV,"UG%02d",iDet+2*kNdet);
652         sprintf(cTagM,"UF%02d",iDet+2*kNdet);
653         gMC->Gspos(cTagV,1,cTagM,xpos,ypos,zpos,0,"ONLY");      
654       }
655
656       // Position the frames of the chambers in the TRD mother volume
657       xpos  = 0.;
658       ypos  = - fClength[iplan][0] - fClength[iplan][1] - fClength[iplan][2]/2.;
659       for (Int_t ic = 0; ic < icham; ic++) {
660         ypos += fClength[iplan][ic];        
661       }
662       ypos += fClength[iplan][icham]/2.;
663       zpos  = fgkCraH/2. + fgkCdrH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
664       // The lower aluminum frame, radiator + drift region
665       sprintf(cTagV,"UA%02d",iDet);
666       gMC->Gspos(cTagV,1,"UTR1",xpos,ypos,zpos,0,"ONLY");
667       // The upper G10 frame, amplification region
668       sprintf(cTagV,"UD%02d",iDet);
669       zpos += fgkCamH/2. + fgkCraH/2. + fgkCdrH/2.;
670       gMC->Gspos(cTagV,1,"UTR1",xpos,ypos,zpos,0,"ONLY");
671       // The upper aluminum frame
672       sprintf(cTagV,"UF%02d",iDet);
673       zpos += fgkCroH/2. + fgkCamH/2.;
674       gMC->Gspos(cTagV,1,"UTR1",xpos,ypos,zpos,0,"ONLY");
675       if (fClengthPH[iplan][icham] > 0.0) {
676         xpos  = 0.;
677         ypos  = - fgkSlenTR2/2.;
678         for (Int_t ic = 0; ic < icham; ic++) {
679           ypos += fClengthPH[iplan][ic];        
680         }
681         ypos += fClengthPH[iplan][icham]/2.;
682         zpos  = fgkCraH/2. + fgkCdrH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
683         // The lower aluminum frame, radiator + drift region
684         sprintf(cTagV,"UA%02d",iDet+kNdet);
685         gMC->Gspos(cTagV,1,"UTR2",xpos,ypos,zpos,0,"ONLY");
686         // The upper G10 frame, amplification region
687         sprintf(cTagV,"UD%02d",iDet+kNdet);
688         zpos += fgkCamH/2. + fgkCraH/2. + fgkCdrH/2.;
689         gMC->Gspos(cTagV,1,"UTR2",xpos,ypos,zpos,0,"ONLY");
690         // The upper aluminum frame
691         sprintf(cTagV,"UF%02d",iDet+kNdet);
692         zpos += fgkCroH/2. + fgkCamH/2.;
693         gMC->Gspos(cTagV,1,"UTR2",xpos,ypos,zpos,0,"ONLY");
694       }
695       if (fClengthRH[iplan][icham] > 0.0) {
696         xpos  = 0.;
697         ypos  = - fgkSlenTR3/2.;
698         for (Int_t ic = 0; ic < icham; ic++) {
699           ypos += fClengthRH[iplan][ic];        
700         }
701         ypos += fClengthRH[iplan][icham]/2.;
702         zpos  = fgkCraH/2. + fgkCdrH/2. - fgkSheight/2. + iplan * (fgkCH + fgkVspace);
703         // The lower aluminum frame, radiator + drift region
704         sprintf(cTagV,"UA%02d",iDet+2*kNdet);
705         gMC->Gspos(cTagV,1,"UTR3",xpos,ypos,zpos,0,"ONLY");
706         // The upper G10 frame, amplification region
707         sprintf(cTagV,"UD%02d",iDet+2*kNdet);
708         zpos += fgkCamH/2. + fgkCraH/2. + fgkCdrH/2.;
709         gMC->Gspos(cTagV,1,"UTR3",xpos,ypos,zpos,0,"ONLY");
710         // The upper aluminum frame
711         sprintf(cTagV,"UF%02d",iDet+2*kNdet);
712         zpos += fgkCroH/2. + fgkCamH/2.;
713         gMC->Gspos(cTagV,1,"UTR3",xpos,ypos,zpos,0,"ONLY");
714       }
715
716     }
717   }
718
719   xpos = 0.;
720   ypos = 0.;
721   zpos = 0.;
722   gMC->Gspos("UTR1",1,"BTR1",xpos,ypos,zpos,0,"ONLY");
723   gMC->Gspos("UTR2",2,"BTR2",xpos,ypos,zpos,0,"ONLY");
724   gMC->Gspos("UTR3",3,"BTR3",xpos,ypos,zpos,0,"ONLY");
725
726 }
727
728 //_____________________________________________________________________________
729 void AliTRDgeometryHole::SetOldGeometry()
730 {
731   //
732   // Use the old chamber lengths
733   //
734
735   Int_t icham;
736   Int_t iplan;
737
738   AliTRDgeometry::SetOldGeometry();
739
740   // The outer lengths of the chambers for the sectors with holes for the PHOS
741   Float_t lengthPH[kNplan][kNcham] = { {   0.0,   0.0,   0.0, 116.5, 123.5 }
742                                      , {   0.0,   0.0,   0.0, 124.0, 131.0 }
743                                      , {   0.0,   0.0,   0.0, 131.5, 134.5 }
744                                      , {   0.0,   0.0,   0.0, 139.0, 142.0 }
745                                      , {   0.0,   0.0,   0.0, 146.0, 142.0 }
746                                      , {   0.0,   0.0,   0.0, 153.5, 134.5 } };
747
748   // The outer lengths of the chambers for the sectors with holes for the RICH
749   Float_t lengthRH[kNplan][kNcham] = { {   0.0,   0.0,   0.0,   0.0,  86.5 }
750                                      , {   0.0,   0.0,   0.0,   0.0, 101.5 }
751                                      , {   0.0,   0.0,   0.0,   0.0, 112.5 }
752                                      , {   0.0,   0.0,   0.0,   0.0, 127.5 }
753                                      , {   0.0,   0.0,   0.0,   0.0, 134.5 }
754                                      , {   0.0,   0.0,   0.0,   0.0, 134.5 } };
755
756   for (icham = 0; icham < kNcham; icham++) {
757     for (iplan = 0; iplan < kNplan; iplan++) {
758       fClengthPH[iplan][icham] = lengthPH[iplan][icham];
759       fClengthRH[iplan][icham] = lengthRH[iplan][icham];
760     }
761   }
762
763 }
764
765
766