1 | ///////////////////////////////////////////////////////////////////////
|
---|
2 | //
|
---|
3 | // MHHillas
|
---|
4 | //
|
---|
5 | // This class contains histograms for every Hillas parameter
|
---|
6 | //
|
---|
7 | ///////////////////////////////////////////////////////////////////////
|
---|
8 |
|
---|
9 | #include "MHHillas.h"
|
---|
10 |
|
---|
11 | #include <math.h>
|
---|
12 |
|
---|
13 | #include <TH1.h>
|
---|
14 | #include <TPad.h>
|
---|
15 | #include <TCanvas.h>
|
---|
16 |
|
---|
17 | #include "MHillas.h"
|
---|
18 |
|
---|
19 | ClassImp(MHHillas)
|
---|
20 |
|
---|
21 | MHHillas::MHHillas (const char *name, const char *title)
|
---|
22 | {
|
---|
23 | //
|
---|
24 | // default constructor
|
---|
25 | // creates an a list of histograms for all pixels and both gain channels
|
---|
26 | //
|
---|
27 |
|
---|
28 | //
|
---|
29 | // set the name and title of this object
|
---|
30 | //
|
---|
31 |
|
---|
32 | *fName = name ? name : "MHHillas" ;
|
---|
33 | *fTitle = title ? title : "Container for Hillas histograms" ;
|
---|
34 |
|
---|
35 | //
|
---|
36 | // loop over all Pixels and create two histograms
|
---|
37 | // one for the Low and one for the High gain
|
---|
38 | // connect all the histogram with the container fHist
|
---|
39 | //
|
---|
40 | // FIXME! Make the histograms looking that they can be used for
|
---|
41 | // presentations (axis title, ...)
|
---|
42 | //
|
---|
43 | fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas", 90, 0, 90);
|
---|
44 | fWidth = new TH1F("Width [mm]", "Width of Hillas", 100, 0, 300);
|
---|
45 | fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
|
---|
46 | fDist = new TH1F("Dist [mm]", "Dist of Hillas", 100, 0, 300);
|
---|
47 | }
|
---|
48 |
|
---|
49 | MHHillas::~MHHillas()
|
---|
50 | {
|
---|
51 | delete fAlpha;
|
---|
52 | delete fWidth;
|
---|
53 | delete fLength;
|
---|
54 | delete fDist;
|
---|
55 | }
|
---|
56 |
|
---|
57 | void MHHillas::Fill(MHillas *par)
|
---|
58 | {
|
---|
59 | fAlpha ->Fill(fabs(par->GetAlpha()));
|
---|
60 | fWidth ->Fill(par->GetWidth());
|
---|
61 | fLength->Fill(par->GetLength());
|
---|
62 | fDist ->Fill(par->GetDist());
|
---|
63 | }
|
---|
64 |
|
---|
65 | void MHHillas::Draw(Option_t *)
|
---|
66 | {
|
---|
67 |
|
---|
68 | //
|
---|
69 | // Fixme! Check for an existing canvas.
|
---|
70 | // And create one if no canvas exists only!
|
---|
71 | //
|
---|
72 | TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
|
---|
73 | c->Divide(2,2);
|
---|
74 |
|
---|
75 | c->cd(1);
|
---|
76 | fAlpha->Draw();
|
---|
77 | c->cd(2);
|
---|
78 | fLength->Draw();
|
---|
79 | c->cd(3);
|
---|
80 | fDist->Draw();
|
---|
81 | c->cd(4);
|
---|
82 | fWidth->Draw();
|
---|
83 |
|
---|
84 | c->Modified();
|
---|
85 | c->Update();
|
---|
86 | }
|
---|