| 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): Markus Gaug 02/2004 <mailto:markus@ifae.es>
|
|---|
| 19 | !
|
|---|
| 20 | ! Copyright: MAGIC Software Development, 2000-2004
|
|---|
| 21 | !
|
|---|
| 22 | !
|
|---|
| 23 | \* ======================================================================== */
|
|---|
| 24 |
|
|---|
| 25 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 26 | //
|
|---|
| 27 | // MExtractedSignalPINDiode
|
|---|
| 28 | //
|
|---|
| 29 | // This is the storage container to hold informations about the extracted signal
|
|---|
| 30 | // (offset) value of the calibration PIN Diode
|
|---|
| 31 | //
|
|---|
| 32 | /////////////////////////////////////////////////////////////////////////////
|
|---|
| 33 | #include "MExtractedSignalPINDiode.h"
|
|---|
| 34 |
|
|---|
| 35 | #include "MLog.h"
|
|---|
| 36 | #include "MLogManip.h"
|
|---|
| 37 |
|
|---|
| 38 | ClassImp(MExtractedSignalPINDiode);
|
|---|
| 39 |
|
|---|
| 40 | using namespace std;
|
|---|
| 41 |
|
|---|
| 42 | static const Float_t gkSignalInitializer = 99999.9;
|
|---|
| 43 |
|
|---|
| 44 | // ------------------------------------------------------------------------
|
|---|
| 45 | //
|
|---|
| 46 | // MExtractedSignalPINDiode holds the extracted signal
|
|---|
| 47 | // of the FADC slices and its error.
|
|---|
| 48 | //
|
|---|
| 49 | // Additionally, the number of saturated Slices are stored.
|
|---|
| 50 | //
|
|---|
| 51 | // Default values for the extracted signals are: 99999.9
|
|---|
| 52 | //
|
|---|
| 53 | MExtractedSignalPINDiode::MExtractedSignalPINDiode(const char* name, const char* title)
|
|---|
| 54 | {
|
|---|
| 55 |
|
|---|
| 56 | fName = name ? name : "MExtractedSignalPINDiode";
|
|---|
| 57 | fTitle = title ? title : "Container of the Extracted Signals";
|
|---|
| 58 |
|
|---|
| 59 | Clear();
|
|---|
| 60 | }
|
|---|
| 61 |
|
|---|
| 62 | // ------------------------------------------------------------------------
|
|---|
| 63 | //
|
|---|
| 64 | // Invalidate values
|
|---|
| 65 | //
|
|---|
| 66 | void MExtractedSignalPINDiode::Clear(Option_t *o)
|
|---|
| 67 | {
|
|---|
| 68 | fExtractedSignal = gkSignalInitializer;
|
|---|
| 69 | fExtractedSignalErr = gkSignalInitializer;
|
|---|
| 70 | fExtractedTime = gkSignalInitializer;
|
|---|
| 71 | fExtractedTimeErr = gkSignalInitializer;
|
|---|
| 72 | fExtractedRms = gkSignalInitializer;
|
|---|
| 73 | fExtractedRmsErr = gkSignalInitializer;
|
|---|
| 74 |
|
|---|
| 75 | fNumSaturated = 0;
|
|---|
| 76 | }
|
|---|
| 77 |
|
|---|
| 78 | void MExtractedSignalPINDiode::SetUsedFADCSlices(const Byte_t first, const Byte_t num)
|
|---|
| 79 | {
|
|---|
| 80 | fFirst = first;
|
|---|
| 81 | fNumFADCSamples = num;
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 | void MExtractedSignalPINDiode::SetExtractedSignal(const Float_t sig, const Float_t sigerr)
|
|---|
| 86 | {
|
|---|
| 87 | fExtractedSignal = sig;
|
|---|
| 88 | fExtractedSignalErr = sigerr;
|
|---|
| 89 | }
|
|---|
| 90 |
|
|---|
| 91 | void MExtractedSignalPINDiode::SetExtractedRms(const Float_t sig, const Float_t sigerr)
|
|---|
| 92 | {
|
|---|
| 93 | fExtractedRms = sig;
|
|---|
| 94 | fExtractedRmsErr = sigerr;
|
|---|
| 95 | }
|
|---|
| 96 |
|
|---|
| 97 | void MExtractedSignalPINDiode::SetExtractedTime(const Float_t sig, const Float_t sigerr)
|
|---|
| 98 | {
|
|---|
| 99 | fExtractedTime = sig;
|
|---|
| 100 | fExtractedTimeErr = sigerr;
|
|---|
| 101 | }
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 | Bool_t MExtractedSignalPINDiode::IsValid() const
|
|---|
| 105 | {
|
|---|
| 106 | return fExtractedSignal >= 0. || fExtractedSignalErr >= 0.;
|
|---|
| 107 | }
|
|---|
| 108 |
|
|---|
| 109 | void MExtractedSignalPINDiode::SetSaturation(const Byte_t numsat)
|
|---|
| 110 | {
|
|---|
| 111 | fNumSaturated = numsat;
|
|---|
| 112 | }
|
|---|
| 113 |
|
|---|
| 114 | void MExtractedSignalPINDiode::Print(Option_t *o) const
|
|---|
| 115 | {
|
|---|
| 116 | *fLog << " Signal: " << fExtractedSignal
|
|---|
| 117 | << " +- " << fExtractedSignalErr
|
|---|
| 118 | << " Nr. Saturation: " << fNumSaturated
|
|---|
| 119 | << endl;
|
|---|
| 120 | }
|
|---|