Geant4  10.02.p03
G4ScoringMessenger Class Reference

#include <G4ScoringMessenger.hh>

Inheritance diagram for G4ScoringMessenger:
Collaboration diagram for G4ScoringMessenger:

Public Member Functions

 G4ScoringMessenger (G4ScoringManager *SManager)
 
 ~G4ScoringMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Protected Member Functions

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

Private Attributes

G4ScoringManagerfSMan
 
G4UIdirectoryscoreDir
 
G4UIcmdWithoutParameterlistCmd
 
G4UIcmdWithoutParameterdumpCmd
 
G4UIcmdWithAnIntegerverboseCmd
 
G4UIdirectorymeshCreateDir
 
G4UIcmdWithAStringmeshBoxCreateCmd
 
G4UIcmdWithAStringmeshCylinderCreateCmd
 
G4UIdirectorymeshDir
 
G4UIcmdWithAStringmeshOpnCmd
 
G4UIcmdWithoutParametermeshClsCmd
 
G4UIcmdWith3VectorAndUnitmBoxSizeCmd
 
G4UIcommandmCylinderSizeCmd
 
G4UIcommandmBinCmd
 
G4UIdirectorymTransDir
 
G4UIcmdWithoutParametermTResetCmd
 
G4UIcmdWith3VectorAndUnitmTXyzCmd
 
G4UIdirectorymRotDir
 
G4UIcmdWithoutParametermRResetCmd
 
G4UIcmdWithADoubleAndUnitmRotXCmd
 
G4UIcmdWithADoubleAndUnitmRotYCmd
 
G4UIcmdWithADoubleAndUnitmRotZCmd
 
G4UIcommanddrawCmd
 
G4UIcommanddrawColumnCmd
 
G4UIdirectorycolorMapDir
 
G4UIcmdWithoutParameterlistColorMapCmd
 
G4UIcmdWithAStringfloatMinMaxCmd
 
G4UIcommandcolorMapMinMaxCmd
 
G4UIcommanddumpQtyToFileCmd
 
G4UIcommanddumpAllQtsToFileCmd
 

Additional Inherited Members

- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 63 of file G4ScoringMessenger.hh.

Constructor & Destructor Documentation

◆ G4ScoringMessenger()

G4ScoringMessenger::G4ScoringMessenger ( G4ScoringManager SManager)

Definition at line 49 of file G4ScoringMessenger.cc.

