]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpZonePainter.cxx
- Disentangle masks effect from trigger chamber efficiency estimation.
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpZonePainter.cxx
index beee288cbd624e4545d2b86dc8adbe8f0e2fc5c9..5ace442cb0c7eaa9d35585ab99811479c29eb7eb 100755 (executable)
@@ -1,30 +1,49 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
 // $Id$
+// $MpId: AliMpZonePainter.cxx,v 1.8 2006/05/24 13:58:32 ivana Exp $
 // Category: graphics
-//
+
+//-----------------------------------------------------------------------------
 // Class AliMpZonePainter
 // ----------------------
 // Class for drawing a zone into canvas
-//
+// Included in AliRoot: 2003/05/02
 // Authors: David Guez, IPN Orsay
+//-----------------------------------------------------------------------------
  
-#include <TVirtualX.h>
-#include <TPad.h>
-#include <TError.h>
-
 #include "AliMpZonePainter.h"
 #include "AliMpGraphContext.h"
 #include "AliMpZone.h"
 #include "AliMpSubZone.h"
 #include "AliMpVRowSegment.h"
 
+#include <TVirtualX.h>
+#include <TPad.h>
+
+/// \cond CLASSIMP
 ClassImp(AliMpZonePainter)
+/// \endcond
 
 //_______________________________________________________________________
 AliMpZonePainter::AliMpZonePainter()
   : AliMpVPainter(),
     fZone(0)
 {
-  // default dummy constructor
+  /// Default constructor
 }
 
 //_______________________________________________________________________
@@ -32,45 +51,22 @@ AliMpZonePainter::AliMpZonePainter(AliMpZone *zone)
   : AliMpVPainter(),
     fZone(zone)
 {
-  // normal constructor 
-
-}
+  /// Standard constructor 
 
-//_____________________________________________________________________________
-AliMpZonePainter::AliMpZonePainter(const AliMpZonePainter& right) 
-  : AliMpVPainter(right) 
-{  
-  // copy constructor (not implemented)
-
-  Fatal("AliMpZonePainter", "Copy constructor not provided.");
 }
 
 //_______________________________________________________________________
 AliMpZonePainter::~AliMpZonePainter()
 {
-  // destructor 
-
+  /// Destructor 
 }
 
-//_____________________________________________________________________________
-AliMpZonePainter& 
-AliMpZonePainter::operator=(const AliMpZonePainter& right)
-{
-  // assignement operator (not implemented)
-
-  // check assignement to self
-  if (this == &right) return *this;
-
-  Fatal("operator =", "Assignement operator not provided.");
-    
-  return *this;  
-}    
-
 //_______________________________________________________________________
 Int_t AliMpZonePainter::DistancetoPrimitive(Int_t x, Int_t y)
 {
-  // dist to the nearest segment center if (x,y) is inside the zone
-  // 9999 otherwise
+  /// Distance to the nearest segment center if (x,y) is inside the zone
+  /// 9999 otherwise
+
   if (fZone->GetNofSubZones()<1) return 9999;
   AliMpGraphContext *gr = AliMpGraphContext::Instance();
 
@@ -88,7 +84,8 @@ Int_t AliMpZonePainter::DistancetoPrimitive(Int_t x, Int_t y)
       AliMpVRowSegment* seg = sub->GetRowSegment(iseg);
 
       TVector2 pos,dim;
-      gr->RealToPad(seg->Position(),seg->Dimensions(),pos,dim);
+      gr->RealToPad(TVector2(seg->GetPositionX(), seg->GetPositionY()),
+                    TVector2(seg->GetDimensionX(),seg->GetDimensionY()),pos,dim);
 
       if ( IsInside(point,pos,dim) ){
        Double_t value = (point-pos).Mod();
@@ -103,15 +100,15 @@ Int_t AliMpZonePainter::DistancetoPrimitive(Int_t x, Int_t y)
 //_______________________________________________________________________
 void AliMpZonePainter::DumpObject()
 {
-// Draw the owned object
-  fZone->Dump();
+  /// Dump the owned object
 
+  fZone->Dump();
 }
 
 //_______________________________________________________________________
 TVector2 AliMpZonePainter::GetPosition() const
 {
-  // Get the owned object's position
+  //// Get the owned object's position
 
   if (fZone->GetNofSubZones()<1) return TVector2(0.,0.);
 
@@ -125,15 +122,15 @@ TVector2 AliMpZonePainter::GetPosition() const
       AliMpVRowSegment* seg = sub->GetRowSegment(iseg);
 
       // update the bottom-left corner
-      if (bl.X()>seg->Position().X()-seg->Dimensions().X())
-       bl.Set(seg->Position().X()-seg->Dimensions().X(),bl.Y());
-      if (bl.Y()>seg->Position().Y()-seg->Dimensions().Y())
-       bl.Set(bl.X(),seg->Position().Y()-seg->Dimensions().Y());
+      if (bl.X()>seg->GetPositionX()-seg->GetDimensionX())
+       bl.Set(seg->GetPositionX()-seg->GetDimensionX(),bl.Y());
+      if (bl.Y()>seg->GetPositionY()-seg->GetDimensionY())
+       bl.Set(bl.X(),seg->GetPositionY()-seg->GetDimensionY());
       // update the upper-right corner
-      if (ur.X()<seg->Position().X()+seg->Dimensions().X())
-       ur.Set(seg->Position().X()+seg->Dimensions().X(),ur.Y());
-      if (ur.Y()<seg->Position().Y()+seg->Dimensions().Y())
-       ur.Set(ur.X(),seg->Position().Y()+seg->Dimensions().Y());
+      if (ur.X()<seg->GetPositionX()+seg->GetDimensionX())
+       ur.Set(seg->GetPositionX()+seg->GetDimensionX(),ur.Y());
+      if (ur.Y()<seg->GetPositionY()+seg->GetDimensionY())
+       ur.Set(ur.X(),seg->GetPositionY()+seg->GetDimensionY());
     } //iseg
   } //isub
   return (ur+bl)/2.;
@@ -142,7 +139,7 @@ TVector2 AliMpZonePainter::GetPosition() const
 //_______________________________________________________________________
 TVector2 AliMpZonePainter::GetDimensions() const
 {
-  // Get the owned object's dimensions
+  //// Get the owned object's dimensions
 
   if (fZone->GetNofSubZones()<1) return TVector2(0.,0.);
 
@@ -156,15 +153,15 @@ TVector2 AliMpZonePainter::GetDimensions() const
       AliMpVRowSegment* seg = sub->GetRowSegment(iseg);
 
       // update the bottom-left corner
-      if (bl.X()>seg->Position().X()-seg->Dimensions().X())
-       bl.Set(seg->Position().X()-seg->Dimensions().X(),bl.Y());
-      if (bl.Y()>seg->Position().Y()-seg->Dimensions().Y())
-       bl.Set(bl.X(),seg->Position().Y()-seg->Dimensions().Y());
+      if (bl.X()>seg->GetPositionX()-seg->GetDimensionX())
+       bl.Set(seg->GetPositionX()-seg->GetDimensionX(),bl.Y());
+      if (bl.Y()>seg->GetPositionY()-seg->GetDimensionY())
+       bl.Set(bl.X(),seg->GetPositionY()-seg->GetDimensionY());
       // update the upper-right corner
-      if (ur.X()<seg->Position().X()+seg->Dimensions().X())
-       ur.Set(seg->Position().X()+seg->Dimensions().X(),ur.Y());
-      if (ur.Y()<seg->Position().Y()+seg->Dimensions().Y())
-       ur.Set(ur.X(),seg->Position().Y()+seg->Dimensions().Y());
+      if (ur.X()<seg->GetPositionX()+seg->GetDimensionX())
+       ur.Set(seg->GetPositionX()+seg->GetDimensionX(),ur.Y());
+      if (ur.Y()<seg->GetPositionY()+seg->GetDimensionY())
+       ur.Set(ur.X(),seg->GetPositionY()+seg->GetDimensionY());
     } //iseg
   } //isub
   return (ur-bl)/2.;
