Log for previous commit:
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpReader.h
CommitLineData
5f91c9e8 1// $Id$
2// Category: sector
3//
4// Class AliMpReader
5// -------------------
6// Class that takes care of reading the sector data.
7//
8// Authors: David Guez, Ivana Hrivnacova; IPN Orsay
9
10#ifndef ALI_MP_READER_H
11#define ALI_MP_READER_H
12
13#include <fstream>
14
15#include <TObject.h>
16#include <TString.h>
5f91c9e8 17
f79c58a5 18#include "AliMpSectorTypes.h"
4139354b 19#include "AliMpStationType.h"
5f91c9e8 20#include "AliMpPlaneType.h"
4139354b 21#include "AliMpXDirection.h"
f79c58a5 22#include "AliMpIntPair.h"
5f91c9e8 23
24class AliMpSector;
25class AliMpZone;
26class AliMpSubZone;
27class AliMpRow;
4139354b 28class AliMpVRowSegmentSpecial;
5f91c9e8 29class AliMpVMotif;
30class AliMpMotifSpecial;
31class AliMpMotifType;
32
33class AliMpReader : public TObject
34{
35 public:
4139354b 36 AliMpReader(AliMpStationType station, AliMpPlaneType plane);
5f91c9e8 37 AliMpReader();
38 virtual ~AliMpReader();
39
40 // methods
41 AliMpSector* BuildSector();
4139354b 42 AliMpMotifType* BuildMotifType(const TString& motifTypeId);
43 AliMpMotifSpecial* BuildMotifSpecial(const TString& motifID,
5f91c9e8 44 AliMpMotifType* motifType);
45
46 // set methods
47 void SetVerboseLevel(Int_t verboseLevel);
48
fb1bf5c0 49 protected:
50 AliMpReader(const AliMpReader& right);
51 AliMpReader& operator = (const AliMpReader& right);
52
5f91c9e8 53 private:
f79c58a5 54#ifdef WITH_ROOT
55 static const Int_t fgkSeparator; // the separator used for conversion
56 // of string to Int_t
57
58 // methods
ec094451 59 Int_t GetIndex(const string& s) const;
f79c58a5 60 Int_t GetIndex(const AliMpIntPair& pair) const;
ec094451 61 string GetString(Int_t index) const;
f79c58a5 62 AliMpIntPair GetPair(Int_t index) const;
63#endif
64
5f91c9e8 65 // methods
66 void ReadSectorData(ifstream& in);
67 void ReadZoneData(ifstream& in);
68 void ReadSubZoneData(ifstream& in, AliMpZone* zone);
69 void ReadRowSegmentsData(ifstream& in,
70 AliMpZone* zone, AliMpSubZone* subZone);
71 AliMpVMotif* ReadMotifData(ifstream& in, AliMpZone* zone);
4139354b 72 void ReadSectorSpecialData(ifstream& in, AliMpXDirection direction);
5f91c9e8 73 void ReadMotifsSpecialData(ifstream& in);
4139354b 74 void ReadRowSpecialData(ifstream& in, AliMpXDirection direction);
5f91c9e8 75 void ReadRowSegmentSpecialData(ifstream& in,
4139354b 76 AliMpVRowSegmentSpecial* segment,
77 AliMpXDirection direction);
5f91c9e8 78
79 // static data members
4139354b 80 static const TString fgkSectorKeyword; // sector keyword
81 static const TString fgkZoneKeyword; // zone keyword
82 static const TString fgkSubZoneKeyword; // subzone keyword
83 static const TString fgkRowKeyword; // row keyword
84 static const TString fgkEofKeyword; // eof keyword
85 static const TString fgkSectorSpecialKeyword; // sector special keyword
86 static const TString fgkMotifKeyword; // motif keyword
87 static const TString fgkRowSpecialKeyword; // row special keyword
88 static const TString fgkPadRowsKeyword; // pad rows keyword
89 static const TString fgkPadRowSegmentKeyword; // pad row segment keyword
5f91c9e8 90
4139354b 91 // data members
92 AliMpStationType fStationType; // station type
93 AliMpPlaneType fPlaneType; // plane type
94 AliMpSector* fSector; // sector
95 Int_t fVerboseLevel;// verbose level
5f91c9e8 96
97 ClassDef(AliMpReader,1) // Data reader
98};
99
100#endif //ALI_MP_READER_H