source: branches/removing_cpp11_features/msignal/MSignalPix.cc@ 19270

Last change on this file since 19270 was 12938, checked in by tbretz, 13 years ago
Added missing intialization of fArrivalTime
File size: 3.6 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): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2005
21!
22!
23\* ======================================================================== */
24
25
26/////////////////////////////////////////////////////////////////////////////
27//
28// MSignalPix
29//
30// Storage container for the signal in a pixel in number of photons.
31//
32// NOTE: This container is NOT ment for I/O. Write it to a file on your
33// own risk!
34//
35// fIsSaturated: boolean variable set to kTRUE whenever one or more of
36// the low gain FADC slices of the pixel is in saturation.
37//
38// Version 2:
39// ----------
40// - added fIsSaturated
41//
42// Version 4:
43// ----------
44// - added fIsHGSaturated
45//
46// Version 5:
47// ----------
48// - added fIdxIsland
49//
50// Version 6:
51// ----------
52// - put the '!' into the comment line for
53// Bool_t fIsCore; //! the pixel is a Core pixel -> kTRUE
54// Short_t fRing; //! NT: number of analyzed rings around the core pixels, fRing>0 means: used, fRing= 0 means: unused, fRing= -1 means: unmapped (no possible to use in the calculation of the image parameters)
55// Short_t fIdxIsland; //! the pixel is a Core pixel -> kTRUE
56// Bool_t fIsHGSaturated; //! the pixel's high gain is saturated
57// This is a queick hack to gain storage space - the structure of
58// the container for calibrated data will change soon.
59//
60// Version 7:
61// ----------
62// - removed '!' from fRing to allow the status 'Unmapped' to be stored
63// after calibration (bad pixel treatment). This increases the file
64// size of the calibrated data by roughly 0.5%
65//
66////////////////////////////////////////////////////////////////////////////
67#include "MSignalPix.h"
68
69#include "MLog.h"
70
71ClassImp(MSignalPix);
72
73using namespace std;
74
75// --------------------------------------------------------------------------
76//
77// Default constructor. The pixel is assumed as used and not a core pixel.
78// NT 29/04/2003: A pixel is considered used when fRing > 0.
79//
80MSignalPix::MSignalPix(Float_t phot, Float_t errphot) :
81 fIsCore(kFALSE), fRing(1), fIdxIsland(-1),
82 fPhot(phot), fErrPhot(errphot), fArrivalTime(-1)
83{
84 MMath::ReducePrecision(fPhot);
85 MMath::ReducePrecision(fErrPhot);
86}
87
88void MSignalPix::Clear(Option_t *o)
89{
90 fIsCore = kFALSE;
91 fRing = 1;
92 fIdxIsland = -1;
93 fPhot = 0;
94 fErrPhot = 0;
95 fArrivalTime = -1;
96}
97
98// --------------------------------------------------------------------------
99//
100// Print information to gLog.
101//
102void MSignalPix::Print(Option_t *) const
103{
104 gLog << GetDescriptor();// << " Pixel: "<< fPixId;
105 switch (fRing)
106 {
107 case -1:
108 gLog << "Unampped";
109 break;
110 case 0:
111 gLog << " Unused ";
112 break;
113 default:
114 gLog << " Used ";
115 break;
116 }
117 gLog << (fIsCore?" Core ":" ");
118 gLog << "Nphot= " << fPhot << " Error(Nphot)=" << fErrPhot << endl;
119}
Note: See TracBrowser for help on using the repository browser.