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;
34 AliEveMUONChamber(const AliEveMUONChamber&); // Not implemented
35 AliEveMUONChamber& operator=(const AliEveMUONChamber&); // Not implemented
40 AliEveMUONData *fMUONData; // data for the current event
41 Color_t fFrameColor; // main coloring
42 UInt_t fRTS; //! Rendering Time Stamp
43 Int_t fChamberID; // number of the chamber, 0 to 13
44 TEveQuadSet fQuadSet1; // 1st cathode plane digits
45 TEveQuadSet fQuadSet2; // 2nd cathode plane digits
46 TEvePointSet fPointSet1; // reconstructed points (1st cathode)
47 TEvePointSet fPointSet2; // simulation hits
48 Short_t fThreshold; // digit amplitude threshold
49 Int_t fMaxVal; // digit amplitude maximum value
50 Int_t fClusterSize; // cluster point size
51 Int_t fHitSize; // hit point size
53 void SetupColor(Int_t val, UChar_t* pix) const;
55 mutable UChar_t *fColorArray; // color-cache
57 void ClearColorArray();
58 void SetupColorArray() const;
59 UChar_t* ColorFromArray(Int_t val) const;
60 void ColorFromArray(Int_t val, UChar_t* pix) const;
61 Int_t ColorIndex(Int_t val) const;
64 AliEveMUONChamber(Int_t id, const Text_t* n = "AliEveMUONChamber", const Text_t* t = 0);
65 virtual ~AliEveMUONChamber();
67 virtual void ComputeBBox();
68 virtual void Paint(Option_t* option = "");
69 virtual UInt_t IncRTS() { return ++fRTS; };
70 virtual Bool_t CanEditMainColor() const { return kTRUE; }
72 void SetDataSource(AliEveMUONData *data);
73 void SetChamberID(Int_t id);
74 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); };
75 AliEveMUONData* GetData() const { return fMUONData; };
76 AliEveMUONChamberData* GetChamberData() const;
77 Int_t GetID() const { return fChamberID; };
78 void SetThreshold(Short_t t);
79 void SetMaxVal(Int_t mv);
80 void SetClusterSize(Int_t size);
81 void SetHitSize(Int_t size);
83 ClassDef(AliEveMUONChamber,1); // Visualisation of the MUON chambers
87 inline UChar_t* AliEveMUONChamber::ColorFromArray(Int_t val) const
89 if(val < fThreshold) val = fThreshold;
90 if(val > fMaxVal) val = fMaxVal;
91 return fColorArray + 4 * (val - fThreshold);
94 inline void AliEveMUONChamber::ColorFromArray(Int_t val, UChar_t* pix) const
96 UChar_t* c = ColorFromArray(val);
97 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];