source: trunk/MagicSoft/Mars/mgui/MCamDisplay.h@ 2178

Last change on this file since 2178 was 2178, checked in by tbretz, 22 years ago
*** empty log message ***
File size: 3.6 KB
Line 
1#ifndef MARS_MCamDisplay
2#define MARS_MCamDisplay
3
4#ifndef MARS_MAGIC
5#include "MAGIC.h"
6#endif
7#ifndef ROOT_Gtypes
8#include <Gtypes.h>
9#endif
10#ifndef ROOT_TArrayF
11#include <TArrayF.h>
12#endif
13#ifndef ROOT_TArrayI
14#include <TArrayI.h>
15#endif
16#ifndef ROOT_TClonesArray
17#include <TClonesArray.h>
18#endif
19
20
21class TBox;
22class TText;
23class TArrow;
24class TGStatusBar;
25
26class MGeomCam;
27class MHexagon;
28class MCurrents;
29class MCamEvent;
30class MRflEvtData;
31class MCerPhotEvt;
32class MCerPhotPix;
33class MImgCleanStd;
34class MPedestalPix;
35class MPedestalCam;
36
37class MCamDisplay : public TObject
38{
39private:
40 MGeomCam *fGeomCam; // pointer to camera geometry
41
42 Bool_t fAutoScale; // indicating the autoscale function
43
44 UInt_t fNumPixels; // number of pixels in the present geometry
45 Float_t fRange; // the range in millimeters of the present geometry
46
47 TArrayI fColors;
48
49 TArrow *fArrowX; // Coordinate System
50 TArrow *fArrowY; // Coordinate System
51
52 TText *fLegRadius; // Coordinate System
53 TText *fLegDegree; // Coordinate System
54
55 TClonesArray *fPixels; // array of all hexagons
56 TClonesArray *fLegend; // array of all color bars
57 TClonesArray *fLegText; // array of all texts
58 TClonesArray *fPhotons; // array of reflector photons
59
60 TArrayF fData;
61 Float_t fMinimum;
62 Float_t fMaximum;
63
64 TList *fNotify;
65
66 //TGStatusBar *fStatusBar;
67
68 TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); }
69
70 MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
71
72 Int_t GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog);
73
74 void Update(Bool_t islog);
75 void UpdateLegend(Float_t min, Float_t max, Bool_t islog);
76 void SetRange();
77 void SetPalette();
78
79 Int_t GetPixelIndex(Int_t px, Int_t py) const;
80
81 enum {
82 kIsUsed = BIT(14)
83 };
84
85public:
86 MCamDisplay();
87 MCamDisplay(MGeomCam *geom);
88 ~MCamDisplay();
89
90 void SetAutoScale(Bool_t input=kTRUE); // *MENU*
91
92 void ShowRflEvent(const MRflEvtData *event=NULL, EMarkerStyle m=kFullDotMedium);
93 void FillRflEvent(const MRflEvtData &event);
94 void FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2);
95 void FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean);
96 void Fill(const MCamEvent &event, Int_t type=0);
97 void Fill(const TArrayF &event, Bool_t ispos=kTRUE);
98
99 void DrawPixelNumbers();
100
101 void Paint(Option_t *option="");
102 void Reset();
103 void Draw(Option_t *option="");
104 void SavePrimitive(ofstream &out, Option_t *);
105 Int_t DistancetoPrimitive(Int_t px, Int_t py);
106 char *GetObjectInfo(Int_t px, Int_t py) const;
107 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
108
109 void SetPalette(Int_t ncolors, Int_t *colors);
110
111 void SetPrettyPalette(); // *MENU*
112 void SetDeepBlueSeaPalette(); // *MENU*
113 void SetInvDeepBlueSeaPalette(); // *MENU*
114
115 void SetPix(const Int_t pixnum, const Int_t color, Float_t min, Float_t max); // New function added by M.Lopez in 31-01-03
116
117 void SetMinimum(Float_t m); // *MENU*
118 void SetMaximum(Float_t m); // *MENU*
119
120 void AddNotify(const MCamEvent &event) { fNotify->Add((TObject*)(&event)); }
121
122 //void SetStatusBar(TGStatusBar *bar) { fStatusBar = bar; }
123
124 ClassDef(MCamDisplay, 0) // Displays the magic camera
125};
126
127inline void MCamDisplay::SetAutoScale(Bool_t input)
128{
129 fAutoScale = input;
130}
131
132inline void MCamDisplay::SetMinimum(Float_t m)
133{
134 fMinimum = m;
135}
136
137inline void MCamDisplay::SetMaximum(Float_t m)
138{
139 fMaximum = m;
140}
141
142#endif
Note: See TracBrowser for help on using the repository browser.