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 list of primaries");
165 NeglectParticleAsPrimaryCmd->
SetCandidates(
"e- gamma proton ion");
168 setNbOfPrimaryFwdGammasPerEventCmd =
170 setNbOfPrimaryFwdGammasPerEventCmd->
SetGuidance(
"Set the nb of primary fwd gamm generated on the adjoint source");
174 setNbOfPrimaryAdjGammasPerEventCmd =
176 setNbOfPrimaryAdjGammasPerEventCmd->
SetGuidance(
"Set the nb of primary fwd gamm generated on the adjoint source");
180 setNbOfPrimaryAdjElectronsPerEventCmd =
182 setNbOfPrimaryAdjElectronsPerEventCmd->
SetGuidance(
"Set the nb of primary fwd gamm generated on the adjoint source");
237 if (beamOnCmd)
delete beamOnCmd;
245 if (!command)
return;
246 if( command==beamOnCmd )
249 const char* nv = (
const char*)newValue;
250 std::istringstream is(nv);
261 else if ( command==ConsiderParticleAsPrimaryCmd){
264 else if ( command==NeglectParticleAsPrimaryCmd){
272 if ( command==DefineSpherExtSourceCmd){
276 const char* nv = (
const char*)newValue;
277 std::istringstream is(nv);
278 is >> x>>y>>z>>r>>unit;
286 else if ( command==DefineSpherExtSourceCenteredOnAVolumeCmd){
290 const char* nv = (
const char*)newValue;
291 std::istringstream is(nv);
292 is >>vol_name>>r>>unit;
296 else if ( command==DefineExtSourceOnAVolumeExtSurfaceCmd){
299 else if ( command== setExtSourceEMaxCmd){
303 else if ( command==DefineSpherAdjSourceCmd){
307 const char* nv = (
const char*)newValue;
308 std::istringstream is(nv);
309 is >> x>>y>>z>>r>>unit;
317 else if ( command==DefineSpherAdjSourceCenteredOnAVolumeCmd){
321 const char* nv = (
const char*)newValue;
322 std::istringstream is(nv);
323 is >>vol_name>>r>>unit;
327 else if ( command==DefineAdjSourceOnAVolumeExtSurfaceCmd){
331 else if ( command== setAdjSourceEminCmd){
335 else if ( command== setAdjSourceEmaxCmd){
339 else if ( command== setNbOfPrimaryFwdGammasPerEventCmd){
342 else if ( command== setNbOfPrimaryAdjGammasPerEventCmd){
345 else if ( command== setNbOfPrimaryAdjElectronsPerEventCmd){
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameter(G4UIparameter *const newParameter)
void SetNewValue(G4UIcommand *, G4String)
void SetAdjointSourceEmax(G4double Emax)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
CLHEP::Hep3Vector G4ThreeVector
static G4int GetNewIntValue(const char *paramString)
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 SetNbOfPrimaryFwdGammasPerEvent(G4int)
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 SetNbAdjointPrimaryElectronsPerEvent(G4int)
void SetNbAdjointPrimaryGammasPerEvent(G4int)
void SetExtSourceEmax(G4double Emax)
G4AdjointSimMessenger(G4AdjointSimManager *)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void NeglectParticleAsPrimary(const G4String &particle_name)