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

#include <G4INCLNKElasticChannel.hh>

+ Inheritance diagram for G4INCL::NKElasticChannel:

Public Member Functions

 NKElasticChannel (Particle *, Particle *)
 
virtual ~NKElasticChannel ()
 
void fillFinalState (FinalState *fs)
 
- Public Member Functions inherited from G4INCL::IChannel
 IChannel ()
 
virtual ~IChannel ()
 
FinalStategetFinalState ()
 
virtual void fillFinalState (FinalState *fs)=0
 

Detailed Description

Definition at line 47 of file G4INCLNKElasticChannel.hh.

Constructor & Destructor Documentation

◆ NKElasticChannel()

G4INCL::NKElasticChannel::NKElasticChannel ( Particle p1,
Particle p2 
)

Definition at line 49 of file G4INCLNKElasticChannel.cc.

50 : particle1(p1), particle2(p2)
51 {}

◆ ~NKElasticChannel()

G4INCL::NKElasticChannel::~NKElasticChannel ( )
virtual

Definition at line 53 of file G4INCLNKElasticChannel.cc.

53{}

Member Function Documentation

◆ fillFinalState()

void G4INCL::NKElasticChannel::fillFinalState ( FinalState fs)
virtual

Implements G4INCL::IChannel.

Definition at line 55 of file G4INCLNKElasticChannel.cc.

55 {
56
57 Particle *nucleon;
58 Particle *kaon;
59
60 if(particle1->isNucleon()){
61 nucleon = particle1;
62 kaon = particle2;
63 }
64 else{
65 nucleon = particle2;
66 kaon = particle1;
67 }
68
69 const G4double norm = KinematicsUtils::momentumInCM(nucleon, kaon);
70
71 ThreeVector mom_kaon;
72
73// const G4double pLab = KinematicsUtils::momentumInLab(kaon,nucleon);
74
75/* if(pLab==0) mom_kaon = Random::normVector();
76 else{
77 const G4double x = kaon->getMomentum().getX();
78 const G4double y = kaon->getMomentum().getY();
79 const G4double z = kaon->getMomentum().getZ();
80
81 const G4double r = std::sqrt(x*x+y*y+z*z);
82 const G4double rho = std::sqrt(x*x+y*y);
83
84 const G4double b = 12. * pLab/2375.; // correspond to the forward slope description at 2375 MeV/c in K- p elastic
85 const G4double cos_theta = std::log(Random::shoot()*(std::exp(b)-std::exp(-b))+std::exp(-b))/b;
86 const G4double sin_theta = std::sqrt(1-cos_theta*cos_theta);
87
88 const G4double cos_phi = std::cos(Random::shoot()*Math::twoPi);
89 const G4double sin_phi = std::sqrt(1-cos_phi*cos_phi);
90
91 if(rho == 0) mom_kaon = ThreeVector(sin_theta*cos_phi,sin_theta*sin_phi,cos_theta);
92 // Rotation in the direction of the incident kaon
93 const G4double px = x/r*cos_theta - y/rho*sin_theta*cos_phi + z/r*x/rho*sin_theta*sin_phi;
94 const G4double py = y/r*cos_theta + x/rho*sin_theta*cos_phi + z/r*y/rho*sin_theta*sin_phi;
95 const G4double pz = z/r*cos_theta - rho/r*sin_theta*sin_phi;
96
97 mom_kaon = ThreeVector(px,py,pz);
98 }*/
99
100 mom_kaon = Random::normVector();
101
102 kaon->setMomentum(mom_kaon*norm);
103 nucleon->setMomentum(-mom_kaon*norm);
104
105 kaon->adjustEnergyFromMomentum();
106 nucleon->adjustEnergyFromMomentum();
107
108 fs->addModifiedParticle(nucleon);
109 fs->addModifiedParticle(kaon);
110
111 }
double G4double
Definition: G4Types.hh:83
G4bool isNucleon() const
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.)
G4bool nucleon(G4int ityp)

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