Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4GammaTransition Class Reference

#include <G4GammaTransition.hh>

Public Member Functions

 G4GammaTransition ()
virtual ~G4GammaTransition ()
virtual G4FragmentSampleTransition (G4Fragment *nucleus, G4double newExcEnergy, G4double mpRatio, G4int JP1, G4int JP2, G4int MP, G4int shell, G4bool isDiscrete, G4bool isGamma)
virtual void SampleDirection (G4Fragment *nuc, G4double ratio, G4int twoJ1, G4int twoJ2, G4int mp)
void SetPolarizationFlag (G4bool val)
void SetTwoJMAX (G4int val)
void SetVerbose (G4int val)

Protected Attributes

G4ThreeVector fDirection
G4PolarizationTransition fPolTrans
G4int fTwoJMAX
G4int fVerbose

Detailed Description

Definition at line 52 of file G4GammaTransition.hh.

Constructor & Destructor Documentation

◆ G4GammaTransition()

G4GammaTransition::G4GammaTransition ( )
explicit

Definition at line 48 of file G4GammaTransition.cc.

49 : polarFlag(false), fDirection(0.,0.,0.), fTwoJMAX(10), fVerbose(0)
50{}
G4ThreeVector fDirection

◆ ~G4GammaTransition()

G4GammaTransition::~G4GammaTransition ( )
virtual

Definition at line 52 of file G4GammaTransition.cc.

53{}

Member Function Documentation

◆ SampleDirection()

void G4GammaTransition::SampleDirection ( G4Fragment * nuc,
G4double ratio,
G4int twoJ1,
G4int twoJ2,
G4int mp )
virtual

Definition at line 166 of file G4GammaTransition.cc.

168{
169 G4double cosTheta, phi;
170 G4NuclearPolarization* np = nuc->GetNuclearPolarization();
171 if(fVerbose > 2) {
172 G4cout << "G4GammaTransition::SampleDirection : 2J1= " << twoJ1
173 << " 2J2= " << twoJ2 << " ratio= " << ratio
174 << " mp= " << mp << G4endl;
175 G4cout << " Nucleus: " << *nuc << G4endl;
176 }
177 if(nullptr == np) {
178 cosTheta = 2*G4UniformRand() - 1.0;
179 phi = CLHEP::twopi*G4UniformRand();
180
181 } else {
182 // PhotonEvaporation dataset:
183 // The multipolarity number with 1,2,3,4,5,6,7 representing E0,E1,M1,E2,M2,E3,M3
184 // monopole transition and 100*Nx+Ny representing multipolarity transition with
185 // Ny and Ny taking the value 1,2,3,4,5,6,7 referring to E0,E1,M1,E2,M2,E3,M3,..
186 // For example a M1+E2 transition would be written 304.
187 // M1 is the primary transition (L) and E2 is the secondary (L')
188
189 G4double mpRatio = ratio;
190
191 G4int L0 = 0, Lp = 0;
192 if (mp > 99) {
193 L0 = mp/200;
194 Lp = (mp%100)/2;
195 } else {
196 L0 = mp/2;
197 Lp = 0;
198 mpRatio = 0.;
199 }
200 fPolTrans.SampleGammaTransition(np, twoJ1, twoJ2, L0, Lp, mpRatio, cosTheta, phi);
201 }
202
203 G4double sinTheta = std::sqrt((1.-cosTheta)*(1.+cosTheta));
204 fDirection.set(sinTheta*std::cos(phi),sinTheta*std::sin(phi),cosTheta);
205 if(fVerbose > 3) {
206 G4cout << "G4GammaTransition::SampleDirection done: " << fDirection << G4endl;
207 if(np) { G4cout << *np << G4endl; }
208 }
209}
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition Randomize.hh:52
G4PolarizationTransition fPolTrans

Referenced by SampleTransition().

◆ SampleTransition()

G4Fragment * G4GammaTransition::SampleTransition ( G4Fragment * nucleus,
G4double newExcEnergy,
G4double mpRatio,
G4int JP1,
G4int JP2,
G4int MP,
G4int shell,
G4bool isDiscrete,
G4bool isGamma )
virtual

Definition at line 56 of file G4GammaTransition.cc.

