]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUON2DMap.h
Separating run-dependent mapping data from data, which are not
[u/mrichter/AliRoot.git] / MUON / AliMUON2DMap.h
index 413e26b61bb3506d9cb309ef86f230264b452340..8dffddacafc4fca1b362311b4f9a4226045f8d3e 100644 (file)
@@ -3,38 +3,70 @@
 
 // $Id$
 
-/// \ingroup base
+/// \ingroup core
 /// \class AliMUON2DMap
-/// \brief Basic implementation of AliMUONV2DStore container using
-/// AliMpExMap internally
+/// \brief Basic implementation of AliMUONVStore container using
+/// AliMpExMap internally.
 ///
-/// Should be revised for better preformance ...
-/// 
-/// \author Laurent Aphecetche
+//  Author Laurent Aphecetche
 
 #ifndef AliMUON2DMAP_H
 #define AliMUON2DMAP_H
 
-#include "AliMUONV2DStore.h"
+#include "AliMUONVStore.h"
 
 class AliMpExMap;
 
-class AliMUON2DMap : public AliMUONV2DStore
+class AliMUON2DMap : public AliMUONVStore
 {
 public:
-  AliMUON2DMap();
+  AliMUON2DMap(TRootIOCtor* ioCtor);
+  AliMUON2DMap(Bool_t optimizeForDEManu);  
+  AliMUON2DMap(const AliMUON2DMap& other);
+  AliMUON2DMap&  operator = (const AliMUON2DMap& other);
   virtual ~AliMUON2DMap();
 
-  virtual TObject* Get(Int_t i, Int_t j) const;
-  virtual Bool_t Set(Int_t i, Int_t j, TObject*, Bool_t replace);
-  virtual Bool_t IsOwner() const;
+  virtual Bool_t Add(TObject* object);
+  
+  /// Mandatory methods from TCollection
+  virtual void Clear(Option_t* opt="");
+  
+  /// Whether the Connect(TTree&) method is implemented
+  virtual Bool_t CanConnect() const { return kFALSE; }
+  
+  virtual AliMUONVStore* Create() const;
+  
+  /// The returned iterator is owned by the client.
+  virtual TIterator* CreateIterator() const;
+
+  /// Iterate on part of the store (only for (i,j) where firstI<=i<=lastI
+  TIterator* CreateIterator(Int_t firstI, Int_t lastI) const;
 
-  virtual void Print(Option_t* opt="") const;
+  using AliMUONVStore::FindObject;
   
+  virtual TObject* FindObject(Int_t i, Int_t j) const;
+
+  virtual TObject* FindObject(UInt_t uid) const;
+
+  /// Whether our internal storage is optimize to store (detection element id, manu id)  
+  Bool_t IsOptimizedForDEManu() const { return fOptimizeForDEManu; }
+  
+  virtual Int_t GetSize() const;
+
+  virtual Int_t GetSize(Int_t i) const;
+
 private:
-  AliMpExMap* fMap;
+  /// Not implemented
+  AliMUON2DMap();
+
+  Bool_t Set(Int_t i, Int_t j, TObject* object, Bool_t replace);
+
+  static const Int_t fgkOptimalSizeForDEManu; ///< Optimal size for DEManu
+
+  AliMpExMap* fMap; ///< Our internal map (an AliMpExMap of AliMpExMaps)
+  Bool_t fOptimizeForDEManu; ///< whether (i,j) pair is supposed to be (DetElemId,ManuId) (allow us to allocate right amount of memory, that's all it does.
   
-  ClassDef(AliMUON2DMap,1) // 
+  ClassDef(AliMUON2DMap,2) // A 2D container
 };
 
 #endif