Geant4-11
Public Member Functions | Private Member Functions | Private Attributes
G4Fancy3DNucleus Class Reference

#include <G4Fancy3DNucleus.hh>

Inheritance diagram for G4Fancy3DNucleus:
G4V3DNucleus

Public Member Functions

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

Private Member Functions

G4double BindingEnergy ()
 
void ChooseFermiMomenta ()
 
void ChooseNucleons ()
 
void ChoosePositions ()
 
 G4Fancy3DNucleus (const G4Fancy3DNucleus &right)
 
G4bool operator!= (const G4Fancy3DNucleus &right) const
 
const G4Fancy3DNucleusoperator= (const G4Fancy3DNucleus &right)
 
G4bool operator== (const G4Fancy3DNucleus &right) const
 
G4bool ReduceSum ()
 

Private Attributes

G4int currentNucleon
 
G4double excitationEnergy
 
std::vector< G4doublefermiM
 
std::vector< G4ThreeVectormomentum
 
G4int myA
 
G4int myL
 
G4int myZ
 
G4double nucleondistance
 
std::vector< G4ThreeVectorplaces
 
std::vector< G4Fancy3DNucleusHelpertestSums
 
G4VNuclearDensitytheDensity
 
G4FermiMomentum theFermi
 
std::pair< G4double, G4doubletheImpactParameter
 
std::vector< G4NucleontheNucleons
 

Detailed Description

Definition at line 54 of file G4Fancy3DNucleus.hh.

Constructor & Destructor Documentation

◆ G4Fancy3DNucleus() [1/2]

G4Fancy3DNucleus::G4Fancy3DNucleus ( )

Definition at line 60 of file G4Fancy3DNucleus.cc.

61 : myA(0), myZ(0), myL(0), theNucleons(250), currentNucleon(-1), theDensity(0),
63 places(250), momentum(250), fermiM(250), testSums(250)
64{
65}
static constexpr double fermi
Definition: G4SIunits.hh:83
std::vector< G4double > fermiM
std::vector< G4Nucleon > theNucleons
std::vector< G4ThreeVector > momentum
std::vector< G4Fancy3DNucleusHelper > testSums
G4VNuclearDensity * theDensity
std::vector< G4ThreeVector > places

◆ ~G4Fancy3DNucleus()

G4Fancy3DNucleus::~G4Fancy3DNucleus ( )

Definition at line 67 of file G4Fancy3DNucleus.cc.

68{
69 if(theDensity) delete theDensity;
70}

References theDensity.

◆ G4Fancy3DNucleus() [2/2]

G4Fancy3DNucleus::G4Fancy3DNucleus ( const G4Fancy3DNucleus right)
private

Member Function Documentation

◆ AddExcitationEnergy()

G4double G4Fancy3DNucleus::AddExcitationEnergy ( G4double  anE)
inline

Definition at line 138 of file G4Fancy3DNucleus.hh.

139{
140 excitationEnergy +=anE;
141 return excitationEnergy;
142}

References excitationEnergy.

◆ BindingEnergy()

G4double G4Fancy3DNucleus::BindingEnergy ( )
private

Definition at line 173 of file G4Fancy3DNucleus.cc.

174{
176}
static G4double GetBindingEnergy(const G4int A, const G4int Z)

References G4NucleiProperties::GetBindingEnergy(), myA, and myZ.

Referenced by ChooseFermiMomenta(), GetMass(), and Init().

◆ CenterNucleons()

void G4Fancy3DNucleus::CenterNucleons ( )

Definition at line 251 of file G4Fancy3DNucleus.cc.

252{
253 G4ThreeVector center;
254
255 for (G4int i=0; i<myA; i++ )
256 {
257 center+=theNucleons[i].GetPosition();
258 }
259 center /= -myA;
260 DoTranslation(center);
261}
int G4int
Definition: G4Types.hh:85
void DoTranslation(const G4ThreeVector &theShift)

References DoTranslation(), myA, and theNucleons.

Referenced by Init(), and G4BinaryLightIonReaction::Interact().

◆ ChooseFermiMomenta()

void G4Fancy3DNucleus::ChooseFermiMomenta ( )
private

Definition at line 457 of file G4Fancy3DNucleus.cc.

