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

#include <G4ParticlePropertyTable.hh>

Public Member Functions

G4int operator== (const G4ParticlePropertyTable &right) const
 
G4int operator!= (const G4ParticlePropertyTable &right) const
 
virtual ~G4ParticlePropertyTable ()
 
G4ParticlePropertyDataGetParticleProperty (const G4String &aParticleName)
 
G4ParticlePropertyDataGetParticleProperty (const G4ParticleDefinition *aParticle)
 
G4bool SetParticleProperty (const G4ParticlePropertyData &newProperty)
 
void Clear ()
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 

Static Public Member Functions

static G4ParticlePropertyTableGetParticlePropertyTable ()
 

Protected Member Functions

 G4ParticlePropertyTable ()
 
 G4ParticlePropertyTable (const G4ParticlePropertyTable &right)
 
G4ParticlePropertyTableoperator= (const G4ParticlePropertyTable &right)
 

Protected Attributes

G4ParticleTablefParticleTable
 
std::vector< G4ParticlePropertyData * > arrayDataObject
 

Detailed Description

Definition at line 48 of file G4ParticlePropertyTable.hh.

Constructor & Destructor Documentation

◆ G4ParticlePropertyTable() [1/2]

G4ParticlePropertyTable::G4ParticlePropertyTable ( )
protected

Definition at line 65 of file G4ParticlePropertyTable.cc.

65 :
66 verboseLevel(1)
67{
69}
static G4ParticleTable * GetParticleTable()

◆ G4ParticlePropertyTable() [2/2]

G4ParticlePropertyTable::G4ParticlePropertyTable ( const G4ParticlePropertyTable right)
protected

Definition at line 72 of file G4ParticlePropertyTable.cc.

73{
75 *this = right;
76}

◆ ~G4ParticlePropertyTable()

G4ParticlePropertyTable::~G4ParticlePropertyTable ( )
virtual

Definition at line 56 of file G4ParticlePropertyTable.cc.

57{
58 for (size_t idx=0; idx<arrayDataObject.size(); idx++){
59 delete arrayDataObject[idx];
60 }
61 arrayDataObject.clear();
62}
std::vector< G4ParticlePropertyData * > arrayDataObject

Member Function Documentation

◆ Clear()

void G4ParticlePropertyTable::Clear ( )

Definition at line 101 of file G4ParticlePropertyTable.cc.

102{
103 for (size_t idx=0; idx<arrayDataObject.size(); idx++){
104 delete arrayDataObject[idx];
105 }
106 arrayDataObject.clear();
107}

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

◆ GetParticleProperty() [1/2]

G4ParticlePropertyData * G4ParticlePropertyTable::GetParticleProperty ( const G4ParticleDefinition aParticle)

Definition at line 119 of file G4ParticlePropertyTable.cc.

120{
121 if (aParticle ==0 ) return 0;
123 pData->thePDGMass = aParticle->GetPDGMass();
124 pData->thePDGWidth = aParticle->GetPDGWidth();
125 pData->thePDGCharge = aParticle->GetPDGCharge();
126 pData->thePDGiSpin = aParticle->GetPDGiSpin();
127 pData->thePDGiParity = aParticle->GetPDGiParity();
128 pData->thePDGiConjugation = aParticle->GetPDGiConjugation();
129 pData->thePDGiGParity = aParticle->GetPDGiGParity();
130 pData->thePDGiIsospin = aParticle->GetPDGiIsospin();
131 pData->thePDGiIsospin3 = aParticle->GetPDGiIsospin3();
132 pData->thePDGMagneticMoment = aParticle->GetPDGMagneticMoment();
133 pData->theLeptonNumber = aParticle->GetLeptonNumber();
134 pData->theBaryonNumber = aParticle->GetBaryonNumber();
135 pData->thePDGEncoding = aParticle->GetPDGEncoding();
136 pData->theAntiPDGEncoding = aParticle->GetAntiPDGEncoding();
137 pData->thePDGLifeTime = aParticle->GetPDGLifeTime();
138 for (size_t flv=0; flv<G4ParticlePropertyData::NumberOfQuarkFlavor; ++flv) {
139 pData->theQuarkContent[flv] = aParticle->theQuarkContent[flv];
140 pData->theAntiQuarkContent[flv] = aParticle->theAntiQuarkContent[flv];
141 }
142
143 arrayDataObject.push_back(pData);
144
145 return pData;
146}
G4double GetPDGMagneticMoment() const
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
G4double GetPDGWidth() const
G4double GetPDGCharge() const
G4int theQuarkContent[NumberOfQuarkFlavor]
G4double GetPDGLifeTime() const
const G4String & GetParticleName() const

◆ GetParticleProperty() [2/2]

G4ParticlePropertyData * G4ParticlePropertyTable::GetParticleProperty ( const G4String aParticleName)

Definition at line 110 of file G4ParticlePropertyTable.cc.

111{
112 G4ParticleDefinition* aParticle = fParticleTable->FindParticle(aParticleName);
113 if (aParticle ==0 ) return 0;
114
115 return GetParticleProperty(aParticle);
116}
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 46 of file G4ParticlePropertyTable.cc.

