138 G4Element* elH = NistMan->FindOrBuildElement(
"H");
139 G4Element* elC = NistMan->FindOrBuildElement(
"C");
140 G4Element* elN = NistMan->FindOrBuildElement(
"N");
141 G4Element* elO = NistMan->FindOrBuildElement(
"O");
142 G4Element* elNa = NistMan->FindOrBuildElement(
"Na");
143 G4Element* elP = NistMan->FindOrBuildElement(
"P");
144 G4Element* elS = NistMan->FindOrBuildElement(
"S");
145 G4Element* elCl = NistMan->FindOrBuildElement(
"Cl");
146 G4Element* elK = NistMan->FindOrBuildElement(
"K");
147 G4Element* elCa = NistMan->FindOrBuildElement(
"Ca");
157 G4double tAir = 293.15 * CLHEP::kelvin;
158 G4double pAir = 1.*CLHEP::atmosphere;
160 fAir->AddElement(elN, 0.7);
161 fAir->AddElement(elO, 0.3);
164 G4double d_Fat = 0.923*g/cm3;
168 fFat->AddElement(elH, 0.119);
169 fFat->AddElement(elC, 0.772);
170 fFat->AddElement(elO, 0.109);
173 G4double d_Water = 1.*g/cm3;
175 matname =
"Water_MI";
177 fWater->AddElement(elH, 2);
178 fWater->AddElement(elO, 1);
181 G4double d_BoneMatrix = 1.263*g/cm3;
183 matname =
"BoneMatrix_MI";
191 G4double d_Mineral = 2.74*g/cm3;
193 matname =
"Mineral_MI";
203 1/(comp[0]/d_Fat+comp[1]/d_Water+comp[2]/d_BoneMatrix+comp[3]/d_Mineral);
205 for (
size_t i=0; i<4; i++) {
206 if (comp[i]>0) n_MedMat++;
207 if (comp[i]<0 || comp[i]>1) {
209 "Error in Medical Material composition: comp[i]<0 or comp[i]>1";
210 G4Exception(
"DetectorConstuction::DefineMaterials()",
"dc0001",
211 FatalException,excep);
215 std::stringstream ss0,ss1,ss2,ss3;
220 if (comp[0]==0 || comp[0]==1) ss0 <<
".00";
221 if (comp[1]==0 || comp[1]==1) ss1 <<
".00";
222 if (comp[2]==0 || comp[2]==1) ss2 <<
".00";
223 if (comp[3]==0 || comp[3]==1) ss3 <<
".00";
224 if (ss0.str().size()<4) ss0 <<
"0";
225 if (ss1.str().size()<4) ss1 <<
"0";
226 if (ss2.str().size()<4) ss2 <<
"0";
227 if (ss3.str().size()<4) ss3 <<
"0";
228 if (ss0.str().size()!=4 || ss1.str().size()!=4 || ss2.str().size()!=4
229 || ss3.str().size()!=4) {
231 "Error in MedMaterial composition: check the digits of the elements of comp";
232 G4Exception(
"DetectorConstuction::DefineMaterials()",
"dc0002",
233 FatalException,excep);
236 matname =
"MedMat_"+ss0.str()+
"_"+ss1.str()+
"_"+ss2.str()+
"_"+ss3.str();
242 if (comp[0]+comp[1]+comp[2]+comp[3] != 1) {
243 G4String excep =
"Error in Medical Material composition: sum(comp) != 1";
244 G4Exception(
"DetectorConstuction::DefineMaterials()",
245 "dc0003",FatalException,excep);
257 fPMMA->AddElement(elH, 8);
258 fPMMA->AddElement(elC, 5);
259 fPMMA->AddElement(elO, 2);
264 matname =
"adipose_MI";
274 matname =
"glandular_MI";
284 matname =
"breast5050_MI";
293 matname =
"liver_MI";
295 fliver->AddElement(elH, 0.102);
296 fliver->AddElement(elC, 0.139);
297 fliver->AddElement(elN, 0.030);
298 fliver->AddElement(elO, 0.716);
299 fliver->AddElement(elNa, 0.002);
300 fliver->AddElement(elP, 0.003);
301 fliver->AddElement(elS, 0.003);
302 fliver->AddElement(elCl, 0.002);
303 fliver->AddElement(elK, 0.003);
308 matname =
"kidney_MI";
310 fkidney->AddElement(elH, 0.103);
311 fkidney->AddElement(elC, 0.132);
312 fkidney->AddElement(elN, 0.030);
313 fkidney->AddElement(elO, 0.724);
314 fkidney->AddElement(elNa, 0.002);
315 fkidney->AddElement(elP, 0.002);
316 fkidney->AddElement(elS, 0.002);
317 fkidney->AddElement(elCl, 0.002);
318 fkidney->AddElement(elK, 0.002);
319 fkidney->AddElement(elCa, 0.001);
324 matname =
"Lexan_MI";
326 fLexan->AddElement(elH, 14);
327 fLexan->AddElement(elC, 16);
328 fLexan->AddElement(elO, 3);
333 matname =
"Kapton_MI";
343 matname =
"carcinoma_MI";
358 matname =
"Nylon_MI";
360 fNylon->AddElement(elH, 11);
361 fNylon->AddElement(elC, 6);
362 fNylon->AddElement(elN, 1);
363 fNylon->AddElement(elO, 1);
368 matname =
"Polyethylene_MI";
376 matname =
"Polystyrene_MI";
384 matname =
"grayMatter_MI";
393 matname =
"whiteMatter_MI";
402 matname =
"blood_MI";
417 matname =
"Formaline_MI";
426 matname =
"Acetone_MI";
435 matname =
"Hperoxide_MI";
443 matname =
"CIRS30-70_MI";
454 matname =
"CIRS50-50_MI";
465 matname =
"CIRS70-30_MI";
476 matname =
"RMI454_MI";
478 fRMI454->AddElement(elH, 0.0924);
479 fRMI454->AddElement(elC, 0.6935);
480 fRMI454->AddElement(elN, 0.0198);
481 fRMI454->AddElement(elO, 0.1943);
488 fBone->AddElement(elH, 0.0582);
489 fBone->AddElement(elC, 0.3055);
490 fBone->AddElement(elN, 0.0347);
491 fBone->AddElement(elO, 0.3856);
492 fBone->AddElement(elP, 0.0684);
493 fBone->AddElement(elCa, 0.1476);
497 matname =
"FatLowX_MI";
506 matname =
"BoneMatrixLowX_MI";
517 matname =
"dryBoneLowX_MI";
529 G4cout <<
"CustomMat composition: " << G4endl;
585 G4cout <<
"CustomMat set, but not used!" << G4endl;
594 "Error in Custom Material composition: check elemental mass fractions";
595 G4Exception(
"DetectorConstuction::DefineMaterials()",
596 "dc0004",FatalException,excep);
601 matname =
"CustomMat";
626 (std::unique_ptr<G4MIData>(
new G4MIData(
"MI")));
631 fLead = NistMan->FindOrBuildMaterial(
"G4_Pb");
632 fTungsten = NistMan->FindOrBuildMaterial(
"G4_W");
633 fGe = NistMan->FindOrBuildMaterial(
"G4_Ge");
694 fWorldLogic->SetVisAttributes(G4VisAttributes::GetInvisible());
697 G4ThreeVector(0., 0., 0.),
812 PhantomVisAttribute->SetForceSolid(
true);
817 <<
" g/cm3" << G4endl;
818 G4cout <<
"Phantom mass: " <<
fPhantomLogic->GetMass()/g <<
" g" << G4endl;
820 G4double rotAngle = 90.*CLHEP::deg;
821 G4RotationMatrix* PhantomRotationMatrix =
822 new G4RotationMatrix(0., 0., 0.);
823 PhantomRotationMatrix->rotateX(rotAngle);
834 G4RotationMatrix* SetupRotationMatrix =
new G4RotationMatrix();
838 G4Box* Slit1OutSolid =
new G4Box(
"Slit1OutSolid",
843 G4Box* Slit2OutSolid =
new G4Box(
"Slit2OutSolid",
848 G4Box* Slit3OutSolid =
new G4Box(
"Slit3OutSolid",
853 G4Box* Slit4OutSolid =
new G4Box(
"Slit4OutSolid",
900 G4cout <<
"Slit material: Tungsten" << G4endl;
901 G4cout <<
"Slit1 thickness: " <<
fSlit1Thickness/mm <<
" mm" << G4endl;
902 G4cout <<
"Slit2 thickness: " <<
fSlit2Thickness/mm <<
" mm" << G4endl;
903 G4cout <<
"Slit3 thickness: " <<
fSlit3Thickness/mm <<
" mm" << G4endl;
904 G4cout <<
"Slit4 thickness: " <<
fSlit4Thickness/mm <<
" mm" << G4endl;
917 SlitlVisAttribute->SetForceSolid(
true);
924 G4ThreeVector Slit1PositionVector = G4ThreeVector(0., 0., Slit1z);
927 G4ThreeVector Slit2PositionVector = G4ThreeVector(0., 0., Slit2z);
931 G4ThreeVector Slit3PositionVector = G4ThreeVector(Slit3x, 0., Slit3z);
935 G4ThreeVector Slit4PositionVector = G4ThreeVector(Slit4x, 0., Slit4z);
983 DetectorVisAttribute->SetForceSolid(
true);
988 G4ThreeVector DetectorPositionVector = G4ThreeVector(Detx, 0., Detz);
991 DetectorPositionVector,
1001 G4double margin = 2.;
1007 ShieldingLength*0.5;
1012 ShieldingLength*0.5,
1020 G4cout <<
"Shielding material: Lead" << G4endl;
1026 ShieldingVisAttribute->SetForceSolid(
true);
1029 G4double Shieldx = ShieldingSampleDistance*std::sin(
fthetaSetup);
1032 G4ThreeVector ShieldingPositionVector =
1033 G4ThreeVector(Shieldx, 0., Shieldz);
1039 G4Tubs* ShieldingBackSolid =
new G4Tubs(
"ShieldingBackSolid",
1048 "ShieldingBackLogic");
1052 G4double ShieldBackx = ShieldingBackSampleDistance*std::sin(
fthetaSetup);
1054 ShieldingBackSampleDistance*std::cos(
fthetaSetup);
1055 G4ThreeVector ShieldingBackPositionVector =
1056 G4ThreeVector(ShieldBackx, 0., ShieldBackz);
1059 ShieldingPositionVector,
1061 "ShieldingPhysical",
1067 ShieldingBackPositionVector,
1069 "ShieldingBackPhysical",