First big commit of the mchview program and its accompanying library,
[u/mrichter/AliRoot.git] / EVE / Alieve / MUONChamber.h
CommitLineData
3626c858 1#ifndef ALIEVE_MUONChamber_H
2#define ALIEVE_MUONChamber_H
3
4#include <Reve/RenderElement.h>
5#include <Reve/QuadSet.h>
eadce74d 6#include <Reve/PointSet.h>
3626c858 7
8#include <TNamed.h>
9#include <TAtt3D.h>
10#include <TAttBBox.h>
11
12namespace Alieve {
13
14class MUONData;
15class MUONChamberData;
16class MUONChamberEditor;
17class MUONChamberGL;
18
19class MUONChamber : public Reve::RenderElement,
20 public TNamed,
21 public TAtt3D,
22 public TAttBBox
23
24{
25
26 friend class MUONChamberGL;
27 friend class MUONChamberEditor;
28
29 MUONChamber(const MUONChamber&); // Not implemented
30 MUONChamber& operator=(const MUONChamber&); // Not implemented
31
32 protected:
33
34 void UpdateQuads();
35
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
eadce74d 42 Reve::PointSet fPointSet1; // reconstructed points (1st cathode)
43 Reve::PointSet fPointSet2; // simulation hits
3626c858 44 Short_t fThreshold; // digit amplitude threshold
45 Int_t fMaxVal; // digit amplitude maximum value
eadce74d 46 Int_t fClusterSize; // cluster point size
47 Int_t fHitSize; // hit point size
3626c858 48
49 void SetupColor(Int_t val, UChar_t* pix) const;
50
51 mutable UChar_t* fColorArray;
eadce74d 52 void ClearColorArray();
53 void SetupColorArray() const;
3626c858 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;
57
58public:
59
eadce74d 60 MUONChamber(Int_t id, const Text_t* n = "MUONChamber", const Text_t* t = 0);
3626c858 61 virtual ~MUONChamber();
62
eadce74d 63 virtual void ComputeBBox();
64 virtual void Paint(Option_t* option = "");
3626c858 65 virtual UInt_t IncRTS() { return ++fRTS; };
66 virtual Bool_t CanEditMainColor() { return kTRUE; }
67
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; };
eadce74d 74 void SetThreshold(Short_t t);
75 void SetMaxVal(Int_t mv);
76 void SetClusterSize(Int_t size);
77 void SetHitSize(Int_t size);
3626c858 78
79 ClassDef(MUONChamber,1); // Visualisation of the MUON chambers
80
81};
82
83inline UChar_t* MUONChamber::ColorFromArray(Int_t val) const
84{
85 if(val < fThreshold) val = fThreshold;
86 if(val > fMaxVal) val = fMaxVal;
87 return fColorArray + 4 * (val - fThreshold);
88}
89
90inline void MUONChamber::ColorFromArray(Int_t val, UChar_t* pix) const
91{
92 UChar_t* c = ColorFromArray(val);
93 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];
94}
95
96}
97
98#endif