Changes in configuration
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveMUONChamber.h
CommitLineData
d810d0de 1// $Id$
fafff680 2// Main authors: Matevz Tadel & Alja Mrak-Tadel & Bogdan Vulpescu: 2006, 2007
d810d0de 3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
51346b82 7 * full copyright notice. *
d810d0de 8 **************************************************************************/
a15e6d7d 9#ifndef AliEveMUONChamber_H
10#define AliEveMUONChamber_H
3626c858 11
84aff7a4 12#include <TEveElement.h>
13#include <TEveQuadSet.h>
14#include <TEvePointSet.h>
3626c858 15
16#include <TNamed.h>
17#include <TAtt3D.h>
18#include <TAttBBox.h>
19
3626c858 20
d810d0de 21class AliEveMUONData;
22class AliEveMUONChamberData;
23class AliEveMUONChamberEditor;
24class AliEveMUONChamberGL;
3626c858 25
d810d0de 26class AliEveMUONChamber : public TEveElement,
fd31e9de 27 public TNamed,
28 public TAtt3D,
29 public TAttBBox
3626c858 30{
d810d0de 31 friend class AliEveMUONChamberGL;
32 friend class AliEveMUONChamberEditor;
3626c858 33
d810d0de 34 AliEveMUONChamber(const AliEveMUONChamber&); // Not implemented
35 AliEveMUONChamber& operator=(const AliEveMUONChamber&); // Not implemented
3626c858 36
fd31e9de 37protected:
3626c858 38 void UpdateQuads();
39
fd31e9de 40 AliEveMUONData *fMUONData; // data for the current event
3626c858 41 Color_t fFrameColor; // main coloring
42 UInt_t fRTS; //! Rendering Time Stamp
43 Int_t fChamberID; // number of the chamber, 0 to 13
84aff7a4 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
3626c858 48 Short_t fThreshold; // digit amplitude threshold
49 Int_t fMaxVal; // digit amplitude maximum value
eadce74d 50 Int_t fClusterSize; // cluster point size
51 Int_t fHitSize; // hit point size
3626c858 52
53 void SetupColor(Int_t val, UChar_t* pix) const;
54
fd31e9de 55 mutable UChar_t *fColorArray; // color-cache
56
eadce74d 57 void ClearColorArray();
58 void SetupColorArray() const;
3626c858 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;
62
63public:
d810d0de 64 AliEveMUONChamber(Int_t id, const Text_t* n = "AliEveMUONChamber", const Text_t* t = 0);
65 virtual ~AliEveMUONChamber();
3626c858 66
eadce74d 67 virtual void ComputeBBox();
68 virtual void Paint(Option_t* option = "");
3626c858 69 virtual UInt_t IncRTS() { return ++fRTS; };
a15e6d7d 70 virtual Bool_t CanEditMainColor() const { return kTRUE; }
3626c858 71
d810d0de 72 void SetDataSource(AliEveMUONData *data);
3626c858 73 void SetChamberID(Int_t id);
74 void SetFrameColor(Color_t col) { fFrameColor = col; IncRTS(); };
d810d0de 75 AliEveMUONData* GetData() const { return fMUONData; };
76 AliEveMUONChamberData* GetChamberData() const;
3626c858 77 Int_t GetID() const { return fChamberID; };
eadce74d 78 void SetThreshold(Short_t t);
79 void SetMaxVal(Int_t mv);
80 void SetClusterSize(Int_t size);
81 void SetHitSize(Int_t size);
3626c858 82
d810d0de 83 ClassDef(AliEveMUONChamber,1); // Visualisation of the MUON chambers
3626c858 84
85};
86
d810d0de 87inline UChar_t* AliEveMUONChamber::ColorFromArray(Int_t val) const
3626c858 88{
89 if(val < fThreshold) val = fThreshold;
90 if(val > fMaxVal) val = fMaxVal;
91 return fColorArray + 4 * (val - fThreshold);
92}
93
d810d0de 94inline void AliEveMUONChamber::ColorFromArray(Int_t val, UChar_t* pix) const
3626c858 95{
96 UChar_t* c = ColorFromArray(val);
97 pix[0] = c[0]; pix[1] = c[1]; pix[2] = c[2]; pix[3] = c[3];
98}
99
3626c858 100#endif