Geant4  10.02.p03
G4AdjointSimMessenger Class Reference

#include <G4AdjointSimMessenger.hh>

Inheritance diagram for G4AdjointSimMessenger:
Collaboration diagram for G4AdjointSimMessenger:

Public Member Functions

 G4AdjointSimMessenger (G4AdjointSimManager *)
 
 ~G4AdjointSimMessenger ()
 
void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

G4AdjointSimManagertheAdjointRunManager
 
G4UIdirectoryAdjointSimDir
 
G4UIcommandbeamOnCmd
 
G4UIcommandDefineSpherExtSourceCmd
 
G4UIcommandDefineSpherExtSourceCenteredOnAVolumeCmd
 
G4UIcmdWithAStringDefineExtSourceOnAVolumeExtSurfaceCmd
 
G4UIcmdWithADoubleAndUnitsetExtSourceEMaxCmd
 
G4UIcommandDefineSpherAdjSourceCmd
 
G4UIcommandDefineSpherAdjSourceCenteredOnAVolumeCmd
 
G4UIcmdWithAStringDefineAdjSourceOnAVolumeExtSurfaceCmd
 
G4UIcmdWithADoubleAndUnitsetAdjSourceEminCmd
 
G4UIcmdWithADoubleAndUnitsetAdjSourceEmaxCmd
 
G4UIcmdWithAStringConsiderParticleAsPrimaryCmd
 
G4UIcmdWithAStringNeglectParticleAsPrimaryCmd
 
G4UIcmdWithAnIntegersetNbOfPrimaryFwdGammasPerEventCmd
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 128 of file G4AdjointSimMessenger.hh.

Constructor & Destructor Documentation

◆ G4AdjointSimMessenger()

G4AdjointSimMessenger::G4AdjointSimMessenger ( G4AdjointSimManager pAdjointRunManager)

Definition at line 57 of file G4AdjointSimMessenger.cc.

