VRayleighModel.cc
Go to the documentation of this file.
1 
9 #include <utl/Point.h>
10 #include <utl/VRandomSampler.h>
11 #include <utl/RandomSamplerFromPDF.h>
12 #include <utl/PhysicalConstants.h>
13 #include <utl/TabulatedFunction.h>
14 
15 #include <atm/VRayleighModel.h>
16 
17 using namespace utl;
18 
19 
20 namespace atm {
21 
22  VRayleighModel::~VRayleighModel()
23  {
24  delete fAngularDistribution;
25  }
26 
27 
28  const utl::VRandomSampler&
29  VRayleighModel::EvaluateScatteringAngleDistribution(const utl::Point& p, const double wLength)
30  const
31  {
32  const double angleMin = 0*deg;
33  const double angleMax = 360*deg;
34  const int n = 180; // 2deg steps
35  const double delta = (angleMax - angleMin) / (n-1);
36 
38  for (int i = 0; i < n; ++i) {
39  const double angle = angleMin + delta * i;
40  const double prob = EvaluateScatteringAngle(p, angle, wLength);
41  pdf.PushBack(angle, prob);
42  }
43  delete fAngularDistribution;
44  fAngularDistribution = new RandomSamplerFromPDF(pdf, RandomSamplerFromPDF::eLinear);
45  return *fAngularDistribution;
46  }
47 
48 }
Point object.
Definition: Point.h:32
Class to hold collection (x,y) points and provide interpolation between them.
void PushBack(const double x, const double y)
constexpr double deg
Definition: AugerUnits.h:140
Class to shoot random numbers given by a user-defined distribution function.

, generated on Tue Sep 26 2023.