GamR  0.0.0
GammaROOT
Loading...
Searching...
No Matches
PopulationParameter.cc
Go to the documentation of this file.
1
13
14#include <math.h>
15
17
18namespace GamR {
19namespace AngDist {
30 {
31 for (int im = 0; im<2*j+1; ++im) {
32 this->Pm.push_back(1.0/(2*j+1));
33 }
34 }
35
36
38 /* equation 2.54 */
39 {
40 double sigma = sigmaj * j;
41 double sum = 0;
42 for (int im = 0; im < 2 * j + 1; ++im) {
43
44 double m = (double)im - j;
45 this->Pm.push_back(exp(-pow(m, 2) / (2 * pow(sigma, 2))));
46 sum = sum + exp(-pow(m, 2) / (2 * pow(sigma, 2)));
47 }
48
49 for (int i = 0; i <= 2 * j + 1; ++i) {
50 this->Pm[i] = this->Pm[i] / sum; /* normalise */
51 }
52 }
53} /* namespace AngDist */
54} /* namespace GamR */
Definition Gain.cc:19