Fixed bug in calculation of initial momentum
This commit is contained in:
parent
c06031344e
commit
5acc941a31
@ -538,11 +538,12 @@ void musrPrimaryGeneratorAction::SetOrReadTheRandomNumberSeeds(G4Event* anEvent)
|
||||
}
|
||||
|
||||
void musrPrimaryGeneratorAction::SetKEnergy(G4double val) {
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4double mu_mass = particleTable->FindParticle("mu+")->GetPDGMass();
|
||||
p0=std::sqrt(val*val + 2*mu_mass*val);
|
||||
// G4cout<<"musrPrimaryGeneratorAction::SetKEnergy: Muon kinetic energy of "
|
||||
// <<val<<" MeV requested ==> initial muon momentum set to "<<p0<<" MeV/c"<<G4endl;
|
||||
//G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
//G4double mu_mass = particleTable->FindParticle("mu+")->GetPDGMass();
|
||||
G4double particle_mass = particleGun->GetParticleDefinition()->GetPDGMass();
|
||||
p0=std::sqrt(val*val + 2*particle_mass*val);
|
||||
/* G4cout<<"musrPrimaryGeneratorAction::SetKEnergy: Particle mass " <<particle_mass<<" particle kinetic energy of "
|
||||
<<val<<" MeV requested ==> initial particle momentum set to "<<p0<<" MeV/c"<<G4endl;*/
|
||||
}
|
||||
|
||||
//===============================================================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user