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"
43 class AliMUONAttPainter;
45 class AliMUONContourHandler;
46 class AliMUONPainterEnv;
47 class AliMUONVCalibParam;
48 class AliMUONVTrackerData;
50 class AliMpMotifPosition;
58 class AliMUONPainterHelper : public TObject
61 AliMUONPainterHelper();
62 virtual ~AliMUONPainterHelper();
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;
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;
78 Int_t ColorFromValue(Double_t value, Double_t min, Double_t max) const;
80 AliMp::CathodType GetCathodeType(Int_t detElemId, Int_t manuId) const;
82 AliMUONContour* GetContour(const char* contourName, Bool_t explodedGeometry=kTRUE) const;
84 /// Return a contour by name
85 AliMUONContour* GetContour(const TString& contourName) const { return GetContour(contourName.Data()); }
87 AliMpMotifPosition* GetMotifPosition(Int_t detElemId, Int_t manuId) const;
89 AliMpPCB* GetPCB(Int_t detElemId, AliMp::PlaneType planeType,
90 Int_t pcbNumber) const;
92 AliMpPCB* GetPCB(Int_t detElemId, AliMp::CathodType cathodType,
93 Int_t pcbNumber) const;
95 AliMp::PlaneType GetPlaneType(Int_t manuId) const;
97 const AliMpSector* GetSector(Int_t detElemId, AliMp::PlaneType planeType) const;
99 const AliMpSlat* GetSlat(Int_t detElemId, AliMp::PlaneType planeType) const;
101 const AliMpSlat* GetSlat(Int_t detElemId, AliMp::CathodType cathodeType) const;
103 const AliMpSlat* GetSlat(Int_t detElemId, Int_t manuId) const;
105 static AliMUONPainterHelper* Instance();
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;
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;
113 AliMUONContour* MergeContours(const TObjArray& contours, const char* contourName, Bool_t explodedGeometry=kTRUE);
115 virtual void Print(Option_t* opt="") const;
117 void RegisterContour(AliMUONContour* contour, Bool_t explodedView=kTRUE);
119 TString FormatValue(const char* name, Double_t value) const;
121 /// Return the environment
122 AliMUONPainterEnv* Env() { return fEnv; }
124 TObjArray* GetAllContoursAsArray(Bool_t explodedView=kTRUE) const;
126 void GenerateDefaultMatrices();
131 AliMUONPainterHelper(const AliMUONPainterHelper&);
133 AliMUONPainterHelper& operator=(const AliMUONPainterHelper&);
136 static AliMUONPainterHelper* fgInstance; ///< global instance
138 TObjArray* fPainterMatrices; ///< default matrices
139 AliMUONPainterEnv* fEnv; ///< resources
140 mutable AliMUONContourHandler* fReal; ///< contours in real coordinates
141 AliMUONContourHandler* fExploded; ///< contours in exploded coordinates
143 ClassDef(AliMUONPainterHelper,3) // Helper class for painters