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

#include <G4GMocrenMessenger.hh>

Inheritance diagram for G4GMocrenMessenger:

Public Member Functions

 G4GMocrenMessenger ()
virtual ~G4GMocrenMessenger ()
virtual G4String GetCurrentValue (G4UIcommand *command)
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
virtual G4String getEventNumberSuffix ()
virtual G4bool appendGeometry ()
virtual G4bool addPointAttributes ()
virtual G4bool useSolids ()
virtual G4bool writeInvisibles ()
virtual G4String getVolumeName ()
virtual std::vector< G4StringgetHitNames ()
virtual G4String getScoringMeshName ()
virtual std::vector< G4StringgetHitScorerNames ()
virtual void list ()
virtual void getNoVoxels (G4int &nx, G4int &ny, G4int &nz) const
virtual G4bool getDrawVolumeGrid ()
Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
virtual ~G4UImessenger ()
G4bool CommandsShouldBeInMaster () const

Additional Inherited Members

Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
G4String LtoS (G4long l)
G4String DtoS (G4double a)
G4String BtoS (G4bool b)
G4int StoI (const G4String &s)
G4long StoL (const G4String &s)
G4double StoD (const G4String &s)
G4bool StoB (const 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 = nullptr
G4String baseDirName = ""
G4bool commandsShouldBeInMaster = false

Detailed Description

Definition at line 45 of file G4GMocrenMessenger.hh.

Constructor & Destructor Documentation

◆ G4GMocrenMessenger()

G4GMocrenMessenger::G4GMocrenMessenger ( )

Definition at line 42 of file G4GMocrenMessenger.cc.

43 : suffix (""), geometry(true), pointAttributes(false), solids(true), invisibles(true),
44 kgMocrenVolumeName("gMocrenVolume"),
45 kgMocrenScoringMeshName("gMocrenScoringMesh"),
46 kDrawVolumeGrid(false) {
47
48 kgMocrenDirectory = new G4UIdirectory("/vis/gMocren/");
49 kgMocrenDirectory->SetGuidance("gMocren commands.");
50
51 setEventNumberSuffixCommand = new G4UIcmdWithAString("/vis/gMocren/setEventNumberSuffix", this);
52 setEventNumberSuffixCommand->SetGuidance("Write separate event files, appended with given suffix.");
53 setEventNumberSuffixCommand->SetGuidance("Define the suffix with a pattern such as '-0000'.");
54 setEventNumberSuffixCommand->SetParameterName("suffix",false);
55 setEventNumberSuffixCommand->SetDefaultValue("");
56 setEventNumberSuffixCommand->AvailableForStates(G4State_Idle);
57
58 appendGeometryCommand = new G4UIcmdWithABool("/vis/gMocren/appendGeometry", this);
59 appendGeometryCommand->SetGuidance("Appends copy of geometry to every event.");
60 appendGeometryCommand->SetParameterName("flag",false);
61 appendGeometryCommand->SetDefaultValue(true);
62 appendGeometryCommand->AvailableForStates(G4State_Idle);
63
64 addPointAttributesCommand = new G4UIcmdWithABool("/vis/gMocren/addPointAttributes", this);
65 addPointAttributesCommand->SetGuidance("Adds point attributes to the points of trajectories.");
66 addPointAttributesCommand->SetParameterName("flag",false);
67 addPointAttributesCommand->SetDefaultValue(false);
68 addPointAttributesCommand->AvailableForStates(G4State_Idle);
69
70 useSolidsCommand = new G4UIcmdWithABool("/vis/gMocren/useSolids", this);
71 useSolidsCommand->SetGuidance("Use GMocren Solids, rather than Geant4 Primitives.");
72 useSolidsCommand->SetParameterName("flag",false);
73 useSolidsCommand->SetDefaultValue(true);
74 useSolidsCommand->AvailableForStates(G4State_Idle);
75
76 /* Not Enabled Yet
77 writeInvisiblesCommand = new G4UIcmdWithABool("/vis/gMocren/writeInvisibles", this);
78 writeInvisiblesCommand->SetGuidance("Write invisible objects.");
79 writeInvisiblesCommand->SetParameterName("flag",false);
80 writeInvisiblesCommand->SetDefaultValue(true);
81 writeInvisiblesCommand->AvailableForStates(G4State_Idle);
82 */
83
84 kSetgMocrenVolumeNameCommand = new G4UIcmdWithAString("/vis/gMocren/setVolumeName", this);
85 kSetgMocrenVolumeNameCommand->SetGuidance("detector name for a volume data in gMocren data.");
86 kSetgMocrenVolumeNameCommand->SetParameterName("kgMocrenVolumeName",false);
87 kSetgMocrenVolumeNameCommand->SetDefaultValue("gMocrenVolume");
88 kSetgMocrenVolumeNameCommand->AvailableForStates(G4State_Idle);
89
90 kAddgMocrenHitNameCommand = new G4UIcmdWithAString("/vis/gMocren/addHitName", this);
91 kAddgMocrenHitNameCommand->SetGuidance("hit name for a dose distribution in gMocren data.");
92 kAddgMocrenHitNameCommand->SetParameterName("kgMocrenHitName",false);
93 kAddgMocrenHitNameCommand->AvailableForStates(G4State_Idle);
94
95 kResetgMocrenHitNameCommand = new G4UIcmdWithoutParameter("/vis/gMocren/resetHitNames", this);
96 kResetgMocrenHitNameCommand->SetGuidance("reset all hit names.");
97 kResetgMocrenHitNameCommand->AvailableForStates(G4State_Idle);
98
99 kSetgMocrenScoringMeshNameCommand = new G4UIcmdWithAString("/vis/gMocren/setScoringMeshName", this);
100 kSetgMocrenScoringMeshNameCommand->SetGuidance("scoring mesh name for a dose distribution in gMocren data.");
101 kSetgMocrenScoringMeshNameCommand->SetParameterName("kgMocrenScoringMeshName",false);
102 kSetgMocrenScoringMeshNameCommand->SetDefaultValue("gMocrenScoringMesh");
103 kSetgMocrenScoringMeshNameCommand->AvailableForStates(G4State_Idle);
104
105 kAddgMocrenHitScorerNameCommand = new G4UIcmdWithAString("/vis/gMocren/addHitScorerName", this);
106 kAddgMocrenHitScorerNameCommand->SetGuidance("hit scorer name for a dose distribution in gMocren data.");
107 kAddgMocrenHitScorerNameCommand->SetParameterName("kgMocrenHitScorerNames",false);
108 kAddgMocrenHitScorerNameCommand->AvailableForStates(G4State_Idle);
109
110 kResetgMocrenHitScorerNameCommand = new G4UIcmdWithoutParameter("/vis/gMocren/resetHitScorerName", this);
111 kResetgMocrenHitScorerNameCommand->SetGuidance("reset all hit scorer names.");
112 kResetgMocrenHitScorerNameCommand->AvailableForStates(G4State_Idle);
113
114 kSetgMocrenNoVoxelsCommand = new G4UIcommand("/vis/gMocren/setNumberOfVoxels", this);
115 kSetgMocrenNoVoxelsCommand->SetGuidance("set number of voxels.");
116 kSetgMocrenNoVoxelsCommand->AvailableForStates(G4State_Idle);
117 G4UIparameter * param = new G4UIparameter("nX", 'i', false);
118 param->SetDefaultValue("1");
119 param->SetParameterRange("nX>0");
120 kSetgMocrenNoVoxelsCommand->SetParameter(param);
121 param = new G4UIparameter("nY", 'i', false);
122 param->SetDefaultValue("1");
123 param->SetParameterRange("nY>0");
124 kSetgMocrenNoVoxelsCommand->SetParameter(param);
125 param = new G4UIparameter("nZ", 'i', false);
126 param->SetDefaultValue("1");
127 param->SetParameterRange("nZ>0");
128 kSetgMocrenNoVoxelsCommand->SetParameter(param);
129
130 kListgMocrenCommand = new G4UIcmdWithoutParameter("/vis/gMocren/list", this);
131 kListgMocrenCommand->SetGuidance("list gMocren command parameters.");
132 kListgMocrenCommand->AvailableForStates(G4State_Idle);
133
134 kDrawVolumeGridCommand = new G4UIcmdWithABool("/vis/gMocren/drawVolumeGrid", this);
135 kDrawVolumeGridCommand->SetGuidance("Add grid of the volume.");
136 kDrawVolumeGridCommand->SetParameterName("kDrawVolumeGrid",false);
137 kDrawVolumeGridCommand->SetDefaultValue(false);
138 kDrawVolumeGridCommand->AvailableForStates(G4State_Idle);
139
140}
@ G4State_Idle
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)

