Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4INCL::PhaseSpaceKopylov Class Reference

Generate momenta using the Kopylov method. More...

#include <G4INCLPhaseSpaceKopylov.hh>

Inheritance diagram for G4INCL::PhaseSpaceKopylov:
Collaboration diagram for G4INCL::PhaseSpaceKopylov:

Public Member Functions

void generate (const G4double sqrtS, ParticleList &particles)
 Generate momenta according to a uniform, non-Lorentz-invariant phase-space model. More...
 
- Public Member Functions inherited from G4INCL::IPhaseSpaceGenerator
 IPhaseSpaceGenerator ()
 
virtual ~IPhaseSpaceGenerator ()
 

Detailed Description

Generate momenta using the Kopylov method.

Definition at line 48 of file G4INCLPhaseSpaceKopylov.hh.

Member Function Documentation

void G4INCL::PhaseSpaceKopylov::generate ( const G4double  sqrtS,
ParticleList particles 
)
virtual

Generate momenta according to a uniform, non-Lorentz-invariant phase-space model.

This function will assign momenta to the particles in the list that is passed as an argument. The event is generated in the CM frame.

Parameters
sqrtStotal centre-of-mass energy of the system
particleslist of particles

Implements G4INCL::IPhaseSpaceGenerator.

Definition at line 63 of file G4INCLPhaseSpaceKopylov.cc.

63  {
64 
65  boostV.setX(0.0);
66  boostV.setY(0.0);
67  boostV.setZ(0.0);
68 
69  const size_t N = particles.size();
70  masses.resize(N);
71  sumMasses.resize(N);
72  std::transform(particles.begin(), particles.end(), masses.begin(), std::mem_fun(&Particle::getMass));
73  std::partial_sum(masses.begin(), masses.end(), sumMasses.begin());
74 
75  G4double PFragMagCM = 0.0;
76  G4double T = sqrtS-sumMasses.back();
77 // assert(T>-1.e-5);
78  if(T<0.)
79  T=0.;
80 
81  // The first particle in the list will pick up all the recoil
82  Particle *restParticle = particles.front();
83  restParticle->setMass(sqrtS);
84  restParticle->adjustEnergyFromMomentum();
85 
86  G4int k=N-1;
87  for (ParticleList::reverse_iterator p=particles.rbegin(); k>0; ++p, --k) {
88  const G4double mu = sumMasses[k-1];
89  T *= (k>1) ? betaKopylov(k) : 0.;
90 
91  const G4double restMass = mu + T;
92 
93  PFragMagCM = KinematicsUtils::momentumInCM(restParticle->getMass(), masses[k], restMass);
94  PFragCM = Random::normVector(PFragMagCM);
95  (*p)->setMomentum(PFragCM);
96  (*p)->adjustEnergyFromMomentum();
97  restParticle->setMass(restMass);
98  restParticle->setMomentum(-PFragCM);
99  restParticle->adjustEnergyFromMomentum();
100 
101  (*p)->boost(boostV);
102  restParticle->boost(boostV);
103 
104  boostV = -restParticle->boostVector();
105  }
106  restParticle->setMass(masses[0]);
107  restParticle->adjustEnergyFromMomentum();
108  }
const int N
Definition: mixmax.h:43
G4double getMass() const
Get the cached particle mass.
const char * p
Definition: xmltok.h:285
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
int G4int
Definition: G4Types.hh:78
ThreeVector normVector(G4double norm=1.)
void setY(G4double ay)
Set the y coordinate.
void setX(G4double ax)
Set the x coordinate.
double G4double
Definition: G4Types.hh:76
void setZ(G4double az)
Set the z coordinate.

Here is the call graph for this function:


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