Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VGammaDeexcitation Class Referenceabstract

#include <G4VGammaDeexcitation.hh>

+ Inheritance diagram for G4VGammaDeexcitation:

Public Member Functions

 G4VGammaDeexcitation ()
 
virtual ~G4VGammaDeexcitation ()
 
virtual G4VGammaTransitionCreateTransition ()=0
 
virtual G4bool CanDoTransition ()=0
 
G4FragmentVectorDoTransition ()
 
G4FragmentVectorDoChain ()
 
G4FragmentGenerateGamma ()
 
G4FragmentGetNucleus ()
 
void SetNucleus (G4Fragment *nucleus)
 
void SetVerboseLevel (G4int verbose)
 
void Initialize ()
 
void SetEO (G4ElectronOccupancy eo)
 
void SetVaccantSN (G4int val)
 
G4ElectronOccupancy GetEO ()
 
G4int GetVacantSN ()
 
void SetTimeLimit (G4double value)
 

Protected Member Functions

void Update ()
 

Protected Attributes

G4VGammaTransition_transition
 
G4int _verbose
 

Detailed Description

Definition at line 72 of file G4VGammaDeexcitation.hh.

Constructor & Destructor Documentation

◆ G4VGammaDeexcitation()

G4VGammaDeexcitation::G4VGammaDeexcitation ( )

Definition at line 76 of file G4VGammaDeexcitation.cc.

76 : _transition(0), _verbose(0),
77 _electronO (0), _vSN(-1)
78{
79 _nucleus = 0;
80 fTimeLimit = DBL_MAX;
81}
G4VGammaTransition * _transition
#define DBL_MAX
Definition: templates.hh:83

◆ ~G4VGammaDeexcitation()

G4VGammaDeexcitation::~G4VGammaDeexcitation ( )
virtual

Definition at line 83 of file G4VGammaDeexcitation.cc.

84{
85 if (_transition != 0) { delete _transition; }
86}

Member Function Documentation

◆ CanDoTransition()

virtual G4bool G4VGammaDeexcitation::CanDoTransition ( )
pure virtual

◆ CreateTransition()

virtual G4VGammaTransition * G4VGammaDeexcitation::CreateTransition ( )
pure virtual

◆ DoChain()

G4FragmentVector * G4VGammaDeexcitation::DoChain ( )

Definition at line 106 of file G4VGammaDeexcitation.cc.

107{
108 if (_verbose > 1) { G4cout << "G4VGammaDeexcitation::DoChain" << G4endl; }
109 const G4double tolerance = CLHEP::keV;
110
111 Initialize();
112 G4FragmentVector* products = new G4FragmentVector();
113
114 while (CanDoTransition())
115 {
117 G4Fragment* gamma = GenerateGamma();
118 if (gamma != 0)
119 {
120 products->push_back(gamma);
121 //G4cout << "Eex(keV)= " << _nucleus->GetExcitationEnergy()/keV << G4endl;
122 if(_nucleus->GetExcitationEnergy() <= tolerance) { break; }
123 Update();
124 }
125 }
126
127 if (_verbose > 1) {
128 G4cout << "G4VGammaDeexcitation::DoChain - Transition deleted, end of chain " << G4endl;
129 }
130
131 return products;
132}
std::vector< G4Fragment * > G4FragmentVector
Definition: G4Fragment.hh:65
double G4double
Definition: G4Types.hh:64
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:235
virtual G4bool CanDoTransition()=0
virtual void SetEnergyFrom(G4double energy)=0

Referenced by G4PhotonEvaporation::BreakItUp(), and G4PhotonEvaporation::BreakUpFragment().

◆ DoTransition()

G4FragmentVector * G4VGammaDeexcitation::DoTransition ( )

Definition at line 88 of file G4VGammaDeexcitation.cc.

89{
90 Initialize();
91 G4FragmentVector* products = new G4FragmentVector();
92
93 if (CanDoTransition())
94 {
95 G4Fragment* gamma = GenerateGamma();
96 if (gamma != 0) { products->push_back(gamma); }
97 }
98
99 if (_verbose > 1) {
100 G4cout << "G4VGammaDeexcitation::DoTransition - Transition deleted " << G4endl;
101 }
102
103 return products;
104}

