bug fixed
[u/mrichter/AliRoot.git] / MUON / AliMUONPainterHelper.h
CommitLineData
0145e89a 1#ifndef ALIMUONPAINTERHELPER_H
2#define ALIMUONPAINTERHELPER_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5* See cxx source for full Copyright notice */
6
7// $Id$
8
9/// \ingroup graphics
10/// \class AliMUONPainterHelper
11/// \brief Utility class for the painters display
12///
13// Author Laurent Aphecetche, Subatech
14
15#ifndef ROOT_TObject
16# include "TObject.h"
17#endif
18
19#ifndef ROOT_TString
20# include "TString.h"
21#endif
22
23#ifndef ROOT_TVector2
24# include "TVector2.h"
25#endif
26
27#ifndef ALI_MP_PLANE_TYPE_H
28# include "AliMpPlaneType.h"
29#endif
30
31#ifndef ALI_MP_CATHOD_TYPE_H
32# include "AliMpCathodType.h"
33#endif
34
35#ifndef ALIMUONVPAINTER_H
36# include "AliMUONVPainter.h"
37#endif
38
39#ifndef ALI_MP_PAD_H
40# include "AliMpPad.h"
41#endif
42
43class AliMUONAttPainter;
8f0acce4 44class AliMUONContour;
fef32488 45class AliMUONContourHandler;
0145e89a 46class AliMUONPainterEnv;
0145e89a 47class AliMUONVCalibParam;
48class AliMUONVTrackerData;
49class AliMpExMap;
50class AliMpMotifPosition;
51class AliMpPCB;
52class AliMpSector;
53class AliMpSlat;
54class TArrayI;
55class TList;
0145e89a 56class TObjArray;
57
58class AliMUONPainterHelper : public TObject
59{
60public:
61 AliMUONPainterHelper();
62 virtual ~AliMUONPainterHelper();
63
64 TString ChamberName(Int_t chamberId) const;
65 TString StationName(Int_t stationId) const;
66 TString DEName(Int_t detElemId) const;
67 TString ManuName(Int_t manuId) const;
68 TString BusPatchName(Int_t busPatchId) const;
69 TString PCBName(Int_t pcbNumber) const;
70
71 TString ChamberPathName(Int_t chamberId) const;
72 TString StationPathName(Int_t stationId) const;
73 TString DEPathName(Int_t detElemId) const;
74 TString ManuPathName(Int_t detElemId, Int_t manuId) const;
75 TString BusPatchPathName(Int_t busPatchId) const;
76 TString PCBPathName(Int_t detElemId, Int_t pcbNumber) const;
77
78 Int_t ColorFromValue(Double_t value, Double_t min, Double_t max) const;
79
0145e89a 80 AliMp::CathodType GetCathodeType(Int_t detElemId, Int_t manuId) const;
81
fef32488 82 AliMUONContour* GetContour(const char* contourName, Bool_t explodedGeometry=kTRUE) const;
0145e89a 83
9016a84e 84 /// Return a contour by name
8f0acce4 85 AliMUONContour* GetContour(const TString& contourName) const { return GetContour(contourName.Data()); }
0145e89a 86
87 AliMpMotifPosition* GetMotifPosition(Int_t detElemId, Int_t manuId) const;
88
89 AliMpPCB* GetPCB(Int_t detElemId, AliMp::PlaneType planeType,
90 Int_t pcbNumber) const;
91
92 AliMpPCB* GetPCB(Int_t detElemId, AliMp::CathodType cathodType,
93 Int_t pcbNumber) const;
94
95 AliMp::PlaneType GetPlaneType(Int_t manuId) const;
96
97 const AliMpSector* GetSector(Int_t detElemId, AliMp::PlaneType planeType) const;
98
99 const AliMpSlat* GetSlat(Int_t detElemId, AliMp::PlaneType planeType) const;
100
101 const AliMpSlat* GetSlat(Int_t detElemId, AliMp::CathodType cathodeType) const;
102
103 const AliMpSlat* GetSlat(Int_t detElemId, Int_t manuId) const;
104
105 static AliMUONPainterHelper* Instance();
106
0145e89a 107 void Local2Global(Int_t detElemId, Double_t xl, Double_t yl, Double_t zl,
108 Double_t& xg, Double_t& yg, Double_t& zg) const;
109
0145e89a 110 void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
111 Double_t& xl, Double_t& yl, Double_t& zl) const;
112
fef32488 113 AliMUONContour* MergeContours(const TObjArray& contours, const char* contourName, Bool_t explodedGeometry=kTRUE);
0145e89a 114
115 virtual void Print(Option_t* opt="") const;
116
fef32488 117 void RegisterContour(AliMUONContour* contour, Bool_t explodedView=kTRUE);
0145e89a 118
119 TString FormatValue(const char* name, Double_t value) const;
120
9016a84e 121 /// Return the environment
0145e89a 122 AliMUONPainterEnv* Env() { return fEnv; }
123
fef32488 124 TObjArray* GetAllContoursAsArray(Bool_t explodedView=kTRUE) const;
125
0145e89a 126private:
127
128 /// Not implemented
129 AliMUONPainterHelper(const AliMUONPainterHelper&);
130 /// Not implemented
131 AliMUONPainterHelper& operator=(const AliMUONPainterHelper&);
132
e937ba7c 133 AliMUONContourHandler* Exploded() const;
134 AliMUONContourHandler* Real() const;
135
0145e89a 136private:
137 static AliMUONPainterHelper* fgInstance; ///< global instance
138
0145e89a 139 AliMUONPainterEnv* fEnv; ///< resources
fef32488 140 mutable AliMUONContourHandler* fReal; ///< contours in real coordinates
e937ba7c 141 mutable AliMUONContourHandler* fExploded; ///< contours in exploded coordinates
0145e89a 142
fcabdc0c 143 ClassDef(AliMUONPainterHelper,4) // Helper class for painters
0145e89a 144};
145
146#endif