source: trunk/MagicSoft/Mars/mcalib/MHCalibrationRelTimePix.cc@ 3839

Last change on this file since 3839 was 3642, checked in by gaug, 21 years ago
*** empty log message ***
File size: 4.1 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 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// Stores and fits the relative arrival times between pixel fPixId and
31// pixel number 1 (hardware index: 2). Times are taken from MArrivalTimePix
32//
33// Results are re-normalized to a value per time (ns) with the formulae:
34//
35// - Mean Rel. Time = Mean Rel. Time * fFADCSliceWidth
36// - Mean Rel. Time Error = Mean Rel. Time Error * fFADCSliceWidth
37// - Sigma Rel. Time = Sigma Rel. Time * fFADCSliceWidth
38// - Sigma Rel. Time Error = Sigma Rel. Time Error * fFADCSliceWidth
39//
40//////////////////////////////////////////////////////////////////////////////
41#include "MHCalibrationRelTimePix.h"
42
43#include <TH1.h>
44
45ClassImp(MHCalibrationRelTimePix);
46
47using namespace std;
48//
49const Int_t MHCalibrationRelTimePix::fgRelTimeNbins = 900;
50const Axis_t MHCalibrationRelTimePix::fgRelTimeFirst = -13.;
51const Axis_t MHCalibrationRelTimePix::fgRelTimeLast = 13.;
52const Float_t MHCalibrationRelTimePix::fgFADCSliceWidth = 3.3333;
53// --------------------------------------------------------------------------
54//
55// Default Constructor.
56//
57// Sets:
58// - the default number for fNbins (fgRelTimeNbins)
59// - the default number for fFirst (fgRelTimeFirst)
60// - the default number for fLast (fgRelTimeLast)
61//
62// - the default name of the fHGausHist ("HCalibrationRelTime")
63// - the default title of the fHGausHist ("Distribution of Relative Arrival Times Pixel ")
64// - the default x-axis title for fHGausHist ("FADC Slice")
65// - the default y-axis title for fHGausHist ("Nr. of events")
66//
67// - the default number for fFADCSliceWidth (fgFADCSliceWidth)
68//
69MHCalibrationRelTimePix::MHCalibrationRelTimePix(const char *name, const char *title)
70{
71
72 fName = name ? name : "MHCalibrationRelTimePix";
73 fTitle = title ? title : "Histogrammed Calibration Relative Arrival Time events";
74
75 SetNbins ( fgRelTimeNbins );
76 SetFirst ( fgRelTimeFirst );
77 SetLast ( fgRelTimeLast );
78 SetFADCSliceWidth();
79
80 // Create a large number of bins, later we will rebin
81 fHGausHist.SetName("HCalibrationRelTime");
82 fHGausHist.SetTitle("Distribution of Relative Arrival Times Pixel ");
83 fHGausHist.SetXTitle("FADC Slice");
84 fHGausHist.SetYTitle("Nr. of events");
85
86}
87
88
89// --------------------------------------------------------------------------
90//
91// Empty function to overload MHGausEvents::Reset()
92//
93void MHCalibrationRelTimePix::Reset()
94{
95}
96
97// --------------------------------------------------------------------------
98//
99// If mean and sigma have not yet been set, returns.
100//
101// Results are re-normalized to a value per time (ns) with the formulae:
102//
103// - Mean Rel. Time = Mean Rel. Time * fFADCSliceWidth
104// - Mean Rel. Time Error = Mean Rel. Time Error * fFADCSliceWidth
105// - Sigma Rel. Time = Sigma Rel. Time * fFADCSliceWidth
106// - Sigma Rel. Time Error = Sigma Rel. Time Error * fFADCSliceWidth
107//
108void MHCalibrationRelTimePix::Renorm()
109{
110
111 if (fMean == fMeanErr == fSigma == fSigmaErr == 0.)
112 return;
113
114 fMean *= fFADCSliceWidth;
115 fMeanErr *= fFADCSliceWidth;
116 fSigma *= fFADCSliceWidth;
117 fSigmaErr*= fFADCSliceWidth;
118
119}
Note: See TracBrowser for help on using the repository browser.