Referenced by G4PhotonEvaporation::BreakUp().

◆ GenerateGamma()

G4Fragment * G4VGammaDeexcitation::GenerateGamma ( )

Definition at line 134 of file G4VGammaDeexcitation.cc.

135{
136 // 23/04/10 V.Ivanchenko rewrite complitely
137 G4double eGamma = 0.;
138
139 if (_transition) {
140 _transition->SelectGamma(); // it can be conversion electron too
141 eGamma = _transition->GetGammaEnergy();
142 //G4cout << "G4VGammaDeexcitation::GenerateGamma - Egam(MeV)= "
143 // << eGamma << G4endl;
144 if(eGamma <= 0.0) { return 0; }
145 } else { return 0; }
146
147 G4double excitation = _nucleus->GetExcitationEnergy() - eGamma;
148 if(excitation < 0.0) { excitation = 0.0; }
149 if (_verbose > 1)
150 {
151 G4cout << "G4VGammaDeexcitation::GenerateGamma - Edeexc(MeV)= " << eGamma
152 << " ** left Eexc(MeV)= " << excitation
153 << G4endl;
154 }
155
157
158 // Do complete Lorentz computation
159 G4LorentzVector lv = _nucleus->GetMomentum();
160 G4double Mass = _nucleus->GetGroundStateMass() + excitation;
161
162 // select secondary
164
165 G4DiscreteGammaTransition* dtransition =
166 dynamic_cast <G4DiscreteGammaTransition*> (_transition);
167
168 G4bool eTransition = false;
169 if (dtransition && !( dtransition->IsAGamma()) ) {
170 eTransition = true;
171 gamma = G4Electron::Electron();
172 _vSN = dtransition->GetOrbitNumber();
173 _electronO.RemoveElectron(_vSN);
174 lv += G4LorentzVector(0.0,0.0,0.0,CLHEP::electron_mass_c2 - dtransition->GetBondEnergy());
175 }
176
177 G4double cosTheta = 1. - 2. * G4UniformRand();
178 G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
179 G4double phi = twopi * G4UniformRand();
180
181 G4double eMass = gamma->GetPDGMass();
182 G4LorentzVector Gamma4P;
183
184 //G4cout << "Egamma= " << eGamma << " Mass= " << eMass << " t= " << gammaTime
185 // << " tlim= " << fTimeLimit << G4endl;
186
187 if(gammaTime > fTimeLimit) {
188 // shortcut for long lived levels
189 // not correct position of stopping ion gamma emission
190 // 4-momentum balance is breaked
191 G4double e = eGamma + eMass;
192 G4double mom = std::sqrt(eGamma*(eGamma + 2*eMass));
193 Gamma4P.set(mom * sinTheta * std::cos(phi),
194 mom * sinTheta * std::sin(phi),
195 mom * cosTheta, e);
196 lv -= Gamma4P;
197 e = lv.e();
198 if(e < Mass) { e = Mass; }
199 mom = std::sqrt((e - Mass)*(e + Mass));
200 G4ThreeVector v = lv.vect().unit();
201 lv.set(mom*v.x(), mom*v.y(), mom*v.z(), e);
202
203 } else {
204 // 2-body decay in rest frame
205 G4double Ecm = lv.mag();
206 G4ThreeVector bst = lv.boostVector();
207
208 G4double GammaEnergy = 0.5*((Ecm - Mass)*(Ecm + Mass) + eMass*eMass)/Ecm;
209 if(GammaEnergy <= eMass) { return 0; }
210
211 G4double mom = std::sqrt((GammaEnergy - eMass)*(GammaEnergy + eMass));
212 Gamma4P.set(mom * sinTheta * std::cos(phi),
213 mom * sinTheta * std::sin(phi),
214 mom * cosTheta,
215 GammaEnergy);
216
217 Gamma4P.boost(bst);
218 lv -= Gamma4P;
219 }
220
221 // modified primary fragment
222 gammaTime += _nucleus->GetCreationTime();
223
224 _nucleus->SetMomentum(lv);
225 _nucleus->SetCreationTime(gammaTime);
226
227 // e- is not produced
228 if(eTransition && !dtransition->GetICM()) { return 0; }
229
230 // gamma or e- are produced
231 G4Fragment * thePhoton = new G4Fragment(Gamma4P,gamma);
232 thePhoton->SetCreationTime(gammaTime);
233
234 //G4cout << "G4VGammaDeexcitation::GenerateGamma : " << thePhoton << G4endl;
235 //G4cout << " Left nucleus: " << _nucleus << G4endl;
236 return thePhoton;
237}
CLHEP::HepLorentzVector G4LorentzVector
bool G4bool
Definition: G4Types.hh:67
#define G4UniformRand()
Definition: Randomize.hh:53
double z() const
Hep3Vector unit() const
double x() const
double y() const
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
Hep3Vector vect() const
void set(double x, double y, double z, double t)
G4int RemoveElectron(G4int orbit, G4int number=1)
static G4Electron * Electron()
Definition: G4Electron.cc:94
G4double GetGroundStateMass() const
Definition: G4Fragment.hh:240
const G4LorentzVector & GetMomentum() const
Definition: G4Fragment.hh:251
G4double GetCreationTime() const
Definition: G4Fragment.hh:378
void SetCreationTime(G4double time)
Definition: G4Fragment.hh:383
void SetMomentum(const G4LorentzVector &value)
Definition: G4Fragment.hh:256
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
virtual G4double GetGammaEnergy()=0
virtual void SelectGamma()=0
virtual G4double GetGammaCreationTime()=0

