Geant4  10.01
G4VGammaDeexcitation.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4VGammaDeexcitation.cc 87376 2014-12-02 08:25:05Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 // GEANT 4 class file
30 //
31 // CERN, Geneva, Switzerland
32 //
33 // File name: G4VGammaDeexcitation
34 //
35 // Author: Maria Grazia Pia (pia@genova.infn.it)
36 //
37 // Creation date: 23 October 1998
38 //
39 // Modifications:
40 //
41 // 21 Nov 2001, Fan Lei (flei@space.qinetiq.com)
42 // Modified GenerateGamma() and UpdateUncleus() for implementation
43 // of Internal Conversion processs
44 //
45 // 15 April 1999, Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
46 // Added creation time evaluation for products of evaporation
47 //
48 // 19 April 2010, J. M. Quesada calculations in CM system
49 // pending final boost to lab system (not critical)
50 //
51 // 23 April 2010, V.Ivanchenko rewite kinematic part using PDG formula
52 // for 2-body decay
53 //
54 // 07 May 2011, V.Ivanchenko implement check ICM flag - produce or not e-
55 //
56 // -------------------------------------------------------------------
57 
58 #include "G4VGammaDeexcitation.hh"
59 
60 #include "globals.hh"
61 #include "G4PhysicalConstants.hh"
62 #include "Randomize.hh"
63 #include "G4Gamma.hh"
64 #include "G4Electron.hh"
65 #include "G4LorentzVector.hh"
66 #include "G4VGammaTransition.hh"
67 #include "G4Fragment.hh"
68 #include "G4FragmentVector.hh"
69 
70 #include "G4ParticleTable.hh"
71 #include "G4IonTable.hh"
72 
74 
75 
76 G4VGammaDeexcitation::G4VGammaDeexcitation(): _transition(0), _verbose(0),
77  _electronO (0), _vSN(-1)
78 {
81 }
82 
84 {
85  delete _transition;
86 }
87 
89  G4Fragment* nucleus)
90 {
91  if (_verbose > 1) { G4cout << "G4VGammaDeexcitation::DoChain" << G4endl; }
92 
93  if(CanDoTransition(nucleus)) {
94  for(size_t i=0; i<100; ++i) {
96  G4Fragment* gamma = GenerateGamma(nucleus);
97  if (gamma) { products->push_back(gamma); }
98  else { break; }
99  //G4cout << i << ". Egamma(MeV)= " << gamma->GetMomentum().e()
100  // << "; new Eex(MeV)= " << nucleus->GetExcitationEnergy()
101  // << G4endl;
102  if(nucleus->GetExcitationEnergy() <= _tolerance) { break; }
103  }
104  }
105  if (_verbose > 1) {
106  G4cout << "G4VGammaDeexcitation::DoChain - end" << G4endl;
107  }
108 }
109 
111 {
112  G4Fragment * thePhoton = 0;
113  if(!CanDoTransition(aNucleus)) { return thePhoton; }
114 
115  _transition->SelectGamma(); // it can be conversion electron too
116  G4double etrans = _transition->GetGammaEnergy();
117  //G4cout << "G4VGammaDeexcitation::GenerateGamma - Etrans(MeV)= "
118  // << etrans << G4endl;
119  if(etrans <= 0.0) { return thePhoton; }
120 
121  // final excitation
122  G4double excitation = aNucleus->GetExcitationEnergy() - etrans;
123  if(excitation <= _tolerance) { excitation = 0.0; }
124  if (_verbose > 1) {
125  G4cout << "G4VGammaDeexcitation::GenerateGamma - Edeexc(MeV)= " << etrans
126  << " ** left Eexc(MeV)= " << excitation
127  << G4endl;
128  }
129 
131 
132  // Do complete Lorentz computation
133  G4LorentzVector lv = aNucleus->GetMomentum();
134  G4double Mass = aNucleus->GetGroundStateMass() + excitation;
135 
136  // select secondary
138 
139  G4DiscreteGammaTransition* dtransition =
140  dynamic_cast <G4DiscreteGammaTransition*> (_transition);
141 
142  if (dtransition && !( dtransition->IsAGamma()) ) {
143  gamma = G4Electron::Electron();
144  _vSN = dtransition->GetOrbitNumber();
146  lv += G4LorentzVector(0.0,0.0,0.0,CLHEP::electron_mass_c2);
147  }
148 
149  G4double cosTheta = 1. - 2. * G4UniformRand();
150  G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
151  G4double phi = twopi * G4UniformRand();
152 
153  G4double eMass = gamma->GetPDGMass();
154  G4LorentzVector Gamma4P;
155  /*
156  G4cout << " Mass= " << eMass << " t= " << gammaTime
157  << " tlim= " << _timeLimit << G4endl;
158  */
159  if(gammaTime > _timeLimit) {
160  // shortcut for long lived levels
161  // not correct position of stopping ion gamma emission
162  // 4-momentum balance is breaked
163  G4double eGamma = aNucleus->GetExcitationEnergy() - excitation;
164  G4double e = eGamma + eMass;
165  G4double mom = std::sqrt(eGamma*(eGamma + 2*eMass));
166  Gamma4P.set(mom * sinTheta * std::cos(phi),
167  mom * sinTheta * std::sin(phi),
168  mom * cosTheta, e);
169  lv -= Gamma4P;
170  e = lv.e();
171  if(e < Mass) { e = Mass; }
172  mom = std::sqrt((e - Mass)*(e + Mass));
173  G4ThreeVector v = lv.vect().unit();
174  lv.set(mom*v.x(), mom*v.y(), mom*v.z(), e);
175 
176  } else {
177  // 2-body decay in rest frame
178  G4double Ecm = lv.mag();
179  G4ThreeVector bst = lv.boostVector();
180 
181  G4double GammaEnergy = 0.5*((Ecm - Mass)*(Ecm + Mass) + eMass*eMass)/Ecm;
182  if(GammaEnergy < eMass) { GammaEnergy = eMass; }
183 
184  G4double mom = std::sqrt((GammaEnergy - eMass)*(GammaEnergy + eMass));
185  Gamma4P.set(mom * sinTheta * std::cos(phi),
186  mom * sinTheta * std::sin(phi),
187  mom * cosTheta,
188  GammaEnergy);
189 
190  Gamma4P.boost(bst);
191  lv -= Gamma4P;
192  }
193 
194  // modified primary fragment
195  gammaTime += aNucleus->GetCreationTime();
196 
197  aNucleus->SetMomentum(lv);
198  aNucleus->SetCreationTime(gammaTime);
199 
200  // gamma or e- are produced
201  thePhoton = new G4Fragment(Gamma4P,gamma);
202  thePhoton->SetCreationTime(gammaTime);
203 
204  //G4cout << "G4VGammaDeexcitation::GenerateGamma : " << thePhoton << G4endl;
205  //G4cout << " Left nucleus: " << aNucleus << G4endl;
206  return thePhoton;
207 }
208 
virtual G4double GetGammaEnergy()=0
CLHEP::Hep3Vector G4ThreeVector
G4ElectronOccupancy _electronO
virtual void SetEnergyFrom(G4double energy)=0
virtual G4bool CanDoTransition(G4Fragment *aNucleus)=0
#define G4UniformRand()
Definition: Randomize.hh:95
G4GLOB_DLL std::ostream G4cout
virtual void SelectGamma()=0
G4double GetCreationTime() const
Definition: G4Fragment.hh:413
const G4LorentzVector & GetMomentum() const
Definition: G4Fragment.hh:276
void SetMomentum(const G4LorentzVector &value)
Definition: G4Fragment.hh:281
std::vector< G4Fragment * > G4FragmentVector
Definition: G4Fragment.hh:65
G4double GetGroundStateMass() const
Definition: G4Fragment.hh:265
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
G4Fragment * GenerateGamma(G4Fragment *nucleus)
void SetCreationTime(G4double time)
Definition: G4Fragment.hh:418
G4double GetPDGMass() const
G4VGammaTransition * _transition
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:195
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:260
G4int RemoveElectron(G4int orbit, G4int number=1)
void DoChain(G4FragmentVector *, G4Fragment *nucleus)
CLHEP::HepLorentzVector G4LorentzVector
virtual G4double GetGammaCreationTime()=0