Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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//
27// G4TransitionRadiation class -- implementation file
28
29// GEANT 4 class implementation file --- Copyright CERN 1995
30// CERN Geneva Switzerland
31
32// For information related to this code, please, contact
33// CERN, CN Division, ASD Group
34// History:
35// 1st version 11.09.97 V. Grichine ([email protected] )
36// 2nd version 16.12.97 V. Grichine
37// 3rd version 28.07.05, P.Gumplinger add G4ProcessType to constructor
38
39
40#include <cmath>
41
43#include "G4Material.hh"
44#include "G4EmProcessSubType.hh"
45
46// Local constants
47
51
52
53///////////////////////////////////////////////////////////////////////
54//
55// Constructor for selected couple of materials
56//
57
59G4TransitionRadiation( const G4String& processName, G4ProcessType type )
60 : G4VDiscreteProcess(processName, type)
61{
64
66}
67
68//////////////////////////////////////////////////////////////////////
69//
70// Destructor
71//
72
74{}
75
76G4bool
78{
79 return ( aParticleType.GetPDGCharge() != 0.0 );
80}
81
85{
87 return DBL_MAX; // so TR doesn't limit mean free path
88}
89
91 const G4Step&)
92{
94 return &aParticleChange;
95}
96
97///////////////////////////////////////////////////////////////////
98//
99// Sympson integral of TR spectral-angle density over energy between
100// the limits energy 1 and energy2 at fixed varAngle = 1 - std::cos(Theta)
101
104 G4double energy2,
105 G4double varAngle ) const
106{
107 G4int i ;
108 G4double h , sumEven = 0.0 , sumOdd = 0.0 ;
109 h = 0.5*(energy2 - energy1)/fSympsonNumber ;
110 for(i=1;i<fSympsonNumber;i++)
111 {
112 sumEven += SpectralAngleTRdensity(energy1 + 2*i*h,varAngle) ;
113 sumOdd += SpectralAngleTRdensity(energy1 + (2*i - 1)*h,varAngle) ;
114 }
115 sumOdd += SpectralAngleTRdensity(energy1 + (2*fSympsonNumber - 1)*h,varAngle) ;
116 return h*( SpectralAngleTRdensity(energy1,varAngle)
117 + SpectralAngleTRdensity(energy2,varAngle)
118 + 4.0*sumOdd + 2.0*sumEven )/3.0 ;
119}
120
121
122
123///////////////////////////////////////////////////////////////////
124//
125// Sympson integral of TR spectral-angle density over energy between
126// the limits varAngle1 and varAngle2 at fixed energy
127
130 G4double varAngle1,
131 G4double varAngle2 ) const
132{
133 G4int i ;
134 G4double h , sumEven = 0.0 , sumOdd = 0.0 ;
135 h = 0.5*(varAngle2 - varAngle1)/fSympsonNumber ;
136 for(i=1;i<fSympsonNumber;i++)
137 {
138 sumEven += SpectralAngleTRdensity(energy,varAngle1 + 2*i*h) ;
139 sumOdd += SpectralAngleTRdensity(energy,varAngle1 + (2*i - 1)*h) ;
140 }
141 sumOdd += SpectralAngleTRdensity(energy,varAngle1 + (2*fSympsonNumber - 1)*h) ;
142
143 return h*( SpectralAngleTRdensity(energy,varAngle1)
144 + SpectralAngleTRdensity(energy,varAngle2)
145 + 4.0*sumOdd + 2.0*sumEven )/3.0 ;
146}
147
148///////////////////////////////////////////////////////////////////
149//
150// The number of transition radiation photons generated in the
151// angle interval between varAngle1 and varAngle2
152//
153
156 G4double varAngle2 ) const
157{
158 G4int i ;
159 G4double h , sumEven = 0.0 , sumOdd = 0.0 ;
160 h = 0.5*(varAngle2 - varAngle1)/fSympsonNumber ;
161 for(i=1;i<fSympsonNumber;i++)
162 {
165 varAngle1 + 2*i*h)
168 varAngle1 + 2*i*h);
171 varAngle1 + (2*i - 1)*h)
174 varAngle1 + (2*i - 1)*h) ;
175 }
178 varAngle1 + (2*fSympsonNumber - 1)*h)
181 varAngle1 + (2*fSympsonNumber - 1)*h) ;
182
185 varAngle1)
188 varAngle1)
191 varAngle2)
194 varAngle2)
195 + 4.0*sumOdd + 2.0*sumEven )/3.0 ;
196}
197
198///////////////////////////////////////////////////////////////////
199//
200// The number of transition radiation photons, generated in the
201// energy interval between energy1 and energy2
202//
203
206 G4double energy2 ) const
207{
208 G4int i ;
209 G4double h , sumEven = 0.0 , sumOdd = 0.0 ;
210 h = 0.5*(energy2 - energy1)/fSympsonNumber ;
211 for(i=1;i<fSympsonNumber;i++)
212 {
213 sumEven += IntegralOverAngle(energy1 + 2*i*h,0.0,0.01*fMaxTheta )
214 + IntegralOverAngle(energy1 + 2*i*h,0.01*fMaxTheta,fMaxTheta);
215 sumOdd += IntegralOverAngle(energy1 + (2*i - 1)*h,0.0,0.01*fMaxTheta)
216 + IntegralOverAngle(energy1 + (2*i - 1)*h,0.01*fMaxTheta,fMaxTheta) ;
217 }
218 sumOdd += IntegralOverAngle(energy1 + (2*fSympsonNumber - 1)*h,
219 0.0,0.01*fMaxTheta)
220 + IntegralOverAngle(energy1 + (2*fSympsonNumber - 1)*h,
221 0.01*fMaxTheta,fMaxTheta) ;
222
223 return h*(IntegralOverAngle(energy1,0.0,0.01*fMaxTheta)
225 + IntegralOverAngle(energy2,0.0,0.01*fMaxTheta)
227 + 4.0*sumOdd + 2.0*sumEven )/3.0 ;
228}
229
230// end of G4TransitionRadiation implementation file --------------------------
@ 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 const G4int fGammaNumber
G4double EnergyIntegralDistribution(G4double energy1, G4double energy2) const
static const G4int fPointNumber
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 G4double SpectralAngleTRdensity(G4double energy, G4double varAngle) const =0
G4bool IsApplicable(const G4ParticleDefinition &aParticleType) override
G4double IntegralOverEnergy(G4double energy1, G4double energy2, G4double varAngle) const
static const G4int fSympsonNumber
G4double AngleIntegralDistribution(G4double varAngle1, G4double varAngle2) const
virtual G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *condition) override
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:327
void ClearNumberOfInteractionLengthLeft()
Definition: G4VProcess.hh:424
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:406
#define DBL_MAX
Definition: templates.hh:62