Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticlePropertyTable Class Reference

#include <G4ParticlePropertyTable.hh>

Public Member Functions

 G4ParticlePropertyTable (const G4ParticlePropertyTable &)=delete
 
G4ParticlePropertyTableoperator= (const G4ParticlePropertyTable &)=delete
 
 ~G4ParticlePropertyTable ()
 
G4ParticlePropertyDataGetParticleProperty (const G4String &aParticleName)
 
G4ParticlePropertyDataGetParticleProperty (const G4ParticleDefinition *aP)
 
G4bool SetParticleProperty (const G4ParticlePropertyData &newProperty)
 
void Clear ()
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 

Static Public Member Functions

static G4ParticlePropertyTableGetParticlePropertyTable ()
 

Protected Member Functions

 G4ParticlePropertyTable ()
 

Protected Attributes

G4ParticleTablefParticleTable = nullptr
 
std::vector< G4ParticlePropertyData * > arrayDataObject
 

Detailed Description

Definition at line 46 of file G4ParticlePropertyTable.hh.

Constructor & Destructor Documentation

◆ G4ParticlePropertyTable() [1/2]

G4ParticlePropertyTable::G4ParticlePropertyTable ( const G4ParticlePropertyTable & )
delete

◆ ~G4ParticlePropertyTable()

G4ParticlePropertyTable::~G4ParticlePropertyTable ( )

Definition at line 50 of file G4ParticlePropertyTable.cc.

51{
52 for (const auto& idx : arrayDataObject) {
53 delete idx;
54 }
55 arrayDataObject.clear();
56}
std::vector< G4ParticlePropertyData * > arrayDataObject

◆ G4ParticlePropertyTable() [2/2]

G4ParticlePropertyTable::G4ParticlePropertyTable ( )
protected

Definition at line 58 of file G4ParticlePropertyTable.cc.

59{
61}
static G4ParticleTable * GetParticleTable()

Referenced by GetParticlePropertyTable().

Member Function Documentation

◆ Clear()

void G4ParticlePropertyTable::Clear ( )

Definition at line 63 of file G4ParticlePropertyTable.cc.

64{
65 for (const auto& idx : arrayDataObject) {
66 delete idx;
67 }
68 arrayDataObject.clear();
69}

Referenced by G4VParticlePropertyReporter::~G4VParticlePropertyReporter(), and G4VParticlePropertyRetriever::~G4VParticlePropertyRetriever().

◆ GetParticleProperty() [1/2]

G4ParticlePropertyData * G4ParticlePropertyTable::GetParticleProperty ( const G4ParticleDefinition * aP)

Definition at line 80 of file G4ParticlePropertyTable.cc.

81{
82 if (aParticle == nullptr) return nullptr;
83 auto pData = new G4ParticlePropertyData(aParticle->GetParticleName());
84 pData->thePDGMass = aParticle->GetPDGMass();
85 pData->thePDGWidth = aParticle->GetPDGWidth();
86 pData->thePDGCharge = aParticle->GetPDGCharge();
87 pData->thePDGiSpin = aParticle->GetPDGiSpin();
88 pData->thePDGiParity = aParticle->GetPDGiParity();
89 pData->thePDGiConjugation = aParticle->GetPDGiConjugation();
90 pData->thePDGiGParity = aParticle->GetPDGiGParity();
91 pData->thePDGiIsospin = aParticle->GetPDGiIsospin();
92 pData->thePDGiIsospin3 = aParticle->GetPDGiIsospin3();
93 pData->thePDGMagneticMoment = aParticle->GetPDGMagneticMoment();
94 pData->theLeptonNumber = aParticle->GetLeptonNumber();
95 pData->theBaryonNumber = aParticle->GetBaryonNumber();
96 pData->thePDGEncoding = aParticle->GetPDGEncoding();
97 pData->theAntiPDGEncoding = aParticle->GetAntiPDGEncoding();
98 pData->thePDGLifeTime = aParticle->GetPDGLifeTime();
99 for (std::size_t flv = 0; flv < G4ParticlePropertyData::NumberOfQuarkFlavor; ++flv) {
100 pData->theQuarkContent[flv] = aParticle->theQuarkContent[flv];
101 pData->theAntiQuarkContent[flv] = aParticle->theAntiQuarkContent[flv];
102 }
103
104 arrayDataObject.push_back(pData);
105
106 return pData;
107}

◆ GetParticleProperty() [2/2]

G4ParticlePropertyData * G4ParticlePropertyTable::GetParticleProperty ( const G4String & aParticleName)

Definition at line 71 of file G4ParticlePropertyTable.cc.

72{
73 G4ParticleDefinition* aParticle = fParticleTable->FindParticle(aParticleName);
74 if (aParticle == nullptr) return nullptr;
75
76 return GetParticleProperty(aParticle);
77}
G4ParticlePropertyData * GetParticleProperty(const G4String &aParticleName)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)

Referenced by G4VParticlePropertyReporter::FillList(), GetParticleProperty(), and G4TextPPRetriever::ModifyPropertyTable().

◆ GetParticlePropertyTable()

G4ParticlePropertyTable * G4ParticlePropertyTable::GetParticlePropertyTable ( )
static

Definition at line 42 of file G4ParticlePropertyTable.cc.