@@ -173,14 +170,13 @@ TVector2 AliMpZonePainter::GetDimensions() const
 //_______________________________________________________________________
 void AliMpZonePainter::Draw(Option_t *option)
 {
-// Draw the sector on the current pad
-// The first letter of <option> is treated as follows:
-// case "S" : each sub zones are drawn separately
-// case ""  : the whole zone is drawn at once
-// in both cases, the rest of the option is passed
-// as argument to the Draw function of respectively
-// zone or row objects.
-// ---
+/// Draw the sector on the current pad
+/// The first letter of \a option is treated as follows:
+/// - case "S" : each sub zones are drawn separately
+/// - case ""  : the whole zone is drawn at once
+/// in both cases, the rest of the option is passed
+/// as argument to the Draw function of respectively
+/// zone or row objects.
 
   AliMpGraphContext *gr = AliMpGraphContext::Instance();
   if (!fZone) return;
@@ -200,10 +196,10 @@ void AliMpZonePainter::Draw(Option_t *option)
          for (Int_t iRowSeg=0;iRowSeg<subZone->GetNofRowSegments();++iRowSeg){
            AliMpVRowSegment *rowSegment = subZone->GetRowSegment(iRowSeg);
 
-           TVector2 bl = rowSegment->Position();
-           bl-=rowSegment->Dimensions();
-           TVector2 ur = rowSegment->Position();
-           ur+=rowSegment->Dimensions();
+           TVector2 bl = TVector2(rowSegment->GetPositionX(),rowSegment->GetPositionY());
+           bl -= TVector2(rowSegment->GetDimensionX(),rowSegment->GetDimensionY());
+           TVector2 ur = TVector2(rowSegment->GetPositionX(),rowSegment->GetPositionY());
+           ur += TVector2(rowSegment->GetDimensionX(),rowSegment->GetDimensionY());
            
            if (bl.X()<blx) blx=bl.X();
            if (bl.Y()<bly) bly=bl.Y();
@@ -229,7 +225,8 @@ void AliMpZonePainter::Draw(Option_t *option)
 //_______________________________________________________________________
 void AliMpZonePainter::Paint(Option_t *option)
 {
-// Paint the object
+//// Paint the object
+
   AliMpGraphContext *gr = AliMpGraphContext::Instance();
   if (!fZone) return;
   if (fZone->GetNofSubZones()<1) return;
@@ -246,7 +243,8 @@ void AliMpZonePainter::Paint(Option_t *option)
     for (Int_t iRowSeg=0;iRowSeg<subZone->GetNofRowSegments();++iRowSeg){
       AliMpVRowSegment *rowSegment = subZone->GetRowSegment(iRowSeg);
       TVector2 pos,dim;
-      gr->RealToPad(rowSegment->Position(),rowSegment->Dimensions(),
+      gr->RealToPad(TVector2(rowSegment->GetPositionX(),rowSegment->GetPositionY()),
+                    TVector2(rowSegment->GetDimensionX(),rowSegment->GetDimensionY()),
                    pos,dim);
       gPad->PaintBox(pos.X()-dim.X(),pos.Y()-dim.Y(),
                     pos.X()+dim.X(),pos.Y()+dim.Y());