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

Last change on this file since 2736 was 2734, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.5 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 <TStyle.h>
37#include <TMath.h>
38
39#include <TMinuit.h>
40#include <TFitter.h>
41
42#include <TF1.h>
43#include <TH2.h>
44#include <TCanvas.h>
45#include <TPaveText.h>
46#include <TRandom.h>
47
48#include "MBinning.h"
49#include "MParList.h"
50
51#include "MLog.h"
52#include "MLogManip.h"
53
54ClassImp(MHCalibrationPINDiode);
55
56using namespace std;
57// --------------------------------------------------------------------------
58//
59// Default Constructor.
60//
61MHCalibrationPINDiode::MHCalibrationPINDiode(const char *name, const char *title)
62 : fVarGausFit(NULL)
63{
64
65 fName = name ? name : "MHCalibrationPINDiode";
66 fTitle = title ? title : "Fill the accumulated charges and times all PINDiode events and perform fits";
67
68 // Create a large number of bins, later we will rebin
69 fChargeFirstHiGain = -1000.;
70 fChargeLastHiGain = gkStartPINDiodeBinNr;
71 fChargeNbinsHiGain = gkStartPINDiodeBinNr;
72
73 fHPCharge = new TH1I("HPCharge","Distribution of Summed FADC Slices",
74 fChargeNbinsHiGain,fChargeFirstHiGain,fChargeLastHiGain);
75 fHPCharge->SetXTitle("Sum FADC Slices");
76 fHPCharge->SetYTitle("Nr. of events");
77 fHPCharge->Sumw2();
78
79 fErrChargeFirst = 0.;
80 fErrChargeLast = gkStartPINDiodeBinNr;
81 fErrChargeNbins = gkStartPINDiodeBinNr;
82
83 fHErrCharge = new TH1F("HErrCharge","Distribution of Variances of Summed FADC Slices",fErrChargeNbins,fErrChargeFirst,fErrChargeLast);
84 fHErrCharge->SetXTitle("Variance Summed FADC Slices");
85 fHErrCharge->SetYTitle("Nr. of events");
86 fHErrCharge->Sumw2();
87
88 Int_t tfirst = 0;
89 Int_t tlast = 31;
90 Int_t nbins = 32;
91
92 fHPTime = new TH1I("HPTime","Distribution of Mean Arrival Times",nbins,tfirst,tlast);
93 fHPTime->SetXTitle("Mean Arrival Times [FADC slice nr]");
94 fHPTime->SetYTitle("Nr. of events");
95 fHPTime->Sumw2();
96
97}
98
99MHCalibrationPINDiode::~MHCalibrationPINDiode()
100{
101
102 delete fHPCharge;
103 delete fHErrCharge;
104
105 if (fVarGausFit)
106 delete fVarGausFit;
107
108 delete fHPTime;
109
110}
111
Note: See TracBrowser for help on using the repository browser.