LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
pyG4ParticleGun Namespace Reference

Functions

void SetParticleByName (G4ParticleGun *gun, const std::string &pname)
 
std::string GetParticleByName (G4ParticleGun *gun)
 

Function Documentation

std::string pyG4ParticleGun::GetParticleByName ( G4ParticleGun *  gun)

Definition at line 113 of file pyG4ParticleGun.cc.

Referenced by export_G4ParticleGun().

115 {
116  const G4ParticleDefinition* pd= gun-> GetParticleDefinition();
117  return (pd-> GetParticleName()).c_str();
118 }
void pyG4ParticleGun::SetParticleByName ( G4ParticleGun *  gun,
const std::string &  pname 
)

Definition at line 99 of file pyG4ParticleGun.cc.

Referenced by export_G4ParticleGun().

101 {
102  G4ParticleTable* particleTable= G4ParticleTable::GetParticleTable();
103  G4ParticleDefinition* pd= particleTable-> FindParticle(pname);
104  if (pd != 0) {
105  gun-> SetParticleDefinition(pd);
106  } else {
107  G4cout << "*** \"" << pname << "\" is not registered "
108  << "in available particle list" << G4endl;
109  }
110 }