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