458{
459 G4int i;
460 G4double density;
461
462 // Pre-allocate buffers for filling by index
463 momentum.resize(myA, G4ThreeVector(0.,0.,0.));
464 fermiM.resize(myA, 0.*GeV);
465
466 for (G4int ntry=0; ntry<1 ; ntry ++ )
467 {
468 for (i=0; i < myA; i++ ) // momenta for all, including last, in case we swap nucleons
469 {
470 density = theDensity->GetDensity(theNucleons[i].GetPosition());
471 fermiM[i] = theFermi.GetFermiMomentum(density);
473 if (theNucleons[i].GetDefinition() == G4Proton::Proton())
474 {
475 G4double eMax = std::sqrt(sqr(fermiM[i]) +sqr(theNucleons[i].GetDefinition()->GetPDGMass()) )
476 - CoulombBarrier();
477 if ( eMax > theNucleons[i].GetDefinition()->GetPDGMass() )
478 {
479 G4double pmax2= sqr(eMax) - sqr(theNucleons[i].GetDefinition()->GetPDGMass());
480 fermiM[i] = std::sqrt(pmax2);
481 while ( mom.mag2() > pmax2 ) /* Loop checking, 30-Oct-2015, G.Folger */
482 {
483 mom=theFermi.GetMomentum(density, fermiM[i]);
484 }
485 } else
486 {
487 //AR-21Dec2017 : emit a "JustWarning" exception instead of writing on the error stream.
488 //G4cerr << "G4Fancy3DNucleus: difficulty finding proton momentum" << G4endl;
490 ed << "Nucleus Z A " << myZ << " " << myA << G4endl;
491 ed << "proton with eMax=" << eMax << G4endl;
492 G4Exception( "G4Fancy3DNucleus::ChooseFermiMomenta(): difficulty finding proton momentum, set it to (0,0,0)",
493 "HAD_FANCY3DNUCLEUS_001", JustWarning, ed );
494 mom=G4ThreeVector(0,0,0);
495 }
496
497 }
498 momentum[i]= mom;
499 }
500
501 if ( ReduceSum() ) break;
502// G4cout <<" G4FancyNucleus: iterating to find momenta: "<< ntry<< G4endl;
503 }
504
505// G4ThreeVector sum;
506// for (G4int index=0; index<myA;sum+=momentum[index++])
507// ;
508// G4cout << "final sum / mag() " << sum << " / " << sum.mag() << G4endl;
509
511 for ( i=0; i< myA ; i++ )
512 {
513 energy = theNucleons[i].GetParticleType()->GetPDGMass()
514 - BindingEnergy()/myA;
516 theNucleons[i].SetMomentum(tempV);
517 // GF 11-05-2011: set BindingEnergy to be T of Nucleon with p , ~ p**2/2m
518 //theNucleons[i].SetBindingEnergy(
519 // 0.5*sqr(fermiM[i])/theNucleons[i].GetParticleType()->GetPDGMass());
520 }
521}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
static constexpr double GeV
Definition: G4SIunits.hh:203
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:83
#define G4endl
Definition: G4ios.hh:57
double mag2() const
G4double CoulombBarrier()
G4FermiMomentum theFermi
G4double BindingEnergy()
G4ThreeVector GetMomentum(G4double density, G4double maxMomentum=-1.)
G4double GetFermiMomentum(G4double density)
static G4Proton * Proton()
Definition: G4Proton.cc:92
G4double GetDensity(const G4ThreeVector &aPosition) const
G4double energy(const ThreeVector &p, const G4double m)
T sqr(const T &x)
Definition: templates.hh:128

References BindingEnergy(), CoulombBarrier(), G4INCL::KinematicsUtils::energy(), fermiM, G4endl, G4Exception(), G4VNuclearDensity::GetDensity(), G4FermiMomentum::GetFermiMomentum(), G4FermiMomentum::GetMomentum(), GeV, JustWarning, CLHEP::Hep3Vector::mag2(), momentum, myA, myZ, G4Proton::Proton(), ReduceSum(), sqr(), theDensity, theFermi, and theNucleons.

Referenced by Init().

◆ ChooseImpactXandY()

std::pair< G4double, G4double > G4V3DNucleus::ChooseImpactXandY ( G4double  maxImpact)
inlineinherited

Definition at line 86 of file G4V3DNucleus.hh.

88{
89 G4double x,y;
90 do
91 {
92 x = 2*G4UniformRand() - 1;
93 y = 2*G4UniformRand() - 1;
94 }
95 while(x*x + y*y > 1); /* Loop checking, 30-Oct-2015, G.Folger */
96
97 G4double impactX = x*(maxImpact);
98 G4double impactY = y*(maxImpact);
99 theImpactParameter.first = impactX;
100 theImpactParameter.second = impactY;
101 return theImpactParameter;
102}
#define G4UniformRand()
Definition: Randomize.hh:52
std::pair< G4double, G4double > theImpactParameter
Definition: G4V3DNucleus.hh:81

