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