source: trunk/MagicSoft/Mars/manalysis/MExtractedSignalPix.cc@ 2911

Last change on this file since 2911 was 2902, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.1 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-2003
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#include "MLog.h"
36#include "MLogManip.h"
37
38ClassImp(MExtractedSignalPix);
39
40using namespace std;
41static const Float_t gkSignalInitializer = 99999.9;
42//
43// MExtractedSignalPix holds the extracted signal (HiGain and LoGain)
44// of the FADC slices and its error.
45//
46// Additionally, the number of saturated HiGain and LoGain Slices are stored.
47//
48// Default values for the extracted signals are: 99999.9
49//
50MExtractedSignalPix::MExtractedSignalPix(const char* name, const char* title)
51 : fExtractedSignalHiGain(gkSignalInitializer),
52 fExtractedSignalHiGainError(gkSignalInitializer),
53 fExtractedSignalLoGain(gkSignalInitializer),
54 fExtractedSignalLoGainError(gkSignalInitializer),
55 fIsLoGainUsed(kFALSE),
56 fNumHiGainSaturated(0),
57 fNumLoGainSaturated(0)
58{
59
60 fName = name ? name : "MExtractedSignalPix";
61 fTitle = title ? title : "Container of the Extracted Signals";
62
63}
64
65
66
67// ------------------------------------------------------------------------
68//
69// Invalidate values
70//
71void MExtractedSignalPix::Clear(Option_t *o)
72{
73
74 fExtractedSignalHiGain = gkSignalInitializer;
75 fExtractedSignalHiGainError = gkSignalInitializer;
76 fExtractedSignalLoGain = gkSignalInitializer;
77 fExtractedSignalLoGainError = gkSignalInitializer;
78
79 fIsLoGainUsed = kFALSE;
80 fNumHiGainSaturated = 0;
81 fNumLoGainSaturated = 0;
82
83}
84
85void MExtractedSignalPix::SetExtractedSignal(Float_t sig, Float_t sigerr)
86{
87
88 fExtractedSignalHiGain = sig;
89 fExtractedSignalHiGainError = sigerr;
90
91 return;
92}
93
94
95void MExtractedSignalPix::SetExtractedSignal(Float_t sighi, Float_t sighierr,
96 Float_t siglo, Float_t sigloerr)
97{
98 fExtractedSignalHiGain = sighi;
99 fExtractedSignalHiGainError = sighierr;
100 fExtractedSignalLoGain = siglo;
101 fExtractedSignalLoGainError = sigloerr;
102
103 return;
104}
105
106Bool_t MExtractedSignalPix::IsValid() const
107{
108
109 return fExtractedSignalHiGain >= 0. || fExtractedSignalHiGainError >= 0.;
110
111}
112
113
114void MExtractedSignalPix::SetGainSaturation(Bool_t sat, Byte_t higain, Byte_t logain)
115{
116
117 fIsLoGainUsed = sat;
118 fNumHiGainSaturated = higain;
119 fNumLoGainSaturated = logain;
120
121 return;
122
123}
124
125
126
127void MExtractedSignalPix::PrintOut()
128{
129
130 *fLog << all << GetDescriptor() << ":" << endl;
131
132 *fLog << " Signal: " << fExtractedSignalHiGain
133 << " +- " << fExtractedSignalHiGainError
134 << " LoGain? " << fIsLoGainUsed
135 << " Nr. Sat. Hi Gain: " << fNumHiGainSaturated
136 << " Nr. Sat. Lo Gain: " << fNumLoGainSaturated
137 << endl;
138
139}
140
Note: See TracBrowser for help on using the repository browser.