AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONVPainter.h
Go to the documentation of this file.
1 #ifndef ALIMUONVPAINTER_H
2 #define ALIMUONVPAINTER_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 
14 // Author Laurent Aphecetche, Subatech
15 
16 #ifndef ALIMUONATTPAINTER_H
17 # include "AliMUONAttPainter.h"
18 #endif
19 #ifndef ROOT_TQObject
20 # include <TQObject.h>
21 #endif
22 #ifndef ROOT_TString
23 # include "TString.h"
24 #endif
25 #ifndef ROOT_TObject
26 # include "TObject.h"
27 #endif
28 #ifndef AL_MP_AREA_H
29 # include "AliMpArea.h"
30 #endif
31 #include <float.h>
32 
33 class AliMUONContour;
36 class AliMpArea;
37 class TCollection;
38 class TH1;
39 class TList;
40 class TMap;
41 class TObjArray;
42 class TVirtualPad;
43 
44 class AliMUONVPainter : public TObject, public TQObject
45 {
46 public:
47 
48  AliMUONVPainter(TRootIOCtor*);
49  AliMUONVPainter(const char* type="");
50  AliMUONVPainter(const AliMUONVPainter& rhs);
52  virtual ~AliMUONVPainter();
53 
55  void Add(AliMUONVPainter* painter);
56 
58  AliMpArea Area() const;
59 
60  virtual void SetAttributes(const AliMUONAttPainter& attributes);
61 
63  virtual AliMUONAttPainter Validate(const AliMUONAttPainter& attributes) const { return attributes; }
64 
66  const AliMUONAttPainter& Attributes() const { return fAttributes; }
67 
68  virtual void ComputeDataRange(const AliMUONVTrackerData& data, Int_t dataIndex,
69  Double_t& dataMin, Double_t& dataMax) const;
70 
71  virtual void Copy(TObject& object) const;
72 
73  AliMUONVPainter* Detach() const;
74 
76  virtual Bool_t CanBeDetached() const { return kTRUE; }
77 
79  virtual Bool_t IsValid() const { return fIsValid; }
80 
82  void Invalidate() { fIsValid = kFALSE; }
83 
84  Int_t Depth() const;
85 
86  virtual Int_t DistancetoPrimitive(Int_t px, Int_t py);
87 
88  virtual void Draw(Option_t* opt="");
89 
90  virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
91 
93  AliMUONContour* Contour() const { return fContour; }
94 
96  virtual const char* GetName() const { return Name().Data(); }
97 
99  virtual TString Name() const { return fName; }
100 
102  virtual TString PathName() const { return fPathName; }
103 
104  virtual TString ContourName() const;
105 
106  virtual char* GetObjectInfo(Int_t px, Int_t py) const;
107 
108  void GetTypes(TObjArray& types) const;
109 
112 
114  virtual TString NameAtPosition(Double_t /*x*/, Double_t /*y*/) const { return GetName(); }
115 
116  AliMUONPainterGroup* Group(const char* type) const;
117 
118  AliMUONPainterGroup* Group(Int_t depth) const;
119 
121  virtual Bool_t HandleMouseMotion() const { return kFALSE; }
122 
123  Bool_t IsResponder() const;
124 
125  Bool_t IsInside(Double_t x, Double_t y) const;
126 
128  AliMUONVPainter* Mother() const { return fMother; }
129 
130  virtual void Paint(Option_t* opt="");
131 
132  virtual void Print(Option_t* opt="") const;
133 
136 
139 
141  void SetContour(AliMUONContour* contour);
142 
143  void SetData(const char* pattern, AliMUONVTrackerData* data, Int_t dataIndex);
144 
145  void SetLine(Int_t depth, Int_t lineColor, Int_t lineWidth);
146 
148  void SetMotherGroup(AliMUONPainterGroup* group) { fGroup = group; }
149 
150  void SetMother(AliMUONVPainter* painter);
151 
152  void SetOutlined(const char* pattern, Bool_t flag);
153 
154  virtual void SetResponder(const char* pattern);
155 
156  virtual void SetResponder(Int_t depth);
157 
158  void SetVisible(const char* pattern, Bool_t flag);
159 
161  const char* Type() const { return fType.Data(); }
162 
163  // SIGNALS
164 
165  void Clicked(AliMUONVPainter* painter, Double_t* pos); // *SIGNAL*
166 
167  void ShiftClicked(AliMUONVPainter* painter, Double_t* pos); // *SIGNAL*
168 
169  void DoubleClicked(AliMUONVPainter* painter, Double_t* pos); // *SIGNAL*
170 
171  static void PixelToPad(Int_t px, Int_t py, Double_t& x, Double_t& y);
172 
173  virtual void PaintOutline(Int_t color=-1, Int_t width=-1, Double_t x=FLT_MAX, Double_t y=FLT_MAX);
174 
175  virtual void PaintArea(Int_t fillColor);
176 
177  virtual void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
178  Double_t min, Double_t max);
179 
181  TVirtualPad* Pad() const { return fPad; }
182 
184  Int_t GetLineColor() const { return fLineColor; }
185 
187  Int_t GetLineWidth() const { return fLineWidth; }
188 
190  void SetLineColor(Int_t lineColor) { fLineColor = lineColor; }
191 
193  void SetLineWidth(Int_t lineWidth) { fLineWidth = lineWidth; }
194 
196  void SetName(const char* name) { fName = name; }
197 
199  void SetPathName(const char* pathName) { fPathName = pathName; }
200 
201  static AliMUONVPainter* CreatePainter(const char* className,
202  const AliMUONAttPainter& att,
203  Int_t id1, Int_t id2);
204 
206  Int_t ID0() const { return fID[0]; }
208  Int_t ID1() const { return fID[1]; }
209 
211  void SetID(Int_t id0, Int_t id1) { fID[0] = id0; fID[1] = id1; }
212 
213  virtual TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
214  Double_t x=FLT_MAX, Double_t y=FLT_MAX);
215 
216  void UpdateGroupsFrom(const AliMUONVPainter& painter);
217 
218  AliMUONVPainter* Master() const;
219 
220  virtual void DrawHistogram(Double_t* values=0x0) const;
221 
223  void DrawHistogram0() const { DrawHistogram(0x0); }
226 
227  virtual void DrawHistogramClone(Double_t* values=0x0) const;
228 
229  virtual void DrawInternalHistogram(Int_t dim) const;
230 
231  virtual void DrawInternalHistogramClone(Int_t dim) const;
232 
234  virtual void FillManuList(TObjArray& manuList) const;
235 
259 
261  virtual Bool_t IsIncluded() const = 0;
262 
264  Bool_t IsExcluded() const { return ! IsIncluded(); }
265 
266  virtual void Include();
267 
268  virtual void Exclude();
269 
270 protected:
271 
272  virtual TCollection* Children() const;
273 
274  void CreateGroups();
275 
277 
278  mutable TH1* fHistogram;
279 
282 
283 private:
284 
285  void FlatList(TList& list);
286 
287  AliMUONPainterGroup* CreateGroup(const char* type, Int_t depth);
288 
289  void GetBoundingBox(Double_t& x1, Double_t& y1,
290  Double_t& x2, Double_t& y2) const;
291 
292  AliMUONVPainter* GetPainter(Int_t px, Int_t py, Double_t& x, Double_t& y) const;
293 
294  void WriteIROC(Double_t value);
295 
296  void GetIROCManuList(TObjArray& manuList);
297 
298  TString fName;
299  TString fPathName;
300  TString fType;
306  Double_t fBorderFactor;
307  TVirtualPad* fPad;
309  Int_t fLineColor;
310  Int_t fLineWidth;
311  Int_t fID[2];
312  Bool_t fIsValid;
313 
314  ClassDef(AliMUONVPainter,3) // Base class of a graphical object for MUON spectrometer
315 };
316 
317 #endif
AliMUONPainterGroup * MotherGroup() const
Return our mother group.
Int_t fID[2]
our ids
AliMUONPainterGroup * ResponderGroup() const
Return the responder group.
void SetID(Int_t id0, Int_t id1)
Set our IDs.
void DrawHistogram0() const
To avoid getting a popup asking for the parameter in the GUI...
static void PixelToPad(Int_t px, Int_t py, Double_t &x, Double_t &y)
void SetOutlined(const char *pattern, Bool_t flag)
AliMUONVPainter * Detach() const
#define TObjArray
AliMUONVTrackerData * InteractiveReadOutConfig() const
void SetLine(Int_t depth, Int_t lineColor, Int_t lineWidth)
virtual void Draw(Option_t *opt="")
void DrawInternalHistogramClone4()
SL.
TString fPathName
our long name
void DrawInternalHistogramClone3()
SL.
AliMUONVPainter * fMother
our mother
virtual Bool_t CanBeDetached() const
Whether this painter can be detached from the current view.
void SetContour(AliMUONContour *contour)
Set out contour.
TH1 * fHistogram
! histogram
virtual TString Name() const
Get our name.
Int_t Depth() const
virtual void ComputeDataRange(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t &dataMin, Double_t &dataMax) const
virtual void SetResponder(const char *pattern)
virtual void DrawInternalHistogramClone(Int_t dim) const
void DrawInternalHistogramClone5()
SL.
virtual Int_t DistancetoPrimitive(Int_t px, Int_t py)
Bool_t IsExcluded() const
Whether or not the part of the detector represented by this painter should be excluded from readout...
virtual void Include()
AliMUONPainterGroup * Group(const char *type) const
virtual void PaintOutline(Int_t color=-1, Int_t width=-1, Double_t x=FLT_MAX, Double_t y=FLT_MAX)
TVirtualPad * fPad
the pad we're drawn in
A rectangle area positioned in plane..
Definition: AliMpArea.h:20
virtual char * GetObjectInfo(Int_t px, Int_t py) const
virtual const char * GetName() const
Get our name.
virtual TString PathName() const
Get our path name (aka fullname)
virtual TString ContourName() const
Bool_t fIsValid
whether we were properly initialized
void ShiftClicked(AliMUONVPainter *painter, Double_t *pos)
void GetTypes(TObjArray &types) const
Int_t GetLineWidth() const
Get our line width.
virtual void DrawHistogramClone(Double_t *values=0x0) const
virtual void Print(Option_t *opt="") const
AliMUONVPainter * Mother() const
Return our mother (0 if we're the top node)
void DrawHistogramClone0() const
To avoid getting a popup asking for the parameter in the GUI...
Int_t ID0() const
Get our first ID.
virtual void PaintArea(Int_t fillColor)
TObjArray * fChildren
our children
Int_t fLineWidth
our outline width
AliMUONVPainter(TRootIOCtor *)
static AliMUONVPainter * CreatePainter(const char *className, const AliMUONAttPainter &att, Int_t id1, Int_t id2)
virtual ~AliMUONVPainter()
AliMUONPainterGroup * fPlotterGroup
the plotter group
virtual void Copy(TObject &object) const
void DrawInternalHistogramClone8()
SL.
const AliMUONAttPainter & Attributes() const
Get our attributes.
void SetName(const char *name)
Set our name.
virtual AliMUONAttPainter Validate(const AliMUONAttPainter &attributes) const
Convert attributes so they are valid ones for us.
Int_t ID1() const
Get our second ID.
Base class for a graphical object representing some part of the MUON tracking system.
TString fName
our (short) name
virtual void Exclude()
virtual Bool_t HandleMouseMotion() const
Whether we handle mouse motion or not.
void SetMother(AliMUONVPainter *painter)
TVirtualPad * Pad() const
Get the pad in which we are plotted.
virtual TString Describe(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t x=FLT_MAX, Double_t y=FLT_MAX)
void Add(AliMUONVPainter *painter)
Add a painter to our list of children. We adopt this painter (i.e. we become owner).
void Invalidate()
Mark us as not valid.
AliMUONContour * Contour() const
Return the contour representing the outline of this object.
void SetPathName(const char *pathName)
Set our path name (aka fullname)
void DrawInternalHistogramClone2()
SL.
Int_t GetLineColor() const
Get our line color.
void SetLineWidth(Int_t lineWidth)
Set our line width.
AliMUONVPainter * Master() const
void FlatList(TList &list)
AliMUONPainterGroup * fGroup
our group
AliMUONVPainter * GetPainter(Int_t px, Int_t py, Double_t &x, Double_t &y) const
void Clicked(AliMUONVPainter *painter, Double_t *pos)
void GetBoundingBox(Double_t &x1, Double_t &y1, Double_t &x2, Double_t &y2) const
AliMpArea Area() const
Return the area containing this painter.
TString fType
our type (DE, Chamber, MANU, etc...)
void SetVisible(const char *pattern, Bool_t flag)
AliMUONPainterGroup * CreateGroup(const char *type, Int_t depth)
virtual Bool_t IsValid() const
Whether we are valid or not.
const char * Type() const
Return our type (e.g. PCB, Chamber, DE, MANU, etc...)
AliMUONContour * fContour
our contour
virtual void DrawInternalHistogram(Int_t dim) const
Bool_t IsResponder() const
TMap * fPainterGroups
map of groups
virtual void FillManuList(TObjArray &manuList) const
Append (i.e. don't have the right to clear the array !) our list of manus to manuList.
2D contour
void DrawInternalHistogramClone6()
SL.
void UpdateGroupsFrom(const AliMUONVPainter &painter)
void SetLineColor(Int_t lineColor)
Set our line color.
AliMUONPainterGroup * fResponderGroup
the responder group
Basic attributes shared by all painters.
virtual Bool_t IsIncluded() const =0
Whether or not the part of the detector represented by this painter should be included in readout...
Int_t fLineColor
our outline color
void WriteIROC(Double_t value)
Bool_t IsInside(Double_t x, Double_t y) const
void SetData(const char *pattern, AliMUONVTrackerData *data, Int_t dataIndex)
void DrawInternalHistogramClone1()
SL.
void DoubleClicked(AliMUONVPainter *painter, Double_t *pos)
A group of AliMUONVPainter.
virtual TString NameAtPosition(Double_t, Double_t) const
Return specific name at a given position, if needed.
AliMUONPainterGroup * PlotterGroup() const
Return the plotter group.
virtual TCollection * Children() const
void GetIROCManuList(TObjArray &manuList)
virtual void SetAttributes(const AliMUONAttPainter &attributes)
Base class for MUON data that can be presented at different levels in the hierarchy of the MUON syste...
void DrawInternalHistogramClone7()
SL.
AliMUONAttPainter fAttributes
our attributes (e.g. view type)
virtual void Paint(Option_t *opt="")
Double_t fBorderFactor
border factor for visu
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
void DrawInternalHistogramClone0()
void DrawInternalHistogramClone9()
SL.
void SetMotherGroup(AliMUONPainterGroup *group)
Set our mother group.
AliMUONVPainter & operator=(const AliMUONVPainter &rhs)
virtual void DrawHistogram(Double_t *values=0x0) const