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

Last change on this file since 1840 was 1740, checked in by moralejo, 22 years ago
*** empty log message ***
File size: 3.2 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;
14class TVirtualPad;
15
16class MGeomCam;
17class MHexagon;
18class MCerPhotEvt;
19class MCerPhotPix;
20class MImgCleanStd;
21class MPedestalPix;
22class MPedestalCam;
23
24class MCamDisplay : public TObject
25{
26private:
27 MGeomCam *fGeomCam; // pointer to camera geometry
28
29 Bool_t fAutoScale; // indicating the autoscale function
30
31 UInt_t fNumPixels; // number of pixels in the present geometry
32 Float_t fRange; // the range in millimeters of the present geometry
33
34 Int_t fColors[50];
35
36 TArrow *fArrowX; // Coordinate System
37 TArrow *fArrowY; // Coordinate System
38
39 TText *fLegRadius; // Coordinate System
40 TText *fLegDegree; // Coordinate System
41
42 TClonesArray *fPixels; // array of all hexagons
43 TClonesArray *fLegend; // array of all color bars
44 TClonesArray *fLegText; // array of all texts
45
46 UInt_t fW; // Width of canvas
47 UInt_t fH; // Height of canvas
48 TVirtualPad *fDrawingPad; // pad in which we are drawing
49 Bool_t fIsAllocated;
50
51 TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); }
52 TText *GetText(Int_t i) { return (TText*)fLegText->At(i); }
53
54 MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
55
56 void SetPixColor(const MCerPhotPix &pix, const UInt_t i, Float_t min, Float_t max);
57 void SetPixColorRatio(const MCerPhotPix &pix, Float_t min, Float_t max);
58 void SetPixColorLevel(const MCerPhotPix &pix, Float_t lvl1, Float_t lvl2);
59 void SetPixColorError(const MCerPhotPix &pix, const UInt_t i, Float_t min, Float_t max);
60 void SetPixColorPedestal(const MPedestalPix &pix, const UInt_t i, Float_t min, Float_t max);
61 Int_t GetColor(Float_t val, Float_t min, Float_t max);
62
63 void UpdateLegend(Float_t min, Float_t max);
64 void Paint(Option_t *option="");
65
66public:
67 MCamDisplay(MGeomCam *geom);
68 ~MCamDisplay();
69
70 void SetAutoScale(Bool_t input=kTRUE) { fAutoScale = input; }
71 void DrawPhotNum(const MCerPhotEvt *event);
72 void DrawRatio(const MCerPhotEvt *event);
73 void DrawLevels(const MCerPhotEvt *event, Float_t lvl1, Float_t lvl2);
74 void DrawErrorPhot(const MCerPhotEvt *event);
75 void DrawLevels(const MCerPhotEvt *event, const MImgCleanStd &clean);
76 void DrawPedestals(const MPedestalCam *event);
77
78 void DrawPixelNumbers();
79
80 virtual void Reset();
81 virtual void Draw(Option_t *option="");
82 virtual void SavePrimitive(ofstream &out, Option_t *);
83 virtual 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
93
94 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
95
96
97 ClassDef(MCamDisplay, 0) // Displays the magic camera
98};
99
100#endif
Note: See TracBrowser for help on using the repository browser.