References G4UniformRand, and G4V3DNucleus::theImpactParameter.

Referenced by G4QGSParticipants::GetList(), and G4FTFParticipants::GetList().

◆ ChooseNucleons()

void G4Fancy3DNucleus::ChooseNucleons ( )
private

Definition at line 280 of file G4Fancy3DNucleus.cc.

281{
282 G4int protons=0, nucleons=0, lambdas=0;
283 G4double probProton = ( G4double(myZ) )/( G4double(myA) );
284 G4double probLambda = myL > 0 ? ( G4double(myL) )/( G4double(myA) ) : 0.0;
285 while ( nucleons < myA ) { /* Loop checking, 30-Oct-2015, G.Folger */
286 G4double rnd = G4UniformRand();
287 if ( rnd < probProton ) {
288 if ( protons < myZ ) {
289 protons++;
290 theNucleons[nucleons++].SetParticleType(G4Proton::Proton());
291 }
292 } else if ( rnd < probProton + probLambda ) {
293 if ( lambdas < myL ) {
294 lambdas++;
295 theNucleons[nucleons++].SetParticleType(G4Lambda::Lambda());
296 }
297 } else {
298 if ( (nucleons - protons - lambdas) < (myA - myZ - myL) ) {
299 theNucleons[nucleons++].SetParticleType(G4Neutron::Neutron());
300 }
301 }
302 }
303 return;
304}
static G4Lambda * Lambda()
Definition: G4Lambda.cc:107
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103

References G4UniformRand, G4Lambda::Lambda(), myA, myL, myZ, G4Neutron::Neutron(), G4Proton::Proton(), and theNucleons.

Referenced by Init().

◆ ChoosePositions()

void G4Fancy3DNucleus::ChoosePositions ( )
private

Definition at line 306 of file G4Fancy3DNucleus.cc.

