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