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

#include <G4Fancy3DNucleus.hh>

+ Inheritance diagram for G4Fancy3DNucleus:

Public Member Functions

 G4Fancy3DNucleus ()
 
 ~G4Fancy3DNucleus ()
 
void Init (G4int theA, G4int theZ)
 
G4bool StartLoop ()
 
G4NucleonGetNextNucleon ()
 
const std::vector< G4Nucleon > & GetNucleons ()
 
G4int GetMassNumber ()
 
G4double GetMass ()
 
G4int GetCharge ()
 
G4double GetNuclearRadius ()
 
G4double GetNuclearRadius (const G4double maxRelativeDensity)
 
G4double GetOuterRadius ()
 
G4double CoulombBarrier ()
 
void DoLorentzBoost (const G4LorentzVector &theBoost)
 
void DoLorentzBoost (const G4ThreeVector &theBeta)
 
void DoLorentzContraction (const G4LorentzVector &theBoost)
 
void DoLorentzContraction (const G4ThreeVector &theBeta)
 
void CenterNucleons ()
 
void DoTranslation (const G4ThreeVector &theShift)
 
const G4VNuclearDensityGetNuclearDensity () const
 
void SortNucleonsIncZ ()
 
void SortNucleonsDecZ ()
 
- Public Member Functions inherited from G4V3DNucleus
 G4V3DNucleus ()
 
virtual ~G4V3DNucleus ()
 
virtual void Init (G4int theA, G4int theZ)=0
 
virtual G4bool StartLoop ()=0
 
virtual G4NucleonGetNextNucleon ()=0
 
virtual const std::vector< G4Nucleon > & GetNucleons ()=0
 
virtual G4int GetMassNumber ()=0
 
virtual G4double GetMass ()=0
 
virtual G4int GetCharge ()=0
 
virtual G4double GetNuclearRadius ()=0
 
virtual G4double GetNuclearRadius (const G4double maxRelativeDensity)=0
 
virtual G4double GetOuterRadius ()=0
 
virtual G4double CoulombBarrier ()=0
 
virtual void DoLorentzBoost (const G4LorentzVector &theBoost)=0
 
virtual void DoLorentzBoost (const G4ThreeVector &theBeta)=0
 
virtual void DoLorentzContraction (const G4LorentzVector &theBoost)=0
 
virtual void DoLorentzContraction (const G4ThreeVector &theBeta)=0
 
virtual void DoTranslation (const G4ThreeVector &theShift)=0
 
virtual const G4VNuclearDensityGetNuclearDensity () const =0
 
virtual void SortNucleonsIncZ ()=0
 
virtual void SortNucleonsDecZ ()=0
 
std::pair< G4double, G4doubleChooseImpactXandY (G4double maxImpact)
 
std::pair< G4double, G4doubleRefetchImpactXandY ()
 

Detailed Description

Definition at line 54 of file G4Fancy3DNucleus.hh.

Constructor & Destructor Documentation

◆ G4Fancy3DNucleus()

G4Fancy3DNucleus::G4Fancy3DNucleus ( )

Definition at line 52 of file G4Fancy3DNucleus.cc.

53 : myA(0), myZ(0), theNucleons(250), currentNucleon(-1), theDensity(0),
54 nucleondistance(0.8*fermi), places(250), momentum(250), fermiM(250),
55 testSums(250)
56{
57//G4cout <<"G4Fancy3DNucleus::G4Fancy3DNucleus()"<<G4endl;
58}

◆ ~G4Fancy3DNucleus()

G4Fancy3DNucleus::~G4Fancy3DNucleus ( )

Definition at line 60 of file G4Fancy3DNucleus.cc.

61{
62 if(theDensity) delete theDensity;
63}

Member Function Documentation

◆ CenterNucleons()

void G4Fancy3DNucleus::CenterNucleons ( )

Definition at line 232 of file G4Fancy3DNucleus.cc.

233{
234 G4ThreeVector center;
235
236 for (G4int i=0; i<myA; i++ )
237 {
238 center+=theNucleons[i].GetPosition();
239 }
240 center /= -myA;
241 DoTranslation(center);
242}
int G4int
Definition: G4Types.hh:66
void DoTranslation(const G4ThreeVector &theShift)

◆ CoulombBarrier()

G4double G4Fancy3DNucleus::CoulombBarrier ( )
virtual

Implements G4V3DNucleus.

Definition at line 490 of file G4Fancy3DNucleus.cc.

