2009-06-22 Kamil Sedlak
- introduced modifications done by Pavel Bakule at ISIS:
a) the time when the initial muon is generated can be
set according to a gaussian or flat distribution.
(all muons were generated at time 0 before this change).
b) a new volume "cylpart" has been added.
The code can be compiled, but no tests of the newly implemented
features have been done. In future, the information about the
time of the muon generation should be added to the root output
tree.
This commit is contained in:
@@ -58,6 +58,7 @@ musrPrimaryGeneratorAction::musrPrimaryGeneratorAction(
|
||||
musrDetectorConstruction* musrDC)
|
||||
:musrDetector(musrDC), x0(0), y0(0), z0(-10*cm), xSigma(0), ySigma(0), zSigma(0),
|
||||
rMaxAllowed(1e10*mm), zMinAllowed(-1e10*mm), zMaxAllowed(1e10*mm),
|
||||
t0(0), tSigma(0),
|
||||
p0(0), pSigma(0), pMinAllowed(0), pMaxAllowed(1e10*mm),
|
||||
xangle0(0), yangle0(0), xangleSigma(0), yangleSigma(0), pitch(0),
|
||||
UnpolarisedMuonBeam(false), TransversalyUnpolarisedMuonBeam(false), xPolarisIni(1.), yPolarisIni(0.), zPolarisIni(0.),
|
||||
@@ -250,6 +251,13 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
} // end of the part specific for the muons generated by random rather then from TURTLE
|
||||
|
||||
|
||||
// Calculate particle (muon) starting time
|
||||
G4double ParticleTime; //P.B. 13 May 2009
|
||||
if (tSigma>0) {ParticleTime = G4RandGauss::shoot(t0,tSigma);} // Gaussian distribution P.B. 13 May 2009
|
||||
else if (tSigma<0) {ParticleTime = t0 + tSigma*(G4UniformRand()*2.-1.);} // Uniform step distribution P.B. 13 May 2009
|
||||
else {ParticleTime = t0;} // Point-like P.B. 13 May 2009
|
||||
|
||||
|
||||
// Calculate the final momentum
|
||||
G4double px, py, pz;
|
||||
px = p*sin(xangle);
|
||||
@@ -284,6 +292,7 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
G4double particle_mass = particleGun->GetParticleDefinition()->GetPDGMass();
|
||||
G4double particleEnergy = std::sqrt(p*p+particle_mass*particle_mass)-particle_mass;
|
||||
particleGun->SetParticleEnergy(particleEnergy);
|
||||
particleGun->SetParticleTime(ParticleTime); //P.B. 13 May 2009
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(px,py,pz));
|
||||
particleGun->SetParticlePolarization(G4ThreeVector(xpolaris,ypolaris,zpolaris));
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
|
||||
Reference in New Issue
Block a user