source: trunk/MagicSoft/Mars/msignal/MArrivalTimePix.cc@ 5456

Last change on this file since 5456 was 3899, checked in by gaug, 21 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! Author(s): Hendrik Bartko 02/2004 <mailto:hbartko@mppmu.mpg.de>
21!
22! Copyright: MAGIC Software Development, 2000-2003
23!
24!
25\* ======================================================================== */
26
27/////////////////////////////////////////////////////////////////////////////
28//
29// MArrivalTimePix
30//
31// This is the storage container to hold informations about the ArrivalTime
32//
33/////////////////////////////////////////////////////////////////////////////
34#include "MArrivalTimePix.h"
35
36#include "MLog.h"
37#include "MLogManip.h"
38
39ClassImp(MArrivalTimePix);
40
41using namespace std;
42
43static const Float_t gkSignalInitializer = 99999.9;
44
45// ------------------------------------------------------------------------
46//
47// MArrivalTimePix holds the ArrivalTime (HiGain and LoGain)
48// of the FADC slices and its error.
49//
50// Additionally, the number of saturated HiGain and LoGain Slices are stored.
51//
52// Default values for the ArrivalTime are: 99999.9
53//
54MArrivalTimePix::MArrivalTimePix(const char* name, const char* title)
55 : fArrivalTimeHiGain(gkSignalInitializer),
56 fArrivalTimeHiGainError(gkSignalInitializer),
57 fArrivalTimeLoGain(gkSignalInitializer),
58 fArrivalTimeLoGainError(gkSignalInitializer),
59 fNumHiGainSaturated(0),
60 fNumLoGainSaturated(0)
61{
62 fName = name ? name : "MArrivalTimePix";
63 fTitle = title ? title : "Container of the Extracted Signals";
64}
65
66// ------------------------------------------------------------------------
67//
68// Invalidate values
69//
70void MArrivalTimePix::Clear(Option_t *o)
71{
72 fArrivalTimeHiGain = gkSignalInitializer;
73 fArrivalTimeHiGainError = gkSignalInitializer;
74 fArrivalTimeLoGain = gkSignalInitializer;
75 fArrivalTimeLoGainError = gkSignalInitializer;
76
77 fNumHiGainSaturated = 0;
78 fNumLoGainSaturated = 0;
79}
80
81void MArrivalTimePix::SetArrivalTime(Float_t sig, Float_t sigerr)
82{
83 fArrivalTimeHiGain = sig;
84 fArrivalTimeHiGainError = sigerr;
85}
86
87void MArrivalTimePix::SetArrivalTime(Float_t sighi, Float_t sighierr,
88 Float_t siglo, Float_t sigloerr)
89{
90 fArrivalTimeHiGain = sighi;
91 fArrivalTimeHiGainError = sighierr;
92 fArrivalTimeLoGain = siglo;
93 fArrivalTimeLoGainError = sigloerr;
94}
95
96Bool_t MArrivalTimePix::IsValid() const
97{
98 return fArrivalTimeHiGain >= 0. || fArrivalTimeHiGainError >= 0.;
99}
100
101void MArrivalTimePix::SetGainSaturation(Bool_t sat, Byte_t higain, Byte_t logain)
102{
103
104 fNumHiGainSaturated = higain;
105 fNumLoGainSaturated = logain;
106}
107
108void MArrivalTimePix::Print(Option_t *o) const
109{
110 *fLog << " Signal: " << fArrivalTimeHiGain
111 << " +- " << fArrivalTimeHiGainError
112 << " Nr. Sat. Hi Gain: " << fNumHiGainSaturated
113 << " Nr. Sat. Lo Gain: " << fNumLoGainSaturated
114 << endl;
115}
Note: See TracBrowser for help on using the repository browser.