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

#include <G4eeToPGammaModel.hh>

Inheritance diagram for G4eeToPGammaModel:
G4Vee2hadrons

Public Member Functions

 G4eeToPGammaModel (G4eeCrossSections *, const G4String &)
 
virtual ~G4eeToPGammaModel ()
 
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 60 of file G4eeToPGammaModel.hh.

Constructor & Destructor Documentation

G4eeToPGammaModel::G4eeToPGammaModel ( G4eeCrossSections cr,
const G4String npart 
)

Definition at line 65 of file G4eeToPGammaModel.cc.

References G4Eta::Eta(), G4ParticleDefinition::GetPDGMass(), python.hepunit::MeV, and G4PionZero::PionZero().

65  :
66  cross(cr)
67 {
68  pi0 = G4PionZero::PionZero();
69  if(npart == "pi0") {
70  massR = 782.62*MeV;
71  particle = pi0;
72  } else {
73  massR = 1019.46*MeV;
74  particle = G4Eta::Eta();
75  }
76  massP = particle->GetPDGMass();
77 }
static G4Eta * Eta()
Definition: G4Eta.cc:109
static G4PionZero * PionZero()
Definition: G4PionZero.cc:104
G4double GetPDGMass() const
G4eeToPGammaModel::~G4eeToPGammaModel ( )
virtual

Definition at line 81 of file G4eeToPGammaModel.cc.

82 {}

Member Function Documentation

G4double G4eeToPGammaModel::ComputeCrossSection ( G4double  e) const
virtual

Implements G4Vee2hadrons.

Definition at line 100 of file G4eeToPGammaModel.cc.

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

101 {
102  G4double ee = std::min(HighEnergy(),e);
103  G4double xs;
104  if(particle == pi0) xs = cross->CrossSectionPi0G(ee);
105  else xs = cross->CrossSectionEtaG(ee);
106  return xs;
107 }
G4double CrossSectionEtaG(G4double)
G4double CrossSectionPi0G(G4double)
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 G4eeToPGammaModel::PeakEnergy ( ) const
virtual

Implements G4Vee2hadrons.

Definition at line 93 of file G4eeToPGammaModel.cc.

94 {
95  return massR;
96 }
G4PhysicsVector * G4eeToPGammaModel::PhysicsVector ( G4double  emin,
G4double  emax 
) const
virtual

Implements G4Vee2hadrons.

Definition at line 111 of file G4eeToPGammaModel.cc.

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

113 {
114  G4double tmin = std::max(emin, ThresholdEnergy());
115  G4double tmax = std::max(tmin, emax);
116  G4int nbins = (G4int)((tmax - tmin)/(5.*MeV));
117  G4PhysicsVector* v = new G4PhysicsLinearVector(emin,emax,nbins);
118  v->SetSpline(true);
119  return v;
120 }
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
virtual G4double ThresholdEnergy() const
void G4eeToPGammaModel::SampleSecondaries ( std::vector< G4DynamicParticle * > *  newp,
G4double  e,
const G4ThreeVector direction 
)
virtual

Implements G4Vee2hadrons.

Definition at line 124 of file G4eeToPGammaModel.cc.

References G4UniformRand, G4Gamma::Gamma(), CLHEP::Hep3Vector::rotateUz(), and python.hepunit::twopi.

126 {
127  G4double egam = 0.5*e*(1.0 - massP*massP/(massR*massR));
128  G4double tkin = e - egam - massP;
129  if(tkin < 0.0) tkin = 0.0;
130  G4double cost;
131  do {
132  cost = 2.0*G4UniformRand() - 1.0;
133  } while( 2.0*G4UniformRand() > 1.0 + cost*cost );
134 
135  G4double sint = sqrt(1.0 - cost*cost);
136  G4double phi = twopi * G4UniformRand();
137 
138  G4ThreeVector dir(sint*cos(phi),sint*sin(phi), cost);
139  dir.rotateUz(direction);
140 
141  // create G4DynamicParticle objects
142  G4DynamicParticle* p1 =
143  new G4DynamicParticle(particle,dir,tkin);
144  G4DynamicParticle* p2 =
145  new G4DynamicParticle(G4Gamma::Gamma(),-dir,egam);
146  newp->push_back(p1);
147  newp->push_back(p2);
148 }
#define G4UniformRand()
Definition: Randomize.hh:87
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
double G4double
Definition: G4Types.hh:76
G4double G4eeToPGammaModel::ThresholdEnergy ( ) const
virtual

Implements G4Vee2hadrons.

Definition at line 86 of file G4eeToPGammaModel.cc.

References G4Vee2hadrons::LowEnergy().

Referenced by PhysicsVector().

87 {
88  return LowEnergy();
89 }
G4double LowEnergy() const

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