2 // Main authors: Matevz Tadel & Alja Mrak-Tadel & Bogdan Vulpescu: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9 #ifndef AliEveMUONChamber_H
10 #define AliEveMUONChamber_H
12 #include <TEveElement.h>
13 #include <TEveQuadSet.h>
14 #include <TEvePointSet.h>
22 class AliEveMUONChamberData;
23 class AliEveMUONChamberEditor;
24 class AliEveMUONChamberGL;
26 class AliEveMUONChamber : public TEveElement,
31 friend class AliEveMUONChamberGL;
32 friend class AliEveMUONChamberEditor;
35 AliEveMUONChamber(Int_t id, const Text_t* n = "AliEveMUONChamber", const Text_t* t = 0);
36 virtual ~AliEveMUONChamber();
38 virtual void ComputeBBox();
39 virtual void Paint(Option_t* option = "");
40 virtual UInt_t IncRTS() { return ++fRTS; };
41 virtual Bool_t CanEditMainColor() const { return kTRUE; }
43 void SetDataSource(AliEveMUONData *data);
44 void SetChamberID(Int_t id);
45 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); };
46 AliEveMUONData* GetData() const { return fMUONData; };
47 AliEveMUONChamberData* GetChamberData() const;
48 Int_t GetID() const { return fChamberID; };
49 void SetThreshold(Short_t t);
50 void SetMaxVal(Int_t mv);
51 void SetClusterSize(Int_t size);
52 void SetHitSize(Int_t size);
57 AliEveMUONData *fMUONData; // data for the current event
58 Color_t fFrameColor; // main coloring
59 UInt_t fRTS; //! Rendering Time Stamp
60 Int_t fChamberID; // number of the chamber, 0 to 13
61 TEveQuadSet fQuadSet1; // 1st cathode plane digits
62 TEveQuadSet fQuadSet2; // 2nd cathode plane digits
63 TEvePointSet fPointSet1; // reconstructed points (1st cathode)
64 TEvePointSet fPointSet2; // simulation hits
65 Short_t fThreshold; // digit amplitude threshold
66 Int_t fMaxVal; // digit amplitude maximum value
67 Int_t fClusterSize; // cluster point size
68 Int_t fHitSize; // hit point size
70 void SetupColor(Int_t val, UChar_t* pix) const;
72 mutable UChar_t *fColorArray; // color-cache
74 void ClearColorArray();
75 void SetupColorArray() const;
76 UChar_t* ColorFromArray(Int_t val) const;
77 void ColorFromArray(Int_t val, UChar_t* pix) const;
78 Int_t ColorIndex(Int_t val) const;
81 AliEveMUONChamber(const AliEveMUONChamber&); // Not implemented
82 AliEveMUONChamber& operator=(const AliEveMUONChamber&); // Not implemented
84 ClassDef(AliEveMUONChamber, 0); // Visualisation of the MUON chambers
90 inline UChar_t* AliEveMUONChamber::ColorFromArray(Int_t val) const
92 if(val < fThreshold) val = fThreshold;
93 if(val > fMaxVal) val = fMaxVal;
94 return fColorArray + 4 * (val - fThreshold);
97 inline void AliEveMUONChamber::ColorFromArray(Int_t val, UChar_t* pix) const
99 UChar_t* c = ColorFromArray(val);
100 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];