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

#include <G4ee2KChargedModel.hh>

Inheritance diagram for G4ee2KChargedModel:
G4Vee2hadrons

Public Member Functions

 G4ee2KChargedModel (G4eeCrossSections *)
 
virtual ~G4ee2KChargedModel ()
 
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 G4ee2KChargedModel.hh.

Constructor & Destructor Documentation

G4ee2KChargedModel::G4ee2KChargedModel ( G4eeCrossSections cr)

Definition at line 64 of file G4ee2KChargedModel.cc.

References G4ParticleDefinition::GetPDGMass(), G4KaonPlus::KaonPlus(), and python.hepunit::MeV.

64  :
65  cross(cr)
66 {
67  massK = G4KaonPlus::KaonPlus()->GetPDGMass();
68  massPhi = 1019.46*MeV;
69 }
G4double GetPDGMass() const
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
G4ee2KChargedModel::~G4ee2KChargedModel ( )
virtual

Definition at line 73 of file G4ee2KChargedModel.cc.

74 {}

Member Function Documentation

G4double G4ee2KChargedModel::ComputeCrossSection ( G4double  e) const
virtual

Implements G4Vee2hadrons.

Definition at line 92 of file G4ee2KChargedModel.cc.

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

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

Implements G4Vee2hadrons.

Definition at line 85 of file G4ee2KChargedModel.cc.

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

Implements G4Vee2hadrons.

Definition at line 100 of file G4ee2KChargedModel.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.*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 G4ee2KChargedModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  newp,
G4double  e,
const G4ThreeVector direction 
)
virtual

Implements G4Vee2hadrons.

Definition at line 113 of file G4ee2KChargedModel.cc.

References G4UniformRand, G4KaonMinus::KaonMinus(), G4KaonPlus::KaonPlus(), 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 =
133  new G4DynamicParticle(G4KaonPlus::KaonPlus(),dir,tkin);
134  G4DynamicParticle* p2 =
135  new G4DynamicParticle(G4KaonMinus::KaonMinus(),-dir,tkin);
136  newp->push_back(p1);
137  newp->push_back(p2);
138 }
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:113
#define G4UniformRand()
Definition: Randomize.hh:87
double G4double
Definition: G4Types.hh:76
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:113
G4double G4ee2KChargedModel::ThresholdEnergy ( ) const
virtual

Implements G4Vee2hadrons.

Definition at line 78 of file G4ee2KChargedModel.cc.

79 {
80  return 2.0*massK;
81 }

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