Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4Fancy3DNucleus Class Reference

#include <G4Fancy3DNucleus.hh>

Inheritance diagram for G4Fancy3DNucleus:
G4V3DNucleus

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 AddExcitationEnergy (G4double)
 
G4double GetExcitationEnergy ()
 
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 ()
 
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 ( )

Definition at line 52 of file G4Fancy3DNucleus.cc.

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

Definition at line 60 of file G4Fancy3DNucleus.cc.

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

Member Function Documentation

G4double G4Fancy3DNucleus::AddExcitationEnergy ( G4double  anE)
inline

Definition at line 130 of file G4Fancy3DNucleus.hh.

131 {
132  excitationEnergy +=anE;
133  return excitationEnergy;
134 }
void G4Fancy3DNucleus::CenterNucleons ( )

Definition at line 237 of file G4Fancy3DNucleus.cc.

References DoTranslation().

238 {
239  G4ThreeVector center;
240 
241  for (G4int i=0; i<myA; i++ )
242  {
243  center+=theNucleons[i].GetPosition();
244  }
245  center /= -myA;
246  DoTranslation(center);
247 }
void DoTranslation(const G4ThreeVector &theShift)
int G4int
Definition: G4Types.hh:78
G4double G4Fancy3DNucleus::CoulombBarrier ( )
virtual

Implements G4V3DNucleus.

Definition at line 496 of file G4Fancy3DNucleus.cc.

References python.hepunit::MeV.

497 {
498  G4double coulombBarrier = (1.44/1.14) * MeV * myZ / (1.0 + std::pow(G4double(myA),1./3.));
499  return coulombBarrier;
500 }
double G4double
Definition: G4Types.hh:76
void G4Fancy3DNucleus::DoLorentzBoost ( const G4LorentzVector theBoost)
virtual

Implements G4V3DNucleus.

Definition at line 199 of file G4Fancy3DNucleus.cc.

200 {
201  for (G4int i=0; i<myA; i++){
202  theNucleons[i].Boost(theBoost);
203  }
204 }
int G4int
Definition: G4Types.hh:78
void G4Fancy3DNucleus::DoLorentzBoost ( const G4ThreeVector theBeta)
virtual

Implements G4V3DNucleus.

Definition at line 206 of file G4Fancy3DNucleus.cc.

207 {
208  for (G4int i=0; i<myA; i++){
209  theNucleons[i].Boost(theBeta);
210  }
211 }
int G4int
Definition: G4Types.hh:78
void G4Fancy3DNucleus::DoLorentzContraction ( const G4LorentzVector theBoost)
virtual

Implements G4V3DNucleus.

Definition at line 227 of file G4Fancy3DNucleus.cc.

References CLHEP::HepLorentzVector::e(), and CLHEP::HepLorentzVector::vect().

228 {
229  if (theBoost.e() !=0 ) {
230  G4ThreeVector beta = theBoost.vect()/theBoost.e();
231  DoLorentzContraction(beta);
232  }
233 }
Hep3Vector vect() const
void DoLorentzContraction(const G4LorentzVector &theBoost)
void G4Fancy3DNucleus::DoLorentzContraction ( const G4ThreeVector theBeta)
virtual

Implements G4V3DNucleus.

Definition at line 213 of file G4Fancy3DNucleus.cc.

References CLHEP::Hep3Vector::mag2().

214 {
215  G4double beta2=theBeta.mag2();
216  if (beta2 > 0) {
217  G4double factor=(1-std::sqrt(1-beta2))/beta2; // (gamma-1)/gamma/beta**2
218  G4ThreeVector rprime;
219  for (G4int i=0; i< myA; i++) {
220  rprime = theNucleons[i].GetPosition() -
221  factor * (theBeta*theNucleons[i].GetPosition()) * theBeta;
222  theNucleons[i].SetPosition(rprime);
223  }
224  }
225 }
int G4int
Definition: G4Types.hh:78
double mag2() const
double G4double
Definition: G4Types.hh:76
void G4Fancy3DNucleus::DoTranslation ( const G4ThreeVector theShift)
virtual

Implements G4V3DNucleus.

Definition at line 249 of file G4Fancy3DNucleus.cc.

Referenced by CenterNucleons().

250 {
251  G4ThreeVector tempV;
252  for (G4int i=0; i<myA; i++ )
253  {
254  tempV = theNucleons[i].GetPosition() + theShift;
255  theNucleons[i].SetPosition(tempV);
256  }
257 }
int G4int
Definition: G4Types.hh:78
G4int G4Fancy3DNucleus::GetCharge ( )
inlinevirtual

Implements G4V3DNucleus.

Definition at line 121 of file G4Fancy3DNucleus.hh.

122 {
123  return myZ;
124 }
G4double G4Fancy3DNucleus::GetExcitationEnergy ( void  )
inline

