]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpZone.cxx
New class - the factory for building mapping segmentations
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpZone.cxx
index aaf03a9ad8d83c75bae33440297dc6402ac69ad1..d09c3c848435adfa9700ce17700656286dded8dd 100755 (executable)
@@ -1,14 +1,31 @@
+/**************************************************************************
+ * 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: AliMpZone.cxx,v 1.6 2005/08/26 15:43:36 ivana Exp $
 // Category: sector
 //
 // Class AliMpZone
 // ---------------
 // Class describing a zone composed of the zone segments.
 // The zone contains pads of the same dimensions.
-//
+// Included in AliRoot: 2003/05/02
 // Authors: David Guez, Ivana Hrivnacova; IPN Orsay
 
 #include "AliMpZone.h"
+#include "AliMpSubZone.h"
 
 ClassImp(AliMpZone)
 
@@ -18,7 +35,7 @@ AliMpZone::AliMpZone(Int_t id)
     fID(id),
     fPadDimensions(TVector2())
 {
-//
+/// Standard constructor
 }
 
 //_____________________________________________________________________________
@@ -27,12 +44,13 @@ AliMpZone::AliMpZone()
     fID(0),
     fPadDimensions(TVector2())
 {
-//
+/// Default constructor
 }
 
 //_____________________________________________________________________________
-AliMpZone::~AliMpZone() {
-//
+AliMpZone::~AliMpZone() 
+{
+/// Destructor
 
   for (Int_t i=0; i<GetNofSubZones(); i++)
     delete fSubZones[i];  
@@ -45,18 +63,22 @@ AliMpZone::~AliMpZone() {
 //_____________________________________________________________________________
 void AliMpZone::AddSubZone(AliMpSubZone* subZone)
 {
-// Adds row segment.
-// ---
+/// Add row segment.
 
+#ifdef WITH_STL
   fSubZones.push_back(subZone);
+#endif
+
+#ifdef WITH_ROOT
+  fSubZones.Add(subZone);
+#endif
 }  
   
 //_____________________________________________________________________________
 AliMpSubZone* AliMpZone::FindSubZone(AliMpVMotif* motif) const
 {
-// Finds a subzone with a specified motif;
-// returns 0 if not found.
-// ---
+/// Find a subzone with a specified motif;
+/// return 0 if not found.
 
   for (Int_t i=0; i<GetNofSubZones(); i++) {
     AliMpSubZone* subZone = GetSubZone(i);
@@ -69,18 +91,32 @@ AliMpSubZone* AliMpZone::FindSubZone(AliMpVMotif* motif) const
 //_____________________________________________________________________________
 Int_t AliMpZone::GetNofSubZones() const 
 {
-// Returns number of row segments.
+/// Return number of row segments.
 
+#ifdef WITH_STL
   return fSubZones.size();
+#endif
+
+#ifdef WITH_ROOT
+  return fSubZones.GetEntriesFast();
+#endif
 }  
 
 //_____________________________________________________________________________
 AliMpSubZone* AliMpZone::GetSubZone(Int_t i) const 
 {
+/// Return i-th sub zone.
+
   if (i<0 || i>=GetNofSubZones()) {
     Warning("GetSubZone", "Index outside range");
     return 0;
   }
   
+#ifdef WITH_STL
   return fSubZones[i];  
+#endif
+
+#ifdef WITH_ROOT
+  return (AliMpSubZone*)fSubZones[i];  
+#endif
 }