+
+
+ // -------------------------------------------------------------------------------
+ // -> EM calorimeter (ZEM)
+
+ gMC->Gsvolu("ZEM ", "PARA", idtmed[10], fDimZEM, 6);
+
+ Int_t irot1, irot2;
+
+ gMC->Matrix(irot1,0.,0.,90.,90.,90.,180.); // Rotation matrix 1
+ gMC->Matrix(irot2,180.,0.,90.,fDimZEM[3]+90.,90.,fDimZEM[3]); // Rotation matrix 2
+// printf("irot1 = %d, irot2 = %d \n", irot1, irot2);
+
+ gMC->Gsvolu("ZEMF", "TUBE", idtmed[3], fFibZEM, 3); // Active material
+
+ gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
+
+ dimPb[0] = fDimZEMPb; // Lead slices
+ dimPb[1] = fDimZEM[2];
+ dimPb[2] = fDimZEM[1];
+ dimPb[3] = 90.-fDimZEM[3];
+ dimPb[4] = 0.;
+ dimPb[5] = 0.;
+ gMC->Gsvolu("ZEL0", "PARA", idtmed[5], dimPb, 6);
+ gMC->Gsvolu("ZEL1", "PARA", idtmed[5], dimPb, 6);
+ gMC->Gsvolu("ZEL2", "PARA", idtmed[5], dimPb, 6);
+
+ // --- Position the lead slices in the tranche
+ Float_t zTran = fDimZEM[0]/fDivZEM[2];
+ Float_t zTrPb = -zTran+fDimZEMPb;
+ gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
+ gMC->Gspos("ZEL1", 1, "ZETR", fDimZEMPb, 0., 0., 0, "ONLY");
+
+ // --- Vacuum zone (to be filled with fibres)
+ dimVoid[0] = (zTran-2*fDimZEMPb)/2.;
+ dimVoid[1] = fDimZEM[2];
+ dimVoid[2] = fDimZEM[1];
+ dimVoid[3] = 90.-fDimZEM[3];
+ dimVoid[4] = 0.;
+ dimVoid[5] = 0.;
+ gMC->Gsvolu("ZEV0", "PARA", idtmed[10], dimVoid,6);
+ gMC->Gsvolu("ZEV1", "PARA", idtmed[10], dimVoid,6);
+
+ // --- Divide the vacuum slice into sticks along x axis
+ gMC->Gsdvn("ZES0", "ZEV0", fDivZEM[0], 3);
+ gMC->Gsdvn("ZES1", "ZEV1", fDivZEM[0], 3);
+
+ // --- Positioning the fibers into the sticks
+ gMC->Gspos("ZEMF", 1,"ZES0", 0., 0., 0., irot2, "ONLY");
+ gMC->Gspos("ZEMF", 1,"ZES1", 0., 0., 0., irot2, "ONLY");
+
+ // --- Positioning the vacuum slice into the tranche
+ Float_t displFib = fDimZEM[1]/fDivZEM[0];
+ gMC->Gspos("ZEV0", 1,"ZETR", -dimVoid[0], 0., 0., 0, "ONLY");
+ gMC->Gspos("ZEV1", 1,"ZETR", -dimVoid[0]+zTran, 0., displFib, 0, "ONLY");
+
+ // --- Positioning the ZEM into the ZDC - rotation for 90 degrees
+ gMC->Gspos("ZEM ", 1,"ZDC ", fPosZEM[0], fPosZEM[1], fPosZEM[2], irot1, "ONLY");
+
+ // --- Adding last slice at the end of the EM calorimeter
+ Float_t zLastSlice = fPosZEM[2]+fDimZEMPb+fDimZEM[0];
+ gMC->Gspos("ZEL2", 1,"ZDC ", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");