Definition at line 136 of file G4Fancy3DNucleus.hh.

137 {
138  return excitationEnergy;
139 }
G4double G4Fancy3DNucleus::GetMass ( )
virtual

Implements G4V3DNucleus.

Definition at line 190 of file G4Fancy3DNucleus.cc.

References G4ParticleDefinition::GetPDGMass(), G4Neutron::Neutron(), and G4Proton::Proton().

191 {
192  return myZ*G4Proton::Proton()->GetPDGMass() +
193  (myA-myZ)*G4Neutron::Neutron()->GetPDGMass() -
194  BindingEnergy();
195 }
static G4Proton * Proton()
Definition: G4Proton.cc:93
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4double GetPDGMass() const
G4int G4Fancy3DNucleus::GetMassNumber ( )
inlinevirtual

Implements G4V3DNucleus.

Definition at line 126 of file G4Fancy3DNucleus.hh.

127 {
128  return myA;
129 }
G4Nucleon * G4Fancy3DNucleus::GetNextNucleon ( )
virtual

Implements G4V3DNucleus.

Definition at line 125 of file G4Fancy3DNucleus.cc.

Referenced by G4LowEIonFragmentation::ApplyYourself().

126 {
127  return ( (currentNucleon>=0 && currentNucleon<myA) ?
128  &theNucleons[currentNucleon++] : 0 );
129 }
const G4VNuclearDensity * G4Fancy3DNucleus::GetNuclearDensity ( ) const
virtual

Implements G4V3DNucleus.

Definition at line 259 of file G4Fancy3DNucleus.cc.

260 {
261  return theDensity;
262 }
G4double G4Fancy3DNucleus::GetNuclearRadius ( )
virtual

Implements G4V3DNucleus.

Definition at line 166 of file G4Fancy3DNucleus.cc.

167 {
168  return GetNuclearRadius(0.5);
169 }
G4double GetNuclearRadius()
G4double G4Fancy3DNucleus::GetNuclearRadius ( const G4double  maxRelativeDensity)
virtual

Implements G4V3DNucleus.

Definition at line 171 of file G4Fancy3DNucleus.cc.

References G4VNuclearDensity::GetRadius().

172 {
173  return theDensity->GetRadius(maxRelativeDensity);
174 }
virtual G4double GetRadius(const G4double maxRelativeDenisty) const =0
const std::vector< G4Nucleon > & G4Fancy3DNucleus::GetNucleons ( )
virtual

Implements G4V3DNucleus.

Definition at line 131 of file G4Fancy3DNucleus.cc.

Referenced by G4MuMinusCapturePrecompound::ApplyYourself().

132 {
133  return theNucleons;
134 }
G4double G4Fancy3DNucleus::GetOuterRadius ( )
virtual

Implements G4V3DNucleus.

Definition at line 176 of file G4Fancy3DNucleus.cc.

Referenced by G4LowEIonFragmentation::ApplyYourself().

177 {
178  G4double maxradius2=0;
179 
180  for (int i=0; i<myA; i++)
181  {
182  if ( theNucleons[i].GetPosition().mag2() > maxradius2 )
183  {
184  maxradius2=theNucleons[i].GetPosition().mag2();
185  }
186  }
187  return std::sqrt(maxradius2)+nucleondistance;
188 }
double G4double
Definition: G4Types.hh:76
void G4Fancy3DNucleus::Init ( G4int  theA,
G4int  theZ 
)
virtual

Implements G4V3DNucleus.

Definition at line 76 of file G4Fancy3DNucleus.cc.

References G4FermiMomentum::Init().

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

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

Implements G4V3DNucleus.

Definition at line 151 of file G4Fancy3DNucleus.cc.

References reverse, and SortNucleonsIncZ().

152 {
153  if (theNucleons.size() < 2 ) return; // Avoid unnecessary work
155 
156  std::reverse(theNucleons.begin(), theNucleons.end());
157 }
void G4Fancy3DNucleus::SortNucleonsIncZ ( )
virtual

Implements G4V3DNucleus.

Definition at line 143 of file G4Fancy3DNucleus.cc.

References G4Fancy3DNucleusHelperForSortInZ(), and sort().

Referenced by SortNucleonsDecZ().

144 {
145  if (theNucleons.size() < 2 ) return; // Avoid unnecesary work
146 
147  std::sort(theNucleons.begin(), theNucleons.end(),
149 }
subroutine sort(A, N)
Definition: dpm25nuc7.f:4670
bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon &nuc1, const G4Nucleon &nuc2)
G4bool G4Fancy3DNucleus::StartLoop ( )
virtual

Implements G4V3DNucleus.

Definition at line 118 of file G4Fancy3DNucleus.cc.

Referenced by G4LowEIonFragmentation::ApplyYourself().

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

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