Geant4-11
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes
G4ScoringMessenger Class Reference

#include <G4ScoringMessenger.hh>

Inheritance diagram for G4ScoringMessenger:
G4UImessenger

Public Member Functions

G4bool CommandsShouldBeInMaster () const
 
 G4ScoringMessenger (G4ScoringManager *SManager)
 
G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator!= (const G4UImessenger &messenger) const
 
G4bool operator== (const G4UImessenger &messenger) const
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
 ~G4ScoringMessenger ()
 

Protected Member Functions

void AddUIcommand (G4UIcommand *newCommand)
 
G4String BtoS (G4bool b)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
G4String DtoS (G4double a)
 
void Fill1D (G4UIcommand *cmd, G4String newValues)
 
void FillTokenVec (G4String newValues, G4TokenVec &token)
 
G4String ItoS (G4int i)
 
void MeshBinCommand (G4VScoringMesh *mesh, G4TokenVec &token)
 
G4bool StoB (G4String s)
 
G4double StoD (G4String s)
 
G4int StoI (G4String s)
 
G4long StoL (G4String s)
 

Protected Attributes

G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Private Attributes

G4UIdirectorycolorMapDir
 
G4UIcommandcolorMapMinMaxCmd
 
G4UIcommanddrawCmd
 
G4UIcommanddrawColumnCmd
 
G4UIcommanddumpAllQtsToFileCmd
 
G4UIcommanddumpAllQtsWithFactorCmd
 
G4UIcmdWithoutParameterdumpCmd
 
G4UIcommanddumpQtyToFileCmd
 
G4UIcommanddumpQtyWithFactorCmd
 
G4UIcommandfill1DCmd
 
G4UIcmdWithAStringfloatMinMaxCmd
 
G4ScoringManagerfSMan
 
G4UIcmdWithoutParameterlistCmd
 
G4UIcmdWithoutParameterlistColorMapCmd
 
G4UIcommandmBinCmd
 
G4UIcmdWith3VectorAndUnitmBoxSizeCmd
 
G4UIcommandmCylinderAngleCmd
 
G4UIcmdWithADoubleAndUnitmCylinderRMinCmd
 
G4UIcommandmCylinderSizeCmd
 
G4UIcmdWithAStringmeshBoxCreateCmd
 
G4UIcmdWithoutParametermeshClsCmd
 
G4UIdirectorymeshCreateDir
 
G4UIcmdWithAStringmeshCylinderCreateCmd
 
G4UIdirectorymeshDir
 
G4UIcmdWithAStringmeshOpnCmd
 
G4UIcommandmeshRWLogVolCreateCmd
 
G4UIdirectorymRotDir
 
G4UIcmdWithADoubleAndUnitmRotXCmd
 
G4UIcmdWithADoubleAndUnitmRotYCmd
 
G4UIcmdWithADoubleAndUnitmRotZCmd
 
G4UIdirectorymTransDir
 
G4UIcmdWithoutParametermTResetCmd
 
G4UIcmdWith3VectorAndUnitmTXyzCmd
 
G4UIcommandprobeCreateCmd
 
G4UIdirectoryprobeDir
 
G4UIcmdWith3VectorAndUnitprobeLocateCmd
 
G4UIcmdWithAStringprobeMatCmd
 
G4UIdirectoryscoreDir
 
G4UIcmdWithAnIntegerverboseCmd
 

Detailed Description

Definition at line 61 of file G4ScoringMessenger.hh.

Constructor & Destructor Documentation

◆ G4ScoringMessenger()

G4ScoringMessenger::G4ScoringMessenger ( G4ScoringManager SManager)

Definition at line 50 of file G4ScoringMessenger.cc.