307{
308 if( myA != 12) {
309
310 G4int i=0;
311 G4ThreeVector aPos, delta;
312 G4bool freeplace;
313 const G4double nd2=sqr(nucleondistance);
314 G4double maxR=GetNuclearRadius(0.001); // there are no nucleons at a
315 // relative Density of 0.01
316 G4int jr=0;
317 G4int jx,jy;
318 G4double arand[600];
319 G4double *prand=arand;
320 places.clear(); // Reset data buffer
321 G4int interationsLeft=1000*myA;
322 while ( (i < myA) && (--interationsLeft>0)) /* Loop checking, 30-Oct-2015, G.Folger */
323 {
324 do
325 {
326 if ( jr < 3 )
327 {
328 jr=std::min(600,9*(myA - i));
329 G4RandFlat::shootArray(jr,prand);
330 //CLHEP::RandFlat::shootArray(jr, prand );
331 }
332 jx=--jr;
333 jy=--jr;
334 aPos.set((2*arand[jx]-1.), (2*arand[jy]-1.), (2*arand[--jr]-1.));
335 } while (aPos.mag2() > 1. ); /* Loop checking, 30-Oct-2015, G.Folger */
336 aPos *=maxR;
338 if (G4UniformRand() < density)
339 {
340 freeplace= true;
341 std::vector<G4ThreeVector>::iterator iplace;
342 for( iplace=places.begin(); iplace!=places.end() && freeplace;++iplace)
343 {
344 delta = *iplace - aPos;
345 freeplace= delta.mag2() > nd2;
346 }
347 if ( freeplace ) {
349 // protons must at least have binding energy of CoulombBarrier, so
350 // assuming the Fermi energy corresponds to a potential, we must place these such
351 // that the Fermi Energy > CoulombBarrier
352 if (theNucleons[i].GetDefinition() == G4Proton::Proton())
353 {
354 G4double nucMass = theNucleons[i].GetDefinition()->GetPDGMass();
355 G4double eFermi= std::sqrt( sqr(pFermi) + sqr(nucMass) ) - nucMass;
356 if (eFermi <= CoulombBarrier() ) freeplace=false;
357 }
358 }
359 if ( freeplace ) {
360 theNucleons[i].SetPosition(aPos);
361 places.push_back(aPos);
362 ++i;
363 }
364 }
365 }
366 if (interationsLeft<=0) {
367 G4Exception("model/util/G4Fancy3DNucleus.cc", "mod_util001", FatalException,
368 "Problem to place nucleons");
369 }
370
371 } else {
372 // Start insertion
373 // Alpha cluster structure of carbon nuclei, C-12, is implemented according to
374 // P. Bozek, W. Broniowski, E.R. Arriola and M. Rybczynski
375 // Phys. Rev. C90, 064902 (2014)
376 const G4double Lbase=3.05*fermi;
377 const G4double Disp=0.552; // 0.91^2*2/3 fermi^2
378 const G4double nd2=sqr(nucleondistance);
379 const G4ThreeVector Corner1=G4ThreeVector( Lbase/2., 0., 0.);
380 const G4ThreeVector Corner2=G4ThreeVector(-Lbase/2., 0., 0.);
381 const G4ThreeVector Corner3=G4ThreeVector( 0.,Lbase*0.866, 0.); // 0.866=sqrt(3)/2
382 G4ThreeVector R1;
383 R1=G4ThreeVector(G4RandGauss::shoot(0.,Disp), G4RandGauss::shoot(0.,Disp), G4RandGauss::shoot(0.,Disp))*fermi + Corner1;
384 theNucleons[0].SetPosition(R1); // First nucleon of the first He-4
385 G4int loopCounterLeft = 10000;
386 for(G4int ii=1; ii<4; ii++) // 2 - 4 nucleons of the first He-4
387 {
388 G4bool Continue;
389 do
390 {
391 R1=G4ThreeVector(G4RandGauss::shoot(0.,Disp), G4RandGauss::shoot(0.,Disp), G4RandGauss::shoot(0.,Disp))*fermi + Corner1;
392 theNucleons[ii].SetPosition(R1);
393 Continue=false;
394 for(G4int jj=0; jj < ii; jj++)
395 {
396 if( (theNucleons[ii].GetPosition() - theNucleons[jj].GetPosition()).mag2() <= nd2 ) {Continue = true; break;}
397 }
398 } while( Continue && --loopCounterLeft > 0 ); /* Loop checking, 12-Dec-2017, A.Ribon */
399 }
400 if ( loopCounterLeft <= 0 ) {
401 G4Exception("model/util/G4Fancy3DNucleus.cc", "mod_util002", FatalException,
402 "Unable to find a good position for the first alpha cluster");
403 }
404 loopCounterLeft = 10000;
405 for(G4int ii=4; ii<8; ii++) // 5 - 8 nucleons of the second He-4
406 {
407 G4bool Continue;
408 do
409 {
410 R1=G4ThreeVector(G4RandGauss::shoot(0.,Disp), G4RandGauss::shoot(0.,Disp), G4RandGauss::shoot(0.,Disp))*fermi + Corner2;
411 theNucleons[ii].SetPosition(R1);
412 Continue=false;
413 for(G4int jj=0; jj < ii; jj++)
414 {
415 if( (theNucleons[ii].GetPosition() - theNucleons[jj].GetPosition()).mag2() <= nd2 ) {Continue = true; break;}
416 }
417 } while( Continue && --loopCounterLeft > 0 ); /* Loop checking, 12-Dec-2017, A.Ribon */
418 }
419 if ( loopCounterLeft <= 0 ) {
420 G4Exception("model/util/G4Fancy3DNucleus.cc", "mod_util003", FatalException,
421 "Unable to find a good position for the second alpha cluster");
422 }
423 loopCounterLeft = 10000;
424 for(G4int ii=8; ii<12; ii++) // 9 - 12 nucleons of the third He-4
425 {
426 G4bool Continue;
427 do
428 {
429 R1=G4ThreeVector(G4RandGauss::shoot(0.,Disp), G4RandGauss::shoot(0.,Disp), G4RandGauss::shoot(0.,Disp))*fermi + Corner3;
430 theNucleons[ii].SetPosition(R1);
431 Continue=false;
432 for(G4int jj=0; jj < ii; jj++)
433 {
434 if( (theNucleons[ii].GetPosition() - theNucleons[jj].GetPosition()).mag2() <= nd2 ) {Continue = true; break;}
435 }
436 } while( Continue && --loopCounterLeft > 0 ); /* Loop checking, 12-Dec-2017, A.Ribon */
437 }
438 if ( loopCounterLeft <= 0 ) {
439 G4Exception("model/util/G4Fancy3DNucleus.cc", "mod_util004", FatalException,
440 "Unable to find a good position for the third alpha cluster");
441 }
442 G4LorentzRotation RandomRotation;
443 RandomRotation.rotateZ(2.*pi*G4UniformRand());
444 RandomRotation.rotateY(std::acos(2.*G4UniformRand()-1.));
445 // Randomly rotation of the created nucleus
447 for(G4int ii=0; ii<myA; ii++ )
448 {
449 Pos=G4LorentzVector(theNucleons[ii].GetPosition(),0.); Pos *=RandomRotation;
450 G4ThreeVector NewPos = Pos.vect();
451 theNucleons[ii].SetPosition(NewPos);
452 }
453
454 }
455}
@ FatalException
CLHEP::HepLorentzVector G4LorentzVector
static constexpr double pi
Definition: G4SIunits.hh:55
bool G4bool
Definition: G4Types.hh:86
void set(double x, double y, double z)
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
G4double GetNuclearRadius()
virtual G4double GetRelativeDensity(const G4ThreeVector &aPosition) const =0
ush Pos
Definition: deflate.h:91
ThreeVector shoot(const G4int Ap, const G4int Af)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments

