55 : theAdjointRunManager(pAdjointRunManager)
59 "Control of the adjoint or reverse monte carlo simulation");
64 beamOnCmd =
new G4UIcommand(
"/adjoint/start_run",
this);
66 beamOnCmd->
SetGuidance(
"Default number of events to be processed is 1.");
88 DefineSpherExtSourceCmd =
89 new G4UIcommand(
"/adjoint/DefineSphericalExtSource",
this);
90 DefineSpherExtSourceCmd->
SetGuidance(
"Define a spherical external source.");
100 DefineSpherExtSourceCenteredOnAVolumeCmd =
101 new G4UIcommand(
"/adjoint/DefineSphericalExtSourceCenteredOnAVolume",
this);
102 DefineSpherExtSourceCenteredOnAVolumeCmd->
SetGuidance(
103 "Define a spherical external source with the center located at the center "
106 DefineSpherExtSourceCenteredOnAVolumeCmd->
SetParameter(phys_vol_name_par);
107 DefineSpherExtSourceCenteredOnAVolumeCmd->
SetParameter(radius_par);
108 DefineSpherExtSourceCenteredOnAVolumeCmd->
SetParameter(unit_par);
111 "/adjoint/DefineExtSourceOnExtSurfaceOfAVolume",
this);
112 DefineExtSourceOnAVolumeExtSurfaceCmd->
SetGuidance(
113 "Set the external source on the external surface of a physical volume");
117 setExtSourceEMaxCmd =
120 "Set the maximum energy of the external source");
128 DefineSpherAdjSourceCmd =
129 new G4UIcommand(
"/adjoint/DefineSphericalAdjSource",
this);
130 DefineSpherAdjSourceCmd->
SetGuidance(
"Define a spherical adjoint source.");
137 DefineSpherAdjSourceCenteredOnAVolumeCmd =
138 new G4UIcommand(
"/adjoint/DefineSphericalAdjSourceCenteredOnAVolume",
this);
139 DefineSpherAdjSourceCenteredOnAVolumeCmd->
SetGuidance(
140 "Define a spherical adjoint source with the center located at the center "
143 DefineSpherAdjSourceCenteredOnAVolumeCmd->
SetParameter(phys_vol_name_par);
144 DefineSpherAdjSourceCenteredOnAVolumeCmd->
SetParameter(radius_par);
145 DefineSpherAdjSourceCenteredOnAVolumeCmd->
SetParameter(unit_par);
148 "/adjoint/DefineAdjSourceOnExtSurfaceOfAVolume",
this);
149 DefineAdjSourceOnAVolumeExtSurfaceCmd->
SetGuidance(
150 "Set the adjoint source on the external surface of physical volume");
154 setAdjSourceEminCmd =
157 "Set the minimum energy of the adjoint source");
162 setAdjSourceEmaxCmd =
165 "Set the maximum energy of the adjoint source");
170 ConsiderParticleAsPrimaryCmd =
173 "Set the selected particle as primary");
175 ConsiderParticleAsPrimaryCmd->
SetCandidates(
"e- gamma proton ion");
177 NeglectParticleAsPrimaryCmd =
180 "Remove the selected particle from the list of primaries");
182 NeglectParticleAsPrimaryCmd->
SetCandidates(
"e- gamma proton ion");
184 setNbOfPrimaryFwdGammasPerEventCmd =
187 "Set the nb of primary fwd gamm generated on the adjoint source");
192 setNbOfPrimaryAdjGammasPerEventCmd =
195 "Set the nb of primary fwd gamm generated on the adjoint source");
201 "/adjoint/SetNbOfPrimaryAdjElectronsPerEvent",
this);
202 setNbOfPrimaryAdjElectronsPerEventCmd->
SetGuidance(
203 "Set the nb of primary fwd gamm generated on the adjoint source");
204 setNbOfPrimaryAdjElectronsPerEventCmd->
SetParameterName(
"Nb_gammas",
false);
213 delete setNbOfPrimaryAdjElectronsPerEventCmd;
214 delete setNbOfPrimaryAdjGammasPerEventCmd;
215 delete setNbOfPrimaryFwdGammasPerEventCmd;
216 delete NeglectParticleAsPrimaryCmd;
217 delete ConsiderParticleAsPrimaryCmd;
218 delete setAdjSourceEmaxCmd;
219 delete setAdjSourceEminCmd;
220 delete DefineAdjSourceOnAVolumeExtSurfaceCmd;
221 delete DefineSpherAdjSourceCenteredOnAVolumeCmd;
222 delete DefineSpherAdjSourceCmd;
223 delete setExtSourceEMaxCmd;
224 delete DefineExtSourceOnAVolumeExtSurfaceCmd;
225 delete DefineSpherExtSourceCenteredOnAVolumeCmd;
226 delete DefineSpherExtSourceCmd;
228 delete AdjointSimDir;
235 if(command ==
nullptr)
237 if(command == beamOnCmd)
240 const char* nv = (
const char*) newValue;
241 std::istringstream is(nv);
247 else if(command == ConsiderParticleAsPrimaryCmd)
251 else if(command == NeglectParticleAsPrimaryCmd)
255 if(command == DefineSpherExtSourceCmd)
259 const char* nv = (
const char*) newValue;
260 std::istringstream is(nv);
261 is >> x >> y >> z >> r >> unit;
269 else if(command == DefineSpherExtSourceCenteredOnAVolumeCmd)
273 const char* nv = (
const char*) newValue;
274 std::istringstream is(nv);
275 is >> vol_name >> r >> unit;
280 else if(command == DefineExtSourceOnAVolumeExtSurfaceCmd)
284 else if(command == setExtSourceEMaxCmd)
289 else if(command == DefineSpherAdjSourceCmd)
293 const char* nv = (
const char*) newValue;
294 std::istringstream is(nv);
295 is >> x >> y >> z >> r >> unit;
304 else if(command == DefineSpherAdjSourceCenteredOnAVolumeCmd)
308 const char* nv = (
const char*) newValue;
309 std::istringstream is(nv);
310 is >> vol_name >> r >> unit;
315 else if(command == DefineAdjSourceOnAVolumeExtSurfaceCmd)
319 else if(command == setAdjSourceEminCmd)
324 else if(command == setAdjSourceEmaxCmd)
329 else if(command == setNbOfPrimaryFwdGammasPerEventCmd)
334 else if(command == setNbOfPrimaryAdjGammasPerEventCmd)
339 else if(command == setNbOfPrimaryAdjElectronsPerEventCmd)
CLHEP::Hep3Vector G4ThreeVector
G4bool DefineAdjointSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
G4bool DefineExtSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
void RunAdjointSimulation(G4int nb_evt)
G4bool DefineSphericalExtSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
void SetNbAdjointPrimaryGammasPerEvent(G4int)
void ConsiderParticleAsPrimary(const G4String &particle_name)
void SetExtSourceEmax(G4double Emax)
void SetAdjointSourceEmax(G4double Emax)
void SetAdjointSourceEmin(G4double Emin)
void NeglectParticleAsPrimary(const G4String &particle_name)
G4bool DefineSphericalAdjointSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
void SetNbAdjointPrimaryElectronsPerEvent(G4int)
void SetNbOfPrimaryFwdGammasPerEvent(G4int)
G4bool DefineSphericalExtSource(G4double radius, G4ThreeVector pos)
G4bool DefineSphericalAdjointSource(G4double radius, G4ThreeVector pos)
G4AdjointSimMessenger(G4AdjointSimManager *)
void SetNewValue(G4UIcommand *, G4String)
static G4RunManager * GetRunManager()
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void AvailableForStates(G4ApplicationState s1)
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)
static G4double GetValueOf(const G4String &)