Geant4  10.02.p03
G4GammaTransition Class Reference

#include <G4GammaTransition.hh>

Inheritance diagram for G4GammaTransition:
Collaboration diagram for G4GammaTransition:

Public Member Functions

 G4GammaTransition ()
 
virtual ~G4GammaTransition ()
 
virtual G4FragmentSampleTransition (G4Fragment *nucleus, G4double newExcEnergy, G4int deltaS, size_t shell, G4bool isGamma, G4bool isLongLived)
 

Private Member Functions

 G4GammaTransition (const G4GammaTransition &right)
 
const G4GammaTransitionoperator= (const G4GammaTransition &right)
 
G4bool operator== (const G4GammaTransition &right) const
 
G4bool operator!= (const G4GammaTransition &right) const
 

Detailed Description

Definition at line 50 of file G4GammaTransition.hh.

Constructor & Destructor Documentation

◆ G4GammaTransition() [1/2]

G4GammaTransition::G4GammaTransition ( )

Definition at line 48 of file G4GammaTransition.cc.

49 {}

◆ ~G4GammaTransition()

G4GammaTransition::~G4GammaTransition ( )
virtual

Definition at line 51 of file G4GammaTransition.cc.

52 {}

◆ G4GammaTransition() [2/2]

G4GammaTransition::G4GammaTransition ( const G4GammaTransition right)
private

Member Function Documentation

◆ operator!=()

G4bool G4GammaTransition::operator!= ( const G4GammaTransition right) const
private

◆ operator=()

const G4GammaTransition& G4GammaTransition::operator= ( const G4GammaTransition right)
private

◆ operator==()

G4bool G4GammaTransition::operator== ( const G4GammaTransition right) const
private

◆ SampleTransition()

G4Fragment * G4GammaTransition::SampleTransition ( G4Fragment nucleus,
G4double  newExcEnergy,
G4int  deltaS,
size_t  shell,
G4bool  isGamma,
G4bool  isLongLived 
)
virtual

Reimplemented in G4PolarizedGammaTransition.

Definition at line 55 of file G4GammaTransition.cc.

60 {
61  G4Fragment* result = 0;
62  G4double bond_energy = 0.;
63 
64  if (!isGamma) {
65  G4int Z = nucleus->GetZ_asInt();
66  if(Z <= 100) {
67  G4int idx = (G4int)shell;
69  bond_energy = G4AtomicShells::GetBindingEnergy(Z, idx);
70  }
71  }
72  G4double etrans = nucleus->GetExcitationEnergy() - newExcEnergy
73  - bond_energy;
74  // G4cout << "G4GammaTransition::GenerateGamma - Etrans(MeV)= "
75  // << etrans << " Eexnew= " << newExcEnergy
76  // << " Ebond= " << bond_energy << G4endl;
77  if(etrans <= 0.0) {
78  etrans += bond_energy;
79  bond_energy = 0.0;
80  }
81 
82  // Do complete Lorentz computation
83  G4LorentzVector lv = nucleus->GetMomentum();
84  G4double mass = nucleus->GetGroundStateMass() + newExcEnergy;
85 
86  //G4double e0 = lv.e();
87 
88  // select secondary
90 
91  if(isGamma) { part = G4Gamma::Gamma(); }
92  else {
93  part = G4Electron::Electron();
94  G4int ne = nucleus->GetNumberOfElectrons() - 1;
95  if(ne < 0) { ne = 0; }
96  nucleus->SetNumberOfElectrons(ne);
97  lv += G4LorentzVector(0.0,0.0,0.0,
98  CLHEP::electron_mass_c2 - bond_energy);
99  }
100 
101  G4double cosTheta = 1. - 2. * G4UniformRand();
102  G4double sinTheta = std::sqrt(1. - cosTheta * cosTheta);
103  G4double phi = twopi * G4UniformRand();
104 
105  G4double emass = part->GetPDGMass();
106 
107  // 2-body decay in rest frame
108  G4double ecm = lv.mag();
109  G4ThreeVector bst = lv.boostVector();
110 
111  //G4cout << "Ecm= " << ecm << " mass= " << mass << " emass= " << emass
112  // << " isLongLived: " << isLongLived << G4endl;
113 
114  G4double energy = 0.5*((ecm - mass)*(ecm + mass) + emass*emass)/ecm;
115  energy = std::max(energy, emass);
116 
117  G4double mom = std::sqrt((energy - emass)*(energy + emass));
118 
119  G4LorentzVector res4mom(mom * sinTheta * std::cos(phi),
120  mom * sinTheta * std::sin(phi),
121  mom * cosTheta, energy);
122 
123  // Lab system transform for short lived level
124  if(!isLongLived) {
125  res4mom.boost(bst);
126  lv -= res4mom;
127  } else {
128  // In exceptional case sample decay at rest at not correct position
129  // of stopping ion, 4-momentum balance is breaked but gamma energy
130  // is correct
131  lv -= res4mom;
132  G4double E = lv.e();
133  G4double P2= (E - mass)*(E + mass);
134  G4ThreeVector v = lv.vect().unit();
135  G4double p = 0.0;
136  if(P2 > 0.0) { p = std::sqrt(P2); }
137  else { E = mass; }
138  lv.set(v.x()*p, v.y()*p, v.z()*p, E);
139  }
140 
141  // modified primary fragment
142  nucleus->SetMomentum(lv);
143 
144  // gamma or e- are produced
145  result = new G4Fragment(res4mom, part);
146 
147  // G4cout << " DeltaE= " << e0 - lv.e() - res4mom.e() << G4endl;
148  //G4cout << "G4GammaTransition::GenerateGamma : " << thePhoton << G4endl;
149  //G4cout << " Left nucleus: " << aNucleus << G4endl;
150  return result;
151 }
G4double GetExcitationEnergy() const
Definition: G4Fragment.hh:273
G4double GetGroundStateMass() const
Definition: G4Fragment.hh:278
void SetNumberOfElectrons(G4int value)
Definition: G4Fragment.hh:384
int G4int
Definition: G4Types.hh:78
Hep3Vector vect() const
#define G4UniformRand()
Definition: Randomize.hh:97
double energy
Definition: plottest35.C:25
G4int GetZ_asInt() const
Definition: G4Fragment.hh:261
Float_t Z
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
void SetMomentum(const G4LorentzVector &value)
Definition: G4Fragment.hh:294
Hep3Vector unit() const
static const double twopi
Definition: G4SIunits.hh:75
TString part[npart]
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
G4int GetNumberOfElectrons() const
Definition: G4Fragment.hh:379
double x() const
void set(double x, double y, double z, double t)
double y() const
const G4LorentzVector & GetMomentum() const
Definition: G4Fragment.hh:289
Hep3Vector boostVector() const
double z() const
static const G4double * P2[nN]
static G4Electron * Electron()
Definition: G4Electron.cc:94
double G4double
Definition: G4Types.hh:76
static const double electron_mass_c2
CLHEP::HepLorentzVector G4LorentzVector
static G4int GetNumberOfShells(G4int Z)
Here is the call graph for this function:
Here is the caller graph for this function:

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