]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STRUCT/AliHALL.cxx
New class to make V2 clusters starting from digits or hits (fast simulation). Origin...
[u/mrichter/AliRoot.git] / STRUCT / AliHALL.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.17  2002/10/14 14:57:39  hristov
19 Merging the VirtualMC branch to the main development branch (HEAD)
20
21 Revision 1.14.6.2  2002/06/14 10:29:54  hristov
22 Merged with v3-08-03
23
24 Revision 1.16  2002/06/12 08:28:28  morsch
25 HBMT positioning commented out.
26
27 Revision 1.15  2002/05/28 08:47:38  morsch
28 Reduces size of pillars to avoid overlap with DIPO.
29
30 Revision 1.14  2001/11/16 12:38:26  morsch
31 Reverse z-ordering in HMBS. (I. Hrivnacova)
32
33 Revision 1.13  2001/06/21 12:26:52  morsch
34 Simple concrete shielding around compensator dipole.
35
36 Revision 1.12  2001/06/20 16:08:56  morsch
37 Remove some shielding to accomodate compensator magnet.
38
39 Revision 1.11  2001/05/16 14:57:22  alibrary
40 New files for folders and Stack
41
42 Revision 1.10  2000/10/02 21:28:15  fca
43 Removal of useless dependecies via forward declarations
44
45 Revision 1.9  2000/06/13 14:55:26  morsch
46 Unused variables removed
47
48 Revision 1.8  2000/06/11 12:35:41  morsch
49 Coding rule violations corrected
50
51 Revision 1.7  2000/01/12 15:33:28  morsch
52 Muon filter removed
53
54 Revision 1.6  1999/09/29 09:24:30  fca
55 Introduction of the Copyright and cvs Log
56
57 */
58
59 ///////////////////////////////////////////////////////////////////////////////
60 //                                                                           //
61 //  Experimental Hall                                                        //
62 //  This class contains the description of the experimental hall             //
63 //                                                                           //
64 //Begin_Html
65 /*
66 <img src="picts/AliHALLClass.gif">
67 </pre>
68 <br clear=left>
69 <font size=+2 color=red>
70 <p>The responsible person for this module is
71 <a href="mailto:andreas.morsch@cern.ch">Andreas Morsch</a>.
72 </font>
73 <pre>
74 */
75 //End_Html
76 //                                                                           //
77 //                                                                           //
78 ///////////////////////////////////////////////////////////////////////////////
79
80 #include "AliHALL.h"
81 #include "AliRun.h"
82 #include "AliMagF.h"
83 #include "AliConst.h"
84  
85 ClassImp(AliHALL)
86  
87 //_____________________________________________________________________________
88 AliHALL::AliHALL()
89 {
90   //
91   // Default constructor for the experimental Hall
92   //
93 }
94  
95 //_____________________________________________________________________________
96 AliHALL::AliHALL(const char *name, const char *title)
97        : AliModule(name,title)
98 {
99   //
100   // Standard constructor for the experimental Hall
101   //
102   SetMarkerColor(7);
103   SetMarkerStyle(2);
104   SetMarkerSize(0.4);
105 }
106  
107 //_____________________________________________________________________________
108 void AliHALL::CreateGeometry()
109 {
110   //
111   // Create the geometry of the exprimental hall
112   //
113   //Begin_Html
114   /*
115     <img src="picts/AliHALLTree.gif">
116   */
117   //End_Html
118   //
119   // If ZDC is not present the experimental hall includes a short
120   // section of the accelerator tunnel
121   //
122   //Begin_Html
123   /*
124     <img src="picts/AliHALLSmall.gif">
125   */
126   //End_Html
127   //
128   // If ZDC is present the experimental hall includes the accelerator
129   // tunnel beyond the ZDC
130   //
131   //Begin_Html
132   /*
133     <img src="picts/AliHALLLarge.gif">
134   */
135   //End_Html
136
137   
138   Float_t r2;
139   Float_t phid, phim, tpar[3], pbox[3], h, r, tspar[5];
140   Float_t w1, dh, am, bm, dl,cm, hm, dr, dx, xl;
141   Int_t idrotm[1999];
142   Float_t trdpar[4], trapar[11], hullen;
143   Float_t phi;
144   
145   Int_t *idtmed = fIdtmed->GetArray()-1899;
146   
147   //     RB24/26 TUNNEL FLOOR 
148   
149   r   = 220.;
150   h   = 140.;
151   phi = TMath::ACos(h / r);
152   xl  = r * TMath::Sin(phi);
153   dr  = 100.;
154   dh  = dr * TMath::Cos(phi);
155   dl  = dr * TMath::Sin(phi);
156   if (gAlice->GetModule("ZDC") == 0) {
157     
158     //     No ZDC 
159     hullen = 250.;
160   } else {
161     
162     //     ZDC is present 
163     hullen = 6400.;
164   }
165   trdpar[0] = xl + dl;
166   trdpar[1] = xl;
167   trdpar[2] = hullen;
168   trdpar[3] = dh / 2.;
169   AliMatrix(idrotm[1900], 90., 0., 0., 0., 90., 90.);
170   AliMatrix(idrotm[1901], 270., 0., 90., 90., 0., 0.);
171   gMC->Gsvolu("HUFL", "TRD1", idtmed[1956], trdpar, 4);
172   r2 = hullen + 2020.;
173   gMC->Gspos("HUFL", 1, "ALIC", 70.,-100-trdpar[3] , r2, idrotm[1900], "ONLY");
174   
175   //     RB24/26 wall 
176   
177   phid     = phi * 57.296;
178   tspar[0] = r;
179   tspar[1] = r + dr;
180   tspar[2] = hullen;
181   tspar[3] = phid - 90.;
182   tspar[4] = 270. - phid;
183   gMC->Gsvolu("HUWA", "TUBS", idtmed[1956], tspar, 5);
184   gMC->Gspos("HUWA", 1, "ALIC", 70., 40.,2020+hullen , 0, "ONLY");
185   
186   //     tunnelplug 
187   
188   tpar[0] = 0.;
189   tpar[1] = 50.;
190   tpar[2] = 60.;
191   gMC->Gsvolu("HUP2", "TUBE", idtmed[1954], tpar, 3);
192   
193   //     END WALL 
194   
195   pbox[0] = 1200.;
196   pbox[1] = 1300.;
197   pbox[2] = 60.;
198   gMC->Gsvolu("HEW1", "BOX ", idtmed[1956], pbox, 3);
199   gMC->Gspos("HUP2", 1, "HEW1", 0.,-404., 0.,   0, "ONLY");
200   gMC->Gspos("HEW1", 1, "ALIC", 0., 404., 1960, 0, "ONLY");
201   
202   //     hall floor 
203   
204   phid      = 16.197;
205   trdpar[0] = 700.;
206   trdpar[1] = TMath::Tan(phid * kDegrad) * 190. + 700.;
207   trdpar[2] = 550.;
208   trdpar[3] = 95.;
209   gMC->Gsvolu("HHF1", "TRD1", idtmed[1956], trdpar, 4);
210   gMC->Gspos("HHF1", 1, "ALIC", 0., -801., 1350., idrotm[1900], "ONLY");
211   gMC->Gspos("HHF1", 2, "ALIC", 0., -801.,-1350., idrotm[1900], "ONLY");
212   
213   //     hall side walls 
214   
215   trapar[0] = 550.;
216   trapar[1] = 0.;
217   trapar[2] = 0.;
218   trapar[3] = 1273.78/2;
219   trapar[4] = 235.;
220   trapar[5] = 50.;
221   trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
222   trapar[7] = trapar[3];
223   trapar[8] = trapar[4];
224   trapar[9] = trapar[5];
225   trapar[10] = trapar[6];
226   dx = trapar[4] * 1.5 + 700. - trapar[5] * .5;
227   gMC->Gsvolu("HHW1", "TRAP", idtmed[1956], trapar, 11);
228   gMC->Gspos("HHW1", 1, "ALIC", dx, -896+trapar[3],  1350., 0, "ONLY");
229   gMC->Gspos("HHW1", 2, "ALIC",-dx, -896+trapar[3],  1350., idrotm[1901], "ONLY");
230   gMC->Gspos("HHW1", 3, "ALIC", dx, -896+trapar[3], -1350., 0, "ONLY");
231   gMC->Gspos("HHW1", 4, "ALIC",-dx, -896+trapar[3], -1350., idrotm[1901], "ONLY");
232   pbox[0] = 50.;
233   pbox[1] = (500. - (trapar[3] * 2. - 896.)) / 2.;
234   pbox[2] = 1900.;
235   gMC->Gsvolu("HBW1", "BOX ", idtmed[1956], pbox, 3);
236   gMC->Gspos("HBW1", 1, "ALIC",  1120., 500-pbox[1], 0., 0, "ONLY");
237   gMC->Gspos("HBW1", 2, "ALIC", -1120., 500-pbox[1], 0., 0, "ONLY");
238   
239   //     slanted wall close to L3 magnet 
240   
241   phim = 45.;
242   hm   = 790.;
243   //rm   = hm / TMath::Cos(phim / 2. * kDegrad);
244   am   = hm * TMath::Tan(phim / 2. * kDegrad);
245   bm   = (hm + 76.) / hm * am;
246   cm   = bm * 2. / TMath::Sqrt(2.);
247   trapar[0] = 800.;
248   trapar[1] = 0.;
249   trapar[2] = 0.;
250   trapar[3] = (1273.78 - cm) / 2.;
251   trapar[4] = 235. - cm * TMath::Tan(phid * kDegrad) / 2.;
252   trapar[5] = 50.;
253   trapar[6] = TMath::ATan((trapar[4] - trapar[5]) / 2. / trapar[3]) * kRaddeg;
254   trapar[7] = trapar[3];
255   trapar[8] = trapar[4];
256   trapar[9] = trapar[5];
257   trapar[10] = trapar[6];
258   w1 = trapar[4];
259   dx = cm*TMath::Tan(phid * kDegrad) + 700. + trapar[4] * 1.5 - trapar[5] * .5;
260   gMC->Gsvolu("HHW2", "TRAP", idtmed[1956], trapar, 11);
261   r2 = cm - 896. + trapar[3];
262   gMC->Gspos("HHW2", 1, "ALIC", dx, r2, 0., 0, "ONLY");
263   gMC->Gspos("HHW2", 2, "ALIC",-dx, r2, 0., idrotm[1901], "ONLY");
264   trapar[3]  = cm / 2.;
265   trapar[4]  = w1 + cm / 2.;
266   trapar[5]  = w1;
267   trapar[6]  = TMath::ATan(.5) * kRaddeg;
268   trapar[7]  = trapar[3];
269   trapar[8]  = trapar[4];
270   trapar[9]  = trapar[5];
271   trapar[10] = trapar[6];
272   dx = 1170. - trapar[4] * .5 - trapar[5] * .5;
273   gMC->Gsvolu("HHW3", "TRAP", idtmed[1956], trapar, 11);
274   r2 = trapar[3] - 896.;
275   gMC->Gspos("HHW3", 1, "ALIC", dx, r2, 0., 0, "ONLY");
276   gMC->Gspos("HHW3", 2, "ALIC",-dx, r2, 0., idrotm[1901], "ONLY");
277   
278
279   tspar[0] = 1070.;
280   tspar[1] = 1170.;
281   tspar[2] = 1900.;
282   tspar[3] = 0.;
283   tspar[4] = 180.;
284   gMC->Gsvolu("HHC1", "TUBS", idtmed[1956], tspar, 5);
285   gMC->Gspos("HHC1", 1, "ALIC", 0., 500., 0., 0, "ONLY");
286   trdpar[0] = 1170 - trapar[4] * 2.;
287   trdpar[1] = trdpar[0] + TMath::Tan(phim * kDegrad) * 76.;
288   trdpar[2] = 800.;
289   trdpar[3] = 38.;
290   gMC->Gsvolu("HHF2", "TRD1", idtmed[1956], trdpar, 4);
291   gMC->Gspos("HHF2", 1, "ALIC", 0., -858., 0., idrotm[1900], "ONLY");
292   
293   //     pillars for working platform 
294   
295   pbox[0] = 40.;
296   pbox[1] = 97.;
297   pbox[2] = 550.;
298   gMC->Gsvolu("HPIL", "BOX ", idtmed[1956], pbox, 3);
299   gMC->Gspos("HPIL", 1, "ALIC", 165.,-706+pbox[1] , 1350., 0, "ONLY");
300   gMC->Gspos("HPIL", 2, "ALIC",-165.,-706+pbox[1] , 1350., 0, "ONLY");
301   
302   //     simple concrete beam shield 
303   
304   Float_t ppgon[10];
305   ppgon[0] =    45.;
306   ppgon[1] =   360.;
307   ppgon[2] =     4.;
308   ppgon[3] =     2.;
309   ppgon[4] = -1800.;
310   ppgon[5] =   150.;
311   ppgon[6] =   250.;
312   ppgon[7] =  -720.;
313   ppgon[8] =   150.;
314   ppgon[9] =   250.;
315
316   gMC->Gsvolu("HMBS", "PGON", idtmed[1956], ppgon, 10);
317   gMC->Gspos("HMBS", 1, "ALIC", 0., 70., 0., 0, "ONLY");
318 /*
319   ppgon[4] = -1800.;
320   ppgon[5] =     0.;
321   ppgon[6] =   150.;
322   ppgon[7] = -1300.;
323   ppgon[8] =     0.;
324   ppgon[9] =   150.;
325   gMC->Gsvolu("HMBT", "PGON", idtmed[1956], ppgon, 10);
326
327   ppgon[4] = -1800.;
328   ppgon[5] =     0.;
329   ppgon[6] =    10.;
330   ppgon[7] = -1300.;
331   ppgon[8] =     0.;
332   ppgon[9] =    10.;
333   gMC->Gsvolu("HMBU", "PGON", idtmed[1954], ppgon, 10);
334
335   gMC->Gspos("HMBU", 1, "HMBT", 0., -70., 0., 0, "ONLY");
336
337   gMC->Gspos("HMBT", 1, "ALIC", 0.,  70., 0., 0, "ONLY");
338 */  
339 }
340
341 //_____________________________________________________________________________
342 void AliHALL::CreateMaterials()
343 {
344   //
345   // Create materials for the experimental hall
346   //
347   
348
349   Int_t   isxfld = gAlice->Field()->Integ();
350   Float_t sxmgmx = gAlice->Field()->Max();
351   
352   Float_t aconc[10] = { 1.,12.01,15.994,22.99,24.305,26.98,28.086,39.1,40.08,55.85 };
353   Float_t zconc[10] = { 1.,6.,8.,11.,12.,13.,14.,19.,20.,26. };
354   Float_t wconc[10] = { .01,.001,.529107,.016,.002,.033872,.337021,.013,.044,.014 };
355   
356   Float_t epsil, stmin, deemax, tmaxfd, stemax;
357
358   //     FOR CONCRETE 
359   
360   AliMaterial(10, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
361   AliMaterial(30, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
362   AliMaterial(50, "IRON$     ", 55.85, 26., 7.87, 1.76, 17.1);
363   AliMaterial(15, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
364   AliMaterial(35, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
365   AliMaterial(55, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
366   AliMixture(17, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
367   AliMixture(37, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
368   AliMixture(57, "CONCRETE$", aconc, zconc, 2.35, 10, wconc);
369   
370   // **************** 
371   //     Defines tracking media parameters. 
372   //     Les valeurs sont commentees pour laisser le defaut 
373   //     a GEANT (version 3-21, page CONS200), f.m. 
374   epsil  = .001;  // Tracking precision, 
375   stemax = -1.;   // Maximum displacement for multiple scat 
376   tmaxfd = -20.;  // Maximum angle due to field deflection 
377   deemax = -.3;   // Maximum fractional energy loss, DLS 
378   stmin  = -.8;
379   // *************** 
380   
381   //     IRON 
382   
383   AliMedium(10, "FE_C0             ", 10, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
384   AliMedium(30, "FE_C1             ", 30, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
385   AliMedium(50, "FE_C2             ", 50, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
386   
387   //    Air 
388   
389   AliMedium(15, "AIR_C0           ", 15, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
390   AliMedium(35, "AIR_C1           ", 35, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
391   AliMedium(55, "AIR_C2           ", 55, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
392   
393   //    Concrete 
394   
395   AliMedium(17, "CC_C0            ", 17, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
396   AliMedium(37, "CC_C1            ", 37, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
397   AliMedium(57, "CC_C2            ", 57, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
398 }
399
400 //_____________________________________________________________________________
401 void AliHALL::Init()
402 {
403   //
404   // Initialise the HALL after it has been built
405   //
406   Int_t i;
407   //
408   if(fDebug) {
409     printf("\n%s: ",ClassName());
410     for(i=0;i<35;i++) printf("*");
411     printf(" HALL_INIT ");
412     for(i=0;i<35;i++) printf("*");
413     printf("\n%s: ",ClassName());
414     //
415     // Here the HALL initialisation code (if any!)
416     for(i=0;i<80;i++) printf("*");
417     printf("\n");
418   }
419 }
420
421 //_____________________________________________________________________________
422 void AliHALL::DrawModule()
423 {
424   //
425   // Draw a shaded view of Experimental Hall
426   //
427
428   // Set everything unseen
429   gMC->Gsatt("*", "seen", -1);
430   // 
431   // Set ALIC mother transparent
432   gMC->Gsatt("ALIC","SEEN",0);
433   //
434   // Set the volumes visible
435   gMC->Gsatt("HUFL","seen",1);
436   gMC->Gsatt("HUWA","seen",1);
437   gMC->Gsatt("HUP2","seen",1);
438   gMC->Gsatt("HEW1","seen",1);
439   gMC->Gsatt("HHF1","seen",1);
440   gMC->Gsatt("HHW1","seen",1);
441   gMC->Gsatt("HBW1","seen",1);
442   gMC->Gsatt("HHW2","seen",1);
443   gMC->Gsatt("HHW3","seen",1);
444   gMC->Gsatt("HHC1","seen",1);
445   gMC->Gsatt("HHF2","seen",1);
446   gMC->Gsatt("HPIL","seen",1);
447   gMC->Gsatt("HMBS","seen",1);
448   gMC->Gsatt("HBBS","seen",1);
449   gMC->Gsatt("HPBS","seen",1);
450   gMC->Gsatt("HXFI","seen",1);
451   gMC->Gsatt("HXII","seen",1);
452   //
453   gMC->Gdopt("hide", "on");
454   gMC->Gdopt("shad", "on");
455   gMC->Gsatt("*", "fill", 7);
456   gMC->SetClipBox(".");
457   if (gAlice->GetModule("ZDC") == 0) {
458     //
459     // ZDC is not present
460     //
461     gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
462     gMC->DefaultRange();
463     gMC->Gdraw("alic", 40, 30, 0, 12, 7.5, .005, .005);
464   } else {
465     //
466     // ZDC is present
467     //
468     gMC->SetClipBox("*", 0, 2000, -2000, 2000, -2000, 16000);
469     gMC->DefaultRange();
470     gMC->Gdraw("alic", 40, 30, 0, 17.5, 10, .0019, .0019);
471   }
472   gMC->Gdhead(1111, "Experimental Hall");
473   gMC->Gdman(18, 2, "MAN");
474 }
475