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

Last change on this file since 1972 was 1965, checked in by tbretz, 21 years ago
*** empty log message ***
File size: 3.1 KB
Line 
1#ifndef MARS_MCamDisplay
2#define MARS_MCamDisplay
3
4#ifndef MARS_MAGIC
5#include "MAGIC.h"
6#endif
7#ifndef ROOT_TClonesArray
8#include <TClonesArray.h>
9#endif
10
11class TBox;
12class TText;
13class TArrow;
14
15class MGeomCam;
16class MHexagon;
17class MCerPhotEvt;
18class MCerPhotPix;
19class MImgCleanStd;
20class MPedestalPix;
21class MPedestalCam;
22
23class MCamDisplay : public TObject
24{
25private:
26 MGeomCam *fGeomCam; // pointer to camera geometry
27
28 Bool_t fAutoScale; // indicating the autoscale function
29
30 UInt_t fNumPixels; // number of pixels in the present geometry
31 Float_t fRange; // the range in millimeters of the present geometry
32
33 Int_t fColors[50];
34
35 TArrow *fArrowX; // Coordinate System
36 TArrow *fArrowY; // Coordinate System
37
38 TText *fLegRadius; // Coordinate System
39 TText *fLegDegree; // Coordinate System
40
41 TClonesArray *fPixels; // array of all hexagons
42 TClonesArray *fLegend; // array of all color bars
43 TClonesArray *fLegText; // array of all texts
44
45 UInt_t fW; // Width of canvas
46 UInt_t fH; // Height of canvas
47
48 TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); }
49 TText *GetText(Int_t i) { return (TText*)fLegText->At(i); }
50
51 MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
52
53 void SetPixColor(const MCerPhotPix &pix, const UInt_t i, Float_t min, Float_t max);
54 void SetPixColorRatio(const MCerPhotPix &pix, Float_t min, Float_t max);
55 void SetPixColorLevel(const MCerPhotPix &pix, Float_t lvl1, Float_t lvl2);
56 void SetPixColorError(const MCerPhotPix &pix, const UInt_t i, Float_t min, Float_t max);
57 void SetPixColorPedestal(const MPedestalPix &pix, const UInt_t i, Float_t min, Float_t max);
58 Int_t GetColor(Float_t val, Float_t min, Float_t max);
59
60 void UpdateLegend(Float_t min, Float_t max);
61 void SetRange();
62 void SetPalette();
63
64public:
65 MCamDisplay();
66 MCamDisplay(MGeomCam *geom);
67 ~MCamDisplay();
68
69 void SetAutoScale(Bool_t input=kTRUE) { fAutoScale = input; }
70 void FillPhotNum(const MCerPhotEvt &event);
71 void FillRatio(const MCerPhotEvt &event);
72 void FillLevels(const MCerPhotEvt &event, Float_t lvl1, Float_t lvl2);
73 void FillErrorPhot(const MCerPhotEvt &event);
74 void FillLevels(const MCerPhotEvt &event, const MImgCleanStd &clean);
75 void FillPedestals(const MPedestalCam &event);
76
77 void DrawPixelNumbers();
78
79 void Paint(Option_t *option="");
80 void Reset();
81 void Draw(Option_t *option="");
82 void SavePrimitive(ofstream &out, Option_t *);
83 Int_t DistancetoPrimitive(Int_t px, Int_t py);
84 //virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
85
86 void SetPalette(Int_t ncolors, Int_t *colors);
87
88 void SetPrettyPalette(); // *MENU*
89 void SetDeepBlueSeaPalette(); // *MENU*
90 void SetInvDeepBlueSeaPalette(); // *MENU*
91
92 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
93
94 ClassDef(MCamDisplay, 0) // Displays the magic camera
95};
96
97#endif
Note: See TracBrowser for help on using the repository browser.