Modules/FdSimulation/TelescopeSimulatorKG2/Camera.h
Go to the documentation of this file.
1 #ifndef _TelescopeSimulatorKG2_Camera_h_
2 #define _TelescopeSimulatorKG2_Camera_h_
3 
4 #include "RTResult.h"
5 #include "RayTracer.h"
6 
7 #include <utl/Point.h>
8 #include <utl/CoordinateSystemPtr.h>
9 
10 
11 namespace utl {
12  class Photon;
13  class Vector;
14  class RandomEngine;
15 }
16 
17 namespace fdet {
18  class Telescope;
19 }
20 
21 class TObjArray;
22 
23 
24 namespace TelescopeSimulatorKG2 {
25 
35  class Camera {
36 
37  public:
39  const fdet::Telescope& tel,
40  const bool plotPhotonTracksAtMercedes,
41  const bool simulateMercedesStars,
42  const bool simulateHaloEffects,
43  const bool simulateGhostEffects,
44  const double nPmts);
45 
46  // Shadow of camera simulation
47  RTNext TraceShadow(const utl::Photon& photonIn, utl::Photon& photonOut,
48  const bool doSupport = true);
49 
50  // Simulate Camera
51  RTNext Trace(const utl::Photon& photonIn, utl::Photon& photonOut,
52  int& nreflections, int& nbackscattered,
53  int& col, int& row);
54 
55  TObjArray* Draw(const bool do3D = true);
56 
57  // Compute the hit position of a ray on the camera surface
58  bool TraceSurf(const utl::Photon& photonIn, utl::Photon& photonOut);
59 
60  // Simulate the ray of light with direction n and point p in the
61  // mercedes and PMT system
63  const utl::Photon& photonIn,
64  utl::Photon& photonOut,
65  int& nreflections);
66 
67  // Give the position pf over the focal surface identify the pixel (nx,ny)
68  //int PixelId(const utl::Point& p, int* nx, int* ny);
69  //int PixelId_new(const utl::Vector& pFocal, int& nx, int& ny);
70 
72  eInside = 0, // cathode
73  eTopRight = 1,
74  eTopLeft = 2,
75  eLeft = 3,
78  eRight = 6,
79  eOutside = 7 // focal plane
80  };
81 
82  HexagonDirection Hexagon(const double x, const double y, const double r);
83 
84  void ConstructPlane(const int id, utl::Vector& n, utl::Point& p, const utl::CoordinateSystemPtr& pxlCS);
85 
86  // this is just needed for photon plotting
87  void SetPhotonTrack(RayTracer::Track* const track) { fPhotonTrack = track; }
88 
89  private:
90  Camera(const Camera&);
91  Camera& operator=(const Camera&);
92 
93  void SetMercedesParameter(const double height, const double width);
95  bool FindPixelId(const utl::Vector& incidentDir, int& row, int& col) const;
96 
103 
104  const double fPMT_n;
105  const double fAir_n = 1.000277; // at STP
106 
109 
110  const double fRFocal; // curvature radius of focal surface
111  const double fMercedesEff;
112 
113  // Warning: the values of SIN_?? may need some changes to simulate
114  // correctly the camera (shadow and trace_surf).
115  // side, top and down limits
116  //const double fSinAx = 0.2491262;
117  //const double fSinBx = 0.25646528973;
118  //const double fSinAy = 0.27966724;
119  //const double fSinBy = 0.26704475;
120 
121  // Mercedes parameters
122  double fD1 = 0;
123  double fD2 = 0;
124  double fR1 = 0;
125  double fR2 = 0;
126  double fHMerc = 0;
127 
128  // mercedes size parameters (see picture)
129  double fNz = 0;
130  double fNt = 0; // z and tangent components of the plane normal.
131 
132  // Variables to control the precision of the normal of the mercedes surface
133  const double fSigma;
134 
135  // camera support
137 
138  // to check for photons to be inside camera bays
139  double fRCurv2 = 0;
140 
141  // for visual plotting of ray tracing details
143 
144  };
145 
146 }
147 
148 
149 #endif
bool TraceSurf(const utl::Photon &photonIn, utl::Photon &photonOut)
HexagonDirection Hexagon(const double x, const double y, const double r)
Point object.
Definition: Point.h:32
RTNext TraceShadow(const utl::Photon &photonIn, utl::Photon &photonOut, const bool doSupport=true)
RTNext Trace(const utl::Photon &photonIn, utl::Photon &photonOut, int &nreflections, int &nbackscattered, int &col, int &row)
RTResult TraceMerc(const utl::CoordinateSystemPtr &pxlCS, const utl::Photon &photonIn, utl::Photon &photonOut, int &nreflections)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Wraps the random number engine used to generate distributions.
Definition: RandomEngine.h:27
void ConstructPlane(const int id, utl::Vector &n, utl::Point &p, const utl::CoordinateSystemPtr &pxlCS)
Camera & operator=(const Camera &)
Camera(utl::RandomEngine &rndm, const fdet::Telescope &tel, const bool plotPhotonTracksAtMercedes, const bool simulateMercedesStars, const bool simulateHaloEffects, const bool simulateGhostEffects, const double nPmts)
void SetMercedesParameter(const double height, const double width)
Detector description interface for Telescope-related data.
Vector object.
Definition: Vector.h:30
bool FindPixelId(const utl::Vector &incidentDir, int &row, int &col) const

, generated on Tue Sep 26 2023.