1d16ff0cbbde18a175c5b940ff2e5eea34d983e7
[u/mrichter/AliRoot.git] / FMD / AliFMDv1.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.11  2000/12/22 11:17:39  hristov
19 New FMD code from Alla + code cleaning
20
21 Revision 1.10  2000/10/02 21:28:07  fca
22 Removal of useless dependecies via forward declarations
23
24 Revision 1.9  2000/05/10 21:56:07  fca
25 Avoid clashes with ITS and add supports
26
27 Revision 1.7  1999/09/29 09:24:14  fca
28 Introduction of the Copyright and cvs Log
29
30 */
31
32 ///////////////////////////////////////////////////////////////////////////////
33 //                                                                           //
34 //  Forward Multiplicity Detector version 1                                  //
35 //                                                                           //
36 //Begin_Html
37 /*
38 <img src="picts/AliFMDv1Class.gif">
39 </pre>
40 <br clear=left>
41 <font size=+2 color=red>
42 <p>The responsible person for this module is
43 <a href="mailto:Valeri.Kondratiev@cern.ch">Valeri Kondratiev</a>.
44 </font>
45 <pre>
46 */
47 //End_Html
48 //                                                                           //
49 ///////////////////////////////////////////////////////////////////////////////
50
51 #include "AliRun.h"
52 #include "AliFMDv1.h"
53 #include "AliMC.h"
54 #include "AliMagF.h"
55 #include <stdlib.h>
56  
57 ClassImp(AliFMDv1)
58  
59 //_____________________________________________________________________________
60 AliFMDv1::AliFMDv1()
61 {
62   //
63   // Default constructor for FMD version 1
64   //
65 }
66  
67 //_____________________________________________________________________________
68 AliFMDv1::AliFMDv1(const char *name, const char *title)
69   : AliFMD(name,title)
70 {
71   //
72   // Standard constructor for FMD version 1
73   //
74   AliModule *start = gAlice->GetModule("START");
75   if(start) {
76     Error("ctor","This version of FMD is incompatible with START\n");
77     exit(1);
78   }
79 }
80  
81 //___________________________________________
82 void AliFMDv1::CreateGeometry()
83 {
84   //
85   // Creation of the geometry of the FMD version 1
86   //
87   //Begin_Html
88   /*
89     <img src="picts/AliFMDv1Tree.gif">
90   */
91   //End_Html
92   //Begin_Html
93   /*
94     <img src="picts/AliFMDv1.gif">
95   */
96   //End_Html
97
98   
99   Float_t rout, z;
100   Float_t par[3], rin;
101
102   Int_t irotm[100];
103   
104   TArrayI &idtmed = *fIdtmed;    
105   
106   // ******************************************************** 
107   //       DEFINE DISK#3  OF FMD 
108   // ******************************************************** 
109   
110   gMC->Gsvolu("BR3_", "BOX ", idtmed[4], par, 0);
111   gMC->Gsvolu("CB3_", "BOX ", idtmed[5], par, 0);
112   gMC->Gsvolu("BR5_", "BOX ", idtmed[4], par, 0);
113   gMC->Gsvolu("CB5_", "BOX ", idtmed[5], par, 0);
114
115   //       Define parameters for the right disk 
116   
117   rin  = 4.5;
118   rout = 10.5;
119   z    = 77.;
120
121   //       Ring #1 
122
123   par[0] = rin;
124   par[1] = rout;
125   par[2] = 1.5;
126   gMC->Gsvolu("R1R3", "TUBE", idtmed[1], par, 3);
127   gMC->Gspos("R1R3", 1, "ALIC", 0., 0., z + 1.5, 0, "ONLY");
128
129   //       Ring #2 
130
131   par[0] = rout;
132   par[1] = rout + .65;
133   par[2] = 1.5;
134   gMC->Gsvolu("R2R3", "TUBE", idtmed[2], par, 3);
135   gMC->Gspos("R2R3", 1, "ALIC", 0., 0., z + 1.5, 0, "ONLY");
136
137   //       Ring #3 
138
139   par[0] = rout + .65;
140   par[1] = rout + 5.65;
141   par[2] = .025;
142   gMC->Gsvolu("R3R3", "TUBE", idtmed[3], par, 3);
143   gMC->Gspos("R3R3", 1, "ALIC", 0., 0., z + 1.525, 0, "ONLY");
144
145   //       Bracket #1
146
147   par[0] = 1.5;
148   par[1] = 0.1;
149   par[2] = 15.35;
150   gMC->Matrix(irotm[11], 90., 0., 161.2, 90., 71.2, 90.);
151   gMC->Gsposp("BR3_",1,"ALIC", 0., 25.25, 85.0, irotm[11],"ONLY",par,3); 
152   par[1] = 0.5;
153   gMC->Gsposp("CB3_",1,"ALIC", 0., 25.41, 84.53,irotm[11],"ONLY",par,3); 
154
155
156   //       Bracket #2
157
158   par[0] = 1.5;
159   par[1] = 0.1;
160   par[2] = 15.35;
161   gMC->Matrix(irotm[12], 90., 180., 161.2, 270., 71.2, 270.);
162   gMC->Gsposp("BR3_",2,"ALIC", 0.,-25.25, 85.0, irotm[12],"ONLY",par,3); 
163   par[1] = 0.5;
164   gMC->Gsposp("CB3_",2,"ALIC", 0.,-25.41, 84.53,irotm[12],"ONLY",par,3); 
165
166
167   //       Bracket #3
168
169   par[0] = 1.5;
170   par[1] = 0.1;
171   par[2] = 15.35;
172   gMC->Matrix(irotm[13], 90., 270., 161.2, 0., 71.2, 0.);
173   gMC->Gsposp("BR3_",3,"ALIC", 25.25, 0., 85.0, irotm[13],"ONLY",par,3); 
174   par[1] = 0.5;
175   gMC->Gsposp("CB3_",3,"ALIC", 25.41, 0., 84.53,irotm[13],"ONLY",par,3); 
176
177
178   //       Bracket #4
179
180   par[0] = 1.5;
181   par[1] = 0.1;
182   par[2] = 15.35;
183   gMC->Matrix(irotm[14], 90., 90., 161.2, 180., 71.2, 180.);
184   gMC->Gsposp("BR3_",4,"ALIC", -25.25, 0., 85.0, irotm[14],"ONLY",par,3); 
185   par[1] = 0.5;
186   gMC->Gsposp("CB3_",4,"ALIC", -25.41, 0., 84.53,irotm[14],"ONLY",par,3); 
187
188   //       Right support ring 
189
190   par[0] = 39.;
191   par[1] = 41.;
192   par[2] = .5;
193   gMC->Gsvolu("R1SP", "TUBE", idtmed[4], par, 3);
194   gMC->Gspos("R1SP", 1, "ALIC", 0., 0., 89.5, 0, "ONLY");
195
196   //       Define parameters for the left disk
197   
198   rin  = 4.5;
199   rout = 10.5;
200   z    = -77.;
201
202   //       Ring #1 
203
204   par[0] = rin;
205   par[1] = rout;
206   par[2] = 1.5;
207   gMC->Gsvolu("R1L3", "TUBE", idtmed[1], par, 3);
208   gMC->Gspos("R1L3", 1, "ALIC", 0., 0., z - 1.5, 0, "ONLY");
209
210   //       Ring #2 
211
212   par[0] = rout;
213   par[1] = rout + .65;
214   par[2] = 1.5;
215   gMC->Gsvolu("R2L3", "TUBE", idtmed[2], par, 3);
216   gMC->Gspos("R2L3", 1, "ALIC", 0., 0., z - 1.5, 0, "ONLY");
217
218   //       Ring #3 
219
220   par[0] = rout + .65;
221   par[1] = rout + 5.65;
222   par[2] = .025;
223   gMC->Gsvolu("R3L3", "TUBE", idtmed[3], par, 3);
224   gMC->Gspos("R3L3", 1, "ALIC", 0., 0., z - 1.525, 0, "ONLY");
225
226   //       Bracket #1
227
228   par[0] = 1.5;
229   par[1] = 0.1;
230   par[2] = 15.35;
231   gMC->Matrix(irotm[61], 90., 0., 180.-161.2, 90., 180.-71.2, 90.);
232   gMC->Gsposp("BR3_",5,"ALIC", 0., 25.25, -85.0, irotm[61],"ONLY",par,3); 
233   par[1] = 0.5;
234   gMC->Gsposp("CB3_",5,"ALIC", 0., 25.41, -84.53,irotm[61],"ONLY",par,3); 
235
236   gMC->Matrix(irotm[91], 90., 0., 90.-10.6, 90., 180.-10.6, 90.);
237   par[1] = 0.1;
238   par[2] = 81.4;
239   gMC->Gsposp("BR5_",1,"ALIC", 0., 55.0, -170.0,irotm[91],"ONLY",par,3); 
240   par[1] = 0.5;
241   gMC->Gsposp("CB5_",1,"ALIC", 0., 55.5, -169.5,irotm[91],"ONLY",par,3); 
242
243   //       Bracket #2
244
245   par[0] = 1.5;
246   par[1] = 0.1;
247   par[2] = 15.35;
248   gMC->Matrix(irotm[62], 90., 180., 180.-161.2, 270., 180.-71.2, 270.);
249   gMC->Gsposp("BR3_",6,"ALIC", 0.,-25.25, -85.0,irotm[62],"ONLY",par,3); 
250   par[1] = 0.5;
251   gMC->Gsposp("CB3_",6,"ALIC", 0.,-25.41, -84.53,irotm[62],"ONLY",par,3); 
252
253   gMC->Matrix(irotm[92], 90., 180., 90.-10.6, 270., 180.-10.6, 270.);
254   par[1] = 0.1;
255   par[2] = 81.4;
256   gMC->Gsposp("BR5_",2,"ALIC", 0., -55.0, -170.0,irotm[92],"ONLY",par,3); 
257   par[1] = 0.5;
258   gMC->Gsposp("CB5_",2,"ALIC", 0., -55.5, -169.5,irotm[92],"ONLY",par,3); 
259
260   //       Bracket #3
261
262   par[0] = 1.5;
263   par[1] = 0.1;
264   par[2] = 15.35;
265   gMC->Matrix(irotm[63], 90., 270., 180.-161.2, 0., 180.-71.2, 0.);
266   gMC->Gsposp("BR3_",7,"ALIC", 25.25, 0., -85.0, irotm[63],"ONLY",par,3); 
267   par[1] = 0.5;
268   gMC->Gsposp("CB3_",7,"ALIC", 25.41, 0., -84.53,irotm[63],"ONLY",par,3); 
269
270   gMC->Matrix(irotm[93], 90., 270., 90.-10.6, 0., 180.-10.6, 0.);
271   par[1] = 0.1;
272   par[2] = 81.4;
273   gMC->Gsposp("BR5_",3,"ALIC", 55., 0., -170.,irotm[93],"ONLY",par,3); 
274   par[1] = 0.5;
275   gMC->Gsposp("CB5_",3,"ALIC", 55.5, 0., -169.5,irotm[93],"ONLY",par,3); 
276
277   //       Bracket #4
278
279   par[0] = 1.5;
280   par[1] = 0.1;
281   par[2] = 15.35;
282   gMC->Matrix(irotm[64], 90., 90., 180.-161.2, 180., 180.-71.2, 180.);
283   gMC->Gsposp("BR3_",8,"ALIC", -25.25, 0., -85., irotm[64],"ONLY",par,3); 
284   par[1] = 0.5;
285   gMC->Gsposp("CB3_",8,"ALIC", -25.41, 0., -84.53,irotm[64],"ONLY",par,3); 
286
287   gMC->Matrix(irotm[94], 90., 90., 90.-10.6, 180., 180.-10.6, 180.);
288   par[1] = 0.1;
289   par[2] = 81.4;
290   gMC->Gsposp("BR5_",4,"ALIC", -55., 0., -170.,irotm[94],"ONLY",par,3); 
291   par[1] = 0.5;
292   gMC->Gsposp("CB5_",4,"ALIC", -55.5, 0., -169.5,irotm[94],"ONLY",par,3); 
293
294   //       Central support ring 
295
296   par[0] = 39.;
297   par[1] = 41.;
298   par[2] = .5;
299   gMC->Gsvolu("R2SP", "TUBE", idtmed[4], par, 3);
300   gMC->Gspos("R2SP", 1, "ALIC", 0., 0., -89.5, 0, "ONLY");
301
302   //        Left support ring 
303
304   par[0] = 69.;
305   par[1] = 71.;
306   par[2] = .5;
307   gMC->Gsvolu("R3SP", "TUBE", idtmed[4], par, 3);
308   gMC->Gspos("R3SP", 1, "ALIC", 0., 0., -249.5, 0, "ONLY");
309
310   // ******************************************************** 
311   //       DEFINE  DISK#2  OF FMD 
312   // ******************************************************** 
313   
314   gMC->Gsvolu("BR2_", "BOX ", idtmed[4], par, 0);
315   gMC->Gsvolu("CB2_", "BOX ", idtmed[5], par, 0);
316
317   //       Define parameters for right disk #2
318   
319   rin  = 7.7;
320   rout = 13.7;
321   z    = 64.4;
322
323   //       Ring #1 
324
325   par[0] = rin;
326   par[1] = rout;
327   par[2] = 1.5;
328   gMC->Gsvolu("R1R2", "TUBE", idtmed[1], par, 3);
329   gMC->Gspos("R1R2", 1, "ALIC", 0., 0., z + 1.5, 0, "ONLY");
330
331   //       Ring #2 
332
333   par[0] = rout;
334   par[1] = rout + .65;
335   par[2] = 1.5;
336   gMC->Gsvolu("R2R2", "TUBE", idtmed[2], par, 3);
337   gMC->Gspos("R2R2", 1, "ALIC", 0., 0., z + 1.5, 0, "ONLY");
338
339   //       Ring #3 
340
341   par[0] = rout + .65;
342   par[1] = rout + 5.65;
343   par[2] = .025;
344   gMC->Gsvolu("R3R2", "TUBE", idtmed[3], par, 3);
345   gMC->Gspos("R3R2", 1, "ALIC", 0., 0., z + 1.525, 0, "ONLY");
346
347   //       Bracket #1
348
349   par[0] = 1.5;
350   par[1] = 0.1;
351   par[2] = 17.35;
352   gMC->Matrix(irotm[21], 90., 30., 139.3, 120., 49.3, 120.);
353   gMC->Gsposp("BR2_",1,"ALIC", -13.4, 23.3, 78.7, irotm[21],"ONLY",par,3); 
354   par[1] = 0.5;
355   gMC->Gsposp("CB2_",1,"ALIC", -13.56, 23.6, 78.4, irotm[21],"ONLY",par,3); 
356
357   //       Bracket #2
358
359   par[0] = 1.5;
360   par[1] = 0.1;
361   par[2] = 17.35;
362   gMC->Matrix(irotm[22], 90., 210., 139.3, 300., 49.3, 300.);
363   gMC->Gsposp("BR2_",2,"ALIC", 13.4,-23.3, 78.7, irotm[22],"ONLY",par,3); 
364   par[1] = 0.5;
365   gMC->Gsposp("CB2_",2,"ALIC", 13.5,-23.6, 78.4,irotm[22],"ONLY",par,3); 
366
367
368   //       Bracket #3
369
370   par[0] = 1.5;
371   par[1] = 0.1;
372   par[2] = 17.35;
373   gMC->Matrix(irotm[23], 90., 300., 139.3, 30., 49.3, 30.);
374   gMC->Gsposp("BR2_",3,"ALIC", 23.3, 13.4, 78.7, irotm[23],"ONLY",par,3); 
375   par[1] = 0.5;
376   gMC->Gsposp("CB2_",3,"ALIC", 23.6, 13.56, 78.4,irotm[23],"ONLY",par,3); 
377
378   //       Bracket #4
379
380   par[0] = 1.5;
381   par[1] = 0.1;
382   par[2] = 17.35;
383   gMC->Matrix(irotm[24], 90., 120., 139.3, 210., 49.3, 210.);
384   gMC->Gsposp("BR2_",4,"ALIC", -23.3, -13.4, 78.7,irotm[24],"ONLY",par,3); 
385   par[1] = 0.5;
386   gMC->Gsposp("CB2_",4,"ALIC", -23.6, -13.56, 78.4,irotm[24],"ONLY",par,3); 
387
388   //       Define parameters for left disk
389   
390   rin  = 7.7;
391   rout = 13.7;
392   z    = -64.4;
393
394   //       Ring #1 
395
396   par[0] = rin;
397   par[1] = rout;
398   par[2] = 1.5;
399   gMC->Gsvolu("R1L2", "TUBE", idtmed[1], par, 3);
400   gMC->Gspos("R1L2", 1, "ALIC", 0., 0., z - 1.5, 0, "ONLY");
401
402   //       Ring #2 
403
404   par[0] = rout;
405   par[1] = rout + .65;
406   par[2] = 1.5;
407   gMC->Gsvolu("R2L2", "TUBE", idtmed[2], par, 3);
408   gMC->Gspos("R2L2", 1, "ALIC", 0., 0., z - 1.5, 0, "ONLY");
409
410   //       Ring #3 
411
412   par[0] = rout + .65;
413   par[1] = rout + 5.65;
414   par[2] = .025;
415   gMC->Gsvolu("R3L2", "TUBE", idtmed[3], par, 3);
416   gMC->Gspos("R3L2", 1, "ALIC", 0., 0., z - 1.525, 0, "ONLY");
417
418   //       Bracket #1
419
420   par[0] = 1.5;
421   par[1] = 0.1;
422   par[2] = 17.35;
423   gMC->Matrix(irotm[51], 90., 30., 180.-139.3, 120., 180.-49.3, 120.);
424   gMC->Gsposp("BR2_",5,"ALIC", -13.4, 23.3, -78.7, irotm[51],"ONLY",par,3); 
425   par[1] = 0.5;
426   gMC->Gsposp("CB2_",5,"ALIC", -13.56, 23.6, -78.4,irotm[51],"ONLY",par,3); 
427
428   gMC->Matrix(irotm[81], 90., 30., 90.-10.6, 120., 180.-10.6, 120.);
429   par[1] = 0.1;
430   par[2] = 81.4;
431   gMC->Gsposp("BR5_",5,"ALIC", -27.5, 47.6, -170.0,irotm[81],"ONLY",par,3); 
432   par[1] = 0.5;
433   gMC->Gsposp("CB5_",5,"ALIC", -27.85, 48., -169.5,irotm[81],"ONLY",par,3); 
434
435   //       Bracket #2
436
437   par[0] = 1.5;
438   par[1] = 0.1;
439   par[2] = 17.35;
440   gMC->Matrix(irotm[52], 90., 210., 180.-139.3, 300., 180.-49.3, 300.);
441   gMC->Gsposp("BR2_",6,"ALIC", 13.4, -23.3, -78.7,irotm[52],"ONLY",par,3); 
442   par[1] = 0.5;
443   gMC->Gsposp("CB2_",6,"ALIC", 13.56, -23.6, -78.4,irotm[52],"ONLY",par,3); 
444
445   gMC->Matrix(irotm[82], 90., 210., 90.-10.6, 300., 180.-10.6, 300.);
446   par[1] = 0.1;
447   par[2] = 81.4;
448   gMC->Gsposp("BR5_",6,"ALIC", 27.5, -47.6, -170.0,irotm[82],"ONLY",par,3); 
449   par[1] = 0.5;
450   gMC->Gsposp("CB5_",6,"ALIC", 27.85, -48., -169.5,irotm[82],"ONLY",par,3); 
451
452   //       Bracket #3
453
454   par[0] = 1.5;
455   par[1] = 0.1;
456   par[2] = 17.35;
457   gMC->Matrix(irotm[53], 90., 300., 180.-139.3, 30., 180.-49.3, 30.);
458   gMC->Gsposp("BR2_",7,"ALIC", 23.3, 13.4, -78.7, irotm[53],"ONLY",par,3); 
459   par[1] = 0.5;
460   gMC->Gsposp("CB2_",7,"ALIC", 23.6, 13.56, -78.4,irotm[53],"ONLY",par,3); 
461
462   gMC->Matrix(irotm[83], 90., 300., 90.-10.6, 30., 180.-10.6, 30.);
463   par[1] = 0.1;
464   par[2] = 81.4;
465   gMC->Gsposp("BR5_",7,"ALIC", 47.6, 27.5, -170.,irotm[83],"ONLY",par,3); 
466   par[1] = 0.5;
467   gMC->Gsposp("CB5_",7,"ALIC", 48., 27.85, -169.5,irotm[83],"ONLY",par,3); 
468
469   //       Bracket #4
470
471   par[0] = 1.5;
472   par[1] = 0.1;
473   par[2] = 17.35;
474   gMC->Matrix(irotm[54], 90., 120., 180.-139.3, 210., 180.-49.3, 210.);
475   gMC->Gsposp("BR2_",8,"ALIC", -23.3, -13.4, -78.7, irotm[54],"ONLY",par,3); 
476   par[1] = 0.5;
477   gMC->Gsposp("CB2_",8,"ALIC", -23.6, -13.56, -78.4,irotm[54],"ONLY",par,3); 
478
479   gMC->Matrix(irotm[84], 90., 120., 90.-10.6, 210., 180.-10.6, 210.);
480   par[1] = 0.1;
481   par[2] = 81.4;
482   gMC->Gsposp("BR5_",8,"ALIC", -47.6, -27.5, -170.,irotm[84],"ONLY",par,3); 
483   par[1] = 0.5;
484   gMC->Gsposp("CB5_",8,"ALIC", -48., -27.85, -169.5,irotm[84],"ONLY",par,3); 
485
486   // ******************************************************** 
487   //       DEFINE  DISK#1  OF FMD 
488   // ******************************************************** 
489   
490   gMC->Gsvolu("BR1_", "BOX ", idtmed[4], par, 0);
491   gMC->Gsvolu("CB1_", "BOX ", idtmed[5], par, 0);
492   
493   //       Define parameters for right disk #1
494   
495   rin  = 12.4;
496   rout = 18.4;
497   z    = 59.4;
498
499   //       Ring #1 
500
501   par[0] = rin;
502   par[1] = rout;
503   par[2] = 1.5;
504   gMC->Gsvolu("R1R1", "TUBE", idtmed[1], par, 3);
505   gMC->Gspos("R1R1", 1, "ALIC", 0., 0., z + 1.5, 0, "ONLY");
506
507   //       Ring #2 
508
509   par[0] = rout;
510   par[1] = rout + .65;
511   par[2] = 1.5;
512   gMC->Gsvolu("R2R1", "TUBE", idtmed[2], par, 3);
513   gMC->Gspos("R2R1", 1, "ALIC", 0., 0., z + 1.5, 0, "ONLY");
514
515   //       Ring #3 
516
517   par[0] = rout + .65;
518   par[1] = rout + 5.65;
519   par[2] = .025;
520   gMC->Gsvolu("R3R1", "TUBE", idtmed[3], par, 3);
521   gMC->Gspos("R3R1", 1, "ALIC", 0., 0., z + 1.525, 0, "ONLY");
522
523   //       Bracket #1
524
525   par[0] = 1.5;
526   par[1] = 0.1;
527   par[2] = 17.5;
528   gMC->Matrix(irotm[31], 90., 60., 128., 150., 38., 150.);
529   gMC->Gsposp("BR1_",1,"ALIC", -25.3, 14.6, 76.2, irotm[31],"ONLY",par,3); 
530   par[1] = 0.5;
531   gMC->Gsposp("CB1_",1,"ALIC", -25.35, 14.8, 75.9, irotm[31],"ONLY",par,3); 
532
533   //       Bracket #2
534
535   par[0] = 1.5;
536   par[1] = 0.1;
537   par[2] = 17.5;
538   gMC->Matrix(irotm[32], 90., 240., 128., 330., 38., 330.);
539   gMC->Gsposp("BR1_",2,"ALIC", 25.3, -14.6, 76.2, irotm[32],"ONLY",par,3); 
540   par[1] = 0.5;
541   gMC->Gsposp("CB1_",2,"ALIC", 25.35, -14.8, 75.9,irotm[32],"ONLY",par,3); 
542
543   //       Bracket #3
544
545   par[0] = 1.5;
546   par[1] = 0.1;
547   par[2] = 17.5;
548   gMC->Matrix(irotm[33], 90., 330., 128., 60., 38., 60.);
549   gMC->Gsposp("BR1_",3,"ALIC", 14.6, 25.3, 76.2, irotm[33],"ONLY",par,3); 
550   par[1] = 0.5;
551   gMC->Gsposp("CB1_",3,"ALIC", 14.8, 25.35, 75.9,irotm[33],"ONLY",par,3); 
552
553   //       Bracket #4
554
555   par[0] = 1.5;
556   par[1] = 0.1;
557   par[2] = 17.5;
558   gMC->Matrix(irotm[34], 90., 150., 128., 240., 38., 240.);
559   gMC->Gsposp("BR1_",4,"ALIC", -14.6, -25.3, 76.2,irotm[34],"ONLY",par,3); 
560   par[1] = 0.5;
561   gMC->Gsposp("CB1_",4,"ALIC", -14.8, -25.35, 75.9,irotm[34],"ONLY",par,3); 
562
563   //       Define parameters for left disk #1
564   
565   rin  = 12.4;
566   rout = 18.4;
567   z    = -59.4;
568
569   //       Ring #1 
570
571   par[0] = rin;
572   par[1] = rout;
573   par[2] = 1.5;
574   gMC->Gsvolu("R1L1", "TUBE", idtmed[1], par, 3);
575   gMC->Gspos("R1L1", 1, "ALIC", 0., 0., z - 1.5, 0, "ONLY");
576
577   //       Ring #2 
578
579   par[0] = rout;
580   par[1] = rout + .65;
581   par[2] = 1.5;
582   gMC->Gsvolu("R2L1", "TUBE", idtmed[2], par, 3);
583   gMC->Gspos("R2L1", 1, "ALIC", 0., 0., z - 1.5, 0, "ONLY");
584
585   //       Ring #3 
586
587   par[0] = rout + .65;
588   par[1] = rout + 5.65;
589   par[2] = .025;
590   gMC->Gsvolu("R3L1", "TUBE", idtmed[3], par, 3);
591   gMC->Gspos("R3L1", 1, "ALIC", 0., 0., z - 1.525, 0, "ONLY");
592
593   //       Bracket #1
594
595   par[0] = 1.5;
596   par[1] = 0.1;
597   par[2] = 17.5;
598   gMC->Matrix(irotm[41], 90., 60., 180.-128., 150., 180.-38.0, 150.);
599   gMC->Gsposp("BR1_",5,"ALIC", -25.3, 14.6, -76.2, irotm[41],"ONLY",par,3); 
600   par[1] = 0.5;
601   gMC->Gsposp("CB1_",5,"ALIC", -25.35, 14.8, -75.9,irotm[41],"ONLY",par,3); 
602
603   gMC->Matrix(irotm[1], 90., 60., 90.-10.6, 150., 180.-10.6, 150.);
604   par[1] = 0.1;
605   par[2] = 81.4;
606   gMC->Gsposp("BR5_",9,"ALIC", -47.6, 27.5, -170.,irotm[1],"ONLY",par,3); 
607   par[1] = 0.5;
608   gMC->Gsposp("CB5_",9,"ALIC", -48., 27.85, -169.5,irotm[1],"ONLY",par,3); 
609
610   //       Bracket #2
611
612   par[0] = 1.5;
613   par[1] = 0.1;
614   par[2] = 17.5;
615   gMC->Matrix(irotm[42], 90., 240., 180.-128., 330., 180.-38., 330.);
616   gMC->Gsposp("BR1_",6,"ALIC", 25.3,-14.6, -76.2,irotm[42],"ONLY",par,3); 
617   par[1] = 0.5;
618   gMC->Gsposp("CB1_",6,"ALIC", 25.35,-14.8, -75.9,irotm[42],"ONLY",par,3); 
619
620   gMC->Matrix(irotm[2], 90., 240., 90.-10.6, 330., 180.-10.6, 330.);
621   par[1] = 0.1;
622   par[2] = 81.4;
623   gMC->Gsposp("BR5_",10,"ALIC", 47.6, -27.5, -170.0,irotm[2],"ONLY",par,3); 
624   par[1] = 0.5;
625   gMC->Gsposp("CB5_",10,"ALIC", 48., -27.85, -169.5,irotm[2],"ONLY",par,3); 
626
627   //       Bracket #3
628
629   par[0] = 1.5;
630   par[1] = 0.1;
631   par[2] = 17.5;
632   gMC->Matrix(irotm[43], 90., 330., 180.-128., 60., 180.-38., 60.);
633   gMC->Gsposp("BR1_",7,"ALIC", 14.6, 25.3, -76.2, irotm[43],"ONLY",par,3); 
634   par[1] = 0.5;
635   gMC->Gsposp("CB1_",7,"ALIC", 14.8, 25.35, -75.9,irotm[43],"ONLY",par,3); 
636
637   gMC->Matrix(irotm[3], 90., 330., 90.-10.6, 60., 180.-10.6, 60.);
638   par[1] = 0.1;
639   par[2] = 81.4;
640   gMC->Gsposp("BR5_",11,"ALIC", 27.5, 47.6, -170.,irotm[3],"ONLY",par,3); 
641   par[1] = 0.5;
642   gMC->Gsposp("CB5_",11,"ALIC", 27.85, 48., -169.5,irotm[3],"ONLY",par,3); 
643
644   //       Bracket #4
645
646   par[0] = 1.5;
647   par[1] = 0.1;
648   par[2] = 17.5;
649   gMC->Matrix(irotm[44], 90., 150., 180.-128., 240., 180.-38., 240.);
650   gMC->Gsposp("BR1_",8,"ALIC", -14.6, -25.3, -76.2, irotm[44],"ONLY",par,3); 
651   par[1] = 0.5;
652   gMC->Gsposp("CB1_",8,"ALIC", -14.8, -25.35, -75.9,irotm[44],"ONLY",par,3); 
653
654   gMC->Matrix(irotm[4], 90., 150., 90.-10.6, 240., 180.-10.6, 240.);
655   par[1] = 0.1;
656   par[2] = 81.4;
657   gMC->Gsposp("BR5_",12,"ALIC", -27.5, -47.6, -170.,irotm[4],"ONLY",par,3); 
658   par[1] = 0.5;
659   gMC->Gsposp("CB5_",12,"ALIC", -27.85, -48., -169.5,irotm[4],"ONLY",par,3); 
660
661   // *********************************************************** 
662   //       DEFINE LEFT DISK#4 OF FMD 
663   // *********************************************************** 
664
665   gMC->Gsvolu("BR4_", "BOX ", idtmed[4], par, 0);
666   gMC->Gsvolu("CB4_", "BOX ", idtmed[5], par, 0);
667
668   //       Define parameters 
669
670   rin  = 4.5;
671   rout = 10.5;
672   z    = -229.5;
673
674   //       Ring #1 
675
676   par[0] = rin;
677   par[1] = rout;
678   par[2] = 1.5;
679   gMC->Gsvolu("R1L4", "TUBE", idtmed[1], par, 3);
680   gMC->Gspos("R1L4", 1, "ALIC", 0., 0., z - 1.5, 0, "ONLY");
681
682   //       Ring #2 
683
684   par[0] = rout;
685   par[1] = rout + .65;
686   par[2] = 1.5;
687   gMC->Gsvolu("R2L4", "TUBE", idtmed[2], par, 3);
688   gMC->Gspos("R2L4", 1, "ALIC", 0., 0., z - 1.5, 0, "ONLY");
689
690   //       Ring #3 
691
692   par[0] = rout + .65;
693   par[1] = rout + 5.65;
694   par[2] = .025;
695   gMC->Gsvolu("R3L4", "TUBE", idtmed[3], par, 3);
696   gMC->Gspos("R3L4", 1, "ALIC", 0., 0., z - 1.525, 0, "ONLY");
697
698   //       Bracket #1
699
700   par[0] = 1.5;
701   par[1] = 0.1;
702   par[2] = 31.25;
703   gMC->Matrix(irotm[71], 90., 0., 90.-71., 90., 180.-71., 90.);
704   gMC->Gsposp("BR4_",1,"ALIC", 0., 40.25, -240., irotm[71],"ONLY",par,3); 
705   par[1] = 0.5;
706   gMC->Gsposp("CB4_",1,"ALIC", 0., 40.75, -239.5, irotm[71],"ONLY",par,3); 
707
708   //       Bracket #2
709
710   par[0] = 1.5;
711   par[1] = 0.1;
712   par[2] = 31.25;
713   gMC->Matrix(irotm[72], 90., 180., 90.-71., 270., 180.-71., 270.);
714   gMC->Gsposp("BR4_",2,"ALIC", 0., -40.25, -240., irotm[72],"ONLY",par,3); 
715   par[1] = 0.5;
716   gMC->Gsposp("CB4_",2,"ALIC", 0., -40.75, -239.5,irotm[72],"ONLY",par,3); 
717
718   //       Bracket #3
719
720   par[0] = 1.5;
721   par[1] = 0.1;
722   par[2] = 31.25;
723   gMC->Matrix(irotm[73], 90., 270., 90.-71., 0., 180.-71., 0.);
724   gMC->Gsposp("BR4_",3,"ALIC", 40.25, 0., -240., irotm[73],"ONLY",par,3); 
725   par[1] = 0.5;
726   gMC->Gsposp("CB4_",3,"ALIC", 40.75, 0., -239.5,irotm[73],"ONLY",par,3); 
727
728   //       Bracket #4
729
730   par[0] = 1.5;
731   par[1] = 0.1;
732   par[2] = 31.25;
733   gMC->Matrix(irotm[74], 90., 90., 90.-71., 180., 180.-71., 180.);
734   gMC->Gsposp("BR4_",4,"ALIC", -40.25, 0., -240.,irotm[74],"ONLY",par,3); 
735   par[1] = 0.5;
736   gMC->Gsposp("CB4_",4,"ALIC", -40.75, 0., -239.5,irotm[74],"ONLY",par,3); 
737 }
738
739 //_____________________________________________________________________________
740 void AliFMDv1::DrawModule()
741 {
742   //
743   // Draw a shaded view of the FMD version 1
744   //
745
746   // Set everything unseen
747   gMC->Gsatt("*", "seen", -1);
748   // 
749   // Set ALIC mother transparent
750   gMC->Gsatt("ALIC","SEEN",0);
751   //
752   // Set the volumes visible
753   gMC->Gsatt("R1R3","SEEN",1);
754   gMC->Gsatt("R2R3","SEEN",1);
755   gMC->Gsatt("R3R3","SEEN",1);
756   gMC->Gsatt("R1L3","SEEN",1);
757   gMC->Gsatt("R2L3","SEEN",1);
758   gMC->Gsatt("R3L3","SEEN",1);
759   gMC->Gsatt("R1R2","SEEN",1);
760   gMC->Gsatt("R2R2","SEEN",1);
761   gMC->Gsatt("R3R2","SEEN",1);
762   gMC->Gsatt("R1L2","SEEN",1);
763   gMC->Gsatt("R2L2","SEEN",1);
764   gMC->Gsatt("R3L2","SEEN",1);
765   gMC->Gsatt("R1R1","SEEN",1);
766   gMC->Gsatt("R2R1","SEEN",1);
767   gMC->Gsatt("R3R1","SEEN",1);
768   gMC->Gsatt("R1L1","SEEN",1);
769   gMC->Gsatt("R2L1","SEEN",1);
770   gMC->Gsatt("R3L1","SEEN",1);
771   gMC->Gsatt("R1L4","SEEN",1);
772   gMC->Gsatt("R2L4","SEEN",1);
773   gMC->Gsatt("R3L4","SEEN",1);
774   gMC->Gsatt("BR1_","SEEN",1);
775   gMC->Gsatt("BR2_","SEEN",1);
776   gMC->Gsatt("BR3_","SEEN",1);
777   gMC->Gsatt("BR4_","SEEN",1);
778   gMC->Gsatt("BR5_","SEEN",1);
779   gMC->Gsatt("CB1_","SEEN",1);
780   gMC->Gsatt("CB2_","SEEN",1);
781   gMC->Gsatt("CB3_","SEEN",1);
782   gMC->Gsatt("CB4_","SEEN",1);
783   gMC->Gsatt("CB5_","SEEN",1);
784   gMC->Gsatt("R1SP","SEEN",1);
785   gMC->Gsatt("R2SP","SEEN",1);
786   gMC->Gsatt("R3SP","SEEN",1);
787   //
788   gMC->Gdopt("hide", "on");
789   gMC->Gdopt("shad", "on");
790   gMC->Gsatt("*", "fill", 7);
791   gMC->SetClipBox(".");
792   gMC->SetClipBox("*", 0, 1000, -1000, 1000, -1000, 1000);
793   gMC->DefaultRange();
794   gMC->Gdraw("alic", 40, 30, 0, 6, 9, .08, .08);
795   gMC->Gdhead(1111, "Forward Multiplicity Detector version 1");
796   gMC->Gdman(13, 9, "MAN");
797 }
798
799 //_____________________________________________________________________________
800 void AliFMDv1::CreateMaterials()
801 {
802   //
803   // Create Materials for version 1 of FMD
804   //
805
806   //     Material for ring #1 
807   Float_t ar1[8] = { 55.8,58.7,52.,47.9,16.,28.,207.2,27. };
808   Float_t zr1[8] = { 26.,28.,24.,22.,8.,14.,82.,13. };
809   Float_t wr1[8] = { .27,.081,.054,.045,.18,.25,.06,.06 };
810   //     Material for ring #2 
811   Float_t ar2[3] = { 55.8,27.,16. };
812   Float_t zr2[3] = { 26.,13.,8. };
813   Float_t wr2[3] = { .35,.34,.31 };
814   //     Material for ring #3 
815   Float_t ar3[3] = { 28.,27.,16. };
816   Float_t zr3[3] = { 14.,13.,8. };
817   Float_t wr3[3] = { .37,.33,.3 };
818   //     Material for brackets 
819   Float_t abr[2] = { 1.,12. };
820   Float_t zbr[2] = { 1.,6. };
821   Float_t wbr[2] = { .1,.9 };
822   //     Material for cables 
823   Float_t acb[4] = { 1.,12.,37.,63.54 };
824   Float_t zcb[4] = { 1.,6.,17.,2.9 };
825   Float_t wcb[4] = { .02,.14,.12,.72 };
826   
827   Float_t epsil, stmin, deemax, tmaxfd, stemax;
828   
829   Int_t   isxfld = gAlice->Field()->Integ();
830   Float_t sxmgmx = gAlice->Field()->Max();
831   
832   //     Ring #1 
833   
834   AliMixture(1, "FMD_R1$", ar1, zr1, 2.69, 8, wr1);
835   
836   //     Ring #2 
837   
838   AliMixture(2, "FMD_R2$", ar2, zr2, 2.63, 3, wr2);
839   
840   //     Ring #3 
841   
842   AliMixture(3, "FMD_R3$", ar3, zr3, 3.15, 3, wr3);
843
844   //     Brackets 
845   
846   AliMixture(4, "FMD_BR$", abr, zbr, 1.8, 2, wbr);
847
848   //     Cables
849   
850   AliMixture(5, "FMD_CB$", acb, zcb, 3.11, 4, wcb);
851
852   // ******************************************************* 
853   //     Defines tracking media parameters. 
854   // ******************************************************* 
855   epsil  = .001; // Tracking precision, DLS 
856   stemax = -1.;  // Maximum displacement for multiple scattering 
857   tmaxfd = -20.; // Maximum angle due to field deflection 
858   deemax = -.3;  // Maximum fractional energy loss, DLS 
859   stmin  = -.8;
860   // ******************************************************** 
861   AliMedium(1, "FMD_R1_L3        ", 1, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
862   AliMedium(2, "FMD_R2_L3        ", 2, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
863   AliMedium(3, "FMD_R3_L3        ", 3, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
864   AliMedium(4, "FMD_BR_L3        ", 4, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
865   AliMedium(5, "FMD_CB_L3        ", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
866 }
867
868
869