Removing useless ifs
[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$
5006ec94 5// $MpId: AliMpMotifMap.h,v 1.9 2005/09/26 16:10:46 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
35class TString;
36class TVector2;
5f91c9e8 37
38class AliMpVMotif;
39class AliMpMotifType;
40class AliMpMotifPosition;
ffb47139 41class AliMpMotifMap;
5f91c9e8 42
43class AliMpMotifMap : public TObject
44{
45 public:
5006ec94 46#ifdef WITH_STL
47 typedef std::map<TString, AliMpVMotif*> MotifMap;
48 typedef MotifMap::const_iterator MotifMapIterator;
49 typedef std::map<TString, AliMpMotifType*> MotifTypeMap;
50 typedef MotifTypeMap::const_iterator MotifTypeMapIterator;
51 typedef std::map<Int_t, AliMpMotifPosition*> MotiPositionMap;
52 typedef MotiPositionMap::const_iterator MotifPositionMapIterator;
53 typedef std::map<AliMpIntPair, AliMpMotifPosition*> MotifPositionMap2;
54 typedef MotifPositionMap2::const_iterator MotifPositionMap2Iterator;
55#endif
56#ifdef WITH_ROOT
57 typedef AliMpExMap MotifMap;
58 typedef AliMpExMap MotifTypeMap;
59 typedef AliMpExMap MotifPositionMap;
60 typedef AliMpExMap MotifPositionMap2;
61#endif
62
63 public:
64 AliMpMotifMap(Bool_t /*standardConstructor*/);
5f91c9e8 65 AliMpMotifMap();
66 virtual ~AliMpMotifMap();
67
68 // methods
69 Bool_t AddMotif(AliMpVMotif* motif, Bool_t warn = true);
70 Bool_t AddMotifType(AliMpMotifType* motifType, Bool_t warn = true);
71 Bool_t AddMotifPosition(AliMpMotifPosition* motifType, Bool_t warn = true);
72 void FillMotifPositionMap2();
ffb47139 73 virtual void Print(const char* /*option*/ = "") const;
5f91c9e8 74 void PrintGlobalIndices(const char* fileName) const;
75 void UpdateGlobalIndices(const char* fileName);
76
77 // find methods
78 AliMpVMotif* FindMotif(const TString& motifID) const;
79 AliMpVMotif* FindMotif(const TString& motifID, const TString& motifTypeID,
ffb47139 80 const TVector2& padDimensions) const;
5f91c9e8 81 AliMpMotifType* FindMotifType(const TString& motifTypeID) const;
82 AliMpMotifPosition* FindMotifPosition(Int_t motifPositionID) const;
f79c58a5 83 // AliMpMotifPosition* FindMotifPosition(const AliMpIntPair& indices) const;
5f91c9e8 84
85 private:
86 // methods
f79c58a5 87 void PrintMotif(const AliMpVMotif* motif) const;
88 void PrintMotifType(const AliMpMotifType* motifType) const;
89 void PrintMotifPosition(const AliMpMotifPosition* motifPosition) const;
90 void PrintMotifPosition2(const AliMpMotifPosition* motifPosition) const;
5f91c9e8 91 void PrintMotifs() const;
92 void PrintMotifTypes() const;
93 void PrintMotifPositions() const;
94 void PrintMotifPositions2() const;
5f91c9e8 95
5f91c9e8 96 // data members
5006ec94 97 MotifMap fMotifs; // motifs map
98 MotifTypeMap fMotifTypes; // motifs types map
99#ifdef WITH_STL
5f91c9e8 100 std::map<Int_t, AliMpMotifPosition*> fMotifPositions; // motif positions map by Id
f79c58a5 101#endif
f79c58a5 102#ifdef WITH_ROOT
5006ec94 103 MotifPositionMap fMotifPositions; // motifs positions map
f79c58a5 104#endif
5006ec94 105 MotifPositionMap2 fMotifPositions2;// motifs positions map
5f91c9e8 106
107 ClassDef(AliMpMotifMap,1) // motif map
108};
109
110#endif //ALI_MP_MOTIF_MAP_H