References CoulombBarrier(), FatalException, fermi, G4Exception(), G4UniformRand, G4VNuclearDensity::GetDensity(), G4FermiMomentum::GetFermiMomentum(), GetNuclearRadius(), G4VNuclearDensity::GetRelativeDensity(), CLHEP::Hep3Vector::mag2(), G4INCL::Math::min(), myA, nucleondistance, pi, places, G4Proton::Proton(), CLHEP::HepLorentzRotation::rotateY(), CLHEP::HepLorentzRotation::rotateZ(), CLHEP::Hep3Vector::set(), G4INCL::DeJongSpin::shoot(), sqr(), theDensity, theFermi, and theNucleons.

Referenced by Init().

◆ CoulombBarrier()

G4double G4Fancy3DNucleus::CoulombBarrier ( )
virtual

Implements G4V3DNucleus.

Definition at line 607 of file G4Fancy3DNucleus.cc.

608{
609 static const G4double cfactor = (1.44/1.14) * MeV;
610 return cfactor*myZ/(1.0 + G4Pow::GetInstance()->Z13(myA));
611}
static constexpr double MeV
Definition: G4SIunits.hh:200
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double Z13(G4int Z) const
Definition: G4Pow.hh:123

References G4Pow::GetInstance(), MeV, myA, myZ, and G4Pow::Z13().

Referenced by ChooseFermiMomenta(), and ChoosePositions().

◆ DoLorentzBoost() [1/2]

void G4Fancy3DNucleus::DoLorentzBoost ( const G4LorentzVector theBoost)
virtual

Implements G4V3DNucleus.

Definition at line 213 of file G4Fancy3DNucleus.cc.

214{
215 for (G4int i=0; i<myA; i++){
216 theNucleons[i].Boost(theBoost);
217 }
218}

References myA, and theNucleons.

◆ DoLorentzBoost() [2/2]

void G4Fancy3DNucleus::DoLorentzBoost ( const G4ThreeVector theBeta)
virtual

Implements G4V3DNucleus.

Definition at line 220 of file G4Fancy3DNucleus.cc.

221{
222 for (G4int i=0; i<myA; i++){
223 theNucleons[i].Boost(theBeta);
224 }
225}

References myA, and theNucleons.

◆ DoLorentzContraction() [1/2]

void G4Fancy3DNucleus::DoLorentzContraction ( const G4LorentzVector theBoost)
virtual

Implements G4V3DNucleus.

Definition at line 241 of file G4Fancy3DNucleus.cc.

242{
243 if (theBoost.e() !=0 ) {
244 G4ThreeVector beta = theBoost.vect()/theBoost.e();
246 }
247}
Hep3Vector vect() const
void DoLorentzContraction(const G4LorentzVector &theBoost)

References anonymous_namespace{G4PionRadiativeDecayChannel.cc}::beta, DoLorentzContraction(), CLHEP::HepLorentzVector::e(), and CLHEP::HepLorentzVector::vect().

Referenced by DoLorentzContraction().

◆ DoLorentzContraction() [2/2]

void G4Fancy3DNucleus::DoLorentzContraction ( const G4ThreeVector theBeta)
virtual

Implements G4V3DNucleus.

Definition at line 227 of file G4Fancy3DNucleus.cc.

228{
229 G4double beta2=theBeta.mag2();
230 if (beta2 > 0) {
231 G4double factor=(1-std::sqrt(1-beta2))/beta2; // (gamma-1)/gamma/beta**2
232 G4ThreeVector rprime;
233 for (G4int i=0; i< myA; i++) {
234 rprime = theNucleons[i].GetPosition() -
235 factor * (theBeta*theNucleons[i].GetPosition()) * theBeta;
236 theNucleons[i].SetPosition(rprime);
237 }
238 }
239}

References CLHEP::Hep3Vector::mag2(), myA, and theNucleons.

◆ DoTranslation()

void G4Fancy3DNucleus::DoTranslation ( const G4ThreeVector theShift)
virtual

Implements G4V3DNucleus.

Definition at line 263 of file G4Fancy3DNucleus.cc.