47{
48 static G4ParticlePropertyTable theParticlePropertyTable;
49 if (!fgParticlePropertyTable){
50 fgParticlePropertyTable = &theParticlePropertyTable;
51 }
52 return fgParticlePropertyTable;
53}

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

◆ GetVerboseLevel()

G4int G4ParticlePropertyTable::GetVerboseLevel ( ) const

◆ operator!=()

G4int G4ParticlePropertyTable::operator!= ( const G4ParticlePropertyTable right) const

Definition at line 95 of file G4ParticlePropertyTable.cc.

96{
97 return false;
98}

◆ operator=()

G4ParticlePropertyTable & G4ParticlePropertyTable::operator= ( const G4ParticlePropertyTable right)
protected

Definition at line 79 of file G4ParticlePropertyTable.cc.

80{
81 if (this != &right) {
83 verboseLevel = right.verboseLevel;
84 }
85 return *this;
86}

◆ operator==()

G4int G4ParticlePropertyTable::operator== ( const G4ParticlePropertyTable right) const

Definition at line 89 of file G4ParticlePropertyTable.cc.

90{
91 return true;
92}

◆ SetParticleProperty()

G4bool G4ParticlePropertyTable::SetParticleProperty ( const G4ParticlePropertyData newProperty)

Definition at line 149 of file G4ParticlePropertyTable.cc.

150{
152 if (pStateMan->GetCurrentState() != G4State_PreInit){
153#ifdef G4VERBOSE
154 if (verboseLevel>0){
155 G4cout << "G4ParticlePropertyTable::GetParticleProperty() ";
156 G4cout << " for " << pData.theParticleName << G4endl;
157 G4cout << " Particle properties can be modified only in Pre_Init state";
158 G4cout << G4endl;
159 }
160#endif
161 return false;
162 }
163
164 G4ParticleDefinition* aParticle = fParticleTable->FindParticle(pData.theParticleName);
165 if (aParticle ==0 ) {
166#ifdef G4VERBOSE
167 if (verboseLevel>1){
168 G4cout << "G4ParticlePropertyTable::GetParticleProperty() ";
169 G4cout << " for " << pData.theParticleName << G4endl;
170 G4cout << " Particle does not exist" << G4endl;
171 }
172#endif
173 return false;
174 }
175
176 if (pData.fPDGMassModified) {
177 aParticle->thePDGMass = pData.thePDGMass;
178 }
179 if (pData.fPDGWidthModified) {
180 aParticle->thePDGMass = pData.thePDGMass;
181 }
182 if (pData.fPDGChargeModified) {
183 aParticle->thePDGCharge = pData.thePDGCharge;
184 }
185 if (pData.fPDGiSpinModified) {
186 aParticle->thePDGiSpin = pData.thePDGiSpin;
187 aParticle->thePDGSpin = 0.5*pData.thePDGiSpin;
188 }
189 if (pData.fPDGiParityModified) {
190 aParticle->thePDGiParity = pData.thePDGiParity;
191 }
192 if (pData.fPDGiConjugationModified) {
193 aParticle->thePDGiConjugation = pData.thePDGiConjugation;
194 }
195 if (pData.fPDGiGParityModified) {
196 aParticle->thePDGiGParity = pData.thePDGiGParity;
197 }
198 if (pData.fPDGiIsospinModified) {
199 aParticle->thePDGiIsospin = pData.thePDGiIsospin;
200 aParticle->thePDGIsospin = 0.5*pData.thePDGiIsospin;
201 }
202 if (pData.fPDGiIsospin3Modified) {
203 aParticle->thePDGiIsospin3 = pData.thePDGiIsospin3;
204 aParticle->thePDGIsospin3 = 0.5*pData.thePDGiIsospin3;
205 }
206 if (pData.fPDGMagneticMomentModified) {
207 aParticle->thePDGMagneticMoment = pData.thePDGMagneticMoment;
208 }
209 if (pData.fLeptonNumberModified) {
210 aParticle->theLeptonNumber = pData.theLeptonNumber;
211 }
212 if (pData.fBaryonNumberModified) {
213 aParticle->theBaryonNumber = pData.theBaryonNumber;
214 }
215 if (pData.fPDGEncodingModified) {
216 aParticle->thePDGEncoding = pData.thePDGEncoding;
217 }
218 if (pData.fAntiPDGEncodingModified) {
219 aParticle->theAntiPDGEncoding = pData.theAntiPDGEncoding;
220 }
221 if (pData.fPDGLifeTimeModified) {
222 aParticle->thePDGLifeTime = pData.thePDGLifeTime;
223 }
224 for (size_t flv=0; flv<<G4ParticlePropertyData::NumberOfQuarkFlavor; ++flv) {
225 if (pData.fQuarkContentModified){
226 aParticle->theQuarkContent[flv] = pData.theQuarkContent[flv];
227 }
228 if (pData.fAntiQuarkContentModified){
229 aParticle->theAntiQuarkContent[flv] = pData.theAntiQuarkContent[flv];
230 }
231 }
232
233 return true;
234}
@ G4State_PreInit
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
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

◆ fParticleTable

G4ParticleTable* G4ParticlePropertyTable::fParticleTable
protected

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