VMieModel.cc
Go to the documentation of this file.
1 
10 #include <utl/Point.h>
11 #include <utl/VRandomSampler.h>
12 #include <utl/RandomSamplerFromPDF.h>
13 #include <utl/PhysicalConstants.h>
14 #include <utl/TabulatedFunction.h>
15 
16 #include <atm/VMieModel.h>
17 
18 using namespace atm;
19 using namespace utl;
20 
21 
23  fAngularDistribution(0)
24 {
25 }
26 
27 
29 {
30  delete fAngularDistribution;
31 }
32 
33 
36  const double wLength)
37  const
38 {
39  const double angleMin = 0*deg;
40  const double angleMax = 360*deg;
41  const int n = 180; // 2deg steps
42  const double delta = (angleMax - angleMin) / (n-1);
43 
45  for (int i = 0; i < n; ++i) {
46  const double angle = angleMin + delta*i;
47  const double prob = EvaluateScatteringAngle(p, angle, wLength);
48  pdf.PushBack(angle, prob);
49  }
50  delete fAngularDistribution;
52  new RandomSamplerFromPDF(pdf, RandomSamplerFromPDF::eLinear);
53  return *fAngularDistribution;
54 }
55 
56 
57 // Configure (x)emacs for this file ...
58 // Local Variables:
59 // mode: c++
60 // compile-command: "make -C .. -k"
61 // End:
virtual const utl::VRandomSampler & EvaluateScatteringAngleDistribution(const utl::Point &p, const double wLength) const
Definition: VMieModel.cc:35
Point object.
Definition: Point.h:32
virtual ~VMieModel()
Definition: VMieModel.cc:28
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
virtual double EvaluateScatteringAngle(const utl::Point &p, const double angle, const double wLength) const =0
utl::VRandomSampler * fAngularDistribution
Definition: VMieModel.h:94
Class to shoot random numbers given by a user-defined distribution function.

, generated on Tue Sep 26 2023.