AliMpReader splitted into AliMpMotifReader and AliMpSectorReader
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpMotifMap.h
CommitLineData
5f91c9e8 1// $Id$
2// Category: motif
3//
4// Class AliMpMotifMap
5// -------------------
6// Class describing the motif map container, where motifs are
7// mapped to their string IDs.
8//
9// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
10
11#ifndef ALI_MP_MOTIF_MAP_H
12#define ALI_MP_MOTIF_MAP_H
13
f79c58a5 14#ifdef WITH_STL
15 #include <map>
16#endif
5f91c9e8 17
18#include <TObject.h>
5f91c9e8 19
20#include "AliMpMotifTypes.h"
ffb47139 21
22class TString;
23class TVector2;
5f91c9e8 24
25class AliMpVMotif;
26class AliMpMotifType;
27class AliMpMotifPosition;
ffb47139 28class AliMpMotifMap;
5f91c9e8 29
30class AliMpMotifMap : public TObject
31{
32 public:
33 AliMpMotifMap();
34 virtual ~AliMpMotifMap();
35
36 // methods
37 Bool_t AddMotif(AliMpVMotif* motif, Bool_t warn = true);
38 Bool_t AddMotifType(AliMpMotifType* motifType, Bool_t warn = true);
39 Bool_t AddMotifPosition(AliMpMotifPosition* motifType, Bool_t warn = true);
40 void FillMotifPositionMap2();
ffb47139 41 virtual void Print(const char* /*option*/ = "") const;
5f91c9e8 42 void PrintGlobalIndices(const char* fileName) const;
43 void UpdateGlobalIndices(const char* fileName);
44
45 // find methods
46 AliMpVMotif* FindMotif(const TString& motifID) const;
47 AliMpVMotif* FindMotif(const TString& motifID, const TString& motifTypeID,
ffb47139 48 const TVector2& padDimensions) const;
5f91c9e8 49 AliMpMotifType* FindMotifType(const TString& motifTypeID) const;
50 AliMpMotifPosition* FindMotifPosition(Int_t motifPositionID) const;
f79c58a5 51 // AliMpMotifPosition* FindMotifPosition(const AliMpIntPair& indices) const;
5f91c9e8 52
53 private:
f79c58a5 54#ifdef WITH_ROOT
55 static const Int_t fgkSeparator; // the separator used for conversion
56 // of TString to Int_t
57
58 // methods
59 Int_t GetIndex(const TString& s) const;
60 Int_t GetIndex(const AliMpIntPair& pair) const;
61 TString GetString(Int_t index) const;
62 AliMpIntPair GetPair(Int_t index) const;
63#endif
64
5f91c9e8 65 // methods
f79c58a5 66 void PrintMotif(const AliMpVMotif* motif) const;
67 void PrintMotifType(const AliMpMotifType* motifType) const;
68 void PrintMotifPosition(const AliMpMotifPosition* motifPosition) const;
69 void PrintMotifPosition2(const AliMpMotifPosition* motifPosition) const;
5f91c9e8 70 void PrintMotifs() const;
71 void PrintMotifTypes() const;
72 void PrintMotifPositions() const;
73 void PrintMotifPositions2() const;
5f91c9e8 74
f79c58a5 75#ifdef WITH_STL
5f91c9e8 76#ifdef __HP_aCC
77 // data members
78 // EXCLUDED FOR CINT (does not compile on HP)
79 MotifMap fMotifs; //! motifs map
80 MotifTypeMap fMotifTypes; //!motif types map
81 //MotifPositionMap fMotifPositions; //! motif positions map
82 // not taken by cint
83 map<Int_t, AliMpMotifPosition*> fMotifPositions; //! motif positions map by Id
84 MotifPositionMap2 fMotifPositions2; //! motif positions map
85#else
86 // data members
f79c58a5 87 MotifMap fMotifs; // motifs map
5f91c9e8 88 MotifTypeMap fMotifTypes; // motif types map
89 //MotifPositionMap fMotifPositions; // motif positions map
90 // not taken by cint
91 std::map<Int_t, AliMpMotifPosition*> fMotifPositions; // motif positions map by Id
92 MotifPositionMap2 fMotifPositions2; // motif positions map
93#endif
f79c58a5 94#endif
95
96#ifdef WITH_ROOT
97 // data members
98 mutable MotifMap fMotifs; // motifs map
99 mutable MotifTypeMap fMotifTypes; // motifs types map
100 mutable MotifPositionMap fMotifPositions; // motifs positions map
101 mutable MotifPositionMap2 fMotifPositions2;// motifs positions map
102#endif
5f91c9e8 103
104 ClassDef(AliMpMotifMap,1) // motif map
105};
106
107#endif //ALI_MP_MOTIF_MAP_H