source: trunk/MagicSoft/Mars/mcalib/MCalibrationPedCam.cc@ 4985

Last change on this file since 4985 was 4882, checked in by tbretz, 20 years ago
*** empty log message ***
File size: 4.3 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 11/2003 <mailto:markus@ifae.es>
19!
20! Copyright: MAGIC Software Development, 2000-2004
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26//
27// MCalibrationPedCam
28//
29// Hold the pedestal Calibration results obtained from MHPedestalCam of the camera:
30//
31// The calculated values (types of GetPixelContent) are:
32//
33// Fitted values:
34// ==============
35//
36// 0: Fitted Pedestal
37// 1: Error of fitted Pedestal
38// 2: Sigma of fitted Pedestal
39// 3: Error of Sigma of fitted Pedestal
40//
41// Useful variables derived from the fit results:
42// =============================================
43//
44// 4: Returned probability of Gauss fit to Pedestal distribution
45//
46/////////////////////////////////////////////////////////////////////////////
47#include "MCalibrationPedCam.h"
48
49#include <TClonesArray.h>
50
51#include "MLog.h"
52#include "MLogManip.h"
53
54#include "MGeomCam.h"
55#include "MGeomPix.h"
56
57#include "MCalibrationPix.h"
58
59ClassImp(MCalibrationPedCam);
60
61using namespace std;
62
63// --------------------------------------------------------------------------
64//
65// Default constructor.
66//
67// Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated
68// to hold one container per pixel. Later, a call to MCalibrationRelTimeCam::InitSize()
69// has to be performed (in MGeomApply).
70//
71// Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated
72// to hold one container per pixel AREA. Later, a call to MCalibrationRelTimeCam::InitAreas()
73// has to be performed (in MGeomApply).
74//
75// Creates a TClonesArray of MCalibrationPix containers, initialized to 1 entry, destinated
76// to hold one container per camera SECTOR. Later, a call to MCalibrationRelTimeCam::InitSectors()
77// has to be performed (in MGeomApply).
78//
79MCalibrationPedCam::MCalibrationPedCam(const char *name, const char *title)
80{
81 fName = name ? name : "MCalibrationPedCam";
82 fTitle = title ? title : "Storage container for the Pedestal Calibration Results in the camera";
83
84 fPixels = new TClonesArray("MCalibrationPix",1);
85 fAverageAreas = new TClonesArray("MCalibrationPix",1);
86 fAverageSectors = new TClonesArray("MCalibrationPix",1);
87
88}
89
90// --------------------------------------------------------------------------
91//
92// The calculated values (types of GetPixelContent) are:
93//
94// Fitted values:
95// ==============
96//
97// 0: Fitted Pedestal
98// 1: Error of fitted Pedestal
99// 2: Sigma of fitted Pedestal
100// 3: Error of Sigma of fitted Pedestal
101//
102// Useful variables derived from the fit results:
103// =============================================
104//
105// 4: Returned probability of Gauss fit to Pedestal distribution
106//
107Bool_t MCalibrationPedCam::GetPixelContent(Double_t &val, Int_t idx, const MGeomCam &cam, Int_t type) const
108{
109
110 if (idx > GetSize())
111 return kFALSE;
112
113 Float_t area = cam[idx].GetA();
114
115 if (area == 0)
116 return kFALSE;
117
118 if ((*this)[idx].IsExcluded())
119 return kFALSE;
120
121 switch (type)
122 {
123 case 0:
124 val = (*this)[idx].GetMean();
125 break;
126 case 1:
127 val = (*this)[idx].GetMeanErr();
128 break;
129 case 2:
130 val = (*this)[idx].GetSigma();
131 break;
132 case 3:
133 val = (*this)[idx].GetSigmaErr();
134 break;
135 case 4:
136 val = (*this)[idx].GetProb();
137 break;
138 default:
139 return kFALSE;
140 }
141
142 return val!=-1.;
143
144}
Note: See TracBrowser for help on using the repository browser.