1 ///////////////////////////////////////////////////////////////////////////
5 // This file is part of starlight.
7 // starlight is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
12 // starlight is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with starlight. If not, see <http://www.gnu.org/licenses/>.
20 ///////////////////////////////////////////////////////////////////////////
22 // File and Version Information:
23 // $Rev:: $: revision of last commit
24 // $Author:: $: author of last commit
25 // $Date:: $: date of last commit
31 ///////////////////////////////////////////////////////////////////////////
37 #include "starlightconstants.h"
38 #include "reportingUtils.h"
40 #include <inputParameters.h>
44 using namespace starlightConstants;
46 //______________________________________________________________________________
47 nucleus::nucleus(const int Z,
49 const double deuteronSlopePar,
50 const bool dAuCoherentProduction)
53 _deuteronSlopePar(deuteronSlopePar),
54 _dAuCoherentProduction(dAuCoherentProduction)
105 case 1: // _Q0 and _rho0 are not relevant for protons.
112 printWarn << "density not defined for projectile with Z = " << _Z << ". using defaults." << endl;
113 _rho0 = 0.16; //'typical' density
114 _Q0 = 0.0; // not used.
116 _r0 = 1.16 * (1. - 1.16 * pow(_A, -2. / 3.)); // for FRITIOF and FormFactor.
119 //______________________________________________________________________________
124 //______________________________________________________________________________
126 nucleus::nuclearRadius() const
128 // we use this for specific nuclei, Au, Pb, protons...
133 if ((_Z == 1) && (_A == 1)) // proton
135 if ((_Z == 1) && (_A == 2)) // deuteron
137 return 1.2 * pow(_A, 1. / 3.);
141 //______________________________________________________________________________
143 nucleus::formFactor(const double t) const
145 // electromagnetic form factor of proton
146 if ((_Z == 1) && (_A == 1)) {
147 const double rec = 1. / (1. + t / 0.71);
150 // deuteron form factor
151 if ((_Z == 1) && (_A == 2)) { // careful with this line on dAu
152 // this is for dAu//Sergey
153 // sergey's stuff, also replaced b with _deuteronSlopePar and dropped t02 since it wasnt used
154 // incoherent form factor F(t) = 0.34 e(141.5 t) + 0.58 e(26.1 t) + 0.08 e(15.5 t)
155 const double st = 0.34 * exp(-141.5 * t ) + 0.58 * exp(-26.1 * t ) + 0.08 * exp(-15.5 * t );
156 const double st4 = 0.34 * exp(-141.5 * t / 4) + 0.58 * exp(-26.1 * t / 4) + 0.08 * exp(-15.5 * t / 4);
157 // st paramters from Franco and Varma for st eqn PRL33 ...
158 // form factor from Eisenberg, nuclear physics B 104
159 const double arg = _deuteronSlopePar * t;
160 if (_dAuCoherentProduction)
161 return (st4 * st4 * exp(-arg) - 0.068 * st4 * exp(-arg * 3. / 4.));
162 return exp(-arg) * 0.5 * (1 + st) - 0.068 * exp(-arg * 3. / 4.)
163 - st4 * st4 * exp(-arg) + 0.068 * st4 * exp(-arg * 3. / 4.);
165 // nuclear form factor
166 // use parameterization from FRITIOF
167 // R = r0 * A^{1/3} with r0 = 1.16 * (1 - 1.16 * A^{-2/3})
168 const double R = fritiofR0();
169 const double q = sqrt(t);
170 const double arg1 = q * R / hbarc;
171 const double arg2 = hbarc / (q * _r0);
172 const double sph = (sin(arg1) - arg1 * cos(arg1)) * 3. * arg2 * arg2 * arg2 / double(_A);
173 const double a0 = 0.70; // [fm]
174 return sph / (1. + (a0 * a0 * t) / (hbarc * hbarc));
177 //______________________________________________________________________________
180 nucleus::dipoleFormFactor(const double t, const double t0) const
182 const double rec = 1. / (1. + t / t0);
186 //______________________________________________________________________________
188 nucleus::thickness(const double b) const
190 // JS This code calculates the nuclear thickness function as per Eq. 4 in
191 // Klein and Nystrand, PRC 60.
192 // former DOUBLE PRECISION FUNCTION T(b)
194 // data for Gauss integration
195 const unsigned int nmbPoints = 5;
196 const double xg[nmbPoints + 1] = {0., 0.1488743390, 0.4333953941, 0.6794095683,
197 0.8650633667, 0.9739065285};
198 const double ag[nmbPoints + 1] = {0., 0.2955242247, 0.2692667193, 0.2190863625,
199 0.1494513492, 0.0666713443};
201 const double zMin = 0;
202 const double zMax = 15;
203 const double zRange = 0.5 * (zMax - zMin);
204 const double zMean = 0.5 * (zMax + zMin);
206 for(unsigned int i = 1; i <= nmbPoints; ++i) {
207 double zsp = zRange * xg[i] + zMean;
208 double radius = sqrt(b * b + zsp * zsp);
209 sum += ag[i] * rws(radius);
210 zsp = zRange * (-xg[i]) + zMean;
211 radius = sqrt(b * b + zsp * zsp);
212 sum += ag[i] * rws(radius);
215 return 2. * zRange * sum;