1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliMUONVPainter.h"
20 #include "AliCodeTimer.h"
22 #include "AliMUONObjectPair.h"
23 #include "AliMUONPainterContour.h"
24 #include "AliMUONPainterGroup.h"
25 #include "AliMUONPainterHelper.h"
26 #include "AliMUONTrackerDataHistogrammer.h"
27 #include "AliMUONVTrackerData.h"
28 #include <Riostream.h>
31 #include <TClassMenuItem.h>
36 #include <TMethodCall.h>
37 #include <TObjArray.h>
38 #include <TObjString.h>
40 #include <TVirtualPad.h>
44 /// \class AliMUONVPainter
46 /// Base class for a graphical object representing some part of the
47 /// MUON tracking system.
49 /// A painter is a graphical representation of some part (e.g. detection element,
50 /// full chamber, one manu, etc...) of the MUON tracking system.
52 /// A painter is a double fold hierarchical structure.
54 /// First, a painter is part of a tree (mother->childrens), that describe
55 /// the natural organization of the spectrometer. For instance, a chamber
56 /// painter has children that are the detection element, the detection elements
57 /// themselves contain manus, which in turn contain channels.
59 /// Second, a painter contains a number of "painter groups" (see AliMUONPainterGroup).
60 /// A group gather all the painters of the same type,
61 /// where the type is a string identifying which part of system we're dealing
62 /// with (chamber, DE, manu, etc...)
64 /// The groups are there to ease the manipulation of similar painters, e.g. if
65 /// we want to hide all detection elements, we hide the "detection element group"
66 /// Some special groups are the responder and the plotter groups. The responder
67 /// group is the group which is currently responding to mouse events.
68 /// The plotter group is the group which is supposed to represent some data.
70 /// There are two ways to represent the painter on screen. In any case, we can
71 /// outline the painter (i.e. draw its borders) (see AliMUONVPainter::PaintOutline).
72 /// In the cases where the painter is attached to some data source (i.e. it is
73 /// used to represent some data about its type, e.g. the mean charge on some manu),
74 /// we can draw the full area of the contour, using some color (see
75 /// AliMUONVPainter::PaintArea).
77 /// Note that you can outline several types of painters (aka groups) at the same
78 /// time, but you cannot plot several groups at the same time.
80 /// Painters are TQObject so they can emit signals.
82 /// Currently emitted signal are :
84 /// void Clicked(AliMUONVPainter* painter, Double_t*);
85 /// DoubleClicked(AliMUONVPainter* painter, Double_t*);
87 /// to know which and where a painter was (double-) clicked.
89 /// \author Laurent Aphecetche, Subatech
92 ClassImp(AliMUONVPainter)
95 //_____________________________________________________________________________
96 AliMUONVPainter::AliMUONVPainter(const char* type)
106 fResponderGroup(0x0),
120 //_____________________________________________________________________________
121 AliMUONVPainter::AliMUONVPainter(const AliMUONVPainter& rhs)
131 fResponderGroup(0x0),
145 //_____________________________________________________________________________
147 AliMUONVPainter::operator=(const AliMUONVPainter& rhs)
149 /// assignment operator
157 //_____________________________________________________________________________
158 AliMUONVPainter::~AliMUONVPainter()
165 //_____________________________________________________________________________
167 AliMUONVPainter::Area() const
169 /// Return the area covered by this painter
172 return fContour->Area();
176 AliWarning("Returning an invalid area, as contour is not defined");
181 //_____________________________________________________________________________
183 AliMUONVPainter::Add(AliMUONVPainter* painter)
185 /// Add a child painter
186 if (!fChildren) fChildren = new TObjArray;
187 assert(painter->Mother()==0x0);
188 fChildren->Add(painter);
189 painter->SetMother(this);
192 //_____________________________________________________________________________
194 AliMUONVPainter::Children() const
196 /// Return the list of childrens
200 //_____________________________________________________________________________
202 AliMUONVPainter::Clicked(AliMUONVPainter* painter, Double_t* values)
204 /// Let our mother emit the signal as clients are probably connected to
205 /// our (grand)mother, not to us
209 Mother()->Clicked(painter,values);
213 Long_t param[] = { (Long_t)painter,(Long_t)values };
215 Emit("Clicked(AliMUONVPainter*,Double_t*)",param);
219 //_____________________________________________________________________________
221 AliMUONVPainter::ShiftClicked(AliMUONVPainter* painter, Double_t* values)
223 /// Let our mother emit the signal as clients are probably connected to
224 /// our (grand)mother, not to us
228 Mother()->ShiftClicked(painter,values);
232 Long_t param[] = { (Long_t)painter,(Long_t)values };
234 Emit("ShiftClicked(AliMUONVPainter*,Double_t*)",param);
238 //_____________________________________________________________________________
240 AliMUONVPainter::ComputeDataRange(const AliMUONVTrackerData&, Int_t,
241 Double_t&, Double_t&) const
243 /// Should compute the min and max of a given data source
244 AliError("Not implemented. Please fixe me");
247 //_____________________________________________________________________________
249 AliMUONVPainter::ContourName() const
251 /// Default implementation of the contour name.
253 TString name(PathName());
256 name += fAttributes.Name();
261 //_____________________________________________________________________________
263 AliMUONVPainter::Copy(TObject& object) const
265 /// Copy this to object.
267 TObject::Copy(object);
269 AliMUONVPainter& painter = static_cast<AliMUONVPainter&>(object);
271 painter.fType = fType;
272 painter.fName = fName;
273 painter.fPathName = fPathName;
275 painter.fMother = 0x0;
276 painter.fContour = fContour;
278 painter.fGroup = 0x0;
279 painter.fResponderGroup = 0x0;
280 painter.fPlotterGroup = 0x0;
282 painter.fBorderFactor = fBorderFactor;
284 painter.fAttributes = fAttributes;
286 painter.fAttributes.SetCathodeAndPlaneDisabled(kFALSE);
290 painter.fLineColor = fLineColor;
291 painter.fLineWidth = fLineWidth;
293 painter.fIsValid = fIsValid;
295 delete painter.fChildren;
296 painter.fChildren = 0x0;
298 painter.fID[0] = fID[0];
299 painter.fID[1] = fID[1];
301 delete painter.fHistogram;
302 painter.fHistogram = 0x0;
304 TIter next(fChildren);
307 while ( ( p = static_cast<AliMUONVPainter*>(next()) ) )
309 painter.Add(static_cast<AliMUONVPainter*>(p->Clone()));
312 painter.UpdateGroupsFrom(*this);
314 object.ResetBit(kCanDelete);
317 //_____________________________________________________________________________
319 AliMUONVPainter::CreateGroup(const char* type, Int_t depth)
321 /// Create a painter group at a given depth
323 if (!fPainterGroups) fPainterGroups = new TMap;
324 TObject* o = fPainterGroups->GetValue(type);
327 AliError(Form("Group %s is already there ! Check this",type));
330 AliMUONPainterGroup* group = new AliMUONPainterGroup(type,depth);
331 fPainterGroups->Add(new TObjString(type),group);
335 //_____________________________________________________________________________
337 AliMUONVPainter::CreateGroups()
339 /// Groups our children into groups
343 AliFatal("Not supposed to create groups for a children");
350 AliMUONVPainter* painter;
352 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
354 AliMUONPainterGroup* group = Group(painter->Type());
357 group = CreateGroup(painter->Type(),painter->Depth());
363 //_____________________________________________________________________________
365 AliMUONVPainter::Detach() const
367 /// Make this a new top painter (i.e. a master)
369 AliDebug(1,Form("Detaching %s",GetName()));
371 AliMUONVPainter* p = static_cast<AliMUONVPainter*>(Clone());
373 AliMUONVPainter* master = Master();
377 AliDebug(1,Form("UpdatingGroups of the detached painter %s from its master %s",
378 p->GetName(),master->GetName()));
379 p->UpdateGroupsFrom(*master);
385 //_____________________________________________________________________________
387 AliMUONVPainter::Depth() const
389 /// Return our depth in the hierarchy
393 return Mother()->Depth() + 1;
401 //_____________________________________________________________________________
403 AliMUONVPainter::DistancetoPrimitive(Int_t px, Int_t py)
405 /// See TObject::DistancetoPrimitive
407 static const Int_t kBigValue = 999999;
409 if (!gPad) return kBigValue;
413 AliMUONVPainter* painter = GetPainter(px,py,x,y);
415 x=y=0.0; // to avoid compiler warning
417 if ( painter == this) return 0;
422 //_____________________________________________________________________________
424 AliMUONVPainter::DoubleClicked(AliMUONVPainter*, Double_t*)
426 /// Should emit the DoubleClicked signal (if I knew how to detect those events...)
428 AliWarning("Please implement me !");
432 // // let our top mother emit the signal as clients are probably connected to
433 // // our mother, not to us
434 // Top()->DoubleClicked(painter,values);
438 // Long_t param[] = { (Long_t)painter,(Long_t)values };
440 // Emit("DoubleClicked(AliMUONVPainter*,Double_t*)",param);
444 //_____________________________________________________________________________
446 AliMUONVPainter::Draw(Option_t* opt)
448 /// Append ourselves to the current pad
452 gROOT->MakeDefCanvas();
455 Bool_t kMustSetRange(kFALSE);
460 if (sopt.Contains("R") ) kMustSetRange=kTRUE;
464 Double_t x1,y1,x2,y2;
465 GetBoundingBox(x1,y1,x2,y2);
466 if ( gPad) gPad->Range(x1,y1,x2,y2);
469 if ( !fMother && !fPainterGroups )
474 TIter next(fChildren);
475 AliMUONVPainter* painter;
476 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
486 //_____________________________________________________________________________
488 AliMUONVPainter::ExecuteEvent(Int_t event, Int_t px, Int_t py)
490 /// Handle graphics events
494 AliMUONVPainter* painter = GetPainter(px,py,x,y);
496 if ( painter == this )
498 Double_t values[] = { x,y };
503 ShiftClicked(this,values);
506 Clicked(this,values);
509 //the following statement is required against other loop executions before returning (depending on the time between the clicks)
510 gPad->GetCanvas()->HandleInput((EEventType)-1,0,0);
511 DoubleClicked(this,values);
517 //_____________________________________________________________________________
519 AliMUONVPainter::FlatList(TList& list)
521 /// Make a flat list of our children (and ourselves)
523 TIter next(fChildren);
524 AliMUONVPainter* painter;
525 while ( ( painter = static_cast<AliMUONVPainter*>(next())))
527 painter->FlatList(list);
533 //_____________________________________________________________________________
535 AliMUONVPainter::GetBoundingBox(Double_t& x1, Double_t& y1,
536 Double_t& x2, Double_t& y2) const
538 /// Get the bounding box = our area
539 AliMpArea area(Area().Position(),Area().Dimensions()*fBorderFactor);
541 x1 = area.LeftBorder();
542 y1 = area.DownBorder();
543 x2 = area.RightBorder();
544 y2 = area.UpBorder();
547 //_____________________________________________________________________________
549 AliMUONVPainter::GetObjectInfo(Int_t, Int_t) const
551 /// See TObject::GetObjectInfo
552 return const_cast<char*>(GetName());
555 //_____________________________________________________________________________
557 AliMUONVPainter::GetPainter(Int_t px, Int_t py, Double_t& x, Double_t& y) const
559 /// Get the responder painter at integer position (px,py), and get back its
560 /// absolute position (x,y)
562 PixelToPad(px,py,x,y);
564 if ( !IsInside(x,y) ) return 0x0;
566 if ( fGroup->IsResponder() ) return const_cast<AliMUONVPainter*>(this);
570 TIter next(fChildren);
571 AliMUONVPainter* painter;
573 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
575 AliMUONVPainter* p = painter->GetPainter(px,py,x,y);
583 //_____________________________________________________________________________
585 AliMUONVPainter::GetTypes(TObjArray& types) const
587 /// Get the list of types (as a TObjArray of TObjString)
588 /// of our hierarchy, sorted alphabetically
590 types.SetOwner(kTRUE);
594 tmp.SetOwner(kFALSE);
596 TIter next(fPainterGroups);
599 while ( ( str = static_cast<TObjString*>(next()) ) )
601 AliMUONPainterGroup* group = Group(str->String().Data());
607 Int_t n = tmp.GetLast()+1;
609 Int_t* index = new Int_t[n];
611 Int_t* a = new Int_t[n];
613 for ( Int_t i = 0; i < n; ++i )
615 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(tmp.At(i));
616 a[i] = group->Depth();
619 TMath::Sort(n,a,index,kFALSE);
621 for ( Int_t i = 0; i < n; ++i )
623 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(tmp.At(index[i]));
624 types.AddLast(new TObjString(group->Type()));
631 //_____________________________________________________________________________
633 AliMUONVPainter::Group(const char* type) const
635 /// Returns a group of a given type
636 if (!fPainterGroups) return 0x0;
637 return static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(type));
640 //_____________________________________________________________________________
642 AliMUONVPainter::Group(Int_t depth) const
644 /// Returns a group of a given depth
645 if (!fPainterGroups) return 0x0;
646 TIter next(fPainterGroups);
647 TObjString* groupName;
648 while ( ( groupName = static_cast<TObjString*>(next()) ) )
650 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>
651 (fPainterGroups->GetValue(groupName->String().Data()));
652 if ( group->Depth() == depth )
660 //_____________________________________________________________________________
662 AliMUONVPainter::IsInside(Double_t x, Double_t y) const
664 /// Whether point (x,y) is inside our contour
665 if (!fContour) return kFALSE;
666 return fContour->IsInside(x,y);
669 //_____________________________________________________________________________
671 AliMUONVPainter::IsResponder() const
673 /// Whether we're responding to mouse events
674 return MotherGroup()->IsResponder();
677 //_____________________________________________________________________________
679 AliMUONVPainter::Master() const
681 /// Return the top of the hierarchy
683 /// if we get no mother, we are the master
685 if ( Mother() == 0x0 ) return const_cast<AliMUONVPainter*>(this);
687 AliMUONVPainter* p = Mother();
689 while ( p->Mother() )
697 //_____________________________________________________________________________
699 AliMUONVPainter::Paint(Option_t*)
701 /// Paint ourselves of screen
702 /// If we have some data (i.e. we're belonging to the plotter group)
703 /// we use PaintArea.
704 /// And if must be outlined, then we do that too.
706 if ( !MotherGroup()->IsVisible() ) return;
708 if ( MotherGroup()->IsPlotter() )
710 PaintArea(*(MotherGroup()->Data()),
711 MotherGroup()->DataIndex(),
712 MotherGroup()->DataMin(),
713 MotherGroup()->DataMax());
716 if ( MotherGroup()->IsOutlined() )
722 //_____________________________________________________________________________
724 AliMUONVPainter::Describe(const AliMUONVTrackerData&, Int_t, Double_t, Double_t)
726 /// Default implementation (must be overriden)
727 AliError(Form("%s : implement me",GetName()));
731 //_____________________________________________________________________________
733 AliMUONVPainter::PaintArea(const AliMUONVTrackerData&, Int_t, Double_t, Double_t)
735 /// Default implementation (must be overriden)
736 AliError(Form("%s : implement me",GetName()));
739 //_____________________________________________________________________________
741 AliMUONVPainter::PaintOutline(Int_t color, Int_t width, Double_t /*x*/, Double_t /*y*/)
743 /// Default implementation is simply a drawing of the contour lines,
744 /// not using the optional (x,y)
745 Int_t c = color >= 0 ? color : GetLineColor();
746 Int_t w = width >= 0 ? width : GetLineWidth();
748 fContour->PaintOutline(c,w);
751 //_____________________________________________________________________________
753 AliMUONVPainter::PixelToPad(Int_t px, Int_t py, Double_t& x, Double_t& y)
755 /// convert (px,py) into pad position (x,y)
757 x = gPad->PadtoX(gPad->AbsPixeltoX(px));
758 y = gPad->PadtoY(gPad->AbsPixeltoY(py));
761 //_____________________________________________________________________________
763 AliMUONVPainter::Print(Option_t* opt) const
766 for ( Int_t i = 0; i < Depth()*4; ++i )
771 if ( !IsValid() ) cout << "!!!INVALID!!!" << endl;
773 cout << Form("%p Name %s Depth %d ContourName %s ID=(%d,%d)",
774 this,GetName(),Depth(),ContourName().Data(),ID0(),ID1());
776 if ( fResponderGroup )
778 cout << Form(" Responder group %p %s",fResponderGroup,fResponderGroup->Type());
782 cout << Form(" Plotter group %p %s",fPlotterGroup,fPlotterGroup->Type());
786 cout << Form(" Mother %p %s",Mother(),Mother()->GetName());
790 cout << Form(" Group %p %s ",MotherGroup(),MotherGroup()->Type());
795 cout << Form(" %d children",fChildren->GetLast()+1);
803 if ( fChildren && ( sopt == "FULL" || sopt == "CHILD" ) )
805 TIter next(fChildren);
806 AliMUONVPainter* painter;
807 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
813 if ( fPainterGroups && ( sopt == "FULL" || sopt == "GROUP" ) )
815 TIter next(fPainterGroups);
816 TObjString* groupName;
817 while ( ( groupName = static_cast<TObjString*>(next()) ) )
819 AliMUONPainterGroup* group = Group(groupName->String().Data());
825 //_____________________________________________________________________________
827 AliMUONVPainter::SetAttributes(const AliMUONAttPainter& attributes)
829 /// Set our attributes
830 fAttributes = attributes;
833 //_____________________________________________________________________________
835 AliMUONVPainter::SetContour(AliMUONPainterContour* contour)
840 AliError(Form("Setting a null contour for painter %s : bad idea !",PathName().Data()));
845 //_____________________________________________________________________________
847 AliMUONVPainter::SetData(const char* pattern, AliMUONVTrackerData* data,
850 /// Tell all painters which type matches pattern that they should
851 /// monitor a given data source
853 if ( !fPainterGroups )
858 TIter next(fPainterGroups);
863 while ( ( str = static_cast<TObjString*>(next()) ) )
865 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
867 if ( group->Matches(pattern) )
869 group->SetData(data,dataIndex);
872 fPlotterGroup = group;
877 group->SetData(0x0,-1);
881 // Update context menus
888 AliMUONPainterGroup* group = Master()->PlotterGroup();
890 while ( ( p = static_cast<AliMUONVPainter*>(pnext()) ) )
892 TList* l = p->IsA()->GetMenuList();
898 Int_t dim = group->Data()->InternalToExternal(group->DataIndex());
899 if ( dim < group->Data()->ExternalDimension() )
901 if ( data && data->IsHistogrammed(dim) )
903 // Add histo drawing to the popup menu
904 TClassMenuItem* n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
905 "Draw histogram","DrawHistogram",p,"",-1,kTRUE);
908 n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
909 "Draw histogram clone","DrawHistogramClone",p,"",-1,kTRUE);
919 //_____________________________________________________________________________
921 AliMUONVPainter::DrawHistogram() const
923 /// Draw histogram (and delete the previous one)
928 DrawHistogramClone();
931 //_____________________________________________________________________________
933 AliMUONVPainter::DrawHistogramClone() const
937 fHistogram = AliMUONTrackerDataHistogrammer::CreateHisto(*this);
946 //_____________________________________________________________________________
948 AliMUONVPainter::FillManuList(TObjArray& manuList) const
950 /// Append to manulist
951 /// This is the default implementation, which just calls the FillManuList
952 /// of all our children.
953 /// Some derived class might need to override this in order to exclude
954 /// some children from the fill.
956 TIter next(Children());
960 while ( ( p = static_cast<AliMUONVPainter*>(next()) ) )
962 p->FillManuList(manuList);
966 //_____________________________________________________________________________
968 AliMUONVPainter::SetLine(Int_t depth, Int_t lineColor, Int_t lineWidth)
970 /// Set the line attributes of painters at a given depth
971 AliMUONPainterGroup* group = Group(depth);
974 group->SetLine(lineColor,lineWidth);
978 //_____________________________________________________________________________
980 AliMUONVPainter::SetMother(AliMUONVPainter* painter)
986 //_____________________________________________________________________________
988 AliMUONVPainter::SetOutlined(const char* pattern, Bool_t flag)
990 /// Decide whether or not painters which type matches pattern
991 /// should be outlined
993 AliDebug(1,Form("pattern=%s flag=%d",pattern,flag));
1000 TIter next(fPainterGroups);
1003 while ( ( str = static_cast<TObjString*>(next()) ) )
1005 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
1006 if ( group->Matches(pattern) )
1008 group->SetOutlined(flag);
1013 //_____________________________________________________________________________
1015 AliMUONVPainter::SetResponder(const char* pattern)
1017 /// Set the painters matching pattern to be the responder
1019 AliDebug(1,Form("pattern=%s",pattern));
1021 if (!fPainterGroups)
1026 TIter next(fPainterGroups);
1029 fResponderGroup = 0x0;
1031 while ( ( str = static_cast<TObjString*>(next()) ) )
1033 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
1034 if ( group->Matches(pattern) )
1036 AliDebug(1,Form("group %s is matching pattern %s : setting to responder",
1037 group->Type(),pattern));
1038 group->SetResponder(kTRUE);
1039 fResponderGroup = group;
1043 group->SetResponder(kFALSE);
1048 //_____________________________________________________________________________
1050 AliMUONVPainter::SetResponder(Int_t depth)
1052 /// Select as responder the *first* group that has a given depth
1054 AliDebug(1,Form("depth=%d",depth));
1056 if (!fPainterGroups)
1061 TIter next(fPainterGroups);
1064 fResponderGroup = 0x0;
1066 while ( ( str = static_cast<TObjString*>(next()) ) )
1068 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
1069 if ( group->Depth() == depth )
1071 AliDebug(1,Form("group %s has correct depth = %d, using as responder",
1072 group->Type(),depth));
1073 group->SetResponder(kTRUE);
1074 fResponderGroup = group;
1079 group->SetResponder(kFALSE);
1084 //_____________________________________________________________________________
1086 AliMUONVPainter::SetVisible(const char* pattern, Bool_t flag)
1088 /// Decide whether the painters matching pattern should be visible or not
1089 AliDebug(1,Form("pattern=%s flag=%d",pattern,flag));
1091 if (!fPainterGroups)
1096 TIter next(fPainterGroups);
1099 while ( ( str = static_cast<TObjString*>(next()) ) )
1101 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
1102 if ( group->Matches(pattern) )
1104 group->SetVisible(flag);
1109 //_____________________________________________________________________________
1111 AliMUONVPainter::UpdateGroupsFrom(const AliMUONVPainter& painter)
1113 /// (re)Create groups
1114 delete fPainterGroups;
1115 fPainterGroups = 0x0;
1119 // and copy the status of responder, plotter and visible
1120 if ( painter.ResponderGroup() )
1122 SetResponder(painter.ResponderGroup()->Type());
1125 if ( painter.PlotterGroup() )
1127 SetData(painter.PlotterGroup()->Type(),
1128 painter.PlotterGroup()->Data(),
1129 painter.PlotterGroup()->DataIndex());
1130 PlotterGroup()->SetDataRange(painter.PlotterGroup()->DataMin(),
1131 painter.PlotterGroup()->DataMax());
1135 painter.GetTypes(types);
1137 TObjString* groupName;
1139 while ( ( groupName = static_cast<TObjString*>(next()) ) )
1141 AliMUONPainterGroup* group = painter.Group(groupName->String().Data());
1142 if ( group->IsVisible() )
1144 SetVisible(group->Type(),kTRUE);
1148 SetVisible(group->Type(),kFALSE);
1151 if ( group->IsOutlined() )
1153 SetOutlined(group->Type(),kTRUE);
1157 SetOutlined(group->Type(),kFALSE);
1160 SetLine(group->Depth(),group->GetLineColor(),group->GetLineWidth());
1164 //_____________________________________________________________________________
1166 AliMUONVPainter::CreatePainter(const char* className,
1167 const AliMUONAttPainter& att,
1168 Int_t id1, Int_t id2)
1170 /// Create a painter (factory method)
1172 TClass* c = TClass::GetClass(className);
1176 AliErrorClass(Form("Cannot get class %s",className));
1184 call.InitWithPrototype(c,className,"AliMUONAttPainter&,Int_t");
1186 if (call.IsValid()) n = 1;
1189 call.InitWithPrototype(c,className,"AliMUONAttPainter&,Int_t,Int_t");
1191 if ( call.IsValid() ) n = 2;
1194 Long_t returnLong(0x0);
1198 Long_t params[] = { (Long_t)(&att), (Long_t)(id1) };
1199 call.SetParamPtrs((void*)(params));
1200 call.Execute((void*)(0x0),returnLong);
1204 Long_t params[] = { (Long_t)(&att), (Long_t)(id1), (Long_t)(id2) };
1205 call.SetParamPtrs((void*)(params));
1206 call.Execute((void*)(0x0),returnLong);
1211 AliErrorClass(Form("Cannot create a painter of class %s",className));
1214 AliMUONVPainter* rv = reinterpret_cast<AliMUONVPainter*> (returnLong);
1218 AliErrorClass(Form("Painter of class %s is not valid",className));