Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4ee2KNeutralModel Class Reference

#include <G4ee2KNeutralModel.hh>

Inheritance diagram for G4ee2KNeutralModel:
G4Vee2hadrons

Public Member Functions

 G4ee2KNeutralModel (G4eeCrossSections *)
 
virtual ~G4ee2KNeutralModel ()
 
virtual G4double ThresholdEnergy () const
 
virtual G4double PeakEnergy () const
 
virtual G4double ComputeCrossSection (G4double) const
 
virtual G4PhysicsVectorPhysicsVector (G4double, G4double) const
 
virtual void SampleSecondaries (std::vector< G4DynamicParticle * > *, G4double, const G4ThreeVector &)
 
- Public Member Functions inherited from G4Vee2hadrons
 G4Vee2hadrons ()
 
virtual ~G4Vee2hadrons ()
 
void SetLowEnergy (G4double val)
 
G4double LowEnergy () const
 
void SetHighEnergy (G4double val)
 
G4double HighEnergy () const
 

Detailed Description

Definition at line 59 of file G4ee2KNeutralModel.hh.

Constructor & Destructor Documentation

G4ee2KNeutralModel::G4ee2KNeutralModel ( G4eeCrossSections cr)

Definition at line 64 of file G4ee2KNeutralModel.cc.

References G4ParticleDefinition::GetPDGMass(), G4KaonZeroLong::KaonZeroLong(), and python.hepunit::MeV.

64  :
65  cross(cr)
66 {
68  massPhi = 1019.46*MeV;
69 }
static G4KaonZeroLong * KaonZeroLong()
G4double GetPDGMass() const
G4ee2KNeutralModel::~G4ee2KNeutralModel ( )
virtual

Definition at line 73 of file G4ee2KNeutralModel.cc.

74 {}

Member Function Documentation

G4double G4ee2KNeutralModel::ComputeCrossSection ( G4double  e) const
virtual

Implements G4Vee2hadrons.

Definition at line 92 of file G4ee2KNeutralModel.cc.

References G4eeCrossSections::CrossSection2Kneutral(), G4Vee2hadrons::HighEnergy(), and G4INCL::Math::min().

93 {
94  G4double ee = std::min(HighEnergy(),e);
95  return cross->CrossSection2Kneutral(ee);
96 }
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4double HighEnergy() const
G4double CrossSection2Kneutral(G4double)
double G4double
Definition: G4Types.hh:76
G4double G4ee2KNeutralModel::PeakEnergy ( ) const
virtual

Implements G4Vee2hadrons.

Definition at line 85 of file G4ee2KNeutralModel.cc.

86 {
87  return massPhi;
88 }
G4PhysicsVector * G4ee2KNeutralModel::PhysicsVector ( G4double  emin,
G4double  emax 
) const
virtual

Implements G4Vee2hadrons.

Definition at line 100 of file G4ee2KNeutralModel.cc.

References G4INCL::Math::max(), python.hepunit::MeV, G4PhysicsVector::SetSpline(), and test::v.

102 {
103  G4double tmin = std::max(emin, 2.0*massK);
104  G4double tmax = std::max(tmin, emax);
105  G4int nbins = (G4int)((tmax - tmin)/(1.0*MeV));
106  G4PhysicsVector* v = new G4PhysicsLinearVector(emin,emax,nbins);
107  v->SetSpline(true);
108  return v;
109 }
int G4int
Definition: G4Types.hh:78
void SetSpline(G4bool)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
double G4double
Definition: G4Types.hh:76
void G4ee2KNeutralModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  newp,
G4double  e,
const G4ThreeVector direction 
)
virtual

Implements G4Vee2hadrons.

Definition at line 113 of file G4ee2KNeutralModel.cc.

References G4UniformRand, G4KaonZeroLong::KaonZeroLong(), G4KaonZeroShort::KaonZeroShort(), CLHEP::Hep3Vector::rotateUz(), and python.hepunit::twopi.

115 {
116 
117  G4double tkin = 0.5*e - massK;
118  if(tkin < 0.0) tkin = 0.0;
119 
120  G4double cost;
121  do {
122  cost = 2.0*G4UniformRand() - 1.0;
123  } while( G4UniformRand() > 1.0 - cost*cost );
124 
125  G4double sint = sqrt(1.0 - cost*cost);
126  G4double phi = twopi * G4UniformRand();
127 
128  G4ThreeVector dir(sint*cos(phi),sint*sin(phi), cost);
129  dir.rotateUz(direction);
130 
131  // create G4DynamicParticle objects
132  G4DynamicParticle* p1 =
134  G4DynamicParticle* p2 =
136  newp->push_back(p1);
137  newp->push_back(p2);
138 }
static G4KaonZeroLong * KaonZeroLong()
#define G4UniformRand()
Definition: Randomize.hh:87
static G4KaonZeroShort * KaonZeroShort()
double G4double
Definition: G4Types.hh:76
G4double G4ee2KNeutralModel::ThresholdEnergy ( ) const
virtual

Implements G4Vee2hadrons.

Definition at line 78 of file G4ee2KNeutralModel.cc.

79 {
80  return 2.0*massK;
81 }

The documentation for this class was generated from the following files: