Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RMC01AnalysisManagerMessenger Class Reference

#include <RMC01AnalysisManagerMessenger.hh>

Inheritance diagram for RMC01AnalysisManagerMessenger:
Collaboration diagram for RMC01AnalysisManagerMessenger:

Public Member Functions

 RMC01AnalysisManagerMessenger (RMC01AnalysisManager *)
 
virtual ~RMC01AnalysisManagerMessenger ()
 
virtual 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
 

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 60 of file RMC01AnalysisManagerMessenger.hh.

Constructor & Destructor Documentation

RMC01AnalysisManagerMessenger::RMC01AnalysisManagerMessenger ( RMC01AnalysisManager analysisManager)

Definition at line 49 of file RMC01AnalysisManagerMessenger.cc.

51 : G4UImessenger(),
52  fAnalysisManager(analysisManager),
53  fAnalysisDir(0),
54  fSetPrecisionForConvergenceTestCmd(0),
55  fSetExpSpectrumToNormaliseAdjResCmd(0),
56  fSetPowerLawSpectrumToNormaliseAdjResCmd(0)
57 {
58  fAnalysisDir = new G4UIdirectory("/RMC01/analysis/");
59  fAnalysisDir->SetGuidance("Analysis commands");
60 
61  G4UIparameter* fluence_par = new G4UIparameter("Fluence",'d',true);
62  fluence_par->SetParameterRange("Fluence > 0");
63  fluence_par->SetGuidance("Omnidirectional fluence for primary spectrum");
64 
65  G4UIparameter* fluence_unit_par = new G4UIparameter("Fluence_unit",'s',true);
66  fluence_unit_par->SetParameterCandidates("1/cm2 1/m2 cm-2 m-2");
67 
68  G4UIparameter* alpha_par = new G4UIparameter("alpha",'d',true);
69 
70  G4UIparameter* e0_par = new G4UIparameter("E0",'d',true);
71  e0_par->SetParameterRange("E0 > 0");
72 
73  G4UIparameter* e1_par = new G4UIparameter("E1",'d',true);
74  e1_par->SetParameterRange("E1 > 0");
75 
76  G4UIparameter* e2_par = new G4UIparameter("E2",'d',true);
77  e2_par->SetParameterRange("E2 > 0");
78 
79  G4UIparameter* e_unit_par = new G4UIparameter("E_unit",'s',true);
80  e_unit_par->SetParameterCandidates("eV keV MeV GeV TeV");
81 
82  G4UIparameter* part_name_par = new G4UIparameter("particle_name",'s',true);
83  part_name_par->SetParameterCandidates("e- gamma proton ");
84 
85  fSetPowerLawSpectrumToNormaliseAdjResCmd =
86  new G4UIcommand("/RMC01/analysis/SetPowerLawPrimSpectrumForAdjointSim",this);
87  fSetPowerLawSpectrumToNormaliseAdjResCmd
88  ->SetGuidance("Set the primary spectrum to which adjoint simulation "
89  "results will be normalised as a power law (Ekin^-alpha).");
90  fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(part_name_par);
91  fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(fluence_par);
92  fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(fluence_unit_par);
93  fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(alpha_par);
94  fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(e1_par);
95  fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(e2_par);
96  fSetPowerLawSpectrumToNormaliseAdjResCmd->SetParameter(e_unit_par);
97  fSetPowerLawSpectrumToNormaliseAdjResCmd
99 
100 
101  fSetExpSpectrumToNormaliseAdjResCmd = new G4UIcommand("/RMC01/analysis/"
102  "SetExponentialSpectrumForAdjointSim",this);
103  fSetExpSpectrumToNormaliseAdjResCmd
104  ->SetGuidance("Set the primary spectrum to which adjoint simulation results"
105  "will be normalised as exponential (exp(-Ekin/E0)).");
106  fSetExpSpectrumToNormaliseAdjResCmd
107  ->SetParameter(new G4UIparameter(*part_name_par));
108  fSetExpSpectrumToNormaliseAdjResCmd
109  ->SetParameter(new G4UIparameter(*fluence_par));
110  fSetExpSpectrumToNormaliseAdjResCmd
111  ->SetParameter(new G4UIparameter(*fluence_unit_par));
112  fSetExpSpectrumToNormaliseAdjResCmd
113  ->SetParameter(new G4UIparameter(*e0_par));
114  fSetExpSpectrumToNormaliseAdjResCmd
115  ->SetParameter(new G4UIparameter(*e1_par));
116  fSetExpSpectrumToNormaliseAdjResCmd
117  ->SetParameter(new G4UIparameter(*e2_par));
118  fSetExpSpectrumToNormaliseAdjResCmd
119  ->SetParameter(new G4UIparameter(*e_unit_par));
120  fSetExpSpectrumToNormaliseAdjResCmd
122 
123 
124  fSetPrecisionForConvergenceTestCmd = new G4UIcmdWithADouble("/RMC01/analysis/"
125  "SetExpectedPrecisionOfResults",this);
126  fSetPrecisionForConvergenceTestCmd
127  ->SetGuidance("Set the precision in % that the computed energy deposited "
128  "in the sensitive volume should reached. If this precision is reached"
129  " before the end of the run, the run is aborted and the results are "
130  "registered.");
131  fSetPrecisionForConvergenceTestCmd->SetParameterName("Precision",true);
132  fSetPrecisionForConvergenceTestCmd
134 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetParameterRange(const char *theRange)
void SetParameterCandidates(const char *theString)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *theGuidance)

