New classes to get a much improved performance in the computation of
authorlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 Apr 2009 20:04:49 +0000 (20:04 +0000)
committerlaphecet <laphecet@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 6 Apr 2009 20:04:49 +0000 (20:04 +0000)
the contours of the various elements in the tracker (manu, buspatch,
detection element, chamber). With this improved algorithm, we can now
stop to use the padstore.root file (which used to contain pre-computed
contours, as that computation was really long) in mchview.
At the same time we achieve a better separation of the contour computation
and graphical representation. So AliMUONPainterContourMaker and
AliMUONPainterContour classes are removed, and the contour and
contour making are now part of the more general geometry library,
instead of the graphics one.

New classes :
                  AliMUONContour
                  AliMUONContourMaker
                  AliMUONContourMakerTest
                  AliMUONContourPainter
                  AliMUONManuContourMaker
                  AliMUONNode
                  AliMUONPainterDataRegistry
                  AliMUONPointWithRef
                  AliMUONPolygon
                  AliMUONSegment
                  AliMUONSegmentTree
                  mapping/AliMpUID

(Laurent)

33 files changed:
MUON/AliMUONBusPatchPainter.cxx
MUON/AliMUONBusPatchPainter.h
MUON/AliMUONChamberPainter.cxx
MUON/AliMUONChamberPainter.h
MUON/AliMUONDEPainter.cxx
MUON/AliMUONDEPainter.h
MUON/AliMUONManuPadPainter.cxx
MUON/AliMUONManuPadPainter.h
MUON/AliMUONManuPainter.cxx
MUON/AliMUONManuPainter.h
MUON/AliMUONMchViewApplication.cxx
MUON/AliMUONPCBPainter.cxx
MUON/AliMUONPCBPainter.h
MUON/AliMUONPainterDataSourceFrame.cxx
MUON/AliMUONPainterDataSourceItem.cxx
MUON/AliMUONPainterHelper.cxx
MUON/AliMUONPainterHelper.h
MUON/AliMUONPainterHighlighter.cxx
MUON/AliMUONPainterPlotSelector.cxx
MUON/AliMUONPainterRegistry.cxx
MUON/AliMUONPainterRegistry.h
MUON/AliMUONRawStream.h
MUON/AliMUONRawStreamTrackerHP.cxx
MUON/AliMUONTrackerDataCompareDialog.cxx
MUON/AliMUONVPainter.cxx
MUON/AliMUONVPainter.h
MUON/MUONevaluationLinkDef.h
MUON/MUONgraphicsLinkDef.h
MUON/MUONmappingLinkDef.h
MUON/libMUONevaluation.pkg
MUON/libMUONgraphics.pkg
MUON/libMUONmapping.pkg
MUON/mchview.cxx

index fe73616..6142b4f 100644 (file)
@@ -18,7 +18,7 @@
 #include "AliMUONBusPatchPainter.h"
 
 #include "AliMUONManuPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
 #include "AliMUONPainterHelper.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVTrackerData.h"
@@ -88,7 +88,7 @@ fBusPatchId(busPatchId)
   
   Int_t mask = AliMpConstants::ManuMask(AliMp::kNonBendingPlane);
   
-  AliMUONPainterContour* bpContour = h->GetContour(ContourName());
+  AliMUONContour* bpContour = h->GetContour(ContourName());
   
   AliDebug(1,Form("BusPatchId %04d bending %d DE %4d bpContour(%s)=%p nofManus=%d",
                   fBusPatchId,att.IsBendingPlane(),detElemId,ContourName().Data(),bpContour,busPatch->GetNofManus()));
@@ -243,7 +243,7 @@ AliMUONBusPatchPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataInd
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }
 
 //_____________________________________________________________________________
index 643c4f8..a9182da 100644 (file)
@@ -38,6 +38,8 @@ public:
     
   virtual void Copy(TObject& object) const;
   
+  using AliMUONVPainter::PaintArea;
+  
   void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
                  Double_t min, Double_t max);
     
index 32a36aa..0bca465 100644 (file)
@@ -18,7 +18,7 @@
 #include "AliMUONChamberPainter.h"
 
 #include "AliMUONDEPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
 #include "AliMUONPainterHelper.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVTrackerData.h"
@@ -87,7 +87,7 @@ fChamberId(chamberId)
   
   deIt.First(fChamberId);
   
-  AliMUONPainterContour* contour = h->GetContour(ContourName());
+  AliMUONContour* contour = h->GetContour(ContourName());
   TObjArray contourArray;
   
   while (!deIt.IsDone())
@@ -227,7 +227,7 @@ AliMUONChamberPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataInde
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }
 
 //_____________________________________________________________________________
index 6051192..b3ec564 100644 (file)
@@ -41,6 +41,8 @@ public:
 
   virtual void Copy(TObject& object) const;
   
+  using AliMUONVPainter::PaintArea;
+  
   void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
                  Double_t min, Double_t max);
     
index e4898a9..b2e69be 100644 (file)
@@ -20,7 +20,7 @@
 #include "AliMUONBusPatchPainter.h"
 #include "AliMUONGeometryTransformer.h"
 #include "AliMUONPCBPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
 #include "AliMUONPainterHelper.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVTrackerData.h"
@@ -138,7 +138,7 @@ fDetElemId(detElemId)
     AliFatal("Not implemented for trigger !!!");
   }
   
-  AliMUONPainterContour* contour = h->GetContour(ContourName());
+  AliMUONContour* contour = h->GetContour(ContourName());
   
   TObjArray contourArray;
     
@@ -282,7 +282,7 @@ AliMUONDEPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }
 
 //_____________________________________________________________________________
index 444153c..68391a7 100644 (file)
@@ -37,6 +37,8 @@ public:
   /// Return the ID of this detection element
   Int_t DetElemId() const { return fDetElemId; }
   
+  using AliMUONVPainter::PaintArea;
+  
   void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
                  Double_t min, Double_t max);
     
index b0cd356..83abd83 100644 (file)
@@ -20,7 +20,6 @@
 #include "AliLog.h"
 #include "AliMUONPainterGroup.h"
 #include "AliMUONPainterHelper.h"
-#include "AliMUONPainterPadStore.h"
 #include "AliMUONTrackerDataHistogrammer.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVDigit.h"
@@ -28,7 +27,6 @@
 #include "AliMpConnection.h"
 #include "AliMpConstants.h"
 #include "AliMpDDLStore.h"
-#include "AliMpDetElement.h"
 #include "AliMpPad.h"
 #include "AliMpSegmentation.h"
 #include "AliMpVSegmentation.h"
