New macro to keep track of timing performances of the segmentation methods (Laurent)
[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>
a70d5d20 36#include <iterator>
2a7ea2e6 37#endif
5f91c9e8 38
39class AliMpVMotif;
40class AliMpMotifType;
41class AliMpMotifPosition;
ffb47139 42class AliMpMotifMap;
5f91c9e8 43
2a7ea2e6 44class TArrayI;
45class TString;
46class TVector2;
47
5f91c9e8 48class AliMpMotifMap : public TObject
49{
50 public:
5006ec94 51#ifdef WITH_STL
f5671fc3 52 /// Motif map type
5006ec94 53 typedef std::map<TString, AliMpVMotif*> MotifMap;
f5671fc3 54 /// Motif map iterator type
5006ec94 55 typedef MotifMap::const_iterator MotifMapIterator;
f5671fc3 56 /// Motif type map type
5006ec94 57 typedef std::map<TString, AliMpMotifType*> MotifTypeMap;
f5671fc3 58 /// Motif type map iterator type
5006ec94 59 typedef MotifTypeMap::const_iterator MotifTypeMapIterator;
f5671fc3 60 /// Motif position map to int type
5006ec94 61 typedef std::map<Int_t, AliMpMotifPosition*> MotiPositionMap;
f5671fc3 62 /// Motif position map to int iterator type
5006ec94 63 typedef MotiPositionMap::const_iterator MotifPositionMapIterator;
f5671fc3 64 /// Motif position map to int pair type
5006ec94 65 typedef std::map<AliMpIntPair, AliMpMotifPosition*> MotifPositionMap2;
f5671fc3 66 /// Motif position map to int pair iterator type
5006ec94 67 typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator;
68#endif
69#ifdef WITH_ROOT
f5671fc3 70 /// Motif map type
5006ec94 71 typedef AliMpExMap MotifMap;
f5671fc3 72 /// Motif type map type
5006ec94 73 typedef AliMpExMap MotifTypeMap;
f5671fc3 74 /// Motif position map to int type
5006ec94 75 typedef AliMpExMap MotifPositionMap;
f5671fc3 76 /// Motif position map to int pair iterator type
5006ec94 77 typedef AliMpExMap MotifPositionMap2;
78#endif
79
80 public:
5f91c9e8 81 AliMpMotifMap();
630711ed 82 AliMpMotifMap(TRootIOCtor* ioCtor);
5f91c9e8 83 virtual ~AliMpMotifMap();
84
85 // methods
86 Bool_t AddMotif(AliMpVMotif* motif, Bool_t warn = true);
87 Bool_t AddMotifType(AliMpMotifType* motifType, Bool_t warn = true);
88 Bool_t AddMotifPosition(AliMpMotifPosition* motifType, Bool_t warn = true);
89 void FillMotifPositionMap2();
6d5f608a 90 virtual void Print(const char* option = "ALL") const;
5f91c9e8 91 void PrintGlobalIndices(const char* fileName) const;
92 void UpdateGlobalIndices(const char* fileName);
93
94 // find methods
95 AliMpVMotif* FindMotif(const TString& motifID) const;
96 AliMpVMotif* FindMotif(const TString& motifID, const TString& motifTypeID,
ffb47139 97 const TVector2& padDimensions) const;
5f91c9e8 98 AliMpMotifType* FindMotifType(const TString& motifTypeID) const;
99 AliMpMotifPosition* FindMotifPosition(Int_t motifPositionID) const;
5f91c9e8 100
6d5f608a 101 /// Find all motifPositionsIDs (=electronicCardNumbers) handled by this map
a70d5d20 102 void GetAllMotifPositionsIDs(TArrayI& enc) const;
103 UInt_t GetNofMotifPositions() const;
104 AliMpMotifPosition* GetMotifPosition(UInt_t index) const;
3283cfc7 105
106 /// Calculate total number of pads defined in the map
107 Int_t CalculateNofPads() const;
6d5f608a 108
5f91c9e8 109 private:
7d5d0cc5 110 /// Not implemented
111 AliMpMotifMap(const AliMpMotifMap& rhs);
112 /// Not implemented
113 AliMpMotifMap& operator=(const AliMpMotifMap& rhs);
114
5f91c9e8 115 // methods
f79c58a5 116 void PrintMotif(const AliMpVMotif* motif) const;
117 void PrintMotifType(const AliMpMotifType* motifType) const;
118 void PrintMotifPosition(const AliMpMotifPosition* motifPosition) const;
119 void PrintMotifPosition2(const AliMpMotifPosition* motifPosition) const;
5f91c9e8 120 void PrintMotifs() const;
121 void PrintMotifTypes() const;
122 void PrintMotifPositions() const;
123 void PrintMotifPositions2() const;
5f91c9e8 124
5f91c9e8 125 // data members
829425a5 126 MotifMap fMotifs; ///< motifs map
127 MotifTypeMap fMotifTypes; ///< motifs types map
5006ec94 128#ifdef WITH_STL
829425a5 129 std::map<Int_t, AliMpMotifPosition*> fMotifPositions; ///< motif positions map by Id
f79c58a5 130#endif
f79c58a5 131#ifdef WITH_ROOT
829425a5 132 MotifPositionMap fMotifPositions; ///< motifs positions map
f79c58a5 133#endif
829425a5 134 MotifPositionMap2 fMotifPositions2;///< motifs positions map
5f91c9e8 135
136 ClassDef(AliMpMotifMap,1) // motif map
137};
138
139#endif //ALI_MP_MOTIF_MAP_H