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

#include <G4INCLNYElasticChannel.hh>

+ Inheritance diagram for G4INCL::NYElasticChannel:

Public Member Functions

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

Constructor & Destructor Documentation

◆ NYElasticChannel()

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

Definition at line 49 of file G4INCLNYElasticChannel.cc.

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

◆ ~NYElasticChannel()

G4INCL::NYElasticChannel::~NYElasticChannel ( )
virtual

Definition at line 53 of file G4INCLNYElasticChannel.cc.

53{}

Member Function Documentation

◆ fillFinalState()

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

Implements G4INCL::IChannel.

Definition at line 55 of file G4INCLNYElasticChannel.cc.

55 {
56
57 Particle *nucleon;
58 Particle *hyperon;
59
60 if(particle1->isNucleon()){
61 nucleon = particle1;
62 hyperon = particle2;
63 }
64 else{
65 nucleon = particle2;
66 hyperon = particle1;
67 }
68
69 const G4double Pcm = KinematicsUtils::momentumInCM(nucleon, hyperon);
70
71 ThreeVector mom_hyperon = Random::normVector(Pcm);
72
73 hyperon->setMomentum(mom_hyperon);
74 nucleon->setMomentum(-mom_hyperon);
75
76 hyperon->adjustEnergyFromMomentum();
77 nucleon->adjustEnergyFromMomentum();
78
79 fs->addModifiedParticle(nucleon);
80 fs->addModifiedParticle(hyperon);
81
82 }
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 hyperon(G4int ityp)
G4bool nucleon(G4int ityp)

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