@@ -118,7 +116,7 @@ AliMUONManuPadPainter::ComputeDataRange(const AliMUONVTrackerData& data,
                                         Double_t& dataMin, Double_t& dataMax) const
 {
   /// Compute data range spanned by this manu pads
-  AliMpDetElement* de = AliMpDDLStore::Instance()->GetDetElement(fDetElemId);
+  const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(fDetElemId,fManuId);
   
   dataMin = FLT_MAX;
   dataMax = -FLT_MAX;
@@ -126,7 +124,7 @@ AliMUONManuPadPainter::ComputeDataRange(const AliMUONVTrackerData& data,
   for ( Int_t manuChannel = 0; manuChannel < AliMpConstants::ManuNofChannels(); 
         ++manuChannel )
   {
-    if ( de->IsConnectedChannel(fManuId,manuChannel) )
+    if ( seg->HasPadByLocation(fManuId,manuChannel) )
     {
       Double_t value = data.Channel(fDetElemId, fManuId, manuChannel, dataIndex);
       dataMin = TMath::Min(value,dataMin);
@@ -210,7 +208,8 @@ AliMUONManuPadPainter::DrawHistogramClone(Double_t* values) const
   
   AliMUONTrackerDataHistogrammer tdh(*data,0,-1);
 
-  fHistogram = tdh.CreateChannelHisto(fDetElemId, fManuId, pad.GetManuChannel());
+  fHistogram = tdh.CreateChannelHisto(fDetElemId, fManuId,pad.GetManuChannel());
+
   if (fHistogram) 
   {
     new TCanvas();
@@ -234,22 +233,17 @@ AliMUONManuPadPainter::PaintArea(const AliMUONVTrackerData& data,
   AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
   
   BackupStyle();
-  
-  Int_t cathode = h->GetCathodeType(fDetElemId,fManuId);
-  
+    
   gVirtualX->SetLineColor(-1);
   gVirtualX->SetFillStyle(1);
   
+  const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(fDetElemId,fManuId);
+  
   for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i ) 
   {    
-    Int_t id = AliMUONVDigit::BuildUniqueID(fDetElemId,fManuId,i,cathode);
-    
-    TVector2 position;
-    TVector2 dimensions;
-    
-    h->PadStore().GetPadGeometry(id,position,dimensions);
+    AliMpPad pad = seg->PadByLocation(fManuId,i,kFALSE);
     
-    if ( dimensions.X() > 0 ) 
+    if ( pad.IsValid() )
     {
       Double_t value = data.Channel(fDetElemId,fManuId,i,dataIndex);
       
@@ -263,13 +257,11 @@ AliMUONManuPadPainter::PaintArea(const AliMUONVTrackerData& data,
                         fDetElemId,fManuId,i,value,min,max,
                         color));
       }
-      
+
       gVirtualX->SetFillColor(color);
       
-      TVector2 bl(position-dimensions);
-      TVector2 ur(position+dimensions);
+      PaintPad(pad);
       
-      gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y());
     }
   }
   
@@ -278,22 +270,20 @@ AliMUONManuPadPainter::PaintArea(const AliMUONVTrackerData& data,
                       
 //_____________________________________________________________________________
 void
-AliMUONManuPadPainter::PaintPad(Int_t padId) const
+AliMUONManuPadPainter::PaintPad(const AliMpPad& pad) const
 {
-  /// Paint a single pad
+  Double_t blx = pad.GetPositionX()-pad.GetDimensionX();
+  Double_t bly = pad.GetPositionY()-pad.GetDimensionY();
   
-  TVector2 position;
-  TVector2 dimensions;
-
-  AliMUONPainterHelper::Instance()->PadStore().GetPadGeometry(padId,position,dimensions);
+  Double_t urx = pad.GetPositionX()+pad.GetDimensionX();
+  Double_t ury = pad.GetPositionY()+pad.GetDimensionY();
+  
+  Double_t xe1,ye1,xe2,ye2,z;
 
-  if ( dimensions.X() > 0 ) 
-  {
-    TVector2 bl(position-dimensions);
-    TVector2 ur(position+dimensions);    
+  AliMUONPainterHelper::Instance()->Local2Global(fDetElemId,blx,bly,0,xe1,ye1,z);
+  AliMUONPainterHelper::Instance()->Local2Global(fDetElemId,urx,ury,0,xe2,ye2,z);
   
-    gPad->PaintBox(bl.X(),bl.Y(),ur.X(),ur.Y());
-  }
+  gPad->PaintBox(xe1,ye1,xe2,ye2);
 }
 
 //_____________________________________________________________________________
@@ -306,16 +296,10 @@ AliMUONManuPadPainter::PaintOutline(Int_t color, Int_t, Double_t x, Double_t y)
   
   Int_t lineColor = color >= 0 ? color : GetLineColor();
   
-  AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
-
-  AliDebug(1,Form("color=%d lineColor=%d x=%7.3f y=%7.3f",color,lineColor,x,y));
-  
   if ( lineColor > 0 )
   {
     BackupStyle();
     
-    Int_t cathode = h->GetCathodeType(fDetElemId,fManuId);
-    
     gVirtualX->SetLineColor(lineColor);
     gVirtualX->SetFillStyle(0);
     
@@ -324,17 +308,19 @@ AliMUONManuPadPainter::PaintOutline(Int_t color, Int_t, Double_t x, Double_t y)
       // find pad to be drawn
       AliMpPad pad = PadByPosition(x,y);
       
-      Int_t id = AliMUONVDigit::BuildUniqueID(fDetElemId,fManuId,pad.GetManuChannel(),cathode);
-
-      PaintPad(id);        
+      PaintPad(pad);        
     }
     else
     {
+      const AliMpVSegmentation* seg = AliMpSegmentation::Instance()->GetMpSegmentationByElectronics(fDetElemId,fManuId);
+
       for ( Int_t i = 0; i < AliMpConstants::ManuNofChannels(); ++i ) 
       {    
-        Int_t id = AliMUONVDigit::BuildUniqueID(fDetElemId,fManuId,i,cathode);
+        AliMpPad pad = seg->PadByLocation(fManuId,i,kFALSE);
+        
+        if (pad.IsValid()) PaintPad(pad);
       
-        PaintPad(id);        
+        PaintPad(pad);        
       }
     }
     RestoreStyle();
index 8c9cf99..c041844 100644 (file)
@@ -46,7 +46,9 @@ public:
     virtual TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
                              Double_t x=FLT_MAX, Double_t y=FLT_MAX);
 
-    void PaintArea(const AliMUONVTrackerData& data,
+  using AliMUONVPainter::PaintArea;
+  
+  void PaintArea(const AliMUONVTrackerData& data,
                    Int_t dataIndex,
                    Double_t min,
                    Double_t max);
@@ -64,8 +66,8 @@ private:
     
   void BackupStyle();
   void RestoreStyle();
-  void PaintPad(Int_t padId) const;
   AliMpPad PadByPosition(Double_t x, Double_t y) const;
+  void PaintPad(const AliMpPad& pad) const;
   
 private:
   Int_t fDetElemId; ///< our detection element id
index d797ceb..c98aece 100644 (file)
@@ -1,3 +1,4 @@
+
 /**************************************************************************
 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 *                                                                        *
@@ -18,7 +19,7 @@
 #include "AliMUONManuPainter.h"
 
 #include "AliMUONManuPadPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
 #include "AliMUONPainterHelper.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVDigit.h"
@@ -74,62 +75,42 @@ AliMUONManuPainter::AliMUONManuPainter(const AliMUONAttPainter& att,
 {
     /// ctor
     
-    SetAttributes(att);
-    
-    AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
-    
-    SetID(detElemId,manuId);
-    SetName(h->ManuName(manuId));
-    SetPathName(h->ManuPathName(detElemId,manuId));
-    
-    AliMpMotifPosition* mp = h->GetMotifPosition(detElemId,manuId);
-    
-    if (!mp)
-    {
-      AliFatal(Form("Could not get manuId %04d from DE %04d",manuId,detElemId));
-    }
-    
-    Double_t x,y,z;
-    
-    AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
-    
-    if ( stationType == AliMp::kStation345 ) 
-    {
-      const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(detElemId,manuId);
-      
-      h->Local2Global(fDetElemId,
-                      mp->GetPositionX() -slat->GetPositionX(),
-                      mp->GetPositionY() -slat->GetPositionY(),
-                      0,
-                      x,y,z);
-    }
-    else if ( stationType != AliMp::kStationTrigger ) 
-    {
-      h->Local2Global(fDetElemId,
-                      mp->GetPositionX(),
-                      mp->GetPositionY(),
-                      0,
-                      x,y,z);      
-    }
-    else
-    {
-      AliError("Hu ho. Not supposed to be used for trigger !");
-      Invalidate();
-      return;
-    }
+  SetAttributes(att);
     
-    AliMUONPainterContour* contour = h->GetContour(ContourName());
+  AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
     
-    if (!contour)
-    {
-      contour = h->GenerateManuContour(fDetElemId,
-                                       fManuId,
-                                       Attributes(),
-                                       ContourName());
-    }
-    SetContour(contour);
+  SetID(detElemId,manuId);
+  SetName(h->ManuName(manuId));
+  SetPathName(h->ManuPathName(detElemId,manuId));
+  
+  
+  AliMp::StationType stationType = AliMpDEManager::GetStationType(detElemId);
+  
+  if ( stationType == AliMp::kStationTrigger ) 
+  {
+    AliError("Hu ho. Not supposed to be used for trigger !");
+    Invalidate();
+    return;    
+  }
     
-    Add(new AliMUONManuPadPainter(*this,fDetElemId,fManuId));
+  AliMUONContour* contour = h->GetContour(ContourName());
+  
+  if (!contour)
+  {
+    contour = h->GenerateManuContour(fDetElemId,
+                                     fManuId,
+                                     Attributes(),
+                                     ContourName());
+  }
+
+  if (!contour)
+  {
+    AliFatal(Form("Could not get manuId %04d from DE %04d",manuId,detElemId));
+  }
+  
+  SetContour(contour);
+  
+  Add(new AliMUONManuPadPainter(*this,fDetElemId,fManuId));
 }
 
 //_____________________________________________________________________________
@@ -223,7 +204,7 @@ AliMUONManuPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }
 
 //_____________________________________________________________________________
index 2a48a6f..1aaa25f 100644 (file)
@@ -38,17 +38,19 @@ public:
 
   virtual void Copy(TObject& object) const;
   
-    virtual TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
-                             Double_t x=FLT_MAX, Double_t y=FLT_MAX);
-
-    void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
-                   Double_t min, Double_t max);
+  virtual TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
+                           Double_t x=FLT_MAX, Double_t y=FLT_MAX);
   
-    virtual AliMUONAttPainter Validate(const AliMUONAttPainter& attributes) const;
-
-    virtual void FillManuList(TObjArray& manuList) const;
-    
-    virtual Bool_t IsIncluded() const;
+  using AliMUONVPainter::PaintArea;
+  
+  void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
+                 Double_t min, Double_t max);
+  
+  virtual AliMUONAttPainter Validate(const AliMUONAttPainter& attributes) const;
+  
+  virtual void FillManuList(TObjArray& manuList) const;
+  
+  virtual Bool_t IsIncluded() const;
     
 private:
   Int_t fDetElemId; ///< our detection element id
index 99c6573..3dcac5c 100644 (file)
@@ -20,6 +20,7 @@
 #include "AliCDBManager.h"
 #include "AliCodeTimer.h"
 #include "AliLog.h"
+#include "AliMUONPainterDataRegistry.h"
 #include "AliMUONPainterDataSourceFrame.h"
 #include "AliMUONPainterEnv.h"
 #include "AliMUONPainterHelper.h"
@@ -305,7 +306,7 @@ AliMUONMchViewApplication::ReadDir(TDirectory& dir)
       AliMUONVTrackerDataMaker* maker = dynamic_cast<AliMUONVTrackerDataMaker*>(object);
       if ( maker ) 
       {
-        AliMUONPainterRegistry::Instance()->Register(maker);
+        AliMUONPainterDataRegistry::Instance()->Register(maker);
       }
     }
     
@@ -318,7 +319,7 @@ AliMUONMchViewApplication::ReadDir(TDirectory& dir)
       if ( data ) 
       {
         AliMUONVTrackerDataMaker* maker = new AliMUONTrackerDataWrapper(data);
-        AliMUONPainterRegistry::Instance()->Register(maker);
+        AliMUONPainterDataRegistry::Instance()->Register(maker);
       }
     }
   }
@@ -352,6 +353,12 @@ AliMUONMchViewApplication::ReleaseNotes()
   
   TGTextView* rn = new TGTextView(t);
 
+  rn->AddLine("0.96a");
+  rn->AddLine("");
+  rn->AddLine("Internal reorganization of the contour computations, that lead to improved performance. ");
+  rn->AddLine("Improved enough to be able to remove completely the usage of the padstore.root file with precomputed contours.");
+  rn->AddLine("");
+  
   rn->AddLine("0.96");
   rn->AddLine("");
   rn->AddLine("New features");
@@ -446,7 +453,7 @@ AliMUONMchViewApplication::Save(const char* filename)
 {
   /// Save VTrackerDataMaker objects into file of given name
   
-  AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+  AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
 
   TFile f(filename,"RECREATE");
   
index 147280b..4553643 100644 (file)
@@ -24,7 +24,7 @@
 #include "AliMUONPCBPainter.h"
 
 #include "AliMUONManuPainter.h"
-#include "AliMUONPainterContour.h"
+#include "AliMUONContour.h"
 #include "AliMUONPainterHelper.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVTrackerData.h"
@@ -65,51 +65,52 @@ AliMUONPCBPainter::AliMUONPCBPainter(const AliMUONAttPainter& att,
   fDetElemId(detElemId),
   fPCBIndex(pcbNumber)
 {
-    /// Ctor
-
-    SetAttributes(att);
-    
-    AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
-    
-    AliMp::PlaneType planeType = ( att.IsBendingPlane() ? AliMp::kBendingPlane : AliMp::kNonBendingPlane );
-    
-    const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(fDetElemId,planeType);
-    
-    SetID(detElemId,pcbNumber);
-    SetName(h->PCBName(pcbNumber));
-    SetPathName(h->PCBPathName(detElemId,pcbNumber));
-    
-    AliMpPCB* pcb = slat->GetPCB(fPCBIndex);
-    
-    AliMUONPainterContour* contour = h->GetContour(ContourName());
-    TObjArray contourArray;
-    
-    for ( Int_t imp = 0 ; imp < pcb->GetSize(); ++imp ) 
-    {
-      AliMpMotifPosition* mp = pcb->GetMotifPosition(imp);
-      AliDebug(1,Form("Adding manu %d to PCB %d of DE %d",
-                      mp->GetID(),fPCBIndex,fDetElemId));
-      AliMUONVPainter* painter = new AliMUONManuPainter(Attributes(),fDetElemId,mp->GetID());
-      Add(painter);
-      if (!contour)
-      {
-        contourArray.Add(painter->Contour());
-      }
-    }
-    
-    Double_t x,y,z;
-    h->Local2Global(fDetElemId,
-                    pcb->X()-slat->GetPositionX(),
-                    pcb->Y()-slat->GetPositionY(),
-                    0.0,
-                    x,y,z);
-    
+  /// Ctor
+  
+  SetAttributes(att);
+  
+  AliMUONPainterHelper* h = AliMUONPainterHelper::Instance();
+  
+  AliMp::PlaneType planeType = ( att.IsBendingPlane() ? AliMp::kBendingPlane : AliMp::kNonBendingPlane );
+  
+  const AliMpSlat* slat = AliMUONPainterHelper::Instance()->GetSlat(fDetElemId,planeType);
+  
+  SetID(detElemId,pcbNumber);
+  SetName(h->PCBName(pcbNumber));
+  SetPathName(h->PCBPathName(detElemId,pcbNumber));
+  
+  AliMpPCB* pcb = slat->GetPCB(fPCBIndex);
+  
+  AliMUONContour* contour = h->GetContour(ContourName());
+  TObjArray contourArray;
+  
+  for ( Int_t imp = 0 ; imp < pcb->GetSize(); ++imp ) 
+  {
+    AliMpMotifPosition* mp = pcb->GetMotifPosition(imp);
+    AliDebug(1,Form("Adding manu %d to PCB %d of DE %d",
+                    mp->GetID(),fPCBIndex,fDetElemId));
+    AliMUONVPainter* painter = new AliMUONManuPainter(Attributes(),fDetElemId,mp->GetID());
+    Add(painter);
     if (!contour)
     {
-      contour = h->MergeContours(contourArray,ContourName());
+      contourArray.Add(painter->Contour());
     }
-    
-    SetContour(contour);
+  }
+  
+  Double_t x,y,z;
+  
+  h->Local2Global(fDetElemId,
+                  pcb->X()-slat->GetPositionX(),
+                  pcb->Y()-slat->GetPositionY(),
+                  0.0,
+                  x,y,z);
+  
+  if (!contour)
+  {
+    contour = h->MergeContours(contourArray,ContourName());
+  }
+  
+  SetContour(contour);
 }
 
 //_____________________________________________________________________________
@@ -195,6 +196,6 @@ AliMUONPCBPainter::PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
   
   Int_t color = AliMUONPainterHelper::Instance()->ColorFromValue(value,min,max);
   
-  Contour()->PaintArea(color);
+  PaintArea(color);
 }
 
index cb0fbe4..a15a127 100644 (file)
@@ -40,6 +40,8 @@ public:
   TString Describe(const AliMUONVTrackerData& data, Int_t dataIndex,
                    Double_t, Double_t);
     
+  using AliMUONVPainter::PaintArea;
+  
   void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
                  Double_t min, Double_t max);
   
index 59466b9..245cf21 100644 (file)
@@ -22,7 +22,7 @@
 #include "AliMUONPainterDataSourceItem.h"
 #include "AliMUONPainterEnv.h"
 #include "AliMUONPainterHelper.h"
-#include "AliMUONPainterRegistry.h"
+#include "AliMUONPainterDataRegistry.h"
 #include "AliMUONRecoParam.h"
 #include "AliMUONTrackerACFDataMaker.h"
 #include "AliMUONTrackerDataMaker.h"
@@ -85,7 +85,7 @@ AliMUONPainterDataSourceFrame::AliMUONPainterDataSourceFrame(const TGWindow* p,
 {
   /// Ctor
   
-    AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+    AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
     
     reg->Connect("DataMakerWasRegistered(AliMUONVTrackerDataMaker*)",
                  "AliMUONPainterDataSourceFrame",
@@ -382,7 +382,7 @@ AliMUONPainterDataSourceFrame::CreateACFDataSource(const TString& acfPath, const
   
   if ( reader->IsValid() ) 
   {
-    AliMUONPainterRegistry::Instance()->Register(reader);
+    AliMUONPainterDataRegistry::Instance()->Register(reader);
     
     AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
     
@@ -415,7 +415,7 @@ AliMUONPainterDataSourceFrame::CreateOCDBDataSource(const TString& cdbPath,
   
   if ( reader->IsValid() ) 
   {
-    AliMUONPainterRegistry::Instance()->Register(reader);
+    AliMUONPainterDataRegistry::Instance()->Register(reader);
     
     AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
     
@@ -589,7 +589,7 @@ AliMUONPainterDataSourceFrame::CreateRawDataSource(const TString& uri)
   
   reader->SetSource(filename.Data());
   
-  AliMUONPainterRegistry::Instance()->Register(reader);
+  AliMUONPainterDataRegistry::Instance()->Register(reader);
   
   AliMUONPainterEnv* env = AliMUONPainterHelper::Instance()->Env();
   
index 41610c8..f563df4 100644 (file)
@@ -19,7 +19,7 @@
 
 #include "AliMUONPainterEnv.h"
 #include "AliMUONPainterHelper.h"
-#include "AliMUONPainterRegistry.h"
+#include "AliMUONPainterDataRegistry.h"
 #include "AliMUONVTrackerDataMaker.h"
 #include "AliMUONVTrackerData.h"
 #include "AliLog.h"
@@ -61,7 +61,7 @@ namespace
       ok = reader->NextEvent();
       if ( reader->IsZombie() ) 
       {
-        AliMUONPainterRegistry::Instance()->DeleteZombies();
+        AliMUONPainterDataRegistry::Instance()->DeleteZombies();
         return 0x0;
       }
       if ( !reader->IsRunning() ) gSystem->Sleep(1000);
@@ -197,7 +197,7 @@ AliMUONPainterDataSourceItem::Remove()
   /// Remove
   
   MakeZombie();
-  AliMUONPainterRegistry::Instance()->Unregister(fDataMaker);
+  AliMUONPainterDataRegistry::Instance()->Unregister(fDataMaker);
 }
 
 //_____________________________________________________________________________
index 08dfe4b..73b08df 100644 (file)
 #include <cstdlib>
 #include "AliMUONPainterHelper.h"
 
+#include "AliCodeTimer.h"
+#include "AliLog.h"
+#include "AliMUONContour.h"
+#include "AliMUONContourMaker.h"
 #include "AliMUONGeometryDetElement.h"
 #include "AliMUONGeometryTransformer.h"
-#include "AliMUONPainterContour.h"
-#include "AliMUONPainterContourMaker.h"
+#include "AliMUONManuContourMaker.h"
 #include "AliMUONPainterEnv.h"
 #include "AliMUONPainterMatrix.h"
-#include "AliMUONPainterPadStore.h"
 #include "AliMUONPainterRegistry.h"
 #include "AliMUONVCalibParam.h"
 #include "AliMUONVDigit.h"
@@ -44,8 +46,6 @@
 #include "AliMpSlat.h"
 #include "AliMpStationType.h"
 #include "AliMpVPadIterator.h"
-#include "AliCodeTimer.h"
-#include "AliLog.h"
 #include <Riostream.h>
 #include <TArrayI.h>
 #include <TCanvas.h>
@@ -53,8 +53,8 @@
 #include <TCollection.h>
 #include <TFile.h>
 #include <TGLabel.h>
-#include <TGeoMatrix.h>
 #include <TGMsgBox.h>
+#include <TGeoMatrix.h>
 #include <TLine.h>
 #include <TList.h>
 #include <TMap.h>
@@ -67,6 +67,8 @@
 #include <TVirtualPad.h>
 #include <TVirtualX.h>
 
+#include "AliMUONChamberPainter.h"
+
 ///\class AliMUONPainterHelper
 ///
 /// Helper class for painters
@@ -81,16 +83,17 @@ AliMUONPainterHelper* AliMUONPainterHelper::fgInstance(0x0);
 
 //_____________________________________________________________________________
 AliMUONPainterHelper::AliMUONPainterHelper() : 
-  TObject(),
-  fPadStore(0x0),
-  fExplodedGlobalTransformations(0x0),
-  fRealGlobalTransformations(0x0),
-  fIsModified(kFALSE),
-  fContourMaker(0x0),
-  fPainterMatrices(0x0),
-  fEnv(0x0)
+TObject(),
+fExplodedGlobalTransformations(0x0),
+fRealGlobalTransformations(0x0),
+fPainterMatrices(0x0),
+fEnv(0x0),
+fAllContours(20000,1)
 {
     /// ctor
+  
+  fAllContours.SetOwnerKeyValue(kTRUE,kTRUE);
+  
     fExplodeFactor[0] = 1.00;
     fExplodeFactor[1] = 1.50;
 
@@ -110,37 +113,19 @@ AliMUONPainterHelper::AliMUONPainterHelper() :
 AliMUONPainterHelper::~AliMUONPainterHelper()
 {
   /// dtor
-  if ( fIsModified ) Save();
   delete fExplodedGlobalTransformations;
   delete fRealGlobalTransformations;
-  delete fPadStore;
-  delete fContourMaker;
   delete fPainterMatrices;
+  fEnv->Save();
   fgInstance = 0;
 }
 
 //_____________________________________________________________________________
-AliMUONPainterContour*
+AliMUONContour*
 AliMUONPainterHelper::GetContour(const char* contourName) const
 {
-  /// Get a contour by name
-  
-  AliCodeTimerAuto("")
-  
-  if ( fContourMaker ) 
-  {
-    return fContourMaker->GetContour(contourName);
-  }
-  return 0x0;
-}
-
-//_____________________________________________________________________________
-Int_t 
-AliMUONPainterHelper::FindPadID(const TArrayI& pads, Double_t x, Double_t y) const
-{
-  /// Find a pad by position
-  
-  return fPadStore->FindPadID(pads,x,y);
+  /// Get a contour by name  
+  return static_cast<AliMUONContour*>(fAllContours.GetValue(contourName));
 }
 
 //_____________________________________________________________________________
@@ -149,6 +134,8 @@ AliMUONPainterHelper::GenerateDefaultMatrices()
 {
   /// Kind of bootstrap method to trigger the generation of all contours
   
+  AliCodeTimerAuto("");
+  
   fPainterMatrices = new TObjArray;
   fPainterMatrices->SetOwner(kFALSE);
   
@@ -159,17 +146,19 @@ AliMUONPainterHelper::GenerateDefaultMatrices()
   att.SetViewPoint(kTRUE,kFALSE);
   att.SetPlane(kFALSE,kFALSE);
   att.SetCathode(kTRUE,kFALSE);
-  
-  AliWarningClass("Should generate back views as well here");
-  
-  attributes.Add(new AliMUONAttPainter(att));  
-  att.SetCathode(kFALSE,kTRUE);
-  attributes.Add(new AliMUONAttPainter(att));
+
   att.SetCathode(kFALSE,kFALSE);
   att.SetPlane(kTRUE,kFALSE);
   attributes.Add(new AliMUONAttPainter(att));
-  att.SetPlane(kFALSE,kTRUE);
-  attributes.Add(new AliMUONAttPainter(att));
+
+// commented the lines below, as it's now fast enough to be created on the fly,
+// only when requested by the user
+//
+//  attributes.Add(new AliMUONAttPainter(att));  
+//  att.SetCathode(kFALSE,kTRUE);
+//  attributes.Add(new AliMUONAttPainter(att));
+//  att.SetPlane(kFALSE,kTRUE);
+//  attributes.Add(new AliMUONAttPainter(att));
   
   TIter next(&attributes);
   AliMUONAttPainter* a;
@@ -180,7 +169,7 @@ AliMUONPainterHelper::GenerateDefaultMatrices()
     
     for ( Int_t i = 0; i < 10; ++i )
     {
-      AliMUONVPainter* painter = AliMUONVPainter::CreatePainter("AliMUONChamberPainter",*a,i,-1);
+      AliMUONVPainter* painter = new AliMUONChamberPainter(*a,i);
       
       painter->SetResponder("Chamber");
       
@@ -209,11 +198,10 @@ AliMUONPainterHelper::GenerateGeometry()
   /// having overlapping detection elements as in the reality, which 
   /// would be inconvenient for a display ;-)
   
-  AliDebug(1,Form(" with explodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]));
+  AliCodeTimerAuto("");
   
   AliMUONGeometryTransformer transformer;
   transformer.LoadGeometryData("transform.dat");
-//  transformer.LoadGeometryData("geometry.root"); //FIXME: add a protection if geometry.root file does not exist
   fExplodedGlobalTransformations = new AliMpExMap;
   fRealGlobalTransformations = new AliMpExMap;
   AliMpDEIterator deIt;
@@ -253,7 +241,7 @@ AliMUONPainterHelper::GenerateGeometry()
 }
 
 //_____________________________________________________________________________
-AliMUONPainterContour* 
+AliMUONContour* 
 AliMUONPainterHelper::GenerateManuContour(Int_t detElemId,
                                           Int_t manuId,
                                           AliMUONAttPainter viewType,
@@ -261,86 +249,26 @@ AliMUONPainterHelper::GenerateManuContour(Int_t detElemId,
 {
   /// Generate the contour of the list of pads
   
-  if (!fContourMaker) fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
-  
-  AliMUONPainterContour* contour = 
-    fContourMaker->GenerateManuContour(contourName,detElemId,manuId,viewType);
+  static AliMUONManuContourMaker maker(fExplodedGlobalTransformations);
   
-  if (contour) 
+  if ( viewType.IsBackView() )
   {
-    RegisterContour(contour);
+    AliError("Backview not implemented yet (and will probably never be, after all...)");
+    return 0x0;
   }
   
-  return contour;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterHelper::GeneratePadStore()
-{
-  /// Generate the pad store
+  AliMUONContour* contour = maker.CreateManuContour(detElemId,manuId,contourName);
   
-  AliCodeTimerAuto("")
-  AliDebugClass(1,"Generating pad store");
-  fPadStore = new AliMUONPainterPadStore();
+  if ( !contour ) return 0x0;
   
-  AliMpDEIterator deIt;
+  AliMUONContour* pContour = new AliMUONContour(*contour);
   
-  deIt.First();
-  while ( !deIt.IsDone() )
+  if (pContour) 
   {
-    Int_t detElemId = deIt.CurrentDEId();
-    if ( AliMpDEManager::GetStationType(detElemId) != AliMp::kStationTrigger )
-    {
-      GeneratePadStore(detElemId);
-    }
-    deIt.Next();
-  }
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterHelper::GeneratePadStore(Int_t detElemId)
-{
-  /// Generate part of the padstore for one detection element
-  
-  AliMp::CathodType cathode[] = { AliMp::kCath0, AliMp::kCath1 };
-  
-  for ( Int_t i = 0; i < 2; ++i ) 
-  {
-    const AliMpVSegmentation* seg = 
-    AliMpSegmentation::Instance()->GetMpSegmentation(detElemId,cathode[i]);
-    AliMpVPadIterator* it = seg->CreateIterator();
-    it->First();
-    
-    while ( !it->IsDone() )
-    {
-      AliMpPad pad = it->CurrentItem();
-      
-      Double_t x,y,z;
-      Local2Global(detElemId,pad.GetPositionX(),pad.GetPositionY(),0,
-                   x,y,z);
-      Int_t manuId = pad.GetManuId();
-      Int_t manuChannel = pad.GetManuChannel();
-      AliMUONVCalibParam* param = fPadStore->Get(detElemId,manuId);
-      param->SetValueAsDouble(manuChannel,0,x);
-      param->SetValueAsDouble(manuChannel,1,y);
-      param->SetValueAsDouble(manuChannel,2,pad.GetDimensionX());
-      param->SetValueAsDouble(manuChannel,3,pad.GetDimensionY());
-      it->Next();
-    }          
-    delete it;
+    RegisterContour(pContour);
   }
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONPainterHelper::GetBoundaries(const TArrayI& pads, Double_t& xmin, Double_t& ymin,
-                                    Double_t& xmax, Double_t& ymax) const
-{
-  /// Get the area covered by an array of pads
   
-  return fPadStore->GetBoundaries(pads,xmin,ymin,xmax,ymax);
+  return pContour;
 }
 
 //_____________________________________________________________________________
@@ -357,13 +285,6 @@ AliMUONPainterHelper::GetCathodeType(Int_t detElemId, Int_t manuId) const
   return AliMpDEManager::GetCathod(detElemId,planeType);
 }
 
-//_____________________________________________________________________________
-AliMUONPainterContour* 
-AliMUONPainterHelper::GetLocalManuContour(Int_t detElemId, Int_t manuId) const
-{
-  /// Retrieve a manu contour (in local coordinates)
-  return fContourMaker->FindLocalManuContour(detElemId,manuId);
-}
 
 //_____________________________________________________________________________
 AliMpMotifPosition* 
@@ -485,51 +406,13 @@ AliMUONPainterHelper::Instance()
   /// Return the global and unique instance of this class
   
   if (fgInstance) return fgInstance;
-  
-  AliMUONPainterEnv env;
-  
-  TString fileName(gSystem->ExpandPathName(env.String("PadStoreFileName","$HOME/padstore.root")));
 
-  if ( gSystem->AccessPathName(fileName.Data(),kFileExists) ) // mind the strange return value of that method...   
-  {
-    // file does NOT exist yet. Create it
-    AliDebugClass(1,"Generating instance");
-    
-    Int_t ret;
-    
-    new TGMsgBox(gClient->GetRoot(),gClient->GetRoot(),"",
-                 Form("File %s not found.\nI will generate it, and this will take a while.\n"
-                      "Click OK (and grab a cup of coffee ;-) ) to proceed,\n or Cancel to quit.",fileName.Data()),
-                 kMBIconQuestion,
-                 kMBOk | kMBCancel,
-                 &ret);
-    if ( ret == kMBCancel ) exit(1);
-    
-    fgInstance = new AliMUONPainterHelper;
-    fgInstance->GenerateGeometry();
-    fgInstance->GeneratePadStore();
-    fgInstance->GenerateDefaultMatrices();
-    fgInstance->Modified(kTRUE);
-    fgInstance->fEnv = new AliMUONPainterEnv;
-    fgInstance->fEnv->Set("PadStoreFileName",fileName.Data());
-    fgInstance->Save();
-    
-  }
-  else
-  {
-    AliDebugClass(1,"Reading instance");
-    TFile f(fileName.Data());
-    fgInstance = static_cast<AliMUONPainterHelper*>(f.Get("AliMUONPainterHelper"));
-    
-    TIter next(fgInstance->fPainterMatrices);
-    AliMUONPainterMatrix* matrix;
-    while ( ( matrix = static_cast<AliMUONPainterMatrix*>(next()) ) )
-    {
-      AliMUONPainterRegistry::Instance()->Register(matrix);
-    }
-    fgInstance->fPainterMatrices->SetOwner(kFALSE);
-    fgInstance->fEnv = new AliMUONPainterEnv;
-  }
+  AliCodeTimerAutoClass("");
+
+  fgInstance = new AliMUONPainterHelper;
+  fgInstance->GenerateGeometry();
+  fgInstance->GenerateDefaultMatrices();
+  fgInstance->fEnv = new AliMUONPainterEnv;
   return fgInstance;
 }
 
@@ -622,18 +505,15 @@ AliMUONPainterHelper::ColorFromValue(Double_t value, Double_t min, Double_t max)
 }
 
 //_____________________________________________________________________________
-AliMUONPainterContour* 
+AliMUONContour* 
 AliMUONPainterHelper::MergeContours(const TObjArray& contours, 
                                     const char* contourName)
 {
   /// Merge a set of contours (delegating to the contour maker)
-  if (!fContourMaker) 
-  {
-    fContourMaker = new AliMUONPainterContourMaker(fExplodedGlobalTransformations);
-  }
   
-  AliMUONPainterContour* contour = fContourMaker->MergeContours(contours,
-                                                                contourName);
+  AliMUONContourMaker maker;
+  
+  AliMUONContour* contour = maker.MergeContour(contours,contourName);
   
   if (contour) 
   {
@@ -654,36 +534,15 @@ AliMUONPainterHelper::Print(Option_t* opt) const
   if ( sopt.Length() == 0 )
   {
     cout << Form("ExplodeFactor=%e,%e",fExplodeFactor[0],fExplodeFactor[1]) << endl;
-    cout << Form("PadStore=%x",fPadStore);
-    if ( fPadStore ) cout << Form(" with %d pads",fPadStore->GetSize());
     cout << endl;
     cout << Form("GlobalTransformations=%x",fExplodedGlobalTransformations);
     if ( fExplodedGlobalTransformations ) cout << Form(" with %d transformations",fExplodedGlobalTransformations->GetSize());
     cout << endl;
-    if ( fContourMaker ) 
-    {
-      cout << Form(" with %d contours",fContourMaker->Size());
-    }
-    else
-    {
-      cout << "No contour";
-    }
+    cout << Form("Contour map : collisions = %5.3f size = %d capacity = %d", 
+                 fAllContours.AverageCollisions(),
+                 fAllContours.GetSize(),
+                 fAllContours.Capacity()) << endl;
     cout << endl;
-    cout << "Modified=";
-    if ( IsModified() ) 
-    {
-    cout << "YES";
-  }
-  else
-  {
-    cout << "NO";
-  }
-  cout << endl;
-  }
-  
-  if ( sopt.Contains("CONTOUR") || sopt.Contains("FULL") )
-  {
-    fContourMaker->Print(opt);
   }
   
   if ( sopt.Contains("MATRI") || sopt.Contains("FULL") )
@@ -694,46 +553,18 @@ AliMUONPainterHelper::Print(Option_t* opt) const
 
 //_____________________________________________________________________________
 void
-AliMUONPainterHelper::RegisterContour(AliMUONPainterContour* contour)
+AliMUONPainterHelper::RegisterContour(AliMUONContour* contour)
 {
   /// contour is adopted by contourMaker
   AliCodeTimerAuto("")
   AliDebug(1,contour->GetName());
-  if ( fContourMaker->HasContour(contour->GetName()) ) 
+  if ( fAllContours.GetValue(contour->GetName()) ) 
   {
     AliError(Form("Contour with name %s is already there",contour->GetName()));
 //    Print("CONTOUR");
     return;
   }
-  fContourMaker->Add(contour);
-  Modified(kTRUE);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterHelper::Save()
-{
-  /// Save to disk
-  
-  if (!IsModified()) return;
-
-  Modified(kFALSE);
-
-  AliInfo("");
-
-  fgInstance->Print();
-  
-  fgInstance->Env()->Save();
-  
-  TString fileName(gSystem->ExpandPathName(fgInstance->Env()->String("PadStoreFileName")));
-
-  AliInfo(Form("Saving to %s",fileName.Data()));
-          
-  TFile f(fileName,"RECREATE");
-
-  fgInstance->Write("");
-  
-  f.Close();
+  fAllContours.Add(new TObjString(contour->GetName()),contour);
 }
 
 //_____________________________________________________________________________
@@ -898,3 +729,4 @@ AliMUONPainterHelper::FormatValue(const char* name, Double_t value) const
   
   return Form("%s = %e",name,value);
 }
+
index 728a6df..4b1d017 100644 (file)
 #  include "AliMpPad.h"
 #endif
 
+#ifndef ROOT_TMap
+#  include "TMap.h"
+#endif
+
 class AliMUONAttPainter;
-class AliMUONPainterContour;
-class AliMUONPainterContourMaker;
+class AliMUONContour;
 class AliMUONPainterEnv;
-class AliMUONPainterPadStore;
 class AliMUONVCalibParam;
 class AliMUONVTrackerData;
 class AliMpExMap;
@@ -79,23 +81,16 @@ public:
   
   Int_t ColorFromValue(Double_t value, Double_t min, Double_t max) const;
   
-  Int_t FindPadID(const TArrayI& pads, Double_t x, Double_t y) const;
-    
   AliMp::CathodType GetCathodeType(Int_t detElemId, Int_t manuId) const;
 
-  AliMUONPainterContour* GenerateManuContour(Int_t detElemId, Int_t manuId,
+  AliMUONContour* GenerateManuContour(Int_t detElemId, Int_t manuId,
                                              AliMUONAttPainter viewType,
                                              const char* contourName);
 
-  void GetBoundaries(const TArrayI& pads, Double_t& xmin, Double_t& ymin,
-                     Double_t& xmax, Double_t& ymax) const;
-
-  AliMUONPainterContour* GetContour(const char* contourName) const;
+  AliMUONContour* GetContour(const char* contourName) const;
 
   /// Return a contour by name
-  AliMUONPainterContour* GetContour(const TString& contourName) const { return GetContour(contourName.Data()); }
-
-  AliMUONPainterContour* GetLocalManuContour(Int_t detElemId, Int_t manuId) const;
+  AliMUONContour* GetContour(const TString& contourName) const { return GetContour(contourName.Data()); }
 
   AliMpMotifPosition* GetMotifPosition(Int_t detElemId, Int_t manuId) const;
   
@@ -134,23 +129,12 @@ public:
   void Global2LocalReal(Int_t detElemId, Double_t xg, Double_t yg, Double_t zg,
                         Double_t& xl, Double_t& yl, Double_t& zl) const;
 
-  AliMUONPainterContour* MergeContours(const TObjArray& contours, 
+  AliMUONContour* MergeContours(const TObjArray& contours, 
                                        const char* contourName);
   
   virtual void Print(Option_t* opt="") const;
   
-  void RegisterContour(AliMUONPainterContour* contour);
-  
-  /// Whether we were modified since our creation
-  Bool_t IsModified() const { return fIsModified; }
-  
-  /// Set the modified flag
-  void Modified(Bool_t value=kTRUE) { fIsModified = value; }
-
-  void Save();
-  
-  /// Return the pad store
-  const AliMUONPainterPadStore& PadStore() const { return *fPadStore; }
+  void RegisterContour(AliMUONContour* contour);
   
   TString FormatValue(const char* name, Double_t value) const;
   
@@ -166,22 +150,18 @@ private:
   
   void GenerateDefaultMatrices();
   void GenerateGeometry();
-  void GeneratePadStore();
-  void GeneratePadStore(Int_t detElemId);  
 
 private:
   static AliMUONPainterHelper* fgInstance; ///< global instance
   
-  AliMUONPainterPadStore* fPadStore; ///< the pad store
   Double_t fExplodeFactor[2]; ///< explosing factors for representation
   AliMpExMap* fExplodedGlobalTransformations; ///< global geometric transformations (exploded)
   AliMpExMap* fRealGlobalTransformations; ///< global geometric transformations (real)
-  Bool_t fIsModified; ///< whether we've been modified since creation
-  mutable AliMUONPainterContourMaker* fContourMaker; ///< the contour builder
   TObjArray* fPainterMatrices; ///< default matrices
   AliMUONPainterEnv* fEnv; ///< resources
+  TMap fAllContours; ///< all contours
   
-  ClassDef(AliMUONPainterHelper,1) // Helper class for painters
+  ClassDef(AliMUONPainterHelper,2) // Helper class for painters
 };
 
 #endif
index ae13218..8e226cd 100644 (file)
@@ -18,7 +18,6 @@
 #include "AliMUONPainterHighlighter.h"
 
 #include "AliMUONVPainter.h"
-#include "AliMUONPainterContour.h"
 #include "AliLog.h"
 
 /// \class AliMUONPainterHighlighter
index 7b54490..0a58b25 100644 (file)
@@ -30,7 +30,7 @@
 #include "AliMUONPainterGroup.h"
 #include "AliMUONPainterInterfaceHelper.h"
 #include "AliMUONPainterMatrix.h"
-#include "AliMUONPainterRegistry.h"
+#include "AliMUONPainterDataRegistry.h"
 #include "AliMUONVPainter.h"
 #include "AliMUONVTrackerData.h"
 #include "AliLog.h"
@@ -62,7 +62,7 @@ fCurrentDimension(-1)
 
   fDataSourceNames = new TGButtonGroup(this,"Sources");
       
-  AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+  AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
   
   reg->Connect("DataSourceWasRegistered(AliMUONVTrackerData*)",
                "AliMUONPainterPlotSelector",
@@ -142,7 +142,7 @@ AliMUONPainterPlotSelector::CreateDimensionButtons(const char* dataSourceName)
   
   AliDebug(1,Form("Creating dimension buttons for dataSource %s",dataSourceName));
   
-  AliMUONVTrackerData* data = AliMUONPainterRegistry::Instance()->DataSource(dataSourceName);
+  AliMUONVTrackerData* data = AliMUONPainterDataRegistry::Instance()->DataSource(dataSourceName);
 
   TGButtonGroup* bg = new TGButtonGroup(this,0,3,5,0,dataSourceName);
   
index 874a6ce..1615dd7 100644 (file)
@@ -21,8 +21,6 @@
 #include "AliMUON2DMap.h"
 #include "AliMUONCalibParamND.h"
 #include "AliMUONPainterMatrix.h"
-#include "AliMUONTrackerData.h"
-#include "AliMUONVTrackerDataMaker.h"
 #include "AliLog.h"
 #include <TGMenu.h>
 #include <TGWindow.h>
@@ -47,17 +45,12 @@ AliMUONPainterRegistry* AliMUONPainterRegistry::fgInstance(0x0);
 //_____________________________________________________________________________
 AliMUONPainterRegistry::AliMUONPainterRegistry() : TObject(), TQObject(),
 fPainterMatrices(new TObjArray),
-fDataMakers(new TObjArray),
 fHistoryMenu(0x0),
 fMenuBar(0x0),
-fHistoryCounter(0),
-fZombies(new TObjArray),
-fInteractiveReadOutConfig(0x0)
+fHistoryCounter(0)
 {
   /// ctor
   fPainterMatrices->SetOwner(kTRUE);
-  fDataMakers->SetOwner(kTRUE);
-  fZombies->SetOwner(kTRUE);
 }
 
 //_____________________________________________________________________________
@@ -65,116 +58,6 @@ AliMUONPainterRegistry::~AliMUONPainterRegistry()
 {
   /// dtor
   delete fPainterMatrices;
-  delete fDataMakers;
-  delete fInteractiveReadOutConfig;
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::CreateInteractiveReadOutConfig() const
-{
-  /// Create configuration of readout
-  fInteractiveReadOutConfig = new AliMUONTrackerData("IROC","IROC",1);
-  fInteractiveReadOutConfig->SetDimensionName(0,"Switch");
-    /// FIXME: should use a version of TrackerData w/ no storage for channels
-    /// (i.e. starting at the manu level, or even bus patch level ?)
-  AliMpManuIterator it;
-  Int_t detElemId;
-  Int_t manuId;
-  AliMUON2DMap store(true);
-
-  while ( it.Next(detElemId,manuId) )
-  {
-    AliMUONVCalibParam* param = new AliMUONCalibParamND(1,64,detElemId,manuId,1);
-    store.Add(param);
-  }
-  fInteractiveReadOutConfig->Add(store);
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerDataMaker* 
-AliMUONPainterRegistry::DataMaker(Int_t i) const
-{
-  /// Get one data source
-  if ( i >= 0 && i <= fDataMakers->GetLast() )
-  {
-    return static_cast<AliMUONVTrackerDataMaker*>(fDataMakers->At(i));
-  }
-  else
-  {
-    AliError(Form("Index out of bounds : %d / %d",i,fDataMakers->GetLast()+1));
-    return 0x0;
-  }
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerData* 
-AliMUONPainterRegistry::DataSource(Int_t i) const
-{
-  /// Get one data source
-  
-  AliMUONVTrackerDataMaker* maker = DataMaker(i);
-  if ( maker ) return maker->Data();
-  return 0x0;
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONPainterRegistry::DataMakerWasRegistered(const AliMUONVTrackerDataMaker* data)
-{
-  /// A new reader source was registered
-  Long_t param[] = { (Long_t)data };
-  
-  Emit("DataMakerWasRegistered(AliMUONVTrackerDataMaker*)",param);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DataMakerWasUnregistered(const AliMUONVTrackerDataMaker* data)
-{
-  /// A data reader was unregistered
-  Long_t param[] = { (Long_t)data };
-  
-  Emit("DataMakerWasUnregistered(AliMUONVTrackerDataMaker*)",param);
-  
-}
-
-//_____________________________________________________________________________
-void 
-AliMUONPainterRegistry::DataSourceWasRegistered(const AliMUONVTrackerData* data)
-{
-  /// A new data source was registered
-  Long_t param[] = { (Long_t)data };
-  
-  Emit("DataSourceWasRegistered(AliMUONVTrackerData*)",param);
-}
-
-//_____________________________________________________________________________
-void
-AliMUONPainterRegistry::DataSourceWasUnregistered(const AliMUONVTrackerData* data)
-{
-  /// A data source was unregistered
-  Long_t param[] = { (Long_t)data };
-  
-  Emit("DataSourceWasUnregistered(AliMUONVTrackerData*)",param);
-  
-}
-
-//_____________________________________________________________________________
-AliMUONVTrackerData*
-AliMUONPainterRegistry::DataSource(const char* name) const
-{
-  /// Find a data source by name
-  for ( Int_t i = 0; i < NumberOfDataMakers(); ++i )
-  {
-    AliMUONVTrackerData* data = DataMaker(i)->Data();
-    if ( data ) 
-    {
-      TString dname(data->GetName());
-      if ( dname == name ) return data;
-    }
-  }
-  return 0x0;
 }
 
 //_____________________________________________________________________________
@@ -218,17 +101,6 @@ AliMUONPainterRegistry::Instance()
 }
 
 //_____________________________________________________________________________
-AliMUONVTrackerData*
-AliMUONPainterRegistry::InteractiveReadOutConfig() const
-{
-  /// Return an object that contains the parts of the detector selected
-  /// (using the mouse) to be part of the readout.
-
-  if (!fInteractiveReadOutConfig) CreateInteractiveReadOutConfig();
-  return fInteractiveReadOutConfig;
-}
-
-//_____________________________________________________________________________
 AliMUONPainterMatrix* 
 AliMUONPainterRegistry::PainterMatrix(Int_t i) const
 {
@@ -246,7 +118,7 @@ AliMUONPainterRegistry::PainterMatrix(Int_t i) const
 
 //_____________________________________________________________________________
 void 
-AliMUONPainterRegistry::PainterMatrixWantToShow(const AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWantToShow(AliMUONPainterMatrix* group)
 {
   /// A given paintermatrix want to appear on screen
   Long_t param[] = { (Long_t)group };
@@ -300,7 +172,7 @@ AliMUONPainterRegistry::AddToHistory(AliMUONPainterMatrix* group)
 
 //_____________________________________________________________________________
 void 
-AliMUONPainterRegistry::PainterMatrixWasRegistered(const AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWasRegistered(AliMUONPainterMatrix* group)
 {
   /// A new painter matrix was registered
   Long_t param[] = { (Long_t)group };
@@ -310,7 +182,7 @@ AliMUONPainterRegistry::PainterMatrixWasRegistered(const AliMUONPainterMatrix* g
 
 //_____________________________________________________________________________
 void 
-AliMUONPainterRegistry::PainterMatrixWasUnregistered(const AliMUONPainterMatrix* group)
+AliMUONPainterRegistry::PainterMatrixWasUnregistered(AliMUONPainterMatrix* group)
 {
   /// A painter matrix was unregistered
   Long_t param[] = { (Long_t)group };
@@ -326,32 +198,8 @@ AliMUONPainterRegistry::Print(Option_t* opt) const
   TString sopt(opt);
   sopt.ToUpper();
   
-  cout << "Number of data readers = " << NumberOfDataMakers() << endl;
   cout << "Number of painter matrices = " << NumberOfPainterMatrices() << endl;
   
-  if ( sopt.Contains("FULL") || sopt.Contains("READER") )
-  {
-    TIter next(fDataMakers);
-    AliMUONVTrackerDataMaker* reader;
-    
-    while ( ( reader = static_cast<AliMUONVTrackerDataMaker*>(next()) ) )
-    {
-      reader->Print();
-    }
-  }
-  
-  if ( sopt.Contains("FULL") || sopt.Contains("DATA") )
-  {
-    TIter next(fDataMakers);
-    AliMUONVTrackerDataMaker* reader;
-    
-    while ( ( reader = static_cast<AliMUONVTrackerDataMaker*>(next()) ) )
-    {
-      AliMUONVTrackerData* data = reader->Data();
-      if ( data ) data->Print();
-    }
-  }
-
   if ( sopt.Contains("FULL") || sopt.Contains("MATRIX") )
   {
     TIter next(fPainterMatrices);
@@ -378,24 +226,6 @@ AliMUONPainterRegistry::Register(AliMUONPainterMatrix* group)
 }
 
 //_____________________________________________________________________________
-void
-AliMUONPainterRegistry::Register(AliMUONVTrackerDataMaker* reader)
-{
-  /// reader is adopted, i.e. the registry becomes the owner of it.
-  fDataMakers->AddLast(reader);
-  DataMakerWasRegistered(reader);
-  if ( reader->Data() ) DataSourceWasRegistered(reader->Data());
-}
-
-//_____________________________________________________________________________
-Int_t 
-AliMUONPainterRegistry::NumberOfDataMakers() const
-{
-  /// The number of data readers we handle
-  return fDataMakers->GetLast()+1;
-}
-
-//_____________________________________________________________________________
 Int_t 
 AliMUONPainterRegistry::NumberOfPainterMatrices() const
 {
@@ -404,48 +234,6 @@ AliMUONPainterRegistry::NumberOfPainterMatrices() const
 }
 
 //_____________________________________________________________________________
-void 
-AliMUONPainterRegistry::DeleteZombies()
-{
-  /// Delete zombies
-  fZombies->Delete();
-}
-
-//_____________________________________________________________________________
-Bool_t 
-AliMUONPainterRegistry::Unregister(AliMUONVTrackerDataMaker* reader)
-{
-  /// Unregister some reader
-  
-  if (!reader) return kFALSE;
-  
-  if ( reader->Data() ) 
-  {
-    DataSourceWasUnregistered(reader->Data());
-    reader->Data()->Destroyed(); // we pretend it's deleted now, even
-    // if it will be only later on when zombie are killed, so that
-    // for instance painters depending on it will no longer try to access it
-  }
-
-  DataMakerWasUnregistered(reader);
-  
-  TObject* o = fDataMakers->Remove(reader);
-  
-  fZombies->Add(o); // for later deletion
-  
-//  if ( o ) 
-//  {
-//    delete o;
-//  }
-//  else
-//  {
-//    AliError(Form("Could not unregister data named %s title %s",reader->GetName(),
-//                  reader->GetTitle()));
-//  }
-  return ( o != 0x0 );
-}
-
-//_____________________________________________________________________________
 Bool_t 
 AliMUONPainterRegistry::Unregister(AliMUONPainterMatrix* group)
 {
index d431b9a..296a0c9 100644 (file)
@@ -21,8 +21,6 @@
 
 class TGPopupMenu;
 class TObjArray;
-class AliMUONVTrackerData;
-class AliMUONVTrackerDataMaker;
 class AliMUONPainterMatrix;
 class TGMenuBar;
 
@@ -31,33 +29,12 @@ class AliMUONPainterRegistry : public TObject, public TQObject
 public:
   virtual ~AliMUONPainterRegistry();
 
-  AliMUONVTrackerDataMaker* DataMaker(Int_t i) const;
-
-  AliMUONVTrackerData* DataSource(Int_t i) const;
-  
-  AliMUONVTrackerData* DataSource(const char* name) const;
-
-  AliMUONVTrackerData* InteractiveReadOutConfig() const;
-  
-  void DataSourceWasRegistered(const AliMUONVTrackerData* data); // *SIGNAL*
-  
-  void DataSourceWasUnregistered(const AliMUONVTrackerData* data); // *SIGNAL*
-
-  void DataMakerWasRegistered(const AliMUONVTrackerDataMaker* reader); // *SIGNAL*
-  
-  void DataMakerWasUnregistered(const AliMUONVTrackerDataMaker* reader); // *SIGNAL*
-  
   Int_t FindIndexOf(AliMUONPainterMatrix* group) const;
   
   void HistoryMenuActivated(Int_t i);
   
   static AliMUONPainterRegistry* Instance();
   
-  Int_t NumberOfDataMakers() const;
-
-  /// Number of data sources = data makers
-  Int_t NumberOfDataSources() const { return NumberOfDataMakers(); }
-
   Int_t NumberOfPainterMatrices() const;
 
   AliMUONPainterMatrix* PainterMatrix(Int_t i) const;
@@ -66,27 +43,21 @@ public:
   
   void AddToHistory(AliMUONPainterMatrix* group);
     
-  void PainterMatrixWasRegistered(const AliMUONPainterMatrix* group); // *SIGNAL*
+  void PainterMatrixWasRegistered(AliMUONPainterMatrix* group); // *SIGNAL*
   
-  void PainterMatrixWasUnregistered(const AliMUONPainterMatrix* group); // *SIGNAL*
+  void PainterMatrixWasUnregistered(AliMUONPainterMatrix* group); // *SIGNAL*
   
-  void PainterMatrixWantToShow(const AliMUONPainterMatrix* group); // *SIGNAL*
+  void PainterMatrixWantToShow(AliMUONPainterMatrix* group); // *SIGNAL*
   
   void Print(Option_t* opt) const;
   
   Int_t Register(AliMUONPainterMatrix* group);
   
-  void Register(AliMUONVTrackerDataMaker* reader);
-
   /// Set the menu bar where to put the history menu
   void SetMenuBar(TGMenuBar* bar) { fMenuBar = bar; }
   
   Bool_t Unregister(AliMUONPainterMatrix* group);
   
-  Bool_t Unregister(AliMUONVTrackerDataMaker* reader);
-
-  void DeleteZombies();
-  
 private:
   /// Not implemented
   AliMUONPainterRegistry();
@@ -95,19 +66,14 @@ private:
   /// Not implemented
   AliMUONPainterRegistry& operator=(const AliMUONPainterRegistry&);
   
-  void CreateInteractiveReadOutConfig() const;
-  
 private:
   static AliMUONPainterRegistry* fgInstance; ///< unique instance
   TObjArray* fPainterMatrices; ///< painter matrices
-  TObjArray* fDataMakers; ///< data makers
   TGPopupMenu* fHistoryMenu; ///< history menu
   TGMenuBar* fMenuBar; ///< Menu bar where to put the history menu
   Int_t fHistoryCounter; ///< index to get back history menu items
-  TObjArray* fZombies; ///< data readers to be deleted
-  mutable AliMUONVTrackerData* fInteractiveReadOutConfig; ///< clickable readout configuration
   
-  ClassDef(AliMUONPainterRegistry,4) // Registry for AliMUONVPainter related stuff
+  ClassDef(AliMUONPainterRegistry,5) // Registry for AliMUONVPainter related stuff
 };
 
 #endif
index 47ba0ee..6a12e30 100644 (file)
@@ -15,7 +15,6 @@
 
 class AliRawReader;
 
-
 class AliMUONRawStream: public TObject {
   public :
     AliMUONRawStream();
index 5ec0b8c..187944c 100644 (file)
@@ -332,6 +332,15 @@ retry:
                        {
                                fkCurrentData = fkCurrentBusPatch->GetData();
                                fkEndOfData = fkCurrentData + fkCurrentBusPatch->GetDataCount();
+        if ( skipParityErrors ) 
+        {
+          Bool_t ok(kTRUE);
+          for ( Int_t i = 0; i < fkCurrentBusPatch->GetLength() && ok; ++ i )
+          {
+            ok = fkCurrentBusPatch->IsParityOk(i);
+          }
+          if (!ok) fkCurrentData = fkEndOfData;
+        }
                                goto retry;
                        }
                }
index 9b54277..dbee749 100644 (file)
 ///
 
 #include "AliLog.h"
-#include "AliMpConstants.h"
 #include "AliMUON2DMap.h"
 #include "AliMUONCalibParamND.h"
-#include "AliMUONPainterRegistry.h"
+#include "AliMUONPainterDataRegistry.h"
 #include "AliMUONTrackerData.h"
 #include "AliMUONTrackerDataWrapper.h"
 #include "AliMUONVTrackerData.h"
+#include "AliMpConstants.h"
 #include "AliMpDDLStore.h"
 #include "AliMpDetElement.h"
 #include "AliMpManuIterator.h"
@@ -106,7 +106,7 @@ fCancel(new TGTextButton(fButtonFrame,"Cancel"))
   
   SetCleanup(kDeepCleanup);
   
-  AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+  AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
   
   for ( Int_t i = 0; i < reg->NumberOfDataSources(); ++i ) 
   {
@@ -205,7 +205,7 @@ AliMUONTrackerDataCompareDialog::CompareData(const char* d1name,
 {
   /// Compare two data sources
   
-  AliMUONPainterRegistry* reg = AliMUONPainterRegistry::Instance();
+  AliMUONPainterDataRegistry* reg = AliMUONPainterDataRegistry::Instance();
   
   AliMUONVTrackerData* d1 = reg->DataSource(d1name);
   if (!d1)
@@ -249,7 +249,7 @@ AliMUONTrackerDataCompareDialog::CompareData(const char* d1name,
   
   AliMUONVTrackerDataMaker* dw = new AliMUONTrackerDataWrapper(d);
   
-  AliMUONPainterRegistry::Instance()->Register(dw);
+  AliMUONPainterDataRegistry::Instance()->Register(dw);
 }
 
 //______________________________________________________________________________
index ad28096..13a4f7c 100644 (file)
 
 #include "AliMUONVPainter.h"
 
-#include "AliCodeTimer.h"
 #include "AliLog.h"
 #include "AliMUON2DMap.h"
 #include "AliMUONCalibParamND.h"
-#include "AliMUONPainterRegistry.h"
-#include "AliMpManuUID.h"
+#include "AliMUONContour.h"
+#include "AliMUONContourPainter.h"
 #include "AliMUONObjectPair.h"
-#include "AliMUONPainterContour.h"
 #include "AliMUONPainterGroup.h"
 #include "AliMUONPainterHelper.h"
+#include "AliMUONPainterDataRegistry.h"
 #include "AliMUONTrackerDataHistogrammer.h"
 #include "AliMUONVTrackerData.h"
+#include "AliMpManuUID.h"
 #include <Riostream.h>
 #include <TCanvas.h>
 #include <TClass.h>
@@ -566,10 +566,9 @@ AliMUONVPainter::GetBoundingBox(Double_t& x1, Double_t& y1,
                                 Double_t& x2, Double_t& y2) const
 {
   /// Get the bounding box = our area
-  AliMpArea area(Area().GetPositionX(), 
+  AliMpArea area(Area().GetPositionX(),
                  Area().GetPositionY(),
-                 Area().GetDimensionX()*fBorderFactor, 
+                 Area().GetDimensionX()*fBorderFactor,
                  Area().GetDimensionY()*fBorderFactor);
 
   x1 = area.LeftBorder();
@@ -754,8 +753,7 @@ AliMUONVPainter::Paint(Option_t*)
   
   if ( IsExcluded() )
   {
-    fContour->PaintArea(2);
-    fContour->PaintOutline(1,1);
+    AliMUONContourPainter::Paint(*fContour,1,1,2); // red fill with black thin outline
   }
 }
 
@@ -786,7 +784,7 @@ AliMUONVPainter::PaintOutline(Int_t color, Int_t width, Double_t /*x*/, Double_t
   Int_t c = color >= 0 ? color : GetLineColor();
   Int_t w = width >= 0 ? width : GetLineWidth();
   
-  fContour->PaintOutline(c,w);
+  AliMUONContourPainter::Paint(*fContour,c,w);
 }
 
 //_____________________________________________________________________________
@@ -873,7 +871,7 @@ AliMUONVPainter::SetAttributes(const AliMUONAttPainter& attributes)
 
 //_____________________________________________________________________________
 void 
-AliMUONVPainter::SetContour(AliMUONPainterContour* contour)
+AliMUONVPainter::SetContour(AliMUONContour* contour)
 {
   /// Set out contour
   if (!contour)
@@ -1328,7 +1326,7 @@ AliMUONVTrackerData*
 AliMUONVPainter::InteractiveReadOutConfig() const
 {
   /// get the interactive readout config object
-  return AliMUONPainterRegistry::Instance()->InteractiveReadOutConfig();
+  return AliMUONPainterDataRegistry::Instance()->InteractiveReadOutConfig();
 }
 
 //_____________________________________________________________________________
@@ -1392,3 +1390,9 @@ AliMUONVPainter::CreatePainter(const char* className,
   return rv;
 }
 
+//_____________________________________________________________________________
+void
+AliMUONVPainter::PaintArea(Int_t fillColor)
+{
+  AliMUONContourPainter::Paint(*(Contour()),-1,-1,fillColor);
+}
index ac3ea2a..6124444 100644 (file)
@@ -30,7 +30,7 @@
 #endif
 #include <float.h>
 
-class AliMUONPainterContour;
+class AliMUONContour;
 class AliMUONPainterGroup;
 class AliMUONVTrackerData;
 class AliMpArea;
@@ -90,7 +90,7 @@ public:
   virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py);
   
   /// Return the contour representing the outline of this object
-  AliMUONPainterContour* Contour() const { return fContour; }
+  AliMUONContour* Contour() const { return fContour; }
 
   /// Get our name
   virtual const char* GetName() const { return Name().Data(); }
@@ -138,7 +138,7 @@ public:
   AliMUONPainterGroup* ResponderGroup() const { return fResponderGroup; }
 
   /// Set out contour
-  void SetContour(AliMUONPainterContour* contour);
+  void SetContour(AliMUONContour* contour);
   
   void SetData(const char* pattern, AliMUONVTrackerData* data, Int_t dataIndex);
 
@@ -172,6 +172,8 @@ public:
 
   virtual void PaintOutline(Int_t color=-1, Int_t width=-1, Double_t x=FLT_MAX, Double_t y=FLT_MAX);
 
+  virtual void PaintArea(Int_t fillColor);
+  
   virtual void PaintArea(const AliMUONVTrackerData& data, Int_t dataIndex,
                          Double_t min, Double_t max);
     
@@ -297,7 +299,7 @@ private:
   TString fType; ///< our type (DE, Chamber, MANU, etc...)
   AliMUONVPainter* fMother;  ///< our mother
   AliMUONPainterGroup* fGroup; ///< our group
-  AliMUONPainterContour* fContour;  ///< our contour
+  AliMUONContour* fContour;  ///< our contour
   TMap* fPainterGroups; ///< map of groups
   TObjArray* fChildren; ///< our children
   AliMUONPainterGroup* fResponderGroup; ///< the responder group
index 00e0c2d..20278bc 100644 (file)
@@ -22,6 +22,7 @@
 #pragma link C++ class AliMUONTriggerGUIboard+;
 #pragma link C++ class AliMUONClusterInfo+;
 #pragma link C++ class AliMUONPadInfo+;
+#pragma link C++ class AliMUONContourMakerTest+;
 
 #endif
 
index 44650d6..99b6cb5 100644 (file)
@@ -11,9 +11,6 @@
 #pragma link C++ class AliMUONChamberPainter+;
 #pragma link C++ class AliMUONManuPainter+;
 #pragma link C++ class AliMUONPCBPainter+;
-#pragma link C++ class AliMUONPainterContour+;
-#pragma link C++ class AliMUONPainterContourMaker+;
-#pragma link C++ class AliMUONPainterContourMaker::AliMUONNeighbour+;
 #pragma link C++ class AliMUONPainterHelper+;
 #pragma link C++ class AliMUONPainterPadStore+;
 #pragma link C++ class AliMUONDEPainter+;
@@ -25,6 +22,7 @@
 #pragma link C++ class AliMUONPainterMatrix+;
 #pragma link C++ class AliMUONAttPainter+;
 #pragma link C++ class AliMUONPainterRegistry+;
+#pragma link C++ class AliMUONPainterDataRegistry+;
 #pragma link C++ class AliMUONPainterHighlighter+;
 #pragma link C++ class AliMUONPainterPlotSelector+;
 #pragma link C++ class AliMUONPainterInterfaceHelper+;
 #pragma link C++ class AliMUONTrackerDataWrapper+;
 #pragma link C++ class AliMUONTrackerDataCompareDialog+;
 #pragma link C++ class AliMUONTrackerACFDataMaker+;
+#pragma link C++ class AliMUONContourPainter+;
+#pragma link C++ class AliMUONPolygon+;
+#pragma link C++ class AliMUONContour+;
+#pragma link C++ class AliMUONContourMaker+;
+#pragma link C++ class AliMUONManuContourMaker+;
+#pragma link C++ class AliMUONSegment+;
+#pragma link C++ class AliMUONSegmentTree+;
+#pragma link C++ class AliMUONNode+;
+#pragma link C++ class AliMUONPointWithRef+;
+
 
 #endif
index d5e237a..38a35f5 100644 (file)
 #pragma link C++ class  AliMpFrtCrocusConstants+;
 #pragma link C++ class  AliMpManuStore+;
 #pragma link C++ class  AliMpFastSegmentation+;
+#pragma link C++ class  AliMpUID+;
 
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  * See cxx source for full Copyright notice                               */
index 551278a..e2d2955 100644 (file)
@@ -11,7 +11,8 @@ SRCS:= AliMUONPairLight.cxx \
        AliMUONTriggerGUIdimap.cxx \
        AliMUONTriggerGUIboard.cxx \
        AliMUONClusterInfo.cxx \
-       AliMUONPadInfo.cxx
+       AliMUONPadInfo.cxx \
+       AliMUONContourMakerTest.cxx
 
 HDRS:= $(SRCS:.cxx=.h)
 
index 771c517..8005dfb 100644 (file)
@@ -8,8 +8,6 @@ SRCS:=  AliMUONVPainter.cxx \
   AliMUONChamberPainter.cxx \
   AliMUONManuPainter.cxx \
   AliMUONPainterPadStore.cxx \
-  AliMUONPainterContourMaker.cxx \
-  AliMUONPainterContour.cxx \
   AliMUONPainterMasterFrame.cxx \
   AliMUONPainterMatrixFrame.cxx \
   AliMUONManuPadPainter.cxx \
@@ -17,6 +15,7 @@ SRCS:=  AliMUONVPainter.cxx \
   AliMUONPainterMatrix.cxx \
   AliMUONAttPainter.cxx \
   AliMUONPainterRegistry.cxx \
+  AliMUONPainterDataRegistry.cxx \
   AliMUONPainterHighlighter.cxx \
   AliMUONPainterPlotSelector.cxx \
   AliMUONPainterInterfaceHelper.cxx \
@@ -31,8 +30,17 @@ SRCS:=  AliMUONVPainter.cxx \
   AliMUONTrackerDataHistogrammer.cxx \
   AliMUONTrackerDataWrapper.cxx \
   AliMUONTrackerDataCompareDialog.cxx \
-  AliMUONTrackerACFDataMaker.cxx
-  
+  AliMUONTrackerACFDataMaker.cxx \
+  AliMUONContourPainter.cxx \
+  AliMUONPolygon.cxx \
+  AliMUONContour.cxx \
+  AliMUONContourMaker.cxx \
+  AliMUONManuContourMaker.cxx \
+  AliMUONSegment.cxx \
+  AliMUONSegmentTree.cxx \
+  AliMUONNode.cxx \
+  AliMUONPointWithRef.cxx
+
 HDRS:= $(SRCS:.cxx=.h) 
 
 DHDR:= MUONgraphicsLinkDef.h
index f3c8640..64be395 100644 (file)
@@ -101,7 +101,8 @@ SRCS +=  \
         mapping/AliMpCDB.cxx \
          mapping/AliMpFrtCrocusConstants.cxx \
          mapping/AliMpManuStore.cxx \
-         mapping/AliMpFastSegmentation.cxx
+         mapping/AliMpFastSegmentation.cxx \
+         mapping/AliMpUID.cxx
 
 # Category graphics
 #
index d28fce6..ca23dc1 100644 (file)
@@ -144,5 +144,5 @@ int main(int argc, char** argv)
   // --- Start the event loop ---
   theApp->Run(kTRUE);
 
-  AliMUONPainterHelper::Instance()->Save();
+  delete AliMUONPainterHelper::Instance(); // important to trigger the saving of the env. file
 }