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 // G4AdjointSimMessenger implementation << 26 // $Id: G4AdjointSimMessenger.cc,v 1.2 2009/11/18 18:02:06 gcosmo Exp $ >> 27 // GEANT4 tag $Name: geant4-09-03 $ 27 // 28 // 28 // ------------------------------------------- << 29 ///////////////////////////////////////////////////////////////////////////// 29 // Class Name: G4AdjointSimMessenger << 30 // Class Name: G4AdjointCrossSurfChecker 30 // Author: L. Desorgher, 2007-2009 << 31 // Author: L. Desorgher 31 // Organisation: SpaceIT GmbH << 32 // Organisation: SpaceIT GmbH 32 // Contract: ESA contract 21435/08/NL/AT << 33 // Contract: ESA contract 21435/08/NL/AT 33 // Customer: ESA/ESTEC << 34 // Customer: ESA/ESTEC 34 // ------------------------------------------- << 35 ///////////////////////////////////////////////////////////////////////////// 35 36 36 #include "G4AdjointSimMessenger.hh" 37 #include "G4AdjointSimMessenger.hh" 37 << 38 #include "G4AdjointSimManager.hh" 38 #include "G4AdjointSimManager.hh" 39 #include "G4RunManager.hh" << 39 #include "G4UIdirectory.hh" 40 #include "G4UIcmdWith3VectorAndUnit.hh" << 41 #include "G4UIcmdWithABool.hh" 40 #include "G4UIcmdWithABool.hh" 42 #include "G4UIcmdWithADouble.hh" << 43 #include "G4UIcmdWithADoubleAndUnit.hh" << 44 #include "G4UIcmdWithAString.hh" << 45 #include "G4UIcmdWithAnInteger.hh" 41 #include "G4UIcmdWithAnInteger.hh" >> 42 #include "G4UIcmdWithADoubleAndUnit.hh" >> 43 #include "G4UIcmdWithADouble.hh" 46 #include "G4UIcmdWithoutParameter.hh" 44 #include "G4UIcmdWithoutParameter.hh" 47 #include "G4UIdirectory.hh" << 45 #include "G4UIcmdWithAString.hh" 48 #include "G4UnitsTable.hh" 46 #include "G4UnitsTable.hh" 49 << 47 #include "G4UIcmdWith3VectorAndUnit.hh" 50 #include <sstream> << 48 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 51 << 52 // ------------------------------------------- << 53 // 49 // 54 G4AdjointSimMessenger::G4AdjointSimMessenger(G 50 G4AdjointSimMessenger::G4AdjointSimMessenger(G4AdjointSimManager* pAdjointRunManager) 55 : theAdjointRunManager(pAdjointRunManager) 51 : theAdjointRunManager(pAdjointRunManager) 56 { << 52 { 57 AdjointSimDir = new G4UIdirectory("/adjoint/ 53 AdjointSimDir = new G4UIdirectory("/adjoint/"); 58 AdjointSimDir->SetGuidance("Control of the a 54 AdjointSimDir->SetGuidance("Control of the adjoint or reverse monte carlo simulation"); 59 55 60 // Start and adjoint Run << 56 //Start and adjoint Run 61 //--------------------- 57 //--------------------- 62 << 58 63 << 59 beamOnCmd = new G4UIcommand("/adjoint/start_run",this); 64 beamOnCmd = new G4UIcommand("/adjoint/start_ << 65 beamOnCmd->SetGuidance("Start an adjoint Run 60 beamOnCmd->SetGuidance("Start an adjoint Run."); 66 beamOnCmd->SetGuidance("Default number of ev 61 beamOnCmd->SetGuidance("Default number of events to be processed is 1."); 67 beamOnCmd->AvailableForStates(G4State_PreIni << 62 beamOnCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 68 auto p1 = new G4UIparameter("numberOfEvent", << 63 G4UIparameter* p1 = new G4UIparameter("numberOfEvent",'i',true); 69 p1->SetDefaultValue(1); 64 p1->SetDefaultValue(1); 70 p1->SetParameterRange("numberOfEvent >= 0"); 65 p1->SetParameterRange("numberOfEvent >= 0"); 71 beamOnCmd->SetParameter(p1); 66 beamOnCmd->SetParameter(p1); 72 67 73 // Commands to define parameters relative to << 68 //Commands to define parameters relative to the external source 74 //------------------------------------------ 69 //------------------------------------------------------------ 75 << 70 76 auto pos_x_par = new G4UIparameter("X", 'd', << 71 G4UIparameter* pos_x_par = new G4UIparameter("X",'d',true); 77 << 72 78 auto pos_y_par = new G4UIparameter("Y", 'd', << 73 G4UIparameter* pos_y_par = new G4UIparameter("Y",'d',true); 79 << 74 80 auto pos_z_par = new G4UIparameter("Z", 'd', << 75 G4UIparameter* pos_z_par = new G4UIparameter("Z",'d',true); 81 << 76 82 auto radius_par = new G4UIparameter("R", 'd' << 77 G4UIparameter* radius_par = new G4UIparameter("R",'d',true); 83 << 78 84 radius_par->SetParameterRange("R >= 0"); 79 radius_par->SetParameterRange("R >= 0"); >> 80 >> 81 G4UIparameter* unit_par = new G4UIparameter("unit",'s',true); 85 82 86 auto unit_par = new G4UIparameter("unit", 's << 83 DefineSpherExtSourceCmd = new G4UIcommand("/adjoint/DefineSphericalExtSource",this); 87 << 88 DefineSpherExtSourceCmd = new G4UIcommand("/ << 89 DefineSpherExtSourceCmd->SetGuidance("Define 84 DefineSpherExtSourceCmd->SetGuidance("Define a spherical external source."); 90 DefineSpherExtSourceCmd->SetParameter(pos_x_ 85 DefineSpherExtSourceCmd->SetParameter(pos_x_par); 91 DefineSpherExtSourceCmd->SetParameter(pos_y_ 86 DefineSpherExtSourceCmd->SetParameter(pos_y_par); 92 DefineSpherExtSourceCmd->SetParameter(pos_z_ 87 DefineSpherExtSourceCmd->SetParameter(pos_z_par); 93 DefineSpherExtSourceCmd->SetParameter(radius 88 DefineSpherExtSourceCmd->SetParameter(radius_par); 94 DefineSpherExtSourceCmd->SetParameter(unit_p 89 DefineSpherExtSourceCmd->SetParameter(unit_par); 95 90 96 auto phys_vol_name_par = new G4UIparameter(" << 91 G4UIparameter* phys_vol_name_par = new G4UIparameter("phys_vol_name",'s',true); 97 92 98 DefineSpherExtSourceCenteredOnAVolumeCmd = << 93 DefineSpherExtSourceCenteredOnAVolumeCmd= new G4UIcommand("/adjoint/DefineSphericalExtSourceCenteredOnAVolume",this); 99 new G4UIcommand("/adjoint/DefineSphericalE << 94 DefineSpherExtSourceCenteredOnAVolumeCmd->SetGuidance("Define a spherical external source with the center located at the center of a physical volume"); 100 DefineSpherExtSourceCenteredOnAVolumeCmd->Se << 101 "Define a spherical external source with t << 102 "of a " << 103 "physical volume"); << 104 DefineSpherExtSourceCenteredOnAVolumeCmd->Se 95 DefineSpherExtSourceCenteredOnAVolumeCmd->SetParameter(phys_vol_name_par); 105 DefineSpherExtSourceCenteredOnAVolumeCmd->Se 96 DefineSpherExtSourceCenteredOnAVolumeCmd->SetParameter(radius_par); 106 DefineSpherExtSourceCenteredOnAVolumeCmd->Se 97 DefineSpherExtSourceCenteredOnAVolumeCmd->SetParameter(unit_par); 107 98 108 DefineExtSourceOnAVolumeExtSurfaceCmd = << 99 DefineExtSourceOnAVolumeExtSurfaceCmd= new G4UIcmdWithAString("/adjoint/DefineExtSourceOnExtSurfaceOfAVolume",this); 109 new G4UIcmdWithAString("/adjoint/DefineExt << 100 DefineExtSourceOnAVolumeExtSurfaceCmd->SetGuidance("Set the external source on the external surface of a physical volume"); 110 DefineExtSourceOnAVolumeExtSurfaceCmd->SetGu << 101 DefineExtSourceOnAVolumeExtSurfaceCmd->SetParameterName("phys_vol_name",false); 111 "Set the external source on the external s << 102 112 DefineExtSourceOnAVolumeExtSurfaceCmd->SetPa << 103 setExtSourceEMaxCmd = new G4UIcmdWithADoubleAndUnit("/adjoint/SetExtSourceEmax",this); 113 << 114 setExtSourceEMaxCmd = new G4UIcmdWithADouble << 115 setExtSourceEMaxCmd->SetGuidance("Set the ma 104 setExtSourceEMaxCmd->SetGuidance("Set the maximum energy of the external source"); 116 setExtSourceEMaxCmd->SetParameterName("Emax" << 105 setExtSourceEMaxCmd->SetParameterName("Emax",false); 117 setExtSourceEMaxCmd->SetUnitCategory("Energy 106 setExtSourceEMaxCmd->SetUnitCategory("Energy"); 118 setExtSourceEMaxCmd->AvailableForStates(G4St << 107 setExtSourceEMaxCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 119 108 120 // Commands to define the adjoint source << 109 //Commands to define the adjoint source 121 //------------------------------------------ 110 //------------------------------------------------------------ 122 111 123 DefineSpherAdjSourceCmd = new G4UIcommand("/ << 112 DefineSpherAdjSourceCmd = new G4UIcommand("/adjoint/DefineSphericalAdjSource",this); 124 DefineSpherAdjSourceCmd->SetGuidance("Define 113 DefineSpherAdjSourceCmd->SetGuidance("Define a spherical adjoint source."); 125 DefineSpherAdjSourceCmd->SetParameter(pos_x_ 114 DefineSpherAdjSourceCmd->SetParameter(pos_x_par); 126 DefineSpherAdjSourceCmd->SetParameter(pos_y_ 115 DefineSpherAdjSourceCmd->SetParameter(pos_y_par); 127 DefineSpherAdjSourceCmd->SetParameter(pos_z_ 116 DefineSpherAdjSourceCmd->SetParameter(pos_z_par); 128 DefineSpherAdjSourceCmd->SetParameter(radius 117 DefineSpherAdjSourceCmd->SetParameter(radius_par); 129 DefineSpherAdjSourceCmd->SetParameter(unit_p 118 DefineSpherAdjSourceCmd->SetParameter(unit_par); 130 119 131 DefineSpherAdjSourceCenteredOnAVolumeCmd = << 120 DefineSpherAdjSourceCenteredOnAVolumeCmd= new G4UIcommand("/adjoint/DefineSphericalAdjSourceCenteredOnAVolume",this); 132 new G4UIcommand("/adjoint/DefineSphericalA << 121 DefineSpherAdjSourceCenteredOnAVolumeCmd->SetGuidance("Define a spherical adjoint source with the center located at the center of a physical volume"); 133 DefineSpherAdjSourceCenteredOnAVolumeCmd->Se << 134 "Define a spherical adjoint source with th << 135 "of a " << 136 "physical volume"); << 137 DefineSpherAdjSourceCenteredOnAVolumeCmd->Se 122 DefineSpherAdjSourceCenteredOnAVolumeCmd->SetParameter(phys_vol_name_par); 138 DefineSpherAdjSourceCenteredOnAVolumeCmd->Se 123 DefineSpherAdjSourceCenteredOnAVolumeCmd->SetParameter(radius_par); 139 DefineSpherAdjSourceCenteredOnAVolumeCmd->Se 124 DefineSpherAdjSourceCenteredOnAVolumeCmd->SetParameter(unit_par); 140 << 125 141 DefineAdjSourceOnAVolumeExtSurfaceCmd = << 126 DefineAdjSourceOnAVolumeExtSurfaceCmd= new G4UIcmdWithAString("/adjoint/DefineAdjSourceOnExtSurfaceOfAVolume",this); 142 new G4UIcmdWithAString("/adjoint/DefineAdj << 127 DefineAdjSourceOnAVolumeExtSurfaceCmd->SetGuidance("Set the adjoint source on the external surface of physical volume"); 143 DefineAdjSourceOnAVolumeExtSurfaceCmd->SetGu << 128 DefineAdjSourceOnAVolumeExtSurfaceCmd->SetParameterName("phys_vol_name",false); 144 "Set the adjoint source on the external su << 129 145 DefineAdjSourceOnAVolumeExtSurfaceCmd->SetPa << 130 setAdjSourceEminCmd = new G4UIcmdWithADoubleAndUnit("/adjoint/SetAdjSourceEmin",this); 146 << 147 setAdjSourceEminCmd = new G4UIcmdWithADouble << 148 setAdjSourceEminCmd->SetGuidance("Set the mi 131 setAdjSourceEminCmd->SetGuidance("Set the minimum energy of the adjoint source"); 149 setAdjSourceEminCmd->SetParameterName("Emin" << 132 setAdjSourceEminCmd->SetParameterName("Emin",false); 150 setAdjSourceEminCmd->SetUnitCategory("Energy 133 setAdjSourceEminCmd->SetUnitCategory("Energy"); 151 setAdjSourceEminCmd->AvailableForStates(G4St << 134 setAdjSourceEminCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 152 << 135 153 setAdjSourceEmaxCmd = new G4UIcmdWithADouble << 136 setAdjSourceEmaxCmd = new G4UIcmdWithADoubleAndUnit("/adjoint/SetAdjSourceEmax",this); 154 setAdjSourceEmaxCmd->SetGuidance("Set the ma 137 setAdjSourceEmaxCmd->SetGuidance("Set the maximum energy of the adjoint source"); 155 setAdjSourceEmaxCmd->SetParameterName("Emax" << 138 setAdjSourceEmaxCmd->SetParameterName("Emax",false); 156 setAdjSourceEmaxCmd->SetUnitCategory("Energy 139 setAdjSourceEmaxCmd->SetUnitCategory("Energy"); 157 setAdjSourceEmaxCmd->AvailableForStates(G4St << 140 setAdjSourceEmaxCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 158 141 159 ConsiderParticleAsPrimaryCmd = new G4UIcmdWi << 142 ConsiderParticleAsPrimaryCmd = new G4UIcmdWithAString("/adjoint/ConsiderAsPrimary",this); 160 ConsiderParticleAsPrimaryCmd->SetGuidance("S 143 ConsiderParticleAsPrimaryCmd->SetGuidance("Set the selected particle as primary"); 161 ConsiderParticleAsPrimaryCmd->SetParameterNa << 144 ConsiderParticleAsPrimaryCmd->SetParameterName("particle",false); 162 ConsiderParticleAsPrimaryCmd->SetCandidates( 145 ConsiderParticleAsPrimaryCmd->SetCandidates("e- gamma proton ion"); 163 146 164 NeglectParticleAsPrimaryCmd = new G4UIcmdWit << 147 NeglectParticleAsPrimaryCmd= new G4UIcmdWithAString("/adjoint/NeglectAsPrimary",this); 165 NeglectParticleAsPrimaryCmd->SetGuidance( << 148 NeglectParticleAsPrimaryCmd->SetGuidance("Remove the selected particle from the lits of primaries"); 166 "Remove the selected particle from the lis << 149 NeglectParticleAsPrimaryCmd->SetParameterName("particle",false); 167 NeglectParticleAsPrimaryCmd->SetParameterNam << 168 NeglectParticleAsPrimaryCmd->SetCandidates(" 150 NeglectParticleAsPrimaryCmd->SetCandidates("e- gamma proton ion"); 169 << 170 setNbOfPrimaryFwdGammasPerEventCmd = << 171 new G4UIcmdWithAnInteger("/adjoint/SetNbOf << 172 setNbOfPrimaryFwdGammasPerEventCmd->SetGuida << 173 "Set the nb of primary fwd gamm generated << 174 setNbOfPrimaryFwdGammasPerEventCmd->SetParam << 175 setNbOfPrimaryFwdGammasPerEventCmd->Availabl << 176 << 177 setNbOfPrimaryAdjGammasPerEventCmd = << 178 new G4UIcmdWithAnInteger("/adjoint/SetNbOf << 179 setNbOfPrimaryAdjGammasPerEventCmd->SetGuida << 180 "Set the nb of primary fwd gamm generated << 181 setNbOfPrimaryAdjGammasPerEventCmd->SetParam << 182 setNbOfPrimaryAdjGammasPerEventCmd->Availabl << 183 << 184 setNbOfPrimaryAdjElectronsPerEventCmd = << 185 new G4UIcmdWithAnInteger("/adjoint/SetNbOf << 186 setNbOfPrimaryAdjElectronsPerEventCmd->SetGu << 187 "Set the nb of primary fwd gamm generated << 188 setNbOfPrimaryAdjElectronsPerEventCmd->SetPa << 189 setNbOfPrimaryAdjElectronsPerEventCmd->Avail << 190 } 151 } 191 152 192 // ------------------------------------------- << 153 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 193 // 154 // >> 155 194 G4AdjointSimMessenger::~G4AdjointSimMessenger( 156 G4AdjointSimMessenger::~G4AdjointSimMessenger() 195 { 157 { 196 delete setNbOfPrimaryAdjElectronsPerEventCmd << 197 delete setNbOfPrimaryAdjGammasPerEventCmd; << 198 delete setNbOfPrimaryFwdGammasPerEventCmd; << 199 delete NeglectParticleAsPrimaryCmd; << 200 delete ConsiderParticleAsPrimaryCmd; << 201 delete setAdjSourceEmaxCmd; << 202 delete setAdjSourceEminCmd; << 203 delete DefineAdjSourceOnAVolumeExtSurfaceCmd << 204 delete DefineSpherAdjSourceCenteredOnAVolume << 205 delete DefineSpherAdjSourceCmd; << 206 delete setExtSourceEMaxCmd; << 207 delete DefineExtSourceOnAVolumeExtSurfaceCmd << 208 delete DefineSpherExtSourceCenteredOnAVolume << 209 delete DefineSpherExtSourceCmd; << 210 delete beamOnCmd; 158 delete beamOnCmd; 211 delete AdjointSimDir; << 212 } 159 } 213 160 214 // ------------------------------------------- << 161 /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 215 // 162 // 216 void G4AdjointSimMessenger::SetNewValue(G4UIco << 163 >> 164 void G4AdjointSimMessenger::SetNewValue(G4UIcommand* command,G4String newValue) 217 { 165 { 218 if (command == nullptr) return; << 166 if( command==beamOnCmd ) 219 if (command == beamOnCmd) { << 167 { 220 G4int nev; 168 G4int nev; 221 const auto nv = (const char*)newValue; << 169 const char* nv = (const char*)newValue; 222 std::istringstream is(nv); 170 std::istringstream is(nv); 223 is >> nev; << 171 is >> nev ; 224 theAdjointRunManager->RunAdjointSimulation << 172 theAdjointRunManager->RunAdjointSimulation(nev); 225 } << 226 else if (command == ConsiderParticleAsPrimar << 227 theAdjointRunManager->ConsiderParticleAsPr << 228 } 173 } 229 else if (command == NeglectParticleAsPrimary << 174 else if ( command==DefineSpherExtSourceCmd){ 230 theAdjointRunManager->NeglectParticleAsPri << 175 231 } << 176 G4double x,y,z,r; 232 if (command == DefineSpherExtSourceCmd) { << 233 G4double x, y, z, r; << 234 G4String unit; 177 G4String unit; 235 const auto nv = (const char*)newValue; << 178 const char* nv = (const char*)newValue; 236 std::istringstream is(nv); 179 std::istringstream is(nv); 237 is >> x >> y >> z >> r >> unit; << 180 is >> x>>y>>z>>r>>unit; 238 << 181 239 x *= G4UnitDefinition::GetValueOf(unit); << 182 x*=G4UnitDefinition::GetValueOf(unit); 240 y *= G4UnitDefinition::GetValueOf(unit); << 183 y*=G4UnitDefinition::GetValueOf(unit); 241 z *= G4UnitDefinition::GetValueOf(unit); << 184 z*=G4UnitDefinition::GetValueOf(unit); 242 r *= G4UnitDefinition::GetValueOf(unit); << 185 r*=G4UnitDefinition::GetValueOf(unit); 243 theAdjointRunManager->DefineSphericalExtSo << 186 theAdjointRunManager->DefineSphericalExtSource(r,G4ThreeVector(x,y,z)); 244 } 187 } 245 else if (command == DefineSpherExtSourceCent << 188 else if ( command==DefineSpherExtSourceCenteredOnAVolumeCmd){ >> 189 246 G4double r; 190 G4double r; 247 G4String vol_name, unit; 191 G4String vol_name, unit; 248 const auto nv = (const char*)newValue; << 192 const char* nv = (const char*)newValue; 249 std::istringstream is(nv); 193 std::istringstream is(nv); 250 is >> vol_name >> r >> unit; << 194 is >>vol_name>>r>>unit; 251 r *= G4UnitDefinition::GetValueOf(unit); << 195 r*=G4UnitDefinition::GetValueOf(unit); 252 theAdjointRunManager->DefineSphericalExtSo << 196 theAdjointRunManager->DefineSphericalExtSourceWithCentreAtTheCentreOfAVolume(r,vol_name); 253 } << 197 } 254 else if (command == DefineExtSourceOnAVolume << 198 else if ( command==DefineExtSourceOnAVolumeExtSurfaceCmd){ 255 theAdjointRunManager->DefineExtSourceOnThe 199 theAdjointRunManager->DefineExtSourceOnTheExtSurfaceOfAVolume(newValue); 256 } 200 } 257 else if (command == setExtSourceEMaxCmd) { << 201 else if ( command== setExtSourceEMaxCmd){ >> 202 258 theAdjointRunManager->SetExtSourceEmax(set 203 theAdjointRunManager->SetExtSourceEmax(setExtSourceEMaxCmd->GetNewDoubleValue(newValue)); 259 } 204 } 260 else if (command == DefineSpherAdjSourceCmd) << 205 else if ( command==DefineSpherAdjSourceCmd){ 261 G4double x, y, z, r; << 206 >> 207 G4double x,y,z,r; 262 G4String unit; 208 G4String unit; 263 const auto nv = (const char*)newValue; << 209 const char* nv = (const char*)newValue; 264 std::istringstream is(nv); 210 std::istringstream is(nv); 265 is >> x >> y >> z >> r >> unit; << 211 is >> x>>y>>z>>r>>unit; 266 << 212 267 x *= G4UnitDefinition::GetValueOf(unit); << 213 x*=G4UnitDefinition::GetValueOf(unit); 268 y *= G4UnitDefinition::GetValueOf(unit); << 214 y*=G4UnitDefinition::GetValueOf(unit); 269 z *= G4UnitDefinition::GetValueOf(unit); << 215 z*=G4UnitDefinition::GetValueOf(unit); 270 r *= G4UnitDefinition::GetValueOf(unit); << 216 r*=G4UnitDefinition::GetValueOf(unit); 271 theAdjointRunManager->DefineSphericalAdjoi << 217 theAdjointRunManager->DefineSphericalAdjointSource(r,G4ThreeVector(x,y,z)); 272 } 218 } 273 else if (command == DefineSpherAdjSourceCent << 219 else if ( command==DefineSpherAdjSourceCenteredOnAVolumeCmd){ >> 220 274 G4double r; 221 G4double r; 275 G4String vol_name, unit; 222 G4String vol_name, unit; 276 const auto nv = (const char*)newValue; << 223 const char* nv = (const char*)newValue; 277 std::istringstream is(nv); 224 std::istringstream is(nv); 278 is >> vol_name >> r >> unit; << 225 is >>vol_name>>r>>unit; 279 r *= G4UnitDefinition::GetValueOf(unit); << 226 r*=G4UnitDefinition::GetValueOf(unit); 280 theAdjointRunManager->DefineSphericalAdjoi << 227 theAdjointRunManager->DefineSphericalAdjointSourceWithCentreAtTheCentreOfAVolume(r,vol_name); 281 } 228 } 282 else if (command == DefineAdjSourceOnAVolume << 229 else if ( command==DefineAdjSourceOnAVolumeExtSurfaceCmd){ >> 230 283 theAdjointRunManager->DefineAdjointSourceO 231 theAdjointRunManager->DefineAdjointSourceOnTheExtSurfaceOfAVolume(newValue); 284 } 232 } 285 else if (command == setAdjSourceEminCmd) { << 233 else if ( command== setAdjSourceEminCmd){ >> 234 286 theAdjointRunManager->SetAdjointSourceEmin 235 theAdjointRunManager->SetAdjointSourceEmin(setAdjSourceEminCmd->GetNewDoubleValue(newValue)); 287 } 236 } 288 else if (command == setAdjSourceEmaxCmd) { << 237 else if ( command== setAdjSourceEmaxCmd){ >> 238 289 theAdjointRunManager->SetAdjointSourceEmax 239 theAdjointRunManager->SetAdjointSourceEmax(setAdjSourceEmaxCmd->GetNewDoubleValue(newValue)); 290 } 240 } 291 else if (command == setNbOfPrimaryFwdGammasP << 241 else if ( command==ConsiderParticleAsPrimaryCmd){ 292 theAdjointRunManager->SetNbOfPrimaryFwdGam << 242 293 setNbOfPrimaryFwdGammasPerEventCmd->GetN << 243 theAdjointRunManager->ConsiderParticleAsPrimary(newValue); 294 } << 244 } 295 else if (command == setNbOfPrimaryAdjGammasP << 245 else if ( command==NeglectParticleAsPrimaryCmd){ 296 theAdjointRunManager->SetNbAdjointPrimaryG << 246 297 setNbOfPrimaryAdjGammasPerEventCmd->GetN << 247 theAdjointRunManager->NeglectParticleAsPrimary(newValue); 298 } << 299 else if (command == setNbOfPrimaryAdjElectro << 300 theAdjointRunManager->SetNbAdjointPrimaryE << 301 setNbOfPrimaryAdjElectronsPerEventCmd->G << 302 } 248 } 303 } 249 } >> 250 304 251