]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PMD/AliPMDv2008.cxx
Protection against missing DPs. Recently we got some runs where the RDB manager got...
[u/mrichter/AliRoot.git] / PMD / AliPMDv2008.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 /* $Id: AliPMDv1.cxx 18594 2007-05-15 13:28:06Z hristov $ */
16
17 //
18 ///////////////////////////////////////////////////////////////////////////////
19 //                                                                           //
20 //  Photon Multiplicity Detector Version 1                                   //
21 //  Bedanga Mohanty : February 14th 2006
22 //                                                                           //
23 //Begin_Html
24 /*
25 <img src="picts/AliPMDv1Class.gif">
26 */
27 //End_Html
28 //                                                                           //
29 ///////////////////////////////////////////////////////////////////////////////
30 ////
31
32 #include <Riostream.h>
33 #include <TGeoManager.h>
34 #include <TGeoGlobalMagField.h>
35 #include <TVirtualMC.h>
36
37 #include "AliConst.h" 
38 #include "AliLog.h"
39 #include "AliMC.h"
40 #include "AliMagF.h" 
41 #include "AliPMDv2008.h"
42 #include "AliRun.h"
43
44 const Int_t   AliPMDv2008::fgkNcolUM1    = 48;  // Number of cols in UM, type 1
45 const Int_t   AliPMDv2008::fgkNcolUM2    = 96;  // Number of cols in UM, type 2
46 const Int_t   AliPMDv2008::fgkNrowUM1    = 96;  // Number of rows in UM, type 1
47 const Int_t   AliPMDv2008::fgkNrowUM2    = 48;  // Number of rows in UM, type 2
48 const Float_t AliPMDv2008::fgkCellRadius = 0.25;     // Radius of a hexagonal cell
49 const Float_t AliPMDv2008::fgkCellWall   = 0.02;     // Thickness of cell Wall
50 const Float_t AliPMDv2008::fgkCellDepth  = 0.50;     // Gas thickness
51 const Float_t AliPMDv2008::fgkThBase     = 0.2;      // Thickness of Base plate
52 const Float_t AliPMDv2008::fgkThBKP      = 0.1;      // Thickness of Back plane
53 const Float_t AliPMDv2008::fgkThAir      = 1.03;      // Thickness of Air
54 const Float_t AliPMDv2008::fgkThPCB      = 0.16;     // Thickness of PCB
55 const Float_t AliPMDv2008::fgkThLead     = 1.5;      // Thickness of Pb
56 const Float_t AliPMDv2008::fgkThSteel    = 0.5;      // Thickness of Steel
57 const Float_t AliPMDv2008::fgkGap        = 0.025;    // Air Gap
58 const Float_t AliPMDv2008::fgkZdist      = 361.5;    // z-position of the detector
59 const Float_t AliPMDv2008::fgkSqroot3    = 1.7320508;// Square Root of 3
60 const Float_t AliPMDv2008::fgkSqroot3by2 = 0.8660254;// Square Root of 3 by 2
61 const Float_t AliPMDv2008::fgkSSBoundary = 0.3;
62 const Float_t AliPMDv2008::fgkThSS       = 1.03;
63 const Float_t AliPMDv2008::fgkThG10      = 1.03;
64 ClassImp(AliPMDv2008)
65  
66 //_____________________________________________________________________________
67 AliPMDv2008::AliPMDv2008():
68   fSMthick(0.),
69   fDthick(0.),
70   fSMLengthax(0.),
71   fSMLengthay(0.),
72   fSMLengthbx(0.),
73   fSMLengthby(0.),
74   fMedSens(0)
75 {
76   //
77   // Default constructor 
78   //
79   for (Int_t i = 0; i < 3; i++)
80     {
81       fDboxmm1[i]  = 0.;
82       fDboxmm12[i] = 0.;
83       fDboxmm2[i]  = 0.;
84       fDboxmm22[i] = 0.;
85     }
86 }
87  
88 //_____________________________________________________________________________
89 AliPMDv2008::AliPMDv2008(const char *name, const char *title):
90   AliPMD(name,title),
91   fSMthick(0.),
92   fDthick(0.),
93   fSMLengthax(0.),
94   fSMLengthay(0.),
95   fSMLengthbx(0.),
96   fSMLengthby(0.),
97   fMedSens(0)
98 {
99   //
100   // Standard constructor
101   //
102   for (Int_t i = 0; i < 3; i++)
103     {
104       fDboxmm1[i]  = 0.;
105       fDboxmm12[i] = 0.;
106       fDboxmm2[i]  = 0.;
107       fDboxmm22[i] = 0.;
108     }
109 }
110
111 //_____________________________________________________________________________
112 void AliPMDv2008::CreateGeometry()
113 {
114   // Create geometry for Photon Multiplicity Detector
115
116   GetParameters();
117   CreateSupermodule();
118   CreatePMD();
119 }
120
121 //_____________________________________________________________________________
122 void AliPMDv2008::CreateSupermodule()
123 {
124   // 
125   // Creates the geometry of the cells of PMD, places them in  supermodule 
126   // which is a rectangular object.
127   // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is 
128   // placed inside another hexagonal cell made of Cu (ECCU) with larger 
129   // radius, compared to ECAR. The difference in radius gives the dimension 
130   // of half width of each cell wall.
131   // These cells are placed in a rectangular strip which are of 2 types 
132   // EST1 and EST2 
133   // 2 types of unit modules are made EUM1 and EUM2 which contains these strips
134   // placed repeatedly 
135   // Each supermodule (ESMA, ESMB), made of G10 is filled with following 
136   //components. They have 6 unit moudles inside them
137   // ESMA, ESMB are placed in EPMD along with EMPB (Pb converter) 
138   // and EMFE (iron support) 
139
140   
141   Int_t i,j;
142   Int_t number;
143   Int_t ihrotm,irotdm;
144   Float_t xb, yb, zb;
145
146   Int_t *idtmed = fIdtmed->GetArray()-599;
147  
148   AliMatrix(ihrotm, 90., 30.,   90.,  120., 0., 0.);
149   AliMatrix(irotdm, 90., 180.,  90.,  270., 180., 0.);
150  
151   // STEP - I
152   //******************************************************//
153   // First create the sensitive medium of a hexagon cell (ECAR)
154   // Inner hexagon filled with gas (Ar+CO2)
155   
156   Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
157   hexd2[4] = -fgkCellDepth/2.;
158   hexd2[7] =  fgkCellDepth/2.;
159   hexd2[6] =  fgkCellRadius - fgkCellWall;
160   hexd2[9] =  fgkCellRadius - fgkCellWall;
161   
162   gMC->Gsvolu("ECAR", "PGON", idtmed[604], hexd2,10);
163   //******************************************************//
164
165   // STEP - II
166   //******************************************************//
167   // Place the sensitive medium inside a hexagon copper cell (ECCU)
168   // Outer hexagon made of Copper
169   
170   Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
171   hexd1[4] = -fgkCellDepth/2.;
172   hexd1[7] =  fgkCellDepth/2.;
173   hexd1[6] =  fgkCellRadius;
174   hexd1[9] =  fgkCellRadius;
175
176   gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
177
178   // Place  inner hex (sensitive volume) inside outer hex (copper)
179   
180   gMC->Gspos("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY");
181   //******************************************************//
182
183   // STEP - III
184   //******************************************************//
185   // Now create Rectangular TWO strips (EST1, EST2) 
186   // of 1 column and 48 or 96 cells length
187
188   // volume for first strip EST1 made of AIR 
189
190   Float_t dbox1[3];
191   dbox1[0] = fgkCellRadius/fgkSqroot3by2;
192   dbox1[1] = fgkNrowUM1*fgkCellRadius;
193   dbox1[2] = fgkCellDepth/2.;
194   
195   gMC->Gsvolu("EST1","BOX", idtmed[698], dbox1, 3);
196
197   // volume for second strip EST2 
198
199
200   Float_t dbox2[3];
201   dbox2[1] = fgkNrowUM2*fgkCellRadius;
202   dbox2[0] = dbox1[0];
203   dbox2[2] = dbox1[2];
204
205   gMC->Gsvolu("EST2","BOX", idtmed[698], dbox2, 3);
206
207   // Place hexagonal cells ECCU placed inside EST1 
208   xb = 0.; 
209   zb = 0.;
210   yb = (dbox1[1]) - fgkCellRadius; 
211   for (i = 1; i <= fgkNrowUM1; ++i) 
212     {
213       number = i;
214       gMC->Gspos("ECCU", number, "EST1", xb,yb,zb, 0, "ONLY");
215       yb -= (fgkCellRadius*2.);
216     }
217
218   // Place hexagonal cells ECCU placed inside EST2 
219   xb = 0.; 
220   zb = 0.;
221   yb = (dbox2[1]) - fgkCellRadius; 
222   for (i = 1; i <= fgkNrowUM2; ++i) 
223     {
224       number = i;
225       gMC->Gspos("ECCU", number, "EST2", xb,yb,zb, 0, "ONLY");
226       //PH      cout << "ECCU in EST2 ==> " << number << "\t"<<xb <<  "\t"<<yb <<endl;
227       yb -= (fgkCellRadius*2.);
228     }
229
230
231   //******************************************************//
232  
233
234   // STEP - IV
235   //******************************************************//
236  // 2 types of rectangular shaped unit modules EUM1 and EUM2 (defined by BOX) 
237   //---------------------------------EHC1 Start----------------------//
238   // Create EHC1 : The honey combs for a unit module type 1
239   // First step is to create a honey comb unit module.
240   // This is named as EHC1, we will lay the EST1 strips of
241   // honey comb cells inside it.
242   
243   //Dimensions of EHC1
244   //X-dimension = Number of columns + cell radius
245   //Y-dimension = Number of rows * cell radius/sqrt3by2 - (some factor)
246   //Z-dimension = cell depth/2
247
248   Float_t dbox3[3];
249   dbox3[0] = (dbox1[0]*fgkNcolUM1)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.);   
250   dbox3[1] = dbox1[1]+fgkCellRadius/2.;
251   dbox3[2] = fgkCellDepth/2.;
252
253   //Create a BOX, Material AIR
254   gMC->Gsvolu("EHC1","BOX", idtmed[698], dbox3, 3);
255   // Place rectangular strips EST1 inside EHC1 unit module
256   xb = dbox3[0]-dbox1[0];  
257   
258   for (j = 1; j <= fgkNcolUM1; ++j)  
259     {
260       if(j%2 == 0)
261         {
262           yb = -fgkCellRadius/2.0;
263         }
264       else
265         {
266           yb = fgkCellRadius/2.0;
267         }
268       number = j;
269       gMC->Gspos("EST1",number, "EHC1", xb, yb , 0. , 0, "MANY");
270       //The strips are being placed from top towards bottom of the module
271       //This is because the first cell in a module in hardware is the top
272       //left corner cell
273       xb = (dbox3[0]-dbox1[0])-j*fgkCellRadius*fgkSqroot3;
274
275     }
276   //--------------------EHC1 done----------------------------------//
277
278
279   //---------------------------------EHC2 Start----------------------//
280   // Create EHC2 : The honey combs for a unit module type 2
281   // First step is to create a honey comb unit module.
282   // This is named as EHC2, we will lay the EST2 strips of
283   // honey comb cells inside it.
284
285   //Dimensions of EHC2
286   //X-dimension = Number of columns + cell radius
287   //Y-dimension = Number of rows * cell radius/sqrt3by2 - (some factor)
288   //Z-dimension = cell depth/2
289
290   dbox3[0] = (dbox1[0]*fgkNcolUM1)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.);   
291   dbox3[1] = dbox1[1]+fgkCellRadius/2.;
292   dbox3[2] = fgkCellDepth/2.;
293
294   Float_t dbox4[3];
295
296   dbox4[0] =(dbox2[0]*fgkNcolUM2)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.); 
297   dbox4[1] = dbox2[1] + fgkCellRadius/2.;
298   dbox4[2] = dbox3[2];
299   
300   //Create a BOX of AIR
301   gMC->Gsvolu("EHC2","BOX", idtmed[698], dbox4, 3);
302
303   // Place rectangular strips EST2 inside EHC2 unit module
304   xb = dbox4[0]-dbox2[0]; 
305   for (j = 1; j <= fgkNcolUM2; ++j) 
306   {
307     if(j%2 == 0)
308   {
309     yb = -fgkCellRadius/2.0;
310   }
311     else
312   {
313     yb = +fgkCellRadius/2.0;
314   }
315     number = j;
316     gMC->Gspos("EST2",number, "EHC2", xb, yb , 0. ,0, "MANY");
317     xb = (dbox4[0]-dbox2[0])-j*fgkCellRadius*fgkSqroot3;
318   }
319   
320
321   //--------------------EHC2 done----------------------------------//
322
323
324   // Now the job is to assmeble an Unit module
325   // It will have the following components
326   // (a) Base plate of G10 of 0.2 cm 
327   // (b) Air gap  of 0.05 cm 
328   // (c) Bottom PCB of 0.16 cm G10
329   // (d) Honey comb 0f 0.5 cm
330   // (e) Top PCB  of 0.16 cm G10
331   // (f) Air gap of 0.16 cm
332   // (g) Back Plane of 0.1 cm G10
333   // (h) Then all around then we have an air gap of 0.5mm
334   // (i) Then all around 0.5mm thick G10 insulation
335   // (h) Then all around Stainless Steel boundary channel 0.3 cm thick
336   //Let us first create them one by one
337   //---------------------------------------------------//
338
339   // ---------------- Lets do it first for UM Type A -----//
340
341  //--------------------------------------------------//
342   //Bottom and Top PCB : EPCA
343   //===========================
344   // Make a 1.6mm thick G10 Bottom and Top PCB for Unit module A
345   // X-dimension same as EHC1 - dbox3[0]
346   // Y-dimension same as EHC1 - dbox3[1]
347   // Z-dimension 0.16/2 = 0.08 cm
348   //-------------------------------------------------//
349   Float_t dboxPcbA[3];
350   dboxPcbA[0]      = dbox3[0]; 
351   dboxPcbA[1]      = dbox3[1];       
352   dboxPcbA[2]      = fgkThPCB/2.;
353   
354   //Top and Bottom PCB is a BOX of Material G10
355   gMC->Gsvolu("EPCA","BOX", idtmed[607], dboxPcbA, 3);
356   //--------------------------------------------------------//  
357   //Back Plane : EBKA
358   //==================
359   // Make a 1.0mm thick Back Plane PCB for Unit module A
360   // X-dimension same as EHC1 - dbox3[0]
361   // Y-dimension same as EHC1 - dbox3[1]
362   // Z-dimension 0.1/2 = 0.05 cm
363   //------------------------------------------------------//
364   Float_t dboxBPlaneA[3];
365   dboxBPlaneA[0]   = dbox3[0]; 
366   dboxBPlaneA[1]   = dbox3[1];       
367   dboxBPlaneA[2]   = fgkThBKP/2.;
368   
369   //Back PLane PCB of MAterial G10
370   gMC->Gsvolu("EBKA","BOX", idtmed[607], dboxBPlaneA, 3);
371   //-------------------------------------------------------------//  
372
373  //---------- That was all in the Z -direction of Unit Module A----//
374
375   //  Now lets us construct the boundary arround the Unit Module --//
376   // This boundary has 
377   // (a) 0.5 mm X and Y and 10.3 mm Z dimension  AIR gap
378   // (b) 0.5 mm X and Y and 10.3 mm Z dimension G10
379   // (c) 3.0 mm X and Y and 12.3 mm Z dimension Stainless Steel
380
381
382
383   //-------------------------------------------------//
384   //AIR GAP between UM and Boundary : ECGA FOR PRESHOWER PLANE
385   //==========================================================
386   // Make a 10.3mm thick Air gap for Unit module A
387   // X-dimension same as EHC1+0.05
388   // Y-dimension same as EHC1+0.05
389   // Z-dimension 1.03/2 = 0.515 cm
390   Float_t dboxAir3A[3];
391   dboxAir3A[0]         = dbox3[0]+(2.0*fgkGap); 
392   dboxAir3A[1]         = dbox3[1]+(2.0*fgkGap); 
393   dboxAir3A[2]         = fgkThAir/2.;
394
395   //FOR PRESHOWER
396   //Air gap is a BOX of Material Air
397   gMC->Gsvolu("ECGA","BOX", idtmed[698], dboxAir3A, 3);
398
399   //FOR VETO
400   //Air gap is a BOX of Material Air
401   gMC->Gsvolu("ECVA","BOX", idtmed[698], dboxAir3A, 3);
402   //-------------------------------------------------//  
403
404  //-------------------------------------------------//
405   //G10 boundary between honeycomb and SS : EDGA
406   //================================================
407   // Make a 10.3mm thick G10 Boundary for Unit module A
408   // X-dimension same as EHC1+Airgap+0.05
409   // Y-dimension same as EHC1+Airgap+0.05
410   // Z-dimension 1.03/2 = 0.515 cm
411   Float_t dboxGGA[3];
412   dboxGGA[0]         = dboxAir3A[0]+(2.0*fgkGap); 
413   dboxGGA[1]         = dboxAir3A[1]+(2.0*fgkGap); 
414   dboxGGA[2]         = fgkThG10/2.;
415
416   //FOR PRESHOWER
417   //G10 BOX 
418   gMC->Gsvolu("EDGA","BOX", idtmed[607], dboxGGA, 3);
419
420   //FOR VETO
421   //G10 BOX 
422   gMC->Gsvolu("EDVA","BOX", idtmed[607], dboxGGA, 3);
423
424   //-------------------------------------------------//  
425   //----------------------------------------------------------//
426   //Stainless Steel Bounadry : ESSA
427   //==================================
428   // Make a 10.3mm thick Stainless Steel boundary for Unit module A
429   // X-dimension same as EHC1 + Airgap + G10 + 0.3
430   // Y-dimension same as EHC1 + Airgap + G10 + 0.3
431   // Z-dimension 1.03/2 = 0.515 cm
432   //------------------------------------------------------//
433   // A Stainless Steel Boundary Channel to house the unit module
434
435   Float_t dboxSS1[3];
436   dboxSS1[0]           = dboxGGA[0]+fgkSSBoundary; 
437   dboxSS1[1]           = dboxGGA[1]+fgkSSBoundary;       
438   dboxSS1[2]           = fgkThSS/2.;
439   
440   //FOR PRESHOWER
441
442   //Stainless Steel boundary - Material Stainless Steel
443   gMC->Gsvolu("ESSA","BOX", idtmed[618], dboxSS1, 3);
444
445   //FOR VETO
446   //Stainless Steel boundary - Material Stainless Steel
447   gMC->Gsvolu("ESVA","BOX", idtmed[618], dboxSS1, 3);
448
449   //----------------------------------------------------------------//
450
451   //----------------------------------------------------------------//
452   // Here we need to place the volume in order ESSA -> EDGA -> ECGA 
453   // this makes the SS boundary and the 0.5mm thick FR4 insulation in place, 
454   // and the air volume ECGA acts as mother for the rest of components.
455   // The above placeemnt is done at (0.,0.,0.) relative coordiante 
456   // Now we place bottom PCB, honeycomb, top PCB in this volume. We donot place
457   // unnecessary air volumes now. Just leave the gap as we are placing them
458   // in  air only. This also reduces the number of volumes for geant to track.
459
460 // Tree structure for different volumes
461 //
462 //                              EUM1
463 //                               |
464 //                      --------------------
465 //                      |        |         |
466 //                    EBPA      ESSA      EBKA
467 //                               |
468 //                              EDGA
469 //                               |
470 //                              ECGA
471 //                               |
472 //                      --------------------
473 //                      |        |         |
474 //                    EPCA(1)   EHC1     EPCA(2)
475 //                   (bottom)    |      (top PCB)
476 //                               |
477 //                          Sensitive volume
478 //                              (gas)
479 //      
480
481
482   //FOR VETO
483 //Creating the side channels 
484 // SS boundary channel, followed by G10 and Air Gap  
485   gMC->Gspos("EDVA", 1, "ESVA", 0., 0., 0., 0, "ONLY");
486   gMC->Gspos("ECVA", 1, "EDVA", 0., 0., 0., 0, "ONLY");
487
488 //FOR PRESHOWER
489   gMC->Gspos("EDGA", 1, "ESSA", 0., 0., 0., 0, "ONLY");
490   gMC->Gspos("ECGA", 1, "EDGA", 0., 0., 0., 0, "ONLY");
491
492  // now other components, using Bedanga's code, but changing the values.
493   //Positioning Bottom PCB, Honey Comb abd Top PCB in AIR
494
495   //For veto plane
496   //Positioning the Bottom 0.16 cm PCB
497   Float_t zbpcb = -dboxAir3A[2] + (2.0*fgkGap) + fgkThPCB/2.;
498   gMC->Gspos("EPCA", 1, "ECVA", 0., 0., zbpcb, 0, "ONLY");
499   //Positioning the Honey Comb 0.5 cm
500   Float_t zhc = zbpcb + fgkThPCB/2. + fgkCellDepth/2.;
501   gMC->Gspos("EHC1", 1, "ECVA", 0., 0., zhc, 0, "ONLY");
502   //Positioning the Top PCB 0.16 cm
503   Float_t ztpcb = zhc + fgkCellDepth/2 + fgkThPCB/2.;
504   gMC->Gspos("EPCA", 2, "ECVA", 0., 0., ztpcb, 0, "ONLY");
505
506
507   //For Preshower plane the ordering is reversed
508   //Positioning the Bottom 0.16 cm PCB
509   zbpcb = -dboxAir3A[2] + fgkThPCB + fgkThPCB/2.;
510   gMC->Gspos("EPCA", 1, "ECGA", 0., 0., zbpcb, 0, "ONLY");
511   //Positioning the Honey Comb 0.5 cm
512   zhc = zbpcb + fgkThPCB/2. + fgkCellDepth/2.;
513   gMC->Gspos("EHC1", 1, "ECGA", 0., 0., zhc, 0, "ONLY");
514   //Positioning the Top PCB 0.16 cm
515   ztpcb = zhc + fgkCellDepth/2 + fgkThPCB/2.;
516   gMC->Gspos("EPCA", 2, "ECGA", 0., 0., ztpcb, 0, "ONLY");
517
518
519
520
521  //--------------Now let us construct final UM ---------------//
522   // We will do it as follows :
523   // (i)  First make a UM of air. which will have dimensions
524   //      of the SS boundary Channel (in x,y) and of height 13.3mm
525   //(ii)  Then we will place all the components
526
527   //----------------------------------------------------------//
528   // A  unit module type A of Air
529   // Dimensions of Unit Module same as SS boundary channel
530   Float_t dboxUM1[3];
531   dboxUM1[0] = dboxSS1[0];
532   dboxUM1[1] = dboxSS1[1];
533   dboxUM1[2] = fgkThSS/2. +0.15; // 0.15 added to accomodate Base Plate at
534   // the bottom and the backplane PCB at the top.
535
536   //FOR PRESHOWER
537   //Create a Unit module of above dimensions Material : AIR
538   gMC->Gsvolu("EUM1","BOX", idtmed[698], dboxUM1, 3);
539   //FOR VETO
540   gMC->Gsvolu("EUV1","BOX", idtmed[698], dboxUM1, 3);
541
542   //----------------------------------------------------------------//
543
544   //BASE PLATE : EBPA
545   //==================
546   // Make a 2mm thick G10 Base plate for Unit module A
547   // Base plate is as big as the final UM dimensions that is as 
548   // SS boundary channel
549   Float_t dboxBaseA[3];
550   dboxBaseA[0]       = dboxSS1[0];
551   dboxBaseA[1]       = dboxSS1[1];       
552   dboxBaseA[2]       = fgkThBase/2.;
553   
554   //Base Blate is a G10 BOX
555   gMC->Gsvolu("EBPA","BOX", idtmed[607], dboxBaseA, 3);
556   //----------------------------------------------------//  
557
558   //FOR VETO
559   //- Placing of all components of UM in AIR BOX EUM1--//
560   //(1)   FIRST PUT THE BASE PLATE
561   Float_t zbaseplate = -dboxUM1[2] + fgkThBase/2.;
562   gMC->Gspos("EBPA", 1, "EUV1", 0., 0., zbaseplate, 0, "ONLY");
563
564   //(2)   NEXT PLACING the SS BOX 
565   Float_t zss = zbaseplate + fgkThBase/2. + fgkThSS/2.;
566   gMC->Gspos("ESVA", 1, "EUV1", 0., 0., zss, 0, "ONLY");
567   
568   // (3) Positioning the Backplane PCB 0.1 cm
569   Float_t zbkp = zss + fgkThSS/2. + fgkThBKP/2.;
570   gMC->Gspos("EBKA", 1, "EUV1", 0., 0., zbkp, 0, "ONLY");
571
572   //FOR PRESHOWER
573   // (3) Positioning the Backplane PCB 0.1 cm
574   zbkp = -dboxUM1[2] + fgkThBKP/2.;
575   gMC->Gspos("EBKA", 1, "EUM1", 0., 0., zbkp, 0, "ONLY");
576
577   //(2)   NEXT PLACING the SS BOX 
578   zss = zbkp + fgkThBKP/2. + fgkThSS/2.;
579   gMC->Gspos("ESSA", 1, "EUM1", 0., 0., zss, 0, "ONLY");
580   
581   //(1)   FIRST PUT THE BASE PLATE
582   zbaseplate = zss + fgkThSS/2 + fgkThBase/2.;
583   gMC->Gspos("EBPA", 1, "EUM1", 0., 0., zbaseplate, 0, "ONLY");
584   //-------------------- UM Type A completed ------------------------//
585
586
587
588   //-------------------- Lets do the same thing for UM type B -------//
589  //--------------------------------------------------//
590   //Bottom and Top PCB : EPCB
591   //===========================
592   // Make a 1.6mm thick G10 Bottom and Top PCB for Unit module B
593   // X-dimension same as EHC2 - dbox4[0]
594   // Y-dimension same as EHC2 - dbox4[1]
595   // Z-dimension 0.16/2 = 0.08 cm
596   //-------------------------------------------------//
597   Float_t dboxPcbB[3];
598   dboxPcbB[0]      = dbox4[0]; 
599   dboxPcbB[1]      = dbox4[1];       
600   dboxPcbB[2]      = fgkThPCB/2.;
601   
602   //Top and Bottom PCB is a BOX of Material G10
603   gMC->Gsvolu("EPCB","BOX", idtmed[607], dboxPcbB, 3);
604   //--------------------------------------------------------//  
605   //Back Plane : EBKB
606   //==================
607   // Make a 1.0mm thick Back Plane PCB for Unit module B
608   // X-dimension same as EHC2 - dbox4[0]
609   // Y-dimension same as EHC2 - dbox4[1]
610   // Z-dimension 0.1/2 = 0.05 cm
611   //------------------------------------------------------//
612   Float_t dboxBPlaneB[3];
613   dboxBPlaneB[0]   = dbox4[0]; 
614   dboxBPlaneB[1]   = dbox4[1];       
615   dboxBPlaneB[2]   = fgkThBKP/2.;
616   
617   //Back PLane PCB of MAterial G10
618   gMC->Gsvolu("EBKB","BOX", idtmed[607], dboxBPlaneB, 3);
619   //-------------------------------------------------------------//  
620
621  //---------- That was all in the Z -direction of Unit Module B----//
622
623   //  Now lets us construct the boundary arround the Unit Module --//
624   // This boundary has 
625   // (a) 0.5 mm X and Y and 10.3 mm Z dimension  AIR gap
626   // (b) 0.5 mm X and Y and 10.3 mm Z dimension G10
627   // (c) 3.0 mm X and Y and 12.3 mm Z dimension Stainless Steel
628
629   //-------------------------------------------------//
630   //AIR GAP between UM and Boundary : ECGB
631   //================================================
632   // Make a 10.3mm thick Air gap for Unit module B
633   // X-dimension same as EHC2+0.05
634   // Y-dimension same as EHC2+0.05
635   // Z-dimension 1.03/2 = 0.515 cm
636   Float_t dboxAir3B[3];
637   dboxAir3B[0]         = dbox4[0]+(2.0*fgkGap); 
638   dboxAir3B[1]         = dbox4[1]+(2.0*fgkGap);       
639   dboxAir3B[2]         = fgkThAir/2.;
640
641   //PRESHOWER
642   //Air gap is a BOX of Material Air
643   gMC->Gsvolu("ECGB","BOX", idtmed[698], dboxAir3B, 3);
644   //VETO
645   gMC->Gsvolu("ECVB","BOX", idtmed[698], dboxAir3B, 3);
646
647   //-------------------------------------------------//  
648
649  //-------------------------------------------------//
650   //G10 boundary between honeycomb and SS : EDGB
651   //================================================
652   // Make a 10.3mm thick G10 Boundary for Unit module B
653   // X-dimension same as EHC2+Airgap+0.05
654   // Y-dimension same as EHC2+Airgap+0.05
655   // Z-dimension 1.03/2 = 0.515 cm
656   Float_t dboxGGB[3];
657   dboxGGB[0]         = dboxAir3B[0]+(2.0*fgkGap); 
658   dboxGGB[1]         = dboxAir3B[1]+(2.0*fgkGap);      
659   dboxGGB[2]         = fgkThG10/2.;
660
661   //PRESHOWER
662   //G10 BOX 
663   gMC->Gsvolu("EDGB","BOX", idtmed[607], dboxGGB, 3);
664   //VETO
665   gMC->Gsvolu("EDVB","BOX", idtmed[607], dboxGGB, 3);
666   //-------------------------------------------------//  
667   //----------------------------------------------------------//
668   //Stainless Steel Bounadry : ESSB
669   //==================================
670   // Make a 10.3mm thick Stainless Steel boundary for Unit module B
671   // X-dimension same as EHC2 + Airgap + G10 + 0.3
672   // Y-dimension same as EHC2 + Airgap + G10 + 0.3
673   // Z-dimension 1.03/2 = 0.515 cm
674   //------------------------------------------------------//
675   // A Stainless Steel Boundary Channel to house the unit module
676
677   Float_t dboxSS2[3];
678   dboxSS2[0]  = dboxGGB[0] + fgkSSBoundary; 
679   dboxSS2[1]  = dboxGGB[1] + fgkSSBoundary;       
680   dboxSS2[2]  = fgkThSS/2.;
681   
682   //PRESHOWER
683   //Stainless Steel boundary - Material Stainless Steel
684   gMC->Gsvolu("ESSB","BOX", idtmed[618], dboxSS2, 3);
685   //VETO
686   gMC->Gsvolu("ESVB","BOX", idtmed[618], dboxSS2, 3);
687   //----------------------------------------------------------------//
688
689   //----------------------------------------------------------------//
690   // Here we need to place the volume in order ESSB -> EDGB -> ECGB 
691   // this makes the SS boiundary and the 0.5mm thick FR4 insulation in place, 
692   // and the air volume ECGB acts as mother for the rest of components.
693   // The above placeemnt is done at (0.,0.,0.) relative coordiante 
694   // Now we place bottom PCB, honeycomb, top PCB in this volume. We donot place
695   // unnecessary air volumes now. Just leave the gap as we are placing them
696   // in  air only. This also reduces the number of volumes for geant to track.
697
698 // Tree structure for different volumes
699 //
700 //                              EUM2
701 //                               |
702 //                      --------------------
703 //                      |        |         |
704 //                    EBPB      ESSB      EBKB
705 //                               |
706 //                              EDGB
707 //                               |
708 //                              ECGB
709 //                               |
710 //                      --------------------
711 //                      |        |         |
712 //                    EPCB(1)   EHC2     EPCB(2)
713 //                   (bottom)    |      (top PCB)
714 //                               |
715 //                          Sensitive volume
716 //                              (gas)
717 //      
718
719 //PRESHOWER
720 //Creating the side channels
721 // SS boundary channel, followed by G10 and Air Gap  
722   gMC->Gspos("EDGB", 1, "ESSB", 0., 0., 0., 0, "ONLY");
723   gMC->Gspos("ECGB", 1, "EDGB", 0., 0., 0., 0, "ONLY");
724   //VETO
725   gMC->Gspos("EDVB", 1, "ESVB", 0., 0., 0., 0, "ONLY");
726   gMC->Gspos("ECVB", 1, "EDVB", 0., 0., 0., 0, "ONLY");
727
728  // now other components, using Bedang's code, but changing the values.
729   //Positioning Bottom PCB, Honey Comb abd Top PCB in AIR
730
731   //VETO
732   //Positioning the Bottom 0.16 cm PCB
733   Float_t zbpcb2 = -dboxAir3B[2] + (2.0*fgkGap) + fgkThPCB/2.;
734   gMC->Gspos("EPCB", 1, "ECVB", 0., 0., zbpcb2, 0, "ONLY");
735   //Positioning the Honey Comb 0.5 cm
736   Float_t zhc2 = zbpcb2 + fgkThPCB/2. + fgkCellDepth/2.;
737   gMC->Gspos("EHC2", 1, "ECVB", 0., 0., zhc2, 0, "ONLY");
738   //Positioning the Top PCB 0.16 cm
739   Float_t ztpcb2 = zhc2 + fgkCellDepth/2 + fgkThPCB/2.;
740   gMC->Gspos("EPCB", 2, "ECVB", 0., 0., ztpcb2, 0, "ONLY");
741
742   //PRESHOWER
743   //For preshower plane the ordering is reversed
744   //Positioning the Bottom 0.16 cm PCB
745   zbpcb2 = -dboxAir3B[2] + fgkThPCB + fgkThPCB/2.;
746   gMC->Gspos("EPCB", 1, "ECGB", 0., 0., zbpcb2, 0, "ONLY");
747   //Positioning the Honey Comb 0.5 cm
748   zhc2 = zbpcb2 + fgkThPCB/2. + fgkCellDepth/2.;
749   gMC->Gspos("EHC2", 1, "ECGB", 0., 0., zhc2, 0, "ONLY");
750   //Positioning the Top PCB 0.16 cm
751   ztpcb2 = zhc2 + fgkCellDepth/2 + fgkThPCB/2.;
752   gMC->Gspos("EPCB", 2, "ECGB", 0., 0., ztpcb2, 0, "ONLY");
753
754
755
756  //--------------Now let us construct final UM ---------------//
757   // We will do it as follows :
758   // (i)  First make a UM of air. which will have dimensions
759   //      of the SS boundary Channel (in x,y) and of height 13.3mm
760   //(ii)  Then we will place all the components
761
762   //----------------------------------------------------------//
763   // A  unit module type B of Air
764   // Dimensions of Unit Module same as SS boundary channel
765
766   Float_t dboxUM2[3];
767   dboxUM2[0] = dboxSS2[0];
768   dboxUM2[1] = dboxSS2[1];
769   dboxUM2[2] = fgkThSS/2. +0.15; // 0.15 added to accomodate Base Plate at
770   // the bottom and the backplane PCB at the top.
771
772   //PRESHOWER
773   //Create a Unit module of above dimensions Material : AIR
774   gMC->Gsvolu("EUM2","BOX", idtmed[698], dboxUM2, 3);
775
776   //VETO
777   gMC->Gsvolu("EUV2","BOX", idtmed[698], dboxUM2, 3);
778   //----------------------------------------------------------------//
779
780   //BASE PLATE : EBPB
781   //==================
782   // Make a 2mm thick G10 Base plate for Unit module B
783   // Base plate is as big as the final UM dimensions that is as 
784   // SS boundary channel
785   Float_t dboxBaseB[3];
786   dboxBaseB[0]       = dboxSS2[0];
787   dboxBaseB[1]       = dboxSS2[1];       
788   dboxBaseB[2]       = fgkThBase/2.;
789   
790   //Base Blate is a G10 BOX
791   gMC->Gsvolu("EBPB","BOX", idtmed[607], dboxBaseB, 3);
792   //----------------------------------------------------//  
793
794   //VETO
795   //- Placing of all components of UM in AIR BOX EUM2--//
796   //(1)   FIRST PUT THE BASE PLATE
797   Float_t zbaseplate2 = -dboxUM2[2] + fgkThBase/2.;
798   gMC->Gspos("EBPB", 1, "EUV2", 0., 0., zbaseplate2, 0, "ONLY");
799
800   //(2)   NEXT PLACING the SS BOX 
801   Float_t zss2 = zbaseplate2 + fgkThBase/2. + fgkThSS/2.;
802   gMC->Gspos("ESVB", 1, "EUV2", 0., 0., zss2, 0, "ONLY");
803   
804   // (3) Positioning the Backplane PCB 0.1 cm
805   Float_t zbkp2 = zss2 + fgkThSS/2. + fgkThBKP/2.;
806   gMC->Gspos("EBKB", 1, "EUV2", 0., 0., zbkp2, 0, "ONLY");
807
808
809
810   //FOR PRESHOWER
811   // (3) Positioning the Backplane PCB 0.1 cm
812   zbkp2 = -dboxUM2[2] + fgkThBKP/2.;
813   gMC->Gspos("EBKB", 1, "EUM2", 0., 0., zbkp2, 0, "ONLY");
814
815   //(2)   NEXT PLACING the SS BOX 
816   zss2 = zbkp2 + fgkThBKP/2. + fgkThSS/2.;
817   gMC->Gspos("ESSB", 1, "EUM2", 0., 0., zss2, 0, "ONLY");
818   
819   //(1)   FIRST PUT THE BASE PLATE
820   zbaseplate2 = zss2 + fgkThSS/2 + fgkThBase/2.;
821   gMC->Gspos("EBPB", 1, "EUM2", 0., 0., zbaseplate2, 0, "ONLY");
822   //-------------------- UM Type B completed ------------------------//
823
824
825   //--- Now we need to make Lead plates of UM dimension -----//
826
827   /**************************/
828   //----------------------------------------------------------//
829   // The lead convertor is of unit module size
830   // Dimensions of Unit Module same as SS boundary channel
831
832   Float_t dboxPba[3];
833   dboxPba[0] = dboxUM1[0];
834   dboxPba[1] = dboxUM1[1];
835   dboxPba[2] = fgkThLead/2.;
836   // Lead of UM dimension
837   gMC->Gsvolu("EPB1","BOX", idtmed[600], dboxPba, 3);
838
839   Float_t dboxPbb[3];
840   dboxPbb[0] = dboxUM2[0];
841   dboxPbb[1] = dboxUM2[1];
842   dboxPbb[2] = fgkThLead/2.;
843   // Lead of UM dimension
844   gMC->Gsvolu("EPB2","BOX", idtmed[600], dboxPbb, 3);
845
846   //----------------------------------------------------------------//
847
848   // 2 types of Rectangular shaped supermodules (BOX) 
849   //each with 6 unit modules 
850   
851   // volume for SUPERMODULE ESMA 
852   //Space added to provide a gapping for HV between UM's
853   //There is a gap of 0.15 cm between two Modules (UMs)
854   // in x-direction and 0.1cm along y-direction
855
856   Float_t dboxSM1[3];
857   dboxSM1[0] = 3.0*dboxUM1[0] + (2.0*0.075);
858   dboxSM1[1] = 2.0*dboxUM1[1] +  0.05;
859   dboxSM1[2] = dboxUM1[2];
860
861   //FOR PRESHOWER  
862   gMC->Gsvolu("ESMA","BOX", idtmed[698], dboxSM1, 3);
863   
864   //FOR VETO
865   gMC->Gsvolu("EMVA","BOX", idtmed[698], dboxSM1, 3);
866
867   //Position the 6 unit modules in EMSA
868   Float_t xa1,xa2,xa3,ya1,ya2; 
869   xa1 =  dboxSM1[0] - dboxUM1[0];
870   xa2 = xa1 - dboxUM1[0] - 0.15 - dboxUM1[0];
871   xa3 = xa2 - dboxUM1[0] - 0.15 - dboxUM1[0];
872   ya1 = dboxSM1[1]  - dboxUM1[1];
873   ya2 = ya1 - dboxUM1[1] - 0.1 - dboxUM1[1];
874
875   //PRESHOWER
876   // gMC->Gspos("EUM1", 1, "ESMA", xa1, ya1, 0., 0, "ONLY"); // BKN
877   gMC->Gspos("EUM1", 2, "ESMA", xa2, ya1, 0., 0, "ONLY");
878   gMC->Gspos("EUM1", 3, "ESMA", xa3, ya1, 0., 0, "ONLY");
879   gMC->Gspos("EUM1", 4, "ESMA", xa1, ya2, 0., 0, "ONLY");
880   gMC->Gspos("EUM1", 5, "ESMA", xa2, ya2, 0., 0, "ONLY");
881   gMC->Gspos("EUM1", 6, "ESMA", xa3, ya2, 0., 0, "ONLY");
882
883   //VETO
884   gMC->Gspos("EUV1", 1, "EMVA", xa1, ya1, 0., 0, "ONLY");
885   gMC->Gspos("EUV1", 2, "EMVA", xa2, ya1, 0., 0, "ONLY");
886   gMC->Gspos("EUV1", 3, "EMVA", xa3, ya1, 0., 0, "ONLY");
887   gMC->Gspos("EUV1", 4, "EMVA", xa1, ya2, 0., 0, "ONLY");
888   gMC->Gspos("EUV1", 5, "EMVA", xa2, ya2, 0., 0, "ONLY");
889   gMC->Gspos("EUV1", 6, "EMVA", xa3, ya2, 0., 0, "ONLY");
890
891
892   // volume for SUPERMODULE ESMB 
893   //Space is added to provide a gapping for HV between UM's
894   Float_t dboxSM2[3];
895   dboxSM2[0] = 2.0*dboxUM2[0] + 0.075; 
896   dboxSM2[1] = 3.0*dboxUM2[1] + (2.0*0.05);
897   dboxSM2[2] = dboxUM2[2];
898   
899   //PRESHOWER
900   gMC->Gsvolu("ESMB","BOX", idtmed[698], dboxSM2, 3);
901   //VETO 
902   gMC->Gsvolu("EMVB","BOX", idtmed[698], dboxSM2, 3);
903
904   //Position the 6 unit modules in EMSB
905   Float_t xb1,xb2,yb1,yb2,yb3; 
906   xb1 = dboxSM2[0] - dboxUM2[0];
907   xb2 = xb1 - dboxUM2[0] - 0.15 - dboxUM2[0];
908   yb1 = dboxSM2[1] - dboxUM2[1];
909   yb2 = yb1 - dboxUM2[1] - 0.1 -  dboxUM2[1];
910   yb3 = yb2 - dboxUM2[1] - 0.1 -  dboxUM2[1];
911
912
913   //PRESHOWER  
914   // gMC->Gspos("EUM2", 1, "ESMB", xb1, yb1, 0., 0, "ONLY");  // BKN
915   // gMC->Gspos("EUM2", 2, "ESMB", xb2, yb1, 0., 0, "ONLY");
916   gMC->Gspos("EUM2", 3, "ESMB", xb1, yb2, 0., 0, "ONLY");
917   gMC->Gspos("EUM2", 4, "ESMB", xb2, yb2, 0., 0, "ONLY");
918   gMC->Gspos("EUM2", 5, "ESMB", xb1, yb3, 0., 0, "ONLY");
919   gMC->Gspos("EUM2", 6, "ESMB", xb2, yb3, 0., 0, "ONLY");
920   
921   //VETO
922   gMC->Gspos("EUV2", 1, "EMVB", xb1, yb1, 0., 0, "ONLY");
923   gMC->Gspos("EUV2", 2, "EMVB", xb2, yb1, 0., 0, "ONLY");
924   gMC->Gspos("EUV2", 3, "EMVB", xb1, yb2, 0., 0, "ONLY");
925   gMC->Gspos("EUV2", 4, "EMVB", xb2, yb2, 0., 0, "ONLY");
926   gMC->Gspos("EUV2", 5, "EMVB", xb1, yb3, 0., 0, "ONLY");
927   gMC->Gspos("EUV2", 6, "EMVB", xb2, yb3, 0., 0, "ONLY");
928   
929   // Make smiliar stucture for lead as for PMD plane
930   //================================================
931
932   // 2 types of Rectangular shaped supermodules (BOX) 
933   //each with 6 unit modules 
934   
935   // volume for SUPERMODULE ESMPbA 
936   //Space added to provide a gapping for HV between UM's
937
938   Float_t dboxSMPb1[3];
939   dboxSMPb1[0] = 3.0*dboxUM1[0] + (2.0*0.075);
940   dboxSMPb1[1] = 2.0*dboxUM1[1] +  0.05;
941   dboxSMPb1[2] = fgkThLead/2.;
942   
943   gMC->Gsvolu("ESPA","BOX", idtmed[698], dboxSMPb1, 3);
944   
945
946   //Position the 6 unit modules in ESMPbA
947   Float_t xpa1,xpa2,xpa3,ypa1,ypa2; 
948   xpa1 = -dboxSMPb1[0] + dboxUM1[0];
949   xpa2 = xpa1 + dboxUM1[0] + 0.15 + dboxUM1[0];
950   xpa3 = xpa2 + dboxUM1[0] + 0.15 + dboxUM1[0];
951   ypa1 = dboxSMPb1[1]  - dboxUM1[1];
952   ypa2 = ypa1 - dboxUM1[1] - 0.1 - dboxUM1[1];
953
954
955   gMC->Gspos("EPB1", 1, "ESPA", xpa1, ypa1, 0., 0, "ONLY");
956   gMC->Gspos("EPB1", 2, "ESPA", xpa2, ypa1, 0., 0, "ONLY");
957   gMC->Gspos("EPB1", 3, "ESPA", xpa3, ypa1, 0., 0, "ONLY");
958   gMC->Gspos("EPB1", 4, "ESPA", xpa1, ypa2, 0., 0, "ONLY");
959   gMC->Gspos("EPB1", 5, "ESPA", xpa2, ypa2, 0., 0, "ONLY");
960   gMC->Gspos("EPB1", 6, "ESPA", xpa3, ypa2, 0., 0, "ONLY");
961
962
963   // volume for SUPERMODULE ESMPbB 
964   //Space is added to provide a gapping for HV between UM's
965   Float_t dboxSMPb2[3];
966   dboxSMPb2[0] = 2.0*dboxUM2[0] + 0.075;
967   dboxSMPb2[1] = 3.0*dboxUM2[1] + (2.0*0.05);
968   dboxSMPb2[2] = fgkThLead/2.;
969
970   gMC->Gsvolu("ESPB","BOX", idtmed[698], dboxSMPb2, 3);
971  
972   //Position the 6 unit modules in ESMPbB
973   Float_t xpb1,xpb2,ypb1,ypb2,ypb3; 
974   xpb1 = -dboxSMPb2[0] + dboxUM2[0];
975   xpb2 = xpb1 + dboxUM2[0] + 0.15 + dboxUM2[0];
976   ypb1 = dboxSMPb2[1]  - dboxUM2[1];
977   ypb2 = ypb1 - dboxUM2[1] - 0.1 -  dboxUM2[1];
978   ypb3 = ypb2 - dboxUM2[1] - 0.1 -  dboxUM2[1];
979
980
981   gMC->Gspos("EPB2", 1, "ESPB", xpb1, ypb1, 0., 0, "ONLY");
982   gMC->Gspos("EPB2", 2, "ESPB", xpb2, ypb1, 0., 0, "ONLY");
983   gMC->Gspos("EPB2", 3, "ESPB", xpb1, ypb2, 0., 0, "ONLY");
984   gMC->Gspos("EPB2", 4, "ESPB", xpb2, ypb2, 0., 0, "ONLY");
985   gMC->Gspos("EPB2", 5, "ESPB", xpb1, ypb3, 0., 0, "ONLY");
986   gMC->Gspos("EPB2", 6, "ESPB", xpb2, ypb3, 0., 0, "ONLY");
987
988
989   //---------------------------------------------------
990   /// ALICE PMD FEE BOARDS IMPLEMENTATION
991   // Dt: 25th February 2006 
992   // - M.M.  Mondal, S.K. Prasad and P.K. Netrakanti
993   //---------------------------------------------------
994
995   //FEE boards 
996   // It is FR4 board of length 7cm
997   // breadth of 2.4 cm and thickness 0.1cm
998   Float_t dboxFEE[3];
999   dboxFEE[0] = 0.05;
1000   dboxFEE[1] = 3.50;
1001   dboxFEE[2] = 1.20;
1002
1003   gMC->Gsvolu("EFEE","BOX", idtmed[607], dboxFEE, 3);
1004
1005   //Mother volume to accomodate FEE boards
1006   // It should have the dimension 
1007   // as the back plane or the 
1008   //corresponding UM
1009   //TYPE A
1010   //------------------------------------------------------//
1011
1012   Float_t dboxFEEBPlaneA[3];
1013   dboxFEEBPlaneA[0]   = dboxBPlaneA[0]; //dbox3[0]; 
1014   dboxFEEBPlaneA[1]   = dboxBPlaneA[1];//dbox3[1];       
1015   dboxFEEBPlaneA[2]   = 1.2;
1016   
1017   //Volume of same dimension as Back PLane of Material AIR
1018   gMC->Gsvolu("EFBA","BOX", idtmed[698], dboxFEEBPlaneA, 3);
1019
1020   //TYPE B
1021   Float_t dboxFEEBPlaneB[3];
1022   dboxFEEBPlaneB[0]   = dboxBPlaneB[0]; //dbox4[0]; 
1023   dboxFEEBPlaneB[1]   = dboxBPlaneB[1];//dbox4[1];       
1024   dboxFEEBPlaneB[2]   = 1.2;
1025   
1026   //Back PLane PCB of MAterial G10
1027   gMC->Gsvolu("EFBB","BOX", idtmed[698], dboxFEEBPlaneB, 3);
1028
1029   //Placing the FEE boards in the Mother volume of AIR
1030
1031   //Type A 
1032
1033   Float_t xFee; // X-position of FEE board
1034   Float_t yFee; // Y-position of FEE board
1035   Float_t zFee = 0.0; // Z-position of FEE board
1036
1037   Float_t xA    = 0.25; //distance from the border to 1st FEE board
1038   Float_t yA    = 4.00; //distance from the border to 1st FEE board
1039   Float_t xSepa = 1.70; //Distance between two FEE boards
1040   Float_t ySepa = 8.00; //Distance between two FEE boards
1041
1042   
1043   // FEE Boards EFEE placed inside EFBA
1044   number = 1;
1045   yFee =  dboxFEEBPlaneA[1] - yA;  
1046   for (i = 1; i <= 6; ++i) 
1047     {
1048       xFee = -dboxFEEBPlaneA[0] + xA; 
1049       for (j = 1; j <= 12; ++j) 
1050         {
1051           gMC->Gspos("EFEE", number, "EFBA", xFee,yFee,zFee, 0, "ONLY");
1052           xFee += xSepa;
1053           number += 1;
1054         }
1055       yFee -= ySepa; 
1056     }
1057   // FEE Boards EFEE placed inside EFBB
1058   number = 1;
1059   yFee =  dboxFEEBPlaneB[1] - yA;  
1060   for (i = 1; i <= 3; ++i) 
1061     {
1062       xFee = -dboxFEEBPlaneB[0] + xA; 
1063       for (j = 1; j <= 24; ++j) 
1064         {
1065           gMC->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
1066           xFee += xSepa;
1067           number += 1;
1068         }
1069       yFee -= ySepa; 
1070     }
1071
1072
1073   //Distance between the two backplanes of two UMs
1074   //in x-direction is 0.92 and ydirection is 0.95
1075   Float_t dboxEFSA[3];
1076   dboxEFSA[0] = 3.0*dboxFEEBPlaneA[0] + 0.92;
1077   dboxEFSA[1] = 2.0*dboxFEEBPlaneA[1] + (0.95/2.0);
1078   dboxEFSA[2] = dboxFEEBPlaneA[2];
1079
1080   //Type A
1081   gMC->Gsvolu("EFSA","BOX", idtmed[698],dboxEFSA, 3);
1082
1083   //Distance between the two backplanes of two UMs
1084   //in x-direction is 0.92 and ydirection is 0.95
1085   Float_t dboxEFSB[3];
1086   dboxEFSB[0] = 2.0*dboxFEEBPlaneB[0] + (0.938/2.0);
1087   dboxEFSB[1] = 3.0*dboxFEEBPlaneB[1] + 1.05;
1088   dboxEFSB[2] = dboxFEEBPlaneB[2];
1089
1090   //Type A
1091   gMC->Gsvolu("EFSB","BOX", idtmed[698],dboxEFSB, 3);
1092
1093
1094   Float_t xfs1,xfs2,xfs3,yfs1,yfs2,yfs3; 
1095   xfs1 = -dboxEFSA[0] + dboxFEEBPlaneA[0];
1096   xfs2 = xfs1 + dboxFEEBPlaneA[0] +  0.92 + dboxFEEBPlaneA[0];
1097   xfs3 = xfs2 + dboxFEEBPlaneA[0] +  0.92 + dboxFEEBPlaneA[0];
1098   yfs1 = dboxEFSA[1] - dboxFEEBPlaneA[1];
1099   yfs2 = yfs1 - dboxFEEBPlaneA[1] - 0.95 - dboxFEEBPlaneA[1];
1100
1101
1102
1103   // gMC->Gspos("EFBA", 1, "EFSA", xfs1, yfs1, 0., 0, "ONLY");  // BKN
1104   gMC->Gspos("EFBA", 2, "EFSA", xfs2, yfs1, 0., 0, "ONLY");
1105   gMC->Gspos("EFBA", 3, "EFSA", xfs3, yfs1, 0., 0, "ONLY");
1106   gMC->Gspos("EFBA", 4, "EFSA", xfs1, yfs2, 0., 0, "ONLY");
1107   gMC->Gspos("EFBA", 5, "EFSA", xfs2, yfs2, 0., 0, "ONLY");
1108   gMC->Gspos("EFBA", 6, "EFSA", xfs3, yfs2, 0., 0, "ONLY");
1109
1110
1111   //Type B positioning
1112
1113   xfs1 = -dboxEFSB[0] + dboxFEEBPlaneB[0];
1114   xfs2 = xfs1 + dboxFEEBPlaneB[0] + 0.938 + dboxFEEBPlaneB[0];
1115   yfs1 = dboxEFSB[1] - dboxFEEBPlaneB[1];
1116   yfs2 = yfs1 - dboxFEEBPlaneB[1] - 1.05 - dboxFEEBPlaneB[1];
1117   yfs3 = yfs2 - dboxFEEBPlaneB[1] - 1.05 - dboxFEEBPlaneB[1];
1118
1119
1120
1121   // gMC->Gspos("EFBB", 1, "EFSB", xfs1, yfs1, 0., 0, "ONLY"); // BKN
1122   // gMC->Gspos("EFBB", 2, "EFSB", xfs2, yfs1, 0., 0, "ONLY"); // BKN
1123   gMC->Gspos("EFBB", 3, "EFSB", xfs1, yfs2, 0., 0, "ONLY");
1124   gMC->Gspos("EFBB", 4, "EFSB", xfs2, yfs2, 0., 0, "ONLY");
1125   gMC->Gspos("EFBB", 5, "EFSB", xfs1, yfs3, 0., 0, "ONLY");
1126   gMC->Gspos("EFBB", 6, "EFSB", xfs2, yfs3, 0., 0, "ONLY");
1127
1128
1129 }
1130  
1131 //_____________________________________________________________________________
1132
1133 void AliPMDv2008::CreatePMD()
1134 {
1135   //
1136   // Create final detector from supermodules
1137   // -- Author : Bedanga and Viyogi June 2003
1138
1139   Float_t   zp;
1140   Int_t jhrot12,jhrot13, irotdm;
1141   Int_t *idtmed = fIdtmed->GetArray()-599;
1142   
1143   //VOLUMES Names : begining with "E" for all PMD volumes, 
1144
1145   // --- DEFINE Iron volumes  for SM A
1146   //   Fe Support 
1147   Float_t dboxFea[3];
1148   dboxFea[0] = fSMLengthax;
1149   dboxFea[1] = fSMLengthay;
1150   dboxFea[2] = fgkThSteel/2.;
1151   
1152   gMC->Gsvolu("EFEA","BOX", idtmed[618], dboxFea, 3);
1153
1154   // --- DEFINE Iron volumes  for SM B
1155   
1156   //   Fe Support 
1157   Float_t dboxFeb[3];
1158   dboxFeb[0] = fSMLengthbx;
1159   dboxFeb[1] = fSMLengthby;
1160   dboxFeb[2] = fgkThSteel/2.;
1161   
1162   gMC->Gsvolu("EFEB","BOX", idtmed[618], dboxFeb, 3);
1163
1164   AliMatrix(irotdm, 90., 0.,  90.,  90., 180., 0.);
1165   AliMatrix(jhrot12, 90., 180., 90., 270., 0., 0.);
1166   AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
1167
1168   // Gaspmd, the dimension of RECTANGULAR mother volume of PMD,
1169   // Four mother volumes EPM1,EPM2 for A-type and 
1170   // volumes EPM3 and EPM4 for B-type. Four to create a hole
1171   // and avoid overlap with beam pipe
1172
1173   Float_t gaspmd[3];
1174   gaspmd[0] = fSMLengthax;
1175   gaspmd[1] = fSMLengthay;
1176   gaspmd[2] = fSMthick;
1177
1178   gMC->Gsvolu("EPM1", "BOX", idtmed[698], gaspmd, 3);
1179   gMC->Gsvolu("EPM2", "BOX", idtmed[698], gaspmd, 3);
1180
1181   //Complete detector for Type A
1182   //Position Super modules type A for both CPV and PMD in EPMD  
1183   Float_t zpsa,zpba,zfea,zcva,zfee; 
1184
1185   // zpsa = - gaspmd[2] + fSMthick/2.;
1186   // -2.5 is given to place PMD at -361.5 
1187   // BM : In future after putting proper electronics
1188   // -2.5 will be replaced by -gaspmd[2]
1189
1190   //TYPE A
1191   //Fee board
1192
1193   // This part is commented for the time being by BKN
1194
1195   zfee=-gaspmd[2] + 1.2;
1196
1197   /*
1198   gMC->Gspos("EFSA", 1, "EPM1", 0., 0., zfee, 0, "ONLY");
1199   gMC->Gspos("EFSA", 2, "EPM2", 0., 0., zfee, jhrot12, "ONLY");
1200   */
1201
1202   //VETO
1203
1204   zcva = zfee + 1.2 + fDthick;
1205
1206   /*
1207   gMC->Gspos("EMVA", 1, "EPM1", 0., 0., zcva, 0, "ONLY");
1208   gMC->Gspos("EMVA", 2, "EPM2", 0., 0., zcva, jhrot12, "ONLY");
1209   */
1210
1211
1212
1213   //Iron support
1214   zfea = zcva + fDthick + fgkThSteel/2.;
1215   gMC->Gspos("EFEA", 1, "EPM1", 0., 0., zfea, 0, "ONLY");
1216   //gMC->Gspos("EFEA", 2, "EPM2", 0., 0., zfea, 0, "ONLY");
1217   //Lead
1218   zpba=zfea+fgkThSteel/2.+ fgkThLead/2.;
1219   gMC->Gspos("ESPA", 1, "EPM1", 0., 0., zpba, 0, "ONLY");
1220   //gMC->Gspos("ESPA", 2, "EPM2", 0., 0., zpba, 0, "ONLY");
1221   //Preshower
1222   zpsa = zpba + fgkThLead/2. + fDthick;
1223   gMC->Gspos("ESMA", 1, "EPM1", 0., 0., zpsa, 0, "ONLY");
1224   //gMC->Gspos("ESMA", 2, "EPM2", 0., 0., zpsa, jhrot12, "ONLY");
1225   //FEE boards
1226   zfee=zpsa + fDthick + 1.2;
1227   gMC->Gspos("EFSA", 3, "EPM1", 0., 0., zfee, 0, "ONLY");
1228   //gMC->Gspos("EFSA", 4, "EPM2", 0., 0., zfee, jhrot12, "ONLY");
1229
1230  
1231   //TYPE - B
1232   gaspmd[0] = fSMLengthbx; 
1233   gaspmd[1] = fSMLengthby; 
1234   gaspmd[2] = fSMthick; 
1235
1236   gMC->Gsvolu("EPM3", "BOX", idtmed[698], gaspmd, 3);
1237   gMC->Gsvolu("EPM4", "BOX", idtmed[698], gaspmd, 3);
1238
1239   //Complete detector for Type B
1240   //Position Super modules type B for both CPV and PMD in EPMD  
1241   Float_t zpsb,zpbb,zfeb,zcvb; 
1242   // zpsb = - gaspmd[2] + fSMthick/2.;
1243   // -2.5 is given to place PMD at -361.5 
1244   // BM: In future after putting proper electronics
1245   // -2.5 will be replaced by -gaspmd[2]
1246
1247  //Fee board
1248
1249   zfee=-gaspmd[2] + 1.2;
1250
1251   /*
1252   gMC->Gspos("EFSB", 5, "EPM3", 0., 0., zfee, 0, "ONLY");
1253   gMC->Gspos("EFSB", 6, "EPM4", 0., 0., zfee, jhrot12, "ONLY");
1254   */
1255
1256   zcvb= zfee + 1.2 + fDthick;
1257
1258   //VETO
1259   /*
1260   gMC->Gspos("EMVB", 3, "EPM3", 0., 0., zcvb, 0, "ONLY");
1261   gMC->Gspos("EMVB", 4, "EPM4", 0., 0., zcvb, jhrot12, "ONLY");
1262   */
1263
1264   //IRON SUPPORT
1265   zfeb= zcvb + fDthick +  fgkThSteel/2.;
1266   //gMC->Gspos("EFEB", 3, "EPM3", 0., 0., zfeb, 0, "ONLY");
1267   gMC->Gspos("EFEB", 4, "EPM4", 0., 0., zfeb, 0, "ONLY");
1268   //LEAD
1269   zpbb= zfeb + fgkThSteel/2.+ fgkThLead/2.;
1270   //gMC->Gspos("ESPB", 3, "EPM3", 0., 0., zpbb, 0, "ONLY");
1271   gMC->Gspos("ESPB", 4, "EPM4", 0., 0., zpbb, 0, "ONLY");
1272   //PRESHOWER
1273   zpsb = zpbb + fgkThLead/2.+ fDthick;
1274   //gMC->Gspos("ESMB", 3, "EPM3", 0., 0., zpsb, 0, "ONLY");
1275   gMC->Gspos("ESMB", 4, "EPM4", 0., 0., zpsb, jhrot12, "ONLY");
1276   //FEE boards
1277   zfee=zpsb + fDthick + 1.2;
1278   //gMC->Gspos("EFSB", 7, "EPM3", 0., 0., zfee, 0, "ONLY");
1279   gMC->Gspos("EFSB", 8, "EPM4", 0., 0., zfee, jhrot12, "ONLY");
1280
1281
1282   // --- Place the EPMD in ALICE 
1283   //Z-distance of PMD from Interaction Point
1284   zp = fgkZdist;
1285
1286   //X and Y-positions of the PMD planes
1287   Float_t xfinal,yfinal; 
1288   Float_t xsmb,ysmb;
1289   Float_t xsma,ysma;
1290
1291   xfinal = fSMLengthax + 0.48/2 + fSMLengthbx;
1292   yfinal = fSMLengthay + 0.20/2 + fSMLengthby;
1293   
1294
1295   xsma =  xfinal  - fSMLengthax;
1296   ysma =  yfinal  - fSMLengthay;
1297   xsmb =  -xfinal + fSMLengthbx;
1298   ysmb =  yfinal  - fSMLengthby;
1299
1300
1301 //Position Full PMD in ALICE   
1302 //
1303 //   EPM1      EPM3
1304 //
1305 //   EPM4      EPM2
1306 // (rotated   (rotated EPM1)
1307 //  EPM3)
1308 //
1309   gMC->Gspos("EPM1", 1, "ALIC",  xsma,ysma,zp,  0, "ONLY");
1310   gMC->Gspos("EPM2", 1, "ALIC", -xsma,-ysma,zp, 0, "ONLY");
1311   gMC->Gspos("EPM3", 1, "ALIC",  xsmb,ysmb,zp,  0, "ONLY");
1312   gMC->Gspos("EPM4", 1, "ALIC", -xsmb,-ysmb,zp, 0, "ONLY");
1313 }
1314
1315  
1316 //_____________________________________________________________________________
1317 void AliPMDv2008::CreateMaterials()
1318 {
1319   // Create materials for the PMD
1320   //
1321   // ORIGIN    : Y. P. VIYOGI 
1322   //
1323   //  cout << " Inside create materials " << endl;
1324
1325   Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
1326   Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
1327   
1328   // --- Define the various materials for GEANT --- 
1329
1330   AliMaterial(1, "Pb    $", 207.19, 82., 11.35, .56, 18.5);
1331   
1332   // Argon
1333
1334   Float_t dAr   = 0.001782;   // --- Ar density in g/cm3 --- 
1335   Float_t x0Ar = 19.55 / dAr;
1336   AliMaterial(2, "Argon$", 39.95, 18., dAr, x0Ar, 6.5e4);
1337
1338   // --- CO2 --- 
1339
1340   Float_t aCO2[2] = { 12.,16. };
1341   Float_t zCO2[2] = { 6.,8. };
1342   Float_t wCO2[2] = { 1.,2. };
1343   Float_t dCO2    = 0.001977;
1344   AliMixture(3, "CO2  $", aCO2, zCO2, dCO2, -2, wCO2);
1345
1346   AliMaterial(4, "Al   $", 26.98, 13., 2.7, 8.9, 18.5);
1347
1348   // ArCO2
1349
1350   Float_t aArCO2[3] = {39.948,12.0107,15.9994};
1351   Float_t zArCO2[3] = {18.,6.,8.};
1352   Float_t wArCO2[3] = {0.7,0.08,0.22};
1353   Float_t dArCO2    = dAr * 0.7 + dCO2 * 0.3;
1354   AliMixture(5, "ArCO2$", aArCO2, zArCO2, dArCO2, 3, wArCO2);
1355
1356   AliMaterial(6, "Fe   $", 55.85, 26., 7.87, 1.76, 18.5);
1357
1358   // G10
1359   
1360   Float_t aG10[4]={1.,12.011,15.9994,28.086};
1361   Float_t zG10[4]={1.,6.,8.,14.};
1362   Float_t wG10[4]={0.15201,0.10641,0.49444,0.24714};
1363   AliMixture(8,"G10",aG10,zG10,1.7,4,wG10);
1364   
1365   AliMaterial(15, "Cu   $", 63.54, 29., 8.96, 1.43, 15.);
1366
1367   // Steel
1368   Float_t aSteel[4] = { 55.847,51.9961,58.6934,28.0855 };
1369   Float_t zSteel[4] = { 26.,24.,28.,14. };
1370   Float_t wSteel[4] = { .715,.18,.1,.005 };
1371   Float_t dSteel    = 7.88;
1372   AliMixture(19, "STAINLESS STEEL$", aSteel, zSteel, dSteel, 4, wSteel); 
1373
1374   //Air
1375
1376   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1377   Float_t zAir[4]={6.,7.,8.,18.};
1378   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1379   Float_t dAir1 = 1.20479E-10;
1380   Float_t dAir = 1.20479E-3;
1381   AliMixture(98, "Vacum$", aAir,  zAir, dAir1, 4, wAir);
1382   AliMixture(99, "Air  $", aAir,  zAir, dAir , 4, wAir);
1383
1384   // Define tracking media 
1385   AliMedium(1,  "Pb conv.$", 1,  0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
1386   AliMedium(4,  "Al      $", 4,  0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
1387   AliMedium(5,  "ArCO2   $", 5,  1, 0, isxfld, sxmgmx, .1, .1, .10, .1);
1388   AliMedium(6,  "Fe      $", 6,  0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
1389   AliMedium(8,  "G10plate$", 8,  0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
1390   AliMedium(15, "Cu      $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
1391   AliMedium(19, "S  steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
1392   AliMedium(98, "Vacuum  $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
1393   AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
1394   
1395   AliDebug(1,"Outside create materials");
1396
1397 }
1398
1399 //_____________________________________________________________________________
1400 void AliPMDv2008::Init()
1401 {
1402   //
1403   // Initialises PMD detector after it has been built
1404   //
1405
1406   //
1407   AliDebug(2,"Inside Init");
1408   AliDebug(2,"PMD simulation package (v1) initialised");
1409   AliDebug(2,"parameters of pmd");
1410   AliDebug(2,Form("%10.2f %10.2f %10.2f %10.2f\n",
1411                   fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist));
1412   Int_t *idtmed = fIdtmed->GetArray()-599;
1413   fMedSens=idtmed[605-1];
1414   // --- Generate explicitly delta rays in the iron, aluminium and lead --- 
1415   // Gstpar removed from here and all energy cut-offs moved to galice.cuts
1416   // Visualization of volumes
1417   gGeoManager->SetVolumeAttribute("ECAR", "SEEN", 0);
1418   gGeoManager->SetVolumeAttribute("ECCU", "SEEN", 0);
1419   gGeoManager->SetVolumeAttribute("ECCU", "COLO", 4);
1420   gGeoManager->SetVolumeAttribute("EST1", "SEEN", 0);
1421   gGeoManager->SetVolumeAttribute("EST2", "SEEN", 0);
1422   gGeoManager->SetVolumeAttribute("EHC1", "SEEN", 0);  
1423   gGeoManager->SetVolumeAttribute("EHC2", "SEEN", 0);
1424   gGeoManager->SetVolumeAttribute("EPCA", "SEEN", 0);
1425   gGeoManager->SetVolumeAttribute("EBKA", "SEEN", 0);
1426   gGeoManager->SetVolumeAttribute("ECGA", "SEEN", 0);
1427   gGeoManager->SetVolumeAttribute("ECVA", "SEEN", 0);
1428   gGeoManager->SetVolumeAttribute("EDGA", "SEEN", 0);
1429   gGeoManager->SetVolumeAttribute("EDVA", "SEEN", 0);
1430   gGeoManager->SetVolumeAttribute("ESSA", "SEEN", 0);
1431   gGeoManager->SetVolumeAttribute("ESVA", "SEEN", 0);
1432   gGeoManager->SetVolumeAttribute("EUM1", "SEEN", 0);
1433   gGeoManager->SetVolumeAttribute("EUV1", "SEEN", 0);
1434   gGeoManager->SetVolumeAttribute("EBPA", "SEEN", 0);
1435   gGeoManager->SetVolumeAttribute("EPCB", "SEEN", 0);
1436   gGeoManager->SetVolumeAttribute("EBKB", "SEEN", 0);
1437   gGeoManager->SetVolumeAttribute("ECGB", "SEEN", 0);
1438   gGeoManager->SetVolumeAttribute("ECVB", "SEEN", 0);
1439   gGeoManager->SetVolumeAttribute("EDGB", "SEEN", 0);
1440   gGeoManager->SetVolumeAttribute("EDVB", "SEEN", 0);
1441   gGeoManager->SetVolumeAttribute("ESSB", "SEEN", 0);
1442   gGeoManager->SetVolumeAttribute("ESVB", "SEEN", 0);
1443   gGeoManager->SetVolumeAttribute("EUM2", "SEEN", 0);
1444   gGeoManager->SetVolumeAttribute("EUV2", "SEEN", 0);
1445   gGeoManager->SetVolumeAttribute("EBPB", "SEEN", 0);
1446   gGeoManager->SetVolumeAttribute("EPB1", "SEEN", 0);
1447   gGeoManager->SetVolumeAttribute("EPB2", "SEEN", 0);
1448   gGeoManager->SetVolumeAttribute("ESMA", "SEEN", 0);
1449   gGeoManager->SetVolumeAttribute("EMVA", "SEEN", 0);
1450   gGeoManager->SetVolumeAttribute("ESMB", "SEEN", 0);
1451   gGeoManager->SetVolumeAttribute("EMVB", "SEEN", 0);
1452   gGeoManager->SetVolumeAttribute("ESPA", "SEEN", 0);
1453   gGeoManager->SetVolumeAttribute("ESPB", "SEEN", 0);
1454   gGeoManager->SetVolumeAttribute("EFEE", "SEEN", 0);
1455   gGeoManager->SetVolumeAttribute("EFEE", "COLO", 4);
1456   gGeoManager->SetVolumeAttribute("EFBA", "SEEN", 0);
1457   gGeoManager->SetVolumeAttribute("EFBB", "SEEN", 0);
1458   gGeoManager->SetVolumeAttribute("EFSA", "SEEN", 0);
1459   gGeoManager->SetVolumeAttribute("EFSB", "SEEN", 0);
1460   gGeoManager->SetVolumeAttribute("EFEA", "SEEN", 0);
1461   gGeoManager->SetVolumeAttribute("EFEB", "SEEN", 0);
1462   gGeoManager->SetVolumeAttribute("EPM1", "SEEN", 1);
1463   gGeoManager->SetVolumeAttribute("EPM2", "SEEN", 1);
1464   gGeoManager->SetVolumeAttribute("EPM3", "SEEN", 1);
1465   gGeoManager->SetVolumeAttribute("EPM4", "SEEN", 1);
1466 }
1467
1468 //_____________________________________________________________________________
1469 void AliPMDv2008::StepManager()
1470 {
1471   //
1472   // Called at each step in the PMD
1473   //
1474
1475   Int_t   copy;
1476   Float_t hits[5], destep;
1477   Float_t center[3] = {0,0,0};
1478   Int_t   vol[6];
1479   
1480   if(gMC->CurrentMedium() == fMedSens && (destep = gMC->Edep())) {
1481   
1482     gMC->CurrentVolID(copy);
1483     vol[0] = copy;
1484
1485     gMC->CurrentVolOffID(1,copy);
1486     vol[1] = copy;
1487
1488     gMC->CurrentVolOffID(2,copy);
1489     vol[2] = copy;
1490
1491     gMC->CurrentVolOffID(3,copy);
1492     vol[3] = copy;
1493
1494     gMC->CurrentVolOffID(4,copy);
1495     vol[4] = copy;
1496
1497     gMC->CurrentVolOffID(5,copy);
1498     vol[5] = copy;
1499
1500
1501     gMC->Gdtom(center,hits,1);
1502     hits[3] = destep*1e9; //Number in eV
1503
1504     // this is for pile-up events
1505     hits[4] = gMC->TrackTime();
1506
1507     AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
1508
1509   }
1510 }
1511
1512   
1513 //------------------------------------------------------------------------
1514 // Get parameters
1515
1516 void AliPMDv2008::GetParameters()
1517 {
1518   // This gives all the parameters of the detector
1519   // such as Length of Supermodules, type A, type B,
1520   // thickness of the Supermodule
1521   //
1522   
1523   fSMLengthax = 32.7434;
1524   //The total length in X is due to the following components
1525   // Factor 3 is because of 3 module length in X for this type
1526   // fgkNcolUM1*fgkCellRadius (48 x 0.25): Total span of each module in X
1527   // fgkCellRadius/2. : There is offset of 1/2 cell
1528   // 0.05+0.05 : Insulation gaps etc
1529   // fgkSSBoundary (0.3) : Boundary frame
1530   // double XA = 3.0*((fgkCellRadius/fgkSqroot3by2*fgkNcolUM1)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + (2.0*0.075);
1531
1532   fSMLengthbx = 42.5886;
1533   //The total length in X is due to the following components
1534   // Factor 2 is because of 2 module length in X for this type
1535   // fgkNcolUM2*fgkCellRadius (96 x 0.25): Total span of each module in X
1536   // fgkCellRadius/2. : There is offset of 1/2 cell
1537   // 0.05+0.05 : Insulation gaps etc
1538   // fgkSSBoundary (0.3) : Boundary frame
1539   //double XB = 2.0*((fgkCellRadius/fgkSqroot3by2*fgkNcolUM2)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + 0.075; 
1540
1541
1542
1543   fSMLengthay = 49.1;
1544   //The total length in Y is due to the following components
1545   // Factor 2 is because of 2 module length in Y for this type
1546   // fgkCellRadius/fgkSqroot3by2)*fgkNrowUM1 (0.25/sqrt3/2 * 96): Total span of each module in Y
1547   //  of strips
1548   // 0.05+0.05 : Insulation gaps etc
1549   // fgkSSBoundary (0.3) : Boundary frame
1550   // double  YA = 2.0*(fgkNrowUM1*fgkCellRadius+fgkCellRadius/2.+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) +  0.05;
1551
1552   fSMLengthby =  37.675;
1553   //The total length in Y is due to the following components
1554   // Factor 3 is because of 3 module length in Y for this type
1555   // fgkCellRadius/fgkSqroot3by2)*fgkNrowUM2 (0.25/sqrt3/2 * 48): Total span of each module in Y
1556   //  of strips
1557   // 0.05+0.05 : Insulation gaps etc
1558   // fgkSSBoundary (0.3) : Boundary frame
1559     //double YB = 3.0*((fgkNrowUM2*fgkCellRadius + fgkCellRadius/2.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + (2.0*0.05);
1560
1561
1562   //Thickness of a pre/veto plane 
1563   fDthick     = fgkThSS/2. +0.15;
1564
1565   //Thickness of the PMD ; 2.4 added for FEE boards 
1566     fSMthick    = 2.0*(fgkThSS/2. +0.15)
1567                 +fgkThSteel/2.+fgkThLead/2.0 + 2.4;
1568
1569
1570   
1571 }
1572 // ---------------------------------------------------------------
1573 void AliPMDv2008::AddAlignableVolumes() const
1574 {
1575   //
1576   // Create entries for alignable volumes associating the symbolic volume
1577   // name with the corresponding volume path. Needs to be syncronized with
1578   // eventual changes in the geometry.
1579   // 
1580   SetSectorAlignable();
1581
1582 }
1583 // ----------------------------------------------------------------
1584 void AliPMDv2008::SetSectorAlignable() const
1585 {
1586   // 
1587
1588   TString vpsector = "ALIC_1/EPM";
1589   TString vpappend = "_1";
1590
1591   TString snsector="PMD/Sector";
1592
1593   TString volpath, symname;
1594   
1595   for(Int_t cnt=1; cnt<=4; cnt++){
1596     volpath = vpsector;
1597     volpath += cnt;
1598     volpath += vpappend;
1599     symname = snsector;
1600     symname += cnt;
1601     if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
1602       {
1603         AliFatal("Unable to set alignable entry!");
1604       }
1605   }
1606 }
1607 // ------------------------------------------------------------------