25 #include <G4ParticleTable.hh>
26 #include <G4ParticleDefinition.hh>
27 #include <G4PhysicalConstants.hh>
28 #include <G4Version.hh>
30 #include <CLHEP/Units/SystemOfUnits.h>
31 #include <CLHEP/Units/PhysicalConstants.h>
42 declareProperty(
"pdgfile", m_pdgfile);
53 G4ParticleTable *theParticleTable = G4ParticleTable::GetParticleTable();
54 std::ifstream pdgFile(
m_pdgfile.c_str(), std::ifstream::in );
56 if (!pdgFile.is_open()) {
63 while ( !pdgFile.eof() ) {
66 getline( pdgFile, linebuf );
69 if (linebuf.substr(0,1) ==
"#")
continue;
70 if (linebuf.substr(0,2) ==
"//")
continue;
73 if (linebuf.empty())
continue;
83 std::istringstream istr(linebuf);
85 istr >> pdg >> nam >> charge >> mass >> width >> lifetime;
91 bool stable = (width > 0 or width < -0.5) ? false :
true;
93 if(width<0) width = 0;
103 lifetime = lifetime*CLHEP::mm/CLHEP::c_light;
106 if (width == 0 && lifetime > 0) {
107 width = CLHEP::hbar_Planck/lifetime;
111 G4ParticleDefinition* p = theParticleTable->FindParticle(pdg);
114 if (abs(pdg)>80 && abs(pdg)<=100) {
124 p =
new G4ParticleDefinition(
147 G4cout <<
"Loaded extra particles using file: " <<
m_pdgfile << G4endl;
151 G4ParticleTable::G4PTblDicIterator* ParticleIterator = ctor.particleIterator();
152 while((*ParticleIterator)()) {
153 G4ParticleDefinition* pdef = ParticleIterator->value();
154 G4ProcessManager* pmgr = pdef->GetProcessManager();
155 if (pdef->GetParticleType() ==
"extra") {
156 if (pdef->GetPDGCharge() != 0) {
157 pmgr->AddProcess(
new G4hMultipleScattering(), -1, 1, 1);
158 pmgr->AddProcess(
new G4hIonisation(), -1, 2, 2);