1 #ifndef ALIMUONPAINTERHELPER_H
2 #define ALIMUONPAINTERHELPER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONPainterHelper
11 /// \brief Utility class for the painters display
13 // Author Laurent Aphecetche, Subatech
24 # include "TVector2.h"
27 #ifndef ALI_MP_PLANE_TYPE_H
28 # include "AliMpPlaneType.h"
31 #ifndef ALI_MP_CATHOD_TYPE_H
32 # include "AliMpCathodType.h"
35 #ifndef ALIMUONVPAINTER_H
36 # include "AliMUONVPainter.h"
40 # include "AliMpPad.h"
47 class AliMUONAttPainter;
49 class AliMUONPainterEnv;
50 class AliMUONVCalibParam;
51 class AliMUONVTrackerData;
53 class AliMpMotifPosition;
62 class AliMUONPainterHelper : public TObject
65 AliMUONPainterHelper();
66 virtual ~AliMUONPainterHelper();
68 TString ChamberName(Int_t chamberId) const;
69 TString StationName(Int_t stationId) const;
70 TString DEName(Int_t detElemId) const;
71 TString ManuName(Int_t manuId) const;
72 TString BusPatchName(Int_t busPatchId) const;
73 TString PCBName(Int_t pcbNumber) const;
75 TString ChamberPathName(Int_t chamberId) const;
76 TString StationPathName(Int_t stationId) const;
77 TString DEPathName(Int_t detElemId) const;
78 TString ManuPathName(Int_t detElemId, Int_t manuId) const;
79 TString BusPatchPathName(Int_t busPatchId) const;
80 TString PCBPathName(Int_t detElemId, Int_t pcbNumber) const;
82 Int_t ColorFromValue(Double_t value, Double_t min, Double_t max) const;
84 AliMp::CathodType GetCathodeType(Int_t detElemId, Int_t manuId) const;
86 AliMUONContour* GenerateManuContour(Int_t detElemId, Int_t manuId,
87 AliMUONAttPainter viewType,
88 const char* contourName);
90 AliMUONContour* GetContour(const char* contourName) const;
92 /// Return a contour by name
93 AliMUONContour* GetContour(const TString& contourName) const { return GetContour(contourName.Data()); }
95 AliMpMotifPosition* GetMotifPosition(Int_t detElemId, Int_t manuId) const;
97 AliMpPCB* GetPCB(Int_t detElemId, AliMp::PlaneType planeType,
98 Int_t pcbNumber) const;
100 AliMpPCB* GetPCB(Int_t detElemId, AliMp::CathodType cathodType,
101 Int_t pcbNumber) const;
103 AliMp::PlaneType GetPlaneType(Int_t manuId) const;
105 const AliMpSector* GetSector(Int_t detElemId, AliMp::PlaneType planeType) const;
107 const AliMpSlat* GetSlat(Int_t detElemId, AliMp::PlaneType planeType) const;
109 const AliMpSlat* GetSlat(Int_t detElemId, AliMp::CathodType cathodeType) const;
111 const AliMpSlat* GetSlat(Int_t detElemId, Int_t manuId) const;
113 static AliMUONPainterHelper* Instance();
115 AliMpPad PadByExplodedPosition(Int_t detElemId, Int_t manuId, Double_t x, Double_t y) const;
117 void Exploded2Real(Int_t detElemId, Double_t xe, Double_t ye, Double_t ze,
118 Double_t& xr, Double_t& yr, Double_t& zr) const;
120 void Local2Global(Int_t detElemId, Double_t xl, Double_t yl, Double_t zl,
121 Double_t& xg, Double_t& yg, Double_t& zg) const;
123 void Local2GlobalReal(Int_t detElemId, Double_t xl, Double_t yl, Double_t zl,
124 Double_t& xg, Double_t& yg, Double_t& zg) const;
126 void Global2Local(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
127 Double_t& xl, Double_t& yl, Double_t& zl) const;
129 void Global2LocalReal(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
130 Double_t& xl, Double_t& yl, Double_t& zl) const;
132 AliMUONContour* MergeContours(const TObjArray& contours,
133 const char* contourName);
135 virtual void Print(Option_t* opt="") const;
137 void RegisterContour(AliMUONContour* contour);
139 TString FormatValue(const char* name, Double_t value) const;
141 /// Return the environment
142 AliMUONPainterEnv* Env() { return fEnv; }
147 AliMUONPainterHelper(const AliMUONPainterHelper&);
149 AliMUONPainterHelper& operator=(const AliMUONPainterHelper&);
151 void GenerateDefaultMatrices();
152 void GenerateGeometry();
155 static AliMUONPainterHelper* fgInstance; ///< global instance
157 Double_t fExplodeFactor[2]; ///< explosing factors for representation
158 AliMpExMap* fExplodedGlobalTransformations; ///< global geometric transformations (exploded)
159 AliMpExMap* fRealGlobalTransformations; ///< global geometric transformations (real)
160 TObjArray* fPainterMatrices; ///< default matrices
161 AliMUONPainterEnv* fEnv; ///< resources
162 TMap fAllContours; ///< all contours
164 ClassDef(AliMUONPainterHelper,2) // Helper class for painters