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 |
|
---|
11 | class TBox;
|
---|
12 | class TText;
|
---|
13 | class TArrow;
|
---|
14 | class TVirtualPad;
|
---|
15 |
|
---|
16 | class MGeomCam;
|
---|
17 | class MHexagon;
|
---|
18 | class MCerPhotEvt;
|
---|
19 | class MCerPhotPix;
|
---|
20 | class MImgCleanStd;
|
---|
21 | class MPedestalPix;
|
---|
22 | class MPedestalCam;
|
---|
23 |
|
---|
24 | class MCamDisplay : public TObject
|
---|
25 | {
|
---|
26 | private:
|
---|
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 Int_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 Int_t i, Float_t min, Float_t max);
|
---|
60 | void SetPixColorPedestal(const MPedestalPix &pix, const Int_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 |
|
---|
66 | public:
|
---|
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 | ClassDef(MCamDisplay, 0) // Displays the magic camera
|
---|
89 | };
|
---|
90 |
|
---|
91 | #endif
|
---|