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

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