source: trunk/Mars/mgeom/MGeomCamFAMOUS.cc@ 19305

Last change on this file since 19305 was 18785, checked in by tbretz, 8 years ago
Added FAMOUS camera layout
File size: 4.0 KB
Line 
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
39ClassImp(MGeomCamFAMOUS);
40
41using namespace std;
42
43// --------------------------------------------------------------------------
44//
45MGeomCamFAMOUS::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//
54MGeomCamFAMOUS::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//
71Bool_t MGeomCamFAMOUS::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//
84void MGeomCamFAMOUS::CreateCam()
85{
86 const static Int_t dir[6] =
87 {
88 MGeomPix::kDirSE,
89 MGeomPix::kDirNE,
90 MGeomPix::kDirN,
91 MGeomPix::kDirNW,
92 MGeomPix::kDirSW,
93 MGeomPix::kDirS
94 };
95
96 const Int_t rings = 4;
97 const Double_t diameter = 16;
98
99 //
100 // add the first pixel to the list
101 //
102 const MGeomPix pix0(0, 0, diameter);
103 SetAt(0, pix0);
104
105 Double_t x, y;
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 MGeomPix::CalcXY(dir[s], ring, i, x, y);
115
116 const MGeomPix pix(x*diameter, -y*diameter, diameter);
117 SetAt(cnt++, pix);
118 }
119 }
120 }
121
122 MGeomPix::CalcXY(MGeomPix::kDirNW, 6, 2, x, y);
123 const MGeomPix pix62(x*diameter, -y*diameter, diameter);
124 SetAt(cnt++, pix62);
125
126 MGeomPix::CalcXY(MGeomPix::kDirSW, 6, 4, x, y);
127 const MGeomPix pix63(x*diameter, -y*diameter, diameter);
128 SetAt(cnt++, pix63);
129
130 MGeomPix::CalcXY(MGeomPix::kDirSE, 6, 2, x, y);
131 const MGeomPix pix64(x*diameter, -y*diameter, diameter);
132 SetAt(cnt++, pix64);
133
134
135}
Note: See TracBrowser for help on using the repository browser.