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

#include <G4INCLPionNucleonChannel.hh>

+ Inheritance diagram for G4INCL::PionNucleonChannel:

Public Member Functions

 PionNucleonChannel (Particle *, Particle *, Nucleus *, const G4bool localE=false)
 
virtual ~PionNucleonChannel ()
 
FinalStategetFinalState ()
 
- Public Member Functions inherited from G4INCL::IChannel
 IChannel ()
 
virtual ~IChannel ()
 
virtual G4INCL::FinalStategetFinalState ()=0
 

Detailed Description

Definition at line 48 of file G4INCLPionNucleonChannel.hh.

Constructor & Destructor Documentation

◆ PionNucleonChannel()

G4INCL::PionNucleonChannel::PionNucleonChannel ( Particle p1,
Particle p2,
Nucleus nucleus,
const G4bool  localE = false 
)

Definition at line 48 of file G4INCLPionNucleonChannel.cc.

49 : theNucleus(nucleus), particle1(p1), particle2(p2), locE(localE)
50 {
51
52 }

◆ ~PionNucleonChannel()

G4INCL::PionNucleonChannel::~PionNucleonChannel ( )
virtual

Definition at line 54 of file G4INCLPionNucleonChannel.cc.

54 {
55
56 }

Member Function Documentation

◆ getFinalState()

FinalState * G4INCL::PionNucleonChannel::getFinalState ( )
virtual

Implements G4INCL::IChannel.

Definition at line 58 of file G4INCLPionNucleonChannel.cc.

58 {
59 FinalState *fs = new FinalState;
60
61 Particle * nucleon;
62 Particle * pion;
63 if(particle1->isNucleon()) {
64 nucleon = particle1;
65 pion = particle2;
66 } else {
67 nucleon = particle2;
68 pion = particle1;
69 }
70
71 ParticleType deltaType = DeltaZero;
72 if(ParticleConfig::isPair(particle1, particle2, Proton, PiPlus)) {
73 deltaType = DeltaPlusPlus;
74 } else if(ParticleConfig::isPair(particle1, particle2, Neutron, PiPlus)) {
75 deltaType = DeltaPlus;
76 } else if(ParticleConfig::isPair(particle1, particle2, Proton, PiZero)) {
77 deltaType = DeltaPlus;
78 } else if(ParticleConfig::isPair(particle1, particle2, Neutron, PiZero)) {
79 deltaType = DeltaZero;
80 } else if(ParticleConfig::isPair(particle1, particle2, Proton, PiMinus)) {
81 deltaType = DeltaZero;
82 } else if(ParticleConfig::isPair(particle1, particle2, Neutron, PiMinus)) {
83 deltaType = DeltaMinus;
84 } else {
85 ERROR("Unknown particle pair in Pi-N collision." << std::endl);
86 }
87
88 G4double deltaEnergy = nucleon->getEnergy() - nucleon->getPotentialEnergy()
89 + pion->getEnergy() - pion->getPotentialEnergy();
90
91 nucleon->setType(deltaType); // nucleon becomes the delta
92 deltaEnergy += theNucleus->getPotential()->computePotentialEnergy(nucleon);
93 nucleon->setEnergy(deltaEnergy); // set the energy of the delta
94
95 ThreeVector deltaMomentum = nucleon->getMomentum() + pion->getMomentum();
96 nucleon->setMomentum(deltaMomentum);
97
98 const G4double deltaMass = std::sqrt(deltaEnergy*deltaEnergy - deltaMomentum.mag2());
99 nucleon->setMass(deltaMass);
100 theNucleus->updatePotentialEnergy(nucleon);
101
102 fs->addModifiedParticle(nucleon); // nucleon became a delta
103 fs->addDestroyedParticle(pion); // pion was removed
104 return fs;
105 }
#define ERROR(x)
double G4double
Definition: G4Types.hh:64
virtual G4double computePotentialEnergy(const Particle *const p) const =0
NuclearPotential::INuclearPotential * getPotential() const
Getter for thePotential.
void updatePotentialEnergy(Particle *p)
Update the particle potential energy.
G4bool isNucleon() const
G4bool isPair(Particle const *const p1, Particle const *const p2, ParticleType t1, ParticleType t2)

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