]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGeometryModuleTransformer.h
Added class to read reconstruction parameters from OCDB (Yuri)
[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 transformation for a detector 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     /// Not implemented
75     AliMUONGeometryModuleTransformer(const AliMUONGeometryModuleTransformer& rhs);
76     /// Not implemented
77     AliMUONGeometryModuleTransformer& 
78       operator = (const AliMUONGeometryModuleTransformer& rhs);
79
80   private:
81     // static data members
82     static const TString  fgkModuleNamePrefix; ///< Geometry module name prefix
83
84     // data members
85     Int_t                 fModuleId;   ///< the module Id
86     TString               fModuleName; ///< the module name
87     TString               fVolumePath; ///< \brief the full path of aligned module volume
88                                        /// or envelope in geometry
89     TGeoHMatrix*          fTransformation;///< \brief the module transformation wrt to top
90                                           /// volume (world)
91     AliMpExMap*           fDetElements;   ///< detection elements
92  
93   ClassDef(AliMUONGeometryModuleTransformer,3) // MUON geometry module class
94 };
95
96 // inline functions
97
98 /// Return module name prefix
99 inline TString 
100 AliMUONGeometryModuleTransformer::GetModuleNamePrefix()
101 { return fgkModuleNamePrefix; }
102
103 /// Set the full path of aligned module volume or envelope in geometry
104 inline void 
105 AliMUONGeometryModuleTransformer::SetVolumePath(const TString& volumePath)
106 { fVolumePath = volumePath; }
107
108 /// Return module ID
109 inline Int_t  
110 AliMUONGeometryModuleTransformer::GetModuleId() const
111 { return fModuleId; }
112
113 /// Return module name
114 inline TString
115 AliMUONGeometryModuleTransformer::GetModuleName() const
116 { return fModuleName; }
117
118 /// Return the full path of aligned module volume or envelope in geometry
119 inline TString 
120 AliMUONGeometryModuleTransformer::GetVolumePath() const
121 { return fVolumePath; }
122
123 /// Return the module transformation wrt to the top volume (world)
124 inline const TGeoHMatrix* 
125 AliMUONGeometryModuleTransformer::GetTransformation() const 
126 { return fTransformation; }
127
128 /// Return detection elements associated with this module
129 inline  AliMpExMap* 
130 AliMUONGeometryModuleTransformer::GetDetElementStore() const
131 { return fDetElements; }
132
133 #endif //ALI_MUON_GEOMETRY_MODULE_TRANSFORMER_H