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.4.p3 ] [ 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 /examples/extended/electromagnetic/TestEm10/src/XTRTransparentRegRadModel.cc (Version 11.3.0) and /examples/extended/electromagnetic/TestEm10/src/XTRTransparentRegRadModel.cc (Version 10.7.p4)


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