/* ======================================================================== *\ ! ! * ! * 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 ! ! \* ======================================================================== */ ///////////////////////////////////////////////////////////////////////////// // // MCameraData // // This is a generalized class storing camera data. For example the cleaning // level for the image cleaning is one possibility. // ///////////////////////////////////////////////////////////////////////////// #include "MCameraData.h" #include "MCerPhotEvt.h" #include "MCerPhotPix.h" #include "MGeomCam.h" #include "MGeomPix.h" #include "MLog.h" #include "MLogManip.h" #include "MPedPhotCam.h" #include "MPedPhotPix.h" #include "MSigmabar.h" ClassImp(MCameraData); using namespace std; // -------------------------------------------------------------------------- // // Creates a MCerPhotPix object for each pixel in the event // MCameraData::MCameraData(const char *name, const char *title) { fName = name ? name : "MCameraData"; fTitle = title ? title : "Generalized storage container for camera contents"; } /* // -------------------------------------------------------------------------- // // This is not yet implemented like it should. // void MCameraData::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); } */ // -------------------------------------------------------------------------- // // Function to calculate the cleaning level for all pixels in a given event // as the ratio between the measured photons and the pedestal rms. // In order to do the image cleaning on average in the same photon flux // (reconstructed photons per pixel area) for the inner and outer pixels, // a correction factor is applied to the outer pixels (see TDAS 02-14). // The correction factor assumes the ideal case that the pedestal rms // scales with the inverse square root of the pixel area. // // FIXME: Should the check noise<=0 be replaced by MBadPixels? // void MCameraData::CalcCleaningLevel(const MCerPhotEvt &evt, const MPedPhotCam &cam, const MGeomCam &geom) { const Int_t n = geom.GetNumPixels(); fData.Set(n); fData.Reset(); fValidity.Set(n); fValidity.Reset(); const Int_t entries = evt.GetNumPixels(); // // check the number of all pixels against the noise level and // set them to 'unused' state if necessary // for (Int_t i=0; i=fData.GetSize()) return kFALSE; val = fData[idx]; return fValidity[idx]; } void MCameraData::DrawPixelContent(Int_t num) const { *fLog << warn << "MCameraData::DrawPixelContent - not available." << endl; }