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

Last change on this file since 1340 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

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