source: trunk/MagicSoft/Mars/mhist/MHFadcPix.cc@ 724

Last change on this file since 724 was 711, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 1.3 KB
Line 
1///////////////////////////////////////////////////////////////////////
2//
3// MHFadcPix
4//
5// This container stores a hostogram to display an Fadc Spekrtum.
6// The spektrum of all the values measured by the Fadcs.
7//
8///////////////////////////////////////////////////////////////////////
9
10#include "MHFadcPix.h"
11
12#include <TPad.h>
13
14ClassImp(MHFadcPix)
15
16MHFadcPix::MHFadcPix(UInt_t pixid)
17{
18 //
19 // Creates the histograms for lo and hi gain of one pixel
20 //
21 // FIXME! Set the right axis titles and ... and ...
22 //
23 Char_t tmp1[40]="hi";
24 Char_t tmp2[40]="hi gain Pixel";
25
26 if (pixid)
27 {
28 sprintf(tmp1, "%s%d", tmp1, pixid);
29 sprintf(tmp2, "%s %d", tmp2, pixid);
30 }
31 fHistHi = new TH1F(tmp1, tmp2, 256, 0, 255);
32
33
34 Char_t tmp3[40]="lo";
35 Char_t tmp4[40]="lo gain Pixel";
36
37 if (pixid)
38 {
39 sprintf(tmp3, "%s%d", tmp3, pixid);
40 sprintf(tmp4, "%s %d", tmp4, pixid);
41 }
42 fHistLo = new TH1F(tmp3, tmp4, 256, 0, 255);
43}
44
45MHFadcPix::~MHFadcPix()
46{
47 delete fHistHi;
48 delete fHistLo;
49}
50
51void MHFadcPix::Draw(Option_t *)
52{
53 if (!gPad)
54 {
55 if (!gROOT->GetMakeDefCanvas())
56 return;
57 (gROOT->GetMakeDefCanvas())();
58 }
59
60 gPad->Divide(1, 2);
61
62 gPad->cd(0);
63 fHistHi->Draw();
64
65 gPad->cd(1);
66 fHistLo->Draw();
67}
Note: See TracBrowser for help on using the repository browser.