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

#include <G4INCLNKToNKChannel.hh>

+ Inheritance diagram for G4INCL::NKToNKChannel:

Public Member Functions

 NKToNKChannel (Particle *, Particle *)
 
virtual ~NKToNKChannel ()
 
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 G4INCLNKToNKChannel.hh.

Constructor & Destructor Documentation

◆ NKToNKChannel()

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

Definition at line 49 of file G4INCLNKToNKChannel.cc.

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

◆ ~NKToNKChannel()

G4INCL::NKToNKChannel::~NKToNKChannel ( )
virtual

Definition at line 53 of file G4INCLNKToNKChannel.cc.

53{}

Member Function Documentation

◆ fillFinalState()

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

Implements G4INCL::IChannel.

Definition at line 55 of file G4INCLNKToNKChannel.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// assert(ParticleTable::getIsospin(nucleon->getType()) + ParticleTable::getIsospin(kaon->getType()) == 0);
70
71 if(kaon->getType() == KZero){
72 nucleon->setType(Neutron);
73 kaon->setType(KPlus);
74 }
75 else{
76 nucleon->setType(Proton);
77 kaon->setType(KZero);
78 }
79
80 ThreeVector mom_kaon;
81
82// const G4double pLab = KinematicsUtils::momentumInLab(kaon,nucleon);
83
84/* if(pLab==0) mom_kaon = Random::normVector();
85 else{
86 const G4double x = kaon->getMomentum().getX();
87 const G4double y = kaon->getMomentum().getY();
88 const G4double z = kaon->getMomentum().getZ();
89
90 const G4double r = std::sqrt(x*x+y*y+z*z);
91 const G4double rho = std::sqrt(x*x+y*y);
92
93 const G4double b = 12. * pLab/2375.; // correspond to the forward slope description at 2375 MeV/c in K- p elastic
94 const G4double cos_theta = std::log(Random::shoot()*(std::exp(b)-std::exp(-b))+std::exp(-b))/b;
95 const G4double sin_theta = std::sqrt(1-cos_theta*cos_theta);
96
97 const G4double cos_phi = std::cos(Random::shoot()*Math::twoPi);
98 const G4double sin_phi = std::sqrt(1-cos_phi*cos_phi);
99
100 if(rho == 0) mom_kaon = ThreeVector(sin_theta*cos_phi,sin_theta*sin_phi,cos_theta);
101 // Rotation in the direction of the incident kaon
102 const G4double px = x/r*cos_theta - y/rho*sin_theta*cos_phi + z/r*x/rho*sin_theta*sin_phi;
103 const G4double py = y/r*cos_theta + x/rho*sin_theta*cos_phi + z/r*y/rho*sin_theta*sin_phi;
104 const G4double pz = z/r*cos_theta - rho/r*sin_theta*sin_phi;
105
106 mom_kaon = ThreeVector(px,py,pz);
107 }*/
108
109 mom_kaon = Random::normVector();
110
111 G4double norm = KinematicsUtils::momentumInCM(kaon,nucleon);
112
113 kaon->setMomentum(mom_kaon*norm);
114 nucleon->setMomentum(-mom_kaon*norm);
115
116 kaon->adjustEnergyFromMomentum();
117 nucleon->adjustEnergyFromMomentum();
118
119 fs->addModifiedParticle(nucleon);
120 fs->addModifiedParticle(kaon);
121
122 }
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: