Remove ke_offset in PrimaryGeneratorAction since it causes confusion

and inconsistencies. Instead, add another homogeneous accelerating
electric field in front of TD foil.
Update TD and MCP2 positions.
This commit is contained in:
2008-11-07 15:18:39 +00:00
parent 94797630f1
commit 5705835d11
3 changed files with 74 additions and 45 deletions

View File

@ -79,10 +79,10 @@ void lem4PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
// }
G4double x, y, z;
G4double p, ke_offset;
G4double p;// ke_offset;
G4double xangle, yangle;
ke_offset = 3.73*keV; // Kin. energy offset due to a 3.73 kV acceleration at the Carbon foil
//ke_offset = 3.73*keV; // Kin. energy offset due to a 3.73 kV acceleration at the Carbon foil
if (takeMuonsFromTurtleFile) {
char line[501];
@ -219,7 +219,8 @@ void lem4PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
particleGun->SetParticlePosition(G4ThreeVector(x,y,z));
//particleGun->SetParticleMomentum(G4ThreeVector(px,py,pz));
G4double particleEnergy = std::sqrt(p*p+mu_mass*mu_mass)-mu_mass;
particleGun->SetParticleEnergy(particleEnergy + ke_offset);
//particleGun->SetParticleEnergy(particleEnergy+ke_offset);
particleGun->SetParticleEnergy(particleEnergy);
particleGun->SetParticleMomentumDirection(G4ThreeVector(px,py,pz));
particleGun->SetParticlePolarization(G4ThreeVector(xpolaris,ypolaris,zpolaris));
particleGun->GeneratePrimaryVertex(anEvent);