LCOV - code coverage report
Current view: top level - PMD/PMDsim - AliPMDv1.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 858 867 99.0 %
Date: 2016-06-14 17:26:59 Functions: 14 17 82.4 %

          Line data    Source code
       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$ */
      16             : 
      17             : //
      18             : ///////////////////////////////////////////////////////////////////////////////
      19             : //                                                                           //
      20             : //  Photon Multiplicity Detector Version 1                                   //
      21             : //  Bedanga Mohanty : February 14th 2006
      22             : //---------------------------------------------------     
      23             : //  ALICE PMD FEE BOARDS IMPLEMENTATION
      24             : //  Dt: 25th February 2006 
      25             : //  M.M. Mondal, S.K. Prasad and P.K. Netrakanti
      26             : //---------------------------------------------------
      27             : //   Create final detector from Unit Modules
      28             : //   Author : Bedanga and Viyogi June 2003
      29             : //---------------------------------------------------
      30             : // Modified by
      31             : // Dr. Y.P. Viyogi and Ranbir Singh
      32             : // Dt: 2nd February 2009
      33             : //
      34             : //Begin_Html
      35             : /*
      36             : <img src="picts/AliPMDv1Class.gif">
      37             : */
      38             : //End_Html
      39             : //                                                                           //
      40             : /////////////////////////////////////////////////////////////////////////////
      41             : ////
      42             : 
      43             : #include <Riostream.h>
      44             : #include <TGeoManager.h>
      45             : #include <TGeoGlobalMagField.h>
      46             : #include <TVirtualMC.h>
      47             : 
      48             : #include "AliConst.h" 
      49             : #include "AliLog.h"
      50             : #include "AliMC.h"
      51             : #include "AliMagF.h" 
      52             : #include "AliPMDv1.h"
      53             : #include "AliRun.h"
      54             : #include "AliTrackReference.h"
      55             : 
      56             : const Int_t   AliPMDv1::fgkNcolUM1    = 48;     // Number of cols in UM, type 1
      57             : const Int_t   AliPMDv1::fgkNcolUM2    = 96;     // Number of cols in UM, type 2
      58             : const Int_t   AliPMDv1::fgkNrowUM1    = 96;     // Number of rows in UM, type 1
      59             : const Int_t   AliPMDv1::fgkNrowUM2    = 48;     // Number of rows in UM, type 2
      60             : const Float_t AliPMDv1::fgkCellRadius = 0.25;     // Radius of a hexagonal cell
      61             : const Float_t AliPMDv1::fgkCellWall   = 0.02;     // Thickness of cell Wall
      62             : const Float_t AliPMDv1::fgkCellDepth  = 0.50;     // Gas thickness
      63             : const Float_t AliPMDv1::fgkThPCB      = 0.16;     // Thickness of PCB 
      64             : const Float_t AliPMDv1::fgkThLead     = 1.5;      // Thickness of Pb
      65             : const Float_t AliPMDv1::fgkThSteel    = 0.5;      // Thickness of Steel
      66             : const Float_t AliPMDv1::fgkGap        = 0.025;    // Air Gap
      67             : const Float_t AliPMDv1::fgkZdist      = 361.5;    // z-position of the detector
      68             : const Float_t AliPMDv1::fgkSqroot3    = 1.7320508;// Square Root of 3
      69             : const Float_t AliPMDv1::fgkSqroot3by2 = 0.8660254;// Square Root of 3 by 2
      70             : const Float_t AliPMDv1::fgkSSBoundary = 0.3;
      71             : const Float_t AliPMDv1::fgkThSS       = 1.23;     // Old thickness of SS frame was 1.03
      72             : const Float_t AliPMDv1::fgkThTopG10   = 0.33;
      73             : const Float_t AliPMDv1::fgkThBotG10   = 0.4;
      74             : 
      75             : 
      76          12 : ClassImp(AliPMDv1)
      77             :  
      78             : //_____________________________________________________________________________
      79          12 : AliPMDv1::AliPMDv1():
      80          12 :   fSMthick(0.),
      81          12 :   fSMthickpmd(0.),
      82          12 :   fDthick(0.),
      83          12 :   fSMLengthax(0.),
      84          12 :   fSMLengthay(0.),
      85          12 :   fSMLengthbx(0.),
      86          12 :   fSMLengthby(0.),
      87          12 :   fMedSens(0)
      88          60 : {
      89             :   
      90             :   // Default constructor 
      91             :   
      92          96 :   for (Int_t i = 0; i < 3; i++)
      93             :     {
      94          36 :       fDboxmm1[i]  = 0.;
      95          36 :       fDboxmm12[i] = 0.;
      96          36 :       fDboxmm2[i]  = 0.;
      97          36 :       fDboxmm22[i] = 0.;
      98             :     }
      99        1176 :   for (Int_t i = 0; i < 48; i++)
     100             :     {
     101         576 :       fModStatus[i] = 1;
     102             :     }
     103             : 
     104          24 : }
     105             :  
     106             : //_____________________________________________________________________________
     107             : AliPMDv1::AliPMDv1(const char *name, const char *title):
     108           1 :   AliPMD(name,title),
     109           1 :   fSMthick(0.),
     110           1 :   fSMthickpmd(0.),
     111           1 :   fDthick(0.),
     112           1 :   fSMLengthax(0.),
     113           1 :   fSMLengthay(0.),
     114           1 :   fSMLengthbx(0.),
     115           1 :   fSMLengthby(0.),
     116           1 :   fMedSens(0)
     117           5 : {
     118             :   
     119             :   // Standard constructor
     120             :   
     121           8 :   for (Int_t i = 0; i < 3; i++)
     122             :     {
     123           3 :       fDboxmm1[i]  = 0.;
     124           3 :       fDboxmm12[i] = 0.;
     125           3 :       fDboxmm2[i]  = 0.;
     126           3 :       fDboxmm22[i] = 0.;
     127             :     }
     128          98 :   for (Int_t i = 0; i < 48; i++)
     129             :     {
     130          48 :       fModStatus[i] = 1;
     131             :     }
     132           2 : }
     133             : 
     134             : 
     135             : 
     136             : 
     137             : //_____________________________________________________________________________
     138             : void AliPMDv1::CreateGeometry()
     139             : {
     140             :   // Create geometry for Photon Multiplicity Detector
     141             : 
     142           2 :   GetParameters();
     143           1 :   CreateSupermodule();
     144           1 :   CreatePMD();
     145           1 : }
     146             : 
     147             : //_____________________________________________________________________________
     148             : void AliPMDv1::CreateSupermodule()
     149             : {
     150             :   // 
     151             :   // Creates the geometry of the cells of PMD, places them in  modules 
     152             :   // which are rectangular objects.
     153             :   // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is 
     154             :   // placed inside another hexagonal cell made of Cu (ECCU) with larger 
     155             :   // radius, compared to ECAR. The difference in radius gives the dimension 
     156             :   // of half width of each cell wall.
     157             :   // These cells are placed in a rectangular strip which are of 2 types 
     158             :   // EST1 and EST2. 
     159             :   // Two types of honeycomb EHC1 & EHC2 are made using strips EST1 & EST2. 
     160             :   // 4 types of unit modules are made EUM1 & EUM2 for PRESHOWER Plane and
     161             :   // EUV1 & EUV2 for VETO Plane which contains  strips placed repeatedly 
     162             :   //  
     163             :   // These unit moules are then placed inside EPM1, EPM2, EPM3 and EPM4 along
     164             :   // with lead convertor ELDA & ELDB and Iron Supports EFE1, EFE2, EFE3 and EFE4
     165             :   //  They have 6 unit moudles inside them in each plane. Therefore, total of 48
     166             :   // unit modules in both the planes (PRESHOWER Plane & VETO Plane). The numbering
     167             :   // of unit modules is from 0 to 47.
     168             :   //
     169             :   // Steel channels (ECHA & ECHB) are also placed which are used to place the unit modules
     170             :   // 
     171             :   // In order to account for the extra material around and on the detector, Girders (EGDR),
     172             :   // girder's Carriage (EXGD), eight Aluminium boxes (ESV1,2,3,4 & EVV1,2,3,4) along with
     173             :   // LVDBs (ELVD), cables (ECB1,2,3,4), and ELMBs (ELMB) are being placed in approximations.
     174             :   // 
     175             :   //  Four FR4 sheets (ECC1,2,3,4) are placed parallel to the PMD on both sides, which perform 
     176             :   // as cooling encloser
     177             :  
     178             :   // NOTE:-  VOLUME Names : begining with "E" for all PMD volumes 
     179             :   
     180             :   Int_t i,j;
     181             :   Int_t number;
     182           2 :   Int_t ihrotm,irotdm;
     183             :   Float_t xb, yb, zb;
     184             : 
     185           1 :   Int_t *idtmed = fIdtmed->GetArray()-599;
     186             :  
     187           1 :   AliMatrix(ihrotm, 90., 30.,   90.,  120., 0., 0.);
     188           1 :   AliMatrix(irotdm, 90., 180.,  90.,  270., 180., 0.);
     189             :  
     190             :   //******************************************************//
     191             :   //                    STEP - I                          //
     192             :   //******************************************************//
     193             :   // First create the sensitive medium of a hexagon cell (ECAR)
     194             :   // Inner hexagon filled with gas (Ar+CO2)
     195             :   // Integer assigned to Ar+CO2 medium is 604
     196             : 
     197           1 :   Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
     198           1 :   hexd2[4] = -fgkCellDepth/2.;
     199           1 :   hexd2[7] =  fgkCellDepth/2.;
     200           1 :   hexd2[6] =  fgkCellRadius - fgkCellWall;
     201           1 :   hexd2[9] =  fgkCellRadius - fgkCellWall;
     202             :   
     203           1 :   TVirtualMC::GetMC()->Gsvolu("ECAR", "PGON", idtmed[604], hexd2,10);
     204             : 
     205             :   //******************************************************//
     206             :   //                    STEP - II                         //
     207             :   //******************************************************//
     208             :   // Place the sensitive medium inside a hexagon copper cell (ECCU)
     209             :   // Outer hexagon made of Copper
     210             :   // Integer assigned to Cu medium is 614
     211             :   
     212           1 :   Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
     213           1 :   hexd1[4] = -fgkCellDepth/2.;
     214           1 :   hexd1[7] =  fgkCellDepth/2.;
     215           1 :   hexd1[6] =  fgkCellRadius;
     216           1 :   hexd1[9] =  fgkCellRadius;
     217             :   
     218           1 :   TVirtualMC::GetMC()->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
     219             : 
     220             :   // Place  inner hex (sensitive volume) inside outer hex (copper)
     221             :   
     222           1 :   TVirtualMC::GetMC()->Gspos("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY");
     223             : 
     224             :   //******************************************************//
     225             :   //                    STEP - III                        //
     226             :   //******************************************************//
     227             :   // Now create Two types of Rectangular strips (EST1, EST2) 
     228             :   // of 1 column and 96 or 48 cells length
     229             : 
     230             :   // volume for first strip EST1 made of AIR 
     231             :   // Integer assigned to Air medium is 698
     232             :   // strip type-1 is of 1 column and 96 rows i.e. of 96 cells length 
     233             : 
     234           1 :   Float_t dbox1[3];
     235           1 :   dbox1[0] = fgkCellRadius/fgkSqroot3by2;
     236           1 :   dbox1[1] = fgkNrowUM1*fgkCellRadius;
     237           1 :   dbox1[2] = fgkCellDepth/2.;
     238             :   
     239           1 :   TVirtualMC::GetMC()->Gsvolu("EST1","BOX", idtmed[698], dbox1, 3);
     240             : 
     241             : 
     242             :   // volume for second strip EST2 
     243             :   // strip type-2 is of 1 column and 48 rows i.e. of 48 cells length 
     244             : 
     245           1 :   Float_t dbox2[3];
     246           1 :   dbox2[1] = fgkNrowUM2*fgkCellRadius;
     247           1 :   dbox2[0] = dbox1[0];
     248           1 :   dbox2[2] = dbox1[2];
     249             : 
     250           1 :   TVirtualMC::GetMC()->Gsvolu("EST2","BOX", idtmed[698], dbox2, 3);
     251             : 
     252             :   // Place hexagonal cells ECCU placed inside EST1 
     253             : 
     254             :   xb = 0.; 
     255             :   zb = 0.;
     256           1 :   yb = (dbox1[1]) - fgkCellRadius; 
     257         194 :   for (i = 1; i <= fgkNrowUM1; ++i) 
     258             :     {
     259             :       number = i;
     260          96 :       TVirtualMC::GetMC()->Gspos("ECCU", number, "EST1", xb,yb,zb, 0, "ONLY");
     261          96 :       yb -= (fgkCellRadius*2.);
     262             :     }
     263             : 
     264             :   // Place hexagonal cells ECCU placed inside EST2 
     265             :   xb = 0.; 
     266             :   zb = 0.;
     267           1 :   yb = (dbox2[1]) - fgkCellRadius; 
     268          98 :   for (i = 1; i <= fgkNrowUM2; ++i) 
     269             :     {
     270             :       number = i;
     271          48 :       TVirtualMC::GetMC()->Gspos("ECCU", number, "EST2", xb,yb,zb, 0, "ONLY");
     272          48 :       yb -= (fgkCellRadius*2.);
     273             :     }
     274             :   
     275             :   
     276             :   //******************************************************//
     277             :   //                    STEP - IV                         //
     278             :   //******************************************************//
     279             :   // Create EHC1 : The honey combs for a unit module type-1
     280             :   //-------------------------EHC1 Start-------------------//
     281             :   
     282             :   // First step is to create a honey comb unit module.
     283             :   // This is named as EHC1 and  is a volume of Air 
     284             :   // we will lay the EST1 strips of honey comb cells inside it.
     285             :   
     286             :   // Dimensions of EHC1
     287             :   // X-dimension = (dbox1[0]*fgkNcolUM1)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.)+ 0.15+0.05+0.05; 
     288             :   // Y-dimension = Number of rows * cell radius/sqrt3by2 + 0.15+0.05+0.05;  
     289             :   // 0.15cm is the extension in honeycomb on both side of X and Y, 0.05 for air gap and 0.05
     290             :   // for G10 boundary around, which are now merged in the dimensions of EHC1 
     291             :   // Z-dimension = cell depth/2
     292             : 
     293             :   Float_t ehcExt = 0.15;
     294             :   Float_t ehcAround = 0.05 + 0.05;;
     295             : 
     296           1 :   Float_t dbox3[3];
     297           2 :   dbox3[0] = (dbox1[0]*fgkNcolUM1)-
     298           1 :     (fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.) + ehcExt + ehcAround;  
     299           1 :   dbox3[1] = dbox1[1]+fgkCellRadius/2. + ehcExt + ehcAround; 
     300           1 :   dbox3[2] = fgkCellDepth/2.;
     301             :   
     302             :   //Create a BOX, Material AIR
     303           1 :   TVirtualMC::GetMC()->Gsvolu("EHC1","BOX", idtmed[698], dbox3, 3);
     304             :   // Place rectangular strips EST1 inside EHC1 unit module
     305           1 :   xb = dbox3[0]-dbox1[0];  
     306             :   
     307          98 :   for (j = 1; j <= fgkNcolUM1; ++j)  
     308             :     {
     309          48 :       if(j%2 == 0)
     310             :         {
     311             :           yb = -fgkCellRadius/2.0;
     312          24 :         }
     313             :       else
     314             :         {
     315             :           yb = fgkCellRadius/2.0;
     316             :         }
     317             :       number = j;
     318          48 :       TVirtualMC::GetMC()->Gspos("EST1",number, "EHC1", xb - 0.25, yb , 0. , 0, "MANY");
     319             :       
     320             :       //The strips are being placed from top towards bottom of the module
     321             :       //This is because the first cell in a module in hardware is the top
     322             :       //left corner cell
     323             :       
     324          48 :       xb = (dbox3[0]-dbox1[0])-j*fgkCellRadius*fgkSqroot3;
     325             :       
     326             :     }
     327             :   
     328             :   //--------------------EHC1 done----------------------------------------//
     329             :   
     330             :   
     331             :   
     332             :   //--------------------------------EHC2 Start---------------------------//
     333             :   // Create EHC2 : The honey combs for a unit module type-2 
     334             :   // First step is to create a honey comb unit module.
     335             :   // This is named as EHC2, we will lay the EST2 strips of
     336             :   // honey comb cells inside it.
     337             :   
     338             :   // Dimensions of EHC2
     339             :   // X-dimension = (dbox2[0]*fgkNcolUM2)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.)+ 0.15+0.05+0.05;
     340             :   // Y-dimension = Number of rows * cell radius/sqrt3by2 + 0.15+0.05+0.05;
     341             :   // 0.15cm is the extension in honeycomb on both side of X and Y, 0.05 for air gap and 0.05
     342             :   // for G10 boundary around, which are now merged in the dimensions of EHC2 
     343             :   // Z-dimension = cell depth/2
     344             :   
     345             :   
     346           1 :   Float_t dbox4[3];
     347             :   
     348           2 :   dbox4[0] =(dbox2[0]*fgkNcolUM2)-
     349           1 :     (fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.) + ehcExt + ehcAround; 
     350           1 :   dbox4[1] = dbox2[1] + fgkCellRadius/2. + ehcExt + ehcAround;
     351           1 :   dbox4[2] = dbox3[2];
     352             :   
     353             :   //Create a BOX of AIR
     354           1 :   TVirtualMC::GetMC()->Gsvolu("EHC2","BOX", idtmed[698], dbox4, 3);
     355             :   
     356             :   // Place rectangular strips EST2 inside EHC2 unit module
     357           1 :   xb = dbox4[0]-dbox2[0]; 
     358             :   
     359         194 :   for (j = 1; j <= fgkNcolUM2; ++j)     
     360             :     {
     361          96 :       if(j%2 == 0)
     362             :         {
     363             :           yb = -fgkCellRadius/2.0;
     364          48 :         }
     365             :       else
     366             :         {
     367             :           yb = +fgkCellRadius/2.0;
     368             :         }
     369             :       number = j;
     370          96 :       TVirtualMC::GetMC()->Gspos("EST2",number, "EHC2", xb - 0.25, yb , 0. ,0, "MANY");
     371          96 :       xb = (dbox4[0]-dbox2[0])-j*fgkCellRadius*fgkSqroot3;
     372             :     }
     373             :   
     374             :  
     375             :   //----------------------------EHC2 done-------------------------------//
     376             : 
     377             :   //====================================================================//
     378             :  
     379             :   // Now the job is to assmeble an Unit module
     380             :   // It will have the following components
     381             :   // (a) Base plate of G10 of 0.2cm 
     382             :   // (b) Air gap  of 0.08cm   
     383             :   // (c) Bottom PCB of 0.16cm G10
     384             :   // (d) Honey comb 0f 0.5cm
     385             :   // (e) Top PCB  of 0.16cm G10 
     386             :   // (f) Back Plane of 0.1cm G10
     387             :   // (g) Then all around then we have an air gap of 0.05cm
     388             :   // (h) Then all around 0.05cm thick G10 insulation
     389             :   // (i) Then all around Stainless Steel boundary channel 0.3 cm thick
     390             : 
     391             :   // In order to reduce the number of volumes and simplify the geometry
     392             :   // following steps are performed:
     393             :   // (I)   Base Plate(0.2cm), Air gap(0.04cm) and Bottom PCB(0.16cm) 
     394             :   //       are taken together as a G10 Plate EDGA (0.4cm)
     395             :   // (II) Back Plane(0.1cm), Air Gap(0.04cm) and Top PCB(0.16cm) and extra 
     396             :   //      clearance 0.03cm are taken together as G10 Plate EEGA(0.33cm)
     397             :   // (III) The all around Air gap(0.05cm) and G10 boundary(0.05cm) are already 
     398             :   //       merged in the dimension of EHC1, EHC2, EDGA and EEGA. Therefore, no 
     399             :   //       separate volumes for all around materials
     400             :   
     401             :   //Let us first create them one by one
     402             :   //--------------------------------------------------------------------//
     403             : 
     404             :   // ---------------- Lets do it first for UM Long Type -----//
     405             :   // 4mm G10 Box : Bottom PCB + Air Gap + Base Plate
     406             :   //================================================
     407             :   // Make a 4mm thick G10 Box for Unit module Long Type 
     408             :   // X-dimension is EHC1 - ehcExt
     409             :   // Y-dimension is EHC1 - ehcExt
     410             :   // EHC1 was extended 0.15cm(ehcExt) on both sides
     411             :   // Z-dimension 0.4/2 = 0.2 cm
     412             :   // Integer assigned to G10 medium is 607
     413             : 
     414           1 :   Float_t dboxCGA[3];
     415           1 :   dboxCGA[0]  = dbox3[0] - ehcExt; 
     416           1 :   dboxCGA[1]  = dbox3[1] - ehcExt; 
     417           1 :   dboxCGA[2]  = fgkThBotG10/2.;
     418             : 
     419             :   //Create a G10 BOX 
     420           1 :   TVirtualMC::GetMC()->Gsvolu("EDGA","BOX", idtmed[607], dboxCGA, 3);
     421             : 
     422             :   //-------------------------------------------------//
     423             :   // 3.3mm G10 Box : Top PCB + Air GAp + Back Plane
     424             :   //================================================
     425             :   // Make a 3.3mm thick G10 Box for Unit module Long Type 
     426             :   // X-dimension is EHC1 - ehcExt
     427             :   // Y-dimension is EHC1 - ehcExt
     428             :   // EHC1 was extended 0.15cm(ehcExt) on both sides
     429             :   // Z-dimension 0.33/2 = 0.165 cm
     430             : 
     431           1 :   Float_t dboxEEGA[3];
     432           1 :   dboxEEGA[0]  = dboxCGA[0]; 
     433           1 :   dboxEEGA[1]  = dboxCGA[1]; 
     434           1 :   dboxEEGA[2]  = fgkThTopG10/2.;
     435             : 
     436             :   //Create a G10 BOX 
     437           1 :   TVirtualMC::GetMC()->Gsvolu("EEGA","BOX", idtmed[607], dboxEEGA, 3);
     438             : 
     439             : 
     440             :   //----------------------------------------------------------//
     441             :   //Stainless Steel Bounadry : EUM1 & EUV1
     442             :   //
     443             :   // Make a 3.63cm thick Stainless Steel boundary for Unit module Long Type
     444             :   // 3.63cm equivalent to EDGA(0.4cm)+EHC1(0.5cm)+EEGA(0.33cm)+FEE Board(2.4cm)
     445             :   // X-dimension is EEGA + fgkSSBoundary
     446             :   // Y-dimension is EEGA + fgkSSBoundary
     447             :   // Z-dimension 1.23/2 + 2.4/2.
     448             :   // FEE Boards are 2.4cm thick
     449             :   // Integer assigned to Stainless Steel medium is 618
     450             :   //------------------------------------------------------//
     451             :   // A Stainless Steel Boundary Channel to house the unit module
     452             :   // along with the FEE Boards
     453             : 
     454           1 :   Float_t dboxSS1[3];
     455           1 :   dboxSS1[0]           = dboxCGA[0]+fgkSSBoundary; 
     456           1 :   dboxSS1[1]           = dboxCGA[1]+fgkSSBoundary;       
     457           1 :   dboxSS1[2]           = fgkThSS/2.+ 2.4/2.;
     458             :   
     459             :   //FOR PRESHOWER
     460             :   //Stainless Steel boundary - Material Stainless Steel
     461           1 :   TVirtualMC::GetMC()->Gsvolu("EUM1","BOX", idtmed[618], dboxSS1, 3);
     462             :   
     463             :   //FOR VETO
     464             :   //Stainless Steel boundary - Material Stainless Steel
     465           1 :   TVirtualMC::GetMC()->Gsvolu("EUV1","BOX", idtmed[618], dboxSS1, 3);
     466             :   
     467             :   //--------------------------------------------------------------------//
     468             : 
     469             : 
     470             :   
     471             : 
     472             :   // ============ PMD FEE BOARDS IMPLEMENTATION ======================//
     473             :   
     474             :   // FEE board
     475             :   // It is FR4 board of length * breadth :: 7cm * 2.4 cm
     476             :   // and thickness 0.2cm
     477             :   // Material medium is same as G10
     478             : 
     479           1 :   Float_t dboxFEE[3];
     480           1 :   dboxFEE[0] = 0.2/2.;  
     481           1 :   dboxFEE[1] = 7.0/2.;
     482           1 :   dboxFEE[2] = 2.4/2.;
     483             : 
     484           1 :   TVirtualMC::GetMC()->Gsvolu("EFEE","BOX", idtmed[607], dboxFEE, 3);
     485             : 
     486             :   // Now to create the Mother volume to accomodate FEE boards
     487             :   // It should have the dimension few mm smaller than the back plane
     488             :   // But, we have taken it as big as EUM1 or EUV1
     489             :   // It is to compensate the Stainless Steel medium of EUM1 or EUV1
     490             : 
     491             :   // Create Mother volume of Air : Long TYPE
     492             : 
     493           1 :   Float_t dboxFEEBPlaneA[3];
     494           1 :   dboxFEEBPlaneA[0]   = dboxSS1[0];  
     495           1 :   dboxFEEBPlaneA[1]   = dboxSS1[1];
     496           1 :   dboxFEEBPlaneA[2]   = 2.4/2.;
     497             :   
     498             :   //Volume of same dimension as EUM1 or EUV1 of Material AIR
     499           1 :   TVirtualMC::GetMC()->Gsvolu("EFBA","BOX", idtmed[698], dboxFEEBPlaneA, 3);
     500             :   
     501             :   //Placing the FEE boards in the Mother volume of AIR
     502             :   
     503             : 
     504             :   Float_t xFee;          // X-position of FEE board
     505             :   Float_t yFee;          // Y-position of FEE board
     506             :   Float_t zFee = 0.0;    // Z-position of FEE board
     507             :   
     508             :   Float_t xA    = 0.5;   //distance from the border to 1st FEE board/Translator
     509             :   Float_t yA    = 4.00;  //distance from the border to 1st FEE board
     510             :   Float_t xSepa = 1.70;  //Distance between two FEE boards in X-side
     511             :   Float_t ySepa = 8.00;  //Distance between two FEE boards in Y-side
     512             :   
     513             :   
     514             :   
     515             :   // FEE Boards EFEE placed inside EFBA
     516             :   
     517           1 :   yFee =  dboxFEEBPlaneA[1] - yA - 0.1 - 0.3;
     518             :   // 0.1cm and 0.3cm are subtracted to shift the FEE Boards on their actual positions
     519             :   // As the positions are changed, because we have taken the dimension of EFBA equal 
     520             :   // to the dimension of EUM1 or EUV1  
     521             :   number = 1;
     522             :   // The loop for six rows of FEE Board
     523          14 :   for (i = 1; i <= 6; ++i)
     524             :     {
     525             :       // First we place the translator board
     526           6 :       xFee = -dboxFEEBPlaneA[0] + xA + 0.1 +0.3;
     527             :       
     528           6 :       TVirtualMC::GetMC()->Gspos("EFEE", number, "EFBA", xFee,yFee,zFee, 0, "ONLY");
     529             :       
     530             :       // The first FEE board is 11mm from the translator board
     531           6 :       xFee   += 1.1;
     532           6 :       number += 1;
     533             :       
     534         156 :       for (j = 1; j <= 12; ++j)
     535             :         {
     536          72 :           TVirtualMC::GetMC()->Gspos("EFEE", number, "EFBA", xFee,yFee,zFee, 0, "ONLY");
     537          72 :           xFee += xSepa;
     538          72 :           number += 1;
     539             :         }
     540           6 :       yFee -= ySepa;
     541             :     }
     542             :   
     543             :   
     544             :   // Now Place EEGA, EDGA, EHC1 and EFBA in EUM1 & EUV1 to complete the unit module
     545             :   
     546             :   
     547             :   //                   FOR PRE SHOWER                //
     548             :   // Placing of all components of UM in AIR BOX EUM1 //
     549             :   
     550             :   //(1)   FIRST PUT the 4mm G10 Box : EDGA
     551           1 :   Float_t zedga = -dboxSS1[2] + fgkThBotG10/2.;
     552           1 :   TVirtualMC::GetMC()->Gspos("EDGA", 1, "EUM1", 0., 0., zedga, 0, "ONLY");
     553             :   
     554             :   //(2)   NEXT PLACING the Honeycomb EHC1
     555           1 :   Float_t zehc1 = zedga + fgkThBotG10/2. + fgkCellDepth/2.;
     556           1 :   TVirtualMC::GetMC()->Gspos("EHC1", 1, "EUM1", 0., 0.,  zehc1, 0, "ONLY");
     557             :   
     558             :   //(3)   NEXT PLACING the 3.3mm G10 Box : EEGA
     559           1 :   Float_t zeega = zehc1 + fgkCellDepth/2. + fgkThTopG10/2.;
     560           1 :   TVirtualMC::GetMC()->Gspos("EEGA", 1, "EUM1", 0., 0., zeega, 0, "ONLY");
     561             :   
     562             :   //(4)   NEXT PLACING the FEE BOARD : EFBA
     563           1 :   Float_t zfeeboardA = zeega + fgkThTopG10/2. +1.2;
     564           1 :   TVirtualMC::GetMC()->Gspos("EFBA", 1, "EUM1", 0., 0., zfeeboardA, 0, "ONLY");
     565             :   
     566             :   //                    FOR VETO                       //
     567             :   //  Placing of all components of UM in AIR BOX EUV1  //
     568             :   
     569             :   //(1)  FIRST PUT the FEE BOARD : EFBA
     570           1 :   zfeeboardA = -dboxSS1[2] + 1.2;
     571           1 :   TVirtualMC::GetMC()->Gspos("EFBA", 1, "EUV1", 0., 0., zfeeboardA, 0, "ONLY");
     572             :   
     573             :   //(2)  FIRST PLACING the 3.3mm G10 Box : EEGA
     574           1 :   zeega = zfeeboardA + 1.2 + fgkThTopG10/2.;
     575           1 :   TVirtualMC::GetMC()->Gspos("EEGA", 1, "EUV1", 0., 0., zeega, 0, "ONLY");
     576             :   
     577             :   //(3)   NEXT PLACING the Honeycomb EHC1
     578           1 :   zehc1 = zeega + fgkThTopG10/2 + fgkCellDepth/2.;
     579           1 :   TVirtualMC::GetMC()->Gspos("EHC1", 1, "EUV1", 0., 0.,  zehc1, 0, "ONLY");
     580             :   
     581             :   //(4)   NEXT PUT THE 4mm G10 Box : EDGA
     582           1 :   zedga = zehc1 + fgkCellDepth/2.+ fgkThBotG10/2.;
     583           1 :   TVirtualMC::GetMC()->Gspos("EDGA", 1, "EUV1", 0., 0., zedga, 0, "ONLY");
     584             :   
     585             : 
     586             :   //===================  LONG TYPE COMPLETED  =========================//
     587             :   //------------ Lets do the same thing for UM Short Type -------------//
     588             :   // 4mm G10 Box : Bottom PCB + Air Gap + Base Plate
     589             :   //================================================
     590             :   // Make a 4mm thick G10 Box for Unit module ShortType
     591             :   // X-dimension is EHC2 - ehcExt
     592             :   // Y-dimension is EHC2 - ehcExt
     593             :   // EHC2 was extended 0.15cm(ehcExt) on both sides
     594             :   // Z-dimension 0.4/2 = 0.2 cm
     595             :   // Integer assigned to G10 medium is 607
     596             :   
     597           1 :   Float_t dboxCGB[3];
     598           1 :   dboxCGB[0]  = dbox4[0] - ehcExt; 
     599           1 :   dboxCGB[1]  = dbox4[1] - ehcExt; 
     600           1 :   dboxCGB[2]  = 0.4/2.;
     601             :   
     602             :   //Create a G10 BOX 
     603           1 :   TVirtualMC::GetMC()->Gsvolu("EDGB","BOX", idtmed[607], dboxCGB, 3);
     604             :   
     605             :   //-------------------------------------------------//
     606             :   // 3.3mm G10 Box : PCB + Air Gap + Back Plane
     607             :   //================================================
     608             :   // Make a 3.3mm thick G10 Box for Unit module Short Type 
     609             :   // X-dimension is EHC2 - ehcExt
     610             :   // Y-dimension is EHC2 - ehcExt
     611             :   // EHC2 was extended 0.15cm(ehcExt) on both sides
     612             :   // Z-dimension 0.33/2 = 0.165 cm
     613             :   
     614           1 :   Float_t dboxEEGB[3];
     615           1 :   dboxEEGB[0]  = dboxCGB[0]; 
     616           1 :   dboxEEGB[1]  = dboxCGB[1]; 
     617           1 :   dboxEEGB[2]  = 0.33/2.;
     618             :   
     619             :   // Create a G10 BOX 
     620           1 :   TVirtualMC::GetMC()->Gsvolu("EEGB","BOX", idtmed[607], dboxEEGB, 3);
     621             :   
     622             :   
     623             :   //Stainless Steel Bounadry : EUM2 & EUV2
     624             :   //==================================
     625             :   // Make a 3.63cm thick Stainless Steel boundary for Unit module Short Type 
     626             :   // 3.63cm equivalent to EDGB(0.4cm)+EHC2(0.5cm)+EEGB(0.33cm)+FEE Board(2.4cm)
     627             :   // X-dimension is EEGB + fgkSSBoundary
     628             :   // Y-dimension is EEGB + fgkSSBoundary
     629             :   // Z-dimension 1.23/2 + 2.4/2.
     630             :   // FEE Boards are 2.4cm thick
     631             :   // Integer assigned to Stainless Steel medium is 618
     632             :   //------------------------------------------------------//
     633             :   // A Stainless Steel Boundary Channel to house the unit module
     634             :   // along with the FEE Boards
     635             :   
     636             :   
     637           1 :   Float_t dboxSS2[3];
     638           1 :   dboxSS2[0]  = dboxCGB[0] + fgkSSBoundary; 
     639           1 :   dboxSS2[1]  = dboxCGB[1] + fgkSSBoundary;       
     640           1 :   dboxSS2[2]  = fgkThSS/2.+ 2.4/2.;
     641             :   
     642             :   //PRESHOWER
     643             :   //Stainless Steel boundary - Material Stainless Steel
     644           1 :   TVirtualMC::GetMC()->Gsvolu("EUM2","BOX", idtmed[618], dboxSS2, 3);
     645             :   
     646             :   //VETO
     647             :   //Stainless Steel boundary - Material Stainless Steel
     648           1 :   TVirtualMC::GetMC()->Gsvolu("EUV2","BOX", idtmed[618], dboxSS2, 3);
     649             :   
     650             :   //----------------------------------------------------------------//
     651             :   //NOW THE FEE BOARD IMPLEMENTATION
     652             :   
     653             :   // To create the Mother volume to accomodate FEE boards
     654             :   // It should have the dimension few mm smaller than the back plane
     655             :   // But, we have taken it as big as EUM2 or EUV2
     656             :   // It is to compensate the Stainless Steel medium of EUM2 or EUV2
     657             : 
     658             :   // Create Mother volume of Air : SHORT TYPE 
     659             :   //------------------------------------------------------//
     660             : 
     661             : 
     662           1 :   Float_t dboxFEEBPlaneB[3];
     663           1 :   dboxFEEBPlaneB[0]   = dboxSS2[0];  
     664           1 :   dboxFEEBPlaneB[1]   = dboxSS2[1];       
     665           1 :   dboxFEEBPlaneB[2]   = 2.4/2.;
     666             :   
     667             :   //Volume of same dimension as EUM2 or EUV2 of Material AIR
     668           1 :   TVirtualMC::GetMC()->Gsvolu("EFBB","BOX", idtmed[698], dboxFEEBPlaneB, 3);
     669             :   
     670             :   
     671             :   // FEE Boards EFEE placed inside EFBB
     672             :   
     673           1 :   yFee =  dboxFEEBPlaneB[1] - yA -0.1 -0.3;  
     674             :   // 0.1cm and 0.3cm are subtracted to shift the FEE Boards on their actual positions
     675             :   // As the positions are changed, because we have taken the dimension of EFBB equal 
     676             :   // to the dimension of EUM2 or EUV2  
     677             :   number = 1;
     678           8 :   for (i = 1; i <= 3; ++i) 
     679             :     {
     680           3 :       xFee = -dboxFEEBPlaneB[0] + xA + 0.1 +0.3;  
     681             :       
     682             :       //First we place the translator board
     683           3 :       TVirtualMC::GetMC()->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
     684             :       // The first FEE board is 11mm from the translator board    
     685           3 :       xFee+=1.1;
     686           3 :       number+=1;
     687             :       
     688          78 :       for (j = 1; j <= 12; ++j) 
     689             :         {
     690          36 :           TVirtualMC::GetMC()->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
     691          36 :           xFee += xSepa;
     692          36 :           number += 1;
     693             :         }
     694             :       
     695             :       //Now we place Bridge Board
     696           3 :       xFee = xFee - xSepa + 0.8 ;
     697             :       //Bridge Board is at a distance 8mm from FEE board
     698           3 :       TVirtualMC::GetMC()->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
     699             :       
     700           3 :       number+=1;
     701           3 :       xFee+=0.8;
     702             :       
     703          78 :       for (j = 1; j <= 12; ++j) 
     704             :         {
     705          36 :           TVirtualMC::GetMC()->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
     706          36 :           xFee += xSepa;
     707          36 :           number += 1;
     708             :         }
     709           3 :       yFee -= ySepa; 
     710             :     }
     711             :   
     712             :   
     713             :   
     714             :   // Now Place EEGB, EDGB, EHC2 and EFBB in EUM2 & EUV2 to complete the unit module
     715             :   
     716             :   // FOR PRE SHOWER
     717             :   //- Placing of all components of UM in AIR BOX EUM2--//
     718             :   //(1)   FIRST PUT the G10 Box : EDGB
     719           1 :   Float_t zedgb = -dboxSS2[2] + 0.4/2.;
     720           1 :   TVirtualMC::GetMC()->Gspos("EDGB", 1, "EUM2", 0., 0., zedgb, 0, "ONLY");
     721             :   
     722             :   //(2)   NEXT PLACING the Honeycomb EHC2
     723           1 :   Float_t zehc2 = zedgb + 0.4/2. + fgkCellDepth/2.;
     724           1 :   TVirtualMC::GetMC()->Gspos("EHC2", 1, "EUM2", 0., 0.,  zehc2, 0, "ONLY");
     725             :   
     726             :   //(3)   NEXT PLACING the G10 Box : EEGB
     727           1 :   Float_t zeegb = zehc2 + fgkCellDepth/2. + 0.33/2.;
     728           1 :   TVirtualMC::GetMC()->Gspos("EEGB", 1, "EUM2", 0., 0., zeegb, 0, "ONLY");
     729             :   
     730             :   //(4)   NEXT PLACING FEE BOARDS : EFBB
     731           1 :   Float_t zfeeboardB = zeegb + 0.33/2.+1.2;
     732           1 :   TVirtualMC::GetMC()->Gspos("EFBB", 1, "EUM2", 0., 0., zfeeboardB, 0, "ONLY");
     733             :   
     734             :   //  FOR VETO
     735             :   //  Placing of all components of UM in AIR BOX EUV2 //
     736             :   
     737             :   //(1)  FIRST PUT the FEE BOARD : EUV2
     738           1 :   zfeeboardB = -dboxSS2[2] + 1.2;
     739           1 :   TVirtualMC::GetMC()->Gspos("EFBB", 1, "EUV2", 0., 0., zfeeboardB, 0, "ONLY");
     740             :   
     741             :   //(2)  FIRST PLACING the G10 Box : EEGB
     742           1 :   zeegb = zfeeboardB + 1.2 + 0.33/2.;
     743           1 :   TVirtualMC::GetMC()->Gspos("EEGB", 1, "EUV2", 0., 0., zeegb, 0, "ONLY");
     744             :   
     745             :   //(3)   NEXT PLACING the Honeycomb EHC2
     746           1 :   zehc2 = zeegb + 0.33/2. + fgkCellDepth/2.;
     747           1 :   TVirtualMC::GetMC()->Gspos("EHC2", 1, "EUV2", 0., 0.,  zehc2, 0, "ONLY");
     748             :   
     749             :   //(4)   NEXT PUT THE G10 Box : EDGB
     750           1 :   zedgb = zehc2 + fgkCellDepth/2.+ 0.4/2.;
     751           1 :   TVirtualMC::GetMC()->Gspos("EDGB", 1, "EUV2", 0., 0., zedgb, 0, "ONLY");
     752             :   
     753             :   
     754             :   //===================================================================//
     755             :   //---------------------- UM Type B completed ------------------------//
     756             :   
     757           1 : }
     758             : 
     759             : //_______________________________________________________________________
     760             : 
     761             : void AliPMDv1::CreatePMD()
     762             : {
     763             :   // Create final detector from Unit Modules
     764             :   // -- Author : Bedanga and Viyogi June 2003
     765             :   
     766             :   
     767             :   Float_t   zp = fgkZdist;  //Z-distance of PMD from Interaction Point 
     768             : 
     769           2 :   Int_t jhrot12,jhrot13, irotdm;
     770           1 :   Int_t *idtmed = fIdtmed->GetArray()-599;
     771             :   
     772           1 :   AliMatrix(irotdm, 90., 0.,  90.,  90., 180., 0.);
     773           1 :   AliMatrix(jhrot12, 90., 180., 90., 270., 0., 0.);
     774           1 :   AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
     775             :   
     776             :   // Now We Will Calculate Position Co-ordinates of EUM1 & EUV1 in EPM1 & EPM2
     777             :   
     778             :   Float_t dbox1[3];
     779             :   dbox1[0] = fgkCellRadius/fgkSqroot3by2;
     780             :   dbox1[1] = fgkNrowUM1*fgkCellRadius;
     781             :   dbox1[2] = fgkCellDepth/2.;
     782             :   
     783             :   Float_t dbox3[3];
     784             :   dbox3[0] = (dbox1[0]*fgkNcolUM1)-
     785             :     (fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.) + 0.15 + 0.05 + 0.05;  
     786             :   dbox3[1] = dbox1[1]+fgkCellRadius/2. + 0.15 + 0.05 + 0.05; 
     787             :   dbox3[2] = fgkCellDepth/2.;
     788             :  
     789             :   Float_t dboxCGA[3];
     790             :   dboxCGA[0]  = dbox3[0] - 0.15; 
     791             :   dboxCGA[1]  = dbox3[1] - 0.15; 
     792             :   dboxCGA[2]  = 0.4/2.;
     793             : 
     794             :   Float_t dboxSS1[3];
     795             :   dboxSS1[0]   = dboxCGA[0]+fgkSSBoundary; 
     796             :   dboxSS1[1]   = dboxCGA[1]+fgkSSBoundary;       
     797             :   dboxSS1[2]   = fgkThSS/2.; 
     798             : 
     799             :   Float_t dboxUM1[3];
     800             :   dboxUM1[0] = dboxSS1[0];
     801             :   dboxUM1[1] = dboxSS1[1];
     802             :   dboxUM1[2] = fgkThSS/2. + 1.2;
     803             : 
     804             :   Float_t dboxSM1[3];
     805           1 :   dboxSM1[0] = fSMLengthax + 0.05; // 0.05cm for the ESC1,2 
     806           1 :   dboxSM1[1] = fSMLengthay;
     807             :   dboxSM1[2] = dboxUM1[2];
     808             :  
     809             :   // Position co-ordinates of the unit modules in EPM1 & EPM2
     810             :   Float_t xa1,xa2,xa3,ya1,ya2; 
     811           1 :   xa1 =  dboxSM1[0] - dboxUM1[0];
     812           1 :   xa2 = xa1 - dboxUM1[0] - 0.1 - dboxUM1[0];
     813           1 :   xa3 = xa2 - dboxUM1[0] - 0.1 - dboxUM1[0];
     814           1 :   ya1 = dboxSM1[1]  - 0.2 - dboxUM1[1];
     815           1 :   ya2 = ya1 - dboxUM1[1] - 0.3 - dboxUM1[1];
     816             :   
     817             :   // Next to Calculate Position Co-ordinates of EUM2 & EUV2 in EPM3 & EPM4
     818             :   
     819             :   Float_t dbox2[3];
     820             :   dbox2[1] = fgkNrowUM2*fgkCellRadius;
     821             :   dbox2[0] = dbox1[0];
     822             :   dbox2[2] = dbox1[2];
     823             :   
     824             :   Float_t dbox4[3];
     825             :   dbox4[0] =(dbox2[0]*fgkNcolUM2)-
     826             :     (fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.) + 0.15 + 0.05 + 0.05; 
     827             :   dbox4[1] = dbox2[1] + fgkCellRadius/2. + 0.15 + 0.05 + 0.05;
     828             :   dbox4[2] = dbox3[2];
     829             :   
     830             :   Float_t dboxCGB[3];
     831             :   dboxCGB[0]  = dbox4[0] - 0.15; 
     832             :   dboxCGB[1]  = dbox4[1] - 0.15; 
     833             :   dboxCGB[2]  = 0.4/2.;
     834             :   
     835             :   Float_t dboxSS2[3];
     836             :   dboxSS2[0]  = dboxCGB[0] + fgkSSBoundary; 
     837             :   dboxSS2[1]  = dboxCGB[1] + fgkSSBoundary;       
     838             :   dboxSS2[2]  = fgkThSS/2.;
     839             :   
     840             :   Float_t dboxUM2[3];
     841             :   dboxUM2[0] = dboxSS2[0];
     842             :   dboxUM2[1] = dboxSS2[1];
     843             :   dboxUM2[2] = fgkThSS/2. + 2.4/2.; // 2.4 cm is added for  FEE Board thickness
     844             : 
     845             :   Float_t dboxSM2[3];
     846           1 :   dboxSM2[0] = fSMLengthbx + 0.05;  // 0.05cm for the ESC3,4
     847           1 :   dboxSM2[1] = fSMLengthby;
     848             :   dboxSM2[2] = dboxUM2[2];
     849             :   
     850             :   // Position co-ordinates of the unit modules in EPM3 & EPM4 
     851             :   // Space is added to provide a gapping for HV between UM's
     852             :   Float_t xb1,xb2,yb1,yb2,yb3; 
     853           1 :   xb1 = dboxSM2[0] - 0.1 - dboxUM2[0];
     854           1 :   xb2 = xb1 - dboxUM2[0] - 0.1 - dboxUM2[0];
     855           1 :   yb1 = dboxSM2[1] -  0.2 - dboxUM2[1];
     856           1 :   yb2 = yb1 - dboxUM2[1] - 0.2 -  dboxUM2[1];
     857           1 :   yb3 = yb2 - dboxUM2[1] - 0.3-  dboxUM2[1];
     858             : 
     859             : 
     860             :   // Create Volumes for Lead(Pb) Plates
     861             : 
     862             :   // Lead Plate For LONG TYPE
     863             :   // X-dimension of Lead Plate = 3*(X-dimension of EUM1 or EUV1) + gap provided between unit modules 
     864             :   // Y-dimension of Lead Plate = 2*(Y-dimension of EUM1 or EUV1) + thickness of SS channels 
     865             :   // + tolerance
     866             :   // Z-demension of Lead Plate = 1.5cm 
     867             :   // Integer assigned to Pb-medium is 600
     868             : 
     869           1 :    Float_t dboxLeadA[3];
     870           1 :   dboxLeadA[0] = fSMLengthax; 
     871           1 :   dboxLeadA[1] = fSMLengthay;
     872           1 :   dboxLeadA[2] = fgkThLead/2.;
     873             : 
     874           1 :   TVirtualMC::GetMC()->Gsvolu("ELDA","BOX", idtmed[600], dboxLeadA, 3);
     875             : 
     876             :   //LEAD Plate For SHORT TYPE
     877             :   // X-dimension of Lead Plate = 2*(X-dimension of EUM2 or EUV2) + gap provided between unit modules 
     878             :   // Y-dimension of Lead Plate = 3*(Y-dimension of EUM2 or EUV2) + thickness of SS channels 
     879             :   // + tolerance
     880             :   // Z-demension of Lead Plate = 1.5cm 
     881             :   // Integer assigned to Pb-medium is 600
     882             : 
     883           1 :    Float_t dboxLeadB[3];
     884           1 :   dboxLeadB[0] = fSMLengthbx; 
     885           1 :   dboxLeadB[1] = fSMLengthby; 
     886           1 :   dboxLeadB[2] = fgkThLead/2.;
     887             : 
     888           1 :   TVirtualMC::GetMC()->Gsvolu("ELDB","BOX", idtmed[600], dboxLeadB, 3);
     889             : 
     890             :   //=========== CREATE MOTHER VOLUMES FOR PMD ===========================/
     891             : 
     892             :   Float_t serviceX    = 23.2;
     893             :   Float_t serviceYa   = 5.2;
     894             :   Float_t serviceYb   = 9.8;
     895             :   Float_t serviceXext = 16.0;
     896             : 
     897             :   // Five Mother Volumes of PMD are Created
     898             :   // Two Volumes EPM1 & EPM2 of Long Type
     899             :   // Other Two Volumes EPM3 & EPM4 for Short Type
     900             :   // Fifth Volume EFGD for Girders and its Carriage
     901             :   // Four Volmes EPM1, EPM2, EPM3 & EPM4 are Placed such that
     902             :   // to create a hole and avoid overlap with Beam Pipe
     903             : 
     904             :   // Create Volume FOR EPM1 
     905             :   // X-dimension = fSMLengthax + Extended Iron Support(23.2cm) + 
     906             :   // Extension in Module(16cm) for full coverage of Detector + 1mm thick SS-Plate
     907             :   // Y-dimension = fSMLengthay + Extended Iron Support(5.2cm)
     908             :   // Z-dimension = fSMthick/2.; fSMthick=17cm is full profile of PMD in Z-Side
     909             :   // Note:- EPM1 is a Volume of Air
     910             : 
     911           1 :   Float_t gaspmd1[3];
     912           1 :   gaspmd1[0] = fSMLengthax + serviceX/2.+ serviceXext/2. + 0.05; //0.05cm for the thickness of 
     913           1 :   gaspmd1[1] = fSMLengthay + serviceYa/2.;                       //SS-plate for cooling encloser  
     914           1 :   gaspmd1[2] = fSMthick/2.;
     915             :   
     916           1 :   TVirtualMC::GetMC()->Gsvolu("EPM1", "BOX", idtmed[698], gaspmd1, 3);
     917             : 
     918             : 
     919             :   // Create Volume FOR EPM2 
     920             : 
     921             :   // X-dimension = fSMLengthax + Extended Iron Support(23.2cm) + 
     922             :   // Extension in Module(16cm) for full coverage of Detector + 1mm thick SS-Plate
     923             :   // Y-dimension = fSMLengthay + Extended Iron Support(9.8cm)
     924             :   // Z-dimension = fSMthick/2.; fSMthick=17cm is full profile of PMD in Z-Side
     925             :   // Note:- EPM2 is a Volume of Air
     926             : 
     927           1 :   Float_t gaspmd2[3];
     928           1 :   gaspmd2[0] = fSMLengthax + serviceX/2. + serviceXext/2. + 0.05; //0.05cm for the thickness of 
     929           1 :   gaspmd2[1] = fSMLengthay + serviceYb/2.;                        //SS-plate for cooling encloser
     930           1 :   gaspmd2[2] = fSMthick/2.;
     931             : 
     932           1 :   TVirtualMC::GetMC()->Gsvolu("EPM2", "BOX", idtmed[698], gaspmd2, 3);
     933             : 
     934             :   // Create Volume FOR EPM3
     935             : 
     936             :   // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm) + 
     937             :   // Extension in Module(16cm) for full coverage of Detector
     938             :   // Y-dimension = fSMLengthby + Extended Iron Support(5.2cm)
     939             :   // Z-dimension = fSMthick/2.; fSMthick=17cm is full profile of PMD in Z-Side
     940             :   // Note:- EPM3 is a Volume of Air
     941             : 
     942             : 
     943           1 :   Float_t gaspmd3[3];
     944           1 :   gaspmd3[0] = fSMLengthbx + serviceX/2. + serviceXext/2.+ 0.05; //0.05cm for the thickness of  
     945           1 :   gaspmd3[1] = fSMLengthby + serviceYa/2.;                       //SS-plate for cooling encloser  
     946           1 :   gaspmd3[2] = fSMthick/2.;
     947             : 
     948           1 :   TVirtualMC::GetMC()->Gsvolu("EPM3", "BOX", idtmed[698], gaspmd3, 3);
     949             : 
     950             :   // Create Volume FOR EPM4
     951             : 
     952             :   // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm) + 
     953             :   // Extension in Module(16cm) for full coverage of Detector
     954             :   // Y-dimension = fSMLengthby + Extended Iron Support(9.8cm)
     955             :   // Z-dimension = fSMthick/2.; fSMthick=17cm is full profile of PMD in Z-Side
     956             :   // Note:- EPM4 is a Volume of Air
     957             :   
     958           1 :   Float_t gaspmd4[3];
     959           1 :   gaspmd4[0] = fSMLengthbx + serviceX/2. + serviceXext/2.+ 0.05;  //0.05cm for the thickness of
     960           1 :   gaspmd4[1] = fSMLengthby + serviceYb/2.;                        //SS-plate for cooling encloser   
     961           1 :   gaspmd4[2] = fSMthick/2.;
     962             : 
     963           1 :   TVirtualMC::GetMC()->Gsvolu("EPM4", "BOX", idtmed[698], gaspmd4, 3);
     964             :   
     965             :   //  Create the Fifth Mother Volume of Girders and its Carriage
     966             :   //-------------------------------------------------------------//
     967             :   // Create the Girders
     968             :   
     969             :   // X-dimension = 238.7cm 
     970             :   // Y-dimension = 12.0cm 
     971             :   // Z-dimension = 7.0cm 
     972             :   // Girders are the Volume of Iron
     973             :   // And the Integer Assigned to SS is 618
     974             : 
     975           1 :   Float_t grdr[3];
     976           1 :   grdr[0] = 238.7/2.;
     977           1 :   grdr[1] = 12.0/2.;
     978           1 :   grdr[2] = 7.0/2.; 
     979             : 
     980           1 :   TVirtualMC::GetMC()->Gsvolu("EGDR", "BOX", idtmed[618], grdr, 3);
     981             :  
     982             :   // Create Air Strip for Girders as the Girders are hollow
     983             :   // Girders are 1cm thick in Y and Z on both sides
     984             :  
     985           1 :   Float_t airgrdr[3];
     986           1 :   airgrdr[0] = grdr[0];
     987           1 :   airgrdr[1] = grdr[1] - 1.0;
     988           1 :   airgrdr[2] = grdr[2] - 1.0;
     989             :   
     990           1 :   TVirtualMC::GetMC()->Gsvolu("EAIR", "BOX", idtmed[698], airgrdr, 3);
     991             : 
     992             :   // Positioning the air strip EAIR in girder EGDR  
     993           1 :   TVirtualMC::GetMC()->Gspos("EAIR", 1, "EGDR",  0., 0., 0.,  0, "ONLY");
     994             :   
     995             :   // Create the Carriage for Girders
     996             :   // Originally, Carriage is divided in two parts
     997             :   // 64.6cm on -X side, 44.2cm on +X side and 8.2cm is the gap between two
     998             :   // In approximation we have taken these together as a single Volume
     999             :   // With X = 64.6cm + 44.2cm + 8.2cm
    1000             :   // Y-dimension = 4.7cm
    1001             :   // Z-dimension = 18.5cm
    1002             :   // Carriage is a Volume of SS
    1003             :     
    1004           1 :   Float_t xgrdr[3];
    1005           1 :   xgrdr[0] = (64.6 + 44.2 + 8.2)/2.;  
    1006           1 :   xgrdr[1] = 4.7/2.; 
    1007           1 :   xgrdr[2] = 18.5/2.;
    1008             : 
    1009           1 :   TVirtualMC::GetMC()->Gsvolu("EXGD", "BOX", idtmed[618], xgrdr, 3);
    1010             : 
    1011             :   // Create Air Strip for the Carriage EXGD as it is hollow
    1012             :   // Carriage is 1cm thick in Y on one side and in Z on both sides 
    1013             : 
    1014           1 :   Float_t xairgrdr[3];
    1015           1 :   xairgrdr[0] = xgrdr[0];
    1016           1 :   xairgrdr[1] = xgrdr[1] - 0.5;
    1017           1 :   xairgrdr[2] = xgrdr[2] - 1.0;
    1018             :   
    1019           1 :   TVirtualMC::GetMC()->Gsvolu("EXIR", "BOX", idtmed[698], xairgrdr, 3);
    1020             :   
    1021             :   // Positioning the air strip EXIR in CArriage EXGD
    1022           1 :   TVirtualMC::GetMC()->Gspos("EXIR", 1, "EXGD",  0., -0.05, 0.,  0, "ONLY");
    1023             : 
    1024             :   // Now Create the master volume of air containing Girders & Carriage
    1025             :     
    1026             :   // X-dimension = same as X-dimension of Girders(EGDR)
    1027             :   // Y-dimension = Y of Girder(EGDR) + Y of Carriage(EXGD) + gap between two
    1028             :   // Z-dimenson = same as Z of Carriage(EXGD)
    1029             :   // Note:- It is a volume of Air
    1030             : 
    1031           1 :   Float_t fulgrdr[3];
    1032           1 :   fulgrdr[0] = 238.7/2.;
    1033           1 :   fulgrdr[1] = 17.5/2.; 
    1034           1 :   fulgrdr[2] = 18.5/2.;
    1035             : 
    1036           1 :   TVirtualMC::GetMC()->Gsvolu("EFGD", "BOX", idtmed[698], fulgrdr, 3);
    1037             : 
    1038             :   // Positioning the EGDR and EXGD in EFGD
    1039             : 
    1040           1 :   TVirtualMC::GetMC()->Gspos("EXGD", 1, "EFGD",  0., 6.4, 0.,      0, "ONLY");
    1041           1 :   TVirtualMC::GetMC()->Gspos("EGDR", 1, "EFGD",  0., -2.75, -5.75, 0, "ONLY");
    1042           1 :   TVirtualMC::GetMC()->Gspos("EGDR", 2, "EFGD",  0., -2.75, 5.75,  0, "ONLY");
    1043             : 
    1044             :   //=========== Mother Volumes are Created ============================//
    1045             : 
    1046             :   // Create the Volume of 1mm thick SS-Plate  for cooling encloser
    1047             :   // These are placed on the side close to the Beam Pipe
    1048             :   // SS-Plate is perpendicular to the plane of Detector 
    1049             :  
    1050             :   // For LONG TYPE
    1051             : 
    1052             :   // For EPM1
    1053             :   // X-dimension = 0.1cm
    1054             :   // Y-dimension = same as Y of EPM1
    1055             :   // Z-dimension = Y of EPM1 - 0.1; 0.1cm is subtracted as 1mm thick 
    1056             :   // FR4 sheets for the detector encloser placed on both sides
    1057             :   // It is a Volume of SS
    1058             :   // Integer assigned to SS is 618
    1059             :  
    1060           1 :   Float_t sscoolencl1[3];
    1061           1 :   sscoolencl1[0] = 0.05;  
    1062           1 :   sscoolencl1[1] = gaspmd1[1];
    1063           1 :   sscoolencl1[2] = gaspmd1[2] - 0.2/2.;
    1064             : 
    1065           1 :   TVirtualMC::GetMC()->Gsvolu("ESC1", "BOX", idtmed[618], sscoolencl1, 3);
    1066             : 
    1067             :   // Placement of ESC1  in EPM1
    1068           1 :   TVirtualMC::GetMC()->Gspos("ESC1", 1,  "EPM1", -gaspmd1[0] + 0.05, 0., 0., 0, "ONLY");
    1069             : 
    1070             : 
    1071             :   // For EPM2
    1072             :   // X-dimension = 0.1cm
    1073             :   // Y-dimension = same as Y of EPM2
    1074             :   // Z-dimension = Y of EPM2 - 0.1; 0.1cm is subtracted as 1mm thick 
    1075             :   // FR4 sheets for the detector encloser placed on both sides
    1076             :   // It is a Volume of SS
    1077             :  
    1078           1 :   Float_t sscoolencl2[3];
    1079           1 :   sscoolencl2[0] = 0.05;  
    1080           1 :   sscoolencl2[1] = gaspmd2[1];
    1081           1 :   sscoolencl2[2] = gaspmd2[2] - 0.2/2.;
    1082             : 
    1083           1 :   TVirtualMC::GetMC()->Gsvolu("ESC2", "BOX", idtmed[618], sscoolencl2, 3);
    1084             : 
    1085             :   // Placement of ESC2  in EPM2
    1086           1 :   TVirtualMC::GetMC()->Gspos("ESC2", 1,  "EPM2",    gaspmd2[0] - 0.05 , 0., 0., 0, "ONLY");
    1087             : 
    1088             :   // For SHORT TYPE
    1089             : 
    1090             :   // For EPM3
    1091             :   // X-dimension = 0.1cm
    1092             :   // Y-dimension = same as Y of EPM3
    1093             :   // Z-dimension = Y of EPM3 - 0.1; 0.1cm is subtracted as 1mm thick 
    1094             :   // FR4 sheets for the detector encloser placed on both sides
    1095             :   // It is a Volume of SS
    1096             :   
    1097           1 :   Float_t sscoolencl3[3];
    1098           1 :   sscoolencl3[0] = 0.05;  
    1099           1 :   sscoolencl3[1] = gaspmd3[1];
    1100           1 :   sscoolencl3[2] = gaspmd3[2] - 0.2/2.;
    1101             : 
    1102           1 :   TVirtualMC::GetMC()->Gsvolu("ESC3", "BOX", idtmed[618], sscoolencl3, 3);
    1103             : 
    1104             :   // Placement of ESC3  in EPM3
    1105           1 :   TVirtualMC::GetMC()->Gspos("ESC3", 1,  "EPM3",    gaspmd3[0] - 0.05 , 0., 0., 0, "ONLY");
    1106             : 
    1107             : 
    1108             :   // For EPM4
    1109             :   // X-dimension = 0.1cm
    1110             :   // Y-dimension = same as Y of EPM4
    1111             :   // Z-dimension = Y of EPM4 - 0.1; 0.1cm is subtracted as 1mm thick 
    1112             :   // FR4 sheets for the detector encloser placed on both sides
    1113             :   // It is a Volume of SS
    1114             :  
    1115           1 :   Float_t sscoolencl4[3];
    1116           1 :   sscoolencl4[0] = 0.05;  
    1117           1 :   sscoolencl4[1] = gaspmd4[1];
    1118           1 :   sscoolencl4[2] = gaspmd4[2] - 0.2/2.;
    1119             : 
    1120           1 :   TVirtualMC::GetMC()->Gsvolu("ESC4", "BOX", idtmed[618], sscoolencl4, 3);
    1121             : 
    1122             :   // Placement of ESC4  in EPM4
    1123           1 :   TVirtualMC::GetMC()->Gspos("ESC4", 1, "EPM4", -gaspmd4[0] + 0.05 , 0., 0., 0, "ONLY");
    1124             : 
    1125             :   //======== CREATE SS SUPPORTS FOR EPM1, EPM2, EPM3 & EPM4 =========//
    1126             :   // --- DEFINE SS volumes  for EPM1 & EPM2 ---
    1127             : 
    1128             :   // Create SS Support For EPM1
    1129             : 
    1130             :   // X-dimension = fSMLengthax + Extended Iron Support(23.2cm)
    1131             :   // Y-dimension = fSMLengthay + Extended Iron Support(5.2cm)
    1132             :   // Z-dimension = thickness of Iron support(0.5cm)
    1133             :   // It is a Volume of SS
    1134             :   // Integer assigned to SS is 618
    1135             : 
    1136           1 :   Float_t dboxFea1[3];
    1137           1 :   dboxFea1[0] = fSMLengthax + serviceX/2.;  
    1138           1 :   dboxFea1[1] = fSMLengthay + serviceYa/2.;
    1139           1 :   dboxFea1[2] = fgkThSteel/2.;
    1140             :   
    1141           1 :   TVirtualMC::GetMC()->Gsvolu("EFE1","BOX", idtmed[618], dboxFea1, 3);
    1142             : 
    1143             : 
    1144             :   // Create SS Support For EPM2
    1145             : 
    1146             :   // X-dimension = fSMLengthax + Extended Iron Support(23.2cm)
    1147             :   // Y-dimension = fSMLengthay + Extended Iron Support(9.8cm)
    1148             :   // Z-dimension = thickness of Iron support(0.5cm)
    1149             :   // It is a Volume of SS
    1150             :   // Integer assigned to SS is 618
    1151             : 
    1152           1 :   Float_t dboxFea2[3];
    1153           1 :   dboxFea2[0] = fSMLengthax + serviceX/2.;   
    1154           1 :   dboxFea2[1] = fSMLengthay + serviceYb/2.;  
    1155           1 :   dboxFea2[2] = fgkThSteel/2.;
    1156             :   
    1157           1 :   TVirtualMC::GetMC()->Gsvolu("EFE2","BOX", idtmed[618], dboxFea2, 3);
    1158             : 
    1159             :   // Create SS Support For EPM3
    1160             : 
    1161             :   // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm)
    1162             :   // Y-dimension = fSMLengthby + Extended Iron Support(5.2cm)
    1163             :   // Z-dimension = thickness of Iron support(0.5cm)
    1164             :   // It is a Volume of SS
    1165             :   // Integer assigned to SS is 618  
    1166             : 
    1167           1 :   Float_t dboxFea3[3];
    1168           1 :   dboxFea3[0] = fSMLengthbx + serviceX/2.; 
    1169           1 :   dboxFea3[1] = fSMLengthby + serviceYa/2.;
    1170           1 :   dboxFea3[2] = fgkThSteel/2.;
    1171             :   
    1172           1 :   TVirtualMC::GetMC()->Gsvolu("EFE3","BOX", idtmed[618], dboxFea3, 3);
    1173             : 
    1174             :   // Create SS Support For EPM4
    1175             : 
    1176             :   // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm)
    1177             :   // Y-dimension = fSMLengthby + Extended Iron Support(9.8cm)
    1178             :   // Z-dimension = thickness of Iron support(0.5cm)
    1179             :   // It is a Volume of SS
    1180             :   // Integer assigned to SS is 618  
    1181             :  
    1182           1 :   Float_t dboxFea4[3];
    1183           1 :   dboxFea4[0] = fSMLengthbx + serviceX/2.;  
    1184           1 :   dboxFea4[1] = fSMLengthby + serviceYb/2.; 
    1185           1 :   dboxFea4[2] = fgkThSteel/2.;
    1186             :   
    1187           1 :   TVirtualMC::GetMC()->Gsvolu("EFE4","BOX", idtmed[618], dboxFea4, 3);
    1188             : 
    1189             : 
    1190             :   //=============== Volumes for SS support are Completed =============//
    1191             : 
    1192             :   // Create FR4 Sheets to enclose the PMD which are Placed parallel to the
    1193             :   // plane of the detector. Four FR4 sheets are created with the dimensions
    1194             :   // corresponding to the Iron Supports
    1195             :   // This is cooling encloser.
    1196             : 
    1197             :   // Create FR4 sheet ECC1
    1198             :   // X-dimension = same as EFE1
    1199             :   // Y-dimension = same as EFE1
    1200             :   // Z-dimension = 0.1cm
    1201             :   // FR4 medium is same as that of G10
    1202             :   // Integer assigned to FR4 medium is 607
    1203             : 
    1204           1 :   Float_t enclos1[3];
    1205           1 :   enclos1[0] = dboxFea1[0];   
    1206           1 :   enclos1[1] = dboxFea1[1];
    1207           1 :   enclos1[2] = 0.05;
    1208             : 
    1209           1 :   TVirtualMC::GetMC()->Gsvolu("ECC1", "BOX", idtmed[607], enclos1, 3);
    1210             : 
    1211             :   // Create FR4 sheet ECC2
    1212             :   // X-dimension = same as EFE2
    1213             :   // Y-dimension = same as EFE2
    1214             :   // Z-dimension = 0.1cm
    1215             : 
    1216           1 :   Float_t enclos2[3];
    1217           1 :   enclos2[0] = dboxFea2[0];  
    1218           1 :   enclos2[1] = dboxFea2[1];
    1219           1 :   enclos2[2] = 0.05;
    1220             : 
    1221           1 :   TVirtualMC::GetMC()->Gsvolu("ECC2", "BOX", idtmed[607], enclos2, 3);
    1222             : 
    1223             :   // Create FR4 sheet ECC3
    1224             :   // X-dimension = same as EFE3
    1225             :   // Y-dimension = same as EFE3
    1226             :   // Z-dimension = 0.1cm
    1227             : 
    1228           1 :   Float_t enclos3[3];
    1229           1 :   enclos3[0] = dboxFea3[0];  
    1230           1 :   enclos3[1] = dboxFea3[1];
    1231           1 :   enclos3[2] = 0.05;
    1232             :   
    1233           1 :   TVirtualMC::GetMC()->Gsvolu("ECC3", "BOX", idtmed[607], enclos3, 3);
    1234             :   
    1235             :   // Create FR4 sheet ECC4
    1236             :   // X-dimension = same as EFE4
    1237             :   // Y-dimension = same as EFE4
    1238             :   // Z-dimension = 0.1cm
    1239             : 
    1240           1 :   Float_t enclos4[3];
    1241           1 :   enclos4[0] = dboxFea4[0];   
    1242           1 :   enclos4[1] = dboxFea4[1];
    1243           1 :   enclos4[2] = 0.05;
    1244             : 
    1245           1 :   TVirtualMC::GetMC()->Gsvolu("ECC4", "BOX", idtmed[607], enclos4, 3);
    1246             : 
    1247             :   //--------------- FR4 SHEETS COMPLETED ---------------------------//
    1248             : 
    1249             :   //------------- Create the SS-Channels(Horizontal Rails) to Place
    1250             :   //     Unit Modules on SS Support -------------------------------------//
    1251             :   
    1252             :   // Two types of SS-Channels are created 
    1253             :   // as we have two types of modules
    1254             :   
    1255             :   // Create SS-channel for Long Type
    1256             :   // X-dimension = same as Lead Plate ELDA
    1257             :   // Y-dimension = 0.1cm
    1258             :   // Z-dimension = 2.0cm
    1259             :   // Volume medium is SS
    1260             : 
    1261           1 :   Float_t channel12[3];
    1262           1 :   channel12[0] = fSMLengthax;  
    1263           1 :   channel12[1] = 0.05; 
    1264           1 :   channel12[2] = 2.0/2.; 
    1265             : 
    1266           1 :   TVirtualMC::GetMC()->Gsvolu("ECHA", "BOX", idtmed[618], channel12, 3);
    1267             :   
    1268             :   // Create SS-channel for Short Type
    1269             :   // X-dimension = same as Lead Plate ELDB
    1270             :   // Y-dimension = 0.1cm
    1271             :   // Z-dimension = 2.0cm
    1272             :   // Volume medium is SS
    1273             : 
    1274           1 :   Float_t channel34[3];
    1275           1 :   channel34[0] = fSMLengthbx;  
    1276           1 :   channel34[1] = 0.05; 
    1277           1 :   channel34[2] = 2.0/2.; 
    1278             : 
    1279           1 :   TVirtualMC::GetMC()->Gsvolu("ECHB", "BOX", idtmed[618], channel34, 3);
    1280             : 
    1281             :   //----------------- SS-Channels are Copmleted --------------------//
    1282             : 
    1283             :   //========= POSITIONING OF SS SUPPORT AND LEAD PLATES IN QUADRANTS =====//
    1284             :   
    1285             :   /**************** Z-Distances of different Components **********/
    1286             :   
    1287             :   Float_t zcva,zfea,zpba,zpsa,zchanVeto,zchanPS, zelvdbVeto, zelvdbPS;
    1288             :   
    1289             :   
    1290             :   zpba       =  - fgkThSteel/2.;                         //z-position of Pb plate
    1291             :   zfea       =  fgkThLead/2.;                            //z-position of SS-Support
    1292           1 :   zchanVeto  =  zpba -  fgkThLead/2. - channel12[2];     //z-position of SS-channel on Veto
    1293           1 :   zchanPS    =  zfea + fgkThSteel/2. + channel12[2];     //z-position of SS-channel on Preshower
    1294           1 :   zpsa       =  zfea + fgkThSteel/2. + fDthick;          //z-position of Preshower
    1295           1 :   zcva       =  zpba - fgkThLead/2.- fDthick;            //z-position of Veto
    1296             :   
    1297             :   zelvdbVeto =  zpba + fgkThLead/2.  - 8.9/2.;           //z-position of LVDBs on Veto side
    1298             :   zelvdbPS   =  zfea + fgkThSteel/2. + 7.4/2.;           //z-position of LVDBs on Preshower side
    1299             :   
    1300             :   // FOR LONG TYPE
    1301             :   Float_t  xLead1,yLead1,zLead1, xLead2,yLead2,zLead2;
    1302             :   Float_t  xIron1,yIron1,zIron1, xIron2,yIron2,zIron2;
    1303             :   
    1304             :   
    1305             :   xIron1 = - 16.0/2. + 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed 
    1306             :   yIron1 = 0.;
    1307             :   zIron1 = zfea;
    1308             :   
    1309             :   xIron2 = 16.0/2. - 0.1/2.;  // half of 0.1cm is added as 1mm SS sheet is placed 
    1310             :   yIron2 = 0.;
    1311             :   zIron2 = zfea;    
    1312             : 
    1313             :   
    1314             :   xLead1 = xIron1 - 23.2/2.; 
    1315             :   yLead1 = -5.2/2.;
    1316             :   zLead1 = zpba;
    1317             :   
    1318             :   xLead2 =xIron2 + 23.2/2.; 
    1319             :   yLead2 = 9.8/2.;
    1320             :   zLead2 = zpba;    
    1321             :   
    1322           1 :   TVirtualMC::GetMC()->Gspos("EFE1", 1, "EPM1", xIron1,  yIron1, zfea, 0, "ONLY");
    1323           1 :   TVirtualMC::GetMC()->Gspos("ELDA", 1, "EPM1", xLead1,  yLead1, zpba, 0, "ONLY"); 
    1324           1 :   TVirtualMC::GetMC()->Gspos("EFE2", 1, "EPM2", xIron2,  yIron2, zfea, 0, "ONLY");
    1325           1 :   TVirtualMC::GetMC()->Gspos("ELDA", 1, "EPM2", xLead2,  yLead2, zpba, jhrot12, "ONLY"); 
    1326             :   
    1327             :   
    1328             :   // FOR SHORT TYPE
    1329             :   Float_t xLead3,yLead3,zLead3, xLead4,yLead4,zLead4;
    1330             :   Float_t xIron3,yIron3,zIron3, xIron4,yIron4,zIron4;
    1331             :   
    1332             :   
    1333             :   xIron3 =  16.0/2.- 0.1/2.;  // half of 0.1cm is added as 1mm SS sheet is placed ; 
    1334             :   yIron3 = 0.;
    1335             :   zIron3 = zfea;
    1336             :   
    1337             :   xIron4 = - 16.0/2.+ 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed; 
    1338             :   yIron4 = 0.;
    1339             :   zIron4 = zfea;    
    1340             :   
    1341             :   xLead3 = xIron3 + 23.2/2.; 
    1342             :   yLead3 = -5.2/2.;
    1343             :   zLead3 = zpba;
    1344             :   
    1345             :   xLead4 = xIron4 - 23.2/2.; 
    1346             :   yLead4 = 9.8/2.;
    1347             :   zLead4 = zpba;    
    1348             :   
    1349           1 :   TVirtualMC::GetMC()->Gspos("EFE3", 1,  "EPM3",  xIron3,  yIron3,  zfea, 0, "ONLY");
    1350           1 :   TVirtualMC::GetMC()->Gspos("ELDB", 1,  "EPM3",  xLead3,  yLead3,  zpba, 0, "ONLY"); 
    1351           1 :   TVirtualMC::GetMC()->Gspos("EFE4", 1,  "EPM4",  xIron4,  yIron4,  zfea, 0, "ONLY");
    1352           1 :   TVirtualMC::GetMC()->Gspos("ELDB", 1,  "EPM4",  xLead4,  yLead4,  zpba, jhrot12, "ONLY"); 
    1353             :   
    1354             :   //===================================================================//
    1355             :   // Placement of FR4 sheets as encloser of full profile of PMD
    1356             : 
    1357           1 :   TVirtualMC::GetMC()->Gspos("ECC1", 1, "EPM1",  xIron1, yIron1, -8.45,  0, "ONLY");
    1358           1 :   TVirtualMC::GetMC()->Gspos("ECC2", 1, "EPM2",  xIron2, yIron2, -8.45,  0,"ONLY");
    1359           1 :   TVirtualMC::GetMC()->Gspos("ECC3", 1, "EPM3",  xIron3, yIron3, -8.45, 0,"ONLY");
    1360           1 :   TVirtualMC::GetMC()->Gspos("ECC4", 1, "EPM4",  xIron4, yIron4, -8.45, 0,"ONLY");
    1361             : 
    1362           1 :   TVirtualMC::GetMC()->Gspos("ECC1", 2, "EPM1",  xIron1, yIron1,  8.45, 0, "ONLY");
    1363           1 :   TVirtualMC::GetMC()->Gspos("ECC2", 2, "EPM2",  xIron2, yIron2,  8.45, 0,"ONLY");
    1364           1 :   TVirtualMC::GetMC()->Gspos("ECC3", 2, "EPM3",  xIron3, yIron3,  8.45, 0,"ONLY");
    1365           1 :   TVirtualMC::GetMC()->Gspos("ECC4", 2, "EPM4",  xIron4, yIron4,  8.45, 0,"ONLY");
    1366             : 
    1367             :   //----------------- NOW TO PLACE SS-CHANNELS -----------------------// 
    1368             :   
    1369             :   Float_t xchanepm11, ychanepm11,ychanepm12;
    1370             :   Float_t xchanepm21, ychanepm21,ychanepm22;
    1371             :   Float_t xchanepm31, ychanepm31,ychanepm32,ychanepm33,ychanepm34;
    1372             :   Float_t xchanepm41, ychanepm41,ychanepm42,ychanepm43,ychanepm44;
    1373             :   
    1374             :   xchanepm11 = xLead1;
    1375           1 :   ychanepm11 = ya1 + yLead1 + dboxSS1[1] + 0.1 + 0.1/2.;
    1376           1 :   ychanepm12 = ya1 + yLead1 - dboxSS1[1] - 0.1 - 0.1/2.;
    1377             :   
    1378             :   xchanepm21 = xLead2;
    1379           1 :   ychanepm21 = -ya1 + yLead2 - dboxSS1[1] - 0.1 - 0.1/2.;
    1380           1 :   ychanepm22 = -ya1 + yLead2 + dboxSS1[1] + 0.1 + 0.1/2.;
    1381             :   
    1382           1 :   TVirtualMC::GetMC()->Gspos("ECHA", 1, "EPM1", xchanepm11, ychanepm11, zchanPS,   0, "ONLY");
    1383           1 :   TVirtualMC::GetMC()->Gspos("ECHA", 2, "EPM1", xchanepm11, ychanepm12, zchanPS,   0, "ONLY"); 
    1384           1 :   TVirtualMC::GetMC()->Gspos("ECHA", 3, "EPM1", xchanepm11, ychanepm11, zchanVeto, 0, "ONLY");
    1385           1 :   TVirtualMC::GetMC()->Gspos("ECHA", 4, "EPM1", xchanepm11, ychanepm12, zchanVeto, 0, "ONLY"); 
    1386           1 :   TVirtualMC::GetMC()->Gspos("ECHA", 1, "EPM2", xchanepm21, ychanepm21, zchanPS,   0, "ONLY");
    1387           1 :   TVirtualMC::GetMC()->Gspos("ECHA", 2, "EPM2", xchanepm21, ychanepm22, zchanPS,   0, "ONLY"); 
    1388           1 :   TVirtualMC::GetMC()->Gspos("ECHA", 3, "EPM2", xchanepm21, ychanepm21, zchanVeto, 0, "ONLY");
    1389           1 :   TVirtualMC::GetMC()->Gspos("ECHA", 4, "EPM2", xchanepm21, ychanepm22, zchanVeto, 0, "ONLY"); 
    1390             :   
    1391             :   xchanepm31 = xLead3;
    1392           1 :   ychanepm31 = yb1 + yLead3 + dboxSS2[1] + 0.1 + 0.1/2.;
    1393           1 :   ychanepm32 = yb1 + yLead3 - dboxSS2[1] - 0.1 - 0.1/2.;
    1394           1 :   ychanepm33 = yb3 + yLead3 + dboxSS2[1] + 0.1 + 0.1/2.;
    1395           1 :   ychanepm34 = yb3 + yLead3 - dboxSS2[1] - 0.1 - 0.1/2.;
    1396             :   
    1397             :   xchanepm41 = xLead4;
    1398           1 :   ychanepm41 = -yb1 + yLead4 - dboxSS2[1] - 0.1 - 0.1/2.;
    1399           1 :   ychanepm42 = -yb1 + yLead4 + dboxSS2[1] + 0.1 + 0.1/2.;
    1400           1 :   ychanepm43 = -yb3 + yLead4 - dboxSS2[1] - 0.1 - 0.1/2.;
    1401           1 :   ychanepm44 = -yb3 + yLead4 + dboxSS2[1] + 0.1 + 0.1/2.;
    1402             :   
    1403             :   
    1404           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 1, "EPM3", xchanepm31, ychanepm31, zchanPS, 0, "ONLY");
    1405           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 2, "EPM3", xchanepm31, ychanepm32, zchanPS, 0, "ONLY"); 
    1406           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 3, "EPM3", xchanepm31, ychanepm33, zchanPS, 0, "ONLY");
    1407           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 4, "EPM3", xchanepm31, ychanepm34 + 0.200005, zchanPS, 0, "ONLY"); 
    1408             :   // Because of overlaping a factor 0.200005 is added in ychanepm34
    1409             :   
    1410           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 5, "EPM3", xchanepm31, ychanepm31, zchanVeto, 0, "ONLY");
    1411           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 6, "EPM3", xchanepm31, ychanepm32, zchanVeto, 0, "ONLY"); 
    1412           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 7, "EPM3", xchanepm31, ychanepm33, zchanVeto, 0, "ONLY");
    1413           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 8, "EPM3", xchanepm31, ychanepm34 + 0.200005, zchanVeto, 0, "ONLY"); 
    1414             :   // Because of overlaping a factor 0.200005 is added in ychanepm34
    1415             :   
    1416           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 1, "EPM4", xchanepm41, ychanepm41, zchanPS, 0, "ONLY");
    1417           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 2, "EPM4", xchanepm41, ychanepm42, zchanPS, 0, "ONLY"); 
    1418           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 3, "EPM4", xchanepm41, ychanepm43, zchanPS, 0, "ONLY");
    1419           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 4, "EPM4", xchanepm41, ychanepm44 - 0.200002, zchanPS, 0, "ONLY"); 
    1420             :   // Because of overlaping a factor 0.200002 is subtracted in ychanepm44
    1421             : 
    1422           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 5, "EPM4", xchanepm41, ychanepm41, zchanVeto, 0, "ONLY");
    1423           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 6, "EPM4", xchanepm41, ychanepm42, zchanVeto, 0, "ONLY"); 
    1424           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 7, "EPM4", xchanepm41, ychanepm43, zchanVeto, 0, "ONLY");
    1425           1 :   TVirtualMC::GetMC()->Gspos("ECHB", 8, "EPM4", xchanepm41, ychanepm44 -0.200002, zchanVeto, 0, "ONLY"); 
    1426             :   // Because of overlaping a factor 0.200002 is subtracted in ychanepm44
    1427             : 
    1428             :   //================= Channel Placement Completed  ======================//
    1429             :   //============ Now to Create Al Box and then LVDBs and Cables          //
    1430             :   //             are Placed inside it                                    //
    1431             : 
    1432             :   // Eight Al Boxes are created, four on Preshower side 
    1433             :   // and four on Veto side
    1434             : 
    1435             :   // FOR PRESHOWER
    1436             : 
    1437             :   // First to Create hollow Al Box
    1438             :   // there are two types of modules, therefore, two Al box of
    1439             :   // long type and two of short type are created
    1440             : 
    1441             :   // For Long Type
    1442             :   // X-dimension = 16.5cm
    1443             :   // Y-dimension = same as EFE1
    1444             :   // Z-dimension = 7.4cm
    1445             :   // Integer assigned to Al medium is 603
    1446             : 
    1447           1 :   Float_t esvdA1[3];
    1448           1 :   esvdA1[0]= 16.5/2.;
    1449           1 :   esvdA1[1]= dboxFea1[1];
    1450           1 :   esvdA1[2]= 7.4/2.;
    1451             :   
    1452           1 :   TVirtualMC::GetMC()->Gsvolu("ESV1", "BOX", idtmed[603], esvdA1, 3);
    1453           1 :   TVirtualMC::GetMC()->Gsvolu("ESV2", "BOX", idtmed[603], esvdA1, 3);
    1454             :   
    1455             :   // Create Air strip for Al Boxes type-A
    1456             :   // Al boxes are 3mm thick In X and Z on both sides
    1457             :   // X-dimension = 16.5cm - 0.3cm
    1458             :   // Y-dimension = same as EFE1
    1459             :   // Z-dimension = 7.4cm - 0.3cm
    1460             : 
    1461           1 :   Float_t eairA1[3];
    1462           1 :   eairA1[0]= esvdA1[0] - 0.3;
    1463           1 :   eairA1[1]= esvdA1[1];
    1464           1 :   eairA1[2]= esvdA1[2] - 0.3;
    1465             : 
    1466           1 :   TVirtualMC::GetMC()->Gsvolu("EIR1", "BOX", idtmed[698], eairA1, 3);
    1467           1 :   TVirtualMC::GetMC()->Gsvolu("EIR2", "BOX", idtmed[698], eairA1, 3);
    1468             : 
    1469             :   // Put air strips EIR1 & EIR2 inside ESV1 & ESV2 respectively    
    1470           1 :   TVirtualMC::GetMC()->Gspos("EIR1", 1,  "ESV1", 0., 0., 0., 0, "ONLY");
    1471           1 :   TVirtualMC::GetMC()->Gspos("EIR2", 1,  "ESV2", 0., 0., 0., 0, "ONLY");
    1472             :   
    1473             : 
    1474             :   // For Short Type
    1475             :   // X-dimension = 16.5cm
    1476             :   // Y-dimension = same as EFE3
    1477             :   // Z-dimension = 7.4cm
    1478             :   
    1479           1 :   Float_t esvdA2[3];
    1480           1 :   esvdA2[0]= esvdA1[0];
    1481           1 :   esvdA2[1]= dboxFea3[1];
    1482           1 :   esvdA2[2]= esvdA1[2];
    1483             : 
    1484           1 :   TVirtualMC::GetMC()->Gsvolu("ESV3", "BOX", idtmed[603], esvdA2, 3);
    1485           1 :   TVirtualMC::GetMC()->Gsvolu("ESV4", "BOX", idtmed[603], esvdA2, 3);
    1486             :   
    1487             :   // Create Air strip for Al Boxes type-B
    1488             :   // Al boxes are 3mm thick In X and Z on both sides
    1489             :   // X-dimension = 16.5cm - 0.3cm
    1490             :   // Y-dimension = same as EFE3
    1491             :   // Z-dimension = 7.4cm - 0.3cm
    1492             : 
    1493           1 :   Float_t eairA2[3];
    1494           1 :   eairA2[0]= esvdA2[0] - 0.3;
    1495           1 :   eairA2[1]= esvdA2[1];
    1496           1 :   eairA2[2]= esvdA2[2] - 0.3;
    1497             : 
    1498           1 :   TVirtualMC::GetMC()->Gsvolu("EIR3", "BOX", idtmed[698], eairA2, 3);
    1499           1 :   TVirtualMC::GetMC()->Gsvolu("EIR4", "BOX", idtmed[698], eairA2, 3);
    1500             :   
    1501             :   // Put air strips EIR3 & EIR4 inside ESV3 & ESV4 respectively        
    1502           1 :   TVirtualMC::GetMC()->Gspos("EIR3", 1,  "ESV3", 0., 0., 0., 0, "ONLY");
    1503           1 :   TVirtualMC::GetMC()->Gspos("EIR4", 1,  "ESV4", 0., 0., 0., 0, "ONLY");
    1504             :   
    1505             :   
    1506             :   // FOR VETO
    1507             : 
    1508             :   // First to Create hollow Al Box
    1509             :   // there are two types of modules, therefore, two Al box of
    1510             :   // long type and two of short type are created
    1511             : 
    1512             :   // For Long Type
    1513             :   // X-dimension = 16.5cm
    1514             :   // Y-dimension = same as EFE1
    1515             :   // Z-dimension = 8.9cm
    1516             :   // Integer assigned to Al medium is 603
    1517             :   
    1518           1 :   Float_t esvdB1[3];
    1519           1 :   esvdB1[0]= 16.5/2.;
    1520           1 :   esvdB1[1]= dboxFea1[1];
    1521           1 :   esvdB1[2]= 8.9/2.;
    1522             : 
    1523           1 :   TVirtualMC::GetMC()->Gsvolu("EVV1", "BOX", idtmed[603], esvdB1, 3);
    1524           1 :   TVirtualMC::GetMC()->Gsvolu("EVV2", "BOX", idtmed[603], esvdB1, 3);
    1525             : 
    1526             :   // Create Air strip for Al Boxes long type
    1527             :   // Al boxes are 3mm thick In X and Z on both sides
    1528             :   // X-dimension = 16.5cm - 0.3cm
    1529             :   // Y-dimension = same as EFE1
    1530             :   // Z-dimension = 8.9cm - 0.3cm
    1531             : 
    1532           1 :   Float_t eairB1[3];
    1533           1 :   eairB1[0]= esvdB1[0] - 0.3;
    1534           1 :   eairB1[1]= esvdB1[1];
    1535           1 :   eairB1[2]= esvdB1[2] - 0.3;
    1536             : 
    1537           1 :   TVirtualMC::GetMC()->Gsvolu("EIR5", "BOX", idtmed[698], eairB1, 3);
    1538           1 :   TVirtualMC::GetMC()->Gsvolu("EIR6", "BOX", idtmed[698], eairB1, 3);
    1539             :  
    1540             :   // Put air strips EIR5 & EIR6 inside EVV1 & EVV2 respectively        
    1541           1 :   TVirtualMC::GetMC()->Gspos("EIR5", 1,  "EVV1", 0., 0., 0., 0, "ONLY");
    1542           1 :   TVirtualMC::GetMC()->Gspos("EIR6", 1,  "EVV2", 0., 0., 0., 0, "ONLY");
    1543             : 
    1544             : 
    1545             :   // For Short Type
    1546             :   // X-dimension = 16.5cm
    1547             :   // Y-dimension = same as EFE3
    1548             :   // Z-dimension = 8.9cm
    1549             :   // Integer assigned to Al medium is 603
    1550             :   
    1551           1 :   Float_t esvdB2[3];
    1552           1 :   esvdB2[0]= esvdB1[0];
    1553           1 :   esvdB2[1]= dboxFea3[1];
    1554           1 :   esvdB2[2]= esvdB1[2];
    1555             : 
    1556           1 :   TVirtualMC::GetMC()->Gsvolu("EVV3", "BOX", idtmed[603], esvdB2, 3);
    1557           1 :   TVirtualMC::GetMC()->Gsvolu("EVV4", "BOX", idtmed[603], esvdB2, 3);
    1558             : 
    1559             :   
    1560             :   // Create Air strip for Al Boxes short type
    1561             :   // Al boxes are 3mm thick In X and Z on both sides
    1562             :   // X-dimension = 16.5cm - 0.3cm
    1563             :   // Y-dimension = same as EFE3
    1564             :   // Z-dimension = 8.9cm - 0.3cm
    1565             :   
    1566           1 :   Float_t eairB2[3];
    1567           1 :   eairB2[0]= esvdB2[0] - 0.3;
    1568           1 :   eairB2[1]= esvdB2[1];
    1569           1 :   eairB2[2]= esvdB2[2] - 0.3;
    1570             :   
    1571           1 :   TVirtualMC::GetMC()->Gsvolu("EIR7", "BOX", idtmed[698], eairB2, 3);
    1572           1 :   TVirtualMC::GetMC()->Gsvolu("EIR8", "BOX", idtmed[698], eairB2, 3);
    1573             :   
    1574             :   // Put air strips EIR7 & EIR8 inside EVV3 & EVV4 respectively      
    1575           1 :   TVirtualMC::GetMC()->Gspos("EIR7", 1,  "EVV3", 0., 0., 0., 0, "ONLY");
    1576           1 :   TVirtualMC::GetMC()->Gspos("EIR8", 1,  "EVV4", 0., 0., 0., 0, "ONLY");
    1577             :   
    1578             :   //------------ Al Boxes Completed ----------------------/
    1579             :   
    1580             :   //--------------Now Create LVDBs----------------------/
    1581             :   
    1582             :   // LVDBs are the volumes of G10
    1583             :   // X-dimension = 10.0cm
    1584             :   // Y-dimension = 8.0cm
    1585             :   // Z-dimension = 0.2cm
    1586             :   // Integer assigned to the G10 medium is 607
    1587             :   
    1588           1 :   Float_t elvdb[3];
    1589           1 :   elvdb[0]= 10.0/2.;
    1590           1 :   elvdb[1]= 8.0/2.;
    1591           1 :   elvdb[2]= 0.2/2.;
    1592             :   
    1593           1 :   TVirtualMC::GetMC()->Gsvolu("ELVD", "BOX", idtmed[607], elvdb, 3);
    1594             :   
    1595             : 
    1596             :   // Put the LVDBs inside Air Boxes
    1597           1 :   Float_t yesvd = dboxFea1[1] - 25.0 - 4.0;
    1598             :   
    1599          14 :   for(Int_t jj =1; jj<=6; jj++){
    1600             :     
    1601           6 :     TVirtualMC::GetMC()->Gspos("ELVD", jj,  "EIR1", 0., yesvd, 0., 0, "ONLY");
    1602           6 :     TVirtualMC::GetMC()->Gspos("ELVD", jj,  "EIR2", 0., yesvd, 0., 0, "ONLY");
    1603             : 
    1604           6 :     yesvd = yesvd -  4.0 - 0.5 - 4.0;
    1605             :     
    1606             :   }
    1607             :   
    1608           1 :   yesvd = dboxFea3[1] - 15.0 - 4.0;
    1609             :   
    1610          14 :   for(Int_t jj =1; jj<=6; jj++){
    1611             :     
    1612           6 :     TVirtualMC::GetMC()->Gspos("ELVD", jj,  "EIR3", 0., yesvd, 0., 0, "ONLY");
    1613           6 :     TVirtualMC::GetMC()->Gspos("ELVD", jj,  "EIR4", 0., yesvd, 0., 0, "ONLY");
    1614             : 
    1615           6 :     yesvd = yesvd -  4.0 - 0.5 - 4.0;
    1616             :   }
    1617             :   
    1618           1 :   yesvd = dboxFea1[1] - 25.0 - 4.0;
    1619             :   
    1620          14 :   for(Int_t jj =1; jj<=6; jj++){
    1621             :     
    1622           6 :     TVirtualMC::GetMC()->Gspos("ELVD", jj,  "EIR5", 0., yesvd, 0., 0, "ONLY");
    1623           6 :     TVirtualMC::GetMC()->Gspos("ELVD", jj,  "EIR6", 0., yesvd, 0., 0, "ONLY");
    1624             : 
    1625           6 :     yesvd = yesvd -  4.0 - 0.5 - 4.0;
    1626             :   }
    1627             :   
    1628           1 :   yesvd = dboxFea3[1] - 15.0 - 4.0;
    1629             :   
    1630          14 :   for(Int_t jj =1; jj<=6; jj++){
    1631             :     
    1632           6 :     TVirtualMC::GetMC()->Gspos("ELVD", jj,  "EIR7", 0., yesvd, 0., 0, "ONLY");
    1633           6 :     TVirtualMC::GetMC()->Gspos("ELVD", jj,  "EIR8", 0., yesvd, 0., 0, "ONLY");
    1634             : 
    1635           6 :     yesvd = yesvd -  4.0 - 0.5 - 4.0;
    1636             :   }
    1637             : 
    1638             :   
    1639             :   //----------------- LVDBs Placement Completed--------------//
    1640             :   
    1641             :   // ------------ Now Create Cables ------------------------//
    1642             :   
    1643             :   // There are a number of cables
    1644             :   // We have reduced the number of volumes to 4
    1645             :   // And these 4 Volumes of Cables are placed repeatedly
    1646             :   // in the four quadrants (EPM1,2,3,4)
    1647             :   // The placement of Cables are in good approximations 
    1648             :   // The material medium for Cables is a mixture of Plastic
    1649             :   // and Copper(Cu). Therefore, in a good approximation a mixture
    1650             :   // is created and Integer assigned to this medium is 631
    1651             :   
    1652           1 :   Float_t cable1[3];
    1653           1 :   cable1[0] = 2.5/2.;
    1654           1 :   cable1[1] = dboxFea1[1];
    1655           1 :   cable1[2] = 2.4/2.;
    1656             :   
    1657           1 :   TVirtualMC::GetMC()->Gsvolu("ECB1", "BOX", idtmed[631], cable1, 3);
    1658             :   
    1659           1 :   Float_t cable2[3];
    1660           1 :   cable2[0] = 2.5/2.;
    1661           1 :   cable2[1] = dboxFea3[1];
    1662           1 :   cable2[2] = 2.4/2.;
    1663             :   
    1664           1 :   TVirtualMC::GetMC()->Gsvolu("ECB2", "BOX", idtmed[631], cable2, 3);
    1665             :   
    1666           1 :   Float_t cable3[3];
    1667           1 :   cable3[0] = 2.5/2.;
    1668           1 :   cable3[1] = dboxFea3[1] - dboxUM2[1];
    1669           1 :   cable3[2] = 2.4/2.;
    1670             :   
    1671           1 :   TVirtualMC::GetMC()->Gsvolu("ECB3", "BOX", idtmed[631], cable3, 3);
    1672             :   
    1673           1 :   Float_t cable4[3];
    1674           1 :   cable4[0] = 2.5/2.;
    1675           1 :   cable4[1] = dboxUM2[1];
    1676           1 :   cable4[2] = 2.4/2.;
    1677             :   
    1678           1 :   TVirtualMC::GetMC()->Gsvolu("ECB4", "BOX", idtmed[631], cable4, 3);
    1679             :   
    1680             :   // Calculation of the co-ordinates of Cables
    1681             : 
    1682             :   Float_t xcable11pm2, xcable12pm2, xcable2pm1, xcable2pm2,  xcable21pm4,  xcable22pm4;
    1683             :   Float_t xcable3pm1, xcable3pm3, xcable3pm4, xcable4pm3;
    1684             : 
    1685             :   Float_t ycable2pm1, ycable2pm2;
    1686             :   Float_t ycable3pm1, ycable3pm3, ycable3pm4, ycable4pm3;
    1687             :   
    1688             :   Float_t zcablePS, zcableVeto;
    1689             :   
    1690           1 :   xcable2pm1 = esvdA1[0] - 3.0 - cable1[0];
    1691           1 :   xcable3pm1 = xcable2pm1 - cable1[0] - 0.5 -  cable1[0];
    1692             :   
    1693           1 :   xcable11pm2 = -esvdA1[0]+ 3.0 + cable1[0];
    1694           1 :   xcable12pm2 = xcable11pm2 + cable1[0] + 0.5 + cable1[0];
    1695           1 :   xcable2pm2  = xcable12pm2 + cable1[0] + 0.5 + cable1[0];
    1696             :   
    1697           1 :   xcable3pm3 = -esvdB1[0] + 3.0 + cable1[0];
    1698           1 :   xcable4pm3 = xcable3pm3 + cable1[0] + 0.5 + cable1[0];
    1699             :   
    1700           1 :   xcable21pm4 = esvdB1[0] - 3.0 - cable1[0];
    1701           1 :   xcable22pm4 = xcable21pm4 - cable1[0] -0.5 - cable1[0];
    1702           1 :   xcable3pm4  = xcable22pm4 - cable1[0] -0.5 -cable1[0];
    1703             :   
    1704           1 :   ycable2pm1 = -(esvdA1[1] - esvdA2[1]);
    1705           1 :   ycable3pm1 = -esvdA1[1] + cable3[1];
    1706             :   
    1707             :   ycable2pm2 =  -(esvdA1[1] - esvdA2[1]);
    1708             :   
    1709             :   ycable3pm3 = -dboxUM2[1];
    1710           1 :   ycable4pm3 = -esvdA2[1] + dboxUM2[1];
    1711             :   
    1712             :   ycable3pm4 = -dboxUM2[1];
    1713             :   
    1714           1 :   zcablePS   = -esvdA1[2] + 0.3 + cable1[2];
    1715           1 :   zcableVeto =  esvdB1[2] - 0.3 - cable1[2];
    1716             : 
    1717             : 
    1718             : 
    1719             :   // Placement of Cables in Air Boxes
    1720           1 :   TVirtualMC::GetMC()->Gspos("ECB2", 1,  "EIR1", xcable2pm1, ycable2pm1, zcablePS, 0, "ONLY");
    1721           1 :   TVirtualMC::GetMC()->Gspos("ECB3", 1,  "EIR1", xcable3pm1, ycable3pm1, zcablePS, 0, "ONLY");
    1722           1 :   TVirtualMC::GetMC()->Gspos("ECB2", 1,  "EIR5", xcable2pm1, ycable2pm1, zcableVeto, 0, "ONLY");
    1723           1 :   TVirtualMC::GetMC()->Gspos("ECB3", 1,  "EIR5", xcable3pm1, ycable3pm1, zcableVeto, 0, "ONLY");
    1724             :   
    1725           1 :   TVirtualMC::GetMC()->Gspos("ECB1", 1,  "EIR2", xcable11pm2,    0.,     zcablePS, 0, "ONLY");
    1726           1 :   TVirtualMC::GetMC()->Gspos("ECB1", 2,  "EIR2", xcable12pm2,    0.,     zcablePS, 0, "ONLY");
    1727           1 :   TVirtualMC::GetMC()->Gspos("ECB2", 1,  "EIR2", xcable2pm2, ycable2pm2, zcablePS, 0, "ONLY");
    1728           1 :   TVirtualMC::GetMC()->Gspos("ECB1", 1,  "EIR6", xcable11pm2,    0.,     zcableVeto, 0, "ONLY");
    1729           1 :   TVirtualMC::GetMC()->Gspos("ECB1", 2,  "EIR6", xcable12pm2,    0.,     zcableVeto, 0, "ONLY");
    1730           1 :   TVirtualMC::GetMC()->Gspos("ECB2", 1,  "EIR6", xcable2pm2, ycable2pm2, zcableVeto, 0, "ONLY");
    1731             :   
    1732           1 :   TVirtualMC::GetMC()->Gspos("ECB3", 1,  "EIR3", xcable3pm3, ycable3pm3, zcablePS, 0, "ONLY");
    1733           1 :   TVirtualMC::GetMC()->Gspos("ECB4", 1,  "EIR3", xcable4pm3, ycable4pm3, zcablePS, 0, "ONLY");
    1734           1 :   TVirtualMC::GetMC()->Gspos("ECB3", 1,  "EIR7", xcable3pm3, ycable3pm3, zcableVeto, 0, "ONLY");
    1735           1 :   TVirtualMC::GetMC()->Gspos("ECB4", 1,  "EIR7", xcable4pm3, ycable4pm3, zcableVeto, 0, "ONLY");
    1736             :   
    1737           1 :   TVirtualMC::GetMC()->Gspos("ECB2", 1,  "EIR4", xcable21pm4,    0.,     zcablePS, 0, "ONLY");
    1738           1 :   TVirtualMC::GetMC()->Gspos("ECB2", 2,  "EIR4", xcable22pm4,    0.,     zcablePS, 0, "ONLY");
    1739           1 :   TVirtualMC::GetMC()->Gspos("ECB3", 1,  "EIR4", xcable3pm4, ycable3pm4, zcablePS, 0, "ONLY");
    1740           1 :   TVirtualMC::GetMC()->Gspos("ECB2", 1,  "EIR8", xcable21pm4,    0.,     zcableVeto, 0, "ONLY");
    1741           1 :   TVirtualMC::GetMC()->Gspos("ECB2", 2,  "EIR8", xcable22pm4,    0.,     zcableVeto, 0, "ONLY");
    1742           1 :   TVirtualMC::GetMC()->Gspos("ECB3", 1,  "EIR8", xcable3pm4, ycable3pm4, zcableVeto, 0, "ONLY");
    1743             :      
    1744             : 
    1745             : 
    1746             :   //=============== NOW POSITIONING THE Al Boxes IN EPM'S================//
    1747             :   
    1748             :    
    1749           1 :   TVirtualMC::GetMC()->Gspos("ESV1", 1,  "EPM1",  dboxFea1[0]  - esvdA1[0] - 8.0,  0., zelvdbPS, 0, "ONLY");
    1750           1 :   TVirtualMC::GetMC()->Gspos("EVV1", 1,  "EPM1",  dboxFea1[0]  - esvdB1[0] - 8.0,  0., zelvdbVeto, 0, "ONLY");
    1751             :   
    1752           1 :   TVirtualMC::GetMC()->Gspos("ESV2", 1,  "EPM2", -dboxFea2[0]  + esvdA1[0] + 8.0, 2.3, zelvdbPS, 0, "ONLY");
    1753           1 :   TVirtualMC::GetMC()->Gspos("EVV2", 1,  "EPM2", -dboxFea2[0]  + esvdB1[0] + 8.0, 2.3, zelvdbVeto, 0, "ONLY");
    1754             :   
    1755           1 :   TVirtualMC::GetMC()->Gspos("ESV3", 1,  "EPM3", -dboxFea3[0]  + esvdA1[0] + 8.0,  0., zelvdbPS, 0, "ONLY");
    1756           1 :   TVirtualMC::GetMC()->Gspos("EVV3", 1,  "EPM3", -dboxFea3[0]  + esvdB1[0] + 8.0,  0., zelvdbVeto, 0, "ONLY");
    1757             :   
    1758           1 :   TVirtualMC::GetMC()->Gspos("ESV4", 1,  "EPM4",  dboxFea4[0]  - esvdA1[0] - 8.0, 2.3, zelvdbPS, 0, "ONLY");
    1759           1 :   TVirtualMC::GetMC()->Gspos("EVV4", 1,  "EPM4",  dboxFea4[0]  - esvdB1[0] - 8.0, 2.3, zelvdbVeto, 0, "ONLY");
    1760             :   
    1761             :   //==================================================================//
    1762             :   //====================== LAST THING IS TO INSTALL ELMB ================//
    1763             :   
    1764             :   // ELMB,s are the G10 Volumes
    1765             : 
    1766             :   // First to create Air Volume to place ELMBs
    1767           1 :   Float_t xelmb[3];
    1768           1 :   xelmb[0] = 10.0;
    1769           1 :   xelmb[1] = 4.0;
    1770           1 :   xelmb[2] = 0.5;
    1771             :   
    1772           1 :   TVirtualMC::GetMC()->Gsvolu("ELMB", "BOX", idtmed[698], xelmb, 3);
    1773             :   
    1774             :   // There are more G10 Volumes
    1775             :   // But in approximation, we reduced them to two
    1776             :   // ELM1 & ELM2
    1777             :   
    1778           1 :   Float_t xelmb1[3];
    1779           1 :   xelmb1[0] = 9.7;
    1780           1 :   xelmb1[1] = 3.6;
    1781           1 :   xelmb1[2] = 0.1;
    1782             :   
    1783           1 :   TVirtualMC::GetMC()->Gsvolu("ELM1", "BOX", idtmed[607], xelmb1, 3);
    1784             :   
    1785           1 :   Float_t xelmb2[3];
    1786           1 :   xelmb2[0] = 6.0;
    1787           1 :   xelmb2[1] = 3.0;
    1788           1 :   xelmb2[2] = 0.1;
    1789             :   
    1790           1 :   TVirtualMC::GetMC()->Gsvolu("ELM2", "BOX", idtmed[607], xelmb2, 3);
    1791             :   
    1792             :   /******** NOW POSITIONING THE G10 VOLUMES ELM1 & ELM2 IN ELMB **********/
    1793             :   
    1794           1 :   TVirtualMC::GetMC()->Gspos("ELM1", 1,  "ELMB",  0., 0., -0.3, 0, "ONLY");
    1795           1 :   TVirtualMC::GetMC()->Gspos("ELM2", 1,  "ELMB",  0., 0.,  0.3, 0, "ONLY");
    1796             :   
    1797             :   // Position co-ordinates of ELMBs in EPM2 & EPM4 
    1798             :   
    1799             :   Float_t xelmbepm2, xelmbepm4, yelmbepm2, yelmbepm4, zelmbPS, zelmbVeto;
    1800             :   
    1801           1 :   xelmbepm2 = -gaspmd2[0] + 16.0 +23.2 + 2.5 + xelmb[0];
    1802           1 :   xelmbepm4 =  gaspmd4[0] - 16.0 -23.2 - 2.5 - xelmb[0];
    1803             :   
    1804           1 :   yelmbepm2 = -gaspmd2[1] + 1.0 + xelmb[1];
    1805           1 :   yelmbepm4 = -gaspmd4[1] + 1.0 + xelmb[1];
    1806             :   
    1807           1 :   zelmbPS   = zfea + fgkThSteel/2.+  xelmb[2];
    1808           1 :   zelmbVeto = zfea - fgkThSteel/2.-  xelmb[2];
    1809             :   
    1810             :   /************ NOW PLACE ELMB'S IN EPM2 & EPM4 *********************/
    1811             :   
    1812             :   // There are total of 14 ELMB volumes
    1813             :   // three on both sides of EPM2 (total of 6)
    1814             :   // and four on both sides of EPM4 (total of 8)
    1815             :   // The ELMBs are placed at the bottom of 
    1816             :   // SS support, which is the extended part
    1817             :   
    1818             :   // Placement of ELMBs on EPM2
    1819           8 :   for(Int_t kk=1;kk<=3;kk++){
    1820           3 :     TVirtualMC::GetMC()->Gspos("ELMB", kk,  "EPM2",  xelmbepm2, yelmbepm2, zelmbPS, 0, "ONLY");
    1821           3 :     xelmbepm2 = xelmbepm2 + xelmb[0] + 0.5 + xelmb[0];
    1822             :   }
    1823             :   
    1824           1 :   xelmbepm2 = -gaspmd2[0] + 16.0 +23.2 + 2.5 + xelmb[0];
    1825             :   
    1826           8 :   for(Int_t kk=4;kk<=6;kk++){
    1827           3 :     TVirtualMC::GetMC()->Gspos("ELMB", kk, "EPM2", xelmbepm2, yelmbepm2, zelmbVeto, 0, "ONLY");
    1828           3 :     xelmbepm2 = xelmbepm2 + xelmb[0] + 0.5 + xelmb[0];
    1829             :   }
    1830             :   
    1831             :   // Placement of ELMBs on EPM4
    1832          10 :   for(Int_t kk=1;kk<=4;kk++){
    1833           4 :     TVirtualMC::GetMC()->Gspos("ELMB", kk, "EPM4", xelmbepm4, yelmbepm4, zelmbPS, 0, "ONLY");
    1834           4 :     xelmbepm4 = xelmbepm4 - xelmb[0] - 0.5 - xelmb[0];
    1835             :   }
    1836             :   
    1837           1 :   xelmbepm4 =  gaspmd4[0] - 16.0 -23.2 - 2.5 - xelmb[0];
    1838          10 :   for(Int_t kk=5;kk<=8;kk++){
    1839           4 :     TVirtualMC::GetMC()->Gspos("ELMB", kk, "EPM4", xelmbepm4, yelmbepm4, zelmbVeto, 0, "ONLY");
    1840           4 :     xelmbepm4 = xelmbepm4 - xelmb[0] - 0.5 - xelmb[0];
    1841             :   }
    1842             :   
    1843             :   //========= Placement of ELMBs Completed ============================/
    1844             :   
    1845             :   // -------------  Now to Place Unit Modules in four quadrants 
    1846             :   //                EPM1, EPM2, EPM3 & EPM4 ---------------------//
    1847             : 
    1848             :   // Position co-ordinates of Unit Modules
    1849             :   
    1850           1 :   Double_t xcord[24];
    1851           1 :   Double_t ycord[24];
    1852             :   
    1853           1 :   xcord[0]  = xa1;
    1854           1 :   xcord[1]  = xa2;
    1855           1 :   xcord[2]  = xa3;
    1856           1 :   xcord[3]  = xa1;
    1857           1 :   xcord[4]  = xa2;
    1858           1 :   xcord[5]  = xa3;
    1859           1 :   xcord[6]  = -xa1;
    1860           1 :   xcord[7]  = -xa2;
    1861           1 :   xcord[8]  = -xa3;
    1862           1 :   xcord[9]  = -xa1;
    1863           1 :   xcord[10] = -xa2;
    1864           1 :   xcord[11] = -xa3;
    1865           1 :   xcord[12] = xb1;
    1866           1 :   xcord[13] = xb2;
    1867           1 :   xcord[14] = xb1;
    1868           1 :   xcord[15] = xb2;
    1869           1 :   xcord[16] = xb1;
    1870           1 :   xcord[17] = xb2;
    1871           1 :   xcord[18] = -xb1;
    1872           1 :   xcord[19] = -xb2;
    1873           1 :   xcord[20] = -xb1;
    1874           1 :   xcord[21] = -xb2;
    1875           1 :   xcord[22] = -xb1;
    1876           1 :   xcord[23] = -xb2;
    1877             : 
    1878           1 :   ycord[0]  = ya1;
    1879           1 :   ycord[1]  = ya1;
    1880           1 :   ycord[2]  = ya1;
    1881           1 :   ycord[3]  = ya2;
    1882           1 :   ycord[4]  = ya2;
    1883           1 :   ycord[5]  = ya2;
    1884           1 :   ycord[6]  = -ya1;
    1885           1 :   ycord[7]  = -ya1;
    1886           1 :   ycord[8]  = -ya1;
    1887           1 :   ycord[9]  = -ya2;
    1888           1 :   ycord[10] = -ya2;
    1889           1 :   ycord[11] = -ya2;
    1890           1 :   ycord[12] = yb1;
    1891           1 :   ycord[13] = yb1;
    1892           1 :   ycord[14] = yb2;
    1893           1 :   ycord[15] = yb2;
    1894           1 :   ycord[16] = yb3+0.100007; //Because of overlapping the factor 0.100007 
    1895           1 :   ycord[17] = yb3+0.100007; // is added
    1896           1 :   ycord[18] = -yb1;
    1897           1 :   ycord[19] = -yb1;
    1898           1 :   ycord[20] = -yb2;
    1899           1 :   ycord[21] = -yb2;
    1900           1 :   ycord[22] = -yb3-0.100004; //Because of overlapping the factor 0.100007 
    1901           1 :   ycord[23] = -yb3-0.100004; // is added
    1902             :  
    1903             : 
    1904             :   // Placement of unit modules EUM1 & EUV1(long type)
    1905             :   // and EUM2 & EUV2(short type)
    1906             :   // in the four quadrants EPM1, EPM2, EPM3 & EPM4
    1907             :   
    1908          14 :   for(Int_t ii=0;ii<=5;ii++){
    1909           6 :     if(fModStatus[ii]){
    1910           6 :       TVirtualMC::GetMC()->Gspos("EUM1", ii, "EPM1", xcord[ii]+xLead1,ycord[ii]+yLead1, zpsa, 0, "ONLY");
    1911           6 :     }  
    1912             :   }
    1913             :   
    1914          14 :   for(Int_t ii=6;ii<=11;ii++){
    1915           6 :     if(fModStatus[ii]) {
    1916           6 :       TVirtualMC::GetMC()->Gspos("EUM1", ii, "EPM2", xcord[ii]+xLead2, ycord[ii]+yLead2, zpsa, jhrot12, "ONLY");
    1917           6 :     }
    1918             :   }
    1919             :   
    1920          14 :   for(Int_t ii=12;ii<=17;ii++){
    1921           6 :     if(fModStatus[ii]) {
    1922           6 :       TVirtualMC::GetMC()->Gspos("EUM2", ii, "EPM3", xcord[ii]+xLead3, ycord[ii]+yLead3, zpsa, 0, "ONLY");
    1923           6 :     }
    1924             :   }
    1925             :   
    1926          14 :   for(Int_t ii=18;ii<=23;ii++){
    1927           6 :     if(fModStatus[ii]) {
    1928           6 :       TVirtualMC::GetMC()->Gspos("EUM2", ii, "EPM4", xcord[ii]+xLead4, ycord[ii]+yLead4, zpsa, jhrot12, "ONLY");
    1929           6 :     }
    1930             :   }
    1931             :   
    1932          14 :   for(Int_t ii=24;ii<=29;ii++){
    1933           6 :     if(fModStatus[ii]) {
    1934           6 :       TVirtualMC::GetMC()->Gspos("EUV1", ii, "EPM1", xcord[ii-24]+xLead1, ycord[ii-24]+yLead1, zcva, 0, "ONLY");
    1935           6 :     }
    1936             :   }
    1937             :   
    1938          14 :   for(Int_t ii=30;ii<=35;ii++){
    1939           6 :     if(fModStatus[ii]) {
    1940           6 :       TVirtualMC::GetMC()->Gspos("EUV1", ii, "EPM2", xcord[ii-24]+xLead2, ycord[ii-24]+yLead2, zcva, jhrot12, "ONLY");
    1941           6 :     }
    1942             :   }
    1943             :   
    1944          14 :   for(Int_t ii=36;ii<=41;ii++){
    1945           6 :     if(fModStatus[ii]) {
    1946           6 :       TVirtualMC::GetMC()->Gspos("EUV2", ii, "EPM3", xcord[ii-24]+xLead3, ycord[ii-24]+yLead3, zcva, 0, "ONLY");
    1947           6 :     }
    1948             :   }
    1949             :   
    1950          14 :   for(Int_t ii=42;ii<=47;ii++){
    1951           6 :     if(fModStatus[ii]) {
    1952           6 :       TVirtualMC::GetMC()->Gspos("EUV2", ii, "EPM4", xcord[ii-24]+xLead4, ycord[ii-24]+yLead4, zcva, jhrot12, "ONLY");
    1953           6 :     }
    1954             :   }
    1955             :   
    1956             :   //-------------- Placement of Unit Modules Completed ---------------// 
    1957             :   
    1958             :   // ========== PLACE THE EPMD IN ALICE ======================//  
    1959             :   
    1960             :   // Now the Job to assemble the five mother volumes of PMD in ALICE
    1961             :   
    1962             :   // Z-distance of PMD from Interaction Point
    1963             : 
    1964             :   zp = fgkZdist;
    1965             :   
    1966             :   // X and Y-positions of the EPM1, EPM2, EPM3 & EPM4
    1967             :   Float_t xfinal,yfinal; 
    1968             :   Float_t xsm1,  xsm2,  xsm3,  xsm4;
    1969             :   Float_t ysm1,  ysm2,  ysm3,  ysm4;
    1970             :   
    1971           2 :   xfinal = (fSMLengthax + serviceX/2. + serviceXext/2. + 0.05) + 0.48/2. +
    1972           1 :     (fSMLengthbx + serviceX/2. + serviceXext/2.+ 0.05);
    1973             : 
    1974             :   //Extra width of the SS plate on Support Structure on X-side and 1mm thick SS for cooling encloser 
    1975             :   //Extra width of the SS plate on Support Structure on X-side for B-Type
    1976             :   
    1977           1 :   yfinal = (fSMLengthay + serviceYa/2.)+ 0.20/2 + (fSMLengthby + serviceYb/2.);
    1978             : 
    1979             :   //serviceYa is the Extra width of the SS plate on Support Structur on Y-side for EPM1 & EPM3 
    1980             :   //serviceYb is the Extra width of the SS plate on Support Structur on Y-side for EPM2 & EPM4
    1981             :   
    1982             :   
    1983           1 :   xsm1 =  xfinal  - (fSMLengthax + serviceX/2. + serviceXext/2. + 0.05);
    1984           1 :   ysm1 =  yfinal  - (fSMLengthay + serviceYa/2.) - 2.3;
    1985             :   
    1986           1 :   xsm2 =  -xfinal  + (fSMLengthax + serviceX/2. + serviceXext/2. + 0.05);
    1987           1 :   ysm2 =  -yfinal  + (fSMLengthay + serviceYb/2.) - 2.3;
    1988             :   
    1989           1 :   xsm3 =  -xfinal + (fSMLengthbx + serviceX/2. + serviceXext/2. + 0.05);
    1990           1 :   ysm3 =   yfinal - (fSMLengthby + serviceYa/2.) - 2.3;
    1991             :   
    1992           1 :   xsm4 =   xfinal - (fSMLengthbx + serviceX/2. + serviceXext/2. + 0.05);
    1993           1 :   ysm4 =  -yfinal + (fSMLengthby + serviceYb/2.) - 2.3;
    1994             :   
    1995             :   //Position Full PMD in ALICE   
    1996             :   //
    1997             :   //       EPM1                EPM3
    1998             :   //
    1999             :   //       EPM4                EPM2
    2000             :   //  (rotated EPM3)      (rotated EPM1)
    2001             :   //
    2002             :   //                EFGD
    2003             :   //        (Girders and its Carriage)
    2004             :   
    2005           1 :   TVirtualMC::GetMC()->Gspos("EPM1", 1, "ALIC",  xsm1,ysm1,zp, 0, "ONLY");
    2006           1 :   TVirtualMC::GetMC()->Gspos("EPM2", 1, "ALIC",  xsm2,ysm2,zp, 0, "ONLY");
    2007             :  
    2008           1 :   TVirtualMC::GetMC()->Gspos("EPM3", 1, "ALIC",  xsm3,ysm3,zp, 0, "ONLY");
    2009           1 :   TVirtualMC::GetMC()->Gspos("EPM4", 1, "ALIC",  xsm4,ysm4,zp, 0, "ONLY");
    2010             :   
    2011           1 :   TVirtualMC::GetMC()->Gspos("EFGD", 1, "ALIC", 0., yfinal + fulgrdr[1], zp, 0, "ONLY");  
    2012           1 : }
    2013             : 
    2014             : //_____________________________________________________________________________
    2015             : 
    2016             : void AliPMDv1::CreateMaterials()
    2017             : {
    2018             :   // Create materials for the PMD
    2019             :   //
    2020             :   // ORIGIN    : Y. P. VIYOGI 
    2021             :   //
    2022             :   //  cout << " Inside create materials " << endl;
    2023             :   
    2024           2 :   Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
    2025           1 :   Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
    2026             :   
    2027             :   // --- Define the various materials for GEANT --- 
    2028             :   
    2029           1 :   AliMaterial(1, "Pb    $", 207.19, 82., 11.35, .56, 18.5);
    2030             :   
    2031             :   // Argon
    2032             :   
    2033             :   Float_t dAr   = 0.001782;   // --- Ar density in g/cm3 --- 
    2034           1 :   Float_t x0Ar = 19.55 / dAr;
    2035           1 :   AliMaterial(2, "Argon$", 39.95, 18., dAr, x0Ar, 6.5e4);
    2036             :   
    2037             :   // --- CO2 --- 
    2038             :   
    2039           1 :   Float_t aCO2[2] = { 12.,16. };
    2040           1 :   Float_t zCO2[2] = { 6.,8. };
    2041           1 :   Float_t wCO2[2] = { 1.,2. };
    2042             :   Float_t dCO2    = 0.001977;
    2043           1 :   AliMixture(3, "CO2  $", aCO2, zCO2, dCO2, -2, wCO2);
    2044             :   
    2045           1 :   AliMaterial(4, "Al   $", 26.98, 13., 2.7, 8.9, 18.5);
    2046             :   
    2047             :   // ArCO2
    2048             :   
    2049           1 :   Float_t aArCO2[3] = {39.948,12.0107,15.9994};
    2050           1 :   Float_t zArCO2[3] = {18.,6.,8.};
    2051           1 :   Float_t wArCO2[3] = {0.7,0.08,0.22};
    2052             :   Float_t dArCO2    = dAr * 0.7 + dCO2 * 0.3;
    2053           1 :   AliMixture(5, "ArCO2$", aArCO2, zArCO2, dArCO2, 3, wArCO2);
    2054             :   
    2055           1 :   AliMaterial(6, "Fe   $", 55.85, 26., 7.87, 1.76, 18.5);
    2056             :   
    2057             :   // G10
    2058             :   
    2059           1 :   Float_t aG10[4]={1.,12.011,15.9994,28.086};
    2060           1 :   Float_t zG10[4]={1.,6.,8.,14.};
    2061           1 :   Float_t wG10[4]={0.15201,0.10641,0.49444,0.24714};
    2062           1 :   AliMixture(8,"G10",aG10,zG10,1.7,4,wG10);
    2063             :   
    2064           1 :   AliMaterial(15, "Cu   $", 63.54, 29., 8.96, 1.43, 15.);
    2065             :   
    2066             :   // Steel
    2067           1 :   Float_t aSteel[4] = { 55.847,51.9961,58.6934,28.0855 };
    2068           1 :   Float_t zSteel[4] = { 26.,24.,28.,14. };
    2069           1 :   Float_t wSteel[4] = { .715,.18,.1,.005 };
    2070             :   Float_t dSteel    = 7.88;
    2071           1 :   AliMixture(19, "STAINLESS STEEL$", aSteel, zSteel, dSteel, 4, wSteel); 
    2072             :   
    2073             :   
    2074             :   // --- CH2 : PLASTIC  --- 
    2075             :   
    2076           1 :   Float_t aCH2[2] = { 12.,1.};
    2077           1 :   Float_t zCH2[2] = { 6.,1.};
    2078           1 :   Float_t wCH2[2] = { 1.,2.};
    2079             :   Float_t dCH2    = 0.95;
    2080           1 :   AliMixture(31, "CH2  $", aCH2, zCH2, dCH2, -2, wCH2);
    2081             :   
    2082             :   // --- CABLES : 80% Plastic and 20% Copper  --- 
    2083             :   
    2084           1 :   Float_t aCABLE[3] = { 12.,1.,63.5 };
    2085           1 :   Float_t zCABLE[3] = { 6.,1.,29. };
    2086           1 :   Float_t wCABLE[3] = { 0.6857, 0.1143, 0.2};
    2087             :   Float_t dCABLE    = dCH2*0.8 + 8.96*0.2;
    2088           1 :   AliMixture(32, "CABLE  $", aCABLE, zCABLE, dCABLE, 3, wCABLE);
    2089             : 
    2090             :   
    2091             :   
    2092             :   //Air
    2093             :   
    2094           1 :   Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
    2095           1 :   Float_t zAir[4]={6.,7.,8.,18.};
    2096           1 :   Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
    2097             :   Float_t dAir1 = 1.20479E-10;
    2098             :   Float_t dAir = 1.20479E-3;
    2099           1 :   AliMixture(98, "Vacum$", aAir,  zAir, dAir1, 4, wAir);
    2100           1 :   AliMixture(99, "Air  $", aAir,  zAir, dAir , 4, wAir);
    2101             :   
    2102             :   // Define tracking media 
    2103           1 :   AliMedium(1,  "Pb conv.$", 1,  0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
    2104           1 :   AliMedium(4,  "Al      $", 4,  0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
    2105           1 :   AliMedium(5,  "ArCO2   $", 5,  1, 0, isxfld, sxmgmx, .1, .1, .10, .1);
    2106           1 :   AliMedium(6,  "Fe      $", 6,  0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
    2107           1 :   AliMedium(8,  "G10plate$", 8,  0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
    2108           1 :   AliMedium(15, "Cu      $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
    2109           1 :   AliMedium(19, "S  steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
    2110           1 :   AliMedium(32, "CABLE   $", 32, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
    2111           1 :   AliMedium(98, "Vacuum  $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
    2112           1 :   AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
    2113             :   
    2114           3 :   AliDebug(1,"Outside create materials");
    2115             :   
    2116           1 : }
    2117             : 
    2118             : //_____________________________________________________________________________
    2119             : 
    2120             : void AliPMDv1::Init()
    2121             : {
    2122             :   //
    2123             :   // Initialises PMD detector after it has been built
    2124             :   //
    2125             :   
    2126             :   //
    2127           4 :   AliDebug(2,"Inside Init");
    2128           3 :   AliDebug(2,"PMD simulation package (v1) initialised");
    2129           3 :   AliDebug(2,"parameters of pmd");
    2130           3 :   AliDebug(2,Form("%10.2f %10.2f %10.2f %10.2f\n",
    2131             :                   fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist));
    2132           1 :   Int_t *idtmed = fIdtmed->GetArray()-599;
    2133           1 :   fMedSens=idtmed[605-1];
    2134             :   // --- Generate explicitly delta rays in the iron, aluminium and lead --- 
    2135             :   // Gstpar is removed from this place and 
    2136             :   // the energy cut offs in the medium moved to galice.cuts
    2137             :   
    2138             :   //TVirtualMC::GetMC()->Gstpar(idtmed[605], "LOSS", 3.);
    2139             :   //TVirtualMC::GetMC()->Gstpar(idtmed[605], "DRAY", 1.);
    2140             :   
    2141             :   // Visualization of volumes
    2142           1 :   gGeoManager->SetVolumeAttribute("ECAR", "SEEN", 0);
    2143           1 :   gGeoManager->SetVolumeAttribute("ECCU", "SEEN", 1);
    2144           1 :   gGeoManager->SetVolumeAttribute("ECCU", "COLO", 4);
    2145           1 :   gGeoManager->SetVolumeAttribute("EST1", "SEEN", 0);
    2146           1 :   gGeoManager->SetVolumeAttribute("EST2", "SEEN", 0);
    2147           1 :   gGeoManager->SetVolumeAttribute("EHC1", "SEEN", 0);  
    2148           1 :   gGeoManager->SetVolumeAttribute("EHC2", "SEEN", 0);
    2149           1 :   gGeoManager->SetVolumeAttribute("EDGA", "SEEN", 1);
    2150           1 :   gGeoManager->SetVolumeAttribute("EDGB", "SEEN", 1);
    2151           1 :   gGeoManager->SetVolumeAttribute("EEGA", "SEEN", 1);
    2152           1 :   gGeoManager->SetVolumeAttribute("EEGB", "SEEN", 1);
    2153           1 :   gGeoManager->SetVolumeAttribute("EUM1", "SEEN", 0);
    2154           1 :   gGeoManager->SetVolumeAttribute("EUV1", "SEEN", 0);
    2155           1 :   gGeoManager->SetVolumeAttribute("EUM2", "SEEN", 0);
    2156           1 :   gGeoManager->SetVolumeAttribute("EUV2", "SEEN", 0);
    2157             : 
    2158             :  
    2159           1 :   gGeoManager->SetVolumeAttribute("EFEE", "SEEN", 0);
    2160           1 :   gGeoManager->SetVolumeAttribute("EFEE", "COLO", 4);
    2161           1 :   gGeoManager->SetVolumeAttribute("EFBA", "SEEN", 1);
    2162           1 :   gGeoManager->SetVolumeAttribute("EFBA", "COLO", 4);
    2163           1 :   gGeoManager->SetVolumeAttribute("EFBB", "SEEN", 0);
    2164           1 :   gGeoManager->SetVolumeAttribute("EFBB", "COLO", 4);
    2165             : 
    2166           1 :   gGeoManager->SetVolumeAttribute("ELDA", "SEEN", 0);
    2167           1 :   gGeoManager->SetVolumeAttribute("ELDB", "SEEN", 0);
    2168             : 
    2169           1 :   gGeoManager->SetVolumeAttribute("EFE1", "SEEN", 0); 
    2170           1 :   gGeoManager->SetVolumeAttribute("EFE2", "SEEN", 0);
    2171           1 :   gGeoManager->SetVolumeAttribute("EFE3", "SEEN", 0);
    2172           1 :   gGeoManager->SetVolumeAttribute("EFE4", "SEEN", 0);
    2173             : 
    2174           1 :   gGeoManager->SetVolumeAttribute("ESC1", "SEEN", 0);
    2175           1 :   gGeoManager->SetVolumeAttribute("ECC1", "COLO", 2);
    2176           1 :   gGeoManager->SetVolumeAttribute("ESC2", "SEEN", 0);
    2177           1 :   gGeoManager->SetVolumeAttribute("ECC2", "COLO", 2);
    2178           1 :   gGeoManager->SetVolumeAttribute("ESC3", "SEEN", 0);
    2179           1 :   gGeoManager->SetVolumeAttribute("ECC3", "COLO", 2);
    2180           1 :   gGeoManager->SetVolumeAttribute("ESC4", "SEEN", 0);
    2181           1 :   gGeoManager->SetVolumeAttribute("ECC4", "COLO", 2);
    2182             : 
    2183           1 :   gGeoManager->SetVolumeAttribute("ECC1", "SEEN", 0);
    2184           1 :   gGeoManager->SetVolumeAttribute("ECC2", "SEEN", 0);
    2185           1 :   gGeoManager->SetVolumeAttribute("ECC3", "SEEN", 0);
    2186           1 :   gGeoManager->SetVolumeAttribute("ECC4", "SEEN", 0);
    2187             : 
    2188           1 :   gGeoManager->SetVolumeAttribute("EPM1", "SEEN", 1);
    2189           1 :   gGeoManager->SetVolumeAttribute("EPM2", "SEEN", 1);
    2190           1 :   gGeoManager->SetVolumeAttribute("EPM3", "SEEN", 1);
    2191           1 :   gGeoManager->SetVolumeAttribute("EPM4", "SEEN", 1);
    2192             : 
    2193           1 :   gGeoManager->SetVolumeAttribute("ECB1", "SEEN", 0);
    2194           1 :   gGeoManager->SetVolumeAttribute("ECB2", "SEEN", 0);
    2195           1 :   gGeoManager->SetVolumeAttribute("ECB3", "SEEN", 0);
    2196           1 :   gGeoManager->SetVolumeAttribute("ECB4", "SEEN", 0);
    2197             : 
    2198           1 :   gGeoManager->SetVolumeAttribute("ELMB", "SEEN", 0);
    2199             :   
    2200           1 :   gGeoManager->SetVolumeAttribute("ESV1", "SEEN", 0);
    2201           1 :   gGeoManager->SetVolumeAttribute("ESV2", "SEEN", 0);
    2202           1 :   gGeoManager->SetVolumeAttribute("ESV3", "SEEN", 0);
    2203           1 :   gGeoManager->SetVolumeAttribute("ESV4", "SEEN", 0);
    2204             : 
    2205           1 :   gGeoManager->SetVolumeAttribute("EVV1", "SEEN", 0);
    2206           1 :   gGeoManager->SetVolumeAttribute("EVV2", "SEEN", 0);
    2207           1 :   gGeoManager->SetVolumeAttribute("EVV3", "SEEN", 0);
    2208           1 :   gGeoManager->SetVolumeAttribute("EVV4", "SEEN", 0);
    2209             : 
    2210           1 :   gGeoManager->SetVolumeAttribute("EFGD", "SEEN", 0);
    2211           1 : }
    2212             : 
    2213             : //_____________________________________________________________________________
    2214             : 
    2215             : void AliPMDv1::StepManager()
    2216             : {
    2217             :   //
    2218             :   // Called at each step in the PMD
    2219             :   //
    2220             :   
    2221      179040 :   Int_t   copy;
    2222       89520 :   Float_t hits[5], destep;
    2223       89520 :   Float_t center[3] = {0,0,0};
    2224       89520 :   Int_t   vol[6];
    2225             :   //const char *namep;
    2226             :   //    printf("Current vol  is ********  %s \n",namep);
    2227       97485 :   if(TVirtualMC::GetMC()->CurrentMedium() == fMedSens && (destep = TVirtualMC::GetMC()->Edep())) {
    2228             :     
    2229         575 :     TVirtualMC::GetMC()->CurrentVolID(copy);
    2230             :     //namep=TVirtualMC::GetMC()->CurrentVolName();
    2231             :     //  printf("Current vol  is %s \n",namep);
    2232         575 :     vol[0]=copy;
    2233             :     
    2234         575 :     TVirtualMC::GetMC()->CurrentVolOffID(1,copy);
    2235             :     //namep=TVirtualMC::GetMC()->CurrentVolOffName(1);
    2236             :     // printf("Current vol 11 is %s \n",namep);
    2237         575 :     vol[1]=copy;
    2238             :     
    2239         575 :     TVirtualMC::GetMC()->CurrentVolOffID(2,copy);
    2240             :     //namep=TVirtualMC::GetMC()->CurrentVolOffName(2);
    2241             :     // printf("Current vol 22 is %s \n",namep);
    2242         575 :     vol[2]=copy;
    2243             :     
    2244         575 :     TVirtualMC::GetMC()->CurrentVolOffID(3,copy);
    2245             :     //namep=TVirtualMC::GetMC()->CurrentVolOffName(3);
    2246             :     // printf("Current vol 33 is %s \n",namep);
    2247         575 :     vol[3]=copy;
    2248             :     
    2249         575 :     TVirtualMC::GetMC()->CurrentVolOffID(4,copy);
    2250             :     //namep=TVirtualMC::GetMC()->CurrentVolOffName(4);
    2251             :     // printf("Current vol 44 is %s \n",namep);
    2252         575 :     vol[4]=copy;
    2253             :     
    2254         575 :     TVirtualMC::GetMC()->CurrentVolOffID(5,copy);
    2255             :     //namep=TVirtualMC::GetMC()->CurrentVolOffName(5);
    2256             :     //printf("Current vol 55 is %s \n",namep);
    2257         575 :     vol[5]=copy;
    2258             : 
    2259             :     
    2260             :     // printf("volume number %4d %4d %4d %4d %4d %4d %10.3f \n",vol[0],vol[1],vol[2],vol[3],vol[4],vol[5],destep*1000000);// edep in MeV
    2261             :     
    2262             :     
    2263         575 :     TVirtualMC::GetMC()->Gdtom(center,hits,1);
    2264         575 :     hits[3] = destep*1e9; //Number in eV
    2265             : 
    2266             :     // this is for pile-up events
    2267         575 :     hits[4] = TVirtualMC::GetMC()->TrackTime();
    2268             : 
    2269         575 :     AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
    2270             : 
    2271         575 :     AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kPMD);
    2272             : 
    2273         575 :   }
    2274       89520 : }
    2275             : 
    2276             : 
    2277             : //------------------------------------------------------------------------
    2278             : // Get parameters
    2279             : 
    2280             : void AliPMDv1::GetParameters()
    2281             : {
    2282             :   // This gives all the parameters of the detector
    2283             :   // such as Length of Supermodules, type A, type B,
    2284             :   // thickness of the Supermodule
    2285             :   //
    2286             :   
    2287           2 :   fSMLengthax = 32.7434;
    2288             :   //The total length in X is due to the following components
    2289             :   // Factor 3 is because of 3 module length in X for this type
    2290             :   // fgkNcolUM1*fgkCellRadius (48 x 0.25): Total span of each module in X
    2291             :   // fgkCellRadius/2. : There is offset of 1/2 cell
    2292             :   // 0.05+0.05 : Insulation gaps etc
    2293             :   // fgkSSBoundary (0.3) : Boundary frame
    2294             :   // double XA = 3.0*((fgkCellRadius/fgkSqroot3by2*fgkNcolUM1)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + (2.0*0.075);
    2295             :   
    2296           1 :   fSMLengthbx = 42.6136;
    2297             :   //The total length in X is due to the following components
    2298             :   // Factor 2 is because of 2 module length in X for this type
    2299             :   // fgkNcolUM2*fgkCellRadius (96 x 0.25): Total span of each module in X
    2300             :   // fgkCellRadius/2. : There is offset of 1/2 cell
    2301             :   // 0.05+0.05 : Insulation gaps etc
    2302             :   // fgkSSBoundary (0.3) : Boundary frame
    2303             :   //double XB = 2.0*((fgkCellRadius/fgkSqroot3by2*fgkNcolUM2)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + 0.1; 
    2304             :   
    2305             : 
    2306             :   
    2307           1 :   fSMLengthay = 49.35;
    2308             :   //The total length in Y is due to the following components
    2309             :   // Factor 2 is because of 2 module length in Y for this type
    2310             :   // fgkCellRadius/fgkSqroot3by2)*fgkNrowUM1 (0.25/sqrt3/2 * 96): Total span of each module in Y
    2311             :   //  of strips
    2312             :   // 0.05+0.05 : Insulation gaps etc
    2313             :   // fgkSSBoundary (0.3) : Boundary frame
    2314             :   // 0.6cm is the channel width plus tolerance
    2315             :   // double  YA = 2.0*(fgkNrowUM1*fgkCellRadius+fgkCellRadius/2.+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) +  0.6/2.;
    2316             :   
    2317           1 :   fSMLengthby =  37.925;
    2318             :   //The total length in Y is due to the following components
    2319             :   // Factor 3 is because of 3 module length in Y for this type
    2320             :   // fgkCellRadius/fgkSqroot3by2)*fgkNrowUM2 (0.25/sqrt3/2 * 48): Total span of each module in Y
    2321             :   //  of strips
    2322             :   // 0.05+0.05 : Insulation gaps etc
    2323             :   // fgkSSBoundary (0.3) : Boundary frame
    2324             :   // 10mm is the channel width plus tolerance
    2325             :   //double YB = 3.0*((fgkNrowUM2*fgkCellRadius + fgkCellRadius/2.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + 1.0/2.;
    2326             :   
    2327             :   
    2328             :   //Thickness of a pre/veto plane 
    2329           1 :   fDthick     = fgkThSS/2. + 1.2;     // 1.2 added as FEE Board are now assembled with pre/veto
    2330             :   
    2331             :   //Thickness of the PMD ; 2.4 added for FEE boards 
    2332           1 :   fSMthickpmd    = 2.0*(fgkThSS/2.) +fgkThSteel/2.+fgkThLead/2.0 + 2.4/2.;
    2333             :   
    2334           1 :   fSMthick = 17.; //17 cm is the full profile of PMD
    2335             :   
    2336             :   
    2337           1 : }
    2338             : 
    2339             : 
    2340             : // ---------------------------------------------------------------
    2341             : void AliPMDv1::AddAlignableVolumes() const
    2342             : {
    2343             :   //
    2344             :   // Create entries for alignable volumes associating the symbolic volume
    2345             :   // name with the corresponding volume path. Needs to be syncronized with
    2346             :   // eventual changes in the geometry.
    2347             :   // 
    2348           2 :   SetSectorAlignable();
    2349             :   
    2350           1 : }
    2351             : // ----------------------------------------------------------------
    2352             : void AliPMDv1::SetSectorAlignable() const
    2353             : {
    2354             :   // 
    2355             :   
    2356           2 :   TString vpsector = "ALIC_1/EPM";
    2357           1 :   TString vpappend = "_1";
    2358             : 
    2359           1 :   TString snsector="PMD/Sector";
    2360             :   
    2361           2 :   TString volpath, symname;
    2362             :   
    2363          10 :   for(Int_t cnt=1; cnt<=4; cnt++){
    2364             :     //for(Int_t cnt=1; cnt<=4; cnt++){
    2365           4 :     volpath = vpsector;
    2366           4 :     volpath += cnt;
    2367           4 :     volpath += vpappend;
    2368           4 :     symname = snsector;
    2369           4 :     symname += cnt;
    2370          16 :     if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
    2371             :       {
    2372           0 :         AliFatal("Unable to set alignable entry!");
    2373             :       }
    2374             :   }
    2375           1 : }
    2376             : // ------------------------------------------------------------------
    2377             : void AliPMDv1::SetCpvOff()
    2378             : {
    2379             :   // Set the entire CPV plane off
    2380             : 
    2381           0 :   for (Int_t imodule = 24; imodule < 48; imodule++)
    2382           0 :     fModStatus[imodule] = 0;
    2383           0 : }
    2384             : // ------------------------------------------------------------------
    2385             : void AliPMDv1::SetPreOff()
    2386             : {
    2387             :   // Set the entire Preshower plane off
    2388             : 
    2389           0 :   for (Int_t imodule = 0; imodule < 24; imodule++)
    2390           0 :     fModStatus[imodule] = 0;
    2391             : 
    2392           0 : }
    2393             : // ------------------------------------------------------------------
    2394             : void AliPMDv1::SetModuleOff(Int_t imodule)
    2395             : {
    2396             :   // Set the individual module off
    2397             : 
    2398           0 :   fModStatus[imodule] = 0;
    2399             : 
    2400           0 : }

Generated by: LCOV version 1.11