]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpMotifMap.cxx
From Cvetan: new macro to load ITS clusters.
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotifMap.cxx
index 6fa30c2425226afa1f7552610dfcbadb15f876cb..4267649d240e0de661bc21ba374f0343d3cf7448 100755 (executable)
@@ -14,7 +14,7 @@
  **************************************************************************/
 
 // $Id$
-// $MpId: AliMpMotifMap.cxx,v 1.14 2006/03/17 11:38:06 ivana Exp $
+// $MpId: AliMpMotifMap.cxx,v 1.16 2006/05/24 13:58:41 ivana Exp $
 // Category: motif
 // -------------------
 // Class AliMpMotifMap
@@ -37,7 +37,9 @@
 #include <TVector2.h>
 #include <TArrayI.h>
 
+/// \cond CLASSIMP
 ClassImp(AliMpMotifMap)
+/// \endcond
 
 //_____________________________________________________________________________
 AliMpMotifMap::AliMpMotifMap(Bool_t /*standardConstructor*/) 
@@ -256,6 +258,41 @@ AliMpMotifMap::GetAllMotifPositionsIDs(TArrayI& ecn) const
 #endif  
 }
 
+//_____________________________________________________________________________
+UInt_t  AliMpMotifMap::GetNofMotifPositions() const
+{
+/// Return the number of all motif positions IDs (electronic card numbers)
+
+#ifdef WITH_STL
+  return fMotifPositions.size();  
+#endif
+  
+#ifdef WITH_ROOT  
+  return fMotifPositions.GetSize();
+#endif 
+} 
+
+//_____________________________________________________________________________
+AliMpMotifPosition* AliMpMotifMap::GetMotifPosition(UInt_t index) const
+{
+/// Return the motif position which is in the map on the index-th position
+
+  if ( index >= GetNofMotifPositions() ) {
+    AliErrorStream() << "Index " << index << " outside limits." << endl;
+    return 0;
+  }   
+
+#ifdef WITH_STL
+  MotifPositionMapIterator it = fMotifPositions.begin();
+  std::advance(it, index);
+  return it->second;
+#endif
+  
+#ifdef WITH_ROOT  
+  return (AliMpMotifPosition*)fMotifPositions.GetObject(index);
+#endif 
+}
+
 //_____________________________________________________________________________
 Int_t AliMpMotifMap::CalculateNofPads() const 
 {