]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpPCBPainter.cxx
Option for customized binning (as in AliUEHist), EventMixing binning now derived...
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPCBPainter.cxx
index 555779a68a88a23d406730fa13aeb1b99ed2b24d..7f48386e449ac62665b3e8ea1a00517e68f3a1f5 100644 (file)
  **************************************************************************/
 
 // $Id$
-// $MpId: AliMpPCBPainter.cxx,v 1.4 2005/09/19 18:56:46 ivana Exp $
-// Category: graphics
-//
-// Class AliMpSlatPainter
-// -----------------------
-// Class for drawing a PCB into canvas
-// Authors: Laurent Aphecetche
+// $MpId: AliMpPCBPainter.cxx,v 1.8 2006/05/24 13:58:32 ivana Exp $
+
+
+//-----------------------------------------------------------------------------
+/// \class AliMpPCBPainter
+/// 
+/// Class for drawing a PCB into canvas
+/// 
+/// \author L. Aphecetche
+//-----------------------------------------------------------------------------
 
 #include "AliMpPCBPainter.h"
 
 #include "AliMpMotifPosition.h"
 #include "AliMpPCB.h"
 
+#include "AliLog.h"
+
 #include "TVirtualX.h"
 #include "TPad.h"
 
 #include <iostream>
 
+/// \cond CLASSIMP
 ClassImp(AliMpPCBPainter)
+/// \endcond
 
 //_____________________________________________________________________________
 AliMpPCBPainter::AliMpPCBPainter(AliMpPCB* pcb)
   : AliMpVPainter(), fPCB(pcb)
 {
-    //
-    // Default ctor.
-    //
+    ///
+    /// Default ctor.
+    ///
 }
 
 //_____________________________________________________________________________
 AliMpPCBPainter::~AliMpPCBPainter()
 {
-  //
-  // Dtor.
-  //
+  ///
+  /// Dtor.
+  ///
 }
 
 //_____________________________________________________________________________
 TVector2
 AliMpPCBPainter::GetDimensions() const
 {
-  //
-  // Returns the half-sizes of the PCB.
-  //
+  ///
+  /// Returns the half-sizes of the PCB.
+  ///
   return TVector2(fPCB->DX(),fPCB->DY());
 }
 
@@ -66,9 +73,9 @@ AliMpPCBPainter::GetDimensions() const
 TVector2
 AliMpPCBPainter::GetPosition() const
 {
-  //
-  // Returns the (x,y) position of the PCB.
-  //
+  ///
+  /// Returns the (x,y) position of the PCB.
+  ///
   return TVector2(fPCB->X(),fPCB->Y());
 }
 
@@ -76,51 +83,36 @@ AliMpPCBPainter::GetPosition() const
 void
 AliMpPCBPainter::Draw(Option_t* option)
 {
-  //
-  // Draws the PCB.
-  //
+  ///
+  /// Draws the PCB.
+  ///
   AliMpGraphContext *gr = AliMpGraphContext::Instance();
   if (!fPCB) return;
 
   gr->Push();
   InitGraphContext();
 
-  std::cout << "PCB Position and Dimensions:" << std::endl;
-  GetPosition().Print();
-  GetDimensions().Print();
-
   switch (option[0])
-    {
+  {
     case 'M':
-      for ( AliMpPCB::Size_t i = 0; i < fPCB->GetSize(); ++i )
-       {
-         AliMpMotifPosition* pos = fPCB->GetMotifPosition(i);
-         
-         gr->Push();
-         gr->SetPadPosForReal(pos->Position(),
-                              pos->Dimensions());
-         //      
-         std::cout << "Motif Position " << pos->GetID()
-                   << std::endl;
-         pos->GetMotif()->Print("");
-         std::cout << "Motif dimension:" << std::endl;
-         pos->GetMotif()->Dimensions().Print();
-         std::cout << "MotifPosition position:" << std::endl;
-         pos->Position().Print();
-         std::cout << "MotifPosition dimensions:" << std::endl;
-         pos->Dimensions().Print();
-         //      int id = atoi(pos->GetMotif()->GetID().Data());
-         gr->SetColor(2+i%7);
-         
-         DrawObject(pos,option+1);
-         
-         gr->Pop();
-       }
+      for ( Int_t i = 0; i < fPCB->GetSize(); ++i )
+      {
+        AliMpMotifPosition* pos = fPCB->GetMotifPosition(i);
+        
+        gr->Push();
+        gr->SetPadPosForReal(TVector2(pos->GetPositionX(),pos->GetPositionY()),
+                             TVector2(pos->GetDimensionX(),pos->GetDimensionY()));
+        gr->SetColor(gr->GetColor()+i);
+        
+        DrawObject(pos,option+1);
+        
+        gr->Pop();
+      }
       break;
     default:
       AppendPad(option);
-    }
-
+  }
+  
   gr->Pop();
 }
 
@@ -128,9 +120,9 @@ AliMpPCBPainter::Draw(Option_t* option)
 void
 AliMpPCBPainter::Paint(Option_t* /*option*/)
 {
-  //
-  // Paint the object.
-  //
+  ///
+  /// Paint the object.
+  ///
   AliMpGraphContext* gr = AliMpGraphContext::Instance();
   if (!fPCB) return;
   Int_t col=gVirtualX->GetFillColor();