/* ======================================================================== *\ ! ! * ! * 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 ! ! \* ======================================================================== */ /////////////////////////////////////////////////////////////////////// // // MHFadcPix // // This container stores a histogram to display an Fadc Spektrum. // The spektrum of all the values measured by the Fadcs. // /////////////////////////////////////////////////////////////////////// #include "MHFadcPix.h" #include #include "MH.h" #include "MBinning.h" #include "MRawEvtData.h" #include "MRawEvtPixelIter.h" ClassImp(MHFadcPix); // -------------------------------------------------------------------------- // // Creates the histograms for lo and hi gain of one pixel // MHFadcPix::MHFadcPix(UInt_t pixid, Type_t t) : fPixId(pixid), fType(t) { fHistHi.SetName(pixid ? Form("HiGain%03d", pixid) : "HiGain"); fHistHi.SetTitle(pixid ? Form("Hi Gain Pixel #%d", pixid) : "Hi Gain Samples"); fHistHi.SetDirectory(NULL); fHistLo.SetName(pixid ? Form("LoGain%03d", pixid) : "LoGain"); fHistLo.SetTitle(pixid ? Form("Lo Gain Pixel #%d", pixid) : "Lo Gain Samples"); fHistLo.SetDirectory(NULL); if (fType==kValue) { fHistHi.SetXTitle("Signal/FADC Units"); fHistLo.SetXTitle("Signal/FADC Units"); fHistHi.SetYTitle("Count"); fHistLo.SetYTitle("Count"); MBinning bins; bins.SetEdges(255, -.5, 255.5); bins.Apply(fHistHi); bins.Apply(fHistLo); } else { fHistHi.SetXTitle("Time/FADC Slices"); fHistLo.SetXTitle("Time/FADC Slices"); fHistLo.SetYTitle("Sum Signal/FADC Units"); fHistHi.SetYTitle("Sum Signal/FADC Units"); } } void MHFadcPix::Init(Byte_t nhi, Byte_t nlo) { MBinning bins; bins.SetEdges(nhi, -.5, -.5+nhi); bins.Apply(fHistHi); bins.SetEdges(nlo, -.5, -.5+nlo); bins.Apply(fHistLo); } Bool_t MHFadcPix::Fill(const MRawEvtData &evt) { MRawEvtPixelIter pixel((MRawEvtData*)&evt); if (!pixel.Jump(fPixId)) return kTRUE; const Int_t nhisamples = evt.GetNumHiGainSamples(); if (fType==kValue) for (Int_t i=0; iDivide(1, 2); gPad->cd(1); fHistHi.Draw(); gPad->cd(2); fHistLo.Draw(); }