1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
7 /// \class AliMUONGeometryTransformer
8 /// \brief Top container class for geometry transformations
10 /// Author: Ivana Hrivnacova, IPN Orsay
12 #ifndef ALI_MUON_GEOMETRY_TRANSFORMER_H
13 #define ALI_MUON_GEOMETRY_TRANSFORMER_H
16 #include <TObjArray.h>
17 #include <TGeoMatrix.h>
19 class AliMUONGeometryModuleTransformer;
21 class AliMUONGeometryTransformer : public TObject
24 AliMUONGeometryTransformer(Bool_t isOwner);
25 AliMUONGeometryTransformer();
26 virtual ~AliMUONGeometryTransformer();
29 void AddModuleTransformer(AliMUONGeometryModuleTransformer* transformer);
32 Bool_t ReadTransformations(const TString& fileName);
33 Bool_t WriteTransformations(const TString& fileName) const;
35 // transformation methods
36 void Global2Local(Int_t detElemId,
37 Float_t xg, Float_t yg, Float_t zg,
38 Float_t& xl, Float_t& yl, Float_t& zl) const;
39 void Global2Local(Int_t detElemId,
40 Double_t xg, Double_t yg, Double_t zg,
41 Double_t& xl, Double_t& yl, Double_t& zl) const;
43 void Local2Global(Int_t detElemId,
44 Float_t xl, Float_t yl, Float_t zl,
45 Float_t& xg, Float_t& yg, Float_t& zg) const;
46 void Local2Global(Int_t detElemId,
47 Double_t xl, Double_t yl, Double_t zl,
48 Double_t& xg, Double_t& yg, Double_t& zg) const;
51 Int_t GetNofModuleTransformers() const;
52 const AliMUONGeometryModuleTransformer* GetModuleTransformer(
53 Int_t index, Bool_t warn = true) const;
55 const AliMUONGeometryModuleTransformer* GetModuleTransformerByDEId(
56 Int_t detElemId, Bool_t warn = true) const;
58 Bool_t HasDE(Int_t detElemId) const;
61 AliMUONGeometryTransformer(const AliMUONGeometryTransformer& right);
62 AliMUONGeometryTransformer& operator = (const AliMUONGeometryTransformer& right);
66 AliMUONGeometryModuleTransformer* GetModuleTransformerNonConst(
67 Int_t index, Bool_t warn = true) const;
68 TString ComposePath(const TString& volName, Int_t copyNo) const;
70 TGeoHMatrix GetTransform(
71 Double_t x, Double_t y, Double_t z,
72 Double_t a1, Double_t a2, Double_t a3,
73 Double_t a4, Double_t a5, Double_t a6) const;
74 void FillData(Int_t moduleId,
75 Double_t x, Double_t y, Double_t z,
76 Double_t a1, Double_t a2, Double_t a3,
77 Double_t a4, Double_t a5, Double_t a6);
78 void FillData(Int_t id, const TString& volName, Int_t copyNo,
79 Double_t x, Double_t y, Double_t z,
80 Double_t a1, Double_t a2, Double_t a3,
81 Double_t a4, Double_t a5, Double_t a6);
83 TString ReadData1(ifstream& in);
84 TString ReadData2(ifstream& in);
86 void WriteTransform(ofstream& out, const TGeoCombiTrans* transform) const;
87 void WriteData1(ofstream& out) const;
88 void WriteData2(ofstream& out) const;
91 TObjArray* fModuleTransformers; // list of module transformers
93 ClassDef(AliMUONGeometryTransformer,1) // Geometry parametrisation
97 inline Int_t AliMUONGeometryTransformer::GetNofModuleTransformers() const
98 { return fModuleTransformers->GetEntriesFast(); }
100 #endif //ALI_MUON_GEOMETRY_TRANSFORMER_H