58  : theAdjointRunManager(pAdjointRunManager)
59 /*
60 #ifdef G4MULTITHREADED
61  ,theMTAdjointRunManager(0),beamOnCmd(0)
62 #endif
63 */
64 
65 {
66  AdjointSimDir = new G4UIdirectory("/adjoint/");
67  AdjointSimDir->SetGuidance("Control of the adjoint or reverse monte carlo simulation");
68 
69 
70  //Start and adjoint Run
71  //---------------------
72  //if (G4RunManager::GetRunManager()->GetRunManagerType() == G4RunManager::sequentialRM){
73  beamOnCmd = new G4UIcommand("/adjoint/start_run",this);
74  beamOnCmd->SetGuidance("Start an adjoint Run.");
75  beamOnCmd->SetGuidance("Default number of events to be processed is 1.");
77  G4UIparameter* p1 = new G4UIparameter("numberOfEvent",'i',true);
78  p1->SetDefaultValue(1);
79  p1->SetParameterRange("numberOfEvent >= 0");
81  //}
82 
83  //Commands to define parameters relative to the external source
84  //------------------------------------------------------------
85 
86  G4UIparameter* pos_x_par = new G4UIparameter("X",'d',true);
87 
88  G4UIparameter* pos_y_par = new G4UIparameter("Y",'d',true);
89 
90  G4UIparameter* pos_z_par = new G4UIparameter("Z",'d',true);
91 
92  G4UIparameter* radius_par = new G4UIparameter("R",'d',true);
93 
94  radius_par->SetParameterRange("R >= 0");
95 
96  G4UIparameter* unit_par = new G4UIparameter("unit",'s',true);
97 
98  DefineSpherExtSourceCmd = new G4UIcommand("/adjoint/DefineSphericalExtSource",this);
99  DefineSpherExtSourceCmd->SetGuidance("Define a spherical external source.");
105 
106  G4UIparameter* phys_vol_name_par = new G4UIparameter("phys_vol_name",'s',true);
107 
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");
113 
114  DefineExtSourceOnAVolumeExtSurfaceCmd= new G4UIcmdWithAString("/adjoint/DefineExtSourceOnExtSurfaceOfAVolume",this);
115  DefineExtSourceOnAVolumeExtSurfaceCmd->SetGuidance("Set the external source on the external surface of a physical volume");
117 
118  setExtSourceEMaxCmd = new G4UIcmdWithADoubleAndUnit("/adjoint/SetExtSourceEmax",this);
119  setExtSourceEMaxCmd->SetGuidance("Set the maximum energy of the external source");
120  setExtSourceEMaxCmd->SetParameterName("Emax",false);
123 
124  //Commands to define the adjoint source
125  //------------------------------------------------------------
126 
127  DefineSpherAdjSourceCmd = new G4UIcommand("/adjoint/DefineSphericalAdjSource",this);
128  DefineSpherAdjSourceCmd->SetGuidance("Define a spherical adjoint source.");
134 
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");
140 
141  DefineAdjSourceOnAVolumeExtSurfaceCmd= new G4UIcmdWithAString("/adjoint/DefineAdjSourceOnExtSurfaceOfAVolume",this);
142  DefineAdjSourceOnAVolumeExtSurfaceCmd->SetGuidance("Set the adjoint source on the external surface of physical volume");
144 
145  setAdjSourceEminCmd = new G4UIcmdWithADoubleAndUnit("/adjoint/SetAdjSourceEmin",this);
146  setAdjSourceEminCmd->SetGuidance("Set the minimum energy of the adjoint source");
147  setAdjSourceEminCmd->SetParameterName("Emin",false);
150 
151  setAdjSourceEmaxCmd = new G4UIcmdWithADoubleAndUnit("/adjoint/SetAdjSourceEmax",this);
152  setAdjSourceEmaxCmd->SetGuidance("Set the maximum energy of the adjoint source");
153  setAdjSourceEmaxCmd->SetParameterName("Emax",false);
156 
157  ConsiderParticleAsPrimaryCmd = new G4UIcmdWithAString("/adjoint/ConsiderAsPrimary",this);
158  ConsiderParticleAsPrimaryCmd->SetGuidance("Set the selected particle as primary");
160  ConsiderParticleAsPrimaryCmd->SetCandidates("e- gamma proton ion");
161 
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");
166 
167 
169  new G4UIcmdWithAnInteger("/adjoint/SetNbOfPrimaryFwdGammasPerEvent",this);
170  setNbOfPrimaryFwdGammasPerEventCmd->SetGuidance("Set the nb of primary fwd gamm generated on the adjoint source");
173 
174 
175 
176 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADoubleAndUnit * setExtSourceEMaxCmd
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterRange(const char *theRange)
G4AdjointSimManager * theAdjointRunManager
void SetDefaultValue(const char *theDefaultValue)
G4UIcmdWithAnInteger * setNbOfPrimaryFwdGammasPerEventCmd
void SetUnitCategory(const char *unitCategory)
G4UIcmdWithADoubleAndUnit * setAdjSourceEminCmd
G4UIcommand * DefineSpherExtSourceCenteredOnAVolumeCmd
G4UIcommand * DefineSpherAdjSourceCenteredOnAVolumeCmd
G4UIcmdWithAString * DefineAdjSourceOnAVolumeExtSurfaceCmd
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4UIcmdWithAString * DefineExtSourceOnAVolumeExtSurfaceCmd
G4UIcmdWithADoubleAndUnit * setAdjSourceEmaxCmd
G4UIcmdWithAString * ConsiderParticleAsPrimaryCmd
void SetCandidates(const char *candidateList)
G4UIcmdWithAString * NeglectParticleAsPrimaryCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Here is the call graph for this function:

◆ ~G4AdjointSimMessenger()

G4AdjointSimMessenger::~G4AdjointSimMessenger ( )

Definition at line 222 of file G4AdjointSimMessenger.cc.

223 {
224  if (beamOnCmd) delete beamOnCmd;
225 }

Member Function Documentation

◆ SetNewValue()

void G4AdjointSimMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 230 of file G4AdjointSimMessenger.cc.

231 {
232  if (!command) return;
233  if( command==beamOnCmd )
234  {
235  G4int nev;
236  const char* nv = (const char*)newValue;
237  std::istringstream is(nv);
238  is >> nev ;
240 /*
241 #ifdef G4MULTITHREADED
242  else if (theMTAdjointRunManager) theMTAdjointRunManager->RunAdjointSimulation(nev);
243  else if (theAdjointRunManager) theAdjointRunManager->SwitchToAdjointSimulationMode();
244 #endif
245 */
246  //G4cout<<"G4AdjointSimMessenger::SetNewValue BeamOnCmd out"<<std::endl;
247  }
248  else if ( command==ConsiderParticleAsPrimaryCmd){
250  }
251  else if ( command==NeglectParticleAsPrimaryCmd){
253  }
254 /*
255 #ifdef G4MULTITHREADED
256  if (G4RunManager::GetRunManager()->GetRunManagerType() == G4RunManager::masterRM) return;
257 #endif
258 */
259  if ( command==DefineSpherExtSourceCmd){
260 
261  G4double x,y,z,r;
262  G4String unit;
263  const char* nv = (const char*)newValue;
264  std::istringstream is(nv);
265  is >> x>>y>>z>>r>>unit;
266 
272  }
273  else if ( command==DefineSpherExtSourceCenteredOnAVolumeCmd){
274 
275  G4double r;
276  G4String vol_name, unit;
277  const char* nv = (const char*)newValue;
278  std::istringstream is(nv);
279  is >>vol_name>>r>>unit;
282  }
283  else if ( command==DefineExtSourceOnAVolumeExtSurfaceCmd){
285  }
286  else if ( command== setExtSourceEMaxCmd){
287 
289  }
290  else if ( command==DefineSpherAdjSourceCmd){
291 
292  G4double x,y,z,r;
293  G4String unit;
294  const char* nv = (const char*)newValue;
295  std::istringstream is(nv);
296  is >> x>>y>>z>>r>>unit;
297 
303  }
304  else if ( command==DefineSpherAdjSourceCenteredOnAVolumeCmd){
305 
306  G4double r;
307  G4String vol_name, unit;
308  const char* nv = (const char*)newValue;
309  std::istringstream is(nv);
310  is >>vol_name>>r>>unit;
313  }
314  else if ( command==DefineAdjSourceOnAVolumeExtSurfaceCmd){
315 
317  }
318  else if ( command== setAdjSourceEminCmd){
319 
321  }
322  else if ( command== setAdjSourceEmaxCmd){
323 
325  }
326  else if ( command== setNbOfPrimaryFwdGammasPerEventCmd){
328  }
329 
330 
331 }
G4UIcmdWithADoubleAndUnit * setExtSourceEMaxCmd
void SetAdjointSourceEmax(G4double Emax)
CLHEP::Hep3Vector G4ThreeVector
static G4int GetNewIntValue(const char *paramString)
G4AdjointSimManager * theAdjointRunManager
G4bool DefineSphericalAdjointSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
G4UIcmdWithAnInteger * setNbOfPrimaryFwdGammasPerEventCmd
G4bool DefineSphericalAdjointSource(G4double radius, G4ThreeVector pos)
G4UIcmdWithADoubleAndUnit * setAdjSourceEminCmd
static G4double GetNewDoubleValue(const char *paramString)
int G4int
Definition: G4Types.hh:78
void SetAdjointSourceEmin(G4double Emin)
G4UIcommand * DefineSpherExtSourceCenteredOnAVolumeCmd
Double_t y
static G4double GetValueOf(const G4String &)
G4UIcommand * DefineSpherAdjSourceCenteredOnAVolumeCmd
G4bool DefineAdjointSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
G4UIcmdWithAString * DefineAdjSourceOnAVolumeExtSurfaceCmd
void SetNbOfPrimaryFwdGammasPerEvent(G4int)
void RunAdjointSimulation(G4int nb_evt)
G4UIcmdWithAString * DefineExtSourceOnAVolumeExtSurfaceCmd
G4bool DefineSphericalExtSourceWithCentreAtTheCentreOfAVolume(G4double radius, const G4String &volume_name)
G4bool DefineSphericalExtSource(G4double radius, G4ThreeVector pos)
G4UIcmdWithADoubleAndUnit * setAdjSourceEmaxCmd
static G4RunManager * GetRunManager()
Definition: G4RunManager.cc:79
G4UIcmdWithAString * ConsiderParticleAsPrimaryCmd
void ConsiderParticleAsPrimary(const G4String &particle_name)
G4bool DefineExtSourceOnTheExtSurfaceOfAVolume(const G4String &volume_name)
double G4double
Definition: G4Types.hh:76
G4UIcmdWithAString * NeglectParticleAsPrimaryCmd
void SetExtSourceEmax(G4double Emax)
void NeglectParticleAsPrimary(const G4String &particle_name)
Here is the call graph for this function:

Member Data Documentation

◆ AdjointSimDir

G4UIdirectory* G4AdjointSimMessenger::AdjointSimDir
private

Definition at line 150 of file G4AdjointSimMessenger.hh.

◆ beamOnCmd

G4UIcommand* G4AdjointSimMessenger::beamOnCmd
private

Definition at line 151 of file G4AdjointSimMessenger.hh.

◆ ConsiderParticleAsPrimaryCmd

G4UIcmdWithAString* G4AdjointSimMessenger::ConsiderParticleAsPrimaryCmd
private

Definition at line 166 of file G4AdjointSimMessenger.hh.

◆ DefineAdjSourceOnAVolumeExtSurfaceCmd

G4UIcmdWithAString* G4AdjointSimMessenger::DefineAdjSourceOnAVolumeExtSurfaceCmd
private

Definition at line 160 of file G4AdjointSimMessenger.hh.

◆ DefineExtSourceOnAVolumeExtSurfaceCmd

G4UIcmdWithAString* G4AdjointSimMessenger::DefineExtSourceOnAVolumeExtSurfaceCmd
private

Definition at line 155 of file G4AdjointSimMessenger.hh.

◆ DefineSpherAdjSourceCenteredOnAVolumeCmd

G4UIcommand* G4AdjointSimMessenger::DefineSpherAdjSourceCenteredOnAVolumeCmd
private

Definition at line 159 of file G4AdjointSimMessenger.hh.

◆ DefineSpherAdjSourceCmd

G4UIcommand* G4AdjointSimMessenger::DefineSpherAdjSourceCmd
private

Definition at line 158 of file G4AdjointSimMessenger.hh.

◆ DefineSpherExtSourceCenteredOnAVolumeCmd

G4UIcommand* G4AdjointSimMessenger::DefineSpherExtSourceCenteredOnAVolumeCmd
private

Definition at line 154 of file G4AdjointSimMessenger.hh.

◆ DefineSpherExtSourceCmd

G4UIcommand* G4AdjointSimMessenger::DefineSpherExtSourceCmd
private

Definition at line 153 of file G4AdjointSimMessenger.hh.

◆ NeglectParticleAsPrimaryCmd

G4UIcmdWithAString* G4AdjointSimMessenger::NeglectParticleAsPrimaryCmd
private

Definition at line 167 of file G4AdjointSimMessenger.hh.

◆ setAdjSourceEmaxCmd

G4UIcmdWithADoubleAndUnit* G4AdjointSimMessenger::setAdjSourceEmaxCmd
private

Definition at line 163 of file G4AdjointSimMessenger.hh.

◆ setAdjSourceEminCmd

G4UIcmdWithADoubleAndUnit* G4AdjointSimMessenger::setAdjSourceEminCmd
private

Definition at line 162 of file G4AdjointSimMessenger.hh.

◆ setExtSourceEMaxCmd

G4UIcmdWithADoubleAndUnit* G4AdjointSimMessenger::setExtSourceEMaxCmd
private

Definition at line 156 of file G4AdjointSimMessenger.hh.

◆ setNbOfPrimaryFwdGammasPerEventCmd

G4UIcmdWithAnInteger* G4AdjointSimMessenger::setNbOfPrimaryFwdGammasPerEventCmd
private

Definition at line 169 of file G4AdjointSimMessenger.hh.

◆ theAdjointRunManager

G4AdjointSimManager* G4AdjointSimMessenger::theAdjointRunManager
private

Definition at line 143 of file G4AdjointSimMessenger.hh.


The documentation for this class was generated from the following files: