From e1e512fa189e44ff8785ffe479fc2e2c77248073 Mon Sep 17 00:00:00 2001 From: YiHui Liu Date: Tue, 17 May 2022 19:36:50 +0800 Subject: [PATCH] add: human phantom --- .vscode/settings.json | 4 +- G4.code-workspace | 107 +-------- include/DetectorConstruction.h | 16 +- include/G4BasePhantomBuilder.h | 66 ++++++ include/G4CustomFemaleBuilder.h | 17 ++ include/G4FemaleBuilder.h | 17 ++ include/G4HumanPhantomColour.h | 31 +++ include/G4HumanPhantomMaterial.h | 34 +++ include/G4MIRDBodyFactory.h | 22 ++ include/G4MIRDBrain.h | 19 ++ include/G4MIRDHead.h | 18 ++ include/G4MIRDHeart.h | 18 ++ include/G4MIRDLeftAdrenal.h | 19 ++ include/G4MIRDLeftArmBone.h | 22 ++ include/G4MIRDLeftBreast.h | 19 ++ include/G4MIRDLeftClavicle.h | 18 ++ include/G4MIRDLeftKidney.h | 17 ++ include/G4MIRDLeftLeg.h | 18 ++ include/G4MIRDLeftLegBone.h | 18 ++ include/G4MIRDLeftLung.h | 19 ++ include/G4MIRDLeftOvary.h | 18 ++ include/G4MIRDLeftScapula.h | 18 ++ include/G4MIRDLeftTeste.h | 18 ++ include/G4MIRDLiver.h | 17 ++ include/G4MIRDLowerLargeIntestine.h | 18 ++ include/G4MIRDMaleGenitalia.h | 18 ++ include/G4MIRDMiddleLowerSpine.h | 19 ++ include/G4MIRDPancreas.h | 19 ++ include/G4MIRDPelvis.h | 18 ++ include/G4MIRDRibCage.h | 31 +++ include/G4MIRDRightAdrenal.h | 18 ++ include/G4MIRDRightArmBone.h | 21 ++ include/G4MIRDRightBreast.h | 19 ++ include/G4MIRDRightClavicle.h | 18 ++ include/G4MIRDRightKidney.h | 18 ++ include/G4MIRDRightLeg.h | 18 ++ include/G4MIRDRightLegBone.h | 18 ++ include/G4MIRDRightLung.h | 19 ++ include/G4MIRDRightOvary.h | 19 ++ include/G4MIRDRightScapula.h | 18 ++ include/G4MIRDRightTeste.h | 19 ++ include/G4MIRDSkull.h | 19 ++ include/G4MIRDSmallIntestine.h | 18 ++ include/G4MIRDSpleen.h | 19 ++ include/G4MIRDStomach.h | 19 ++ include/G4MIRDThymus.h | 19 ++ include/G4MIRDThyroid.h | 18 ++ include/G4MIRDTrunk.h | 19 ++ include/G4MIRDUpperLargeIntestine.h | 18 ++ include/G4MIRDUpperSpine.h | 19 ++ include/G4MIRDUrinaryBladder.h | 19 ++ include/G4MIRDUterus.h | 19 ++ include/G4MaleBuilder.h | 17 ++ include/G4PhantomBuilder.h | 77 +++++++ include/G4VBodyFactory.h | 13 ++ include/G4VOrgan.h | 16 ++ include/G4VoxelBreastFactory.h | 21 ++ include/G4VoxelLeftBreast.h | 16 ++ include/G4VoxelRightBreast.h | 16 ++ src/DetectorConstruction.cpp | 131 ++++++++++- src/G4BasePhantomBuilder.cpp | 5 + src/G4CustomFemaleBuilder.cpp | 62 +++++ src/G4FemaleBuilder.cpp | 56 +++++ src/G4HumanPhantomColour.cpp | 52 +++++ src/G4HumanPhantomMaterial.cpp | 185 +++++++++++++++ src/G4MIRDBodyFactory.cpp | 192 ++++++++++++++++ src/G4MIRDBrain.cpp | 67 ++++++ src/G4MIRDHead.cpp | 89 ++++++++ src/G4MIRDHeart.cpp | 84 +++++++ src/G4MIRDLeftAdrenal.cpp | 74 ++++++ src/G4MIRDLeftArmBone.cpp | 77 +++++++ src/G4MIRDLeftBreast.cpp | 88 ++++++++ src/G4MIRDLeftClavicle.cpp | 72 ++++++ src/G4MIRDLeftKidney.cpp | 83 +++++++ src/G4MIRDLeftLeg.cpp | 76 +++++++ src/G4MIRDLeftLegBone.cpp | 75 ++++++ src/G4MIRDLeftLung.cpp | 106 +++++++++ src/G4MIRDLeftOvary.cpp | 71 ++++++ src/G4MIRDLeftScapula.cpp | 93 ++++++++ src/G4MIRDLeftTeste.cpp | 71 ++++++ src/G4MIRDLiver.cpp | 95 ++++++++ src/G4MIRDLowerLargeIntestine.cpp | 100 ++++++++ src/G4MIRDMaleGenitalia.cpp | 103 +++++++++ src/G4MIRDMiddleLowerSpine.cpp | 71 ++++++ src/G4MIRDPancreas.cpp | 81 +++++++ src/G4MIRDPelvis.cpp | 107 +++++++++ src/G4MIRDRibCage.cpp | 141 ++++++++++++ src/G4MIRDRightAdrenal.cpp | 74 ++++++ src/G4MIRDRightArmBone.cpp | 78 +++++++ src/G4MIRDRightBreast.cpp | 88 ++++++++ src/G4MIRDRightClavicle.cpp | 69 ++++++ src/G4MIRDRightKidney.cpp | 83 +++++++ src/G4MIRDRightLeg.cpp | 75 ++++++ src/G4MIRDRightLegBone.cpp | 82 +++++++ src/G4MIRDRightLung.cpp | 97 ++++++++ src/G4MIRDRightOvary.cpp | 69 ++++++ src/G4MIRDRightScapula.cpp | 93 ++++++++ src/G4MIRDRightTeste.cpp | 69 ++++++ src/G4MIRDSkull.cpp | 84 +++++++ src/G4MIRDSmallIntestine.cpp | 129 +++++++++++ src/G4MIRDSpleen.cpp | 69 ++++++ src/G4MIRDStomach.cpp | 81 +++++++ src/G4MIRDThymus.cpp | 69 ++++++ src/G4MIRDThyroid.cpp | 99 ++++++++ src/G4MIRDTrunk.cpp | 73 ++++++ src/G4MIRDUpperLargeIntestine.cpp | 84 +++++++ src/G4MIRDUpperSpine.cpp | 82 +++++++ src/G4MIRDUrinaryBladder.cpp | 76 +++++++ src/G4MIRDUterus.cpp | 75 ++++++ src/G4MaleBuilder.cpp | 39 ++++ src/G4PhantomBuilder.cpp | 339 ++++++++++++++++++++++++++++ src/G4VBodyFactory.cpp | 5 + src/G4VOrgan.cpp | 5 + src/G4VoxelBreastFactory.cpp | 25 ++ src/G4VoxelLeftBreast.cpp | 72 ++++++ src/G4VoxelRightBreast.cpp | 74 ++++++ 116 files changed, 6043 insertions(+), 121 deletions(-) create mode 100644 include/G4BasePhantomBuilder.h create mode 100644 include/G4CustomFemaleBuilder.h create mode 100644 include/G4FemaleBuilder.h create mode 100644 include/G4HumanPhantomColour.h create mode 100644 include/G4HumanPhantomMaterial.h create mode 100644 include/G4MIRDBodyFactory.h create mode 100644 include/G4MIRDBrain.h create mode 100644 include/G4MIRDHead.h create mode 100644 include/G4MIRDHeart.h create mode 100644 include/G4MIRDLeftAdrenal.h create mode 100644 include/G4MIRDLeftArmBone.h create mode 100644 include/G4MIRDLeftBreast.h create mode 100644 include/G4MIRDLeftClavicle.h create mode 100644 include/G4MIRDLeftKidney.h create mode 100644 include/G4MIRDLeftLeg.h create mode 100644 include/G4MIRDLeftLegBone.h create mode 100644 include/G4MIRDLeftLung.h create mode 100644 include/G4MIRDLeftOvary.h create mode 100644 include/G4MIRDLeftScapula.h create mode 100644 include/G4MIRDLeftTeste.h create mode 100644 include/G4MIRDLiver.h create mode 100644 include/G4MIRDLowerLargeIntestine.h create mode 100644 include/G4MIRDMaleGenitalia.h create mode 100644 include/G4MIRDMiddleLowerSpine.h create mode 100644 include/G4MIRDPancreas.h create mode 100644 include/G4MIRDPelvis.h create mode 100644 include/G4MIRDRibCage.h create mode 100644 include/G4MIRDRightAdrenal.h create mode 100644 include/G4MIRDRightArmBone.h create mode 100644 include/G4MIRDRightBreast.h create mode 100644 include/G4MIRDRightClavicle.h create mode 100644 include/G4MIRDRightKidney.h create mode 100644 include/G4MIRDRightLeg.h create mode 100644 include/G4MIRDRightLegBone.h create mode 100644 include/G4MIRDRightLung.h create mode 100644 include/G4MIRDRightOvary.h create mode 100644 include/G4MIRDRightScapula.h create mode 100644 include/G4MIRDRightTeste.h create mode 100644 include/G4MIRDSkull.h create mode 100644 include/G4MIRDSmallIntestine.h create mode 100644 include/G4MIRDSpleen.h create mode 100644 include/G4MIRDStomach.h create mode 100644 include/G4MIRDThymus.h create mode 100644 include/G4MIRDThyroid.h create mode 100644 include/G4MIRDTrunk.h create mode 100644 include/G4MIRDUpperLargeIntestine.h create mode 100644 include/G4MIRDUpperSpine.h create mode 100644 include/G4MIRDUrinaryBladder.h create mode 100644 include/G4MIRDUterus.h create mode 100644 include/G4MaleBuilder.h create mode 100644 include/G4PhantomBuilder.h create mode 100644 include/G4VBodyFactory.h create mode 100644 include/G4VOrgan.h create mode 100644 include/G4VoxelBreastFactory.h create mode 100644 include/G4VoxelLeftBreast.h create mode 100644 include/G4VoxelRightBreast.h create mode 100644 src/G4BasePhantomBuilder.cpp create mode 100644 src/G4CustomFemaleBuilder.cpp create mode 100644 src/G4FemaleBuilder.cpp create mode 100644 src/G4HumanPhantomColour.cpp create mode 100644 src/G4HumanPhantomMaterial.cpp create mode 100644 src/G4MIRDBodyFactory.cpp create mode 100644 src/G4MIRDBrain.cpp create mode 100644 src/G4MIRDHead.cpp create mode 100644 src/G4MIRDHeart.cpp create mode 100644 src/G4MIRDLeftAdrenal.cpp create mode 100644 src/G4MIRDLeftArmBone.cpp create mode 100644 src/G4MIRDLeftBreast.cpp create mode 100644 src/G4MIRDLeftClavicle.cpp create mode 100644 src/G4MIRDLeftKidney.cpp create mode 100644 src/G4MIRDLeftLeg.cpp create mode 100644 src/G4MIRDLeftLegBone.cpp create mode 100644 src/G4MIRDLeftLung.cpp create mode 100644 src/G4MIRDLeftOvary.cpp create mode 100644 src/G4MIRDLeftScapula.cpp create mode 100644 src/G4MIRDLeftTeste.cpp create mode 100644 src/G4MIRDLiver.cpp create mode 100644 src/G4MIRDLowerLargeIntestine.cpp create mode 100644 src/G4MIRDMaleGenitalia.cpp create mode 100644 src/G4MIRDMiddleLowerSpine.cpp create mode 100644 src/G4MIRDPancreas.cpp create mode 100644 src/G4MIRDPelvis.cpp create mode 100644 src/G4MIRDRibCage.cpp create mode 100644 src/G4MIRDRightAdrenal.cpp create mode 100644 src/G4MIRDRightArmBone.cpp create mode 100644 src/G4MIRDRightBreast.cpp create mode 100644 src/G4MIRDRightClavicle.cpp create mode 100644 src/G4MIRDRightKidney.cpp create mode 100644 src/G4MIRDRightLeg.cpp create mode 100644 src/G4MIRDRightLegBone.cpp create mode 100644 src/G4MIRDRightLung.cpp create mode 100644 src/G4MIRDRightOvary.cpp create mode 100644 src/G4MIRDRightScapula.cpp create mode 100644 src/G4MIRDRightTeste.cpp create mode 100644 src/G4MIRDSkull.cpp create mode 100644 src/G4MIRDSmallIntestine.cpp create mode 100644 src/G4MIRDSpleen.cpp create mode 100644 src/G4MIRDStomach.cpp create mode 100644 src/G4MIRDThymus.cpp create mode 100644 src/G4MIRDThyroid.cpp create mode 100644 src/G4MIRDTrunk.cpp create mode 100644 src/G4MIRDUpperLargeIntestine.cpp create mode 100644 src/G4MIRDUpperSpine.cpp create mode 100644 src/G4MIRDUrinaryBladder.cpp create mode 100644 src/G4MIRDUterus.cpp create mode 100644 src/G4MaleBuilder.cpp create mode 100644 src/G4PhantomBuilder.cpp create mode 100644 src/G4VBodyFactory.cpp create mode 100644 src/G4VOrgan.cpp create mode 100644 src/G4VoxelBreastFactory.cpp create mode 100644 src/G4VoxelLeftBreast.cpp create mode 100644 src/G4VoxelRightBreast.cpp diff --git a/.vscode/settings.json b/.vscode/settings.json index 90162d7..b4d8c35 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,3 @@ { - "cmake.configureSettings": { - "CMAKE_TOOLCHAIN_FILE": "D:/Microsoft/vcpkg/scripts/buildsystems/vcpkg.cmake" - } + "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools" } \ No newline at end of file diff --git a/G4.code-workspace b/G4.code-workspace index ef0c72e..7493bdd 100644 --- a/G4.code-workspace +++ b/G4.code-workspace @@ -6,112 +6,7 @@ ], "settings": { "files.associations": { - "*.icc": "cpp", - "algorithm": "cpp", - "array": "cpp", - "atomic": "cpp", - "bit": "cpp", - "cctype": "cpp", - "cfenv": "cpp", - "charconv": "cpp", - "chrono": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "compare": "cpp", - "complex": "cpp", - "concepts": "cpp", - "condition_variable": "cpp", - "csetjmp": "cpp", - "csignal": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "deque": "cpp", - "exception": "cpp", - "format": "cpp", - "forward_list": "cpp", - "fstream": "cpp", - "functional": "cpp", - "future": "cpp", - "initializer_list": "cpp", - "iomanip": "cpp", - "ios": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "iterator": "cpp", - "limits": "cpp", - "list": "cpp", - "locale": "cpp", - "map": "cpp", - "memory": "cpp", - "mutex": "cpp", - "new": "cpp", - "numeric": "cpp", - "optional": "cpp", - "ostream": "cpp", - "queue": "cpp", - "ratio": "cpp", - "regex": "cpp", - "set": "cpp", - "sstream": "cpp", - "stack": "cpp", - "stdexcept": "cpp", - "stop_token": "cpp", - "streambuf": "cpp", - "string": "cpp", - "system_error": "cpp", - "thread": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "typeinfo": "cpp", - "unordered_map": "cpp", - "utility": "cpp", - "vector": "cpp", - "xfacet": "cpp", - "xhash": "cpp", - "xiosbase": "cpp", - "xlocale": "cpp", - "xlocbuf": "cpp", - "xlocinfo": "cpp", - "xlocmes": "cpp", - "xlocmon": "cpp", - "xlocnum": "cpp", - "xloctime": "cpp", - "xmemory": "cpp", - "xstddef": "cpp", - "xstring": "cpp", - "xtr1common": "cpp", - "xtree": "cpp", - "xutility": "cpp", - "bbox_action": "cpp", - "aida_ntuple": "cpp", - "ntuple_binding": "cpp", - "ntuple_booking": "cpp", - "raxml_out": "cpp", - "rcsv_ntuple": "cpp", - "base_leaf": "cpp", - "branch": "cpp", - "info": "cpp", - "iros": "cpp", - "ntuple": "cpp", - "tree": "cpp", - "field_desc": "cpp", - "wcsv_ntuple": "cpp", - "bufobj": "cpp", - "aidas": "cpp", - "element": "cpp", - "colorf": "cpp", - "cid": "cpp", - "mem": "cpp", - "sout": "cpp", - "typedefs": "cpp", - "senum": "cpp" + "*.icc": "cpp" } } } \ No newline at end of file diff --git a/include/DetectorConstruction.h b/include/DetectorConstruction.h index 0523303..1a34247 100644 --- a/include/DetectorConstruction.h +++ b/include/DetectorConstruction.h @@ -4,9 +4,9 @@ #include "G4VUserDetectorConstruction.hh" #include "globals.hh" - class G4VPhysicalVolume; class G4LogicalVolume; +class G4HumanPhantomMaterial; class DetectorConstruction : public G4VUserDetectorConstruction { public: @@ -14,6 +14,20 @@ public: ~DetectorConstruction() override; G4VPhysicalVolume* Construct() override; + +private: + void ConstructSectionSphere(G4LogicalVolume* fMotherLogical, G4double zBias); + void ConstructSectionCons(G4String name, G4LogicalVolume* fMotherLogical, G4double zBias, G4double pRmax1, + G4double pRmin1, G4double pRmax2, G4double pRmin2, G4double hz); + void ConstructSectionSmall(G4LogicalVolume* fMotherLogical, G4double zBias); + void ConstructSectionBig(G4LogicalVolume* fMotherLogical, G4double zBias); + void ConstructHumanPhantom(G4VPhysicalVolume* fMotherPhysics); + +private: + G4HumanPhantomMaterial* material; + G4String model; + G4String sex; + std::map sensitivities; }; #endif diff --git a/include/G4BasePhantomBuilder.h b/include/G4BasePhantomBuilder.h new file mode 100644 index 0000000..d9a9e41 --- /dev/null +++ b/include/G4BasePhantomBuilder.h @@ -0,0 +1,66 @@ +#ifndef G4BasePhantomBuilder_h +#define G4BasePhantomBuilder_h 1 + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; + +class G4BasePhantomBuilder { +public: + G4BasePhantomBuilder(); + virtual ~G4BasePhantomBuilder(); + + virtual void BuildHead(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildTrunk(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftLeg(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightLeg(const G4String&, G4bool, G4bool) { return; }; + + virtual void BuildUpperSpine(const G4String&, G4bool, G4bool) { return; } + virtual void BuildMiddleLowerSpine(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftLegBone(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightLegBone(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftArmBone(const G4String&, G4bool, G4bool) { return; } + virtual void BuildRightArmBone(const G4String&, G4bool, G4bool) { return; } + virtual void BuildSkull(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRibCage(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildPelvis(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftScapula(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightScapula(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftClavicle(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightClavicle(const G4String&, G4bool, G4bool) { return; }; + + virtual void BuildBrain(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildHeart(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftLung(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightLung(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildStomach(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildSmallIntestine(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildUpperLargeIntestine(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLowerLargeIntestine(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftKidney(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightKidney(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftAdrenal(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightAdrenal(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLiver(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildPancreas(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildSpleen(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildUrinaryBladder(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildThyroid(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildThymus(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftOvary(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightOvary(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildUterus(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftBreast(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightBreast(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildVoxelLeftBreast(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildVoxelRightBreast(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildMaleGenitalia(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildLeftTeste(const G4String&, G4bool, G4bool) { return; }; + virtual void BuildRightTeste(const G4String&, G4bool, G4bool) { return; }; + + virtual void SetModel(G4String) { return; }; + virtual void SetMotherVolume(G4VPhysicalVolume*) { return; }; + virtual G4VPhysicalVolume* GetPhantom() { return 0; }; +}; + +#endif diff --git a/include/G4CustomFemaleBuilder.h b/include/G4CustomFemaleBuilder.h new file mode 100644 index 0000000..562c8bf --- /dev/null +++ b/include/G4CustomFemaleBuilder.h @@ -0,0 +1,17 @@ +#ifndef G4CustomFemaleBuilder_h +#define G4CustomFemaleBuilder_h 1 + +#include "G4PhantomBuilder.h" + +class G4CustomFemaleBuilder : public G4PhantomBuilder { +public: + G4CustomFemaleBuilder(); + ~G4CustomFemaleBuilder(); + + void BuildVoxelLeftBreast(const G4String&, G4bool, G4bool); + void BuildVoxelRightBreast(const G4String&, G4bool, G4bool); + void BuildLeftOvary(const G4String&, G4bool, G4bool); + void BuildRightOvary(const G4String&, G4bool, G4bool); + void BuildUterus(const G4String&, G4bool, G4bool); +}; +#endif diff --git a/include/G4FemaleBuilder.h b/include/G4FemaleBuilder.h new file mode 100644 index 0000000..d03d5bc --- /dev/null +++ b/include/G4FemaleBuilder.h @@ -0,0 +1,17 @@ +#ifndef G4FemaleBuilder_h +#define G4FemaleBuilder_h 1 + +#include "G4PhantomBuilder.h" + +class G4FemaleBuilder : public G4PhantomBuilder { +public: + G4FemaleBuilder(); + ~G4FemaleBuilder(); + + void BuildLeftBreast(const G4String&, G4bool, G4bool); + void BuildRightBreast(const G4String&, G4bool, G4bool); + void BuildLeftOvary(const G4String&, G4bool, G4bool); + void BuildRightOvary(const G4String&, G4bool, G4bool); + void BuildUterus(const G4String&, G4bool, G4bool); +}; +#endif diff --git a/include/G4HumanPhantomColour.h b/include/G4HumanPhantomColour.h new file mode 100644 index 0000000..f1b4ff0 --- /dev/null +++ b/include/G4HumanPhantomColour.h @@ -0,0 +1,31 @@ +#ifndef G4HumanPhantomColour_H +#define G4HumanPhantomColour_H 1 + +#include "G4Colour.hh" +#include "globals.hh" + +class G4Colour; +class G4HumanPhantomColour { +public: + G4HumanPhantomColour(); + ~G4HumanPhantomColour(); + +public: + // void DefineColour(); + G4Colour GetColour(const G4String&); // returns the colour + +private: + G4Colour white; + G4Colour pink; + G4Colour grey; + G4Colour yellow; + G4Colour blue; + G4Colour lightBlue; + G4Colour green; + G4Colour brown; + G4Colour purple; + G4Colour red; + G4Colour orange; + G4Colour black; +}; +#endif diff --git a/include/G4HumanPhantomMaterial.h b/include/G4HumanPhantomMaterial.h new file mode 100644 index 0000000..221fe9c --- /dev/null +++ b/include/G4HumanPhantomMaterial.h @@ -0,0 +1,34 @@ +#ifndef G4HumanPhantomMaterial_H +#define G4HumanPhantomMaterial_H 1 + +#include "globals.hh" +class G4Material; + +class G4HumanPhantomMaterial { +public: + G4HumanPhantomMaterial(); + ~G4HumanPhantomMaterial(); + +public: + void DefineMaterials(); + G4Material* GetMaterial(G4String); // returns the material + +private: + // G4Material* matW; + // G4Material* matplexiglass; + // G4Material* matPb; + // G4Material* matir192; + // G4Material* Titanium; + // G4Material* matAir; + G4Material* matH2O; + G4Material* soft; + G4Material* skeleton; + G4Material* lung; + G4Material* adipose; + G4Material* glandular; + G4Material* adipose_glandular; + // G4Material*Vacuum; + + // G4Material* muscle; +}; +#endif diff --git a/include/G4MIRDBodyFactory.h b/include/G4MIRDBodyFactory.h new file mode 100644 index 0000000..0b98542 --- /dev/null +++ b/include/G4MIRDBodyFactory.h @@ -0,0 +1,22 @@ +#ifndef G4MIRDBodyFactory_h +#define G4MIRDBodyFactory_h 1 + +#include "G4VBodyFactory.h" +#include "G4VOrgan.h" + +#include + +class G4VBodyFactory; +class G4VPhysicalVolume; +class G4VOrgan; + +class G4MIRDBodyFactory : public G4VBodyFactory { +public: + G4MIRDBodyFactory(); + ~G4MIRDBodyFactory(); + G4VPhysicalVolume* CreateOrgan(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: + std::map organ; +}; +#endif diff --git a/include/G4MIRDBrain.h b/include/G4MIRDBrain.h new file mode 100644 index 0000000..c9b570d --- /dev/null +++ b/include/G4MIRDBrain.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDBrain_h +#define G4MIRDBrain_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDBrain : public G4VOrgan { +public: + G4MIRDBrain(); + ~G4MIRDBrain(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDHead.h b/include/G4MIRDHead.h new file mode 100644 index 0000000..68dfd28 --- /dev/null +++ b/include/G4MIRDHead.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDHead_h +#define G4MIRDHead_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; +class MarsMaterial; + +class G4MIRDHead : public G4VOrgan { +public: + G4MIRDHead(); + ~G4MIRDHead(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); +}; +#endif diff --git a/include/G4MIRDHeart.h b/include/G4MIRDHeart.h new file mode 100644 index 0000000..d35e93f --- /dev/null +++ b/include/G4MIRDHeart.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDHeart_h +#define G4MIRDHeart_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; +class MarsMaterial; + +class G4MIRDHeart : public G4VOrgan { +public: + G4MIRDHeart(); + ~G4MIRDHeart(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); +}; +#endif diff --git a/include/G4MIRDLeftAdrenal.h b/include/G4MIRDLeftAdrenal.h new file mode 100644 index 0000000..551969c --- /dev/null +++ b/include/G4MIRDLeftAdrenal.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDLeftAdrenal_h +#define G4MIRDLeftAdrenal_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftAdrenal : public G4VOrgan { +public: + G4MIRDLeftAdrenal(); + ~G4MIRDLeftAdrenal(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftArmBone.h b/include/G4MIRDLeftArmBone.h new file mode 100644 index 0000000..6813bd2 --- /dev/null +++ b/include/G4MIRDLeftArmBone.h @@ -0,0 +1,22 @@ +#ifndef G4MIRDLeftArmBone_h +#define G4MIRDLeftArmBone_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftArmBone : public G4VOrgan { +public: + G4MIRDLeftArmBone(); + ~G4MIRDLeftArmBone(); + + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: + // SAXProcessor sxp; + // ProcessingConfigurator config; +}; +#endif diff --git a/include/G4MIRDLeftBreast.h b/include/G4MIRDLeftBreast.h new file mode 100644 index 0000000..66ce674 --- /dev/null +++ b/include/G4MIRDLeftBreast.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDLeftBreast_h +#define G4MIRDLeftBreast_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftBreast : public G4VOrgan { +public: + G4MIRDLeftBreast(); + ~G4MIRDLeftBreast(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftClavicle.h b/include/G4MIRDLeftClavicle.h new file mode 100644 index 0000000..c00211f --- /dev/null +++ b/include/G4MIRDLeftClavicle.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDLeftClavicle_h +#define G4MIRDLeftClavicle_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftClavicle : public G4VOrgan { +public: + G4MIRDLeftClavicle(); + ~G4MIRDLeftClavicle(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftKidney.h b/include/G4MIRDLeftKidney.h new file mode 100644 index 0000000..46fec50 --- /dev/null +++ b/include/G4MIRDLeftKidney.h @@ -0,0 +1,17 @@ +#ifndef G4MIRDLeftKidney_h +#define G4MIRDLeftKidney_h 1 + +#include "G4VOrgan.h" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftKidney : public G4VOrgan { +public: + G4MIRDLeftKidney(); + ~G4MIRDLeftKidney(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftLeg.h b/include/G4MIRDLeftLeg.h new file mode 100644 index 0000000..ac4172f --- /dev/null +++ b/include/G4MIRDLeftLeg.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDLeftLeg_h +#define G4MIRDLeftLeg_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftLeg : public G4VOrgan { +public: + G4MIRDLeftLeg(); + ~G4MIRDLeftLeg(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftLegBone.h b/include/G4MIRDLeftLegBone.h new file mode 100644 index 0000000..5fb4516 --- /dev/null +++ b/include/G4MIRDLeftLegBone.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDLeftLegBone_h +#define G4MIRDLeftLegBone_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftLegBone : public G4VOrgan { +public: + G4MIRDLeftLegBone(); + ~G4MIRDLeftLegBone(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftLung.h b/include/G4MIRDLeftLung.h new file mode 100644 index 0000000..f44fb49 --- /dev/null +++ b/include/G4MIRDLeftLung.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDLeftLung_h +#define G4MIRDLeftLung_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftLung : public G4VOrgan { +public: + G4MIRDLeftLung(); + ~G4MIRDLeftLung(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftOvary.h b/include/G4MIRDLeftOvary.h new file mode 100644 index 0000000..bab1c5e --- /dev/null +++ b/include/G4MIRDLeftOvary.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDLeftOvary_h +#define G4MIRDLeftOvary_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; + +class G4MIRDLeftOvary : public G4VOrgan { +public: + G4MIRDLeftOvary(); + ~G4MIRDLeftOvary(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftScapula.h b/include/G4MIRDLeftScapula.h new file mode 100644 index 0000000..a81afa6 --- /dev/null +++ b/include/G4MIRDLeftScapula.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDLeftScapula_h +#define G4MIRDLeftScapula_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLeftScapula : public G4VOrgan { +public: + G4MIRDLeftScapula(); + ~G4MIRDLeftScapula(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLeftTeste.h b/include/G4MIRDLeftTeste.h new file mode 100644 index 0000000..a7ce69c --- /dev/null +++ b/include/G4MIRDLeftTeste.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDLeftTeste_h +#define G4MIRDLeftTeste_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; + +class G4MIRDLeftTeste : public G4VOrgan { +public: + G4MIRDLeftTeste(); + ~G4MIRDLeftTeste(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLiver.h b/include/G4MIRDLiver.h new file mode 100644 index 0000000..1b56d39 --- /dev/null +++ b/include/G4MIRDLiver.h @@ -0,0 +1,17 @@ +#ifndef G4MIRDLiver_h +#define G4MIRDLiver_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; + +class G4MIRDLiver : public G4VOrgan { +public: + G4MIRDLiver(); + ~G4MIRDLiver(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDLowerLargeIntestine.h b/include/G4MIRDLowerLargeIntestine.h new file mode 100644 index 0000000..90424b5 --- /dev/null +++ b/include/G4MIRDLowerLargeIntestine.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDLowerLargeIntestine_h +#define G4MIRDLowerLargeIntestine_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDLowerLargeIntestine : public G4VOrgan { +public: + G4MIRDLowerLargeIntestine(); + ~G4MIRDLowerLargeIntestine(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDMaleGenitalia.h b/include/G4MIRDMaleGenitalia.h new file mode 100644 index 0000000..e25c358 --- /dev/null +++ b/include/G4MIRDMaleGenitalia.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDMaleGenitalia_h +#define G4MIRDMaleGenitalia_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; + +class G4MIRDMaleGenitalia : public G4VOrgan { +public: + G4MIRDMaleGenitalia(); + ~G4MIRDMaleGenitalia(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDMiddleLowerSpine.h b/include/G4MIRDMiddleLowerSpine.h new file mode 100644 index 0000000..0e0b5b7 --- /dev/null +++ b/include/G4MIRDMiddleLowerSpine.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDMiddleLowerSpine_h +#define G4MIRDMiddleLowerSpine_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDMiddleLowerSpine : public G4VOrgan { +public: + G4MIRDMiddleLowerSpine(); + ~G4MIRDMiddleLowerSpine(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDPancreas.h b/include/G4MIRDPancreas.h new file mode 100644 index 0000000..758a486 --- /dev/null +++ b/include/G4MIRDPancreas.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDPancreas_h +#define G4MIRDPancreas_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDPancreas : public G4VOrgan { +public: + G4MIRDPancreas(); + ~G4MIRDPancreas(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDPelvis.h b/include/G4MIRDPelvis.h new file mode 100644 index 0000000..0571fcd --- /dev/null +++ b/include/G4MIRDPelvis.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDPelvis_h +#define G4MIRDPelvis_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDPelvis : public G4VOrgan { +public: + G4MIRDPelvis(); + ~G4MIRDPelvis(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRibCage.h b/include/G4MIRDRibCage.h new file mode 100644 index 0000000..670846a --- /dev/null +++ b/include/G4MIRDRibCage.h @@ -0,0 +1,31 @@ +#ifndef G4MIRDRibCage_h +#define G4MIRDRibCage_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRibCage : public G4VOrgan { +public: + G4MIRDRibCage(); + ~G4MIRDRibCage(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: + G4VPhysicalVolume* physRib1; + G4VPhysicalVolume* physRib2; + G4VPhysicalVolume* physRib3; + G4VPhysicalVolume* physRib4; + G4VPhysicalVolume* physRib5; + G4VPhysicalVolume* physRib6; + G4VPhysicalVolume* physRib7; + G4VPhysicalVolume* physRib8; + G4VPhysicalVolume* physRib9; + G4VPhysicalVolume* physRib10; + G4VPhysicalVolume* physRib11; + G4VPhysicalVolume* physRib12; +}; +#endif diff --git a/include/G4MIRDRightAdrenal.h b/include/G4MIRDRightAdrenal.h new file mode 100644 index 0000000..2480de9 --- /dev/null +++ b/include/G4MIRDRightAdrenal.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDRightAdrenal_h +#define G4MIRDRightAdrenal_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightAdrenal : public G4VOrgan { +public: + G4MIRDRightAdrenal(); + ~G4MIRDRightAdrenal(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightArmBone.h b/include/G4MIRDRightArmBone.h new file mode 100644 index 0000000..466849f --- /dev/null +++ b/include/G4MIRDRightArmBone.h @@ -0,0 +1,21 @@ +#ifndef G4MIRDRightArmBone_h +#define G4MIRDRightArmBone_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightArmBone : public G4VOrgan { +public: + G4MIRDRightArmBone(); + ~G4MIRDRightArmBone(); + + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: + // SAXProcessor sxp; + // ProcessingConfigurator config; +}; +#endif diff --git a/include/G4MIRDRightBreast.h b/include/G4MIRDRightBreast.h new file mode 100644 index 0000000..6953853 --- /dev/null +++ b/include/G4MIRDRightBreast.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDRightBreast_h +#define G4MIRDRightBreast_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightBreast : public G4VOrgan { +public: + G4MIRDRightBreast(); + ~G4MIRDRightBreast(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightClavicle.h b/include/G4MIRDRightClavicle.h new file mode 100644 index 0000000..228eef4 --- /dev/null +++ b/include/G4MIRDRightClavicle.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDRightClavicle_h +#define G4MIRDRightClavicle_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightClavicle : public G4VOrgan { +public: + G4MIRDRightClavicle(); + ~G4MIRDRightClavicle(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightKidney.h b/include/G4MIRDRightKidney.h new file mode 100644 index 0000000..fbed525 --- /dev/null +++ b/include/G4MIRDRightKidney.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDRightKidney_h +#define G4MIRDRightKidney_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightKidney : public G4VOrgan { +public: + G4MIRDRightKidney(); + ~G4MIRDRightKidney(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightLeg.h b/include/G4MIRDRightLeg.h new file mode 100644 index 0000000..bb6280f --- /dev/null +++ b/include/G4MIRDRightLeg.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDRightLeg_h +#define G4MIRDRightLeg_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightLeg : public G4VOrgan { +public: + G4MIRDRightLeg(); + ~G4MIRDRightLeg(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightLegBone.h b/include/G4MIRDRightLegBone.h new file mode 100644 index 0000000..315de24 --- /dev/null +++ b/include/G4MIRDRightLegBone.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDRightLegBone_h +#define G4MIRDRightLegBone_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightLegBone : public G4VOrgan { +public: + G4MIRDRightLegBone(); + ~G4MIRDRightLegBone(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightLung.h b/include/G4MIRDRightLung.h new file mode 100644 index 0000000..4918734 --- /dev/null +++ b/include/G4MIRDRightLung.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDRightLung_h +#define G4MIRDRightLung_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightLung : public G4VOrgan { +public: + G4MIRDRightLung(); + ~G4MIRDRightLung(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightOvary.h b/include/G4MIRDRightOvary.h new file mode 100644 index 0000000..71b39d4 --- /dev/null +++ b/include/G4MIRDRightOvary.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDRightOvary_h +#define G4MIRDRightOvary_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightOvary : public G4VOrgan { +public: + G4MIRDRightOvary(); + ~G4MIRDRightOvary(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightScapula.h b/include/G4MIRDRightScapula.h new file mode 100644 index 0000000..6dbc6bd --- /dev/null +++ b/include/G4MIRDRightScapula.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDRightScapula_h +#define G4MIRDRightScapula_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightScapula : public G4VOrgan { +public: + G4MIRDRightScapula(); + ~G4MIRDRightScapula(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDRightTeste.h b/include/G4MIRDRightTeste.h new file mode 100644 index 0000000..0345efd --- /dev/null +++ b/include/G4MIRDRightTeste.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDRightTeste_h +#define G4MIRDRightTeste_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDRightTeste : public G4VOrgan { +public: + G4MIRDRightTeste(); + ~G4MIRDRightTeste(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDSkull.h b/include/G4MIRDSkull.h new file mode 100644 index 0000000..91ec2c5 --- /dev/null +++ b/include/G4MIRDSkull.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDSkull_h +#define G4MIRDSkull_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDSkull : public G4VOrgan { +public: + G4MIRDSkull(); + ~G4MIRDSkull(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDSmallIntestine.h b/include/G4MIRDSmallIntestine.h new file mode 100644 index 0000000..e15650e --- /dev/null +++ b/include/G4MIRDSmallIntestine.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDSmallIntestine_h +#define G4MIRDSmallIntestine_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDSmallIntestine : public G4VOrgan { +public: + G4MIRDSmallIntestine(); + ~G4MIRDSmallIntestine(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDSpleen.h b/include/G4MIRDSpleen.h new file mode 100644 index 0000000..3698adf --- /dev/null +++ b/include/G4MIRDSpleen.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDSpleen_h +#define G4MIRDSpleen_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDSpleen : public G4VOrgan { +public: + G4MIRDSpleen(); + ~G4MIRDSpleen(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDStomach.h b/include/G4MIRDStomach.h new file mode 100644 index 0000000..43fd9de --- /dev/null +++ b/include/G4MIRDStomach.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDStomach_h +#define G4MIRDStomach_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDStomach : public G4VOrgan { +public: + G4MIRDStomach(); + ~G4MIRDStomach(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDThymus.h b/include/G4MIRDThymus.h new file mode 100644 index 0000000..4692347 --- /dev/null +++ b/include/G4MIRDThymus.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDThymus_h +#define G4MIRDThymus_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDThymus : public G4VOrgan { +public: + G4MIRDThymus(); + ~G4MIRDThymus(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDThyroid.h b/include/G4MIRDThyroid.h new file mode 100644 index 0000000..0651a89 --- /dev/null +++ b/include/G4MIRDThyroid.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDThyroid_h +#define G4MIRDThyroid_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDThyroid : public G4VOrgan { +public: + G4MIRDThyroid(); + ~G4MIRDThyroid(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDTrunk.h b/include/G4MIRDTrunk.h new file mode 100644 index 0000000..c07abf0 --- /dev/null +++ b/include/G4MIRDTrunk.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDTrunk_h +#define G4MIRDTrunk_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDTrunk : public G4VOrgan { +public: + G4MIRDTrunk(); + ~G4MIRDTrunk(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDUpperLargeIntestine.h b/include/G4MIRDUpperLargeIntestine.h new file mode 100644 index 0000000..b21019c --- /dev/null +++ b/include/G4MIRDUpperLargeIntestine.h @@ -0,0 +1,18 @@ +#ifndef G4MIRDUpperLargeIntestine_h +#define G4MIRDUpperLargeIntestine_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDUpperLargeIntestine : public G4VOrgan { +public: + G4MIRDUpperLargeIntestine(); + ~G4MIRDUpperLargeIntestine(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDUpperSpine.h b/include/G4MIRDUpperSpine.h new file mode 100644 index 0000000..26d5ca0 --- /dev/null +++ b/include/G4MIRDUpperSpine.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDUpperSpine_h +#define G4MIRDUpperSpine_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDUpperSpine : public G4VOrgan { +public: + G4MIRDUpperSpine(); + ~G4MIRDUpperSpine(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDUrinaryBladder.h b/include/G4MIRDUrinaryBladder.h new file mode 100644 index 0000000..dde98a9 --- /dev/null +++ b/include/G4MIRDUrinaryBladder.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDUrinaryBladder_h +#define G4MIRDUrinaryBladder_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDUrinaryBladder : public G4VOrgan { +public: + G4MIRDUrinaryBladder(); + ~G4MIRDUrinaryBladder(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MIRDUterus.h b/include/G4MIRDUterus.h new file mode 100644 index 0000000..d31c845 --- /dev/null +++ b/include/G4MIRDUterus.h @@ -0,0 +1,19 @@ +#ifndef G4MIRDUterus_h +#define G4MIRDUterus_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4MIRDUterus : public G4VOrgan { +public: + G4MIRDUterus(); + ~G4MIRDUterus(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: +}; +#endif diff --git a/include/G4MaleBuilder.h b/include/G4MaleBuilder.h new file mode 100644 index 0000000..96f3401 --- /dev/null +++ b/include/G4MaleBuilder.h @@ -0,0 +1,17 @@ +#ifndef G4MaleBuilder_h +#define G4MaleBuilder_h 1 + +#include "G4PhantomBuilder.h" + +class G4PhantomBuilder; +class G4MaleBuilder : public G4PhantomBuilder { +public: + G4MaleBuilder(); + ~G4MaleBuilder(); + + void BuildMaleGenitalia(const G4String& colourName, G4bool solidVis, G4bool sensitivity); + void BuildLeftTeste(const G4String& colourName, G4bool solidVis, G4bool sensitivity); + void BuildRightTeste(const G4String& colourName, G4bool solidVis, G4bool sensitivity); + // void SetModel(G4String); +}; +#endif diff --git a/include/G4PhantomBuilder.h b/include/G4PhantomBuilder.h new file mode 100644 index 0000000..2fd7f20 --- /dev/null +++ b/include/G4PhantomBuilder.h @@ -0,0 +1,77 @@ +#ifndef G4PhantomBuilder_h +#define G4PhantomBuilder_h 1 + +#include "G4BasePhantomBuilder.h" + +#include "G4VPhysicalVolume.hh" +#include "globals.hh" + +class G4BasePhantomBuilder; +class G4VPhysicalVolume; +class G4VBodyFactory; +class G4PhantomBuilder : public G4BasePhantomBuilder { +public: + G4PhantomBuilder(); + ~G4PhantomBuilder(); + + void BuildHead(const G4String&, G4bool, G4bool); + void BuildTrunk(const G4String&, G4bool, G4bool); + void BuildLeftLeg(const G4String&, G4bool, G4bool); + void BuildRightLeg(const G4String&, G4bool, G4bool); + + void BuildUpperSpine(const G4String&, G4bool, G4bool); + void BuildMiddleLowerSpine(const G4String&, G4bool, G4bool); + void BuildLeftLegBone(const G4String&, G4bool, G4bool); + void BuildRightLegBone(const G4String&, G4bool, G4bool); + void BuildLeftArmBone(const G4String&, G4bool, G4bool); + void BuildRightArmBone(const G4String&, G4bool, G4bool); + void BuildSkull(const G4String&, G4bool, G4bool); + void BuildRibCage(const G4String&, G4bool, G4bool); + void BuildPelvis(const G4String&, G4bool, G4bool); + void BuildLeftScapula(const G4String&, G4bool, G4bool); + void BuildRightScapula(const G4String&, G4bool, G4bool); + void BuildLeftAdrenal(const G4String&, G4bool, G4bool); + void BuildRightAdrenal(const G4String&, G4bool, G4bool); + void BuildLeftClavicle(const G4String&, G4bool, G4bool); + void BuildRightClavicle(const G4String&, G4bool, G4bool); + + void BuildBrain(const G4String&, G4bool, G4bool); + + void BuildHeart(const G4String&, G4bool, G4bool); + + void BuildLeftLung(const G4String&, G4bool, G4bool); + void BuildRightLung(const G4String&, G4bool, G4bool); + + void BuildStomach(const G4String&, G4bool, G4bool); + void BuildSmallIntestine(const G4String&, G4bool, G4bool); + void BuildUpperLargeIntestine(const G4String&, G4bool, G4bool); + void BuildLowerLargeIntestine(const G4String&, G4bool, G4bool); + + void BuildLeftKidney(const G4String&, G4bool, G4bool); + void BuildRightKidney(const G4String&, G4bool, G4bool); + void BuildLiver(const G4String&, G4bool, G4bool); + void BuildPancreas(const G4String&, G4bool, G4bool); + void BuildSpleen(const G4String&, G4bool, G4bool); + void BuildUrinaryBladder(const G4String&, G4bool, G4bool); + + void BuildThyroid(const G4String&, G4bool, G4bool); + void BuildThymus(const G4String&, G4bool, G4bool); + + void SetModel(G4String); + void SetMotherVolume(G4VPhysicalVolume*); + + G4VPhysicalVolume* GetPhantom(); + +protected: + G4VBodyFactory* body; + + G4String model; + + G4VPhysicalVolume* motherVolume; + G4VPhysicalVolume* headVolume; + G4VPhysicalVolume* trunkVolume; + G4VPhysicalVolume* leftLegVolume; + G4VPhysicalVolume* rightLegVolume; + G4VPhysicalVolume* maleGenitaliaVolume; +}; +#endif diff --git a/include/G4VBodyFactory.h b/include/G4VBodyFactory.h new file mode 100644 index 0000000..666658c --- /dev/null +++ b/include/G4VBodyFactory.h @@ -0,0 +1,13 @@ +#ifndef G4VBodyFactory_h +#define G4VBodyFactory_h 1 + +#include "G4VPhysicalVolume.hh" +class G4VPhysicalVolume; +class G4VBodyFactory { +public: + G4VBodyFactory(); + virtual ~G4VBodyFactory(); + virtual G4VPhysicalVolume* CreateOrgan(const G4String& idFile, G4VPhysicalVolume* motherVolume, + const G4String& colour, G4bool solidFrame, G4bool sensitivity) = 0; +}; +#endif diff --git a/include/G4VOrgan.h b/include/G4VOrgan.h new file mode 100644 index 0000000..5c31dc3 --- /dev/null +++ b/include/G4VOrgan.h @@ -0,0 +1,16 @@ +#ifndef G4VOrgan_h +#define G4VOrgan_h 1 + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; +class G4LogicalVolume; + +class G4VOrgan { +public: + G4VOrgan(); + virtual ~G4VOrgan(); + virtual G4VPhysicalVolume* Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool sensitivity) = 0; +}; +#endif diff --git a/include/G4VoxelBreastFactory.h b/include/G4VoxelBreastFactory.h new file mode 100644 index 0000000..fbabc33 --- /dev/null +++ b/include/G4VoxelBreastFactory.h @@ -0,0 +1,21 @@ +#ifndef G4VoxelBreastFactory_h +#define G4VoxelBreastFactory_h 1 + +#include "G4VBodyFactory.h" +#include "G4VOrgan.h" + +#include +class G4VBodyFactory; +class G4VPhysicalVolume; +class G4VOrgan; + +class G4VoxelBreastFactory : public G4VBodyFactory { +public: + G4VoxelBreastFactory(); + ~G4VoxelBreastFactory(); + G4VPhysicalVolume* CreateOrgan(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); + +private: + std::map organ; +}; +#endif diff --git a/include/G4VoxelLeftBreast.h b/include/G4VoxelLeftBreast.h new file mode 100644 index 0000000..e10cd4b --- /dev/null +++ b/include/G4VoxelLeftBreast.h @@ -0,0 +1,16 @@ +#ifndef G4VoxelLeftBreast_h +#define G4VoxelLeftBreast_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; + +class G4VoxelLeftBreast : public G4VOrgan { +public: + G4VoxelLeftBreast(); + ~G4VoxelLeftBreast(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); +}; +#endif diff --git a/include/G4VoxelRightBreast.h b/include/G4VoxelRightBreast.h new file mode 100644 index 0000000..477f188 --- /dev/null +++ b/include/G4VoxelRightBreast.h @@ -0,0 +1,16 @@ +#ifndef G4VoxelRightBreast_h +#define G4VoxelRightBreast_h 1 + +#include "G4VOrgan.h" + +#include "G4VPhysicalVolume.hh" + +class G4VPhysicalVolume; + +class G4VoxelRightBreast : public G4VOrgan { +public: + G4VoxelRightBreast(); + ~G4VoxelRightBreast(); + G4VPhysicalVolume* Construct(const G4String&, G4VPhysicalVolume*, const G4String&, G4bool, G4bool); +}; +#endif diff --git a/src/DetectorConstruction.cpp b/src/DetectorConstruction.cpp index 84cd5af..e7df0e7 100644 --- a/src/DetectorConstruction.cpp +++ b/src/DetectorConstruction.cpp @@ -1,4 +1,9 @@ #include "DetectorConstruction.h" +#include "G4BasePhantomBuilder.h" +#include "G4CustomFemaleBuilder.h" +#include "G4FemaleBuilder.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MaleBuilder.h" #include "Material.h" #include "G4Box.hh" @@ -13,11 +18,11 @@ #include "G4Tubs.hh" #include "G4UnionSolid.hh" -DetectorConstruction::DetectorConstruction() {} +DetectorConstruction::DetectorConstruction() { material = new G4HumanPhantomMaterial(); } -DetectorConstruction::~DetectorConstruction() {} +DetectorConstruction::~DetectorConstruction() { delete material; } -static void ConstructSectionSphere(G4LogicalVolume* fMotherLogical, G4double zBias) { +void DetectorConstruction::ConstructSectionSphere(G4LogicalVolume* fMotherLogical, G4double zBias) { G4double pRadius = 2.8 * m / 2; G4double pRadius2 = 1.2 * m; G4double pRadiusMid = pRadius - 10 * cm; @@ -60,8 +65,9 @@ static void ConstructSectionSphere(G4LogicalVolume* fMotherLogical, G4double zBi new G4PVPlacement(0, pos0, logicAir, "NodeAir", logicWorld, false, 0, true); } -static void ConstructSectionCons(G4String name, G4LogicalVolume* fMotherLogical, G4double zBias, G4double pRmax1, - G4double pRmin1, G4double pRmax2, G4double pRmin2, G4double hz) { +void DetectorConstruction::ConstructSectionCons(G4String name, G4LogicalVolume* fMotherLogical, G4double zBias, + G4double pRmax1, G4double pRmin1, G4double pRmax2, G4double pRmin2, + G4double hz) { G4double pRminMid = pRmin1 - 10 * cm; G4double pRmaxMid = pRmax1 - 10 * cm; G4ThreeVector pos0 = G4ThreeVector(); @@ -106,7 +112,7 @@ static void ConstructSectionCons(G4String name, G4LogicalVolume* fMotherLogical, new G4PVPlacement(0, pos0, logicAir, name + "Air", logicWorld, false, 0, true); } -static void ConstructSectionSmall(G4LogicalVolume* fMotherLogical, G4double zBias) { +void DetectorConstruction::ConstructSectionSmall(G4LogicalVolume* fMotherLogical, G4double zBias) { G4double pRmax = 2.8 / 2 * m; G4double hz = 5.18 / 2 * m; G4double hxBox = 1.5 / 2 * m; @@ -152,7 +158,7 @@ static void ConstructSectionSmall(G4LogicalVolume* fMotherLogical, G4double zBia new G4PVPlacement(0, pos1, logicAir, "SmallAir", logicWorld, false, 0, true); } -static void ConstructSectionBig(G4LogicalVolume* fMotherLogical, G4double zBias) { +void DetectorConstruction::ConstructSectionBig(G4LogicalVolume* fMotherLogical, G4double zBias) { G4double pRmax = 4.2 / 2 * m; G4double hz = 6.72 / 2 * m; G4double hxBox = 2.4 / 2 * m; @@ -218,6 +224,109 @@ static void ConstructSectionBig(G4LogicalVolume* fMotherLogical, G4double zBias) new G4PVPlacement(0, G4ThreeVector(0, 0, -7.5), logicTailAl2, "BigTailAl2", logicTail, false, 0, true); } +void DetectorConstruction::ConstructHumanPhantom(G4VPhysicalVolume* fMotherPhysics) { + material->DefineMaterials(); + + G4BasePhantomBuilder* builder = 0; + + if (sex == "Female") { + if (model == "MIX") + builder = new G4CustomFemaleBuilder; + else { + builder = new G4FemaleBuilder; + } + builder->SetModel(model); + G4cout << model << " " << sex << G4endl; + } else if (sex == "Male") { + builder = new G4MaleBuilder; + builder->SetModel(model); + if (model == "MIX") { + G4cout << "Custom Male is not available!!! MIRD model is selected !" << G4endl; + model = "MIRD"; + builder->SetModel(model); + } + } + + builder->SetMotherVolume(fMotherPhysics); + + // the argument indicates the sensitivity of the volume + + builder->BuildHead("black", false, sensitivities["Head"]); + builder->BuildSkull("orange", false, sensitivities["Skull"]); + builder->BuildBrain("yellow", true, sensitivities["Brain"]); + + if (model != "MIRDHead") { + // builder->SetModel(model); + builder->BuildTrunk("yellow", false, sensitivities["Trunk"]); + + builder->BuildLeftLeg("yellow", false, sensitivities["LeftLeg"]); + builder->BuildRightLeg("yellow", false, sensitivities["RightLeg"]); + + builder->BuildLeftArmBone("grey", true, sensitivities["LeftArmBone"]); + builder->BuildRightArmBone("grey", true, sensitivities["RightArmBone"]); + + builder->BuildLeftLegBone("grey", true, sensitivities["LeftLegBone"]); + builder->BuildRightLegBone("grey", true, sensitivities["RightLegBone"]); + + builder->BuildUpperSpine("yellow", true, sensitivities["UpperSpine"]); + + if (model == "MIRD" || model == "MIX") { + builder->BuildLeftScapula("grey", true, sensitivities["LeftScapula"]); + builder->BuildRightScapula("grey", true, sensitivities["RightScapula"]); + builder->BuildLeftAdrenal("yellow", true, sensitivities["LeftAdrenal"]); + builder->BuildRightAdrenal("yellow", true, sensitivities["RightAdrenal"]); + builder->BuildThymus("orange", true, sensitivities["Thymus"]); + builder->BuildLeftClavicle("grey", true, sensitivities["LeftClavicle"]); + builder->BuildRightClavicle("grey", true, sensitivities["RightClavicle"]); + builder->BuildSmallIntestine("orange", true, sensitivities["SmallIntestine"]); + builder->BuildRibCage("grey", true, sensitivities["RibCage"]); + } + + builder->BuildMiddleLowerSpine("yellow", true, sensitivities["MiddleLowerSpine"]); + + builder->BuildPelvis("grey", true, sensitivities["Pelvis"]); + + builder->BuildStomach("orange", true, sensitivities["Stomach"]); + builder->BuildUpperLargeIntestine("lightBlue", true, sensitivities["UpperLargeIntestine"]); + builder->BuildLowerLargeIntestine("lightBlue", true, sensitivities["LowerLargeIntestine"]); + + builder->BuildSpleen("green", true, sensitivities["Spleen"]); + builder->BuildPancreas("purple", true, sensitivities["Pancreas"]); + builder->BuildLiver("orange", true, sensitivities["Liver"]); + + builder->BuildLeftKidney("green", true, sensitivities["LeftKidney"]); + builder->BuildRightKidney("green", true, sensitivities["RightKidney"]); + builder->BuildUrinaryBladder("green", true, sensitivities["UrinaryBladder"]); + + builder->BuildHeart("red", true, sensitivities["Hearth"]); // to do MIRD + builder->BuildLeftLung("blue", true, sensitivities["LeftLung"]); + builder->BuildRightLung("blue", true, sensitivities["RightLung"]); + builder->BuildThyroid("orange", true, sensitivities["Thyroid"]); + + if (sex == "Female") { + builder->BuildLeftOvary("purple", true, sensitivities["LeftOvary"]); + builder->BuildRightOvary("purple", true, sensitivities["RightOvary"]); + builder->BuildUterus("purple", true, sensitivities["Uterus"]); + + if (model == "MIRD") { + builder->BuildLeftBreast("purple", true, sensitivities["LeftBreast"]); + builder->BuildRightBreast("purple", true, sensitivities["RightBreast"]); + } else if (model == "MIX") { + builder->BuildVoxelLeftBreast("purple", false, sensitivities["LeftBreast"]); + builder->BuildVoxelRightBreast("purple", false, sensitivities["RightBreast"]); + } + } + + if (sex == "Male") { + builder->BuildMaleGenitalia("yellow", false, sensitivities["MaleGenitalia"]); + builder->BuildLeftTeste("purple", true, sensitivities["LeftTeste"]); + builder->BuildRightTeste("purple", true, sensitivities["RightTeste"]); + } + } + G4VPhysicalVolume* result = builder->GetPhantom(); + delete builder; +} + G4VPhysicalVolume* DetectorConstruction::Construct() { // Define materials DefineMaterials(); @@ -229,16 +338,16 @@ G4VPhysicalVolume* DetectorConstruction::Construct() { // Debug for particle range // G4Box* solidPlane1 = new G4Box("Plane1", 10 * m, 10 * m, 2 * mm); - // G4LogicalVolume* logicPlane1 = new G4LogicalVolume(solidPlane1, G4Material::GetMaterial("AluminumAlloySeries5"), "Plane1"); - // new G4PVPlacement(0, G4ThreeVector(), logicPlane1, "Plane1", logicWorld, false, 0, true); + // G4LogicalVolume* logicPlane1 = new G4LogicalVolume(solidPlane1, G4Material::GetMaterial("AluminumAlloySeries5"), + // "Plane1"); new G4PVPlacement(0, G4ThreeVector(), logicPlane1, "Plane1", logicWorld, false, 0, true); // G4Box* solidPlane2 = new G4Box("Plane2", 10 * m, 10 * m, 10 * mm); // G4LogicalVolume* logicPlane2 = new G4LogicalVolume(solidPlane2, G4Material::GetMaterial("Taparan"), "Plane2"); // new G4PVPlacement(0, G4ThreeVector(0, 0, -6), logicPlane2, "Plane2", logicWorld, false, 0, true); // G4Box* solidPlane3 = new G4Box("Plane3", 10 * m, 10 * m, 5 * mm); - // G4LogicalVolume* logicPlane3 = new G4LogicalVolume(solidPlane3, G4Material::GetMaterial("AluminumAlloySeries5"), "Plane3"); - // new G4PVPlacement(0, G4ThreeVector(0, 0, -14.5), logicPlane3, "Plane3", logicWorld, false, 0, true); + // G4LogicalVolume* logicPlane3 = new G4LogicalVolume(solidPlane3, G4Material::GetMaterial("AluminumAlloySeries5"), + // "Plane3"); new G4PVPlacement(0, G4ThreeVector(0, 0, -14.5), logicPlane3, "Plane3", logicWorld, false, 0, true); // 节点舱 ConstructSectionSphere(logicWorld, (5.18 + 0.33) * m); diff --git a/src/G4BasePhantomBuilder.cpp b/src/G4BasePhantomBuilder.cpp new file mode 100644 index 0000000..4a264dc --- /dev/null +++ b/src/G4BasePhantomBuilder.cpp @@ -0,0 +1,5 @@ +#include "G4BasePhantomBuilder.h" + +G4BasePhantomBuilder::G4BasePhantomBuilder() { ; } + +G4BasePhantomBuilder::~G4BasePhantomBuilder() { ; } diff --git a/src/G4CustomFemaleBuilder.cpp b/src/G4CustomFemaleBuilder.cpp new file mode 100644 index 0000000..5850890 --- /dev/null +++ b/src/G4CustomFemaleBuilder.cpp @@ -0,0 +1,62 @@ +#include "G4CustomFemaleBuilder.h" +#include "G4VBodyFactory.h" +#include "G4VoxelBreastFactory.h" + +G4CustomFemaleBuilder::G4CustomFemaleBuilder() {} + +G4CustomFemaleBuilder::~G4CustomFemaleBuilder() + +{ + delete body; +} + +void G4CustomFemaleBuilder::BuildUterus(const G4String& colourName, G4bool solidVis, G4bool sensitivity) + +{ + if (trunkVolume == 0) + G4Exception("G4CustomFemaleBuilder::BuildUterus()", "human_phantom0001", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Uterus", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4CustomFemaleBuilder::BuildLeftOvary(const G4String& colourName, G4bool solidVis, G4bool sensitivity) + +{ + if (trunkVolume == 0) + G4Exception("G4CustomFemaleBuilder::BuildLeftOvary()", "human_phantom0002", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("LeftOvary", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4CustomFemaleBuilder::BuildRightOvary(const G4String& colourName, G4bool solidVis, G4bool sensitivity) + +{ + if (trunkVolume == 0) + G4Exception("G4CustomFemaleBuilder::BuildRightOvary()", "human_phantom0003", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("RightOvary", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4CustomFemaleBuilder::BuildVoxelLeftBreast(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + G4cout << "BuildVoxelLeftBreast" << G4endl; + if (motherVolume == 0) + G4Exception("G4CustomFemaleBuilder::BuildVoxelLeftBreast()", "human_phantom0004", FatalException, + "The world volume is missing !!!!!"); + + G4VBodyFactory* customBody = new G4VoxelBreastFactory(); + customBody->CreateOrgan("LeftBreast", motherVolume, colourName, solidVis, sensitivity); + delete customBody; +} + +void G4CustomFemaleBuilder::BuildVoxelRightBreast(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (motherVolume == 0) + G4Exception("G4CustomFemaleBuilder::BuildVoxelRightBreast()", "human_phantom0005", FatalException, + "The world volume is missing !!!!!"); + + G4VBodyFactory* customBody = new G4VoxelBreastFactory(); + customBody->CreateOrgan("RightBreast", motherVolume, colourName, solidVis, sensitivity); + delete customBody; +} diff --git a/src/G4FemaleBuilder.cpp b/src/G4FemaleBuilder.cpp new file mode 100644 index 0000000..913e9d7 --- /dev/null +++ b/src/G4FemaleBuilder.cpp @@ -0,0 +1,56 @@ +#include "G4FemaleBuilder.h" +#include "G4VBodyFactory.h" + +G4FemaleBuilder::G4FemaleBuilder() {} + +G4FemaleBuilder::~G4FemaleBuilder() + +{ + delete body; +} + +void G4FemaleBuilder::BuildUterus(const G4String& colourName, G4bool solidVis, G4bool sensitivity) + +{ + if (trunkVolume == 0) + G4Exception("G4FemaleBuilder::BuildUterus()", "human_phantom0006", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Uterus", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4FemaleBuilder::BuildLeftOvary(const G4String& colourName, G4bool solidVis, G4bool sensitivity) + +{ + if (trunkVolume == 0) + G4Exception("G4FemaleBuilder::BuildLeftOvary()", "human_phantom0007", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("LeftOvary", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4FemaleBuilder::BuildRightOvary(const G4String& colourName, G4bool solidVis, G4bool sensitivity) + +{ + if (trunkVolume == 0) + G4Exception("G4FemaleBuilder::BuildRightOvary()", "human_phantom0008", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("RightOvary", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4FemaleBuilder::BuildLeftBreast(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (motherVolume == 0) + G4Exception("G4FemaleBuilder::BuildLeftBreast()", "human_phantom0009", FatalException, + "The world volume is missing !!!!!"); + + body->CreateOrgan("LeftBreast", motherVolume, colourName, solidVis, sensitivity); +} + +void G4FemaleBuilder::BuildRightBreast(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (motherVolume == 0) + G4Exception("G4FemaleBuilder::BuildRightBreast()", "human_phantom0010", FatalException, + "The world volume is missing !!!!!"); + + body->CreateOrgan("RightBreast", motherVolume, colourName, solidVis, sensitivity); +} diff --git a/src/G4HumanPhantomColour.cpp b/src/G4HumanPhantomColour.cpp new file mode 100644 index 0000000..e955526 --- /dev/null +++ b/src/G4HumanPhantomColour.cpp @@ -0,0 +1,52 @@ +#include "G4HumanPhantomColour.h" + +#include "G4Colour.hh" +#include "G4VisAttributes.hh" +G4HumanPhantomColour::G4HumanPhantomColour() { + white = G4Colour(1.0, 1.0, 1.0); + pink = G4Colour(0.94, 0.5, 0.5); + grey = G4Colour(0.46, 0.53, 0.6); + yellow = G4Colour(1.0, 1.0, 0.); + blue = G4Colour(0.25, 0.41, 0.88); + lightBlue = G4Colour(0.28, 0.82, 0.8); + green = G4Colour(0., 1., 0.); + brown = G4Colour(0.5, 0.5, 0.); + purple = G4Colour(0.85, 0.44, 0.84); + red = G4Colour(1.0, 0.0, 0.0); + orange = G4Colour(1., 0.5, 0.); + black = G4Colour(0., 0., 0.); +} + +G4HumanPhantomColour::~G4HumanPhantomColour() {} + +G4Colour G4HumanPhantomColour::GetColour(const G4String& colourName) { + // Returns the colour + if (colourName == "pink") + return pink; + else if (colourName == "white") + return white; + else if (colourName == "grey") + return grey; + else if (colourName == "yellow") + return yellow; + else if (colourName == "blue") + return blue; + else if (colourName == "lightBlue") + return lightBlue; + else if (colourName == "green") + return green; + else if (colourName == "brown") + return brown; + else if (colourName == "purple") + return purple; + else if (colourName == "red") + return red; + else if (colourName == "orange") + return orange; + else if (colourName == "black") + return black; + else { + G4cout << colourName << "does not exist !!!" << G4endl; + return white; + } +} diff --git a/src/G4HumanPhantomMaterial.cpp b/src/G4HumanPhantomMaterial.cpp new file mode 100644 index 0000000..120f892 --- /dev/null +++ b/src/G4HumanPhantomMaterial.cpp @@ -0,0 +1,185 @@ +#include "G4HumanPhantomMaterial.h" + +#include "G4Element.hh" +#include "G4ElementTable.hh" +#include "G4MaterialPropertiesTable.hh" +#include "G4MaterialPropertyVector.hh" +#include "G4MaterialTable.hh" +#include "G4RunManager.hh" +#include "G4SystemOfUnits.hh" +#include "Randomize.hh" +#include "globals.hh" + +G4HumanPhantomMaterial::G4HumanPhantomMaterial() + : soft(0), skeleton(0), lung(0), adipose(0), glandular(0), adipose_glandular(0) { + ; +} + +G4HumanPhantomMaterial::~G4HumanPhantomMaterial() { ; } + +void G4HumanPhantomMaterial::DefineMaterials() { + // Define required materials + + G4double A; // atomic mass + G4double Z; // atomic number + G4double d; // density + + // General elements + + A = 1.01 * g / mole; + G4Element* elH = new G4Element("Hydrogen", "H", Z = 1., A); + + A = 12.011 * g / mole; + G4Element* elC = new G4Element("Carbon", "C", Z = 6., A); + + A = 14.01 * g / mole; + G4Element* elN = new G4Element("Nitrogen", "N", Z = 7., A); + + A = 16.00 * g / mole; + G4Element* elO = new G4Element("Oxygen", "O", Z = 8., A); + + A = 22.99 * g / mole; + G4Element* elNa = new G4Element("Sodium", "Na", Z = 11., A); + + A = 24.305 * g / mole; + G4Element* elMg = new G4Element("Magnesium", "Mg", Z = 12., A); + + A = 30.974 * g / mole; + G4Element* elP = new G4Element("Phosphorus", "P", Z = 15., A); + + A = 32.064 * g / mole; + G4Element* elS = new G4Element("Sulfur", "S", Z = 16., A); + + A = 35.453 * g / mole; + G4Element* elCl = new G4Element("Chlorine", "Cl", Z = 17., A); + + A = 39.098 * g / mole; + G4Element* elK = new G4Element("Potassium", "K", Z = 19., A); + + A = 40.08 * g / mole; + G4Element* elCa = new G4Element("Calcium", "Ca", Z = 20., A); + + A = 55.85 * g / mole; + G4Element* elFe = new G4Element("Iron", "Fe", Z = 26., A); + + A = 65.38 * g / mole; + G4Element* elZn = new G4Element("Zinc", "Zn", Z = 30., A); + + A = 85.47 * g / mole; + G4Element* elRb = new G4Element("Rb", "Rb", Z = 37., A); + + A = 87.62 * g / mole; + G4Element* elSr = new G4Element("Sr", "Sr", Z = 38., A); + + A = 91.22 * g / mole; + G4Element* elZr = new G4Element("Zr", "Zr", Z = 40., A); + + A = 207.19 * g / mole; + G4Element* elPb = new G4Element("Lead", "Pb", Z = 82., A); + + // Water + d = 1.000 * g / cm3; + matH2O = new G4Material("Water", d, 2); + matH2O->AddElement(elH, 2); + matH2O->AddElement(elO, 1); + matH2O->GetIonisation()->SetMeanExcitationEnergy(75.0 * eV); + + // MIRD soft tissue + d = 0.9869 * g / cm3; + soft = new G4Material("soft_tissue", d, 16); + soft->AddElement(elH, 0.1047); + soft->AddElement(elC, 0.2302); + soft->AddElement(elN, 0.0234); + soft->AddElement(elO, 0.6321); + soft->AddElement(elNa, 0.0013); + soft->AddElement(elMg, 0.00015); + soft->AddElement(elP, 0.0024); + soft->AddElement(elS, 0.0022); + soft->AddElement(elCl, 0.0014); + soft->AddElement(elK, 0.0021); + soft->AddElement(elFe, 0.000063); + soft->AddElement(elZn, 0.000032); + soft->AddElement(elRb, 0.0000057); + soft->AddElement(elSr, 0.00000034); + soft->AddElement(elZr, 0.000008); + soft->AddElement(elPb, 0.00000016); + + // MIRD Skeleton + + d = 1.4862 * g / cm3; + skeleton = new G4Material("skeleton", d, 15); + skeleton->AddElement(elH, 0.0704); + skeleton->AddElement(elC, 0.2279); + skeleton->AddElement(elN, 0.0387); + skeleton->AddElement(elO, 0.4856); + skeleton->AddElement(elNa, 0.0032); + skeleton->AddElement(elMg, 0.0011); + skeleton->AddElement(elP, 0.0694); + skeleton->AddElement(elS, 0.0017); + skeleton->AddElement(elCl, 0.0014); + skeleton->AddElement(elK, 0.0015); + skeleton->AddElement(elCa, 0.0991); + skeleton->AddElement(elFe, 0.00008); + skeleton->AddElement(elZn, 0.000048); + skeleton->AddElement(elSr, 0.000032); + skeleton->AddElement(elPb, 0.000011); + + // MIRD lung material + d = 0.2958 * g / cm3; + lung = new G4Material("lung_material", d, 16); + lung->AddElement(elH, 0.1021); + lung->AddElement(elC, 0.1001); + lung->AddElement(elN, 0.028); + lung->AddElement(elO, 0.7596); + lung->AddElement(elNa, 0.0019); + lung->AddElement(elMg, 0.000074); + lung->AddElement(elP, 0.00081); + lung->AddElement(elS, 0.0023); + lung->AddElement(elCl, 0.0027); + lung->AddElement(elK, 0.0020); + lung->AddElement(elCa, 0.00007); + lung->AddElement(elFe, 0.00037); + lung->AddElement(elZn, 0.000011); + lung->AddElement(elRb, 0.0000037); + lung->AddElement(elSr, 0.000000059); + lung->AddElement(elPb, 0.00000041); + + G4double density_adipose = 0.93 * g / cm3; + adipose = new G4Material("adipose", density_adipose, 8); + adipose->AddElement(elH, 0.112); + adipose->AddElement(elC, 0.619); + adipose->AddElement(elN, 0.017); + adipose->AddElement(elO, 0.251); + adipose->AddElement(elS, 0.00025); + adipose->AddElement(elP, 0.00025); + adipose->AddElement(elK, 0.00025); + adipose->AddElement(elCa, 0.00025); + + G4double density_glandular = 1.04 * g / cm3; + glandular = new G4Material("glandular", density_glandular, 8); + glandular->AddElement(elH, 0.1); + glandular->AddElement(elC, 0.184); + glandular->AddElement(elN, 0.032); + glandular->AddElement(elO, 0.679); + glandular->AddElement(elS, 0.00125); + glandular->AddElement(elP, 0.00125); + glandular->AddElement(elK, 0.00125); + glandular->AddElement(elCa, 0.00125); + + d = (density_adipose * 0.5) + (density_glandular * 0.5); + adipose_glandular = new G4Material("adipose_glandular", d, 2); + adipose_glandular->AddMaterial(adipose, 0.5); + adipose_glandular->AddMaterial(glandular, 0.5); + + // Air + d = 1.290 * mg / cm3; + G4Material* matAir = new G4Material("Air", d, 2); + matAir->AddElement(elN, 0.7); + matAir->AddElement(elO, 0.3); +} + +G4Material* G4HumanPhantomMaterial::GetMaterial(G4String material) { + // Returns a material + G4Material* pttoMaterial = G4Material::GetMaterial(material); + return pttoMaterial; +} diff --git a/src/G4MIRDBodyFactory.cpp b/src/G4MIRDBodyFactory.cpp new file mode 100644 index 0000000..b43c2f6 --- /dev/null +++ b/src/G4MIRDBodyFactory.cpp @@ -0,0 +1,192 @@ +#include "G4MIRDBodyFactory.h" + +#include "G4MIRDBrain.h" +#include "G4MIRDHead.h" +#include "G4MIRDHeart.h" +#include "G4MIRDLeftAdrenal.h" +#include "G4MIRDLeftArmBone.h" +#include "G4MIRDLeftBreast.h" +#include "G4MIRDLeftClavicle.h" +#include "G4MIRDLeftKidney.h" +#include "G4MIRDLeftLeg.h" +#include "G4MIRDLeftLegBone.h" +#include "G4MIRDLeftLung.h" +#include "G4MIRDLeftOvary.h" +#include "G4MIRDLeftScapula.h" +#include "G4MIRDLeftTeste.h" +#include "G4MIRDLiver.h" +#include "G4MIRDLowerLargeIntestine.h" +#include "G4MIRDMaleGenitalia.h" +#include "G4MIRDMiddleLowerSpine.h" +#include "G4MIRDPancreas.h" +#include "G4MIRDPelvis.h" +#include "G4MIRDRibCage.h" +#include "G4MIRDRightAdrenal.h" +#include "G4MIRDRightArmBone.h" +#include "G4MIRDRightBreast.h" +#include "G4MIRDRightClavicle.h" +#include "G4MIRDRightKidney.h" +#include "G4MIRDRightLeg.h" +#include "G4MIRDRightLegBone.h" +#include "G4MIRDRightLung.h" +#include "G4MIRDRightOvary.h" +#include "G4MIRDRightScapula.h" +#include "G4MIRDRightTeste.h" +#include "G4MIRDSkull.h" +#include "G4MIRDSmallIntestine.h" +#include "G4MIRDSpleen.h" +#include "G4MIRDStomach.h" +#include "G4MIRDThymus.h" +#include "G4MIRDThyroid.h" +#include "G4MIRDTrunk.h" +#include "G4MIRDUpperLargeIntestine.h" +#include "G4MIRDUpperSpine.h" +#include "G4MIRDUrinaryBladder.h" +#include "G4MIRDUterus.h" + +G4MIRDBodyFactory::G4MIRDBodyFactory() { + // Map with name of the organ and pointer to the MIRDOrgan class + // organ["ParameterisedRightBreast"] = new G4ParameterisedRightBreast(); + // organ["ParameterisedLeftBreast"] = new G4ParameterisedLeftBreast(); + organ["Head"] = new G4MIRDHead(); + organ["Trunk"] = new G4MIRDTrunk(); + organ["LeftLeg"] = new G4MIRDLeftLeg(); + organ["RightLeg"] = new G4MIRDRightLeg(); + + organ["Skull"] = new G4MIRDSkull(); + organ["LeftArmBone"] = new G4MIRDLeftArmBone(); + organ["RightArmBone"] = new G4MIRDRightArmBone(); + organ["UpperSpine"] = new G4MIRDUpperSpine(); + organ["MiddleLowerSpine"] = new G4MIRDMiddleLowerSpine(); + organ["Pelvis"] = new G4MIRDPelvis(); + organ["RibCage"] = new G4MIRDRibCage(); + organ["LeftClavicle"] = new G4MIRDLeftClavicle(); + organ["RightClavicle"] = new G4MIRDRightClavicle(); + organ["LeftLegBone"] = new G4MIRDLeftLegBone(); + organ["RightLegBone"] = new G4MIRDRightLegBone(); + organ["LeftScapula"] = new G4MIRDLeftScapula(); + organ["RightScapula"] = new G4MIRDRightScapula(); + + organ["Heart"] = new G4MIRDHeart(); + organ["Thyroid"] = new G4MIRDThyroid(); + organ["Thymus"] = new G4MIRDThymus(); + organ["MaleGenitalia"] = new G4MIRDMaleGenitalia(); + organ["Brain"] = new G4MIRDBrain(); + organ["Stomach"] = new G4MIRDStomach(); + organ["UpperLargeIntestine"] = new G4MIRDUpperLargeIntestine(); + organ["LowerLargeIntestine"] = new G4MIRDLowerLargeIntestine(); + organ["SmallIntestine"] = new G4MIRDSmallIntestine(); + organ["Spleen"] = new G4MIRDSpleen(); + organ["Pancreas"] = new G4MIRDPancreas(); + organ["LeftKidney"] = new G4MIRDLeftKidney(); + organ["RightKidney"] = new G4MIRDRightKidney(); + organ["UrinaryBladder"] = new G4MIRDUrinaryBladder(); + organ["Uterus"] = new G4MIRDUterus(); + organ["Liver"] = new G4MIRDLiver(); + organ["LeftLung"] = new G4MIRDLeftLung(); + organ["RightLung"] = new G4MIRDRightLung(); + organ["LeftOvary"] = new G4MIRDLeftOvary(); + organ["RightOvary"] = new G4MIRDRightOvary(); + organ["LeftTeste"] = new G4MIRDLeftTeste(); + organ["RightTeste"] = new G4MIRDRightTeste(); + organ["RightBreast"] = new G4MIRDRightBreast(); + organ["LeftBreast"] = new G4MIRDLeftBreast(); + organ["LeftAdrenal"] = new G4MIRDLeftAdrenal(); + organ["RightAdrenal"] = new G4MIRDRightAdrenal(); +} + +G4MIRDBodyFactory::~G4MIRDBodyFactory() { + delete organ["Head"]; + organ["Head"] = 0; + delete organ["RightLeg"]; + organ["RightLeg"] = 0; + delete organ["LeftLeg"]; + organ["LeftLeg"] = 0; + delete organ["Trunk"]; + organ["Trunk"] = 0; + + delete organ["RightScapula"]; + organ["RightScapula"] = 0; + delete organ["LeftScapula"]; + organ["LeftScapula"] = 0; + delete organ["RightLegBone"]; + organ["RightLegBone"] = 0; + delete organ["LeftLegBone"]; + organ["LeftLegBone"] = 0; + delete organ["RibCage"]; + organ["RibCage"] = 0; + delete organ["MiddleLowerSpine"]; + organ["MidlleLowerSpine"] = 0; + delete organ["UpperSpine"]; + organ["UpperSpine"] = 0; + delete organ["Skull"]; + organ["Skull"] = 0; + delete organ["RightArmBone"]; + organ["RightArmBone"] = 0; + delete organ["LeftArmBone"]; + organ["LeftArmBone"] = 0; + delete organ["RightClavicle"]; + organ["RightClavicle"] = 0; + delete organ["LeftClavicle"]; + organ["LeftClavicle"] = 0; + delete organ["Pelvis"]; + organ["Pelvis"] = 0; + + delete organ["RightAdrenal"]; + organ["RightAdrenal"] = 0; + delete organ["LeftAdrenal"]; + organ["LeftAdrenal"] = 0; + delete organ["LeftBreast"]; + organ["LeftBreast"] = 0; + delete organ["RightBreast"]; + organ["RightBreast"] = 0; + delete organ["RightOvary"]; + organ["RightOvary"] = 0; + delete organ["LeftOvary"]; + organ["LeftOvary"] = 0; + delete organ["RightTeste"]; + organ["RightTeste"] = 0; + delete organ["LeftTeste"]; + organ["LeftTeste"] = 0; + delete organ["RightLung"]; + organ["RightLung"] = 0; + delete organ["LeftLung"]; + organ["LeftLung"] = 0; + delete organ["Uterus"]; + organ["Uterus"] = 0; + delete organ["UrinaryBladder"]; + organ["UrinaryBladder"] = 0; + delete organ["RightKidney"]; + organ["RightKidney"] = 0; + delete organ["LeftKidney"]; + organ["LeftKidney"] = 0; + delete organ["Pancreas"]; + organ["Pancreas"] = 0; + delete organ["Spleen"]; + organ["Spleen"] = 0; + delete organ["LowerLargeIntestine"]; + organ["LowerLargeIntestine"] = 0; + delete organ["SmallIntestine"]; + organ["SmallIntestine"] = 0; + delete organ["UpperLargeIntestine"]; + organ["UpperLargeIntestine"] = 0; + delete organ["Stomach"]; + organ["Stomach"] = 0; + delete organ["Brain"]; + organ["Brain"] = 0; + delete organ["Heart"]; + organ["Heart"] = 0; + delete organ["Thymus"]; + organ["Thymus"] = 0; + delete organ["MaleGenitalia"]; + organ["MaleGenitalia"] = 0; + delete organ["Thyroid"]; + organ["Thyroid"] = 0; + delete organ["Liver"]; + organ["Liver"] = 0; +} + +G4VPhysicalVolume* G4MIRDBodyFactory::CreateOrgan(const G4String& organ_name, G4VPhysicalVolume* motherVolume, + const G4String& colourName, G4bool visAttribute, G4bool sensitivity) { + return organ[organ_name]->Construct(organ_name, motherVolume, colourName, visAttribute, sensitivity); +} diff --git a/src/G4MIRDBrain.cpp b/src/G4MIRDBrain.cpp new file mode 100644 index 0000000..35a4646 --- /dev/null +++ b/src/G4MIRDBrain.cpp @@ -0,0 +1,67 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDBrain.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDBrain::G4MIRDBrain() {} + +G4MIRDBrain::~G4MIRDBrain() {} + +G4VPhysicalVolume* G4MIRDBrain::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother " << mother->GetName() << G4endl; + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 6. * cm; + G4double by = 9. * cm; + G4double cz = 6.5 * cm; + + G4Ellipsoid* brain = new G4Ellipsoid("Brain", ax, by, cz); + + G4LogicalVolume* logicBrain = new G4LogicalVolume(brain, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physBrain = new G4PVPlacement(0, G4ThreeVector(0. * cm, 0. * cm, 8.75 * cm), "physicalBrain", + logicBrain, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* BrainVisAtt = new G4VisAttributes(G4Colour(0.41,0.41,0.41)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + + G4VisAttributes* BrainVisAtt = new G4VisAttributes(colour); + BrainVisAtt->SetForceSolid(wireFrame); + BrainVisAtt->SetLineWidth(0.7 * mm); + logicBrain->SetVisAttributes(BrainVisAtt); + + // Testing Brain Volume + G4double BrainVol = logicBrain->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Brain = " << BrainVol / cm3 << " cm^3" << G4endl; + + // Testing Brain Material + G4String BrainMat = logicBrain->GetMaterial()->GetName(); + G4cout << "Material of Brain = " << BrainMat << G4endl; + + // Testing Density + G4double BrainDensity = logicBrain->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << BrainDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double BrainMass = (BrainVol)*BrainDensity; + G4cout << "Mass of Brain = " << BrainMass / gram << " g" << G4endl; + + return physBrain; +} diff --git a/src/G4MIRDHead.cpp b/src/G4MIRDHead.cpp new file mode 100644 index 0000000..6684600 --- /dev/null +++ b/src/G4MIRDHead.cpp @@ -0,0 +1,89 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDHead.h" + +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDHead::G4MIRDHead() {} + +G4MIRDHead::~G4MIRDHead() {} + +G4VPhysicalVolume* G4MIRDHead::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4Material* soft = material->GetMaterial("soft_tissue"); + + // MIRD male model + // Ellipsoid + G4double ax = 7.0 * cm; + G4double by = 10.0 * cm; + G4double cz = 8.50 * cm; + G4double zcut1 = 0.0 * cm; + G4double zcut2 = 8.5 * cm; + + G4Ellipsoid* head1 = new G4Ellipsoid("Head1", ax, by, cz, zcut1, zcut2); + + G4double dx = 7.0 * cm; + G4double dy = 10.0 * cm; + G4double dz = 7.75 * cm; + + G4EllipticalTube* head2 = new G4EllipticalTube("Head2", dx, dy, dz); + + G4UnionSolid* head = new G4UnionSolid("Head", head2, head1, + 0, // Rotation + G4ThreeVector(0. * cm, 0. * cm, 7.7500 * cm)); + + G4LogicalVolume* logicHead = new G4LogicalVolume(head, soft, "logical" + volumeName, 0, 0, 0); + // Define rotation and position here! + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(180. * degree); + rm->rotateY(180. * degree); + + G4VPhysicalVolume* physHead = new G4PVPlacement(rm, + // G4ThreeVector(0.* cm,0.*cm, 70.75*cm), //FA + G4ThreeVector(0. * cm, 0. * cm, 77.75 * cm), "physicalHead", + logicHead, mother, false, 0, true); + + // Visualization Attributes + + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* HeadVisAtt = new G4VisAttributes(colour); + + HeadVisAtt->SetForceSolid(wireFrame); + // HeadVisAtt->SetLineWidth(0.7* mm); + // HeadVisAtt-> SetForceAuxEdgeVisible(true); + logicHead->SetVisAttributes(HeadVisAtt); + + // Testing Head Volume + G4double HeadVol = logicHead->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Head = " << HeadVol / cm3 << " cm^3" << G4endl; + + // Testing Head Material + G4String HeadMat = logicHead->GetMaterial()->GetName(); + G4cout << "Material of Head = " << HeadMat << G4endl; + + // Testing Density + G4double HeadDensity = logicHead->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << HeadDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double HeadMass = (HeadVol)*HeadDensity; + G4cout << "Mass of Head = " << HeadMass / gram << " g" << G4endl; + + return physHead; +} diff --git a/src/G4MIRDHeart.cpp b/src/G4MIRDHeart.cpp new file mode 100644 index 0000000..8abcb17 --- /dev/null +++ b/src/G4MIRDHeart.cpp @@ -0,0 +1,84 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDHeart.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4Sphere.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDHeart::G4MIRDHeart() {} + +G4MIRDHeart::~G4MIRDHeart() {} + +G4VPhysicalVolume* G4MIRDHeart::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4Material* soft = material->GetMaterial("soft_tissue"); + + G4double ax = 4.00 * cm; + G4double by = 4.00 * cm; + G4double cz = 7.00 * cm; + G4double zcut1 = -7.00 * cm; + G4double zcut2 = 0.0 * cm; + + G4Ellipsoid* heart1 = new G4Ellipsoid("Heart1", ax, by, cz, zcut1, zcut2); + + G4double rmin = 0. * cm; + G4double rmax = 3.99 * cm; + G4double startphi = 0. * degree; + G4double deltaphi = 360. * degree; + G4double starttheta = 0. * degree; + G4double deltatheta = 90. * degree; + + G4Sphere* heart2 = new G4Sphere("Heart2", rmin, rmax, startphi, deltaphi, starttheta, deltatheta); + + G4UnionSolid* heart = new G4UnionSolid("Heart", heart1, heart2); + + G4LogicalVolume* logicHeart = new G4LogicalVolume(heart, soft, "HeartVolume", 0, 0, 0); + + // Define rotation and position here! + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateY(25. * degree); + G4VPhysicalVolume* physHeart = new G4PVPlacement(rm, G4ThreeVector(0.0, -3.0 * cm, 15.32 * cm), "physicalHeart", + logicHeart, mother, false, 0, true); + + // Visualization Attributes + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* HeartVisAtt = new G4VisAttributes(colour); + HeartVisAtt->SetForceSolid(wireFrame); + logicHeart->SetVisAttributes(HeartVisAtt); + + G4cout << "Heart created !!!!!!" << G4endl; + + // Testing Heart Volume + G4double HeartVol = logicHeart->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Heart = " << HeartVol / cm3 << " cm^3" << G4endl; + + // Testing Heart Material + G4String HeartMat = logicHeart->GetMaterial()->GetName(); + G4cout << "Material of Heart = " << HeartMat << G4endl; + + // Testing Density + G4double HeartDensity = logicHeart->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << HeartDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double HeartMass = (HeartVol)*HeartDensity; + G4cout << "Mass of Heart = " << HeartMass / gram << " g" << G4endl; + + return physHeart; +} diff --git a/src/G4MIRDLeftAdrenal.cpp b/src/G4MIRDLeftAdrenal.cpp new file mode 100644 index 0000000..ae701a0 --- /dev/null +++ b/src/G4MIRDLeftAdrenal.cpp @@ -0,0 +1,74 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftAdrenal.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftAdrenal::G4MIRDLeftAdrenal() {} + +G4MIRDLeftAdrenal::~G4MIRDLeftAdrenal() {} + +G4VPhysicalVolume* G4MIRDLeftAdrenal::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 1.5 * cm; // a + G4double by = 0.5 * cm; // b + G4double cz = 5.0 * cm; // c + + G4VSolid* leftAdrenal = new G4Ellipsoid("OneLeftAdrenal", ax, by, cz, 0. * cm, cz); + + G4LogicalVolume* logicLeftAdrenal = new G4LogicalVolume(leftAdrenal, soft, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physLeftAdrenal = + new G4PVPlacement(0, + G4ThreeVector(4.5 * cm, // xo + 6.5 * cm, // yo + 3. * cm), // zo + "physicalLeftAdrenal", logicLeftAdrenal, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftAdrenalVisAtt = new G4VisAttributes(G4Colour(0.72,0.52,0.04)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftAdrenalVisAtt = new G4VisAttributes(colour); + LeftAdrenalVisAtt->SetForceSolid(wireFrame); + logicLeftAdrenal->SetVisAttributes(LeftAdrenalVisAtt); + + G4cout << "Left LeftAdrenal created !!!!!!" << G4endl; + + // Testing LeftAdrenal Volume + G4double LeftAdrenalVol = logicLeftAdrenal->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftAdrenal = " << LeftAdrenalVol / cm3 << " cm^3" << G4endl; + + // Testing LeftAdrenal Material + G4String LeftAdrenalMat = logicLeftAdrenal->GetMaterial()->GetName(); + G4cout << "Material of LeftAdrenal = " << LeftAdrenalMat << G4endl; + + // Testing Density + G4double LeftAdrenalDensity = logicLeftAdrenal->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftAdrenalDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftAdrenalMass = (LeftAdrenalVol)*LeftAdrenalDensity; + G4cout << "Mass of LeftAdrenal = " << LeftAdrenalMass / gram << " g" << G4endl; + + return physLeftAdrenal; +} diff --git a/src/G4MIRDLeftArmBone.cpp b/src/G4MIRDLeftArmBone.cpp new file mode 100644 index 0000000..76c600f --- /dev/null +++ b/src/G4MIRDLeftArmBone.cpp @@ -0,0 +1,77 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftArmBone.h" + +#include "G4EllipticalCone.hh" +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftArmBone::G4MIRDLeftArmBone() {} + +G4MIRDLeftArmBone::~G4MIRDLeftArmBone() {} + +G4VPhysicalVolume* G4MIRDLeftArmBone::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + // Remind! the elliptical cone gives problems! Intersections of volumes, + // wrong calculation of the volume! + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + + delete material; + + G4double dx = 1.4 * cm; // a + G4double dy = 2.7 * cm; // b + // G4double dz= 46. * cm;//z0 + + // G4EllipticalCone* arm = new G4EllipticalCone("OneLeftArmBone",dx/2.,dy/2.,dz, 34.5 *cm); + G4EllipticalTube* leftArm = new G4EllipticalTube("OneLeftArmBone", dx, dy, 34.5 * cm); + + G4LogicalVolume* logicLeftArmBone = new G4LogicalVolume(leftArm, skeleton, "logical" + volumeName, 0, 0, 0); + + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(180. * degree); + G4VPhysicalVolume* physLeftArmBone = + new G4PVPlacement(rm, G4ThreeVector(18.4 * cm, 0.0, -0.5 * cm), + //-x0 + "physicalLeftArmBone", logicLeftArmBone, mother, false, 0, true); + + // Visualization Attributes + + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftArmBoneVisAtt = new G4VisAttributes(colour); + LeftArmBoneVisAtt->SetForceSolid(wireFrame); + logicLeftArmBone->SetVisAttributes(LeftArmBoneVisAtt); + + G4cout << "LeftArmBone created !!!!!!" << G4endl; + + // Testing LeftArmBone Volume + G4double LeftArmBoneVol = logicLeftArmBone->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftArmBone = " << LeftArmBoneVol / cm3 << " cm^3" << G4endl; + + // Testing LeftArmBone Material + G4String LeftArmBoneMat = logicLeftArmBone->GetMaterial()->GetName(); + G4cout << "Material of LeftArmBone = " << LeftArmBoneMat << G4endl; + + // Testing Density + G4double LeftArmBoneDensity = logicLeftArmBone->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftArmBoneDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftArmBoneMass = (LeftArmBoneVol)*LeftArmBoneDensity; + G4cout << "Mass of LeftArmBone = " << LeftArmBoneMass / gram << " g" << G4endl; + + return physLeftArmBone; +} diff --git a/src/G4MIRDLeftBreast.cpp b/src/G4MIRDLeftBreast.cpp new file mode 100644 index 0000000..2417d36 --- /dev/null +++ b/src/G4MIRDLeftBreast.cpp @@ -0,0 +1,88 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftBreast.h" + +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftBreast::G4MIRDLeftBreast() {} + +G4MIRDLeftBreast::~G4MIRDLeftBreast() {} + +G4VPhysicalVolume* G4MIRDLeftBreast::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 4.95 * cm; + G4double by = 4.35 * cm; + G4double cz = 4.15 * cm; + + G4Ellipsoid* oneLeftBreast = new G4Ellipsoid("OneLeftBreast", ax, by, cz); + + G4double dx = 20. * cm; + G4double dy = 10. * cm; + G4double dz = 35. * cm; + + G4EllipticalTube* Trunk = new G4EllipticalTube("Trunk", dx, dy, dz); + + G4RotationMatrix* rm_relative = new G4RotationMatrix(); + rm_relative->rotateX(90. * degree); + + G4SubtractionSolid* breast = new G4SubtractionSolid("LeftBreast", oneLeftBreast, Trunk, rm_relative, + G4ThreeVector(-10. * cm, 0.0 * cm, -8.66 * cm)); + + G4LogicalVolume* logicLeftBreast = new G4LogicalVolume(breast, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(90. * degree); + rm->rotateY(0. * degree); + rm->rotateZ(16. * degree); + G4VPhysicalVolume* physLeftBreast = new G4PVPlacement( + rm, G4ThreeVector(10 * cm, 9.1 * cm, 52. * cm), "physicalLeftBreast", logicLeftBreast, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftBreastVisAtt = new G4VisAttributes(G4Colour(1.0,0.41,0.71)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftBreastVisAtt = new G4VisAttributes(colour); + LeftBreastVisAtt->SetForceSolid(wireFrame); + + logicLeftBreast->SetVisAttributes(LeftBreastVisAtt); + + G4cout << "LeftBreast created !!!!!!" << G4endl; + + // Testing LeftBreast Volume + G4double LeftBreastVol = logicLeftBreast->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftBreast = " << LeftBreastVol / cm3 << " cm^3" << G4endl; + + // Testing LeftBreast Material + G4String LeftBreastMat = logicLeftBreast->GetMaterial()->GetName(); + G4cout << "Material of LeftBreast = " << LeftBreastMat << G4endl; + + // Testing Density + G4double LeftBreastDensity = logicLeftBreast->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftBreastDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftBreastMass = (LeftBreastVol)*LeftBreastDensity; + G4cout << "Mass of LeftBreast = " << LeftBreastMass / gram << " g" << G4endl; + + return physLeftBreast; +} diff --git a/src/G4MIRDLeftClavicle.cpp b/src/G4MIRDLeftClavicle.cpp new file mode 100644 index 0000000..530db1b --- /dev/null +++ b/src/G4MIRDLeftClavicle.cpp @@ -0,0 +1,72 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftClavicle.h" + +#include "G4Box.hh" +#include "G4Cons.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4Torus.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftClavicle::G4MIRDLeftClavicle() {} + +G4MIRDLeftClavicle::~G4MIRDLeftClavicle() {} + +G4VPhysicalVolume* G4MIRDLeftClavicle::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* skeleton = material->GetMaterial("skeleton"); + + G4double rMin = 0 * cm; + G4double rMax = 0.7883 * cm; + G4double rTor = 10 * cm; + G4double pSPhi = 298.15 * degree; + G4double pDPhi = 0.7 * rad; + + G4Torus* clavicle = new G4Torus("Clavicle", rMin, rMax, rTor, pSPhi, pDPhi); + + G4LogicalVolume* logicLeftClavicle = new G4LogicalVolume(clavicle, skeleton, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physLeftClavicle = + new G4PVPlacement(0, G4ThreeVector(0. * cm, 2. * cm, 33.25 * cm), "physicalLeftClavicle", logicLeftClavicle, + mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftClavicleVisAtt = new G4VisAttributes(G4Colour(0.94,0.5,0.5)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftClavicleVisAtt = new G4VisAttributes(colour); + LeftClavicleVisAtt->SetForceSolid(wireFrame); + logicLeftClavicle->SetVisAttributes(LeftClavicleVisAtt); + + G4cout << "LeftClavicle created !!!!!!" << G4endl; + + // Testing LeftClavicle Volume + G4double LeftClavicleVol = logicLeftClavicle->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftClavicle = " << LeftClavicleVol / cm3 << " cm^3" << G4endl; + + // Testing LeftClavicle Material + G4String LeftClavicleMat = logicLeftClavicle->GetMaterial()->GetName(); + G4cout << "Material of LeftClavicle = " << LeftClavicleMat << G4endl; + + // Testing Density + G4double LeftClavicleDensity = logicLeftClavicle->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftClavicleDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftClavicleMass = (LeftClavicleVol)*LeftClavicleDensity; + G4cout << "Mass of LeftClavicle = " << LeftClavicleMass / gram << " g" << G4endl; + + return physLeftClavicle; +} diff --git a/src/G4MIRDLeftKidney.cpp b/src/G4MIRDLeftKidney.cpp new file mode 100644 index 0000000..beaaaa2 --- /dev/null +++ b/src/G4MIRDLeftKidney.cpp @@ -0,0 +1,83 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftKidney.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftKidney::G4MIRDLeftKidney() {} + +G4MIRDLeftKidney::~G4MIRDLeftKidney() {} + +G4VPhysicalVolume* G4MIRDLeftKidney::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 4.5 * cm; // a + G4double by = 1.5 * cm; // b + G4double cz = 5.5 * cm; // c + + G4VSolid* oneLeftKidney = new G4Ellipsoid("OneLeftKidney", ax, by, cz); + + G4double xx = 6. * cm; + G4double yy = 12.00 * cm; + G4double zz = 12.00 * cm; + G4VSolid* subtrLeftKidney = new G4Box("SubtrLeftKidney", xx / 2., yy / 2., zz / 2.); + + G4SubtractionSolid* leftKidney = new G4SubtractionSolid("LeftKidney", oneLeftKidney, subtrLeftKidney, 0, + G4ThreeVector(-6. * cm, // x0 + 0.0 * cm, 0.0 * cm)); + + G4LogicalVolume* logicLeftKidney = new G4LogicalVolume(leftKidney, soft, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physLeftKidney = + new G4PVPlacement(0, + G4ThreeVector(6. * cm, // xo + 6. * cm, // yo + -2.50 * cm), // zo + "physicalLeftKidney", logicLeftKidney, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftKidneyVisAtt = new G4VisAttributes(G4Colour(0.72,0.52,0.04)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftKidneyVisAtt = new G4VisAttributes(colour); + LeftKidneyVisAtt->SetForceSolid(wireFrame); + logicLeftKidney->SetVisAttributes(LeftKidneyVisAtt); + + G4cout << "Left LeftKidney created !!!!!!" << G4endl; + + // Testing LeftKidney Volume + G4double LeftKidneyVol = logicLeftKidney->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftKidney = " << LeftKidneyVol / cm3 << " cm^3" << G4endl; + + // Testing LeftKidney Material + G4String LeftKidneyMat = logicLeftKidney->GetMaterial()->GetName(); + G4cout << "Material of LeftKidney = " << LeftKidneyMat << G4endl; + + // Testing Density + G4double LeftKidneyDensity = logicLeftKidney->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftKidneyDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftKidneyMass = (LeftKidneyVol)*LeftKidneyDensity; + G4cout << "Mass of LeftKidney = " << LeftKidneyMass / gram << " g" << G4endl; + + return physLeftKidney; +} diff --git a/src/G4MIRDLeftLeg.cpp b/src/G4MIRDLeftLeg.cpp new file mode 100644 index 0000000..ca40015 --- /dev/null +++ b/src/G4MIRDLeftLeg.cpp @@ -0,0 +1,76 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftLeg.h" + +#include "G4Cons.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftLeg::G4MIRDLeftLeg() {} + +G4MIRDLeftLeg::~G4MIRDLeftLeg() {} + +G4VPhysicalVolume* G4MIRDLeftLeg::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + + G4double rmin1 = 0. * cm; + G4double rmin2 = 0. * cm; + G4double dz = 80.0 * cm; + G4double rmax1 = 2.0 * cm; + G4double rmax2 = 10. * cm; + G4double startphi = 0. * degree; + G4double deltaphi = 360. * degree; + + G4Cons* leg1 = new G4Cons("Leg1", rmin1, rmax1, rmin2, rmax2, dz / 2., startphi, deltaphi); + + G4LogicalVolume* logicLeftLeg = new G4LogicalVolume(leg1, soft, "logical" + volumeName, 0, 0, 0); + + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(180. * degree); + rm->rotateY(180. * degree); + G4VPhysicalVolume* physLeftLeg = new G4PVPlacement(rm, + // G4ThreeVector(10. * cm, 0. * cm, -47. *cm), //FA + G4ThreeVector(10. * cm, 0. * cm, -40. * cm), "physicalLeftLeg", + logicLeftLeg, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftLegVisAtt = new G4VisAttributes(G4Colour(0.94,0.5,0.5)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftLegVisAtt = new G4VisAttributes(colour); + LeftLegVisAtt->SetForceSolid(wireFrame); + logicLeftLeg->SetVisAttributes(LeftLegVisAtt); + + G4cout << "LeftLeg created !!!!!!" << G4endl; + + // Testing LeftLeg Volume + G4double LeftLegVol = logicLeftLeg->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftLeg = " << LeftLegVol / cm3 << " cm^3" << G4endl; + + // Testing LeftLeg Material + G4String LeftLegMat = logicLeftLeg->GetMaterial()->GetName(); + G4cout << "Material of LeftLeg = " << LeftLegMat << G4endl; + + // Testing Density + G4double LeftLegDensity = logicLeftLeg->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftLegDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftLegMass = (LeftLegVol)*LeftLegDensity; + G4cout << "Mass of LeftLeg = " << LeftLegMass / gram << " g" << G4endl; + + return physLeftLeg; +} diff --git a/src/G4MIRDLeftLegBone.cpp b/src/G4MIRDLeftLegBone.cpp new file mode 100644 index 0000000..4a86de7 --- /dev/null +++ b/src/G4MIRDLeftLegBone.cpp @@ -0,0 +1,75 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftLegBone.h" + +#include "G4Cons.hh" +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftLegBone::G4MIRDLeftLegBone() {} + +G4MIRDLeftLegBone::~G4MIRDLeftLegBone() {} + +G4VPhysicalVolume* G4MIRDLeftLegBone::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + + delete material; + + G4double dz = 79.8 * cm; + G4double rmin1 = 0.0 * cm; + G4double rmin2 = 0.0 * cm; + G4double rmax1 = 1. * cm; + G4double rmax2 = 3.5 * cm; + G4double startphi = 0. * degree; + G4double deltaphi = 360. * degree; + + G4Cons* leg_bone = new G4Cons("OneLeftLegBone", rmin1, rmax1, rmin2, rmax2, dz / 2., startphi, deltaphi); + + G4LogicalVolume* logicLeftLegBone = new G4LogicalVolume(leg_bone, skeleton, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physLeftLegBone = new G4PVPlacement( + 0, G4ThreeVector(0.0 * cm, 0.0, 0.1 * cm), "physicalLeftLegBone", logicLeftLegBone, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftLegBoneVisAtt = new G4VisAttributes(G4Colour(0.46,0.53,0.6)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftLegBoneVisAtt = new G4VisAttributes(colour); + + LeftLegBoneVisAtt->SetForceSolid(wireFrame); + logicLeftLegBone->SetVisAttributes(LeftLegBoneVisAtt); + + G4cout << "LeftLegBone created !!!!!!" << G4endl; + + // Testing LeftLegBone Volume + G4double LeftLegBoneVol = logicLeftLegBone->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftLegBone = " << LeftLegBoneVol / cm3 << " cm^3" << G4endl; + + // Testing LeftLegBone Material + G4String LeftLegBoneMat = logicLeftLegBone->GetMaterial()->GetName(); + G4cout << "Material of LeftLegBone = " << LeftLegBoneMat << G4endl; + + // Testing Density + G4double LeftLegBoneDensity = logicLeftLegBone->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftLegBoneDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftLegBoneMass = (LeftLegBoneVol)*LeftLegBoneDensity; + G4cout << "Mass of LeftLegBone = " << LeftLegBoneMass / gram << " g" << G4endl; + + return physLeftLegBone; +} diff --git a/src/G4MIRDLeftLung.cpp b/src/G4MIRDLeftLung.cpp new file mode 100644 index 0000000..4ccba05 --- /dev/null +++ b/src/G4MIRDLeftLung.cpp @@ -0,0 +1,106 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftLung.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftLung::G4MIRDLeftLung() {} + +G4MIRDLeftLung::~G4MIRDLeftLung() {} + +G4VPhysicalVolume* G4MIRDLeftLung::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* lung_material = material->GetMaterial("lung_material"); + delete material; + + G4double ax = 5. * cm; // a + G4double by = 7.5 * cm; // b + G4double cz = 24. * cm; // c + G4double zcut1 = 0.0 * cm; + G4double zcut2 = 24. * cm; + + G4Ellipsoid* oneLung = new G4Ellipsoid("OneLung", ax, by, cz, zcut1, zcut2); + + ax = 5. * cm; + by = 7.5 * cm; + cz = 24. * cm; + + G4Ellipsoid* subtrLung = new G4Ellipsoid("subtrLung", ax, by, cz); + + // y<0 + + G4double dx = 5.5 * cm; + G4double dy = 8.5 * cm; + G4double dz = 24. * cm; + + G4Box* box = new G4Box("Box", dx, dy, dz); + + // G4SubtractionSolid* section = new G4SubtractionSolid("BoxSub", subtrLung, box, 0, G4ThreeVector(0.*cm, 8.5* cm, + // 0.*cm)); + G4SubtractionSolid* section2 = + new G4SubtractionSolid("BoxSub2", subtrLung, box, 0, G4ThreeVector(0. * cm, 8.5 * cm, 0. * cm)); + + // G4SubtractionSolid* lung1 = new G4SubtractionSolid("Lung1", oneLung, + // section, + // 0, G4ThreeVector(6.*cm,0*cm,0.0*cm)); + + G4SubtractionSolid* lung2 = + new G4SubtractionSolid("Lung2", oneLung, section2, 0, G4ThreeVector(-6. * cm, 0 * cm, 0.0 * cm)); + + // G4RotationMatrix* matrix = new G4RotationMatrix(); + // matrix->rotateX(180. * degree); + // matrix ->rotateZ(180.*degree); + // matrix -> rotateY(180.* degree); + + // G4UnionSolid* lungs = new G4UnionSolid("Lungs", lung1, lung2, matrix, G4ThreeVector(17*cm, 0., 0.)); + + G4LogicalVolume* logicLeftLung = new G4LogicalVolume(lung2, lung_material, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physLeftLung = new G4PVPlacement(0, G4ThreeVector(8.50 * cm, 0.0 * cm, 8.5 * cm), + "physicalLeftLung", logicLeftLung, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftLungVisAtt = new G4VisAttributes(G4Colour(0.25,0.41,0.88)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftLungVisAtt = new G4VisAttributes(colour); + LeftLungVisAtt->SetForceSolid(wireFrame); + logicLeftLung->SetVisAttributes(LeftLungVisAtt); + + G4cout << "LeftLung created !!!!!!" << G4endl; + + // Testing LeftLung Volume + G4double LeftLungVol = logicLeftLung->GetSolid()->GetCubicVolume(); + + G4cout << "Volume of LeftLung = " << (LeftLungVol) / cm3 << " cm^3" << G4endl; + + // Testing LeftLung Material + G4String LeftLungMat = logicLeftLung->GetMaterial()->GetName(); + G4cout << "Material of LeftLung = " << LeftLungMat << G4endl; + + // Testing Density + G4double LeftLungDensity = logicLeftLung->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftLungDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftLungMass = (LeftLungVol)*LeftLungDensity; + G4cout << "Mass of LeftLung = " << LeftLungMass / gram << " g" << G4endl; + + return physLeftLung; +} diff --git a/src/G4MIRDLeftOvary.cpp b/src/G4MIRDLeftOvary.cpp new file mode 100644 index 0000000..9ccf236 --- /dev/null +++ b/src/G4MIRDLeftOvary.cpp @@ -0,0 +1,71 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftOvary.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftOvary::G4MIRDLeftOvary() {} + +G4MIRDLeftOvary::~G4MIRDLeftOvary() {} + +G4VPhysicalVolume* G4MIRDLeftOvary::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 1. * cm; + G4double by = 0.5 * cm; + G4double cz = 2. * cm; + + G4Ellipsoid* OneOvary = new G4Ellipsoid("OneOvary", ax, by, cz); + + G4LogicalVolume* logicLeftOvary = new G4LogicalVolume(OneOvary, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physLeftOvary = new G4PVPlacement(0, G4ThreeVector(-6. * cm, 0.5 * cm, -20 * cm), + "physicalLeftOvary", logicLeftOvary, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftOvaryVisAtt = new G4VisAttributes(G4Colour(0.85,0.44,0.84)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + delete colourPointer; + + G4VisAttributes* LeftOvaryVisAtt = new G4VisAttributes(colour); + LeftOvaryVisAtt->SetForceSolid(wireFrame); + logicLeftOvary->SetVisAttributes(LeftOvaryVisAtt); + + G4cout << "LeftOvary created !!!!!!" << G4endl; + + // Testing LeftOvary Volume + G4double LeftOvaryVol = logicLeftOvary->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftOvary = " << LeftOvaryVol / cm3 << " cm^3" << G4endl; + + // Testing LeftOvary Material + G4String LeftOvaryMat = logicLeftOvary->GetMaterial()->GetName(); + G4cout << "Material of LeftOvary = " << LeftOvaryMat << G4endl; + + // Testing Density + G4double LeftOvaryDensity = logicLeftOvary->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftOvaryDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftOvaryMass = (LeftOvaryVol)*LeftOvaryDensity; + G4cout << "Mass of LeftOvary = " << LeftOvaryMass / gram << " g" << G4endl; + + return physLeftOvary; +} diff --git a/src/G4MIRDLeftScapula.cpp b/src/G4MIRDLeftScapula.cpp new file mode 100644 index 0000000..c4cc6f8 --- /dev/null +++ b/src/G4MIRDLeftScapula.cpp @@ -0,0 +1,93 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftScapula.h" + +#include "G4Box.hh" +#include "G4Cons.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftScapula::G4MIRDLeftScapula() {} + +G4MIRDLeftScapula::~G4MIRDLeftScapula() {} + +G4VPhysicalVolume* G4MIRDLeftScapula::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* skeleton = material->GetMaterial("skeleton"); + + G4double ax_in = 17. * cm; + G4double by_in = 9.8 * cm; + G4double ax_out = 19. * cm; + G4double by_out = 9.8 * cm; + G4double dz = 16.4 * cm; + + G4EllipticalTube* inner_scapula = new G4EllipticalTube("ScapulaIn", ax_in, by_in, (dz + 1. * cm) / 2); + G4EllipticalTube* outer_scapula = new G4EllipticalTube("ScapulaOut", ax_out, by_out, dz / 2); + + G4Box* subtraction = new G4Box("subtraction", ax_out, ax_out, ax_out); + + G4double xx = ax_out * 0.242; //(sin 14deg) + G4double yy = -ax_out * 0.97; // (cos 14 deg) + + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateZ(-14. * degree); + + G4SubtractionSolid* scapula_first = + new G4SubtractionSolid("Scapula_first", outer_scapula, subtraction, rm, G4ThreeVector(xx, yy, 0. * cm)); + + G4double xx2 = -ax_out * 0.62470; //(cos 51.34deg) + G4double yy2 = ax_out * 0.78087; // (sin 51.34 deg) + + G4RotationMatrix* rm2 = new G4RotationMatrix(); + rm2->rotateZ(-38.6598 * degree); + + G4SubtractionSolid* scapula_bone = + new G4SubtractionSolid("Scapula", scapula_first, subtraction, rm2, G4ThreeVector(xx2, yy2, 0. * cm)); + + G4SubtractionSolid* scapula = new G4SubtractionSolid("Scapula", scapula_bone, inner_scapula); + + G4LogicalVolume* logicLeftScapula = new G4LogicalVolume(scapula, skeleton, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physLeftScapula = new G4PVPlacement( + 0, G4ThreeVector(0. * cm, 0. * cm, 24.1 * cm), "physicalLeftScapula", logicLeftScapula, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftScapulaVisAtt = new G4VisAttributes(G4Colour(0.94,0.5,0.5)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LeftScapulaVisAtt = new G4VisAttributes(colour); + LeftScapulaVisAtt->SetForceSolid(wireFrame); + logicLeftScapula->SetVisAttributes(LeftScapulaVisAtt); + + G4cout << "LeftScapula created !!!!!!" << G4endl; + + // Testing LeftScapula Volume + G4double LeftScapulaVol = logicLeftScapula->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftScapula = " << LeftScapulaVol / cm3 << " cm^3" << G4endl; + + // Testing LeftScapula Material + G4String LeftScapulaMat = logicLeftScapula->GetMaterial()->GetName(); + G4cout << "Material of LeftScapula = " << LeftScapulaMat << G4endl; + + // Testing Density + G4double LeftScapulaDensity = logicLeftScapula->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftScapulaDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftScapulaMass = (LeftScapulaVol)*LeftScapulaDensity; + G4cout << "Mass of LeftScapula = " << LeftScapulaMass / gram << " g" << G4endl; + + return physLeftScapula; +} diff --git a/src/G4MIRDLeftTeste.cpp b/src/G4MIRDLeftTeste.cpp new file mode 100644 index 0000000..5977c27 --- /dev/null +++ b/src/G4MIRDLeftTeste.cpp @@ -0,0 +1,71 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLeftTeste.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLeftTeste::G4MIRDLeftTeste() {} + +G4MIRDLeftTeste::~G4MIRDLeftTeste() {} + +G4VPhysicalVolume* G4MIRDLeftTeste::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 1.3 * cm; + G4double by = 1.5 * cm; + G4double cz = 2.3 * cm; + + G4Ellipsoid* OneTeste = new G4Ellipsoid("OneTeste", ax, by, cz); + + G4LogicalVolume* logicLeftTeste = new G4LogicalVolume(OneTeste, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physLeftTeste = new G4PVPlacement(0, G4ThreeVector(1.4 * cm, 3. * cm, 0 * cm), + "physicalLeftTeste", logicLeftTeste, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LeftTesteVisAtt = new G4VisAttributes(G4Colour(0.85,0.44,0.84)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + delete colourPointer; + + G4VisAttributes* LeftTesteVisAtt = new G4VisAttributes(colour); + LeftTesteVisAtt->SetForceSolid(wireFrame); + logicLeftTeste->SetVisAttributes(LeftTesteVisAtt); + + G4cout << "LeftTeste created !!!!!!" << G4endl; + + // Testing LeftTeste Volume + G4double LeftTesteVol = logicLeftTeste->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LeftTeste = " << LeftTesteVol / cm3 << " cm^3" << G4endl; + + // Testing LeftTeste Material + G4String LeftTesteMat = logicLeftTeste->GetMaterial()->GetName(); + G4cout << "Material of LeftTeste = " << LeftTesteMat << G4endl; + + // Testing Density + G4double LeftTesteDensity = logicLeftTeste->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LeftTesteDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LeftTesteMass = (LeftTesteVol)*LeftTesteDensity; + G4cout << "Mass of LeftTeste = " << LeftTesteMass / gram << " g" << G4endl; + + return physLeftTeste; +} diff --git a/src/G4MIRDLiver.cpp b/src/G4MIRDLiver.cpp new file mode 100644 index 0000000..63c6cec --- /dev/null +++ b/src/G4MIRDLiver.cpp @@ -0,0 +1,95 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLiver.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +#include + +G4MIRDLiver::G4MIRDLiver() {} + +G4MIRDLiver::~G4MIRDLiver() {} + +G4VPhysicalVolume* G4MIRDLiver::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother " << mother->GetName() << G4endl; + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double dx = 14.19 * cm; // a + G4double dy = 7.84 * cm; // b + G4double dz = 7.21 * cm; //(z2-z1)/2 + + G4EllipticalTube* firstLiver = new G4EllipticalTube("FirstLiver", dx, dy, dz); + + G4double xx = 20.00 * cm; + G4double yy = 50.00 * cm; + G4double zz = 50.00 * cm; + + G4Box* subtrLiver = new G4Box("SubtrLiver", xx / 2., yy / 2., zz / 2.); + + G4RotationMatrix* rm_relative = new G4RotationMatrix(); + rm_relative->rotateY(32. * degree); + rm_relative->rotateZ(40.9 * degree); + + // G4double aa = (1.00/31.51); + // G4double bb = (1.00/44.75); + // G4double cc = (-1.00/38.76); + // G4cout<< aa << " "<< bb << " "<rotateX(180. * degree); + G4VPhysicalVolume* physLiver = new G4PVPlacement(rm, G4ThreeVector(0. * cm, 0. * cm, 0. * cm), "physicalLiver", + logicLiver, mother, false, 0, true); + + // Visualization Attributes + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LiverVisAtt = new G4VisAttributes(colour); + LiverVisAtt->SetForceSolid(wireFrame); + logicLiver->SetVisAttributes(LiverVisAtt); + + G4cout << "Liver created !!!!!!" << G4endl; + + // Testing Liver Volume + G4double LiverVol = logicLiver->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Liver = " << LiverVol / cm3 << " cm^3" << G4endl; + + // Testing Liver Material + G4String LiverMat = logicLiver->GetMaterial()->GetName(); + G4cout << "Material of Liver = " << LiverMat << G4endl; + + // Testing Density + G4double LiverDensity = logicLiver->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LiverDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LiverMass = (LiverVol)*LiverDensity; + G4cout << "Mass of Liver = " << LiverMass / gram << " g" << G4endl; + + return physLiver; +} diff --git a/src/G4MIRDLowerLargeIntestine.cpp b/src/G4MIRDLowerLargeIntestine.cpp new file mode 100644 index 0000000..1cdf960 --- /dev/null +++ b/src/G4MIRDLowerLargeIntestine.cpp @@ -0,0 +1,100 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDLowerLargeIntestine.h" + +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4Torus.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDLowerLargeIntestine::G4MIRDLowerLargeIntestine() {} + +G4MIRDLowerLargeIntestine::~G4MIRDLowerLargeIntestine() {} + +G4VPhysicalVolume* G4MIRDLowerLargeIntestine::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double dx = 1.88 * cm; // a + G4double dy = 2.13 * cm; // b + G4double dz = 7.64 * cm; //(z1-z2)/2 + + G4EllipticalTube* DescendingColonLowerLargeIntestine = new G4EllipticalTube("DiscendingColon", dx, dy, dz); + + G4double rmin = 0.0 * cm; + G4double rmax = 1.88 * cm; // a + G4double rtor = 5.72 * cm; // R1 + G4double startphi = 0. * degree; + G4double deltaphi = 90. * degree; + + G4Torus* SigmoidColonUpLowerLargeIntestine = + new G4Torus("SigmoidColonUpLowerLargeIntestine", rmin, rmax, rtor, startphi, deltaphi); + + rtor = 3. * cm; // R2 + G4VSolid* SigmoidColonDownLowerLargeIntestine = + new G4Torus("SigmoidColonDownLowerLargeIntestine", rmin, rmax, rtor, startphi, deltaphi); + + G4RotationMatrix* relative_rm = new G4RotationMatrix(); + relative_rm->rotateY(180. * degree); + relative_rm->rotateZ(90. * degree); + + G4UnionSolid* SigmoidColonLowerLargeIntestine = + new G4UnionSolid("SigmoidColonLowerLargeIntestine", SigmoidColonUpLowerLargeIntestine, + SigmoidColonDownLowerLargeIntestine, relative_rm, G4ThreeVector(0.0, 8.72 * cm, 0.0)); + // R1 + R2 + + G4RotationMatrix* relative_rm_2 = new G4RotationMatrix(); + relative_rm_2->rotateX(90. * degree); + + G4UnionSolid* LowerLargeIntestine = + new G4UnionSolid("LowerLargeIntestine", DescendingColonLowerLargeIntestine, SigmoidColonLowerLargeIntestine, + relative_rm_2, G4ThreeVector(-5.72 * cm, 0.0 * cm, -7.64 * cm)); // -rtor,0, -dz + + G4LogicalVolume* logicLowerLargeIntestine = + new G4LogicalVolume(LowerLargeIntestine, soft, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physLowerLargeIntestine = + new G4PVPlacement(0, // R1+ R2, -2.36 (y0), z0 + G4ThreeVector(8.72 * cm, -2.36 * cm, -18.64 * cm), "physicalLowerLargeIntestine", + logicLowerLargeIntestine, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* LowerLargeIntestineVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* LowerLargeIntestineVisAtt = new G4VisAttributes(colour); + LowerLargeIntestineVisAtt->SetForceSolid(wireFrame); + logicLowerLargeIntestine->SetVisAttributes(LowerLargeIntestineVisAtt); + + G4cout << "LowerLargeIntestine created !!!!!!" << G4endl; + + // Testing LowerLargeIntestine Volume + G4double LowerLargeIntestineVol = logicLowerLargeIntestine->GetSolid()->GetCubicVolume(); + G4cout << "Volume of LowerLargeIntestine = " << LowerLargeIntestineVol / cm3 << " cm^3" << G4endl; + + // Testing LowerLargeIntestine Material + G4String LowerLargeIntestineMat = logicLowerLargeIntestine->GetMaterial()->GetName(); + G4cout << "Material of LowerLargeIntestine = " << LowerLargeIntestineMat << G4endl; + + // Testing Density + G4double LowerLargeIntestineDensity = logicLowerLargeIntestine->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << LowerLargeIntestineDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double LowerLargeIntestineMass = (LowerLargeIntestineVol)*LowerLargeIntestineDensity; + G4cout << "Mass of LowerLargeIntestine = " << LowerLargeIntestineMass / gram << " g" << G4endl; + + return physLowerLargeIntestine; +} diff --git a/src/G4MIRDMaleGenitalia.cpp b/src/G4MIRDMaleGenitalia.cpp new file mode 100644 index 0000000..731be58 --- /dev/null +++ b/src/G4MIRDMaleGenitalia.cpp @@ -0,0 +1,103 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDMaleGenitalia.h" + +#include "G4Cons.hh" +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4Trap.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDMaleGenitalia::G4MIRDMaleGenitalia() {} + +G4MIRDMaleGenitalia::~G4MIRDMaleGenitalia() {} + +G4VPhysicalVolume* G4MIRDMaleGenitalia::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double pDz = 2.4 * cm; + G4double pTheta = 0 * degree; + G4double pPhi = 0 * degree; + G4double pDy1 = 4.76 * cm; + G4double pDx1 = 9.52 * cm; + G4double pDx2 = 9.52 * cm; + G4double pAlp1 = 0 * degree; + G4double pDy2 = 5 * cm; + G4double pDx3 = 10 * cm; + G4double pDx4 = 10 * cm; + G4double pAlp2 = 0 * degree; + + G4Trap* genitaliaTrap = + new G4Trap("GenitaliaTrap", pDz, pTheta, pPhi, pDy1, pDx1, pDx2, pAlp1, pDy2, pDx3, pDx4, pAlp2); + + G4double rmin1 = 0. * cm; + G4double rmin2 = 0. * cm; + G4double dz = 5 * cm; + G4double rmax1 = 9.51 * cm; + G4double rmax2 = 10.01 * cm; + G4double startphi = 0. * degree; + G4double deltaphi = 360. * degree; + + G4Cons* genitaliaLegL = new G4Cons("GenitaliaLegL", rmin1, rmax1, rmin2, rmax2, dz / 2., startphi, deltaphi); + + G4Cons* genitaliaLegR = new G4Cons("GenitaliaLegR", rmin1, rmax1, rmin2, rmax2, dz / 2., startphi, deltaphi); + + G4UnionSolid* genitaliaLegs = + new G4UnionSolid("GenitaliaLegs", genitaliaLegL, genitaliaLegR, 0, G4ThreeVector(20. * cm, 0. * cm, 0 * cm)); + + G4SubtractionSolid* MaleGenitalia = new G4SubtractionSolid("MaleGenitalia", genitaliaTrap, genitaliaLegs, + 0, // + G4ThreeVector(-10. * cm, -5. * cm, 0 * cm)); + + G4LogicalVolume* logicMaleGenitalia = new G4LogicalVolume(MaleGenitalia, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physMaleGenitalia = + new G4PVPlacement(0, G4ThreeVector(0 * cm, 5. * cm, -2.4 * cm), "physicalMaleGenitalia", logicMaleGenitalia, + mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* MaleGenitaliaVisAtt = new G4VisAttributes(G4Colour(0.85,0.44,0.84)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + delete colourPointer; + + G4VisAttributes* MaleGenitaliaVisAtt = new G4VisAttributes(colour); + MaleGenitaliaVisAtt->SetForceSolid(wireFrame); + logicMaleGenitalia->SetVisAttributes(MaleGenitaliaVisAtt); + + G4cout << "MaleGenitalia created !!!!!!" << G4endl; + + // Testing MaleGenitalia Volume + G4double MaleGenitaliaVol = logicMaleGenitalia->GetSolid()->GetCubicVolume(); + G4cout << "Volume of MaleGenitalia = " << MaleGenitaliaVol / cm3 << " cm^3" << G4endl; + + // Testing MaleGenitalia Material + G4String MaleGenitaliaMat = logicMaleGenitalia->GetMaterial()->GetName(); + G4cout << "Material of MaleGenitalia = " << MaleGenitaliaMat << G4endl; + + // Testing Density + G4double MaleGenitaliaDensity = logicMaleGenitalia->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << MaleGenitaliaDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double MaleGenitaliaMass = (MaleGenitaliaVol)*MaleGenitaliaDensity; + G4cout << "Mass of MaleGenitalia = " << MaleGenitaliaMass / gram << " g" << G4endl; + + return physMaleGenitalia; +} diff --git a/src/G4MIRDMiddleLowerSpine.cpp b/src/G4MIRDMiddleLowerSpine.cpp new file mode 100644 index 0000000..edabfd1 --- /dev/null +++ b/src/G4MIRDMiddleLowerSpine.cpp @@ -0,0 +1,71 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDMiddleLowerSpine.h" + +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDMiddleLowerSpine::G4MIRDMiddleLowerSpine() {} + +G4MIRDMiddleLowerSpine::~G4MIRDMiddleLowerSpine() {} + +G4VPhysicalVolume* G4MIRDMiddleLowerSpine::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + + delete material; + + G4double dx = 2. * cm; + G4double dy = 2.5 * cm; + G4double dz = 24. * cm; + + G4VSolid* middleLowerSpine = new G4EllipticalTube("MiddleLowerSpine", dx, dy, dz); + + G4LogicalVolume* logicMiddleLowerSpine = + new G4LogicalVolume(middleLowerSpine, skeleton, "logical" + volumeName, 0, 0, 0); + // Define rotation and position here! + G4VPhysicalVolume* physMiddleLowerSpine = + new G4PVPlacement(0, G4ThreeVector(0.0 * cm, 5.5 * cm, 11. * cm), "physicalMiddleLowerSpine", + logicMiddleLowerSpine, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* MiddleLowerSpineVisAtt = new G4VisAttributes(G4Colour(0.46,0.53,0.6)); + + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* MiddleLowerSpineVisAtt = new G4VisAttributes(colour); + MiddleLowerSpineVisAtt->SetForceSolid(wireFrame); + logicMiddleLowerSpine->SetVisAttributes(MiddleLowerSpineVisAtt); + + G4cout << "MiddleLowerSpine created !!!!!!" << G4endl; + + // Testing MiddleLowerSpine Volume + G4double MiddleLowerSpineVol = logicMiddleLowerSpine->GetSolid()->GetCubicVolume(); + G4cout << "Volume of MiddleLowerSpine = " << MiddleLowerSpineVol / cm3 << " cm^3" << G4endl; + + // Testing MiddleLowerSpine Material + G4String MiddleLowerSpineMat = logicMiddleLowerSpine->GetMaterial()->GetName(); + G4cout << "Material of MiddleLowerSpine = " << MiddleLowerSpineMat << G4endl; + + // Testing Density + G4double MiddleLowerSpineDensity = logicMiddleLowerSpine->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << MiddleLowerSpineDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double MiddleLowerSpineMass = (MiddleLowerSpineVol)*MiddleLowerSpineDensity; + G4cout << "Mass of MiddleLowerSpine = " << MiddleLowerSpineMass / gram << " g" << G4endl; + + return physMiddleLowerSpine; +} diff --git a/src/G4MIRDPancreas.cpp b/src/G4MIRDPancreas.cpp new file mode 100644 index 0000000..e6cd6ce --- /dev/null +++ b/src/G4MIRDPancreas.cpp @@ -0,0 +1,81 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDPancreas.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDPancreas::G4MIRDPancreas() {} + +G4MIRDPancreas::~G4MIRDPancreas() {} + +G4VPhysicalVolume* G4MIRDPancreas::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 3. * cm; // c + G4double by = 1. * cm; // b + G4double cz = 15. * cm; // a + G4double zcut1 = -15. * cm; // -a + G4double zcut2 = 0.0 * cm; + + G4Ellipsoid* pancreasFirst = new G4Ellipsoid("PancreasFirst", ax, by, cz, zcut1, zcut2); + + G4double xx = 6. * cm; // 2*c + G4double yy = 2. * cm; // 2*b + G4double zz = 12. * cm; // cz - x1 = 3 cm + G4Box* subtrPancreas = new G4Box("SubtrPancreas", xx / 2., yy / 2., zz / 2.); + + G4SubtractionSolid* pancreas = + new G4SubtractionSolid("pancreas", pancreasFirst, subtrPancreas, 0, G4ThreeVector(-3 * cm, 0.0, -9. * cm)); + // + G4LogicalVolume* logicPancreas = new G4LogicalVolume(pancreas, soft, "logical" + volumeName, 0, 0, 0); + + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateY(90. * degree); + G4VPhysicalVolume* physPancreas = new G4PVPlacement(rm, G4ThreeVector(-0. * cm, 0.0, 2 * cm), // x0, 0, 2 cm + "physicalPancreas", logicPancreas, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* PancreasVisAtt = new G4VisAttributes(G4Colour(0.28,0.82,0.8)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* PancreasVisAtt = new G4VisAttributes(colour); + PancreasVisAtt->SetForceSolid(wireFrame); + logicPancreas->SetVisAttributes(PancreasVisAtt); + + G4cout << "Pancreas created !!!!!!" << G4endl; + + // Testing Pancreas Volume + G4double PancreasVol = logicPancreas->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Pancreas = " << PancreasVol / cm3 << " cm^3" << G4endl; + + // Testing Pancreas Material + G4String PancreasMat = logicPancreas->GetMaterial()->GetName(); + G4cout << "Material of Pancreas = " << PancreasMat << G4endl; + + // Testing Density + G4double PancreasDensity = logicPancreas->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << PancreasDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double PancreasMass = (PancreasVol)*PancreasDensity; + G4cout << "Mass of Pancreas = " << PancreasMass / gram << " g" << G4endl; + + return physPancreas; +} diff --git a/src/G4MIRDPelvis.cpp b/src/G4MIRDPelvis.cpp new file mode 100644 index 0000000..435d118 --- /dev/null +++ b/src/G4MIRDPelvis.cpp @@ -0,0 +1,107 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDPelvis.h" + +#include "G4Box.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VSolid.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDPelvis::G4MIRDPelvis() {} + +G4MIRDPelvis::~G4MIRDPelvis() {} + +G4VPhysicalVolume* G4MIRDPelvis::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + + delete material; + /* + G4double dx= 10.35 * cm;//12. *cm; // a2 + G4double dy= 11.76 * cm;//12. * cm; // b2 + G4double dz= 9.915 * cm; // z2/2 + + G4VSolid* outPelvis = new G4EllipticalTube("OutPelvis",dx, dy, dz); + + G4double dx_in = 9.75 * cm;//11.3 * cm; // a1 + G4double dy_in = 11.07 *cm; //11.3* cm; //b1 + G4double dz_in = 10. * cm;//11.0 *cm; // z2/2 + + */ + G4double dx = 12. * cm; // a2 + G4double dy = 12. * cm; // b2 + G4double dz = 11. * cm; // z2/2 + + G4VSolid* outPelvis = new G4EllipticalTube("OutPelvis", dx, dy, dz); + + dx = 11.3 * cm; // a1 + dy = 11.3 * cm; // b1 + dz = 12.0 * cm; // z2/2 + + G4VSolid* inPelvis = new G4EllipticalTube("InPelvis", dx, dy, dz); + + G4double x = 28. * cm; // a2 * 2 + G4double y = 28. * cm; // b2*2 + G4double z = 24. * cm; // z2 + + G4VSolid* subPelvis = new G4Box("SubtrPelvis", x / 2., y / 2., z / 2.); + + G4SubtractionSolid* firstPelvis = + new G4SubtractionSolid("FirstPelvis", outPelvis, inPelvis, 0, G4ThreeVector(0. * cm, -0.8 * cm, 0. * cm)); + + G4SubtractionSolid* secondPelvis = + new G4SubtractionSolid("SecondPelvis", firstPelvis, subPelvis, 0, G4ThreeVector(0.0, -14. * cm, 0. * cm)); + // half of the y size of the box + + G4SubtractionSolid* pelvis = + new G4SubtractionSolid("Pelvis", secondPelvis, subPelvis, 0, G4ThreeVector(0.0, 22. * cm, -9. * cm)); + + G4LogicalVolume* logicPelvis = new G4LogicalVolume(pelvis, skeleton, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physPelvis = + new G4PVPlacement(0, G4ThreeVector(0.0, -3. * cm, -24. * cm), // 0, y02, z position + // with respect to the trunk + "physicalPelvis", logicPelvis, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* PelvisVisAtt = new G4VisAttributes(G4Colour(0.46,0.53,0.6)); + + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* PelvisVisAtt = new G4VisAttributes(colour); + PelvisVisAtt->SetForceSolid(wireFrame); + logicPelvis->SetVisAttributes(PelvisVisAtt); + + G4cout << "Pelvis created !!!!!!" << G4endl; + + // Testing Pelvis Volume + G4double PelvisVol = logicPelvis->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Pelvis = " << PelvisVol / cm3 << " cm^3" << G4endl; + + // Testing Pelvis Material + G4String PelvisMat = logicPelvis->GetMaterial()->GetName(); + G4cout << "Material of Pelvis = " << PelvisMat << G4endl; + + // Testing Density + G4double PelvisDensity = logicPelvis->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << PelvisDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double PelvisMass = (PelvisVol)*PelvisDensity; + G4cout << "Mass of Pelvis = " << PelvisMass / gram << " g" << G4endl; + + return physPelvis; +} diff --git a/src/G4MIRDRibCage.cpp b/src/G4MIRDRibCage.cpp new file mode 100644 index 0000000..703d13e --- /dev/null +++ b/src/G4MIRDRibCage.cpp @@ -0,0 +1,141 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRibCage.h" + +#include "G4Box.hh" +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4PVReplica.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRibCage::G4MIRDRibCage() {} + +G4MIRDRibCage::~G4MIRDRibCage() {} + +G4VPhysicalVolume* G4MIRDRibCage::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + G4Material* soft = material->GetMaterial("soft_tissue"); + + delete material; + + G4double dx = 17. * cm; // a2 + G4double dy = 9.8 * cm; // b2 + G4double thickness = 32.4 * cm; // z2/2 of cage + + G4EllipticalTube* outCage = new G4EllipticalTube("outCage", dx, dy, thickness / 2.); + + dx = 16.4 * cm; // a1 + dy = 9.2 * cm; // b1 + G4double dz = 34. * cm; // z2/2 + + G4EllipticalTube* inCage = new G4EllipticalTube("inCage", dx, dy, dz / 2.); + + G4SubtractionSolid* cage = + new G4SubtractionSolid("Cage", outCage, inCage, 0, G4ThreeVector(0. * cm, 0. * cm, 0. * cm)); + + G4LogicalVolume* logicRibCage = new G4LogicalVolume(cage, soft, "logicalCage", 0, 0, 0); + + G4VPhysicalVolume* physRibCage = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, thickness / 2. + 0.1 * cm), + // with respect to the trunk + "physicalRibCage", logicRibCage, mother, false, 0, true); + + G4double xx = 17. * cm; + G4double yy = 9.8 * cm; + G4double ribThickness = 1.4 * cm; + G4EllipticalTube* rib_out = new G4EllipticalTube("rib_out", xx, yy, ribThickness / 2.); + + xx = 16.5 * cm; + yy = 9.3 * cm; + G4double zz = 1.5 * cm; + G4EllipticalTube* rib_in = new G4EllipticalTube("rib_in", xx, yy, zz / 2.); + G4SubtractionSolid* rib = new G4SubtractionSolid("rib", rib_out, rib_in); + + G4LogicalVolume* logicRib = new G4LogicalVolume(rib, skeleton, "logical" + volumeName, 0, 0, 0); + + physRib1 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-32.2 * cm / 2. + 0.8 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib2 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-32.2 * cm / 2. + 0.8 * cm + 2.8 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib3 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 5.6 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib4 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 8.4 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib5 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 11.2 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib6 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 14. * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib7 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 16.8 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib8 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 19.6 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib9 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 22.4 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib10 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 25.2 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib11 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 28. * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + physRib12 = new G4PVPlacement(0, G4ThreeVector(0.0, 0.0, (-thickness / 2. + 0.8 * cm + 30.8 * cm)), + // with respect to the trunk + "physicalRib", logicRib, physRibCage, false, 0, true); + + // Visualization Attributes + logicRibCage->SetVisAttributes(G4VisAttributes::GetInvisible()); + + // G4VisAttributes* RibCageVisAtt = new G4VisAttributes(G4Colour(0.46,0.53,0.6)); + + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RibCageVisAtt = new G4VisAttributes(colour); + RibCageVisAtt->SetForceSolid(wireFrame); + logicRib->SetVisAttributes(RibCageVisAtt); + + G4cout << "RibCage created !!!!!!" << G4endl; + // Testing Pelvis Volume + G4double RibCageVol = logicRib->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RibCage = " << ((RibCageVol)*12.) / cm3 << " cm^3" << G4endl; + + // Testing RibCage Material + G4String RibCageMat = logicRib->GetMaterial()->GetName(); + G4cout << "Material of RibCage = " << RibCageMat << G4endl; + + // Testing Density + G4double RibCageDensity = logicRib->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RibCageDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RibCageMass = (RibCageVol)*RibCageDensity * 12; // 12 is the total number of ribs; + G4cout << "Mass of RibCage = " << (RibCageMass) / gram << " g" << G4endl; + + return physRibCage; +} diff --git a/src/G4MIRDRightAdrenal.cpp b/src/G4MIRDRightAdrenal.cpp new file mode 100644 index 0000000..aa50b04 --- /dev/null +++ b/src/G4MIRDRightAdrenal.cpp @@ -0,0 +1,74 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightAdrenal.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightAdrenal::G4MIRDRightAdrenal() {} + +G4MIRDRightAdrenal::~G4MIRDRightAdrenal() {} + +G4VPhysicalVolume* G4MIRDRightAdrenal::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 1.5 * cm; // a + G4double by = 0.5 * cm; // b + G4double cz = 5.0 * cm; // c + + G4VSolid* rightAdrenal = new G4Ellipsoid("OneRightAdrenal", ax, by, cz, 0. * cm, cz); + + G4LogicalVolume* logicRightAdrenal = new G4LogicalVolume(rightAdrenal, soft, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physRightAdrenal = + new G4PVPlacement(0, + G4ThreeVector(-4.5 * cm, // xo + 6.5 * cm, // yo + 3. * cm), // zo + "physicalRightAdrenal", logicRightAdrenal, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightAdrenalVisAtt = new G4VisAttributes(G4Colour(0.72,0.52,0.04)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightAdrenalVisAtt = new G4VisAttributes(colour); + RightAdrenalVisAtt->SetForceSolid(wireFrame); + logicRightAdrenal->SetVisAttributes(RightAdrenalVisAtt); + + G4cout << "Right RightAdrenal created !!!!!!" << G4endl; + + // Testing RightAdrenal Volume + G4double RightAdrenalVol = logicRightAdrenal->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightAdrenal = " << RightAdrenalVol / cm3 << " cm^3" << G4endl; + + // Testing RightAdrenal Material + G4String RightAdrenalMat = logicRightAdrenal->GetMaterial()->GetName(); + G4cout << "Material of RightAdrenal = " << RightAdrenalMat << G4endl; + + // Testing Density + G4double RightAdrenalDensity = logicRightAdrenal->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightAdrenalDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightAdrenalMass = (RightAdrenalVol)*RightAdrenalDensity; + G4cout << "Mass of RightAdrenal = " << RightAdrenalMass / gram << " g" << G4endl; + + return physRightAdrenal; +} diff --git a/src/G4MIRDRightArmBone.cpp b/src/G4MIRDRightArmBone.cpp new file mode 100644 index 0000000..1e6a76a --- /dev/null +++ b/src/G4MIRDRightArmBone.cpp @@ -0,0 +1,78 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightArmBone.h" + +#include "G4EllipticalCone.hh" +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightArmBone::G4MIRDRightArmBone() {} + +G4MIRDRightArmBone::~G4MIRDRightArmBone() {} + +G4VPhysicalVolume* G4MIRDRightArmBone::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + // Remind! the elliptical cone gives problems! Intersections of volumes, + // wrong calculation of the volume! + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + + delete material; + + G4double dx = 1.4 * cm; // a + G4double dy = 2.7 * cm; // b + // G4double dz= 46. * cm;//z0 + + // G4EllipticalCone* arm = new G4EllipticalCone("OneRightArmBone",dx/2.,dy/2.,dz, 34.5 *cm); + G4EllipticalTube* rightArm = new G4EllipticalTube("OneRightArmBone", dx, dy, 34.5 * cm); + + G4LogicalVolume* logicRightArmBone = new G4LogicalVolume(rightArm, skeleton, "logical" + volumeName, 0, 0, 0); + + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(180. * degree); + G4VPhysicalVolume* physRightArmBone = + new G4PVPlacement(rm, G4ThreeVector(-18.4 * cm, 0.0, -0.5 * cm), + //-x0 + "physicalRightArmBone", logicRightArmBone, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightArmBoneVisAtt = new G4VisAttributes(G4Colour(0.46,0.53,0.6)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightArmBoneVisAtt = new G4VisAttributes(colour); + + RightArmBoneVisAtt->SetForceSolid(wireFrame); + logicRightArmBone->SetVisAttributes(RightArmBoneVisAtt); + + G4cout << "RightArmBone created !!!!!!" << G4endl; + + // Testing RightArmBone Volume + G4double RightArmBoneVol = logicRightArmBone->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightArmBone = " << RightArmBoneVol / cm3 << " cm^3" << G4endl; + + // Testing RightArmBone Material + G4String RightArmBoneMat = logicRightArmBone->GetMaterial()->GetName(); + G4cout << "Material of RightArmBone = " << RightArmBoneMat << G4endl; + + // Testing Density + G4double RightArmBoneDensity = logicRightArmBone->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightArmBoneDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightArmBoneMass = (RightArmBoneVol)*RightArmBoneDensity; + G4cout << "Mass of RightArmBone = " << RightArmBoneMass / gram << " g" << G4endl; + + return physRightArmBone; +} diff --git a/src/G4MIRDRightBreast.cpp b/src/G4MIRDRightBreast.cpp new file mode 100644 index 0000000..6900e4d --- /dev/null +++ b/src/G4MIRDRightBreast.cpp @@ -0,0 +1,88 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightBreast.h" + +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightBreast::G4MIRDRightBreast() {} + +G4MIRDRightBreast::~G4MIRDRightBreast() {} + +G4VPhysicalVolume* G4MIRDRightBreast::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 4.95 * cm; + G4double by = 4.35 * cm; + G4double cz = 4.15 * cm; + + G4Ellipsoid* oneRightBreast = new G4Ellipsoid("OneRightBreast", ax, by, cz); + + G4double dx = 20. * cm; + G4double dy = 10. * cm; + G4double dz = 35. * cm; + + G4EllipticalTube* Trunk = new G4EllipticalTube("Trunk", dx, dy, dz); + + G4RotationMatrix* rm_relative = new G4RotationMatrix(); + rm_relative->rotateX(90. * degree); + + G4SubtractionSolid* breast = new G4SubtractionSolid("RightBreast", oneRightBreast, Trunk, rm_relative, + G4ThreeVector(10. * cm, 0.0 * cm, -8.66 * cm)); + + G4LogicalVolume* logicRightBreast = new G4LogicalVolume(breast, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(90. * degree); + rm->rotateY(0. * degree); + rm->rotateZ(-16. * degree); + G4VPhysicalVolume* physRightBreast = + new G4PVPlacement(rm, G4ThreeVector(-10. * cm, 9.1 * cm, 52. * cm), "physicalRightBreast", logicRightBreast, + mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightBreastVisAtt = new G4VisAttributes(G4Colour(1.0,0.41,0.71)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightBreastVisAtt = new G4VisAttributes(colour); + RightBreastVisAtt->SetForceSolid(wireFrame); + logicRightBreast->SetVisAttributes(RightBreastVisAtt); + + G4cout << "RightBreast created !!!!!!" << G4endl; + + // Testing RightBreast Volume + G4double RightBreastVol = logicRightBreast->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightBreast = " << RightBreastVol / cm3 << " cm^3" << G4endl; + + // Testing RightBreast Material + G4String RightBreastMat = logicRightBreast->GetMaterial()->GetName(); + G4cout << "Material of RightBreast = " << RightBreastMat << G4endl; + + // Testing Density + G4double RightBreastDensity = logicRightBreast->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightBreastDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightBreastMass = (RightBreastVol)*RightBreastDensity; + G4cout << "Mass of RightBreast = " << RightBreastMass / gram << " g" << G4endl; + + return physRightBreast; +} diff --git a/src/G4MIRDRightClavicle.cpp b/src/G4MIRDRightClavicle.cpp new file mode 100644 index 0000000..f64e3d8 --- /dev/null +++ b/src/G4MIRDRightClavicle.cpp @@ -0,0 +1,69 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightClavicle.h" + +#include "G4Box.hh" +#include "G4Cons.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4Torus.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightClavicle::G4MIRDRightClavicle() {} + +G4MIRDRightClavicle::~G4MIRDRightClavicle() {} + +G4VPhysicalVolume* G4MIRDRightClavicle::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* skeleton = material->GetMaterial("skeleton"); + + G4double rMin = 0 * cm; + G4double rMax = 0.7883 * cm; + G4double rTor = 10 * cm; + G4double pSPhi = 201.75 * degree; + G4double pDPhi = 0.7 * rad; + + G4Torus* clavicle = new G4Torus("Clavicle", rMin, rMax, rTor, pSPhi, pDPhi); + + G4LogicalVolume* logicRightClavicle = new G4LogicalVolume(clavicle, skeleton, "logical" + volumeName, 0, 0, 0); + G4VPhysicalVolume* physRightClavicle = + new G4PVPlacement(0, G4ThreeVector(0. * cm, 2. * cm, 33.25 * cm), "physicalRightClavicle", logicRightClavicle, + mother, false, 0, true); + + // Visualization Attributes + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightClavicleVisAtt = new G4VisAttributes(colour); + RightClavicleVisAtt->SetForceSolid(wireFrame); + logicRightClavicle->SetVisAttributes(RightClavicleVisAtt); + G4cout << "RightClavicle created !!!!!!" << G4endl; + + // Testing RightClavicle Volume + G4double RightClavicleVol = logicRightClavicle->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightClavicle = " << RightClavicleVol / cm3 << " cm^3" << G4endl; + + // Testing RightClavicle Material + G4String RightClavicleMat = logicRightClavicle->GetMaterial()->GetName(); + G4cout << "Material of RightClavicle = " << RightClavicleMat << G4endl; + + // Testing Density + G4double RightClavicleDensity = logicRightClavicle->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightClavicleDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightClavicleMass = (RightClavicleVol)*RightClavicleDensity; + G4cout << "Mass of RightClavicle = " << RightClavicleMass / gram << " g" << G4endl; + + return physRightClavicle; +} diff --git a/src/G4MIRDRightKidney.cpp b/src/G4MIRDRightKidney.cpp new file mode 100644 index 0000000..58eb07b --- /dev/null +++ b/src/G4MIRDRightKidney.cpp @@ -0,0 +1,83 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightKidney.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightKidney::G4MIRDRightKidney() {} + +G4MIRDRightKidney::~G4MIRDRightKidney() {} + +G4VPhysicalVolume* G4MIRDRightKidney::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 4.5 * cm; // a + G4double by = 1.5 * cm; // b + G4double cz = 5.5 * cm; // c + + G4VSolid* oneRightKidney = new G4Ellipsoid("OneRightKidney", ax, by, cz); + + G4double xx = 6. * cm; + G4double yy = 12.00 * cm; + G4double zz = 12.00 * cm; + G4VSolid* subtrRightKidney = new G4Box("SubtrRightKidney", xx / 2., yy / 2., zz / 2.); + + G4SubtractionSolid* kidney = new G4SubtractionSolid("RightKidney", oneRightKidney, subtrRightKidney, 0, + G4ThreeVector(6. * cm, // x0 + 0.0 * cm, 0.0 * cm)); + + G4LogicalVolume* logicRightKidney = new G4LogicalVolume(kidney, soft, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physRightKidney = + new G4PVPlacement(0, + G4ThreeVector(-6. * cm, // xo + 6. * cm, // yo + -2.50 * cm), // zo + "physicalRightKidney", logicRightKidney, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightKidneyVisAtt = new G4VisAttributes(G4Colour(0.72,0.52,0.04)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightKidneyVisAtt = new G4VisAttributes(colour); + RightKidneyVisAtt->SetForceSolid(wireFrame); + logicRightKidney->SetVisAttributes(RightKidneyVisAtt); + + G4cout << "RightKidney created !!!!!!" << G4endl; + + // Testing RightKidney Volume + G4double RightKidneyVol = logicRightKidney->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightKidney = " << RightKidneyVol / cm3 << " cm^3" << G4endl; + + // Testing RightKidney Material + G4String RightKidneyMat = logicRightKidney->GetMaterial()->GetName(); + G4cout << "Material of RightKidney = " << RightKidneyMat << G4endl; + + // Testing Density + G4double RightKidneyDensity = logicRightKidney->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightKidneyDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightKidneyMass = (RightKidneyVol)*RightKidneyDensity; + G4cout << "Mass of RightKidney = " << RightKidneyMass / gram << " g" << G4endl; + + return physRightKidney; +} diff --git a/src/G4MIRDRightLeg.cpp b/src/G4MIRDRightLeg.cpp new file mode 100644 index 0000000..8b38a3f --- /dev/null +++ b/src/G4MIRDRightLeg.cpp @@ -0,0 +1,75 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightLeg.h" + +#include "G4Cons.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightLeg::G4MIRDRightLeg() {} + +G4MIRDRightLeg::~G4MIRDRightLeg() {} + +G4VPhysicalVolume* G4MIRDRightLeg::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + + G4double rmin1 = 0. * cm; + G4double rmin2 = 0. * cm; + G4double dz = 80.0 * cm; + G4double rmax1 = 2.0 * cm; + G4double rmax2 = 10. * cm; + G4double startphi = 0. * degree; + G4double deltaphi = 360. * degree; + + G4Cons* leg1 = new G4Cons("Leg1", rmin1, rmax1, rmin2, rmax2, dz / 2., startphi, deltaphi); + + G4LogicalVolume* logicRightLeg = new G4LogicalVolume(leg1, soft, "logical" + volumeName, 0, 0, 0); + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(180. * degree); + rm->rotateY(180. * degree); + G4VPhysicalVolume* physRightLeg = new G4PVPlacement(rm, + // G4ThreeVector(-10. * cm, 0. * cm, -47. *cm), //FA + G4ThreeVector(-10. * cm, 0. * cm, -40. * cm), + "physicalRightLeg", logicRightLeg, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightLegVisAtt = new G4VisAttributes(G4Colour(0.94,0.5,0.5)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightLegVisAtt = new G4VisAttributes(colour); + RightLegVisAtt->SetForceSolid(wireFrame); + logicRightLeg->SetVisAttributes(RightLegVisAtt); + + G4cout << "RightLeg created !!!!!!" << G4endl; + + // Testing RightLeg Volume + G4double RightLegVol = logicRightLeg->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightLeg = " << RightLegVol / cm3 << " cm^3" << G4endl; + + // Testing RightLeg Material + G4String RightLegMat = logicRightLeg->GetMaterial()->GetName(); + G4cout << "Material of RightLeg = " << RightLegMat << G4endl; + + // Testing Density + G4double RightLegDensity = logicRightLeg->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightLegDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightLegMass = (RightLegVol)*RightLegDensity; + G4cout << "Mass of RightLeg = " << RightLegMass / gram << " g" << G4endl; + + return physRightLeg; +} diff --git a/src/G4MIRDRightLegBone.cpp b/src/G4MIRDRightLegBone.cpp new file mode 100644 index 0000000..9d64070 --- /dev/null +++ b/src/G4MIRDRightLegBone.cpp @@ -0,0 +1,82 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightLegBone.h" + +#include "G4Cons.hh" +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightLegBone::G4MIRDRightLegBone() {} + +G4MIRDRightLegBone::~G4MIRDRightLegBone() {} + +G4VPhysicalVolume* G4MIRDRightLegBone::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + + delete material; + + G4double dz = 79.8 * cm; + G4double rmin1 = 0.0 * cm; + G4double rmin2 = 0.0 * cm; + G4double rmax1 = 1. * cm; + G4double rmax2 = 3.5 * cm; + G4double startphi = 0. * degree; + G4double deltaphi = 360. * degree; + + G4Cons* leg_bone = new G4Cons("OneRightLegBone", rmin1, rmax1, rmin2, rmax2, dz / 2., startphi, deltaphi); + + // G4RotationMatrix* rm_relative = new G4RotationMatrix(); + // rm_relative -> rotateY(-12.5 * degree); + + // G4UnionSolid* legs_bones = new G4UnionSolid("RightLegBone", + // leg_bone, leg_bone, + // 0, + // G4ThreeVector(20.* cm, 0.0,0. * cm)); + + G4LogicalVolume* logicRightLegBone = new G4LogicalVolume(leg_bone, skeleton, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physRightLegBone = new G4PVPlacement( + 0, G4ThreeVector(0.0 * cm, 0.0, 0.1 * cm), "physicalRightLegBone", logicRightLegBone, mother, false, 0, true); + + // Visualization Attributes + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightLegBoneVisAtt = new G4VisAttributes(colour); + + RightLegBoneVisAtt->SetForceSolid(wireFrame); + logicRightLegBone->SetVisAttributes(RightLegBoneVisAtt); + + G4cout << "RightLegBone created !!!!!!" << G4endl; + + // Testing RightLegBone Volume + G4double RightLegBoneVol = logicRightLegBone->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightLegBone = " << RightLegBoneVol / cm3 << " cm^3" << G4endl; + + // Testing RightLegBone Material + G4String RightLegBoneMat = logicRightLegBone->GetMaterial()->GetName(); + G4cout << "Material of RightLegBone = " << RightLegBoneMat << G4endl; + + // Testing Density + G4double RightLegBoneDensity = logicRightLegBone->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightLegBoneDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightLegBoneMass = (RightLegBoneVol)*RightLegBoneDensity; + G4cout << "Mass of RightLegBone = " << RightLegBoneMass / gram << " g" << G4endl; + + return physRightLegBone; +} diff --git a/src/G4MIRDRightLung.cpp b/src/G4MIRDRightLung.cpp new file mode 100644 index 0000000..c227aab --- /dev/null +++ b/src/G4MIRDRightLung.cpp @@ -0,0 +1,97 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightLung.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightLung::G4MIRDRightLung() {} + +G4MIRDRightLung::~G4MIRDRightLung() {} + +G4VPhysicalVolume* G4MIRDRightLung::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* lung_material = material->GetMaterial("lung_material"); + delete material; + + G4double ax = 5. * cm; // a + G4double by = 7.5 * cm; // b + G4double cz = 24. * cm; // c + G4double zcut1 = 0.0 * cm; + G4double zcut2 = 24. * cm; + + G4Ellipsoid* oneLung = new G4Ellipsoid("OneLung", ax, by, cz, zcut1, zcut2); + + ax = 5. * cm; + by = 7.5 * cm; + cz = 24. * cm; + + G4Ellipsoid* subtrLung = new G4Ellipsoid("subtrLung", ax, by, cz); + + // y<0 + + G4double dx = 5.5 * cm; + G4double dy = 8.5 * cm; + G4double dz = 24. * cm; + + G4Box* box = new G4Box("Box", dx, dy, dz); + + G4SubtractionSolid* section = + new G4SubtractionSolid("BoxSub", subtrLung, box, 0, G4ThreeVector(0. * cm, 8.5 * cm, 0. * cm)); + // G4SubtractionSolid* section2 = new G4SubtractionSolid("BoxSub2", subtrLung, box, 0, G4ThreeVector(0.*cm, -8.5* + // cm, 0.*cm)); + + G4SubtractionSolid* lung1 = + new G4SubtractionSolid("Lung1", oneLung, section, 0, G4ThreeVector(6. * cm, 0 * cm, 0.0 * cm)); + + G4LogicalVolume* logicRightLung = new G4LogicalVolume(lung1, lung_material, "logical" + volumeName, 0, 0, 0); + + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateZ(-360. * degree); + G4VPhysicalVolume* physRightLung = new G4PVPlacement(rm, G4ThreeVector(-8.50 * cm, 0.0 * cm, 8.5 * cm), + "physicalRightLung", logicRightLung, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightLungVisAtt = new G4VisAttributes(G4Colour(0.25,0.41,0.88)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightLungVisAtt = new G4VisAttributes(colour); + RightLungVisAtt->SetForceSolid(wireFrame); + logicRightLung->SetVisAttributes(RightLungVisAtt); + + G4cout << "RightLung created !!!!!!" << G4endl; + + // Testing RightLung Volume + G4double RightLungVol = logicRightLung->GetSolid()->GetCubicVolume(); + + G4cout << "Volume of RightLung = " << (RightLungVol) / cm3 << " cm^3" << G4endl; + + // Testing RightLung Material + G4String RightLungMat = logicRightLung->GetMaterial()->GetName(); + G4cout << "Material of RightLung = " << RightLungMat << G4endl; + + // Testing Density + G4double RightLungDensity = logicRightLung->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightLungDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightLungMass = (RightLungVol)*RightLungDensity; + G4cout << "Mass of RightLung = " << RightLungMass / gram << " g" << G4endl; + + return physRightLung; +} diff --git a/src/G4MIRDRightOvary.cpp b/src/G4MIRDRightOvary.cpp new file mode 100644 index 0000000..353f677 --- /dev/null +++ b/src/G4MIRDRightOvary.cpp @@ -0,0 +1,69 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightOvary.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightOvary::G4MIRDRightOvary() {} + +G4MIRDRightOvary::~G4MIRDRightOvary() {} + +G4VPhysicalVolume* G4MIRDRightOvary::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 1. * cm; + G4double by = 0.5 * cm; + G4double cz = 2. * cm; + + G4Ellipsoid* OneOvary = new G4Ellipsoid("OneOvary", ax, by, cz); + + G4LogicalVolume* logicRightOvary = new G4LogicalVolume(OneOvary, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physRightOvary = new G4PVPlacement( + 0, G4ThreeVector(6. * cm, 0.5 * cm, -20 * cm), "physicalRightOvary", logicRightOvary, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightOvaryVisAtt = new G4VisAttributes(G4Colour(0.85,0.44,0.84)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightOvaryVisAtt = new G4VisAttributes(colour); + RightOvaryVisAtt->SetForceSolid(wireFrame); + logicRightOvary->SetVisAttributes(RightOvaryVisAtt); + + G4cout << "RightOvary created !!!!!!" << G4endl; + + // Testing RightOvary Volume + G4double RightOvaryVol = logicRightOvary->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightOvary = " << RightOvaryVol / cm3 << " cm^3" << G4endl; + + // Testing RightOvary Material + G4String RightOvaryMat = logicRightOvary->GetMaterial()->GetName(); + G4cout << "Material of RightOvary = " << RightOvaryMat << G4endl; + + // Testing Density + G4double RightOvaryDensity = logicRightOvary->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightOvaryDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightOvaryMass = (RightOvaryVol)*RightOvaryDensity; + G4cout << "Mass of RightOvary = " << RightOvaryMass / gram << " g" << G4endl; + + return physRightOvary; +} diff --git a/src/G4MIRDRightScapula.cpp b/src/G4MIRDRightScapula.cpp new file mode 100644 index 0000000..cad3535 --- /dev/null +++ b/src/G4MIRDRightScapula.cpp @@ -0,0 +1,93 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightScapula.h" + +#include "G4Box.hh" +#include "G4Cons.hh" +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightScapula::G4MIRDRightScapula() {} + +G4MIRDRightScapula::~G4MIRDRightScapula() {} + +G4VPhysicalVolume* G4MIRDRightScapula::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* skeleton = material->GetMaterial("skeleton"); + + G4double ax_in = 17. * cm; + G4double by_in = 9.8 * cm; + G4double ax_out = 19. * cm; + G4double by_out = 9.8 * cm; + G4double dz = 16.4 * cm; + + G4EllipticalTube* inner_scapula = new G4EllipticalTube("ScapulaIn", ax_in, by_in, (dz + 1. * cm) / 2); + G4EllipticalTube* outer_scapula = new G4EllipticalTube("ScapulaOut", ax_out, by_out, dz / 2); + + G4Box* subtraction = new G4Box("subtraction", ax_out, ax_out, ax_out); + + G4double xx = -ax_out * 0.242; //(sin 14deg) + G4double yy = -ax_out * 0.97; // (cos 14 deg) + + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateZ(14. * degree); + + G4SubtractionSolid* scapula_first = + new G4SubtractionSolid("Scapula_first", outer_scapula, subtraction, rm, G4ThreeVector(xx, yy, 0. * cm)); + + G4double xx2 = ax_out * 0.62470; //(cos 51.34deg) + G4double yy2 = ax_out * 0.78087; // (sin 51.34 deg) + + G4RotationMatrix* rm2 = new G4RotationMatrix(); + rm2->rotateZ(38.6598 * degree); + + G4SubtractionSolid* scapula_bone = + new G4SubtractionSolid("Scapula", scapula_first, subtraction, rm2, G4ThreeVector(xx2, yy2, 0. * cm)); + + G4SubtractionSolid* scapula = new G4SubtractionSolid("Scapula", scapula_bone, inner_scapula); + + G4LogicalVolume* logicRightScapula = new G4LogicalVolume(scapula, skeleton, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physRightScapula = + new G4PVPlacement(0, G4ThreeVector(0. * cm, 0. * cm, 24.1 * cm), "physicalRightScapula", logicRightScapula, + mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightScapulaVisAtt = new G4VisAttributes(G4Colour(0.94,0.5,0.5)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightScapulaVisAtt = new G4VisAttributes(colour); + RightScapulaVisAtt->SetForceSolid(wireFrame); + logicRightScapula->SetVisAttributes(RightScapulaVisAtt); + G4cout << "RightScapula created !!!!!!" << G4endl; + + // Testing RightScapula Volume + G4double RightScapulaVol = logicRightScapula->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightScapula = " << RightScapulaVol / cm3 << " cm^3" << G4endl; + + // Testing RightScapula Material + G4String RightScapulaMat = logicRightScapula->GetMaterial()->GetName(); + G4cout << "Material of RightScapula = " << RightScapulaMat << G4endl; + + // Testing Density + G4double RightScapulaDensity = logicRightScapula->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightScapulaDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightScapulaMass = (RightScapulaVol)*RightScapulaDensity; + G4cout << "Mass of RightScapula = " << RightScapulaMass / gram << " g" << G4endl; + + return physRightScapula; +} diff --git a/src/G4MIRDRightTeste.cpp b/src/G4MIRDRightTeste.cpp new file mode 100644 index 0000000..32df453 --- /dev/null +++ b/src/G4MIRDRightTeste.cpp @@ -0,0 +1,69 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDRightTeste.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDRightTeste::G4MIRDRightTeste() {} + +G4MIRDRightTeste::~G4MIRDRightTeste() {} + +G4VPhysicalVolume* G4MIRDRightTeste::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 1.3 * cm; + G4double by = 1.5 * cm; + G4double cz = 2.3 * cm; + + G4Ellipsoid* OneTeste = new G4Ellipsoid("OneTeste", ax, by, cz); + + G4LogicalVolume* logicRightTeste = new G4LogicalVolume(OneTeste, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physRightTeste = new G4PVPlacement( + 0, G4ThreeVector(-1.4 * cm, 3 * cm, 0 * cm), "physicalRightTeste", logicRightTeste, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* RightTesteVisAtt = new G4VisAttributes(G4Colour(0.85,0.44,0.84)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* RightTesteVisAtt = new G4VisAttributes(colour); + RightTesteVisAtt->SetForceSolid(wireFrame); + logicRightTeste->SetVisAttributes(RightTesteVisAtt); + + G4cout << "RightTeste created !!!!!!" << G4endl; + + // Testing RightTeste Volume + G4double RightTesteVol = logicRightTeste->GetSolid()->GetCubicVolume(); + G4cout << "Volume of RightTeste = " << RightTesteVol / cm3 << " cm^3" << G4endl; + + // Testing RightTeste Material + G4String RightTesteMat = logicRightTeste->GetMaterial()->GetName(); + G4cout << "Material of RightTeste = " << RightTesteMat << G4endl; + + // Testing Density + G4double RightTesteDensity = logicRightTeste->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << RightTesteDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double RightTesteMass = (RightTesteVol)*RightTesteDensity; + G4cout << "Mass of RightTeste = " << RightTesteMass / gram << " g" << G4endl; + + return physRightTeste; +} diff --git a/src/G4MIRDSkull.cpp b/src/G4MIRDSkull.cpp new file mode 100644 index 0000000..8831781 --- /dev/null +++ b/src/G4MIRDSkull.cpp @@ -0,0 +1,84 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDSkull.h" + +#include "G4Box.hh" +#include "G4Ellipsoid.hh" +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VSolid.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDSkull::G4MIRDSkull() {} + +G4MIRDSkull::~G4MIRDSkull() {} + +G4VPhysicalVolume* G4MIRDSkull::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + + delete material; + + // Outer cranium + G4double ax = 6.8 * cm; // a out skull + G4double by = 9.8 * cm; // bout + G4double cz = 8.3 * cm; // cout + + G4Ellipsoid* craniumOut = new G4Ellipsoid("CraniumOut", ax, by, cz); + + ax = 6. * cm; // a in + by = 9. * cm; // b in + cz = 6.5 * cm; // cin + + G4Ellipsoid* craniumIn = new G4Ellipsoid("CraniumIn", ax, by, cz); + + G4SubtractionSolid* cranium = + new G4SubtractionSolid("Cranium", craniumOut, craniumIn, 0, G4ThreeVector(0.0, 0.0, 1. * cm)); + + G4LogicalVolume* logicSkull = new G4LogicalVolume(cranium, skeleton, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physSkull = + new G4PVPlacement(0, G4ThreeVector(0., 0., 7.75 * cm), "physicalSkull", logicSkull, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* SkullVisAtt = new G4VisAttributes(G4Colour(0.46,0.53,0.6)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* SkullVisAtt = new G4VisAttributes(colour); + SkullVisAtt->SetForceSolid(wireFrame); + SkullVisAtt->SetLineWidth(4. * mm); + logicSkull->SetVisAttributes(SkullVisAtt); + + G4cout << "Skull created !!!!!!" << G4endl; + + // Testing Skull Volume + G4double SkullVol = logicSkull->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Skull = " << SkullVol / cm3 << " cm^3" << G4endl; + + // Testing Skull Material + G4String SkullMat = logicSkull->GetMaterial()->GetName(); + G4cout << "Material of Skull = " << SkullMat << G4endl; + + // Testing Density + G4double SkullDensity = logicSkull->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << SkullDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double SkullMass = (SkullVol)*SkullDensity; + G4cout << "Mass of Skull = " << SkullMass / gram << " g" << G4endl; + + return physSkull; +} diff --git a/src/G4MIRDSmallIntestine.cpp b/src/G4MIRDSmallIntestine.cpp new file mode 100644 index 0000000..74fdcb6 --- /dev/null +++ b/src/G4MIRDSmallIntestine.cpp @@ -0,0 +1,129 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDSmallIntestine.h" + +#include "G4Box.hh" +#include "G4EllipticalTube.hh" +#include "G4IntersectionSolid.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4Torus.hh" +#include "G4Tubs.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDSmallIntestine::G4MIRDSmallIntestine() {} + +G4MIRDSmallIntestine::~G4MIRDSmallIntestine() {} + +G4VPhysicalVolume* G4MIRDSmallIntestine::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double boxX = 11. * cm; + G4double boxY = 3.53 * cm; + G4double boxZ = 5 * cm; + + G4Box* smallIntestineBox = new G4Box("smallIntestineBox", boxX, boxY, boxZ); + + G4double tubsRmin = 0 * cm; + G4double tubsRmax = 11. * cm; + G4double tubsZ = 5 * cm; + G4double tubsSphi = 0 * degree; + G4double tubsDphi = 360 * degree; + + G4Tubs* smallIntestineTubs = new G4Tubs("smallIntestineTubs", tubsRmin, tubsRmax, tubsZ, tubsSphi, tubsDphi); + + // G4IntersectionSolid* SmallIntestine = new + // G4IntersectionSolid("SmallIntestine",smallIntestineTubs,smallIntestineBox, + G4IntersectionSolid* filledSmallIntestine1 = new G4IntersectionSolid( + "filledSmallIntestine1", smallIntestineTubs, smallIntestineBox, 0, G4ThreeVector(0 * cm, -1.33 * cm, 0 * cm)); + + G4IntersectionSolid* filledSmallIntestine = new G4IntersectionSolid( + "filledSmallIntestine", filledSmallIntestine1, smallIntestineTubs, 0, G4ThreeVector(0 * cm, 0.8 * cm, 0 * cm)); + + G4double dx = 2.50 * cm; // aU + G4double dy = 2.50 * cm; // bU + G4double dz = 4.775 * cm; // dzU + + G4VSolid* AscendingColonUpperLargeIntestine = new G4EllipticalTube("AscendingColon", dx, dy, dz); + + dx = 2.50 * cm; // bt + dy = 1.50 * cm; // ct + dz = 10.50 * cm; // x1t + + G4VSolid* TraverseColonUpperLargeIntestine = new G4EllipticalTube("TraverseColon", dx, dy, dz); + + G4RotationMatrix* relative_rm = new G4RotationMatrix(); + relative_rm->rotateX(90. * degree); + // relative_rm -> rotateZ(180. * degree); + relative_rm->rotateY(90. * degree); + G4UnionSolid* upperLargeIntestine = + new G4UnionSolid("UpperLargeIntestine", AscendingColonUpperLargeIntestine, TraverseColonUpperLargeIntestine, + relative_rm, G4ThreeVector(-8.0 * cm, 0.0 * cm, 6.275 * cm)); //,0,dzU + ct transverse + + dx = 1.88 * cm; // a + dy = 2.13 * cm; // b + dz = 7.64 * cm; //(z1-z2)/2 + + G4EllipticalTube* DescendingColonLowerLargeIntestine = new G4EllipticalTube("DiscendingColon", dx, dy, dz); + + G4UnionSolid* upperlowerLargeIntestine = + new G4UnionSolid("UpperLowerLargeIntestine", upperLargeIntestine, DescendingColonLowerLargeIntestine, 0, + G4ThreeVector(-16.72 * cm, 0.0 * cm, -2.865 * cm)); //,0,dzU + ct t + + G4SubtractionSolid* SmallIntestine = + new G4SubtractionSolid("SmallIntestine", filledSmallIntestine, upperlowerLargeIntestine, 0, + G4ThreeVector(8.0 * cm, -0.3 * cm, -2.775 * cm)); + + G4LogicalVolume* logicSmallIntestine = new G4LogicalVolume(SmallIntestine, soft, "logical" + volumeName, 0, 0, 0); + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(180. * degree); + rm->rotateY(180. * degree); + G4VPhysicalVolume* physSmallIntestine = + new G4PVPlacement(rm, + G4ThreeVector(0 * cm, -2.66 * cm, + -13 * cm), // Xcheck the spina position the correct placement shuod be this one + // G4ThreeVector(0*cm, -5.13*cm, -13*cm), // Xcheck the spina position the correct placement + // shuod be this one G4ThreeVector(0*cm, -6*cm, -13*cm), + "physical" + volumeName, logicSmallIntestine, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* SmallIntestineVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* SmallIntestineVisAtt = new G4VisAttributes(colour); + SmallIntestineVisAtt->SetForceSolid(wireFrame); + logicSmallIntestine->SetVisAttributes(SmallIntestineVisAtt); + + G4cout << "SmallIntestine created !!!!!!" << G4endl; + + // Testing SmallIntestine Volume + G4double SmallIntestineVol = logicSmallIntestine->GetSolid()->GetCubicVolume(); + G4cout << "Volume of SmallIntestine = " << SmallIntestineVol / cm3 << " cm^3" << G4endl; + + // Testing SmallIntestine Material + G4String SmallIntestineMat = logicSmallIntestine->GetMaterial()->GetName(); + G4cout << "Material of SmallIntestine = " << SmallIntestineMat << G4endl; + + // Testing Density + G4double SmallIntestineDensity = logicSmallIntestine->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << SmallIntestineDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double SmallIntestineMass = (SmallIntestineVol)*SmallIntestineDensity; + G4cout << "Mass of SmallIntestine = " << SmallIntestineMass / gram << " g" << G4endl; + + return physSmallIntestine; +} diff --git a/src/G4MIRDSpleen.cpp b/src/G4MIRDSpleen.cpp new file mode 100644 index 0000000..0839eac --- /dev/null +++ b/src/G4MIRDSpleen.cpp @@ -0,0 +1,69 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDSpleen.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDSpleen::G4MIRDSpleen() {} + +G4MIRDSpleen::~G4MIRDSpleen() {} + +G4VPhysicalVolume* G4MIRDSpleen::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 3.5 * cm; + G4double by = 2. * cm; + G4double cz = 6. * cm; + + G4Ellipsoid* spleen = new G4Ellipsoid("spleen", ax, by, cz); + + G4LogicalVolume* logicSpleen = new G4LogicalVolume(spleen, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physSpleen = + new G4PVPlacement(0, G4ThreeVector(11. * cm, 3. * cm, 2. * cm), // ztrans = half trunk lenght - z0 + "physicalSpleen", logicSpleen, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* SpleenVisAtt = new G4VisAttributes(G4Colour(0.41,0.41,0.41)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* SpleenVisAtt = new G4VisAttributes(colour); + SpleenVisAtt->SetForceSolid(wireFrame); + logicSpleen->SetVisAttributes(SpleenVisAtt); + + G4cout << "Spleen created !!!!!!" << G4endl; + + // Testing Spleen Volume + G4double SpleenVol = logicSpleen->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Spleen = " << SpleenVol / cm3 << " cm^3" << G4endl; + + // Testing Spleen Material + G4String SpleenMat = logicSpleen->GetMaterial()->GetName(); + G4cout << "Material of Spleen = " << SpleenMat << G4endl; + + // Testing Density + G4double SpleenDensity = logicSpleen->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << SpleenDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double SpleenMass = (SpleenVol)*SpleenDensity; + G4cout << "Mass of Spleen = " << SpleenMass / gram << " g" << G4endl; + + return physSpleen; +} diff --git a/src/G4MIRDStomach.cpp b/src/G4MIRDStomach.cpp new file mode 100644 index 0000000..ef4f07f --- /dev/null +++ b/src/G4MIRDStomach.cpp @@ -0,0 +1,81 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDStomach.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDStomach::G4MIRDStomach() {} + +G4MIRDStomach::~G4MIRDStomach() {} + +G4VPhysicalVolume* G4MIRDStomach::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 4. * cm; + G4double by = 3. * cm; + G4double cz = 8. * cm; + // G4double zcut1 = -8. * cm; + // G4double zcut2 = 8* cm; + + G4Ellipsoid* stomach_out = new G4Ellipsoid("stomach_out", ax, by, cz); + // zcut1, zcut2); + /* + ax = 3.387 * cm; + by = 2.387 * cm; + cz = 7.387 * cm; + zcut1 = - 7.387 *cm; + zcut2 = 7.387 *cm; + + G4Ellipsoid* cavity = new G4Ellipsoid ("cavity", ax, by, cz, zcut1, zcut2); + + G4SubtractionSolid* stomach = new G4SubtractionSolid("stomach",stomach_out, cavity); + */ + G4LogicalVolume* logicStomach = new G4LogicalVolume(stomach_out, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physStomach = new G4PVPlacement(0, G4ThreeVector(8. * cm, -4. * cm, 0), "physicalStomach", + logicStomach, mother, false, 0, true); + + // Visualization Attributes + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + + G4VisAttributes* StomachVisAtt = new G4VisAttributes(colour); + StomachVisAtt->SetForceSolid(wireFrame); + logicStomach->SetVisAttributes(StomachVisAtt); + + G4cout << "Stomach created !!!!!!" << G4endl; + + // Testing Stomach Volume + G4double StomachVol = logicStomach->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Stomach = " << StomachVol / cm3 << " cm^3" << G4endl; + + // Testing Stomach Material + G4String StomachMat = logicStomach->GetMaterial()->GetName(); + G4cout << "Material of Stomach = " << StomachMat << G4endl; + + // Testing Density + G4double StomachDensity = logicStomach->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << StomachDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double StomachMass = (StomachVol)*StomachDensity; + G4cout << "Mass of Stomach = " << StomachMass / gram << " g" << G4endl; + + return physStomach; +} diff --git a/src/G4MIRDThymus.cpp b/src/G4MIRDThymus.cpp new file mode 100644 index 0000000..bc5ff31 --- /dev/null +++ b/src/G4MIRDThymus.cpp @@ -0,0 +1,69 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDThymus.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDThymus::G4MIRDThymus() {} + +G4MIRDThymus::~G4MIRDThymus() {} + +G4VPhysicalVolume* G4MIRDThymus::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 3. * cm; + G4double by = 0.5 * cm; + G4double cz = 4. * cm; + + G4Ellipsoid* Thymus = new G4Ellipsoid("Thymus", ax, by, cz); + + G4LogicalVolume* logicThymus = new G4LogicalVolume(Thymus, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physThymus = new G4PVPlacement(0, G4ThreeVector(2. * cm, -6. * cm, 25.5 * cm), "physicalThymus", + logicThymus, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* ThymusVisAtt = new G4VisAttributes(G4Colour(0.85,0.44,0.84)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* ThymusVisAtt = new G4VisAttributes(colour); + ThymusVisAtt->SetForceSolid(wireFrame); + logicThymus->SetVisAttributes(ThymusVisAtt); + + G4cout << "Thymus created !!!!!!" << G4endl; + + // Testing Thymus Volume + G4double ThymusVol = logicThymus->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Thymus = " << ThymusVol / cm3 << " cm^3" << G4endl; + + // Testing Thymus Material + G4String ThymusMat = logicThymus->GetMaterial()->GetName(); + G4cout << "Material of Thymus = " << ThymusMat << G4endl; + + // Testing Density + G4double ThymusDensity = logicThymus->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << ThymusDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double ThymusMass = (ThymusVol)*ThymusDensity; + G4cout << "Mass of Thymus = " << ThymusMass / gram << " g" << G4endl; + + return physThymus; +} diff --git a/src/G4MIRDThyroid.cpp b/src/G4MIRDThyroid.cpp new file mode 100644 index 0000000..b894faa --- /dev/null +++ b/src/G4MIRDThyroid.cpp @@ -0,0 +1,99 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDThyroid.h" + +#include "G4Box.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4Tubs.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VSolid.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDThyroid::G4MIRDThyroid() {} + +G4MIRDThyroid::~G4MIRDThyroid() {} + +G4VPhysicalVolume* G4MIRDThyroid::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double z = 4.20 * cm; // c thickness = c, + G4double rmin = 0. * cm; + G4double rmax = 1.85 * cm; // Rmax + G4double startphi = 0. * degree; + G4double deltaphi = 180. * degree; // y< y0 + + G4Tubs* LobOfThyroidOut = new G4Tubs("LobOfThyroidOut", rmin, rmax, z / 2., startphi, deltaphi); + + z = 4.50 * cm; // c thickness + something + rmax = 0.83 * cm; // r + deltaphi = 360. * degree; + G4Tubs* LobOfThyroidIn = new G4Tubs("LobOfThyroidIn", rmin, rmax, z / 2., startphi, deltaphi); + + G4double xx = 3.72 * cm; + G4double yy = 3.72 * cm; + G4double zz = 20.00 * cm; + G4Box* SubtrThyroid = new G4Box("SubtrThyroid", xx / 2., yy / 2., zz / 2.); + + // subtraction of the two tubs + G4SubtractionSolid* FirstThyroid = new G4SubtractionSolid("FirstThyroid", LobOfThyroidOut, LobOfThyroidIn); + + G4RotationMatrix* relative_matrix = new G4RotationMatrix(); + relative_matrix->rotateX(-50. * degree); + + G4SubtractionSolid* SecondThyroid = new G4SubtractionSolid( + "SecondThyroid", FirstThyroid, SubtrThyroid, relative_matrix, G4ThreeVector(0.0 * cm, 0.0 * cm, 4.20 * cm)); + + G4RotationMatrix* relative_matrix_2 = new G4RotationMatrix(); + relative_matrix_2->rotateX(50. * degree); + + G4SubtractionSolid* thyroid = new G4SubtractionSolid( + "SecondThyroid", SecondThyroid, SubtrThyroid, relative_matrix_2, G4ThreeVector(0.0 * cm, 0.0 * cm, -5.40 * cm)); + + G4LogicalVolume* logicThyroid = new G4LogicalVolume(thyroid, soft, "ThyroidVolume", 0, 0, 0); + + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateZ(180. * degree); + G4VPhysicalVolume* physThyroid = new G4PVPlacement( + rm, + // G4ThreeVector(0.0*cm,-3.91*cm, -5.925*cm),//y0 + G4ThreeVector(0.0 * cm, -3.91 * cm, -5.65 * cm), // y0 + "physicalThyroid", logicThyroid, mother, false, 0, true); + + // Visualization Attributes + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* ThyroidVisAtt = new G4VisAttributes(colour); + ThyroidVisAtt->SetForceSolid(wireFrame); + logicThyroid->SetVisAttributes(ThyroidVisAtt); + + G4cout << "Thyroid created !!!!!!" << G4endl; + + // Testing Thyroid Volume + G4double ThyroidVol = logicThyroid->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Thyroid = " << ThyroidVol / cm3 << " cm^3" << G4endl; + + // Testing Thyroid Material + G4String ThyroidMat = logicThyroid->GetMaterial()->GetName(); + G4cout << "Material of Thyroid = " << ThyroidMat << G4endl; + + // Testing Density + G4double ThyroidDensity = logicThyroid->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << ThyroidDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double ThyroidMass = (ThyroidVol)*ThyroidDensity; + G4cout << "Mass of Thyroid = " << ThyroidMass / gram << " g" << G4endl; + + return physThyroid; +} diff --git a/src/G4MIRDTrunk.cpp b/src/G4MIRDTrunk.cpp new file mode 100644 index 0000000..0a1fc9a --- /dev/null +++ b/src/G4MIRDTrunk.cpp @@ -0,0 +1,73 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDTrunk.h" + +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDTrunk::G4MIRDTrunk() {} + +G4MIRDTrunk::~G4MIRDTrunk() {} + +G4VPhysicalVolume* G4MIRDTrunk::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* soft = material->GetMaterial("soft_tissue"); + + delete material; + + // MIRD Male trunk + + G4double dx = 20. * cm; + G4double dy = 10. * cm; + G4double dz = 35. * cm; + + G4EllipticalTube* trunk = new G4EllipticalTube("Trunk", dx, dy, dz); + + G4LogicalVolume* logicTrunk = new G4LogicalVolume(trunk, soft, "logical" + volumeName, 0, 0, 0); + // Define rotation and position here! + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(180. * degree); + rm->rotateY(180. * degree); + G4VPhysicalVolume* physTrunk = new G4PVPlacement(rm, + // G4ThreeVector(0.* cm, 0. *cm, 28.*cm), //FA + G4ThreeVector(0. * cm, 0. * cm, 35. * cm), "physicalTrunk", + logicTrunk, mother, false, 0, true); + + // Visualization Attributes + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* TrunkVisAtt = new G4VisAttributes(colour); + TrunkVisAtt->SetForceSolid(wireFrame); + logicTrunk->SetVisAttributes(TrunkVisAtt); + + G4cout << "Trunk created !!!!!!" << G4endl; + + // Testing Trunk Volume + G4double TrunkVol = logicTrunk->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Trunk = " << TrunkVol / cm3 << " cm^3" << G4endl; + + // Testing Trunk Material + G4String TrunkMat = logicTrunk->GetMaterial()->GetName(); + G4cout << "Material of Trunk = " << TrunkMat << G4endl; + + // Testing Density + G4double TrunkDensity = logicTrunk->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << TrunkDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double TrunkMass = (TrunkVol)*TrunkDensity; + G4cout << "Mass of Trunk = " << TrunkMass / gram << " g" << G4endl; + + return physTrunk; +} diff --git a/src/G4MIRDUpperLargeIntestine.cpp b/src/G4MIRDUpperLargeIntestine.cpp new file mode 100644 index 0000000..8c49dd5 --- /dev/null +++ b/src/G4MIRDUpperLargeIntestine.cpp @@ -0,0 +1,84 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDUpperLargeIntestine.h" + +#include "G4EllipticalTube.hh" +#include "G4LogicalVolume.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4UnionSolid.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDUpperLargeIntestine::G4MIRDUpperLargeIntestine() {} + +G4MIRDUpperLargeIntestine::~G4MIRDUpperLargeIntestine() {} + +G4VPhysicalVolume* G4MIRDUpperLargeIntestine::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double dx = 2.5 * cm; // aU + G4double dy = 2.5 * cm; // bU + G4double dz = 4.775 * cm; // dzU + + G4VSolid* AscendingColonUpperLargeIntestine = new G4EllipticalTube("AscendingColon", dx, dy, dz); + + dx = 2.5 * cm; // bt + dy = 1.5 * cm; // ct + dz = 10.5 * cm; // x1t + + G4VSolid* TraverseColonUpperLargeIntestine = new G4EllipticalTube("TraverseColon", dx, dy, dz); + + G4RotationMatrix* relative_rm = new G4RotationMatrix(); + relative_rm->rotateX(90. * degree); + relative_rm->rotateZ(0. * degree); + relative_rm->rotateY(90. * degree); + G4UnionSolid* upperLargeIntestine = + new G4UnionSolid("UpperLargeIntestine", AscendingColonUpperLargeIntestine, TraverseColonUpperLargeIntestine, + relative_rm, G4ThreeVector(8.0 * cm, 0.0, 6.275 * cm)); //,0,dzU + ct transverse + + G4LogicalVolume* logicUpperLargeIntestine = + new G4LogicalVolume(upperLargeIntestine, soft, "logical" + volumeName, 0, 0, 0); + + G4VPhysicalVolume* physUpperLargeIntestine = + new G4PVPlacement(0, G4ThreeVector(-8.0 * cm, -2.36 * cm, -15.775 * cm), + "physicalUpperLargeIntestine", // xo, yo, zo ascending colon + logicUpperLargeIntestine, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* UpperLargeIntestineVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* UpperLargeIntestineVisAtt = new G4VisAttributes(colour); + UpperLargeIntestineVisAtt->SetForceSolid(wireFrame); + logicUpperLargeIntestine->SetVisAttributes(UpperLargeIntestineVisAtt); + + G4cout << "UpperLargeIntestine created !!!!!!" << G4endl; + + // Testing UpperLargeIntestine Volume + G4double UpperLargeIntestineVol = logicUpperLargeIntestine->GetSolid()->GetCubicVolume(); + G4cout << "Volume of UpperLargeIntestine = " << UpperLargeIntestineVol / cm3 << " cm^3" << G4endl; + + // Testing UpperLargeIntestine Material + G4String UpperLargeIntestineMat = logicUpperLargeIntestine->GetMaterial()->GetName(); + G4cout << "Material of UpperLargeIntestine = " << UpperLargeIntestineMat << G4endl; + + // Testing Density + G4double UpperLargeIntestineDensity = logicUpperLargeIntestine->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << UpperLargeIntestineDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double UpperLargeIntestineMass = (UpperLargeIntestineVol)*UpperLargeIntestineDensity; + G4cout << "Mass of UpperLargeIntestine = " << UpperLargeIntestineMass / gram << " g" << G4endl; + + return physUpperLargeIntestine; +} diff --git a/src/G4MIRDUpperSpine.cpp b/src/G4MIRDUpperSpine.cpp new file mode 100644 index 0000000..2aad135 --- /dev/null +++ b/src/G4MIRDUpperSpine.cpp @@ -0,0 +1,82 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDUpperSpine.h" + +#include "G4Box.hh" +#include "G4EllipticalTube.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDUpperSpine::G4MIRDUpperSpine() {} + +G4MIRDUpperSpine::~G4MIRDUpperSpine() {} + +G4VPhysicalVolume* G4MIRDUpperSpine::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4Material* skeleton = material->GetMaterial("skeleton"); + + delete material; + + G4double dx = 2. * cm; + G4double dy = 2.5 * cm; + G4double dz = 4.25 * cm; + + G4EllipticalTube* upperSpine = new G4EllipticalTube("UpperSpine", dx, dy, dz); + + G4double xx = 20. * cm; + G4double yy = 10. * cm; + G4double zz = 5. * cm; + + G4Box* subtraction = new G4Box("box", xx / 2., yy / 2., zz / 2.); + + G4RotationMatrix* matrix = new G4RotationMatrix(); + matrix->rotateX(-25. * deg); + + G4SubtractionSolid* upper_spine = + new G4SubtractionSolid("upperspine", upperSpine, subtraction, matrix, G4ThreeVector(0., -2.5 * cm, 5.5 * cm)); + + G4LogicalVolume* logicUpperSpine = new G4LogicalVolume(upper_spine, skeleton, "logical" + volumeName, 0, 0, 0); + // Define rotation and position here! + G4VPhysicalVolume* physUpperSpine = new G4PVPlacement( + 0, G4ThreeVector(0.0, 5.5 * cm, -3.5 * cm), "physicalUpperSpine", logicUpperSpine, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* UpperSpineVisAtt = new G4VisAttributes(G4Colour(0.46,0.53,0.6)); + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* UpperSpineVisAtt = new G4VisAttributes(colour); + + UpperSpineVisAtt->SetForceSolid(wireFrame); + logicUpperSpine->SetVisAttributes(UpperSpineVisAtt); + + G4cout << "UpperSpine created !!!!!!" << G4endl; + + // Testing UpperSpine Volume + G4double UpperSpineVol = logicUpperSpine->GetSolid()->GetCubicVolume(); + G4cout << "Volume of UpperSpine = " << UpperSpineVol / cm3 << " cm^3" << G4endl; + + // Testing UpperSpine Material + G4String UpperSpineMat = logicUpperSpine->GetMaterial()->GetName(); + G4cout << "Material of UpperSpine = " << UpperSpineMat << G4endl; + + // Testing Density + G4double UpperSpineDensity = logicUpperSpine->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << UpperSpineDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double UpperSpineMass = (UpperSpineVol)*UpperSpineDensity; + G4cout << "Mass of UpperSpine = " << UpperSpineMass / gram << " g" << G4endl; + + return physUpperSpine; +} diff --git a/src/G4MIRDUrinaryBladder.cpp b/src/G4MIRDUrinaryBladder.cpp new file mode 100644 index 0000000..ac15034 --- /dev/null +++ b/src/G4MIRDUrinaryBladder.cpp @@ -0,0 +1,76 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDUrinaryBladder.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4SDManager.hh" +#include "G4SubtractionSolid.hh" +#include "G4SystemOfUnits.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDUrinaryBladder::G4MIRDUrinaryBladder() {} + +G4MIRDUrinaryBladder::~G4MIRDUrinaryBladder() {} + +G4VPhysicalVolume* G4MIRDUrinaryBladder::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 4.958 * cm; + G4double by = 3.458 * cm; + G4double cz = 3.458 * cm; + + G4Ellipsoid* bladder = new G4Ellipsoid("bladder_out", ax, by, cz); + + ax = 4.706 * cm; + by = 3.206 * cm; + cz = 3.206 * cm; + G4Ellipsoid* inner = new G4Ellipsoid("innerBladder", ax, by, cz); + + G4SubtractionSolid* totalBladder = new G4SubtractionSolid("bladder", bladder, inner); + + G4LogicalVolume* logicUrinaryBladder = new G4LogicalVolume(totalBladder, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4VPhysicalVolume* physUrinaryBladder = + new G4PVPlacement(0, G4ThreeVector(0 * cm, -4.5 * cm, -27. * cm), "physicalUrinaryBladder", logicUrinaryBladder, + mother, false, 0, true); + + // Visualization Attributes + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* UrinaryBladderVisAtt = new G4VisAttributes(colour); + // G4VisAttributes* UrinaryBladderVisAtt = new G4VisAttributes(G4Colour(0.85,0.65,0.125)); + + UrinaryBladderVisAtt->SetForceSolid(wireFrame); + logicUrinaryBladder->SetVisAttributes(UrinaryBladderVisAtt); + + G4cout << "UrinaryBladder created !!!!!!" << G4endl; + + // Testing UrinaryBladder Volume + G4double UrinaryBladderVol = logicUrinaryBladder->GetSolid()->GetCubicVolume(); + G4cout << "Volume of UrinaryBladder = " << UrinaryBladderVol / cm3 << " cm^3" << G4endl; + + // Testing UrinaryBladder Material + G4String UrinaryBladderMat = logicUrinaryBladder->GetMaterial()->GetName(); + G4cout << "Material of UrinaryBladder = " << UrinaryBladderMat << G4endl; + + // Testing Density + G4double UrinaryBladderDensity = logicUrinaryBladder->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << UrinaryBladderDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double UrinaryBladderMass = (UrinaryBladderVol)*UrinaryBladderDensity; + G4cout << "Mass of UrinaryBladder = " << UrinaryBladderMass / gram << " g" << G4endl; + + return physUrinaryBladder; +} diff --git a/src/G4MIRDUterus.cpp b/src/G4MIRDUterus.cpp new file mode 100644 index 0000000..5dd3309 --- /dev/null +++ b/src/G4MIRDUterus.cpp @@ -0,0 +1,75 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4MIRDUterus.h" + +#include "G4Ellipsoid.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4MIRDUterus::G4MIRDUterus() {} + +G4MIRDUterus::~G4MIRDUterus() {} + +G4VPhysicalVolume* G4MIRDUterus::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) { + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* soft = material->GetMaterial("soft_tissue"); + delete material; + + G4double ax = 2.5 * cm; // a + G4double by = 1.5 * cm; // c + G4double cz = 5. * cm; // b + + G4double zcut1 = -5. * cm; //-b + G4double zcut2 = 2.5 * cm; // y1-y0 + + G4Ellipsoid* uterus = new G4Ellipsoid("Uterus", ax, by, cz, zcut1, zcut2); + + G4LogicalVolume* logicUterus = new G4LogicalVolume(uterus, soft, "logical" + volumeName, 0, 0, 0); + + // Define rotation and position here! + G4RotationMatrix* rm = new G4RotationMatrix(); + rm->rotateX(90. * degree); + G4VPhysicalVolume* physUterus = new G4PVPlacement(rm, G4ThreeVector(0. * cm, 2 * cm, -21 * cm), + "physicalUterus", // y0 + logicUterus, mother, false, 0, true); + + // Visualization Attributes + // G4VisAttributes* UterusVisAtt = new G4VisAttributes(G4Colour(0.85,0.44,0.84)); + + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + G4VisAttributes* UterusVisAtt = new G4VisAttributes(colour); + UterusVisAtt->SetForceSolid(wireFrame); + logicUterus->SetVisAttributes(UterusVisAtt); + + G4cout << "Uterus created !!!!!!" << G4endl; + + // Testing Uterus Volume + G4double UterusVol = logicUterus->GetSolid()->GetCubicVolume(); + G4cout << "Volume of Uterus = " << UterusVol / cm3 << " cm^3" << G4endl; + + // Testing Uterus Material + G4String UterusMat = logicUterus->GetMaterial()->GetName(); + G4cout << "Material of Uterus = " << UterusMat << G4endl; + + // Testing Density + G4double UterusDensity = logicUterus->GetMaterial()->GetDensity(); + G4cout << "Density of Material = " << UterusDensity * cm3 / g << " g/cm^3" << G4endl; + + // Testing Mass + G4double UterusMass = (UterusVol)*UterusDensity; + G4cout << "Mass of Uterus = " << UterusMass / gram << " g" << G4endl; + + return physUterus; +} diff --git a/src/G4MaleBuilder.cpp b/src/G4MaleBuilder.cpp new file mode 100644 index 0000000..5da788d --- /dev/null +++ b/src/G4MaleBuilder.cpp @@ -0,0 +1,39 @@ +#include "G4MaleBuilder.h" +#include "G4VBodyFactory.h" + +G4MaleBuilder::G4MaleBuilder() {} + +G4MaleBuilder::~G4MaleBuilder() { delete body; } + +void G4MaleBuilder::BuildMaleGenitalia(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (motherVolume == 0) + G4Exception("G4PhantomBuilder::BuildMaleGenitalia()", "human_phantom0048", FatalException, + "The world volume is missing !!!!!"); + + G4cout << "MotherVolume: " << motherVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + + maleGenitaliaVolume = body->CreateOrgan("MaleGenitalia", motherVolume, colourName, solidVis, sensitivity); +} + +void G4MaleBuilder::BuildLeftTeste(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (maleGenitaliaVolume == 0) + G4Exception("G4FemaleBuilder::BuildLeftTeste()", "human_phantom0049", FatalException, + "The maleGenitaliaVolume volume is missing !!!!!"); + + G4cout << "MotherVolume: " << motherVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + + body->CreateOrgan("LeftTeste", maleGenitaliaVolume, colourName, solidVis, sensitivity); +} + +void G4MaleBuilder::BuildRightTeste(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (maleGenitaliaVolume == 0) + G4Exception("G4FemaleBuilder::BuildRightTeste()", "human_phantom0050", FatalException, + "The maleGenitaliaVolume volume is missing !!!!!"); + + G4cout << "MotherVolume: " << motherVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + + body->CreateOrgan("RightTeste", maleGenitaliaVolume, colourName, solidVis, sensitivity); +} diff --git a/src/G4PhantomBuilder.cpp b/src/G4PhantomBuilder.cpp new file mode 100644 index 0000000..1e3814b --- /dev/null +++ b/src/G4PhantomBuilder.cpp @@ -0,0 +1,339 @@ +#include "G4MIRDBodyFactory.h" +#include "G4PhantomBuilder.h" +#include "G4VBodyFactory.h" + +#include "G4Box.hh" +#include "G4Colour.hh" +#include "G4Element.hh" +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4RunManager.hh" +#include "G4VisAttributes.hh" + +G4PhantomBuilder::G4PhantomBuilder() : model("MIRD") { + // sex can be "female" or "male" + body = 0; + motherVolume = 0; + headVolume = 0; + trunkVolume = 0; + leftLegVolume = 0; + rightLegVolume = 0; + maleGenitaliaVolume = 0; +} + +G4PhantomBuilder::~G4PhantomBuilder() {} +void G4PhantomBuilder::BuildTrunk(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (motherVolume == 0) + G4Exception("G4PhantomBuilder::BuildTrunk()", "human_phantom0014", FatalException, + "The world volume is missing !!!!!"); + + G4cout << "MotherVolume: " << motherVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + trunkVolume = body->CreateOrgan("Trunk", motherVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLeftLeg(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (motherVolume == 0) + G4Exception("G4PhantomBuilder::BuildLeftLeg()", "human_phantom0015", FatalException, + "The world volume is missing !!!!!"); + + G4cout << "MotherVolume: " << motherVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + leftLegVolume = body->CreateOrgan("LeftLeg", motherVolume, colourName, solidVis, sensitivity); +} +void G4PhantomBuilder::BuildRightLeg(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (motherVolume == 0) + G4Exception("G4PhantomBuilder::BuildRightLeg()", "human_phantom0016", FatalException, + "The world volume is missing !!!!!"); + + G4cout << "MotherVolume: " << motherVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + rightLegVolume = body->CreateOrgan("RightLeg", motherVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLeftLegBone(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (leftLegVolume == 0) + G4Exception("G4PhantomBuilder::BuildLeftLegBone()", "human_phantom0017", FatalException, + "The left leg volume is missing !!!!!"); + + G4cout << "MotherVolume: " << leftLegVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("LeftLegBone", leftLegVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildRightLegBone(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildRightLegBone()", "human_phantom0018", FatalException, + "The right leg volume is missing !!!!!"); + + G4cout << "MotherVolume: " << rightLegVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("RightLegBone", rightLegVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLeftArmBone(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildLeftArmBone()", "human_phantom0019", FatalException, + "The world volume is missing !!!!!"); + + G4cout << "MotherVolume: " << trunkVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("LeftArmBone", trunkVolume, colourName, solidVis, sensitivity); +} +void G4PhantomBuilder::BuildRightArmBone(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildRightArmBone()", "human_phantom0020", FatalException, + "The trunk volume is missing !!!!!"); + + G4cout << "MotherVolume: " << trunkVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("RightArmBone", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLeftScapula(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildLeftScapula()", "human_phantom0021", FatalException, + "The trunk volume is missing !!!!!"); + + G4cout << "MotherVolume: " << trunkVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("LeftScapula", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildRightScapula(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildRightScapula()", "human_phantom0022", FatalException, + "The trunk volume is missing !!!!!"); + + G4cout << "MotherVolume: " << trunkVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("RightScapula", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLeftClavicle(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildLeftClavicle()", "human_phantom0023", FatalException, + "The trunk volume is missing !!!!!"); + + G4cout << "MotherVolume: " << trunkVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("LeftClavicle", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildRightClavicle(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildRightClavicle()", "human_phantom0024", FatalException, + "The trunk volume is missing !!!!!"); + + G4cout << "MotherVolume: " << trunkVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("RightClavicle", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildHead(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (motherVolume == 0) + G4Exception("G4PhantomBuilder::BuildHead()", "human_phantom0025", FatalException, + "The mother volume is missing !!!!!"); + + G4cout << "MotherVolume: " << motherVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + headVolume = body->CreateOrgan("Head", motherVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildSkull(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (headVolume == 0) + G4Exception("G4PhantomBuilder::BuildSkull()", "human_phantom0026", FatalException, + "The head volume is missing !!!!!"); + + G4cout << "MotherVolume: " << headVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("Skull", headVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildUpperSpine(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (headVolume == 0) + G4Exception("G4PhantomBuilder::BuildUpperSpine()", "human_phantom0027", FatalException, + "The head volume is missing !!!!!"); + + G4cout << "MotherVolume: " << headVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("UpperSpine", headVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildMiddleLowerSpine(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildMiddleLowerSpine()", "human_phantom0028", FatalException, + "The trunk volume is missing !!!!!"); + + G4cout << "MotherVolume: " << trunkVolume->GetName() << G4endl; + G4cout << "sensitivity : " << sensitivity << G4endl; + body->CreateOrgan("MiddleLowerSpine", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildPelvis(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildPelvis()", "human_phantom0029", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Pelvis", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildBrain(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (headVolume == 0) + G4Exception("G4PhantomBuilder::BuildBrain()", "human_phantom0030", FatalException, + "The head volume is missing !!!!!"); + + body->CreateOrgan("Brain", headVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildHeart(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildHeart()", "human_phantom0031", FatalException, + "The trunk volume is missing !!!!!"); + body->CreateOrgan("Heart", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLeftLung(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildLeftLung()", "human_phantom0032", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("LeftLung", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildRightLung(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildRightLung()", "human_phantom0033", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("RightLung", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildStomach(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildStomach()", "human_phantom0034", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Stomach", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildRibCage(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildRibCage()", "human_phantom0035", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("RibCage", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildSpleen(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildSpleen()", "human_phantom0036", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Spleen", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildUpperLargeIntestine(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildUpperLargeIntestine()", "human_phantom0037", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("UpperLargeIntestine", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLowerLargeIntestine(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildLowerLargeIntestine()", "human_phantom0038", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("LowerLargeIntestine", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildSmallIntestine(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildSamllIntestine()", "human_phantom0039", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("SmallIntestine", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLeftKidney(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildLeftKidney()", "human_phantom0040", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("LeftKidney", trunkVolume, colourName, solidVis, sensitivity); +} +void G4PhantomBuilder::BuildRightKidney(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildRightKidney()", "human_phantom0041", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("RightKidney", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLeftAdrenal(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildLeftAdrenal()", "human_phantom0042", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("LeftAdrenal", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildRightAdrenal(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildRightAdrenal()", "human_phantom0043", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("RightAdrenal", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildLiver(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildLiver()", "human_phantom0044", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Liver", trunkVolume, colourName, solidVis, sensitivity); +} +void G4PhantomBuilder::BuildPancreas(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildPancreas()", "human_phantom0045", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Pancreas", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildUrinaryBladder(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildUrinaryBladder()", "human_phantom0046", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("UrinaryBladder", trunkVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildThyroid(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (headVolume == 0) + G4Exception("G4PhantomBuilder::BuildThyroid()", "human_phantom0047", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Thyroid", headVolume, colourName, solidVis, sensitivity); +} + +void G4PhantomBuilder::BuildThymus(const G4String& colourName, G4bool solidVis, G4bool sensitivity) { + if (trunkVolume == 0) + G4Exception("G4PhantomBuilder::BuildThymus()", "human_phantom0048", FatalException, + "The trunk volume is missing !!!!!"); + + body->CreateOrgan("Thymus", trunkVolume, colourName, solidVis, sensitivity); +} + +G4VPhysicalVolume* G4PhantomBuilder::GetPhantom() { return motherVolume; } + +void G4PhantomBuilder::SetMotherVolume(G4VPhysicalVolume* mother) { motherVolume = mother; } + +void G4PhantomBuilder::SetModel(G4String modelFlag) { + model = modelFlag; + + if (model == "MIRD" || model == "MIX") body = new G4MIRDBodyFactory(); +} diff --git a/src/G4VBodyFactory.cpp b/src/G4VBodyFactory.cpp new file mode 100644 index 0000000..a2391c2 --- /dev/null +++ b/src/G4VBodyFactory.cpp @@ -0,0 +1,5 @@ +#include "G4VBodyFactory.h" + +G4VBodyFactory::G4VBodyFactory() { ; } + +G4VBodyFactory::~G4VBodyFactory() { ; } diff --git a/src/G4VOrgan.cpp b/src/G4VOrgan.cpp new file mode 100644 index 0000000..5f0952b --- /dev/null +++ b/src/G4VOrgan.cpp @@ -0,0 +1,5 @@ +#include "G4VOrgan.h" + +G4VOrgan::G4VOrgan() { ; } + +G4VOrgan::~G4VOrgan() { ; } diff --git a/src/G4VoxelBreastFactory.cpp b/src/G4VoxelBreastFactory.cpp new file mode 100644 index 0000000..076b3da --- /dev/null +++ b/src/G4VoxelBreastFactory.cpp @@ -0,0 +1,25 @@ +#include "G4VoxelBreastFactory.hh" + +#include "G4VoxelLeftBreast.hh" +#include "G4VoxelRightBreast.hh" + +G4VoxelBreastFactory::G4VoxelBreastFactory() { + // Map with name of the organ and pointer to the MIRDOrgan class + // organ["ParameterisedRightBreast"] = new G4ParameterisedRightBreast(); + organ["LeftBreast"] = new G4VoxelLeftBreast(); + organ["RightBreast"] = new G4VoxelRightBreast(); +} + +G4VoxelBreastFactory::~G4VoxelBreastFactory() { + delete organ["RightBreast"]; + organ["RightBreast"] = 0; + + delete organ["LeftBreast"]; + organ["LeftBreast"] = 0; +} + +G4VPhysicalVolume* G4VoxelBreastFactory::CreateOrgan(const G4String& organ_name, G4VPhysicalVolume* motherVolume, + const G4String& colourName, G4bool visAttribute, + G4bool sensitivity) { + return organ[organ_name]->Construct(organ_name, motherVolume, colourName, visAttribute, sensitivity); +} diff --git a/src/G4VoxelLeftBreast.cpp b/src/G4VoxelLeftBreast.cpp new file mode 100644 index 0000000..c7a3703 --- /dev/null +++ b/src/G4VoxelLeftBreast.cpp @@ -0,0 +1,72 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4VoxelLeftBreast.h" + +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4PVReplica.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4Tubs.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4VoxelLeftBreast::G4VoxelLeftBreast() {} + +G4VoxelLeftBreast::~G4VoxelLeftBreast() {} + +G4VPhysicalVolume* G4VoxelLeftBreast::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) + +{ + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* adipose = material->GetMaterial("adipose"); + G4Material* adipose_glandular = material->GetMaterial("adipose_glandular"); + delete material; + + G4double rmin = 0. * cm; + G4double rmax = 6. * cm; + G4double zz = 6. * cm; + G4double startPhi = 0. * degree; + G4double spanningPhi = 180. * degree; + + G4Tubs* breast = new G4Tubs("out_breast", rmin, rmax, zz / 2., startPhi, spanningPhi); + + G4LogicalVolume* breast_log = new G4LogicalVolume(breast, adipose, "logicalOut" + volumeName, 0, 0, 0); + rmax = 5.5 * cm; + zz = 5. * cm; + G4Tubs* innerBreast = new G4Tubs("inner_breast", rmin, rmax, zz / 2., startPhi, spanningPhi); + + G4LogicalVolume* innerBreast_log = + new G4LogicalVolume(innerBreast, adipose_glandular, "logical" + volumeName, 0, 0, 0); + + G4RotationMatrix* matrix = new G4RotationMatrix(); + // matrix -> rotateX(-90.* degree); + // matrix -> rotateY(180.* degree); + matrix->rotateZ(18. * degree); + + G4VPhysicalVolume* physBreast = new G4PVPlacement(matrix, G4ThreeVector(10. * cm, 8.7 * cm, 52. * cm), + "physicalVoxelLeftBreast", breast_log, mother, false, 0, true); + + G4VPhysicalVolume* physInnerBreast = + new G4PVPlacement(0, G4ThreeVector(), "LeftBreast", innerBreast_log, physBreast, false, 0, true); + + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + delete colourPointer; + + G4VisAttributes* BreastVisAtt = new G4VisAttributes(colour); + BreastVisAtt->SetForceSolid(wireFrame); + breast_log->SetVisAttributes(BreastVisAtt); + + G4VisAttributes* innerBreastVisAtt = new G4VisAttributes(colour); + innerBreastVisAtt->SetForceSolid(false); + innerBreast_log->SetVisAttributes(innerBreastVisAtt); + + G4cout << "Voxel Left Breast created !!!!!! This model has to be refined" << G4endl; + return physInnerBreast; +} diff --git a/src/G4VoxelRightBreast.cpp b/src/G4VoxelRightBreast.cpp new file mode 100644 index 0000000..ff0a602 --- /dev/null +++ b/src/G4VoxelRightBreast.cpp @@ -0,0 +1,74 @@ +#include "G4HumanPhantomColour.h" +#include "G4HumanPhantomMaterial.h" +#include "G4VoxelRightBreast.h" + +#include "G4LogicalVolume.hh" +#include "G4Material.hh" +#include "G4PVPlacement.hh" +#include "G4PVReplica.hh" +#include "G4RotationMatrix.hh" +#include "G4SDManager.hh" +#include "G4SystemOfUnits.hh" +#include "G4ThreeVector.hh" +#include "G4Tubs.hh" +#include "G4VPhysicalVolume.hh" +#include "G4VisAttributes.hh" +#include "globals.hh" + +G4VoxelRightBreast::G4VoxelRightBreast() {} + +G4VoxelRightBreast::~G4VoxelRightBreast() {} + +G4VPhysicalVolume* G4VoxelRightBreast::Construct(const G4String& volumeName, G4VPhysicalVolume* mother, + const G4String& colourName, G4bool wireFrame, G4bool) + +{ + G4cout << "Construct " << volumeName << " with mother volume " << mother->GetName() << G4endl; + G4HumanPhantomMaterial* material = new G4HumanPhantomMaterial(); + G4Material* adipose = material->GetMaterial("adipose"); + G4Material* adipose_glandular = material->GetMaterial("adipose_glandular"); + delete material; + + G4double rmin = 0. * cm; + G4double rmax = 6. * cm; + G4double zz = 6. * cm; + G4double startPhi = 0. * degree; + G4double spanningPhi = 180. * degree; + + G4Tubs* breast = new G4Tubs("out_breast", rmin, rmax, zz / 2., startPhi, spanningPhi); + + G4LogicalVolume* breast_log = new G4LogicalVolume(breast, adipose, "logicalOut" + volumeName, 0, 0, 0); + rmax = 5.5 * cm; + zz = 5. * cm; + G4Tubs* innerBreast = new G4Tubs("inner_breast", rmin, rmax, zz / 2., startPhi, spanningPhi); + + G4LogicalVolume* innerBreast_log = + new G4LogicalVolume(innerBreast, adipose_glandular, "logical" + volumeName, 0, 0, 0); + + G4RotationMatrix* matrix = new G4RotationMatrix(); + matrix->rotateX(0. * degree); + matrix->rotateY(0. * degree); + matrix->rotateZ(-18. * degree); + + G4VPhysicalVolume* physBreast = new G4PVPlacement(matrix, G4ThreeVector(-10. * cm, 8.7 * cm, 52. * cm), + "physicalVoxelRightBreast", breast_log, mother, false, 0, true); + + G4VPhysicalVolume* physInnerBreast = + new G4PVPlacement(0, G4ThreeVector(), "RightBreast", innerBreast_log, physBreast, false, 0, true); + + G4HumanPhantomColour* colourPointer = new G4HumanPhantomColour(); + G4Colour colour = colourPointer->GetColour(colourName); + delete colourPointer; + + G4VisAttributes* BreastVisAtt = new G4VisAttributes(colour); + BreastVisAtt->SetForceSolid(wireFrame); + breast_log->SetVisAttributes(BreastVisAtt); + + G4VisAttributes* innerBreastVisAtt = new G4VisAttributes(colour); + innerBreastVisAtt->SetForceSolid(false); + innerBreast_log->SetVisAttributes(innerBreastVisAtt); + + G4cout << "Voxel Right Breast created !!!!!! This model must be refined!" << G4endl; + + return physInnerBreast; +}