Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CascadeParamMessenger Class Reference

#include <G4CascadeParamMessenger.hh>

+ Inheritance diagram for G4CascadeParamMessenger:

Public Member Functions

 G4CascadeParamMessenger (G4CascadeParameters *params)
 
virtual ~G4CascadeParamMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Protected Member Functions

void CreateDirectory (const char *path, const char *desc)
 
template<class T >
T * CreateCommand (const G4String &cmd, const G4String &desc)
 
- 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)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 

Additional Inherited Members

- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 

Detailed Description

Definition at line 45 of file G4CascadeParamMessenger.hh.

Constructor & Destructor Documentation

◆ G4CascadeParamMessenger()

G4CascadeParamMessenger::G4CascadeParamMessenger ( G4CascadeParameters params)

Definition at line 45 of file G4CascadeParamMessenger.cc.

46 : G4UImessenger(), theParams(params), cmdDir(0), localCmdDir(false) {
47 // NOTE: Put under same top-level tree as EM
48 CreateDirectory("/process/had/cascade/","Bertini-esque cascade parameters");
49
50 verboseCmd = CreateCommand<G4UIcmdWithAnInteger>("verbose",
51 "Enable information messages");
52 reportCmd = CreateCommand<G4UIcmdWithoutParameter>("report",
53 "Dump all non-default parameter settings");
54 usePreCoCmd = CreateCommand<G4UIcmdWithABool>("usePreCompound",
55 "Use PreCompoundModel for nuclear de-excitation");
56 doCoalCmd = CreateCommand<G4UIcmdWithABool>("doCoalescence",
57 "Apply final-state nucleon clustering");
58 randomFileCmd = CreateCommand<G4UIcmdWithAString>("randomFile",
59 "Save random-engine to file at each interaction");
60 nucUseBestCmd = CreateCommand<G4UIcmdWithABool>("useBestNuclearModel",
61 "Use all physical-units for nuclear structure");
62 nucRad2parCmd = CreateCommand<G4UIcmdWithADouble>("useTwoParamNuclearRadius",
63 "Use R = C1*cbrt(A) + C2/cbrt(A)");
64 nucRadScaleCmd = CreateCommand<G4UIcmdWithADouble>("nuclearRadiusScale",
65 "Set length scale for nuclear model");
66 nucRadSmallCmd = CreateCommand<G4UIcmdWithADouble>("smallNucleusRadius",
67 "Set radius of A<4 nuclei");
68 nucRadAlphaCmd = CreateCommand<G4UIcmdWithADouble>("alphaRadiusScale",
69 "Fraction of small-radius for He-4");
70 nucRadTrailingCmd = CreateCommand<G4UIcmdWithADouble>("shadowningRadius",
71 "Effective nucleon radius for trailing effect");
72 nucFermiScaleCmd = CreateCommand<G4UIcmdWithADouble>("fermiScale",
73 "Scale factor for fermi momentum");
74 nucXsecScaleCmd = CreateCommand<G4UIcmdWithADouble>("crossSectionScale",
75 "Scale fator for total cross-sections");
76 nucGammaQDCmd = CreateCommand<G4UIcmdWithADouble>("gammaQuasiDeutScale",
77 "Scale factor for gamma-quasideutron cross-sections");
78 coalDPmax2Cmd = CreateCommand<G4UIcmdWithADouble>("cluster2DPmax",
79 "Maximum momentum for p-n clusters");
80 coalDPmax3Cmd = CreateCommand<G4UIcmdWithADouble>("cluster3DPmax",
81 "Maximum momentum for ppn/pnn clusters");
82 coalDPmax4Cmd = CreateCommand<G4UIcmdWithADouble>("cluster4DPmax",
83 "Maximum momentum for alpha clusters");
84}
void CreateDirectory(const char *path, const char *desc)

◆ ~G4CascadeParamMessenger()

G4CascadeParamMessenger::~G4CascadeParamMessenger ( )
virtual

Definition at line 86 of file G4CascadeParamMessenger.cc.

86 {
87 delete verboseCmd;
88 delete reportCmd;
89 delete usePreCoCmd;
90 delete doCoalCmd;
91 delete randomFileCmd;
92 delete nucUseBestCmd;
93 delete nucRad2parCmd;
94 delete nucRadScaleCmd;
95 delete nucRadSmallCmd;
96 delete nucRadAlphaCmd;
97 delete nucRadTrailingCmd;
98 delete nucFermiScaleCmd;
99 delete nucXsecScaleCmd;
100 delete nucGammaQDCmd;
101 delete coalDPmax2Cmd;
102 delete coalDPmax3Cmd;
103 delete coalDPmax4Cmd;
104 if (localCmdDir) delete cmdDir;
105}

Member Function Documentation

◆ CreateCommand()

template<class T >
T * G4CascadeParamMessenger::CreateCommand ( const G4String cmd,
const G4String desc 
)
protected

◆ CreateDirectory()

void G4CascadeParamMessenger::CreateDirectory ( const char *  path,
const char *  desc 
)
protected

Definition at line 110 of file G4CascadeParamMessenger.cc.

111 {
113 if (!UIman) return;
114
115 // Directory path must be absolute, prepend "/" if ncessary
116 G4String fullPath = path;
117 if (fullPath(0) != '/') fullPath.prepend("/");
118 if (fullPath(fullPath.length()-1) != '/') fullPath.append("/");
119
120 // See if input path has already been registered
121 G4UIcommand* foundPath = UIman->GetTree()->FindPath(fullPath);
122 if (foundPath) cmdDir = dynamic_cast<G4UIdirectory*>(foundPath);
123
124 if (!cmdDir) { // Create local deletable directory
125 localCmdDir = true;
126 cmdDir = new G4UIdirectory(fullPath.c_str());
127 cmdDir->SetGuidance(desc);
128 }
129}
G4String & append(const G4String &)
G4String & prepend(const char *)
G4UIcommand * FindPath(const char *commandPath) const
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
G4UIcommandTree * GetTree() const
Definition: G4UImanager.hh:197
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:51

Referenced by G4CascadeParamMessenger().

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 134 of file G4CascadeParamMessenger.cc.

134 {
135 if (cmd == reportCmd) theParams->DumpConfig(G4cout);
136
137 if (cmd == verboseCmd)
138 theParams->G4CASCADE_VERBOSE = strdup(arg.c_str());
139
140 if (cmd == usePreCoCmd)
141 theParams->G4CASCADE_USE_PRECOMPOUND = StoB(arg) ? strdup(arg.c_str()) : 0;
142
143 if (cmd == doCoalCmd)
144 theParams->G4CASCADE_DO_COALESCENCE = StoB(arg) ? strdup(arg.c_str()) : 0;
145
146 if (cmd == randomFileCmd)
147 theParams->G4CASCADE_RANDOM_FILE = arg.empty() ? 0 : strdup(arg.c_str());
148
149 if (cmd == nucUseBestCmd)
150 theParams->G4NUCMODEL_USE_BEST = StoB(arg) ? strdup(arg.c_str()) : 0;
151
152 if (cmd == nucRad2parCmd)
153 theParams->G4NUCMODEL_RAD_2PAR = strdup(arg.c_str());
154
155 if (cmd == nucRadScaleCmd)
156 theParams->G4NUCMODEL_RAD_SCALE = strdup(arg.c_str());
157
158 if (cmd == nucRadSmallCmd)
159 theParams->G4NUCMODEL_RAD_SMALL = strdup(arg.c_str());
160
161 if (cmd == nucRadAlphaCmd)
162 theParams->G4NUCMODEL_RAD_ALPHA = strdup(arg.c_str());
163
164 if (cmd == nucRadTrailingCmd)
165 theParams->G4NUCMODEL_RAD_TRAILING = strdup(arg.c_str());
166
167 if (cmd == nucFermiScaleCmd)
168 theParams->G4NUCMODEL_FERMI_SCALE = strdup(arg.c_str());
169
170 if (cmd == nucXsecScaleCmd)
171 theParams->G4NUCMODEL_XSEC_SCALE = strdup(arg.c_str());
172
173 if (cmd == nucGammaQDCmd)
174 theParams->G4NUCMODEL_GAMMAQD = strdup(arg.c_str());
175
176 if (cmd == coalDPmax2Cmd)
177 theParams->DPMAX_2CLUSTER = strdup(arg.c_str());
178
179 if (cmd == coalDPmax3Cmd)
180 theParams->DPMAX_3CLUSTER = strdup(arg.c_str());
181
182 if (cmd == coalDPmax4Cmd)
183 theParams->DPMAX_4CLUSTER = strdup(arg.c_str());
184
185 theParams->Initialize(); // Update numerical values from settings
186}
G4DLLIMPORT std::ostream G4cout
G4bool StoB(G4String s)

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