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3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/xrays/src/G4StrawTubeXTRadiator.cc (Version 11.3.0) and /processes/electromagnetic/xrays/src/G4StrawTubeXTRadiator.cc (Version 9.4)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
                                                   >>  26 //
                                                   >>  27 // $Id: G4StrawTubeXTRadiator.cc,v 1.7 2010/06/16 15:34:15 gcosmo Exp $
                                                   >>  28 // GEANT4 tag $Name: geant4-09-04-beta-01 $
                                                   >>  29 //
 26                                                    30 
 27 #include "G4StrawTubeXTRadiator.hh"                31 #include "G4StrawTubeXTRadiator.hh"
 28                                                <<  32 #include "Randomize.hh"
 29 #include "G4Gamma.hh"                              33 #include "G4Gamma.hh"
 30 #include "G4PhysicalConstants.hh"              << 
 31 #include "G4SystemOfUnits.hh"                  << 
 32                                                    34 
 33 //////////////////////////////////////////////     35 ////////////////////////////////////////////////////////////////////////////
                                                   >>  36 //
 34 // Constructor, destructor                         37 // Constructor, destructor
 35 G4StrawTubeXTRadiator::G4StrawTubeXTRadiator(G <<  38 
 36                                              G <<  39 G4StrawTubeXTRadiator::G4StrawTubeXTRadiator(G4LogicalVolume *anEnvelope,
 37                                              G <<  40            G4Material* foilMat,G4Material* gasMat, 
 38                                              G <<  41                                          G4double a, G4double b, G4Material* mediumMat,
 39                                              G <<  42                                          G4bool unishut,
 40                                              c <<  43                                          const G4String& processName) :
 41   : G4VXTRenergyLoss(anEnvelope, foilMat, gasM <<  44   G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,1,processName)
 42 {                                                  45 {
 43   if(verboseLevel > 0)                             46   if(verboseLevel > 0)
 44     G4cout << "Straw tube X-ray TR  radiator E <<  47     G4cout<<"Straw tube X-ray TR  radiator EM process is called"<<G4endl;
 45                                                    48 
 46   if(unishut)                                  <<  49   if( unishut )
 47   {                                                50   {
 48     fAlphaPlate = 1. / 3.;                     <<  51     fAlphaPlate = 1./3.;
 49     fAlphaGas   = 12.4;                            52     fAlphaGas   = 12.4;
 50     if(verboseLevel > 0)                           53     if(verboseLevel > 0)
 51       G4cout << "straw uniform shooting: "     <<  54       G4cout<<"straw uniform shooting: "<<"fAlphaPlate = "
 52              << "fAlphaPlate = " << fAlphaPlat <<  55       <<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl;
 53              << " ; fAlphaGas = " << fAlphaGas <<  56 
 54   }                                                57   }
 55   else                                             58   else
 56   {                                                59   {
 57     fAlphaPlate = 0.5;                             60     fAlphaPlate = 0.5;
 58     fAlphaGas   = 5.;                              61     fAlphaGas   = 5.;
 59     if(verboseLevel > 0)                           62     if(verboseLevel > 0)
 60       G4cout << "straw isotropical shooting: " <<  63       G4cout<<"straw isotropical shooting: "<<"fAlphaPlate = "
 61              << "fAlphaPlate = " << fAlphaPlat <<  64       <<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl;
 62              << " ; fAlphaGas = " << fAlphaGas <<  65 
 63   }                                            << 
 64                                                    66 
                                                   >>  67   }
 65   // index of medium material                      68   // index of medium material
 66   fMatIndex3 = (G4int)mediumMat->GetIndex();   <<  69 
                                                   >>  70   fMatIndex3 = mediumMat->GetIndex();
 67   if(verboseLevel > 0)                             71   if(verboseLevel > 0)
 68     G4cout << "medium material = " << mediumMa <<  72     G4cout<<"medium material = "<<mediumMat->GetName()<<G4endl;
 69                                                    73 
 70   // plasma energy squared for plate material      74   // plasma energy squared for plate material
 71   fSigma3 = fPlasmaCof * mediumMat->GetElectro <<  75 
                                                   >>  76   fSigma3 = fPlasmaCof*mediumMat->GetElectronDensity();
 72   if(verboseLevel > 0)                             77   if(verboseLevel > 0)
 73     G4cout << "medium plasma energy = " << std <<  78     G4cout<<"medium plasma energy = "<<std::sqrt(fSigma3)/eV<<" eV"<<G4endl;
 74            << G4endl;                          << 
 75                                                    79 
 76   // Compute cofs for preparation of linear ph     80   // Compute cofs for preparation of linear photo absorption in external medium
                                                   >>  81 
 77   ComputeMediumPhotoAbsCof();                      82   ComputeMediumPhotoAbsCof();
                                                   >>  83 
                                                   >>  84   // Build energy and angular integral spectra of X-ray TR photons from
                                                   >>  85   // a radiator
                                                   >>  86 
                                                   >>  87   // BuildTable();
 78 }                                                  88 }
 79                                                    89 
 80 //////////////////////////////////////////////     90 ///////////////////////////////////////////////////////////////////////////
 81 G4StrawTubeXTRadiator::~G4StrawTubeXTRadiator( << 
 82                                                    91 
 83 void G4StrawTubeXTRadiator::ProcessDescription <<  92 G4StrawTubeXTRadiator::~G4StrawTubeXTRadiator()
 84 {                                                  93 {
 85   out << "Simulation of forward X-ray transiti << 
 86          "a straw tube radiator.\n";           << 
 87 }                                                  94 }
 88                                                    95 
 89 //////////////////////////////////////////////     96 ///////////////////////////////////////////////////////////////////////////
                                                   >>  97 //
 90 // Approximation for radiator interference fac     98 // Approximation for radiator interference factor for the case of
 91 // straw tube radiator. The plate (window, str <<  99 // straw tube radiator. The plate (window, straw wall) and gas (inside straw) 
 92 // gap thicknesses are gamma distributed.      << 100 // gap thicknesses are  gamma distributed.
 93 // The mean values of the plate and gas gap th << 101 // The mean values of the plate and gas gap thicknesses 
 94 // are supposed to be about XTR formation zone    102 // are supposed to be about XTR formation zone.
 95 G4double G4StrawTubeXTRadiator::GetStackFactor << 103 
 96                                                << 104 G4double 
                                                   >> 105 G4StrawTubeXTRadiator::GetStackFactor( G4double energy, 
                                                   >> 106                                          G4double gamma, G4double varAngle )
 97 {                                                 107 {
 98   G4double result, L2, L3, M2, M3;             << 
 99                                                   108 
100   L2 = GetPlateFormationZone(energy, gamma, va << 109 
101   L3 = GetGasFormationZone(energy, gamma, varA << 110   G4double result, L2, L3, M2, M3;
                                                   >> 111   
                                                   >> 112   L2 = GetPlateFormationZone(energy,gamma,varAngle);
                                                   >> 113   L3 = GetGasFormationZone(energy,gamma,varAngle);
102                                                   114 
103   M2 = GetPlateLinearPhotoAbs(energy);            115   M2 = GetPlateLinearPhotoAbs(energy);
104   M3 = GetGasLinearPhotoAbs(energy);              116   M3 = GetGasLinearPhotoAbs(energy);
105                                                   117 
106   G4complex C2(1.0 + 0.5 * fPlateThick * M2 /  << 118   G4complex C2(1.0 + 0.5*fPlateThick*M2/fAlphaPlate, fPlateThick/L2/fAlphaPlate); 
107                fPlateThick / L2 / fAlphaPlate) << 119   G4complex C3(1.0 + 0.5*fGasThick*M3/fAlphaGas, fGasThick/L3/fAlphaGas); 
108   G4complex C3(1.0 + 0.5 * fGasThick * M3 / fA << 
109                fGasThick / L3 / fAlphaGas);    << 
110                                                << 
111   G4complex H2 = std::pow(C2, -fAlphaPlate);   << 
112   G4complex H3 = std::pow(C3, -fAlphaGas);     << 
113   G4complex H  = H2 * H3;                      << 
114                                                << 
115   G4complex Z1 = GetMediumComplexFZ(energy, ga << 
116   G4complex Z2 = GetPlateComplexFZ(energy, gam << 
117   G4complex Z3 = GetGasComplexFZ(energy, gamma << 
118                                                << 
119   G4complex R = (Z1 - Z2) * (Z1 - Z2) * (1. -  << 
120                 (Z2 - Z3) * (Z2 - Z3) * (1. -  << 
121                 2. * (Z1 - Z2) * (Z2 - Z3) * H << 
122                                                   120 
123   result = 2.0 * std::real(R) * (varAngle * en << 121   G4complex H2 = std::pow(C2,-fAlphaPlate);  
                                                   >> 122   G4complex H3 = std::pow(C3,-fAlphaGas);
                                                   >> 123   G4complex H  = H2*H3;
                                                   >> 124 
                                                   >> 125   G4complex Z1 = GetMediumComplexFZ(energy,gamma,varAngle);
                                                   >> 126   G4complex Z2 = GetPlateComplexFZ(energy,gamma,varAngle);
                                                   >> 127   G4complex Z3 = GetGasComplexFZ(energy,gamma,varAngle);
                                                   >> 128 
                                                   >> 129 
                                                   >> 130   G4complex R  =    ( Z1 - Z2 )*( Z1 - Z2 )*( 1. - H2*H ) +
                                                   >> 131                     ( Z2 - Z3 )*( Z2 - Z3 )*( 1. - H3 )   + 
                                                   >> 132                  2.*( Z1 - Z2 )*( Z2 - Z3 )*H2*( 1. - H3 ) ;
                                                   >> 133 
                                                   >> 134   result       = 2.0*std::real(R)*(varAngle*energy/hbarc/hbarc);
                                                   >> 135   
                                                   >> 136   return      result;
124                                                   137 
125   return result;                               << 
126 }                                                 138 }
127                                                   139 
128 ////////////////////////////////////////////// << 140 
                                                   >> 141 //////////////////////////////////////////////////////////////////////
                                                   >> 142 //////////////////////////////////////////////////////////////////////
                                                   >> 143 //////////////////////////////////////////////////////////////////////
                                                   >> 144 //
129 // Calculates formation zone for external medi    145 // Calculates formation zone for external medium. Omega is energy !!!
130 G4double G4StrawTubeXTRadiator::GetMediumForma << 146 
131                                                << 147 G4double G4StrawTubeXTRadiator::GetMediumFormationZone( G4double omega ,
132                                                << 148                                                 G4double gamma ,
                                                   >> 149                                                 G4double varAngle    ) 
133 {                                                 150 {
134   G4double cof, lambda;                           151   G4double cof, lambda;
135   lambda = 1.0 / gamma / gamma + varAngle + fS << 152   lambda = 1.0/gamma/gamma + varAngle + fSigma3/omega/omega;
136   cof    = 2.0 * hbarc / omega / lambda;       << 153   cof = 2.0*hbarc/omega/lambda ;
137   return cof;                                  << 154   return cof ;
138 }                                                 155 }
139                                                   156 
140 ////////////////////////////////////////////// << 157 //////////////////////////////////////////////////////////////////////
                                                   >> 158 //
141 // Calculates complex formation zone for exter    159 // Calculates complex formation zone for external medium. Omega is energy !!!
142 G4complex G4StrawTubeXTRadiator::GetMediumComp << 160 
143                                                << 161 G4complex G4StrawTubeXTRadiator::GetMediumComplexFZ( G4double omega ,
144                                                << 162                                              G4double gamma ,
                                                   >> 163                                              G4double varAngle    ) 
145 {                                                 164 {
146   G4double cof, length, delta, real_v, image_v << 165   G4double cof, length,delta, real_v, image_v;
147                                                   166 
148   length = 0.5 * GetMediumFormationZone(omega, << 167   length = 0.5*GetMediumFormationZone(omega,gamma,varAngle);
149   delta  = length * GetMediumLinearPhotoAbs(om << 168   delta  = length*GetMediumLinearPhotoAbs(omega);
150   cof    = 1.0 / (1.0 + delta * delta);        << 169   cof    = 1.0/(1.0 + delta*delta);
151                                                   170 
152   real_v  = length * cof;                      << 171   real_v   = length*cof;
153   image_v = real_v * delta;                    << 172   image_v  = real_v*delta;
154                                                   173 
155   G4complex zone(real_v, image_v);             << 174   G4complex zone(real_v,image_v); 
156   return zone;                                    175   return zone;
157 }                                                 176 }
158                                                   177 
159 //////////////////////////////////////////////    178 ////////////////////////////////////////////////////////////////////////
                                                   >> 179 //
160 // Computes matrix of Sandia photo absorption     180 // Computes matrix of Sandia photo absorption cross section coefficients for
161 // medium material                                181 // medium material
162 void G4StrawTubeXTRadiator::ComputeMediumPhoto << 182 
                                                   >> 183 void G4StrawTubeXTRadiator::ComputeMediumPhotoAbsCof() 
163 {                                                 184 {
164   const G4MaterialTable* theMaterialTable = G4    185   const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
165   const G4Material* mat                   = (* << 186   const G4Material* mat = (*theMaterialTable)[fMatIndex3];
166   fMediumPhotoAbsCof                      = ma << 187   fMediumPhotoAbsCof = mat->GetSandiaTable();
167 }                                                 188 }
168                                                   189 
169 //////////////////////////////////////////////    190 //////////////////////////////////////////////////////////////////////
170 // Returns the value of linear photo absorptio << 191 //
                                                   >> 192 // Returns the value of linear photo absorption coefficient (in reciprocal 
171 // length) for medium for given energy of X-ra    193 // length) for medium for given energy of X-ray photon omega
172 G4double G4StrawTubeXTRadiator::GetMediumLinea << 194 
                                                   >> 195 G4double G4StrawTubeXTRadiator::GetMediumLinearPhotoAbs(G4double omega) 
173 {                                                 196 {
174   G4double omega2, omega3, omega4;             << 197   G4double omega2, omega3, omega4; 
175                                                   198 
176   omega2 = omega * omega;                      << 199   omega2 = omega*omega;
177   omega3 = omega2 * omega;                     << 200   omega3 = omega2*omega;
178   omega4 = omega2 * omega2;                    << 201   omega4 = omega2*omega2;
179                                                   202 
180   const G4double* SandiaCof =                  << 203   G4double* SandiaCof = fMediumPhotoAbsCof->GetSandiaCofForMaterial(omega);
181     fMediumPhotoAbsCof->GetSandiaCofForMateria << 
182                                                   204 
183   G4double cross = SandiaCof[0] / omega + Sand << 205   G4double cross = SandiaCof[0]/omega  + SandiaCof[1]/omega2 +
184                    SandiaCof[2] / omega3 + San << 206                    SandiaCof[2]/omega3 + SandiaCof[3]/omega4;
185   return cross;                                   207   return cross;
186 }                                                 208 }
                                                   >> 209 
                                                   >> 210 //
                                                   >> 211 //
                                                   >> 212 ////////////////////////////////////////////////////////////////////////////
                                                   >> 213 
                                                   >> 214 
                                                   >> 215 
                                                   >> 216 
                                                   >> 217 
                                                   >> 218 
                                                   >> 219 
                                                   >> 220 
187                                                   221