]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGeometryDetElement.h
Adding CreateIterator(void) and GetNeighbours() pure virtual methods,
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryDetElement.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
6 /// \ingroup geometry
7 /// \class AliMUONGeometryDetElement
8 /// \brief Class for storing detection element transformations 
9 ///
10 /// \author Ivana Hrivnacova, IPN Orsay
11
12 #ifndef ALI_MUON_GEOMETRY_DET_ELEMENT_H
13 #define ALI_MUON_GEOMETRY_DET_ELEMENT_H
14
15 #include <TObject.h>
16 #include <TString.h>
17
18 class TGeoHMatrix;
19
20 class AliMUONGeometryDetElement : public TObject
21 {
22   public:
23     AliMUONGeometryDetElement(Int_t detElemId,
24                               const TString& volumePath);
25     AliMUONGeometryDetElement();
26     virtual ~AliMUONGeometryDetElement();
27
28     // static methods
29     static TString GetDENamePrefix();
30
31     // methods
32     void Global2Local(
33                  Float_t xg, Float_t yg, Float_t zg, 
34                  Float_t& xl, Float_t& yl, Float_t& zl) const;
35     void Global2Local(
36                  Double_t xg, Double_t yg, Double_t zg, 
37                  Double_t& xl, Double_t& yl, Double_t& zl) const;
38
39     void Local2Global(
40                  Float_t xl, Float_t yl, Float_t zl, 
41                  Float_t& xg, Float_t& yg, Float_t& zg) const;
42     void Local2Global(
43                  Double_t xl, Double_t yl, Double_t zl, 
44                  Double_t& xg, Double_t& yg, Double_t& zg) const;
45     void PrintLocalTransform() const;
46     void PrintGlobalTransform() const;
47
48     // set methods
49     void SetLocalTransformation(const TGeoHMatrix& transform);
50     void SetGlobalTransformation(const TGeoHMatrix& transform);
51     void SetVolumePath(const TString& volumePath);
52     
53     // get methods
54     Int_t    GetId() const;
55     TString  GetDEName() const;
56     TString  GetVolumePath() const;
57     TString  GetVolumeName() const;
58     Int_t    GetVolumeCopyNo() const;
59     const TGeoHMatrix*  GetLocalTransformation() const;
60     const TGeoHMatrix*  GetGlobalTransformation() const;
61
62   protected:
63     AliMUONGeometryDetElement(const AliMUONGeometryDetElement& rhs);
64     AliMUONGeometryDetElement& operator = (const AliMUONGeometryDetElement& rhs);
65   
66   private:
67     // methods
68     void PrintTransform(const TGeoHMatrix* transform) const;
69  
70      // static data members
71     static const TString  fgkDENamePrefix; /// < Geometry module name prefix
72  
73     // data members
74     TString       fDEName;     ///< detection element name
75     TString       fVolumePath; ///< \brief the full path of aligned volume
76                                ///  or envelope in geometry
77     TGeoHMatrix*  fLocalTransformation;  ///< the transformation wrt module
78     TGeoHMatrix*  fGlobalTransformation; ///< the transformation wrt world
79
80   ClassDef(AliMUONGeometryDetElement,2) // MUON det element transformations
81 };
82
83 // inline functions
84
85 /// Return module name prefix
86 inline TString AliMUONGeometryDetElement::GetDENamePrefix()
87 { return fgkDENamePrefix; }
88
89 /// Set the full path of the aligned volume or envelope in geometry
90 inline void AliMUONGeometryDetElement::SetVolumePath(const TString& volumePath)
91 { fVolumePath = volumePath; }
92
93 /// Return detection element ID
94 inline Int_t AliMUONGeometryDetElement::GetId() const
95 { return GetUniqueID(); }
96
97 /// Return detection element ID
98 inline TString AliMUONGeometryDetElement::GetDEName() const
99 { return fDEName; }
100
101 /// Return the full path of the aligned volume or envelope in geometry
102 inline TString AliMUONGeometryDetElement::GetVolumePath() const
103 { return fVolumePath; }
104
105 /// Return the detection element transformation wrt module
106 inline const TGeoHMatrix* 
107 AliMUONGeometryDetElement::GetLocalTransformation() const
108 { return fLocalTransformation; }
109
110 /// Return the detection element transformation wrt world
111 inline const TGeoHMatrix* 
112 AliMUONGeometryDetElement::GetGlobalTransformation() const
113 { return fGlobalTransformation; }
114
115 #endif //ALI_MUON_GEOMETRY_DET_ELEMENT_H