491{
492 G4double coulombBarrier = (1.44/1.14) * MeV * myZ / (1.0 + std::pow(G4double(myA),1./3.));
493 return coulombBarrier;
494}
double G4double
Definition: G4Types.hh:64

◆ DoLorentzBoost() [1/2]

void G4Fancy3DNucleus::DoLorentzBoost ( const G4LorentzVector theBoost)
virtual

Implements G4V3DNucleus.

Definition at line 198 of file G4Fancy3DNucleus.cc.

199{
200 for (G4int i=0; i<myA; i++){
201 theNucleons[i].Boost(theBoost);
202 }
203}

◆ DoLorentzBoost() [2/2]

void G4Fancy3DNucleus::DoLorentzBoost ( const G4ThreeVector theBeta)
virtual

Implements G4V3DNucleus.

Definition at line 205 of file G4Fancy3DNucleus.cc.

206{
207 for (G4int i=0; i<myA; i++){
208 theNucleons[i].Boost(theBeta);
209 }
210}

◆ DoLorentzContraction() [1/2]

void G4Fancy3DNucleus::DoLorentzContraction ( const G4LorentzVector theBoost)
virtual

Implements G4V3DNucleus.

Definition at line 223 of file G4Fancy3DNucleus.cc.

224{
225 G4ThreeVector beta = theBoost.vect()/theBoost.e();
226 // DoLorentzBoost(beta);
228}
Hep3Vector vect() const
void DoLorentzContraction(const G4LorentzVector &theBoost)

Referenced by DoLorentzContraction().

◆ DoLorentzContraction() [2/2]

void G4Fancy3DNucleus::DoLorentzContraction ( const G4ThreeVector theBeta)
virtual

Implements G4V3DNucleus.

Definition at line 212 of file G4Fancy3DNucleus.cc.

213{
214 G4double factor=(1-std::sqrt(1-theBeta.mag2()))/theBeta.mag2(); // (gamma-1)/gamma/beta**2
215 G4ThreeVector rprime;
216 for (G4int i=0; i< myA; i++) {
217 rprime = theNucleons[i].GetPosition() -
218 factor * (theBeta*theNucleons[i].GetPosition()) * theBeta;
219 theNucleons[i].SetPosition(rprime);
220 }
221}
double mag2() const

◆ DoTranslation()

void G4Fancy3DNucleus::DoTranslation ( const G4ThreeVector theShift)
virtual

Implements G4V3DNucleus.

Definition at line 244 of file G4Fancy3DNucleus.cc.

245{
246 G4ThreeVector tempV;
247 for (G4int i=0; i<myA; i++ )
248 {
249 tempV = theNucleons[i].GetPosition() + theShift;
250 theNucleons[i].SetPosition(tempV);
251 }
252}

Referenced by CenterNucleons().

◆ GetCharge()

G4int G4Fancy3DNucleus::GetCharge ( )
inlinevirtual

Implements G4V3DNucleus.

Definition at line 118 of file G4Fancy3DNucleus.hh.

119{
120 return myZ;
121}

◆ GetMass()

G4double G4Fancy3DNucleus::GetMass ( )
virtual

Implements G4V3DNucleus.

Definition at line 189 of file G4Fancy3DNucleus.cc.

190{
191 return myZ*G4Proton::Proton()->GetPDGMass() +
192 (myA-myZ)*G4Neutron::Neutron()->GetPDGMass() -
193 BindingEnergy();
194}
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
static G4Proton * Proton()
Definition: G4Proton.cc:93

◆ GetMassNumber()

G4int G4Fancy3DNucleus::GetMassNumber ( )
inlinevirtual

Implements G4V3DNucleus.

Definition at line 123 of file G4Fancy3DNucleus.hh.

124{
125 return myA;
126}

◆ GetNextNucleon()

G4Nucleon * G4Fancy3DNucleus::GetNextNucleon ( )
virtual

Implements G4V3DNucleus.

Definition at line 124 of file G4Fancy3DNucleus.cc.

125{
126 return ( (currentNucleon>=0 && currentNucleon<myA) ?
127 &theNucleons[currentNucleon++] : 0 );
128}

Referenced by G4LowEIonFragmentation::ApplyYourself().

◆ GetNuclearDensity()

const G4VNuclearDensity * G4Fancy3DNucleus::GetNuclearDensity ( ) const
virtual

Implements G4V3DNucleus.

Definition at line 254 of file G4Fancy3DNucleus.cc.

255{
256 return theDensity;
257}

◆ GetNuclearRadius() [1/2]

