/* ======================================================================== *\ ! ! * ! * 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 12/2000 ! Author(s): Harald Kornmayer 1/2001 ! ! Copyright: MAGIC Software Development, 2000-2002 ! ! \* ======================================================================== */ /////////////////////////////////////////////////////////////////////// // // MGeomCam // // This is the base class of different camera geometries. It creates // a pixel object for a given number of pixels and defines the // interface of how to acccess the geometry information. // /////////////////////////////////////////////////////////////////////// #include "MGeomCam.h" #include // IsA()->New() #include "MLog.h" #include "MLogManip.h" #include "MGeomPix.h" ClassImp(MGeomCam); using namespace std; MGeomCam::MGeomCam() : fNumPixels(0), fCamDist(0), fConvMm2Deg(0) { } // -------------------------------------------------------------------------- // // Initializes a Camera Geometry with npix pixels. All pixels // are deleted when the corresponding array is deleted. // MGeomCam::MGeomCam(UInt_t npix, Float_t dist, const char *name, const char *title) : fNumPixels(npix), fCamDist(dist), fConvMm2Deg(kRad2Deg/(dist*1000)), fPixels(npix) { fName = name ? name : "MGeomCam"; fTitle = title ? title : "Storage container for a camera geometry"; // // make sure that the destructor delete all contained objects // fPixels.SetOwner(); for (UInt_t i=0; i(fPixels.UncheckedAt(i)); } MGeomPix &MGeomCam::operator[](Int_t i) const { return *static_cast(fPixels.UncheckedAt(i)); } // -------------------------------------------------------------------------- // // Set the kIsOuterRing flag for all pixels which have a outermost pixel // as Next Neighbor and don't have the kIsOutermostRing flag itself. // void MGeomCam::InitOuterRing() { fPixels.ForEach(MGeomPix, CheckOuterRing)(*this); } // -------------------------------------------------------------------------- // // Calculate the highest sector index+1 of all pixels, please make sure // the the sector numbers are continous. // void MGeomCam::CalcNumSectors() { fNumSectors = 0; for (UInt_t i=0; ifNumSectors) fNumSectors = s; } fNumSectors++; } // -------------------------------------------------------------------------- // // Calculate the maximum radius of the camera. This is ment for GUI layout. // void MGeomCam::CalcMaxRadius() { fMaxRadius = 0; for (UInt_t i=0; ifMaxRadius) fMaxRadius = maxr; } } // -------------------------------------------------------------------------- // // returns the ratio of the area of the pixel with index 0 to the pixel // with the specified index i. 0 Is returned if the index argument is // out of range. // Float_t MGeomCam::GetPixRatio(UInt_t i) const { return iNew(); }