Line data Source code
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 core
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(TRootIOCtor* ioCtor);
24 : AliMUON2DMap(Bool_t optimizeForDEManu);
25 : AliMUON2DMap(const AliMUON2DMap& other);
26 : AliMUON2DMap& operator = (const AliMUON2DMap& other);
27 : virtual ~AliMUON2DMap();
28 :
29 : virtual Bool_t Add(TObject* object);
30 :
31 : /// Mandatory methods from TCollection
32 : virtual void Clear(Option_t* opt="");
33 :
34 : /// Whether the Connect(TTree&) method is implemented
35 0 : virtual Bool_t CanConnect() const { return kFALSE; }
36 :
37 : virtual AliMUONVStore* Create() const;
38 :
39 : /// The returned iterator is owned by the client.
40 : virtual TIterator* CreateIterator() const;
41 :
42 : /// Iterate on part of the store (only for (i,j) where firstI<=i<=lastI
43 : TIterator* CreateIterator(Int_t firstI, Int_t lastI) const;
44 :
45 : using AliMUONVStore::FindObject;
46 :
47 : virtual TObject* FindObject(Int_t i, Int_t j) const;
48 :
49 : virtual TObject* FindObject(UInt_t uid) const;
50 :
51 : /// Whether our internal storage is optimize to store (detection element id, manu id)
52 0 : Bool_t IsOptimizedForDEManu() const { return fOptimizeForDEManu; }
53 :
54 : virtual Int_t GetSize() const;
55 :
56 : virtual Int_t GetSize(Int_t i) const;
57 :
58 : private:
59 : /// Not implemented
60 : AliMUON2DMap();
61 :
62 : Bool_t Set(Int_t i, Int_t j, TObject* object, Bool_t replace);
63 :
64 : static const Int_t fgkOptimalSizeForDEManu; ///< Optimal size for DEManu
65 :
66 : AliMpExMap* fMap; ///< Our internal map (an AliMpExMap of AliMpExMaps)
67 : 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.
68 :
69 96 : ClassDef(AliMUON2DMap,2) // A 2D container
70 : };
71 :
72 : #endif
|