G4double G4Fancy3DNucleus::GetNuclearRadius ( )
virtual

Implements G4V3DNucleus.

Definition at line 165 of file G4Fancy3DNucleus.cc.

166{
167 return GetNuclearRadius(0.5);
168}
G4double GetNuclearRadius()

Referenced by GetNuclearRadius().

◆ GetNuclearRadius() [2/2]

G4double G4Fancy3DNucleus::GetNuclearRadius ( const G4double  maxRelativeDensity)
virtual

Implements G4V3DNucleus.

Definition at line 170 of file G4Fancy3DNucleus.cc.

171{
172 return theDensity->GetRadius(maxRelativeDensity);
173}
virtual G4double GetRadius(const G4double maxRelativeDenisty) const =0

◆ GetNucleons()

const std::vector< G4Nucleon > & G4Fancy3DNucleus::GetNucleons ( )
virtual

Implements G4V3DNucleus.

Definition at line 130 of file G4Fancy3DNucleus.cc.

131{
132 return theNucleons;
133}

Referenced by G4MuMinusCapturePrecompound::ApplyYourself().

◆ GetOuterRadius()

G4double G4Fancy3DNucleus::GetOuterRadius ( )
virtual

Implements G4V3DNucleus.

Definition at line 175 of file G4Fancy3DNucleus.cc.

176{
177 G4double maxradius2=0;
178
179 for (int i=0; i<myA; i++)
180 {
181 if ( theNucleons[i].GetPosition().mag2() > maxradius2 )
182 {
183 maxradius2=theNucleons[i].GetPosition().mag2();
184 }
185 }
186 return std::sqrt(maxradius2)+nucleondistance;
187}

Referenced by G4LowEIonFragmentation::ApplyYourself().

◆ Init()

void G4Fancy3DNucleus::Init ( G4int  theA,
G4int  theZ 
)
virtual

Implements G4V3DNucleus.

Definition at line 76 of file G4Fancy3DNucleus.cc.

77{
78// G4cout << "G4Fancy3DNucleus::Init(theA, theZ) called"<<G4endl;
79 currentNucleon=-1;
80 theNucleons.clear();
81
82 myZ = theZ;
83 myA= theA;
84
85 theNucleons.resize(myA); // Pre-loads vector with empty elements
86
87// G4cout << "myA, myZ" << myA << ", " << myZ << G4endl;
88
89 if(theDensity) delete theDensity;
90 if ( myA < 17 ) {
91 theDensity = new G4NuclearShellModelDensity(myA, myZ);
92 } else {
93 theDensity = new G4NuclearFermiDensity(myA, myZ);
94 }
95
96 theFermi.Init(myA, myZ);
97
98 ChooseNucleons();
99
100 ChoosePositions();
101
102// CenterNucleons(); // This would introduce a bias
103
104 ChooseFermiMomenta();
105
106 G4double Ebinding= BindingEnergy()/myA;
107
108 for (G4int aNucleon=0; aNucleon < myA; aNucleon++)
109 {
110 theNucleons[aNucleon].SetBindingEnergy(Ebinding);
111 }
112
113
114 return;
115}
void Init(G4int anA, G4int aZ)

Referenced by G4MuMinusCapturePrecompound::ApplyYourself(), and G4LowEIonFragmentation::ApplyYourself().

◆ SortNucleonsDecZ()

void G4Fancy3DNucleus::SortNucleonsDecZ ( )
virtual

Implements G4V3DNucleus.

Definition at line 150 of file G4Fancy3DNucleus.cc.

151{
152 if (theNucleons.size() < 2 ) return; // Avoid unnecessary work
154
155 std::reverse(theNucleons.begin(), theNucleons.end());
156}

◆ SortNucleonsIncZ()

void G4Fancy3DNucleus::SortNucleonsIncZ ( )
virtual

Implements G4V3DNucleus.

Definition at line 142 of file G4Fancy3DNucleus.cc.

143{
144 if (theNucleons.size() < 2 ) return; // Avoid unnecesary work
145
146 std::sort(theNucleons.begin(), theNucleons.end(),
148}
bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon &nuc1, const G4Nucleon &nuc2)

Referenced by SortNucleonsDecZ().

◆ StartLoop()

G4bool G4Fancy3DNucleus::StartLoop ( )
virtual

Implements G4V3DNucleus.

Definition at line 117 of file G4Fancy3DNucleus.cc.

118{
119 currentNucleon=0;
120 return (theNucleons.size()>0);
121}

Referenced by G4LowEIonFragmentation::ApplyYourself().


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