]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpTriggerReader.h
New class - the factory for building mapping segmentations
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpTriggerReader.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5 // $MpId$
6
7 /// \ingroup slat
8 /// \class AliMpTriggerReader
9 /// \brief Read trigger slat ASCII files
10 /// 
11 /// Author: Laurent Aphecetche
12
13 #ifndef ALI_MP_TRIGGER_READER_H
14 #define ALI_MP_TRIGGER_READER_H
15
16 #ifndef ROOT_TObject
17 #  include "TObject.h"
18 #endif
19
20 #ifndef ROOT_TMap
21 #  include "TMap.h"
22 #endif
23
24 #ifndef ROOT_TString
25 #  include "TString.h"
26 #endif
27
28 #ifndef ALI_MP_PLANE_TYPE_H
29 #  include "AliMpPlaneType.h"
30 #endif
31
32 #ifndef ALI_MP_STATION_TYPE_H
33 #  include "AliMpStationType.h"
34 #endif
35
36 class AliMpSlat;
37 class AliMpTrigger;
38 class AliMpPCB;
39 class TList;
40
41 class AliMpTriggerReader : public TObject
42 {
43  public:
44   AliMpTriggerReader();
45   virtual ~AliMpTriggerReader();
46
47   static AliMpTrigger* ReadSlat(const char* slatType, AliMpPlaneType planeType);
48
49   static AliMpPCB* ReadPCB(const char* pcbType);
50   
51   static void Reset();
52   
53 //private:
54     
55   static AliMpSlat* BuildSlat(const char* slatName, 
56                               AliMpPlaneType planeType,
57                               const TList& descriptionLines,
58                               Double_t scale=1.0);
59   
60   static Int_t DecodeFlipLine(const TString& sline,
61                               TString& slatType2,
62                               Bool_t& flipX, Bool_t& flipY);
63   
64   static Int_t DecodeScaleLine(const TString& sline, 
65                                Double_t& scale, TString& slatType);
66   
67   static void FlipLines(TList& lines, Bool_t flipX, Bool_t flipY, 
68                         Int_t srcLine, Int_t destLine);
69   
70   static TString GetBoardNameFromPCBLine(const TString&);
71   
72   static Int_t GetLine(const TString& slatType);
73   
74   static Int_t IsLayerLine(const TString& sline);
75     
76   static int LocalBoardNumber(const char* localBoardName);
77   
78   static AliMpPCB* PCB(const char* pcbType); 
79   
80   static void ReadLines(const char* slatType,
81                         AliMpPlaneType planeType,
82                         TList& lines,
83                         Double_t& scale, Bool_t& flipX, Bool_t& flipY,
84                         Int_t& srcLine, Int_t& destLine);
85   
86   static void ReadLocalBoardMapping();
87   
88 private:
89     
90   static TMap fgPCBMap; //! map of TObjString to AliMpPCB*
91   
92   static TMap fgLocalBoardMap; //! map of TObjString to TObjString
93   
94   ClassDef(AliMpTriggerReader,1) // Reader for trigger slats mapping files 
95 };
96
97 #endif