32 #include <Riostream.h> 35 #include <TClassMenuItem.h> 40 #include <TMethodCall.h> 41 #include <TObjArray.h> 42 #include <TObjString.h> 44 #include <TVirtualPad.h> 106 fResponderGroup(0x0),
132 fResponderGroup(0x0),
209 AliWarning(
"Returning an invalid area, as contour is not defined");
220 assert(painter->
Mother()==0x0);
246 Long_t param[] = { (Long_t)painter,(Long_t)values };
248 Emit(
"Clicked(AliMUONVPainter*,Double_t*)",param);
265 Long_t param[] = { (Long_t)painter,(Long_t)values };
267 Emit(
"ShiftClicked(AliMUONVPainter*,Double_t*)",param);
274 Double_t&, Double_t&)
const 277 AliError(
"Not implemented. Please fixe me");
300 TObject::Copy(
object);
340 while ( ( p = static_cast<AliMUONVPainter*>(next()) ) )
342 painter.
Add(static_cast<AliMUONVPainter*>(p->Clone()));
347 object.ResetBit(kCanDelete);
360 AliError(Form(
"Group %s is already there ! Check this",type));
376 AliFatal(
"Not supposed to create groups for a children");
385 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
436 static const Int_t kBigValue = 999999;
438 if (!gPad)
return kBigValue;
446 if ( painter ==
this)
return 0;
481 gROOT->MakeDefCanvas();
484 Bool_t kMustSetRange(kFALSE);
489 if (sopt.Contains(
"R") ) kMustSetRange=kTRUE;
493 Double_t x1,y1,x2,y2;
495 if ( gPad) gPad->Range(x1,y1,x2,y2);
505 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
525 if ( painter ==
this )
527 Double_t values[] = { x,y };
539 gPad->GetCanvas()->HandleInput((EEventType)-1,0,0);
554 while ( ( painter = static_cast<AliMUONVPainter*>(next())))
565 Double_t& x2, Double_t& y2)
const 569 Area().GetPositionY(),
584 return const_cast<char*
>(
GetName());
605 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
622 types.SetOwner(kTRUE);
626 tmp.SetOwner(kFALSE);
631 while ( ( str = static_cast<TObjString*>(next()) ) )
639 Int_t n = tmp.GetLast()+1;
641 Int_t* index =
new Int_t[n];
643 Int_t* a =
new Int_t[n];
645 for ( Int_t i = 0; i < n; ++i )
648 a[i] = group->
Depth();
651 TMath::Sort(n,a,index,kFALSE);
653 for ( Int_t i = 0; i < n; ++i )
656 types.AddLast(
new TObjString(group->
Type()));
679 TObjString* groupName;
680 while ( ( groupName = static_cast<TObjString*>(next()) ) )
684 if ( group->
Depth() == depth )
795 x = gPad->PadtoX(gPad->AbsPixeltoX(px));
796 y = gPad->PadtoY(gPad->AbsPixeltoY(py));
804 for ( Int_t i = 0; i <
Depth()*4; ++i )
809 if ( !
IsValid() ) cout <<
"!!!INVALID!!!" << endl;
811 cout << Form(
"%p Name %s Depth %d ContourName %s ID=(%d,%d)",
833 cout << Form(
" %d children",
fChildren->GetLast()+1);
841 if (
fChildren && ( sopt ==
"FULL" || sopt ==
"CHILD" ) )
845 while ( ( painter = static_cast<AliMUONVPainter*>(next()) ) )
854 TObjString* groupName;
855 while ( ( groupName = static_cast<TObjString*>(next()) ) )
878 AliError(Form(
"Setting a null contour for painter %s : bad idea !",
PathName().Data()));
898 data->Connect(
"Destroyed()",ClassName(),
this,Form(
"SetData(=\"%s\",0x0,-1)",pattern));
906 while ( ( str = static_cast<TObjString*>(next()) ) )
912 group->
SetData(data,dataIndex);
933 while ( ( p = static_cast<AliMUONVPainter*>(pnext()) ) )
935 TList* l = p->IsA()->GetMenuList();
939 TClassMenuItem* n(0x0);
941 l->Add(
new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
942 "Include",
"Include",
p,
"",-1,kTRUE));
943 l->Add(
new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
944 "Exclude",
"Exclude",
p,
"",-1,kTRUE));
951 TString name(
"Draw histogram of ");
955 n =
new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
956 name.Data(),
"DrawHistogram0",
p,
"",-1,kTRUE);
961 n =
new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
962 name.Data(),
"DrawHistogramClone0",
p,
"",-1,kTRUE);
968 for ( Int_t i = 0; i < nd; ++i )
970 n =
new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(),
972 Form(
"DrawInternalHistogramClone%d",i),
p,
"",-1,kTRUE);
1047 while ( ( p = static_cast<AliMUONVPainter*>(next()) ) )
1061 group->
SetLine(lineColor,lineWidth);
1088 while ( ( str = static_cast<TObjString*>(next()) ) )
1091 if ( group->
Matches(pattern) )
1114 while ( ( str = static_cast<TObjString*>(next()) ) )
1117 if ( group->
Matches(pattern) )
1145 while ( ( str = static_cast<TObjString*>(next()) ) )
1148 if ( group->
Depth() == depth )
1175 while ( ( str = static_cast<TObjString*>(next()) ) )
1178 if ( group->
Matches(pattern) )
1213 TObjString* groupName;
1215 while ( ( groupName = static_cast<TObjString*>(next()) ) )
1287 TIter nextm(&manuList);
1290 while ((muid=static_cast<AliMpManuUID*>(nextm())))
1324 Int_t id1, Int_t id2)
1328 TClass* c = TClass::GetClass(className);
1340 call.InitWithPrototype(c,className,
"AliMUONAttPainter&,Int_t");
1342 if (call.IsValid()) n = 1;
1345 call.InitWithPrototype(c,className,
"AliMUONAttPainter&,Int_t,Int_t");
1347 if ( call.IsValid() ) n = 2;
1350 Long_t returnLong(0x0);
1354 Long_t params[] = { (Long_t)(&att), (Long_t)(id1) };
1355 call.SetParamPtrs((
void*)(params),2);
1356 call.Execute((
void*)(0x0),returnLong);
1360 Long_t params[] = { (Long_t)(&att), (Long_t)(id1), (Long_t)(id2) };
1361 call.SetParamPtrs((
void*)(params),3);
1362 call.Execute((
void*)(0x0),returnLong);
1367 AliErrorClass(Form(
"Cannot create a painter of class %s",className));
1374 AliErrorClass(Form(
"Painter of class %s is not valid",className));
AliMUONPainterGroup * MotherGroup() const
Return our mother group.
AliMUONPainterGroup * ResponderGroup() const
Return the responder group.
void SetID(Int_t id0, Int_t id1)
Set our IDs.
static void PixelToPad(Int_t px, Int_t py, Double_t &x, Double_t &y)
Int_t GetLineWidth() const
void SetOutlined(const char *pattern, Bool_t flag)
Bool_t IsResponder() const
Whether we are the responder group.
AliMUONVPainter * Detach() const
Double_t LeftBorder() const
AliMUONVTrackerData * InteractiveReadOutConfig() const
Int_t DataIndex() const
Return the index within the data.
void SetLine(Int_t depth, Int_t lineColor, Int_t lineWidth)
virtual void Draw(Option_t *opt="")
TString fPathName
our long name
AliMUONVPainter * fMother
our mother
Int_t DetElemId() const
Get detection element.
virtual Bool_t Replace(const AliMUONVStore &store)=0
Replace values.
Bool_t Matches(const char *pattern) const
void SetContour(AliMUONContour *contour)
Set out contour.
TH1 * fHistogram
! histogram
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 SetResponder(Bool_t flag=kTRUE)
Set the responder flag.
static TH1 * CreateHisto(const AliMUONVPainter &painter, Int_t externalDim, Int_t internalDim)
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...
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..
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)
void SetOutlined(Bool_t flag=kTRUE)
Set the outlined flag.
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)
virtual TString DimensionName(Int_t dim) const =0
Get the name of a given (internal) dimension.
Int_t ID0() const
Get our first ID.
virtual void PaintArea(Int_t fillColor)
TObjArray * fChildren
our children
Int_t fLineWidth
our outline width
void SetDataRange(Double_t min, Double_t max)
Set the data range.
#define AliWarning(message)
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
AliMUONVTrackerData * Data() const
Return the data we are plotting.
void SetVisible(Bool_t flag=kTRUE)
Set the visible flag.
static AliMUONPainterDataRegistry * Instance()
Container of calibration values for a given number of channels.
#define AliErrorClass(message)
const AliMUONAttPainter & Attributes() const
Get our attributes.
const char * Type() const
Our type.
void SetData(AliMUONVTrackerData *data, Int_t dataIndex)
Int_t Depth() const
Depth.
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
void SetMother(AliMUONVPainter *painter)
virtual TString Describe(const AliMUONVTrackerData &data, Int_t dataIndex, Double_t x=FLT_MAX, Double_t y=FLT_MAX)
virtual Bool_t IsSingleEvent() const =0
Whether we deal with only one event at a time.
void Add(AliMUONVPainter *painter)
Add a painter to our list of children. We adopt this painter (i.e. we become owner).
AliMUONContour * Contour() const
Return the contour representing the outline of this object.
Bool_t Add(AliMUONVPainter *painter)
void SetCathodeAndPlaneDisabled(Bool_t value)
void SetLine(Int_t lineColor, Int_t lineWidth)
Int_t GetLineColor() const
Get our line color.
Bool_t IsVisible() const
Whether we are visible.
virtual const char * GetName() const
Return our name.
Implementation of AliMUONVCalibParam for tuples of double.
Double_t UpBorder() const
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)
virtual Bool_t IsHistogrammed(Int_t) const
Whether we have histograms for a given dimension, or not.
void GetBoundingBox(Double_t &x1, Double_t &y1, Double_t &x2, Double_t &y2) const
Bool_t IsOutlined() const
Whether we should outline ourselves.
AliMpArea Area() const
Return the area containing this painter.
TString fType
our type (DE, Chamber, MANU, etc...)
#define AliFatal(message)
Basic implementation of AliMUONVStore container using AliMpExMap internally.
Int_t GetLineColor() const
Int_t ManuId() const
Get manu identifier.
Double_t DownBorder() const
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 Bool_t Add(TObject *object)
Add an object to the store.
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.
void UpdateGroupsFrom(const AliMUONVPainter &painter)
AliMUONPainterGroup * fResponderGroup
the responder group
virtual TString ExternalDimensionName(Int_t dim) const =0
Get the name of a given (external) dimension.
Basic attributes shared by all painters.
Double_t DataMin() const
Min data we are plotting.
Int_t fLineColor
our outline color
void WriteIROC(Double_t value)
static void Paint(const AliMUONContour &contour, Int_t lineColor=1, Int_t lineStyle=1, Int_t fillColor=-1, Int_t fillStyle=1001)
Bool_t IsInside(Double_t x, Double_t y) const
#define AliError(message)
void SetData(const char *pattern, AliMUONVTrackerData *data, Int_t dataIndex)
void DoubleClicked(AliMUONVPainter *painter, Double_t *pos)
A group of AliMUONVPainter.
AliMUONPainterGroup * PlotterGroup() const
Return the plotter group.
virtual TCollection * Children() const
void GetIROCManuList(TObjArray &manuList)
Bool_t IsInside(Double_t x, Double_t y) const
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...
AliMUONAttPainter fAttributes
our attributes (e.g. view type)
virtual void Paint(Option_t *opt="")
Double_t DataMax() const
Max data we are plotting.
Double_t RightBorder() const
Double_t fBorderFactor
border factor for visu
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual Int_t ExternalDimension() const =0
The number of dimensions we are inputting.
void Print(Option_t *opt="") const
AliMUONVTrackerData * InteractiveReadOutConfig() const
AliMUONVPainter & operator=(const AliMUONVPainter &rhs)
virtual void DrawHistogram(Double_t *values=0x0) const