55G4float G4PhotonEvaporation::GREnergy[] = {0.0f};
56G4float G4PhotonEvaporation::GRWidth[] = {0.0f};
64 : fTransition(p), fPolarization(nullptr), fVerbose(1)
67 G4cout <<
"### New G4PhotonEvaporation() " <<
this <<
G4endl;
70 fTolerance = 20*CLHEP::eV;
76 if(0.0f == GREnergy[2]) { InitialiseGRData(); }
86 if (isInitialised) {
return; }
100 G4cout <<
"### G4PhotonEvaporation is initialized " <<
this <<
G4endl;
104void G4PhotonEvaporation::InitialiseGRData()
107 if(0.0f == GREnergy[2]) {
109 const G4float GRWfactor = 0.3f;
111 GREnergy[
A] = (
G4float)(40.3*CLHEP::MeV/g4calc->
powZ(
A,0.2));
112 GRWidth[
A] = GRWfactor*GREnergy[
A];
127 if(fCorrelatedGamma && fRDM) {
130 if(
nullptr != nucp) {
139 G4cout <<
"G4PhotonEvaporation::EmittedFragment: "
141 if(fPolarization) {
G4cout <<
"NucPolar: " << fPolarization <<
G4endl; }
142 G4cout <<
" CorrGamma: " << fCorrelatedGamma <<
" RDM: " << fRDM
143 <<
" fPolarization: " << fPolarization <<
G4endl;
150 if(fNucPStore && fPolarization && 0 == fIndex) {
152 G4cout <<
"G4PhotonEvaporation::EmittedFragment: remove "
153 << fPolarization <<
G4endl;
155 fNucPStore->
RemoveMe(fPolarization);
156 fPolarization =
nullptr;
161 G4cout <<
"G4PhotonEvaporation::EmittedFragment: RDM= "
162 << fRDM <<
" done:" <<
G4endl;
179 products->push_back(aNucleus);
188 G4cout <<
"G4PhotonEvaporation::BreakUpChain RDM= " << fRDM <<
" "
195 if(fCorrelatedGamma) {
203 gamma = GenerateGamma(nucleus);
206 products->push_back(gamma);
208 G4cout <<
"G4PhotonEvaporation::BreakUpChain: "
219 if(
nullptr != fPolarization) {
220 delete fPolarization;
221 fPolarization =
nullptr;
237 G4cout <<
"G4PhotonEvaporation::GetEmissionProbability: Z="
238 << Z <<
" A=" <<
A <<
" Eexc(MeV)= " << fExcEnergy <<
G4endl;
242 if(0 >= Z || 1 >=
A || Z ==
A || fTolerance >= fExcEnergy)
243 {
return fProbability; }
246 if(
A >= MAXGRDATA) {
A = MAXGRDATA-1; }
249 static const G4float GREfactor = 5.0f;
250 if(fExcEnergy >= (
G4double)(GREfactor*GRWidth[
A] + GREnergy[
A])) {
260 emax = std::min(emax, fExcEnergy);
262 if(0.0 == emax || fExcEnergy*eexcfac <= emax) { emax = fExcEnergy*eexcfac; }
265 const G4double MaxDeltaEnergy = CLHEP::MeV;
266 fPoints = std::min((
G4int)(fStep/MaxDeltaEnergy) + 2, MAXDEPOINT);
269 G4cout <<
"Emax= " << emax <<
" Npoints= " << fPoints
270 <<
" Eex= " << fExcEnergy <<
G4endl;
278 G4double xsqr = std::sqrt(levelDensity*fExcEnergy);
285 G4double p0 =
G4Exp(-2.0*xsqr)*gammaR2*gammaE2/(egdp2*egdp2 + gammaR2);
288 for(
G4int i=1; i<fPoints; ++i) {
291 gammaR2 = gammaE2*wres2;
292 egdp2 = gammaE2 - eres2;
293 p1 =
G4Exp(2.0*(std::sqrt(levelDensity*std::abs(fExcEnergy - egam)) - xsqr))
294 *gammaR2*gammaE2/(egdp2*egdp2 + gammaR2);
295 fProbability += (p1 + p0);
296 fCummProbability[i] = fProbability;
298 G4cout <<
"Egamma= " << egam <<
" Eex= " << fExcEnergy
299 <<
" p0= " << p0 <<
" p1= " << p1 <<
" sum= "
300 << fCummProbability[i] <<
G4endl;
305 static const G4double NormC = 1.25*CLHEP::millibarn
306 /(CLHEP::pi2*CLHEP::hbarc*CLHEP::hbarc);
307 fProbability *= fStep*NormC*
A;
308 if(fVerbose > 1) {
G4cout <<
"prob= " << fProbability <<
G4endl; }
328 InitialiseLevelManager(Z,
A);
331 if(E > fLevelEnergyMax + fTolerance) { E = energy; }
338 InitialiseLevelManager(Z,
A);
339 return fLevelEnergyMax;
343G4PhotonEvaporation::GenerateGamma(
G4Fragment* nucleus)
348 if(eexc <= fTolerance) {
return result; }
362 G4bool isDiscrete =
false;
365 std::size_t ntrans = 0;
368 G4cout <<
"GenerateGamma: " <<
" Eex= " << eexc
369 <<
" Eexmax= " << fLevelEnergyMax <<
G4endl;
372 if(
nullptr != fLevelManager && eexc <= fLevelEnergyMax + fTolerance) {
375 isDiscrete = (std::abs(elevel - eexc) < fTolerance);
377 G4cout <<
" index= " << fIndex
380 if(isDiscrete && 0 < fIndex) {
382 level = fLevelManager->
GetLevel(fIndex);
383 if(
nullptr != level) {
385 G4cout <<
" ntrans= " << ntrans <<
" JP= " << JP1
386 <<
" RDM: " << fRDM <<
G4endl;
390 if(fLevelManager->
FloatingLevel(fIndex) > 0 && 0 == ntrans &&
391 std::abs(elevel - fLevelManager->
LevelEnergy(fIndex-1)) < fTolerance) {
392 auto newlevel = fLevelManager->
GetLevel(fIndex-1);
393 if(
nullptr != newlevel && newlevel->NumberOfTransitions() > 0) {
411 <<
" Exc= " << eexc <<
" Emax= "
412 << fLevelEnergyMax <<
" idx= " << fIndex
413 <<
" fCode= " << fCode <<
" fPoints= " << fPoints
414 <<
" Ntr= " << ntrans <<
" discrete: " << isDiscrete
415 <<
" fProb= " << fProbability <<
G4endl;
423 if(fCode != 1000*theZ + theA || eexc != fExcEnergy) {
426 if(fProbability == 0.0) {
431 for(
G4int i=1; i<fPoints; ++i) {
433 G4cout <<
"y= " << y <<
" cummProb= " << fCummProbability[i]
434 <<
" fPoints= " << fPoints <<
" fStep= " << fStep <<
G4endl;
436 if(y <= fCummProbability[i]) {
437 efinal = fStep*((i - 1) + (y - fCummProbability[i-1])
438 /(fCummProbability[i] - fCummProbability[i-1]));
445 G4cout <<
"Continues proposes Efinal= " << efinal <<
G4endl;
447 if(
nullptr != fLevelManager) {
448 if(efinal < fLevelEnergyMax) {
452 if(efinal >= eexc && 0 < fIndex) {
461 efinal = fLevelEnergyMax;
466 G4cout <<
"Continues emission efinal(MeV)= " << efinal <<
G4endl;
469 }
else if (0 == fIndex) {
471 if (
nullptr != fLevelManager) {
473 if(ltime > fMaxLifeTime) { isLL =
true; }
482 G4cout <<
"Discrete emission from level Index= " << fIndex
483 <<
" Elevel= " << fLevelManager->
LevelEnergy(fIndex)
484 <<
" Ltime= " << fLevelManager->
LifeTime(fIndex)
485 <<
" LtimeMax= " << fMaxLifeTime
486 <<
" RDM= " << fRDM <<
" ICM= " << fICM <<
G4endl;
492 if (!fRDM && ltime > fMaxLifeTime) {
502 G4cout <<
"Ntrans= " << ntrans <<
" idx= " << idx
503 <<
" ICM= " << fICM <<
" JP1= " << JP1 <<
G4endl;
512 rndm = (rndm - prob)/(1.0 - prob);
527 if(fSampleTime && ltime <
DBL_MAX) {
534 if(
nullptr != fLevelManager) {
536 if(ltime > fMaxLifeTime) { isLL =
true; }
541 if(std::abs(efinal - eexc) <= fTolerance) {
return result; }
544 JP2, multiP, vShellNumber,
545 isDiscrete, isGamma);
554 if(efinal == 0.0 && fIndex > 0) {
560 G4cout <<
"Final level E= " << efinal <<
" time= " << time
561 <<
" idxFinal= " << fIndex <<
" isDiscrete: " << isDiscrete
562 <<
" isGamma: " << isGamma <<
" multiP= " << multiP
563 <<
" shell= " << vShellNumber
564 <<
" JP1= " << JP1 <<
" JP2= " << JP2 <<
G4endl;
571 if(p != fTransition) {
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
std::vector< G4Fragment * > G4FragmentVector
G4double G4Log(G4double x)
#define G4MUTEX_INITIALIZER
G4GLOB_DLL std::ostream G4cout
G4bool CorrelatedGamma() const
G4double GetMaxLifeTime() const
G4double GetMinExcitation() const
G4bool GetInternalConversionFlag() const
void SetFloatingLevelNumber(G4int value)
G4double GetGroundStateMass() const
G4NuclearPolarization * GetNuclearPolarization() const
G4double GetExcitationEnergy() const
void SetCreatorModelID(G4int value)
G4double GetCreationTime() const
void SetNuclearPolarization(G4NuclearPolarization *)
void SetCreationTime(G4double time)
G4double ComputeGroundStateMass(G4int Z, G4int A, G4int nLambdas=0) const
void SetLongLived(G4bool value)
void SetSpin(G4double value)
void SetPolarizationFlag(G4bool val)
void SetTwoJMAX(G4int val)
void SetVerbose(G4int val)
virtual G4Fragment * SampleTransition(G4Fragment *nucleus, G4double newExcEnergy, G4double mpRatio, G4int JP1, G4int JP2, G4int MP, G4int shell, G4bool isDiscrete, G4bool isGamma)
const G4NucLevel * GetLevel(const std::size_t i) const
std::size_t NearestLevelIndex(const G4double energy, const std::size_t index=0) const
G4int FloatingLevel(const std::size_t i) const
G4double LevelEnergy(const std::size_t i) const
G4double LifeTime(const std::size_t i) const
G4double NearestLevelEnergy(const G4double energy, const std::size_t index=0) const
G4int TwoSpinParity(const std::size_t i) const
std::size_t NumberOfTransitions() const
std::size_t SampleGammaTransition(G4double rndm) const
G4float MultipolarityRatio(std::size_t idx) const
G4int SampleShell(std::size_t idx, G4double rndm) const
G4float GammaProbability(std::size_t idx) const
std::size_t FinalExcitationIndex(std::size_t idx) const
G4int TransitionType(std::size_t idx) const
G4double GetLevelDensity(G4int Z, G4int A, G4double U)
G4DeexPrecoParameters * GetParameters()
static G4NuclearLevelData * GetInstance()
static G4NuclearPolarizationStore * GetInstance()
void RemoveMe(G4NuclearPolarization *ptr)
G4NuclearPolarization * FindOrBuild(G4int Z, G4int A, G4double Eexc)
void SetExcitationEnergy(G4double val)
void RDMForced(G4bool) override
G4double GetEmissionProbability(G4Fragment *theNucleus) override
G4double GetUpperLevelEnergy(G4int Z, G4int A)
void SetICM(G4bool) override
G4double ComputeProbability(G4Fragment *theNucleus, G4double kinEnergy) override
G4double ComputeInverseXSection(G4Fragment *theNucleus, G4double kinEnergy) override
G4double GetFinalLevelEnergy(G4int Z, G4int A, G4double energy)
G4bool BreakUpChain(G4FragmentVector *theResult, G4Fragment *theNucleus) override
~G4PhotonEvaporation() override
void SetGammaTransition(G4GammaTransition *)
G4PhotonEvaporation(G4GammaTransition *ptr=nullptr)
G4FragmentVector * BreakItUp(const G4Fragment &theNucleus)
void Initialise() override
G4Fragment * EmittedFragment(G4Fragment *theNucleus) override
static G4int GetModelID(const G4int modelIndex)
static G4Pow * GetInstance()
G4double powZ(G4int Z, G4double y) const