1 | /* ======================================================================== *\
|
---|
2 | !
|
---|
3 | ! *
|
---|
4 | ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
---|
5 | ! * Software. It is distributed to you in the hope that it can be a useful
|
---|
6 | ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
---|
7 | ! * It is distributed WITHOUT ANY WARRANTY.
|
---|
8 | ! *
|
---|
9 | ! * Permission to use, copy, modify and distribute this software and its
|
---|
10 | ! * documentation for any purpose is hereby granted without fee,
|
---|
11 | ! * provided that the above copyright notice appear in all copies and
|
---|
12 | ! * that both that copyright notice and this permission notice appear
|
---|
13 | ! * in supporting documentation. It is provided "as is" without express
|
---|
14 | ! * or implied warranty.
|
---|
15 | ! *
|
---|
16 | !
|
---|
17 | !
|
---|
18 | ! Author(s): Thomas Bretz 03/2017 <mailto:tbretz@physik.rwth-aachen.de>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2017
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MGeomCamFAMOUS
|
---|
28 | //
|
---|
29 | // This class stores the geometry information of the final FAMOUS camera.
|
---|
30 | // MGeomCamFAMOUS cam; // Creates the final FAMOUS camera
|
---|
31 | //
|
---|
32 | ////////////////////////////////////////////////////////////////////////////
|
---|
33 | #include "MGeomCamFAMOUS.h"
|
---|
34 | #include <iostream>
|
---|
35 | #include <TMath.h>
|
---|
36 |
|
---|
37 | #include "MGeomPix.h"
|
---|
38 |
|
---|
39 | ClassImp(MGeomCamFAMOUS);
|
---|
40 |
|
---|
41 | using namespace std;
|
---|
42 |
|
---|
43 | // --------------------------------------------------------------------------
|
---|
44 | //
|
---|
45 | MGeomCamFAMOUS::MGeomCamFAMOUS(const char *name)
|
---|
46 | : MGeomCam(64, 0.55, name, "Geometry information of the final FAMOUS Camera")
|
---|
47 | {
|
---|
48 | CreateCam();
|
---|
49 | InitGeometry();
|
---|
50 | }
|
---|
51 |
|
---|
52 | // --------------------------------------------------------------------------
|
---|
53 | //
|
---|
54 | MGeomCamFAMOUS::MGeomCamFAMOUS(Double_t dist, const char *name)
|
---|
55 | : MGeomCam(64, dist, name, "Geometry information of the final FAMOUS Camera")
|
---|
56 | {
|
---|
57 | CreateCam();
|
---|
58 | InitGeometry();
|
---|
59 | }
|
---|
60 |
|
---|
61 | // --------------------------------------------------------------------------
|
---|
62 | //
|
---|
63 | // Check if the photon which is flying along the trajectory u has passed
|
---|
64 | // (or will pass) the frame of the camera (and consequently get
|
---|
65 | // absorbed). The position p and direction u must be in the
|
---|
66 | // telescope coordinate frame, which is z parallel to the focal plane,
|
---|
67 | // x to the right and y upwards, looking from the mirror towards the camera.
|
---|
68 | //
|
---|
69 | // The units are cm.
|
---|
70 | //
|
---|
71 | Bool_t MGeomCamFAMOUS::HitFrame(MQuaternion p, const MQuaternion &u) const
|
---|
72 | {
|
---|
73 | // It's a lens, there is no camera shadow
|
---|
74 |
|
---|
75 | // z is defined from the mirror (0) to the camera (z>0).
|
---|
76 | // Thus we just propagate to the focal plane (z=fDist)
|
---|
77 | //p -= 1700./u.Z()*u;
|
---|
78 | //p.PropagateZ(u, GetCameraDist()*100); // m->cm
|
---|
79 |
|
---|
80 | // Add 10% to the max radius and convert from mm to cm
|
---|
81 | return kFALSE;//p.R()<GetMaxRadius()*0.11;//TMath::Abs(p.X())<65 && TMath::Abs(p.Y())<65;
|
---|
82 | }
|
---|
83 |
|
---|
84 | // --------------------------------------------------------------------------
|
---|
85 | //
|
---|
86 | void MGeomCamFAMOUS::CreateCam()
|
---|
87 | {
|
---|
88 | const static Int_t dir[6] =
|
---|
89 | {
|
---|
90 | MGeomPix::kDirSE,
|
---|
91 | MGeomPix::kDirNE,
|
---|
92 | MGeomPix::kDirN,
|
---|
93 | MGeomPix::kDirNW,
|
---|
94 | MGeomPix::kDirSW,
|
---|
95 | MGeomPix::kDirS
|
---|
96 | };
|
---|
97 |
|
---|
98 | const Int_t rings = 4;
|
---|
99 | const Double_t diameter = 16;
|
---|
100 |
|
---|
101 | //
|
---|
102 | // add the first pixel to the list
|
---|
103 | //
|
---|
104 | const MGeomPix pix0(0, 0, diameter);
|
---|
105 | SetAt(0, pix0);
|
---|
106 |
|
---|
107 | Double_t x, y;
|
---|
108 |
|
---|
109 | Int_t cnt = 1;
|
---|
110 | for (int ring=1; ring<=rings; ring++)
|
---|
111 | {
|
---|
112 | for (Int_t s=0; s<6; s++)
|
---|
113 | {
|
---|
114 | for (int i=1; i<=ring; i++)
|
---|
115 | {
|
---|
116 | MGeomPix::CalcXY(dir[s], ring, i, x, y);
|
---|
117 |
|
---|
118 | const MGeomPix pix(x*diameter, -y*diameter, diameter);
|
---|
119 | SetAt(cnt++, pix);
|
---|
120 | }
|
---|
121 | }
|
---|
122 | }
|
---|
123 |
|
---|
124 | MGeomPix::CalcXY(MGeomPix::kDirNW, 6, 2, x, y);
|
---|
125 | const MGeomPix pix62(x*diameter, -y*diameter, diameter);
|
---|
126 | SetAt(cnt++, pix62);
|
---|
127 |
|
---|
128 | MGeomPix::CalcXY(MGeomPix::kDirSW, 6, 4, x, y);
|
---|
129 | const MGeomPix pix63(x*diameter, -y*diameter, diameter);
|
---|
130 | SetAt(cnt++, pix63);
|
---|
131 |
|
---|
132 | MGeomPix::CalcXY(MGeomPix::kDirSE, 6, 2, x, y);
|
---|
133 | const MGeomPix pix64(x*diameter, -y*diameter, diameter);
|
---|
134 | SetAt(cnt++, pix64);
|
---|
135 |
|
---|
136 |
|
---|
137 | }
|
---|