983 G4Material* fCrystalMaterial = G4Material::GetMaterial(
"Cesiumiodide");
991 solidEnd =
new G4Cons(
"EndWorld",(*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,(*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
992 (*emcEnd).WorldDz/2,0.*deg,360.*deg);
993 logicEnd =
new G4LogicalVolume(solidEnd, G4Material::GetMaterial(
"Air"),
"EndWorld", 0, 0, 0);
994 physiEnd =
new G4PVPlacement(0,
995 G4ThreeVector(0,0,(*emcEnd).WorldZPosition),
1006 G4RotationMatrix *rotateEnd =
new G4RotationMatrix();
1007 rotateEnd->rotateY(180.*deg);
1008 physiEnd =
new G4PVPlacement(rotateEnd,
1009 G4ThreeVector(0,0,-(*emcEnd).WorldZPosition),
1041 solidEndPhi =
new G4Cons(
"EndPhi",(*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,(*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
1042 (*emcEnd).WorldDz/2,0*deg,22.5*deg);
1043 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"EndPhi", 0, 0, 0);
1044 for(G4int i=0;i<14;i++)
1048 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1049 rotatePhi->rotateZ(-i*22.5*deg+67.5*deg);
1050 physiEndPhi =
new G4PVPlacement(rotatePhi,G4ThreeVector(0,0,0),logicEndPhi,
"EndPhi",logicEnd,
false,i,
false);
1056 for(G4int i=0;i<35;i++)
1060 solidEndCasing =
new G4IrregBox(
"EndCasing",(*emcEnd).fPnt[i]);
1061 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCasingMaterial,
"EndCasing");
1062 physiEndCasing =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicEndCasing,
"EndCasing",logicEndPhi,
false,copyNb,
false);
1065 solidEndCrystal =
new G4IrregBox(
"EndCrystal",(*emcEnd).cryPoint);
1066 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,
"EndCrystal");
1067 physiEndCrystal =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicEndCrystal,
"EndCrystal",logicEndCasing,
false,copyNb,
false);
1077 solidEndPhi =
new G4Cons(
"EndPhi",(*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,(*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
1078 (*emcEnd).WorldDz/2,67.5*deg,22.5*deg);
1079 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"EndPhi", 0, 0, 0);
1080 for(G4int i=0;i<2;i++)
1082 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1083 rotatePhi->rotateZ(-i*180.*deg);
1084 physiEndPhi =
new G4PVPlacement(rotatePhi,G4ThreeVector(0,0,0),logicEndPhi,
"EndPhi",logicEnd,
false,i*8+6,
false);
1089 for(G4int i=0;i<35;i++)
1092 solidEndCasing =
new G4IrregBox(
"EndCasing",(*emcEnd).fPnt1[i]);
1093 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCasingMaterial,
"EndCasing");
1094 physiEndCasing =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicEndCasing,
"EndCasing",logicEndPhi,
false,copyNb,
false);
1097 solidEndCrystal =
new G4IrregBox(
"EndCrystal",(*emcEnd).cryPoint);
1098 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,
"EndCrystal");
1099 physiEndCrystal =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicEndCrystal,
"EndCrystal",logicEndCasing,
false,copyNb,
false);
1106 (*emcEnd).ReflectX();
1109 for(G4int i=0;i<35;i++)
1110 for (G4int j=0;j<8;j++)
1111 (*emcEnd).fPnt1[i][j].rotateZ(-90.*deg);
1113 solidEndPhi =
new G4Cons(
"EndPhi",(*emcEnd).WorldRmin1,(*emcEnd).WorldRmax1,(*emcEnd).WorldRmin2,(*emcEnd).WorldRmax2,
1114 (*emcEnd).WorldDz/2,0*deg,22.5*deg);
1115 logicEndPhi =
new G4LogicalVolume(solidEndPhi, G4Material::GetMaterial(
"Air"),
"EndPhi", 0, 0, 0);
1116 for(G4int i=0;i<2;i++)
1118 G4RotationMatrix *rotatePhi =
new G4RotationMatrix();
1119 rotatePhi->rotateZ(-i*180.*deg-90.*deg);
1120 physiEndPhi =
new G4PVPlacement(rotatePhi,G4ThreeVector(0,0,0),logicEndPhi,
"EndPhi",logicEnd,
false,i*8+7,
false);
1125 for(G4int i=0;i<35;i++)
1128 solidEndCasing =
new G4IrregBox(
"EndCasing",(*emcEnd).fPnt1[i]);
1129 logicEndCasing =
new G4LogicalVolume(solidEndCasing,fCrystalMaterial,
"EndCasing");
1130 physiEndCasing =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicEndCasing,
"EndCasing",logicEndPhi,
false,copyNb,
false);
1133 solidEndCrystal =
new G4IrregBox(
"EndCrystal",(*emcEnd).cryPoint);
1134 logicEndCrystal =
new G4LogicalVolume(solidEndCrystal,fCrystalMaterial,
"EndCrystal");
1135 physiEndCrystal =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicEndCrystal,
"EndCrystal",logicEndCasing,
false,copyNb,
false);
1149 solidSupportBar =
new G4Tubs(
"SupportBar",
1150 (*besEMCGeometry).BSCRmax+(*besEMCGeometry).SPBarThickness1,
1151 (*besEMCGeometry).BSCRmax+(*besEMCGeometry).SPBarThickness+(*besEMCGeometry).SPBarThickness1,
1152 (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz,
1156 logicSupportBar =
new G4LogicalVolume(solidSupportBar,stainlessSteel,
"SupportBar");
1158 physiSupportBar =
new G4PVPlacement(0,G4ThreeVector(0,0,0),logicSupportBar,
"SupportBar",logicEMC,
false,0,
false);
1160 solidSupportBar1 =
new G4Tubs(
"SupportBar1",
1161 (*besEMCGeometry).BSCRmax,
1162 (*besEMCGeometry).BSCRmax+(*besEMCGeometry).SPBarThickness1,
1163 (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3,
1164 (*besEMCGeometry).BSCPhiDphi-(*besEMCGeometry).SPBarDphi/2,
1165 (*besEMCGeometry).SPBarDphi);
1167 logicSupportBar1 =
new G4LogicalVolume(solidSupportBar1,stainlessSteel,
"SupportBar1");
1169 for(G4int i=0;i<(*besEMCGeometry).BSCNbPhi/2;i++)
1171 G4RotationMatrix *rotateSPBar =
new G4RotationMatrix();
1172 rotateSPBar->rotateZ((*besEMCGeometry).BSCPhiDphi-i*2*(*besEMCGeometry).BSCPhiDphi);
1173 physiSupportBar1 =
new G4PVPlacement(rotateSPBar,G4ThreeVector(0,0,0),logicSupportBar1,
"SupportBar1",logicEMC,
false,0,
false);
1177 solidEndRing =
new G4Tubs(
"EndRing",
1178 (*besEMCGeometry).EndRingRmin,
1179 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr/2,
1180 (*besEMCGeometry).EndRingDz/2,
1184 solidGear =
new G4Tubs(
"Gear",
1185 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr/2,
1186 (*besEMCGeometry).EndRingRmin+(*besEMCGeometry).EndRingDr,
1187 (*besEMCGeometry).EndRingDz/2,
1189 (*besEMCGeometry).BSCPhiDphi);
1192 solidTaperRing1 =
new G4Tubs(
"TaperRing1",
1193 (*besEMCGeometry).TaperRingRmin1,
1194 (*besEMCGeometry).TaperRingRmin1+(*besEMCGeometry).TaperRingThickness1,
1195 (*besEMCGeometry).TaperRingInnerLength/2,
1199 solidTaperRing2 =
new G4Cons(
"TaperRing2",
1200 (*besEMCGeometry).TaperRingRmin1,
1201 (*besEMCGeometry).TaperRingRmin1+(*besEMCGeometry).TaperRingDr,
1202 (*besEMCGeometry).TaperRingRmin2,
1203 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr,
1204 (*besEMCGeometry).TaperRingDz/2,
1208 solidTaperRing3 =
new G4Cons(
"TaperRing3",
1209 (*besEMCGeometry).BSCRmax2,
1210 (*besEMCGeometry).BSCRmax2+(*besEMCGeometry).TaperRingOuterLength1,
1211 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr,
1212 (*besEMCGeometry).TaperRingRmin2+(*besEMCGeometry).TaperRingDr+(*besEMCGeometry).TaperRingOuterLength,
1213 (*besEMCGeometry).TaperRingThickness3/2,
1217 logicEndRing =
new G4LogicalVolume(solidEndRing,stainlessSteel,
"EmcEndRing");
1218 logicGear =
new G4LogicalVolume(solidGear,stainlessSteel,
"Gear");
1219 logicTaperRing1 =
new G4LogicalVolume(solidTaperRing1,stainlessSteel,
"TaperRing1");
1220 logicTaperRing2 =
new G4LogicalVolume(solidTaperRing2,stainlessSteel,
"TaperRing2");
1221 logicTaperRing3 =
new G4LogicalVolume(solidTaperRing3,stainlessSteel,
"TaperRing3");
1223 for(G4int i=0;i<2;i++)
1225 G4RotationMatrix *rotateSPRing =
new G4RotationMatrix();
1226 G4double zEndRing,z1,z2,z3;
1229 zEndRing = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz/2;
1230 z1 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3
1231 -(*besEMCGeometry).TaperRingDz-(*besEMCGeometry).TaperRingInnerLength/2;
1232 z2 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3-(*besEMCGeometry).TaperRingDz/2;
1233 z3 = (*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3/2;
1237 rotateSPRing->rotateY(180.*deg);
1238 zEndRing = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3+(*besEMCGeometry).EndRingDz/2);
1239 z1 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3
1240 -(*besEMCGeometry).TaperRingDz-(*besEMCGeometry).TaperRingInnerLength/2);
1241 z2 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3-(*besEMCGeometry).TaperRingDz/2);
1242 z3 = -((*besEMCGeometry).BSCDz+(*besEMCGeometry).TaperRingThickness3/2);
1245 physiEndRing =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,zEndRing),
1246 logicEndRing,
"EndRing",logicEMC,
false,0);
1248 for(G4int j=0;j<(*besEMCGeometry).BSCNbPhi/2;j++)
1250 G4RotationMatrix *rotateGear =
new G4RotationMatrix();
1251 rotateGear->rotateZ((*besEMCGeometry).BSCPhiDphi/2-j*2*(*besEMCGeometry).BSCPhiDphi);
1252 physiGear =
new G4PVPlacement(rotateGear,G4ThreeVector(0,0,zEndRing),
1253 logicGear,
"Gear",logicEMC,
false,0);
1256 physiTaperRing1 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z1),
1257 logicTaperRing1,
"TaperRing1",logicEMC,
false,0);
1259 physiTaperRing2 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z2),
1260 logicTaperRing2,
"TaperRing2",logicEMC,
false,0);
1262 physiTaperRing3 =
new G4PVPlacement(rotateSPRing,G4ThreeVector(0,0,z3),
1263 logicTaperRing3,
"TaperRing3",logicEMC,
false,0);