]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpArea.cxx
Adding comment lines to class description needed for Root documentation,
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpArea.cxx
index 3ae92ab4459191a7402899fc7366d12d94f9dc46..0529420e9bab157616ba18603d1cddaee015f396 100755 (executable)
@@ -1,28 +1,54 @@
+/**************************************************************************
+ * 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: AliMpArea.cxx,v 1.8 2006/05/24 13:58:29 ivana Exp $
 // Category: basic
-//
+
+//-----------------------------------------------------------------------------
 // Class AliMpArea
 // ----------------
 // Class that defines a rectangle area positioned in plane..
-//
+// Included in AliRoot: 2003/05/02
 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
-
-#include <Riostream.h>
+//-----------------------------------------------------------------------------
 
 #include "AliMpArea.h"
+#include "AliMpConstants.h"
 
-ClassImp(AliMpArea)
+#include <Riostream.h>
 
+/// \cond CLASSIMP
+ClassImp(AliMpArea)
+/// \endcond
 
 //_____________________________________________________________________________
 AliMpArea::AliMpArea(const TVector2& position, const TVector2& dimensions)
   : TObject(),
     fPosition(position),
     fDimensions(dimensions),
-    fValidity(true) {
-//
+    fValidity(true) 
+{
+/// Standard constructor
+
   // Check dimensions
-  if (fDimensions.X() <= 0. || fDimensions.Y() <=0.) {
+  if (  fDimensions.X() < - AliMpConstants::LengthTolerance() || 
+        fDimensions.Y() < - AliMpConstants::LengthTolerance() || 
+      ( fDimensions.X() < AliMpConstants::LengthTolerance() && 
+        fDimensions.Y() < AliMpConstants::LengthTolerance() ) )
+  {
     fDimensions = TVector2();
     fValidity = false;
   }  
@@ -33,21 +59,25 @@ AliMpArea::AliMpArea()
   : TObject(),
     fPosition(TVector2()),
     fDimensions(TVector2()), 
-    fValidity(false) {
-//
+    fValidity(false) 
+{
+/// Default constructor
 }
 
 //_____________________________________________________________________________
 AliMpArea::AliMpArea(const AliMpArea& rhs):
   TObject(rhs),
   fPosition(rhs.fPosition),
-  fDimensions(rhs.fDimensions) {
-//
+  fDimensions(rhs.fDimensions), 
+  fValidity(rhs.fValidity) 
+{
+/// Copy constructor
 }
 
 //_____________________________________________________________________________
-AliMpArea::~AliMpArea() {
-//
+AliMpArea::~AliMpArea() 
+{
+/// Destructor
 }
 
 //
@@ -57,12 +87,12 @@ AliMpArea::~AliMpArea() {
 //______________________________________________________________________________
 AliMpArea& AliMpArea::operator = (const AliMpArea& right)
 {
-// Assignement operator
+/// Assignment operator
 
-  // check assignement to self
+  // check assignment to self
   if (this == &right) return *this;
 
-  // base class assignement
+  // base class assignment
   TObject::operator=(right);
 
   fPosition = right.fPosition;
@@ -79,8 +109,7 @@ AliMpArea& AliMpArea::operator = (const AliMpArea& right)
 //_____________________________________________________________________________
 Double_t AliMpArea::LeftBorder() const
 {
-// Returns the position of the left edge.
-// --
+/// Return the position of the left edge.
 
   return fPosition.X() - fDimensions.X();
 }
@@ -88,8 +117,7 @@ Double_t AliMpArea::LeftBorder() const
 //_____________________________________________________________________________
 Double_t AliMpArea::RightBorder() const
 {
-// Returns the position of right edge.
-// --
+/// Return the position of right edge.
 
   return fPosition.X() + fDimensions.X();
 }
@@ -97,8 +125,7 @@ Double_t AliMpArea::RightBorder() const
 //_____________________________________________________________________________
 Double_t AliMpArea::UpBorder() const
 {
-// Returns the position of the up edge.
-// --
+/// Return the position of the up edge.
 
   return fPosition.Y() + fDimensions.Y();
 }
@@ -106,8 +133,7 @@ Double_t AliMpArea::UpBorder() const
 //_____________________________________________________________________________
 Double_t AliMpArea::DownBorder() const
 {
-// Returns the position of the down edge.
-// --
+/// Return the position of the down edge.
 
   return fPosition.Y() - fDimensions.Y();
 }
@@ -115,8 +141,7 @@ Double_t AliMpArea::DownBorder() const
 //_____________________________________________________________________________
 TVector2 AliMpArea::LeftDownCorner() const
 {
-// Returns position of the left down corner.
-// --
+/// Return position of the left down corner.
 
   return TVector2(LeftBorder(), DownBorder());
 }  
@@ -124,8 +149,7 @@ TVector2 AliMpArea::LeftDownCorner() const
 //_____________________________________________________________________________
 TVector2 AliMpArea::LeftUpCorner() const
 {
-// Returns position of the left up corner.
-// --
+/// Return position of the left up corner.
 
   return TVector2(LeftBorder(), UpBorder());
 }  
@@ -133,8 +157,7 @@ TVector2 AliMpArea::LeftUpCorner() const
 //_____________________________________________________________________________
 TVector2 AliMpArea::RightDownCorner() const
 {
-// Returns position of the right down corner.
-// --
+/// Return position of the right down corner.
 
   return TVector2(RightBorder(), DownBorder());
 }  
@@ -143,19 +166,30 @@ TVector2 AliMpArea::RightDownCorner() const
 //_____________________________________________________________________________
 TVector2 AliMpArea::RightUpCorner() const
 {
-// Returns position of the right up corner.
-// --
+/// Return position of the right up corner.
 
   return TVector2(RightBorder(), UpBorder());
 }  
 
+//_____________________________________________________________________________
+void
+AliMpArea::Print(Option_t*) const
+{
+/// Printing
+
+  cout << (*this) << endl;
+}
+
 //_____________________________________________________________________________
 ostream& operator<< (ostream &stream,const AliMpArea& area)
 {
+/// Output streaming
+
   stream << "Area: position: (" 
          << area.Position().X() << ", " << area.Position().Y() << ") " 
         << " dimensions: (" 
          << area.Dimensions().X() << ", " << area.Dimensions().Y() << ") " 
+  << " valid: " << (area.IsValid()==true ? "YES":"NO")
         << endl;
   return stream;
 }