source: trunk/MagicSoft/Mars/manalysis/MHPedestalPix.cc@ 3164

Last change on this file since 3164 was 3164, checked in by gaug, 21 years ago
*** empty log message ***
File size: 2.9 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// MHPedestalPix
28//
29// Histogram class for pedestal analysis. Holds the histogrammed pedestals,
30// derives from MHGausEvents, perform Fourier analysis
31//
32//////////////////////////////////////////////////////////////////////////////
33#include "MHPedestalPix.h"
34
35#include <TH1.h>
36
37ClassImp(MHPedestalPix);
38
39using namespace std;
40//
41const Int_t MHPedestalPix::fgChargeNbins = 450 ;
42const Axis_t MHPedestalPix::fgChargeFirst = -0.5;
43const Axis_t MHPedestalPix::fgChargeLast = 449.5;
44// --------------------------------------------------------------------------
45//
46// Default Constructor.
47//
48MHPedestalPix::MHPedestalPix(const char *name, const char *title)
49 : fPixId(-1)
50{
51
52 fName = name ? name : "MHPedestalPix";
53 fTitle = title ? title : "Histogrammed Pedestal events";
54
55 SetChargeNbins();
56 SetChargeFirst();
57 SetChargeLast();
58
59 // Create a large number of bins, later we will rebin
60 fHGausHist.SetName("HPedestalCharge");
61 fHGausHist.SetTitle("Distribution of Summed FADC Pedestal Slices Pixel ");
62 fHGausHist.SetXTitle("Sum FADC Slices");
63 fHGausHist.SetYTitle("Nr. of events");
64 fHGausHist.Sumw2();
65
66}
67
68MHPedestalPix::~MHPedestalPix()
69{
70}
71
72
73void MHPedestalPix::InitBins()
74{
75
76 fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
77
78}
79
80
81void MHPedestalPix::ChangeHistId(Int_t id)
82{
83
84 fPixId = id;
85
86 fHGausHist.SetName(Form("%s%d", fHGausHist.GetName(), id));
87 fHGausHist.SetTitle(Form("%s%d", fHGausHist.GetTitle(), id));
88}
89
90
91void MHPedestalPix::Renorm(const Float_t nslices)
92{
93
94 if (!IsGausFitOK())
95 return;
96
97 Float_t sqslices = TMath::Sqrt(nslices);
98
99 SetMean(GetMean()/nslices);
100 //
101 // Mean error goes with PedestalRMS/Sqrt(entries) -> scale with slices
102 //
103 SetMeanErr(GetMeanErr()/nslices);
104 //
105 // Sigma goes like PedestalRMS -> scale with sqrt(slices)
106 //
107 SetSigma(GetSigma()/sqslices);
108 //
109 // Sigma error goes like PedestalRMS/2.(entries) -> scale with slices
110 //
111 SetSigmaErr(GetSigmaErr()/nslices);
112
113}
114
Note: See TracBrowser for help on using the repository browser.