◆ ~G4GMocrenMessenger()

G4GMocrenMessenger::~G4GMocrenMessenger ( )
virtual

Definition at line 142 of file G4GMocrenMessenger.cc.

142 {
143 delete setEventNumberSuffixCommand;
144 delete appendGeometryCommand;
145 delete addPointAttributesCommand;
146 delete useSolidsCommand;
147 // delete writeInvisiblesCommand;
148 delete kSetgMocrenVolumeNameCommand;
149 delete kAddgMocrenHitNameCommand;
150 delete kResetgMocrenHitNameCommand;
151 //
152 delete kSetgMocrenScoringMeshNameCommand;
153 delete kAddgMocrenHitScorerNameCommand;
154 delete kResetgMocrenHitScorerNameCommand;
155 //
156 delete kSetgMocrenNoVoxelsCommand;
157 //
158 delete kgMocrenDirectory;
159 //
160 delete kDrawVolumeGridCommand;
161}

Member Function Documentation

◆ addPointAttributes()

G4bool G4GMocrenMessenger::addPointAttributes ( )
virtual

Definition at line 244 of file G4GMocrenMessenger.cc.

244 {
245 return pointAttributes;
246}

◆ appendGeometry()

G4bool G4GMocrenMessenger::appendGeometry ( )
virtual

