Adding includes required by ROOT
[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$
13985652 5// $MpId: AliMpMotifMap.h,v 1.14 2006/05/24 13:58:18 ivana Exp $
dee1d5f1 6
7/// \ingroup motif
8/// \class AliMpMotifMap
9/// \brief Motif map containers
13985652 10///
dee1d5f1 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///
13985652 17/// \author David Guez, Ivana Hrivnacova; IPN Orsay
5f91c9e8 18
19#ifndef ALI_MP_MOTIF_MAP_H
20#define ALI_MP_MOTIF_MAP_H
21
2a7ea2e6 22#include <TObject.h>
23
5006ec94 24#include "AliMpContainers.h"
25
f79c58a5 26#ifdef WITH_STL
5006ec94 27#include "AliMpIntPair.h"
f79c58a5 28#endif
5f91c9e8 29
5006ec94 30#ifdef WITH_ROOT
31#include "AliMpExMap.h"
32#endif
5f91c9e8 33
2a7ea2e6 34#ifdef WITH_STL
35#include <map>
36#endif
5f91c9e8 37
38class AliMpVMotif;
39class AliMpMotifType;
40class AliMpMotifPosition;
ffb47139 41class AliMpMotifMap;
5f91c9e8 42
2a7ea2e6 43class TArrayI;
44class TString;
45class TVector2;
46
5f91c9e8 47class AliMpMotifMap : public TObject
48{
49 public:
5006ec94 50#ifdef WITH_STL
51 typedef std::map<TString, AliMpVMotif*> MotifMap;
52 typedef MotifMap::const_iterator MotifMapIterator;
53 typedef std::map<TString, AliMpMotifType*> MotifTypeMap;
54 typedef MotifTypeMap::const_iterator MotifTypeMapIterator;
55 typedef std::map<Int_t, AliMpMotifPosition*> MotiPositionMap;
56 typedef MotiPositionMap::const_iterator MotifPositionMapIterator;
57 typedef std::map<AliMpIntPair, AliMpMotifPosition*> MotifPositionMap2;
58 typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator;
59#endif
60#ifdef WITH_ROOT
61 typedef AliMpExMap MotifMap;
62 typedef AliMpExMap MotifTypeMap;
63 typedef AliMpExMap MotifPositionMap;
64 typedef AliMpExMap MotifPositionMap2;
65#endif
66
67 public:
68 AliMpMotifMap(Bool_t /*standardConstructor*/);
5f91c9e8 69 AliMpMotifMap();
70 virtual ~AliMpMotifMap();
71
72 // methods
73 Bool_t AddMotif(AliMpVMotif* motif, Bool_t warn = true);
74 Bool_t AddMotifType(AliMpMotifType* motifType, Bool_t warn = true);
75 Bool_t AddMotifPosition(AliMpMotifPosition* motifType, Bool_t warn = true);
76 void FillMotifPositionMap2();
6d5f608a 77 virtual void Print(const char* option = "ALL") const;
5f91c9e8 78 void PrintGlobalIndices(const char* fileName) const;
79 void UpdateGlobalIndices(const char* fileName);
80
81 // find methods
82 AliMpVMotif* FindMotif(const TString& motifID) const;
83 AliMpVMotif* FindMotif(const TString& motifID, const TString& motifTypeID,
ffb47139 84 const TVector2& padDimensions) const;
5f91c9e8 85 AliMpMotifType* FindMotifType(const TString& motifTypeID) const;
86 AliMpMotifPosition* FindMotifPosition(Int_t motifPositionID) const;
5f91c9e8 87
6d5f608a 88 /// Find all motifPositionsIDs (=electronicCardNumbers) handled by this map
3283cfc7 89 void GetAllMotifPositionsIDs(TArrayI& enc) const;
90
91 /// Calculate total number of pads defined in the map
92 Int_t CalculateNofPads() const;
6d5f608a 93
5f91c9e8 94 private:
95 // methods
f79c58a5 96 void PrintMotif(const AliMpVMotif* motif) const;
97 void PrintMotifType(const AliMpMotifType* motifType) const;
98 void PrintMotifPosition(const AliMpMotifPosition* motifPosition) const;
99 void PrintMotifPosition2(const AliMpMotifPosition* motifPosition) const;
5f91c9e8 100 void PrintMotifs() const;
101 void PrintMotifTypes() const;
102 void PrintMotifPositions() const;
103 void PrintMotifPositions2() const;
5f91c9e8 104
5f91c9e8 105 // data members
829425a5 106 MotifMap fMotifs; ///< motifs map
107 MotifTypeMap fMotifTypes; ///< motifs types map
5006ec94 108#ifdef WITH_STL
829425a5 109 std::map<Int_t, AliMpMotifPosition*> fMotifPositions; ///< motif positions map by Id
f79c58a5 110#endif
f79c58a5 111#ifdef WITH_ROOT
829425a5 112 MotifPositionMap fMotifPositions; ///< motifs positions map
f79c58a5 113#endif
829425a5 114 MotifPositionMap2 fMotifPositions2;///< motifs positions map
5f91c9e8 115
116 ClassDef(AliMpMotifMap,1) // motif map
117};
118
119#endif //ALI_MP_MOTIF_MAP_H