source: trunk/MagicSoft/Mars/manalysis/MNphotEvent.cc@ 595

Last change on this file since 595 was 595, checked in by harald, 24 years ago
Added the first implementation of a EventDisplay for MAGIC. The class doing the job is called "MCamDisplay".
File size: 2.2 KB
Line 
1#include "MNphotEvent.h"
2
3#include <math.h>
4#include <TClonesArray.h>
5#include <TCanvas.h>
6
7#include "MCamGeom.h"
8#include "MCamDisplay.h"
9#include "MHexagon.h"
10
11ClassImp(MNphotPix)
12ClassImp(MNphotEvent)
13
14MNphotPix::MNphotPix(Int_t pix, Float_t phot , Float_t errphot )
15{
16 // default constructor
17 fPixId = pix ;
18 fPhot = phot ;
19 fErrPhot = errphot ;
20}
21
22void MNphotPix::SetPixelContent(Int_t pix, Float_t phot , Float_t errphot)
23{
24 fPixId = pix ;
25 fPhot = phot ;
26 fErrPhot = errphot ;
27}
28
29void MNphotPix::Print()
30{
31 // information about a pixel
32 cout << "MNphotPix: Pixel: "<< fPixId
33 << " Nphot= " << fPhot
34 << " Error(Nphot) = " << fErrPhot
35 << endl ;
36}
37
38// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
39// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
40// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
41
42
43MNphotEvent::MNphotEvent(const char *name, const char *title )
44{
45 // the default constructor
46
47
48 *fName = name ? name : "MNphotEvent";
49 *fTitle = name ? name : "(Number of Photon)-Event Information";
50
51 fType = 0 ;
52 fNbPixels = 0 ;
53
54 fPixels = new TClonesArray ("MNphotPix", 577) ;
55
56 fPixels->Clear() ;
57}
58
59void MNphotEvent::Draw(Option_t* option)
60{
61 //
62 //
63
64 MCamDisplay *disp = new MCamDisplay(fType) ;
65
66 disp->Draw( this ) ;
67
68 // disp->Draw() ;
69
70}
71
72
73
74
75Int_t MNphotEvent::GetNbPixels()
76{
77 return fNbPixels ;
78}
79
80void MNphotEvent::AddPixel(Int_t id, Float_t nph, Float_t err)
81{
82 TClonesArray &caP = *fPixels ;
83 new ( caP[fNbPixels++] ) MNphotPix( id, nph, err ) ;
84}
85
86void MNphotEvent::Clear()
87{
88 fNbPixels = 0 ;
89 fPixels->Clear() ;
90}
91
92void MNphotEvent::Print()
93{
94 cout << "MNphotEvent::Print()"
95 << "Number of Pixels: " << fNbPixels
96 << "(" << fPixels->GetEntries() << ")"
97 << endl ;
98
99 for (Int_t il=0; il<fPixels->GetEntries(); il++ )
100 {
101 ((MNphotPix *) fPixels->At(il))->Print() ;
102 }
103}
104
105Int_t MNphotEvent::GetPixelId(Int_t i )
106{
107 return ( ( (MNphotPix *) fPixels->At(i))->GetPixId() ) ;
108}
109
110Float_t MNphotEvent::GetPhotons(Int_t i )
111{
112 return ( ( (MNphotPix *) fPixels->At(i))->GetPhotons() ) ;
113}
Note: See TracBrowser for help on using the repository browser.