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

Last change on this file since 3334 was 3165, checked in by gaug, 21 years ago
*** empty log message ***
File size: 3.0 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
72void MHPedestalPix::Clear(Option_t *o)
73{
74
75 fPixId = -1;
76 MHGausEvents::Clear();
77 return;
78}
79
80
81
82void MHPedestalPix::InitBins()
83{
84
85 fHGausHist.SetBins(fChargeNbins,fChargeFirst,fChargeLast);
86
87}
88
89
90void MHPedestalPix::ChangeHistId(Int_t id)
91{
92
93 fPixId = id;
94
95 fHGausHist.SetName(Form("%s%d", fHGausHist.GetName(), id));
96 fHGausHist.SetTitle(Form("%s%d", fHGausHist.GetTitle(), id));
97}
98
99
100void MHPedestalPix::Renorm(const Float_t nslices)
101{
102
103 if (!IsGausFitOK())
104 return;
105
106 Float_t sqslices = TMath::Sqrt(nslices);
107
108 SetMean(GetMean()/nslices);
109 //
110 // Mean error goes with PedestalRMS/Sqrt(entries) -> scale with slices
111 //
112 SetMeanErr(GetMeanErr()/nslices);
113 //
114 // Sigma goes like PedestalRMS -> scale with sqrt(slices)
115 //
116 SetSigma(GetSigma()/sqslices);
117 //
118 // Sigma error goes like PedestalRMS/2.(entries) -> scale with slices
119 //
120 SetSigmaErr(GetSigmaErr()/nslices);
121
122}
123
Note: See TracBrowser for help on using the repository browser.