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: G4TransparentRegXTRadiator.cc,v 1.12 2010-06-16 15:34:15 gcosmo Exp $ >> 28 // GEANT4 tag $Name: not supported by cvs2svn $ >> 29 // 26 30 27 #include "G4TransparentRegXTRadiator.hh" << 31 #include <complex> 28 32 29 #include "G4PhysicalConstants.hh" << 33 #include "G4TransparentRegXTRadiator.hh" >> 34 #include "Randomize.hh" >> 35 #include "G4Integrator.hh" >> 36 #include "G4Gamma.hh" 30 37 31 ////////////////////////////////////////////// 38 //////////////////////////////////////////////////////////////////////////// >> 39 // 32 // Constructor, destructor 40 // Constructor, destructor 33 G4TransparentRegXTRadiator::G4TransparentRegXT << 41 34 G4LogicalVolume* anEnvelope, G4Material* foi << 42 G4TransparentRegXTRadiator::G4TransparentRegXTRadiator(G4LogicalVolume *anEnvelope, 35 G4double a, G4double b, G4int n, const G4Str << 43 G4Material* foilMat,G4Material* gasMat, 36 : G4VXTRenergyLoss(anEnvelope, foilMat, gasM << 44 G4double a, G4double b, G4int n, >> 45 const G4String& processName) : >> 46 G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName) 37 { 47 { 38 if(verboseLevel > 0) 48 if(verboseLevel > 0) 39 G4cout << "Regular transparent X-ray TR r << 49 G4cout<<"Regular transparent X-ray TR radiator EM process is called"<<G4endl; 40 << G4endl; << 41 50 42 // Build energy and angular integral spectra 51 // Build energy and angular integral spectra of X-ray TR photons from 43 // a radiator 52 // a radiator 44 53 45 fAlphaPlate = 10000; 54 fAlphaPlate = 10000; 46 fAlphaGas = 1000; 55 fAlphaGas = 1000; >> 56 >> 57 // BuildTable(); 47 } 58 } 48 59 49 ////////////////////////////////////////////// 60 /////////////////////////////////////////////////////////////////////////// 50 G4TransparentRegXTRadiator::~G4TransparentRegX << 51 61 52 ////////////////////////////////////////////// << 62 G4TransparentRegXTRadiator::~G4TransparentRegXTRadiator() 53 void G4TransparentRegXTRadiator::ProcessDescri << 54 { 63 { 55 out << "Simulation of forward X-ray transiti << 64 ; 56 "relativistic charged particles cross << 57 "two materials.\n"; << 58 } 65 } 59 66 60 ////////////////////////////////////////////// 67 /////////////////////////////////////////////////////////////////////////// >> 68 // >> 69 // >> 70 61 G4double G4TransparentRegXTRadiator::SpectralX 71 G4double G4TransparentRegXTRadiator::SpectralXTRdEdx(G4double energy) 62 { 72 { 63 G4double result, sum = 0., tmp, cof1, cof2, << 73 G4double result, sum = 0., tmp, cof1, cof2, cofMin, cofPHC/*, aMa, bMb ,sigma*/; 64 G4int k, kMax, kMin; 74 G4int k, kMax, kMin; 65 75 66 cofPHC = 4. * pi * hbarc; << 76 //aMa = fPlateThick*GetPlateLinearPhotoAbs(energy); 67 tmp = (fSigma1 - fSigma2) / cofPHC / ener << 77 //bMb = fGasThick*GetGasLinearPhotoAbs(energy); 68 cof1 = fPlateThick * tmp; << 78 //sigma = aMa + bMb; 69 cof2 = fGasThick * tmp; << 79 >> 80 cofPHC = 4*pi*hbarc; >> 81 tmp = (fSigma1 - fSigma2)/cofPHC/energy; >> 82 cof1 = fPlateThick*tmp; >> 83 cof2 = fGasThick*tmp; 70 84 71 cofMin = energy * (fPlateThick + fGasThick) << 85 cofMin = energy*(fPlateThick + fGasThick)/fGamma/fGamma; 72 cofMin += (fPlateThick * fSigma1 + fGasThick << 86 cofMin += (fPlateThick*fSigma1 + fGasThick*fSigma2)/energy; 73 cofMin /= cofPHC; 87 cofMin /= cofPHC; 74 88 75 theta2 = cofPHC / (energy * (fPlateThick + f << 89 // if (fGamma < 1200) kMin = G4int(cofMin); // 1200 ? >> 90 // else kMin = 1; >> 91 76 92 77 kMin = G4int(cofMin); 93 kMin = G4int(cofMin); 78 if(cofMin > kMin) << 94 if (cofMin > kMin) kMin++; 79 kMin++; << 80 95 81 kMax = kMin + 49; << 96 // tmp = (fPlateThick + fGasThick)*energy*fMaxThetaTR; >> 97 // tmp /= cofPHC; >> 98 // kMax = G4int(tmp); >> 99 // if(kMax < 0) kMax = 0; >> 100 // kMax += kMin; >> 101 >> 102 >> 103 kMax = kMin + 19; // 9; // kMin + G4int(tmp); >> 104 >> 105 // tmp /= fGamma; >> 106 // if( G4int(tmp) < kMin ) kMin = G4int(tmp); >> 107 // G4cout<<"kMin = "<<kMin<<"; kMax = "<<kMax<<G4endl; 82 108 83 if(verboseLevel > 2) << 109 for( k = kMin; k <= kMax; k++ ) 84 { 110 { 85 G4cout << cof1 << " " << cof2 << " << 111 tmp = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick); 86 G4cout << "kMin = " << kMin << "; kMax << 112 result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2); 87 } << 113 // tmp = std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 88 for(k = kMin; k <= kMax; ++k) << 114 if( k == kMin && kMin == G4int(cofMin) ) 89 { << 90 tmp = pi * fPlateThick * (k + cof2) / ( << 91 result = (k - cof1) * (k - cof1) * (k + co << 92 if(k == kMin && kMin == G4int(cofMin)) << 93 { 115 { 94 sum += << 116 sum += 0.5*std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 95 0.5 * std::sin(tmp) * std::sin(tmp) * << 96 } 117 } 97 else 118 else 98 { 119 { 99 sum += std::sin(tmp) * std::sin(tmp) * s << 120 sum += std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result; 100 } 121 } 101 theta2k = std::sqrt(theta2 * std::abs(k - << 102 << 103 if(verboseLevel > 2) 122 if(verboseLevel > 2) 104 { << 123 { 105 G4cout << k << " " << theta2k << " << 124 G4cout<<"k = "<<k<<"; tmp = "<<std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result 106 << std::sin(tmp) * std::sin(tmp) << 125 <<"; sum = "<<sum<<G4endl; 107 << " " << sum << G4endl; << 126 } 108 } << 109 } 127 } 110 result = 4. * (cof1 + cof2) * (cof1 + cof2) << 128 result = 4*( cof1 + cof2 )*( cof1 + cof2 )*sum/energy; 111 result *= fPlateNumber; << 129 // result *= ( 1 - std::exp(-0.5*fPlateNumber*sigma) )/( 1 - std::exp(-0.5*sigma) ); 112 << 130 // fPlateNumber; >> 131 result *= fPlateNumber; // *std::exp(-0.5*fPlateNumber*sigma); >> 132 // +1-std::exp(-0.5*fPlateNumber*sigma); >> 133 /* >> 134 fEnergy = energy; >> 135 // G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral; >> 136 G4Integrator<G4TransparentRegXTRadiator,G4double(G4VXTRenergyLoss::*)(G4double)> integral; >> 137 >> 138 tmp = integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx, >> 139 0.0,0.3*fMaxThetaTR) + >> 140 integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx, >> 141 0.3*fMaxThetaTR,0.6*fMaxThetaTR) + >> 142 integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx, >> 143 0.6*fMaxThetaTR,fMaxThetaTR) ; >> 144 result += tmp; >> 145 */ 113 return result; 146 return result; 114 } 147 } 115 148 >> 149 116 ////////////////////////////////////////////// 150 /////////////////////////////////////////////////////////////////////////// >> 151 // 117 // Approximation for radiator interference fac 152 // Approximation for radiator interference factor for the case of 118 // fully Regular radiator. The plate and gas g << 153 // fully Regular radiator. The plate and gas gap thicknesses are fixed . 119 // The mean values of the plate and gas gap th << 154 // The mean values of the plate and gas gap thicknesses 120 // are supposed to be about XTR formation zone << 155 // are supposed to be about XTR formation zones but much less than 121 // mean absorption length of XTR photons in co << 156 // mean absorption length of XTR photons in coresponding material. 122 G4double G4TransparentRegXTRadiator::GetStackF << 157 123 << 158 G4double 124 << 159 G4TransparentRegXTRadiator::GetStackFactor( G4double energy, >> 160 G4double gamma, G4double varAngle ) 125 { 161 { 126 G4double result, Qa, Qb, Q, aZa, bZb, aMa, b << 162 /* 127 << 163 G4double result, Za, Zb, Ma, Mb, sigma; 128 aZa = fPlateThick / GetPlateFormationZone( << 164 129 bZb = fGasThick / GetGasFormationZone(ener << 165 Za = GetPlateFormationZone(energy,gamma,varAngle); 130 aMa = fPlateThick * GetPlateLinearPhotoAbs << 166 Zb = GetGasFormationZone(energy,gamma,varAngle); 131 bMb = fGasThick * GetGasLinearPhotoAbs(ene << 167 Ma = GetPlateLinearPhotoAbs(energy); 132 sigma = aMa * fPlateThick + bMb * fGasThick; << 168 Mb = GetGasLinearPhotoAbs(energy); 133 Qa = std::exp(-0.5 * aMa); << 169 sigma = Ma*fPlateThick + Mb*fGasThick; 134 Qb = std::exp(-0.5 * bMb); << 170 135 Q = Qa * Qb; << 171 G4complex Ca(1.0+0.5*fPlateThick*Ma/fAlphaPlate,fPlateThick/Za/fAlphaPlate); 136 << 172 G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas); 137 G4complex Ha(Qa * std::cos(aZa), -Qa * std:: << 173 138 G4complex Hb(Qb * std::cos(bZb), -Qb * std:: << 174 G4complex Ha = std::pow(Ca,-fAlphaPlate); 139 G4complex H = Ha * Hb; << 175 G4complex Hb = std::pow(Cb,-fAlphaGas); >> 176 G4complex H = Ha*Hb; >> 177 G4complex F1 = (1.0 - Ha)*(1.0 - Hb )/(1.0 - H) >> 178 * G4double(fPlateNumber) ; >> 179 G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H) >> 180 * (1.0 - std::exp(-0.5*fPlateNumber*sigma)) ; >> 181 // *(1.0 - std::pow(H,fPlateNumber)) ; >> 182 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle); >> 183 // G4complex R = F2*OneInterfaceXTRdEdx(energy,gamma,varAngle); >> 184 result = 2.0*std::real(R); >> 185 return result; >> 186 */ >> 187 // numerically unstable result >> 188 >> 189 G4double result, Qa, Qb, Q, aZa, bZb, aMa, bMb, D, sigma; >> 190 >> 191 aZa = fPlateThick/GetPlateFormationZone(energy,gamma,varAngle); >> 192 bZb = fGasThick/GetGasFormationZone(energy,gamma,varAngle); >> 193 aMa = fPlateThick*GetPlateLinearPhotoAbs(energy); >> 194 bMb = fGasThick*GetGasLinearPhotoAbs(energy); >> 195 sigma = aMa*fPlateThick + bMb*fGasThick; >> 196 Qa = std::exp(-0.5*aMa); >> 197 Qb = std::exp(-0.5*bMb); >> 198 Q = Qa*Qb; >> 199 >> 200 G4complex Ha( Qa*std::cos(aZa), -Qa*std::sin(aZa) ); >> 201 G4complex Hb( Qb*std::cos(bZb), -Qb*std::sin(bZb) ); >> 202 G4complex H = Ha*Hb; 140 G4complex Hs = conj(H); 203 G4complex Hs = conj(H); 141 D = 1.0 / ((1 - Q) * (1 - Q) + << 204 D = 1.0 /( (1 - Q)*(1 - Q) + 142 4 * Q * std::sin(0.5 * (aZa + bZb << 205 4*Q*std::sin(0.5*(aZa + bZb))*std::sin(0.5*(aZa + bZb)) ); 143 G4complex F1 = << 206 G4complex F1 = (1.0 - Ha)*(1.0 - Hb)*(1.0 - Hs) 144 (1.0 - Ha) * (1.0 - Hb) * (1.0 - Hs) * G4d << 207 * G4double(fPlateNumber)*D; 145 G4complex F2 = (1.0 - Ha) * (1.0 - Ha) * Hb << 208 G4complex F2 = (1.0 - Ha)*(1.0 - Ha)*Hb*(1.0 - Hs)*(1.0 - Hs) 146 (1.0 - std::exp(-0.5 * fPlate << 209 // * (1.0 - std::pow(H,fPlateNumber)) * D*D; 147 G4complex R = (F1 + F2) * OneInterfaceXTRdEd << 210 * (1.0 - std::exp(-0.5*fPlateNumber*sigma)) * D*D; 148 result = 2.0 * std::real(R); << 211 G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle); 149 return result; << 212 result = 2.0*std::real(R); >> 213 return result; >> 214 150 } 215 } >> 216 >> 217 >> 218 // >> 219 // >> 220 //////////////////////////////////////////////////////////////////////////// >> 221 >> 222 >> 223 >> 224 >> 225 >> 226 >> 227 >> 228 151 229