51 : fSMan(SManager)
52{
53 G4UIparameter* param = nullptr;
54
55 scoreDir = new G4UIdirectory("/score/");
56 scoreDir->SetGuidance("Interactive scoring commands.");
57
58 listCmd = new G4UIcmdWithoutParameter("/score/list", this);
59 listCmd->SetGuidance("List scoring worlds.");
60
61 dumpCmd = new G4UIcmdWithoutParameter("/score/dump", this);
62 dumpCmd->SetGuidance("Dump results of scorers.");
63
64 verboseCmd = new G4UIcmdWithAnInteger("/score/verbose", this);
65 verboseCmd->SetGuidance("Verbosity.");
66 verboseCmd->SetGuidance(" 0) errors or warnings,");
67 verboseCmd->SetGuidance(" 1) information with 0)");
68
69 meshCreateDir = new G4UIdirectory("/score/create/");
70 meshCreateDir->SetGuidance(" Mesh creation commands.");
71 //
72 // Mesh commands
73 meshBoxCreateCmd = new G4UIcmdWithAString("/score/create/boxMesh", this);
74 meshBoxCreateCmd->SetGuidance("Create scoring box mesh.");
75 meshBoxCreateCmd->SetParameterName("MeshName", false);
76 //
78 new G4UIcmdWithAString("/score/create/cylinderMesh", this);
79 meshCylinderCreateCmd->SetGuidance("Create scoring mesh.");
80 meshCylinderCreateCmd->SetParameterName("MeshName", false);
81 //
82 // meshSphereCreateCmd = new
83 // G4UIcmdWithAString("/score/create/sphereMesh",this);
84 // meshSphereCreateCmd->SetGuidance("Create scoring mesh.");
85 // meshSphereCreateCmd->SetParameterName("MeshName",false);
86 //
88 new G4UIcommand("/score/create/realWorldLogVol", this);
90 "Define scorers to a logical volume defined in the real world.");
92 " - Name of the specified logical volume is used as the mesh name.");
94 " - /score/mesh commands do not affect for this mesh.");
96 " - If copyNumberLevel is set, the copy number of that-level higher");
98 " in the geometrical hierarchy is used as the index.");
99 param = new G4UIparameter("logVol", 's', false);
101 param = new G4UIparameter("copyNumberLevel", 'i', true);
102 param->SetParameterRange("copyNumberLevel>=0");
103 param->SetDefaultValue(0);
105 //
106 probeCreateCmd = new G4UIcommand("/score/create/probe", this);
107 probeCreateCmd->SetGuidance("Define scoring probe.");
109 " halfSize defines the half-width of the probing cube.");
110 param = new G4UIparameter("pname", 's', false);
112 param = new G4UIparameter("halfSize", 'd', false);
114 param = new G4UIparameter("unit", 's', true);
115 param->SetDefaultUnit("mm");
117 param = new G4UIparameter("checkOverlap", 'b', true);
118 param->SetDefaultValue(false);
120 //
121 meshOpnCmd = new G4UIcmdWithAString("/score/open", this);
122 meshOpnCmd->SetGuidance("Open scoring mesh.");
123 meshOpnCmd->SetParameterName("MeshName", false);
124 //
125 meshClsCmd = new G4UIcmdWithoutParameter("/score/close", this);
126 meshClsCmd->SetGuidance("Close scoring mesh.");
127 //
128 // meshActCmd = new G4UIcmdWithABool("/score/mesh/activate",this);
129 // meshActCmd->SetGuidance("Activate scoring mesh.");
130 // meshActCmd->SetParameterName("MeshName",false);
131 //
132 meshDir = new G4UIdirectory("/score/mesh/");
133 meshDir->SetGuidance(" Mesh processing commands.");
134 //
135 mBoxSizeCmd = new G4UIcmdWith3VectorAndUnit("/score/mesh/boxSize", this);
136 mBoxSizeCmd->SetGuidance("Define size of the scoring mesh.");
137 mBoxSizeCmd->SetGuidance("Dx Dy Dz unit");
138 mBoxSizeCmd->SetParameterName("Di", "Dj", "Dk", false, false);
139 mBoxSizeCmd->SetRange("Di>0. && Dj>0. && Dk>0.");
141 //
142 mCylinderSizeCmd = new G4UIcommand("/score/mesh/cylinderSize", this);
143 mCylinderSizeCmd->SetGuidance("Define size of the scoring mesh.");
144 mCylinderSizeCmd->SetGuidance("R Dz unit");
145 param = new G4UIparameter("R", 'd', false);
146 param->SetParameterRange("R>0");
148 param = new G4UIparameter("Dz", 'd', false);
149 param->SetParameterRange("Dz>0");
151 param = new G4UIparameter("unit", 's', true);
152 param->SetDefaultUnit("mm");
154 //
156 new G4UIcmdWithADoubleAndUnit("/score/mesh/cylinderRMin", this);
157 mCylinderRMinCmd->SetGuidance("Define the inner radius of the tube mesh.");
158 mCylinderRMinCmd->SetGuidance("This command is not needed for cylinder mesh");
159 mCylinderRMinCmd->SetParameterName("RMin", false, false);
160 mCylinderRMinCmd->SetRange("RMin>=0.");
162 //
163 mCylinderAngleCmd = new G4UIcommand("/score/mesh/cylinderAngles", this);
165 "Define starting angle and span for tube segment mesh.");
167 "This command is not needed for cylinder mesh");
168 param = new G4UIparameter("startPhi", 'd', false);
170 param = new G4UIparameter("deltaPhi", 'd', false);
171 param->SetParameterRange("deltaPhi>0.");
173 param = new G4UIparameter("unit", 's', true);
174 param->SetDefaultUnit("deg");
176 //
177 // Division command
178 mBinCmd = new G4UIcommand("/score/mesh/nBin", this);
179 mBinCmd->SetGuidance("Define segments of the scoring mesh.");
180 mBinCmd->SetGuidance("[usage] /score/mesh/nBin");
181 mBinCmd->SetGuidance(" In case of boxMesh, parameters are given in");
182 mBinCmd->SetGuidance(" Ni :(int) Number of bins i (in x-axis) ");
183 mBinCmd->SetGuidance(" Nj :(int) Number of bins j (in y-axis) ");
184 mBinCmd->SetGuidance(" Nk :(int) Number of bins k (in z-axis) ");
185 mBinCmd->SetGuidance(" In case of cylinderMesh, parameters are given in");
186 mBinCmd->SetGuidance(" Nr :(int) Number of bins in radial axis ");
187 mBinCmd->SetGuidance(" Nz :(int) Number of bins in z axis ");
188 mBinCmd->SetGuidance(" Nphi:(int) Number of bins in phi axis ");
189 // mBinCmd->SetGuidance(" Axis:(int) Axis of division ");
190 // mBinCmd->SetGuidance(" P1..Pn-1 :(double) \"paramter from P1 to Pn-1 for
191 // division.\"");
192 param = new G4UIparameter("Ni", 'i', false);
193 param->SetDefaultValue("1");
194 param->SetParameterRange("Ni>0");
195 mBinCmd->SetParameter(param);
196 param = new G4UIparameter("Nj", 'i', false);
197 param->SetDefaultValue("1");
198 param->SetParameterRange("Nj>0");
199 mBinCmd->SetParameter(param);
200 param = new G4UIparameter("Nk", 'i', false);
201 param->SetDefaultValue("1");
202 mBinCmd->SetParameter(param);
203 param->SetParameterRange("Nk>0");
204 // param = new G4UIparameter("Axis",'i',true);
205 // param->SetDefaultValue("3");
206 // mBinCmd->SetParameter(param);
207 //
208 // Placement command
209 mTransDir = new G4UIdirectory("/score/mesh/translate/");
210 mTransDir->SetGuidance("Mesh translation commands.");
211 //
212 mTResetCmd = new G4UIcmdWithoutParameter("/score/mesh/translate/reset", this);
213 mTResetCmd->SetGuidance("Reset translated position of the scoring mesh.");
214 //
215 mTXyzCmd = new G4UIcmdWith3VectorAndUnit("/score/mesh/translate/xyz", this);
216 mTXyzCmd->SetGuidance("Translate the scoring mesh.");
217 mTXyzCmd->SetParameterName("X", "Y", "Z", false, false);
219 //
220 mRotDir = new G4UIdirectory("/score/mesh/rotate/");
221 mRotDir->SetGuidance("Mesh rotation commands.");
222 //
223 // mRResetCmd = new G4UIcmdWithoutParameter("/score/mesh/rotate/reset",this);
224 // mRResetCmd->SetGuidance("Reset rotation angles of the scoring mesh.");
225 //
226 mRotXCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateX", this);
227 mRotXCmd->SetGuidance("Rotate the scoring mesh in X axis.");
228 mRotXCmd->SetParameterName("Rx", false);
229 mRotXCmd->SetDefaultUnit("deg");
230 //
231 mRotYCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateY", this);
232 mRotYCmd->SetGuidance("Rotate the scoring mesh in Y axis.");
233 mRotYCmd->SetParameterName("Ry", false);
234 mRotYCmd->SetDefaultUnit("deg");
235 //
236 mRotZCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateZ", this);
237 mRotZCmd->SetGuidance("Rotate the scoring mesh in Z axis.");
238 mRotZCmd->SetParameterName("Rz", false);
239 mRotZCmd->SetDefaultUnit("deg");
240 //
241 probeDir = new G4UIdirectory("/score/probe/");
242 probeDir->SetGuidance("Probe commands");
243
244 probeMatCmd = new G4UIcmdWithAString("/score/probe/material", this);
245 probeMatCmd->SetGuidance("Specify a material to the probe cube.");
246 probeMatCmd->SetGuidance("Material name has to be taken from G4NistManager.");
247 probeMatCmd->SetGuidance("Once this command is used, the specified material "
248 "overlays the material in the mass geometry");
249 probeMatCmd->SetGuidance("with \"Layered Mass Geometry\" mechanism so that "
250 "physics quantities such as energy deposition");
251 probeMatCmd->SetGuidance("or dose will be calculated with this material.");
252 probeMatCmd->SetGuidance("To switch-off this overlaying, use \"none\".");
253 probeMatCmd->SetParameterName("matName", true);
256
257 probeLocateCmd = new G4UIcmdWith3VectorAndUnit("/score/probe/locate", this);
259 "Locate a probe in the global coordinate system.");
260 probeLocateCmd->SetParameterName("x", "y", "z", false);
263
264 // Draw Scoring result
265 drawCmd = new G4UIcommand("/score/drawProjection", this);
266 drawCmd->SetGuidance("Draw projection(s) of scored quantities.");
268 "Parameter <proj> specified which projection(s) to be drawn.");
270 " 100 : xy-plane, 010 : yz-plane, 001 : zx-plane -- default 111");
272 " 100 : N/A, 010 : z_phi-plane, 001 : r_phi-plane -- default 111");
273 param = new G4UIparameter("meshName", 's', false);
274 drawCmd->SetParameter(param);
275 param = new G4UIparameter("psName", 's', false);
276 drawCmd->SetParameter(param);
277 param = new G4UIparameter("colorMapName", 's', true);
278 param->SetDefaultValue("defaultLinearColorMap");
279 drawCmd->SetParameter(param);
280 param = new G4UIparameter("proj", 'i', true);
281 param->SetDefaultValue(111);
282 drawCmd->SetParameter(param);
284
285 // Draw column
286 drawColumnCmd = new G4UIcommand("/score/drawColumn", this);
287 drawColumnCmd->SetGuidance("Draw a cell column.");
288 drawColumnCmd->SetGuidance(" plane = 0 : x-y, 1: y-z, 2: z-x for box mesh");
290 " 0 : z-phi, 1: r-phi, 2: r-z for cylinder mesh");
291 param = new G4UIparameter("meshName", 's', false);
293 param = new G4UIparameter("psName", 's', false);
295 param = new G4UIparameter("plane", 'i', false);
296 param->SetParameterRange("plane>=0 && plane<=2");
298 param = new G4UIparameter("column", 'i', false);
300 param = new G4UIparameter("colorMapName", 's', true);
301 param->SetDefaultValue("defaultLinearColorMap");
304
305 colorMapDir = new G4UIdirectory("/score/colorMap/");
306 colorMapDir->SetGuidance("Color map commands.");
307
309 new G4UIcmdWithoutParameter("/score/colorMap/listScoreColorMaps", this);
310 listColorMapCmd->SetGuidance("List registered score color maps.");
312
313 floatMinMaxCmd = new G4UIcmdWithAString("/score/colorMap/floatMinMax", this);
315 "Min/Max of the color map is calculated according to the actual scores.");
316 floatMinMaxCmd->SetParameterName("colorMapName", true, false);
317 floatMinMaxCmd->SetDefaultValue("defaultLinearColorMap");
319
320 colorMapMinMaxCmd = new G4UIcommand("/score/colorMap/setMinMax", this);
321 colorMapMinMaxCmd->SetGuidance("Define min/max value of the color map.");
322 param = new G4UIparameter("colorMapMame", 's', true);
323 param->SetDefaultValue("defaultLinearColorMap");
325 param = new G4UIparameter("minValue", 'd', false);
327 param = new G4UIparameter("maxValue", 'd', false);
330
331 /*
332 chartCmd = new G4UIcommand("/score/drawChart",this);
333 chartCmd->SetGuidance("Draw color chart on the screen.");
334 chartCmd->SetGuidance("[usage] /score/drawChart");
335 chartCmd->SetGuidance(" mesh :(String) Mesh name.");
336 chartCmd->SetGuidance(" psname :(String) PS name.");
337 chartCmd->SetGuidance(" On/Off :(boolean) On or Off the color chart.");
338 chartCmd->SetGuidance(" scale :(String) default=linear, or log ");
339 param = new G4UIparameter("meshName",'s',false);
340 chartCmd->SetParameter(param);
341 param = new G4UIparameter("psName",'s',false);
342 chartCmd->SetParameter(param);
343 param = new G4UIparameter("On",'s',true);
344 param->SetDefaultValue("true");
345 chartCmd->SetParameter(param);
346 param = new G4UIparameter("scale",'s',true);
347 param->SetDefaultValue("linear");
348 chartCmd->SetParameter(param);
349 */
350
351 // Dump a scored quantity
352 dumpQtyToFileCmd = new G4UIcommand("/score/dumpQuantityToFile", this);
353 dumpQtyToFileCmd->SetGuidance("Dump one scored quantity to file.");
354 param = new G4UIparameter("meshName", 's', false);
356 param = new G4UIparameter("psName", 's', false);
358 param = new G4UIparameter("fileName", 's', false);
360 param = new G4UIparameter("option", 's', true);
363
364 dumpQtyWithFactorCmd = new G4UIcommand("/score/dumpQuantityWithFactor", this);
365 dumpQtyWithFactorCmd->SetGuidance("Dump one scored quantity to file.");
367 "Each value is multiplied by the specified factor.");
368 param = new G4UIparameter("meshName", 's', false);
370 param = new G4UIparameter("psName", 's', false);
372 param = new G4UIparameter("fileName", 's', false);
374 param = new G4UIparameter("factor", 'd', false);
375 param->SetParameterRange("factor>0.");
377 param = new G4UIparameter("option", 's', true);
380
381 // Dump all scored quantities
382 dumpAllQtsToFileCmd = new G4UIcommand("/score/dumpAllQuantitiesToFile", this);
383 dumpAllQtsToFileCmd->SetGuidance("Dump all quantities of the mesh to file.");
384 param = new G4UIparameter("meshName", 's', false);
386 param = new G4UIparameter("fileName", 's', false);
388 param = new G4UIparameter("option", 's', true);
391
393 new G4UIcommand("/score/dumpAllQuantitiesWithFactor", this);
395 "Dump all quantities of the mesh to file.");
397 "Each value is multiplied by the specified factor.");
398 param = new G4UIparameter("meshName", 's', false);
400 param = new G4UIparameter("fileName", 's', false);
402 param = new G4UIparameter("factor", 'd', false);
403 param->SetParameterRange("factor>0.");
405 param = new G4UIparameter("option", 's', true);
408
409 fill1DCmd = new G4UIcommand("/score/fill1D", this);
410 fill1DCmd->SetGuidance("Let a primitive scorer fill 1-D histogram");
411 fill1DCmd->SetGuidance("Before using this command, primitive scorer must be "
412 "defined and assigned.");
413 fill1DCmd->SetGuidance("Also before using this command, a histogram has to "
414 "be defined by /analysis/h1/create command.");
416 "This command is available only for real-world volume or probe.");
417 fill1DCmd->SetGuidance("Please note that this command has to be applied to "
418 "each copy number of the scoring volume.");
419 fill1DCmd->SetGuidance("If same histogram ID is used more than once, more "
420 "than one scorers fill that histogram.");
421 param = new G4UIparameter("histID", 'i', false);
422 fill1DCmd->SetParameter(param);
423 param = new G4UIparameter("meshName", 's', false);
424 fill1DCmd->SetParameter(param);
425 param = new G4UIparameter("scorerName", 's', false);
426 fill1DCmd->SetParameter(param);
427 param = new G4UIparameter("copyNo", 'i', true);
428 param->SetDefaultValue(0);
429 fill1DCmd->SetParameter(param);
430}
G4UIcmdWith3VectorAndUnit * mBoxSizeCmd
G4UIcmdWith3VectorAndUnit * probeLocateCmd
G4UIcommand * mCylinderAngleCmd
G4UIcommand * dumpQtyToFileCmd
G4UIcmdWithoutParameter * dumpCmd
G4UIcmdWithADoubleAndUnit * mRotXCmd
G4ScoringManager * fSMan
G4UIcmdWithAString * meshBoxCreateCmd
G4UIdirectory * colorMapDir
G4UIdirectory * meshDir
G4UIcmdWithoutParameter * mTResetCmd
G4UIdirectory * scoreDir
G4UIcmdWithAnInteger * verboseCmd
G4UIdirectory * mTransDir
G4UIcommand * probeCreateCmd
G4UIcommand * dumpAllQtsToFileCmd
G4UIcommand * drawColumnCmd
G4UIcmdWith3VectorAndUnit * mTXyzCmd
G4UIcmdWithADoubleAndUnit * mRotYCmd
G4UIcommand * mCylinderSizeCmd
G4UIcmdWithAString * meshOpnCmd
G4UIcmdWithoutParameter * meshClsCmd
G4UIcmdWithADoubleAndUnit * mCylinderRMinCmd
G4UIcommand * dumpAllQtsWithFactorCmd
G4UIcmdWithAString * probeMatCmd
G4UIdirectory * mRotDir
G4UIcommand * dumpQtyWithFactorCmd
G4UIcommand * colorMapMinMaxCmd
G4UIdirectory * probeDir
G4UIcmdWithAString * meshCylinderCreateCmd
G4UIdirectory * meshCreateDir
G4UIcmdWithoutParameter * listCmd
G4UIcmdWithADoubleAndUnit * mRotZCmd
G4UIcommand * meshRWLogVolCreateCmd
G4UIcmdWithoutParameter * listColorMapCmd
G4UIcmdWithAString * floatMinMaxCmd
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:172
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:146
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void SetRange(const char *rs)
Definition: G4UIcommand.hh:120
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)
void SetDefaultUnit(const char *theDefaultUnit)

