Geant4-11
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Static Private Attributes
G4ParticlePropertyTable Class Reference

#include <G4ParticlePropertyTable.hh>

Public Member Functions

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

Static Public Member Functions

static G4ParticlePropertyTableGetParticlePropertyTable ()
 

Protected Member Functions

 G4ParticlePropertyTable ()
 

Protected Attributes

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

Private Attributes

G4int verboseLevel = 1
 

Static Private Attributes

static G4ThreadLocal G4ParticlePropertyTablefgParticlePropertyTable = nullptr
 

Detailed Description

Definition at line 47 of file G4ParticlePropertyTable.hh.

Constructor & Destructor Documentation

◆ G4ParticlePropertyTable() [1/2]

G4ParticlePropertyTable::G4ParticlePropertyTable ( const G4ParticlePropertyTable )
delete

◆ ~G4ParticlePropertyTable()

G4ParticlePropertyTable::~G4ParticlePropertyTable ( )

Definition at line 53 of file G4ParticlePropertyTable.cc.

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

References arrayDataObject.

◆ G4ParticlePropertyTable() [2/2]

G4ParticlePropertyTable::G4ParticlePropertyTable ( )
protected

Definition at line 63 of file G4ParticlePropertyTable.cc.

64{
66}
static G4ParticleTable * GetParticleTable()

References fParticleTable, and G4ParticleTable::GetParticleTable().

Referenced by GetParticlePropertyTable().

Member Function Documentation

◆ Clear()

void G4ParticlePropertyTable::Clear ( )

Definition at line 69 of file G4ParticlePropertyTable.cc.

70{
71 for (std::size_t idx=0; idx<arrayDataObject.size(); ++idx)
72 {
73 delete arrayDataObject[idx];
74 }
75 arrayDataObject.clear();
76}

References arrayDataObject.

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

◆ GetParticleProperty() [1/2]

G4ParticlePropertyData * G4ParticlePropertyTable::GetParticleProperty ( const G4ParticleDefinition aP)

Definition at line 89 of file G4ParticlePropertyTable.cc.