Definition at line 240 of file G4GMocrenMessenger.cc.

240 {
241 return geometry;
242}

◆ GetCurrentValue()

G4String G4GMocrenMessenger::GetCurrentValue ( G4UIcommand * command)
virtual

Reimplemented from G4UImessenger.

Definition at line 163 of file G4GMocrenMessenger.cc.

163 {
164 if (command==setEventNumberSuffixCommand) {
165 return suffix;
166 } else if (command==appendGeometryCommand) {
167 return appendGeometryCommand->ConvertToString(geometry);
168 } else if (command==addPointAttributesCommand) {
169 return addPointAttributesCommand->ConvertToString(pointAttributes);
170 } else if (command==useSolidsCommand) {
171 return useSolidsCommand->ConvertToString(solids);
172 // } else if (command==writeInvisiblesCommand) {
173 // return writeInvisiblesCommand->ConvertToString(invisibles);
174 } else if (command == kSetgMocrenVolumeNameCommand) {
175 return kgMocrenVolumeName;
176 } else if (command == kAddgMocrenHitNameCommand) {
177 G4String strval;
178 std::vector<G4String>::iterator itr = kgMocrenHitNames.begin();
179 for(; itr != kgMocrenHitNames.end(); itr++) {
180 strval += *itr;
181 strval += " ";
182 }
183 return strval;
184 } else if (command == kSetgMocrenScoringMeshNameCommand) {
185 return kgMocrenScoringMeshName;
186 } else if (command == kAddgMocrenHitScorerNameCommand) {
187 G4String strval;
188 std::vector<G4String>::iterator itr = kgMocrenHitScorerNames.begin();
189 for(; itr != kgMocrenHitScorerNames.end(); itr++) {
190 strval += *itr;
191 strval += " ";
192 }
193 return strval;
194 } else if (command==kDrawVolumeGridCommand) {
195 return kDrawVolumeGridCommand->ConvertToString(kDrawVolumeGrid);
196 } else {
197 return "";
198 }
199}

◆ getDrawVolumeGrid()

virtual G4bool G4GMocrenMessenger::getDrawVolumeGrid ( )
inlinevirtual

Definition at line 65 of file G4GMocrenMessenger.hh.

65{return kDrawVolumeGrid;}

◆ getEventNumberSuffix()

G4String G4GMocrenMessenger::getEventNumberSuffix ( )
virtual

Definition at line 236 of file G4GMocrenMessenger.cc.

236 {
237 return suffix;
238}

◆ getHitNames()

std::vector< G4String > G4GMocrenMessenger::getHitNames ( )
virtual

Definition at line 260 of file G4GMocrenMessenger.cc.

260 {
261 return kgMocrenHitNames;
262}

◆ getHitScorerNames()

std::vector< G4String > G4GMocrenMessenger::getHitScorerNames ( )
virtual

Definition at line 268 of file G4GMocrenMessenger.cc.

268 {
269 return kgMocrenHitScorerNames;
270}

◆ getNoVoxels()

void G4GMocrenMessenger::getNoVoxels ( G4int & nx,
G4int & ny,
G4int & nz ) const
virtual

Definition at line 299 of file G4GMocrenMessenger.cc.

299 {
300 nx = kgMocrenNoVoxels[0];
301 ny = kgMocrenNoVoxels[1];
302 nz = kgMocrenNoVoxels[2];
303}

◆ getScoringMeshName()

G4String G4GMocrenMessenger::getScoringMeshName ( )
virtual

Definition at line 264 of file G4GMocrenMessenger.cc.

264 {
265 return kgMocrenScoringMeshName;
266}

◆ getVolumeName()

G4String G4GMocrenMessenger::getVolumeName ( )
virtual

Definition at line 256 of file G4GMocrenMessenger.cc.

256 {
257 return kgMocrenVolumeName;
258}

◆ list()

void G4GMocrenMessenger::list ( )
virtual

Definition at line 272 of file G4GMocrenMessenger.cc.

272 {
273 G4cout << " Current valuess of gMocren command parameters:" << G4endl;
274 //
275 G4cout << " volume name: " << kgMocrenVolumeName << G4endl;
276 //
277 G4cout << " hit names: ";
278 if(kgMocrenHitNames.size() > 0) {
279 std::vector<G4String>::iterator itr = kgMocrenHitNames.begin();
280 for(; itr != kgMocrenHitNames.end(); itr++)
281 G4cout << *itr << " " << G4endl;
282 } else {
283 G4cout << G4endl;
284 }
285 //
286 G4cout << " scoring mesh name: " << kgMocrenScoringMeshName << G4endl;
287 //
288 G4cout << " scorer names: ";
289 if(kgMocrenHitScorerNames.size() > 0) {
290 std::vector<G4String>::iterator itr = kgMocrenHitScorerNames.begin();
291 for(; itr != kgMocrenHitScorerNames.end(); itr++)
292 G4cout << *itr << " " << G4endl;
293 } else {
294 G4cout << G4endl;
295 }
296 G4cout << G4endl;
297}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

Referenced by SetNewValue().

◆ SetNewValue()

void G4GMocrenMessenger::SetNewValue ( G4UIcommand * command,
G4String newValue )
virtual

Reimplemented from G4UImessenger.

Definition at line 201 of file G4GMocrenMessenger.cc.

201 {
202 if (command==setEventNumberSuffixCommand) {
203 suffix = std::move(newValue);
204 } else if (command==appendGeometryCommand) {
205 geometry = appendGeometryCommand->GetNewBoolValue(newValue);
206 } else if (command==addPointAttributesCommand) {
207 pointAttributes = addPointAttributesCommand->GetNewBoolValue(newValue);
208 } else if (command==useSolidsCommand) {
209 solids = useSolidsCommand->GetNewBoolValue(newValue);
210 // } else if (command==writeInvisiblesCommand) {
211 // invisibles = writeInvisiblesCommand->GetNewBoolValue(newValue);
212 } else if (command == kSetgMocrenVolumeNameCommand) {
213 kgMocrenVolumeName = std::move(newValue);
214 } else if (command == kAddgMocrenHitNameCommand) {
215 kgMocrenHitNames.push_back(std::move(newValue));
216 } else if (command == kResetgMocrenHitNameCommand) {
217 kgMocrenHitNames.clear();
218 } else if (command == kSetgMocrenScoringMeshNameCommand) {
219 kgMocrenScoringMeshName = std::move(newValue);
220 } else if (command == kAddgMocrenHitScorerNameCommand) {
221 kgMocrenHitScorerNames.push_back(std::move(newValue));
222 } else if (command == kResetgMocrenHitScorerNameCommand) {
223 kgMocrenHitScorerNames.clear();
224 } else if (command == kListgMocrenCommand) {
225 list();
226 } else if (command == kSetgMocrenNoVoxelsCommand) {
227 G4Tokenizer next(newValue);
228 for(int i = 0; i < 3; i++) {
229 kgMocrenNoVoxels[i] = StoI(next());
230 }
231 } else if (command==kDrawVolumeGridCommand) {
232 kDrawVolumeGrid = kDrawVolumeGridCommand->GetNewBoolValue(newValue);
233 }
234}
G4int StoI(const G4String &s)

◆ useSolids()

G4bool G4GMocrenMessenger::useSolids ( )
virtual

Definition at line 248 of file G4GMocrenMessenger.cc.

248 {
249 return solids;
250}

◆ writeInvisibles()

G4bool G4GMocrenMessenger::writeInvisibles ( )
virtual

Definition at line 252 of file G4GMocrenMessenger.cc.

252 {
253 return invisibles;
254}

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