source: trunk/MagicSoft/Mars/mdatacheck/MHHillas.cc@ 706

Last change on this file since 706 was 706, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 1.8 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 <TH1.h>
12#include <TPad.h>
13#include <TCanvas.h>
14
15#include "MHillas.h"
16
17ClassImp(MHHillas)
18
19MHHillas::MHHillas (const char *name, const char *title)
20{
21 //
22 // default constructor
23 // creates an a list of histograms for all pixels and both gain channels
24 //
25
26 //
27 // set the name and title of this object
28 //
29
30 *fName = name ? name : "MHHillas" ;
31 *fTitle = title ? title : "Container for Hillas histograms" ;
32
33 //
34 // loop over all Pixels and create two histograms
35 // one for the Low and one for the High gain
36 // connect all the histogram with the container fHist
37 //
38 fAlpha = new TH1F("Alpha [deg]", "Alpha of Hillas", 90, 0, 90);
39 fWidth = new TH1F("Width [mm]", "Width of Hillas", 100, 0, 300);
40 fLength = new TH1F("Length [mm]", "Length of Hillas", 100, 0, 300);
41 fDist = new TH1F("Dist [mm]", "Dist of Hillas", 100, 0, 300);
42}
43
44MHHillas::~MHHillas()
45{
46 delete fAlpha;
47 delete fWidth;
48 delete fLength;
49 delete fDist;
50}
51
52void MHHillas::Fill(MHillas *par)
53{
54 fAlpha ->Fill(fabs(par->GetAlpha()));
55 fWidth ->Fill(par->GetWidth());
56 fLength->Fill(par->GetLength());
57 fDist ->Fill(par->GetDist());
58}
59
60void MHHillas::Draw(Option_t *)
61{
62
63 //
64 // Fixme! Check for an existing canvas.
65 // And create one if no canvas exists only!
66 //
67 TCanvas *c = new TCanvas("Hillas", "Histograms of Hillas Parameters");
68 c->Divide(2,2);
69
70 c->cd(1);
71 fAlpha->Draw();
72 c->cd(2);
73 fLength->Draw();
74 c->cd(3);
75 fDist->Draw();
76 c->cd(4);
77 fWidth->Draw();
78
79 c->Modified();
80 c->Update();
81}
Note: See TracBrowser for help on using the repository browser.