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