3 <one line to give the program's name and a brief idea of what it does.>
4 Copyright (C) <year> <name of author>
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
26 class randomGenerator;
32 /** Spectrum must be constructed with beam-beam system, default constructor disallowed */
33 spectrum(beamBeamSystem *bbs);
36 * Generate a table of photon energy probabilities
37 * Use NK+1 logarithmic steps between Et_min and Eg_max
39 int generateKsingle();
42 * Generate a 2-D table of photon energy probabilities
43 * Use NK+1 x NK+1 logarithmic steps between Et_min and Eg_max
45 int generateKdouble();
48 * Get the energy of a single gamma
49 * @return energy of the gamma
54 * Get the energy of a single gamma
55 * @param egamma1 variable passed by reference to get the energy of the frst gamma
56 * @param egamma2 variable passed by reference to get the energy of the second gamma
57 * @return energy of the gamma
59 void drawKdouble(float &egamma1, float &egamma2);
61 /** Set the beam beam system */
62 void setBeamBeamSystem(beamBeamSystem *bbs) {
63 _beamBeamSystem = bbs;
66 /** Set the minimum gamma energy */
67 void setMinGammaEnergy(double energy) { _eGammaMin = energy; }
69 /** Set the maximum gamma energy */
70 void setMaxGammaEnergy(double energy) { _eGammaMax = energy; }
72 /** Set minimum impact parameter */
73 void setBmin(double bmin) { _bMin = bmin; }
75 /** Set maximum impact parameter */
76 void setBmax(double bmax) { _bMax = bmax; }
80 /** Generate the hadron breakup probability table */
81 virtual bool generateBreakupProbabilities();
83 /** Needs some explanation */
84 virtual double getSigma(double /*egamma*/) const {
88 virtual double getTransformedNofe(double egamma, double b);
90 /** Minimum impact parameter */
93 /** Maximum impact parameter */
96 /** Number of bins in impact parameter */
99 /** Vector containing the probability of breakup */
100 std::vector<double> _probOfBreakup;
102 /** Beam beam system */
103 beamBeamSystem *_beamBeamSystem;
106 double getFnSingle(double egamma) const;
108 double getFnDouble(double egamma1, double egamma2) const;
113 /** Contains the 1 photon probabilities */
114 std::vector<double> _fnSingle;
116 /** Contains the 2 photon probabilities */
117 std::vector<std::vector<double> > _fnDouble;
119 /** Contains the cumulative distribution */
120 std::vector<double> _fnSingleCumulative;
122 /** Contains the cumulative distribution */
123 std::vector<std::vector<double> > _fnDoubleCumulative;
126 std::vector<double> _fnDoubleInt;
129 std::vector<double> _fnDoubleIntCumulative;
131 /** Vecotr of gamma energies */
132 std::vector<double> _eGamma;
134 /** Min gamma energy */
137 /** Max gamma energy */
146 /** Hadron breakup probability is calculated */
147 bool _hadBreakProbCalculated;
149 /** Default constructed disallowed (not implemented) */