References colorMapDir, colorMapMinMaxCmd, drawCmd, drawColumnCmd, dumpAllQtsToFileCmd, dumpAllQtsWithFactorCmd, dumpCmd, dumpQtyToFileCmd, dumpQtyWithFactorCmd, fill1DCmd, floatMinMaxCmd, listCmd, listColorMapCmd, mBinCmd, mBoxSizeCmd, mCylinderAngleCmd, mCylinderRMinCmd, mCylinderSizeCmd, meshBoxCreateCmd, meshClsCmd, meshCreateDir, meshCylinderCreateCmd, meshDir, meshOpnCmd, meshRWLogVolCreateCmd, mRotDir, mRotXCmd, mRotYCmd, mRotZCmd, mTransDir, mTResetCmd, mTXyzCmd, probeCreateCmd, probeDir, probeLocateCmd, probeMatCmd, scoreDir, G4UIcmdWith3VectorAndUnit::SetDefaultUnit(), G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIparameter::SetDefaultUnit(), G4UIcmdWithAString::SetDefaultValue(), G4UIparameter::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcommand::SetParameter(), G4UIcmdWithADoubleAndUnit::SetParameterName(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWith3VectorAndUnit::SetParameterName(), G4UIparameter::SetParameterRange(), G4UIcommand::SetRange(), G4UIcommand::SetToBeBroadcasted(), and verboseCmd.

◆ ~G4ScoringMessenger()

G4ScoringMessenger::~G4ScoringMessenger ( )

Definition at line 432 of file G4ScoringMessenger.cc.

433{
434 delete listCmd;
435 delete verboseCmd;
436 //
437 delete meshBoxCreateCmd;
440 delete probeCreateCmd;
441 delete meshCreateDir;
442 // delete meshSphereCreateCmd;
443 //
444 delete meshOpnCmd;
445 //
446 delete meshClsCmd;
447 // delete meshActCmd;
448 delete meshDir;
449 //
450 delete mBoxSizeCmd;
451 delete mCylinderSizeCmd;
452 delete mCylinderRMinCmd;
453 delete mCylinderAngleCmd;
454 // delete mSphereSizeCmd;
455 //
456 delete mBinCmd;
457 //
458 delete mTResetCmd;
459 delete mTXyzCmd;
460 delete mTransDir;
461 // delete mRResetCmd;
462 delete mRotXCmd;
463 delete mRotYCmd;
464 delete mRotZCmd;
465 delete mRotDir;
466 //
467 delete probeLocateCmd;
468 delete probeMatCmd;
469 delete probeDir;
470 //
471 // delete chartCmd;
472 delete dumpCmd;
473 delete drawCmd;
474 delete drawColumnCmd;
475 delete listColorMapCmd;
476 delete floatMinMaxCmd;
477 delete colorMapMinMaxCmd;
478 delete colorMapDir;
479 delete dumpQtyToFileCmd;
481 delete dumpAllQtsToFileCmd;
483 delete fill1DCmd;
484 //
485 delete scoreDir;
486}

References colorMapDir, colorMapMinMaxCmd, drawCmd, drawColumnCmd, dumpAllQtsToFileCmd, dumpAllQtsWithFactorCmd, dumpCmd, dumpQtyToFileCmd, dumpQtyWithFactorCmd, fill1DCmd, floatMinMaxCmd, listCmd, listColorMapCmd, mBinCmd, mBoxSizeCmd, mCylinderAngleCmd, mCylinderRMinCmd, mCylinderSizeCmd, meshBoxCreateCmd, meshClsCmd, meshCreateDir, meshCylinderCreateCmd, meshDir, meshOpnCmd, meshRWLogVolCreateCmd, mRotDir, mRotXCmd, mRotYCmd, mRotZCmd, mTransDir, mTResetCmd, mTXyzCmd, probeCreateCmd, probeDir, probeLocateCmd, probeMatCmd, scoreDir, and verboseCmd.

Member Function Documentation

◆ AddUIcommand()

void G4UImessenger::AddUIcommand ( G4UIcommand newCommand)
protectedinherited

Definition at line 149 of file G4UImessenger.cc.

150{
151 G4cerr << "Warning : Old style definition of G4UIcommand <"
152 << newCommand->GetCommandPath() << ">." << G4endl;
153}
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:136

References G4cerr, G4endl, and G4UIcommand::GetCommandPath().

◆ BtoS()

G4String G4UImessenger::BtoS ( G4bool  b)
protectedinherited

Definition at line 98 of file G4UImessenger.cc.

99{
100 G4String vl = "0";
101 if(b)
102 vl = "true";
103 return vl;
104}

◆ CommandsShouldBeInMaster()

G4bool G4UImessenger::CommandsShouldBeInMaster ( ) const
inlineinherited

Definition at line 77 of file G4UImessenger.hh.

78 {
80 }
G4bool commandsShouldBeInMaster

References G4UImessenger::commandsShouldBeInMaster.

Referenced by G4UIcommand::G4UIcommandCommonConstructorCode().

◆ CreateCommand()

template<typename T >
T * G4UImessenger::CreateCommand ( const G4String cname,
const G4String dsc 
)
protectedinherited

Definition at line 110 of file G4UImessenger.hh.

111{
112 G4String path;
113 if(cname[0] != '/')
114 {
115 path = baseDirName + cname;
116 if(path[0] != '/')
117 path = "/" + path;
118 }
119
120 T* command = new T(path.c_str(), this);
121 command->SetGuidance(dsc.c_str());
122
123 return command;
124}
G4String baseDirName

References G4UImessenger::baseDirName.

◆ CreateDirectory()

void G4UImessenger::CreateDirectory ( const G4String path,
const G4String dsc,
G4bool  commandsToBeBroadcasted = true 
)
protectedinherited

Definition at line 156 of file G4UImessenger.cc.

158{
160
161 G4String fullpath = path;
162 if(fullpath.back() != '/')
163 fullpath.append("/");
164
165 G4UIcommandTree* tree = ui->GetTree()->FindCommandTree(fullpath.c_str());
166 if(tree != nullptr)
167 {
168 baseDirName = tree->GetPathName();
169 }
170 else
171 {
172 baseDir = new G4UIdirectory(fullpath.c_str(), commandsToBeBroadcasted);
173 baseDirName = fullpath;
174 baseDir->SetGuidance(dsc.c_str());
175 }
176}
const G4String & GetPathName() const
G4UIcommandTree * FindCommandTree(const char *commandPath)
G4UIcommandTree * GetTree() const
Definition: G4UImanager.hh:186
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
G4UIdirectory * baseDir

References G4UImessenger::baseDir, G4UImessenger::baseDirName, G4UIcommandTree::FindCommandTree(), G4UIcommandTree::GetPathName(), G4UImanager::GetTree(), G4UImanager::GetUIpointer(), and G4UIcommand::SetGuidance().

Referenced by G4MoleculeShootMessenger::G4MoleculeShootMessenger(), and G4UImessenger::G4UImessenger().

◆ DtoS()

G4String G4UImessenger::DtoS ( G4double  a)
protectedinherited

Definition at line 90 of file G4UImessenger.cc.

91{
92 std::ostringstream os;
93 os << a;
94 return G4String(os.str());
95}

Referenced by G4ScoreQuantityMessenger::FilterCommands(), and G4UIcontrolMessenger::SetNewValue().

◆ Fill1D()

void G4ScoringMessenger::Fill1D ( G4UIcommand cmd,
G4String  newValues 
)
protected

Definition at line 1032 of file G4ScoringMessenger.cc.

1033{
1034 using MeshShape = G4VScoringMesh::MeshShape;
1035
1036 G4Tokenizer next(newVal);
1037 G4int histID = StoI(next());
1038 G4String meshName = next();
1039 G4String primName = next();
1040 G4int copyNo = StoI(next());
1041
1042 auto filler = G4VScoreHistFiller::Instance();
1043 if(!filler)
1044 {
1046 ed << "G4TScoreHistFiller is not instantiated in this application.";
1047 cmd->CommandFailed(ed);
1048 return;
1049 }
1050 //
1051 // To do : check the validity of histID
1052 //
1053
1055 auto mesh = sm->FindMesh(meshName);
1056 if(mesh == nullptr)
1057 {
1059 ed << "Mesh name <" << meshName << "> is not found.";
1060 cmd->CommandFailed(ed);
1061 return;
1062 }
1063 auto shape = mesh->GetShape();
1064 if(shape != MeshShape::realWorldLogVol && shape != MeshShape::probe)
1065 {
1067 ed << "Mesh <" << meshName
1068 << "> is not real-world logical volume or probe.";
1069 cmd->CommandFailed(ed);
1070 return;
1071 }
1072
1073 auto prim = mesh->GetPrimitiveScorer(primName);
1074 if(prim == nullptr)
1075 {
1077 ed << "Primitive scorer name <" << primName << "> is not found.";
1078 cmd->CommandFailed(ed);
1079 return;
1080 }
1081 auto pp = dynamic_cast<G4VPrimitivePlotter*>(prim);
1082 if(pp == nullptr)
1083 {
1085 ed << "Primitive scorer <" << primName
1086 << "> does not support direct histogram filling.";
1087 cmd->CommandFailed(ed);
1088 return;
1089 }
1090
1091 pp->Plot(copyNo, histID);
1092}
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
int G4int
Definition: G4Types.hh:85
static G4ScoringManager * GetScoringManagerIfExist()
void CommandFailed(G4int errCode, G4ExceptionDescription &ed)
Definition: G4UIcommand.hh:179
G4int StoI(G4String s)
static G4VScoreHistFiller * Instance()

References G4UIcommand::CommandFailed(), G4ScoringManager::GetScoringManagerIfExist(), G4VScoreHistFiller::Instance(), G4InuclParticleNames::pp, G4InuclParticleNames::sm, and G4UImessenger::StoI().

Referenced by SetNewValue().

◆ FillTokenVec()

void G4ScoringMessenger::FillTokenVec ( G4String  newValues,
G4TokenVec token 
)
protected

Definition at line 986 of file G4ScoringMessenger.cc.

987{
988 G4Tokenizer next(newValues);
989 G4String val;
990 while(!(val = next()).empty())
991 { // Loop checking 12.18.2015 M.Asai
992 token.push_back(val);
993 }
994}

References anonymous_namespace{G4MTcoutDestination.cc}::empty.

Referenced by SetNewValue().

◆ GetCurrentValue()

G4String G4ScoringMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 975 of file G4ScoringMessenger.cc.

976{
977 G4String val;
978 if(command == verboseCmd)
979 {
981 }
982
983 return val;
984}
G4int GetVerboseLevel() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:445

References G4UIcommand::ConvertToString(), fSMan, G4ScoringManager::GetVerboseLevel(), and verboseCmd.

◆ ItoS()

G4String G4UImessenger::ItoS ( G4int  i)
protectedinherited

Definition at line 82 of file G4UImessenger.cc.

83{
84 std::ostringstream os;
85 os << i;
86 return G4String(os.str());
87}

Referenced by G4GenericMessenger::DeclareMethod(), and G4ParticleGunMessenger::GetCurrentValue().

◆ MeshBinCommand()

void G4ScoringMessenger::MeshBinCommand ( G4VScoringMesh mesh,
G4TokenVec token 
)
protected

Definition at line 996 of file G4ScoringMessenger.cc.

997{
998 G4int Ni = StoI(token[0]);
999 G4int Nj = StoI(token[1]);
1000 G4int Nk = StoI(token[2]);
1001 G4int nSegment[3];
1002
1003 if(dynamic_cast<G4ScoringBox*>(mesh))
1004 {
1005 G4cout << ".... G4ScoringMessenger::MeshBinCommand - G4ScoringBox"
1006 << G4endl;
1007 nSegment[0] = Ni;
1008 nSegment[1] = Nj;
1009 nSegment[2] = Nk;
1010 }
1011 else if(dynamic_cast<G4ScoringCylinder*>(mesh))
1012 {
1013 G4cout << ".... G4ScoringMessenger::MeshBinCommand - G4ScoringCylinder"
1014 << G4endl;
1015 nSegment[0] = Nj;
1016 nSegment[1] = Nk;
1017 nSegment[2] = Ni;
1018 }
1019 else
1020 {
1021 G4Exception("G4ScoringMessenger::MeshBinCommand()", "001", FatalException,
1022 "invalid mesh type");
1023 return;
1024 }
1025 //
1026 mesh->SetNumberOfSegments(nSegment);
1027}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
G4GLOB_DLL std::ostream G4cout
void SetNumberOfSegments(G4int nSegment[3])

References FatalException, G4cout, G4endl, G4Exception(), G4VScoringMesh::SetNumberOfSegments(), and G4UImessenger::StoI().

Referenced by SetNewValue().

◆ operator!=()

G4bool G4UImessenger::operator!= ( const G4UImessenger messenger) const
inherited

Definition at line 76 of file G4UImessenger.cc.

77{
78 return this != &messenger;
79}

◆ operator==()

G4bool G4UImessenger::operator== ( const G4UImessenger messenger) const
inherited

Definition at line 70 of file G4UImessenger.cc.

71{
72 return this == &messenger;
73}

◆ SetNewValue()

void G4ScoringMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 488 of file G4ScoringMessenger.cc.

489{
490 using MeshShape = G4VScoringMesh::MeshShape;
491
492 if(command == listCmd)
493 {
494 fSMan->List();
495 }
496 else if(command == dumpCmd)
497 {
498 fSMan->Dump();
499 }
500 else if(command == drawCmd)
501 {
502 G4Tokenizer next(newVal);
503 G4String meshName = next();
504 G4String psName = next();
505 G4String colorMapName = next();
506 G4int axflg = StoI(next());
507 fSMan->DrawMesh(meshName, psName, colorMapName, axflg);
508 }
509 else if(command == drawColumnCmd)
510 {
511 G4Tokenizer next(newVal);
512 G4String meshName = next();
513 G4String psName = next();
514 G4int iPlane = StoI(next());
515 G4int iColumn = StoI(next());
516 G4String colorMapName = next();
517 fSMan->DrawMesh(meshName, psName, iPlane, iColumn, colorMapName);
518 // } else if(command==chartCmd ){
519 // G4Tokenizer next(newVal);
520 // G4String meshName = next();
521 // G4String psName = next();
522 // //G4bool onFlag = StoB(next());
523 // G4String scaleOption = next();
524 // fSMan->DrawChart(meshName,psName,onFlag,scaleOption);
525 }
526 else if(command == dumpQtyToFileCmd)
527 {
528 G4Tokenizer next(newVal);
529 G4String meshName = next();
530 G4String psName = next();
531 G4String fileName = next();
532 G4String option = next("\n");
533 auto mesh = fSMan->FindMesh(meshName);
534 if(!mesh)
535 {
537 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
538 command->CommandFailed(ed);
539 return;
540 }
541 fSMan->DumpQuantityToFile(meshName, psName, fileName, option);
542 }
543 else if(command == dumpQtyWithFactorCmd)
544 {
545 G4Tokenizer next(newVal);
546 G4String meshName = next();
547 G4String psName = next();
548 G4String fileName = next();
549 G4double fac = StoD(next());
550 G4String option = next("\n");
551 auto mesh = fSMan->FindMesh(meshName);
552 if(!mesh)
553 {
555 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
556 command->CommandFailed(ed);
557 return;
558 }
560 fSMan->DumpQuantityToFile(meshName, psName, fileName, option);
561 fSMan->SetFactor(1.0);
562 }
563 else if(command == dumpAllQtsToFileCmd)
564 {
565 G4Tokenizer next(newVal);
566 G4String meshName = next();
567 G4String fileName = next();
568 G4String option = next("\n");
569 auto mesh = fSMan->FindMesh(meshName);
570 if(!mesh)
571 {
573 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
574 command->CommandFailed(ed);
575 return;
576 }
577 fSMan->DumpAllQuantitiesToFile(meshName, fileName, option);
578 }
579 else if(command == dumpAllQtsWithFactorCmd)
580 {
581 G4Tokenizer next(newVal);
582 G4String meshName = next();
583 G4String fileName = next();
584 G4double fac = StoD(next());
585 G4String option = next("\n");
586 auto mesh = fSMan->FindMesh(meshName);
587 if(!mesh)
588 {
590 ed << "Mesh name <" << meshName << "> is not found. Command ignored.";
591 command->CommandFailed(ed);
592 return;
593 }
595 fSMan->DumpAllQuantitiesToFile(meshName, fileName, option);
596 fSMan->SetFactor(1.0);
597 }
598 else if(command == fill1DCmd)
599 {
600 Fill1D(command, newVal);
601 }
602 else if(command == verboseCmd)
603 {
605 }
606 else if(command == meshBoxCreateCmd)
607 {
608 G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh();
609 if(currentmesh)
610 {
612 ed << "ERROR[" << meshBoxCreateCmd->GetCommandPath() << "] : Mesh <"
613 << currentmesh->GetWorldName()
614 << "> is still open. Close it first. Command ignored.";
615 command->CommandFailed(ed);
616 }
617 else
618 {
619 G4VScoringMesh* mesh = fSMan->FindMesh(newVal);
620 if(!mesh)
621 {
622 mesh = new G4ScoringBox(newVal);
624 }
625 else
626 {
628 ed << "ERROR[" << meshBoxCreateCmd->GetCommandPath()
629 << "] : Scoring mesh <" << newVal
630 << "> already exists. Command ignored.";
631 command->CommandFailed(ed);
632 }
633 }
634 }
635 else if(command == meshCylinderCreateCmd)
636 {
637 G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh();
638 if(currentmesh)
639 {
641 ed << "ERROR[" << meshCylinderCreateCmd->GetCommandPath() << "] : Mesh <"
642 << currentmesh->GetWorldName()
643 << "> is still open. Close it first. Command ignored.";
644 command->CommandFailed(ed);
645 }
646 else
647 {
648 G4VScoringMesh* mesh = fSMan->FindMesh(newVal);
649 if(!mesh)
650 {
651 mesh = new G4ScoringCylinder(newVal);
653 }
654 else
655 {
657 ed << "ERROR[" << meshCylinderCreateCmd->GetCommandPath()
658 << "] : Scoring mesh <" << newVal
659 << "> already exists. Command ignored.";
660 command->CommandFailed(ed);
661 }
662 }
663 }
664 else if(command == meshRWLogVolCreateCmd)
665 {
666 auto mesh = fSMan->GetCurrentMesh();
667 if(mesh)
668 {
670 ed << "ERROR[" << meshRWLogVolCreateCmd->GetCommandPath() << "] : Mesh <"
671 << mesh->GetWorldName()
672 << "> is still open. Close it first. Command ignored.";
673 command->CommandFailed(ed);
674 }
675 else
676 {
677 G4Tokenizer next(newVal);
678 G4String meshName = next();
679 G4int idx = StoI(next());
680 mesh = fSMan->FindMesh(meshName);
681 if(!mesh)
682 {
683 mesh = new G4ScoringRealWorld(meshName);
684 mesh->SetCopyNumberLevel(idx);
686 }
687 else
688 {
690 ed << "ERROR[" << meshRWLogVolCreateCmd->GetCommandPath()
691 << "] : Scoring mesh <" << meshName
692 << "> already exists. Command ignored.";
693 command->CommandFailed(ed);
694 }
695 }
696 }
697 else if(command == probeCreateCmd)
698 {
699 auto mesh = fSMan->GetCurrentMesh();
700 if(mesh)
701 {
703 ed << "ERROR[" << meshRWLogVolCreateCmd->GetCommandPath() << "] : Mesh <"
704 << mesh->GetWorldName()
705 << "> is still open. Close it first. Command ignored.";
706 command->CommandFailed(ed);
707 }
708 else
709 {
710 G4Tokenizer next(newVal);
711 G4String qname = next();
712 G4double halfSize = StoD(next());
713 halfSize *= G4UIcommand::ValueOf(next());
714 G4bool checkOverlap = StoB(next());
715 mesh = fSMan->FindMesh(qname);
716 if(!mesh)
717 {
718 mesh = new G4ScoringProbe(qname, halfSize, checkOverlap);
720 }
721 else
722 {
724 ed << "ERROR[" << probeCreateCmd->GetCommandPath() << "] : Mesh name <"
725 << qname << "> already exists. Use another name.";
726 command->CommandFailed(ed);
727 }
728 }
729 }
730 else if(command == probeMatCmd || command == probeLocateCmd)
731 {
732 auto mesh = fSMan->GetCurrentMesh();
733 if(!mesh)
734 {
736 ed << "ERROR : No mesh is currently open. Open/create a mesh first. "
737 "Command ignored.";
738 command->CommandFailed(ed);
739 return;
740 }
741 if(mesh->GetShape() != MeshShape::probe)
742 {
744 ed << "ERROR : Inconsistent mesh type. Close current mesh and open "
745 "Scoring Probe.";
746 command->CommandFailed(ed);
747 return;
748 }
749
750 if(command == probeMatCmd)
751 {
752 G4bool succ = static_cast<G4ScoringProbe*>(mesh)->SetMaterial(newVal);
753 if(!succ)
754 {
756 ed << "Material <" << newVal
757 << "> is not defind in G4NistManager. Command is ignored.\n"
758 << "Use /material/nist/listMaterials command to see the available "
759 "materials.";
760 command->CommandFailed(ed);
761 return;
762 }
763 }
764 else if(command == probeLocateCmd)
765 {
767 static_cast<G4ScoringProbe*>(mesh)->LocateProbe(loc);
768 }
769 }
770 else if(command == listColorMapCmd)
771 {
773 }
774 else if(command == floatMinMaxCmd)
775 {
776 G4VScoreColorMap* colorMap = fSMan->GetScoreColorMap(newVal);
777 if(colorMap)
778 {
779 colorMap->SetFloatingMinMax(true);
780 }
781 else
782 {
784 ed << "ERROR[" << floatMinMaxCmd->GetCommandPath() << "] : color map <"
785 << newVal << "> is not defined. Command ignored.";
786 command->CommandFailed(ed);
787 }
788 }
789 else if(command == colorMapMinMaxCmd)
790 {
791 G4Tokenizer next(newVal);
792 G4String mapName = next();
793 G4double minVal = StoD(next());
794 G4double maxVal = StoD(next());
795 G4VScoreColorMap* colorMap = fSMan->GetScoreColorMap(mapName);
796 if(colorMap)
797 {
798 colorMap->SetFloatingMinMax(false);
799 colorMap->SetMinMax(minVal, maxVal);
800 }
801 else
802 {
804 ed << "ERROR[" << colorMapMinMaxCmd->GetCommandPath() << "] : color map <"
805 << newVal << "> is not defined. Command ignored." << G4endl;
806 command->CommandFailed(ed);
807 }
808 }
809 else if(command == meshOpnCmd)
810 {
811 G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh();
812 if(currentmesh)
813 {
815 ed << "ERROR[" << meshOpnCmd->GetCommandPath() << "] : Mesh <"
816 << currentmesh->GetWorldName()
817 << "> is still open. Close it first. Command ignored.";
818 command->CommandFailed(ed);
819 }
820 else
821 {
822 G4VScoringMesh* mesh = fSMan->FindMesh(newVal);
823 if(!mesh)
824 {
826 ed << "ERROR[" << meshOpnCmd->GetCommandPath() << "] : Scoring mesh <"
827 << newVal << "> does not exist. Command ignored.";
828 command->CommandFailed(ed);
829 }
830 else
831 {
832 fSMan->SetCurrentMesh(mesh);
833 }
834 }
835 }
836 else if(command == meshClsCmd)
837 {
839 }
840 else
841 {
842 //
843 // Get Current Mesh
844 //
846 //
847 // Commands for Current Mesh
848 if(mesh)
849 {
850 MeshShape shape = mesh->GetShape();
851 if(shape == MeshShape::realWorldLogVol)
852 {
854 ed << "ERROR[" << mBinCmd->GetCommandPath()
855 << "] : Number of mesh command cannot be set for this type of mesh. "
856 "Command ignored.";
857 command->CommandFailed(ed);
858 }
859 else
860 {
861 // Tokens
862 G4TokenVec token;
863 FillTokenVec(newVal, token);
864 //
865 // Mesh Geometry
866 //
867 // if(command==meshActCmd) {
868 // mesh->Activate(meshActCmd->GetNewBoolValue(newVal));
869 // } else
870 if(command == mBoxSizeCmd)
871 {
872 if(shape == MeshShape::box)
873 {
875 G4double vsize[3];
876 vsize[0] = size.x();
877 vsize[1] = size.y();
878 vsize[2] = size.z();
879 mesh->SetSize(vsize);
880 }
881 else
882 {
884 ed << "ERROR[" << mBoxSizeCmd->GetCommandPath()
885 << "] : This mesh is not Box. Command ignored.";
886 command->CommandFailed(ed);
887 }
888 }
889 else if(command == mCylinderSizeCmd || command == mCylinderRMinCmd ||
890 command == mCylinderAngleCmd)
891 {
892 if(shape != MeshShape::cylinder)
893 {
895 ed << "ERROR[" << command->GetCommandPath()
896 << "] : This mesh is not Cylinder. Command ignored.";
897 command->CommandFailed(ed);
898 }
899 else
900 {
901 if(command == mCylinderSizeCmd)
902 {
903 G4double vsize[3];
904 vsize[0] = (mesh->GetSize()).x();
905 vsize[1] = StoD(token[0]);
906 vsize[2] = StoD(token[1]);
907 G4double unt = mCylinderSizeCmd->ValueOf(token[2]);
908 vsize[1] *= unt;
909 vsize[2] *= unt;
910 mesh->SetSize(vsize);
911 }
912 else if(command == mCylinderRMinCmd)
913 {
914 G4double vsize[3];
915 vsize[0] = mCylinderRMinCmd->GetNewDoubleValue(newVal);
916 vsize[1] = (mesh->GetSize()).y();
917 vsize[2] = (mesh->GetSize()).z();
918 mesh->SetSize(vsize);
919 }
920 else if(command == mCylinderAngleCmd)
921 {
922 G4double stphi = StoD(token[0]);
923 G4double spphi = StoD(token[1]);
924 G4double unt = mCylinderAngleCmd->ValueOf(token[2]);
925 mesh->SetAngles(stphi * unt, spphi * unt);
926 }
927 }
928 }
929 else if(command == mBinCmd)
930 {
931 MeshBinCommand(mesh, token);
932 }
933 else if(command == mTResetCmd)
934 {
935 G4double centerPosition[3] = { 0., 0., 0. };
936 mesh->SetCenterPosition(centerPosition);
937 }
938 else if(command == mTXyzCmd)
939 {
941 G4double centerPosition[3];
942 centerPosition[0] = xyz.x();
943 centerPosition[1] = xyz.y();
944 centerPosition[2] = xyz.z();
945 mesh->SetCenterPosition(centerPosition);
946 // } else if(command==mRResetCmd) {
947 }
948 else if(command == mRotXCmd)
949 {
950 G4double value = mRotXCmd->GetNewDoubleValue(newVal);
951 mesh->RotateX(value);
952 }
953 else if(command == mRotYCmd)
954 {
955 G4double value = mRotYCmd->GetNewDoubleValue(newVal);
956 mesh->RotateY(value);
957 }
958 else if(command == mRotZCmd)
959 {
960 G4double value = mRotZCmd->GetNewDoubleValue(newVal);
961 mesh->RotateZ(value);
962 }
963 }
964 }
965 else
966 {
968 ed << "ERROR: No mesh is currently open. Open/create a mesh first. "
969 "Command ignored.";
970 command->CommandFailed(ed);
971 }
972 }
973}
static const G4double fac
std::vector< G4String > G4TokenVec
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
double z() const
double x() const
double y() const
void RegisterScoringMesh(G4VScoringMesh *scm)
void SetVerboseLevel(G4int vl)
G4VScoreColorMap * GetScoreColorMap(const G4String &mapName)
void DumpAllQuantitiesToFile(const G4String &meshName, const G4String &fileName, const G4String &option="")
G4VScoringMesh * FindMesh(G4VHitsCollection *map)
void SetCurrentMesh(G4VScoringMesh *scm)
void DrawMesh(const G4String &meshName, const G4String &psName, const G4String &colorMapName, G4int axflg=111)
void SetFactor(G4double val=1.0)
G4VScoringMesh * GetCurrentMesh() const
void DumpQuantityToFile(const G4String &meshName, const G4String &psName, const G4String &fileName, const G4String &option="")
void FillTokenVec(G4String newValues, G4TokenVec &token)
void MeshBinCommand(G4VScoringMesh *mesh, G4TokenVec &token)
void Fill1D(G4UIcommand *cmd, G4String newValues)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
static G4int GetNewIntValue(const char *paramString)
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:363
G4double StoD(G4String s)
G4bool StoB(G4String s)
void SetMinMax(G4double minVal, G4double maxVal)
void SetFloatingMinMax(G4bool vl=true)
G4ThreeVector GetSize() const
MeshShape GetShape() const
void RotateY(G4double delta)
void SetAngles(G4double, G4double)
const G4String & GetWorldName() const
void SetCenterPosition(G4double centerPosition[3])
void SetCopyNumberLevel(G4int val)
void RotateX(G4double delta)
void SetSize(G4double size[3])
void RotateZ(G4double delta)
def SetMaterial(material_name)
Definition: EmPlot.py:25

References G4ScoringManager::CloseCurrentMesh(), colorMapMinMaxCmd, G4UIcommand::CommandFailed(), drawCmd, drawColumnCmd, G4ScoringManager::DrawMesh(), G4ScoringManager::Dump(), dumpAllQtsToFileCmd, dumpAllQtsWithFactorCmd, G4ScoringManager::DumpAllQuantitiesToFile(), dumpCmd, dumpQtyToFileCmd, dumpQtyWithFactorCmd, G4ScoringManager::DumpQuantityToFile(), fac, Fill1D(), fill1DCmd, FillTokenVec(), G4ScoringManager::FindMesh(), floatMinMaxCmd, fSMan, G4endl, G4UIcommand::GetCommandPath(), G4ScoringManager::GetCurrentMesh(), G4UIcmdWith3VectorAndUnit::GetNew3VectorValue(), G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), G4ScoringManager::GetScoreColorMap(), G4VScoringMesh::GetShape(), G4VScoringMesh::GetSize(), G4VScoringMesh::GetWorldName(), G4ScoringManager::List(), listCmd, listColorMapCmd, G4ScoringManager::ListScoreColorMaps(), mBinCmd, mBoxSizeCmd, mCylinderAngleCmd, mCylinderRMinCmd, mCylinderSizeCmd, MeshBinCommand(), meshBoxCreateCmd, meshClsCmd, meshCylinderCreateCmd, meshOpnCmd, meshRWLogVolCreateCmd, mRotXCmd, mRotYCmd, mRotZCmd, mTResetCmd, mTXyzCmd, probeCreateCmd, probeLocateCmd, probeMatCmd, G4ScoringManager::RegisterScoringMesh(), G4VScoringMesh::RotateX(), G4VScoringMesh::RotateY(), G4VScoringMesh::RotateZ(), G4VScoringMesh::SetAngles(), G4VScoringMesh::SetCenterPosition(), G4ScoringManager::SetCurrentMesh(), G4ScoringManager::SetFactor(), G4VScoreColorMap::SetFloatingMinMax(), EmPlot::SetMaterial(), G4VScoreColorMap::SetMinMax(), G4VScoringMesh::SetSize(), G4ScoringManager::SetVerboseLevel(), G4UImessenger::StoB(), G4UImessenger::StoD(), G4UImessenger::StoI(), G4UIcommand::ValueOf(), verboseCmd, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ StoB()

