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

Last change on this file since 2489 was 2204, checked in by Daniela Dorner, 21 years ago
*** empty log message ***
File size: 3.7 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; //! Color conversion table
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 void FillRandom();
99
100 void DrawPixelNumbers();
101
102 void Paint(Option_t *option="");
103 void Reset();
104 void Draw(Option_t *option="");
105 void SavePrimitive(ofstream &out, Option_t *);
106 Int_t DistancetoPrimitive(Int_t px, Int_t py);
107 char *GetObjectInfo(Int_t px, Int_t py) const;
108 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
109
110 void SetPalette(Int_t ncolors, Int_t *colors);
111
112 void SetPrettyPalette(); // *MENU*
113 void SetDeepBlueSeaPalette(); // *MENU*
114 void SetInvDeepBlueSeaPalette(); // *MENU*
115
116 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
117
118 void SetMinimum(Float_t m); // *MENU*
119 void SetMaximum(Float_t m); // *MENU*
120
121 void AddNotify(const MCamEvent &event) { fNotify->Add((TObject*)(&event)); }
122
123 //void SetStatusBar(TGStatusBar *bar) { fStatusBar = bar; }
124
125 ClassDef(MCamDisplay, 1) // Displays the magic camera
126};
127
128inline void MCamDisplay::SetAutoScale(Bool_t input)
129{
130 fAutoScale = input;
131}
132
133inline void MCamDisplay::SetMinimum(Float_t m)
134{
135 fMinimum = m;
136}
137
138inline void MCamDisplay::SetMaximum(Float_t m)
139{
140 fMaximum = m;
141}
142
143#endif
Note: See TracBrowser for help on using the repository browser.