56 scoreDir->
SetGuidance(
"Interactive scoring commands.");
70 meshCreateDir->
SetGuidance(
" Mesh creation commands.");
74 meshBoxCreateCmd->
SetGuidance(
"Create scoring box mesh.");
78 meshCylinderCreateCmd->
SetGuidance(
"Create scoring mesh.");
85 meshRWLogVolCreateCmd =
new G4UIcommand(
"/score/create/realWorldLogVol",
this);
86 meshRWLogVolCreateCmd->
SetGuidance(
"Define scorers to a logical volume defined in the real world.");
87 meshRWLogVolCreateCmd->
SetGuidance(
" - Name of the specified logical volume is used as the mesh name.");
88 meshRWLogVolCreateCmd->
SetGuidance(
" - /score/mesh commands do not affect for this mesh.");
89 meshRWLogVolCreateCmd->
SetGuidance(
" - If copyNumberLevel is set, the copy number of that-level higher");
90 meshRWLogVolCreateCmd->
SetGuidance(
" in the geometrical hierarchy is used as the index.");
98 probeCreateCmd =
new G4UIcommand(
"/score/create/probe",
this);
99 probeCreateCmd->
SetGuidance(
"Define scoring probe.");
100 probeCreateCmd->
SetGuidance(
" halfSize defines the half-width of the probing cube.");
124 meshDir->
SetGuidance(
" Mesh processing commands.");
127 mBoxSizeCmd->
SetGuidance(
"Define size of the scoring mesh.");
130 mBoxSizeCmd->
SetRange(
"Di>0. && Dj>0. && Dk>0.");
133 mCylinderSizeCmd =
new G4UIcommand(
"/score/mesh/cylinderSize",
this);
134 mCylinderSizeCmd->
SetGuidance(
"Define size of the scoring mesh.");
147 mBinCmd =
new G4UIcommand(
"/score/mesh/nBin",
this);
148 mBinCmd->
SetGuidance(
"Define segments of the scoring mesh.");
150 mBinCmd->
SetGuidance(
" In case of boxMesh, parameters are given in");
151 mBinCmd->
SetGuidance(
" Ni :(int) Number of bins i (in x-axis) ");
152 mBinCmd->
SetGuidance(
" Nj :(int) Number of bins j (in y-axis) ");
153 mBinCmd->
SetGuidance(
" Nk :(int) Number of bins k (in z-axis) ");
154 mBinCmd->
SetGuidance(
" In case of cylinderMesh, parameters are given in");
155 mBinCmd->
SetGuidance(
" Nr :(int) Number of bins in radial axis ");
156 mBinCmd->
SetGuidance(
" Nz :(int) Number of bins in z axis ");
157 mBinCmd->
SetGuidance(
" Nphi:(int) Number of bins in phi axis ");
178 mTransDir->
SetGuidance(
"Mesh translation commands.");
181 mTResetCmd->
SetGuidance(
"Reset translated position of the scoring mesh.");
184 mTXyzCmd->
SetGuidance(
"Translate the scoring mesh.");
195 mRotXCmd->
SetGuidance(
"Rotate the scoring mesh in X axis.");
200 mRotYCmd->
SetGuidance(
"Rotate the scoring mesh in Y axis.");
205 mRotZCmd->
SetGuidance(
"Rotate the scoring mesh in Z axis.");
213 probeMatCmd->
SetGuidance(
"Specify a material to the probe cube.");
214 probeMatCmd->
SetGuidance(
"Material name has to be taken from G4NistManager.");
215 probeMatCmd->
SetGuidance(
"Once this command is used, the specified material overlays the material in the mass geometry");
216 probeMatCmd->
SetGuidance(
"with \"Layered Mass Geometry\" mechanism so that physics quantities such as energy deposition");
217 probeMatCmd->
SetGuidance(
"or dose will be calculated with this material.");
218 probeMatCmd->
SetGuidance(
"To switch-off this overlaying, use \"none\".");
223 probeLocateCmd->
SetGuidance(
"Locate a probe in the global coordinate system.");
228 drawCmd =
new G4UIcommand(
"/score/drawProjection",
this);
229 drawCmd->
SetGuidance(
"Draw projection(s) of scored quantities.");
230 drawCmd->
SetGuidance(
"Parameter <proj> specified which projection(s) to be drawn.");
231 drawCmd->
SetGuidance(
" 100 : xy-plane, 010 : yz-plane, 001 : zx-plane -- default 111");
232 drawCmd->
SetGuidance(
" 100 : N/A, 010 : z_phi-plane, 001 : r_phi-plane -- default 111");
246 drawColumnCmd =
new G4UIcommand(
"/score/drawColumn",
this);
248 drawColumnCmd->
SetGuidance(
" plane = 0 : x-y, 1: y-z, 2: z-x for box mesh");
249 drawColumnCmd->
SetGuidance(
" 0 : z-phi, 1: r-phi, 2: r-z for cylinder mesh");
268 listColorMapCmd->
SetGuidance(
"List registered score color maps.");
272 floatMinMaxCmd->
SetGuidance(
"Min/Max of the color map is calculated according to the actual scores.");
277 colorMapMinMaxCmd =
new G4UIcommand(
"/score/colorMap/setMinMax",
this);
278 colorMapMinMaxCmd->
SetGuidance(
"Define min/max value of the color map.");
309 dumpQtyToFileCmd =
new G4UIcommand(
"/score/dumpQuantityToFile",
this);
310 dumpQtyToFileCmd->
SetGuidance(
"Dump one scored quantity to file.");
321 dumpQtyWithFactorCmd =
new G4UIcommand(
"/score/dumpQuantityWithFactor",
this);
322 dumpQtyWithFactorCmd->
SetGuidance(
"Dump one scored quantity to file.");
323 dumpQtyWithFactorCmd->
SetGuidance(
"Each value is multiplied by the specified factor.");
338 dumpAllQtsToFileCmd =
new G4UIcommand(
"/score/dumpAllQuantitiesToFile",
this);
339 dumpAllQtsToFileCmd->
SetGuidance(
"Dump all quantities of the mesh to file.");
348 dumpAllQtsWithFactorCmd =
new G4UIcommand(
"/score/dumpAllQuantitiesWithFactor",
this);
349 dumpAllQtsWithFactorCmd->
SetGuidance(
"Dump all quantities of the mesh to file.");
350 dumpAllQtsWithFactorCmd->
SetGuidance(
"Each value is multiplied by the specified factor.");
362 fill1DCmd =
new G4UIcommand(
"/score/fill1D",
this);
363 fill1DCmd->
SetGuidance(
"Let a primitive scorer fill 1-D histogram");
364 fill1DCmd->
SetGuidance(
"Before using this command, primitive scorer must be defined and assigned.");
365 fill1DCmd->
SetGuidance(
"Also before using this command, a histogram has to be defined by /analysis/h1/create command.");
366 fill1DCmd->
SetGuidance(
"This command is available only for real-world volume or probe.");
367 fill1DCmd->
SetGuidance(
"Please note that this command has to be applied to each copy number of the scoring volume.");
368 fill1DCmd->
SetGuidance(
"If same histogram ID is used more than once, more than one scorers fill that histogram.");
386 delete meshBoxCreateCmd;
387 delete meshCylinderCreateCmd;
388 delete meshRWLogVolCreateCmd;
389 delete probeCreateCmd;
390 delete meshCreateDir;
400 delete mCylinderSizeCmd;
414 delete probeLocateCmd;
421 delete drawColumnCmd;
422 delete listColorMapCmd;
423 delete floatMinMaxCmd;
424 delete colorMapMinMaxCmd;
426 delete dumpQtyToFileCmd;
427 delete dumpQtyWithFactorCmd;
428 delete dumpAllQtsToFileCmd;
429 delete dumpAllQtsWithFactorCmd;
439 if(command==listCmd) {
441 }
else if(command==dumpCmd) {
443 }
else if(command==drawCmd) {
449 fSMan->
DrawMesh(meshName,psName,colorMapName,axflg);
450 }
else if(command==drawColumnCmd) {
457 fSMan->
DrawMesh(meshName,psName,iPlane,iColumn,colorMapName);
466 }
else if(command==dumpQtyToFileCmd) {
472 auto mesh = fSMan->
FindMesh(meshName);
476 ed <<
"Mesh name <" << meshName <<
"> is not found. Command ignored.";
481 }
else if(command==dumpQtyWithFactorCmd) {
488 auto mesh = fSMan->
FindMesh(meshName);
492 ed <<
"Mesh name <" << meshName <<
"> is not found. Command ignored.";
499 }
else if(command==dumpAllQtsToFileCmd) {
504 auto mesh = fSMan->
FindMesh(meshName);
508 ed <<
"Mesh name <" << meshName <<
"> is not found. Command ignored.";
513 }
else if(command==dumpAllQtsWithFactorCmd) {
519 auto mesh = fSMan->
FindMesh(meshName);
523 ed <<
"Mesh name <" << meshName <<
"> is not found. Command ignored.";
530 }
else if(command==fill1DCmd) {
532 }
else if(command==verboseCmd) {
534 }
else if(command==meshBoxCreateCmd) {
540 <<
"> is still open. Close it first. Command ignored.";
551 <<
"] : Scoring mesh <" << newVal
552 <<
"> already exists. Command ignored.";
556 }
else if(command==meshCylinderCreateCmd) {
562 <<
"> is still open. Close it first. Command ignored.";
573 <<
"] : Scoring mesh <" << newVal
574 <<
"> already exists. Command ignored.";
578 }
else if(command==meshRWLogVolCreateCmd) {
583 <<
"] : Mesh <" << mesh->GetWorldName()
584 <<
"> is still open. Close it first. Command ignored.";
595 mesh->SetCopyNumberLevel(idx);
600 <<
"] : Scoring mesh <" << meshName <<
"> already exists. Command ignored.";
604 }
else if(command==probeCreateCmd) {
609 <<
"] : Mesh <" << mesh->GetWorldName()
610 <<
"> is still open. Close it first. Command ignored.";
630 <<
"] : Mesh name <" << qname <<
"> already exists. Use another name.";
634 }
else if(command==probeMatCmd || command==probeLocateCmd) {
639 ed <<
"ERROR : No mesh is currently open. Open/create a mesh first. Command ignored.";
643 if(mesh->GetShape() != MeshShape::probe)
646 ed <<
"ERROR : Inconsistent mesh type. Close current mesh and open Scoring Probe.";
651 if(command==probeMatCmd)
657 ed <<
"Material <" << newVal <<
"> is not defind in G4NistManager. Command is ignored.\n"
658 <<
"Use /material/nist/listMaterials command to see the available materials.";
663 else if(command==probeLocateCmd)
668 }
else if(command==listColorMapCmd) {
670 }
else if(command==floatMinMaxCmd) {
678 <<
"] : color map <" << newVal <<
"> is not defined. Command ignored." ;
681 }
else if(command==colorMapMinMaxCmd) {
694 <<
"] : color map <" << newVal <<
"> is not defined. Command ignored."
698 }
else if(command==meshOpnCmd) {
704 <<
"> is still open. Close it first. Command ignored.";
711 <<
"] : Scoring mesh <" << newVal <<
"> does not exist. Command ignored.";
717 }
else if(command==meshClsCmd) {
728 if ( shape == MeshShape::realWorldLogVol ) {
731 <<
"] : Number of mesh command cannot be set for this type of mesh. Command ignored.";
744 if(command==mBoxSizeCmd) {
745 if ( shape == MeshShape::box){
755 <<
"] : This mesh is not Box. Command ignored.";
758 }
else if(command==mCylinderSizeCmd) {
759 if ( shape == MeshShape::cylinder ){
761 vsize[0] =
StoD(token[0]);
762 vsize[1] =
StoD(token[1]);
771 <<
"] : This mesh is not Box. Command ignored.";
774 }
else if(command==mBinCmd) {
776 }
else if(command==mTResetCmd) {
777 G4double centerPosition[3] ={ 0., 0., 0.};
779 }
else if(command==mTXyzCmd) {
782 centerPosition[0] = xyz.
x();
783 centerPosition[1] = xyz.
y();
784 centerPosition[2] = xyz.
z();
787 }
else if(command==mRotXCmd) {
790 }
else if(command==mRotYCmd) {
793 }
else if(command==mRotZCmd) {
800 ed <<
"ERROR: No mesh is currently open. Open/create a mesh first. Command ignored.";
809 if(command==verboseCmd)
819 while ( !(val = next()).isNull() ) {
820 token.push_back(val);
832 G4cout <<
".... G4ScoringMessenger::MeshBinCommand - G4ScoringBox" <<
G4endl;
837 G4cout <<
".... G4ScoringMessenger::MeshBinCommand - G4ScoringCylinder" <<
G4endl;
866 ed <<
"G4TScoreHistFiller is not instantiated in this application.";
875 auto mesh = sm->FindMesh(meshName);
879 ed <<
"Mesh name <" << meshName <<
"> is not found.";
883 auto shape = mesh->GetShape();
884 if(shape!=MeshShape::realWorldLogVol && shape!=MeshShape::probe)
887 ed <<
"Mesh <" << meshName <<
"> is not real-world logical volume or probe.";
892 auto prim = mesh->GetPrimitiveScorer(primName);
896 ed <<
"Primitive scorer name <" << primName <<
"> is not found.";
904 ed <<
"Primitive scorer <" << primName <<
"> does not support direct histogram filling.";
909 pp->Plot(copyNo,histID);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
std::vector< G4String > G4TokenVec
G4GLOB_DLL std::ostream G4cout
void RegisterScoringMesh(G4VScoringMesh *scm)
G4int GetVerboseLevel() const
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 ListScoreColorMaps()
static G4ScoringManager * GetScoringManagerIfExist()
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)
G4ScoringMessenger(G4ScoringManager *SManager)
void Fill1D(G4UIcommand *cmd, G4String newValues)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValues)
void SetDefaultUnit(const char *defUnit)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultUnit(const char *defUnit)
static G4double GetNewDoubleValue(const char *paramString)
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)
static G4int GetNewIntValue(const char *paramString)
void SetToBeBroadcasted(G4bool val)
static G4double ValueOf(const char *unitName)
static G4String ConvertToString(G4bool boolVal)
const G4String & GetCommandPath() const
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void CommandFailed(G4int errCode, G4ExceptionDescription &ed)
void SetRange(const char *rs)
G4double StoD(G4String s)
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)
void SetDefaultUnit(const char *theDefaultUnit)
void SetMinMax(G4double minVal, G4double maxVal)
void SetFloatingMinMax(G4bool vl=true)
static G4VScoreHistFiller * Instance()
MeshShape GetShape() const
void RotateY(G4double delta)
const G4String & GetWorldName() const
void SetNumberOfSegments(G4int nSegment[3])
void SetCenterPosition(G4double centerPosition[3])
void RotateX(G4double delta)
void SetSize(G4double size[3])
void RotateZ(G4double delta)