]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUON2DMap.h
Initial version (Laurent)
[u/mrichter/AliRoot.git] / MUON / AliMUON2DMap.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice                               */
3
4 // $Id$
5
6 /// \ingroup calib
7 /// \class AliMUON2DMap
8 /// \brief Basic implementation of AliMUONVStore container using
9 /// AliMpExMap internally.
10 ///
11 //  Author Laurent Aphecetche
12
13 #ifndef AliMUON2DMAP_H
14 #define AliMUON2DMAP_H
15
16 #include "AliMUONVStore.h"
17
18 class AliMpExMap;
19
20 class AliMUON2DMap : public AliMUONVStore
21 {
22 public:
23   AliMUON2DMap(Bool_t optimizeForDEManu=kFALSE);  
24   AliMUON2DMap(const AliMUON2DMap& other);
25   AliMUON2DMap&  operator = (const AliMUON2DMap& other);
26   virtual ~AliMUON2DMap();
27
28   virtual Bool_t Add(TObject* object);
29   
30   /// Mandatory methods from TCollection
31   virtual void Clear(Option_t* opt="");
32   
33   /// Whether the Connect(TTree&) method is implemented
34   virtual Bool_t CanConnect() const { return kFALSE; }
35   
36   virtual AliMUONVStore* Create() const;
37   
38   /// The returned iterator is owned by the client.
39   virtual TIterator* CreateIterator() const;
40
41   /// Iterate on part of the store (only for (i,j) where firstI<=i<=lastI
42   TIterator* CreateIterator(Int_t firstI, Int_t lastI) const;
43
44   using AliMUONVStore::FindObject;
45   
46   virtual TObject* FindObject(Int_t i, Int_t j) const;
47
48   /// Whether our internal storage is optimize to store (detection element id, manu id)  
49   Bool_t IsOptimizedForDEManu() const { return fOptimizeForDEManu; }
50   
51   virtual Int_t GetSize() const;
52
53   virtual Int_t GetSize(Int_t i) const;
54
55 private:
56   void CopyTo(AliMUON2DMap& destination) const;
57   Bool_t Set(Int_t i, Int_t j, TObject* object, Bool_t replace);
58
59 private:
60   AliMpExMap* fMap; ///< Our internal map (an AliMpExMap of AliMpExMaps)
61   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.
62   
63   ClassDef(AliMUON2DMap,2) // A 2D container
64 };
65
66 #endif