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