20#include <G4UIcmdWithABool.hh>
21#include <G4UIcmdWithADouble.hh>
22#include <G4UIcmdWithAString.hh>
23#include <G4UIcmdWithAnInteger.hh>
24#include <G4UIcmdWithoutParameter.hh>
25#include <G4UIdirectory.hh>
31 fParticlesChecker(particlesChecker),
33 fSelectedProperty(
""),
34 fCheckParticlesCmd(0),
36 fSelectPropertyCmd(0),
42 fDirectory =
new G4UIdirectory(
"/mcParticlesChecker/");
43 fDirectory->SetGuidance(
"Particles checker commands.");
46 new G4UIcmdWithoutParameter(
"/mcParticlesChecker/checkParticles",
this);
48 "Check properties for all instantiated particles");
52 new G4UIcmdWithAnInteger(
"/mcParticlesChecker/checkParticle",
this);
54 "Check properties for the particle with given PDG encoding");
59 new G4UIcmdWithAString(
"/mcParticlesChecker/selectProperty",
this);
64 new G4UIcmdWithABool(
"/mcParticlesChecker/setChecking",
this);
65 fSetCheckingCmd->SetGuidance(
"(In)Activate checking for a selected property");
70 new G4UIcmdWithADouble(
"/mcParticlesChecker/setPrecision",
this);
74 G4State_PreInit, G4State_Init, G4State_Idle);
103 const std::set<TG4ParticlesChecker::ParticleProperty>& availableProperties =
105 std::set<TG4ParticlesChecker::ParticleProperty>::const_iterator it;
106 for (it = availableProperties.begin(); it != availableProperties.end();
109 candidates = candidates + G4String(
" ");
113 G4String guidance =
"Select particle property to be checked.\n";
114 guidance = guidance +
"Available: ";
115 guidance = guidance + candidates;
137 TString text =
"The particle property has to be selected first.\n";
138 text = text +
"The command will have no effect.";
140 "The particle property has not been yet seleceted.");
Definition of the TG4Globals class and basic container types.
Definition of the TG4ParticlesCheckerMessenger class.
Definition of the TG4ParticlesChecker class.
Definition of the TG4UICmdWithAComplexString class.
static void Warning(const TString &className, const TString &methodName, const TString &text)
G4UIcmdWithoutParameter * fCheckParticlesCmd
command: checkParticles
G4UIcmdWithADouble * fSetPrecisionCmd
command: setPrecision
G4UIcmdWithAString * fSelectPropertyCmd
command: selectProperty
virtual void SetNewValue(G4UIcommand *command, G4String string)
G4UIcmdWithAnInteger * fCheckParticleCmd
command: checkParticle
TG4ParticlesCheckerMessenger()
Not implemented.
G4UIcmdWithABool * fSetCheckingCmd
command: setChecking
G4UIdirectory * fDirectory
command directory
TG4ParticlesChecker * fParticlesChecker
associated class
virtual ~TG4ParticlesCheckerMessenger()
G4String fSelectedProperty
selected property
A helper class for comparing the basic particles properties in between Root and Geant4.
const std::set< ParticleProperty > & GetAvailableProperties() const
G4bool CheckParticle(G4int pdgEncoding) const
void SetChecking(ParticleProperty property, G4bool check)
static G4String GetParticlePropertyName(ParticleProperty property)
static ParticleProperty GetParticleProperty(const G4String &propertyName)
G4bool CheckParticles() const
void SetPrecision(G4double precision)