X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;ds=sidebyside;f=MUON%2FAliMUONVPainter.cxx;h=ad280965e0238ddd7ee65b17ea57d7daa50b43ef;hb=6e97fbb8cd3f6c541db069b487f1fcac52398d32;hp=ab824c6ce2308396dfc474a01237e3deb5ece738;hpb=b89ac3d6105be7362f1376fdc34df2802a5c5e86;p=u%2Fmrichter%2FAliRoot.git diff --git a/MUON/AliMUONVPainter.cxx b/MUON/AliMUONVPainter.cxx index ab824c6ce23..ad280965e02 100644 --- a/MUON/AliMUONVPainter.cxx +++ b/MUON/AliMUONVPainter.cxx @@ -19,6 +19,10 @@ #include "AliCodeTimer.h" #include "AliLog.h" +#include "AliMUON2DMap.h" +#include "AliMUONCalibParamND.h" +#include "AliMUONPainterRegistry.h" +#include "AliMpManuUID.h" #include "AliMUONObjectPair.h" #include "AliMUONPainterContour.h" #include "AliMUONPainterGroup.h" @@ -92,6 +96,30 @@ ClassImp(AliMUONVPainter) ///\endcond +//_____________________________________________________________________________ +AliMUONVPainter::AliMUONVPainter(TRootIOCtor*) : TObject(), +TQObject(), +fHistogram(0x0), +fName(""), +fPathName(""), +fType(""), +fMother(0x0), +fGroup(0x0), +fContour(0x0), +fPainterGroups(0x0), +fChildren(0x0), +fResponderGroup(0x0), +fPlotterGroup(0x0), +fBorderFactor(1.1), +fPad(0x0), +fAttributes(), +fLineColor(1), +fLineWidth(1), +fIsValid(kTRUE) +{ + /// streamer ctor +} + //_____________________________________________________________________________ AliMUONVPainter::AliMUONVPainter(const char* type) : TObject(), @@ -538,7 +566,11 @@ AliMUONVPainter::GetBoundingBox(Double_t& x1, Double_t& y1, Double_t& x2, Double_t& y2) const { /// Get the bounding box = our area - AliMpArea area(Area().Position(),Area().Dimensions()*fBorderFactor); + + AliMpArea area(Area().GetPositionX(), + Area().GetPositionY(), + Area().GetDimensionX()*fBorderFactor, + Area().GetDimensionY()*fBorderFactor); x1 = area.LeftBorder(); y1 = area.DownBorder(); @@ -719,6 +751,12 @@ AliMUONVPainter::Paint(Option_t*) { PaintOutline(); } + + if ( IsExcluded() ) + { + fContour->PaintArea(2); + fContour->PaintOutline(1,1); + } } //_____________________________________________________________________________ @@ -736,6 +774,7 @@ AliMUONVPainter::PaintArea(const AliMUONVTrackerData&, Int_t, Double_t, Double_t { /// Default implementation (must be overriden) AliError(Form("%s : implement me",GetName())); + return; } //_____________________________________________________________________________ @@ -898,33 +937,42 @@ AliMUONVPainter::SetData(const char* pattern, AliMUONVTrackerData* data, { TList* l = p->IsA()->GetMenuList(); -// l->Clear(); l->Delete(); - if ( group ) + TClassMenuItem* n(0x0); + + l->Add(new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(), + "Include","Include",p,"",-1,kTRUE)); + l->Add(new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(), + "Exclude","Exclude",p,"",-1,kTRUE)); + + if ( group ) { - Int_t dim = group->Data()->InternalToExternal(group->DataIndex()); - if ( dim < group->Data()->ExternalDimension() ) - { - if ( data && data->IsHistogrammed(dim) ) - { - // Add histo drawing to the popup menu - TClassMenuItem* n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(), - "Draw histogram","DrawHistogram0",p,"",-1,kTRUE); - l->Add(n); - - n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(), - "Draw histogram clone","DrawHistogramClone0",p,"",-1,kTRUE); - l->Add(n); - } + if ( data && data->IsHistogrammed(0) ) + { + // Add histo drawing to the popup menu + TString name("Draw histogram of "); + + name += data->ExternalDimensionName(0); + + n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(), + name.Data(),"DrawHistogram0",p,"",-1,kTRUE); + l->Add(n); + name += " clone"; + + n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(), + name.Data(),"DrawHistogramClone0",p,"",-1,kTRUE); + l->Add(n); } - for ( Int_t i = 0; i < data->ExternalDimension()*2; ++i ) + Int_t nd = data->IsSingleEvent() ? data->ExternalDimension() : data->ExternalDimension()*2; + + for ( Int_t i = 0; i < nd; ++i ) { - TClassMenuItem* n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(), - Form("Draw %s clone",data->DimensionName(i).Data()), - Form("DrawInternalHistogramClone%d",i),p,"",-1,kTRUE); + n = new TClassMenuItem(TClassMenuItem::kPopupUserFunction,p->IsA(), + Form("Draw %s clone",data->DimensionName(i).Data()), + Form("DrawInternalHistogramClone%d",i),p,"",-1,kTRUE); l->Add(n); } } @@ -1201,6 +1249,86 @@ AliMUONVPainter::UpdateGroupsFrom(const AliMUONVPainter& painter) SetLine(group->Depth(),group->GetLineColor(),group->GetLineWidth()); } + +} + +//_____________________________________________________________________________ +void +AliMUONVPainter::Include() +{ + /// Include this painter + AliInfo(GetName()); + + /// Update the global interactive read out configuration + WriteIROC(1); +} + +//_____________________________________________________________________________ +void +AliMUONVPainter::GetIROCManuList(TObjArray& manuList) +{ + /// Get the list of manus spanned by this painter AND by its dual + + FillManuList(manuList); + + // get our dual + AliMUONAttPainter att(Attributes()); + + att.Invert(); + + att.SetCathodeAndPlaneDisabled(kTRUE); + + AliMUONVPainter* p = AliMUONVPainter::CreatePainter(ClassName(),att,ID0(),ID1()); + + if (p) + { + p->FillManuList(manuList); + } + + delete p; +} + +//_____________________________________________________________________________ +void +AliMUONVPainter::WriteIROC(Double_t value) +{ + /// Update the interactive readout configuration + + TObjArray manuList; + GetIROCManuList(manuList); + + AliMpManuUID* muid; + TIter nextm(&manuList); + AliMUON2DMap store(true); + + while ((muid=static_cast(nextm()))) + { + AliMUONVCalibParam* param = new AliMUONCalibParamND(1,64, + muid->DetElemId(), + muid->ManuId(),value); + store.Add(param); + } + + InteractiveReadOutConfig()->Replace(store); +} + +//_____________________________________________________________________________ +void +AliMUONVPainter::Exclude() +{ + /// Exclude this painter + AliInfo(GetName()); + + /// Update the global interactive read out configuration + WriteIROC(0.0); +} + +//_____________________________________________________________________________ +AliMUONVTrackerData* +AliMUONVPainter::InteractiveReadOutConfig() const +{ + /// get the interactive readout config object + return AliMUONPainterRegistry::Instance()->InteractiveReadOutConfig(); } //_____________________________________________________________________________