source: branches/Mars_IncreaseNsb/msignal/MSignalPix.cc@ 18811

Last change on this file since 18811 was 18243, checked in by Daniela Dorner, 9 years ago
added new parameter fTimeSlope to the output of the calibration
File size: 3.8 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// Version 8:
67// ----------
68// - added new time variable fTimeSlope describing the width of the rise time
69//
70////////////////////////////////////////////////////////////////////////////
71#include "MSignalPix.h"
72
73#include "MLog.h"
74
75ClassImp(MSignalPix);
76
77using namespace std;
78
79// --------------------------------------------------------------------------
80//
81// Default constructor. The pixel is assumed as used and not a core pixel.
82// NT 29/04/2003: A pixel is considered used when fRing > 0.
83//
84MSignalPix::MSignalPix(Float_t phot, Float_t errphot) :
85 fIsCore(kFALSE), fRing(1), fIdxIsland(-1),
86 fPhot(phot), fErrPhot(errphot), fArrivalTime(-1),
87 fTimeSlope(-1)
88{
89 MMath::ReducePrecision(fPhot);
90 MMath::ReducePrecision(fErrPhot);
91}
92
93void MSignalPix::Clear(Option_t *o)
94{
95 fIsCore = kFALSE;
96 fRing = 1;
97 fIdxIsland = -1;
98 fPhot = 0;
99 fErrPhot = 0;
100 fArrivalTime = -1;
101 fTimeSlope = -1;
102}
103
104// --------------------------------------------------------------------------
105//
106// Print information to gLog.
107//
108void MSignalPix::Print(Option_t *) const
109{
110 gLog << GetDescriptor();// << " Pixel: "<< fPixId;
111 switch (fRing)
112 {
113 case -1:
114 gLog << "Unampped";
115 break;
116 case 0:
117 gLog << " Unused ";
118 break;
119 default:
120 gLog << " Used ";
121 break;
122 }
123 gLog << (fIsCore?" Core ":" ");
124 gLog << "Nphot= " << fPhot << " Error(Nphot)=" << fErrPhot << endl;
125}
Note: See TracBrowser for help on using the repository browser.