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

Last change on this file since 19823 was 19673, checked in by tbretz, 5 years ago
Allow to create a camera without the blind pixels.
File size: 4.4 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.5021, 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//
63MGeomCamFAMOUS::MGeomCamFAMOUS(Double_t dist, bool all, const char *name)
64: MGeomCam(all?64:61, dist, name, "Geometry information of the final FAMOUS Camera")
65{
66 CreateCam(all);
67 InitGeometry();
68}
69
70// --------------------------------------------------------------------------
71//
72// Check if the photon which is flying along the trajectory u has passed
73// (or will pass) the frame of the camera (and consequently get
74// absorbed). The position p and direction u must be in the
75// telescope coordinate frame, which is z parallel to the focal plane,
76// x to the right and y upwards, looking from the mirror towards the camera.
77//
78// The units are cm.
79//
80Bool_t MGeomCamFAMOUS::HitFrame(MQuaternion p, const MQuaternion &u) const
81{
82 // It's a lens, there is no camera shadow
83
84 // z is defined from the mirror (0) to the camera (z>0).
85 // Thus we just propagate to the focal plane (z=fDist)
86 //p -= 1700./u.Z()*u;
87 //p.PropagateZ(u, GetCameraDist()*100); // m->cm
88
89 // Add 10% to the max radius and convert from mm to cm
90 return kFALSE;//p.R()<GetMaxRadius()*0.11;//TMath::Abs(p.X())<65 && TMath::Abs(p.Y())<65;
91}
92
93// --------------------------------------------------------------------------
94//
95void MGeomCamFAMOUS::CreateCam(bool all)
96{
97 const static Int_t dir[6] =
98 {
99 MGeomPix::kDirSE,
100 MGeomPix::kDirNE,
101 MGeomPix::kDirN,
102 MGeomPix::kDirNW,
103 MGeomPix::kDirSW,
104 MGeomPix::kDirS
105 };
106
107 const Int_t rings = 4;
108 const Double_t diameter = 16;
109
110 //
111 // add the first pixel to the list
112 //
113 const MGeomPix pix0(0, 0, diameter);
114 SetAt(0, pix0);
115
116 Double_t x, y;
117
118 Int_t cnt = 1;
119 for (int ring=1; ring<=rings; ring++)
120 {
121 for (Int_t s=0; s<6; s++)
122 {
123 for (int i=1; i<=ring; i++)
124 {
125 MGeomPix::CalcXY(dir[s], ring, i, x, y);
126
127 const MGeomPix pix(x*diameter, -y*diameter, diameter);
128 SetAt(cnt++, pix);
129 }
130 }
131 }
132
133 if (!all)
134 return;
135
136 MGeomPix::CalcXY(MGeomPix::kDirNW, 6, 2, x, y);
137 const MGeomPix pix62(x*diameter, -y*diameter, diameter);
138 SetAt(cnt++, pix62);
139
140 MGeomPix::CalcXY(MGeomPix::kDirSW, 6, 4, x, y);
141 const MGeomPix pix63(x*diameter, -y*diameter, diameter);
142 SetAt(cnt++, pix63);
143
144 MGeomPix::CalcXY(MGeomPix::kDirSE, 6, 2, x, y);
145 const MGeomPix pix64(x*diameter, -y*diameter, diameter);
146 SetAt(cnt++, pix64);
147
148
149}
Note: See TracBrowser for help on using the repository browser.