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

#include <G4ContinuumGammaTransition.hh>

Inheritance diagram for G4ContinuumGammaTransition:
G4VGammaTransition

Public Member Functions

 G4ContinuumGammaTransition (const G4NuclearLevelManager *levelManager, G4int Z, G4int A, G4double excitation, G4int verbose)
 
virtual ~G4ContinuumGammaTransition ()
 
virtual void SetEnergyFrom (G4double energy)
 
virtual G4double GetGammaEnergy ()
 
virtual G4double GetGammaCreationTime ()
 
virtual void SelectGamma ()
 
- Public Member Functions inherited from G4VGammaTransition
 G4VGammaTransition ()
 
virtual ~G4VGammaTransition ()
 

Additional Inherited Members

- Protected Attributes inherited from G4VGammaTransition
G4int _verbose
 

Detailed Description

Definition at line 59 of file G4ContinuumGammaTransition.hh.

Constructor & Destructor Documentation

G4ContinuumGammaTransition::G4ContinuumGammaTransition ( const G4NuclearLevelManager levelManager,
G4int  Z,
G4int  A,
G4double  excitation,
G4int  verbose 
)

Definition at line 66 of file G4ContinuumGammaTransition.cc.

References G4VGammaTransition::_verbose, G4NuclearLevel::Energy(), G4Pow::GetInstance(), G4NuclearLevelManager::GetLevel(), G4NuclearLevelManager::MaxLevelEnergy(), python.hepunit::MeV, G4NuclearLevelManager::MinLevelEnergy(), G4NuclearLevelManager::NumberOfLevels(), and G4Pow::powZ().

70  :
71  _nucleusA(A), _nucleusZ(Z), _excitation(excitation), _levelManager(levelManager)
72 {
73  G4double eTolerance = 0.;
74  G4int lastButOne = _levelManager->NumberOfLevels() - 2;
75  if (lastButOne >= 0)
76  {
77  eTolerance = (_levelManager->MaxLevelEnergy() -
78  _levelManager->GetLevel(lastButOne)->Energy());
79  if (eTolerance < 0.) eTolerance = 0.;
80  }
81 
82 
83  _verbose = verbose;
84  _eGamma = 0.;
85  _gammaCreationTime = 0.;
86 
87  _maxLevelE = _levelManager->MaxLevelEnergy() + eTolerance;
88  _minLevelE = _levelManager->MinLevelEnergy();
89 
90  // Energy range for photon generation; upper limit is defined 5*Gamma(GDR) from GDR peak
91  _eMin = 0.001 * MeV;
92  // Giant Dipole Resonance energy
93  G4double energyGDR = (40.3 / G4Pow::GetInstance()->powZ(_nucleusA,0.2) ) * MeV;
94  // Giant Dipole Resonance width
95  G4double widthGDR = 0.30 * energyGDR;
96  // Extend
97  G4double factor = 5;
98  _eMax = energyGDR + factor * widthGDR;
99  if (_eMax > excitation) _eMax = _excitation;
100 
101 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:53
G4double Energy() const
G4double MinLevelEnergy() const
int G4int
Definition: G4Types.hh:78
const G4NuclearLevel * GetLevel(G4int i) const
G4double powZ(G4int Z, G4double y) const
Definition: G4Pow.hh:258
double G4double
Definition: G4Types.hh:76
G4double MaxLevelEnergy() const
G4ContinuumGammaTransition::~G4ContinuumGammaTransition ( )
virtual

Definition at line 107 of file G4ContinuumGammaTransition.cc.

108 {}

Member Function Documentation

G4double G4ContinuumGammaTransition::GetGammaCreationTime ( )
virtual

Implements G4VGammaTransition.

Definition at line 183 of file G4ContinuumGammaTransition.cc.

184 {
185  return _gammaCreationTime;
186 }
G4double G4ContinuumGammaTransition::GetGammaEnergy ( )
virtual

Implements G4VGammaTransition.

Definition at line 178 of file G4ContinuumGammaTransition.cc.

179 {
180  return _eGamma;
181 }
void G4ContinuumGammaTransition::SelectGamma ( )
virtual

Implements G4VGammaTransition.

Definition at line 110 of file G4ContinuumGammaTransition.cc.

References G4VGammaTransition::_verbose, G4NuclearLevel::Energy(), G4cout, G4endl, G4UniformRand, G4NuclearLevelManager::NearestLevel(), and python.hepunit::second.

111 {
112 
113  _eGamma = 0.;
114 
115  G4int nBins = 100;
116  G4double sampleArray[101];
117  sampleArray[0] = 0.0;
118  G4int i;
119  G4double del = (_eMax - _eMin) / G4double(nBins);
120  G4double sum = 0;
121  G4double w1 = E1Pdf(_eMin);
122  G4double w2;
123  //G4cout << _eMin << " " << _eMax << " " << del << G4endl;
124  for (i=1; i<=nBins; i++) {
125  G4double e = _eMin + del * i;
126  w2 = E1Pdf(e);
127  sum += 0.5*(w1 + w2);
128  w1 = w2;
129  sampleArray[i] = sum;
130  if(_verbose > 10) {
131  G4cout << "*---* G4ContinuumTransition: e = " << e
132  << " pdf = " << sampleArray[i] << G4endl;
133  }
134  }
135  sum *= G4UniformRand();
136  _eGamma = _eMax;
137  for (i=1; i<=nBins; i++) {
138  if(sum <= sampleArray[i]) {
139  _eGamma = _eMin + del * i;
140  G4double w = sampleArray[i] - sampleArray[i-1];
141  //G4cout << _eGamma << " " << w << G4endl;
142  if(w != 0.0) {
143  _eGamma -= (sampleArray[i] - sum)*del/w;
144  }
145  break;
146  }
147  }
148 
149  G4double finalExcitation = _excitation - _eGamma;
150 
151  if(_verbose > 10) {
152  G4cout << "*---*---* G4ContinuumTransition: eGamma = " << _eGamma
153  << " finalExcitation = " << finalExcitation << G4endl;
154  }
155  // if (finalExcitation < 0)
156  if(finalExcitation < _minLevelE/2.)
157  {
158  _eGamma = _excitation;
159  finalExcitation = 0.;
160  }
161 
162  if (finalExcitation < _maxLevelE && finalExcitation > 0.)
163  {
164  G4double levelE = _levelManager->NearestLevel(finalExcitation)->Energy();
165  G4double diff = finalExcitation - levelE;
166  _eGamma = _eGamma + diff;
167  }
168 
169  _gammaCreationTime = GammaTime();
170 
171  if(_verbose > 10) {
172  G4cout << "*---*---* G4ContinuumTransition: _gammaCreationTime = "
173  << _gammaCreationTime/second << G4endl;
174  }
175  return;
176 }
G4double Energy() const
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:87
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const G4NuclearLevel * NearestLevel(G4double energy, G4double eDiffMax=9999.*CLHEP::GeV) const
void G4ContinuumGammaTransition::SetEnergyFrom ( G4double  energy)
virtual

Implements G4VGammaTransition.

Definition at line 189 of file G4ContinuumGammaTransition.cc.

References energy().

190 {
191  if (energy > 0.) _excitation = energy;
192 }
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106

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