]>
Commit | Line | Data |
---|---|---|
da32329d AM |
1 | /////////////////////////////////////////////////////////////////////////// |
2 | // | |
3 | // Copyright 2010 | |
4 | // | |
5 | // This file is part of starlight. | |
6 | // | |
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. | |
11 | // | |
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. | |
16 | // | |
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/>. | |
19 | // | |
20 | /////////////////////////////////////////////////////////////////////////// | |
21 | // | |
22 | // File and Version Information: | |
23 | // $Rev:: 164 $: revision of last commit | |
24 | // $Author:: odjuvsla $: author of last commit | |
25 | // $Date:: 2013-10-06 16:18:08 +0200 #$: date of last commit | |
26 | // | |
27 | // Description: | |
28 | // | |
29 | // | |
30 | // | |
31 | /////////////////////////////////////////////////////////////////////////// | |
32 | ||
33 | ||
34 | #include <iostream> | |
35 | #include <fstream> | |
36 | #include <cmath> | |
37 | ||
38 | #include "starlightconstants.h" | |
39 | #include "inputParameters.h" | |
40 | #include "reportingUtils.h" | |
41 | #include "bessel.h" | |
42 | #include "beam.h" | |
43 | ||
44 | ||
45 | using namespace std; | |
46 | using namespace starlightConstants; | |
47 | ||
48 | //______________________________________________________________________________ | |
49 | beam::beam(const int Z_, | |
50 | const int A_, | |
51 | const double bdeuteron, | |
52 | const bool dAuCoherentProduction) | |
53 | : nucleus(Z_, | |
54 | A_, | |
55 | bdeuteron, | |
56 | dAuCoherentProduction) | |
57 | ,_beamLorentzGamma(inputParametersInstance.beamLorentzGamma()) | |
58 | { | |
59 | } | |
60 | ||
61 | ||
62 | //______________________________________________________________________________ | |
63 | beam::~beam() | |
64 | { } | |
65 | ||
66 | ||
67 | //______________________________________________________________________________ | |
68 | double beam::photonFlux(const double impactparameter, | |
69 | const double photonEnergy) const | |
70 | { | |
71 | // function for the calculation of the "photon density". | |
72 | // photonFlux = number of photons / (energy * area) | |
73 | // assume beta = 1 and gamma >> 1, i.e. neglect the (1 / gamma^2) * K_0(x) term | |
74 | ||
75 | const double X | |
76 | = (impactparameter * photonEnergy) / (_beamLorentzGamma * hbarc); | |
77 | if (X <= 0) | |
78 | printWarn << "X = " << X << endl; | |
79 | ||
80 | const double factor1 = (double(Z() * Z()) * alpha) / (pi * pi); | |
81 | const double factor2 = 1. / (photonEnergy * impactparameter * impactparameter); | |
82 | const double bessel = bessel::dbesk1(X); | |
83 | const double factor3 = X * X * bessel * bessel; | |
84 | ||
85 | return factor1 * factor2 * factor3; | |
86 | } |