#include <G4ParticlePropertyTable.hh>
Public Member Functions | |
G4int | operator== (const G4ParticlePropertyTable &right) const |
G4int | operator!= (const G4ParticlePropertyTable &right) const |
virtual | ~G4ParticlePropertyTable () |
G4ParticlePropertyData * | GetParticleProperty (const G4String &aParticleName) |
G4ParticlePropertyData * | GetParticleProperty (const G4ParticleDefinition *aParticle) |
G4bool | SetParticleProperty (const G4ParticlePropertyData &newProperty) |
void | Clear () |
void | SetVerboseLevel (G4int value) |
G4int | GetVerboseLevel () const |
Static Public Member Functions | |
static G4ParticlePropertyTable * | GetParticlePropertyTable () |
Protected Member Functions | |
G4ParticlePropertyTable () | |
G4ParticlePropertyTable (const G4ParticlePropertyTable &right) | |
G4ParticlePropertyTable & | operator= (const G4ParticlePropertyTable &right) |
Protected Attributes | |
G4ParticleTable * | fParticleTable |
std::vector< G4ParticlePropertyData * > | arrayDataObject |
Definition at line 48 of file G4ParticlePropertyTable.hh.
G4ParticlePropertyTable::G4ParticlePropertyTable | ( | ) | [protected] |
Definition at line 65 of file G4ParticlePropertyTable.cc.
References fParticleTable, and G4ParticleTable::GetParticleTable().
00065 : 00066 verboseLevel(1) 00067 { 00068 fParticleTable = G4ParticleTable::GetParticleTable(); 00069 }
G4ParticlePropertyTable::G4ParticlePropertyTable | ( | const G4ParticlePropertyTable & | right | ) | [protected] |
Definition at line 72 of file G4ParticlePropertyTable.cc.
References fParticleTable, and G4ParticleTable::GetParticleTable().
00073 { 00074 fParticleTable = G4ParticleTable::GetParticleTable(); 00075 *this = right; 00076 }
G4ParticlePropertyTable::~G4ParticlePropertyTable | ( | ) | [virtual] |
Definition at line 56 of file G4ParticlePropertyTable.cc.
References arrayDataObject.
00057 { 00058 for (size_t idx=0; idx<arrayDataObject.size(); idx++){ 00059 delete arrayDataObject[idx]; 00060 } 00061 arrayDataObject.clear(); 00062 }
void G4ParticlePropertyTable::Clear | ( | ) |
Definition at line 101 of file G4ParticlePropertyTable.cc.
References arrayDataObject.
Referenced by G4VParticlePropertyReporter::~G4VParticlePropertyReporter(), and G4VParticlePropertyRetriever::~G4VParticlePropertyRetriever().
00102 { 00103 for (size_t idx=0; idx<arrayDataObject.size(); idx++){ 00104 delete arrayDataObject[idx]; 00105 } 00106 arrayDataObject.clear(); 00107 }
G4ParticlePropertyData * G4ParticlePropertyTable::GetParticleProperty | ( | const G4ParticleDefinition * | aParticle | ) |
Definition at line 119 of file G4ParticlePropertyTable.cc.
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::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.
00120 { 00121 if (aParticle ==0 ) return 0; 00122 G4ParticlePropertyData* pData = new G4ParticlePropertyData(aParticle->GetParticleName()); 00123 pData->thePDGMass = aParticle->GetPDGMass(); 00124 pData->thePDGWidth = aParticle->GetPDGWidth(); 00125 pData->thePDGCharge = aParticle->GetPDGCharge(); 00126 pData->thePDGiSpin = aParticle->GetPDGiSpin(); 00127 pData->thePDGiParity = aParticle->GetPDGiParity(); 00128 pData->thePDGiConjugation = aParticle->GetPDGiConjugation(); 00129 pData->thePDGiGParity = aParticle->GetPDGiGParity(); 00130 pData->thePDGiIsospin = aParticle->GetPDGiIsospin(); 00131 pData->thePDGiIsospin3 = aParticle->GetPDGiIsospin3(); 00132 pData->thePDGMagneticMoment = aParticle->GetPDGMagneticMoment(); 00133 pData->theLeptonNumber = aParticle->GetLeptonNumber(); 00134 pData->theBaryonNumber = aParticle->GetBaryonNumber(); 00135 pData->thePDGEncoding = aParticle->GetPDGEncoding(); 00136 pData->theAntiPDGEncoding = aParticle->GetAntiPDGEncoding(); 00137 pData->thePDGLifeTime = aParticle->GetPDGLifeTime(); 00138 for (size_t flv=0; flv<G4ParticlePropertyData::NumberOfQuarkFlavor; ++flv) { 00139 pData->theQuarkContent[flv] = aParticle->theQuarkContent[flv]; 00140 pData->theAntiQuarkContent[flv] = aParticle->theAntiQuarkContent[flv]; 00141 } 00142 00143 arrayDataObject.push_back(pData); 00144 00145 return pData; 00146 }
G4ParticlePropertyData * G4ParticlePropertyTable::GetParticleProperty | ( | const G4String & | aParticleName | ) |
Definition at line 110 of file G4ParticlePropertyTable.cc.
References G4ParticleTable::FindParticle(), and fParticleTable.
Referenced by G4VParticlePropertyReporter::FillList(), and G4TextPPRetriever::ModifyPropertyTable().
00111 { 00112 G4ParticleDefinition* aParticle = fParticleTable->FindParticle(aParticleName); 00113 if (aParticle ==0 ) return 0; 00114 00115 return GetParticleProperty(aParticle); 00116 }
G4ParticlePropertyTable * G4ParticlePropertyTable::GetParticlePropertyTable | ( | ) | [static] |
Definition at line 46 of file G4ParticlePropertyTable.cc.
Referenced by G4VParticlePropertyReporter::G4VParticlePropertyReporter(), and G4VParticlePropertyRetriever::G4VParticlePropertyRetriever().
00047 { 00048 static G4ParticlePropertyTable theParticlePropertyTable; 00049 if (!fgParticlePropertyTable){ 00050 fgParticlePropertyTable = &theParticlePropertyTable; 00051 } 00052 return fgParticlePropertyTable; 00053 }
G4int G4ParticlePropertyTable::GetVerboseLevel | ( | ) | const |
Referenced by G4ParticlePropertyMessenger::GetCurrentValue().
G4int G4ParticlePropertyTable::operator!= | ( | const G4ParticlePropertyTable & | right | ) | const |
G4ParticlePropertyTable & G4ParticlePropertyTable::operator= | ( | const G4ParticlePropertyTable & | right | ) | [protected] |
Definition at line 79 of file G4ParticlePropertyTable.cc.
References fParticleTable, and verboseLevel.
00080 { 00081 if (this != &right) { 00082 fParticleTable = right.fParticleTable; 00083 verboseLevel = right.verboseLevel; 00084 } 00085 return *this; 00086 }
G4int G4ParticlePropertyTable::operator== | ( | const G4ParticlePropertyTable & | right | ) | const |
G4bool G4ParticlePropertyTable::SetParticleProperty | ( | const G4ParticlePropertyData & | newProperty | ) |
Definition at line 149 of file G4ParticlePropertyTable.cc.
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::theAntiPDGEncoding, G4ParticleDefinition::theAntiPDGEncoding, G4ParticlePropertyData::theAntiQuarkContent, G4ParticleDefinition::theAntiQuarkContent, G4ParticlePropertyData::theBaryonNumber, G4ParticleDefinition::theBaryonNumber, G4ParticlePropertyData::theLeptonNumber, G4ParticleDefinition::theLeptonNumber, G4ParticlePropertyData::theParticleName, G4ParticlePropertyData::thePDGCharge, G4ParticleDefinition::thePDGCharge, G4ParticlePropertyData::thePDGEncoding, G4ParticleDefinition::thePDGEncoding, G4ParticlePropertyData::thePDGiConjugation, G4ParticleDefinition::thePDGiConjugation, G4ParticlePropertyData::thePDGiGParity, G4ParticleDefinition::thePDGiGParity, G4ParticlePropertyData::thePDGiIsospin, G4ParticleDefinition::thePDGiIsospin, G4ParticlePropertyData::thePDGiIsospin3, G4ParticleDefinition::thePDGiIsospin3, G4ParticlePropertyData::thePDGiParity, G4ParticleDefinition::thePDGiParity, G4ParticleDefinition::thePDGIsospin, G4ParticleDefinition::thePDGIsospin3, G4ParticlePropertyData::thePDGiSpin, G4ParticleDefinition::thePDGiSpin, G4ParticlePropertyData::thePDGLifeTime, G4ParticleDefinition::thePDGLifeTime, G4ParticlePropertyData::thePDGMagneticMoment, G4ParticleDefinition::thePDGMagneticMoment, G4ParticlePropertyData::thePDGMass, G4ParticleDefinition::thePDGMass, G4ParticleDefinition::thePDGSpin, G4ParticlePropertyData::theQuarkContent, and G4ParticleDefinition::theQuarkContent.
Referenced by G4TextPPRetriever::ModifyPropertyTable().
00150 { 00151 G4StateManager* pStateMan = G4StateManager::GetStateManager(); 00152 if (pStateMan->GetCurrentState() != G4State_PreInit){ 00153 #ifdef G4VERBOSE 00154 if (verboseLevel>0){ 00155 G4cout << "G4ParticlePropertyTable::GetParticleProperty() "; 00156 G4cout << " for " << pData.theParticleName << G4endl; 00157 G4cout << " Particle properties can be modified only in Pre_Init state"; 00158 G4cout << G4endl; 00159 } 00160 #endif 00161 return false; 00162 } 00163 00164 G4ParticleDefinition* aParticle = fParticleTable->FindParticle(pData.theParticleName); 00165 if (aParticle ==0 ) { 00166 #ifdef G4VERBOSE 00167 if (verboseLevel>1){ 00168 G4cout << "G4ParticlePropertyTable::GetParticleProperty() "; 00169 G4cout << " for " << pData.theParticleName << G4endl; 00170 G4cout << " Particle does not exist" << G4endl; 00171 } 00172 #endif 00173 return false; 00174 } 00175 00176 if (pData.fPDGMassModified) { 00177 aParticle->thePDGMass = pData.thePDGMass; 00178 } 00179 if (pData.fPDGWidthModified) { 00180 aParticle->thePDGMass = pData.thePDGMass; 00181 } 00182 if (pData.fPDGChargeModified) { 00183 aParticle->thePDGCharge = pData.thePDGCharge; 00184 } 00185 if (pData.fPDGiSpinModified) { 00186 aParticle->thePDGiSpin = pData.thePDGiSpin; 00187 aParticle->thePDGSpin = 0.5*pData.thePDGiSpin; 00188 } 00189 if (pData.fPDGiParityModified) { 00190 aParticle->thePDGiParity = pData.thePDGiParity; 00191 } 00192 if (pData.fPDGiConjugationModified) { 00193 aParticle->thePDGiConjugation = pData.thePDGiConjugation; 00194 } 00195 if (pData.fPDGiGParityModified) { 00196 aParticle->thePDGiGParity = pData.thePDGiGParity; 00197 } 00198 if (pData.fPDGiIsospinModified) { 00199 aParticle->thePDGiIsospin = pData.thePDGiIsospin; 00200 aParticle->thePDGIsospin = 0.5*pData.thePDGiIsospin; 00201 } 00202 if (pData.fPDGiIsospin3Modified) { 00203 aParticle->thePDGiIsospin3 = pData.thePDGiIsospin3; 00204 aParticle->thePDGIsospin3 = 0.5*pData.thePDGiIsospin3; 00205 } 00206 if (pData.fPDGMagneticMomentModified) { 00207 aParticle->thePDGMagneticMoment = pData.thePDGMagneticMoment; 00208 } 00209 if (pData.fLeptonNumberModified) { 00210 aParticle->theLeptonNumber = pData.theLeptonNumber; 00211 } 00212 if (pData.fBaryonNumberModified) { 00213 aParticle->theBaryonNumber = pData.theBaryonNumber; 00214 } 00215 if (pData.fPDGEncodingModified) { 00216 aParticle->thePDGEncoding = pData.thePDGEncoding; 00217 } 00218 if (pData.fAntiPDGEncodingModified) { 00219 aParticle->theAntiPDGEncoding = pData.theAntiPDGEncoding; 00220 } 00221 if (pData.fPDGLifeTimeModified) { 00222 aParticle->thePDGLifeTime = pData.thePDGLifeTime; 00223 } 00224 for (size_t flv=0; flv<<G4ParticlePropertyData::NumberOfQuarkFlavor; ++flv) { 00225 if (pData.fQuarkContentModified){ 00226 aParticle->theQuarkContent[flv] = pData.theQuarkContent[flv]; 00227 } 00228 if (pData.fAntiQuarkContentModified){ 00229 aParticle->theAntiQuarkContent[flv] = pData.theAntiQuarkContent[flv]; 00230 } 00231 } 00232 00233 return true; 00234 }
void G4ParticlePropertyTable::SetVerboseLevel | ( | G4int | value | ) |
std::vector<G4ParticlePropertyData*> G4ParticlePropertyTable::arrayDataObject [protected] |
Definition at line 105 of file G4ParticlePropertyTable.hh.
Referenced by Clear(), GetParticleProperty(), and ~G4ParticlePropertyTable().
G4ParticleTable* G4ParticlePropertyTable::fParticleTable [protected] |
Definition at line 98 of file G4ParticlePropertyTable.hh.
Referenced by G4ParticlePropertyTable(), GetParticleProperty(), operator=(), and SetParticleProperty().