+ // EPMD GASPMD AIR : INSIDE PMD and its SIZE
+ // *** Define the EPMD Volume and fill with air ***
+ // Gaspmd, the dimension of HEXAGONAL mother volume of PMD,
+
+
+ Float_t gaspmd[10] = {0.,360.,6,2,-4.,12.,150.,4.,12.,150.};
+
+ gaspmd[5] = fgkNcellHole * fgkCellRadius * 2. * fgkSqroot3by2;
+ gaspmd[8] = gaspmd[5];
+
+ gMC->Gsvolu("EPMD", "PGON", idtmed[698], gaspmd, 10);
+ gMC->Gsatt("EPMD", "SEEN", 0);
+
+ AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.);
+
+ AliMatrix(jhrot12, 90., 120., 90., 210., 0., 0.);
+ AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
+
+
+ Float_t dmthick = 2. * fSMthick + fgkThLead + fgkThSteel;
+
+ // dparaemm1 array contains parameters of the imaginary volume EMM1,
+ // EMM1 is a master module of type 1, which has 24 copies in the PMD.
+ // EMM1 : normal volume as in old cases
+
+
+ Float_t dparaemm1[6] = {12.5,12.5,0.8,30.,0.,0.};
+ dparaemm1[0] = fSMLength/2.;
+ dparaemm1[1] = dparaemm1[0] *fgkSqroot3by2;
+ dparaemm1[2] = dmthick/2.;
+
+ gMC->Gsvolu("EMM1","PARA", idtmed[698], dparaemm1, 6);
+ gMC->Gsatt("EMM1", "SEEN", 1);
+
+ //
+ // --- DEFINE Modules, iron, and lead volumes
+ // Pb Convertor for EMM1
+
+ Float_t dparapb1[6] = {12.5,12.5,8.,30.,0.,0.};
+ dparapb1[0] = fSMLength/2.;
+ dparapb1[1] = dparapb1[0] * fgkSqroot3by2;
+ dparapb1[2] = fgkThLead/2.;
+
+ gMC->Gsvolu("EPB1","PARA", idtmed[600], dparapb1, 6);
+ gMC->Gsatt ("EPB1", "SEEN", 0);
+
+ // Fe Support for EMM1
+ Float_t dparafe1[6] = {12.5,12.5,8.,30.,0.,0.};
+ dparafe1[0] = dparapb1[0];
+ dparafe1[1] = dparapb1[1];
+ dparafe1[2] = fgkThSteel/2.;
+
+ gMC->Gsvolu("EFE1","PARA", idtmed[618], dparafe1, 6);
+ gMC->Gsatt ("EFE1", "SEEN", 0);
+
+ //
+ // position supermodule ESMA, ESMB, EPB1, EFE1 inside EMM1
+
+ Float_t zps,zpb,zfe,zcv;
+
+ zps = -dparaemm1[2] + fSMthick/2.;
+ gMC->Gspos("ESMB", 1, "EMM1", 0., 0., zps, 0, "ONLY");
+ zpb = zps+fSMthick/2.+dparapb1[2];
+ gMC->Gspos("EPB1", 1, "EMM1", 0., 0., zpb, 0, "ONLY");
+ zfe = zpb+dparapb1[2]+dparafe1[2];
+ gMC->Gspos("EFE1", 1, "EMM1", 0., 0., zfe, 0, "ONLY");
+ zcv = zfe+dparafe1[2]+fSMthick/2.;
+ gMC->Gspos("ESMA", 1, "EMM1", 0., 0., zcv, 0, "ONLY");
+
+ // EMM2 : special master module having full row of cells but the number
+ // of rows limited by hole.
+
+ Float_t dparaemm2[6] = {12.5,12.5,0.8,30.,0.,0.};
+ dparaemm2[0] = fSMLength/2.;
+ dparaemm2[1] = (fNcellSM - fgkNcellHole + 0.25)*fgkCellRadius*fgkSqroot3by2;
+ dparaemm2[2] = dmthick/2.;
+
+ gMC->Gsvolu("EMM2","PARA", idtmed[698], dparaemm2, 6);
+ gMC->Gsatt("EMM2", "SEEN", 1);
+
+ // Pb Convertor for EMM2
+ Float_t dparapb2[6] = {12.5,12.5,8.,30.,0.,0.};
+ dparapb2[0] = dparaemm2[0];
+ dparapb2[1] = dparaemm2[1];
+ dparapb2[2] = fgkThLead/2.;
+
+ gMC->Gsvolu("EPB2","PARA", idtmed[600], dparapb2, 6);
+ gMC->Gsatt ("EPB2", "SEEN", 0);
+
+ // Fe Support for EMM2
+ Float_t dparafe2[6] = {12.5,12.5,8.,30.,0.,0.};
+ dparafe2[0] = dparapb2[0];
+ dparafe2[1] = dparapb2[1];
+ dparafe2[2] = fgkThSteel/2.;
+
+ gMC->Gsvolu("EFE2","PARA", idtmed[618], dparafe2, 6);
+ gMC->Gsatt ("EFE2", "SEEN", 0);
+
+ // position supermodule ESMX, ESMY inside EMM2
+
+ zps = -dparaemm2[2] + fSMthick/2.;
+ gMC->Gspos("ESMY", 1, "EMM2", 0., 0., zps, 0, "ONLY");
+ zpb = zps + fSMthick/2.+dparapb2[2];
+ gMC->Gspos("EPB2", 1, "EMM2", 0., 0., zpb, 0, "ONLY");
+ zfe = zpb + dparapb2[2]+dparafe2[2];
+ gMC->Gspos("EFE2", 1, "EMM2", 0., 0., zfe, 0, "ONLY");
+ zcv = zfe + dparafe2[2]+fSMthick/2.;
+ gMC->Gspos("ESMX", 1, "EMM2", 0., 0., zcv, 0, "ONLY");
+ //
+ // EMM3 : special master module having truncated rows and columns of cells
+ // limited by hole.
+
+ Float_t dparaemm3[6] = {12.5,12.5,0.8,30.,0.,0.};
+ dparaemm3[0] = dparaemm2[1]/fgkSqroot3by2;
+ dparaemm3[1] = (fgkNcellHole + 0.25) * fgkCellRadius *fgkSqroot3by2;
+ dparaemm3[2] = dmthick/2.;
+
+ gMC->Gsvolu("EMM3","PARA", idtmed[698], dparaemm3, 6);
+ gMC->Gsatt("EMM3", "SEEN", 1);
+
+ // Pb Convertor for EMM3
+ Float_t dparapb3[6] = {12.5,12.5,8.,30.,0.,0.};
+ dparapb3[0] = dparaemm3[0];
+ dparapb3[1] = dparaemm3[1];
+ dparapb3[2] = fgkThLead/2.;
+
+ gMC->Gsvolu("EPB3","PARA", idtmed[600], dparapb3, 6);
+ gMC->Gsatt ("EPB3", "SEEN", 0);
+
+ // Fe Support for EMM3
+ Float_t dparafe3[6] = {12.5,12.5,8.,30.,0.,0.};
+ dparafe3[0] = dparapb3[0];
+ dparafe3[1] = dparapb3[1];
+ dparafe3[2] = fgkThSteel/2.;
+
+ gMC->Gsvolu("EFE3","PARA", idtmed[618], dparafe3, 6);
+ gMC->Gsatt ("EFE3", "SEEN", 0);
+
+ // position supermodule ESMP, ESMQ inside EMM3
+
+ zps = -dparaemm3[2] + fSMthick/2.;
+ gMC->Gspos("ESMQ", 1, "EMM3", 0., 0., zps, 0, "ONLY");
+ zpb = zps + fSMthick/2.+dparapb3[2];
+ gMC->Gspos("EPB3", 1, "EMM3", 0., 0., zpb, 0, "ONLY");
+ zfe = zpb + dparapb3[2]+dparafe3[2];
+ gMC->Gspos("EFE3", 1, "EMM3", 0., 0., zfe, 0, "ONLY");
+ zcv = zfe + dparafe3[2] + fSMthick/2.;
+ gMC->Gspos("ESMP", 1, "EMM3", 0., 0., zcv, 0, "ONLY");
+ //
+
+ // EHOL is a tube structure made of air
+ //
+ //Float_t d_hole[3];
+ //d_hole[0] = 0.;
+ //d_hole[1] = fgkNcellHole * fgkCellRadius *2. * fgkSqroot3by2 + boundary;
+ //d_hole[2] = dmthick/2.;
+ //
+ //gMC->Gsvolu("EHOL", "TUBE", idtmed[698], d_hole, 3);
+ //gMC->Gsatt("EHOL", "SEEN", 1);
+
+ //Al-rod as boundary of the supermodules
+
+ Float_t alRod[3] ;
+ alRod[0] = fSMLength * 3/2. - gaspmd[5]/2 - fgkBoundary ;
+ alRod[1] = fgkBoundary;
+ alRod[2] = dmthick/2.;
+
+ gMC->Gsvolu("EALM","BOX ", idtmed[698], alRod, 3);
+ gMC->Gsatt ("EALM", "SEEN", 1);
+ Float_t xalm[3];
+ xalm[0]=alRod[0] + gaspmd[5] + 3.0*fgkBoundary;
+ xalm[1]=-xalm[0]/2.;
+ xalm[2]=xalm[1];
+
+ Float_t yalm[3];
+ yalm[0]=0.;
+ yalm[1]=xalm[0]*fgkSqroot3by2;
+ yalm[2]=-yalm[1];
+
+ // delx = full side of the supermodule
+ Float_t delx=fSMLength * 3.;
+ Float_t x1= delx*fgkSqroot3by2 /2.;
+ Float_t x4=delx/4.;
+
+ // placing master modules and Al-rod in PMD
+
+ Float_t dx = fSMLength;
+ Float_t dy = dx * fgkSqroot3by2;
+ Float_t xsup[9] = {-dx/2., dx/2., 3.*dx/2.,
+ -dx, 0., dx,
+ -3.*dx/2., -dx/2., dx/2.};
+
+ Float_t ysup[9] = {dy, dy, dy,
+ 0., 0., 0.,
+ -dy, -dy, -dy};
+
+ // xpos and ypos are the x & y coordinates of the centres of EMM1 volumes
+
+ Float_t xoff = fgkBoundary * TMath::Tan(fgkPi/6.);
+ Float_t xmod[3]={x4 + xoff , x4 + xoff, -2.*x4-fgkBoundary/fgkSqroot3by2};
+ Float_t ymod[3] = {-x1 - fgkBoundary, x1 + fgkBoundary, 0.};
+ Float_t xpos[9], ypos[9], x2, y2, x3, y3;
+
+ Float_t xemm2 = fSMLength/2. -
+ (fNcellSM + fgkNcellHole + 0.25) * fgkCellRadius * 0.5
+ + xoff;
+ Float_t yemm2 = -(fNcellSM + fgkNcellHole + 0.25)*fgkCellRadius*fgkSqroot3by2
+ - fgkBoundary;
+
+ Float_t xemm3 = (fNcellSM + 0.5 * fgkNcellHole + 0.25) * fgkCellRadius +
+ xoff;
+ Float_t yemm3 = - (fgkNcellHole - 0.25) * fgkCellRadius * fgkSqroot3by2 -
+ fgkBoundary;
+
+ Float_t theta[3] = {0., 2.*fgkPi/3., 4.*fgkPi/3.};
+ Int_t irotate[3] = {0, jhrot12, jhrot13};
+
+ nummod=0;
+ for (j=0; j<3; ++j) {
+ gMC->Gspos("EALM", j+1, "EPMD", xalm[j],yalm[j], 0., irotate[j], "ONLY");
+ x2=xemm2*TMath::Cos(theta[j]) - yemm2*TMath::Sin(theta[j]);
+ y2=xemm2*TMath::Sin(theta[j]) + yemm2*TMath::Cos(theta[j]);
+
+ gMC->Gspos("EMM2", j+1, "EPMD", x2,y2, 0., irotate[j], "ONLY");
+
+ x3=xemm3*TMath::Cos(theta[j]) - yemm3*TMath::Sin(theta[j]);
+ y3=xemm3*TMath::Sin(theta[j]) + yemm3*TMath::Cos(theta[j]);
+
+ gMC->Gspos("EMM3", j+4, "EPMD", x3,y3, 0., irotate[j], "ONLY");
+
+ for (i=1; i<9; ++i) {
+ xpos[i]=xmod[j] + xsup[i]*TMath::Cos(theta[j]) -
+ ysup[i]*TMath::Sin(theta[j]);
+ ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) +
+ ysup[i]*TMath::Cos(theta[j]);
+
+ AliDebugClass(1,Form("xpos: %f, ypos: %f", xpos[i], ypos[i]));
+
+ nummod = nummod+1;
+
+ AliDebugClass(1,Form("nummod %d",nummod));
+
+ gMC->Gspos("EMM1", nummod + 6, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY");
+
+ }
+ }