65{
66 G4Fragment* result = nullptr;
67 G4double bondEnergy = 0.0;
68 G4bool isGamma = gamma;
69 if (!isDiscrete) { isGamma = true; }
70
71 G4double excEnergy = nucleus->GetExcitationEnergy();
72
73 // check is IC electron can be emitted
74 if (!isGamma) {
75 if(0 <= shell) {
76 G4int Z = nucleus->GetZ_asInt();
77 if(Z <= 104) {
78 G4int idx = std::min(shell, G4AtomicShells::GetNumberOfShells(Z)-1);
79 bondEnergy = G4AtomicShells::GetBindingEnergy(Z, idx);
80 if (bondEnergy > excEnergy) {
81 isGamma = true;
82 }
83 } else {
84 isGamma = true;
85 }
86 } else {
87 isGamma = true;
88 }
89 }
90 if (fVerbose > 2) {
91 G4cout << "G4GammaTransition::GenerateGamma " << " Eexnew=" << newExcEnergy
92 << " Ebond=" << bondEnergy << G4endl;
93 }
94
95 // complete selection of secondary
96 G4ParticleDefinition* part;
97 G4int ne = nucleus->GetNumberOfElectrons();
98 if (0 == ne) { isGamma = true; }
99
100 if ( isGamma ) { part = G4Gamma::Gamma(); }
101 else {
102 part = G4Electron::Electron();
103 --ne;
104 nucleus->SetNumberOfElectrons(ne);
105 }
106
107 if (isGamma && polarFlag && isDiscrete && JP1 <= fTwoJMAX) {
108 SampleDirection(nucleus, mpRatio, JP1, JP2, MP);
109 } else {
111 }
112
113 // 4-vector of initial fragnet
114 G4LorentzVector lv = nucleus->GetMomentum();
115
116 // kinematics of the decay
117 G4double emass = part->GetPDGMass();
118 G4double m0 = nucleus->GetGroundStateMass() + excEnergy;
119 G4double m1 = nucleus->GetGroundStateMass() + newExcEnergy;
120 if (!isGamma) {
121 m0 += (ne + 1)*CLHEP::electron_mass_c2 - bondEnergy;
122 m1 += ne*CLHEP::electron_mass_c2;
123 }
124
125 // 2-body decay in rest frame
126 const G4double elim2 = 100.*CLHEP::eV*CLHEP::eV;
127 G4bool atRest = (lv.vect().mag2() < elim2);
128 G4ThreeVector bst(0.0, 0.0, 0.0);
129 if (!atRest) { bst = lv.boostVector(); }
130
131 //G4cout << "Ecm= " << ecm << " mass= " << mass << " emass= " << emass << G4endl;
132
133 G4double energy = 0.5*((m0 - m1)*(m0 + m1) + emass*emass)/m0;
134 G4double mom = (isGamma) ? energy : std::sqrt((energy - emass)*(energy + emass));
135
136 // emitted gamma or e-
137 G4LorentzVector res4mom(mom * fDirection.x(),
138 mom * fDirection.y(),
139 mom * fDirection.z(), energy);
140 // residual
141 energy = m0 - energy;
142 mom = std::sqrt((energy - m1)*(energy + m1));
143 lv.set(-mom*fDirection.x(), -mom*fDirection.y(), -mom*fDirection.z(), energy);
144
145 // Lab system transform for short lived level
146 if (!atRest) {
147 lv.boost(bst);
148 res4mom.boost(bst);
149 }
150
151 // modified primary fragment
152 nucleus->SetExcEnergyAndMomentum(newExcEnergy, lv);
153
154 // gamma or e- are produced
155 result = new G4Fragment(res4mom, part);
156
157 //G4cout << " DeltaE= " << e0 - lv.e() - res4mom.e() + emass
158 // << " Emass= " << emass << G4endl;
159 if(fVerbose > 2) {
160 G4cout << "G4GammaTransition::SampleTransition : " << *result << G4endl;
161 G4cout << " Left nucleus: " << *nucleus << G4endl;
162 }
163 return result;
164}
CLHEP::HepLorentzVector G4LorentzVector
G4ThreeVector G4RandomDirection()
CLHEP::Hep3Vector G4ThreeVector
bool G4bool
Definition G4Types.hh:86
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
Hep3Vector vect() const
void set(double x, double y, double z, double t)
static G4double GetBindingEnergy(G4int Z, G4int SubshellNb)
static G4int GetNumberOfShells(G4int Z)
static G4Electron * Electron()
Definition G4Electron.cc:91
virtual void SampleDirection(G4Fragment *nuc, G4double ratio, G4int twoJ1, G4int twoJ2, G4int mp)
static G4Gamma * Gamma()
Definition G4Gamma.cc:81
G4double energy(const ThreeVector &p, const G4double m)

◆ SetPolarizationFlag()

void G4GammaTransition::SetPolarizationFlag ( G4bool val)
inline

Definition at line 73 of file G4GammaTransition.hh.

73{ polarFlag = val; };

◆ SetTwoJMAX()

void G4GammaTransition::SetTwoJMAX ( G4int val)
inline

Definition at line 75 of file G4GammaTransition.hh.

75{ fTwoJMAX = val; };

◆ SetVerbose()

void G4GammaTransition::SetVerbose ( G4int val)
inline

Definition at line 77 of file G4GammaTransition.hh.

77{ fVerbose = val; fPolTrans.SetVerbose(val); };

Member Data Documentation

◆ fDirection

G4ThreeVector G4GammaTransition::fDirection
protected

Definition at line 90 of file G4GammaTransition.hh.

Referenced by G4GammaTransition(), SampleDirection(), and SampleTransition().

◆ fPolTrans

G4PolarizationTransition G4GammaTransition::fPolTrans
protected

Definition at line 91 of file G4GammaTransition.hh.

Referenced by SampleDirection(), and SetVerbose().

◆ fTwoJMAX

G4int G4GammaTransition::fTwoJMAX
protected

Definition at line 92 of file G4GammaTransition.hh.

Referenced by G4GammaTransition(), SampleTransition(), and SetTwoJMAX().

◆ fVerbose

G4int G4GammaTransition::fVerbose
protected

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