]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpSlatMotifMap.h
Adding singleton static data member and access function
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpSlatMotifMap.h
1 #ifndef ALIMPSLATMOTIFMAP_H
2 #define ALIMPSLATMOTIFMAP_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice                               */
6
7 // $Id$
8
9 /// \ingroup motif
10 /// \class AliMpSlatMotifMap
11 /// \brief A container to keep track of allocated motifs and motifTypes for slats
12 /// (both St345 and trigger ones).
13 ///
14 //  Author Laurent Aphecetche, Subatech
15
16 #ifndef ROOT_TMap
17 #  include "TMap.h"
18 #endif
19
20 class AliMpVMotif;
21 class AliMpMotifType;
22 class TString;
23
24 class AliMpSlatMotifMap : public TObject
25 {
26 public:
27   AliMpSlatMotifMap();
28   virtual ~AliMpSlatMotifMap();
29   
30   // static methods
31   static AliMpSlatMotifMap* Instance();
32
33   AliMpVMotif* FindMotif(const TString& id) const;
34   AliMpMotifType* FindMotifType(const TString& id) const;
35   
36   Bool_t AddMotif(AliMpVMotif* motif, Bool_t warn=kTRUE);
37   Bool_t AddMotifType(AliMpMotifType* motifType, Bool_t warn=kTRUE);
38         
39   void Print(Option_t* opt="") const;
40   
41   void Reset();
42   
43 private:
44   static AliMpSlatMotifMap* fgInstance; ///< Singleton instance
45
46   TMap fMotifs; ///< collection of motifs
47   TMap fMotifTypes; ///< collection of motifTypes
48   
49   ClassDef(AliMpSlatMotifMap,2) // Slat motif map 
50 };
51
52 #endif