Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticlePropertyTable Class Reference

#include <G4ParticlePropertyTable.hh>

Collaboration diagram for G4ParticlePropertyTable:

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::G4ParticlePropertyTable ( )
protected

Definition at line 65 of file G4ParticlePropertyTable.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

G4ParticlePropertyTable::G4ParticlePropertyTable ( const G4ParticlePropertyTable right)
protected

Definition at line 72 of file G4ParticlePropertyTable.cc.

73 {
75  *this = right;
76 }
static G4ParticleTable * GetParticleTable()

Here is the call graph for this function:

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

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 }
std::vector< G4ParticlePropertyData * > arrayDataObject

Here is the caller graph for this function:

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 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ParticlePropertyData * GetParticleProperty(const G4String &aParticleName)

Here is the call graph for this function:

Here is the caller graph for this function:

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 }
std::vector< G4ParticlePropertyData * > arrayDataObject
const G4String & GetParticleName() const
G4int GetAntiPDGEncoding() const
G4double GetPDGWidth() const
G4int GetPDGiConjugation() const
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
G4double GetPDGMass() const
G4int theQuarkContent[NumberOfQuarkFlavor]
G4double GetPDGLifeTime() const
G4double GetPDGMagneticMoment() const
G4double GetPDGCharge() const

Here is the call graph for this function:

G4ParticlePropertyTable * G4ParticlePropertyTable::GetParticlePropertyTable ( )
static

Definition at line 46 of file G4ParticlePropertyTable.cc.

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 95 of file G4ParticlePropertyTable.cc.

96 {
97  return false;
98 }
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 }
G4int G4ParticlePropertyTable::operator== ( const G4ParticlePropertyTable right) const

Definition at line 89 of file G4ParticlePropertyTable.cc.

90 {
91  return true;
92 }
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 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4StateManager * GetStateManager()
G4GLOB_DLL std::ostream G4cout
G4ApplicationState GetCurrentState() const
G4int theAntiQuarkContent[NumberOfQuarkFlavor]
G4int theQuarkContent[NumberOfQuarkFlavor]
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ParticlePropertyTable::SetVerboseLevel ( G4int  value)

Member Data Documentation

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

Definition at line 105 of file G4ParticlePropertyTable.hh.

G4ParticleTable* G4ParticlePropertyTable::fParticleTable
protected

Definition at line 98 of file G4ParticlePropertyTable.hh.


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