Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4TransitionRadiation.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// G4TransitionRadiation class -- implementation file
27
28// GEANT 4 class implementation file --- Copyright CERN 1995
29
30// For information related to this code, please, contact
31// CERN, CN Division, ASD Group
32// History:
33// 1st version 11.09.97 V. Grichine (Vladimir.Grichine@cern.ch )
34// 2nd version 16.12.97 V. Grichine
35// 3rd version 28.07.05, P.Gumplinger add G4ProcessType to constructor
36
37//#include <cmath>
38
40
41#include "G4EmProcessSubType.hh"
42
43///////////////////////////////////////////////////////////////////////
44// Constructor for selected couple of materials
46 G4ProcessType type)
47 : G4VDiscreteProcess(processName, type)
48{
51
53 fSigma1 = fSigma2 = 0.0;
54}
55
56//////////////////////////////////////////////////////////////////////
57// Destructor
59
60void G4TransitionRadiation::ProcessDescription(std::ostream& out) const
61{
62 out << "Base class for simulation of x-ray transition radiation.\n";
63}
64
66 const G4ParticleDefinition& aParticleType)
67{
68 return (aParticleType.GetPDGCharge() != 0.0);
69}
70
73{
75 return DBL_MAX; // so TR doesn't limit mean free path
76}
77
79 const G4Step&)
80{
82 return &aParticleChange;
83}
84
85///////////////////////////////////////////////////////////////////
86// Sympson integral of TR spectral-angle density over energy between
87// the limits energy 1 and energy2 at fixed varAngle = 1 - std::cos(Theta)
89 G4double energy2,
90 G4double varAngle) const
91{
92 G4int i;
93 G4double h, sumEven = 0.0, sumOdd = 0.0;
94 h = 0.5 * (energy2 - energy1) / fSympsonNumber;
95 for(i = 1; i < fSympsonNumber; i++)
96 {
97 sumEven += SpectralAngleTRdensity(energy1 + 2 * i * h, varAngle);
98 sumOdd += SpectralAngleTRdensity(energy1 + (2 * i - 1) * h, varAngle);
99 }
100 sumOdd +=
101 SpectralAngleTRdensity(energy1 + (2 * fSympsonNumber - 1) * h, varAngle);
102 return h *
103 (SpectralAngleTRdensity(energy1, varAngle) +
104 SpectralAngleTRdensity(energy2, varAngle) + 4.0 * sumOdd +
105 2.0 * sumEven) /
106 3.0;
107}
108
109///////////////////////////////////////////////////////////////////
110// Sympson integral of TR spectral-angle density over energy between
111// the limits varAngle1 and varAngle2 at fixed energy
113 G4double varAngle1,
114 G4double varAngle2) const
115{
116 G4int i;
117 G4double h, sumEven = 0.0, sumOdd = 0.0;
118 h = 0.5 * (varAngle2 - varAngle1) / fSympsonNumber;
119 for(i = 1; i < fSympsonNumber; ++i)
120 {
121 sumEven += SpectralAngleTRdensity(energy, varAngle1 + 2 * i * h);
122 sumOdd += SpectralAngleTRdensity(energy, varAngle1 + (2 * i - 1) * h);
123 }
124 sumOdd +=
125 SpectralAngleTRdensity(energy, varAngle1 + (2 * fSympsonNumber - 1) * h);
126
127 return h *
128 (SpectralAngleTRdensity(energy, varAngle1) +
129 SpectralAngleTRdensity(energy, varAngle2) + 4.0 * sumOdd +
130 2.0 * sumEven) /
131 3.0;
132}
133
134///////////////////////////////////////////////////////////////////
135// The number of transition radiation photons generated in the
136// angle interval between varAngle1 and varAngle2
138 G4double varAngle1, G4double varAngle2) const
139{
140 G4int i;
141 G4double h, sumEven = 0.0, sumOdd = 0.0;
142 h = 0.5 * (varAngle2 - varAngle1) / fSympsonNumber;
143 for(i = 1; i < fSympsonNumber; ++i)
144 {
146 fMinEnergy + 0.3 * (fMaxEnergy - fMinEnergy),
147 varAngle1 + 2 * i * h) +
149 fMaxEnergy, varAngle1 + 2 * i * h);
151 fMinEnergy + 0.3 * (fMaxEnergy - fMinEnergy),
152 varAngle1 + (2 * i - 1) * h) +
154 fMaxEnergy, varAngle1 + (2 * i - 1) * h);
155 }
156 sumOdd +=
158 varAngle1 + (2 * fSympsonNumber - 1) * h) +
160 varAngle1 + (2 * fSympsonNumber - 1) * h);
161
162 return h *
164 fMinEnergy + 0.3 * (fMaxEnergy - fMinEnergy),
165 varAngle1) +
167 fMaxEnergy, varAngle1) +
169 fMinEnergy + 0.3 * (fMaxEnergy - fMinEnergy),
170 varAngle2) +
172 fMaxEnergy, varAngle2) +
173 4.0 * sumOdd + 2.0 * sumEven) /
174 3.0;
175}
176
177///////////////////////////////////////////////////////////////////
178// The number of transition radiation photons, generated in the
179// energy interval between energy1 and energy2
181 G4double energy1, G4double energy2) const
182{
183 G4int i;
184 G4double h, sumEven = 0.0, sumOdd = 0.0;
185 h = 0.5 * (energy2 - energy1) / fSympsonNumber;
186 for(i = 1; i < fSympsonNumber; ++i)
187 {
188 sumEven +=
189 IntegralOverAngle(energy1 + 2 * i * h, 0.0, 0.01 * fMaxTheta) +
190 IntegralOverAngle(energy1 + 2 * i * h, 0.01 * fMaxTheta, fMaxTheta);
191 sumOdd +=
192 IntegralOverAngle(energy1 + (2 * i - 1) * h, 0.0, 0.01 * fMaxTheta) +
193 IntegralOverAngle(energy1 + (2 * i - 1) * h, 0.01 * fMaxTheta, fMaxTheta);
194 }
195 sumOdd += IntegralOverAngle(energy1 + (2 * fSympsonNumber - 1) * h, 0.0,
196 0.01 * fMaxTheta) +
197 IntegralOverAngle(energy1 + (2 * fSympsonNumber - 1) * h,
198 0.01 * fMaxTheta, fMaxTheta);
199
200 return h *
201 (IntegralOverAngle(energy1, 0.0, 0.01 * fMaxTheta) +
202 IntegralOverAngle(energy1, 0.01 * fMaxTheta, fMaxTheta) +
203 IntegralOverAngle(energy2, 0.0, 0.01 * fMaxTheta) +
204 IntegralOverAngle(energy2, 0.01 * fMaxTheta, fMaxTheta) +
205 4.0 * sumOdd + 2.0 * sumEven) /
206 3.0;
207}
@ fTransitionRadiation
G4double condition(const G4ErrorSymMatrix &m)
G4ForceCondition
@ Forced
G4ProcessType
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
G4double GetPDGCharge() const
Definition: G4Step.hh:62
static constexpr G4int fSympsonNumber
G4double EnergyIntegralDistribution(G4double energy1, G4double energy2) const
G4double IntegralOverAngle(G4double energy, G4double varAngle1, G4double varAngle2) const
virtual G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &) override
G4TransitionRadiation(const G4String &processName="TR", G4ProcessType type=fElectromagnetic)
virtual ~G4TransitionRadiation()
virtual G4double SpectralAngleTRdensity(G4double energy, G4double varAngle) const =0
G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
virtual void ProcessDescription(std::ostream &) const override
G4double IntegralOverEnergy(G4double energy1, G4double energy2, G4double varAngle) const
G4double AngleIntegralDistribution(G4double varAngle1, G4double varAngle2) const
virtual G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *condition) override
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:331
void ClearNumberOfInteractionLengthLeft()
Definition: G4VProcess.hh:428
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:410
#define DBL_MAX
Definition: templates.hh:62