source: trunk/source/processes/electromagnetic/xrays/src/G4RegularXTRadiator.cc@ 1315

Last change on this file since 1315 was 1228, checked in by garnier, 16 years ago

update geant4.9.3 tag

File size: 5.5 KB
RevLine 
[819]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// $Id: G4RegularXTRadiator.cc,v 1.9 2006/06/29 19:56:09 gunter Exp $
[1228]28// GEANT4 tag $Name: geant4-09-03 $
[819]29//
30
31#include <complex>
32
33#include "G4RegularXTRadiator.hh"
34#include "Randomize.hh"
35
36#include "G4Gamma.hh"
37
38using namespace std;
39
40////////////////////////////////////////////////////////////////////////////
41//
42// Constructor, destructor
43
44G4RegularXTRadiator::G4RegularXTRadiator(G4LogicalVolume *anEnvelope,
45 G4Material* foilMat,G4Material* gasMat,
46 G4double a, G4double b, G4int n,
47 const G4String& processName) :
48 G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName)
49{
50 G4cout<<"Regular X-ray TR radiator EM process is called"<<G4endl ;
51
52 // Build energy and angular integral spectra of X-ray TR photons from
53 // a radiator
54
55 fAlphaPlate = 10000;
56 fAlphaGas = 1000;
57 G4cout<<"fAlphaPlate = "<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl ;
58
59 // BuildTable() ;
60}
61
62///////////////////////////////////////////////////////////////////////////
63
64G4RegularXTRadiator::~G4RegularXTRadiator()
65{
66 ;
67}
68
69
70
71///////////////////////////////////////////////////////////////////////////
72//
73// Approximation for radiator interference factor for the case of
74// fully Regular radiator. The plate and gas gap thicknesses are fixed .
75// The mean values of the plate and gas gap thicknesses
76// are supposed to be about XTR formation zones but much less than
77// mean absorption length of XTR photons in coresponding material.
78
79G4double
80G4RegularXTRadiator::GetStackFactor( G4double energy,
81 G4double gamma, G4double varAngle )
82{
83
84 // some gamma (10000/1000) like algorithm
85
86 G4double result, Za, Zb, Ma, Mb;
87
88 Za = GetPlateFormationZone(energy,gamma,varAngle);
89 Zb = GetGasFormationZone(energy,gamma,varAngle);
90
91 Ma = GetPlateLinearPhotoAbs(energy);
92 Mb = GetGasLinearPhotoAbs(energy);
93
94
95 G4complex Ca(1.0+0.5*fPlateThick*Ma/fAlphaPlate,fPlateThick/Za/fAlphaPlate);
96 G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas);
97
98 G4complex Ha = pow(Ca,-fAlphaPlate);
99 G4complex Hb = pow(Cb,-fAlphaGas);
100 G4complex H = Ha*Hb;
101
102 G4complex F1 = (1.0 - Ha)*(1.0 - Hb )/(1.0 - H)
103 * G4double(fPlateNumber);
104
105 G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H)
106 * (1.0 - pow(H,fPlateNumber));
107
108 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle);
109
110 result = 2.0*real(R);
111
112 return result;
113
114 /*
115 // numerically stable but slow algorithm
116
117 G4double result, Qa, Qb, Q, aZa, bZb, aMa, bMb; // , D;
118
119 aZa = fPlateThick/GetPlateFormationZone(energy,gamma,varAngle);
120 bZb = fGasThick/GetGasFormationZone(energy,gamma,varAngle);
121 aMa = fPlateThick*GetPlateLinearPhotoAbs(energy);
122 bMb = fGasThick*GetGasLinearPhotoAbs(energy);
123 Qa = exp(-aMa);
124 Qb = exp(-bMb);
125 Q = Qa*Qb;
126 G4complex Ha( exp(-0.5*aMa)*cos(aZa),
127 -exp(-0.5*aMa)*sin(aZa) );
128 G4complex Hb( exp(-0.5*bMb)*cos(bZb),
129 -exp(-0.5*bMb)*sin(bZb) );
130 G4complex H = Ha*Hb;
131
132 G4complex Hs = conj(H);
133 D = 1.0 /( (1 - sqrt(Q))*(1 - sqrt(Q)) +
134 4*sqrt(Q)*sin(0.5*(aZa+bZb))*sin(0.5*(aZa+bZb)) );
135 G4complex F1 = (1.0 - Ha)*(1.0 - Hb)*(1.0 - Hs)
136 * G4double(fPlateNumber)*D;
137 G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb*(1.0-Hs)*(1.0-Hs)
138 * (1.0 - pow(H,fPlateNumber)) * D*D;
139 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle);
140
141
142 G4complex S(0.,0.), c(1.,0.);
143 G4int k;
144 for(k = 1; k < fPlateNumber; k++)
145 {
146 c *= H;
147 S += ( G4double(fPlateNumber) - G4double(k) )*c;
148 }
149 G4complex R = (2.- Ha - 1./Ha)*S + (1. - Ha)*G4double(fPlateNumber);
150 R *= OneInterfaceXTRdEdx(energy,gamma,varAngle);
151 result = 2.0*real(R);
152 return result;
153 */
154}
155
156
157//
158//
159////////////////////////////////////////////////////////////////////////////
160
161
162
163
164
165
166
167
Note: See TracBrowser for help on using the repository browser.