EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
spectrum.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file spectrum.h
1 
2 /*
3  <one line to give the program's name and a brief idea of what it does.>
4  Copyright (C) <year> <name of author>
5 
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.
10 
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.
15 
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/>.
18 
19 */
20 
21 #ifndef SPECTRUM_H
22 #define SPECTRUM_H
23 
24 #include <vector>
25 #include "randomgenerator.h"
26 class beamBeamSystem;
27 //class randomGenerator;
28 
29 class spectrum
30 {
31 public:
32 
34  spectrum(const randomGenerator &randy, beamBeamSystem *bbs);
35 
40  int generateKsingle();
41 
46  int generateKdouble();
47 
52  double drawKsingle();
53 
60  void drawKdouble(float &egamma1, float &egamma2);
61 
64  _beamBeamSystem = bbs;
65  }
66 
68  void setMinGammaEnergy(double energy) { _eGammaMin = energy; }
69 
71  void setMaxGammaEnergy(double energy) { _eGammaMax = energy; }
72 
74  void setBmin(double bmin) { _bMin = bmin; }
75 
77  void setBmax(double bmax) { _bMax = bmax; }
78 
79 protected:
80 
82  virtual bool generateBreakupProbabilities();
83 
85  virtual double getSigma(double /*egamma*/) const {
86  return 1.05;
87  }
88 
89  virtual double getTransformedNofe(double egamma, double b);
90 
92  double _bMin;
93 
95  double _bMax;
96 
98  int _nBbins;
99 
101  std::vector<double> _probOfBreakup;
102 
105 
106 private:
107  double getFnSingle(double egamma) const;
108 
109  double getFnDouble(double egamma1, double egamma2) const;
110 
112  int _nK;
113 
115  std::vector<double> _fnSingle;
116 
118  std::vector<std::vector<double> > _fnDouble;
119 
121  std::vector<double> _fnSingleCumulative;
122 
124  std::vector<std::vector<double> > _fnDoubleCumulative;
125 
127  std::vector<double> _fnDoubleInt;
128 
130  std::vector<double> _fnDoubleIntCumulative;
131 
133  std::vector<double> _eGamma;
134 
136  double _eGammaMin;
137 
139  double _eGammaMax;
140 
142  int _zTarget;
143 
145  int _aTarget;
146 
149 
152 
154  spectrum();
155 
156 };
157 
158 #endif // SPECTRUM_H