source: trunk/MagicSoft/Mars/mcalib/MCalibrationPINDiode.cc@ 2840

Last change on this file since 2840 was 2839, checked in by gaug, 21 years ago
*** empty log message ***
File size: 3.0 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-2001
21!
22!
23\* ======================================================================== */
24
25/////////////////////////////////////////////////////////////////////////////
26// //
27// MCalibrationPINDiode //
28// //
29// This is the storage container to hold informations about the pedestal //
30// (offset) value of one Pixel (PMT). //
31// //
32/////////////////////////////////////////////////////////////////////////////
33#include "MCalibrationPINDiode.h"
34
35#include "MLog.h"
36#include "MLogManip.h"
37
38ClassImp(MCalibrationPINDiode);
39
40using namespace std;
41// --------------------------------------------------------------------------
42//
43// Default Constructor.
44//
45MCalibrationPINDiode::MCalibrationPINDiode(const char *name, const char *title)
46 : fHist(NULL),
47 fCharge(-1.),
48 fErrCharge(-1.),
49 fPed(-1.),
50 fPedRms(-1.),
51 fSigmaCharge(-1.),
52 fErrSigmaCharge(-1.),
53 fTime(-1.),
54 fErrTime(-1.)
55{
56
57 fName = name ? name : "MCalibrationPINDiode";
58 fTitle = title ? title : "Container of the MHCalibrationPINDiode and the fit results";
59
60 fHist = new MHCalibrationPINDiode();
61
62 if (!fHist)
63 *fLog << warn << dbginf << " Could not create MHCalibrationPINDiode " << endl;
64
65}
66
67MCalibrationPINDiode::~MCalibrationPINDiode()
68{
69 delete fHist;
70}
71
72// ------------------------------------------------------------------------
73//
74// Invalidate values
75//
76void MCalibrationPINDiode::Clear(Option_t *o)
77{
78 fHist->Reset();
79}
80
81Bool_t MCalibrationPINDiode::FitCharge()
82{
83 if(!fHist->FitChargeHiGain())
84 return kFALSE;
85
86 fCharge = fHist->GetChargeMean();
87 fErrCharge = fHist->GetChargeMeanErr();
88 fSigmaCharge = fHist->GetChargeSigma();
89 fErrSigmaCharge = fHist->GetChargeSigmaErr();
90
91 return kTRUE;
92
93}
94
95Bool_t MCalibrationPINDiode::FitTime()
96{
97
98 if(!fHist->FitTimeHiGain())
99 return kFALSE;
100
101 fTime = fHist->GetTime();
102 fErrTime = fHist->GetErrTime();
103
104 return kTRUE;
105
106}
Note: See TracBrowser for help on using the repository browser.