Import Geant4 11.2.0 source tree
This commit is contained in:
@@ -37,45 +37,41 @@
|
||||
// "Muon Decays and Physics Beyond the Standard Model"
|
||||
// Rev. Mod. Phys. 73, 151 (2001)
|
||||
|
||||
// Author: P.Gumplinger - Triumf, 25 July 2007
|
||||
// Revision: D. Mingming - Center for HEP, Tsinghua Univ., 10 August 2011
|
||||
// Author: P.Gumplinger - Triumf, 25 July 2007
|
||||
// Revision: D. Mingming - Center for HEP, Tsinghua Univ., 10 August 2011
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef G4MuonRadiativeDecayChannelWithSpin_hh
|
||||
#define G4MuonRadiativeDecayChannelWithSpin_hh 1
|
||||
|
||||
#include <CLHEP/Units/PhysicalConstants.h>
|
||||
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4VDecayChannel.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include <CLHEP/Units/PhysicalConstants.h>
|
||||
|
||||
class G4MuonRadiativeDecayChannelWithSpin : public G4VDecayChannel
|
||||
{
|
||||
public:
|
||||
|
||||
G4MuonRadiativeDecayChannelWithSpin(const G4String& theParentName,
|
||||
G4double theBR);
|
||||
G4MuonRadiativeDecayChannelWithSpin(const G4String& theParentName, G4double theBR);
|
||||
~G4MuonRadiativeDecayChannelWithSpin() override = default;
|
||||
|
||||
G4DecayProducts* DecayIt(G4double) override;
|
||||
|
||||
protected:
|
||||
|
||||
// Copy constructor and assignment operator
|
||||
G4MuonRadiativeDecayChannelWithSpin(const G4MuonRadiativeDecayChannelWithSpin&) = default;
|
||||
G4MuonRadiativeDecayChannelWithSpin& operator=(const G4MuonRadiativeDecayChannelWithSpin&);
|
||||
// Copy constructor and assignment operator
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
G4MuonRadiativeDecayChannelWithSpin() = default;
|
||||
|
||||
G4double fron(G4double Pmu, G4double x, G4double y,
|
||||
G4double cthetaE, G4double cthetaG, G4double cthetaEG);
|
||||
G4double fron(G4double Pmu, G4double x, G4double y, G4double cthetaE, G4double cthetaG,
|
||||
G4double cthetaEG);
|
||||
|
||||
// Generates random vectors, uniformly distributed over the surface
|
||||
// of a sphere of given radius
|
||||
void rn3dim(G4double& x, G4double& y, G4double& z, G4double xlong);
|
||||
// Generates random vectors, uniformly distributed over the surface
|
||||
// of a sphere of given radius
|
||||
|
||||
G4double atan4(G4double x, G4double y);
|
||||
};
|
||||
@@ -84,22 +80,22 @@ class G4MuonRadiativeDecayChannelWithSpin : public G4VDecayChannel
|
||||
// Inline methods
|
||||
// ------------------------
|
||||
|
||||
inline void G4MuonRadiativeDecayChannelWithSpin::rn3dim(G4double& x,
|
||||
G4double& y,
|
||||
G4double& z,
|
||||
inline void G4MuonRadiativeDecayChannelWithSpin::rn3dim(G4double& x, G4double& y, G4double& z,
|
||||
G4double xlong)
|
||||
{
|
||||
G4double a = 0.; G4double b = 0.; G4double c = 0.; G4double r = 0.;
|
||||
G4double a = 0.;
|
||||
G4double b = 0.;
|
||||
G4double c = 0.;
|
||||
G4double r = 0.;
|
||||
|
||||
do
|
||||
{
|
||||
do {
|
||||
a = G4UniformRand() - 0.5;
|
||||
b = G4UniformRand() - 0.5;
|
||||
c = G4UniformRand() - 0.5;
|
||||
r = a*a + b*b + c*c;
|
||||
} while (r > 0.25); // Loop checking, 09.08.2015, K.Kurashige
|
||||
r = a * a + b * b + c * c;
|
||||
} while (r > 0.25); // Loop checking, 09.08.2015, K.Kurashige
|
||||
|
||||
G4double rinv = xlong/(std::sqrt(r));
|
||||
G4double rinv = xlong / (std::sqrt(r));
|
||||
x = a * rinv;
|
||||
y = b * rinv;
|
||||
z = c * rinv;
|
||||
@@ -107,23 +103,27 @@ inline void G4MuonRadiativeDecayChannelWithSpin::rn3dim(G4double& x,
|
||||
return;
|
||||
}
|
||||
|
||||
inline G4double G4MuonRadiativeDecayChannelWithSpin::atan4(G4double x,
|
||||
G4double y)
|
||||
inline G4double G4MuonRadiativeDecayChannelWithSpin::atan4(G4double x, G4double y)
|
||||
{
|
||||
G4double phi = 0.;
|
||||
|
||||
if (x==0. && y>0.){
|
||||
phi = 0.5*CLHEP::pi;
|
||||
} else if (x==0. && y<0.){
|
||||
phi = 1.5*CLHEP::pi;
|
||||
} else if (y==0. && x>0.){
|
||||
if (x == 0. && y > 0.) {
|
||||
phi = 0.5 * CLHEP::pi;
|
||||
}
|
||||
else if (x == 0. && y < 0.) {
|
||||
phi = 1.5 * CLHEP::pi;
|
||||
}
|
||||
else if (y == 0. && x > 0.) {
|
||||
phi = 0.;
|
||||
} else if (y==0. && x<0.){
|
||||
}
|
||||
else if (y == 0. && x < 0.) {
|
||||
phi = CLHEP::pi;
|
||||
} else if (x>0. ){
|
||||
phi = std::atan(y/x);
|
||||
} else if (x<0. ){
|
||||
phi = std::atan(y/x) + CLHEP::pi;
|
||||
}
|
||||
else if (x > 0.) {
|
||||
phi = std::atan(y / x);
|
||||
}
|
||||
else if (x < 0.) {
|
||||
phi = std::atan(y / x) + CLHEP::pi;
|
||||
}
|
||||
|
||||
return phi;
|
||||
|
||||
Reference in New Issue
Block a user