- thgas = fPar[2];
- thmin = fIn[0];
- thmax = fIn[1];
- zdist1 = fIn[2];
- zdist = TMath::Abs(zdist1);
- thlow = fIn[3];
- thhigh = fIn[4];
- edge = fGeo[1];
- numqu = Int_t(fGeo[2]);
-
- pad1 = fPadSize[0];
- pad2 = fPadSize[1];
- pad3 = fPadSize[2];
- pad4 = fPadSize[3];
- npad2 = Int_t(24/fPadSize[1]);
-
- spsw2[0] = (npad2 * pad2)/2 + edge;
- spsw2[1] = spsw2[0];
- spsw2[2] = (thgas + .4) / 2;
- scpv2[0] = spsw2[0];
- scpv2[1] = spsw2[1];
- scpv2[2] = spsw2[2];
-// The modules (DW11 and DV11 are filed with gas, G10 plate is ignored)
- pMC->Gsvolu("DW11","BOX ", idtmed[604], spsw2, 3);
- pMC->Gsatt("DW11", "SEEN", 1);
- pMC->Gsvolu("DV11","BOX ", idtmed[604], spsw2, 3);
- pMC->Gsatt("DV11", "SEEN", 1);
-
- // --- DEFINE MODULES, IRON, TUNGSTEN AND LEAD VOLUMES
-
-
- spb[0] = spsw1[0];
- spb[1] = spsw1[1];
- spb[2] = .75;
- pMC->Gsvolu("DPPB","BOX ", idtmed[600], spb, 3);
- pMC->Gsatt("DPPB", "SEEN", 1);
-
- sw[0] = spsw1[0];
- sw[1] = spsw1[1];
- sw[2] = 0.9/2.;
- pMC->Gsvolu("DPW ","BOX ", idtmed[600], sw, 3);
- pMC->Gsatt("DPW ", "SEEN", 1);
-
- sfe[0] = spsw1[0];
- sfe[1] = spsw1[1];
- sfe[2] = 0.6/2.;
- pMC->Gsvolu("DPFE","BOX ", idtmed[605], sfe, 3);
- pMC->Gsatt("DPFE", "SEEN", 1);
-
- smod2[0] = spsw2[0];
- smod2[1] = smod2[0];
- smod2[2] = spsw2[2] + sfe[2] + spb[2] + scpv2[2];
- pMC->Gsvolu("DM11", "BOX ", idtmed[698], smod2, 3);
-
- // --- place gas box (as CPV), iron support, lead converter and gas box
- // --- (preshower) in the module
- xc = 0.;
- yc = 0.;
- // --- First the CPV box
- zc = -(spsw2[2] + sfe[2] + spb[2] + spsw2[2]) + spsw2[2];
- pMC->Gspos("DV11", 1, "DM11", xc, yc, zc, 0, "ONLY");
- // --- Then iron support plate
- zc = zc + sfe[2] + spsw2[2];
- pMC->Gspos("DPFE", 1, "DM11", xc, yc, zc, 0, "ONLY");
- // --- Then lead converter plate
- zc = zc + sfe[2] + spb[2];
- pMC->Gspos("DPPB", 1, "DM11", xc, yc, zc, 0, "ONLY");
- // --- Lastly the preshower box
- zc = zc + spb[2] + spsw2[2];
- pMC->Gspos("DW11", 1, "DM11", xc, yc, zc, 0, "ONLY");
+ // Place hexagonal cells ECCU cells inside EHC1 (72 X 72)
+
+ Int_t xrow = 1;
+
+ yb = -dpara1[1] + (1./fgkSqroot3by2)*hexd1[6];
+ zb = 0.;
+
+ for (j = 1; j <= fNcellSM; ++j) {
+ xb =-(dpara1[0] + dpara1[1]*0.577) + 2*hexd1[6]; //0.577=tan(30deg)
+ if(xrow >= 2){
+ xb = xb+(xrow-1)*hexd1[6];
+ }
+ for (i = 1; i <= fNcellSM; ++i) {
+ number = i+(j-1)*fNcellSM;
+ gMC->Gspos("ECCU", number, "EHC1", xb,yb,zb, ihrotm, "ONLY");
+ xb += (hexd1[6]*2.);
+ }
+ xrow = xrow+1;
+ yb += (hexd1[6]*fgkSqroot3);
+ }
+
+
+ // Place EHC1 and EAIR into ESMA and ESMB
+
+ Float_t zAir1,zAir2,zGas;
+
+ //ESMA is normal supermodule with base at bottom, with EHC1
+ zAir1= -dparasm1[2] + fgkThBase + dparaair[2];
+ gMC->Gspos("EAIR", 1, "ESMA", 0., 0., zAir1, 0, "ONLY");
+ zGas=zAir1+dparaair[2]+ fgkThPCB + dpara1[2];
+ //Line below Commented for version 0 of PMD routine
+ // gMC->Gspos("EHC1", 1, "ESMA", 0., 0., zGas, 0, "ONLY");
+ zAir2=zGas+dpara1[2]+ fgkThPCB + dparaair[2];
+ gMC->Gspos("EAIR", 2, "ESMA", 0., 0., zAir2, 0, "ONLY");
+
+ // ESMB is mirror image of ESMA, with base at top, with EHC1
+
+ zAir1= -dparasm1[2] + fgkThPCB + dparaair[2];
+ gMC->Gspos("EAIR", 3, "ESMB", 0., 0., zAir1, 0, "ONLY");
+ zGas=zAir1+dparaair[2]+ fgkThPCB + dpara1[2];
+ //Line below Commented for version 0 of PMD routine
+ // gMC->Gspos("EHC1", 2, "ESMB", 0., 0., zGas, 0, "ONLY");
+ zAir2=zGas+dpara1[2]+ fgkThPCB + dparaair[2];
+ gMC->Gspos("EAIR", 4, "ESMB", 0., 0., zAir2, 0, "ONLY");
+
+
+ // special supermodule EMM2(GEANT only) containing 6 unit modules
+ // volume for SUPERMODULE
+
+ Float_t dparasm2[6] = {12.5,12.5,0.8,30.,0.,0.};
+ dparasm2[0]=(fNcellSM+0.25)*hexd1[6] ;
+ dparasm2[1] = (fNcellSM - fgkNcellHole + 0.25) * fgkSqroot3by2 * hexd1[6];
+ dparasm2[2] = fSMthick/2.;
+
+ gMC->Gsvolu("ESMX","PARA", idtmed[607], dparasm2, 6);
+ gGeoManager->SetVolumeAttribute("ESMX", "SEEN", 0);
+ //
+ gMC->Gsvolu("ESMY","PARA", idtmed[607], dparasm2, 6);
+ gGeoManager->SetVolumeAttribute("ESMY", "SEEN", 0);
+
+ Float_t dpara2[6] = {12.5,12.5,0.4,30.,0.,0.};
+ dpara2[0] = dparasm2[0];
+ dpara2[1] = dparasm2[1];
+ dpara2[2] = fgkCellDepth/2.;
+
+ gMC->Gsvolu("EHC2","PARA", idtmed[698], dpara2, 6);
+ gGeoManager->SetVolumeAttribute("EHC2", "SEEN", 1);
+
+
+ // Air residing between the PCB and the base
+
+ Float_t dpara2Air[6] = {12.5,12.5,8.,30.,0.,0.};
+ dpara2Air[0]= dparasm2[0];
+ dpara2Air[1]= dparasm2[1];
+ dpara2Air[2]= fgkThAir/2.;
+
+ gMC->Gsvolu("EAIX","PARA", idtmed[698], dpara2Air, 6);
+ gGeoManager->SetVolumeAttribute("EAIX", "SEEN", 0);
+
+ // Place hexagonal single cells ECCU inside EHC2
+ // skip cells which go into the hole in top left corner.
+
+ xrow=1;
+ yb = -dpara2[1] + (1./fgkSqroot3by2)*hexd1[6];
+ zb = 0.;
+ for (j = 1; j <= (fNcellSM - fgkNcellHole); ++j) {
+ xb =-(dpara2[0] + dpara2[1]*0.577) + 2*hexd1[6];
+ if(xrow >= 2){
+ xb = xb+(xrow-1)*hexd1[6];
+ }
+ for (i = 1; i <= fNcellSM; ++i) {
+ number = i+(j-1)*fNcellSM;
+ gMC->Gspos("ECCU", number, "EHC2", xb,yb,zb, ihrotm, "ONLY");
+ xb += (hexd1[6]*2.);
+ }
+ xrow = xrow+1;
+ yb += (hexd1[6]*fgkSqroot3);
+ }
+
+
+ // ESMX is normal supermodule with base at bottom, with EHC2
+
+ zAir1= -dparasm2[2] + fgkThBase + dpara2Air[2];
+ gMC->Gspos("EAIX", 1, "ESMX", 0., 0., zAir1, 0, "ONLY");
+ zGas=zAir1+dpara2Air[2]+ fgkThPCB + dpara2[2];
+ //Line below Commented for version 0 of PMD routine
+ // gMC->Gspos("EHC2", 1, "ESMX", 0., 0., zGas, 0, "ONLY");
+ zAir2=zGas+dpara2[2]+ fgkThPCB + dpara2Air[2];
+ gMC->Gspos("EAIX", 2, "ESMX", 0., 0., zAir2, 0, "ONLY");
+
+ // ESMY is mirror image of ESMX with base at bottom, with EHC2
+
+ zAir1= -dparasm2[2] + fgkThPCB + dpara2Air[2];
+ gMC->Gspos("EAIX", 3, "ESMY", 0., 0., zAir1, 0, "ONLY");
+ zGas=zAir1+dpara2Air[2]+ fgkThPCB + dpara2[2];
+ //Line below Commented for version 0 of PMD routine
+ // gMC->Gspos("EHC2", 2, "ESMY", 0., 0., zGas, 0, "ONLY");
+ zAir2=zGas+dpara2[2]+ fgkThPCB + dpara2Air[2];
+ gMC->Gspos("EAIX", 4, "ESMY", 0., 0., zAir2, 0, "ONLY");
+
+ //
+ // special supermodule EMM3 (GEANT only) containing 2 unit modules
+ // volume for SUPERMODULE
+ //
+ Float_t dparaSM3[6] = {12.5,12.5,0.8,30.,0.,0.};
+ dparaSM3[0]=(fNcellSM - fgkNcellHole +0.25)*hexd1[6] ;
+ dparaSM3[1] = (fgkNcellHole + 0.25) * hexd1[6] * fgkSqroot3by2;
+ dparaSM3[2] = fSMthick/2.;
+
+ gMC->Gsvolu("ESMP","PARA", idtmed[607], dparaSM3, 6);
+ gGeoManager->SetVolumeAttribute("ESMP", "SEEN", 0);
+ //
+ gMC->Gsvolu("ESMQ","PARA", idtmed[607], dparaSM3, 6);
+ gGeoManager->SetVolumeAttribute("ESMQ", "SEEN", 0);
+
+ Float_t dpara3[6] = {12.5,12.5,0.4,30.,0.,0.};
+ dpara3[0] = dparaSM3[0];
+ dpara3[1] = dparaSM3[1];
+ dpara3[2] = fgkCellDepth/2.;
+
+ gMC->Gsvolu("EHC3","PARA", idtmed[698], dpara3, 6);
+ gGeoManager->SetVolumeAttribute("EHC3", "SEEN", 1);
+
+ // Air residing between the PCB and the base
+
+ Float_t dpara3Air[6] = {12.5,12.5,8.,30.,0.,0.};
+ dpara3Air[0]= dparaSM3[0];
+ dpara3Air[1]= dparaSM3[1];
+ dpara3Air[2]= fgkThAir/2.;
+
+ gMC->Gsvolu("EAIP","PARA", idtmed[698], dpara3Air, 6);
+ gGeoManager->SetVolumeAttribute("EAIP", "SEEN", 0);
+
+
+ // Place hexagonal single cells ECCU inside EHC3
+ // skip cells which go into the hole in top left corner.
+
+ xrow=1;
+ yb = -dpara3[1] + (1./fgkSqroot3by2)*hexd1[6];
+ zb = 0.;
+ for (j = 1; j <= fgkNcellHole; ++j) {
+ xb =-(dpara3[0] + dpara3[1]*0.577) + 2*hexd1[6];
+ if(xrow >= 2){
+ xb = xb+(xrow-1)*hexd1[6];
+ }
+ for (i = 1; i <= (fNcellSM - fgkNcellHole); ++i) {
+ number = i+(j-1)*(fNcellSM - fgkNcellHole);
+ gMC->Gspos("ECCU", number, "EHC3", xb,yb,zb, ihrotm, "ONLY");
+ xb += (hexd1[6]*2.);
+ }
+ xrow = xrow+1;
+ yb += (hexd1[6]*fgkSqroot3);
+ }
+
+ // ESMP is normal supermodule with base at bottom, with EHC3
+
+ zAir1= -dparaSM3[2] + fgkThBase + dpara3Air[2];
+ gMC->Gspos("EAIP", 1, "ESMP", 0., 0., zAir1, 0, "ONLY");
+ zGas=zAir1+dpara3Air[2]+ fgkThPCB + dpara3[2];
+ //Line below Commented for version 0 of PMD routine
+ // gMC->Gspos("EHC3", 1, "ESMP", 0., 0., zGas, 0, "ONLY");
+ zAir2=zGas+dpara3[2]+ fgkThPCB + dpara3Air[2];
+ gMC->Gspos("EAIP", 2, "ESMP", 0., 0., zAir2, 0, "ONLY");
+
+ // ESMQ is mirror image of ESMP with base at bottom, with EHC3
+
+ zAir1= -dparaSM3[2] + fgkThPCB + dpara3Air[2];
+ gMC->Gspos("EAIP", 3, "ESMQ", 0., 0., zAir1, 0, "ONLY");
+ zGas=zAir1+dpara3Air[2]+ fgkThPCB + dpara3[2];
+ //Line below Commented for version 0 of PMD routine
+ // gMC->Gspos("EHC3", 2, "ESMQ", 0., 0., zGas, 0, "ONLY");
+ zAir2=zGas+dpara3[2]+ fgkThPCB + dpara3Air[2];
+ gMC->Gspos("EAIP", 4, "ESMQ", 0., 0., zAir2, 0, "ONLY");