91{
92 if (aParticle == nullptr ) return nullptr;
94 = new G4ParticlePropertyData(aParticle->GetParticleName());
95 pData->thePDGMass = aParticle->GetPDGMass();
96 pData->thePDGWidth = aParticle->GetPDGWidth();
97 pData->thePDGCharge = aParticle->GetPDGCharge();
98 pData->thePDGiSpin = aParticle->GetPDGiSpin();
99 pData->thePDGiParity = aParticle->GetPDGiParity();
100 pData->thePDGiConjugation = aParticle->GetPDGiConjugation();
101 pData->thePDGiGParity = aParticle->GetPDGiGParity();
102 pData->thePDGiIsospin = aParticle->GetPDGiIsospin();
103 pData->thePDGiIsospin3 = aParticle->GetPDGiIsospin3();
104 pData->thePDGMagneticMoment = aParticle->GetPDGMagneticMoment();
105 pData->theLeptonNumber = aParticle->GetLeptonNumber();
106 pData->theBaryonNumber = aParticle->GetBaryonNumber();
107 pData->thePDGEncoding = aParticle->GetPDGEncoding();
108 pData->theAntiPDGEncoding = aParticle->GetAntiPDGEncoding();
109 pData->thePDGLifeTime = aParticle->GetPDGLifeTime();
110 for (std::size_t flv=0;
112 {
113 pData->theQuarkContent[flv] = aParticle->theQuarkContent[flv];
114 pData->theAntiQuarkContent[flv] = aParticle->theAntiQuarkContent[flv];
115 }
116
117 arrayDataObject.push_back(pData);
118
119 return pData;
120}
G4int theQuarkContent[NumberOfQuarkFlavor]
G4int theAntiQuarkContent[NumberOfQuarkFlavor]

References arrayDataObject, G4ParticleDefinition::GetAntiPDGEncoding(), G4ParticleDefinition::GetBaryonNumber(), G4ParticleDefinition::GetLeptonNumber(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGCharge(), G4ParticleDefinition::GetPDGEncoding(), G4ParticleDefinition::GetPDGiConjugation(), G4ParticleDefinition::GetPDGiGParity(), G4ParticleDefinition::GetPDGiIsospin(), G4ParticleDefinition::GetPDGiIsospin3(), G4ParticleDefinition::GetPDGiParity(), G4ParticleDefinition::GetPDGiSpin(), G4ParticleDefinition::GetPDGLifeTime(), G4ParticleDefinition::GetPDGMagneticMoment(), G4ParticleDefinition::GetPDGMass(), G4ParticleDefinition::GetPDGWidth(), G4ParticlePropertyData::NumberOfQuarkFlavor, G4ParticlePropertyData::theAntiPDGEncoding, G4ParticleDefinition::theAntiQuarkContent, G4ParticlePropertyData::theAntiQuarkContent, G4ParticlePropertyData::theBaryonNumber, G4ParticlePropertyData::theLeptonNumber, G4ParticlePropertyData::thePDGCharge, G4ParticlePropertyData::thePDGEncoding, G4ParticlePropertyData::thePDGiConjugation, G4ParticlePropertyData::thePDGiGParity, G4ParticlePropertyData::thePDGiIsospin, G4ParticlePropertyData::thePDGiIsospin3, G4ParticlePropertyData::thePDGiParity, G4ParticlePropertyData::thePDGiSpin, G4ParticlePropertyData::thePDGLifeTime, G4ParticlePropertyData::thePDGMagneticMoment, G4ParticlePropertyData::thePDGMass, G4ParticlePropertyData::thePDGWidth, G4ParticleDefinition::theQuarkContent, and G4ParticlePropertyData::theQuarkContent.

◆ GetParticleProperty() [2/2]

G4ParticlePropertyData * G4ParticlePropertyTable::GetParticleProperty ( const G4String aParticleName)

Definition at line 80 of file G4ParticlePropertyTable.cc.

81{
82 G4ParticleDefinition* aParticle = fParticleTable->FindParticle(aParticleName);
83 if (aParticle == nullptr ) return nullptr;
84
85 return GetParticleProperty(aParticle);
86}
G4ParticlePropertyData * GetParticleProperty(const G4String &aParticleName)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)

References G4ParticleTable::FindParticle(), fParticleTable, and GetParticleProperty().

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

◆ GetParticlePropertyTable()

G4ParticlePropertyTable * G4ParticlePropertyTable::GetParticlePropertyTable ( )
static

◆ GetVerboseLevel()

G4int G4ParticlePropertyTable::GetVerboseLevel ( ) const

◆ operator=()

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

◆ SetParticleProperty()

G4bool G4ParticlePropertyTable::SetParticleProperty ( const G4ParticlePropertyData newProperty)

Definition at line 123 of file G4ParticlePropertyTable.cc.

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

References G4ParticlePropertyData::fAntiPDGEncodingModified, G4ParticlePropertyData::fAntiQuarkContentModified, G4ParticlePropertyData::fBaryonNumberModified, G4ParticleTable::FindParticle(), G4ParticlePropertyData::fLeptonNumberModified, fParticleTable, G4ParticlePropertyData::fPDGChargeModified, G4ParticlePropertyData::fPDGEncodingModified, G4ParticlePropertyData::fPDGiConjugationModified, G4ParticlePropertyData::fPDGiGParityModified, G4ParticlePropertyData::fPDGiIsospin3Modified, G4ParticlePropertyData::fPDGiIsospinModified, G4ParticlePropertyData::fPDGiParityModified, G4ParticlePropertyData::fPDGiSpinModified, G4ParticlePropertyData::fPDGLifeTimeModified, G4ParticlePropertyData::fPDGMagneticMomentModified, G4ParticlePropertyData::fPDGMassModified, G4ParticlePropertyData::fPDGWidthModified, G4ParticlePropertyData::fQuarkContentModified, G4cout, G4endl, G4State_PreInit, G4StateManager::GetCurrentState(), G4StateManager::GetStateManager(), G4ParticlePropertyData::NumberOfQuarkFlavor, G4ParticleDefinition::theAntiPDGEncoding, G4ParticlePropertyData::theAntiPDGEncoding, G4ParticleDefinition::theAntiQuarkContent, G4ParticlePropertyData::theAntiQuarkContent, G4ParticleDefinition::theBaryonNumber, G4ParticlePropertyData::theBaryonNumber, G4ParticleDefinition::theLeptonNumber, G4ParticlePropertyData::theLeptonNumber, G4ParticlePropertyData::theParticleName, G4ParticleDefinition::thePDGCharge, G4ParticlePropertyData::thePDGCharge, G4ParticleDefinition::thePDGEncoding, G4ParticlePropertyData::thePDGEncoding, G4ParticleDefinition::thePDGiConjugation, G4ParticlePropertyData::thePDGiConjugation, G4ParticleDefinition::thePDGiGParity, G4ParticlePropertyData::thePDGiGParity, G4ParticleDefinition::thePDGiIsospin, G4ParticlePropertyData::thePDGiIsospin, G4ParticleDefinition::thePDGiIsospin3, G4ParticlePropertyData::thePDGiIsospin3, G4ParticleDefinition::thePDGiParity, G4ParticlePropertyData::thePDGiParity, G4ParticleDefinition::thePDGIsospin, G4ParticleDefinition::thePDGIsospin3, G4ParticleDefinition::thePDGiSpin, G4ParticlePropertyData::thePDGiSpin, G4ParticleDefinition::thePDGLifeTime, G4ParticlePropertyData::thePDGLifeTime, G4ParticleDefinition::thePDGMagneticMoment, G4ParticlePropertyData::thePDGMagneticMoment, G4ParticleDefinition::thePDGMass, G4ParticlePropertyData::thePDGMass, G4ParticleDefinition::thePDGSpin, G4ParticleDefinition::theQuarkContent, G4ParticlePropertyData::theQuarkContent, and verboseLevel.

Referenced by G4TextPPRetriever::ModifyPropertyTable().

◆ SetVerboseLevel()

void G4ParticlePropertyTable::SetVerboseLevel ( G4int  value)

Field Documentation

◆ arrayDataObject

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

Definition at line 89 of file G4ParticlePropertyTable.hh.

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

◆ fgParticlePropertyTable

G4ThreadLocal G4ParticlePropertyTable * G4ParticlePropertyTable::fgParticlePropertyTable = nullptr
staticprivate

Definition at line 94 of file G4ParticlePropertyTable.hh.

Referenced by GetParticlePropertyTable().

◆ fParticleTable

G4ParticleTable* G4ParticlePropertyTable::fParticleTable = nullptr
protected

◆ verboseLevel

G4int G4ParticlePropertyTable::verboseLevel = 1
private

Definition at line 93 of file G4ParticlePropertyTable.hh.

Referenced by SetParticleProperty().


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