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 08/2010 <mailto:thomas.bretz@epfl.ch>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2010
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MGeomCamFACT
|
---|
28 | //
|
---|
29 | // This class stores the geometry information of the final FACT camera.
|
---|
30 | // MGeomCamFACT cam; // Creates the final FACT camera
|
---|
31 | //
|
---|
32 | ////////////////////////////////////////////////////////////////////////////
|
---|
33 | #include "MGeomCamFACT.h"
|
---|
34 |
|
---|
35 | #include <TMath.h>
|
---|
36 |
|
---|
37 | #include "MGeomPix.h"
|
---|
38 |
|
---|
39 | ClassImp(MGeomCamFACT);
|
---|
40 |
|
---|
41 | using namespace std;
|
---|
42 |
|
---|
43 | // --------------------------------------------------------------------------
|
---|
44 | //
|
---|
45 | MGeomCamFACT::MGeomCamFACT(const char *name)
|
---|
46 | : MGeomCam(1440, 4.90, name, "Geometry information of the final FACT Camera")
|
---|
47 | {
|
---|
48 | CreateCam();
|
---|
49 | InitGeometry();
|
---|
50 | }
|
---|
51 |
|
---|
52 | // --------------------------------------------------------------------------
|
---|
53 | //
|
---|
54 | MGeomCamFACT::MGeomCamFACT(Double_t dist, const char *name)
|
---|
55 | : MGeomCam(1440, dist, name, "Geometry information of the final FACT 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 MGeomCamFACT::HitFrame(MQuaternion p, const MQuaternion &u) const
|
---|
72 | {
|
---|
73 | // z is defined from the mirror (0) to the camera (z>0).
|
---|
74 | // Thus we just propagate to the focal plane (z=fDist)
|
---|
75 | //p -= 1700./u.Z()*u;
|
---|
76 | p.PropagateZ(u, GetCameraDist()*100); // m->cm
|
---|
77 |
|
---|
78 | // Add 10% to the max radius and convert from mm to cm
|
---|
79 | return p.R()<GetMaxRadius()*0.11;//TMath::Abs(p.X())<65 && TMath::Abs(p.Y())<65;
|
---|
80 | }
|
---|
81 |
|
---|
82 | // --------------------------------------------------------------------------
|
---|
83 | //
|
---|
84 | #include <iostream>
|
---|
85 | #include <iomanip>
|
---|
86 | void MGeomCamFACT::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 = 23;
|
---|
99 | const Double_t diameter = 9.5;
|
---|
100 |
|
---|
101 | // add the first pixel to the list
|
---|
102 | //
|
---|
103 | MGeomPix pix0(0, -0.5*diameter, diameter);
|
---|
104 | pix0.SetPhi(TMath::Pi()/2);
|
---|
105 | SetAt(0, pix0);
|
---|
106 |
|
---|
107 | Int_t cnt = 1;
|
---|
108 | for (int ring=1; ring<=rings; ring++)
|
---|
109 | {
|
---|
110 | for (Int_t s=0; s<6; s++)
|
---|
111 | {
|
---|
112 | for (int i=1; i<=ring; i++)
|
---|
113 | {
|
---|
114 | Double_t x, y;
|
---|
115 | const Double_t d2 = MGeomPix::CalcXY(dir[s], ring, i, x, y);
|
---|
116 | if (d2 - x > 395.75)
|
---|
117 | continue;
|
---|
118 |
|
---|
119 | MGeomPix pix(y*diameter, (x-0.5)*diameter, diameter);
|
---|
120 | pix.SetPhi(TMath::Pi()/2);
|
---|
121 | SetAt(cnt++, pix);
|
---|
122 |
|
---|
123 | if (cnt!=1416)
|
---|
124 | continue;
|
---|
125 |
|
---|
126 | MGeomPix pix1( y*diameter, -6.5*diameter, diameter);
|
---|
127 | MGeomPix pix2(-y*diameter, -6.5*diameter, diameter);
|
---|
128 | pix1.SetPhi(TMath::Pi()/2);
|
---|
129 | pix2.SetPhi(TMath::Pi()/2);
|
---|
130 | SetAt(1438, pix1);
|
---|
131 | SetAt(1439, pix2);
|
---|
132 | }
|
---|
133 | }
|
---|
134 | }
|
---|
135 | }
|
---|