264{
265 G4ThreeVector tempV;
266 for (G4int i=0; i<myA; i++ )
267 {
268 tempV = theNucleons[i].GetPosition() + theShift;
269 theNucleons[i].SetPosition(tempV);
270 }
271}

References myA, and theNucleons.

Referenced by CenterNucleons().

◆ GetCharge()

G4int G4Fancy3DNucleus::GetCharge ( )
inlinevirtual

Implements G4V3DNucleus.

Definition at line 123 of file G4Fancy3DNucleus.hh.

124{
125 return myZ;
126}

References myZ.

Referenced by G4BinaryLightIonReaction::Interact().

◆ GetExcitationEnergy()

G4double G4Fancy3DNucleus::GetExcitationEnergy ( void  )
inline

Definition at line 144 of file G4Fancy3DNucleus.hh.

145{
146 return excitationEnergy;
147}

References excitationEnergy.

◆ GetMass()

G4double G4Fancy3DNucleus::GetMass ( )
virtual

◆ GetMassNumber()

G4int G4Fancy3DNucleus::GetMassNumber ( )
inlinevirtual

Implements G4V3DNucleus.

Definition at line 128 of file G4Fancy3DNucleus.hh.

129{
130 return myA;
131}

References myA.

Referenced by G4BinaryLightIonReaction::Interact().

◆ GetNextNucleon()

G4Nucleon * G4Fancy3DNucleus::GetNextNucleon ( )
virtual

◆ GetNuclearDensity()

const G4VNuclearDensity * G4Fancy3DNucleus::GetNuclearDensity ( ) const
virtual

Implements G4V3DNucleus.

Definition at line 273 of file G4Fancy3DNucleus.cc.

274{
275 return theDensity;
276}

References theDensity.

Referenced by G4BinaryLightIonReaction::GetProjectileExcitation(), and G4BinaryLightIonReaction::Interact().

◆ GetNuclearRadius() [1/2]

G4double G4Fancy3DNucleus::GetNuclearRadius ( )
virtual

Implements G4V3DNucleus.

Definition at line 179 of file G4Fancy3DNucleus.cc.

180{
181 return GetNuclearRadius(0.5);
182}

References GetNuclearRadius().

Referenced by ChoosePositions(), and GetNuclearRadius().

◆ GetNuclearRadius() [2/2]

G4double G4Fancy3DNucleus::GetNuclearRadius ( const G4double  maxRelativeDensity)
virtual

Implements G4V3DNucleus.

Definition at line 184 of file G4Fancy3DNucleus.cc.

185{
186 return theDensity->GetRadius(maxRelativeDensity);
187}
virtual G4double GetRadius(const G4double maxRelativeDenisty) const =0

References G4VNuclearDensity::GetRadius(), and theDensity.

◆ GetNucleons()

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

Implements G4V3DNucleus.

Definition at line 144 of file G4Fancy3DNucleus.cc.

145{
146 return theNucleons;
147}

References theNucleons.

Referenced by G4MuMinusCapturePrecompound::ApplyYourself().

◆ GetNumberOfLambdas()

G4int G4Fancy3DNucleus::GetNumberOfLambdas ( )
inlinevirtual

Implements G4V3DNucleus.

Definition at line 133 of file G4Fancy3DNucleus.hh.

134{
135 return myL;
136}

References myL.

◆ GetOuterRadius()

G4double G4Fancy3DNucleus::GetOuterRadius ( )
virtual

Implements G4V3DNucleus.

Definition at line 189 of file G4Fancy3DNucleus.cc.

190{
191 G4double maxradius2=0;
192
193 for (int i=0; i<myA; i++)
194 {
195 if ( theNucleons[i].GetPosition().mag2() > maxradius2 )
196 {
197 maxradius2=theNucleons[i].GetPosition().mag2();
198 }
199 }
200 return std::sqrt(maxradius2)+nucleondistance;
201}

References myA, nucleondistance, and theNucleons.

Referenced by G4LowEIonFragmentation::ApplyYourself(), and G4BinaryLightIonReaction::Interact().

◆ Init()

void G4Fancy3DNucleus::Init ( G4int  theA,
G4int  theZ,
G4int  numberOfLambdas = 0 
)
virtual

Implements G4V3DNucleus.

Definition at line 83 of file G4Fancy3DNucleus.cc.

