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): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
|
---|
19 | ! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
|
---|
20 | !
|
---|
21 | ! Copyright: MAGIC Software Development, 2000-2001
|
---|
22 | !
|
---|
23 | !
|
---|
24 | \* ======================================================================== */
|
---|
25 |
|
---|
26 | ///////////////////////////////////////////////////////////////////////
|
---|
27 | //
|
---|
28 | // MHFadcPix
|
---|
29 | //
|
---|
30 | // This container stores a hostogram to display an Fadc Spekrtum.
|
---|
31 | // The spektrum of all the values measured by the Fadcs.
|
---|
32 | //
|
---|
33 | ///////////////////////////////////////////////////////////////////////
|
---|
34 |
|
---|
35 | #include "MHFadcPix.h"
|
---|
36 |
|
---|
37 | #include <TPad.h>
|
---|
38 |
|
---|
39 | ClassImp(MHFadcPix);
|
---|
40 |
|
---|
41 | // --------------------------------------------------------------------------
|
---|
42 | //
|
---|
43 | // Creates the histograms for lo and hi gain of one pixel
|
---|
44 | //
|
---|
45 | MHFadcPix::MHFadcPix(UInt_t pixid)
|
---|
46 | {
|
---|
47 | // FIXME! Set the right axis titles and ... and ...
|
---|
48 | Char_t tmp1[40]="hi";
|
---|
49 | Char_t tmp2[40]="hi gain Pixel";
|
---|
50 |
|
---|
51 | if (pixid)
|
---|
52 | {
|
---|
53 | sprintf(tmp1, "%s%d", tmp1, pixid);
|
---|
54 | sprintf(tmp2, "%s %d", tmp2, pixid);
|
---|
55 | }
|
---|
56 | fHistHi = new TH1F(tmp1, tmp2, 256, 0, 255);
|
---|
57 |
|
---|
58 |
|
---|
59 | Char_t tmp3[40]="lo";
|
---|
60 | Char_t tmp4[40]="lo gain Pixel";
|
---|
61 |
|
---|
62 | if (pixid)
|
---|
63 | {
|
---|
64 | sprintf(tmp3, "%s%d", tmp3, pixid);
|
---|
65 | sprintf(tmp4, "%s %d", tmp4, pixid);
|
---|
66 | }
|
---|
67 | fHistLo = new TH1F(tmp3, tmp4, 256, 0, 255);
|
---|
68 | }
|
---|
69 |
|
---|
70 | // --------------------------------------------------------------------------
|
---|
71 | MHFadcPix::~MHFadcPix()
|
---|
72 | {
|
---|
73 | delete fHistHi;
|
---|
74 | delete fHistLo;
|
---|
75 | }
|
---|
76 |
|
---|
77 | // --------------------------------------------------------------------------
|
---|
78 | void MHFadcPix::Draw(Option_t *)
|
---|
79 | {
|
---|
80 | if (!gPad)
|
---|
81 | {
|
---|
82 | if (!gROOT->GetMakeDefCanvas())
|
---|
83 | return;
|
---|
84 | (gROOT->GetMakeDefCanvas())();
|
---|
85 | }
|
---|
86 |
|
---|
87 | gPad->Divide(1, 2);
|
---|
88 |
|
---|
89 | gPad->cd(0);
|
---|
90 | fHistHi->Draw();
|
---|
91 |
|
---|
92 | gPad->cd(1);
|
---|
93 | fHistLo->Draw();
|
---|
94 | }
|
---|