Geant4 9.6.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// $Id$
27//
28// G4TransitionRadiation class -- implementation file
29
30// GEANT 4 class implementation file --- Copyright CERN 1995
31// CERN Geneva Switzerland
32
33// For information related to this code, please, contact
34// CERN, CN Division, ASD Group
35// History:
36// 1st version 11.09.97 V. Grichine ([email protected] )
37// 2nd version 16.12.97 V. Grichine
38// 3rd version 28.07.05, P.Gumplinger add G4ProcessType to constructor
39
40
41#include <cmath>
42
44#include "G4Material.hh"
45#include "G4EmProcessSubType.hh"
46
47// Local constants
48
52
53
54///////////////////////////////////////////////////////////////////////
55//
56// Constructor for selected couple of materials
57//
58
60G4TransitionRadiation( const G4String& processName, G4ProcessType type )
61 : G4VDiscreteProcess(processName, type)
62{
65
67}
68
69//////////////////////////////////////////////////////////////////////
70//
71// Destructor
72//
73
75{}
76
77G4bool
79{
80 return ( aParticleType.GetPDGCharge() != 0.0 );
81}
82
86{
88 return DBL_MAX; // so TR doesn't limit mean free path
89}
90
92 const G4Step&)
93{
95 return &aParticleChange;
96}
97
98///////////////////////////////////////////////////////////////////
99//
100// Sympson integral of TR spectral-angle density over energy between
101// the limits energy 1 and energy2 at fixed varAngle = 1 - std::cos(Theta)
102
105 G4double energy2,
106 G4double varAngle ) const
107{
108 G4int i ;
109 G4double h , sumEven = 0.0 , sumOdd = 0.0 ;
110 h = 0.5*(energy2 - energy1)/fSympsonNumber ;
111 for(i=1;i<fSympsonNumber;i++)
112 {
113 sumEven += SpectralAngleTRdensity(energy1 + 2*i*h,varAngle) ;
114 sumOdd += SpectralAngleTRdensity(energy1 + (2*i - 1)*h,varAngle) ;
115 }
116 sumOdd += SpectralAngleTRdensity(energy1 + (2*fSympsonNumber - 1)*h,varAngle) ;
117 return h*( SpectralAngleTRdensity(energy1,varAngle)
118 + SpectralAngleTRdensity(energy2,varAngle)
119 + 4.0*sumOdd + 2.0*sumEven )/3.0 ;
120}
121
122
123
124///////////////////////////////////////////////////////////////////
125//
126// Sympson integral of TR spectral-angle density over energy between
127// the limits varAngle1 and varAngle2 at fixed energy
128
131 G4double varAngle1,
132 G4double varAngle2 ) const
133{
134 G4int i ;
135 G4double h , sumEven = 0.0 , sumOdd = 0.0 ;
136 h = 0.5*(varAngle2 - varAngle1)/fSympsonNumber ;
137 for(i=1;i<fSympsonNumber;i++)
138 {
139 sumEven += SpectralAngleTRdensity(energy,varAngle1 + 2*i*h) ;
140 sumOdd += SpectralAngleTRdensity(energy,varAngle1 + (2*i - 1)*h) ;
141 }
142 sumOdd += SpectralAngleTRdensity(energy,varAngle1 + (2*fSympsonNumber - 1)*h) ;
143
144 return h*( SpectralAngleTRdensity(energy,varAngle1)
145 + SpectralAngleTRdensity(energy,varAngle2)
146 + 4.0*sumOdd + 2.0*sumEven )/3.0 ;
147}
148
149///////////////////////////////////////////////////////////////////
150//
151// The number of transition radiation photons generated in the
152// angle interval between varAngle1 and varAngle2
153//
154
157 G4double varAngle2 ) const
158{
159 G4int i ;
160 G4double h , sumEven = 0.0 , sumOdd = 0.0 ;
161 h = 0.5*(varAngle2 - varAngle1)/fSympsonNumber ;
162 for(i=1;i<fSympsonNumber;i++)
163 {
166 varAngle1 + 2*i*h)
169 varAngle1 + 2*i*h);
172 varAngle1 + (2*i - 1)*h)
175 varAngle1 + (2*i - 1)*h) ;
176 }
179 varAngle1 + (2*fSympsonNumber - 1)*h)
182 varAngle1 + (2*fSympsonNumber - 1)*h) ;
183
186 varAngle1)
189 varAngle1)
192 varAngle2)
195 varAngle2)
196 + 4.0*sumOdd + 2.0*sumEven )/3.0 ;
197}
198
199///////////////////////////////////////////////////////////////////
200//
201// The number of transition radiation photons, generated in the
202// energy interval between energy1 and energy2
203//
204
207 G4double energy2 ) const
208{
209 G4int i ;
210 G4double h , sumEven = 0.0 , sumOdd = 0.0 ;
211 h = 0.5*(energy2 - energy1)/fSympsonNumber ;
212 for(i=1;i<fSympsonNumber;i++)
213 {
214 sumEven += IntegralOverAngle(energy1 + 2*i*h,0.0,0.01*fMaxTheta )
215 + IntegralOverAngle(energy1 + 2*i*h,0.01*fMaxTheta,fMaxTheta);
216 sumOdd += IntegralOverAngle(energy1 + (2*i - 1)*h,0.0,0.01*fMaxTheta)
217 + IntegralOverAngle(energy1 + (2*i - 1)*h,0.01*fMaxTheta,fMaxTheta) ;
218 }
219 sumOdd += IntegralOverAngle(energy1 + (2*fSympsonNumber - 1)*h,
220 0.0,0.01*fMaxTheta)
221 + IntegralOverAngle(energy1 + (2*fSympsonNumber - 1)*h,
222 0.01*fMaxTheta,fMaxTheta) ;
223
224 return h*(IntegralOverAngle(energy1,0.0,0.01*fMaxTheta)
226 + IntegralOverAngle(energy2,0.0,0.01*fMaxTheta)
228 + 4.0*sumOdd + 2.0*sumEven )/3.0 ;
229}
230
231
232
233
234// end of G4TransitionRadiation implementation file --------------------------
@ fTransitionRadiation
G4double condition(const G4ErrorSymMatrix &m)
G4ForceCondition
@ Forced
G4ProcessType
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
G4double GetPDGCharge() const
Definition: G4Step.hh:78
static const G4int fGammaNumber
G4double EnergyIntegralDistribution(G4double energy1, G4double energy2) const
G4double GetMeanFreePath(const G4Track &, G4double, G4ForceCondition *condition)
static const G4int fPointNumber
G4double IntegralOverAngle(G4double energy, G4double varAngle1, G4double varAngle2) const
G4TransitionRadiation(const G4String &processName="TR", G4ProcessType type=fElectromagnetic)
virtual G4double SpectralAngleTRdensity(G4double energy, G4double varAngle) const =0
G4double IntegralOverEnergy(G4double energy1, G4double energy2, G4double varAngle) const
G4bool IsApplicable(const G4ParticleDefinition &aParticleType)
G4VParticleChange * PostStepDoIt(const G4Track &, const G4Step &)
static const G4int fSympsonNumber
G4double AngleIntegralDistribution(G4double varAngle1, G4double varAngle2) const
G4ParticleChange aParticleChange
Definition: G4VProcess.hh:289
void ClearNumberOfInteractionLengthLeft()
Definition: G4VProcess.hh:418
void SetProcessSubType(G4int)
Definition: G4VProcess.hh:403
#define DBL_MAX
Definition: templates.hh:83