| 1 | /* ======================================================================== *\
|
|---|
| 2 | !
|
|---|
| 3 | ! *
|
|---|
| 4 | ! * This file is part of MARS, the MAGIC Analysis and Reconstruction
|
|---|
| 5 | ! * Software. It is distributed to you in the hope that it can be a useful
|
|---|
| 6 | ! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
|
|---|
| 7 | ! * It is distributed WITHOUT ANY WARRANTY.
|
|---|
| 8 | ! *
|
|---|
| 9 | ! * Permission to use, copy, modify and distribute this software and its
|
|---|
| 10 | ! * documentation for any purpose is hereby granted without fee,
|
|---|
| 11 | ! * provided that the above copyright notice appear in all copies and
|
|---|
| 12 | ! * that both that copyright notice and this permission notice appear
|
|---|
| 13 | ! * in supporting documentation. It is provided "as is" without express
|
|---|
| 14 | ! * or implied warranty.
|
|---|
| 15 | ! *
|
|---|
| 16 | !
|
|---|
| 17 | !
|
|---|
| 18 | ! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>
|
|---|
| 19 | ! Author(s): Markus Gaug 04/2004 <mailto:markus@ifae.es>
|
|---|
| 20 | ! Author(s): Florian Goebel 06/2004 <mailto:fgoebel@mppmu.mpg.de>
|
|---|
| 21 | !
|
|---|
| 22 | ! Copyright: MAGIC Software Development, 2000-2004
|
|---|
| 23 | !
|
|---|
| 24 | !
|
|---|
| 25 | \* ======================================================================== */
|
|---|
| 26 |
|
|---|
| 27 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 28 | //
|
|---|
| 29 | // MPedestalPix
|
|---|
| 30 | //
|
|---|
| 31 | // This is the storage container to hold informations about the pedestal
|
|---|
| 32 | // (offset) value of one Pixel (PMT).
|
|---|
| 33 | //
|
|---|
| 34 | // Float_t fPedestal:
|
|---|
| 35 | // - mean value of pedestal (PMT offset)
|
|---|
| 36 | // Float_t fPedestalRms:
|
|---|
| 37 | // - root mean square / sigma / standard deviation of pedestal
|
|---|
| 38 | // Float_t fPedestalABoffset:
|
|---|
| 39 | // - the difference between odd slice pedestal mean and the
|
|---|
| 40 | // total pedestal mean (fPedestal). For even slices pedestal
|
|---|
| 41 | // use -fPedestalABoffset.
|
|---|
| 42 | // UInt_t fNumEvents:
|
|---|
| 43 | // - number of times, the Process was executed (to estimate the error
|
|---|
| 44 | // of pedestal)
|
|---|
| 45 | //
|
|---|
| 46 | // version 2:
|
|---|
| 47 | // ----------
|
|---|
| 48 | // added:
|
|---|
| 49 | // fPedestalABoffset difference between pedestal mean of odd slices and
|
|---|
| 50 | // the total pedestal mean (fPedestal)
|
|---|
| 51 | // fNumEvents number of times, the Process was executed
|
|---|
| 52 | // (to estimate the error of pedestal)
|
|---|
| 53 | //
|
|---|
| 54 | // version 3:
|
|---|
| 55 | // ----------
|
|---|
| 56 | // - fValid removed
|
|---|
| 57 | //
|
|---|
| 58 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 59 | #include "MPedestalPix.h"
|
|---|
| 60 |
|
|---|
| 61 | #include "MLog.h"
|
|---|
| 62 | #include "MLogManip.h"
|
|---|
| 63 |
|
|---|
| 64 | ClassImp(MPedestalPix);
|
|---|
| 65 |
|
|---|
| 66 | using namespace std;
|
|---|
| 67 |
|
|---|
| 68 | // ------------------------------------------------------------------------
|
|---|
| 69 | //
|
|---|
| 70 | // Default constructor. Calls Clear()
|
|---|
| 71 | //
|
|---|
| 72 | MPedestalPix::MPedestalPix()
|
|---|
| 73 | {
|
|---|
| 74 | Clear();
|
|---|
| 75 | }
|
|---|
| 76 |
|
|---|
| 77 | // ------------------------------------------------------------------------
|
|---|
| 78 | //
|
|---|
| 79 | // Invalidate values
|
|---|
| 80 | //
|
|---|
| 81 | void MPedestalPix::Clear(Option_t *o)
|
|---|
| 82 | {
|
|---|
| 83 | fPedestal = -1;
|
|---|
| 84 | fPedestalRms = -1;
|
|---|
| 85 | fPedestalABoffset = -1;
|
|---|
| 86 | fNumEvents = 0;
|
|---|
| 87 | }
|
|---|
| 88 |
|
|---|
| 89 | // --------------------------------------------------------------------------
|
|---|
| 90 | //
|
|---|
| 91 | // Copy 'constructor'
|
|---|
| 92 | //
|
|---|
| 93 | void MPedestalPix::Copy(TObject &object) const
|
|---|
| 94 | {
|
|---|
| 95 |
|
|---|
| 96 | MPedestalPix &pix = (MPedestalPix&)object;
|
|---|
| 97 |
|
|---|
| 98 | pix.fPedestal = fPedestal ;
|
|---|
| 99 | pix.fPedestalRms = fPedestalRms ;
|
|---|
| 100 | pix.fPedestalABoffset = fPedestalABoffset ;
|
|---|
| 101 | }
|
|---|
| 102 |
|
|---|
| 103 | // ------------------------------------------------------------------------
|
|---|
| 104 | //
|
|---|
| 105 | // Set all values to 0
|
|---|
| 106 | //
|
|---|
| 107 | void MPedestalPix::InitUseHists()
|
|---|
| 108 | {
|
|---|
| 109 | fPedestal = 0;
|
|---|
| 110 | fPedestalRms = 0;
|
|---|
| 111 | fPedestalABoffset = 0;
|
|---|
| 112 | fNumEvents = 0;
|
|---|
| 113 | }
|
|---|
| 114 |
|
|---|
| 115 | // ------------------------------------------------------------------------
|
|---|
| 116 | //
|
|---|
| 117 | // Set fPedestal=m, fPedestalRms=r, fPedestalABoffset=offs, fNumEvents=n
|
|---|
| 118 | //
|
|---|
| 119 | void MPedestalPix::Set(Float_t m, Float_t r, Float_t offs, UInt_t n)
|
|---|
| 120 | {
|
|---|
| 121 | fPedestal = m;
|
|---|
| 122 | fPedestalRms = r;
|
|---|
| 123 | fPedestalABoffset = offs;
|
|---|
| 124 | fNumEvents = n;
|
|---|
| 125 | }
|
|---|
| 126 |
|
|---|
| 127 | // ------------------------------------------------------------------------
|
|---|
| 128 | //
|
|---|
| 129 | // Return kTRUE if pedestal rms is valid (>=0)
|
|---|
| 130 | //
|
|---|
| 131 | Bool_t MPedestalPix::IsValid() const
|
|---|
| 132 | {
|
|---|
| 133 | return fPedestalRms>=0;
|
|---|
| 134 | }
|
|---|