Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/examples/advanced/iort_therapy/src/IORTDetectorMessenger.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /examples/advanced/iort_therapy/src/IORTDetectorMessenger.cc (Version 11.3.0) and /examples/advanced/iort_therapy/src/IORTDetectorMessenger.cc (Version 9.5)


  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 << 
159     changeDiscoYPositionIORTCmd -> SetGuidance << 
160     changeDiscoYPositionIORTCmd -> SetParamete << 
161     changeDiscoYPositionIORTCmd -> SetDefaultU << 
162     changeDiscoYPositionIORTCmd -> SetUnitCand << 
163     changeDiscoYPositionIORTCmd -> AvailableFo << 
164                                                << 
165     changeDiscoZPositionIORTCmd = new G4UIcmdW << 
166     changeDiscoZPositionIORTCmd -> SetGuidance << 
167     changeDiscoZPositionIORTCmd -> SetParamete << 
168     changeDiscoZPositionIORTCmd -> SetDefaultU << 
169     changeDiscoZPositionIORTCmd -> SetUnitCand << 
170     changeDiscoZPositionIORTCmd -> AvailableFo << 
171                                                << 
172     changeTheDisc1MaterialCmd = new G4UIcmdWit    158     changeTheDisc1MaterialCmd = new G4UIcmdWithAString("/ProtectionDisc1/material", this);
173     changeTheDisc1MaterialCmd -> SetGuidance("    159     changeTheDisc1MaterialCmd -> SetGuidance("Change the Disc1 material"); 
174     changeTheDisc1MaterialCmd -> SetParameterN    160     changeTheDisc1MaterialCmd -> SetParameterName("Disc1Material", false);
175     changeTheDisc1MaterialCmd -> SetDefaultVal    161     changeTheDisc1MaterialCmd -> SetDefaultValue("G4_WATER");
176     changeTheDisc1MaterialCmd -> AvailableForS    162     changeTheDisc1MaterialCmd -> AvailableForStates(G4State_Idle);
177                                                   163 
178                                                   164 
179                                                   165 
180     // Change disc2                               166     // Change disc2 
181     changeTheDisc2Dir = new G4UIdirectory("/Pr    167     changeTheDisc2Dir = new G4UIdirectory("/ProtectionDisc2/");
182     changeTheDisc2Dir -> SetGuidance("Command     168     changeTheDisc2Dir -> SetGuidance("Command to change the Disc2");
183                                                   169     
184     changeOuterRadiusDisco1IORTCmd = new G4UIc    170     changeOuterRadiusDisco1IORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc2/OuterRadiusDisc2",this);
185     changeOuterRadiusDisco1IORTCmd -> SetGuida    171     changeOuterRadiusDisco1IORTCmd -> SetGuidance("Set size of outer radius");
186     changeOuterRadiusDisco1IORTCmd -> SetParam    172     changeOuterRadiusDisco1IORTCmd -> SetParameterName("Size",false);
187     changeOuterRadiusDisco1IORTCmd -> SetDefau    173     changeOuterRadiusDisco1IORTCmd -> SetDefaultUnit("mm");  
188     changeOuterRadiusDisco1IORTCmd -> SetUnitC    174     changeOuterRadiusDisco1IORTCmd -> SetUnitCandidates("mm cm m");  
189     changeOuterRadiusDisco1IORTCmd -> Availabl    175     changeOuterRadiusDisco1IORTCmd -> AvailableForStates(G4State_Idle);
190                                                   176 
191     changeinnerRadiusDisco1IORTCmd = new G4UIc    177     changeinnerRadiusDisco1IORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc2/InnerRadiusDisc2",this);
192     changeinnerRadiusDisco1IORTCmd -> SetGuida    178     changeinnerRadiusDisco1IORTCmd -> SetGuidance("Set size of inner radius");
193     changeinnerRadiusDisco1IORTCmd -> SetParam    179     changeinnerRadiusDisco1IORTCmd -> SetParameterName("Size",false);
194     changeinnerRadiusDisco1IORTCmd -> SetDefau    180     changeinnerRadiusDisco1IORTCmd -> SetDefaultUnit("mm");  
195     changeinnerRadiusDisco1IORTCmd -> SetUnitC    181     changeinnerRadiusDisco1IORTCmd -> SetUnitCandidates("mm cm m");  
196     changeinnerRadiusDisco1IORTCmd -> Availabl    182     changeinnerRadiusDisco1IORTCmd -> AvailableForStates(G4State_Idle);
197                                                   183 
198                                                   184 
199     changeheightDisco1IORTCmd = new G4UIcmdWit    185     changeheightDisco1IORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc2/HeightDisc2",this);
200     changeheightDisco1IORTCmd -> SetGuidance("    186     changeheightDisco1IORTCmd -> SetGuidance("Set size of higth");
201     changeheightDisco1IORTCmd -> SetParameterN    187     changeheightDisco1IORTCmd -> SetParameterName("Size",false);
202     changeheightDisco1IORTCmd -> SetDefaultUni    188     changeheightDisco1IORTCmd -> SetDefaultUnit("mm");  
203     changeheightDisco1IORTCmd -> SetUnitCandid    189     changeheightDisco1IORTCmd -> SetUnitCandidates("mm cm m");  
204     changeheightDisco1IORTCmd -> AvailableForS    190     changeheightDisco1IORTCmd -> AvailableForStates(G4State_Idle);
205                                                   191 
206     changeDisco1XPositionIORTCmd = new G4UIcmd    192     changeDisco1XPositionIORTCmd = new G4UIcmdWithADoubleAndUnit("/ProtectionDisc2/XPositionDisc2",this);
207     changeDisco1XPositionIORTCmd -> SetGuidanc    193     changeDisco1XPositionIORTCmd -> SetGuidance("Set the X position");
208     changeDisco1XPositionIORTCmd -> SetParamet    194     changeDisco1XPositionIORTCmd -> SetParameterName("Size",false);
209     changeDisco1XPositionIORTCmd -> SetDefault    195     changeDisco1XPositionIORTCmd -> SetDefaultUnit("mm");  
210     changeDisco1XPositionIORTCmd -> SetUnitCan    196     changeDisco1XPositionIORTCmd -> SetUnitCandidates("mm cm m");  
211     changeDisco1XPositionIORTCmd -> AvailableF    197     changeDisco1XPositionIORTCmd -> AvailableForStates(G4State_Idle);
212                                                   198 
213     changeTheDisc2MaterialCmd = new G4UIcmdWit    199     changeTheDisc2MaterialCmd = new G4UIcmdWithAString("/ProtectionDisc2/material", this);
214     changeTheDisc2MaterialCmd -> SetGuidance("    200     changeTheDisc2MaterialCmd -> SetGuidance("Change the Disc2 material"); 
215     changeTheDisc2MaterialCmd -> SetParameterN    201     changeTheDisc2MaterialCmd -> SetParameterName("Disc1Material", false);
216     changeTheDisc2MaterialCmd -> SetDefaultVal    202     changeTheDisc2MaterialCmd -> SetDefaultValue("G4_WATER");
217     changeTheDisc2MaterialCmd -> AvailableForS    203     changeTheDisc2MaterialCmd -> AvailableForStates(G4State_Idle);
218                                                   204 
219     // Delete disc 1-2                            205     // Delete disc 1-2
220     deleteTheDiscDir = new G4UIdirectory("/Del    206     deleteTheDiscDir = new G4UIdirectory("/DeleteProtectionDisc/");
221     deleteTheDiscDir -> SetGuidance("Command t    207     deleteTheDiscDir -> SetGuidance("Command to delete the 1-2 Discs ");
222                                                   208 
223     deletediscCmd = new G4UIcmdWithoutParamete    209     deletediscCmd = new G4UIcmdWithoutParameter("/DeleteProtectionDisc/delete",this);
224     deletediscCmd->SetGuidance("Delete the 1-2    210     deletediscCmd->SetGuidance("Delete the 1-2 Discs geometry.");
225     deletediscCmd->SetGuidance("This command M    211     deletediscCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
226     deletediscCmd->AvailableForStates(G4State_    212     deletediscCmd->AvailableForStates(G4State_Idle);
227                                                   213 
228     // Insert disc 1-2                            214     // Insert disc 1-2
229     insertTheDiscDir = new G4UIdirectory("/Ins    215     insertTheDiscDir = new G4UIdirectory("/InsertProtectionDisc/");
230     insertTheDiscDir -> SetGuidance("Command t    216     insertTheDiscDir -> SetGuidance("Command to insert the 1-2 Discs ");
231                                                   217 
232     insertdiscCmd = new G4UIcmdWithoutParamete    218     insertdiscCmd = new G4UIcmdWithoutParameter("/InsertProtectionDisc/insert",this);
233     insertdiscCmd->SetGuidance("Insert the 1-2    219     insertdiscCmd->SetGuidance("Insert the 1-2 Discs geometry.");
234     insertdiscCmd->SetGuidance("This command M    220     insertdiscCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
235     insertdiscCmd->SetGuidance("After this com    221     insertdiscCmd->SetGuidance("After this command MUST be applied update command \"beamOn\" ");
236     insertdiscCmd->AvailableForStates(G4State_    222     insertdiscCmd->AvailableForStates(G4State_Idle);
237                                                << 
238     // Change Tilt angle disc1 + disc2         << 
239     changeTheAnglediscDir = new G4UIdirectory( << 
240     changeTheAnglediscDir -> SetGuidance("Set  << 
241                                                << 
242     changeTheAnglediscCmd = new G4UIcmdWithADo << 
243     changeTheAnglediscCmd -> SetParameterName( << 
244     changeTheAnglediscCmd -> SetDefaultUnit("d << 
245     changeTheAnglediscCmd -> SetUnitCandidates << 
246     changeTheAnglediscCmd -> AvailableForState << 
247    }                                              223    }
248                                                   224 
249 //////////////////////////////////////////////    225 /////////////////////////////////////////////////////////////////////////////
250 IORTDetectorMessenger::~IORTDetectorMessenger(    226 IORTDetectorMessenger::~IORTDetectorMessenger()
251 {                                                 227 {
252     delete changeThePhantomDir;                   228     delete changeThePhantomDir; 
253     delete changeThePhantomSizeCmd;               229     delete changeThePhantomSizeCmd; 
254     delete changeThePhantomPositionCmd;           230     delete changeThePhantomPositionCmd; 
255     delete changeThePhantomMaterialCmd;           231     delete changeThePhantomMaterialCmd; 
256     delete updateCmd;                             232     delete updateCmd;
257     delete changeTheDetectorDir;                  233     delete changeTheDetectorDir; 
258     delete changeTheDetectorSizeCmd;              234     delete changeTheDetectorSizeCmd; 
259     delete changeTheDetectorToPhantomPositionC    235     delete changeTheDetectorToPhantomPositionCmd; 
260     delete changeTheDetectorVoxelCmd;             236     delete changeTheDetectorVoxelCmd;
261                                                   237     
262     delete changeTheDisc1Dir;                     238     delete changeTheDisc1Dir;
263     delete changeOuterRadiusDiscoIORTCmd;         239     delete changeOuterRadiusDiscoIORTCmd;
264     delete changeinnerRadiusDiscoIORTCmd;         240     delete changeinnerRadiusDiscoIORTCmd;
265     delete changeheightDiscoIORTCmd;              241     delete changeheightDiscoIORTCmd; 
266     delete changeDiscoXPositionIORTCmd;           242     delete changeDiscoXPositionIORTCmd;
267     delete changeDiscoYPositionIORTCmd;        << 
268     delete changeDiscoZPositionIORTCmd;        << 
269     delete changeTheDisc1MaterialCmd;             243     delete changeTheDisc1MaterialCmd;
270                                                   244 
271     delete changeTheDisc2Dir;                     245     delete changeTheDisc2Dir;
272     delete changeOuterRadiusDisco1IORTCmd;        246     delete changeOuterRadiusDisco1IORTCmd;
273     delete changeinnerRadiusDisco1IORTCmd;        247     delete changeinnerRadiusDisco1IORTCmd;
274     delete changeheightDisco1IORTCmd;             248     delete changeheightDisco1IORTCmd; 
275     delete changeDisco1XPositionIORTCmd;          249     delete changeDisco1XPositionIORTCmd;
276     delete changeTheDisc2MaterialCmd;             250     delete changeTheDisc2MaterialCmd;
277                                                   251 
278     delete deletediscCmd;                         252     delete deletediscCmd;
279     delete insertdiscCmd;                         253     delete insertdiscCmd;
280                                                << 
281     delete changeTheAnglediscDir;              << 
282     delete changeTheAnglediscCmd;              << 
283 }                                                 254 }
284                                                   255 
285 //////////////////////////////////////////////    256 /////////////////////////////////////////////////////////////////////////////
286 void IORTDetectorMessenger::SetNewValue(G4UIco    257 void IORTDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
287 {                                                 258 {
288                                                   259   
289   if( command == changeThePhantomSizeCmd)         260   if( command == changeThePhantomSizeCmd)
290     {                                             261     {
291   G4ThreeVector size = changeThePhantomSizeCmd    262   G4ThreeVector size = changeThePhantomSizeCmd -> GetNew3VectorValue(newValue);
292   iortDetector -> SetPhantomSize(size.getX(),s    263   iortDetector -> SetPhantomSize(size.getX(),size.getY(),size.getZ());
293     }                                             264     }
294   else if (command == changeThePhantomPosition    265   else if (command == changeThePhantomPositionCmd )
295   {                                               266   {
296    G4ThreeVector size = changeThePhantomPositi    267    G4ThreeVector size = changeThePhantomPositionCmd -> GetNew3VectorValue(newValue);
297          iortDetector -> SetPhantomPosition(si    268          iortDetector -> SetPhantomPosition(size);
298   }                                               269   }
299   else if (command == changeThePhantomMaterial    270   else if (command == changeThePhantomMaterialCmd)
300   {                                               271   {
301       iortDetector -> SetPhantomMaterial(newVa    272       iortDetector -> SetPhantomMaterial(newValue);
302   }                                               273   }
303   else if (command == changeTheDetectorSizeCmd    274   else if (command == changeTheDetectorSizeCmd)
304   {                                               275   {
305   G4ThreeVector size = changeTheDetectorSizeCm    276   G4ThreeVector size = changeTheDetectorSizeCmd  -> GetNew3VectorValue(newValue);
306         iortDetector -> SetDetectorSize(size.g    277         iortDetector -> SetDetectorSize(size.getX(),size.getY(),size.getZ());
307   }                                               278   }
308   else if (command == changeTheDetectorToPhant    279   else if (command == changeTheDetectorToPhantomPositionCmd)
309   {                                               280   {
310   G4ThreeVector size = changeTheDetectorToPhan    281   G4ThreeVector size = changeTheDetectorToPhantomPositionCmd-> GetNew3VectorValue(newValue);
311         iortDetector -> SetDetectorToPhantomPo    282         iortDetector -> SetDetectorToPhantomPosition(size);
312   }                                               283   }
313   else if (command == changeTheDetectorVoxelCm    284   else if (command == changeTheDetectorVoxelCmd)
314   {                                               285   {
315   G4ThreeVector size = changeTheDetectorVoxelC    286   G4ThreeVector size = changeTheDetectorVoxelCmd  -> GetNew3VectorValue(newValue);
316         iortDetector -> SetVoxelSize(size.getX    287         iortDetector -> SetVoxelSize(size.getX(),size.getY(),size.getZ());
317   }                                               288   }
318 /////////////////////disc/////////////////////    289 /////////////////////disc/////////////////////////////////
319                                                   290 
320   else if( command == changeOuterRadiusDiscoIO    291   else if( command == changeOuterRadiusDiscoIORTCmd )
321     {                                             292     { 
322          iortDetector -> SetOuterRadiusDiscoIO    293          iortDetector -> SetOuterRadiusDiscoIORT
323   (changeOuterRadiusDiscoIORTCmd -> GetNewDoub    294   (changeOuterRadiusDiscoIORTCmd -> GetNewDoubleValue(newValue));
324     }                                             295     }
325   else if( command == changeinnerRadiusDiscoIO    296   else if( command == changeinnerRadiusDiscoIORTCmd )
326     { iortDetector -> SetinnerRadiusDiscoIORT     297     { iortDetector -> SetinnerRadiusDiscoIORT
327   (changeinnerRadiusDiscoIORTCmd -> GetNewDoub    298   (changeinnerRadiusDiscoIORTCmd -> GetNewDoubleValue(newValue));
328     }                                             299     }
329   else if( command == changeheightDiscoIORTCmd    300   else if( command == changeheightDiscoIORTCmd )
330     { iortDetector -> SetheightDiscoIORT          301     { iortDetector -> SetheightDiscoIORT
331   (changeheightDiscoIORTCmd -> GetNewDoubleVal    302   (changeheightDiscoIORTCmd -> GetNewDoubleValue(newValue));
332     }                                             303     }
333   else if( command == changeDiscoXPositionIORT    304   else if( command == changeDiscoXPositionIORTCmd )
334     { iortDetector -> SetDiscoXPositionIORT       305     { iortDetector -> SetDiscoXPositionIORT
335   (changeDiscoXPositionIORTCmd -> GetNewDouble    306   (changeDiscoXPositionIORTCmd -> GetNewDoubleValue(newValue));
336     }                                             307     }
337   else if( command == changeDiscoYPositionIORT << 
338     { iortDetector -> SetDiscoYPositionIORT    << 
339   (changeDiscoYPositionIORTCmd -> GetNewDouble << 
340     }                                          << 
341   else if( command == changeDiscoZPositionIORT << 
342     { iortDetector -> SetDiscoZPositionIORT    << 
343   (changeDiscoZPositionIORTCmd -> GetNewDouble << 
344     }                                          << 
345   else if (command == changeTheDisc1MaterialCm    308   else if (command == changeTheDisc1MaterialCmd)
346   {                                               309   {
347       iortDetector -> SetDiscoMaterialIORT(new    310       iortDetector -> SetDiscoMaterialIORT(newValue);
348   }                                               311   }
349                                                   312 
                                                   >> 313 
350   else if( command == changeOuterRadiusDisco1I    314   else if( command == changeOuterRadiusDisco1IORTCmd )
351     { iortDetector -> SetOuterRadiusDiscoIORT1    315     { iortDetector -> SetOuterRadiusDiscoIORT1
352   (changeOuterRadiusDisco1IORTCmd -> GetNewDou    316   (changeOuterRadiusDisco1IORTCmd -> GetNewDoubleValue(newValue));
353     }                                             317     }
354   else if( command == changeinnerRadiusDisco1I    318   else if( command == changeinnerRadiusDisco1IORTCmd )
355     { iortDetector -> SetinnerRadiusDiscoIORT1    319     { iortDetector -> SetinnerRadiusDiscoIORT1
356   (changeinnerRadiusDisco1IORTCmd -> GetNewDou    320   (changeinnerRadiusDisco1IORTCmd -> GetNewDoubleValue(newValue));
357     }                                             321     }
358   else if( command == changeheightDisco1IORTCm    322   else if( command == changeheightDisco1IORTCmd )
359     { iortDetector -> SetheightDiscoIORT1         323     { iortDetector -> SetheightDiscoIORT1
360   (changeheightDisco1IORTCmd -> GetNewDoubleVa    324   (changeheightDisco1IORTCmd -> GetNewDoubleValue(newValue));
361     }                                             325     }
362   else if( command == changeDisco1XPositionIOR    326   else if( command == changeDisco1XPositionIORTCmd )
363     { iortDetector -> SetDiscoXPositionIORT1      327     { iortDetector -> SetDiscoXPositionIORT1
364   (changeDisco1XPositionIORTCmd -> GetNewDoubl    328   (changeDisco1XPositionIORTCmd -> GetNewDoubleValue(newValue));
365     }                                             329     }
366   else if (command == changeTheDisc2MaterialCm    330   else if (command == changeTheDisc2MaterialCmd)
367   {                                               331   {
368       iortDetector -> SetDiscoMaterialIORT1(ne    332       iortDetector -> SetDiscoMaterialIORT1(newValue);
369   }                                               333   }
370   else if (command == changeTheAnglediscCmd)   << 334   
371   {                                            << 
372       iortDetector -> SetAngleDiscoIORT0       << 
373         (changeTheAnglediscCmd -> GetNewDouble << 
374   }                                            << 
375                                                   335 
376                                                   336 
377                                                   337 
378   else if (command == updateCmd)                  338   else if (command == updateCmd)
379   {                                               339   {
380       iortDetector -> UpdateGeometry();           340       iortDetector -> UpdateGeometry();
381   }                                               341   }
382                                                   342 
383   else if (command == deletediscCmd)              343   else if (command == deletediscCmd)
384   {                                               344   {
385       iortDetector -> DeleteDisc();               345       iortDetector -> DeleteDisc();
386   }                                               346   }
387                                                   347 
388 else if (command == insertdiscCmd)                348 else if (command == insertdiscCmd)
389   {                                               349   {
390       iortDetector -> ConstructDisc();            350       iortDetector -> ConstructDisc();
391   }                                               351   }
392 }                                                 352 }
393                                                   353