Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4INCL::NKToNKChannel Class Reference

#include <G4INCLNKToNKChannel.hh>

Inheritance diagram for G4INCL::NKToNKChannel:
G4INCL::IChannel

Public Member Functions

void fillFinalState (FinalState *fs)
 
FinalStategetFinalState ()
 
 NKToNKChannel (Particle *, Particle *)
 
virtual ~NKToNKChannel ()
 

Private Member Functions

 INCL_DECLARE_ALLOCATION_POOL (NKToNKChannel)
 

Private Attributes

Particleparticle1
 
Particleparticle2
 

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()){
62 kaon = particle2;
63 }
64 else{
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
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)

References G4INCL::FinalState::addModifiedParticle(), G4INCL::Particle::adjustEnergyFromMomentum(), G4INCL::Particle::getType(), G4INCL::Particle::isNucleon(), G4INCL::KPlus, G4INCL::KZero, G4INCL::KinematicsUtils::momentumInCM(), G4INCL::Neutron, G4INCL::Random::normVector(), G4InuclParticleNames::nucleon(), particle1, particle2, G4INCL::Proton, G4INCL::Particle::setMomentum(), and G4INCL::Particle::setType().

◆ getFinalState()

FinalState * G4INCL::IChannel::getFinalState ( )
inherited

Definition at line 50 of file G4INCLIChannel.cc.

50 {
51 FinalState *fs = new FinalState;
53 return fs;
54 }
virtual void fillFinalState(FinalState *fs)=0

References G4INCL::IChannel::fillFinalState().

◆ INCL_DECLARE_ALLOCATION_POOL()

G4INCL::NKToNKChannel::INCL_DECLARE_ALLOCATION_POOL ( NKToNKChannel  )
private

Field Documentation

◆ particle1

Particle* G4INCL::NKToNKChannel::particle1
private

Definition at line 55 of file G4INCLNKToNKChannel.hh.

Referenced by fillFinalState().

◆ particle2

Particle * G4INCL::NKToNKChannel::particle2
private

Definition at line 55 of file G4INCLNKToNKChannel.hh.

Referenced by fillFinalState().


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