Geant4 11.1.1
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 ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
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 (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const 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 = 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 40 of file G4GMocrenMessenger.cc.

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

◆ ~G4GMocrenMessenger()

G4GMocrenMessenger::~G4GMocrenMessenger ( )
virtual

Definition at line 140 of file G4GMocrenMessenger.cc.

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

Member Function Documentation

◆ addPointAttributes()

G4bool G4GMocrenMessenger::addPointAttributes ( )
virtual

Definition at line 242 of file G4GMocrenMessenger.cc.

242 {
243 return pointAttributes;
244}

◆ appendGeometry()

G4bool G4GMocrenMessenger::appendGeometry ( )
virtual

Definition at line 238 of file G4GMocrenMessenger.cc.

238 {
239 return geometry;
240}

◆ GetCurrentValue()

G4String G4GMocrenMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 161 of file G4GMocrenMessenger.cc.

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

◆ getDrawVolumeGrid()

virtual G4bool G4GMocrenMessenger::getDrawVolumeGrid ( )
inlinevirtual

Definition at line 65 of file G4GMocrenMessenger.hh.

65{return kDrawVolumeGrid;}

Referenced by G4GMocrenFileSceneHandler::AddSolid().

◆ getEventNumberSuffix()

G4String G4GMocrenMessenger::getEventNumberSuffix ( )
virtual

Definition at line 234 of file G4GMocrenMessenger.cc.

234 {
235 return suffix;
236}

◆ getHitNames()

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

Definition at line 258 of file G4GMocrenMessenger.cc.

258 {
259 return kgMocrenHitNames;
260}

Referenced by G4GMocrenFileSceneHandler::AddCompound().

◆ getHitScorerNames()

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

Definition at line 266 of file G4GMocrenMessenger.cc.

266 {
267 return kgMocrenHitScorerNames;
268}

Referenced by G4GMocrenFileSceneHandler::AddCompound().

◆ getNoVoxels()

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

Definition at line 297 of file G4GMocrenMessenger.cc.

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

◆ getScoringMeshName()

G4String G4GMocrenMessenger::getScoringMeshName ( )
virtual

Definition at line 262 of file G4GMocrenMessenger.cc.

262 {
263 return kgMocrenScoringMeshName;
264}

◆ getVolumeName()

G4String G4GMocrenMessenger::getVolumeName ( )
virtual

Definition at line 254 of file G4GMocrenMessenger.cc.

254 {
255 return kgMocrenVolumeName;
256}

Referenced by G4GMocrenFileSceneHandler::AddSolid().

◆ list()

void G4GMocrenMessenger::list ( )
virtual

Definition at line 270 of file G4GMocrenMessenger.cc.

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

Referenced by SetNewValue().

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 199 of file G4GMocrenMessenger.cc.

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

◆ useSolids()

G4bool G4GMocrenMessenger::useSolids ( )
virtual

Definition at line 246 of file G4GMocrenMessenger.cc.

246 {
247 return solids;
248}

◆ writeInvisibles()

G4bool G4GMocrenMessenger::writeInvisibles ( )
virtual

Definition at line 250 of file G4GMocrenMessenger.cc.

250 {
251 return invisibles;
252}

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