source: trunk/MagicSoft/Mars/msignal/MExtractedSignalPix.cc@ 7422

Last change on this file since 7422 was 5952, checked in by mazin, 20 years ago
*** empty log message ***
File size: 3.5 KB
Line 
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 12/2003 <mailto:markus@ifae.es>
19! Author(s): Thomas Bretz 12/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
20!
21! Copyright: MAGIC Software Development, 2000-2004
22!
23!
24\* ======================================================================== */
25
26/////////////////////////////////////////////////////////////////////////////
27//
28// MExtractedSignalPix
29//
30// This is the storage container to hold informations about the pedestal
31// (offset) value of one Pixel (PMT).
32//
33/////////////////////////////////////////////////////////////////////////////
34#include "MExtractedSignalPix.h"
35
36#include "MLog.h"
37#include "MLogManip.h"
38
39ClassImp(MExtractedSignalPix);
40
41using namespace std;
42
43static const Float_t gkSignalInitializer = -99999.9;
44// ------------------------------------------------------------------------
45//
46// MExtractedSignalPix holds the extracted signal (HiGain and LoGain)
47// of the FADC slices and its error.
48//
49// Additionally, the number of saturated HiGain and LoGain Slices are stored.
50//
51// Default values for the extracted signals are: 99999.9
52//
53MExtractedSignalPix::MExtractedSignalPix(const char* name, const char* title)
54{
55 fName = name ? name : "MExtractedSignalPix";
56 fTitle = title ? title : "Container of the Extracted Signals";
57
58 Clear();
59
60}
61
62
63// ------------------------------------------------------------------------
64//
65// Invalidate values
66//
67void MExtractedSignalPix::Clear(Option_t *o)
68{
69 fExtractedSignalHiGain = gkSignalInitializer;
70 fExtractedSignalHiGainError = -1;
71 fExtractedSignalLoGain = gkSignalInitializer;
72 fExtractedSignalLoGainError = -1;
73
74 fLoGainUsed = kFALSE;
75
76 fNumHiGainSaturated = 0;
77 fNumLoGainSaturated = 0;
78
79 fChisquare = -1.;
80}
81
82void MExtractedSignalPix::SetExtractedSignal(Float_t sig, Float_t sigerr)
83{
84 fExtractedSignalHiGain = sig;
85 fExtractedSignalHiGainError = sigerr;
86}
87
88void MExtractedSignalPix::SetExtractedSignal(Float_t sighi, Float_t sighierr,
89 Float_t siglo, Float_t sigloerr)
90{
91 fExtractedSignalHiGain = sighi;
92 fExtractedSignalHiGainError = sighierr;
93 fExtractedSignalLoGain = siglo;
94 fExtractedSignalLoGainError = sigloerr;
95}
96
97Bool_t MExtractedSignalPix::IsValid() const
98{
99 return (!IsLoGainUsed() && fExtractedSignalHiGainError >= 0) || (IsLoGainUsed() && fExtractedSignalLoGainError >= 0);
100}
101
102void MExtractedSignalPix::SetGainSaturation(Bool_t sat, Byte_t higain, Byte_t logain)
103{
104
105 fLoGainUsed = sat;
106 fNumHiGainSaturated = higain;
107 fNumLoGainSaturated = logain;
108}
109
110void MExtractedSignalPix::Print(Option_t *o) const
111{
112 *fLog << " Signal: " << fExtractedSignalHiGain
113 << " +- " << fExtractedSignalHiGainError
114 << " LoGain? " << fLoGainUsed
115 << " Nr. Sat. Hi Gain: " << fNumHiGainSaturated
116 << " Nr. Sat. Lo Gain: " << fNumLoGainSaturated
117 << endl;
118}
Note: See TracBrowser for help on using the repository browser.