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)
65 #if defined(NON_INTEGER_A_Z)
109 for (
G4int aNucleon=0; aNucleon <
myA; aNucleon++)
180 for (
int i=0; i<
myA; i++)
182 if (
theNucleons[i].GetPosition().mag2() > maxradius2 )
217 G4double factor=(1-std::sqrt(1-beta2))/beta2;
221 factor * (theBeta*
theNucleons[i].GetPosition()) * theBeta;
229 if (theBoost.e() !=0 ) {
268 G4int protons=0,nucleons=0;
270 while (nucleons <
myA )
277 else if ( (nucleons-protons) < (
myA-
myZ) )
281 else G4cout <<
"G4Fancy3DNucleus::ChooseNucleons not efficient" <<
G4endl;
308 G4RandFlat::shootArray(jr,prand);
313 aPos.set((2*arand[jx]-1.), (2*arand[jy]-1.), (2*arand[--jr]-1.));
314 }
while (aPos.mag2() > 1. );
320 std::vector<G4ThreeVector>::iterator iplace;
321 for( iplace=
places.begin(); iplace!=
places.end() && freeplace;++iplace)
323 delta = *iplace - aPos;
324 freeplace= delta.mag2() > nd2;
361 for (
G4int ntry=0; ntry<1 ; ntry ++ )
363 for (i=0; i <
myA; i++ )
372 if ( eMax >
theNucleons[i].GetDefinition()->GetPDGMass() )
375 fermiM[i] = std::sqrt(pmax2);
376 while ( mom.mag2() > pmax2 )
382 G4cerr <<
"G4Fancy3DNucleus: difficulty finding proton momentum" <<
G4endl;
400 for ( i=0; i<
myA ; i++ )
402 energy =
theNucleons[i].GetParticleType()->GetPDGMass()
422 if ( sum.mag() <= PFermi )
434 for (
G4int aNucleon=0; aNucleon < myA-1; aNucleon++) {
435 delta = 2.*((
momentum[aNucleon]*testDir)*testDir);
437 testSums[aNucleon].Fill(delta, delta.mag(), aNucleon);
444 while ( (sum-
testSums[--index].Vector).mag()>PFermi && index>0)
447 if ( sum.mag() > (sum-
testSums[index].Vector).mag() ) {
449 sum-=testSums[index].Vector;
453 if ( (sum-
testSums[index].Vector).mag() <= PFermi )
457 for (
G4int aNucleon=0; aNucleon<=index; aNucleon++)
462 && std::abs(
momentum[myA-1].mag() - pTry ) < pBest )
464 pBest=std::abs(
momentum[myA-1].mag() - pTry );
470 G4String text =
"G4Fancy3DNucleus.cc: Logic error in ReduceSum()";
474 momentum[myA-1]=testSums[best].Vector-sum;
484 if (
fermiM[++swapit] > PFermi )
break;
486 if (swapit == myA-1 )
return false;
499 return coulombBarrier;
std::vector< G4ThreeVector > momentum
void ChooseFermiMomenta()
CLHEP::Hep3Vector G4ThreeVector
G4double CoulombBarrier()
void DoTranslation(const G4ThreeVector &theShift)
std::vector< G4double > fermiM
void DoLorentzBoost(const G4LorentzVector &theBoost)
virtual const G4ThreeVector & GetPosition() const
G4double excitationEnergy
std::vector< G4Fancy3DNucleusHelper > testSums
std::vector< G4ThreeVector > places
virtual G4double GetRadius(const G4double maxRelativeDenisty) const =0
G4GLOB_DLL std::ostream G4cout
std::vector< G4Nucleon > theNucleons
bool G4Fancy3DNucleusHelperForSortInZ(const G4Nucleon &nuc1, const G4Nucleon &nuc2)
void Init(G4int theA, G4int theZ)
virtual G4double GetRelativeDensity(const G4ThreeVector &aPosition) const =0
G4double GetFermiMomentum(G4double density)
static G4Proton * Proton()
G4double GetNuclearRadius()
static G4Neutron * Neutron()
const std::vector< G4Nucleon > & GetNucleons()
void Init(G4int anA, G4int aZ)
G4double GetPDGMass() const
G4double GetDensity(const G4ThreeVector &aPosition) const
static G4double GetBindingEnergy(const G4int A, const G4int Z)
G4double energy(const ThreeVector &p, const G4double m)
void DoLorentzContraction(const G4LorentzVector &theBoost)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4ThreeVector GetMomentum(G4double density, G4double maxMomentum=-1.)
G4double GetOuterRadius()
const G4VNuclearDensity * GetNuclearDensity() const
const G4double nucleondistance
G4Nucleon * GetNextNucleon()
static const double fermi
G4VNuclearDensity * theDensity
G4GLOB_DLL std::ostream G4cerr
CLHEP::HepLorentzVector G4LorentzVector