G4bool G4UImessenger::StoB ( G4String  s)
protectedinherited

Definition at line 137 of file G4UImessenger.cc.

138{
140 G4bool vl = false;
141 if(v == "Y" || v == "YES" || v == "1" || v == "T" || v == "TRUE")
142 {
143 vl = true;
144 }
145 return vl;
146}
G4String to_upper_copy(G4String str)
Return uppercase copy of string.

References G4StrUtil::to_upper_copy().

Referenced by G4LocalThreadCoutMessenger::SetNewValue(), G4CascadeParamMessenger::SetNewValue(), G4ScoreQuantityMessenger::SetNewValue(), and SetNewValue().

◆ StoD()

G4double G4UImessenger::StoD ( G4String  s)
protectedinherited

◆ StoI()

G4int G4UImessenger::StoI ( G4String  s)
protectedinherited

◆ StoL()

G4long G4UImessenger::StoL ( G4String  s)
protectedinherited

Definition at line 117 of file G4UImessenger.cc.

118{
119 G4long vl;
120 const char* t = str;
121 std::istringstream is(t);
122 is >> vl;
123 return vl;
124}
long G4long
Definition: G4Types.hh:87

Referenced by G4RunMessenger::SetNewValue().

Field Documentation

◆ baseDir

G4UIdirectory* G4UImessenger::baseDir = nullptr
protectedinherited

