Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/electromagnetic/standard/src/G4InitXscPAI.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.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 /processes/electromagnetic/standard/src/G4InitXscPAI.cc (Version 11.3.0) and /processes/electromagnetic/standard/src/G4InitXscPAI.cc (Version 7.0.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
 26 //                                                 23 //
                                                   >>  24 // $Id: G4InitXscPAI.cc,v 1.7 2004/12/01 19:37:14 vnivanch Exp $
                                                   >>  25 // GEANT4 tag $Name: geant4-07-00-patch-01 $
                                                   >>  26 //
 27 //                                                 27 // 
 28 // G4InitXscPAI.cc -- class implementation fil     28 // G4InitXscPAI.cc -- class implementation file
 29 //                                                 29 //
 30 // GEANT 4 class implementation file               30 // GEANT 4 class implementation file
 31 //                                                 31 //
 32 // For information related to this code, pleas     32 // For information related to this code, please, contact
 33 // the Geant4 Collaboration.                       33 // the Geant4 Collaboration.
 34 //                                                 34 //
 35 // R&D: Vladimir.Grichine@cern.ch                  35 // R&D: Vladimir.Grichine@cern.ch
 36 //                                                 36 //
 37 // History:                                        37 // History:
 38 //                                                 38 //
 39                                                    39 
 40                                                    40 
 41                                                    41 
 42 #include "G4InitXscPAI.hh"                         42 #include "G4InitXscPAI.hh"
 43                                                    43 
 44 #include "globals.hh"                              44 #include "globals.hh"
 45 #include "G4PhysicalConstants.hh"              << 
 46 #include "G4SystemOfUnits.hh"                  << 
 47 #include "G4ios.hh"                                45 #include "G4ios.hh"
 48 #include "G4Poisson.hh"                            46 #include "G4Poisson.hh"
 49 #include "G4Integrator.hh"                         47 #include "G4Integrator.hh"
 50 #include "G4Material.hh"                           48 #include "G4Material.hh"
 51 #include "G4MaterialCutsCouple.hh"                 49 #include "G4MaterialCutsCouple.hh"
 52 #include "G4SandiaTable.hh"                        50 #include "G4SandiaTable.hh"
 53                                                    51 
 54                                                    52 
 55                                                    53 
 56 // Local class constants                           54 // Local class constants
 57                                                    55 
 58 const G4double G4InitXscPAI::fDelta        = 0     56 const G4double G4InitXscPAI::fDelta        = 0.005 ; // energy shift from interval border
 59 const G4int G4InitXscPAI::fPAIbin          = 1     57 const G4int G4InitXscPAI::fPAIbin          = 100 ;     // size of energy transfer vectors
 60 const G4double G4InitXscPAI::fSolidDensity = 0     58 const G4double G4InitXscPAI::fSolidDensity = 0.05*g/cm3 ; // ~gas-solid border
 61                                                    59 
 62 //////////////////////////////////////////////     60 //////////////////////////////////////////////////////////////////
 63 //                                                 61 //
 64 // Constructor                                     62 // Constructor
 65 //                                                 63 //
 66                                                    64 
 67 using namespace std;                               65 using namespace std;
 68                                                    66 
 69 G4InitXscPAI::G4InitXscPAI( const G4MaterialCu     67 G4InitXscPAI::G4InitXscPAI( const G4MaterialCutsCouple* matCC)
 70   : fPAIxscVector(nullptr),                    <<  68   : fPAIxscVector(NULL),
 71     fPAIdEdxVector(nullptr),                   <<  69     fPAIdEdxVector(NULL),
 72     fPAIphotonVector(nullptr),                 <<  70     fPAIphotonVector(NULL),
 73     fPAIelectronVector(nullptr),               <<  71     fPAIelectronVector(NULL),
 74     fChCosSqVector(nullptr),                   <<  72     fChCosSqVector(NULL),
 75     fChWidthVector(nullptr)                    <<  73     fChWidthVector(NULL)
 76 {                                                  74 {
 77   G4int i, j, matIndex;                            75   G4int i, j, matIndex;
 78                                                    76  
 79   fDensity         = matCC->GetMaterial()->Get     77   fDensity         = matCC->GetMaterial()->GetDensity();
 80   fElectronDensity = matCC->GetMaterial()->Get     78   fElectronDensity = matCC->GetMaterial()->GetElectronDensity();
 81   matIndex         = (G4int)matCC->GetMaterial <<  79   matIndex         = matCC->GetMaterial()->GetIndex();
 82                                                    80 
 83   fSandia          = new G4SandiaTable(matInde     81   fSandia          = new G4SandiaTable(matIndex);
 84   fIntervalNumber  = fSandia->GetMaxInterval()     82   fIntervalNumber  = fSandia->GetMaxInterval()-1;
 85                                                    83 
 86   fMatSandiaMatrix = new G4OrderedTable();         84   fMatSandiaMatrix = new G4OrderedTable();
 87                                                    85  
 88   for (i = 0; i < fIntervalNumber; ++i)        <<  86   for (i = 0; i < fIntervalNumber; i++)
 89   {                                                87   {
 90     fMatSandiaMatrix->push_back(new G4DataVect     88     fMatSandiaMatrix->push_back(new G4DataVector(5,0.));
 91   }                                                89   }           
 92   for (i = 0; i < fIntervalNumber; ++i)        <<  90   for (G4int i = 0; i < fIntervalNumber; i++)
 93   {                                                91   {
 94     (*(*fMatSandiaMatrix)[i])[0] = fSandia->Ge     92     (*(*fMatSandiaMatrix)[i])[0] = fSandia->GetSandiaMatTable(i,0);
 95                                                    93 
 96     for(j = 1; j < 5 ; ++j)                    <<  94     for(j = 1; j < 5 ; j++)
 97     {                                              95     {
 98       (*(*fMatSandiaMatrix)[i])[j] = fSandia->     96       (*(*fMatSandiaMatrix)[i])[j] = fSandia->GetSandiaMatTable(i,j)*fDensity;
 99     }                                              97     }     
100   }                                                98   }
101   KillCloseIntervals();                            99   KillCloseIntervals();
102   Normalisation();                                100   Normalisation();
103   fBetaGammaSq = fTmax = 0.0;                  << 101 
104   fIntervalTmax = fCurrentInterval = 0;        << 
105 }                                                 102 }
106                                                   103 
107                                                   104 
108                                                   105 
109                                                   106 
110 //////////////////////////////////////////////    107 ////////////////////////////////////////////////////////////////////////////
111 //                                                108 //
112 // Destructor                                     109 // Destructor
113                                                   110 
114 G4InitXscPAI::~G4InitXscPAI()                     111 G4InitXscPAI::~G4InitXscPAI()
115 {                                                 112 {
116   delete fPAIxscVector;                        << 113   if(fPAIxscVector)      delete fPAIxscVector;  
117   delete fPAIdEdxVector;                       << 114   if(fPAIdEdxVector)     delete fPAIdEdxVector;  
118   delete fPAIphotonVector;                     << 115   if(fPAIphotonVector)   delete fPAIphotonVector;  
119   delete fPAIelectronVector;                   << 116   if(fPAIelectronVector) delete fPAIelectronVector;  
120   delete fChCosSqVector;                       << 117   if(fChCosSqVector)     delete fChCosSqVector;  
121   delete fChWidthVector;                       << 118   if(fChWidthVector)     delete fChWidthVector;  
122   delete fSandia;                              << 
123   delete fMatSandiaMatrix;                     << 
124 }                                                 119 }
125                                                   120 
126 //////////////////////////////////////////////    121 ////////////////////////////////////////////////////////////////////////
127 //                                                122 //
128 // Kill close intervals, recalculate fInterval    123 // Kill close intervals, recalculate fIntervalNumber
129                                                   124 
130 void G4InitXscPAI::KillCloseIntervals()           125 void G4InitXscPAI::KillCloseIntervals()
131 {                                                 126 {
132   G4int i, j, k;                                  127   G4int i, j, k;
133   G4double energy1, energy2;                      128   G4double energy1, energy2; 
134                                                   129             
135   for( i = 0 ; i < fIntervalNumber - 1 ; i++ )    130   for( i = 0 ; i < fIntervalNumber - 1 ; i++ )
136   {                                               131   {
137     energy1 = (*(*fMatSandiaMatrix)[i])[0];       132     energy1 = (*(*fMatSandiaMatrix)[i])[0];
138     energy2 = (*(*fMatSandiaMatrix)[i+1])[0];     133     energy2 = (*(*fMatSandiaMatrix)[i+1])[0];
139                                                   134 
140     if( energy2 - energy1 > 1.5*fDelta*(energy    135     if( energy2 - energy1 > 1.5*fDelta*(energy1 + energy2) )  continue ;
141     else                                          136     else
142     {                                             137     {
143       for(j = i; j < fIntervalNumber-1; j++)      138       for(j = i; j < fIntervalNumber-1; j++)
144       {                                           139       {
145         for( k = 0; k < 5; k++ )                  140         for( k = 0; k < 5; k++ )
146         {                                         141         {
147           (*(*fMatSandiaMatrix)[j])[k] = (*(*f    142           (*(*fMatSandiaMatrix)[j])[k] = (*(*fMatSandiaMatrix)[j+1])[k];
148   }                                               143   }
149       }                                           144       }
150       fIntervalNumber-- ;                         145       fIntervalNumber-- ;
151       i-- ;                                       146       i-- ;
152     }                                             147     }
153   }                                               148   }
154                                                   149   
155 }                                                 150 }
156                                                   151 
157 //////////////////////////////////////////////    152 ////////////////////////////////////////////////////////////////////////
158 //                                                153 //
159 // Kill close intervals, recalculate fInterval    154 // Kill close intervals, recalculate fIntervalNumber
160                                                   155 
161 void G4InitXscPAI::Normalisation()                156 void G4InitXscPAI::Normalisation()
162 {                                                 157 {
163   G4int i, j;                                     158   G4int i, j;
164   G4double energy1, energy2, /*delta,*/ cof; / << 159   G4double energy1, energy2, delta, cof; // , shift;
165                                                   160 
166   energy1 = (*(*fMatSandiaMatrix)[fIntervalNum    161   energy1 = (*(*fMatSandiaMatrix)[fIntervalNumber-1])[0];
167   energy2 = 2.*(*(*fMatSandiaMatrix)[fInterval    162   energy2 = 2.*(*(*fMatSandiaMatrix)[fIntervalNumber-1])[0];
168                                                   163 
169                                                   164  
170   cof = RutherfordIntegral(fIntervalNumber-1,e    165   cof = RutherfordIntegral(fIntervalNumber-1,energy1,energy2);
171                                                   166             
172   for( i = fIntervalNumber-2; i >= 0; i-- )       167   for( i = fIntervalNumber-2; i >= 0; i-- )
173   {                                               168   {
174     energy1 = (*(*fMatSandiaMatrix)[i])[0];       169     energy1 = (*(*fMatSandiaMatrix)[i])[0];
175     energy2 = (*(*fMatSandiaMatrix)[i+1])[0];     170     energy2 = (*(*fMatSandiaMatrix)[i+1])[0];
176                                                   171 
177     cof += RutherfordIntegral(i,energy1,energy    172     cof += RutherfordIntegral(i,energy1,energy2);
178     // G4cout<<"norm. cof = "<<cof<<G4endl;       173     // G4cout<<"norm. cof = "<<cof<<G4endl;
179   }                                               174   }
180   fNormalizationCof  = 2*pi*pi*hbarc*hbarc*fin    175   fNormalizationCof  = 2*pi*pi*hbarc*hbarc*fine_structure_const/electron_mass_c2 ;
181   fNormalizationCof *= fElectronDensity;          176   fNormalizationCof *= fElectronDensity;
182   //delta = fNormalizationCof - cof;           << 177   delta = fNormalizationCof - cof;
183   fNormalizationCof /= cof;                       178   fNormalizationCof /= cof;
184   //  G4cout<<"G4InitXscPAI::fNormalizationCof    179   //  G4cout<<"G4InitXscPAI::fNormalizationCof/cof = "<<fNormalizationCof
185   //    <<";  at delta ="<<delta<<G4endl ;        180   //    <<";  at delta ="<<delta<<G4endl ;
186                                                   181 
187   for (i = 0; i < fIntervalNumber; i++) // ren << 182   for (G4int i = 0; i < fIntervalNumber; i++) // renormalisation on QM sum rule
188   {                                               183   {
189     for(j = 1; j < 5 ; j++)                       184     for(j = 1; j < 5 ; j++)
190     {                                             185     {
191       (*(*fMatSandiaMatrix)[i])[j] *= fNormali    186       (*(*fMatSandiaMatrix)[i])[j] *= fNormalizationCof;
192     }                                             187     }     
193   }                                               188   }
194   /*                                              189   /* 
195   if(delta > 0) // shift the first energy inte    190   if(delta > 0) // shift the first energy interval
196   {                                               191   {
197     for(i=1;i<100;i++)                            192     for(i=1;i<100;i++)
198     {                                             193     {
199       energy1 = (1.-i/100.)*(*(*fMatSandiaMatr    194       energy1 = (1.-i/100.)*(*(*fMatSandiaMatrix)[0])[0];
200       energy2 = (*(*fMatSandiaMatrix)[0])[0];     195       energy2 = (*(*fMatSandiaMatrix)[0])[0];
201       shift   = RutherfordIntegral(0,energy1,e    196       shift   = RutherfordIntegral(0,energy1,energy2);
202       G4cout<<shift<<"\t";                        197       G4cout<<shift<<"\t";
203       if(shift >= delta) break;                   198       if(shift >= delta) break;
204     }                                             199     }
205     (*(*fMatSandiaMatrix)[0])[0] = energy1;       200     (*(*fMatSandiaMatrix)[0])[0] = energy1;
206     cof += shift;                                 201     cof += shift;
207   }                                               202   }
208   else if(delta < 0)                              203   else if(delta < 0)
209   {                                               204   {
210     for(i=1;i<100;i++)                            205     for(i=1;i<100;i++)
211     {                                             206     {
212       energy1 = (*(*fMatSandiaMatrix)[0])[0];     207       energy1 = (*(*fMatSandiaMatrix)[0])[0];
213       energy2 = (*(*fMatSandiaMatrix)[0])[0] +    208       energy2 = (*(*fMatSandiaMatrix)[0])[0] + 
214               ( (*(*fMatSandiaMatrix)[0])[0] -    209               ( (*(*fMatSandiaMatrix)[0])[0] - (*(*fMatSandiaMatrix)[0])[0] )*i/100.;
215       shift   = RutherfordIntegral(0,energy1,e    210       shift   = RutherfordIntegral(0,energy1,energy2);
216       if( shift >= std::abs(delta) ) break;    << 211       if( shift >= fabs(delta) ) break;
217     }                                             212     }
218     (*(*fMatSandiaMatrix)[0])[0] = energy2;       213     (*(*fMatSandiaMatrix)[0])[0] = energy2;
219     cof -= shift;                                 214     cof -= shift;
220   }                                               215   }
221   G4cout<<G4cout<<"G4InitXscPAI::fNormalizatio    216   G4cout<<G4cout<<"G4InitXscPAI::fNormalizationCof/cof = "<<fNormalizationCof/cof
222         <<";  at delta ="<<delta<<"  and i = "    217         <<";  at delta ="<<delta<<"  and i = "<<i<<G4endl ;
223  */                                               218  */ 
224 }                                                 219 }
225                                                   220 
                                                   >> 221 
                                                   >> 222 
                                                   >> 223 
                                                   >> 224 
226 //////////////////////////////////////////////    225 ////////////////////////////////////////////////////////////////////
227 //                                                226 //
228 // Integration over electrons that could be co    227 // Integration over electrons that could be considered
229 // quasi-free at energy transfer of interest      228 // quasi-free at energy transfer of interest
230                                                   229 
231 G4double G4InitXscPAI::RutherfordIntegral( G4i    230 G4double G4InitXscPAI::RutherfordIntegral( G4int k,
232                     G4double x1,                  231                     G4double x1,
233                       G4double x2   )             232                       G4double x2   )
234 {                                                 233 {
235    G4double  c1, c2, c3, a1, a2, a3, a4 ;         234    G4double  c1, c2, c3, a1, a2, a3, a4 ;
236                                                   235 
237    a1 = (*(*fMatSandiaMatrix)[k])[1];             236    a1 = (*(*fMatSandiaMatrix)[k])[1]; 
238    a2 = (*(*fMatSandiaMatrix)[k])[2];             237    a2 = (*(*fMatSandiaMatrix)[k])[2]; 
239    a3 = (*(*fMatSandiaMatrix)[k])[3];             238    a3 = (*(*fMatSandiaMatrix)[k])[3]; 
240    a4 = (*(*fMatSandiaMatrix)[k])[4];             239    a4 = (*(*fMatSandiaMatrix)[k])[4]; 
241    // G4cout<<"RI: x1 = "<<x1<<"; "<<"x2 = "<<    240    // G4cout<<"RI: x1 = "<<x1<<"; "<<"x2 = "<<x2<<G4endl;   
242    c1 = (x2 - x1)/x1/x2 ;                         241    c1 = (x2 - x1)/x1/x2 ;
243    c2 = (x2 - x1)*(x2 + x1)/x1/x1/x2/x2 ;         242    c2 = (x2 - x1)*(x2 + x1)/x1/x1/x2/x2 ;
244    c3 = (x2 - x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x    243    c3 = (x2 - x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2 ;
245    // G4cout<<" RI: c1 = "<<c1<<"; "<<"c2 = "<    244    // G4cout<<" RI: c1 = "<<c1<<"; "<<"c2 = "<<c2<<"; "<<"c3 = "<<c3<<G4endl;   
246                                                   245    
247    return  a1*log(x2/x1) + a2*c1 + a3*c2/2 + a    246    return  a1*log(x2/x1) + a2*c1 + a3*c2/2 + a4*c3/3 ;
248                                                   247 
249 }   // end of RutherfordIntegral                  248 }   // end of RutherfordIntegral 
250                                                   249 
251 //////////////////////////////////////////////    250 ///////////////////////////////////////////////////////////////
252 //                                                251 //
253 //  Integrate photo-absorption cross-section f    252 //  Integrate photo-absorption cross-section from I1 up to omega
254                                                   253 
255 G4double G4InitXscPAI::IntegralTerm(G4double o    254 G4double G4InitXscPAI::IntegralTerm(G4double omega)
256 {                                                 255 {
257   G4int i;                                        256   G4int i;
258   G4double energy1, energy2, result = 0.;         257   G4double energy1, energy2, result = 0.; 
259                                                   258             
260   for( i = 0; i <= fIntervalTmax; i++ )           259   for( i = 0; i <= fIntervalTmax; i++ )
261   {                                               260   {
262     if(i == fIntervalTmax)                        261     if(i == fIntervalTmax) 
263     {                                             262     {
264       energy1 = (*(*fMatSandiaMatrix)[i])[0];     263       energy1 = (*(*fMatSandiaMatrix)[i])[0];
265       result += RutherfordIntegral(i,energy1,o    264       result += RutherfordIntegral(i,energy1,omega);
266     }                                             265     }
267     else                                          266     else 
268     {                                             267     {
269       if( omega <= (*(*fMatSandiaMatrix)[i+1])    268       if( omega <= (*(*fMatSandiaMatrix)[i+1])[0])
270       {                                           269       {
271         energy1 = (*(*fMatSandiaMatrix)[i])[0]    270         energy1 = (*(*fMatSandiaMatrix)[i])[0];
272         result += RutherfordIntegral(i,energy1    271         result += RutherfordIntegral(i,energy1,omega);
273         break;                                    272         break;
274       }                                           273       }
275       else                                        274       else
276       {                                           275       {
277         energy1 = (*(*fMatSandiaMatrix)[i])[0]    276         energy1 = (*(*fMatSandiaMatrix)[i])[0];
278         energy2 = (*(*fMatSandiaMatrix)[i+1])[    277         energy2 = (*(*fMatSandiaMatrix)[i+1])[0];
279         result += RutherfordIntegral(i,energy1    278         result += RutherfordIntegral(i,energy1,energy2);
280       }                                           279       }
281     }                                             280     }
282     // G4cout<<"IntegralTerm<<"("<<omega<<")"<    281     // G4cout<<"IntegralTerm<<"("<<omega<<")"<<" = "<<result<<G4endl;
283   }                                               282   }
284   return result;                                  283   return result;
285 }                                                 284 }
286                                                   285 
287                                                   286 
288 //////////////////////////////////////////////    287 ////////////////////////////////////////////////////////////////
289 //                                                288 //
290 // Imaginary part of dielectric constant          289 // Imaginary part of dielectric constant
291 // (G4int k - interval number, G4double en1 -     290 // (G4int k - interval number, G4double en1 - energy point)
292                                                   291 
293 G4double G4InitXscPAI::ImPartDielectricConst(     292 G4double G4InitXscPAI::ImPartDielectricConst( G4int    k ,
294                              G4double energy1     293                              G4double energy1 )
295 {                                                 294 {
296    G4double energy2,energy3,energy4,a1,a2,a3,a    295    G4double energy2,energy3,energy4,a1,a2,a3,a4,result;
297                                                   296 
298    a1 = (*(*fMatSandiaMatrix)[k])[1];             297    a1 = (*(*fMatSandiaMatrix)[k])[1]; 
299    a2 = (*(*fMatSandiaMatrix)[k])[2];             298    a2 = (*(*fMatSandiaMatrix)[k])[2]; 
300    a3 = (*(*fMatSandiaMatrix)[k])[3];             299    a3 = (*(*fMatSandiaMatrix)[k])[3]; 
301    a4 = (*(*fMatSandiaMatrix)[k])[4];             300    a4 = (*(*fMatSandiaMatrix)[k])[4]; 
302                                                   301 
303    energy2 = energy1*energy1;                     302    energy2 = energy1*energy1;
304    energy3 = energy2*energy1;                     303    energy3 = energy2*energy1;
305    energy4 = energy3*energy1;                     304    energy4 = energy3*energy1;
306                                                   305    
307    result  = a1/energy1+a2/energy2+a3/energy3+    306    result  = a1/energy1+a2/energy2+a3/energy3+a4/energy4 ;  
308    result *= hbarc/energy1 ;                      307    result *= hbarc/energy1 ;
309                                                   308    
310    return result ;                                309    return result ;
311                                                   310 
312 }  // end of ImPartDielectricConst                311 }  // end of ImPartDielectricConst 
313                                                   312 
314 //////////////////////////////////////////////    313 ////////////////////////////////////////////////////////////////
315 //                                                314 //
316 // Modulus squared of dielectric constant         315 // Modulus squared of dielectric constant
317 // (G4int k - interval number, G4double omega     316 // (G4int k - interval number, G4double omega - energy point)
318                                                   317 
319 G4double G4InitXscPAI::ModuleSqDielectricConst    318 G4double G4InitXscPAI::ModuleSqDielectricConst( G4int    k ,
320                              G4double omega )     319                              G4double omega )
321 {                                                 320 {
322    G4double eIm2, eRe2, result;                   321    G4double eIm2, eRe2, result;
323                                                   322 
324    result = ImPartDielectricConst(k,omega);       323    result = ImPartDielectricConst(k,omega);
325    eIm2   = result*result;                        324    eIm2   = result*result;
326                                                   325 
327    result = RePartDielectricConst(omega);         326    result = RePartDielectricConst(omega);
328    eRe2   = result*result;                        327    eRe2   = result*result;
329                                                   328 
330    result = eIm2 + eRe2;                          329    result = eIm2 + eRe2;
331                                                   330   
332    return result ;                                331    return result ;
333 }                                                 332 }  
334                                                   333 
335                                                   334 
336 //////////////////////////////////////////////    335 //////////////////////////////////////////////////////////////////////////////
337 //                                                336 //
338 // Real part of dielectric constant minus unit    337 // Real part of dielectric constant minus unit: epsilon_1 - 1
339 // (G4double enb - energy point)                  338 // (G4double enb - energy point)
340 //                                                339 //
341                                                   340 
342 G4double G4InitXscPAI::RePartDielectricConst(G    341 G4double G4InitXscPAI::RePartDielectricConst(G4double enb)
343 {                                                 342 {
344   G4int i;                                        343   G4int i;       
345    G4double x0, x02, x03, x04, x05, x1, x2, a1    344    G4double x0, x02, x03, x04, x05, x1, x2, a1,a2,a3,a4,xx1 ,xx2 , xx12,
346             c1, c2, c3, cof1, cof2, xln1, xln2    345             c1, c2, c3, cof1, cof2, xln1, xln2, xln3, result ;
347                                                   346 
348    x0 = enb ;                                     347    x0 = enb ;
349    result = 0 ;                                   348    result = 0 ;
350                                                   349    
351    for( i = 0; i < fIntervalNumber-1; i++)        350    for( i = 0; i < fIntervalNumber-1; i++)
352    {                                              351    {
353       x1 = (*(*fMatSandiaMatrix)[i])[0];          352       x1 = (*(*fMatSandiaMatrix)[i])[0];
354       x2 = (*(*fMatSandiaMatrix)[i+1])[0] ;       353       x2 = (*(*fMatSandiaMatrix)[i+1])[0] ;
355                                                   354 
356       a1 = (*(*fMatSandiaMatrix)[i])[1];          355       a1 = (*(*fMatSandiaMatrix)[i])[1]; 
357       a2 = (*(*fMatSandiaMatrix)[i])[2];          356       a2 = (*(*fMatSandiaMatrix)[i])[2]; 
358       a3 = (*(*fMatSandiaMatrix)[i])[3];          357       a3 = (*(*fMatSandiaMatrix)[i])[3]; 
359       a4 = (*(*fMatSandiaMatrix)[i])[4];          358       a4 = (*(*fMatSandiaMatrix)[i])[4];
360                                                   359  
361       if( std::abs(x0-x1) < 0.5*(x0+x1)*fDelta << 360       if( fabs(x0-x1) < 0.5*(x0+x1)*fDelta ) 
362       {                                           361       {
363         if(x0 >= x1) x0 = x1*(1+fDelta);          362         if(x0 >= x1) x0 = x1*(1+fDelta);
364         else         x0 = x1*(1-fDelta);          363         else         x0 = x1*(1-fDelta);
365       }                                           364       } 
366       if( std::abs(x0-x2) < 0.5*(x0+x2)*fDelta << 365       if( fabs(x0-x2) < 0.5*(x0+x2)*fDelta ) 
367       {                                           366       {
368         if(x0 >= x2) x0 = x2*(1+fDelta);          367         if(x0 >= x2) x0 = x2*(1+fDelta);
369         else         x0 = x2*(1-fDelta);          368         else         x0 = x2*(1-fDelta);
370       }                                           369       }
371       xx1 = x1 - x0 ;                             370       xx1 = x1 - x0 ;
372       xx2 = x2 - x0 ;                             371       xx2 = x2 - x0 ;
373       xx12 = xx2/xx1 ;                            372       xx12 = xx2/xx1 ;
374                                                   373       
375       if( xx12 < 0 ) xx12 = -xx12;                374       if( xx12 < 0 ) xx12 = -xx12;
376                                                   375       
377       xln1 = log(x2/x1) ;                         376       xln1 = log(x2/x1) ;
378       xln2 = log(xx12) ;                          377       xln2 = log(xx12) ;
379       xln3 = log((x2 + x0)/(x1 + x0)) ;           378       xln3 = log((x2 + x0)/(x1 + x0)) ;
380                                                   379 
381       x02 = x0*x0 ;                               380       x02 = x0*x0 ;
382       x03 = x02*x0 ;                              381       x03 = x02*x0 ;
383       x04 = x03*x0 ;                              382       x04 = x03*x0 ;
384       x05 = x04*x0;                               383       x05 = x04*x0;
385                                                   384 
386       c1  = (x2 - x1)/x1/x2 ;                     385       c1  = (x2 - x1)/x1/x2 ;
387       c2  = (x2 - x1)*(x2 +x1)/x1/x1/x2/x2 ;      386       c2  = (x2 - x1)*(x2 +x1)/x1/x1/x2/x2 ;
388       c3  = (x2 -x1)*(x1*x1 + x1*x2 + x2*x2)/x    387       c3  = (x2 -x1)*(x1*x1 + x1*x2 + x2*x2)/x1/x1/x1/x2/x2/x2 ;
389                                                   388 
390       result -= (a1/x02 + a3/x04)*xln1 ;          389       result -= (a1/x02 + a3/x04)*xln1 ;
391       result -= (a2/x02 + a4/x04)*c1 ;            390       result -= (a2/x02 + a4/x04)*c1 ;
392       result -= a3*c2/2/x02 ;                     391       result -= a3*c2/2/x02 ;
393       result -= a4*c3/3/x02 ;                     392       result -= a4*c3/3/x02 ;
394                                                   393 
395       cof1 = a1/x02 + a3/x04 ;                    394       cof1 = a1/x02 + a3/x04 ;
396       cof2 = a2/x03 + a4/x05 ;                    395       cof2 = a2/x03 + a4/x05 ;
397                                                   396 
398       result += 0.5*(cof1 +cof2)*xln2 ;           397       result += 0.5*(cof1 +cof2)*xln2 ;
399       result += 0.5*(cof1 - cof2)*xln3 ;          398       result += 0.5*(cof1 - cof2)*xln3 ;
400    }                                              399    } 
401    result *= 2*hbarc/pi ;                         400    result *= 2*hbarc/pi ;
402                                                   401    
403    return result ;                                402    return result ;
404                                                   403 
405 }   // end of RePartDielectricConst               404 }   // end of RePartDielectricConst 
406                                                   405 
407 //////////////////////////////////////////////    406 //////////////////////////////////////////////////////////////////////
408 //                                                407 //
409 // PAI differential cross-section in terms of     408 // PAI differential cross-section in terms of
410 // simplified Allison's equation                  409 // simplified Allison's equation
411 //                                                410 //
412                                                   411 
413 G4double G4InitXscPAI::DifPAIxSection( G4doubl    412 G4double G4InitXscPAI::DifPAIxSection( G4double omega )
414 {                                                 413 {
415   G4int i = fCurrentInterval;                     414   G4int i = fCurrentInterval;
416   G4double  betaGammaSq = fBetaGammaSq;           415   G4double  betaGammaSq = fBetaGammaSq;       
417   G4double integralTerm = IntegralTerm(omega);    416   G4double integralTerm = IntegralTerm(omega);
418   G4double be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,res    417   G4double be2,cof,x1,x2,x3,x4,x5,x6,x7,x8,result ;
419   G4double epsilonRe = RePartDielectricConst(o    418   G4double epsilonRe = RePartDielectricConst(omega);
420   G4double epsilonIm = ImPartDielectricConst(i    419   G4double epsilonIm = ImPartDielectricConst(i,omega);
421   G4double be4 ;                                  420   G4double be4 ;
422   static const G4double betaBohr2 = fine_struc << 421   G4double betaBohr2 = fine_structure_const*fine_structure_const ;
423   static const G4double betaBohr4 = betaBohr2* << 422   G4double betaBohr4 = betaBohr2*betaBohr2*4.0 ;
424   be2 = betaGammaSq/(1 + betaGammaSq) ;           423   be2 = betaGammaSq/(1 + betaGammaSq) ;
425   be4 = be2*be2 ;                                 424   be4 = be2*be2 ;
426                                                   425  
427    cof = 1 ;                                      426    cof = 1 ;
428    x1 = log(2*electron_mass_c2/omega) ;           427    x1 = log(2*electron_mass_c2/omega) ;
429                                                   428 
430    if( betaGammaSq < 0.01 ) x2 = log(be2) ;       429    if( betaGammaSq < 0.01 ) x2 = log(be2) ;
431    else                                           430    else
432    {                                              431    {
433      x2 = -log( (1/betaGammaSq - epsilonRe)*      432      x2 = -log( (1/betaGammaSq - epsilonRe)*
434           (1/betaGammaSq - epsilonRe) +           433           (1/betaGammaSq - epsilonRe) + 
435           epsilonIm*epsilonIm )/2 ;               434           epsilonIm*epsilonIm )/2 ;
436    }                                              435    }
437    if( epsilonIm == 0.0 || betaGammaSq < 0.01     436    if( epsilonIm == 0.0 || betaGammaSq < 0.01 )
438    {                                              437    {
439      x6=0 ;                                       438      x6=0 ;
440    }                                              439    }
441    else                                           440    else
442    {                                              441    {
443      x3 = -epsilonRe + 1/betaGammaSq ;            442      x3 = -epsilonRe + 1/betaGammaSq ;
444      x5 = -1 - epsilonRe + be2*((1 +epsilonRe)    443      x5 = -1 - epsilonRe + be2*((1 +epsilonRe)*(1 + epsilonRe) +
445      epsilonIm*epsilonIm) ;                       444      epsilonIm*epsilonIm) ;
446                                                   445 
447      x7 = atan2(epsilonIm,x3) ;                   446      x7 = atan2(epsilonIm,x3) ;
448      x6 = x5 * x7 ;                               447      x6 = x5 * x7 ;
449    }                                              448    }
450     // if(fImPartDielectricConst[i] == 0) x6 =    449     // if(fImPartDielectricConst[i] == 0) x6 = 0 ;
451                                                   450    
452    x4 = ((x1 + x2)*epsilonIm + x6)/hbarc ;        451    x4 = ((x1 + x2)*epsilonIm + x6)/hbarc ;
453    //   if( x4 < 0.0 ) x4 = 0.0 ;                 452    //   if( x4 < 0.0 ) x4 = 0.0 ;
454    x8 = (1 + epsilonRe)*(1 + epsilonRe) +         453    x8 = (1 + epsilonRe)*(1 + epsilonRe) + 
455         epsilonIm*epsilonIm;                      454         epsilonIm*epsilonIm;
456                                                   455 
457    result = (x4 + cof*integralTerm/omega/omega    456    result = (x4 + cof*integralTerm/omega/omega) ;
458    if(result < 1.0e-8) result = 1.0e-8 ;          457    if(result < 1.0e-8) result = 1.0e-8 ;
459    result *= fine_structure_const/be2/pi ;        458    result *= fine_structure_const/be2/pi ;
460    //   result *= (1-exp(-beta/betaBohr))*(1-e    459    //   result *= (1-exp(-beta/betaBohr))*(1-exp(-beta/betaBohr)) ;
461    //  result *= (1-exp(-be2/betaBohr2)) ;        460    //  result *= (1-exp(-be2/betaBohr2)) ;
462    result *= (1-exp(-be4/betaBohr4)) ;            461    result *= (1-exp(-be4/betaBohr4)) ;
463    if(fDensity >= fSolidDensity)                  462    if(fDensity >= fSolidDensity)
464    {                                              463    { 
465       result /= x8 ;                              464       result /= x8 ;
466    }                                              465    }
467    return result ;                                466    return result ;
468                                                   467 
469 } // end of DifPAIxSection                        468 } // end of DifPAIxSection 
470                                                   469 
471 //////////////////////////////////////////////    470 //////////////////////////////////////////////////////////////////////
472 //                                                471 //
473 // Differential PAI dEdx(omega)=omega*dNdx(ome    472 // Differential PAI dEdx(omega)=omega*dNdx(omega)
474 //                                                473 //
475                                                   474 
476 G4double G4InitXscPAI::DifPAIdEdx( G4double om    475 G4double G4InitXscPAI::DifPAIdEdx( G4double omega )
477 {                                                 476 {
478   G4double dEdx = omega*DifPAIxSection(omega);    477   G4double dEdx = omega*DifPAIxSection(omega);
479   return dEdx;                                    478   return dEdx;
480 }                                                 479 }
481                                                   480 
482 //////////////////////////////////////////////    481 //////////////////////////////////////////////////////////////////////////
483 //                                                482 //
484 // Calculation od dN/dx of collisions with cre    483 // Calculation od dN/dx of collisions with creation of Cerenkov pseudo-photons
485                                                   484 
486 G4double G4InitXscPAI::PAIdNdxCherenkov( G4dou    485 G4double G4InitXscPAI::PAIdNdxCherenkov( G4double omega  )
487 {                                                 486 {        
488   G4int i = fCurrentInterval;                     487   G4int i = fCurrentInterval;
489   G4double  betaGammaSq = fBetaGammaSq;           488   G4double  betaGammaSq = fBetaGammaSq;       
490   G4double epsilonRe = RePartDielectricConst(o    489   G4double epsilonRe = RePartDielectricConst(omega);
491   G4double epsilonIm = ImPartDielectricConst(i    490   G4double epsilonIm = ImPartDielectricConst(i,omega);
492                                                   491 
493   G4double /*cof,*/ logarithm, x3, x5, argumen << 492   G4double cof, logarithm, x3, x5, argument, modul2, dNdxC ; 
494   G4double be2, be4;                           << 493   G4double be2, be4, betaBohr2,betaBohr4,cofBetaBohr ;
495                                                   494 
496   //cof         = 1.0 ;                        << 495    cof         = 1.0 ;
497   static const G4double cofBetaBohr = 4.0 ;    << 496    cofBetaBohr = 4.0 ;
498   static const G4double betaBohr2   = fine_str << 497    betaBohr2   = fine_structure_const*fine_structure_const ;
499   static const G4double betaBohr4   = betaBohr << 498    betaBohr4   = betaBohr2*betaBohr2*cofBetaBohr ;
500                                                   499 
501    be2 = betaGammaSq/(1 + betaGammaSq) ;          500    be2 = betaGammaSq/(1 + betaGammaSq) ;
502    be4 = be2*be2 ;                                501    be4 = be2*be2 ;
503                                                   502 
504    if( betaGammaSq < 0.01 ) logarithm = log(1.    503    if( betaGammaSq < 0.01 ) logarithm = log(1.0+betaGammaSq) ; // 0.0 ;
505    else                                           504    else
506    {                                              505    {
507      logarithm  = -log( (1/betaGammaSq - epsil    506      logarithm  = -log( (1/betaGammaSq - epsilonRe)*
508                   (1/betaGammaSq - epsilonRe)     507                   (1/betaGammaSq - epsilonRe) + 
509                   epsilonIm*epsilonIm )*0.5 ;     508                   epsilonIm*epsilonIm )*0.5 ;
510      logarithm += log(1+1.0/betaGammaSq) ;        509      logarithm += log(1+1.0/betaGammaSq) ;
511    }                                              510    }
512                                                   511 
513    if( epsilonIm == 0.0 || betaGammaSq < 0.01     512    if( epsilonIm == 0.0 || betaGammaSq < 0.01 )
514    {                                              513    {
515      argument = 0.0 ;                             514      argument = 0.0 ;
516    }                                              515    }
517    else                                           516    else
518    {                                              517    {
519      x3 = -epsilonRe + 1.0/betaGammaSq ;          518      x3 = -epsilonRe + 1.0/betaGammaSq ;
520      x5 = -1.0 - epsilonRe +                      519      x5 = -1.0 - epsilonRe +
521           be2*((1.0 +epsilonRe)*(1.0 + epsilon    520           be2*((1.0 +epsilonRe)*(1.0 + epsilonRe) +
522     epsilonIm*epsilonIm) ;                        521     epsilonIm*epsilonIm) ;
523      if( x3 == 0.0 ) argument = 0.5*pi;           522      if( x3 == 0.0 ) argument = 0.5*pi;
524      else            argument = atan2(epsilonI    523      else            argument = atan2(epsilonIm,x3) ;
525      argument *= x5  ;                            524      argument *= x5  ;
526    }                                              525    }   
527    dNdxC = ( logarithm*epsilonIm + argument )/    526    dNdxC = ( logarithm*epsilonIm + argument )/hbarc ;
528                                                   527   
529    if(dNdxC < 1.0e-8) dNdxC = 1.0e-8 ;            528    if(dNdxC < 1.0e-8) dNdxC = 1.0e-8 ;
530                                                   529 
531    dNdxC *= fine_structure_const/be2/pi ;         530    dNdxC *= fine_structure_const/be2/pi ;
532                                                   531 
533    dNdxC *= (1-exp(-be4/betaBohr4)) ;             532    dNdxC *= (1-exp(-be4/betaBohr4)) ;
534                                                   533 
535    if(fDensity >= fSolidDensity)                  534    if(fDensity >= fSolidDensity)
536    {                                              535    { 
537       modul2 = (1.0 + epsilonRe)*(1.0 + epsilo    536       modul2 = (1.0 + epsilonRe)*(1.0 + epsilonRe) + 
538                     epsilonIm*epsilonIm;          537                     epsilonIm*epsilonIm;
539       dNdxC /= modul2 ;                           538       dNdxC /= modul2 ;
540    }                                              539    }
541    return dNdxC ;                                 540    return dNdxC ;
542                                                   541 
543 } // end of PAIdNdxCerenkov                       542 } // end of PAIdNdxCerenkov 
544                                                   543 
545 //////////////////////////////////////////////    544 //////////////////////////////////////////////////////////////////////////
546 //                                                545 //
547 // Calculation od dN/dx of collisions with cre    546 // Calculation od dN/dx of collisions with creation of longitudinal EM
548 // excitations (plasmons, delta-electrons)        547 // excitations (plasmons, delta-electrons)
549                                                   548 
550 G4double G4InitXscPAI::PAIdNdxPlasmon( G4doubl    549 G4double G4InitXscPAI::PAIdNdxPlasmon( G4double omega )
551 {                                                 550 {        
552   G4int i = fCurrentInterval;                     551   G4int i = fCurrentInterval;
553   G4double  betaGammaSq = fBetaGammaSq;           552   G4double  betaGammaSq = fBetaGammaSq;       
554   G4double integralTerm = IntegralTerm(omega);    553   G4double integralTerm = IntegralTerm(omega);
555   G4double epsilonRe = RePartDielectricConst(o    554   G4double epsilonRe = RePartDielectricConst(omega);
556   G4double epsilonIm = ImPartDielectricConst(i    555   G4double epsilonIm = ImPartDielectricConst(i,omega);
557                                                   556 
558    G4double cof, resonance, modul2, dNdxP ;       557    G4double cof, resonance, modul2, dNdxP ;
559    G4double be2, be4;                          << 558    G4double be2, be4, betaBohr2, betaBohr4, cofBetaBohr ;
560                                                   559 
561    cof = 1 ;                                      560    cof = 1 ;
562    static const G4double cofBetaBohr = 4.0 ;   << 561    cofBetaBohr = 4.0 ;
563    static const G4double betaBohr2   = fine_st << 562    betaBohr2   = fine_structure_const*fine_structure_const ;
564    static const G4double betaBohr4   = betaBoh << 563    betaBohr4   = betaBohr2*betaBohr2*cofBetaBohr ;
565                                                   564 
566    be2 = betaGammaSq/(1 + betaGammaSq) ;          565    be2 = betaGammaSq/(1 + betaGammaSq) ;
567    be4 = be2*be2 ;                                566    be4 = be2*be2 ;
568                                                   567  
569    resonance  = log(2*electron_mass_c2*be2/ome    568    resonance  = log(2*electron_mass_c2*be2/omega) ;  
570    resonance *= epsilonIm/hbarc ;                 569    resonance *= epsilonIm/hbarc ;
571                                                   570 
572                                                   571 
573    dNdxP = ( resonance + cof*integralTerm/omeg    572    dNdxP = ( resonance + cof*integralTerm/omega/omega ) ;
574                                                   573 
575    if( dNdxP < 1.0e-8 ) dNdxP = 1.0e-8 ;          574    if( dNdxP < 1.0e-8 ) dNdxP = 1.0e-8 ;
576                                                   575 
577    dNdxP *= fine_structure_const/be2/pi ;         576    dNdxP *= fine_structure_const/be2/pi ;
578    dNdxP *= (1-exp(-be4/betaBohr4)) ;             577    dNdxP *= (1-exp(-be4/betaBohr4)) ;
579                                                   578 
580    if( fDensity >= fSolidDensity )                579    if( fDensity >= fSolidDensity )
581    {                                              580    { 
582      modul2 = (1 + epsilonRe)*(1 + epsilonRe)     581      modul2 = (1 + epsilonRe)*(1 + epsilonRe) + 
583                epsilonIm*epsilonIm;               582                epsilonIm*epsilonIm;
584      dNdxP /= modul2 ;                            583      dNdxP /= modul2 ;
585    }                                              584    }
586    return dNdxP ;                                 585    return dNdxP ;
587                                                   586 
588 } // end of PAIdNdxPlasmon                        587 } // end of PAIdNdxPlasmon 
589                                                   588 
590 //////////////////////////////////////////////    589 ////////////////////////////////////////////////////////////////////////
591 //                                                590 //
592 // Calculation of the PAI integral cross-secti    591 // Calculation of the PAI integral cross-section
593 // = specific primary ionisation, 1/cm            592 // = specific primary ionisation, 1/cm
594 //                                                593 // 
595                                                   594 
596 void G4InitXscPAI::IntegralPAIxSection(G4doubl    595 void G4InitXscPAI::IntegralPAIxSection(G4double bg2, G4double Tmax)
597 {                                                 596 {
598   G4int i,k,i1,i2;                                597   G4int i,k,i1,i2;
599   G4double energy1, energy2, result = 0.;         598   G4double energy1, energy2, result = 0.;
600                                                   599  
601   fBetaGammaSq = bg2;                             600   fBetaGammaSq = bg2;
602   fTmax        = Tmax;                            601   fTmax        = Tmax;
603                                                   602 
604   delete fPAIxscVector;                        << 603   if(fPAIxscVector) delete fPAIxscVector;  
605                                                   604   
606   fPAIxscVector = new G4PhysicsLogVector( (*(*    605   fPAIxscVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
607   fPAIxscVector->PutValue(fPAIbin-1,result);      606   fPAIxscVector->PutValue(fPAIbin-1,result);
608                                                   607             
609   for( i = fIntervalNumber - 1; i >= 0; i-- )     608   for( i = fIntervalNumber - 1; i >= 0; i-- )
610   {                                               609   {
611     if( Tmax >= (*(*fMatSandiaMatrix)[i])[0] )    610     if( Tmax >= (*(*fMatSandiaMatrix)[i])[0] ) break;
612   }                                               611   }
613   if (i < 0) i = 0; // Tmax should be more tha    612   if (i < 0) i = 0; // Tmax should be more than 
614                     // first ionisation potent    613                     // first ionisation potential
615   fIntervalTmax = i;                              614   fIntervalTmax = i;
616                                                   615 
617   G4Integrator<G4InitXscPAI,G4double(G4InitXsc    616   G4Integrator<G4InitXscPAI,G4double(G4InitXscPAI::*)(G4double)> integral;
618                                                   617 
619   for( k = fPAIbin - 2; k >= 0; k-- )             618   for( k = fPAIbin - 2; k >= 0; k-- )
620   {                                               619   {
621     energy1 = fPAIxscVector->GetLowEdgeEnergy(    620     energy1 = fPAIxscVector->GetLowEdgeEnergy(k);
622     energy2 = fPAIxscVector->GetLowEdgeEnergy(    621     energy2 = fPAIxscVector->GetLowEdgeEnergy(k+1);
623                                                   622 
624     for( i = fIntervalTmax; i >= 0; i-- )         623     for( i = fIntervalTmax; i >= 0; i-- ) 
625     {                                             624     {
626       if( energy2 > (*(*fMatSandiaMatrix)[i])[    625       if( energy2 > (*(*fMatSandiaMatrix)[i])[0] ) break;
627     }                                             626     }
628     if(i < 0) i = 0;                              627     if(i < 0) i = 0;
629     i2 = i;                                       628     i2 = i;
630                                                   629 
631     for( i = fIntervalTmax; i >= 0; i-- )         630     for( i = fIntervalTmax; i >= 0; i-- ) 
632     {                                             631     {
633       if( energy1 > (*(*fMatSandiaMatrix)[i])[    632       if( energy1 > (*(*fMatSandiaMatrix)[i])[0] ) break;
634     }                                             633     }
635     if(i < 0) i = 0;                              634     if(i < 0) i = 0;
636     i1 = i;                                       635     i1 = i;
637                                                   636 
638     if( i1 == i2 )                                637     if( i1 == i2 )
639     {                                             638     {
640       fCurrentInterval = i1;                      639       fCurrentInterval = i1;
641       result += integral.Legendre10(this,&G4In    640       result += integral.Legendre10(this,&G4InitXscPAI::DifPAIxSection,
642                                     energy1,en    641                                     energy1,energy2);
643       fPAIxscVector->PutValue(k,result);          642       fPAIxscVector->PutValue(k,result);
644     }                                             643     }
645     else                                          644     else
646     {                                             645     {
647       for( i = i2; i >= i1; i-- )                 646       for( i = i2; i >= i1; i-- ) 
648       {                                           647       {
649         fCurrentInterval = i;                     648         fCurrentInterval = i;
650                                                   649 
651         if( i==i2 )        result += integral.    650         if( i==i2 )        result += integral.Legendre10(this,
652                            &G4InitXscPAI::DifP    651                            &G4InitXscPAI::DifPAIxSection,
653                            (*(*fMatSandiaMatri    652                            (*(*fMatSandiaMatrix)[i])[0] ,energy2);
654                                                   653 
655   else if( i == i1 ) result += integral.Legend    654   else if( i == i1 ) result += integral.Legendre10(this,
656                            &G4InitXscPAI::DifP    655                            &G4InitXscPAI::DifPAIxSection,energy1,
657                            (*(*fMatSandiaMatri    656                            (*(*fMatSandiaMatrix)[i+1])[0]);
658                                                   657 
659         else               result += integral.    658         else               result += integral.Legendre10(this,
660                            &G4InitXscPAI::DifP    659                            &G4InitXscPAI::DifPAIxSection,
661                        (*(*fMatSandiaMatrix)[i    660                        (*(*fMatSandiaMatrix)[i])[0] ,(*(*fMatSandiaMatrix)[i+1])[0]);
662       }                                           661       }
663       fPAIxscVector->PutValue(k,result);          662       fPAIxscVector->PutValue(k,result);
664     }                                             663     }
665     // G4cout<<k<<"\t"<<result<<G4endl;           664     // G4cout<<k<<"\t"<<result<<G4endl; 
666   }                                               665   }
667   return ;                                        666   return ;
668 }                                                 667 }
669                                                   668 
670                                                   669 
671 //////////////////////////////////////////////    670 ////////////////////////////////////////////////////////////////////////
672 //                                                671 //
673 // Calculation of the PAI integral dEdx           672 // Calculation of the PAI integral dEdx
674 // = mean energy loss per unit length, keV/cm     673 // = mean energy loss per unit length, keV/cm
675 //                                                674 // 
676                                                   675 
677 void G4InitXscPAI::IntegralPAIdEdx(G4double bg    676 void G4InitXscPAI::IntegralPAIdEdx(G4double bg2, G4double Tmax)
678 {                                                 677 {
679   G4int i,k,i1,i2;                                678   G4int i,k,i1,i2;
680   G4double energy1, energy2, result = 0.;         679   G4double energy1, energy2, result = 0.;
681                                                   680  
682   fBetaGammaSq = bg2;                             681   fBetaGammaSq = bg2;
683   fTmax        = Tmax;                            682   fTmax        = Tmax;
684                                                   683 
685   delete fPAIdEdxVector;                       << 684   if(fPAIdEdxVector) delete fPAIdEdxVector;  
686                                                   685   
687   fPAIdEdxVector = new G4PhysicsLogVector( (*(    686   fPAIdEdxVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
688   fPAIdEdxVector->PutValue(fPAIbin-1,result);     687   fPAIdEdxVector->PutValue(fPAIbin-1,result);
689                                                   688             
690   for( i = fIntervalNumber - 1; i >= 0; i-- )     689   for( i = fIntervalNumber - 1; i >= 0; i-- )
691   {                                               690   {
692     if( Tmax >= (*(*fMatSandiaMatrix)[i])[0] )    691     if( Tmax >= (*(*fMatSandiaMatrix)[i])[0] ) break;
693   }                                               692   }
694   if (i < 0) i = 0; // Tmax should be more tha    693   if (i < 0) i = 0; // Tmax should be more than 
695                     // first ionisation potent    694                     // first ionisation potential
696   fIntervalTmax = i;                              695   fIntervalTmax = i;
697                                                   696 
698   G4Integrator<G4InitXscPAI,G4double(G4InitXsc    697   G4Integrator<G4InitXscPAI,G4double(G4InitXscPAI::*)(G4double)> integral;
699                                                   698 
700   for( k = fPAIbin - 2; k >= 0; k-- )             699   for( k = fPAIbin - 2; k >= 0; k-- )
701   {                                               700   {
702     energy1 = fPAIdEdxVector->GetLowEdgeEnergy    701     energy1 = fPAIdEdxVector->GetLowEdgeEnergy(k);
703     energy2 = fPAIdEdxVector->GetLowEdgeEnergy    702     energy2 = fPAIdEdxVector->GetLowEdgeEnergy(k+1);
704                                                   703 
705     for( i = fIntervalTmax; i >= 0; i-- )         704     for( i = fIntervalTmax; i >= 0; i-- ) 
706     {                                             705     {
707       if( energy2 > (*(*fMatSandiaMatrix)[i])[    706       if( energy2 > (*(*fMatSandiaMatrix)[i])[0] ) break;
708     }                                             707     }
709     if(i < 0) i = 0;                              708     if(i < 0) i = 0;
710     i2 = i;                                       709     i2 = i;
711                                                   710 
712     for( i = fIntervalTmax; i >= 0; i-- )         711     for( i = fIntervalTmax; i >= 0; i-- ) 
713     {                                             712     {
714       if( energy1 > (*(*fMatSandiaMatrix)[i])[    713       if( energy1 > (*(*fMatSandiaMatrix)[i])[0] ) break;
715     }                                             714     }
716     if(i < 0) i = 0;                              715     if(i < 0) i = 0;
717     i1 = i;                                       716     i1 = i;
718                                                   717 
719     if( i1 == i2 )                                718     if( i1 == i2 )
720     {                                             719     {
721       fCurrentInterval = i1;                      720       fCurrentInterval = i1;
722       result += integral.Legendre10(this,&G4In    721       result += integral.Legendre10(this,&G4InitXscPAI::DifPAIdEdx,
723                                     energy1,en    722                                     energy1,energy2);
724       fPAIdEdxVector->PutValue(k,result);         723       fPAIdEdxVector->PutValue(k,result);
725     }                                             724     }
726     else                                          725     else
727     {                                             726     {
728       for( i = i2; i >= i1; i-- )                 727       for( i = i2; i >= i1; i-- ) 
729       {                                           728       {
730         fCurrentInterval = i;                     729         fCurrentInterval = i;
731                                                   730 
732         if( i==i2 )        result += integral.    731         if( i==i2 )        result += integral.Legendre10(this,
733                            &G4InitXscPAI::DifP    732                            &G4InitXscPAI::DifPAIdEdx,
734                            (*(*fMatSandiaMatri    733                            (*(*fMatSandiaMatrix)[i])[0] ,energy2);
735                                                   734 
736   else if( i == i1 ) result += integral.Legend    735   else if( i == i1 ) result += integral.Legendre10(this,
737                            &G4InitXscPAI::DifP    736                            &G4InitXscPAI::DifPAIdEdx,energy1,
738                            (*(*fMatSandiaMatri    737                            (*(*fMatSandiaMatrix)[i+1])[0]);
739                                                   738 
740         else               result += integral.    739         else               result += integral.Legendre10(this,
741                            &G4InitXscPAI::DifP    740                            &G4InitXscPAI::DifPAIdEdx,
742                        (*(*fMatSandiaMatrix)[i    741                        (*(*fMatSandiaMatrix)[i])[0] ,(*(*fMatSandiaMatrix)[i+1])[0]);
743       }                                           742       }
744       fPAIdEdxVector->PutValue(k,result);         743       fPAIdEdxVector->PutValue(k,result);
745     }                                             744     }
746     // G4cout<<k<<"\t"<<result<<G4endl;           745     // G4cout<<k<<"\t"<<result<<G4endl; 
747   }                                               746   }
748   return ;                                        747   return ;
749 }                                                 748 }
750                                                   749 
751 //////////////////////////////////////////////    750 ////////////////////////////////////////////////////////////////////////
752 //                                                751 //
753 // Calculation of the PAI Cerenkov integral cr    752 // Calculation of the PAI Cerenkov integral cross-section
754 // fIntegralCrenkov[1] = specific Crenkov ioni    753 // fIntegralCrenkov[1] = specific Crenkov ionisation, 1/cm
755 // and fIntegralCerenkov[0] = mean Cerenkov lo    754 // and fIntegralCerenkov[0] = mean Cerenkov loss per cm  in keV/cm
756                                                   755 
757 void G4InitXscPAI::IntegralCherenkov(G4double     756 void G4InitXscPAI::IntegralCherenkov(G4double bg2, G4double Tmax)
758 {                                                 757 {
759   G4int i,k,i1,i2;                                758   G4int i,k,i1,i2;
760   G4double energy1, energy2, beta2, module2, c    759   G4double energy1, energy2, beta2, module2, cos2, width, result = 0.;
761                                                   760  
762   fBetaGammaSq = bg2;                             761   fBetaGammaSq = bg2;
763   fTmax        = Tmax;                            762   fTmax        = Tmax;
764   beta2        = bg2/(1+bg2);                     763   beta2        = bg2/(1+bg2);
765                                                   764 
766   delete fPAIphotonVector;                     << 765   if(fPAIphotonVector) delete fPAIphotonVector;  
767   delete fChCosSqVector;                       << 766   if(fChCosSqVector)   delete fChCosSqVector;  
768   delete fChWidthVector;                       << 767   if(fChWidthVector)   delete fChWidthVector;  
769                                                   768   
770   fPAIphotonVector = new G4PhysicsLogVector( (    769   fPAIphotonVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
771   fChCosSqVector = new G4PhysicsLogVector( (*(    770   fChCosSqVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
772   fChWidthVector = new G4PhysicsLogVector( (*(    771   fChWidthVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
773                                                   772 
774   fPAIphotonVector->PutValue(fPAIbin-1,result)    773   fPAIphotonVector->PutValue(fPAIbin-1,result);
775   fChCosSqVector->PutValue(fPAIbin-1,1.);         774   fChCosSqVector->PutValue(fPAIbin-1,1.);
776   fChWidthVector->PutValue(fPAIbin-1,1e-7);       775   fChWidthVector->PutValue(fPAIbin-1,1e-7);
777                                                   776             
778   for( i = fIntervalNumber - 1; i >= 0; i-- )     777   for( i = fIntervalNumber - 1; i >= 0; i-- )
779   {                                               778   {
780     if( Tmax >= (*(*fMatSandiaMatrix)[i])[0] )    779     if( Tmax >= (*(*fMatSandiaMatrix)[i])[0] ) break;
781   }                                               780   }
782   if (i < 0) i = 0; // Tmax should be more tha    781   if (i < 0) i = 0; // Tmax should be more than 
783                     // first ionisation potent    782                     // first ionisation potential
784   fIntervalTmax = i;                              783   fIntervalTmax = i;
785                                                   784 
786   G4Integrator<G4InitXscPAI,G4double(G4InitXsc    785   G4Integrator<G4InitXscPAI,G4double(G4InitXscPAI::*)(G4double)> integral;
787                                                   786 
788   for( k = fPAIbin - 2; k >= 0; k-- )             787   for( k = fPAIbin - 2; k >= 0; k-- )
789   {                                               788   {
790     energy1 = fPAIphotonVector->GetLowEdgeEner    789     energy1 = fPAIphotonVector->GetLowEdgeEnergy(k);
791     energy2 = fPAIphotonVector->GetLowEdgeEner    790     energy2 = fPAIphotonVector->GetLowEdgeEnergy(k+1);
792                                                   791 
793     for( i = fIntervalTmax; i >= 0; i-- )         792     for( i = fIntervalTmax; i >= 0; i-- ) 
794     {                                             793     {
795       if( energy2 > (*(*fMatSandiaMatrix)[i])[    794       if( energy2 > (*(*fMatSandiaMatrix)[i])[0] ) break;
796     }                                             795     }
797     if(i < 0) i = 0;                              796     if(i < 0) i = 0;
798     i2 = i;                                       797     i2 = i;
799                                                   798 
800     for( i = fIntervalTmax; i >= 0; i-- )         799     for( i = fIntervalTmax; i >= 0; i-- ) 
801     {                                             800     {
802       if( energy1 > (*(*fMatSandiaMatrix)[i])[    801       if( energy1 > (*(*fMatSandiaMatrix)[i])[0] ) break;
803     }                                             802     }
804     if(i < 0) i = 0;                              803     if(i < 0) i = 0;
805     i1 = i;                                       804     i1 = i;
806                                                   805 
807     module2 = ModuleSqDielectricConst(i1,energ    806     module2 = ModuleSqDielectricConst(i1,energy1);
808     cos2    = RePartDielectricConst(energy1)/m    807     cos2    = RePartDielectricConst(energy1)/module2/beta2;      
809     width   = ImPartDielectricConst(i1,energy1    808     width   = ImPartDielectricConst(i1,energy1)/module2/beta2;
810                                                   809       
811     fChCosSqVector->PutValue(k,cos2);             810     fChCosSqVector->PutValue(k,cos2);
812     fChWidthVector->PutValue(k,width);            811     fChWidthVector->PutValue(k,width);
813                                                   812 
814     if( i1 == i2 )                                813     if( i1 == i2 )
815     {                                             814     {
816       fCurrentInterval = i1;                      815       fCurrentInterval = i1;
817       result += integral.Legendre10(this,&G4In    816       result += integral.Legendre10(this,&G4InitXscPAI::PAIdNdxCherenkov,
818                                     energy1,en    817                                     energy1,energy2);
819       fPAIphotonVector->PutValue(k,result);       818       fPAIphotonVector->PutValue(k,result);
820                                                   819 
821     }                                             820     }
822     else                                          821     else
823     {                                             822     {
824       for( i = i2; i >= i1; i-- )                 823       for( i = i2; i >= i1; i-- ) 
825       {                                           824       {
826         fCurrentInterval = i;                     825         fCurrentInterval = i;
827                                                   826 
828         if( i==i2 )        result += integral.    827         if( i==i2 )        result += integral.Legendre10(this,
829                            &G4InitXscPAI::PAId    828                            &G4InitXscPAI::PAIdNdxCherenkov,
830                            (*(*fMatSandiaMatri    829                            (*(*fMatSandiaMatrix)[i])[0] ,energy2);
831                                                   830 
832   else if( i == i1 ) result += integral.Legend    831   else if( i == i1 ) result += integral.Legendre10(this,
833                            &G4InitXscPAI::PAId    832                            &G4InitXscPAI::PAIdNdxCherenkov,energy1,
834                            (*(*fMatSandiaMatri    833                            (*(*fMatSandiaMatrix)[i+1])[0]);
835                                                   834 
836         else               result += integral.    835         else               result += integral.Legendre10(this,
837                            &G4InitXscPAI::PAId    836                            &G4InitXscPAI::PAIdNdxCherenkov,
838                        (*(*fMatSandiaMatrix)[i    837                        (*(*fMatSandiaMatrix)[i])[0] ,(*(*fMatSandiaMatrix)[i+1])[0]);
839       }                                           838       }
840       fPAIphotonVector->PutValue(k,result);       839       fPAIphotonVector->PutValue(k,result);
841     }                                             840     }
842     // G4cout<<k<<"\t"<<result<<G4endl;           841     // G4cout<<k<<"\t"<<result<<G4endl; 
843   }                                               842   }
844   return;                                         843   return;
845 }   // end of IntegralCerenkov                    844 }   // end of IntegralCerenkov 
846                                                   845 
847 //////////////////////////////////////////////    846 ////////////////////////////////////////////////////////////////////////
848 //                                                847 //
849 // Calculation of the PAI Plasmon integral cro    848 // Calculation of the PAI Plasmon integral cross-section
850 // fIntegralPlasmon[1] = splasmon primary ioni    849 // fIntegralPlasmon[1] = splasmon primary ionisation, 1/cm
851 // and fIntegralPlasmon[0] = mean plasmon loss    850 // and fIntegralPlasmon[0] = mean plasmon loss per cm  in keV/cm
852                                                   851 
853 void G4InitXscPAI::IntegralPlasmon(G4double bg    852 void G4InitXscPAI::IntegralPlasmon(G4double bg2, G4double Tmax)
854 {                                                 853 {
855   G4int i,k,i1,i2;                                854   G4int i,k,i1,i2;
856   G4double energy1, energy2, result = 0.;         855   G4double energy1, energy2, result = 0.;
857                                                   856  
858   fBetaGammaSq = bg2;                             857   fBetaGammaSq = bg2;
859   fTmax        = Tmax;                            858   fTmax        = Tmax;
860                                                   859 
861   delete fPAIelectronVector;                   << 860   if(fPAIelectronVector) delete fPAIelectronVector;  
862                                                   861   
863   fPAIelectronVector = new G4PhysicsLogVector(    862   fPAIelectronVector = new G4PhysicsLogVector( (*(*fMatSandiaMatrix)[0])[0], fTmax, fPAIbin);
864   fPAIelectronVector->PutValue(fPAIbin-1,resul    863   fPAIelectronVector->PutValue(fPAIbin-1,result);
865                                                   864             
866   for( i = fIntervalNumber - 1; i >= 0; i-- )     865   for( i = fIntervalNumber - 1; i >= 0; i-- )
867   {                                               866   {
868     if( Tmax >= (*(*fMatSandiaMatrix)[i])[0] )    867     if( Tmax >= (*(*fMatSandiaMatrix)[i])[0] ) break;
869   }                                               868   }
870   if (i < 0) i = 0; // Tmax should be more tha    869   if (i < 0) i = 0; // Tmax should be more than 
871                     // first ionisation potent    870                     // first ionisation potential
872   fIntervalTmax = i;                              871   fIntervalTmax = i;
873                                                   872 
874   G4Integrator<G4InitXscPAI,G4double(G4InitXsc    873   G4Integrator<G4InitXscPAI,G4double(G4InitXscPAI::*)(G4double)> integral;
875                                                   874 
876   for( k = fPAIbin - 2; k >= 0; k-- )             875   for( k = fPAIbin - 2; k >= 0; k-- )
877   {                                               876   {
878     energy1 = fPAIelectronVector->GetLowEdgeEn    877     energy1 = fPAIelectronVector->GetLowEdgeEnergy(k);
879     energy2 = fPAIelectronVector->GetLowEdgeEn    878     energy2 = fPAIelectronVector->GetLowEdgeEnergy(k+1);
880                                                   879 
881     for( i = fIntervalTmax; i >= 0; i-- )         880     for( i = fIntervalTmax; i >= 0; i-- ) 
882     {                                             881     {
883       if( energy2 > (*(*fMatSandiaMatrix)[i])[    882       if( energy2 > (*(*fMatSandiaMatrix)[i])[0] ) break;
884     }                                             883     }
885     if(i < 0) i = 0;                              884     if(i < 0) i = 0;
886     i2 = i;                                       885     i2 = i;
887                                                   886 
888     for( i = fIntervalTmax; i >= 0; i-- )         887     for( i = fIntervalTmax; i >= 0; i-- ) 
889     {                                             888     {
890       if( energy1 > (*(*fMatSandiaMatrix)[i])[    889       if( energy1 > (*(*fMatSandiaMatrix)[i])[0] ) break;
891     }                                             890     }
892     if(i < 0) i = 0;                              891     if(i < 0) i = 0;
893     i1 = i;                                       892     i1 = i;
894                                                   893 
895     if( i1 == i2 )                                894     if( i1 == i2 )
896     {                                             895     {
897       fCurrentInterval = i1;                      896       fCurrentInterval = i1;
898       result += integral.Legendre10(this,&G4In    897       result += integral.Legendre10(this,&G4InitXscPAI::PAIdNdxPlasmon,
899                                     energy1,en    898                                     energy1,energy2);
900       fPAIelectronVector->PutValue(k,result);     899       fPAIelectronVector->PutValue(k,result);
901     }                                             900     }
902     else                                          901     else
903     {                                             902     {
904       for( i = i2; i >= i1; i-- )                 903       for( i = i2; i >= i1; i-- ) 
905       {                                           904       {
906         fCurrentInterval = i;                     905         fCurrentInterval = i;
907                                                   906 
908         if( i==i2 )        result += integral.    907         if( i==i2 )        result += integral.Legendre10(this,
909                            &G4InitXscPAI::PAId    908                            &G4InitXscPAI::PAIdNdxPlasmon,
910                            (*(*fMatSandiaMatri    909                            (*(*fMatSandiaMatrix)[i])[0] ,energy2);
911                                                   910 
912   else if( i == i1 ) result += integral.Legend    911   else if( i == i1 ) result += integral.Legendre10(this,
913                            &G4InitXscPAI::PAId    912                            &G4InitXscPAI::PAIdNdxPlasmon,energy1,
914                            (*(*fMatSandiaMatri    913                            (*(*fMatSandiaMatrix)[i+1])[0]);
915                                                   914 
916         else               result += integral.    915         else               result += integral.Legendre10(this,
917                            &G4InitXscPAI::PAId    916                            &G4InitXscPAI::PAIdNdxPlasmon,
918                        (*(*fMatSandiaMatrix)[i    917                        (*(*fMatSandiaMatrix)[i])[0] ,(*(*fMatSandiaMatrix)[i+1])[0]);
919       }                                           918       }
920       fPAIelectronVector->PutValue(k,result);     919       fPAIelectronVector->PutValue(k,result);
921     }                                             920     }
922     // G4cout<<k<<"\t"<<result<<G4endl;           921     // G4cout<<k<<"\t"<<result<<G4endl; 
923   }                                               922   }
924   return;                                         923   return;
925 }   // end of IntegralPlasmon                     924 }   // end of IntegralPlasmon
926                                                   925 
927                                                   926 
928 //////////////////////////////////////////////    927 /////////////////////////////////////////////////////////////////////////
929 //                                                928 //
930 //                                                929 //
931                                                   930 
932 G4double G4InitXscPAI::GetPhotonLambda( G4doub    931 G4double G4InitXscPAI::GetPhotonLambda( G4double omega )
933 {                                                 932 {  
934   G4int i ;                                       933   G4int i ;
935   G4double omega2, omega3, omega4, a1, a2, a3,    934   G4double omega2, omega3, omega4, a1, a2, a3, a4, lambda ;
936                                                   935 
937   omega2 = omega*omega ;                          936   omega2 = omega*omega ;
938   omega3 = omega2*omega ;                         937   omega3 = omega2*omega ;
939   omega4 = omega2*omega2 ;                        938   omega4 = omega2*omega2 ;
940                                                   939 
941   for(i = 0; i < fIntervalNumber;i++)             940   for(i = 0; i < fIntervalNumber;i++)
942   {                                               941   {
943     if( omega < (*(*fMatSandiaMatrix)[i])[0] )    942     if( omega < (*(*fMatSandiaMatrix)[i])[0] ) break ;
944   }                                               943   }
945   if( i == 0 )                                    944   if( i == 0 )
946   {                                               945   {
947     G4cout<<"Warning: energy in G4InitXscPAI::    946     G4cout<<"Warning: energy in G4InitXscPAI::GetPhotonLambda < I1"<<G4endl;
948   }                                               947   }
949   else i-- ;                                      948   else i-- ;
950                                                   949 
951   a1 = (*(*fMatSandiaMatrix)[i])[1];              950   a1 = (*(*fMatSandiaMatrix)[i])[1]; 
952   a2 = (*(*fMatSandiaMatrix)[i])[2];              951   a2 = (*(*fMatSandiaMatrix)[i])[2]; 
953   a3 = (*(*fMatSandiaMatrix)[i])[3];              952   a3 = (*(*fMatSandiaMatrix)[i])[3]; 
954   a4 = (*(*fMatSandiaMatrix)[i])[4];              953   a4 = (*(*fMatSandiaMatrix)[i])[4]; 
955                                                   954 
956   lambda = 1./(a1/omega + a2/omega2 + a3/omega    955   lambda = 1./(a1/omega + a2/omega2 + a3/omega3 + a4/omega4);
957                                                   956 
958   return lambda ;                                 957   return lambda ;
959 }                                                 958 }
960                                                   959 
961 //////////////////////////////////////////////    960 /////////////////////////////////////////////////////////////////////////
962 //                                                961 //
963 //                                                962 //
964                                                   963 
965 //////////////////////////////////////////////    964 /////////////////////////////////////////////////////////////////////////
966 //                                                965 //
967 //                                                966 //
968                                                   967 
969 G4double G4InitXscPAI::GetStepEnergyLoss( G4do    968 G4double G4InitXscPAI::GetStepEnergyLoss( G4double step )
970 {                                                 969 {  
971   G4double loss = 0.0 ;                           970   G4double loss = 0.0 ;
972   loss *= step;                                   971   loss *= step;
973                                                   972 
974   return loss ;                                   973   return loss ;
975 }                                                 974 }
976                                                   975 
977 //////////////////////////////////////////////    976 /////////////////////////////////////////////////////////////////////////
978 //                                                977 //
979 //                                                978 //
980                                                   979 
981 G4double G4InitXscPAI::GetStepCerenkovLoss( G4    980 G4double G4InitXscPAI::GetStepCerenkovLoss( G4double step )
982 {                                                 981 {  
983   G4double loss = 0.0 ;                           982   G4double loss = 0.0 ;
984   loss *= step;                                   983   loss *= step;
985                                                   984 
986   return loss ;                                   985   return loss ;
987 }                                                 986 }
988                                                   987 
989 //////////////////////////////////////////////    988 /////////////////////////////////////////////////////////////////////////
990 //                                                989 //
991 //                                                990 //
992                                                   991 
993 G4double G4InitXscPAI::GetStepPlasmonLoss( G4d    992 G4double G4InitXscPAI::GetStepPlasmonLoss( G4double step )
994 {                                                 993 {  
995                                                   994 
996                                                   995 
997   G4double loss = 0.0 ;                           996   G4double loss = 0.0 ;
998   loss *= step;                                   997   loss *= step;
999   return loss ;                                   998   return loss ;
1000 }                                                999 }
1001                                                  1000 
1002                                                  1001    
1003 //                                               1002 //   
1004 // end of G4InitXscPAI implementation file       1003 // end of G4InitXscPAI implementation file 
1005 //                                               1004 //
1006 /////////////////////////////////////////////    1005 ////////////////////////////////////////////////////////////////////////////
1007                                                  1006 
1008                                                  1007