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

#include <G4QuasiElasticChannel.hh>

Public Member Functions

 G4QuasiElasticChannel ()
 
 ~G4QuasiElasticChannel ()
 
G4double GetFraction (G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)
 
G4KineticTrackVectorScatter (G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary)
 

Detailed Description

Definition at line 52 of file G4QuasiElasticChannel.hh.

Constructor & Destructor Documentation

◆ G4QuasiElasticChannel()

G4QuasiElasticChannel::G4QuasiElasticChannel ( )

Definition at line 61 of file G4QuasiElasticChannel.cc.

62 : theQuasiElastic(G4QuasiElRatios::GetPointer()),
63 the3DNucleus(new G4Fancy3DNucleus) {}
static G4QuasiElRatios * GetPointer()

◆ ~G4QuasiElasticChannel()

G4QuasiElasticChannel::~G4QuasiElasticChannel ( )

Definition at line 65 of file G4QuasiElasticChannel.cc.

66{
67 delete the3DNucleus;
68}

Member Function Documentation

◆ GetFraction()

G4double G4QuasiElasticChannel::GetFraction ( G4Nucleus theNucleus,
const G4DynamicParticle thePrimary 
)

Definition at line 70 of file G4QuasiElasticChannel.cc.

72{
73 #ifdef debug_scatter
74 G4cout << "G4QuasiElasticChannel:: P=" << thePrimary.GetTotalMomentum()
75 << ", pPDG=" << thePrimary.GetDefinition()->GetPDGEncoding()
76 << ", Z = " << theNucleus.GetZ_asInt())
77 << ", N = " << theNucleus.GetN_asInt())
78 << ", A = " << theNucleus.GetA_asInt() << G4endl;
79 #endif
80
81 std::pair<G4double,G4double> ratios;
82 ratios=theQuasiElastic->GetRatios(thePrimary.GetTotalMomentum(),
83 thePrimary.GetDefinition()->GetPDGEncoding(),
84 theNucleus.GetZ_asInt(),
85 theNucleus.GetN_asInt());
86 #ifdef debug_scatter
87 G4cout << "G4QuasiElasticChannel::ratios " << ratios.first << " x " <<ratios.second
88 << " = " << ratios.first*ratios.second << G4endl;
89 #endif
90
91 return ratios.first*ratios.second;
92}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4ParticleDefinition * GetDefinition() const
G4double GetTotalMomentum() const
G4int GetA_asInt() const
Definition: G4Nucleus.hh:109
G4int GetZ_asInt() const
Definition: G4Nucleus.hh:115
G4int GetN_asInt() const
Definition: G4Nucleus.hh:112
std::pair< G4double, G4double > GetRatios(G4double pIU, G4int prPDG, G4int tgZ, G4int tgN)

Referenced by G4TheoFSGenerator::ApplyYourself().

◆ Scatter()

G4KineticTrackVector * G4QuasiElasticChannel::Scatter ( G4Nucleus theNucleus,
const G4DynamicParticle thePrimary 
)

Definition at line 94 of file G4QuasiElasticChannel.cc.

