Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4ParticlesChecker.h
Go to the documentation of this file.
1#ifndef TG4_PARTICLES_CHECKER_H
2#define TG4_PARTICLES_CHECKER_H
3
4//------------------------------------------------
5// The Geant4 Virtual Monte Carlo package
6// Copyright (C) 2007 - 2014 Ivana Hrivnacova
7// All rights reserved.
8//
9// For the licensing terms see geant4_vmc/LICENSE.
10// Contact: root-vmc@cern.ch
11//-------------------------------------------------
12
17
19#include "TG4Verbose.h"
20
21#include <set>
22
24
25class TParticlePDG;
26
37
39{
40 public:
55
56 public:
59
60 static G4String GetParticlePropertyName(ParticleProperty property);
61 static ParticleProperty GetParticleProperty(const G4String& propertyName);
62
63 G4bool CheckParticles() const;
64 G4bool CheckParticle(G4int pdgEncoding) const;
65
66 // set methods
67 void SetChecking(ParticleProperty property, G4bool check);
68 void SetPrecision(G4double precision);
69
70 // get methods
71 const std::set<ParticleProperty>& GetAvailableProperties() const;
72 const std::set<ParticleProperty>& GetCheckedProperties() const;
73
74 private:
79
80 // methods
81 G4bool IsEqualRel(G4double dx, G4double dy, G4double epsilon) const;
82
83 G4double GetPropertyValue(
84 ParticleProperty property, G4ParticleDefinition* g4Particle) const;
85 G4double GetPropertyValue(
86 ParticleProperty property, TParticlePDG* rtParticle) const;
87
88 void PrintCheckedProperties() const;
89
90 G4bool CheckName(
91 G4ParticleDefinition* g4Particle, TParticlePDG* rtParticle) const;
92 G4bool CheckProperty(ParticleProperty property,
93 G4ParticleDefinition* g4Particle, TParticlePDG* rtParticle) const;
94 G4bool CheckParticle(
95 G4ParticleDefinition* g4Particle, TParticlePDG* rtParticle) const;
96
97 // static data members
98 static const G4double fgkDefaultPrecision;
99
100 // data members
101
104
106 std::set<ParticleProperty> fAvailableProperties;
107
109 std::set<ParticleProperty> fCheckedProperties;
110
112 G4double fPrecision;
113};
114
115// inline functions
116
117inline void TG4ParticlesChecker::SetPrecision(G4double precision)
118{
120 fPrecision = precision;
121}
122
123inline const std::set<TG4ParticlesChecker::ParticleProperty>&
129
130inline const std::set<TG4ParticlesChecker::ParticleProperty>&
136
137#endif // TG4_PARTICLES_CHECKER_H
Definition of the TG4ParticlesCheckerMessenger class.
Definition of the TG4Verbose class.
Messenger class that defines commands for TG4ParticlesChecker.
A helper class for comparing the basic particles properties in between Root and Geant4.
const std::set< ParticleProperty > & GetAvailableProperties() const
G4double fPrecision
precision for checking
G4bool CheckParticle(G4int pdgEncoding) const
ParticleProperty
The enumeration of "checkable" particle properties.
void SetChecking(ParticleProperty property, G4bool check)
std::set< ParticleProperty > fCheckedProperties
set of properties selected for checking
static G4String GetParticlePropertyName(ParticleProperty property)
static ParticleProperty GetParticleProperty(const G4String &propertyName)
TG4ParticlesChecker & operator=(const TG4ParticlesChecker &right)
Not implemented.
static const G4double fgkDefaultPrecision
default precision
TG4ParticlesCheckerMessenger fMessenger
messenger for this class
TG4ParticlesChecker(const TG4ParticlesChecker &right)
Not implemented.
const std::set< ParticleProperty > & GetCheckedProperties() const
G4bool CheckName(G4ParticleDefinition *g4Particle, TParticlePDG *rtParticle) const
G4bool IsEqualRel(G4double dx, G4double dy, G4double epsilon) const
std::set< ParticleProperty > fAvailableProperties
set of available properties
G4double GetPropertyValue(ParticleProperty property, G4ParticleDefinition *g4Particle) const
G4bool CheckProperty(ParticleProperty property, G4ParticleDefinition *g4Particle, TParticlePDG *rtParticle) const
void SetPrecision(G4double precision)
Base class for defining the verbose level and a common messenger.
Definition TG4Verbose.h:36