source: trunk/MagicSoft/Mars/mhist/MHHillas.cc@ 859

Last change on this file since 859 was 859, checked in by tbretz, 23 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.1 KB
Line 
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
19ClassImp(MHHillas);
20
21MHHillas::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
49MHHillas::~MHHillas()
50{
51 delete fAlpha;
52 delete fWidth;
53 delete fLength;
54 delete fDist;
55}
56
57void MHHillas::Fill(const 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
65void 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->SetBit(kCanDelete);
77 fAlpha->Draw();
78 c->cd(2);
79 fLength->SetBit(kCanDelete);
80 fLength->Draw();
81 c->cd(3);
82 fDist->SetBit(kCanDelete);
83 fDist->Draw();
84 c->cd(4);
85 fWidth->SetBit(kCanDelete);
86 fWidth->Draw();
87
88 c->Modified();
89 c->Update();
90}
Note: See TracBrowser for help on using the repository browser.