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 | fQfirst = 0;
|
---|
70 | fQlast = gkStartPINDiodeBinNr;
|
---|
71 | fQnbins = gkStartPINDiodeBinNr;
|
---|
72 |
|
---|
73 | fHPQ = new TH1I("HPQ","Distribution of Summed FADC Slices",fQnbins,fQfirst,fQlast);
|
---|
74 | fHPQ->SetXTitle("Sum FADC Slices");
|
---|
75 | fHPQ->SetYTitle("Nr. of events");
|
---|
76 | fHPQ->Sumw2();
|
---|
77 |
|
---|
78 | fErrQfirst = 0.;
|
---|
79 | fErrQlast = gkStartPINDiodeBinNr;
|
---|
80 | fErrQnbins = gkStartPINDiodeBinNr;
|
---|
81 |
|
---|
82 | fHErrQ = new TH1F("HErrQ","Distribution of Variances of Summed FADC Slices",fErrQnbins,fErrQfirst,fErrQlast);
|
---|
83 | fHErrQ->SetXTitle("Variance Summed FADC Slices");
|
---|
84 | fHErrQ->SetYTitle("Nr. of events");
|
---|
85 | fHErrQ->Sumw2();
|
---|
86 |
|
---|
87 | Int_t tfirst = 0;
|
---|
88 | Int_t tlast = 31;
|
---|
89 | Int_t nbins = 32;
|
---|
90 |
|
---|
91 | fHPT = new TH1I("HPT","Distribution of Mean Arrival Times",nbins,tfirst,tlast);
|
---|
92 | fHPT->SetXTitle("Mean Arrival Times [FADC slice nr]");
|
---|
93 | fHPT->SetYTitle("Nr. of events");
|
---|
94 | fHPT->Sumw2();
|
---|
95 |
|
---|
96 | }
|
---|
97 |
|
---|
98 | MHCalibrationPINDiode::~MHCalibrationPINDiode()
|
---|
99 | {
|
---|
100 |
|
---|
101 | delete fHPQ;
|
---|
102 | delete fHErrQ;
|
---|
103 |
|
---|
104 | if (fVarGausFit)
|
---|
105 | delete fVarGausFit;
|
---|
106 |
|
---|
107 | delete fHPT;
|
---|
108 |
|
---|
109 | }
|
---|
110 |
|
---|