Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::PhaseSpaceKopylov Class Reference

Generate momenta using the Kopylov method. More...

#include <G4INCLPhaseSpaceKopylov.hh>

+ Inheritance 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.
 
- Public Member Functions inherited from G4INCL::IPhaseSpaceGenerator
 IPhaseSpaceGenerator ()
 
virtual ~IPhaseSpaceGenerator ()
 
virtual void generate (const G4double sqrtS, ParticleList &particles)=0
 Generate an event in the CM frame.
 

Detailed Description

Generate momenta using the Kopylov method.

Definition at line 48 of file G4INCLPhaseSpaceKopylov.hh.

Member Function Documentation

◆ generate()

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 std::size_t N = particles.size();
70 masses.resize(N);
71 sumMasses.resize(N);
72 std::transform(particles.begin(), particles.end(), masses.begin(), std::mem_fn(&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=G4int(N-1);
87 for (auto 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 }
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4double getMass() const
Get the cached particle mass.
void setY(G4double ay)
Set the y coordinate.
void setZ(G4double az)
Set the z coordinate.
void setX(G4double ax)
Set the x coordinate.
#define N
Definition: crc32.c:56
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
ThreeVector normVector(G4double norm=1.)

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