58 : theAdjointRunManager(pAdjointRunManager)
67 AdjointSimDir->
SetGuidance(
"Control of the adjoint or reverse monte carlo simulation");
73 beamOnCmd =
new G4UIcommand(
"/adjoint/start_run",
this);
75 beamOnCmd->
SetGuidance(
"Default number of events to be processed is 1.");
98 DefineSpherExtSourceCmd =
new G4UIcommand(
"/adjoint/DefineSphericalExtSource",
this);
99 DefineSpherExtSourceCmd->
SetGuidance(
"Define a spherical external source.");
108 DefineSpherExtSourceCenteredOnAVolumeCmd=
new G4UIcommand(
"/adjoint/DefineSphericalExtSourceCenteredOnAVolume",
this);
109 DefineSpherExtSourceCenteredOnAVolumeCmd->
SetGuidance(
"Define a spherical external source with the center located at the center of a physical volume");
110 DefineSpherExtSourceCenteredOnAVolumeCmd->
SetParameter(phys_vol_name_par);
111 DefineSpherExtSourceCenteredOnAVolumeCmd->
SetParameter(radius_par);
112 DefineSpherExtSourceCenteredOnAVolumeCmd->
SetParameter(unit_par);
114 DefineExtSourceOnAVolumeExtSurfaceCmd=
new G4UIcmdWithAString(
"/adjoint/DefineExtSourceOnExtSurfaceOfAVolume",
this);
115 DefineExtSourceOnAVolumeExtSurfaceCmd->
SetGuidance(
"Set the external source on the external surface of a physical volume");
116 DefineExtSourceOnAVolumeExtSurfaceCmd->
SetParameterName(
"phys_vol_name",
false);
119 setExtSourceEMaxCmd->
SetGuidance(
"Set the maximum energy of the external source");
127 DefineSpherAdjSourceCmd =
new G4UIcommand(
"/adjoint/DefineSphericalAdjSource",
this);
128 DefineSpherAdjSourceCmd->
SetGuidance(
"Define a spherical adjoint source.");
135 DefineSpherAdjSourceCenteredOnAVolumeCmd=
new G4UIcommand(
"/adjoint/DefineSphericalAdjSourceCenteredOnAVolume",
this);
136 DefineSpherAdjSourceCenteredOnAVolumeCmd->
SetGuidance(
"Define a spherical adjoint source with the center located at the center of a physical volume");
137 DefineSpherAdjSourceCenteredOnAVolumeCmd->
SetParameter(phys_vol_name_par);
138 DefineSpherAdjSourceCenteredOnAVolumeCmd->
SetParameter(radius_par);
139 DefineSpherAdjSourceCenteredOnAVolumeCmd->
SetParameter(unit_par);
141 DefineAdjSourceOnAVolumeExtSurfaceCmd=
new G4UIcmdWithAString(
"/adjoint/DefineAdjSourceOnExtSurfaceOfAVolume",
this);
142 DefineAdjSourceOnAVolumeExtSurfaceCmd->
SetGuidance(
"Set the adjoint source on the external surface of physical volume");
143 DefineAdjSourceOnAVolumeExtSurfaceCmd->
SetParameterName(
"phys_vol_name",
false);
146 setAdjSourceEminCmd->
SetGuidance(
"Set the minimum energy of the adjoint source");
152 setAdjSourceEmaxCmd->
SetGuidance(
"Set the maximum energy of the adjoint source");
157 ConsiderParticleAsPrimaryCmd =
new G4UIcmdWithAString(
"/adjoint/ConsiderAsPrimary",
this);
158 ConsiderParticleAsPrimaryCmd->
SetGuidance(
"Set the selected particle as primary");
160 ConsiderParticleAsPrimaryCmd->
SetCandidates(
"e- gamma proton ion");
162 NeglectParticleAsPrimaryCmd=
new G4UIcmdWithAString(
"/adjoint/NeglectAsPrimary",
this);
163 NeglectParticleAsPrimaryCmd->
SetGuidance(
"Remove the selected particle from the lits of primaries");
165 NeglectParticleAsPrimaryCmd->
SetCandidates(
"e- gamma proton ion");
214 if (beamOnCmd)
delete beamOnCmd;
222 if (!command)
return;
223 if( command==beamOnCmd )
226 const char* nv = (
const char*)newValue;
227 std::istringstream is(nv);
238 else if ( command==ConsiderParticleAsPrimaryCmd){
241 else if ( command==NeglectParticleAsPrimaryCmd){
249 if ( command==DefineSpherExtSourceCmd){
253 const char* nv = (
const char*)newValue;
254 std::istringstream is(nv);
255 is >> x>>y>>z>>r>>unit;
263 else if ( command==DefineSpherExtSourceCenteredOnAVolumeCmd){
267 const char* nv = (
const char*)newValue;
268 std::istringstream is(nv);
269 is >>vol_name>>r>>unit;
273 else if ( command==DefineExtSourceOnAVolumeExtSurfaceCmd){
276 else if ( command== setExtSourceEMaxCmd){
280 else if ( command==DefineSpherAdjSourceCmd){
284 const char* nv = (
const char*)newValue;
285 std::istringstream is(nv);
286 is >> x>>y>>z>>r>>unit;
294 else if ( command==DefineSpherAdjSourceCenteredOnAVolumeCmd){
298 const char* nv = (
const char*)newValue;
299 std::istringstream is(nv);
300 is >>vol_name>>r>>unit;
304 else if ( command==DefineAdjSourceOnAVolumeExtSurfaceCmd){
308 else if ( command== setAdjSourceEminCmd){
312 else if ( command== setAdjSourceEmaxCmd){
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameter(G4UIparameter *const newParameter)
void SetNewValue(G4UIcommand *, G4String)
void SetAdjointSourceEmax(G4double Emax)
CLHEP::Hep3Vector G4ThreeVector
void SetParameterRange(const char *theRange)
void SetDefaultValue(const char *theDefaultValue)
G4bool DefineSphericalAdjointSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
G4bool DefineSphericalAdjointSource(G4double radius, G4ThreeVector pos)
void SetUnitCategory(const char *unitCategory)
static G4double GetNewDoubleValue(const char *paramString)
void SetAdjointSourceEmin(G4double Emin)
static G4double GetValueOf(const G4String &)
G4bool DefineAdjointSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
void SetGuidance(const char *aGuidance)
void RunAdjointSimulation(G4int nb_evt)
void AvailableForStates(G4ApplicationState s1)
G4bool DefineSphericalExtSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
G4bool DefineSphericalExtSource(G4double radius, G4ThreeVector pos)
static G4RunManager * GetRunManager()
void ConsiderParticleAsPrimary(const G4String &particle_name)
G4bool DefineExtSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
void SetCandidates(const char *candidateList)
void SetExtSourceEmax(G4double Emax)
G4AdjointSimMessenger(G4AdjointSimManager *)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void NeglectParticleAsPrimary(const G4String &particle_name)