/* ======================================================================== *\ ! ! * ! * 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, 10/2003 ! Author(s): Hendrik Bartko, 08/2004 ! ! Copyright: MAGIC Software Development, 2000-2004 ! ! \* ======================================================================== */ ///////////////////////////////////////////////////////////////////////////// // // MHexagonFreqSpace // // This is a generalized class storing camera data. It stores real and // imaginary part of the triangular frequency space of the MHexagonalFT. // ///////////////////////////////////////////////////////////////////////////// #include "MHexagonFreqSpace.h" #include "MMath.h" #include "MLog.h" #include "MLogManip.h" #include "MGeomCam.h" #include "MGeomPix.h" ClassImp(MHexagonFreqSpace); using namespace std; // -------------------------------------------------------------------------- // // Creates a MCerPhotPix object for each pixel in the event // MHexagonFreqSpace::MHexagonFreqSpace(const char *name, const char *title) { fName = name ? name : "MHexagonFreqSpace"; fTitle = title ? title : "Storage container for fourier space camera"; } Double_t MHexagonFreqSpace::GetAbs(UInt_t idx) const { return TMath::Hypot(fDataRe[idx], fDataIm[idx]); } /* // -------------------------------------------------------------------------- // // This is not yet implemented like it should. // void MHexagonFreqSpace::Draw(Option_t* option) { // // FIXME!!! Here the Draw function of the CamDisplay // should be called to add the CamDisplay to the Pad. // The drawing should be done in MCamDisplay::Paint // // MGeomCam *geom = fType ? new MGeomCamMagic : new MGeomCamCT1; // MCamDisplay *disp = new MCamDisplay(geom); // delete geom; // disp->DrawPhotNum(this); } */ // -------------------------------------------------------------------------- // // Returns the contents of the pixel. // type 0: sqrt(re^2+im^2) // type 1: re // type 2: im // Bool_t MHexagonFreqSpace::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const { if (idx<0 || (UInt_t)idx>=fDataRe.GetSize()) return kFALSE; switch (type) { case 0: val = TMath::Hypot(fDataRe[idx], fDataIm[idx]); break; case 1: val = fDataRe[idx]; break; case 2: val = fDataIm[idx]; break; } return kTRUE; } // -------------------------------------------------------------------------- // // Set real and imaginary part from MArrayD re and im. The size of both // arrays must be identical. // void MHexagonFreqSpace::Set(const MArrayD &re, const MArrayD &im) { if (re.GetSize()!=im.GetSize()) return; /* fDataRe.Set(re.GetSize()); fDataIm.Set(re.GetSize()); for(unsigned int j=0; jSetAt(idx1, MGeomPix(n-j, (n+j-num/2)*fgTan30, 2)); (*cam)[idx1].SetNeighbors(); } } cam->InitGeometry(); return cam; }