84{
86 theNucleons.clear();
88 places.clear();
89 momentum.clear();
90 fermiM.clear();
91 testSums.clear();
92
93 myZ = theZ;
94 myA = theA;
95 myL = std::max(numberOfLambdas, 0); // Cannot be negative
97
98 theNucleons.resize(myA); // Pre-loads vector with empty elements
99
100 // For simplicity, we neglect eventual Lambdas in the nucleus as far as the
101 // density of nucler levels and the Fermi level are concerned.
102
103 if(theDensity) delete theDensity;
104 if ( myA < 17 ) {
106 if( myA == 12 ) nucleondistance=0.9*fermi;
107 } else {
109 }
110
112
114
116
117 if( myA == 12 ) CenterNucleons(); // This would introduce a bias
118
120
121 G4double Ebinding= BindingEnergy()/myA;
122
123 for (G4int aNucleon=0; aNucleon < myA; aNucleon++)
124 {
125 theNucleons[aNucleon].SetBindingEnergy(Ebinding);
126 }
127
128 return;
129}
void Init(G4int anA, G4int aZ)
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References BindingEnergy(), CenterNucleons(), ChooseFermiMomenta(), ChooseNucleons(), ChoosePositions(), currentNucleon, excitationEnergy, fermi, fermiM, G4FermiMomentum::Init(), G4INCL::Math::max(), momentum, myA, myL, myZ, nucleondistance, places, testSums, theDensity, theFermi, and theNucleons.

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

◆ operator!=()

G4bool G4Fancy3DNucleus::operator!= ( const G4Fancy3DNucleus right) const
private

◆ operator=()

const G4Fancy3DNucleus & G4Fancy3DNucleus::operator= ( const G4Fancy3DNucleus right)
private

◆ operator==()

G4bool G4Fancy3DNucleus::operator== ( const G4Fancy3DNucleus right) const
private

◆ ReduceSum()

G4bool G4Fancy3DNucleus::ReduceSum ( )
private

Definition at line 524 of file G4Fancy3DNucleus.cc.

525{
526 G4ThreeVector sum;
527 G4double PFermi=fermiM[myA-1];
528
529 for (G4int i=0; i < myA-1 ; i++ )
530 { sum+=momentum[i]; }
531
532// check if have to do anything at all..
533 if ( sum.mag() <= PFermi )
534 {
535 momentum[myA-1]=-sum;
536 return true;
537 }
538
539// find all possible changes in momentum, changing only the component parallel to sum
540 G4ThreeVector testDir=sum.unit();
541 testSums.clear();
542 testSums.resize(myA-1); // Allocate block for filling below
543
544 G4ThreeVector delta;
545 for (G4int aNucleon=0; aNucleon < myA-1; aNucleon++) {
546 delta = 2.*((momentum[aNucleon]*testDir)*testDir);
547
548 testSums[aNucleon].Fill(delta, delta.mag(), aNucleon);
549 }
550
551 std::sort(testSums.begin(), testSums.end());
552
553// reduce Momentum Sum until the next would be allowed.
554 G4int index=testSums.size();
555 while ( (sum-testSums[--index].Vector).mag()>PFermi && index>0) /* Loop checking, 30-Oct-2015, G.Folger */
556 {
557 // Only take one which improve, ie. don't change sign and overshoot...
558 if ( sum.mag() > (sum-testSums[index].Vector).mag() ) {
559 momentum[testSums[index].Index]-=testSums[index].Vector;
560 sum-=testSums[index].Vector;
561 }
562 }
563
564 if ( (sum-testSums[index].Vector).mag() <= PFermi )
565 {
566 G4int best=-1;
567 G4double pBest=2*PFermi; // anything larger than PFermi
568 for ( G4int aNucleon=0; aNucleon<=index; aNucleon++)
569 {
570 // find the momentum closest to choosen momentum for last Nucleon.
571 G4double pTry=(testSums[aNucleon].Vector-sum).mag();
572 if ( pTry < PFermi
573 && std::abs(momentum[myA-1].mag() - pTry ) < pBest )
574 {
575 pBest=std::abs(momentum[myA-1].mag() - pTry );
576 best=aNucleon;
577 }
578 }
579 if ( best < 0 )
580 {
581 G4String text = "G4Fancy3DNucleus.cc: Logic error in ReduceSum()";
582 throw G4HadronicException(__FILE__, __LINE__, text);
583 }
584 momentum[testSums[best].Index]-=testSums[best].Vector;
585 momentum[myA-1]=testSums[best].Vector-sum;
586
587 return true;
588
589 }
590
591 // try to compensate momentum using another Nucleon....
592 G4int swapit=-1;
593 while (swapit<myA-1) /* Loop checking, 30-Oct-2015, G.Folger */
594 {
595 if ( fermiM[++swapit] > PFermi ) break;
596 }
597 if (swapit == myA-1 ) return false;
598
599 // Now we have a nucleon with a bigger Fermi Momentum.
600 // Exchange with last nucleon.. and iterate.
601 std::swap(theNucleons[swapit], theNucleons[myA-1]);
602 std::swap(momentum[swapit], momentum[myA-1]);
603 std::swap(fermiM[swapit], fermiM[myA-1]);
604 return ReduceSum();
605}
Hep3Vector unit() const
double mag() const

