124void G4ScoreQuantityMessenger::QuantityCommands()
131 quantityDir->
SetGuidance(
"Scoring quantity of the mesh.");
135 "Assign previously defined quantity to the current quantity.");
139 qGetUnitCmd->
SetGuidance(
"Print output unit of the current quantity.");
142 qSetUnitCmd->
SetGuidance(
"Set output unit of the current quantity.");
146 qeDepCmd =
new G4UIcommand(
"/score/quantity/energyDeposit",
this);
148 qeDepCmd->
SetGuidance(
"[usage] /score/quantity/energyDeposit qname unit");
149 qeDepCmd->
SetGuidance(
" qname :(String) scorer name");
157 qCellChgCmd =
new G4UIcommand(
"/score/quantity/cellCharge",
this);
159 qCellChgCmd->
SetGuidance(
"[usage] /score/quantity/cellCharge qname unit");
160 qCellChgCmd->
SetGuidance(
" qname :(String) scorer name");
168 qCellFluxCmd =
new G4UIcommand(
"/score/quantity/cellFlux",
this);
170 qCellFluxCmd->
SetGuidance(
"[usage] /score/quantity/cellFlux qname unit");
171 qCellFluxCmd->
SetGuidance(
" qname :(String) scorer name");
179 qPassCellFluxCmd =
new G4UIcommand(
"/score/quantity/passageCellFlux",
this);
180 qPassCellFluxCmd->
SetGuidance(
"Passage cell flux scorer");
182 "[usage] /score/quantity/passageCellFlux qname unit");
183 qPassCellFluxCmd->
SetGuidance(
" qname :(String) scorer name");
184 qPassCellFluxCmd->
SetGuidance(
" unit :(String) unit");
191 qdoseDepCmd =
new G4UIcommand(
"/score/quantity/doseDeposit",
this);
193 qdoseDepCmd->
SetGuidance(
"[usage] /score/quantity/doseDeposit qname unit");
194 qdoseDepCmd->
SetGuidance(
" qname :(String) scorer name");
202 qnOfStepCmd =
new G4UIcommand(
"/score/quantity/nOfStep",
this);
203 qnOfStepCmd->
SetGuidance(
"Number of step scorer.");
204 qnOfStepCmd->
SetGuidance(
"[usage] /score/quantity/nOfStep qname");
205 qnOfStepCmd->
SetGuidance(
"[usage] /score/quantity/nOfStep qname bflag");
206 qnOfStepCmd->
SetGuidance(
" qname :(String) scorer name");
207 qnOfStepCmd->
SetGuidance(
" bflag :(Bool) Skip zero step ");
208 qnOfStepCmd->
SetGuidance(
" at geometry boundary if true");
215 qnOfSecondaryCmd =
new G4UIcommand(
"/score/quantity/nOfSecondary",
this);
216 qnOfSecondaryCmd->
SetGuidance(
"Number of secondary scorer.");
217 qnOfSecondaryCmd->
SetGuidance(
"[usage] /score/quantity/nOfSecondary qname");
218 qnOfSecondaryCmd->
SetGuidance(
" qname :(String) scorer name");
222 qTrackLengthCmd =
new G4UIcommand(
"/score/quantity/trackLength",
this);
223 qTrackLengthCmd->
SetGuidance(
"Track length scorer.");
225 "[usage] /score/quantity/trackLength qname wflag kflag vflag unit");
226 qTrackLengthCmd->
SetGuidance(
" qname :(String) scorer name");
227 qTrackLengthCmd->
SetGuidance(
" wflag :(Bool) weighted");
228 qTrackLengthCmd->
SetGuidance(
" kflag :(Bool) multiply kinetic energy");
229 qTrackLengthCmd->
SetGuidance(
" vflag :(Bool) divide by velocity");
230 qTrackLengthCmd->
SetGuidance(
" unit :(String) unit");
247 new G4UIcommand(
"/score/quantity/passageCellCurrent",
this);
248 qPassCellCurrCmd->
SetGuidance(
"Passage cell current scorer.");
250 "[usage] /score/quantity/passageCellCurrent qname wflag");
251 qPassCellCurrCmd->
SetGuidance(
" qname :(String) scorer name");
252 qPassCellCurrCmd->
SetGuidance(
" wflag :(Bool) weighted");
259 qPassTrackLengthCmd =
260 new G4UIcommand(
"/score/quantity/passageTrackLength",
this);
261 qPassTrackLengthCmd->
SetGuidance(
"Passage track length scorer.");
263 "[usage] /score/quantity/passageTrackLength qname wflag unit");
264 qPassTrackLengthCmd->
SetGuidance(
" qname :(String) scorer name");
265 qPassTrackLengthCmd->
SetGuidance(
" wflag :(Bool) weighted");
266 qPassTrackLengthCmd->
SetGuidance(
" unit :(Bool) unit");
277 new G4UIcommand(
"/score/quantity/flatSurfaceCurrent",
this);
278 qFlatSurfCurrCmd->
SetGuidance(
"Flat surface current Scorer.");
280 "[usage] /score/quantity/flatSurfaceCurrent qname dflag wflag aflag unit");
281 qFlatSurfCurrCmd->
SetGuidance(
" qname :(String) scorer name");
282 qFlatSurfCurrCmd->
SetGuidance(
" dflag :(Int) direction flag");
283 qFlatSurfCurrCmd->
SetGuidance(
" : 0 = Both In and Out");
286 qFlatSurfCurrCmd->
SetGuidance(
" wflag :(Bool) weighted");
287 qFlatSurfCurrCmd->
SetGuidance(
" aflag :(Bool) divide by area");
288 qFlatSurfCurrCmd->
SetGuidance(
" unit :(String) unit");
304 qFlatSurfFluxCmd =
new G4UIcommand(
"/score/quantity/flatSurfaceFlux",
this);
305 qFlatSurfFluxCmd->
SetGuidance(
"Flat surface flux scorer.");
307 "[usage] /score/quantity/flatSurfaceFlux qname dflag unit");
308 qFlatSurfFluxCmd->
SetGuidance(
" qname :(String) scorer name");
309 qFlatSurfFluxCmd->
SetGuidance(
" dflag :(Int) direction flag");
310 qFlatSurfFluxCmd->
SetGuidance(
" : 0 = Both In and Out");
313 qFlatSurfFluxCmd->
SetGuidance(
" wflag :(Bool) weighted");
314 qFlatSurfFluxCmd->
SetGuidance(
" aflag :(Bool) divide by area");
315 qFlatSurfFluxCmd->
SetGuidance(
" unit :(String) unit");
332 qVolFluxCmd =
new G4UIcommand(
"/score/quantity/volumeFlux",
this);
335 "This scorer scores the number of particles getting into the volume "
336 "without normalized by the surface area.");
338 "[usage] /score/quantity/volumeFlux qname divcos dflag");
339 qVolFluxCmd->
SetGuidance(
" qname :(String) scorer name");
340 qVolFluxCmd->
SetGuidance(
" divcos :(Bool) divide by cos(theta), where theta "
341 "is the incident angle (default : false)");
343 " dflag :(Int) direction, 1 : inward (default), 2 : outward");
354 qNofCollisionCmd =
new G4UIcommand(
"/score/quantity/nOfCollision",
this);
355 qNofCollisionCmd->
SetGuidance(
"Number of collision scorer.");
357 "[usage] /score/quantity/nOfCollision qname wflag");
358 qNofCollisionCmd->
SetGuidance(
" qname :(String) scorer name");
365 qPopulationCmd =
new G4UIcommand(
"/score/quantity/population",
this);
367 qPopulationCmd->
SetGuidance(
"[usage] /score/quantity/population qname wflag");
368 qPopulationCmd->
SetGuidance(
" qname :(String) scorer name");
369 qPopulationCmd->
SetGuidance(
" wflag :(Bool) weighted");
377 qTrackCountCmd =
new G4UIcommand(
"/score/quantity/nOfTrack",
this);
378 qTrackCountCmd->
SetGuidance(
"Number of track scorer.");
380 "[usage] /score/quantity/nOfTrack qname dflag wflag");
381 qTrackCountCmd->
SetGuidance(
" qname :(String) scorer name");
382 qTrackCountCmd->
SetGuidance(
" dflag :(Int) direction");
383 qTrackCountCmd->
SetGuidance(
" : 0 = Both In and Out");
386 qTrackCountCmd->
SetGuidance(
" wflag :(Bool) weighted");
397 qTerminationCmd =
new G4UIcommand(
"/score/quantity/nOfTerminatedTrack",
this);
398 qTerminationCmd->
SetGuidance(
"Number of terminated tracks scorer.");
400 "[usage] /score/quantity/nOfTerminatedTrack qname wflag");
401 qTerminationCmd->
SetGuidance(
" qname :(String) scorer name");
402 qTerminationCmd->
SetGuidance(
" wflag :(Bool) weighted");
411 new G4UIcommand(
"/score/quantity/minKinEAtGeneration",
this);
412 qMinKinEAtGeneCmd->
SetGuidance(
"Min Kinetic Energy at Generation");
414 "[usage] /score/quantity/minKinEAtGeneration qname unit");
415 qMinKinEAtGeneCmd->
SetGuidance(
" qname :(String) scorer name");
416 qMinKinEAtGeneCmd->
SetGuidance(
" unit :(String) unit name");
423 qStepCheckerCmd =
new G4UIcommand(
"/score/quantity/stepChecker",
this);
424 qStepCheckerCmd->
SetGuidance(
"Display a comment when this PS is invoked");
425 qStepCheckerCmd->
SetGuidance(
"[usage] /score/quantity/stepChecker qname");
426 qStepCheckerCmd->
SetGuidance(
" qname :(String) scorer name");
431void G4ScoreQuantityMessenger::FilterCommands()
438 filterDir->
SetGuidance(
" Scoring filter commands.");
441 fchargedCmd->
SetGuidance(
"Charged particle filter.");
445 fneutralCmd->
SetGuidance(
"Neutral particle filter.");
448 fkinECmd =
new G4UIcommand(
"/score/filter/kineticEnergy",
this);
451 "[usage] /score/filter/kineticEnergy fname Elow Ehigh unit");
452 fkinECmd->
SetGuidance(
" fname :(String) Filter Name ");
453 fkinECmd->
SetGuidance(
" Elow :(Double) Lower edge of kinetic energy");
454 fkinECmd->
SetGuidance(
" Ehigh :(Double) Higher edge of kinetic energy");
455 fkinECmd->
SetGuidance(
" unit :(String) unit of given kinetic energy");
469 fparticleCmd =
new G4UIcommand(
"/score/filter/particle",
this);
471 fparticleCmd->
SetGuidance(
"[usage] /score/filter/particle fname p0 .. pn");
472 fparticleCmd->
SetGuidance(
" fname :(String) Filter Name ");
473 fparticleCmd->
SetGuidance(
" p0 .. pn :(String) particle names");
483 new G4UIcommand(
"/score/filter/particleWithKineticEnergy",
this);
484 fparticleKinECmd->
SetGuidance(
"Particle with kinetic energy filter.");
486 "[usage] /score/filter/particleWithKineticEnergy fname Elow Ehigh unit p0 "
488 fparticleKinECmd->
SetGuidance(
" fname :(String) Filter Name ");
490 " Elow :(Double) Lower edge of kinetic energy");
492 " Ehigh :(Double) Higher edge of kinetic energy");
494 " unit :(String) unit of given kinetic energy");
495 fparticleKinECmd->
SetGuidance(
" p0 .. pn :(String) particle names");
524 delete qPassCellFluxCmd;
528 delete qnOfSecondaryCmd;
530 delete qTrackLengthCmd;
531 delete qPassCellCurrCmd;
532 delete qPassTrackLengthCmd;
533 delete qFlatSurfCurrCmd;
534 delete qFlatSurfFluxCmd;
537 delete qNofCollisionCmd;
538 delete qPopulationCmd;
539 delete qTrackCountCmd;
540 delete qTerminationCmd;
541 delete qMinKinEAtGeneCmd;
543 delete qStepCheckerCmd;
550 delete fparticleKinECmd;
566 ed <<
"ERROR : No mesh is currently open. Open/create a mesh first. "
578 if(command == qTouchCmd)
582 else if(command == qGetUnitCmd)
586 else if(command == qSetUnitCmd)
590 else if(command == qCellChgCmd)
595 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
607 else if(command == qCellFluxCmd)
612 if(shape == MeshShape::box)
616 else if(shape == MeshShape::cylinder)
623 pps->SetNumberOfSegments(nSeg);
626 else if(shape == MeshShape::realWorldLogVol)
628 ed <<
"Cell flux for real world volume is not yet supported. Command "
633 else if(shape == MeshShape::probe)
641 else if(command == qPassCellFluxCmd)
646 if(shape == MeshShape::box)
650 else if(shape == MeshShape::cylinder)
657 pps->SetNumberOfSegments(nSeg);
660 else if(shape == MeshShape::realWorldLogVol)
662 ed <<
"Passing cell flux for real world volume is not yet supported. "
667 else if(shape == MeshShape::probe)
675 else if(command == qeDepCmd)
680 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
692 else if(command == qdoseDepCmd)
697 if(shape == MeshShape::box)
701 else if(shape == MeshShape::cylinder)
705 pps->SetUnit(token[1]);
709 pps->SetNumberOfSegments(nSeg);
712 else if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
720 else if(command == qnOfStepCmd)
725 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
737 else if(command == qnOfSecondaryCmd)
742 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
753 else if(command == qTrackLengthCmd)
758 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
773 else if(command == qPassCellCurrCmd)
778 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
790 else if(command == qPassTrackLengthCmd)
795 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
808 else if(command == qFlatSurfCurrCmd)
813 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
835 else if(command == qFlatSurfFluxCmd)
840 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
862 else if(command == qVolFluxCmd)
867 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
880 else if(command == qNofCollisionCmd)
885 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
897 else if(command == qPopulationCmd)
902 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
914 else if(command == qTrackCountCmd)
919 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
932 else if(command == qTerminationCmd)
937 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
949 else if(command == qMinKinEAtGeneCmd)
954 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
966 else if(command == qStepCheckerCmd)
971 if(shape == MeshShape::realWorldLogVol || shape == MeshShape::probe)
986 else if(command == fchargedCmd)
995 <<
"] : Current quantity is not set. Set or touch a quantity first.";
999 else if(command == fneutralCmd)
1008 <<
"] : Current quantity is not set. Set or touch a quantity first.";
1012 else if(command == fkinECmd)
1026 <<
"] : Current quantity is not set. Set or touch a quantity first.";
1030 else if(command == fparticleKinECmd)
1039 <<
"] : Current quantity is not set. Set or touch a quantity first.";
1043 else if(command == fparticleCmd)
1052 <<
"] : Current quantity is not set. Set or touch a quantity first.";
1070 while(!(val = next()).empty())
1072 token.push_back(val);
1084 std::vector<G4String> pnames;
1085 for(
G4int i = 1; i < (
G4int) token.size(); i++)
1087 pnames.push_back(token[i]);
1103 for(
G4int i = 4; i < (
G4int) token.size(); i++)
1105 filter->add(token[i]);
1120 ed <<
"WARNING[" << qTouchCmd->
GetCommandPath() <<
"] : Quantity name, \""
1121 << psname <<
"\", is already existing.";
std::ostringstream G4ExceptionDescription
std::vector< G4String > G4TokenVec
G4GLOB_DLL std::ostream G4cout
virtual void SetUnit(const G4String &unit)
virtual void SetUnit(const G4String &unit)
virtual void SetUnit(const G4String &unit)
virtual void SetUnit(const G4String &unit)
void DivideByArea(G4bool flg=true)
void Weighted(G4bool flg=true)
virtual void SetUnit(const G4String &unit)
void Weighted(G4bool flg=true)
void DivideByArea(G4bool flg=true)
virtual void SetUnit(const G4String &unit)
virtual void SetUnit(const G4String &unit)
void Weighted(G4bool flg=true)
void SetBoundaryFlag(G4bool flg=true)
void Weighted(G4bool flg=true)
virtual void SetUnit(const G4String &unit)
virtual void SetUnit(const G4String &unit)
void Weighted(G4bool flg=true)
void Weighted(G4bool flg=true)
void Weighted(G4bool flg=true)
void Weighted(G4bool flg=true)
virtual void SetUnit(const G4String &unit)
void MultiplyKineticEnergy(G4bool flg=true)
void Weighted(G4bool flg=true)
void DivideByVelocity(G4bool flg=true)
void SetDivCos(G4bool val)
void FParticleWithEnergyCommand(G4VScoringMesh *mesh, G4TokenVec &token)
G4bool CheckMeshPS(G4VScoringMesh *mesh, G4String &psname, G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValues) override
G4String GetCurrentValue(G4UIcommand *) override
~G4ScoreQuantityMessenger() override
G4ScoreQuantityMessenger(G4ScoringManager *SManager)
void FillTokenVec(G4String newValues, G4TokenVec &token)
void FParticleCommand(G4VScoringMesh *mesh, G4TokenVec &token)
G4VScoringMesh * GetCurrentMesh() const
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
const G4String & GetCommandPath() const
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
void CommandFailed(G4int errCode, G4ExceptionDescription &ed)
G4double StoD(const G4String &s)
G4String DtoS(G4double a)
G4int StoI(const G4String &s)
void SetDefaultValue(const char *theDefaultValue)
void SetParameterRange(const char *theRange)
void SetDefaultUnit(const char *theDefaultUnit)
static G4double GetValueOf(const G4String &)
void SetFilter(G4VSDFilter *filter)
void SetNullToCurrentPrimitiveScorer()
G4ThreeVector GetSize() const
MeshShape GetShape() const
G4double GetStartAngle() const
void GetNumberOfSegments(G4int nSegment[3])
G4int GetCopyNumberLevel() const
void SetCurrentPSUnit(const G4String &unit)
void SetCurrentPrimitiveScorer(const G4String &name)
void SetPrimitiveScorer(G4VPrimitiveScorer *ps)
G4String GetCurrentPSUnit()
G4double GetAngleSpan() const
G4bool IsCurrentPrimitiveScorerNull()
G4bool FindPrimitiveScorer(const G4String &psname)