1 #ifndef ALIMUONPAINTERMATRIX_H
2 #define ALIMUONPAINTERMATRIX_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMUONPainterMatrix
11 /// \brief A matrix of AliMUONVPainter
13 // Author Laurent Aphecetche, Subatech
21 #ifndef ALIMUONATTPAINTER_H
22 # include "AliMUONAttPainter.h"
25 class AliMUONVPainter;
26 class AliMUONVTrackerData;
30 class AliMUONPainterMatrix : public TObject
33 AliMUONPainterMatrix(const char* basename="", Int_t nx=1, Int_t ny=1);
34 virtual ~AliMUONPainterMatrix();
36 /// Adopt a painter in this matrix
37 void Adopt(AliMUONVPainter* painter);
41 AliMUONPainterMatrix* Clone(const AliMUONAttPainter& attributes) const;
43 void Connect(const char* sourceMethod, const char* destClassName,
44 void* destObject, const char* destMethod);
46 /// Get our attributes
47 const AliMUONAttPainter& Attributes() const { return fAttributes; }
49 /// Compute the data range for this matrix
50 void ComputeDataRange();
52 /// Get the data range for this matrix
53 void GetDataRange(Double_t& dataMin, Double_t& dataMax) const;
56 virtual const char* GetName() const { return Name(); }
59 virtual const char* Name() const;
61 /// Base name (short name)
62 const char* Basename() const { return fBasename.Data(); }
64 const char* Whatname() const { return fWhatname.Data(); }
66 void GetTypes(TObjArray& types) const;
68 /// Number of painters to arrange in x-direction
69 Int_t Nx() const { return fNx; }
71 /// Number of painters to arrange in y-direction
72 Int_t Ny() const { return fNy; }
75 AliMUONVPainter* Painter(Int_t index) const;
78 void Print(Option_t* opt="") const;
80 AliMUONVTrackerData* Data() const;
82 TString DataPattern() const;
84 Int_t DataIndex() const;
86 void SetData(const char* pattern, AliMUONVTrackerData* d, Int_t indexInData);
88 /// Force a given data range for all painter groups belonging to this matrix
89 void SetDataRange(Double_t min, Double_t max);
91 void SetOutlined(const char* pattern, Bool_t value);
93 void SetResponder(const char* pattern);
95 /// Number of painters (should be <= Nx*Ny)
98 /// Normalize attributes
99 AliMUONAttPainter Validate(const AliMUONAttPainter& att) const;
101 static TString NameIt(const char* what, const char* basename, const AliMUONAttPainter& att);
103 void Draw(Option_t* opt="");
105 TCanvas* CreateCanvas(Int_t x=0, Int_t y=0, Int_t w=-1, Int_t h=-1);
109 AliMUONPainterMatrix(const AliMUONPainterMatrix& rhs);
111 AliMUONPainterMatrix& operator=(const AliMUONPainterMatrix& rhs);
113 void UpdateAttributes();
116 TString fBasename; ///< base name of that matrix
117 TString fWhatname; ///< data name
118 Int_t fNx; ///< number of rows
119 Int_t fNy; ///< number of columns
120 TObjArray* fPainters; ///< painters in that matrix
121 AliMUONAttPainter fAttributes; ///< attributes of our painter(s)
123 ClassDef(AliMUONPainterMatrix,2) // Matrix of AliMUONVPainter