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 TVirtualPad;
|
---|
14 |
|
---|
15 | class MGeomCam;
|
---|
16 | class MHexagon;
|
---|
17 | class MCerPhotEvt;
|
---|
18 | class MCerPhotPix;
|
---|
19 |
|
---|
20 | class MCamDisplay : public TObject
|
---|
21 | {
|
---|
22 | private:
|
---|
23 | MGeomCam *fGeomCam; // pointer to camera geometry
|
---|
24 |
|
---|
25 | Bool_t fAutoScale; // indicating the autoscale function
|
---|
26 |
|
---|
27 | UInt_t fNumPixels; // number of pixels in the present geometry
|
---|
28 | Float_t fRange; // the range in millimeters of the present geometry
|
---|
29 |
|
---|
30 | Float_t fMinPhe; // The minimal number of Phe
|
---|
31 | Float_t fMaxPhe; // The maximum number of Phe
|
---|
32 |
|
---|
33 | Int_t fColors[50];
|
---|
34 |
|
---|
35 | TClonesArray *fPixels; // array of all hexagons
|
---|
36 | TClonesArray *fLegend; // array of all color bars
|
---|
37 | TClonesArray *fLegText; // array of all texts
|
---|
38 |
|
---|
39 | UInt_t fW; // Width of canvas
|
---|
40 | UInt_t fH; // Height of canvas
|
---|
41 | TVirtualPad *fDrawingPad; // pad in which we are drawing
|
---|
42 | Bool_t fIsAllocated;
|
---|
43 |
|
---|
44 | TBox *GetBox(Int_t i) { return (TBox*) fLegend->At(i); }
|
---|
45 | TText *GetText(Int_t i) { return (TText*)fLegText->At(i); }
|
---|
46 |
|
---|
47 | MHexagon &operator[](int i) { return *((MHexagon*)fPixels->At(i)); }
|
---|
48 |
|
---|
49 | void SetPixColor(const MCerPhotPix &pix, const Int_t i);
|
---|
50 | Int_t GetColor(Float_t wert);
|
---|
51 |
|
---|
52 | void UpdateLegend();
|
---|
53 | void Paint(Option_t *option="");
|
---|
54 |
|
---|
55 | public:
|
---|
56 | MCamDisplay(MGeomCam *geom);
|
---|
57 | ~MCamDisplay();
|
---|
58 |
|
---|
59 | void SetAutoScale(Bool_t input=kTRUE) { fAutoScale = input; }
|
---|
60 | void DrawPhotNum(const MCerPhotEvt *event);
|
---|
61 |
|
---|
62 | void DrawPixelNumbers();
|
---|
63 |
|
---|
64 | virtual void Reset();
|
---|
65 | virtual void Draw(Option_t *option="");
|
---|
66 | virtual void SavePrimitive(ofstream &out, Option_t *);
|
---|
67 | virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
|
---|
68 | //virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
|
---|
69 |
|
---|
70 | void SetPalette(Int_t ncolors, Int_t *colors);
|
---|
71 |
|
---|
72 | ClassDef(MCamDisplay, 0) // Displays the magic camera
|
---|
73 | };
|
---|
74 |
|
---|
75 | #endif
|
---|