G4TransparentRegXTRadiator.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 //
00029 
00030 #include <complex>
00031 
00032 #include "G4TransparentRegXTRadiator.hh"
00033 #include "G4PhysicalConstants.hh"
00034 #include "Randomize.hh"
00035 #include "G4Integrator.hh"
00036 #include "G4Gamma.hh"
00037 
00039 //
00040 // Constructor, destructor
00041 
00042 G4TransparentRegXTRadiator::G4TransparentRegXTRadiator(G4LogicalVolume *anEnvelope,
00043                                          G4Material* foilMat,G4Material* gasMat, 
00044                                          G4double a, G4double b, G4int n,
00045                                          const G4String& processName) :
00046   G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName)
00047 {
00048   if(verboseLevel > 0)
00049     G4cout<<"Regular transparent X-ray TR  radiator EM process is called"<<G4endl;
00050 
00051   // Build energy and angular integral spectra of X-ray TR photons from
00052   // a radiator
00053 
00054   fAlphaPlate = 10000;
00055   fAlphaGas   = 1000;
00056 
00057   // BuildTable();
00058 }
00059 
00061 
00062 G4TransparentRegXTRadiator::~G4TransparentRegXTRadiator()
00063 {
00064   ;
00065 }
00066 
00068 //
00069 //
00070 
00071 G4double G4TransparentRegXTRadiator::SpectralXTRdEdx(G4double energy)
00072 {
00073   G4double result, sum = 0., tmp, cof1, cof2, cofMin, cofPHC, theta2, theta2k /*, aMa, bMb ,sigma*/;
00074   G4int k, kMax, kMin;
00075 
00076   //aMa = fPlateThick*GetPlateLinearPhotoAbs(energy);
00077   //bMb = fGasThick*GetGasLinearPhotoAbs(energy);
00078   //sigma = aMa + bMb;
00079    
00080   cofPHC  = 4*pi*hbarc;
00081   tmp     = (fSigma1 - fSigma2)/cofPHC/energy;  
00082   cof1    = fPlateThick*tmp;
00083   cof2    = fGasThick*tmp;
00084 
00085   cofMin  =  energy*(fPlateThick + fGasThick)/fGamma/fGamma;
00086   cofMin += (fPlateThick*fSigma1 + fGasThick*fSigma2)/energy;
00087   cofMin /= cofPHC;
00088 
00089   theta2 = cofPHC/(energy*(fPlateThick + fGasThick));
00090 
00091   //  if (fGamma < 1200) kMin = G4int(cofMin);  // 1200 ?
00092   // else               kMin = 1;
00093 
00094 
00095   kMin = G4int(cofMin);
00096   if (cofMin > kMin) kMin++;
00097 
00098   // tmp  = (fPlateThick + fGasThick)*energy*fMaxThetaTR;
00099   // tmp /= cofPHC;
00100   // kMax = G4int(tmp);
00101   // if(kMax < 0) kMax = 0;
00102   // kMax += kMin;
00103   
00104 
00105   kMax = kMin + 49; //  19; // kMin + G4int(tmp);
00106 
00107   // tmp /= fGamma;
00108   // if( G4int(tmp) < kMin ) kMin = G4int(tmp);
00109 
00110   if(verboseLevel > 2)
00111   {    
00112     G4cout<<cof1<<"     "<<cof2<<"        "<<cofMin<<G4endl;
00113     G4cout<<"kMin = "<<kMin<<";    kMax = "<<kMax<<G4endl;
00114   }
00115   for( k = kMin; k <= kMax; k++ )
00116   {
00117     tmp    = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick);
00118     result = (k - cof1)*(k - cof1)*(k + cof2)*(k + cof2);
00119     // tmp = std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result;
00120     if( k == kMin && kMin == G4int(cofMin) )
00121     {
00122       sum   += 0.5*std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result;
00123     }
00124     else
00125     {
00126       sum   += std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result;
00127     }
00128     theta2k = std::sqrt(theta2*std::abs(k-cofMin));
00129 
00130     if(verboseLevel > 2)
00131     {    
00132       // G4cout<<"k = "<<k<<"; sqrt(theta2k) = "<<theta2k<<"; tmp = "<<std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result
00133       //     <<";    sum = "<<sum<<G4endl;  
00134       G4cout<<k<<"   "<<theta2k<<"     "<<std::sin(tmp)*std::sin(tmp)*std::abs(k-cofMin)/result
00135               <<"      "<<sum<<G4endl;  
00136     }  
00137   }
00138   result = 4*( cof1 + cof2 )*( cof1 + cof2 )*sum/energy;
00139   // result *= ( 1 - std::exp(-0.5*fPlateNumber*sigma) )/( 1 - std::exp(-0.5*sigma) );  
00140   // fPlateNumber;
00141   result *= fPlateNumber; // *std::exp(-0.5*fPlateNumber*sigma); 
00142                              // +1-std::exp(-0.5*fPlateNumber*sigma); 
00143   /*  
00144   fEnergy = energy;
00145   //  G4Integrator<G4VXTRenergyLoss,G4double(G4VXTRenergyLoss::*)(G4double)> integral;
00146   G4Integrator<G4TransparentRegXTRadiator,G4double(G4VXTRenergyLoss::*)(G4double)> integral;
00147  
00148   tmp = integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx,
00149                              0.0,0.3*fMaxThetaTR) +
00150       integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx,
00151                              0.3*fMaxThetaTR,0.6*fMaxThetaTR) +         
00152       integral.Legendre96(this,&G4VXTRenergyLoss::SpectralAngleXTRdEdx,
00153                              0.6*fMaxThetaTR,fMaxThetaTR) ;
00154   result += tmp;
00155   */
00156   return result;
00157 }
00158 
00159 
00161 //
00162 // Approximation for radiator interference factor for the case of
00163 // fully Regular radiator. The plate and gas gap thicknesses are fixed .
00164 // The mean values of the plate and gas gap thicknesses 
00165 // are supposed to be about XTR formation zones but much less than 
00166 // mean absorption length of XTR photons in coresponding material.
00167 
00168 G4double 
00169 G4TransparentRegXTRadiator::GetStackFactor( G4double energy, 
00170                                          G4double gamma, G4double varAngle )
00171 {
00172   /*
00173   G4double result, Za, Zb, Ma, Mb, sigma;
00174   
00175   Za = GetPlateFormationZone(energy,gamma,varAngle);
00176   Zb = GetGasFormationZone(energy,gamma,varAngle);
00177   Ma = GetPlateLinearPhotoAbs(energy);
00178   Mb = GetGasLinearPhotoAbs(energy);
00179   sigma = Ma*fPlateThick + Mb*fGasThick;
00180 
00181   G4complex Ca(1.0+0.5*fPlateThick*Ma/fAlphaPlate,fPlateThick/Za/fAlphaPlate); 
00182   G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas); 
00183 
00184   G4complex Ha = std::pow(Ca,-fAlphaPlate);  
00185   G4complex Hb = std::pow(Cb,-fAlphaGas);
00186   G4complex H  = Ha*Hb;
00187   G4complex F1 =   (1.0 - Ha)*(1.0 - Hb )/(1.0 - H)
00188                  * G4double(fPlateNumber) ;
00189   G4complex F2 =   (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H)
00190                  * (1.0 - std::exp(-0.5*fPlateNumber*sigma)) ;
00191   //    *(1.0 - std::pow(H,fPlateNumber)) ;
00192     G4complex R  = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle);
00193   // G4complex R  = F2*OneInterfaceXTRdEdx(energy,gamma,varAngle);
00194   result       = 2.0*std::real(R);  
00195   return      result;
00196   */
00197    // numerically unstable result
00198 
00199   G4double result, Qa, Qb, Q, aZa, bZb, aMa, bMb, D, sigma; 
00200  
00201   aZa   = fPlateThick/GetPlateFormationZone(energy,gamma,varAngle);
00202   bZb   = fGasThick/GetGasFormationZone(energy,gamma,varAngle);
00203   aMa   = fPlateThick*GetPlateLinearPhotoAbs(energy);
00204   bMb   = fGasThick*GetGasLinearPhotoAbs(energy);
00205   sigma = aMa*fPlateThick + bMb*fGasThick;
00206   Qa    = std::exp(-0.5*aMa);
00207   Qb    = std::exp(-0.5*bMb);
00208   Q     = Qa*Qb;
00209 
00210   G4complex Ha( Qa*std::cos(aZa), -Qa*std::sin(aZa)   );  
00211   G4complex Hb( Qb*std::cos(bZb), -Qb*std::sin(bZb)    );
00212   G4complex H  = Ha*Hb;
00213   G4complex Hs = conj(H);
00214   D            = 1.0 /( (1 - Q)*(1 - Q) + 
00215                   4*Q*std::sin(0.5*(aZa + bZb))*std::sin(0.5*(aZa + bZb)) );
00216   G4complex F1 = (1.0 - Ha)*(1.0 - Hb)*(1.0 - Hs)
00217                  * G4double(fPlateNumber)*D;
00218   G4complex F2 = (1.0 - Ha)*(1.0 - Ha)*Hb*(1.0 - Hs)*(1.0 - Hs)
00219                    // * (1.0 - std::pow(H,fPlateNumber)) * D*D;
00220                  * (1.0 - std::exp(-0.5*fPlateNumber*sigma)) * D*D;
00221   G4complex R  = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle);
00222   result       = 2.0*std::real(R); 
00223   return      result;
00224   
00225 }
00226 
00227 
00228 //
00229 //
00231 
00232 
00233 
00234 
00235 
00236 
00237 
00238 

Generated on Mon May 27 17:50:02 2013 for Geant4 by  doxygen 1.4.7