50 :fSMan(SManager)
51 {
52  G4UIparameter* param;
53 
54  scoreDir = new G4UIdirectory("/score/");
55  scoreDir->SetGuidance("Interactive scoring commands.");
56 
57  listCmd = new G4UIcmdWithoutParameter("/score/list",this);
58  listCmd->SetGuidance("List scoring worlds.");
59 
60  dumpCmd = new G4UIcmdWithoutParameter("/score/dump",this);
61  dumpCmd->SetGuidance("Dump results of scorers.");
62 
63  verboseCmd = new G4UIcmdWithAnInteger("/score/verbose",this);
64  verboseCmd->SetGuidance("Verbosity.");
65  verboseCmd->SetGuidance(" 0) errors or warnings,");
66  verboseCmd->SetGuidance(" 1) information with 0)");
67 
68  meshDir = new G4UIdirectory("/score/mesh/");
69  meshDir->SetGuidance(" Mesh processing commands.");
70 
71  meshCreateDir = new G4UIdirectory("/score/create/");
72  meshCreateDir->SetGuidance(" Mesh creation commands.");
73  //
74  // Mesh commands
75  meshBoxCreateCmd = new G4UIcmdWithAString("/score/create/boxMesh",this);
76  meshBoxCreateCmd->SetGuidance("Create scoring box mesh.");
77  meshBoxCreateCmd->SetParameterName("MeshName",false);
78  //
79  meshCylinderCreateCmd = new G4UIcmdWithAString("/score/create/cylinderMesh",this);
80  meshCylinderCreateCmd->SetGuidance("Create scoring mesh.");
81  meshCylinderCreateCmd->SetParameterName("MeshName",false);
82  //
83 // meshSphereCreateCmd = new G4UIcmdWithAString("/score/create/sphereMesh",this);
84 // meshSphereCreateCmd->SetGuidance("Create scoring mesh.");
85 // meshSphereCreateCmd->SetParameterName("MeshName",false);
86  //
87  meshOpnCmd = new G4UIcmdWithAString("/score/open",this);
88  meshOpnCmd->SetGuidance("Open scoring mesh.");
89  meshOpnCmd->SetParameterName("MeshName",false);
90  //
91  meshClsCmd = new G4UIcmdWithoutParameter("/score/close",this);
92  meshClsCmd->SetGuidance("Close scoring mesh.");
93  //
94 // meshActCmd = new G4UIcmdWithABool("/score/mesh/activate",this);
95 // meshActCmd->SetGuidance("Activate scoring mesh.");
96 // meshActCmd->SetParameterName("MeshName",false);
97  //
98  mBoxSizeCmd = new G4UIcmdWith3VectorAndUnit("/score/mesh/boxSize",this);
99  mBoxSizeCmd->SetGuidance("Define size of the scoring mesh.");
100  mBoxSizeCmd->SetGuidance("Dx Dy Dz unit");
101  mBoxSizeCmd->SetParameterName("Di","Dj","Dk",false,false);
102  mBoxSizeCmd->SetRange("Di>0. && Dj>0. && Dk>0.");
104  //
105  mCylinderSizeCmd = new G4UIcommand("/score/mesh/cylinderSize",this);
106  mCylinderSizeCmd->SetGuidance("Define size of the scoring mesh.");
107  mCylinderSizeCmd->SetGuidance("R Dz unit");
108  param = new G4UIparameter("R",'d',false);
109  param->SetParameterRange("R>0");
111  param = new G4UIparameter("Dz",'d',false);
112  param->SetParameterRange("Dz>0");
114  param = new G4UIparameter("unit",'s',true);
115  param->SetDefaultValue("mm");
117  //
118  // Division command
119  mBinCmd = new G4UIcommand("/score/mesh/nBin",this);
120  mBinCmd->SetGuidance("Define segments of the scoring mesh.");
121  mBinCmd->SetGuidance("[usage] /score/mesh/nBin");
122  mBinCmd->SetGuidance(" In case of boxMesh, parameters are given in");
123  mBinCmd->SetGuidance(" Ni :(int) Number of bins i (in x-axis) ");
124  mBinCmd->SetGuidance(" Nj :(int) Number of bins j (in y-axis) ");
125  mBinCmd->SetGuidance(" Nk :(int) Number of bins k (in z-axis) ");
126  mBinCmd->SetGuidance(" In case of cylinderMesh, parameters are given in");
127  mBinCmd->SetGuidance(" Nr :(int) Number of bins in radial axis ");
128  mBinCmd->SetGuidance(" Nz :(int) Number of bins in z axis ");
129  mBinCmd->SetGuidance(" Nphi:(int) Number of bins in phi axis ");
130  //mBinCmd->SetGuidance(" Axis:(int) Axis of division ");
131 // mBinCmd->SetGuidance(" P1..Pn-1 :(double) \"paramter from P1 to Pn-1 for division.\"");
132  param = new G4UIparameter("Ni",'i',false);
133  param->SetDefaultValue("1");
134  param->SetParameterRange("Ni>0");
135  mBinCmd->SetParameter(param);
136  param = new G4UIparameter("Nj",'i',false);
137  param->SetDefaultValue("1");
138  param->SetParameterRange("Nj>0");
139  mBinCmd->SetParameter(param);
140  param = new G4UIparameter("Nk",'i',false);
141  param->SetDefaultValue("1");
142  mBinCmd->SetParameter(param);
143  param->SetParameterRange("Nk>0");
144  //param = new G4UIparameter("Axis",'i',true);
145  //param->SetDefaultValue("3");
146  //mBinCmd->SetParameter(param);
147  //
148  // Placement command
149  mTransDir = new G4UIdirectory("/score/mesh/translate/");
150  mTransDir->SetGuidance("Mesh translation commands.");
151  //
152  mTResetCmd = new G4UIcmdWithoutParameter("/score/mesh/translate/reset",this);
153  mTResetCmd->SetGuidance("Reset translated position of the scoring mesh.");
154  //
155  mTXyzCmd = new G4UIcmdWith3VectorAndUnit("/score/mesh/translate/xyz",this);
156  mTXyzCmd->SetGuidance("Translate the scoring mesh.");
157  mTXyzCmd->SetParameterName("X","Y","Z",false,false);
158  mTXyzCmd->SetDefaultUnit("mm");
159  //
160  mRotDir = new G4UIdirectory("/score/mesh/rotate/");
161  mRotDir->SetGuidance("Mesh rotation commands.");
162  //
163  mRResetCmd = new G4UIcmdWithoutParameter("/score/mesh/rotate/reset",this);
164  mRResetCmd->SetGuidance("Reset rotation angles of the scoring mesh.");
165  //
166  mRotXCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateX",this);
167  mRotXCmd->SetGuidance("Rotate the scoring mesh in X axis.");
168  mRotXCmd->SetParameterName("Rx",false);
169  mRotXCmd->SetDefaultUnit("deg");
170  //
171  mRotYCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateY",this);
172  mRotYCmd->SetGuidance("Rotate the scoring mesh in Y axis.");
173  mRotYCmd->SetParameterName("Ry",false);
174  mRotYCmd->SetDefaultUnit("deg");
175  //
176  mRotZCmd = new G4UIcmdWithADoubleAndUnit("/score/mesh/rotate/rotateZ",this);
177  mRotZCmd->SetGuidance("Rotate the scoring mesh in Z axis.");
178  mRotZCmd->SetParameterName("Rz",false);
179  mRotZCmd->SetDefaultUnit("deg");
180  //
181 
182  // Draw Scoring result
183  drawCmd = new G4UIcommand("/score/drawProjection",this);
184  drawCmd->SetGuidance("Draw projection(s) of scored quantities.");
185  drawCmd->SetGuidance("Parameter <proj> specified which projection(s) to be drawn.");
186  drawCmd->SetGuidance(" 100 : xy-plane, 010 : yz-plane, 001 : zx-plane -- default 111");
187  drawCmd->SetGuidance(" 100 : N/A, 010 : z_phi-plane, 001 : r_phi-plane -- default 111");
188  param = new G4UIparameter("meshName",'s',false);
189  drawCmd->SetParameter(param);
190  param = new G4UIparameter("psName",'s',false);
191  drawCmd->SetParameter(param);
192  param = new G4UIparameter("colorMapName",'s',true);
193  param->SetDefaultValue("defaultLinearColorMap");
194  drawCmd->SetParameter(param);
195  param = new G4UIparameter("proj",'i',true);
196  param->SetDefaultValue(111);
197  drawCmd->SetParameter(param);
198  drawCmd->SetToBeBroadcasted(false);
199 
200  // Draw column
201  drawColumnCmd = new G4UIcommand("/score/drawColumn",this);
202  drawColumnCmd->SetGuidance("Draw a cell column.");
203  drawColumnCmd->SetGuidance(" plane = 0 : x-y, 1: y-z, 2: z-x for box mesh");
204  drawColumnCmd->SetGuidance(" 0 : z-phi, 1: r-phi, 2: r-z for cylinder mesh");
205  param = new G4UIparameter("meshName",'s',false);
206  drawColumnCmd->SetParameter(param);
207  param = new G4UIparameter("psName",'s',false);
208  drawColumnCmd->SetParameter(param);
209  param = new G4UIparameter("plane",'i',false);
210  param->SetParameterRange("plane>=0 && plane<=2");
211  drawColumnCmd->SetParameter(param);
212  param = new G4UIparameter("column",'i',false);
213  drawColumnCmd->SetParameter(param);
214  param = new G4UIparameter("colorMapName",'s',true);
215  param->SetDefaultValue("defaultLinearColorMap");
216  drawColumnCmd->SetParameter(param);
218 
219  colorMapDir = new G4UIdirectory("/score/colorMap/");
220  colorMapDir->SetGuidance("Color map commands.");
221 
222  listColorMapCmd = new G4UIcmdWithoutParameter("/score/colorMap/listScoreColorMaps",this);
223  listColorMapCmd->SetGuidance("List registered score color maps.");
225 
226  floatMinMaxCmd = new G4UIcmdWithAString("/score/colorMap/floatMinMax",this);
227  floatMinMaxCmd->SetGuidance("Min/Max of the color map is calculated accorging to the actual scores.");
228  floatMinMaxCmd->SetParameterName("colorMapName",true,false);
229  floatMinMaxCmd->SetDefaultValue("defaultLinearColorMap");
231 
232  colorMapMinMaxCmd = new G4UIcommand("/score/colorMap/setMinMax",this);
233  colorMapMinMaxCmd->SetGuidance("Define min/max value of the color map.");
234  param = new G4UIparameter("colorMapMame",'s',true);
235  param->SetDefaultValue("defaultLinearColorMap");
237  param = new G4UIparameter("minValue",'d',false);
239  param = new G4UIparameter("maxValue",'d',false);
242 
243  /*
244  chartCmd = new G4UIcommand("/score/drawChart",this);
245  chartCmd->SetGuidance("Draw color chart on the screen.");
246  chartCmd->SetGuidance("[usage] /score/drawChart");
247  chartCmd->SetGuidance(" mesh :(String) Mesh name.");
248  chartCmd->SetGuidance(" psname :(String) PS name.");
249  chartCmd->SetGuidance(" On/Off :(boolean) On or Off the color chart.");
250  chartCmd->SetGuidance(" scale :(String) default=linear, or log ");
251  param = new G4UIparameter("meshName",'s',false);
252  chartCmd->SetParameter(param);
253  param = new G4UIparameter("psName",'s',false);
254  chartCmd->SetParameter(param);
255  param = new G4UIparameter("On",'s',true);
256  param->SetDefaultValue("true");
257  chartCmd->SetParameter(param);
258  param = new G4UIparameter("scale",'s',true);
259  param->SetDefaultValue("linear");
260  chartCmd->SetParameter(param);
261  */
262 
263  // Dump a scored quantity
264  dumpQtyToFileCmd = new G4UIcommand("/score/dumpQuantityToFile", this);
265  dumpQtyToFileCmd->SetGuidance("Dump one scored quantity to file.");
266  param = new G4UIparameter("meshName", 's', false);
268  param = new G4UIparameter("psName", 's', false);
270  param = new G4UIparameter("fileName", 's', false);
272  param = new G4UIparameter("option", 's', true);
275 
276  // Dump all scored quantities
277  dumpAllQtsToFileCmd = new G4UIcommand("/score/dumpAllQuantitiesToFile", this);
278  dumpAllQtsToFileCmd->SetGuidance("Dump all quantities of the mesh to file.");
279  param = new G4UIparameter("meshName", 's', false);
281  param = new G4UIparameter("fileName", 's', false);
283  param = new G4UIparameter("option", 's', true);
286 
287 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
G4UIcommand * colorMapMinMaxCmd
G4UIdirectory * mTransDir
G4UIcommand * mCylinderSizeCmd
void SetParameterRange(const char *theRange)
G4UIdirectory * mRotDir
void SetDefaultUnit(const char *defUnit)
void SetToBeBroadcasted(G4bool val)
Definition: G4UIcommand.hh:184
void SetDefaultValue(const char *theDefaultValue)
G4UIcmdWithADoubleAndUnit * mRotZCmd
G4UIdirectory * meshCreateDir
G4UIcommand * drawColumnCmd
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithoutParameter * mRResetCmd
G4UIcmdWithAString * meshOpnCmd
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4UIcmdWithAString * meshBoxCreateCmd
G4UIcmdWithoutParameter * mTResetCmd
G4UIcmdWithoutParameter * listCmd
G4UIdirectory * scoreDir
G4UIcmdWithoutParameter * meshClsCmd
G4UIcmdWithoutParameter * listColorMapCmd
void SetDefaultValue(const char *defVal)
void SetDefaultUnit(const char *defUnit)
G4UIcmdWith3VectorAndUnit * mTXyzCmd
G4UIcommand * dumpQtyToFileCmd
G4UIcmdWithADoubleAndUnit * mRotYCmd
G4UIcommand * dumpAllQtsToFileCmd
G4UIcmdWithAnInteger * verboseCmd
G4ScoringManager * fSMan
G4UIdirectory * meshDir
G4UIcmdWithoutParameter * dumpCmd
G4UIcmdWithAString * floatMinMaxCmd
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWith3VectorAndUnit * mBoxSizeCmd
G4UIcmdWithAString * meshCylinderCreateCmd
G4UIcmdWithADoubleAndUnit * mRotXCmd
G4UIdirectory * colorMapDir
Here is the call graph for this function:

◆ ~G4ScoringMessenger()

G4ScoringMessenger::~G4ScoringMessenger ( )

Definition at line 289 of file G4ScoringMessenger.cc.

290 {
291  delete listCmd;
292  delete verboseCmd;
293  //
294  delete meshCreateDir;
295  delete meshBoxCreateCmd;
296  delete meshCylinderCreateCmd;
297 // delete meshSphereCreateCmd;
298  //
299  delete meshOpnCmd;
300  //
301  delete meshClsCmd;
302 // delete meshActCmd;
303  delete meshDir;
304  //
305  delete mBoxSizeCmd;
306  delete mCylinderSizeCmd;
307 // delete mSphereSizeCmd;
308  //
309  delete mBinCmd;
310  //
311  delete mTResetCmd;
312  delete mTXyzCmd;
313  delete mTransDir;
314  delete mRResetCmd;
315  delete mRotXCmd;
316  delete mRotYCmd;
317  delete mRotZCmd;
318  delete mRotDir;
319  //
320  //delete chartCmd;
321  delete dumpCmd;
322  delete drawCmd;
323  delete drawColumnCmd;
324  delete listColorMapCmd;
325  delete floatMinMaxCmd;
326  delete colorMapMinMaxCmd;
327  delete colorMapDir;
328  delete dumpQtyToFileCmd;
329  delete dumpAllQtsToFileCmd;
330  //
331  delete scoreDir;
332 }
G4UIcommand * colorMapMinMaxCmd
G4UIdirectory * mTransDir
G4UIcommand * mCylinderSizeCmd
G4UIdirectory * mRotDir
G4UIcmdWithADoubleAndUnit * mRotZCmd
G4UIdirectory * meshCreateDir
G4UIcommand * drawColumnCmd
G4UIcmdWithoutParameter * mRResetCmd
G4UIcmdWithAString * meshOpnCmd
G4UIcmdWithAString * meshBoxCreateCmd
G4UIcmdWithoutParameter * mTResetCmd
G4UIcmdWithoutParameter * listCmd
G4UIdirectory * scoreDir
G4UIcmdWithoutParameter * meshClsCmd
G4UIcmdWithoutParameter * listColorMapCmd
G4UIcmdWith3VectorAndUnit * mTXyzCmd
G4UIcommand * dumpQtyToFileCmd
G4UIcmdWithADoubleAndUnit * mRotYCmd
G4UIcommand * dumpAllQtsToFileCmd
G4UIcmdWithAnInteger * verboseCmd
G4UIdirectory * meshDir
G4UIcmdWithoutParameter * dumpCmd
G4UIcmdWithAString * floatMinMaxCmd
G4UIcmdWith3VectorAndUnit * mBoxSizeCmd
G4UIcmdWithAString * meshCylinderCreateCmd
G4UIcmdWithADoubleAndUnit * mRotXCmd
G4UIdirectory * colorMapDir

Member Function Documentation

◆ FillTokenVec()

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

Definition at line 538 of file G4ScoringMessenger.cc.

538  {
539 
540  G4Tokenizer next(newValues);
541  G4String val;
542  while ( !(val = next()).isNull() ) { // Loop checking 12.18.2015 M.Asai
543  token.push_back(val);
544  }
545 }
Here is the caller graph for this function:

◆ GetCurrentValue()

G4String G4ScoringMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 529 of file G4ScoringMessenger.cc.

530 {
531  G4String val;
532  if(command==verboseCmd)
534 
535  return val;
536 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4int GetVerboseLevel() const
G4UIcmdWithAnInteger * verboseCmd
G4ScoringManager * fSMan
Here is the call graph for this function:

◆ MeshBinCommand()

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

Definition at line 548 of file G4ScoringMessenger.cc.

548  {
549  G4int Ni = StoI(token[0]);
550  G4int Nj = StoI(token[1]);
551  G4int Nk = StoI(token[2]);
552  G4int nSegment[3];
553 
554  if(dynamic_cast<G4ScoringBox*>(mesh)) {
555  G4cout << ".... G4ScoringMessenger::MeshBinCommand - G4ScoringBox" << G4endl;
556  nSegment[0] = Ni;
557  nSegment[1] = Nj;
558  nSegment[2] = Nk;
559  } else if(dynamic_cast<G4ScoringCylinder*>(mesh)) {
560  G4cout << ".... G4ScoringMessenger::MeshBinCommand - G4ScoringCylinder" << G4endl;
561  nSegment[0] = Nj;
562  nSegment[1] = Nk;
563  nSegment[2] = Ni;
564  } else {
565  G4Exception("G4ScoringMessenger::MeshBinCommand()", "001", FatalException, "invalid mesh type");
566  return;
567  }
568  //
569  mesh->SetNumberOfSegments(nSegment);
570 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4int StoI(G4String s)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
void SetNumberOfSegments(G4int nSegment[3])
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 334 of file G4ScoringMessenger.cc.

335 {
336  if(command==listCmd) {
337  fSMan->List();
338  } else if(command==dumpCmd) {
339  fSMan->Dump();
340  } else if(command==drawCmd) {
341  G4Tokenizer next(newVal);
342  G4String meshName = next();
343  G4String psName = next();
344  G4String colorMapName = next();
345  G4int axflg = StoI(next());
346  fSMan->DrawMesh(meshName,psName,colorMapName,axflg);
347  } else if(command==drawColumnCmd) {
348  G4Tokenizer next(newVal);
349  G4String meshName = next();
350  G4String psName = next();
351  G4int iPlane = StoI(next());
352  G4int iColumn = StoI(next());
353  G4String colorMapName = next();
354  fSMan->DrawMesh(meshName,psName,iPlane,iColumn,colorMapName);
355 // } else if(command==chartCmd ){
356 // G4Tokenizer next(newVal);
357 // G4String meshName = next();
358 // G4String psName = next();
359 // //G4bool onFlag = StoB(next());
360 // G4String scaleOption = next();
361 // fSMan->DrawChart(meshName,psName,onFlag,scaleOption);
362 
363  } else if(command==dumpQtyToFileCmd) {
364  G4Tokenizer next(newVal);
365  G4String meshName = next();
366  G4String psName = next();
367  G4String fileName = next();
368  G4String option = next("\n");
369  fSMan->DumpQuantityToFile(meshName, psName, fileName, option);
370  } else if(command==dumpAllQtsToFileCmd) {
371  G4Tokenizer next(newVal);
372  G4String meshName = next();
373  G4String fileName = next();
374  G4String option = next("\n");
375  fSMan->DumpAllQuantitiesToFile(meshName, fileName, option);
376  } else if(command==verboseCmd) {
378  } else if(command==meshBoxCreateCmd) {
379  G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh();
380  if ( currentmesh ){
381  G4cerr << "ERROR[" << meshBoxCreateCmd->GetCommandPath()
382  << "] : Mesh <" << currentmesh->GetWorldName()
383  << "> is still open. Close it first. Command ignored." << G4endl;
384  } else {
385 
386  G4VScoringMesh* mesh = fSMan->FindMesh(newVal);
387  if ( !mesh ){
388  mesh = new G4ScoringBox(newVal);
389  fSMan->RegisterScoringMesh(mesh);
390  }else{
391  G4cerr << "ERROR[" << meshBoxCreateCmd->GetCommandPath()
392  << "] : Scoring mesh <" << newVal
393  << "> already exists. Command ignored." << G4endl;
394  }
395  }
396  } else if(command==meshCylinderCreateCmd) {
397  G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh();
398  if ( currentmesh ){
400  << "] : Mesh <" << currentmesh->GetWorldName()
401  << "> is still open. Close it first. Command ignored." << G4endl;
402  } else {
403 
404  G4VScoringMesh* mesh = fSMan->FindMesh(newVal);
405  if ( !mesh ){
406  mesh = new G4ScoringCylinder(newVal);
407  fSMan->RegisterScoringMesh(mesh);
408  }else{
410  << "] : Scoring mesh <" << newVal
411  << "> already exists. Command ignored." << G4endl;
412  }
413  }
414  } else if(command==listColorMapCmd) {
416  } else if(command==floatMinMaxCmd) {
417  G4VScoreColorMap* colorMap = fSMan->GetScoreColorMap(newVal);
418  if(colorMap)
419  { colorMap->SetFloatingMinMax(true); }
420  else
421  { G4cerr << "ERROR[" << floatMinMaxCmd->GetCommandPath()
422  << "] : color map <" << newVal << "> is not defined. Command ignored."
423  << G4endl;
424  }
425  } else if(command==colorMapMinMaxCmd) {
426  G4Tokenizer next(newVal);
427  G4String mapName = next();
428  G4double minVal = StoD(next());
429  G4double maxVal = StoD(next());
430  G4VScoreColorMap* colorMap = fSMan->GetScoreColorMap(mapName);
431  if(colorMap)
432  { colorMap->SetFloatingMinMax(false);
433  colorMap->SetMinMax(minVal,maxVal); }
434  else
435  { G4cerr << "ERROR[" << colorMapMinMaxCmd->GetCommandPath()
436  << "] : color map <" << newVal << "> is not defined. Command ignored."
437  << G4endl;
438  }
439  } else if(command==meshOpnCmd) {
440  G4VScoringMesh* currentmesh = fSMan->GetCurrentMesh();
441  if ( currentmesh ){
442  G4cerr << "ERROR[" << meshOpnCmd->GetCommandPath()
443  << "] : Mesh <" << currentmesh->GetWorldName() << "> is still open. Close it first. Command ignored." << G4endl;
444  } else {
445  G4VScoringMesh* mesh = fSMan->FindMesh(newVal);
446  if ( !mesh ){
447  G4cerr << "ERROR[" << meshOpnCmd->GetCommandPath()
448  << "] : Scoring mesh <" << newVal << "> does not exist. Command ignored." << G4endl;
449  } else {
450  fSMan->SetCurrentMesh(mesh);
451  }
452  }
453  } else if(command==meshClsCmd) {
455  } else {
456  //
457  // Get Current Mesh
458  //
460  //
461  // Commands for Current Mesh
462  if ( mesh ){
463  // Tokens
464  G4TokenVec token;
465  FillTokenVec(newVal,token);
466  //
467  // Mesh Geometry
468  //
469 // if(command==meshActCmd) {
470 // mesh->Activate(meshActCmd->GetNewBoolValue(newVal));
471 // } else
472  if(command==mBoxSizeCmd) {
473  MeshShape shape = mesh->GetShape();
474  if ( shape == boxMesh ){
476  G4double vsize[3];
477  vsize[0] = size.x();
478  vsize[1] = size.y();
479  vsize[2] = size.z();
480  mesh->SetSize(vsize);
481  } else {
482  G4cerr << "ERROR[" << mBoxSizeCmd->GetCommandPath()
483  << "] : This mesh is not Box. Command ignored." << G4endl;
484  }
485  }else if(command==mCylinderSizeCmd) {
486  MeshShape shape = mesh->GetShape();
487  if ( shape == cylinderMesh ){
488  G4double vsize[3];
489  vsize[0] = StoD(token[0]);
490  vsize[1] = StoD(token[1]);
491  G4double unt = mCylinderSizeCmd->ValueOf(token[2]);
492  vsize[0] *= unt;
493  vsize[1] *= unt;
494  vsize[2] = 0.0;
495  mesh->SetSize(vsize);
496  } else {
497  G4cerr << "ERROR[" << mBoxSizeCmd->GetCommandPath()
498  << "] : This mesh is not Box. Command ignored." << G4endl;
499  }
500  } else if(command==mBinCmd) {
501  MeshBinCommand(mesh,token);
502  } else if(command==mTResetCmd) {
503  G4double centerPosition[3] ={ 0., 0., 0.};
504  mesh->SetCenterPosition(centerPosition);
505  } else if(command==mTXyzCmd) {
507  G4double centerPosition[3];
508  centerPosition[0] = xyz.x();
509  centerPosition[1] = xyz.y();
510  centerPosition[2] = xyz.z();
511  mesh->SetCenterPosition(centerPosition);
512  } else if(command==mRResetCmd) {
513  } else if(command==mRotXCmd) {
514  G4double value = mRotXCmd->GetNewDoubleValue(newVal);
515  mesh->RotateX(value);
516  } else if(command==mRotYCmd) {
517  G4double value = mRotYCmd->GetNewDoubleValue(newVal);
518  mesh->RotateY(value);
519  } else if(command==mRotZCmd) {
520  G4double value = mRotZCmd->GetNewDoubleValue(newVal);
521  mesh->RotateZ(value);
522  }
523  }else{
524  G4cerr << "ERROR: No mesh is currently open. Open/create a mesh first. Command ignored." << G4endl;
525  }
526  }
527 }
G4UIcommand * colorMapMinMaxCmd
G4VScoringMesh * GetCurrentMesh() const
std::vector< G4String > G4TokenVec
G4UIcommand * mCylinderSizeCmd
void RotateY(G4double delta)
static G4int GetNewIntValue(const char *paramString)
void SetSize(G4double size[3])
static G4ThreeVector GetNew3VectorValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * mRotZCmd
void RotateX(G4double delta)
G4UIcommand * drawColumnCmd
G4VScoringMesh * FindMesh(G4VHitsCollection *map)
static G4double GetNewDoubleValue(const char *paramString)
int G4int
Definition: G4Types.hh:78
void DumpAllQuantitiesToFile(const G4String &meshName, const G4String &fileName, const G4String &option="")
G4UIcmdWithoutParameter * mRResetCmd
void SetMinMax(G4double minVal, G4double maxVal)
const G4String & GetWorldName() const
G4UIcmdWithAString * meshOpnCmd
G4VScoreColorMap * GetScoreColorMap(const G4String &mapName)
G4UIcmdWithAString * meshBoxCreateCmd
G4UIcmdWithoutParameter * mTResetCmd
G4UIcmdWithoutParameter * listCmd
G4UIcmdWithoutParameter * meshClsCmd
G4int StoI(G4String s)
void RotateZ(G4double delta)
double x() const
void DrawMesh(const G4String &meshName, const G4String &psName, const G4String &colorMapName, G4int axflg=111)
G4UIcmdWithoutParameter * listColorMapCmd
void SetCenterPosition(G4double centerPosition[3])
double y() const
G4double StoD(G4String s)
void SetCurrentMesh(G4VScoringMesh *scm)
void DumpQuantityToFile(const G4String &meshName, const G4String &psName, const G4String &fileName, const G4String &option="")
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:308
G4UIcmdWith3VectorAndUnit * mTXyzCmd
void MeshBinCommand(G4VScoringMesh *mesh, G4TokenVec &token)
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:139
G4UIcommand * dumpQtyToFileCmd
double z() const
G4UIcmdWithADoubleAndUnit * mRotYCmd
void SetFloatingMinMax(G4bool vl=true)
MeshShape
G4UIcommand * dumpAllQtsToFileCmd
G4UIcmdWithAnInteger * verboseCmd
#define G4endl
Definition: G4ios.hh:61
void FillTokenVec(G4String newValues, G4TokenVec &token)
G4ScoringManager * fSMan
double G4double
Definition: G4Types.hh:76
void SetVerboseLevel(G4int vl)
void RegisterScoringMesh(G4VScoringMesh *scm)
G4UIcmdWithoutParameter * dumpCmd
G4UIcmdWithAString * floatMinMaxCmd
MeshShape GetShape() const
G4UIcmdWith3VectorAndUnit * mBoxSizeCmd
G4UIcmdWithAString * meshCylinderCreateCmd
G4UIcmdWithADoubleAndUnit * mRotXCmd
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:

Member Data Documentation

◆ colorMapDir

G4UIdirectory* G4ScoringMessenger::colorMapDir
private

Definition at line 123 of file G4ScoringMessenger.hh.

◆ colorMapMinMaxCmd

G4UIcommand* G4ScoringMessenger::colorMapMinMaxCmd
private

Definition at line 126 of file G4ScoringMessenger.hh.

◆ drawCmd

G4UIcommand* G4ScoringMessenger::drawCmd
private

Definition at line 121 of file G4ScoringMessenger.hh.

◆ drawColumnCmd

G4UIcommand* G4ScoringMessenger::drawColumnCmd
private

Definition at line 122 of file G4ScoringMessenger.hh.

◆ dumpAllQtsToFileCmd

G4UIcommand* G4ScoringMessenger::dumpAllQtsToFileCmd
private

Definition at line 131 of file G4ScoringMessenger.hh.

◆ dumpCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::dumpCmd
private

Definition at line 87 of file G4ScoringMessenger.hh.

◆ dumpQtyToFileCmd

G4UIcommand* G4ScoringMessenger::dumpQtyToFileCmd
private

Definition at line 130 of file G4ScoringMessenger.hh.

◆ floatMinMaxCmd

G4UIcmdWithAString* G4ScoringMessenger::floatMinMaxCmd
private

Definition at line 125 of file G4ScoringMessenger.hh.

◆ fSMan

G4ScoringManager* G4ScoringMessenger::fSMan
private

Definition at line 84 of file G4ScoringMessenger.hh.

◆ listCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::listCmd
private

Definition at line 86 of file G4ScoringMessenger.hh.

◆ listColorMapCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::listColorMapCmd
private

Definition at line 124 of file G4ScoringMessenger.hh.

◆ mBinCmd

G4UIcommand* G4ScoringMessenger::mBinCmd
private

Definition at line 108 of file G4ScoringMessenger.hh.

◆ mBoxSizeCmd

G4UIcmdWith3VectorAndUnit* G4ScoringMessenger::mBoxSizeCmd
private

Definition at line 103 of file G4ScoringMessenger.hh.

◆ mCylinderSizeCmd

G4UIcommand* G4ScoringMessenger::mCylinderSizeCmd
private

Definition at line 104 of file G4ScoringMessenger.hh.

◆ meshBoxCreateCmd

G4UIcmdWithAString* G4ScoringMessenger::meshBoxCreateCmd
private

Definition at line 91 of file G4ScoringMessenger.hh.

◆ meshClsCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::meshClsCmd
private

Definition at line 99 of file G4ScoringMessenger.hh.

◆ meshCreateDir

G4UIdirectory* G4ScoringMessenger::meshCreateDir
private

Definition at line 90 of file G4ScoringMessenger.hh.

◆ meshCylinderCreateCmd

G4UIcmdWithAString* G4ScoringMessenger::meshCylinderCreateCmd
private

Definition at line 92 of file G4ScoringMessenger.hh.

◆ meshDir

G4UIdirectory* G4ScoringMessenger::meshDir
private

Definition at line 96 of file G4ScoringMessenger.hh.

◆ meshOpnCmd

G4UIcmdWithAString* G4ScoringMessenger::meshOpnCmd
private

Definition at line 97 of file G4ScoringMessenger.hh.

◆ mRotDir

G4UIdirectory* G4ScoringMessenger::mRotDir
private

Definition at line 114 of file G4ScoringMessenger.hh.

◆ mRotXCmd

G4UIcmdWithADoubleAndUnit* G4ScoringMessenger::mRotXCmd
private

Definition at line 116 of file G4ScoringMessenger.hh.

◆ mRotYCmd

G4UIcmdWithADoubleAndUnit* G4ScoringMessenger::mRotYCmd
private

Definition at line 117 of file G4ScoringMessenger.hh.

◆ mRotZCmd

G4UIcmdWithADoubleAndUnit* G4ScoringMessenger::mRotZCmd
private

Definition at line 118 of file G4ScoringMessenger.hh.

◆ mRResetCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::mRResetCmd
private

Definition at line 115 of file G4ScoringMessenger.hh.

◆ mTransDir

G4UIdirectory* G4ScoringMessenger::mTransDir
private

Definition at line 111 of file G4ScoringMessenger.hh.

◆ mTResetCmd

G4UIcmdWithoutParameter* G4ScoringMessenger::mTResetCmd
private

Definition at line 112 of file G4ScoringMessenger.hh.

◆ mTXyzCmd

G4UIcmdWith3VectorAndUnit* G4ScoringMessenger::mTXyzCmd
private

Definition at line 113 of file G4ScoringMessenger.hh.

◆ scoreDir

G4UIdirectory* G4ScoringMessenger::scoreDir
private

Definition at line 85 of file G4ScoringMessenger.hh.

◆ verboseCmd

G4UIcmdWithAnInteger* G4ScoringMessenger::verboseCmd
private

Definition at line 88 of file G4ScoringMessenger.hh.


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