+ //FOR VETO
+ //Stainless Steel boundary - Material Stainless Steel
+ gMC->Gsvolu("ESVA","BOX", idtmed[618], dboxSS1, 3);
+
+ //----------------------------------------------------------------//
+
+ //----------------------------------------------------------------//
+ // Here we need to place the volume in order ESSA -> EDGA -> ECGA
+ // this makes the SS boundary and the 0.5mm thick FR4 insulation in place,
+ // and the air volume ECGA acts as mother for the rest of components.
+ // The above placeemnt is done at (0.,0.,0.) relative coordiante
+ // Now we place bottom PCB, honeycomb, top PCB in this volume. We donot place
+ // unnecessary air volumes now. Just leave the gap as we are placing them
+ // in air only. This also reduces the number of volumes for geant to track.
+
+// Tree structure for different volumes
+//
+// EUM1
+// |
+// --------------------
+// | | |
+// EBPA ESSA EBKA
+// |
+// EDGA
+// |
+// ECGA
+// |
+// --------------------
+// | | |
+// EPCA(1) EHC1 EPCA(2)
+// (bottom) | (top PCB)
+// |
+// Sensitive volume
+// (gas)
+//
+
+
+ //FOR VETO
+//Creating the side channels
+// SS boundary channel, followed by G10 and Air Gap
+ gMC->Gspos("EDVA", 1, "ESVA", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("ECVA", 1, "EDVA", 0., 0., 0., 0, "ONLY");
+
+//FOR PRESHOWER
+ gMC->Gspos("EDGA", 1, "ESSA", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("ECGA", 1, "EDGA", 0., 0., 0., 0, "ONLY");
+
+ // now other components, using Bedanga's code, but changing the values.
+ //Positioning Bottom PCB, Honey Comb abd Top PCB in AIR
+
+ //For veto plane
+ //Positioning the Bottom 0.16 cm PCB
+ Float_t zbpcb = -dboxAir3A[2] + (2.0*fgkGap) + fgkThPCB/2.;
+ gMC->Gspos("EPCA", 1, "ECVA", 0., 0., zbpcb, 0, "ONLY");
+ //Positioning the Honey Comb 0.5 cm
+ Float_t zhc = zbpcb + fgkThPCB/2. + fgkCellDepth/2.;
+ gMC->Gspos("EHC1", 1, "ECVA", 0., 0., zhc, 0, "ONLY");
+ //Positioning the Top PCB 0.16 cm
+ Float_t ztpcb = zhc + fgkCellDepth/2 + fgkThPCB/2.;
+ gMC->Gspos("EPCA", 2, "ECVA", 0., 0., ztpcb, 0, "ONLY");
+
+
+ //For Preshower plane the ordering is reversed
+ //Positioning the Bottom 0.16 cm PCB
+ zbpcb = -dboxAir3A[2] + fgkThPCB + fgkThPCB/2.;
+ gMC->Gspos("EPCA", 1, "ECGA", 0., 0., zbpcb, 0, "ONLY");
+ //Positioning the Honey Comb 0.5 cm
+ zhc = zbpcb + fgkThPCB/2. + fgkCellDepth/2.;
+ gMC->Gspos("EHC1", 1, "ECGA", 0., 0., zhc, 0, "ONLY");
+ //Positioning the Top PCB 0.16 cm
+ ztpcb = zhc + fgkCellDepth/2 + fgkThPCB/2.;
+ gMC->Gspos("EPCA", 2, "ECGA", 0., 0., ztpcb, 0, "ONLY");
+
+
+
+
+ //--------------Now let us construct final UM ---------------//
+ // We will do it as follows :
+ // (i) First make a UM of air. which will have dimensions
+ // of the SS boundary Channel (in x,y) and of height 13.3mm
+ //(ii) Then we will place all the components
+
+ //----------------------------------------------------------//
+ // A unit module type A of Air
+ // Dimensions of Unit Module same as SS boundary channel
+ Float_t dboxUM1[3];
+ dboxUM1[0] = dboxSS1[0];
+ dboxUM1[1] = dboxSS1[1];
+ dboxUM1[2] = fgkThSS/2. +0.15; // 0.15 added to accomodate Base Plate at
+ // the bottom and the backplane PCB at the top.
+
+ //FOR PRESHOWER
+ //Create a Unit module of above dimensions Material : AIR
+ gMC->Gsvolu("EUM1","BOX", idtmed[698], dboxUM1, 3);
+ //FOR VETO
+ gMC->Gsvolu("EUV1","BOX", idtmed[698], dboxUM1, 3);
+
+ //----------------------------------------------------------------//
+
+ //BASE PLATE : EBPA
+ //==================
+ // Make a 2mm thick G10 Base plate for Unit module A
+ // Base plate is as big as the final UM dimensions that is as
+ // SS boundary channel
+ Float_t dboxBaseA[3];
+ dboxBaseA[0] = dboxSS1[0];
+ dboxBaseA[1] = dboxSS1[1];
+ dboxBaseA[2] = fgkThBase/2.;
+
+ //Base Blate is a G10 BOX
+ gMC->Gsvolu("EBPA","BOX", idtmed[607], dboxBaseA, 3);
+ //----------------------------------------------------//
+
+ //FOR VETO
+ //- Placing of all components of UM in AIR BOX EUM1--//
+ //(1) FIRST PUT THE BASE PLATE
+ Float_t zbaseplate = -dboxUM1[2] + fgkThBase/2.;
+ gMC->Gspos("EBPA", 1, "EUV1", 0., 0., zbaseplate, 0, "ONLY");
+
+ //(2) NEXT PLACING the SS BOX
+ Float_t zss = zbaseplate + fgkThBase/2. + fgkThSS/2.;
+ gMC->Gspos("ESVA", 1, "EUV1", 0., 0., zss, 0, "ONLY");
+
+ // (3) Positioning the Backplane PCB 0.1 cm
+ Float_t zbkp = zss + fgkThSS/2. + fgkThBKP/2.;
+ gMC->Gspos("EBKA", 1, "EUV1", 0., 0., zbkp, 0, "ONLY");
+
+ //FOR PRESHOWER
+ // (3) Positioning the Backplane PCB 0.1 cm
+ zbkp = -dboxUM1[2] + fgkThBKP/2.;
+ gMC->Gspos("EBKA", 1, "EUM1", 0., 0., zbkp, 0, "ONLY");
+
+ //(2) NEXT PLACING the SS BOX
+ zss = zbkp + fgkThBKP/2. + fgkThSS/2.;
+ gMC->Gspos("ESSA", 1, "EUM1", 0., 0., zss, 0, "ONLY");
+
+ //(1) FIRST PUT THE BASE PLATE
+ zbaseplate = zss + fgkThSS/2 + fgkThBase/2.;
+ gMC->Gspos("EBPA", 1, "EUM1", 0., 0., zbaseplate, 0, "ONLY");
+ //-------------------- UM Type A completed ------------------------//
+
+
+
+ //-------------------- Lets do the same thing for UM type B -------//
+ //--------------------------------------------------//
+ //Bottom and Top PCB : EPCB
+ //===========================
+ // Make a 1.6mm thick G10 Bottom and Top PCB for Unit module B
+ // X-dimension same as EHC2 - dbox4[0]
+ // Y-dimension same as EHC2 - dbox4[1]
+ // Z-dimension 0.16/2 = 0.08 cm
+ //-------------------------------------------------//
+ Float_t dboxPcbB[3];
+ dboxPcbB[0] = dbox4[0];
+ dboxPcbB[1] = dbox4[1];
+ dboxPcbB[2] = fgkThPCB/2.;
+
+ //Top and Bottom PCB is a BOX of Material G10
+ gMC->Gsvolu("EPCB","BOX", idtmed[607], dboxPcbB, 3);
+ //--------------------------------------------------------//
+ //Back Plane : EBKB
+ //==================
+ // Make a 1.0mm thick Back Plane PCB for Unit module B
+ // X-dimension same as EHC2 - dbox4[0]
+ // Y-dimension same as EHC2 - dbox4[1]
+ // Z-dimension 0.1/2 = 0.05 cm
+ //------------------------------------------------------//
+ Float_t dboxBPlaneB[3];
+ dboxBPlaneB[0] = dbox4[0];
+ dboxBPlaneB[1] = dbox4[1];
+ dboxBPlaneB[2] = fgkThBKP/2.;
+
+ //Back PLane PCB of MAterial G10
+ gMC->Gsvolu("EBKB","BOX", idtmed[607], dboxBPlaneB, 3);
+ //-------------------------------------------------------------//
+
+ //---------- That was all in the Z -direction of Unit Module B----//
+
+ // Now lets us construct the boundary arround the Unit Module --//
+ // This boundary has
+ // (a) 0.5 mm X and Y and 10.3 mm Z dimension AIR gap
+ // (b) 0.5 mm X and Y and 10.3 mm Z dimension G10
+ // (c) 3.0 mm X and Y and 12.3 mm Z dimension Stainless Steel
+
+ //-------------------------------------------------//
+ //AIR GAP between UM and Boundary : ECGB
+ //================================================
+ // Make a 10.3mm thick Air gap for Unit module B
+ // X-dimension same as EHC2+0.05
+ // Y-dimension same as EHC2+0.05
+ // Z-dimension 1.03/2 = 0.515 cm
+ Float_t dboxAir3B[3];
+ dboxAir3B[0] = dbox4[0]+(2.0*fgkGap);
+ dboxAir3B[1] = dbox4[1]+(2.0*fgkGap);
+ dboxAir3B[2] = fgkThAir/2.;
+
+ //PRESHOWER
+ //Air gap is a BOX of Material Air
+ gMC->Gsvolu("ECGB","BOX", idtmed[698], dboxAir3B, 3);
+ //VETO
+ gMC->Gsvolu("ECVB","BOX", idtmed[698], dboxAir3B, 3);
+
+ //-------------------------------------------------//
+
+ //-------------------------------------------------//
+ //G10 boundary between honeycomb and SS : EDGB
+ //================================================
+ // Make a 10.3mm thick G10 Boundary for Unit module B
+ // X-dimension same as EHC2+Airgap+0.05
+ // Y-dimension same as EHC2+Airgap+0.05
+ // Z-dimension 1.03/2 = 0.515 cm
+ Float_t dboxGGB[3];
+ dboxGGB[0] = dboxAir3B[0]+(2.0*fgkGap);
+ dboxGGB[1] = dboxAir3B[1]+(2.0*fgkGap);
+ dboxGGB[2] = fgkThG10/2.;
+
+ //PRESHOWER
+ //G10 BOX
+ gMC->Gsvolu("EDGB","BOX", idtmed[607], dboxGGB, 3);
+ //VETO
+ gMC->Gsvolu("EDVB","BOX", idtmed[607], dboxGGB, 3);
+ //-------------------------------------------------//
+ //----------------------------------------------------------//
+ //Stainless Steel Bounadry : ESSB
+ //==================================
+ // Make a 10.3mm thick Stainless Steel boundary for Unit module B
+ // X-dimension same as EHC2 + Airgap + G10 + 0.3
+ // Y-dimension same as EHC2 + Airgap + G10 + 0.3
+ // Z-dimension 1.03/2 = 0.515 cm
+ //------------------------------------------------------//
+ // A Stainless Steel Boundary Channel to house the unit module
+
+ Float_t dboxSS2[3];
+ dboxSS2[0] = dboxGGB[0] + fgkSSBoundary;
+ dboxSS2[1] = dboxGGB[1] + fgkSSBoundary;
+ dboxSS2[2] = fgkThSS/2.;
+
+ //PRESHOWER
+ //Stainless Steel boundary - Material Stainless Steel
+ gMC->Gsvolu("ESSB","BOX", idtmed[618], dboxSS2, 3);
+ //VETO
+ gMC->Gsvolu("ESVB","BOX", idtmed[618], dboxSS2, 3);
+ //----------------------------------------------------------------//
+
+ //----------------------------------------------------------------//
+ // Here we need to place the volume in order ESSB -> EDGB -> ECGB
+ // this makes the SS boiundary and the 0.5mm thick FR4 insulation in place,
+ // and the air volume ECGB acts as mother for the rest of components.
+ // The above placeemnt is done at (0.,0.,0.) relative coordiante
+ // Now we place bottom PCB, honeycomb, top PCB in this volume. We donot place
+ // unnecessary air volumes now. Just leave the gap as we are placing them
+ // in air only. This also reduces the number of volumes for geant to track.
+
+// Tree structure for different volumes
+//
+// EUM2
+// |
+// --------------------
+// | | |
+// EBPB ESSB EBKB
+// |
+// EDGB
+// |
+// ECGB
+// |
+// --------------------
+// | | |
+// EPCB(1) EHC2 EPCB(2)
+// (bottom) | (top PCB)
+// |
+// Sensitive volume
+// (gas)
+//
+
+//PRESHOWER
+//Creating the side channels
+// SS boundary channel, followed by G10 and Air Gap
+ gMC->Gspos("EDGB", 1, "ESSB", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("ECGB", 1, "EDGB", 0., 0., 0., 0, "ONLY");
+ //VETO
+ gMC->Gspos("EDVB", 1, "ESVB", 0., 0., 0., 0, "ONLY");
+ gMC->Gspos("ECVB", 1, "EDVB", 0., 0., 0., 0, "ONLY");
+
+ // now other components, using Bedang's code, but changing the values.
+ //Positioning Bottom PCB, Honey Comb abd Top PCB in AIR
+
+ //VETO
+ //Positioning the Bottom 0.16 cm PCB
+ Float_t zbpcb2 = -dboxAir3B[2] + (2.0*fgkGap) + fgkThPCB/2.;
+ gMC->Gspos("EPCB", 1, "ECVB", 0., 0., zbpcb2, 0, "ONLY");
+ //Positioning the Honey Comb 0.5 cm
+ Float_t zhc2 = zbpcb2 + fgkThPCB/2. + fgkCellDepth/2.;
+ gMC->Gspos("EHC2", 1, "ECVB", 0., 0., zhc2, 0, "ONLY");
+ //Positioning the Top PCB 0.16 cm
+ Float_t ztpcb2 = zhc2 + fgkCellDepth/2 + fgkThPCB/2.;
+ gMC->Gspos("EPCB", 2, "ECVB", 0., 0., ztpcb2, 0, "ONLY");
+
+ //PRESHOWER
+ //For preshower plane the ordering is reversed
+ //Positioning the Bottom 0.16 cm PCB
+ zbpcb2 = -dboxAir3B[2] + fgkThPCB + fgkThPCB/2.;
+ gMC->Gspos("EPCB", 1, "ECGB", 0., 0., zbpcb2, 0, "ONLY");
+ //Positioning the Honey Comb 0.5 cm
+ zhc2 = zbpcb2 + fgkThPCB/2. + fgkCellDepth/2.;
+ gMC->Gspos("EHC2", 1, "ECGB", 0., 0., zhc2, 0, "ONLY");
+ //Positioning the Top PCB 0.16 cm
+ ztpcb2 = zhc2 + fgkCellDepth/2 + fgkThPCB/2.;
+ gMC->Gspos("EPCB", 2, "ECGB", 0., 0., ztpcb2, 0, "ONLY");
+
+
+
+ //--------------Now let us construct final UM ---------------//
+ // We will do it as follows :
+ // (i) First make a UM of air. which will have dimensions
+ // of the SS boundary Channel (in x,y) and of height 13.3mm
+ //(ii) Then we will place all the components
+
+ //----------------------------------------------------------//
+ // A unit module type B of Air
+ // Dimensions of Unit Module same as SS boundary channel
+
+ Float_t dboxUM2[3];
+ dboxUM2[0] = dboxSS2[0];
+ dboxUM2[1] = dboxSS2[1];
+ dboxUM2[2] = fgkThSS/2. +0.15; // 0.15 added to accomodate Base Plate at
+ // the bottom and the backplane PCB at the top.
+
+ //PRESHOWER
+ //Create a Unit module of above dimensions Material : AIR
+ gMC->Gsvolu("EUM2","BOX", idtmed[698], dboxUM2, 3);
+
+ //VETO
+ gMC->Gsvolu("EUV2","BOX", idtmed[698], dboxUM2, 3);
+ //----------------------------------------------------------------//
+
+ //BASE PLATE : EBPB
+ //==================
+ // Make a 2mm thick G10 Base plate for Unit module B
+ // Base plate is as big as the final UM dimensions that is as
+ // SS boundary channel
+ Float_t dboxBaseB[3];
+ dboxBaseB[0] = dboxSS2[0];
+ dboxBaseB[1] = dboxSS2[1];
+ dboxBaseB[2] = fgkThBase/2.;
+
+ //Base Blate is a G10 BOX
+ gMC->Gsvolu("EBPB","BOX", idtmed[607], dboxBaseB, 3);
+ //----------------------------------------------------//
+
+ //VETO
+ //- Placing of all components of UM in AIR BOX EUM2--//
+ //(1) FIRST PUT THE BASE PLATE
+ Float_t zbaseplate2 = -dboxUM2[2] + fgkThBase/2.;
+ gMC->Gspos("EBPB", 1, "EUV2", 0., 0., zbaseplate2, 0, "ONLY");
+
+ //(2) NEXT PLACING the SS BOX
+ Float_t zss2 = zbaseplate2 + fgkThBase/2. + fgkThSS/2.;
+ gMC->Gspos("ESVB", 1, "EUV2", 0., 0., zss2, 0, "ONLY");
+
+ // (3) Positioning the Backplane PCB 0.1 cm
+ Float_t zbkp2 = zss2 + fgkThSS/2. + fgkThBKP/2.;
+ gMC->Gspos("EBKB", 1, "EUV2", 0., 0., zbkp2, 0, "ONLY");
+
+
+
+ //FOR PRESHOWER
+ // (3) Positioning the Backplane PCB 0.1 cm
+ zbkp2 = -dboxUM2[2] + fgkThBKP/2.;
+ gMC->Gspos("EBKB", 1, "EUM2", 0., 0., zbkp2, 0, "ONLY");
+
+ //(2) NEXT PLACING the SS BOX
+ zss2 = zbkp2 + fgkThBKP/2. + fgkThSS/2.;
+ gMC->Gspos("ESSB", 1, "EUM2", 0., 0., zss2, 0, "ONLY");
+
+ //(1) FIRST PUT THE BASE PLATE
+ zbaseplate2 = zss2 + fgkThSS/2 + fgkThBase/2.;
+ gMC->Gspos("EBPB", 1, "EUM2", 0., 0., zbaseplate2, 0, "ONLY");
+ //-------------------- UM Type B completed ------------------------//
+
+
+ //--- Now we need to make Lead plates of UM dimension -----//
+
+ /**************************/
+ //----------------------------------------------------------//
+ // The lead convertor is of unit module size
+ // Dimensions of Unit Module same as SS boundary channel
+
+ Float_t dboxPba[3];
+ dboxPba[0] = dboxUM1[0];
+ dboxPba[1] = dboxUM1[1];
+ dboxPba[2] = fgkThLead/2.;
+ // Lead of UM dimension
+ gMC->Gsvolu("EPB1","BOX", idtmed[600], dboxPba, 3);
+
+ Float_t dboxPbb[3];
+ dboxPbb[0] = dboxUM2[0];
+ dboxPbb[1] = dboxUM2[1];
+ dboxPbb[2] = fgkThLead/2.;
+ // Lead of UM dimension
+ gMC->Gsvolu("EPB2","BOX", idtmed[600], dboxPbb, 3);
+
+ //----------------------------------------------------------------//