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 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/hadronic/models/inclxx/incl_physics/src/G4INCLDeuteronDensity.cc (Version 11.3.0) and /processes/hadronic/models/inclxx/incl_physics/src/G4INCLDeuteronDensity.cc (Version 9.6.p2)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
 26 // INCL++ intra-nuclear cascade model              26 // INCL++ intra-nuclear cascade model
 27 // Alain Boudard, CEA-Saclay, France           <<  27 // Pekka Kaitaniemi, CEA and Helsinki Institute of Physics
 28 // Joseph Cugnon, University of Liege, Belgium <<  28 // Davide Mancusi, CEA
 29 // Jean-Christophe David, CEA-Saclay, France   <<  29 // Alain Boudard, CEA
 30 // Pekka Kaitaniemi, CEA-Saclay, France, and H <<  30 // Sylvie Leray, CEA
 31 // Sylvie Leray, CEA-Saclay, France            <<  31 // Joseph Cugnon, University of Liege
 32 // Davide Mancusi, CEA-Saclay, France          << 
 33 //                                                 32 //
 34 #define INCLXX_IN_GEANT4_MODE 1                    33 #define INCLXX_IN_GEANT4_MODE 1
 35                                                    34 
 36 #include "globals.hh"                              35 #include "globals.hh"
 37                                                    36 
 38 /** \file G4INCLDeuteronDensity.cc                 37 /** \file G4INCLDeuteronDensity.cc
 39  * \brief Deuteron density in r and p accordin     38  * \brief Deuteron density in r and p according to the Paris potential.
 40  *                                                 39  *
 41  * \date 6 March 2012                              40  * \date 6 March 2012
 42  * \author Davide Mancusi                          41  * \author Davide Mancusi
 43  */                                                42  */
 44                                                    43 
 45 #include "G4INCLDeuteronDensity.hh"                44 #include "G4INCLDeuteronDensity.hh"
 46 #include "G4INCLGlobals.hh"                        45 #include "G4INCLGlobals.hh"
 47 // #include <cassert>                              46 // #include <cassert>
 48 #include <algorithm>                               47 #include <algorithm>
 49                                                    48 
 50 namespace G4INCL {                                 49 namespace G4INCL {
 51                                                    50 
 52   namespace DeuteronDensity {                  <<  51   /// \brief Coefficients for the deuteron wave function
 53                                                <<  52   const G4double DeuteronDensity::coeff1[coeffTableSize] = {
 54     namespace {                                <<  53     0.88688076e+0,
 55                                                <<  54     -0.34717093e+0,
 56       const G4int coeffTableSize = 13;         <<  55     -0.30502380e+1,
 57                                                <<  56     0.56207766e+2,
 58       /// \brief Coefficients for the deuteron <<  57     -0.74957334e+3,
 59       const G4double coeff1[coeffTableSize] =  <<  58     0.53365279e+4,
 60         0.88688076e+0,                         <<  59     -0.22706863e+5,
 61         -0.34717093e+0,                        <<  60     0.60434469e+5,
 62         -0.30502380e+1,                        <<  61     -0.10292058e+6,
 63         0.56207766e+2,                         <<  62     0.11223357e+6,
 64         -0.74957334e+3,                        <<  63     -0.75925226e+5,
 65         0.53365279e+4,                         <<  64     0.29059715e+5,
 66         -0.22706863e+5,                        <<  65     -0.48157368e+4
 67         0.60434469e+5,                         <<  66   };
 68         -0.10292058e+6,                        <<  67 
 69         0.11223357e+6,                         <<  68   /// \brief Coefficients for the deuteron wave function
 70         -0.75925226e+5,                        <<  69   const G4double DeuteronDensity::coeff2[coeffTableSize] = {
 71         0.29059715e+5,                         <<  70     0.23135193e-1,
 72         -0.48157368e+4                         <<  71     -0.85604572e+0,
 73       };                                       <<  72     0.56068193e+1,
 74                                                <<  73     -0.69462922e+2,
 75       /// \brief Coefficients for the deuteron <<  74     0.41631118e+3,
 76       const G4double coeff2[coeffTableSize] =  <<  75     -0.12546621e+4,
 77         0.23135193e-1,                         <<  76     0.12387830e+4,
 78         -0.85604572e+0,                        <<  77     0.33739172e+4,
 79         0.56068193e+1,                         <<  78     -0.13041151e+5,
 80         -0.69462922e+2,                        <<  79     0.19512524e+5,
 81         0.41631118e+3,                         <<  80     -0.15634324e+5,
 82         -0.12546621e+4,                        <<  81     0.66231089e+4,
 83         0.12387830e+4,                         <<  82     -0.11698185e+4
 84         0.33739172e+4,                         <<  83   };
 85         -0.13041151e+5,                        <<  84 
 86         0.19512524e+5,                         <<  85   /// \brief Normalisation coefficient for the r-space deuteron wave function
 87         -0.15634324e+5,                        <<  86   const G4double DeuteronDensity::normalisationR = std::sqrt(32. * Math::pi) * 0.28212;
 88         0.66231089e+4,                         <<  87 
 89         -0.11698185e+4                         <<  88   /// \brief Normalisation coefficient for the p-space deuteron wave function
 90       };                                       <<  89   const G4double DeuteronDensity::normalisationP = normalisationR / (std::sqrt(4. * Math::pi) * std::pow(PhysicalConstants::hc,1.5));
 91                                                <<  90 
 92       /// \brief Normalisation coefficient for <<  91   /// \brief Mysterious coefficient that appears in the wavefunctions
 93       const G4double normalisationR = std::sqr <<  92   const G4double DeuteronDensity::al = 0.23162461;
 94                                                <<  93 
 95       /// \brief Normalisation coefficient for <<  94   G4double DeuteronDensity::densityR(const G4double r) {
 96       const G4double normalisationP = normalis <<  95     const G4double sWave = wavefunctionR(0, r);
 97                                                <<  96     const G4double dWave = wavefunctionR(2, r);
 98       /// \brief Mysterious coefficient that a <<  97     return r*r*(sWave*sWave + dWave*dWave);
 99       const G4double al = 0.23162461;          <<  98   }
100                                                << 
101     }                                          << 
102                                                << 
103     G4double densityR(const G4double r) {      << 
104       const G4double sWave = wavefunctionR(0,  << 
105       const G4double dWave = wavefunctionR(2,  << 
106       return r*r*(sWave*sWave + dWave*dWave);  << 
107     }                                          << 
108                                                    99 
109     G4double derivDensityR(const G4double r) { << 100   G4double DeuteronDensity::derivDensityR(const G4double r) {
110       const G4double sWave = wavefunctionR(0,  << 101     const G4double sWave = wavefunctionR(0, r);
111       const G4double dWave = wavefunctionR(2,  << 102     const G4double dWave = wavefunctionR(2, r);
112       const G4double sWaveDeriv = derivWavefun << 103     const G4double sWaveDeriv = derivWavefunctionR(0, r);
113       const G4double dWaveDeriv = derivWavefun << 104     const G4double dWaveDeriv = derivWavefunctionR(2, r);
114       return (sWave*sWaveDeriv + dWave*dWaveDe << 105     return (sWave*sWaveDeriv + dWave*dWaveDeriv) / Math::twoPi;
115     }                                          << 106   }
116                                                   107 
117     G4double densityP(const G4double p) {      << 108   G4double DeuteronDensity::densityP(const G4double p) {
118       const G4double sWave = wavefunctionP(0,  << 109     const G4double sWave = wavefunctionP(0, p);
119       const G4double dWave = wavefunctionP(2,  << 110     const G4double dWave = wavefunctionP(2, p);
120       return p*p*(sWave*sWave + dWave*dWave);  << 111     return p*p*(sWave*sWave + dWave*dWave);
121     }                                          << 112   }
122                                                   113 
123     G4double wavefunctionR(const G4int l, cons << 114   G4double DeuteronDensity::wavefunctionR(const G4int l, const G4double theR) {
124 // assert(l==0 || l==2); // only s- and d-wave    115 // assert(l==0 || l==2); // only s- and d-waves in a deuteron
125       const G4double r = 2. * std::max(theR, 1 << 116     const G4double r = 2. * std::max(theR, 1.e-4);
126                                                   117 
127       G4double result = 0.;                    << 118     G4double result = 0.;
128       G4double fmr;                            << 119     G4double fmr;
129                                                   120 
130       for(G4int i=0; i<coeffTableSize; ++i) {  << 121     for(G4int i=0; i<coeffTableSize; ++i) {
131         fmr = r * (al+i);                      << 122       fmr = r * (al+i);
132         if(l==0) { // s-wave                   << 123       if(l==0) { // s-wave
133           result += coeff1[i] * std::exp(-fmr) << 124         result += coeff1[i] * std::exp(-fmr);
134         } else { // d-wave                     << 125       } else { // d-wave
135           result += coeff2[i] * std::exp(-fmr) << 126         result += coeff2[i] * std::exp(-fmr) * (1.+3./fmr+3./(fmr*fmr));
136         }                                      << 
137       }                                           127       }
138                                                << 
139       result *= normalisationR/r;              << 
140       return result;                           << 
141     }                                             128     }
142                                                   129 
143     G4double derivWavefunctionR(const G4int l, << 130     result *= normalisationR/r;
                                                   >> 131     return result;
                                                   >> 132   }
                                                   >> 133 
                                                   >> 134   G4double DeuteronDensity::derivWavefunctionR(const G4int l, const G4double theR) {
144 // assert(l==0 || l==2); // only s- and d-wave    135 // assert(l==0 || l==2); // only s- and d-waves in a deuteron
145       const G4double r = 2. * std::max(theR, 1 << 136     const G4double r = 2. * std::max(theR, 1.e-4);
146                                                   137 
147       G4double result = 0.;                    << 138     G4double result = 0.;
148       G4double fmr;                            << 139     G4double fmr;
149                                                   140 
150       for(G4int i=0; i<coeffTableSize; ++i) {  << 141     for(G4int i=0; i<coeffTableSize; ++i) {
151         fmr = r * (al+i);                      << 142       fmr = r * (al+i);
152         if(l==0) { // s-wave                   << 143       if(l==0) { // s-wave
153           result += coeff1[i] * std::exp(-fmr) << 144         result += coeff1[i] * std::exp(-fmr) * (fmr + 1.);
154         } else { // d-wave                     << 145       } else { // d-wave
155           result += coeff2[i] * std::exp(-fmr) << 146         result += coeff2[i] * std::exp(-fmr) * (fmr + 4. + 9./fmr + 9./(fmr*fmr));
156         }                                      << 
157       }                                           147       }
158                                                << 
159       result *= -normalisationR/(r*r);         << 
160       return result;                           << 
161     }                                             148     }
162                                                   149 
163     G4double wavefunctionP(const G4int l, cons << 150     result *= -normalisationR/(r*r);
                                                   >> 151     return result;
                                                   >> 152   }
                                                   >> 153 
                                                   >> 154   G4double DeuteronDensity::wavefunctionP(const G4int l, const G4double theQ) {
164 // assert(l==0 || l==2); // only s- and d-wave    155 // assert(l==0 || l==2); // only s- and d-waves in a deuteron
165       const G4double q = theQ / PhysicalConsta << 156     const G4double q = theQ / PhysicalConstants::hc;
166       const G4double q2 = q*q;                 << 157     const G4double q2 = q*q;
167       G4double result=0.;                      << 158     G4double result=0.;
168       G4double fmq, alPlusI;                   << 159     G4double fmq, alPlusI;
169       for(G4int i=0; i<coeffTableSize; ++i) {  << 160     for(G4int i=0; i<coeffTableSize; ++i) {
170         alPlusI = al+i;                        << 161       alPlusI = al+i;
171         fmq = q2 + alPlusI*alPlusI;            << 162       fmq = q2 + alPlusI*alPlusI;
172         if(l==0) { // s-wave                   << 163       if(l==0) { // s-wave
173           result += coeff1[i] / fmq;           << 164         result += coeff1[i] / fmq;
174         } else { // d-wave                     << 165       } else { // d-wave
175           result += coeff2[i] / fmq;           << 166         result += coeff2[i] / fmq;
176         }                                      << 
177       }                                           167       }
178                                                << 
179       result *= normalisationP;                << 
180       return result;                           << 
181     }                                             168     }
182                                                   169 
                                                   >> 170     result *= normalisationP;
                                                   >> 171     return result;
183   }                                               172   }
184                                                   173 
185 }                                                 174 }
                                                   >> 175 
186                                                   176