43{
44 if (fgParticlePropertyTable == nullptr) {
45 fgParticlePropertyTable = new G4ParticlePropertyTable;
46 }
47 return fgParticlePropertyTable;
48}

Referenced by G4VParticlePropertyReporter::G4VParticlePropertyReporter(), and G4VParticlePropertyRetriever::G4VParticlePropertyRetriever().

◆ GetVerboseLevel()

G4int G4ParticlePropertyTable::GetVerboseLevel ( ) const

◆ operator=()

G4ParticlePropertyTable & G4ParticlePropertyTable::operator= ( const G4ParticlePropertyTable & )
delete

◆ SetParticleProperty()

G4bool G4ParticlePropertyTable::SetParticleProperty ( const G4ParticlePropertyData & newProperty)

Definition at line 109 of file G4ParticlePropertyTable.cc.

110{
112 if (pStateMan->GetCurrentState() != G4State_PreInit) {
113#ifdef G4VERBOSE
114 if (verboseLevel > 0) {
115 G4cout << "G4ParticlePropertyTable::GetParticleProperty() ";
116 G4cout << " for " << pData.theParticleName << G4endl;
117 G4cout << " Particle properties can be modified only in Pre_Init state";
118 G4cout << G4endl;
119 }
120#endif
121 return false;
122 }
123
124 G4ParticleDefinition* aParticle = fParticleTable->FindParticle(pData.theParticleName);
125 if (aParticle == nullptr) {
126#ifdef G4VERBOSE
127 if (verboseLevel > 1) {
128 G4cout << "G4ParticlePropertyTable::GetParticleProperty() ";
129 G4cout << " for " << pData.theParticleName << G4endl;
130 G4cout << " Particle does not exist" << G4endl;
131 }
132#endif
133 return false;
134 }
135
136 if (pData.fPDGMassModified) {
137 aParticle->thePDGMass = pData.thePDGMass;
138 }
139 if (pData.fPDGWidthModified) {
140 aParticle->thePDGMass = pData.thePDGMass;
141 }
142 if (pData.fPDGChargeModified) {
143 aParticle->thePDGCharge = pData.thePDGCharge;
144 }
145 if (pData.fPDGiSpinModified) {
146 aParticle->thePDGiSpin = pData.thePDGiSpin;
147 aParticle->thePDGSpin = 0.5 * pData.thePDGiSpin;
148 }
149 if (pData.fPDGiParityModified) {
150 aParticle->thePDGiParity = pData.thePDGiParity;
151 }
152 if (pData.fPDGiConjugationModified) {
153 aParticle->thePDGiConjugation = pData.thePDGiConjugation;
154 }
155 if (pData.fPDGiGParityModified) {
156 aParticle->thePDGiGParity = pData.thePDGiGParity;
157 }
158 if (pData.fPDGiIsospinModified) {
159 aParticle->thePDGiIsospin = pData.thePDGiIsospin;
160 aParticle->thePDGIsospin = 0.5 * pData.thePDGiIsospin;
161 }
162 if (pData.fPDGiIsospin3Modified) {
163 aParticle->thePDGiIsospin3 = pData.thePDGiIsospin3;
164 aParticle->thePDGIsospin3 = 0.5 * pData.thePDGiIsospin3;
165 }
166 if (pData.fPDGMagneticMomentModified) {
167 aParticle->thePDGMagneticMoment = pData.thePDGMagneticMoment;
168 }
169 if (pData.fLeptonNumberModified) {
170 aParticle->theLeptonNumber = pData.theLeptonNumber;
171 }
172 if (pData.fBaryonNumberModified) {
173 aParticle->theBaryonNumber = pData.theBaryonNumber;
174 }
175 if (pData.fPDGEncodingModified) {
176 aParticle->thePDGEncoding = pData.thePDGEncoding;
177 }
178 if (pData.fAntiPDGEncodingModified) {
179 aParticle->theAntiPDGEncoding = pData.theAntiPDGEncoding;
180 }
181 if (pData.fPDGLifeTimeModified) {
182 aParticle->thePDGLifeTime = pData.thePDGLifeTime;
183 }
184 for (std::size_t flv = 0; flv < G4ParticlePropertyData::NumberOfQuarkFlavor; ++flv) {
185 if (pData.fQuarkContentModified) {
186 aParticle->theQuarkContent[flv] = pData.theQuarkContent[flv];
187 }
188 if (pData.fAntiQuarkContentModified) {
189 aParticle->theAntiQuarkContent[flv] = pData.theAntiQuarkContent[flv];
190 }
191 }
192
193 return true;
194}
@ G4State_PreInit
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
G4int theQuarkContent[NumberOfQuarkFlavor]
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()

Referenced by G4TextPPRetriever::ModifyPropertyTable().

◆ SetVerboseLevel()

void G4ParticlePropertyTable::SetVerboseLevel ( G4int value)

Member Data Documentation

◆ arrayDataObject

std::vector<G4ParticlePropertyData*> G4ParticlePropertyTable::arrayDataObject
protected

Definition at line 86 of file G4ParticlePropertyTable.hh.

Referenced by Clear(), GetParticleProperty(), and ~G4ParticlePropertyTable().

◆ fParticleTable

G4ParticleTable* G4ParticlePropertyTable::fParticleTable = nullptr
protected

The documentation for this class was generated from the following files: