Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // This is the *BASIC* version of IORT, a Gean 26 // This is the *BASIC* version of IORT, a Geant4-based application 27 // 27 // 28 // Main Authors: G.Russo(a,b), C.Casarino*(c), 28 // Main Authors: G.Russo(a,b), C.Casarino*(c), G.C. Candiano(c), G.A.P. Cirrone(d), F.Romano(d) 29 // Contributor Authors: S.Guatelli(e) 29 // Contributor Authors: S.Guatelli(e) 30 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d 30 // Past Authors: G.Arnetta(c), S.E.Mazzaglia(d) 31 // 31 // 32 // (a) Fondazione Istituto San Raffaele G.Gi 32 // (a) Fondazione Istituto San Raffaele G.Giglio, Cefalù, Italy 33 // (b) IBFM-CNR , Segrate (Milano), Italy 33 // (b) IBFM-CNR , Segrate (Milano), Italy 34 // (c) LATO (Laboratorio di Tecnologie Oncol 34 // (c) LATO (Laboratorio di Tecnologie Oncologiche), Cefalù, Italy 35 // (d) Laboratori Nazionali del Sud of the I 35 // (d) Laboratori Nazionali del Sud of the INFN, Catania, Italy 36 // (e) University of Wollongong, Australia << 36 // (e) University of Wallongong, Australia 37 // 37 // 38 // *Corresponding author, email to carlo.cas 38 // *Corresponding author, email to carlo.casarino@polooncologicocefalu.it 39 ////////////////////////////////////////////// 39 ////////////////////////////////////////////////////////////////////////////////////////////// 40 40 41 #include "IORTDetectorMessenger.hh" 41 #include "IORTDetectorMessenger.hh" 42 #include "IORTDetectorConstruction.hh" 42 #include "IORTDetectorConstruction.hh" 43 #include "G4UIdirectory.hh" 43 #include "G4UIdirectory.hh" 44 #include "G4UIcmdWith3VectorAndUnit.hh" 44 #include "G4UIcmdWith3VectorAndUnit.hh" 45 #include "G4UIcmdWithoutParameter.hh" 45 #include "G4UIcmdWithoutParameter.hh" 46 #include "G4UIcmdWithAString.hh" 46 #include "G4UIcmdWithAString.hh" 47 #include "G4UIcmdWithADoubleAndUnit.hh" // a 47 #include "G4UIcmdWithADoubleAndUnit.hh" // aggiunto 48 48 49 ////////////////////////////////////////////// 49 ///////////////////////////////////////////////////////////////////////////// 50 IORTDetectorMessenger::IORTDetectorMessenger(I 50 IORTDetectorMessenger::IORTDetectorMessenger(IORTDetectorConstruction* detector) 51 :iortDetector(detector) 51 :iortDetector(detector) 52 { 52 { 53 // Change Phantom size 53 // Change Phantom size 54 changeThePhantomDir = new G4UIdirectory("/ 54 changeThePhantomDir = new G4UIdirectory("/changePhantom/"); 55 changeThePhantomDir -> SetGuidance("Comman 55 changeThePhantomDir -> SetGuidance("Command to change the Phantom Size/position"); 56 changeThePhantomSizeCmd = new G4UIcmdWith3 56 changeThePhantomSizeCmd = new G4UIcmdWith3VectorAndUnit("/changePhantom/size", this); 57 changeThePhantomSizeCmd -> SetGuidance("In 57 changeThePhantomSizeCmd -> SetGuidance("Insert sizes X Y and Z" 58 "\n 0 o 58 "\n 0 or negative values mean <<Don't change it!>>"); 59 changeThePhantomSizeCmd -> SetParameterNam 59 changeThePhantomSizeCmd -> SetParameterName("PhantomSizeAlongX", 60 "PhantomSizeAlongY", 60 "PhantomSizeAlongY", 61 "PhantomSizeAlongZ", false); 61 "PhantomSizeAlongZ", false); 62 changeThePhantomSizeCmd -> SetDefaultUnit( 62 changeThePhantomSizeCmd -> SetDefaultUnit("mm"); 63 changeThePhantomSizeCmd -> SetUnitCandidat 63 changeThePhantomSizeCmd -> SetUnitCandidates("nm um mm cm"); 64 changeThePhantomSizeCmd -> AvailableForSta 64 changeThePhantomSizeCmd -> AvailableForStates(G4State_Idle); 65 65 66 66 67 // Change Phantom material 67 // Change Phantom material 68 changeThePhantomMaterialCmd = new G4UIcmdW 68 changeThePhantomMaterialCmd = new G4UIcmdWithAString("/changePhantom/material", this); 69 changeThePhantomMaterialCmd -> SetGuidance 69 changeThePhantomMaterialCmd -> SetGuidance("Change the Phantom and the detector material"); 70 changeThePhantomMaterialCmd -> SetParamete 70 changeThePhantomMaterialCmd -> SetParameterName("PhantomMaterial", false); 71 changeThePhantomMaterialCmd -> SetDefaultV 71 changeThePhantomMaterialCmd -> SetDefaultValue("G4_WATER"); 72 changeThePhantomMaterialCmd -> AvailableFo 72 changeThePhantomMaterialCmd -> AvailableForStates(G4State_Idle); 73 73 74 // Change Phantom position 74 // Change Phantom position 75 changeThePhantomPositionCmd = new G4UIcmdW 75 changeThePhantomPositionCmd = new G4UIcmdWith3VectorAndUnit("/changePhantom/position", this); 76 changeThePhantomPositionCmd -> SetGuidance 76 changeThePhantomPositionCmd -> SetGuidance("Insert X Y and Z dimensions for the position of the center of the Phantom" 77 " respect to that of the \"World\" 77 " respect to that of the \"World\""); 78 changeThePhantomPositionCmd -> SetParamete 78 changeThePhantomPositionCmd -> SetParameterName("PositionAlongX", 79 "PositionAlongY", 79 "PositionAlongY", 80 "PositionAlongZ", false); 80 "PositionAlongZ", false); 81 changeThePhantomPositionCmd -> SetDefaultU 81 changeThePhantomPositionCmd -> SetDefaultUnit("mm"); 82 changeThePhantomPositionCmd -> SetUnitCand 82 changeThePhantomPositionCmd -> SetUnitCandidates("um mm cm m"); 83 changeThePhantomPositionCmd -> AvailableFo 83 changeThePhantomPositionCmd -> AvailableForStates(G4State_Idle); 84 84 85 85 86 updateCmd = new G4UIcmdWithoutParameter("/ 86 updateCmd = new G4UIcmdWithoutParameter("/changePhantom/update",this); 87 updateCmd->SetGuidance("Update Phantom/Det 87 updateCmd->SetGuidance("Update Phantom/Detector geometry."); 88 updateCmd->SetGuidance("This command MUST 88 updateCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); 89 updateCmd->SetGuidance("if you changed geo 89 updateCmd->SetGuidance("if you changed geometrical value(s)."); 90 updateCmd->AvailableForStates(G4State_Idle 90 updateCmd->AvailableForStates(G4State_Idle); 91 91 92 // Change detector size 92 // Change detector size 93 changeTheDetectorDir = new G4UIdirectory(" 93 changeTheDetectorDir = new G4UIdirectory("/changeDetector/"); 94 changeTheDetectorDir -> SetGuidance("Comma 94 changeTheDetectorDir -> SetGuidance("Command to change the Detector's Size/position/Voxels"); 95 95 96 changeTheDetectorSizeCmd = new G4UIcmdWith 96 changeTheDetectorSizeCmd = new G4UIcmdWith3VectorAndUnit("/changeDetector/size",this); 97 changeTheDetectorSizeCmd -> SetGuidance("I 97 changeTheDetectorSizeCmd -> SetGuidance("Insert sizes for X Y and Z dimensions of the Detector" 98 "\n 0 or negative values mean 98 "\n 0 or negative values mean <<Don't change it>>"); 99 changeTheDetectorSizeCmd -> SetParameterNa 99 changeTheDetectorSizeCmd -> SetParameterName("DetectorSizeAlongX", "DetectorSizeAlongY", "DetectorSizeAlongZ", false); 100 changeTheDetectorSizeCmd -> SetDefaultUnit 100 changeTheDetectorSizeCmd -> SetDefaultUnit("mm"); 101 changeTheDetectorSizeCmd -> SetUnitCandida 101 changeTheDetectorSizeCmd -> SetUnitCandidates("nm um mm cm"); 102 changeTheDetectorSizeCmd -> AvailableForSt 102 changeTheDetectorSizeCmd -> AvailableForStates(G4State_Idle); 103 103 104 // Change the detector to phantom displac 104 // Change the detector to phantom displacement 105 changeTheDetectorToPhantomPositionCmd = ne 105 changeTheDetectorToPhantomPositionCmd = new G4UIcmdWith3VectorAndUnit("/changeDetector/displacement",this); 106 changeTheDetectorToPhantomPositionCmd -> S 106 changeTheDetectorToPhantomPositionCmd -> SetGuidance("Insert X Y and Z displacements between Detector and Phantom" 107 107 "\nNegative values mean <<Don't change it!>>"); 108 changeTheDetectorToPhantomPositionCmd -> S 108 changeTheDetectorToPhantomPositionCmd -> SetParameterName("DisplacementAlongX", 109 "DisplacementAlongY", 109 "DisplacementAlongY", 110 "DisplacementAlongZ", fals 110 "DisplacementAlongZ", false); 111 changeTheDetectorToPhantomPositionCmd -> S 111 changeTheDetectorToPhantomPositionCmd -> SetDefaultUnit("mm"); 112 changeTheDetectorToPhantomPositionCmd -> S 112 changeTheDetectorToPhantomPositionCmd -> SetUnitCandidates("nm um mm cm"); 113 changeTheDetectorToPhantomPositionCmd -> A 113 changeTheDetectorToPhantomPositionCmd -> AvailableForStates(G4State_Idle); 114 114 115 // Change voxels by its size 115 // Change voxels by its size 116 changeTheDetectorVoxelCmd = new G4UIcmdWit 116 changeTheDetectorVoxelCmd = new G4UIcmdWith3VectorAndUnit("/changeDetector/voxelSize",this); 117 changeTheDetectorVoxelCmd -> SetGuidance(" 117 changeTheDetectorVoxelCmd -> SetGuidance("Insert Voxel sizes for X Y and Z dimensions" 118 "\n 0 or ne 118 "\n 0 or negative values mean <<Don't change it!>>"); 119 changeTheDetectorVoxelCmd -> SetParameterN 119 changeTheDetectorVoxelCmd -> SetParameterName("VoxelSizeAlongX", "VoxelSizeAlongY", "VoxelSizeAlongZ", false); 120 changeTheDetectorVoxelCmd -> SetDefaultUni 120 changeTheDetectorVoxelCmd -> SetDefaultUnit("mm"); 121 changeTheDetectorVoxelCmd -> SetUnitCandid 121 changeTheDetectorVoxelCmd -> SetUnitCandidates("nm um mm cm"); 122 changeTheDetectorVoxelCmd -> AvailableForS 122 changeTheDetectorVoxelCmd -> AvailableForStates(G4State_Idle); 123 123 124 124 125 // Change disc1 125 // Change disc1 126 changeTheDisc1Dir = new G4UIdirectory("/Pr 126 changeTheDisc1Dir = new G4UIdirectory("/ProtectionDisc1/"); 127 changeTheDisc1Dir -> SetGuidance("Command 127 changeTheDisc1Dir -> SetGuidance("Command to change the Disc1"); 128 128 129 changeOuterRadiusDiscoIORTCmd = new G4UIcm 129 changeOuterRadiusDiscoIORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc1/OuterRadiusDisc1",this); 130 changeOuterRadiusDiscoIORTCmd -> SetGuidan 130 changeOuterRadiusDiscoIORTCmd -> SetGuidance("Set size of outer radius"); 131 changeOuterRadiusDiscoIORTCmd -> SetParame 131 changeOuterRadiusDiscoIORTCmd -> SetParameterName("Size",false); 132 changeOuterRadiusDiscoIORTCmd -> SetDefaul 132 changeOuterRadiusDiscoIORTCmd -> SetDefaultUnit("mm"); 133 changeOuterRadiusDiscoIORTCmd -> SetUnitCa 133 changeOuterRadiusDiscoIORTCmd -> SetUnitCandidates("mm cm m"); 134 changeOuterRadiusDiscoIORTCmd -> Available 134 changeOuterRadiusDiscoIORTCmd -> AvailableForStates(G4State_Idle); 135 135 136 changeinnerRadiusDiscoIORTCmd = new G4UIcm 136 changeinnerRadiusDiscoIORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc1/InnerRadiusDisc1",this); 137 changeinnerRadiusDiscoIORTCmd -> SetGuidan 137 changeinnerRadiusDiscoIORTCmd -> SetGuidance("Set size of inner radius"); 138 changeinnerRadiusDiscoIORTCmd -> SetParame 138 changeinnerRadiusDiscoIORTCmd -> SetParameterName("Size",false); 139 changeinnerRadiusDiscoIORTCmd -> SetDefaul 139 changeinnerRadiusDiscoIORTCmd -> SetDefaultUnit("mm"); 140 changeinnerRadiusDiscoIORTCmd -> SetUnitCa 140 changeinnerRadiusDiscoIORTCmd -> SetUnitCandidates("mm cm m"); 141 changeinnerRadiusDiscoIORTCmd -> Available 141 changeinnerRadiusDiscoIORTCmd -> AvailableForStates(G4State_Idle); 142 142 143 143 144 changeheightDiscoIORTCmd = new G4UIcmdWith 144 changeheightDiscoIORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc1/HeightDisc1",this); 145 changeheightDiscoIORTCmd -> SetGuidance("S 145 changeheightDiscoIORTCmd -> SetGuidance("Set size of higth"); 146 changeheightDiscoIORTCmd -> SetParameterNa 146 changeheightDiscoIORTCmd -> SetParameterName("Size",false); 147 changeheightDiscoIORTCmd -> SetDefaultUnit 147 changeheightDiscoIORTCmd -> SetDefaultUnit("mm"); 148 changeheightDiscoIORTCmd -> SetUnitCandida 148 changeheightDiscoIORTCmd -> SetUnitCandidates("mm cm m"); 149 changeheightDiscoIORTCmd -> AvailableForSt 149 changeheightDiscoIORTCmd -> AvailableForStates(G4State_Idle); 150 150 151 changeDiscoXPositionIORTCmd = new G4UIcmdW 151 changeDiscoXPositionIORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc1/XPositionDisc1",this); 152 changeDiscoXPositionIORTCmd -> SetGuidance 152 changeDiscoXPositionIORTCmd -> SetGuidance("Set the X position"); 153 changeDiscoXPositionIORTCmd -> SetParamete 153 changeDiscoXPositionIORTCmd -> SetParameterName("Size",false); 154 changeDiscoXPositionIORTCmd -> SetDefaultU 154 changeDiscoXPositionIORTCmd -> SetDefaultUnit("mm"); 155 changeDiscoXPositionIORTCmd -> SetUnitCand 155 changeDiscoXPositionIORTCmd -> SetUnitCandidates("mm cm m"); 156 changeDiscoXPositionIORTCmd -> AvailableFo 156 changeDiscoXPositionIORTCmd -> AvailableForStates(G4State_Idle); 157 157 158 changeDiscoYPositionIORTCmd = new G4UIcmdW 158 changeDiscoYPositionIORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc1/YPositionDisc1",this); 159 changeDiscoYPositionIORTCmd -> SetGuidance 159 changeDiscoYPositionIORTCmd -> SetGuidance("Set the Y position"); 160 changeDiscoYPositionIORTCmd -> SetParamete 160 changeDiscoYPositionIORTCmd -> SetParameterName("Size",false); 161 changeDiscoYPositionIORTCmd -> SetDefaultU 161 changeDiscoYPositionIORTCmd -> SetDefaultUnit("mm"); 162 changeDiscoYPositionIORTCmd -> SetUnitCand 162 changeDiscoYPositionIORTCmd -> SetUnitCandidates("mm cm m"); 163 changeDiscoYPositionIORTCmd -> AvailableFo 163 changeDiscoYPositionIORTCmd -> AvailableForStates(G4State_Idle); 164 164 165 changeDiscoZPositionIORTCmd = new G4UIcmdW 165 changeDiscoZPositionIORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc1/ZPositionDisc1",this); 166 changeDiscoZPositionIORTCmd -> SetGuidance 166 changeDiscoZPositionIORTCmd -> SetGuidance("Set the Z position"); 167 changeDiscoZPositionIORTCmd -> SetParamete 167 changeDiscoZPositionIORTCmd -> SetParameterName("Size",false); 168 changeDiscoZPositionIORTCmd -> SetDefaultU 168 changeDiscoZPositionIORTCmd -> SetDefaultUnit("mm"); 169 changeDiscoZPositionIORTCmd -> SetUnitCand 169 changeDiscoZPositionIORTCmd -> SetUnitCandidates("mm cm m"); 170 changeDiscoZPositionIORTCmd -> AvailableFo 170 changeDiscoZPositionIORTCmd -> AvailableForStates(G4State_Idle); 171 171 172 changeTheDisc1MaterialCmd = new G4UIcmdWit 172 changeTheDisc1MaterialCmd = new G4UIcmdWithAString("/ProtectionDisc1/material", this); 173 changeTheDisc1MaterialCmd -> SetGuidance(" 173 changeTheDisc1MaterialCmd -> SetGuidance("Change the Disc1 material"); 174 changeTheDisc1MaterialCmd -> SetParameterN 174 changeTheDisc1MaterialCmd -> SetParameterName("Disc1Material", false); 175 changeTheDisc1MaterialCmd -> SetDefaultVal 175 changeTheDisc1MaterialCmd -> SetDefaultValue("G4_WATER"); 176 changeTheDisc1MaterialCmd -> AvailableForS 176 changeTheDisc1MaterialCmd -> AvailableForStates(G4State_Idle); 177 177 178 178 179 179 180 // Change disc2 180 // Change disc2 181 changeTheDisc2Dir = new G4UIdirectory("/Pr 181 changeTheDisc2Dir = new G4UIdirectory("/ProtectionDisc2/"); 182 changeTheDisc2Dir -> SetGuidance("Command 182 changeTheDisc2Dir -> SetGuidance("Command to change the Disc2"); 183 183 184 changeOuterRadiusDisco1IORTCmd = new G4UIc 184 changeOuterRadiusDisco1IORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc2/OuterRadiusDisc2",this); 185 changeOuterRadiusDisco1IORTCmd -> SetGuida 185 changeOuterRadiusDisco1IORTCmd -> SetGuidance("Set size of outer radius"); 186 changeOuterRadiusDisco1IORTCmd -> SetParam 186 changeOuterRadiusDisco1IORTCmd -> SetParameterName("Size",false); 187 changeOuterRadiusDisco1IORTCmd -> SetDefau 187 changeOuterRadiusDisco1IORTCmd -> SetDefaultUnit("mm"); 188 changeOuterRadiusDisco1IORTCmd -> SetUnitC 188 changeOuterRadiusDisco1IORTCmd -> SetUnitCandidates("mm cm m"); 189 changeOuterRadiusDisco1IORTCmd -> Availabl 189 changeOuterRadiusDisco1IORTCmd -> AvailableForStates(G4State_Idle); 190 190 191 changeinnerRadiusDisco1IORTCmd = new G4UIc 191 changeinnerRadiusDisco1IORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc2/InnerRadiusDisc2",this); 192 changeinnerRadiusDisco1IORTCmd -> SetGuida 192 changeinnerRadiusDisco1IORTCmd -> SetGuidance("Set size of inner radius"); 193 changeinnerRadiusDisco1IORTCmd -> SetParam 193 changeinnerRadiusDisco1IORTCmd -> SetParameterName("Size",false); 194 changeinnerRadiusDisco1IORTCmd -> SetDefau 194 changeinnerRadiusDisco1IORTCmd -> SetDefaultUnit("mm"); 195 changeinnerRadiusDisco1IORTCmd -> SetUnitC 195 changeinnerRadiusDisco1IORTCmd -> SetUnitCandidates("mm cm m"); 196 changeinnerRadiusDisco1IORTCmd -> Availabl 196 changeinnerRadiusDisco1IORTCmd -> AvailableForStates(G4State_Idle); 197 197 198 198 199 changeheightDisco1IORTCmd = new G4UIcmdWit 199 changeheightDisco1IORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc2/HeightDisc2",this); 200 changeheightDisco1IORTCmd -> SetGuidance(" 200 changeheightDisco1IORTCmd -> SetGuidance("Set size of higth"); 201 changeheightDisco1IORTCmd -> SetParameterN 201 changeheightDisco1IORTCmd -> SetParameterName("Size",false); 202 changeheightDisco1IORTCmd -> SetDefaultUni 202 changeheightDisco1IORTCmd -> SetDefaultUnit("mm"); 203 changeheightDisco1IORTCmd -> SetUnitCandid 203 changeheightDisco1IORTCmd -> SetUnitCandidates("mm cm m"); 204 changeheightDisco1IORTCmd -> AvailableForS 204 changeheightDisco1IORTCmd -> AvailableForStates(G4State_Idle); 205 205 206 changeDisco1XPositionIORTCmd = new G4UIcmd 206 changeDisco1XPositionIORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc2/XPositionDisc2",this); 207 changeDisco1XPositionIORTCmd -> SetGuidanc 207 changeDisco1XPositionIORTCmd -> SetGuidance("Set the X position"); 208 changeDisco1XPositionIORTCmd -> SetParamet 208 changeDisco1XPositionIORTCmd -> SetParameterName("Size",false); 209 changeDisco1XPositionIORTCmd -> SetDefault 209 changeDisco1XPositionIORTCmd -> SetDefaultUnit("mm"); 210 changeDisco1XPositionIORTCmd -> SetUnitCan 210 changeDisco1XPositionIORTCmd -> SetUnitCandidates("mm cm m"); 211 changeDisco1XPositionIORTCmd -> AvailableF 211 changeDisco1XPositionIORTCmd -> AvailableForStates(G4State_Idle); 212 212 213 changeTheDisc2MaterialCmd = new G4UIcmdWit 213 changeTheDisc2MaterialCmd = new G4UIcmdWithAString("/ProtectionDisc2/material", this); 214 changeTheDisc2MaterialCmd -> SetGuidance(" 214 changeTheDisc2MaterialCmd -> SetGuidance("Change the Disc2 material"); 215 changeTheDisc2MaterialCmd -> SetParameterN 215 changeTheDisc2MaterialCmd -> SetParameterName("Disc1Material", false); 216 changeTheDisc2MaterialCmd -> SetDefaultVal 216 changeTheDisc2MaterialCmd -> SetDefaultValue("G4_WATER"); 217 changeTheDisc2MaterialCmd -> AvailableForS 217 changeTheDisc2MaterialCmd -> AvailableForStates(G4State_Idle); 218 218 219 // Delete disc 1-2 219 // Delete disc 1-2 220 deleteTheDiscDir = new G4UIdirectory("/Del 220 deleteTheDiscDir = new G4UIdirectory("/DeleteProtectionDisc/"); 221 deleteTheDiscDir -> SetGuidance("Command t 221 deleteTheDiscDir -> SetGuidance("Command to delete the 1-2 Discs "); 222 222 223 deletediscCmd = new G4UIcmdWithoutParamete 223 deletediscCmd = new G4UIcmdWithoutParameter("/DeleteProtectionDisc/delete",this); 224 deletediscCmd->SetGuidance("Delete the 1-2 224 deletediscCmd->SetGuidance("Delete the 1-2 Discs geometry."); 225 deletediscCmd->SetGuidance("This command M 225 deletediscCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); 226 deletediscCmd->AvailableForStates(G4State_ 226 deletediscCmd->AvailableForStates(G4State_Idle); 227 227 228 // Insert disc 1-2 228 // Insert disc 1-2 229 insertTheDiscDir = new G4UIdirectory("/Ins 229 insertTheDiscDir = new G4UIdirectory("/InsertProtectionDisc/"); 230 insertTheDiscDir -> SetGuidance("Command t 230 insertTheDiscDir -> SetGuidance("Command to insert the 1-2 Discs "); 231 231 232 insertdiscCmd = new G4UIcmdWithoutParamete 232 insertdiscCmd = new G4UIcmdWithoutParameter("/InsertProtectionDisc/insert",this); 233 insertdiscCmd->SetGuidance("Insert the 1-2 233 insertdiscCmd->SetGuidance("Insert the 1-2 Discs geometry."); 234 insertdiscCmd->SetGuidance("This command M 234 insertdiscCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); 235 insertdiscCmd->SetGuidance("After this com 235 insertdiscCmd->SetGuidance("After this command MUST be applied update command \"beamOn\" "); 236 insertdiscCmd->AvailableForStates(G4State_ 236 insertdiscCmd->AvailableForStates(G4State_Idle); 237 237 238 // Change Tilt angle disc1 + disc2 238 // Change Tilt angle disc1 + disc2 239 changeTheAnglediscDir = new G4UIdirectory( 239 changeTheAnglediscDir = new G4UIdirectory("/ChangeTiltAngleDisc1-2/"); 240 changeTheAnglediscDir -> SetGuidance("Set 240 changeTheAnglediscDir -> SetGuidance("Set tilt angle of the 1-2 Discs"); 241 241 242 changeTheAnglediscCmd = new G4UIcmdWithADo 242 changeTheAnglediscCmd = new G4UIcmdWithADoubleAndUnit("/ChangeTiltAngleDisc1-2/TiltAngleDisc1-2",this); 243 changeTheAnglediscCmd -> SetParameterName( 243 changeTheAnglediscCmd -> SetParameterName("Angle",false); 244 changeTheAnglediscCmd -> SetDefaultUnit("d 244 changeTheAnglediscCmd -> SetDefaultUnit("deg"); 245 changeTheAnglediscCmd -> SetUnitCandidates 245 changeTheAnglediscCmd -> SetUnitCandidates("deg rad"); 246 changeTheAnglediscCmd -> AvailableForState 246 changeTheAnglediscCmd -> AvailableForStates(G4State_Idle); 247 } 247 } 248 248 249 ////////////////////////////////////////////// 249 ///////////////////////////////////////////////////////////////////////////// 250 IORTDetectorMessenger::~IORTDetectorMessenger( 250 IORTDetectorMessenger::~IORTDetectorMessenger() 251 { 251 { 252 delete changeThePhantomDir; 252 delete changeThePhantomDir; 253 delete changeThePhantomSizeCmd; 253 delete changeThePhantomSizeCmd; 254 delete changeThePhantomPositionCmd; 254 delete changeThePhantomPositionCmd; 255 delete changeThePhantomMaterialCmd; 255 delete changeThePhantomMaterialCmd; 256 delete updateCmd; 256 delete updateCmd; 257 delete changeTheDetectorDir; 257 delete changeTheDetectorDir; 258 delete changeTheDetectorSizeCmd; 258 delete changeTheDetectorSizeCmd; 259 delete changeTheDetectorToPhantomPositionC 259 delete changeTheDetectorToPhantomPositionCmd; 260 delete changeTheDetectorVoxelCmd; 260 delete changeTheDetectorVoxelCmd; 261 261 262 delete changeTheDisc1Dir; 262 delete changeTheDisc1Dir; 263 delete changeOuterRadiusDiscoIORTCmd; 263 delete changeOuterRadiusDiscoIORTCmd; 264 delete changeinnerRadiusDiscoIORTCmd; 264 delete changeinnerRadiusDiscoIORTCmd; 265 delete changeheightDiscoIORTCmd; 265 delete changeheightDiscoIORTCmd; 266 delete changeDiscoXPositionIORTCmd; 266 delete changeDiscoXPositionIORTCmd; 267 delete changeDiscoYPositionIORTCmd; 267 delete changeDiscoYPositionIORTCmd; 268 delete changeDiscoZPositionIORTCmd; 268 delete changeDiscoZPositionIORTCmd; 269 delete changeTheDisc1MaterialCmd; 269 delete changeTheDisc1MaterialCmd; 270 270 271 delete changeTheDisc2Dir; 271 delete changeTheDisc2Dir; 272 delete changeOuterRadiusDisco1IORTCmd; 272 delete changeOuterRadiusDisco1IORTCmd; 273 delete changeinnerRadiusDisco1IORTCmd; 273 delete changeinnerRadiusDisco1IORTCmd; 274 delete changeheightDisco1IORTCmd; 274 delete changeheightDisco1IORTCmd; 275 delete changeDisco1XPositionIORTCmd; 275 delete changeDisco1XPositionIORTCmd; 276 delete changeTheDisc2MaterialCmd; 276 delete changeTheDisc2MaterialCmd; 277 277 278 delete deletediscCmd; 278 delete deletediscCmd; 279 delete insertdiscCmd; 279 delete insertdiscCmd; 280 280 281 delete changeTheAnglediscDir; 281 delete changeTheAnglediscDir; 282 delete changeTheAnglediscCmd; 282 delete changeTheAnglediscCmd; 283 } 283 } 284 284 285 ////////////////////////////////////////////// 285 ///////////////////////////////////////////////////////////////////////////// 286 void IORTDetectorMessenger::SetNewValue(G4UIco 286 void IORTDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue) 287 { 287 { 288 288 289 if( command == changeThePhantomSizeCmd) 289 if( command == changeThePhantomSizeCmd) 290 { 290 { 291 G4ThreeVector size = changeThePhantomSizeCmd 291 G4ThreeVector size = changeThePhantomSizeCmd -> GetNew3VectorValue(newValue); 292 iortDetector -> SetPhantomSize(size.getX(),s 292 iortDetector -> SetPhantomSize(size.getX(),size.getY(),size.getZ()); 293 } 293 } 294 else if (command == changeThePhantomPosition 294 else if (command == changeThePhantomPositionCmd ) 295 { 295 { 296 G4ThreeVector size = changeThePhantomPositi 296 G4ThreeVector size = changeThePhantomPositionCmd -> GetNew3VectorValue(newValue); 297 iortDetector -> SetPhantomPosition(si 297 iortDetector -> SetPhantomPosition(size); 298 } 298 } 299 else if (command == changeThePhantomMaterial 299 else if (command == changeThePhantomMaterialCmd) 300 { 300 { 301 iortDetector -> SetPhantomMaterial(newVa 301 iortDetector -> SetPhantomMaterial(newValue); 302 } 302 } 303 else if (command == changeTheDetectorSizeCmd 303 else if (command == changeTheDetectorSizeCmd) 304 { 304 { 305 G4ThreeVector size = changeTheDetectorSizeCm 305 G4ThreeVector size = changeTheDetectorSizeCmd -> GetNew3VectorValue(newValue); 306 iortDetector -> SetDetectorSize(size.g 306 iortDetector -> SetDetectorSize(size.getX(),size.getY(),size.getZ()); 307 } 307 } 308 else if (command == changeTheDetectorToPhant 308 else if (command == changeTheDetectorToPhantomPositionCmd) 309 { 309 { 310 G4ThreeVector size = changeTheDetectorToPhan 310 G4ThreeVector size = changeTheDetectorToPhantomPositionCmd-> GetNew3VectorValue(newValue); 311 iortDetector -> SetDetectorToPhantomPo 311 iortDetector -> SetDetectorToPhantomPosition(size); 312 } 312 } 313 else if (command == changeTheDetectorVoxelCm 313 else if (command == changeTheDetectorVoxelCmd) 314 { 314 { 315 G4ThreeVector size = changeTheDetectorVoxelC 315 G4ThreeVector size = changeTheDetectorVoxelCmd -> GetNew3VectorValue(newValue); 316 iortDetector -> SetVoxelSize(size.getX 316 iortDetector -> SetVoxelSize(size.getX(),size.getY(),size.getZ()); 317 } 317 } 318 /////////////////////disc///////////////////// 318 /////////////////////disc///////////////////////////////// 319 319 320 else if( command == changeOuterRadiusDiscoIO 320 else if( command == changeOuterRadiusDiscoIORTCmd ) 321 { 321 { 322 iortDetector -> SetOuterRadiusDiscoIO 322 iortDetector -> SetOuterRadiusDiscoIORT 323 (changeOuterRadiusDiscoIORTCmd -> GetNewDoub 323 (changeOuterRadiusDiscoIORTCmd -> GetNewDoubleValue(newValue)); 324 } 324 } 325 else if( command == changeinnerRadiusDiscoIO 325 else if( command == changeinnerRadiusDiscoIORTCmd ) 326 { iortDetector -> SetinnerRadiusDiscoIORT 326 { iortDetector -> SetinnerRadiusDiscoIORT 327 (changeinnerRadiusDiscoIORTCmd -> GetNewDoub 327 (changeinnerRadiusDiscoIORTCmd -> GetNewDoubleValue(newValue)); 328 } 328 } 329 else if( command == changeheightDiscoIORTCmd 329 else if( command == changeheightDiscoIORTCmd ) 330 { iortDetector -> SetheightDiscoIORT 330 { iortDetector -> SetheightDiscoIORT 331 (changeheightDiscoIORTCmd -> GetNewDoubleVal 331 (changeheightDiscoIORTCmd -> GetNewDoubleValue(newValue)); 332 } 332 } 333 else if( command == changeDiscoXPositionIORT 333 else if( command == changeDiscoXPositionIORTCmd ) 334 { iortDetector -> SetDiscoXPositionIORT 334 { iortDetector -> SetDiscoXPositionIORT 335 (changeDiscoXPositionIORTCmd -> GetNewDouble 335 (changeDiscoXPositionIORTCmd -> GetNewDoubleValue(newValue)); 336 } 336 } 337 else if( command == changeDiscoYPositionIORT 337 else if( command == changeDiscoYPositionIORTCmd ) 338 { iortDetector -> SetDiscoYPositionIORT 338 { iortDetector -> SetDiscoYPositionIORT 339 (changeDiscoYPositionIORTCmd -> GetNewDouble 339 (changeDiscoYPositionIORTCmd -> GetNewDoubleValue(newValue)); 340 } 340 } 341 else if( command == changeDiscoZPositionIORT 341 else if( command == changeDiscoZPositionIORTCmd ) 342 { iortDetector -> SetDiscoZPositionIORT 342 { iortDetector -> SetDiscoZPositionIORT 343 (changeDiscoZPositionIORTCmd -> GetNewDouble 343 (changeDiscoZPositionIORTCmd -> GetNewDoubleValue(newValue)); 344 } 344 } 345 else if (command == changeTheDisc1MaterialCm 345 else if (command == changeTheDisc1MaterialCmd) 346 { 346 { 347 iortDetector -> SetDiscoMaterialIORT(new 347 iortDetector -> SetDiscoMaterialIORT(newValue); 348 } 348 } 349 349 350 else if( command == changeOuterRadiusDisco1I 350 else if( command == changeOuterRadiusDisco1IORTCmd ) 351 { iortDetector -> SetOuterRadiusDiscoIORT1 351 { iortDetector -> SetOuterRadiusDiscoIORT1 352 (changeOuterRadiusDisco1IORTCmd -> GetNewDou 352 (changeOuterRadiusDisco1IORTCmd -> GetNewDoubleValue(newValue)); 353 } 353 } 354 else if( command == changeinnerRadiusDisco1I 354 else if( command == changeinnerRadiusDisco1IORTCmd ) 355 { iortDetector -> SetinnerRadiusDiscoIORT1 355 { iortDetector -> SetinnerRadiusDiscoIORT1 356 (changeinnerRadiusDisco1IORTCmd -> GetNewDou 356 (changeinnerRadiusDisco1IORTCmd -> GetNewDoubleValue(newValue)); 357 } 357 } 358 else if( command == changeheightDisco1IORTCm 358 else if( command == changeheightDisco1IORTCmd ) 359 { iortDetector -> SetheightDiscoIORT1 359 { iortDetector -> SetheightDiscoIORT1 360 (changeheightDisco1IORTCmd -> GetNewDoubleVa 360 (changeheightDisco1IORTCmd -> GetNewDoubleValue(newValue)); 361 } 361 } 362 else if( command == changeDisco1XPositionIOR 362 else if( command == changeDisco1XPositionIORTCmd ) 363 { iortDetector -> SetDiscoXPositionIORT1 363 { iortDetector -> SetDiscoXPositionIORT1 364 (changeDisco1XPositionIORTCmd -> GetNewDoubl 364 (changeDisco1XPositionIORTCmd -> GetNewDoubleValue(newValue)); 365 } 365 } 366 else if (command == changeTheDisc2MaterialCm 366 else if (command == changeTheDisc2MaterialCmd) 367 { 367 { 368 iortDetector -> SetDiscoMaterialIORT1(ne 368 iortDetector -> SetDiscoMaterialIORT1(newValue); 369 } 369 } 370 else if (command == changeTheAnglediscCmd) 370 else if (command == changeTheAnglediscCmd) 371 { 371 { 372 iortDetector -> SetAngleDiscoIORT0 372 iortDetector -> SetAngleDiscoIORT0 373 (changeTheAnglediscCmd -> GetNewDouble 373 (changeTheAnglediscCmd -> GetNewDoubleValue(newValue)); 374 } 374 } 375 375 376 376 377 377 378 else if (command == updateCmd) 378 else if (command == updateCmd) 379 { 379 { 380 iortDetector -> UpdateGeometry(); 380 iortDetector -> UpdateGeometry(); 381 } 381 } 382 382 383 else if (command == deletediscCmd) 383 else if (command == deletediscCmd) 384 { 384 { 385 iortDetector -> DeleteDisc(); 385 iortDetector -> DeleteDisc(); 386 } 386 } 387 387 388 else if (command == insertdiscCmd) 388 else if (command == insertdiscCmd) 389 { 389 { 390 iortDetector -> ConstructDisc(); 390 iortDetector -> ConstructDisc(); 391 } 391 } 392 } 392 } 393 393