]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/MUONChamber.h
fixed typo in ESDListNames
[u/mrichter/AliRoot.git] / EVE / Alieve / MUONChamber.h
1 #ifndef ALIEVE_MUONChamber_H
2 #define ALIEVE_MUONChamber_H
3
4 #include <Reve/RenderElement.h>
5 #include <Reve/QuadSet.h>
6 #include <Reve/PointSet.h>
7
8 #include <TNamed.h>
9 #include <TAtt3D.h>
10 #include <TAttBBox.h>
11
12 namespace Alieve {
13
14 class MUONData;
15 class MUONChamberData;
16 class MUONChamberEditor;
17 class MUONChamberGL;
18
19 class 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
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
48
49   void SetupColor(Int_t val, UChar_t* pix) const;
50
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;
57
58 public:
59
60   MUONChamber(Int_t id, const Text_t* n = "MUONChamber", const Text_t* t = 0);
61   virtual ~MUONChamber();
62
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; }
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; };
74   void  SetThreshold(Short_t t);
75   void  SetMaxVal(Int_t mv);
76   void  SetClusterSize(Int_t size);
77   void  SetHitSize(Int_t size);
78
79   ClassDef(MUONChamber,1);  // Visualisation of the MUON chambers
80
81 };
82
83 inline 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
90 inline 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