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)
107 fResponderGroup(0x0),
121 //_____________________________________________________________________________
122 AliMUONVPainter::AliMUONVPainter(const AliMUONVPainter& rhs)
133 fResponderGroup(0x0),
147 //_____________________________________________________________________________
149 AliMUONVPainter::operator=(const AliMUONVPainter& rhs)
151 /// assignment operator
159 //_____________________________________________________________________________
160 AliMUONVPainter::~AliMUONVPainter()
167 //_____________________________________________________________________________
169 AliMUONVPainter::Area() const
171 /// Return the area covered by this painter
174 return fContour->Area();
178 AliWarning("Returning an invalid area, as contour is not defined");
183 //_____________________________________________________________________________
185 AliMUONVPainter::Add(AliMUONVPainter* painter)
187 /// Add a child painter
188 if (!fChildren) fChildren = new TObjArray;
189 assert(painter->Mother()==0x0);
190 fChildren->Add(painter);
191 painter->SetMother(this);
194 //_____________________________________________________________________________
196 AliMUONVPainter::Children() const
198 /// Return the list of childrens
202 //_____________________________________________________________________________
204 AliMUONVPainter::Clicked(AliMUONVPainter* painter, Double_t* values)
206 /// Let our mother emit the signal as clients are probably connected to
207 /// our (grand)mother, not to us
211 Mother()->Clicked(painter,values);
215 Long_t param[] = { (Long_t)painter,(Long_t)values };
217 Emit("Clicked(AliMUONVPainter*,Double_t*)",param);
221 //_____________________________________________________________________________
223 AliMUONVPainter::ShiftClicked(AliMUONVPainter* painter, Double_t* values)
225 /// Let our mother emit the signal as clients are probably connected to
226 /// our (grand)mother, not to us
230 Mother()->ShiftClicked(painter,values);
234 Long_t param[] = { (Long_t)painter,(Long_t)values };
236 Emit("ShiftClicked(AliMUONVPainter*,Double_t*)",param);
240 //_____________________________________________________________________________
242 AliMUONVPainter::ComputeDataRange(const AliMUONVTrackerData&, Int_t,
243 Double_t&, Double_t&) const
245 /// Should compute the min and max of a given data source
246 AliError("Not implemented. Please fixe me");
249 //_____________________________________________________________________________
251 AliMUONVPainter::ContourName() const
253 /// Default implementation of the contour name.
255 TString name(PathName());
258 name += fAttributes.Name();
263 //_____________________________________________________________________________
265 AliMUONVPainter::Copy(TObject& object) const
267 /// Copy this to object.
269 TObject::Copy(object);
271 AliMUONVPainter& painter = static_cast<AliMUONVPainter&>(object);
273 painter.fType = fType;
274 painter.fName = fName;
275 painter.fPathName = fPathName;
277 painter.fMother = 0x0;
278 painter.fContour = fContour;
280 painter.fGroup = 0x0;
281 painter.fResponderGroup = 0x0;
282 painter.fPlotterGroup = 0x0;
284 painter.fBorderFactor = fBorderFactor;
286 painter.fAttributes = fAttributes;
288 painter.fAttributes.SetCathodeAndPlaneDisabled(kFALSE);
292 painter.fLineColor = fLineColor;
293 painter.fLineWidth = fLineWidth;
295 painter.fIsValid = fIsValid;
297 delete painter.fChildren;
298 painter.fChildren = 0x0;
300 painter.fID[0] = fID[0];
301 painter.fID[1] = fID[1];
303 delete painter.fHistogram;
304 painter.fHistogram = 0x0;
306 TIter next(fChildren);
309 while ( ( p = static_cast<AliMUONVPainter*>(next()) ) )
311 painter.Add(static_cast<AliMUONVPainter*>(p->Clone()));
314 painter.UpdateGroupsFrom(*this);
316 object.ResetBit(kCanDelete);
319 //_____________________________________________________________________________
321 AliMUONVPainter::CreateGroup(const char* type, Int_t depth)
323 /// Create a painter group at a given depth
325 if (!fPainterGroups) fPainterGroups = new TMap;
326 TObject* o = fPainterGroups->GetValue(type);
329 AliError(Form("Group %s is already there ! Check this",type));
332 AliMUONPainterGroup* group = new AliMUONPainterGroup(type,depth);
333 fPainterGroups->Add(new TObjString(type),group);
337 //_____________________________________________________________________________
339 AliMUONVPainter::CreateGroups()
341 /// Groups our children into groups
345 AliFatal("Not supposed to create groups for a children");
352 AliMUONVPainter* painter;
354 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
356 AliMUONPainterGroup* group = Group(painter->Type());
359 group = CreateGroup(painter->Type(),painter->Depth());
365 //_____________________________________________________________________________
367 AliMUONVPainter::Detach() const
369 /// Make this a new top painter (i.e. a master)
371 AliDebug(1,Form("Detaching %s",GetName()));
373 AliMUONVPainter* p = static_cast<AliMUONVPainter*>(Clone());
375 AliMUONVPainter* master = Master();
379 AliDebug(1,Form("UpdatingGroups of the detached painter %s from its master %s",
380 p->GetName(),master->GetName()));
381 p->UpdateGroupsFrom(*master);
387 //_____________________________________________________________________________
389 AliMUONVPainter::Depth() const
391 /// Return our depth in the hierarchy
395 return Mother()->Depth() + 1;
403 //_____________________________________________________________________________
405 AliMUONVPainter::DistancetoPrimitive(Int_t px, Int_t py)
407 /// See TObject::DistancetoPrimitive
409 static const Int_t kBigValue = 999999;
411 if (!gPad) return kBigValue;
415 AliMUONVPainter* painter = GetPainter(px,py,x,y);
417 x=y=0.0; // to avoid compiler warning
419 if ( painter == this) return 0;
424 //_____________________________________________________________________________
426 AliMUONVPainter::DoubleClicked(AliMUONVPainter*, Double_t*)
428 /// Should emit the DoubleClicked signal (if I knew how to detect those events...)
430 AliWarning("Please implement me !");
434 // // let our top mother emit the signal as clients are probably connected to
435 // // our mother, not to us
436 // Top()->DoubleClicked(painter,values);
440 // Long_t param[] = { (Long_t)painter,(Long_t)values };
442 // Emit("DoubleClicked(AliMUONVPainter*,Double_t*)",param);
446 //_____________________________________________________________________________
448 AliMUONVPainter::Draw(Option_t* opt)
450 /// Append ourselves to the current pad
454 gROOT->MakeDefCanvas();
457 Bool_t kMustSetRange(kFALSE);
462 if (sopt.Contains("R") ) kMustSetRange=kTRUE;
466 Double_t x1,y1,x2,y2;
467 GetBoundingBox(x1,y1,x2,y2);
468 if ( gPad) gPad->Range(x1,y1,x2,y2);
471 if ( !fMother && !fPainterGroups )
476 TIter next(fChildren);
477 AliMUONVPainter* painter;
478 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
488 //_____________________________________________________________________________
490 AliMUONVPainter::ExecuteEvent(Int_t event, Int_t px, Int_t py)
492 /// Handle graphics events
496 AliMUONVPainter* painter = GetPainter(px,py,x,y);
498 if ( painter == this )
500 Double_t values[] = { x,y };
505 ShiftClicked(this,values);
508 Clicked(this,values);
511 //the following statement is required against other loop executions before returning (depending on the time between the clicks)
512 gPad->GetCanvas()->HandleInput((EEventType)-1,0,0);
513 DoubleClicked(this,values);
519 //_____________________________________________________________________________
521 AliMUONVPainter::FlatList(TList& list)
523 /// Make a flat list of our children (and ourselves)
525 TIter next(fChildren);
526 AliMUONVPainter* painter;
527 while ( ( painter = static_cast<AliMUONVPainter*>(next())))
529 painter->FlatList(list);
535 //_____________________________________________________________________________
537 AliMUONVPainter::GetBoundingBox(Double_t& x1, Double_t& y1,
538 Double_t& x2, Double_t& y2) const
540 /// Get the bounding box = our area
541 AliMpArea area(Area().Position(),Area().Dimensions()*fBorderFactor);
543 x1 = area.LeftBorder();
544 y1 = area.DownBorder();
545 x2 = area.RightBorder();
546 y2 = area.UpBorder();
549 //_____________________________________________________________________________
551 AliMUONVPainter::GetObjectInfo(Int_t, Int_t) const
553 /// See TObject::GetObjectInfo
554 return const_cast<char*>(GetName());
557 //_____________________________________________________________________________
559 AliMUONVPainter::GetPainter(Int_t px, Int_t py, Double_t& x, Double_t& y) const
561 /// Get the responder painter at integer position (px,py), and get back its
562 /// absolute position (x,y)
564 PixelToPad(px,py,x,y);
566 if ( !IsInside(x,y) ) return 0x0;
568 if ( fGroup->IsResponder() ) return const_cast<AliMUONVPainter*>(this);
572 TIter next(fChildren);
573 AliMUONVPainter* painter;
575 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
577 AliMUONVPainter* p = painter->GetPainter(px,py,x,y);
585 //_____________________________________________________________________________
587 AliMUONVPainter::GetTypes(TObjArray& types) const
589 /// Get the list of types (as a TObjArray of TObjString)
590 /// of our hierarchy, sorted alphabetically
592 types.SetOwner(kTRUE);
596 tmp.SetOwner(kFALSE);
598 TIter next(fPainterGroups);
601 while ( ( str = static_cast<TObjString*>(next()) ) )
603 AliMUONPainterGroup* group = Group(str->String().Data());
609 Int_t n = tmp.GetLast()+1;
611 Int_t* index = new Int_t[n];
613 Int_t* a = new Int_t[n];
615 for ( Int_t i = 0; i < n; ++i )
617 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(tmp.At(i));
618 a[i] = group->Depth();
621 TMath::Sort(n,a,index,kFALSE);
623 for ( Int_t i = 0; i < n; ++i )
625 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(tmp.At(index[i]));
626 types.AddLast(new TObjString(group->Type()));
633 //_____________________________________________________________________________
635 AliMUONVPainter::Group(const char* type) const
637 /// Returns a group of a given type
638 if (!fPainterGroups) return 0x0;
639 return static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(type));
642 //_____________________________________________________________________________
644 AliMUONVPainter::Group(Int_t depth) const
646 /// Returns a group of a given depth
647 if (!fPainterGroups) return 0x0;
648 TIter next(fPainterGroups);
649 TObjString* groupName;
650 while ( ( groupName = static_cast<TObjString*>(next()) ) )
652 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>
653 (fPainterGroups->GetValue(groupName->String().Data()));
654 if ( group->Depth() == depth )
662 //_____________________________________________________________________________
664 AliMUONVPainter::IsInside(Double_t x, Double_t y) const
666 /// Whether point (x,y) is inside our contour
667 if (!fContour) return kFALSE;
668 return fContour->IsInside(x,y);
671 //_____________________________________________________________________________
673 AliMUONVPainter::IsResponder() const
675 /// Whether we're responding to mouse events
676 return MotherGroup()->IsResponder();
679 //_____________________________________________________________________________
681 AliMUONVPainter::Master() const
683 /// Return the top of the hierarchy
685 /// if we get no mother, we are the master
687 if ( Mother() == 0x0 ) return const_cast<AliMUONVPainter*>(this);
689 AliMUONVPainter* p = Mother();
691 while ( p->Mother() )
699 //_____________________________________________________________________________
701 AliMUONVPainter::Paint(Option_t*)
703 /// Paint ourselves of screen
704 /// If we have some data (i.e. we're belonging to the plotter group)
705 /// we use PaintArea.
706 /// And if must be outlined, then we do that too.
708 if ( !MotherGroup()->IsVisible() ) return;
710 if ( MotherGroup()->IsPlotter() )
712 PaintArea(*(MotherGroup()->Data()),
713 MotherGroup()->DataIndex(),
714 MotherGroup()->DataMin(),
715 MotherGroup()->DataMax());
718 if ( MotherGroup()->IsOutlined() )
724 //_____________________________________________________________________________
726 AliMUONVPainter::Describe(const AliMUONVTrackerData&, Int_t, Double_t, Double_t)
728 /// Default implementation (must be overriden)
729 AliError(Form("%s : implement me",GetName()));
733 //_____________________________________________________________________________
735 AliMUONVPainter::PaintArea(const AliMUONVTrackerData&, Int_t, Double_t, Double_t)
737 /// Default implementation (must be overriden)
738 AliError(Form("%s : implement me",GetName()));
741 //_____________________________________________________________________________
743 AliMUONVPainter::PaintOutline(Int_t color, Int_t width, Double_t /*x*/, Double_t /*y*/)
745 /// Default implementation is simply a drawing of the contour lines,
746 /// not using the optional (x,y)
747 Int_t c = color >= 0 ? color : GetLineColor();
748 Int_t w = width >= 0 ? width : GetLineWidth();
750 fContour->PaintOutline(c,w);
753 //_____________________________________________________________________________
755 AliMUONVPainter::PixelToPad(Int_t px, Int_t py, Double_t& x, Double_t& y)
757 /// convert (px,py) into pad position (x,y)
759 x = gPad->PadtoX(gPad->AbsPixeltoX(px));
760 y = gPad->PadtoY(gPad->AbsPixeltoY(py));
763 //_____________________________________________________________________________
765 AliMUONVPainter::Print(Option_t* opt) const
768 for ( Int_t i = 0; i < Depth()*4; ++i )
773 if ( !IsValid() ) cout << "!!!INVALID!!!" << endl;
775 cout << Form("%p Name %s Depth %d ContourName %s ID=(%d,%d)",
776 this,GetName(),Depth(),ContourName().Data(),ID0(),ID1());
778 if ( fResponderGroup )
780 cout << Form(" Responder group %p %s",fResponderGroup,fResponderGroup->Type());
784 cout << Form(" Plotter group %p %s",fPlotterGroup,fPlotterGroup->Type());
788 cout << Form(" Mother %p %s",Mother(),Mother()->GetName());
792 cout << Form(" Group %p %s ",MotherGroup(),MotherGroup()->Type());
797 cout << Form(" %d children",fChildren->GetLast()+1);
805 if ( fChildren && ( sopt == "FULL" || sopt == "CHILD" ) )
807 TIter next(fChildren);
808 AliMUONVPainter* painter;
809 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
815 if ( fPainterGroups && ( sopt == "FULL" || sopt == "GROUP" ) )
817 TIter next(fPainterGroups);
818 TObjString* groupName;
819 while ( ( groupName = static_cast<TObjString*>(next()) ) )
821 AliMUONPainterGroup* group = Group(groupName->String().Data());
827 //_____________________________________________________________________________
829 AliMUONVPainter::SetAttributes(const AliMUONAttPainter& attributes)
831 /// Set our attributes
832 fAttributes = attributes;
835 //_____________________________________________________________________________
837 AliMUONVPainter::SetContour(AliMUONPainterContour* contour)
842 AliError(Form("Setting a null contour for painter %s : bad idea !",PathName().Data()));
847 //_____________________________________________________________________________
849 AliMUONVPainter::SetData(const char* pattern, AliMUONVTrackerData* data,
852 /// Tell all painters which type matches pattern that they should
853 /// monitor a given data source
855 if ( !fPainterGroups )
860 TIter next(fPainterGroups);
865 while ( ( str = static_cast<TObjString*>(next()) ) )
867 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
869 if ( group->Matches(pattern) )
871 group->SetData(data,dataIndex);
874 fPlotterGroup = group;
879 group->SetData(0x0,-1);
883 // Update context menus
890 AliMUONPainterGroup* group = Master()->PlotterGroup();
892 while ( ( p = static_cast<AliMUONVPainter*>(pnext()) ) )
894 TList* l = p->IsA()->GetMenuList();
900 Int_t dim = group->Data()->InternalToExternal(group->DataIndex());
901 if ( dim < group->Data()->ExternalDimension() )
903 if ( data && data->IsHistogrammed(dim) )
905 // Add histo drawing to the popup menu
906 TClassMenuItem* n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
907 "Draw histogram","DrawHistogram",p,"",-1,kTRUE);
910 n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
911 "Draw histogram clone","DrawHistogramClone",p,"",-1,kTRUE);
921 //_____________________________________________________________________________
923 AliMUONVPainter::DrawHistogram() const
925 /// Draw histogram (and delete the previous one)
930 DrawHistogramClone();
933 //_____________________________________________________________________________
935 AliMUONVPainter::DrawHistogramClone() const
939 fHistogram = AliMUONTrackerDataHistogrammer::CreateHisto(*this);
948 //_____________________________________________________________________________
950 AliMUONVPainter::FillManuList(TObjArray& manuList) const
952 /// Append to manulist
953 /// This is the default implementation, which just calls the FillManuList
954 /// of all our children.
955 /// Some derived class might need to override this in order to exclude
956 /// some children from the fill.
958 TIter next(Children());
962 while ( ( p = static_cast<AliMUONVPainter*>(next()) ) )
964 p->FillManuList(manuList);
968 //_____________________________________________________________________________
970 AliMUONVPainter::SetLine(Int_t depth, Int_t lineColor, Int_t lineWidth)
972 /// Set the line attributes of painters at a given depth
973 AliMUONPainterGroup* group = Group(depth);
976 group->SetLine(lineColor,lineWidth);
980 //_____________________________________________________________________________
982 AliMUONVPainter::SetMother(AliMUONVPainter* painter)
988 //_____________________________________________________________________________
990 AliMUONVPainter::SetOutlined(const char* pattern, Bool_t flag)
992 /// Decide whether or not painters which type matches pattern
993 /// should be outlined
995 AliDebug(1,Form("pattern=%s flag=%d",pattern,flag));
1002 TIter next(fPainterGroups);
1005 while ( ( str = static_cast<TObjString*>(next()) ) )
1007 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
1008 if ( group->Matches(pattern) )
1010 group->SetOutlined(flag);
1015 //_____________________________________________________________________________
1017 AliMUONVPainter::SetResponder(const char* pattern)
1019 /// Set the painters matching pattern to be the responder
1021 AliDebug(1,Form("pattern=%s",pattern));
1023 if (!fPainterGroups)
1028 TIter next(fPainterGroups);
1031 fResponderGroup = 0x0;
1033 while ( ( str = static_cast<TObjString*>(next()) ) )
1035 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
1036 if ( group->Matches(pattern) )
1038 AliDebug(1,Form("group %s is matching pattern %s : setting to responder",
1039 group->Type(),pattern));
1040 group->SetResponder(kTRUE);
1041 fResponderGroup = group;
1045 group->SetResponder(kFALSE);
1050 //_____________________________________________________________________________
1052 AliMUONVPainter::SetResponder(Int_t depth)
1054 /// Select as responder the *first* group that has a given depth
1056 AliDebug(1,Form("depth=%d",depth));
1058 if (!fPainterGroups)
1063 TIter next(fPainterGroups);
1066 fResponderGroup = 0x0;
1068 while ( ( str = static_cast<TObjString*>(next()) ) )
1070 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
1071 if ( group->Depth() == depth )
1073 AliDebug(1,Form("group %s has correct depth = %d, using as responder",
1074 group->Type(),depth));
1075 group->SetResponder(kTRUE);
1076 fResponderGroup = group;
1081 group->SetResponder(kFALSE);
1086 //_____________________________________________________________________________
1088 AliMUONVPainter::SetVisible(const char* pattern, Bool_t flag)
1090 /// Decide whether the painters matching pattern should be visible or not
1091 AliDebug(1,Form("pattern=%s flag=%d",pattern,flag));
1093 if (!fPainterGroups)
1098 TIter next(fPainterGroups);
1101 while ( ( str = static_cast<TObjString*>(next()) ) )
1103 AliMUONPainterGroup* group = static_cast<AliMUONPainterGroup*>(fPainterGroups->GetValue(str));
1104 if ( group->Matches(pattern) )
1106 group->SetVisible(flag);
1111 //_____________________________________________________________________________
1113 AliMUONVPainter::UpdateGroupsFrom(const AliMUONVPainter& painter)
1115 /// (re)Create groups
1116 delete fPainterGroups;
1117 fPainterGroups = 0x0;
1121 // and copy the status of responder, plotter and visible
1122 if ( painter.ResponderGroup() )
1124 SetResponder(painter.ResponderGroup()->Type());
1127 if ( painter.PlotterGroup() )
1129 SetData(painter.PlotterGroup()->Type(),
1130 painter.PlotterGroup()->Data(),
1131 painter.PlotterGroup()->DataIndex());
1132 PlotterGroup()->SetDataRange(painter.PlotterGroup()->DataMin(),
1133 painter.PlotterGroup()->DataMax());
1137 painter.GetTypes(types);
1139 TObjString* groupName;
1141 while ( ( groupName = static_cast<TObjString*>(next()) ) )
1143 AliMUONPainterGroup* group = painter.Group(groupName->String().Data());
1144 if ( group->IsVisible() )
1146 SetVisible(group->Type(),kTRUE);
1150 SetVisible(group->Type(),kFALSE);
1153 if ( group->IsOutlined() )
1155 SetOutlined(group->Type(),kTRUE);
1159 SetOutlined(group->Type(),kFALSE);
1162 SetLine(group->Depth(),group->GetLineColor(),group->GetLineWidth());
1166 //_____________________________________________________________________________
1168 AliMUONVPainter::CreatePainter(const char* className,
1169 const AliMUONAttPainter& att,
1170 Int_t id1, Int_t id2)
1172 /// Create a painter (factory method)
1174 TClass* c = TClass::GetClass(className);
1178 AliErrorClass(Form("Cannot get class %s",className));
1186 call.InitWithPrototype(c,className,"AliMUONAttPainter&,Int_t");
1188 if (call.IsValid()) n = 1;
1191 call.InitWithPrototype(c,className,"AliMUONAttPainter&,Int_t,Int_t");
1193 if ( call.IsValid() ) n = 2;
1196 Long_t returnLong(0x0);
1200 Long_t params[] = { (Long_t)(&att), (Long_t)(id1) };
1201 call.SetParamPtrs((void*)(params));
1202 call.Execute((void*)(0x0),returnLong);
1206 Long_t params[] = { (Long_t)(&att), (Long_t)(id1), (Long_t)(id2) };
1207 call.SetParamPtrs((void*)(params));
1208 call.Execute((void*)(0x0),returnLong);
1213 AliErrorClass(Form("Cannot create a painter of class %s",className));
1216 AliMUONVPainter* rv = reinterpret_cast<AliMUONVPainter*> (returnLong);
1220 AliErrorClass(Form("Painter of class %s is not valid",className));