Referenced by DoChain(), DoTransition(), and G4PhotonEvaporation::EmittedFragment().

◆ GetEO()

G4ElectronOccupancy G4VGammaDeexcitation::GetEO ( )
inline

◆ GetNucleus()

◆ GetVacantSN()

G4int G4VGammaDeexcitation::GetVacantSN ( )
inline

◆ Initialize()

void G4VGammaDeexcitation::Initialize ( )
inline

Definition at line 143 of file G4VGammaDeexcitation.hh.

144{
145 if (_transition != 0) { delete _transition; }
147 if (_transition != 0) {
149 }
150}
virtual G4VGammaTransition * CreateTransition()=0

Referenced by DoChain(), DoTransition(), and G4PhotonEvaporation::EmittedFragment().

◆ SetEO()

void G4VGammaDeexcitation::SetEO ( G4ElectronOccupancy  eo)
inline

Definition at line 99 of file G4VGammaDeexcitation.hh.

99{ _electronO = eo; };

Referenced by G4PhotonEvaporation::SetEOccupancy().

◆ SetNucleus()

void G4VGammaDeexcitation::SetNucleus ( G4Fragment nucleus)
inline

◆ SetTimeLimit()

void G4VGammaDeexcitation::SetTimeLimit ( G4double  value)
inline

Definition at line 105 of file G4VGammaDeexcitation.hh.

105{ fTimeLimit = value; }

Referenced by G4PhotonEvaporation::G4PhotonEvaporation(), and G4PhotonEvaporation::SetTimeLimit().

◆ SetVaccantSN()

void G4VGammaDeexcitation::SetVaccantSN ( G4int  val)
inline

◆ SetVerboseLevel()

void G4VGammaDeexcitation::SetVerboseLevel ( G4int  verbose)
inline

Definition at line 138 of file G4VGammaDeexcitation.hh.

139{
140 _verbose = verbose;
141}

Referenced by G4PhotonEvaporation::SetVerboseLevel().

◆ Update()

void G4VGammaDeexcitation::Update ( )
protected

Definition at line 239 of file G4VGammaDeexcitation.cc.

240{
241 if (_transition != 0)
242 {
243 delete _transition;
244 _transition = 0;
245 if (_verbose > 1) {
246 G4cout << "G4VGammaDeexcitation::Update - Transition deleted " << G4endl;
247 }
248 }
249
251 if (_transition != 0)
252 {
254 // if ( _vSN != -1) (dynamic_cast <G4DiscreteGammaTransition*> (_transition))->SetICM(false);
255 // the above line is commented out for bug fix #952. It was intruduced for reason that
256 // the k-shell electron is most likely one to be kicked out and there is no time for
257 // the atom to deexcite before the next IC. But this limitation is causing other problems as
258 // reported in #952
259 }
260
261 return;
262}

Referenced by DoChain().

Member Data Documentation

◆ _transition

◆ _verbose


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