17 #include <utl/MathConstants.h>
18 #include <utl/AugerUnits.h>
19 #include <utl/ErrorLogger.h>
20 #include <utl/Photon.h>
21 #include <utl/Point.h>
22 #include <utl/Vector.h>
23 #include <utl/CoordinateSystemPtr.h>
25 #include <fdet/Telescope.h>
26 #include <fdet/Mirror.h>
28 #include <TPolyLine3D.h>
29 #include <TObjArray.h>
31 using namespace TelescopeSimulatorKG;
40 fOrigin =
Point (0, 0, 0, fTelCS);
61 err <<
"Missed Mirror : " << sphereStatus <<
" !!!";
67 photonOut = intersections.back().first;
68 Vector normal(intersections.back().second);
73 INFO(
"Not reflected at mirror");
84 TObjArray* objs =
new TObjArray();
92 double segWidth = width/nSeg;
94 for (
int i=0; i<nSeg; i++) {
96 for (
int j=0; j<nSeg; j++) {
98 double x_center = -(width-segWidth)/2 + (width-segWidth)/(nSeg-1)*i;
99 double y_center = -(width-segWidth)/2 + (width-segWidth)/(nSeg-1)*j;
101 double x1 = x_center-segWidth/2;
102 double x2 = x_center+segWidth/2;
103 double y1 = y_center-segWidth/2;
104 double y2 = y_center+segWidth/2;
106 double r1 =
sqrt (x1*x1 + y1*y1);
107 double r2 =
sqrt (x2*x2 + y1*y1);
108 double r3 =
sqrt (x1*x1 + y2*y2);
109 double r4 =
sqrt (x2*x2 + y2*y2);
111 double z1 = -
sqrt (fRCurv*fRCurv - r1*r1);
112 double z2 = -
sqrt (fRCurv*fRCurv - r2*r2);
113 double z3 = -
sqrt (fRCurv*fRCurv - r3*r3);
114 double z4 = -
sqrt (fRCurv*fRCurv - r4*r4);
116 TPolyLine3D *l1 =
new TPolyLine3D (4);
117 l1->SetLineColor (color);
118 l1->SetLineWidth (size);
119 l1->SetPoint (0, x1,y1,z1);
120 l1->SetPoint (1, x2,y1,z2);
121 l1->SetPoint (2, x2,y2,z4);
122 l1->SetPoint (3, x1,y2,z3);
123 l1->SetPoint (4, x1,y1,z1);
double GetSigmaNormal() const
Variable to model the mirror surface imperfection.
int Reflection(const utl::Photon &photonIn, const Vector &normal, utl::Photon &photonOut)
Mirror(utl::RandomEngine &rndm, const fdet::Telescope &tel)
#define INFO(message)
Macro for logging informational messages.
int Sphere(const Point &origin, const double radius, const utl::Photon &photonIn, IntersectionList &intersection)
utl::CoordinateSystemPtr GetTelescopeCoordinateSystem() const
Wraps the random number engine used to generate distributions.
std::vector< PhotonNormalPair > IntersectionList
double GetRadiusOfCurvature() const
Average radius of curvature for the segments.
Detector description interface for Telescope-related data.
const Mirror & GetMirror() const
Get the Mirror object that belongs to the telescope.
#define ERROR(message)
Macro for logging error messages.
RTResult Trace(const utl::Photon &photonIn, utl::Photon &photonOut)