1 #ifndef ALIEVE_MUONChamber_H
2 #define ALIEVE_MUONChamber_H
4 #include <Reve/RenderElement.h>
5 #include <Reve/QuadSet.h>
6 #include <Reve/PointSet.h>
15 class MUONChamberData;
16 class MUONChamberEditor;
19 class MUONChamber : public Reve::RenderElement,
26 friend class MUONChamberGL;
27 friend class MUONChamberEditor;
29 MUONChamber(const MUONChamber&); // Not implemented
30 MUONChamber& operator=(const MUONChamber&); // Not implemented
36 MUONData* fMUONData; // data for the current event
37 Color_t fFrameColor; // main coloring
38 UInt_t fRTS; //! Rendering Time Stamp
39 Int_t fChamberID; // number of the chamber, 0 to 13
40 Reve::OldQuadSet fQuadSet1; // 1st cathode plane digits
41 Reve::OldQuadSet fQuadSet2; // 2nd cathode plane digits
42 Reve::PointSet fPointSet1; // reconstructed points (1st cathode)
43 Reve::PointSet fPointSet2; // simulation hits
44 Short_t fThreshold; // digit amplitude threshold
45 Int_t fMaxVal; // digit amplitude maximum value
46 Int_t fClusterSize; // cluster point size
47 Int_t fHitSize; // hit point size
49 void SetupColor(Int_t val, UChar_t* pix) const;
51 mutable UChar_t* fColorArray;
52 void ClearColorArray();
53 void SetupColorArray() const;
54 UChar_t* ColorFromArray(Int_t val) const;
55 void ColorFromArray(Int_t val, UChar_t* pix) const;
56 Int_t ColorIndex(Int_t val) const;
60 MUONChamber(Int_t id, const Text_t* n = "MUONChamber", const Text_t* t = 0);
61 virtual ~MUONChamber();
63 virtual void ComputeBBox();
64 virtual void Paint(Option_t* option = "");
65 virtual UInt_t IncRTS() { return ++fRTS; };
66 virtual Bool_t CanEditMainColor() { return kTRUE; }
68 void SetDataSource(MUONData *data);
69 void SetChamberID(Int_t id);
70 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); };
71 MUONData* GetData() const { return fMUONData; };
72 MUONChamberData* GetChamberData() const;
73 Int_t GetID() const { return fChamberID; };
74 void SetThreshold(Short_t t);
75 void SetMaxVal(Int_t mv);
76 void SetClusterSize(Int_t size);
77 void SetHitSize(Int_t size);
79 ClassDef(MUONChamber,1); // Visualisation of the MUON chambers
83 inline UChar_t* MUONChamber::ColorFromArray(Int_t val) const
85 if(val < fThreshold) val = fThreshold;
86 if(val > fMaxVal) val = fMaxVal;
87 return fColorArray + 4 * (val - fThreshold);
90 inline void MUONChamber::ColorFromArray(Int_t val, UChar_t* pix) const
92 UChar_t* c = ColorFromArray(val);
93 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];