]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpTriggerReader.h
Fix coverity defect
[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: AliMpTriggerReader.h,v 1.5 2006/05/24 13:58:27 ivana Exp $
6
7 /// \ingroup mptrigger
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 class AliMpSlatMotifMap;
33 class AliMpSlat;
34 class AliMpTrigger;
35 class AliMpPCB;
36 class AliMpDataStreams;
37
38 class TList;
39
40 class AliMpTriggerReader : public TObject
41 {
42  public:
43   AliMpTriggerReader(const AliMpDataStreams& dataStreams, AliMpSlatMotifMap* motifMap);
44   virtual ~AliMpTriggerReader();
45
46   AliMpTrigger* ReadSlat(const char* slatType, AliMp::PlaneType planeType);
47
48   AliMpPCB* ReadPCB(const char* pcbType);
49   
50 private:
51     
52   AliMpSlat* BuildSlat(const char* slatName, 
53                               AliMp::PlaneType planeType,
54                               const TList& descriptionLines,
55                               Double_t scale=1.0);
56   
57   Int_t DecodeFlipLine(const TString& sline,
58                               TString& slatType2,
59                               Bool_t& flipX, Bool_t& flipY);
60   
61   Int_t DecodeScaleLine(const TString& sline, 
62                                Double_t& scale, TString& slatType);
63   
64   void FlipLines(TList& lines, Bool_t flipX, Bool_t flipY, 
65                         Int_t srcLine, Int_t destLine);
66   
67   TString GetBoardNameFromPCBLine(const TString& sline);
68   
69   Int_t GetLine(const TString& slatType);
70   
71   Int_t IsLayerLine(const TString& sline) const;
72     
73   int LocalBoardNumber(const char* localBoardName);
74   
75   // AliMpPCB* PCB(const char* pcbType); 
76   
77   void ReadLines(const char* slatType,
78                         AliMp::PlaneType planeType,
79                         TList& lines,
80                         Double_t& scale, Bool_t& flipX, Bool_t& flipY,
81                         Int_t& srcLine, Int_t& destLine);
82   
83   void ReadLocalBoardMapping();
84   
85 private:
86   /// Not implemented
87   AliMpTriggerReader(const AliMpTriggerReader& rhs);
88   /// Not implemented
89   AliMpTriggerReader& operator=(const AliMpTriggerReader& rhs);
90     
91   // static methods
92   static const TString& GetKeywordLayer();
93   static const TString& GetKeywordScale();
94   static const TString& GetKeywordPcb();
95   static const TString& GetKeywordFlipX();
96   static const TString& GetKeywordFlipY();
97   
98   // data members
99   const AliMpDataStreams&  fkDataStreams; //!< data streams
100   AliMpSlatMotifMap* fMotifMap; //!< storage for motifTypes and motifs...
101   
102   TMap fLocalBoardMap; //!< map of TObjString to TObjString
103
104   ClassDef(AliMpTriggerReader,0) // Reader for trigger slats mapping files 
105 };
106
107 #endif