Added cos(Theta) angular distribution
This commit is contained in:
@ -368,18 +368,18 @@ void musrPhysicsList::ConstructEM()
|
||||
//cks 14.12.2011 else if (stringProcessName=="G4PenelopeIonisation") pManager->AddProcess(new G4PenelopeIonisation,nr1,nr2,nr3);
|
||||
//cks 14.12.2011 else if (stringProcessName=="G4PenelopeBremsstrahlung") pManager->AddProcess(new G4PenelopeBremsstrahlung,nr1,nr2,nr3);
|
||||
//cks 14.12.2011 else if (stringProcessName=="G4PenelopeAnnihilation") pManager->AddProcess(new G4PenelopeAnnihilation,nr1,nr2,nr3);
|
||||
//cks 14.12.2011 else if (stringProcessName=="G4LowEnergyIonisation") pManager->AddProcess(new G4LowEnergyIonisation,nr1,nr2,nr3);
|
||||
//cks 14.12.2011 else if (stringProcessName=="G4LowEnergyBremsstrahlung") pManager->AddProcess(new G4LowEnergyBremsstrahlung,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4MuMultipleScattering") pManager->AddProcess(new G4MuMultipleScattering,nr1,nr2,nr3);
|
||||
// else if (stringProcessName=="G4LowEnergyIonisation") pManager->AddProcess(new G4LowEnergyIonisation,nr1,nr2,nr3);
|
||||
// else if (stringProcessName=="G4LowEnergyBremsstrahlung") pManager->AddProcess(new G4LowEnergyBremsstrahlung,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4MuMultipleScattering") pManager->AddProcess(new G4MuMultipleScattering,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4MuIonisation") pManager->AddProcess(new G4MuIonisation,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4MuBremsstrahlung") pManager->AddProcess(new G4MuBremsstrahlung,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4MuPairProduction") pManager->AddProcess(new G4MuPairProduction,nr1,nr2,nr3);
|
||||
// cks 2009-06-08 G4StepLimiter and/or G4UserSpecialCuts are needed to activate the "G4UserLimits"
|
||||
else if (stringProcessName=="G4StepLimiter") pManager->AddProcess(new G4StepLimiter,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4UserSpecialCuts") pManager->AddProcess(new G4UserSpecialCuts,nr1,nr2,nr3);
|
||||
// else if (stringProcessName=="G4DecayWithSpin") pManager->AddProcess(new G4DecayWithSpin,nr1,nr2,nr3);
|
||||
// else if (stringProcessName=="G4hIonisation") pManager->AddProcess(new G4hIonisation,nr1,nr2,nr3);
|
||||
// else if (stringProcessName=="G4hLowEnergyIonisation") pManager->AddProcess(new G4hLowEnergyIonisation,nr1,nr2,nr3);
|
||||
// else if (stringProcessName=="G4DecayWithSpin") pManager->AddProcess(new G4DecayWithSpin,nr1,nr2,nr3);
|
||||
// else if (stringProcessName=="G4hIonisation") pManager->AddProcess(new G4hIonisation,nr1,nr2,nr3);
|
||||
// else if (stringProcessName=="G4hLowEnergyIonisation") pManager->AddProcess(new G4hLowEnergyIonisation,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="musrMuFormation") pManager->AddProcess(new musrMuFormation,nr1,nr2,nr3);
|
||||
else if (stringProcessName=="G4Scintillation") {
|
||||
G4Scintillation* myScintillation = new G4Scintillation();
|
||||
|
@ -260,8 +260,26 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
if (pitch!=0) {yangle += - pitch * (y-y0); }
|
||||
|
||||
} // end of the part specific for the muons generated by random rather then from TURTLE
|
||||
//------- Add new intial angle
|
||||
G4double sinXangle, sinYangle, phi;
|
||||
G4double px, py, pz;
|
||||
if (zangleSigma<0) {
|
||||
sinXangle=sqrt(G4UniformRand());
|
||||
phi=2*CLHEP::pi*G4UniformRand();
|
||||
|
||||
// Calculate the final momentum
|
||||
px = p*sinXangle*cos(phi);
|
||||
py = p*sinXangle*sin(phi);
|
||||
pz = std::sqrt(p*p - px*px - py*py);
|
||||
}
|
||||
|
||||
if (zangleSigma> 0) {sinXangle=sin(xangle); sinYangle=sin(yangle);
|
||||
px = p*sinXangle;
|
||||
py = p*sinYangle;
|
||||
pz = std::sqrt(p*p - px*px - py*py);
|
||||
// printf("px, py, pz = %f, %f, %f\n", px, py, pz);
|
||||
}
|
||||
|
||||
|
||||
// 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
|
||||
@ -269,12 +287,7 @@ void musrPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
else {ParticleTime = t0;} // Point-like P.B. 13 May 2009
|
||||
|
||||
|
||||
// Calculate the final momentum
|
||||
G4double px, py, pz;
|
||||
px = p*sin(xangle);
|
||||
py = p*sin(yangle);
|
||||
pz = std::sqrt(p*p - px*px - py*py);
|
||||
|
||||
|
||||
|
||||
// Now rotate so that beam propagates along /gun/direction
|
||||
|
||||
|
Reference in New Issue
Block a user