+ gMC->Gsvolu("EFE2","BOX", idtmed[618], dboxFea2, 3);
+
+ // Create SS Support For EPM3
+
+ // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm)
+ // Y-dimension = fSMLengthby + Extended Iron Support(5.2cm)
+ // Z-dimension = thickness of Iron support(0.5cm)
+ // It is a Volume of SS
+ // Integer assigned to SS is 618
+
+ Float_t dboxFea3[3];
+ dboxFea3[0] = fSMLengthbx + serviceX/2.;
+ dboxFea3[1] = fSMLengthby + serviceYa/2.;
+ dboxFea3[2] = fgkThSteel/2.;
+
+ gMC->Gsvolu("EFE3","BOX", idtmed[618], dboxFea3, 3);
+
+ // Create SS Support For EPM4
+
+ // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm)
+ // Y-dimension = fSMLengthby + Extended Iron Support(9.8cm)
+ // Z-dimension = thickness of Iron support(0.5cm)
+ // It is a Volume of SS
+ // Integer assigned to SS is 618
+
+ Float_t dboxFea4[3];
+ dboxFea4[0] = fSMLengthbx + serviceX/2.;
+ dboxFea4[1] = fSMLengthby + serviceYb/2.;
+ dboxFea4[2] = fgkThSteel/2.;
+
+ gMC->Gsvolu("EFE4","BOX", idtmed[618], dboxFea4, 3);
+
+
+ //=============== Volumes for SS support are Completed =============//
+
+ // Create FR4 Sheets to enclose the PMD which are Placed parallel to the
+ // plane of the detector. Four FR4 sheets are created with the dimensions
+ // corresponding to the Iron Supports
+ // This is cooling encloser.
+
+ // Create FR4 sheet ECC1
+ // X-dimension = same as EFE1
+ // Y-dimension = same as EFE1
+ // Z-dimension = 0.1cm
+ // FR4 medium is same as that of G10
+ // Integer assigned to FR4 medium is 607
+
+ Float_t enclos1[3];
+ enclos1[0] = dboxFea1[0];
+ enclos1[1] = dboxFea1[1];
+ enclos1[2] = 0.05;
+
+ gMC->Gsvolu("ECC1", "BOX", idtmed[607], enclos1, 3);
+
+ // Create FR4 sheet ECC2
+ // X-dimension = same as EFE2
+ // Y-dimension = same as EFE2
+ // Z-dimension = 0.1cm
+
+ Float_t enclos2[3];
+ enclos2[0] = dboxFea2[0];
+ enclos2[1] = dboxFea2[1];
+ enclos2[2] = 0.05;
+
+ gMC->Gsvolu("ECC2", "BOX", idtmed[607], enclos2, 3);
+
+ // Create FR4 sheet ECC3
+ // X-dimension = same as EFE3
+ // Y-dimension = same as EFE3
+ // Z-dimension = 0.1cm
+
+ Float_t enclos3[3];
+ enclos3[0] = dboxFea3[0];
+ enclos3[1] = dboxFea3[1];
+ enclos3[2] = 0.05;
+
+ gMC->Gsvolu("ECC3", "BOX", idtmed[607], enclos3, 3);
+
+ // Create FR4 sheet ECC4
+ // X-dimension = same as EFE4
+ // Y-dimension = same as EFE4
+ // Z-dimension = 0.1cm
+
+ Float_t enclos4[3];
+ enclos4[0] = dboxFea4[0];
+ enclos4[1] = dboxFea4[1];
+ enclos4[2] = 0.05;
+
+ gMC->Gsvolu("ECC4", "BOX", idtmed[607], enclos4, 3);
+
+ //--------------- FR4 SHEETS COMPLETED ---------------------------//
+
+ //------------- Create the SS-Channels(Horizontal Rails) to Place
+ // Unit Modules on SS Support -------------------------------------//
+
+ // Two types of SS-Channels are created
+ // as we have two types of modules
+
+ // Create SS-channel for Long Type
+ // X-dimension = same as Lead Plate ELDA
+ // Y-dimension = 0.1cm
+ // Z-dimension = 2.0cm
+ // Volume medium is SS
+
+ Float_t channel12[3];
+ channel12[0] = fSMLengthax;
+ channel12[1] = 0.05;
+ channel12[2] = 2.0/2.;
+
+ gMC->Gsvolu("ECHA", "BOX", idtmed[618], channel12, 3);
+
+ // Create SS-channel for Short Type
+ // X-dimension = same as Lead Plate ELDB
+ // Y-dimension = 0.1cm
+ // Z-dimension = 2.0cm
+ // Volume medium is SS
+
+ Float_t channel34[3];
+ channel34[0] = fSMLengthbx;
+ channel34[1] = 0.05;
+ channel34[2] = 2.0/2.;
+
+ gMC->Gsvolu("ECHB", "BOX", idtmed[618], channel34, 3);
+
+ //----------------- SS-Channels are Copmleted --------------------//
+
+ //========= POSITIONING OF SS SUPPORT AND LEAD PLATES IN QUADRANTS =====//
+
+ /**************** Z-Distances of different Components **********/
+
+ Float_t zcva,zfea,zpba,zpsa,zchanVeto,zchanPS, zelvdbVeto, zelvdbPS;
+
+
+ zpba = - fgkThSteel/2.; //z-position of Pb plate
+ zfea = fgkThLead/2.; //z-position of SS-Support
+ zchanVeto = zpba - fgkThLead/2. - channel12[2]; //z-position of SS-channel on Veto
+ zchanPS = zfea + fgkThSteel/2. + channel12[2]; //z-position of SS-channel on Preshower
+ zpsa = zfea + fgkThSteel/2. + fDthick; //z-position of Preshower
+ zcva = zpba - fgkThLead/2.- fDthick; //z-position of Veto
+
+ zelvdbVeto = zpba + fgkThLead/2. - 8.9/2.; //z-position of LVDBs on Veto side
+ zelvdbPS = zfea + fgkThSteel/2. + 7.4/2.; //z-position of LVDBs on Preshower side
+
+ // FOR LONG TYPE
+ Float_t xLead1,yLead1,zLead1, xLead2,yLead2,zLead2;
+ Float_t xIron1,yIron1,zIron1, xIron2,yIron2,zIron2;
+
+
+ xIron1 = - 16.0/2. + 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed
+ yIron1 = 0.;
+ zIron1 = zfea;
+
+ xIron2 = 16.0/2. - 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed
+ yIron2 = 0.;
+ zIron2 = zfea;
+
+
+ xLead1 = xIron1 - 23.2/2.;
+ yLead1 = -5.2/2.;
+ zLead1 = zpba;
+
+ xLead2 =xIron2 + 23.2/2.;
+ yLead2 = 9.8/2.;
+ zLead2 = zpba;
+
+ gMC->Gspos("EFE1", 1, "EPM1", xIron1, yIron1, zfea, 0, "ONLY");
+ gMC->Gspos("ELDA", 1, "EPM1", xLead1, yLead1, zpba, 0, "ONLY");
+ gMC->Gspos("EFE2", 1, "EPM2", xIron2, yIron2, zfea, 0, "ONLY");
+ gMC->Gspos("ELDA", 1, "EPM2", xLead2, yLead2, zpba, jhrot12, "ONLY");
+
+
+ // FOR SHORT TYPE
+ Float_t xLead3,yLead3,zLead3, xLead4,yLead4,zLead4;
+ Float_t xIron3,yIron3,zIron3, xIron4,yIron4,zIron4;
+
+
+ xIron3 = 16.0/2.- 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed ;
+ yIron3 = 0.;
+ zIron3 = zfea;
+
+ xIron4 = - 16.0/2.+ 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed;
+ yIron4 = 0.;
+ zIron4 = zfea;
+
+ xLead3 = xIron3 + 23.2/2.;
+ yLead3 = -5.2/2.;
+ zLead3 = zpba;
+
+ xLead4 = xIron4 - 23.2/2.;
+ yLead4 = 9.8/2.;
+ zLead4 = zpba;
+
+ gMC->Gspos("EFE3", 1, "EPM3", xIron3, yIron3, zfea, 0, "ONLY");
+ gMC->Gspos("ELDB", 1, "EPM3", xLead3, yLead3, zpba, 0, "ONLY");
+ gMC->Gspos("EFE4", 1, "EPM4", xIron4, yIron4, zfea, 0, "ONLY");
+ gMC->Gspos("ELDB", 1, "EPM4", xLead4, yLead4, zpba, jhrot12, "ONLY");
+
+ //===================================================================//
+ // Placement of FR4 sheets as encloser of full profile of PMD
+
+ gMC->Gspos("ECC1", 1, "EPM1", xIron1, yIron1, -8.45, 0, "ONLY");
+ gMC->Gspos("ECC2", 1, "EPM2", xIron2, yIron2, -8.45, 0,"ONLY");
+ gMC->Gspos("ECC3", 1, "EPM3", xIron3, yIron3, -8.45, 0,"ONLY");
+ gMC->Gspos("ECC4", 1, "EPM4", xIron4, yIron4, -8.45, 0,"ONLY");
+
+ gMC->Gspos("ECC1", 2, "EPM1", xIron1, yIron1, 8.45, 0, "ONLY");
+ gMC->Gspos("ECC2", 2, "EPM2", xIron2, yIron2, 8.45, 0,"ONLY");
+ gMC->Gspos("ECC3", 2, "EPM3", xIron3, yIron3, 8.45, 0,"ONLY");
+ gMC->Gspos("ECC4", 2, "EPM4", xIron4, yIron4, 8.45, 0,"ONLY");
+
+ //----------------- NOW TO PLACE SS-CHANNELS -----------------------//
+
+ Float_t xchanepm11, ychanepm11,ychanepm12;
+ Float_t xchanepm21, ychanepm21,ychanepm22;
+ Float_t xchanepm31, ychanepm31,ychanepm32,ychanepm33,ychanepm34;
+ Float_t xchanepm41, ychanepm41,ychanepm42,ychanepm43,ychanepm44;
+
+ xchanepm11 = xLead1;
+ ychanepm11 = ya1 + yLead1 + dboxSS1[1] + 0.1 + 0.1/2.;
+ ychanepm12 = ya1 + yLead1 - dboxSS1[1] - 0.1 - 0.1/2.;
+
+ xchanepm21 = xLead2;
+ ychanepm21 = -ya1 + yLead2 - dboxSS1[1] - 0.1 - 0.1/2.;
+ ychanepm22 = -ya1 + yLead2 + dboxSS1[1] + 0.1 + 0.1/2.;
+
+ gMC->Gspos("ECHA", 1, "EPM1", xchanepm11, ychanepm11, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHA", 2, "EPM1", xchanepm11, ychanepm12, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHA", 3, "EPM1", xchanepm11, ychanepm11, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHA", 4, "EPM1", xchanepm11, ychanepm12, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHA", 1, "EPM2", xchanepm21, ychanepm21, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHA", 2, "EPM2", xchanepm21, ychanepm22, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHA", 3, "EPM2", xchanepm21, ychanepm21, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHA", 4, "EPM2", xchanepm21, ychanepm22, zchanVeto, 0, "ONLY");
+
+ xchanepm31 = xLead3;
+ ychanepm31 = yb1 + yLead3 + dboxSS2[1] + 0.1 + 0.1/2.;
+ ychanepm32 = yb1 + yLead3 - dboxSS2[1] - 0.1 - 0.1/2.;
+ ychanepm33 = yb3 + yLead3 + dboxSS2[1] + 0.1 + 0.1/2.;
+ ychanepm34 = yb3 + yLead3 - dboxSS2[1] - 0.1 - 0.1/2.;
+
+ xchanepm41 = xLead4;
+ ychanepm41 = -yb1 + yLead4 - dboxSS2[1] - 0.1 - 0.1/2.;
+ ychanepm42 = -yb1 + yLead4 + dboxSS2[1] + 0.1 + 0.1/2.;
+ ychanepm43 = -yb3 + yLead4 - dboxSS2[1] - 0.1 - 0.1/2.;
+ ychanepm44 = -yb3 + yLead4 + dboxSS2[1] + 0.1 + 0.1/2.;
+
+
+ gMC->Gspos("ECHB", 1, "EPM3", xchanepm31, ychanepm31, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHB", 2, "EPM3", xchanepm31, ychanepm32, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHB", 3, "EPM3", xchanepm31, ychanepm33, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHB", 4, "EPM3", xchanepm31, ychanepm34 + 0.200005, zchanPS, 0, "ONLY");
+ // Because of overlaping a factor 0.200005 is added in ychanepm34
+
+ gMC->Gspos("ECHB", 5, "EPM3", xchanepm31, ychanepm31, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHB", 6, "EPM3", xchanepm31, ychanepm32, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHB", 7, "EPM3", xchanepm31, ychanepm33, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHB", 8, "EPM3", xchanepm31, ychanepm34 + 0.200005, zchanVeto, 0, "ONLY");
+ // Because of overlaping a factor 0.200005 is added in ychanepm34
+
+ gMC->Gspos("ECHB", 1, "EPM4", xchanepm41, ychanepm41, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHB", 2, "EPM4", xchanepm41, ychanepm42, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHB", 3, "EPM4", xchanepm41, ychanepm43, zchanPS, 0, "ONLY");
+ gMC->Gspos("ECHB", 4, "EPM4", xchanepm41, ychanepm44 - 0.200002, zchanPS, 0, "ONLY");
+ // Because of overlaping a factor 0.200002 is subtracted in ychanepm44
+
+ gMC->Gspos("ECHB", 5, "EPM4", xchanepm41, ychanepm41, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHB", 6, "EPM4", xchanepm41, ychanepm42, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHB", 7, "EPM4", xchanepm41, ychanepm43, zchanVeto, 0, "ONLY");
+ gMC->Gspos("ECHB", 8, "EPM4", xchanepm41, ychanepm44 -0.200002, zchanVeto, 0, "ONLY");
+ // Because of overlaping a factor 0.200002 is subtracted in ychanepm44
+
+ //================= Channel Placement Completed ======================//
+ //============ Now to Create Al Box and then LVDBs and Cables //
+ // are Placed inside it //
+
+ // Eight Al Boxes are created, four on Preshower side
+ // and four on Veto side
+
+ // FOR PRESHOWER
+
+ // First to Create hollow Al Box
+ // there are two types of modules, therefore, two Al box of
+ // long type and two of short type are created
+
+ // For Long Type
+ // X-dimension = 16.5cm
+ // Y-dimension = same as EFE1
+ // Z-dimension = 7.4cm
+ // Integer assigned to Al medium is 603
+
+ Float_t esvdA1[3];
+ esvdA1[0]= 16.5/2.;
+ esvdA1[1]= dboxFea1[1];
+ esvdA1[2]= 7.4/2.;
+
+ gMC->Gsvolu("ESV1", "BOX", idtmed[603], esvdA1, 3);
+ gMC->Gsvolu("ESV2", "BOX", idtmed[603], esvdA1, 3);
+
+ // Create Air strip for Al Boxes type-A
+ // Al boxes are 3mm thick In X and Z on both sides
+ // X-dimension = 16.5cm - 0.3cm
+ // Y-dimension = same as EFE1
+ // Z-dimension = 7.4cm - 0.3cm
+
+ Float_t eairA1[3];
+ eairA1[0]= esvdA1[0] - 0.3;
+ eairA1[1]= esvdA1[1];
+ eairA1[2]= esvdA1[2] - 0.3;
+
+ gMC->Gsvolu("EIR1", "BOX", idtmed[698], eairA1, 3);
+ gMC->Gsvolu("EIR2", "BOX", idtmed[698], eairA1, 3);
+
+ // Put air strips EIR1 & EIR2 inside ESV1 & ESV2 respectively
+ gMC->Gspos("EIR1", 1, "ESV1", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("EIR2", 1, "ESV2", 0., 0., 0., 0, "ONLY");
+
+
+ // For Short Type
+ // X-dimension = 16.5cm
+ // Y-dimension = same as EFE3
+ // Z-dimension = 7.4cm
+
+ Float_t esvdA2[3];
+ esvdA2[0]= esvdA1[0];
+ esvdA2[1]= dboxFea3[1];
+ esvdA2[2]= esvdA1[2];
+
+ gMC->Gsvolu("ESV3", "BOX", idtmed[603], esvdA2, 3);
+ gMC->Gsvolu("ESV4", "BOX", idtmed[603], esvdA2, 3);
+
+ // Create Air strip for Al Boxes type-B
+ // Al boxes are 3mm thick In X and Z on both sides
+ // X-dimension = 16.5cm - 0.3cm
+ // Y-dimension = same as EFE3
+ // Z-dimension = 7.4cm - 0.3cm
+
+ Float_t eairA2[3];
+ eairA2[0]= esvdA2[0] - 0.3;
+ eairA2[1]= esvdA2[1];
+ eairA2[2]= esvdA2[2] - 0.3;
+
+ gMC->Gsvolu("EIR3", "BOX", idtmed[698], eairA2, 3);
+ gMC->Gsvolu("EIR4", "BOX", idtmed[698], eairA2, 3);
+
+ // Put air strips EIR3 & EIR4 inside ESV3 & ESV4 respectively
+ gMC->Gspos("EIR3", 1, "ESV3", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("EIR4", 1, "ESV4", 0., 0., 0., 0, "ONLY");
+
+
+ // FOR VETO
+
+ // First to Create hollow Al Box
+ // there are two types of modules, therefore, two Al box of
+ // long type and two of short type are created
+
+ // For Long Type
+ // X-dimension = 16.5cm
+ // Y-dimension = same as EFE1
+ // Z-dimension = 8.9cm
+ // Integer assigned to Al medium is 603
+
+ Float_t esvdB1[3];
+ esvdB1[0]= 16.5/2.;
+ esvdB1[1]= dboxFea1[1];
+ esvdB1[2]= 8.9/2.;
+
+ gMC->Gsvolu("EVV1", "BOX", idtmed[603], esvdB1, 3);
+ gMC->Gsvolu("EVV2", "BOX", idtmed[603], esvdB1, 3);
+
+ // Create Air strip for Al Boxes long type
+ // Al boxes are 3mm thick In X and Z on both sides
+ // X-dimension = 16.5cm - 0.3cm
+ // Y-dimension = same as EFE1
+ // Z-dimension = 8.9cm - 0.3cm
+
+ Float_t eairB1[3];
+ eairB1[0]= esvdB1[0] - 0.3;
+ eairB1[1]= esvdB1[1];
+ eairB1[2]= esvdB1[2] - 0.3;
+
+ gMC->Gsvolu("EIR5", "BOX", idtmed[698], eairB1, 3);
+ gMC->Gsvolu("EIR6", "BOX", idtmed[698], eairB1, 3);
+
+ // Put air strips EIR5 & EIR6 inside EVV1 & EVV2 respectively
+ gMC->Gspos("EIR5", 1, "EVV1", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("EIR6", 1, "EVV2", 0., 0., 0., 0, "ONLY");
+
+
+ // For Short Type
+ // X-dimension = 16.5cm
+ // Y-dimension = same as EFE3
+ // Z-dimension = 8.9cm
+ // Integer assigned to Al medium is 603
+
+ Float_t esvdB2[3];
+ esvdB2[0]= esvdB1[0];
+ esvdB2[1]= dboxFea3[1];
+ esvdB2[2]= esvdB1[2];
+
+ gMC->Gsvolu("EVV3", "BOX", idtmed[603], esvdB2, 3);
+ gMC->Gsvolu("EVV4", "BOX", idtmed[603], esvdB2, 3);
+
+
+ // Create Air strip for Al Boxes short type
+ // Al boxes are 3mm thick In X and Z on both sides
+ // X-dimension = 16.5cm - 0.3cm
+ // Y-dimension = same as EFE3
+ // Z-dimension = 8.9cm - 0.3cm
+
+ Float_t eairB2[3];
+ eairB2[0]= esvdB2[0] - 0.3;
+ eairB2[1]= esvdB2[1];
+ eairB2[2]= esvdB2[2] - 0.3;
+
+ gMC->Gsvolu("EIR7", "BOX", idtmed[698], eairB2, 3);
+ gMC->Gsvolu("EIR8", "BOX", idtmed[698], eairB2, 3);
+
+ // Put air strips EIR7 & EIR8 inside EVV3 & EVV4 respectively
+ gMC->Gspos("EIR7", 1, "EVV3", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("EIR8", 1, "EVV4", 0., 0., 0., 0, "ONLY");
+
+ //------------ Al Boxes Completed ----------------------/
+
+ //--------------Now Create LVDBs----------------------/
+
+ // LVDBs are the volumes of G10
+ // X-dimension = 10.0cm
+ // Y-dimension = 8.0cm
+ // Z-dimension = 0.2cm
+ // Integer assigned to the G10 medium is 607
+
+ Float_t elvdb[3];
+ elvdb[0]= 10.0/2.;
+ elvdb[1]= 8.0/2.;
+ elvdb[2]= 0.2/2.;
+
+ gMC->Gsvolu("ELVD", "BOX", idtmed[607], elvdb, 3);
+
+
+ // Put the LVDBs inside Air Boxes
+ Float_t yesvd = dboxFea1[1] - 25.0 - 4.0;
+
+ for(Int_t jj =1; jj<=6; jj++){
+
+ gMC->Gspos("ELVD", jj, "EIR1", 0., yesvd, 0., 0, "ONLY");
+ gMC->Gspos("ELVD", jj, "EIR2", 0., yesvd, 0., 0, "ONLY");
+
+ yesvd = yesvd - 4.0 - 0.5 - 4.0;
+
+ }
+
+ yesvd = dboxFea3[1] - 15.0 - 4.0;
+
+ for(Int_t jj =1; jj<=6; jj++){
+
+ gMC->Gspos("ELVD", jj, "EIR3", 0., yesvd, 0., 0, "ONLY");
+ gMC->Gspos("ELVD", jj, "EIR4", 0., yesvd, 0., 0, "ONLY");
+
+ yesvd = yesvd - 4.0 - 0.5 - 4.0;
+ }
+
+ yesvd = dboxFea1[1] - 25.0 - 4.0;
+
+ for(Int_t jj =1; jj<=6; jj++){
+
+ gMC->Gspos("ELVD", jj, "EIR5", 0., yesvd, 0., 0, "ONLY");
+ gMC->Gspos("ELVD", jj, "EIR6", 0., yesvd, 0., 0, "ONLY");
+
+ yesvd = yesvd - 4.0 - 0.5 - 4.0;
+ }
+
+ yesvd = dboxFea3[1] - 15.0 - 4.0;
+
+ for(Int_t jj =1; jj<=6; jj++){
+
+ gMC->Gspos("ELVD", jj, "EIR7", 0., yesvd, 0., 0, "ONLY");
+ gMC->Gspos("ELVD", jj, "EIR8", 0., yesvd, 0., 0, "ONLY");
+
+ yesvd = yesvd - 4.0 - 0.5 - 4.0;
+ }
+
+
+ //----------------- LVDBs Placement Completed--------------//
+
+ // ------------ Now Create Cables ------------------------//
+
+ // There are a number of cables
+ // We have reduced the number of volumes to 4
+ // And these 4 Volumes of Cables are placed repeatedly
+ // in the four quadrants (EPM1,2,3,4)
+ // The placement of Cables are in good approximations
+ // The material medium for Cables is a mixture of Plastic
+ // and Copper(Cu). Therefore, in a good approximation a mixture
+ // is created and Integer assigned to this medium is 631
+
+ Float_t cable1[3];
+ cable1[0] = 2.5/2.;
+ cable1[1] = dboxFea1[1];
+ cable1[2] = 2.4/2.;
+
+ gMC->Gsvolu("ECB1", "BOX", idtmed[631], cable1, 3);
+
+ Float_t cable2[3];
+ cable2[0] = 2.5/2.;
+ cable2[1] = dboxFea3[1];
+ cable2[2] = 2.4/2.;
+
+ gMC->Gsvolu("ECB2", "BOX", idtmed[631], cable2, 3);
+
+ Float_t cable3[3];
+ cable3[0] = 2.5/2.;
+ cable3[1] = dboxFea3[1] - dboxUM2[1];
+ cable3[2] = 2.4/2.;
+
+ gMC->Gsvolu("ECB3", "BOX", idtmed[631], cable3, 3);
+
+ Float_t cable4[3];
+ cable4[0] = 2.5/2.;
+ cable4[1] = dboxUM2[1];
+ cable4[2] = 2.4/2.;
+
+ gMC->Gsvolu("ECB4", "BOX", idtmed[631], cable4, 3);
+
+ // Calculation of the co-ordinates of Cables
+
+ Float_t xcable11pm2, xcable12pm2, xcable2pm1, xcable2pm2, xcable21pm4, xcable22pm4;
+ Float_t xcable3pm1, xcable3pm3, xcable3pm4, xcable4pm3;
+
+ Float_t ycable2pm1, ycable2pm2;
+ Float_t ycable3pm1, ycable3pm3, ycable3pm4, ycable4pm3;
+
+ Float_t zcablePS, zcableVeto;
+
+ xcable2pm1 = esvdA1[0] - 3.0 - cable1[0];
+ xcable3pm1 = xcable2pm1 - cable1[0] - 0.5 - cable1[0];
+
+ xcable11pm2 = -esvdA1[0]+ 3.0 + cable1[0];
+ xcable12pm2 = xcable11pm2 + cable1[0] + 0.5 + cable1[0];
+ xcable2pm2 = xcable12pm2 + cable1[0] + 0.5 + cable1[0];
+
+ xcable3pm3 = -esvdB1[0] + 3.0 + cable1[0];
+ xcable4pm3 = xcable3pm3 + cable1[0] + 0.5 + cable1[0];
+
+ xcable21pm4 = esvdB1[0] - 3.0 - cable1[0];
+ xcable22pm4 = xcable21pm4 - cable1[0] -0.5 - cable1[0];
+ xcable3pm4 = xcable22pm4 - cable1[0] -0.5 -cable1[0];
+
+ ycable2pm1 = -(esvdA1[1] - esvdA2[1]);
+ ycable3pm1 = -esvdA1[1] + cable3[1];
+
+ ycable2pm2 = -(esvdA1[1] - esvdA2[1]);
+
+ ycable3pm3 = -dboxUM2[1];
+ ycable4pm3 = -esvdA2[1] + dboxUM2[1];
+
+ ycable3pm4 = -dboxUM2[1];
+
+ zcablePS = -esvdA1[2] + 0.3 + cable1[2];
+ zcableVeto = esvdB1[2] - 0.3 - cable1[2];
+
+
+
+ // Placement of Cables in Air Boxes
+ gMC->Gspos("ECB2", 1, "EIR1", xcable2pm1, ycable2pm1, zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB3", 1, "EIR1", xcable3pm1, ycable3pm1, zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB2", 1, "EIR5", xcable2pm1, ycable2pm1, zcableVeto, 0, "ONLY");
+ gMC->Gspos("ECB3", 1, "EIR5", xcable3pm1, ycable3pm1, zcableVeto, 0, "ONLY");
+
+ gMC->Gspos("ECB1", 1, "EIR2", xcable11pm2, 0., zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB1", 2, "EIR2", xcable12pm2, 0., zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB2", 1, "EIR2", xcable2pm2, ycable2pm2, zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB1", 1, "EIR6", xcable11pm2, 0., zcableVeto, 0, "ONLY");
+ gMC->Gspos("ECB1", 2, "EIR6", xcable12pm2, 0., zcableVeto, 0, "ONLY");
+ gMC->Gspos("ECB2", 1, "EIR6", xcable2pm2, ycable2pm2, zcableVeto, 0, "ONLY");
+
+ gMC->Gspos("ECB3", 1, "EIR3", xcable3pm3, ycable3pm3, zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB4", 1, "EIR3", xcable4pm3, ycable4pm3, zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB3", 1, "EIR7", xcable3pm3, ycable3pm3, zcableVeto, 0, "ONLY");
+ gMC->Gspos("ECB4", 1, "EIR7", xcable4pm3, ycable4pm3, zcableVeto, 0, "ONLY");
+
+ gMC->Gspos("ECB2", 1, "EIR4", xcable21pm4, 0., zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB2", 2, "EIR4", xcable22pm4, 0., zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB3", 1, "EIR4", xcable3pm4, ycable3pm4, zcablePS, 0, "ONLY");
+ gMC->Gspos("ECB2", 1, "EIR8", xcable21pm4, 0., zcableVeto, 0, "ONLY");
+ gMC->Gspos("ECB2", 2, "EIR8", xcable22pm4, 0., zcableVeto, 0, "ONLY");
+ gMC->Gspos("ECB3", 1, "EIR8", xcable3pm4, ycable3pm4, zcableVeto, 0, "ONLY");
+
+
+
+ //=============== NOW POSITIONING THE Al Boxes IN EPM'S================//
+
+
+ gMC->Gspos("ESV1", 1, "EPM1", dboxFea1[0] - esvdA1[0] - 8.0, 0., zelvdbPS, 0, "ONLY");
+ gMC->Gspos("EVV1", 1, "EPM1", dboxFea1[0] - esvdB1[0] - 8.0, 0., zelvdbVeto, 0, "ONLY");
+
+ gMC->Gspos("ESV2", 1, "EPM2", -dboxFea2[0] + esvdA1[0] + 8.0, 2.3, zelvdbPS, 0, "ONLY");
+ gMC->Gspos("EVV2", 1, "EPM2", -dboxFea2[0] + esvdB1[0] + 8.0, 2.3, zelvdbVeto, 0, "ONLY");
+
+ gMC->Gspos("ESV3", 1, "EPM3", -dboxFea3[0] + esvdA1[0] + 8.0, 0., zelvdbPS, 0, "ONLY");
+ gMC->Gspos("EVV3", 1, "EPM3", -dboxFea3[0] + esvdB1[0] + 8.0, 0., zelvdbVeto, 0, "ONLY");
+
+ gMC->Gspos("ESV4", 1, "EPM4", dboxFea4[0] - esvdA1[0] - 8.0, 2.3, zelvdbPS, 0, "ONLY");
+ gMC->Gspos("EVV4", 1, "EPM4", dboxFea4[0] - esvdB1[0] - 8.0, 2.3, zelvdbVeto, 0, "ONLY");
+
+ //==================================================================//
+ //====================== LAST THING IS TO INSTALL ELMB ================//
+
+ // ELMB,s are the G10 Volumes
+
+ // First to create Air Volume to place ELMBs
+ Float_t xelmb[3];
+ xelmb[0] = 10.0;
+ xelmb[1] = 4.0;
+ xelmb[2] = 0.5;
+
+ gMC->Gsvolu("ELMB", "BOX", idtmed[698], xelmb, 3);
+
+ // There are more G10 Volumes
+ // But in approximation, we reduced them to two
+ // ELM1 & ELM2
+
+ Float_t xelmb1[3];
+ xelmb1[0] = 9.7;
+ xelmb1[1] = 3.6;
+ xelmb1[2] = 0.1;
+
+ gMC->Gsvolu("ELM1", "BOX", idtmed[607], xelmb1, 3);
+
+ Float_t xelmb2[3];
+ xelmb2[0] = 6.0;
+ xelmb2[1] = 3.0;
+ xelmb2[2] = 0.1;
+
+ gMC->Gsvolu("ELM2", "BOX", idtmed[607], xelmb2, 3);
+
+ /******** NOW POSITIONING THE G10 VOLUMES ELM1 & ELM2 IN ELMB **********/
+
+ gMC->Gspos("ELM1", 1, "ELMB", 0., 0., -0.3, 0, "ONLY");
+ gMC->Gspos("ELM2", 1, "ELMB", 0., 0., 0.3, 0, "ONLY");
+
+ // Position co-ordinates of ELMBs in EPM2 & EPM4
+
+ Float_t xelmbepm2, xelmbepm4, yelmbepm2, yelmbepm4, zelmbPS, zelmbVeto;
+
+ xelmbepm2 = -gaspmd2[0] + 16.0 +23.2 + 2.5 + xelmb[0];
+ xelmbepm4 = gaspmd4[0] - 16.0 -23.2 - 2.5 - xelmb[0];
+
+ yelmbepm2 = -gaspmd2[1] + 1.0 + xelmb[1];
+ yelmbepm4 = -gaspmd4[1] + 1.0 + xelmb[1];
+
+ zelmbPS = zfea + fgkThSteel/2.+ xelmb[2];
+ zelmbVeto = zfea - fgkThSteel/2.- xelmb[2];
+
+ /************ NOW PLACE ELMB'S IN EPM2 & EPM4 *********************/
+
+ // There are total of 14 ELMB volumes
+ // three on both sides of EPM2 (total of 6)
+ // and four on both sides of EPM4 (total of 8)
+ // The ELMBs are placed at the bottom of
+ // SS support, which is the extended part
+
+ // Placement of ELMBs on EPM2
+ for(Int_t kk=1;kk<=3;kk++){
+ gMC->Gspos("ELMB", kk, "EPM2", xelmbepm2, yelmbepm2, zelmbPS, 0, "ONLY");
+ xelmbepm2 = xelmbepm2 + xelmb[0] + 0.5 + xelmb[0];
+ }
+
+ xelmbepm2 = -gaspmd2[0] + 16.0 +23.2 + 2.5 + xelmb[0];
+
+ for(Int_t kk=4;kk<=6;kk++){
+ gMC->Gspos("ELMB", kk, "EPM2", xelmbepm2, yelmbepm2, zelmbVeto, 0, "ONLY");
+ xelmbepm2 = xelmbepm2 + xelmb[0] + 0.5 + xelmb[0];
+ }
+
+ // Placement of ELMBs on EPM4
+ for(Int_t kk=1;kk<=4;kk++){
+ gMC->Gspos("ELMB", kk, "EPM4", xelmbepm4, yelmbepm4, zelmbPS, 0, "ONLY");
+ xelmbepm4 = xelmbepm4 - xelmb[0] - 0.5 - xelmb[0];
+ }
+
+ xelmbepm4 = gaspmd4[0] - 16.0 -23.2 - 2.5 - xelmb[0];
+ for(Int_t kk=5;kk<=8;kk++){
+ gMC->Gspos("ELMB", kk, "EPM4", xelmbepm4, yelmbepm4, zelmbVeto, 0, "ONLY");
+ xelmbepm4 = xelmbepm4 - xelmb[0] - 0.5 - xelmb[0];
+ }
+
+ //========= Placement of ELMBs Completed ============================/
+
+ // ------------- Now to Place Unit Modules in four quadrants
+ // EPM1, EPM2, EPM3 & EPM4 ---------------------//
+
+ // Position co-ordinates of Unit Modules
+
+ Double_t xcord[24];
+ Double_t ycord[24];
+
+ xcord[0] = xa1;
+ xcord[1] = xa2;
+ xcord[2] = xa3;
+ xcord[3] = xa1;
+ xcord[4] = xa2;
+ xcord[5] = xa3;
+ xcord[6] = -xa1;
+ xcord[7] = -xa2;
+ xcord[8] = -xa3;
+ xcord[9] = -xa1;
+ xcord[10] = -xa2;
+ xcord[11] = -xa3;
+ xcord[12] = xb1;
+ xcord[13] = xb2;
+ xcord[14] = xb1;
+ xcord[15] = xb2;
+ xcord[16] = xb1;
+ xcord[17] = xb2;
+ xcord[18] = -xb1;
+ xcord[19] = -xb2;
+ xcord[20] = -xb1;
+ xcord[21] = -xb2;
+ xcord[22] = -xb1;
+ xcord[23] = -xb2;
+
+ ycord[0] = ya1;
+ ycord[1] = ya1;
+ ycord[2] = ya1;
+ ycord[3] = ya2;
+ ycord[4] = ya2;
+ ycord[5] = ya2;
+ ycord[6] = -ya1;
+ ycord[7] = -ya1;
+ ycord[8] = -ya1;
+ ycord[9] = -ya2;
+ ycord[10] = -ya2;
+ ycord[11] = -ya2;
+ ycord[12] = yb1;
+ ycord[13] = yb1;
+ ycord[14] = yb2;
+ ycord[15] = yb2;
+ ycord[16] = yb3+0.100007; //Because of overlapping the factor 0.100007
+ ycord[17] = yb3+0.100007; // is added
+ ycord[18] = -yb1;
+ ycord[19] = -yb1;
+ ycord[20] = -yb2;
+ ycord[21] = -yb2;
+ ycord[22] = -yb3-0.100004; //Because of overlapping the factor 0.100007
+ ycord[23] = -yb3-0.100004; // is added
+
+
+ // Placement of unit modules EUM1 & EUV1(long type)
+ // and EUM2 & EUV2(short type)
+ // in the four quadrants EPM1, EPM2, EPM3 & EPM4
+
+ for(Int_t ii=0;ii<=5;ii++){
+ if(fModStatus[ii]){
+ gMC->Gspos("EUM1", ii, "EPM1", xcord[ii]+xLead1,ycord[ii]+yLead1, zpsa, 0, "ONLY");
+ }
+ }
+
+ for(Int_t ii=6;ii<=11;ii++){
+ if(fModStatus[ii]) {
+ gMC->Gspos("EUM1", ii, "EPM2", xcord[ii]+xLead2, ycord[ii]+yLead2, zpsa, jhrot12, "ONLY");
+ }
+ }
+
+ for(Int_t ii=12;ii<=17;ii++){
+ if(fModStatus[ii]) {
+ gMC->Gspos("EUM2", ii, "EPM3", xcord[ii]+xLead3, ycord[ii]+yLead3, zpsa, 0, "ONLY");
+ }
+ }
+
+ for(Int_t ii=18;ii<=23;ii++){
+ if(fModStatus[ii]) {
+ gMC->Gspos("EUM2", ii, "EPM4", xcord[ii]+xLead4, ycord[ii]+yLead4, zpsa, jhrot12, "ONLY");
+ }
+ }
+
+ for(Int_t ii=24;ii<=29;ii++){
+ if(fModStatus[ii]) {
+ gMC->Gspos("EUV1", ii, "EPM1", xcord[ii-24]+xLead1, ycord[ii-24]+yLead1, zcva, 0, "ONLY");
+ }
+ }
+
+ for(Int_t ii=30;ii<=35;ii++){
+ if(fModStatus[ii]) {
+ gMC->Gspos("EUV1", ii, "EPM2", xcord[ii-24]+xLead2, ycord[ii-24]+yLead2, zcva, jhrot12, "ONLY");
+ }
+ }
+
+ for(Int_t ii=36;ii<=41;ii++){
+ if(fModStatus[ii]) {
+ gMC->Gspos("EUV2", ii, "EPM3", xcord[ii-24]+xLead3, ycord[ii-24]+yLead3, zcva, 0, "ONLY");
+ }
+ }
+
+ for(Int_t ii=42;ii<=47;ii++){
+ if(fModStatus[ii]) {
+ gMC->Gspos("EUV2", ii, "EPM4", xcord[ii-24]+xLead4, ycord[ii-24]+yLead4, zcva, jhrot12, "ONLY");
+ }
+ }
+
+ //-------------- Placement of Unit Modules Completed ---------------//
+
+ // ========== PLACE THE EPMD IN ALICE ======================//
+
+ // Now the Job to assemble the five mother volumes of PMD in ALICE
+
+ // Z-distance of PMD from Interaction Point
+
+ zp = fgkZdist;
+
+ // X and Y-positions of the EPM1, EPM2, EPM3 & EPM4
+ Float_t xfinal,yfinal;
+ Float_t xsm1, xsm2, xsm3, xsm4;
+ Float_t ysm1, ysm2, ysm3, ysm4;
+
+ xfinal = (fSMLengthax + serviceX/2. + serviceXext/2. + 0.05) + 0.48/2. +
+ (fSMLengthbx + serviceX/2. + serviceXext/2.+ 0.05);
+
+ //Extra width of the SS plate on Support Structure on X-side and 1mm thick SS for cooling encloser
+ //Extra width of the SS plate on Support Structure on X-side for B-Type
+
+ yfinal = (fSMLengthay + serviceYa/2.)+ 0.20/2 + (fSMLengthby + serviceYb/2.);