00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 #include "G4ee2KChargedModel.hh"
00050 #include "Randomize.hh"
00051 #include "G4PhysicalConstants.hh"
00052 #include "G4SystemOfUnits.hh"
00053 #include "G4KaonPlus.hh"
00054 #include "G4KaonMinus.hh"
00055 #include "G4DynamicParticle.hh"
00056 #include "G4PhysicsVector.hh"
00057 #include "G4PhysicsLinearVector.hh"
00058 #include "G4eeCrossSections.hh"
00059
00060
00061
00062 using namespace std;
00063
00064 G4ee2KChargedModel::G4ee2KChargedModel(G4eeCrossSections* cr):
00065 cross(cr)
00066 {
00067 massK = G4KaonPlus::KaonPlus()->GetPDGMass();
00068 massPhi = 1019.46*MeV;
00069 }
00070
00071
00072
00073 G4ee2KChargedModel::~G4ee2KChargedModel()
00074 {}
00075
00076
00077
00078 G4double G4ee2KChargedModel::ThresholdEnergy() const
00079 {
00080 return 2.0*massK;
00081 }
00082
00083
00084
00085 G4double G4ee2KChargedModel::PeakEnergy() const
00086 {
00087 return massPhi;
00088 }
00089
00090
00091
00092 G4double G4ee2KChargedModel::ComputeCrossSection(G4double e) const
00093 {
00094 G4double ee = std::min(HighEnergy(),e);
00095 return cross->CrossSection2Kcharged(ee);
00096 }
00097
00098
00099
00100 G4PhysicsVector* G4ee2KChargedModel::PhysicsVector(G4double emin,
00101 G4double emax) const
00102 {
00103 G4double tmin = std::max(emin, 2.0*massK);
00104 G4double tmax = std::max(tmin, emax);
00105 G4int nbins = (G4int)((tmax - tmin)/(1.*MeV));
00106 G4PhysicsVector* v = new G4PhysicsLinearVector(emin,emax,nbins);
00107 v->SetSpline(true);
00108 return v;
00109 }
00110
00111
00112
00113 void G4ee2KChargedModel::SampleSecondaries(std::vector<G4DynamicParticle*>* newp,
00114 G4double e, const G4ThreeVector& direction)
00115 {
00116
00117 G4double tkin = 0.5*e - massK;
00118 if(tkin < 0.0) tkin = 0.0;
00119
00120 G4double cost;
00121 do {
00122 cost = 2.0*G4UniformRand() - 1.0;
00123 } while( G4UniformRand() > 1.0 - cost*cost );
00124
00125 G4double sint = sqrt(1.0 - cost*cost);
00126 G4double phi = twopi * G4UniformRand();
00127
00128 G4ThreeVector dir(sint*cos(phi),sint*sin(phi), cost);
00129 dir.rotateUz(direction);
00130
00131
00132 G4DynamicParticle* p1 =
00133 new G4DynamicParticle(G4KaonPlus::KaonPlus(),dir,tkin);
00134 G4DynamicParticle* p2 =
00135 new G4DynamicParticle(G4KaonMinus::KaonMinus(),-dir,tkin);
00136 newp->push_back(p1);
00137 newp->push_back(p2);
00138 }
00139
00140
00141