◆ baseDirName

G4String G4UImessenger::baseDirName = ""
protectedinherited

◆ colorMapDir

G4UIdirectory* G4ScoringMessenger::colorMapDir
private

Definition at line 126 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), and ~G4ScoringMessenger().

◆ colorMapMinMaxCmd

G4UIcommand* G4ScoringMessenger::colorMapMinMaxCmd
private

Definition at line 129 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ commandsShouldBeInMaster

G4bool G4UImessenger::commandsShouldBeInMaster = false
protectedinherited

◆ drawCmd

G4UIcommand* G4ScoringMessenger::drawCmd
private

Definition at line 124 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ drawColumnCmd

G4UIcommand* G4ScoringMessenger::drawColumnCmd
private

Definition at line 125 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ dumpAllQtsToFileCmd

G4UIcommand* G4ScoringMessenger::dumpAllQtsToFileCmd
private

Definition at line 134 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ dumpAllQtsWithFactorCmd

G4UIcommand* G4ScoringMessenger::dumpAllQtsWithFactorCmd
private

Definition at line 136 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ dumpCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::dumpCmd
private

Definition at line 81 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ dumpQtyToFileCmd

G4UIcommand* G4ScoringMessenger::dumpQtyToFileCmd
private

Definition at line 133 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ dumpQtyWithFactorCmd

G4UIcommand* G4ScoringMessenger::dumpQtyWithFactorCmd
private

Definition at line 135 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ fill1DCmd

G4UIcommand* G4ScoringMessenger::fill1DCmd
private

Definition at line 139 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ floatMinMaxCmd

G4UIcmdWithAString* G4ScoringMessenger::floatMinMaxCmd
private

Definition at line 128 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ fSMan

G4ScoringManager* G4ScoringMessenger::fSMan
private

Definition at line 78 of file G4ScoringMessenger.hh.

Referenced by GetCurrentValue(), and SetNewValue().

◆ listCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::listCmd
private

Definition at line 80 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ listColorMapCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::listColorMapCmd
private

Definition at line 127 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mBinCmd

G4UIcommand* G4ScoringMessenger::mBinCmd
private

Definition at line 106 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mBoxSizeCmd

G4UIcmdWith3VectorAndUnit* G4ScoringMessenger::mBoxSizeCmd
private

Definition at line 99 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mCylinderAngleCmd

G4UIcommand* G4ScoringMessenger::mCylinderAngleCmd
private

Definition at line 102 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mCylinderRMinCmd

G4UIcmdWithADoubleAndUnit* G4ScoringMessenger::mCylinderRMinCmd
private

Definition at line 101 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mCylinderSizeCmd

