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): Thomas Bretz 04/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
|
---|
19 | !
|
---|
20 | ! Copyright: MAGIC Software Development, 2000-2003
|
---|
21 | !
|
---|
22 | !
|
---|
23 | \* ======================================================================== */
|
---|
24 |
|
---|
25 | /////////////////////////////////////////////////////////////////////////////
|
---|
26 | //
|
---|
27 | // MHBlindPixels
|
---|
28 | //
|
---|
29 | ////////////////////////////////////////////////////////////////////////////
|
---|
30 | #include "MHBlindPixels.h"
|
---|
31 |
|
---|
32 | #include <TCanvas.h>
|
---|
33 |
|
---|
34 | #include "MBlindPixels.h"
|
---|
35 |
|
---|
36 | ClassImp(MHBlindPixels);
|
---|
37 |
|
---|
38 | // -------------------------------------------------------------------------
|
---|
39 | //
|
---|
40 | // Default Constructor.
|
---|
41 | //
|
---|
42 | MHBlindPixels::MHBlindPixels(const char *name, const char *title)
|
---|
43 | : fHist(fName, fTitle, 577, -.5, 577-.5)
|
---|
44 | {
|
---|
45 | fName = name ? name : "MHBlindPixels";
|
---|
46 | fTitle = title ? title : "Histogram for Blind Pixels";
|
---|
47 |
|
---|
48 | // - we initialize the histogram
|
---|
49 | // - we have to give diferent names for the diferent histograms because
|
---|
50 | // root don't allow us to have diferent histograms with the same name
|
---|
51 |
|
---|
52 | fHist.SetName(fName);
|
---|
53 | fHist.SetTitle(fTitle);
|
---|
54 |
|
---|
55 | fHist.SetDirectory(NULL);
|
---|
56 |
|
---|
57 | fHist.SetXTitle("Id");
|
---|
58 | fHist.SetYTitle("Counts");
|
---|
59 | }
|
---|
60 |
|
---|
61 | // ------------------------------------------------------------------------
|
---|
62 | //
|
---|
63 | // Drawing function. It creates its own canvas.
|
---|
64 | //
|
---|
65 | void MHBlindPixels::Draw(Option_t *option)
|
---|
66 | {
|
---|
67 | TVirtualPad *pad = gPad ? gPad : MakeDefCanvas(this);
|
---|
68 | pad->SetBorderMode(0);
|
---|
69 |
|
---|
70 | fHist.Draw(option);
|
---|
71 |
|
---|
72 | pad->Modified();
|
---|
73 | pad->Update();
|
---|
74 | }
|
---|
75 |
|
---|
76 | Bool_t MHBlindPixels::Fill(const MParContainer *par)
|
---|
77 | {
|
---|
78 | if (!par)
|
---|
79 | return kFALSE;
|
---|
80 |
|
---|
81 | const MBlindPixels &bp = *(MBlindPixels*)par;
|
---|
82 |
|
---|
83 | // FIXME: Slow.
|
---|
84 | for (int i=0; i<577; i++)
|
---|
85 | if (bp.IsBlind(i))
|
---|
86 | fHist.Fill(i);
|
---|
87 |
|
---|
88 | return kTRUE;
|
---|
89 | }
|
---|