References fermiM, CLHEP::Hep3Vector::mag(), momentum, myA, ReduceSum(), testSums, theNucleons, and CLHEP::Hep3Vector::unit().

Referenced by ChooseFermiMomenta(), and ReduceSum().

◆ RefetchImpactXandY()

std::pair< G4double, G4double > G4V3DNucleus::RefetchImpactXandY ( )
inlineinherited

Definition at line 77 of file G4V3DNucleus.hh.

77{return theImpactParameter;}

References G4V3DNucleus::theImpactParameter.

◆ SortNucleonsDecZ()

void G4Fancy3DNucleus::SortNucleonsDecZ ( )
virtual

Implements G4V3DNucleus.

Definition at line 164 of file G4Fancy3DNucleus.cc.

165{
166 if (theNucleons.size() < 2 ) return; // Avoid unnecessary work
168
169 std::reverse(theNucleons.begin(), theNucleons.end());
170}

References SortNucleonsIncZ(), and theNucleons.

◆ SortNucleonsIncZ()

void G4Fancy3DNucleus::SortNucleonsIncZ ( )
virtual

Implements G4V3DNucleus.

Definition at line 156 of file G4Fancy3DNucleus.cc.

157{
158 if (theNucleons.size() < 2 ) return; // Avoid unnecesary work
159
160 std::sort(theNucleons.begin(), theNucleons.end(),
162}
bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon &nuc1, const G4Nucleon &nuc2)

References G4Fancy3DNucleusHelperForSortInZ(), and theNucleons.

Referenced by SortNucleonsDecZ().

◆ StartLoop()

G4bool G4Fancy3DNucleus::StartLoop ( )
virtual

Field Documentation

◆ currentNucleon

G4int G4Fancy3DNucleus::currentNucleon
private

Definition at line 110 of file G4Fancy3DNucleus.hh.

Referenced by GetNextNucleon(), Init(), and StartLoop().

◆ excitationEnergy

G4double G4Fancy3DNucleus::excitationEnergy
private

Definition at line 114 of file G4Fancy3DNucleus.hh.

Referenced by AddExcitationEnergy(), GetExcitationEnergy(), and Init().

◆ fermiM

std::vector<G4double> G4Fancy3DNucleus::fermiM
private

Definition at line 118 of file G4Fancy3DNucleus.hh.

Referenced by ChooseFermiMomenta(), Init(), and ReduceSum().

◆ momentum

std::vector<G4ThreeVector> G4Fancy3DNucleus::momentum
private

Definition at line 117 of file G4Fancy3DNucleus.hh.

Referenced by ChooseFermiMomenta(), Init(), and ReduceSum().

◆ myA

G4int G4Fancy3DNucleus::myA
private

◆ myL

G4int G4Fancy3DNucleus::myL
private

Definition at line 107 of file G4Fancy3DNucleus.hh.

Referenced by ChooseNucleons(), GetMass(), GetNumberOfLambdas(), and Init().

◆ myZ

G4int G4Fancy3DNucleus::myZ
private

◆ nucleondistance

G4double G4Fancy3DNucleus::nucleondistance
private

Definition at line 113 of file G4Fancy3DNucleus.hh.

Referenced by ChoosePositions(), GetOuterRadius(), and Init().

◆ places

std::vector<G4ThreeVector> G4Fancy3DNucleus::places
private

Definition at line 116 of file G4Fancy3DNucleus.hh.

Referenced by ChoosePositions(), and Init().

◆ testSums

std::vector<G4Fancy3DNucleusHelper> G4Fancy3DNucleus::testSums
private

Definition at line 119 of file G4Fancy3DNucleus.hh.

Referenced by Init(), and ReduceSum().

◆ theDensity

G4VNuclearDensity* G4Fancy3DNucleus::theDensity
private

◆ theFermi

G4FermiMomentum G4Fancy3DNucleus::theFermi
private

Definition at line 112 of file G4Fancy3DNucleus.hh.

Referenced by ChooseFermiMomenta(), ChoosePositions(), and Init().

◆ theImpactParameter

std::pair<G4double, G4double> G4V3DNucleus::theImpactParameter
privateinherited

◆ theNucleons

std::vector<G4Nucleon> G4Fancy3DNucleus::theNucleons
private

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