Geant4 Cross Reference |
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 68037 2013-03-13 14:15:08Z gcosmo $ >> 28 // 26 29 27 #include "G4StrawTubeXTRadiator.hh" 30 #include "G4StrawTubeXTRadiator.hh" 28 << 29 #include "G4Gamma.hh" << 30 #include "G4PhysicalConstants.hh" 31 #include "G4PhysicalConstants.hh" 31 #include "G4SystemOfUnits.hh" 32 #include "G4SystemOfUnits.hh" >> 33 #include "Randomize.hh" >> 34 #include "G4Gamma.hh" 32 35 33 ////////////////////////////////////////////// 36 //////////////////////////////////////////////////////////////////////////// >> 37 // 34 // Constructor, destructor 38 // Constructor, destructor 35 G4StrawTubeXTRadiator::G4StrawTubeXTRadiator(G << 39 36 G << 40 G4StrawTubeXTRadiator::G4StrawTubeXTRadiator(G4LogicalVolume *anEnvelope, 37 G << 41 G4Material* foilMat,G4Material* gasMat, 38 G << 42 G4double a, G4double b, G4Material* mediumMat, 39 G << 43 G4bool unishut, 40 c << 44 const G4String& processName) : 41 : G4VXTRenergyLoss(anEnvelope, foilMat, gasM << 45 G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,1,processName) 42 { 46 { 43 if(verboseLevel > 0) 47 if(verboseLevel > 0) 44 G4cout << "Straw tube X-ray TR radiator E << 48 G4cout<<"Straw tube X-ray TR radiator EM process is called"<<G4endl; 45 49 46 if(unishut) << 50 if( unishut ) 47 { 51 { 48 fAlphaPlate = 1. / 3.; << 52 fAlphaPlate = 1./3.; 49 fAlphaGas = 12.4; 53 fAlphaGas = 12.4; 50 if(verboseLevel > 0) 54 if(verboseLevel > 0) 51 G4cout << "straw uniform shooting: " << 55 G4cout<<"straw uniform shooting: "<<"fAlphaPlate = " 52 << "fAlphaPlate = " << fAlphaPlat << 56 <<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl; 53 << " ; fAlphaGas = " << fAlphaGas << 57 54 } 58 } 55 else 59 else 56 { 60 { 57 fAlphaPlate = 0.5; 61 fAlphaPlate = 0.5; 58 fAlphaGas = 5.; 62 fAlphaGas = 5.; 59 if(verboseLevel > 0) 63 if(verboseLevel > 0) 60 G4cout << "straw isotropical shooting: " << 64 G4cout<<"straw isotropical shooting: "<<"fAlphaPlate = " 61 << "fAlphaPlate = " << fAlphaPlat << 65 <<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl; 62 << " ; fAlphaGas = " << fAlphaGas << 63 } << 64 66 >> 67 >> 68 } 65 // index of medium material 69 // index of medium material 66 fMatIndex3 = (G4int)mediumMat->GetIndex(); << 70 >> 71 fMatIndex3 = mediumMat->GetIndex(); 67 if(verboseLevel > 0) 72 if(verboseLevel > 0) 68 G4cout << "medium material = " << mediumMa << 73 G4cout<<"medium material = "<<mediumMat->GetName()<<G4endl; 69 74 70 // plasma energy squared for plate material 75 // plasma energy squared for plate material 71 fSigma3 = fPlasmaCof * mediumMat->GetElectro << 76 >> 77 fSigma3 = fPlasmaCof*mediumMat->GetElectronDensity(); 72 if(verboseLevel > 0) 78 if(verboseLevel > 0) 73 G4cout << "medium plasma energy = " << std << 79 G4cout<<"medium plasma energy = "<<std::sqrt(fSigma3)/eV<<" eV"<<G4endl; 74 << G4endl; << 75 80 76 // Compute cofs for preparation of linear ph 81 // Compute cofs for preparation of linear photo absorption in external medium >> 82 77 ComputeMediumPhotoAbsCof(); 83 ComputeMediumPhotoAbsCof(); >> 84 >> 85 // Build energy and angular integral spectra of X-ray TR photons from >> 86 // a radiator >> 87 >> 88 // BuildTable(); 78 } 89 } 79 90 80 ////////////////////////////////////////////// 91 /////////////////////////////////////////////////////////////////////////// 81 G4StrawTubeXTRadiator::~G4StrawTubeXTRadiator( << 82 92 83 void G4StrawTubeXTRadiator::ProcessDescription << 93 G4StrawTubeXTRadiator::~G4StrawTubeXTRadiator() 84 { 94 { 85 out << "Simulation of forward X-ray transiti << 86 "a straw tube radiator.\n"; << 87 } 95 } 88 96 89 ////////////////////////////////////////////// 97 /////////////////////////////////////////////////////////////////////////// >> 98 // 90 // Approximation for radiator interference fac 99 // Approximation for radiator interference factor for the case of 91 // straw tube radiator. The plate (window, str << 100 // straw tube radiator. The plate (window, straw wall) and gas (inside straw) 92 // gap thicknesses are gamma distributed. << 101 // gap thicknesses are gamma distributed. 93 // The mean values of the plate and gas gap th << 102 // The mean values of the plate and gas gap thicknesses 94 // are supposed to be about XTR formation zone 103 // are supposed to be about XTR formation zone. 95 G4double G4StrawTubeXTRadiator::GetStackFactor << 104 96 << 105 G4double >> 106 G4StrawTubeXTRadiator::GetStackFactor( G4double energy, >> 107 G4double gamma, G4double varAngle ) 97 { 108 { 98 G4double result, L2, L3, M2, M3; << 99 109 100 L2 = GetPlateFormationZone(energy, gamma, va << 110 101 L3 = GetGasFormationZone(energy, gamma, varA << 111 G4double result, L2, L3, M2, M3; >> 112 >> 113 L2 = GetPlateFormationZone(energy,gamma,varAngle); >> 114 L3 = GetGasFormationZone(energy,gamma,varAngle); 102 115 103 M2 = GetPlateLinearPhotoAbs(energy); 116 M2 = GetPlateLinearPhotoAbs(energy); 104 M3 = GetGasLinearPhotoAbs(energy); 117 M3 = GetGasLinearPhotoAbs(energy); 105 118 106 G4complex C2(1.0 + 0.5 * fPlateThick * M2 / << 119 G4complex C2(1.0 + 0.5*fPlateThick*M2/fAlphaPlate, fPlateThick/L2/fAlphaPlate); 107 fPlateThick / L2 / fAlphaPlate) << 120 G4complex C3(1.0 + 0.5*fGasThick*M3/fAlphaGas, fGasThick/L3/fAlphaGas); 108 G4complex C3(1.0 + 0.5 * fGasThick * M3 / fA << 121 109 fGasThick / L3 / fAlphaGas); << 122 G4complex H2 = std::pow(C2,-fAlphaPlate); 110 << 123 G4complex H3 = std::pow(C3,-fAlphaGas); 111 G4complex H2 = std::pow(C2, -fAlphaPlate); << 124 G4complex H = H2*H3; 112 G4complex H3 = std::pow(C3, -fAlphaGas); << 125 113 G4complex H = H2 * H3; << 126 G4complex Z1 = GetMediumComplexFZ(energy,gamma,varAngle); 114 << 127 G4complex Z2 = GetPlateComplexFZ(energy,gamma,varAngle); 115 G4complex Z1 = GetMediumComplexFZ(energy, ga << 128 G4complex Z3 = GetGasComplexFZ(energy,gamma,varAngle); 116 G4complex Z2 = GetPlateComplexFZ(energy, gam << 129 117 G4complex Z3 = GetGasComplexFZ(energy, gamma << 130 118 << 131 G4complex R = ( Z1 - Z2 )*( Z1 - Z2 )*( 1. - H2*H ) + 119 G4complex R = (Z1 - Z2) * (Z1 - Z2) * (1. - << 132 ( Z2 - Z3 )*( Z2 - Z3 )*( 1. - H3 ) + 120 (Z2 - Z3) * (Z2 - Z3) * (1. - << 133 2.*( Z1 - Z2 )*( Z2 - Z3 )*H2*( 1. - H3 ) ; 121 2. * (Z1 - Z2) * (Z2 - Z3) * H << 122 134 123 result = 2.0 * std::real(R) * (varAngle * en << 135 result = 2.0*std::real(R)*(varAngle*energy/hbarc/hbarc); >> 136 >> 137 return result; 124 138 125 return result; << 126 } 139 } 127 140 128 ////////////////////////////////////////////// << 141 >> 142 ////////////////////////////////////////////////////////////////////// >> 143 ////////////////////////////////////////////////////////////////////// >> 144 ////////////////////////////////////////////////////////////////////// >> 145 // 129 // Calculates formation zone for external medi 146 // Calculates formation zone for external medium. Omega is energy !!! 130 G4double G4StrawTubeXTRadiator::GetMediumForma << 147 131 << 148 G4double G4StrawTubeXTRadiator::GetMediumFormationZone( G4double omega , 132 << 149 G4double gamma , >> 150 G4double varAngle ) 133 { 151 { 134 G4double cof, lambda; 152 G4double cof, lambda; 135 lambda = 1.0 / gamma / gamma + varAngle + fS << 153 lambda = 1.0/gamma/gamma + varAngle + fSigma3/omega/omega; 136 cof = 2.0 * hbarc / omega / lambda; << 154 cof = 2.0*hbarc/omega/lambda ; 137 return cof; << 155 return cof ; 138 } 156 } 139 157 140 ////////////////////////////////////////////// << 158 ////////////////////////////////////////////////////////////////////// >> 159 // 141 // Calculates complex formation zone for exter 160 // Calculates complex formation zone for external medium. Omega is energy !!! 142 G4complex G4StrawTubeXTRadiator::GetMediumComp << 161 143 << 162 G4complex G4StrawTubeXTRadiator::GetMediumComplexFZ( G4double omega , 144 << 163 G4double gamma , >> 164 G4double varAngle ) 145 { 165 { 146 G4double cof, length, delta, real_v, image_v << 166 G4double cof, length,delta, real_v, image_v; 147 167 148 length = 0.5 * GetMediumFormationZone(omega, << 168 length = 0.5*GetMediumFormationZone(omega,gamma,varAngle); 149 delta = length * GetMediumLinearPhotoAbs(om << 169 delta = length*GetMediumLinearPhotoAbs(omega); 150 cof = 1.0 / (1.0 + delta * delta); << 170 cof = 1.0/(1.0 + delta*delta); 151 171 152 real_v = length * cof; << 172 real_v = length*cof; 153 image_v = real_v * delta; << 173 image_v = real_v*delta; 154 174 155 G4complex zone(real_v, image_v); << 175 G4complex zone(real_v,image_v); 156 return zone; 176 return zone; 157 } 177 } 158 178 159 ////////////////////////////////////////////// 179 //////////////////////////////////////////////////////////////////////// >> 180 // 160 // Computes matrix of Sandia photo absorption 181 // Computes matrix of Sandia photo absorption cross section coefficients for 161 // medium material 182 // medium material 162 void G4StrawTubeXTRadiator::ComputeMediumPhoto << 183 >> 184 void G4StrawTubeXTRadiator::ComputeMediumPhotoAbsCof() 163 { 185 { 164 const G4MaterialTable* theMaterialTable = G4 186 const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable(); 165 const G4Material* mat = (* << 187 const G4Material* mat = (*theMaterialTable)[fMatIndex3]; 166 fMediumPhotoAbsCof = ma << 188 fMediumPhotoAbsCof = mat->GetSandiaTable(); 167 } 189 } 168 190 169 ////////////////////////////////////////////// 191 ////////////////////////////////////////////////////////////////////// 170 // Returns the value of linear photo absorptio << 192 // >> 193 // Returns the value of linear photo absorption coefficient (in reciprocal 171 // length) for medium for given energy of X-ra 194 // length) for medium for given energy of X-ray photon omega 172 G4double G4StrawTubeXTRadiator::GetMediumLinea << 195 >> 196 G4double G4StrawTubeXTRadiator::GetMediumLinearPhotoAbs(G4double omega) 173 { 197 { 174 G4double omega2, omega3, omega4; << 198 G4double omega2, omega3, omega4; 175 199 176 omega2 = omega * omega; << 200 omega2 = omega*omega; 177 omega3 = omega2 * omega; << 201 omega3 = omega2*omega; 178 omega4 = omega2 * omega2; << 202 omega4 = omega2*omega2; 179 203 180 const G4double* SandiaCof = << 204 const G4double* SandiaCof = fMediumPhotoAbsCof->GetSandiaCofForMaterial(omega); 181 fMediumPhotoAbsCof->GetSandiaCofForMateria << 182 205 183 G4double cross = SandiaCof[0] / omega + Sand << 206 G4double cross = SandiaCof[0]/omega + SandiaCof[1]/omega2 + 184 SandiaCof[2] / omega3 + San << 207 SandiaCof[2]/omega3 + SandiaCof[3]/omega4; 185 return cross; 208 return cross; 186 } 209 } >> 210 >> 211 // >> 212 // >> 213 //////////////////////////////////////////////////////////////////////////// >> 214 >> 215 >> 216 >> 217 >> 218 >> 219 >> 220 >> 221 187 222