]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpPadRow.cxx
Adding new libraries
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpPadRow.cxx
index bb0ecd94ed2d7f98020e028079a34cb3dc7394c1..a2335d29ce01f6e4e314df50bf73a7610e76055e 100755 (executable)
@@ -1,42 +1,66 @@
+/**************************************************************************
+ * 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: AliMpPadRow.cxx,v 1.8 2006/05/24 13:58:46 ivana Exp $
 // Category: sector
 //
 // Class AliMpPadRow
 // ------------------
 // Class describing a pad row composed of the pad row segments.
-//
+// Included in AliRoot: 2003/05/02
 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
 
-#include <TError.h>
-
 #include "AliMpPadRow.h"
 #include "AliMpPadRowLSegment.h"
 #include "AliMpPadRowRSegment.h"
 
+#include "AliLog.h"
+
+#include <Riostream.h>
+
+/// \cond CLASSIMP
 ClassImp(AliMpPadRow)
+/// \endcond
 
 //_____________________________________________________________________________
-AliMpPadRow::AliMpPadRow(AliMpXDirection direction) 
+AliMpPadRow::AliMpPadRow(AliMp::XDirection direction) 
   : TObject(),
     fDirection(direction), 
-    fID(0)
+    fID(0),
+    fOffsetX(0),
+    fSegments() 
 {
-//
+/// Standard constructor
 }
 
 //_____________________________________________________________________________
 AliMpPadRow::AliMpPadRow() 
   : TObject(),
-    fDirection(kLeft), 
-    fID(0)
+    fDirection(AliMp::kLeft), 
+    fID(0),
+    fOffsetX(0),
+    fSegments() 
 {
-//
+/// Default constructor
 }
 
 //_____________________________________________________________________________
-AliMpPadRow::~AliMpPadRow() {
-//  
+AliMpPadRow::~AliMpPadRow() 
+{
+/// Destructor  
 
   for (Int_t i=0; i<GetNofPadRowSegments() ; i++)
     delete fSegments[i];
@@ -49,14 +73,13 @@ AliMpPadRow::~AliMpPadRow() {
 //_____________________________________________________________________________
 Double_t AliMpPadRow::CurrentBorderX() const
 {
-// Returns the left/right x border 
-// (depending on the direction which the row segments are filled in).
-// ---
+/// Return the left/right x border 
+/// (depending on the direction which the row segments are filled in).
 
   if (GetNofPadRowSegments() == 0)
       return fOffsetX;
   else 
-    if (fDirection == kLeft)
+    if (fDirection == AliMp::kLeft)
       return GetPadRowSegment(GetNofPadRowSegments()-1)->LeftBorderX();
     else  
       return GetPadRowSegment(GetNofPadRowSegments()-1)->RightBorderX();
@@ -71,12 +94,11 @@ AliMpVPadRowSegment*
 AliMpPadRow::AddPadRowSegment(AliMpMotif* motif, Int_t motifPositionId,
                               Int_t nofPads)
 {
-// Adds pad row segment.
-// ---
+/// Add a pad row segment.
 
   AliMpVPadRowSegment* padRowSegment = 0;
 
-  if (fDirection == kLeft) {
+  if (fDirection == AliMp::kLeft) {
     padRowSegment 
       = new AliMpPadRowLSegment(this, motif, motifPositionId, nofPads);
   }    
@@ -89,7 +111,13 @@ AliMpPadRow::AddPadRowSegment(AliMpMotif* motif, Int_t motifPositionId,
   padRowSegment->SetOffsetX(CurrentBorderX());
 
   // Adds the pad row segment
+#ifdef WITH_STL
   fSegments.push_back(padRowSegment);
+#endif
+
+#ifdef WITH_ROOT
+  fSegments.Add(padRowSegment);
+#endif
   
   return padRowSegment;
 }  
@@ -97,9 +125,8 @@ AliMpPadRow::AddPadRowSegment(AliMpMotif* motif, Int_t motifPositionId,
 //_____________________________________________________________________________
 AliMpVPadRowSegment* AliMpPadRow::FindPadRowSegment(Double_t x) const
 {
-// Finds the row segment for the specified x position;
-// returns 0 if no row segment is found.
-// ---
+/// Find the row segment for the specified x position;
+/// return 0 if no row segment is found.
 
   for (Int_t i=0; i<GetNofPadRowSegments(); i++) {
     AliMpVPadRowSegment* rs = GetPadRowSegment(i);
@@ -113,14 +140,15 @@ AliMpVPadRowSegment* AliMpPadRow::FindPadRowSegment(Double_t x) const
 //_____________________________________________________________________________
 Double_t  AliMpPadRow::HalfSizeY() const
 {
+/// Return the half size in y
+
   return GetPadRowSegment(0)->HalfSizeY();
 }
 
 //_____________________________________________________________________________
 void  AliMpPadRow::SetID(Int_t id)
 {
-// Sets the ID.
-// ---
+/// Set the ID.
 
   fID = id;
 }    
@@ -128,8 +156,7 @@ void  AliMpPadRow::SetID(Int_t id)
 //_____________________________________________________________________________
 void  AliMpPadRow::SetOffsetX(Double_t offsetX)
 {
-// Sets the x offset.
-// ---
+/// Set the x offset.
 
   fOffsetX = offsetX;
 }    
@@ -137,8 +164,7 @@ void  AliMpPadRow::SetOffsetX(Double_t offsetX)
 //_____________________________________________________________________________
 Int_t AliMpPadRow::GetID() const 
 {
-// Returns the row ID.
-// ---
+/// Return the pad row ID.
 
   return fID;
 }  
@@ -146,28 +172,40 @@ Int_t AliMpPadRow::GetID() const
 //_____________________________________________________________________________
 Int_t AliMpPadRow::GetNofPadRowSegments() const 
 {
-// Returns number of row segments.
-// ---
+/// Return the number of pad row segments.
 
+#ifdef WITH_STL
   return fSegments.size();
+#endif
+
+#ifdef WITH_ROOT
+  return fSegments.GetEntriesFast();
+#endif
 }  
 
 //_____________________________________________________________________________
 AliMpVPadRowSegment* AliMpPadRow::GetPadRowSegment(Int_t i) const 
 {
+/// Return the pad row segment with the specified number.
+
   if (i<0 || i>=GetNofPadRowSegments()) {
-    Warning("GetRowSegment", "Index outside range");
+    AliWarningStream() << "Index outside range" << endl;
     return 0;
   }
   
+#ifdef WITH_STL
   return fSegments[i];  
+#endif
+
+#ifdef WITH_ROOT
+  return (AliMpVPadRowSegment*)fSegments[i];  
+#endif
 }
 
 //_____________________________________________________________________________
 Int_t AliMpPadRow::GetNofPads() const 
 {
-// Returns number of pads in this pad row.
-// ---
+/// Return the number of pads in this pad row.
 
   Int_t nofPads=0;
   for (Int_t i=0; i<GetNofPadRowSegments(); i++)