Here is the call graph for this function:

RMC01AnalysisManagerMessenger::~RMC01AnalysisManagerMessenger ( )
virtual

Definition at line 138 of file RMC01AnalysisManagerMessenger.cc.

139 {
140  delete fAnalysisDir;
141 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 145 of file RMC01AnalysisManagerMessenger.cc.

147 {
148  if( command == fSetPowerLawSpectrumToNormaliseAdjResCmd){
149  G4double alpha,e1,e2,fluence;
150  G4String f_unit,e_unit,part_name;
151  const char* nv = (const char*)newValue;
152  std::istringstream is(nv);
153  is >> part_name>>fluence>>f_unit>>alpha>>e1>>e2>>e_unit;
154 
155  G4double factor_f_unit=1/cm2;
156  if (f_unit == "1/m2" || f_unit =="m-2") factor_f_unit=1/m2;
157  fluence*=factor_f_unit;
158  e1*= G4UnitDefinition::GetValueOf(e_unit);
159  e2*= G4UnitDefinition::GetValueOf(e_unit);
160  fAnalysisManager->SetPrimaryPowerLawSpectrumForAdjointSim(
161  part_name, fluence, alpha, e1, e2);
162  }
163  else if( command == fSetExpSpectrumToNormaliseAdjResCmd){
164  G4double e0,e1,e2,fluence;
165  G4String f_unit,e_unit,part_name;
166  const char* nv = (const char*)newValue;
167  std::istringstream is(nv);
168  is >> part_name>>fluence>>f_unit>>e0>>e1>>e2>>e_unit;
169 
170  G4double factor_f_unit=1/cm2;
171  if (f_unit == "1/m2" || f_unit =="m-2") factor_f_unit=1/m2;
172 
173  fluence*=factor_f_unit;
174  e0*= G4UnitDefinition::GetValueOf(e_unit);
175  e1*= G4UnitDefinition::GetValueOf(e_unit);
176  e2*= G4UnitDefinition::GetValueOf(e_unit);
177 
178  fAnalysisManager->SetPrimaryExpSpectrumForAdjointSim(part_name,
179  fluence, e0, e1, e2);
180 
181  }
182  else if( command == fSetPrecisionForConvergenceTestCmd){
183  fAnalysisManager->SetPrecision(
184  fSetPrecisionForConvergenceTestCmd->GetNewDoubleValue(newValue));
185  }
186 }
void SetPrimaryPowerLawSpectrumForAdjointSim(const G4String &particle_name, G4double fluence, G4double alpha, G4double Emin, G4double Emax)
static constexpr double cm2
Definition: G4SIunits.hh:120
void SetPrimaryExpSpectrumForAdjointSim(const G4String &particle_name, G4double fluence, G4double E0, G4double Emin, G4double Emax)
static G4double GetValueOf(const G4String &)
void SetPrecision(G4double precision)
static G4double GetNewDoubleValue(const char *paramString)
double G4double
Definition: G4Types.hh:76
static const G4double alpha
static constexpr double m2
Definition: G4SIunits.hh:130

Here is the call graph for this function:


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