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

#include <G4INCLNKElasticChannel.hh>

Inheritance diagram for G4INCL::NKElasticChannel:
G4INCL::IChannel

Public Member Functions

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

Private Member Functions

 INCL_DECLARE_ALLOCATION_POOL (NKElasticChannel)
 

Private Attributes

Particleparticle1
 
Particleparticle2
 

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.

◆ ~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()){
62 kaon = particle2;
63 }
64 else{
66 kaon = particle1;
67 }
68
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)

References G4INCL::FinalState::addModifiedParticle(), G4INCL::Particle::adjustEnergyFromMomentum(), G4INCL::Particle::isNucleon(), G4INCL::KinematicsUtils::momentumInCM(), G4INCL::Random::normVector(), G4InuclParticleNames::nucleon(), particle1, particle2, and G4INCL::Particle::setMomentum().

◆ 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::NKElasticChannel::INCL_DECLARE_ALLOCATION_POOL ( NKElasticChannel  )
private

Field Documentation

◆ particle1

Particle* G4INCL::NKElasticChannel::particle1
private

Definition at line 55 of file G4INCLNKElasticChannel.hh.

Referenced by fillFinalState().

◆ particle2

Particle * G4INCL::NKElasticChannel::particle2
private

Definition at line 55 of file G4INCLNKElasticChannel.hh.

Referenced by fillFinalState().


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