Line data Source code
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 : AliMUONGeometryDetElement(Int_t detElemId, const TString& volumePath);
25 : AliMUONGeometryDetElement(TRootIOCtor* /*ioCtor*/);
26 : virtual ~AliMUONGeometryDetElement();
27 :
28 : // static methods
29 : static const TString& GetDENamePrefix();
30 : static TString GetDEName(Int_t detElemId);
31 :
32 : // methods
33 : void Global2Local(
34 : Float_t xg, Float_t yg, Float_t zg,
35 : Float_t& xl, Float_t& yl, Float_t& zl) const;
36 : void Global2Local(
37 : Double_t xg, Double_t yg, Double_t zg,
38 : Double_t& xl, Double_t& yl, Double_t& zl) const;
39 :
40 : void Local2Global(
41 : Float_t xl, Float_t yl, Float_t zl,
42 : Float_t& xg, Float_t& yg, Float_t& zg) const;
43 : void Local2Global(
44 : Double_t xl, Double_t yl, Double_t zl,
45 : Double_t& xg, Double_t& yg, Double_t& zg) const;
46 : void PrintLocalTransform() const;
47 : void PrintGlobalTransform() const;
48 :
49 : // set methods
50 : void SetLocalTransformation(const TGeoHMatrix& transform, Bool_t warn = true);
51 : void SetGlobalTransformation(const TGeoHMatrix& transform, Bool_t warn = true);
52 : void SetVolumePath(const TString& volumePath);
53 :
54 : // get methods
55 : Int_t GetId() const;
56 : TString GetDEName() const;
57 : TString GetVolumePath() const;
58 : TString GetVolumeName() const;
59 : Int_t GetVolumeCopyNo() const;
60 : const TGeoHMatrix* GetLocalTransformation() const;
61 : const TGeoHMatrix* GetGlobalTransformation() const;
62 :
63 : protected:
64 : /// Not implemented
65 : AliMUONGeometryDetElement();
66 : /// Not implemented
67 : AliMUONGeometryDetElement(const AliMUONGeometryDetElement& rhs);
68 : /// Not implemented
69 : AliMUONGeometryDetElement& operator = (const AliMUONGeometryDetElement& rhs);
70 :
71 : private:
72 : // methods
73 : void PrintTransform(const TGeoHMatrix* transform) const;
74 :
75 : // data members
76 : TString fDEName; ///< detection element name
77 : TString fVolumePath; ///< \brief the full path of aligned volume
78 : /// or envelope in geometry
79 : TGeoHMatrix* fLocalTransformation; ///< the transformation wrt module
80 : TGeoHMatrix* fGlobalTransformation; ///< the transformation wrt world
81 :
82 7318 : ClassDef(AliMUONGeometryDetElement,2) // MUON det element transformations
83 : };
84 :
85 : // inline functions
86 :
87 : /// Set the full path of the aligned volume or envelope in geometry
88 : inline void AliMUONGeometryDetElement::SetVolumePath(const TString& volumePath)
89 0 : { fVolumePath = volumePath; }
90 :
91 : /// Return detection element ID
92 : inline Int_t AliMUONGeometryDetElement::GetId() const
93 1824 : { return GetUniqueID(); }
94 :
95 : /// Return detection element ID
96 : inline TString AliMUONGeometryDetElement::GetDEName() const
97 0 : { return fDEName; }
98 :
99 : /// Return the full path of the aligned volume or envelope in geometry
100 : inline TString AliMUONGeometryDetElement::GetVolumePath() const
101 456 : { return fVolumePath; }
102 :
103 : /// Return the detection element transformation wrt module
104 : inline const TGeoHMatrix*
105 : AliMUONGeometryDetElement::GetLocalTransformation() const
106 0 : { return fLocalTransformation; }
107 :
108 : /// Return the detection element transformation wrt world
109 : inline const TGeoHMatrix*
110 : AliMUONGeometryDetElement::GetGlobalTransformation() const
111 456 : { return fGlobalTransformation; }
112 :
113 : #endif //ALI_MUON_GEOMETRY_DET_ELEMENT_H
|