/RayTracer.h
Go to the documentation of this file.
1 #ifndef _TelescopeSimulatorKG2_RayTracer_h_
2 #define _TelescopeSimulatorKG2_RayTracer_h_
3 
4 
5 #include "RTResult.h"
6 
7 #include <utl/CoordinateSystemPtr.h>
8 #include <utl/TabulatedFunction.h>
9 
10 #include <vector>
11 #include <string>
12 
13 class TObjArray;
14 
15 namespace fdet {
16  class Telescope;
17 }
18 
19 namespace utl {
20  class RandomEngine;
21  class Photon;
22  class Point;
23 }
24 
25 class TPolyLine3D;
26 class TObjArray;
27 
28 namespace TelescopeSimulatorKG2 {
29 
30  class Lens;
31  class Mirror;
32  class Camera;
33  class Filter;
34 
43  class RayTracer {
44 
45  RayTracer();
46  RayTracer& operator=(const RayTracer&);
47  RayTracer(const RayTracer&);
48 
49  public:
50 
51  // helper class to store photon track coordinates.
52  // just for plotting (visual debugging)
53  class Track {
54  public:
55  Track(const utl::CoordinateSystemPtr& cs) : fCS(cs), fColor(1) {}
56  void AddPoint(const utl::Point& p);
57  void SetColor(const int color) {fColor=color;}
58  TPolyLine3D* GetLine();
59  private:
61  int fColor;
62  std::vector<float> fX; // TPolyLine3D can only float ...
63  std::vector<float> fY;
64  std::vector<float> fZ;
65  };
66 
67  RayTracer(const int Verbosity,
68  const fdet::Telescope& tel,
69  utl::RandomEngine& random,
70  bool simulateShadow,
71  bool simualteCameraSupportShadow,
72  bool simulateMercedesStars,
73  bool simulateFilterStructure,
74  bool simulateHaloEffects,
75  bool simulateGhostEffects,
76  const int maxMirrorReflections,
77  const double mirrorSize,
78  const double mirrorSegmentSigma,
79  const double mirrorRadiusSigma,
80  const double mirrorAbsorptionTop,
81  const double mirrorAbsorptionBot,
82  utl::TabulatedFunction* mirrorDiffusionTop,
83  utl::TabulatedFunction* mirrorDiffusionBot,
84  const double filterIncreaseReflInside,
85  const double filterIncreaseReflOutside,
86  const double filterPosition,
87  const double filterPositionVertical,
88  const double filterPositionVertical2,
89  const double filterPositionHorizontal,
90  const double filterDustAbsorption,
91  const double lensIncreaseRefl,
92  const double lensPosition,
93  const double minLensThickness,
94  const double torusRadius,
95  const double tubeRadius,
96  const double torusZ0,
97  const double pmt_n,
98  bool plotPhotonTracks=false,
99  bool plotPhotonTracksAtMercedes=false,
100  double drawPhotonsProbabilty=0);
101 
102  ~RayTracer();
103 
104  RTResult Trace(const utl::Photon& photonIn,
105  utl::Photon& photonOut,
106  int& nreflections,
107  int& nbackscattered,
108  int& col,
109  int& row);
110 
111  private:
123 
124  // for 3d plotting
127  TObjArray* fObjectsPhotons;
128 
134  };
135 
136 } // TelescopeSimulatorKG2
137 
138 #endif // _TelescopeSimulatorKG2_RayTracer_h_
139 
140 // Configure (x)emacs for this file ...
141 // Local Variables:
142 // mode:c++
143 // compile-command: "make -C .. -k"
144 // End:
const utl::CoordinateSystemPtr & fCS
Definition: /RayTracer.h:60
Point object.
Definition: Point.h:32
Simulates the UV filter in the raytracing of the TelescopeSimulator module.
RayTracer & operator=(const RayTracer &)
Simulates the corrector ring in the raytracing of the TelescopeSimulator module.
Definition: /Lens.h:38
Class to hold collection (x,y) points and provide interpolation between them.
const utl::RandomEngine * fRandom
Definition: /RayTracer.h:114
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
void AddPoint(const utl::Point &p)
Definition: /RayTracer.cc:34
Wraps the random number engine used to generate distributions.
Definition: RandomEngine.h:27
Simulates all ray tracing inside a telescope.
Definition: /RayTracer.h:43
RTResult Trace(const utl::Photon &photonIn, utl::Photon &photonOut, int &nreflections, int &nbackscattered, int &col, int &row)
Raytracing through the telescope components.
Definition: /RayTracer.cc:192
Detector description interface for Telescope-related data.
Simulates the mirror in the raytracing of the TelescopeSimulator module.
Track(const utl::CoordinateSystemPtr &cs)
Definition: /RayTracer.h:55
const fdet::Telescope * fTel
Definition: /RayTracer.h:113

, generated on Tue Sep 26 2023.