G4UIcommand* G4ScoringMessenger::mCylinderSizeCmd
private

Definition at line 100 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ meshBoxCreateCmd

G4UIcmdWithAString* G4ScoringMessenger::meshBoxCreateCmd
private

Definition at line 85 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ meshClsCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::meshClsCmd
private

Definition at line 95 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ meshCreateDir

G4UIdirectory* G4ScoringMessenger::meshCreateDir
private

Definition at line 84 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), and ~G4ScoringMessenger().

◆ meshCylinderCreateCmd

G4UIcmdWithAString* G4ScoringMessenger::meshCylinderCreateCmd
private

Definition at line 86 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ meshDir

G4UIdirectory* G4ScoringMessenger::meshDir
private

Definition at line 92 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), and ~G4ScoringMessenger().

◆ meshOpnCmd

G4UIcmdWithAString* G4ScoringMessenger::meshOpnCmd
private

Definition at line 93 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ meshRWLogVolCreateCmd

G4UIcommand* G4ScoringMessenger::meshRWLogVolCreateCmd
private

Definition at line 88 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mRotDir

G4UIdirectory* G4ScoringMessenger::mRotDir
private

Definition at line 112 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), and ~G4ScoringMessenger().

◆ mRotXCmd

G4UIcmdWithADoubleAndUnit* G4ScoringMessenger::mRotXCmd
private

