]>
Commit | Line | Data |
---|---|---|
d4bb94a1 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
4 | // $Id$ | |
692de412 | 5 | |
6 | /// \ingroup geometry | |
7 | /// \class AliMUONGeometryBuilder | |
8 | /// \brief Manager class for geometry construction via geometry builders. | |
9 | /// | |
10 | /// Author: Ivana Hrivnacova, IPN Orsay | |
d4bb94a1 | 11 | |
e118b27e | 12 | #ifndef ALI_MUON_GEOMETRY_BUILDER_H |
13 | #define ALI_MUON_GEOMETRY_BUILDER_H | |
14 | ||
d4bb94a1 | 15 | #include <TObject.h> |
e118b27e | 16 | #include <TGeoMatrix.h> |
d4bb94a1 | 17 | |
9a6c488e | 18 | #include "AliMUONGeometry.h" |
19 | ||
d4bb94a1 | 20 | class TObjArray; |
21 | ||
e118b27e | 22 | class AliModule; |
d4bb94a1 | 23 | class AliMUONVGeometryBuilder; |
24 | ||
25 | class AliMUONGeometryBuilder : public TObject | |
26 | { | |
27 | public: | |
e118b27e | 28 | AliMUONGeometryBuilder(AliModule* detector); |
d4bb94a1 | 29 | AliMUONGeometryBuilder(); |
d4bb94a1 | 30 | virtual ~AliMUONGeometryBuilder(); |
067866a3 | 31 | |
32 | // static methods | |
33 | static TGeoHMatrix Multiply(const TGeoMatrix& m1, const TGeoMatrix& m2); | |
34 | static TGeoHMatrix Multiply(const TGeoMatrix& m1, const TGeoMatrix& m2, | |
35 | const TGeoMatrix& m3); | |
36 | static TGeoHMatrix Multiply(const TGeoMatrix& m1, const TGeoMatrix& m2, | |
37 | const TGeoMatrix& m3, const TGeoMatrix& m4); | |
d4bb94a1 | 38 | |
e118b27e | 39 | // methods |
eea63c73 | 40 | // |
e118b27e | 41 | void AddBuilder(AliMUONVGeometryBuilder* geomBuilder); |
d4bb94a1 | 42 | void CreateGeometry(); |
43 | void CreateMaterials(); | |
eea63c73 | 44 | |
45 | void InitGeometry(); | |
46 | void InitGeometry(const TString& svmapFileName); | |
47 | ||
48 | void ReadTransformations(); | |
49 | void ReadTransformations(const TString& fileName); | |
50 | ||
51 | void WriteTransformations(); | |
52 | void WriteTransformations(const TString& fileName); | |
53 | ||
54 | void WriteSVMaps(); | |
55 | void WriteSVMaps(const TString& fileName, Bool_t rebuild = true); | |
9a6c488e | 56 | |
57 | // Geometry parametrisation | |
58 | const AliMUONGeometry* GetGeometry() const; | |
59 | const AliMUONGeometryTransformer* GetTransformer() const; | |
76497dec | 60 | |
61 | // Alignement | |
62 | virtual Bool_t GetAlign() const; | |
eea63c73 | 63 | virtual void SetAlign(Bool_t align = true); |
64 | virtual void SetAlign(const TString& fileName, Bool_t align = true); | |
d4bb94a1 | 65 | |
d4bb94a1 | 66 | protected: |
67 | AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right); | |
68 | AliMUONGeometryBuilder& operator = (const AliMUONGeometryBuilder& right); | |
69 | ||
70 | private: | |
71 | // method | |
72 | void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo, | |
73 | const TGeoHMatrix& matrix, Int_t npar, Double_t* param, | |
74 | const char* only) const; | |
8618c022 | 75 | void SetAlign(AliMUONVGeometryBuilder* builder); |
d4bb94a1 | 76 | |
eea63c73 | 77 | // static data members |
78 | static const TString fgkDefaultTransformFileName; // default transformations file name | |
79 | static const TString fgkDefaultSVMapFileName; // default svmaps file name | |
80 | static const TString fgkOutFileNameExtension; // default output file name extension | |
81 | ||
d4bb94a1 | 82 | // data members |
9a6c488e | 83 | AliModule* fModule; // the AliRoot module |
84 | Bool_t fAlign; // option to read transformations | |
85 | // from a file | |
eea63c73 | 86 | TString fTransformFileName; // transformations file name |
87 | TString fSVMapFileName; // svmaps file name | |
9a6c488e | 88 | TGeoCombiTrans fGlobalTransformation;// global transformation |
89 | // applied to the whole geometry | |
90 | TObjArray* fGeometryBuilders; // list of Geometry Builders | |
91 | AliMUONGeometry* fGeometry; // geometry parametrisation | |
d4bb94a1 | 92 | |
394d8216 | 93 | ClassDef(AliMUONGeometryBuilder,5) // Geometry builder |
d4bb94a1 | 94 | }; |
95 | ||
76497dec | 96 | // inline functions |
97 | ||
eea63c73 | 98 | inline void AliMUONGeometryBuilder::InitGeometry() |
99 | { InitGeometry(fSVMapFileName); } | |
100 | ||
101 | inline void AliMUONGeometryBuilder::ReadTransformations() | |
102 | { ReadTransformations(fTransformFileName); } | |
103 | ||
104 | inline void AliMUONGeometryBuilder::WriteTransformations() | |
105 | { WriteTransformations(fTransformFileName + fgkOutFileNameExtension); } | |
106 | ||
107 | inline void AliMUONGeometryBuilder::WriteSVMaps() | |
108 | { WriteSVMaps(fSVMapFileName + fgkOutFileNameExtension); } | |
109 | ||
9a6c488e | 110 | inline |
111 | const AliMUONGeometry* AliMUONGeometryBuilder::GetGeometry() const | |
112 | { return fGeometry; } | |
113 | ||
114 | inline | |
115 | const AliMUONGeometryTransformer* AliMUONGeometryBuilder::GetTransformer() const | |
116 | { return fGeometry->GetTransformer(); } | |
117 | ||
76497dec | 118 | inline Bool_t AliMUONGeometryBuilder::GetAlign() const |
119 | { return fAlign; } | |
120 | ||
d4bb94a1 | 121 | #endif //ALI_MUON_GEOMETRY_BUILDER_H |
122 | ||
123 | ||
124 | ||
125 | ||
126 | ||
127 | ||
128 |