96{
97 G4int A=theNucleus.GetA_asInt();
98 G4int Z=theNucleus.GetZ_asInt();
99 // build Nucleus and choose random nucleon to scatter with
100 the3DNucleus->Init(theNucleus.GetA_asInt(),theNucleus.GetZ_asInt());
101 const std::vector<G4Nucleon>& nucleons=the3DNucleus->GetNucleons();
102 G4double targetNucleusMass=the3DNucleus->GetMass();
103 G4LorentzVector targetNucleus4Mom(0.,0.,0.,targetNucleusMass);
104 G4int index;
105 do {
106 index=G4lrint((A-1)*G4UniformRand());
107 } while (index < 0 || index >= static_cast<G4int>(nucleons.size()));
108
109 G4ParticleDefinition * pDef= nucleons[index].GetDefinition();
110
111 G4int resA=A - 1;
112 G4int resZ=Z - static_cast<int>(pDef->GetPDGCharge());
113 G4ParticleDefinition* resDef;
114 G4double residualNucleusMass;
115 if(resZ)
116 {
117 resDef=G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ);
118 residualNucleusMass=resDef->GetPDGMass();
119 }
120 else {
121 resDef=G4Neutron::Neutron();
122 residualNucleusMass=resA * G4Neutron::Neutron()->GetPDGMass();
123 }
124 #ifdef debug_scatter
125 G4cout<<"G4QElChan::Scatter: neutron - proton? A ="<<A<<", Z="<<Z<<", projName="
126 <<pDef->GetParticleName()<<G4endl;
127 #endif
128
129 G4LorentzVector pNucleon=nucleons[index].Get4Momentum();
130 G4double residualNucleusEnergy=std::sqrt(sqr(residualNucleusMass) +
131 pNucleon.vect().mag2());
132 pNucleon.setE(targetNucleusMass-residualNucleusEnergy);
133 G4LorentzVector residualNucleus4Mom=targetNucleus4Mom-pNucleon;
134
135 std::pair<G4LorentzVector,G4LorentzVector> result;
136
137 result=theQuasiElastic->Scatter(pDef->GetPDGEncoding(),pNucleon,
138 thePrimary.GetDefinition()->GetPDGEncoding(),
139 thePrimary.Get4Momentum());
140 G4LorentzVector scatteredHadron4Mom;
141 if (result.first.e() > 0.)
142 scatteredHadron4Mom=result.second;
143 else { //scatter failed
144 //G4cout << "Warning - G4QuasiElasticChannel::Scatter no scattering" << G4endl;
145 //return 0; //no scatter
146 scatteredHadron4Mom=thePrimary.Get4Momentum();
147 residualNucleus4Mom=G4LorentzVector(0.,0.,0.,targetNucleusMass);
149 }
150
151#ifdef debug_scatter
152 G4LorentzVector EpConservation=pNucleon+thePrimary.Get4Momentum()
153 - result.first - result.second;
154 if ( (EpConservation.vect().mag2() > .01*MeV*MeV )
155 || (std::abs(EpConservation.e()) > 0.1 * MeV ) )
156 {
157 G4cout << "Warning - G4QuasiElasticChannel::Scatter E-p non conservation : "
158 << EpConservation << G4endl;
159 }
160#endif
161
163 G4KineticTrack * sPrim=new G4KineticTrack(thePrimary.GetDefinition(),
164 0.,G4ThreeVector(0), scatteredHadron4Mom);
165 ktv->push_back(sPrim);
166 if (result.first.e() > 0.)
167 {
168 G4KineticTrack * sNuc=new G4KineticTrack(pDef, 0.,G4ThreeVector(0), result.first);
169 ktv->push_back(sNuc);
170 }
171 if(resZ || resA==1) // For the only neutron or for tnuclei with Z>0
172 {
173 G4KineticTrack * rNuc=new G4KineticTrack(resDef,
174 0.,G4ThreeVector(0), residualNucleus4Mom);
175 ktv->push_back(rNuc);
176 }
177 else // The residual nucleus consists of only neutrons
178 {
179 residualNucleus4Mom/=resA; // Split 4-mom of A*n system equally
180 for(G4int in=0; in<resA; in++) // Loop over neutrons in A*n system.
181 {
182 G4KineticTrack* rNuc=new G4KineticTrack(resDef,
183 0.,G4ThreeVector(0), residualNucleus4Mom);
184 ktv->push_back(rNuc);
185 }
186 }
187#ifdef debug_scatter
188 G4cout<<"G4QElC::Scat: Nucleon: "<<result.first <<" mass "<<result.first.mag() << G4endl;
189 G4cout<<"G4QElC::Scat: Project: "<<result.second<<" mass "<<result.second.mag()<< G4endl;
190#endif
191 return ktv;
192}
CLHEP::HepLorentzVector G4LorentzVector
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4UniformRand()
Definition: Randomize.hh:53
double mag2() const
Hep3Vector vect() const
G4LorentzVector Get4Momentum() const
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
static G4ParticleTable * GetParticleTable()
std::pair< G4LorentzVector, G4LorentzVector > Scatter(G4int NPDG, G4LorentzVector N4M, G4int pPDG, G4LorentzVector p4M)
virtual void Init(G4int theA, G4int theZ)=0
virtual G4double GetMass()=0
virtual const std::vector< G4Nucleon > & GetNucleons()=0
int G4lrint(double ad)
Definition: templates.hh:163
T sqr(const T &x)
Definition: templates.hh:145

Referenced by G4TheoFSGenerator::ApplyYourself().


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