Geant4 VMC Version 6.6
|
A helper class for comparing the basic particles properties in between Root and Geant4. More...
#include <TG4ParticlesChecker.h>
Public Types | |
enum | ParticleProperty { kName , kMass , kCharge , kLifetime , kWidth , kParity , kSpin , kIsospin , kIsospin3 , kNone } |
The enumeration of "checkable" particle properties. More... | |
Public Member Functions | |
TG4ParticlesChecker () | |
~TG4ParticlesChecker () | |
G4bool | CheckParticles () const |
G4bool | CheckParticle (G4int pdgEncoding) const |
void | SetChecking (ParticleProperty property, G4bool check) |
void | SetPrecision (G4double precision) |
const std::set< ParticleProperty > & | GetAvailableProperties () const |
const std::set< ParticleProperty > & | GetCheckedProperties () const |
Public Member Functions inherited from TG4Verbose | |
TG4Verbose (const G4String &cmdName) | |
TG4Verbose (const G4String &cmdName, G4int verboseLevel) | |
virtual | ~TG4Verbose () |
virtual void | VerboseLevel (G4int level) |
virtual G4int | VerboseLevel () const |
Static Public Member Functions | |
static G4String | GetParticlePropertyName (ParticleProperty property) |
static ParticleProperty | GetParticleProperty (const G4String &propertyName) |
Private Member Functions | |
TG4ParticlesChecker (const TG4ParticlesChecker &right) | |
Not implemented. | |
TG4ParticlesChecker & | operator= (const TG4ParticlesChecker &right) |
Not implemented. | |
G4bool | IsEqualRel (G4double dx, G4double dy, G4double epsilon) const |
G4double | GetPropertyValue (ParticleProperty property, G4ParticleDefinition *g4Particle) const |
G4double | GetPropertyValue (ParticleProperty property, TParticlePDG *rtParticle) const |
void | PrintCheckedProperties () const |
G4bool | CheckName (G4ParticleDefinition *g4Particle, TParticlePDG *rtParticle) const |
G4bool | CheckProperty (ParticleProperty property, G4ParticleDefinition *g4Particle, TParticlePDG *rtParticle) const |
G4bool | CheckParticle (G4ParticleDefinition *g4Particle, TParticlePDG *rtParticle) const |
Private Attributes | |
TG4ParticlesCheckerMessenger | fMessenger |
messenger for this class | |
std::set< ParticleProperty > | fAvailableProperties |
set of available properties | |
std::set< ParticleProperty > | fCheckedProperties |
set of properties selected for checking | |
G4double | fPrecision |
precision for checking | |
Static Private Attributes | |
static const G4double | fgkDefaultPrecision = 1.e-06 |
default precision | |
A helper class for comparing the basic particles properties in between Root and Geant4.
Verbose level:
Definition at line 38 of file TG4ParticlesChecker.h.
The enumeration of "checkable" particle properties.
Enumerator | |
---|---|
kName | mass |
kMass | mass |
kCharge | charge |
kLifetime | lifetime |
kWidth | width |
kParity | parity |
kSpin | spin |
kIsospin | isospin |
kIsospin3 | isospin3 |
kNone | no property |
Definition at line 42 of file TG4ParticlesChecker.h.
TG4ParticlesChecker::TG4ParticlesChecker | ( | ) |
Default constructor
Definition at line 101 of file TG4ParticlesChecker.cxx.
TG4ParticlesChecker::~TG4ParticlesChecker | ( | ) |
Destructor
Definition at line 130 of file TG4ParticlesChecker.cxx.
|
private |
Not implemented.
|
static |
Return the name of property given by ParticleProperty code
Definition at line 39 of file TG4ParticlesChecker.cxx.
Referenced by CheckName(), CheckProperty(), GetParticleProperty(), TG4ParticlesCheckerMessenger::Init(), and PrintCheckedProperties().
|
static |
Return the ParticleProperty code fore the property given by name
Definition at line 69 of file TG4ParticlesChecker.cxx.
Referenced by TG4ParticlesCheckerMessenger::SetNewValue().
G4bool TG4ParticlesChecker::CheckParticles | ( | ) | const |
Loop over Root particles database and check the particles properties wrt Geant4 particles. Return true if all particles selected properties match.
Definition at line 385 of file TG4ParticlesChecker.cxx.
Referenced by TG4ParticlesCheckerMessenger::SetNewValue().
G4bool TG4ParticlesChecker::CheckParticle | ( | G4int | pdgEncoding | ) | const |
Check the properties of the particle with given pdgEncoding. Return true if all particle selected properties match
Definition at line 462 of file TG4ParticlesChecker.cxx.
Referenced by CheckParticle(), CheckParticles(), and TG4ParticlesCheckerMessenger::SetNewValue().
void TG4ParticlesChecker::SetChecking | ( | ParticleProperty | property, |
G4bool | check ) |
Select or deselect the given property for checking.
Definition at line 497 of file TG4ParticlesChecker.cxx.
Referenced by TG4ParticlesCheckerMessenger::SetNewValue().
|
inline |
Set the precision for checking.
Definition at line 117 of file TG4ParticlesChecker.h.
Referenced by TG4ParticlesCheckerMessenger::SetNewValue().
|
inline |
Return the set of available properties
Definition at line 124 of file TG4ParticlesChecker.h.
Referenced by TG4ParticlesCheckerMessenger::Init().
|
inline |
Return the set of properties selected for checking
Definition at line 131 of file TG4ParticlesChecker.h.
|
private |
Not implemented.
|
private |
The function to compare given values dx and dy; the values are found equal if there difference relative to the first value is within the given precision epsilon.
Definition at line 140 of file TG4ParticlesChecker.cxx.
Referenced by CheckProperty().
|
private |
Return the given property value for the given Geant4 particle
Definition at line 151 of file TG4ParticlesChecker.cxx.
Referenced by CheckProperty().
|
private |
Return the given property value for the given Root particle
Definition at line 180 of file TG4ParticlesChecker.cxx.
|
private |
Print the list of properties selected for checking and the selected precision
Definition at line 209 of file TG4ParticlesChecker.cxx.
Referenced by CheckParticle(), and CheckParticles().
|
private |
Check if the given property values in Geant4 and Root for the given particle are equal within the defined precision. Return true if values match, otherwise print the property name and values and return false.
Definition at line 228 of file TG4ParticlesChecker.cxx.
Referenced by CheckProperty().
|
private |
Check if the given property values in Geant4 and Root for the given particle are equal within the defined precision. Return true if values match, otherwise print the property name and values and return false.
Definition at line 327 of file TG4ParticlesChecker.cxx.
Referenced by CheckParticle().
|
private |
Check all selected properties for the given Geant4 and Root particles.
Definition at line 360 of file TG4ParticlesChecker.cxx.
|
staticprivate |
default precision
Definition at line 98 of file TG4ParticlesChecker.h.
|
private |
messenger for this class
Definition at line 103 of file TG4ParticlesChecker.h.
Referenced by TG4ParticlesChecker().
|
private |
set of available properties
Definition at line 106 of file TG4ParticlesChecker.h.
Referenced by GetAvailableProperties(), and TG4ParticlesChecker().
|
private |
set of properties selected for checking
Definition at line 109 of file TG4ParticlesChecker.h.
Referenced by CheckName(), CheckParticle(), CheckParticles(), GetCheckedProperties(), PrintCheckedProperties(), SetChecking(), and TG4ParticlesChecker().
|
private |
precision for checking
Definition at line 112 of file TG4ParticlesChecker.h.
Referenced by CheckProperty(), PrintCheckedProperties(), and SetPrecision().