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 |
|
---|
54 | ClassImp(MHCalibrationPINDiode);
|
---|
55 |
|
---|
56 | using namespace std;
|
---|
57 | // --------------------------------------------------------------------------
|
---|
58 | //
|
---|
59 | // Default Constructor.
|
---|
60 | //
|
---|
61 | MHCalibrationPINDiode::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 | fChargeFirst = 0;
|
---|
70 | fChargeLast = gkStartPINDiodeBinNr;
|
---|
71 | fChargeNbins = gkStartPINDiodeBinNr;
|
---|
72 |
|
---|
73 | fHPCharge = new TH1I("HPCharge","Distribution of Summed FADC Slices",fChargeNbins,fChargeFirst,fChargeLast);
|
---|
74 | fHPCharge->SetXTitle("Sum FADC Slices");
|
---|
75 | fHPCharge->SetYTitle("Nr. of events");
|
---|
76 | fHPCharge->Sumw2();
|
---|
77 |
|
---|
78 | fErrChargeFirst = 0.;
|
---|
79 | fErrChargeLast = gkStartPINDiodeBinNr;
|
---|
80 | fErrChargeNbins = gkStartPINDiodeBinNr;
|
---|
81 |
|
---|
82 | fHErrCharge = new TH1F("HErrCharge","Distribution of Variances of Summed FADC Slices",fErrChargeNbins,fErrChargeFirst,fErrChargeLast);
|
---|
83 | fHErrCharge->SetXTitle("Variance Summed FADC Slices");
|
---|
84 | fHErrCharge->SetYTitle("Nr. of events");
|
---|
85 | fHErrCharge->Sumw2();
|
---|
86 |
|
---|
87 | Int_t tfirst = 0;
|
---|
88 | Int_t tlast = 31;
|
---|
89 | Int_t nbins = 32;
|
---|
90 |
|
---|
91 | fHPTime = new TH1I("HPTime","Distribution of Mean Arrival Times",nbins,tfirst,tlast);
|
---|
92 | fHPTime->SetXTitle("Mean Arrival Times [FADC slice nr]");
|
---|
93 | fHPTime->SetYTitle("Nr. of events");
|
---|
94 | fHPTime->Sumw2();
|
---|
95 |
|
---|
96 | }
|
---|
97 |
|
---|
98 | MHCalibrationPINDiode::~MHCalibrationPINDiode()
|
---|
99 | {
|
---|
100 |
|
---|
101 | delete fHPCharge;
|
---|
102 | delete fHErrCharge;
|
---|
103 |
|
---|
104 | if (fVarGausFit)
|
---|
105 | delete fVarGausFit;
|
---|
106 |
|
---|
107 | delete fHPTime;
|
---|
108 |
|
---|
109 | }
|
---|
110 |
|
---|