G4INCLDeuteronDensity.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // INCL++ intra-nuclear cascade model
00027 // Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
00028 // Davide Mancusi, CEA
00029 // Alain Boudard, CEA
00030 // Sylvie Leray, CEA
00031 // Joseph Cugnon, University of Liege
00032 //
00033 #define INCLXX_IN_GEANT4_MODE 1
00034 
00035 #include "globals.hh"
00036 
00044 #include "G4INCLDeuteronDensity.hh"
00045 #include "G4INCLGlobals.hh"
00046 // #include <cassert>
00047 #include <algorithm>
00048 
00049 namespace G4INCL {
00050 
00052   const G4double DeuteronDensity::coeff1[coeffTableSize] = {
00053     0.88688076e+0,
00054     -0.34717093e+0,
00055     -0.30502380e+1,
00056     0.56207766e+2,
00057     -0.74957334e+3,
00058     0.53365279e+4,
00059     -0.22706863e+5,
00060     0.60434469e+5,
00061     -0.10292058e+6,
00062     0.11223357e+6,
00063     -0.75925226e+5,
00064     0.29059715e+5,
00065     -0.48157368e+4
00066   };
00067 
00069   const G4double DeuteronDensity::coeff2[coeffTableSize] = {
00070     0.23135193e-1,
00071     -0.85604572e+0,
00072     0.56068193e+1,
00073     -0.69462922e+2,
00074     0.41631118e+3,
00075     -0.12546621e+4,
00076     0.12387830e+4,
00077     0.33739172e+4,
00078     -0.13041151e+5,
00079     0.19512524e+5,
00080     -0.15634324e+5,
00081     0.66231089e+4,
00082     -0.11698185e+4
00083   };
00084 
00086   const G4double DeuteronDensity::normalisationR = std::sqrt(32. * Math::pi) * 0.28212;
00087 
00089   const G4double DeuteronDensity::normalisationP = normalisationR / (std::sqrt(4. * Math::pi) * std::pow(PhysicalConstants::hc,1.5));
00090 
00092   const G4double DeuteronDensity::al = 0.23162461;
00093 
00094   G4double DeuteronDensity::densityR(const G4double r) {
00095     const G4double sWave = wavefunctionR(0, r);
00096     const G4double dWave = wavefunctionR(2, r);
00097     return r*r*(sWave*sWave + dWave*dWave);
00098   }
00099 
00100   G4double DeuteronDensity::derivDensityR(const G4double r) {
00101     const G4double sWave = wavefunctionR(0, r);
00102     const G4double dWave = wavefunctionR(2, r);
00103     const G4double sWaveDeriv = derivWavefunctionR(0, r);
00104     const G4double dWaveDeriv = derivWavefunctionR(2, r);
00105     return (sWave*sWaveDeriv + dWave*dWaveDeriv) / Math::twoPi;
00106   }
00107 
00108   G4double DeuteronDensity::densityP(const G4double p) {
00109     const G4double sWave = wavefunctionP(0, p);
00110     const G4double dWave = wavefunctionP(2, p);
00111     return p*p*(sWave*sWave + dWave*dWave);
00112   }
00113 
00114   G4double DeuteronDensity::wavefunctionR(const G4int l, const G4double theR) {
00115 // assert(l==0 || l==2); // only s- and d-waves in a deuteron
00116     const G4double r = 2. * std::max(theR, 1.e-4);
00117 
00118     G4double result = 0.;
00119     G4double fmr;
00120 
00121     for(G4int i=0; i<coeffTableSize; ++i) {
00122       fmr = r * (al+i);
00123       if(l==0) { // s-wave
00124         result += coeff1[i] * std::exp(-fmr);
00125       } else { // d-wave
00126         result += coeff2[i] * std::exp(-fmr) * (1.+3./fmr+3./(fmr*fmr));
00127       }
00128     }
00129 
00130     result *= normalisationR/r;
00131     return result;
00132   }
00133 
00134   G4double DeuteronDensity::derivWavefunctionR(const G4int l, const G4double theR) {
00135 // assert(l==0 || l==2); // only s- and d-waves in a deuteron
00136     const G4double r = 2. * std::max(theR, 1.e-4);
00137 
00138     G4double result = 0.;
00139     G4double fmr;
00140 
00141     for(G4int i=0; i<coeffTableSize; ++i) {
00142       fmr = r * (al+i);
00143       if(l==0) { // s-wave
00144         result += coeff1[i] * std::exp(-fmr) * (fmr + 1.);
00145       } else { // d-wave
00146         result += coeff2[i] * std::exp(-fmr) * (fmr + 4. + 9./fmr + 9./(fmr*fmr));
00147       }
00148     }
00149 
00150     result *= -normalisationR/(r*r);
00151     return result;
00152   }
00153 
00154   G4double DeuteronDensity::wavefunctionP(const G4int l, const G4double theQ) {
00155 // assert(l==0 || l==2); // only s- and d-waves in a deuteron
00156     const G4double q = theQ / PhysicalConstants::hc;
00157     const G4double q2 = q*q;
00158     G4double result=0.;
00159     G4double fmq, alPlusI;
00160     for(G4int i=0; i<coeffTableSize; ++i) {
00161       alPlusI = al+i;
00162       fmq = q2 + alPlusI*alPlusI;
00163       if(l==0) { // s-wave
00164         result += coeff1[i] / fmq;
00165       } else { // d-wave
00166         result += coeff2[i] / fmq;
00167       }
00168     }
00169 
00170     result *= normalisationP;
00171     return result;
00172   }
00173 
00174 }
00175 

Generated on Mon May 27 17:48:35 2013 for Geant4 by  doxygen 1.4.7