]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGeometryModuleTransformer.h
- AliMUONGeometryStore replaced with AliMpExMap (used as the type
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryModuleTransformer.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 // Revision of includes 07/05/2004
6
7 /// \ingroup geometry
8 /// \class AliMUONGeometryModuleTransformer
9 /// \brief Geometry transformer for a detector module
10 ///
11 /// Class for definition of the trasformation for adetector module
12 /// and its detection elements
13 ///
14 /// \author Ivana Hrivnacova, IPN Orsay
15
16 #ifndef ALI_MUON_GEOMETRY_MODULE_TRANSFORMER_H
17 #define ALI_MUON_GEOMETRY_MODULE_TRANSFORMER_H
18
19 #include <TObject.h>
20 #include <TString.h>
21
22 class AliMUONGeometryDetElement;
23
24 class AliMpExMap;
25
26 class TGeoTranslation;
27 class TGeoRotation;
28 class TGeoHMatrix;
29 class TObjArray;
30 class TArrayI;
31
32 class AliMUONGeometryModuleTransformer : public TObject
33 {
34   public:
35     AliMUONGeometryModuleTransformer(Int_t moduleId);
36     AliMUONGeometryModuleTransformer();
37     virtual ~AliMUONGeometryModuleTransformer();
38
39     // static methods
40     static TString GetModuleNamePrefix();
41
42     // methods
43     void Global2Local(Int_t detElemId,
44                  Float_t xg, Float_t yg, Float_t zg, 
45                  Float_t& xl, Float_t& yl, Float_t& zl) const;
46     void Global2Local(Int_t detElemId,
47                  Double_t xg, Double_t yg, Double_t zg, 
48                  Double_t& xl, Double_t& yl, Double_t& zl) const;
49
50     void Local2Global(Int_t detElemId,
51                  Float_t xl, Float_t yl, Float_t zl, 
52                  Float_t& xg, Float_t& yg, Float_t& zg) const;
53     void Local2Global(Int_t detElemId,
54                  Double_t xl, Double_t yl, Double_t zl, 
55                  Double_t& xg, Double_t& yg, Double_t& zg) const;
56
57     // set methods
58     void  SetTransformation(const TGeoHMatrix& transform);
59     void  SetVolumePath(const TString& volumePath);
60  
61     // get methods
62     Int_t    GetModuleId() const;
63     TString  GetModuleName() const;
64     TString  GetVolumePath() const;
65     TString  GetVolumeName() const;
66     TString  GetMotherVolumeName() const;
67
68     const TGeoHMatrix*  GetTransformation() const;    
69     AliMpExMap*         GetDetElementStore() const; 
70     AliMUONGeometryDetElement*  
71                         GetDetElement(Int_t detElemId, Bool_t warn = true) const;    
72
73   protected:
74     AliMUONGeometryModuleTransformer(const AliMUONGeometryModuleTransformer& rhs);
75     AliMUONGeometryModuleTransformer& 
76       operator = (const AliMUONGeometryModuleTransformer& rhs);
77
78   private:
79     // static data members
80     static const TString  fgkModuleNamePrefix; /// < Geometry module name prefix
81
82     // data members
83     Int_t                 fModuleId;   ///< the module Id
84     TString               fModuleName; ///< the module name
85     TString               fVolumePath; ///< \brief the full path of aligned module volume
86                                        /// or envelope in geometry
87     TGeoHMatrix*          fTransformation;///< \brief the module transformation wrt to top
88                                           /// volume (world)
89     AliMpExMap*           fDetElements;   ///< detection elements
90  
91   ClassDef(AliMUONGeometryModuleTransformer,3) // MUON geometry module class
92 };
93
94 // inline functions
95
96 /// Return module name prefix
97 inline TString 
98 AliMUONGeometryModuleTransformer::GetModuleNamePrefix()
99 { return fgkModuleNamePrefix; }
100
101 /// Set the full path of aligned module volume or envelope in geometry
102 inline void 
103 AliMUONGeometryModuleTransformer::SetVolumePath(const TString& volumePath)
104 { fVolumePath = volumePath; }
105
106 /// Return module ID
107 inline Int_t  
108 AliMUONGeometryModuleTransformer::GetModuleId() const
109 { return fModuleId; }
110
111 /// Return module name
112 inline TString
113 AliMUONGeometryModuleTransformer::GetModuleName() const
114 { return fModuleName; }
115
116 /// Return the full path of aligned module volume or envelope in geometry
117 inline TString 
118 AliMUONGeometryModuleTransformer::GetVolumePath() const
119 { return fVolumePath; }
120
121 /// Return the module transformation wrt to the top volume (world)
122 inline const TGeoHMatrix* 
123 AliMUONGeometryModuleTransformer::GetTransformation() const 
124 { return fTransformation; }
125
126 /// Return detection elements associated with this module
127 inline  AliMpExMap* 
128 AliMUONGeometryModuleTransformer::GetDetElementStore() const
129 { return fDetElements; }
130
131 #endif //ALI_MUON_GEOMETRY_MODULE_TRANSFORMER_H