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