Geant4  10.03
G4GammaTransition.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: G4GammaTransition.cc 85659 2014-11-03 10:59:10Z vnivanch $
27 //
28 // -------------------------------------------------------------------
29 // GEANT 4 class file
30 //
31 // CERN, Geneva, Switzerland
32 //
33 // File name: G4GammaTransition
34 //
35 // Author V.Ivanchenko 27 February 2015
36 //
37 // -------------------------------------------------------------------
38 
39 #include "G4GammaTransition.hh"
40 #include "G4AtomicShells.hh"
41 #include "Randomize.hh"
42 #include "G4RandomDirection.hh"
43 #include "G4Gamma.hh"
44 #include "G4Electron.hh"
45 #include "G4LorentzVector.hh"
46 #include "G4SystemOfUnits.hh"
47 #include "G4PhysicalConstants.hh"
48 
50  : polarFlag(false), fDirection(0.,0.,0.)
51 {}
52 
54 {}
55 
56 G4Fragment*
58  G4double newExcEnergy,
59  G4double mpRatio,
60  G4int JP1,
61  G4int JP2,
62  G4int MP,
63  size_t shell,
64  G4bool isDiscrete,
65  G4bool isGamma,
66  G4bool isLongLived)
67 {
68  G4Fragment* result = nullptr;
69  G4double bond_energy = 0.;
70 
71  if (!isGamma) {
72  G4int Z = nucleus->GetZ_asInt();
73  if(Z <= 100) {
74  G4int idx = (G4int)shell;
76  bond_energy = G4AtomicShells::GetBindingEnergy(Z, idx);
77  }
78  }
79  G4double etrans = nucleus->GetExcitationEnergy() - newExcEnergy
80  - bond_energy;
81  // G4cout << "G4GammaTransition::GenerateGamma - Etrans(MeV)= "
82  // << etrans << " Eexnew= " << newExcEnergy
83  // << " Ebond= " << bond_energy << G4endl;
84  if(etrans <= 0.0) {
85  etrans += bond_energy;
86  bond_energy = 0.0;
87  }
88 
89  // Do complete Lorentz computation
90  G4LorentzVector lv = nucleus->GetMomentum();
91  G4double mass = nucleus->GetGroundStateMass() + newExcEnergy;
92 
93  // select secondary
95 
96  if(isGamma) { part = G4Gamma::Gamma(); }
97  else {
98  part = G4Electron::Electron();
99  G4int ne = std::max(nucleus->GetNumberOfElectrons() - 1, 0);
100  nucleus->SetNumberOfElectrons(ne);
101  lv += G4LorentzVector(0.0,0.0,0.0,
102  CLHEP::electron_mass_c2 - bond_energy);
103  }
104  /*
105  G4cout << "New GammaTransition: polarFlag: " << polarFlag
106  << " isDiscrete: " << isDiscrete << " isGamma: " << isGamma
107  << " isLongLived: " << isLongLived << G4endl;
108  */
109  if(polarFlag && isDiscrete && isGamma && !isLongLived) {
110  SampleDirection(nucleus, mpRatio, JP1, JP2, MP);
111  } else {
113  }
114 
115  G4double emass = part->GetPDGMass();
116 
117  // 2-body decay in rest frame
118  G4double ecm = lv.mag();
119  G4ThreeVector bst = lv.boostVector();
120 
121  //G4cout << "Ecm= " << ecm << " mass= " << mass << " emass= " << emass
122  // << " isLongLived: " << isLongLived << G4endl;
123 
124  G4double energy = 0.5*((ecm - mass)*(ecm + mass) + emass*emass)/ecm;
125  energy = std::max(energy, emass);
126 
127  G4double mom = std::sqrt((energy - emass)*(energy + emass));
128 
129  G4LorentzVector res4mom(mom * fDirection.x(),
130  mom * fDirection.y(),
131  mom * fDirection.z(), energy);
132 
133  // Lab system transform for short lived level
134  if(!isLongLived) {
135  res4mom.boost(bst);
136  lv -= res4mom;
137  } else {
138  // In exceptional case sample decay at rest at not correct position
139  // of stopping ion, 4-momentum balance is breaked but gamma energy
140  // is correct
141  lv -= res4mom;
142  G4double E = lv.e();
143  G4double P2= (E - mass)*(E + mass);
144  G4ThreeVector v = lv.vect().unit();
145  G4double p = 0.0;
146  if(P2 > 0.0) { p = std::sqrt(P2); }
147  else { E = mass; }
148  lv.set(v.x()*p, v.y()*p, v.z()*p, E);
149  }
150 
151  // modified primary fragment
152  nucleus->SetMomentum(lv);
153 
154  // gamma or e- are produced
155  result = new G4Fragment(res4mom, part);
156 
157  // G4cout << " DeltaE= " << e0 - lv.e() - res4mom.e() << G4endl;
158  //G4cout << "G4GammaTransition::GenerateGamma : " << thePhoton << G4endl;
159  //G4cout << " Left nucleus: " << aNucleus << G4endl;
160  return result;
161 }
162 
164  G4int twoJ1, G4int twoJ2, G4int mp)
165 {
166  //G4cout << "G4GammaTransition::SampleDirection" << G4endl;
168 
169  // initial state is non-polarized - create polarization
170  if(!np) {
171  np = new G4NuclearPolarization();
172  nuc->SetNuclearPolarization(np);
175  return;
176  }
177 
178  // PhotonEvaporation dataset:
179  // The multipolarity number with 1,2,3,4,5,6,7 representing E1,M1,E2,M2,E3,M3
180  // monopole transition and 100*Nx+Ny representing multipolarity transition with
181  // Ny and Ny taking the value 1,2,3,4,5,6,7 referring to E1,M1,E2,M2,E3,M3,..
182  // For example a M1+E2 transition would be written 203.
183  //
184  // In M1+E2, M1 is the primary transition (L) and E2 is the secondary (L')
185  // So mp = 203 means L0 = 1, Lp = 2 while mp = 2 means L0 = 1, Lp = 0
186  G4int L0 = 0, Lp = 0;
187  if(mp >= 100) {
188  L0 = mp / 200;
189  Lp = (mp - 200*L0)/2;
190 
191  } else {
192  L0 = mp / 2;
193  //if(ratio != 0.0) {
194  // G4cout << "Warning: Got ratio = " << ratio
195  // << " when 0 was expected... Setting to zero." << G4endl;
196  ratio = 0.;
197  }
198 
199  fPolTrans.SetGammaTransitionData(twoJ1, twoJ2, L0, ratio, Lp);
200 
202  G4double phi = fPolTrans.GenerateGammaPhi(cosTheta, np->GetPolarization());
203  fPolTrans.UpdatePolarizationToFinalState(cosTheta, phi, nuc);
204 
205  G4double sinTheta = std::sqrt((1.-cosTheta)*(1.+cosTheta));
206  fDirection.set(sinTheta*std::cos(phi),sinTheta*std::sin(phi),cosTheta);
207 }
CLHEP::Hep3Vector G4ThreeVector
virtual void SampleDirection(G4Fragment *nuc, G4double ratio, G4int twoJ1, G4int twoJ2, G4int mp)
G4ThreeVector fDirection
G4int GetNumberOfElectrons() const
Definition: G4Fragment.hh:379
G4double GenerateGammaPhi(G4double cosTheta, const POLAR &)
G4double GenerateGammaCosTheta(const POLAR &)
void SetNumberOfElectrons(G4int value)
Definition: G4Fragment.hh:384
G4ThreeVector G4RandomDirection()
int G4int
Definition: G4Types.hh:78
virtual ~G4GammaTransition()
void SetNuclearPolarization(G4NuclearPolarization *)
Definition: G4Fragment.hh:213
std::vector< std::vector< G4complex > > & GetPolarization()
bool G4bool
Definition: G4Types.hh:79
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
const G4LorentzVector & GetMomentum() const
Definition: G4Fragment.hh:289
void SetMomentum(const G4LorentzVector &value)
Definition: G4Fragment.hh:294
G4double GetGroundStateMass() const
Definition: G4Fragment.hh:278
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetGammaTransitionData(G4int twoJ1, G4int twoJ2, G4int Lbar, G4double delta=0, G4int Lprime=1)
virtual G4Fragment * SampleTransition(G4Fragment *nucleus, G4double newExcEnergy, G4double mpRatio, G4int JP1, G4int JP2, G4int MP, size_t shell, G4bool isDiscrete, G4bool isGamma, G4bool isLongLived)
G4double GetPDGMass() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double energy(const ThreeVector &p, const G4double m)
G4PolarizationTransition fPolTrans
void UpdatePolarizationToFinalState(G4double cosTheta, G4double phi, G4Fragment *)
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
G4int GetZ_asInt() const
Definition: G4Fragment.hh:261
static const G4double * P2[nN]
static G4Electron * Electron()
Definition: G4Electron.cc:94
double G4double
Definition: G4Types.hh:76
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:273
G4NuclearPolarization * GetNuclearPolarization() const
Definition: G4Fragment.hh:430
CLHEP::HepLorentzVector G4LorentzVector
static G4int GetNumberOfShells(G4int Z)