source: trunk/MagicSoft/Mars/mcalib/MHCalibrationPINDiode.cc@ 2901

Last change on this file since 2901 was 2885, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.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-2002
21!
22!
23\* ======================================================================== */
24
25//////////////////////////////////////////////////////////////////////////////
26//
27// MHCalibrationPINDiode
28//
29// Performs all the necessary fits to extract the mean number of photons
30// out of the derived light flux
31//
32//////////////////////////////////////////////////////////////////////////////
33#include "MHCalibrationPINDiode.h"
34#include "MHCalibrationConfig.h"
35
36#include <TH1.h>
37#include <TF1.h>
38
39ClassImp(MHCalibrationPINDiode);
40
41using namespace std;
42
43// --------------------------------------------------------------------------
44//
45// Default Constructor.
46//
47MHCalibrationPINDiode::MHCalibrationPINDiode(const char *name, const char *title)
48 : fVarGausFit(NULL)
49{
50
51 fName = name ? name : "MHCalibrationPINDiode";
52 fTitle = title ? title : "Fill the accumulated charges and times all PINDiode events and perform fits";
53
54 // Create a large number of bins, later we will rebin
55 fChargeFirstHiGain = -1000.;
56 fChargeLastHiGain = gkStartPINDiodeBinNr;
57 fChargeNbinsHiGain = gkStartPINDiodeBinNr;
58
59 fHPCharge = new TH1I("HPCharge","Distribution of Summed FADC Slices",
60 fChargeNbinsHiGain,fChargeFirstHiGain,fChargeLastHiGain);
61 fHPCharge->SetXTitle("Sum FADC Slices");
62 fHPCharge->SetYTitle("Nr. of events");
63 fHPCharge->Sumw2();
64 fHPCharge->SetDirectory(0);
65
66 fErrChargeFirst = 0.;
67 fErrChargeLast = gkStartPINDiodeBinNr;
68 fErrChargeNbins = gkStartPINDiodeBinNr;
69
70 fHErrCharge = new TH1F("HErrCharge","Distribution of Variances of Summed FADC Slices",fErrChargeNbins,fErrChargeFirst,fErrChargeLast);
71 fHErrCharge->SetXTitle("Variance Summed FADC Slices");
72 fHErrCharge->SetYTitle("Nr. of events");
73 fHErrCharge->Sumw2();
74 fHErrCharge->SetDirectory(0);
75
76 Int_t tfirst = 0;
77 Int_t tlast = 31;
78 Int_t nbins = 32;
79
80 fHPTime = new TH1I("HPTime","Distribution of Mean Arrival Times",nbins,tfirst,tlast);
81 fHPTime->SetXTitle("Mean Arrival Times [FADC slice nr]");
82 fHPTime->SetYTitle("Nr. of events");
83 fHPTime->Sumw2();
84 fHPTime->SetDirectory(0);
85
86}
87
88MHCalibrationPINDiode::~MHCalibrationPINDiode()
89{
90
91 delete fHPCharge;
92 delete fHErrCharge;
93
94 if (fVarGausFit)
95 delete fVarGausFit;
96
97 delete fHPTime;
98
99}
100
101const Double_t MHCalibrationPINDiode::GetTime() const
102{
103 return fVarGausFit->GetParameter(2);
104}
105
106const Double_t MHCalibrationPINDiode::GetErrTime() const
107{
108 return fVarGausFit->GetParameter(3);
109}
Note: See TracBrowser for help on using the repository browser.