/* ======================================================================== *\ ! ! * ! * This file is part of MARS, the MAGIC Analysis and Reconstruction ! * Software. It is distributed to you in the hope that it can be a useful ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes. ! * It is distributed WITHOUT ANY WARRANTY. ! * ! * Permission to use, copy, modify and distribute this software and its ! * documentation for any purpose is hereby granted without fee, ! * provided that the above copyright notice appear in all copies and ! * that both that copyright notice and this permission notice appear ! * in supporting documentation. It is provided "as is" without express ! * or implied warranty. ! * ! ! ! Author(s): Thomas Bretz 03/2007 ! Author(s): Michael Backes 03/2007 ! ! Copyright: MAGIC Software Development, 2000-2008 ! ! \* ======================================================================== */ ///////////////////////////////////////////////////////////////////////////// // // MGeomCamDwarf // // This class stores the geometry information of the Dwarf camera. // MGeomCamDwarf cam; // Creates the 313 pixel dwarf camera // // It can also be used to create a hexagonal camera with identical sized // pixels and n rings (while the central pixel is counted as ring 0). // MGeomCamDwarf cam(9, 21); // Creates the CT3 camera // // Or it can be used to create a roundish camera, similar to a // hexagonal camera, but the edges filled with additional pixels // inside a circle. // MGeomCamDwarf cam(209.5, 13.2); // //////////////////////////////////////////////////////////////////////////// #include "MGeomCamDwarf.h" #include #include #include #include "MGeomPix.h" ClassImp(MGeomCamDwarf); using namespace std; // -------------------------------------------------------------------------- // // Dwarf camera has 313 pixels. For geometry and Next Neighbor info see // CreateCam and CreateNN // MGeomCamDwarf::MGeomCamDwarf(const char *name) : MGeomCam(CalcNumPix(9.5), 4.57, name, "Geometry information of Dwarf Camera") { CreateCam(21, 9.5); InitGeometry(); } // -------------------------------------------------------------------------- // // Use this to create a camera with a roundish shape and a radius rad in // millimeter containing the pixel centers. The pixel will have a diameter // diameter in millimeters, and a distance dist in meters. // MGeomCamDwarf::MGeomCamDwarf(Double_t rad, Double_t diameter, Double_t dist, const char *name) : MGeomCam(CalcNumPix(diameter<=0 ? rad : rad/diameter), dist, name, "Geometry information for a roundish camera") { CreateCam(diameter, diameter<=0 ? rad : rad/diameter); InitGeometry(); } // -------------------------------------------------------------------------- // // Use this to create a camera with a hexagonal shape and rings rings. // The first ring around the central pixel is 1. The pixel will have a // diameter diameter in millimeters, and a distance dist in meters. // MGeomCamDwarf::MGeomCamDwarf(Int_t rings, Double_t diameter, Double_t dist, const char *name) : MGeomCam(CalcNumPix(rings), dist, name, "Geometry information for a hexagonal camera") { CreateCam(diameter, rings); InitGeometry(); } // -------------------------------------------------------------------------- // // Check if the photon which is flying along the trajectory u has passed // (or will pass) the frame of the camera (and consequently get // absorbed). The position p and direction u must be in the // telescope coordinate frame, which is z parallel to the focal plane, // x to the right and y upwards, looking from the mirror towards the camera. // // The units are cm. // Bool_t MGeomCamDwarf::HitFrame(MQuaternion p, const MQuaternion &u) const { // z is defined from the mirror (0) to the camera (z>0). // Thus we just propagate to the focal plane (z=fDist) //p -= 1700./u.Z()*u; p.PropagateZ(u, GetCameraDist()*100); // m->cm // Add 10% to the max radius and convert from mm to cm return p.R()