Definition at line 114 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mRotYCmd

G4UIcmdWithADoubleAndUnit* G4ScoringMessenger::mRotYCmd
private

Definition at line 115 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mRotZCmd

G4UIcmdWithADoubleAndUnit* G4ScoringMessenger::mRotZCmd
private

Definition at line 116 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mTransDir

G4UIdirectory* G4ScoringMessenger::mTransDir
private

Definition at line 109 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), and ~G4ScoringMessenger().

◆ mTResetCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::mTResetCmd
private

Definition at line 110 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ mTXyzCmd

G4UIcmdWith3VectorAndUnit* G4ScoringMessenger::mTXyzCmd
private

Definition at line 111 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ probeCreateCmd

G4UIcommand* G4ScoringMessenger::probeCreateCmd
private

Definition at line 89 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ probeDir

G4UIdirectory* G4ScoringMessenger::probeDir
private

Definition at line 119 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), and ~G4ScoringMessenger().

◆ probeLocateCmd

G4UIcmdWith3VectorAndUnit* G4ScoringMessenger::probeLocateCmd
private

Definition at line 121 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ probeMatCmd

G4UIcmdWithAString* G4ScoringMessenger::probeMatCmd
private

Definition at line 120 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), SetNewValue(), and ~G4ScoringMessenger().

◆ scoreDir

G4UIdirectory* G4ScoringMessenger::scoreDir
private

Definition at line 79 of file G4ScoringMessenger.hh.

Referenced by G4ScoringMessenger(), and ~G4ScoringMessenger().

◆ verboseCmd

G4UIcmdWithAnInteger* G4ScoringMessenger::verboseCmd
private

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