| 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 02/2004 <mailto:markus@ifae.es>
|
|---|
| 19 | !
|
|---|
| 20 | ! Copyright: MAGIC Software Development, 2000-2004
|
|---|
| 21 | !
|
|---|
| 22 | !
|
|---|
| 23 | \* ======================================================================== */
|
|---|
| 24 |
|
|---|
| 25 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 26 | //
|
|---|
| 27 | // MHCalibrationRelTimePix
|
|---|
| 28 | //
|
|---|
| 29 | // Histogram class for the relative arrival time calibration.
|
|---|
| 30 | // Holds the histogrammed arrival times,
|
|---|
| 31 | // derives from MHGausEvents, perform Fourier analysis
|
|---|
| 32 | //
|
|---|
| 33 | //////////////////////////////////////////////////////////////////////////////
|
|---|
| 34 | #include "MHCalibrationRelTimePix.h"
|
|---|
| 35 |
|
|---|
| 36 | #include <TH1.h>
|
|---|
| 37 |
|
|---|
| 38 | ClassImp(MHCalibrationRelTimePix);
|
|---|
| 39 |
|
|---|
| 40 | using namespace std;
|
|---|
| 41 | //
|
|---|
| 42 | const Int_t MHCalibrationRelTimePix::fgChargeNbins = 900;
|
|---|
| 43 | const Axis_t MHCalibrationRelTimePix::fgChargeFirst = -13.;
|
|---|
| 44 | const Axis_t MHCalibrationRelTimePix::fgChargeLast = 13.;
|
|---|
| 45 | // --------------------------------------------------------------------------
|
|---|
| 46 | //
|
|---|
| 47 | // Default Constructor.
|
|---|
| 48 | //
|
|---|
| 49 | // Sets:
|
|---|
| 50 | // - the default number for fChargeNbins (fgChargeNbins)
|
|---|
| 51 | // - the default number for fChargeFirst (fgChargeFirst)
|
|---|
| 52 | // - the default number for fChargeLast (fgChargeLast)
|
|---|
| 53 | //
|
|---|
| 54 | // - the default name of the fHGausHist ("HCalibrationRelTime")
|
|---|
| 55 | // - the default title of the fHGausHist ("Distribution of Relative Arrival Times Pixel ")
|
|---|
| 56 | // - the default x-axis title for fHGausHist ("FADC Slice")
|
|---|
| 57 | // - the default y-axis title for fHGausHist ("Nr. of events")
|
|---|
| 58 | //
|
|---|
| 59 | // Initializes:
|
|---|
| 60 | // - fPixId to -1
|
|---|
| 61 | //
|
|---|
| 62 | // Executes:
|
|---|
| 63 | // - MHGausEvents::Clear()
|
|---|
| 64 | //
|
|---|
| 65 | MHCalibrationRelTimePix::MHCalibrationRelTimePix(const char *name, const char *title)
|
|---|
| 66 | : fPixId(-1)
|
|---|
| 67 | {
|
|---|
| 68 |
|
|---|
| 69 | fName = name ? name : "MHCalibrationRelTimePix";
|
|---|
| 70 | fTitle = title ? title : "Histogrammed Calibration Relative Arrival Time events";
|
|---|
| 71 |
|
|---|
| 72 | SetChargeNbins();
|
|---|
| 73 | SetChargeFirst();
|
|---|
| 74 | SetChargeLast();
|
|---|
| 75 |
|
|---|
| 76 | // Create a large number of bins, later we will rebin
|
|---|
| 77 | fHGausHist.SetName("HCalibrationRelTime");
|
|---|
| 78 | fHGausHist.SetTitle("Distribution of Relative Arrival Times Pixel ");
|
|---|
| 79 | fHGausHist.SetXTitle("FADC Slice");
|
|---|
| 80 | fHGausHist.SetYTitle("Nr. of events");
|
|---|
| 81 |
|
|---|
| 82 | Clear();
|
|---|
| 83 |
|
|---|
| 84 | }
|
|---|
| 85 |
|
|---|
| 86 | // --------------------------------------------------------------------------
|
|---|
| 87 | //
|
|---|
| 88 | // Sets:
|
|---|
| 89 | // - fPixId to -1
|
|---|
| 90 | //
|
|---|
| 91 | // Executes:
|
|---|
| 92 | // - MHGausEvents::Clear()
|
|---|
| 93 | //
|
|---|
| 94 | void MHCalibrationRelTimePix::Clear(Option_t *o)
|
|---|
| 95 | {
|
|---|
| 96 |
|
|---|
| 97 | fPixId = -1;
|
|---|
| 98 | MHGausEvents::Clear();
|
|---|
| 99 | return;
|
|---|
| 100 | }
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 | // --------------------------------------------------------------------------
|
|---|
| 104 | //
|
|---|
| 105 | // Empty function to overload MHGausEvents::Reset()
|
|---|
| 106 | //
|
|---|
| 107 | void MHCalibrationRelTimePix::Reset()
|
|---|
| 108 | {
|
|---|
| 109 | }
|
|---|
| 110 |
|
|---|
| 111 | // --------------------------------------------------------------------------
|
|---|
| 112 | //
|
|---|
| 113 | // Sets:
|
|---|
| 114 | // - fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
|
|---|
| 115 | //
|
|---|
| 116 | void MHCalibrationRelTimePix::Init()
|
|---|
| 117 | {
|
|---|
| 118 |
|
|---|
| 119 | fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
|
|---|
| 120 |
|
|---|
| 121 | }
|
|---|
| 122 |
|
|---|
| 123 | // --------------------------------------------------------------------------
|
|---|
| 124 | //
|
|---|
| 125 | // - Set fPixId to id
|
|---|
| 126 | //
|
|---|
| 127 | // Add id to names and titles of:
|
|---|
| 128 | // - fHGausHist
|
|---|
| 129 | //
|
|---|
| 130 | void MHCalibrationRelTimePix::ChangeHistId(Int_t id)
|
|---|
| 131 | {
|
|---|
| 132 |
|
|---|
| 133 | fPixId = id;
|
|---|
| 134 |
|
|---|
| 135 | fHGausHist.SetName( Form("%s%d", fHGausHist.GetName(), id));
|
|---|
| 136 | fHGausHist.SetTitle( Form("%s%d", fHGausHist.GetTitle(), id));
|
|---|
| 137 |
|
|---|
| 138 | }
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 | // ----------------------------------------------------------------------
|
|---|
| 142 | //
|
|---|
| 143 | // Renorm the results from FADC slices to times.
|
|---|
| 144 | // The parameters slicewidth is the inverse of the FADC frequency and has the unit ns.
|
|---|
| 145 | //
|
|---|
| 146 | void MHCalibrationRelTimePix::Renorm(const Float_t slicewidth)
|
|---|
| 147 | {
|
|---|
| 148 |
|
|---|
| 149 | SetMean( GetMean() * slicewidth );
|
|---|
| 150 | SetMeanErr( GetMeanErr() * slicewidth );
|
|---|
| 151 | SetSigma( GetSigma() * slicewidth );
|
|---|
| 152 | SetSigmaErr( GetSigmaErr()* slicewidth );
|
|---|
| 153 |
|
|---|
| 154 | }
|
|---|
| 155 |
|
|---|