]>
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 | /// | |
a9aad96e | 10 | /// \author Ivana Hrivnacova, IPN Orsay |
d4bb94a1 | 11 | |
e118b27e | 12 | #ifndef ALI_MUON_GEOMETRY_BUILDER_H |
13 | #define ALI_MUON_GEOMETRY_BUILDER_H | |
14 | ||
beec1d7e | 15 | #include "AliMUONGeometry.h" |
16 | ||
d4bb94a1 | 17 | #include <TObject.h> |
e118b27e | 18 | #include <TGeoMatrix.h> |
d4bb94a1 | 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 | ||
eea63c73 | 48 | void WriteSVMaps(); |
49 | void WriteSVMaps(const TString& fileName, Bool_t rebuild = true); | |
9a6c488e | 50 | |
51 | // Geometry parametrisation | |
52 | const AliMUONGeometry* GetGeometry() const; | |
53 | const AliMUONGeometryTransformer* GetTransformer() const; | |
76497dec | 54 | |
55 | // Alignement | |
56 | virtual Bool_t GetAlign() const; | |
eea63c73 | 57 | virtual void SetAlign(Bool_t align = true); |
58 | virtual void SetAlign(const TString& fileName, Bool_t align = true); | |
d4bb94a1 | 59 | |
d4bb94a1 | 60 | protected: |
61 | AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right); | |
62 | AliMUONGeometryBuilder& operator = (const AliMUONGeometryBuilder& right); | |
63 | ||
64 | private: | |
65 | // method | |
66 | void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo, | |
67 | const TGeoHMatrix& matrix, Int_t npar, Double_t* param, | |
beec1d7e | 68 | const char* only, Bool_t makeAssembly = false) const; |
69 | void CreateGeometryWithTGeo(); | |
70 | void CreateGeometryWithoutTGeo(); | |
8618c022 | 71 | void SetAlign(AliMUONVGeometryBuilder* builder); |
d4bb94a1 | 72 | |
eea63c73 | 73 | // static data members |
829425a5 | 74 | static const TString fgkDefaultVolPathsFileName; ///< default volume paths file name |
75 | static const TString fgkDefaultTransformFileName; ///< default transformations file name | |
76 | static const TString fgkDefaultSVMapFileName; ///< default svmaps file name | |
77 | static const TString fgkOutFileNameExtension; ///< default output file name extension | |
eea63c73 | 78 | |
d4bb94a1 | 79 | // data members |
829425a5 | 80 | AliModule* fModule; ///< the AliRoot module |
81 | Bool_t fAlign; ///< \brief option to read transformations | |
82 | /// from a file | |
83 | TString fTransformFileName; ///< transformations file name | |
84 | TString fSVMapFileName; ///< svmaps file name | |
85 | TGeoCombiTrans fGlobalTransformation;///< \brief global transformation | |
86 | /// applied to the whole geometry | |
87 | TObjArray* fGeometryBuilders; ///< list of Geometry Builders | |
88 | AliMUONGeometry* fGeometry; ///< geometry parametrisation | |
d4bb94a1 | 89 | |
beec1d7e | 90 | ClassDef(AliMUONGeometryBuilder,6) // Geometry builder |
d4bb94a1 | 91 | }; |
92 | ||
76497dec | 93 | // inline functions |
94 | ||
a9aad96e | 95 | /// Initialize geometry |
eea63c73 | 96 | inline void AliMUONGeometryBuilder::InitGeometry() |
97 | { InitGeometry(fSVMapFileName); } | |
98 | ||
a9aad96e | 99 | /// Write sensitive volume maps |
eea63c73 | 100 | inline void AliMUONGeometryBuilder::WriteSVMaps() |
101 | { WriteSVMaps(fSVMapFileName + fgkOutFileNameExtension); } | |
102 | ||
a9aad96e | 103 | /// Return geometry parametrisation |
9a6c488e | 104 | inline |
105 | const AliMUONGeometry* AliMUONGeometryBuilder::GetGeometry() const | |
106 | { return fGeometry; } | |
107 | ||
a9aad96e | 108 | /// Return geometry transformer |
9a6c488e | 109 | inline |
110 | const AliMUONGeometryTransformer* AliMUONGeometryBuilder::GetTransformer() const | |
111 | { return fGeometry->GetTransformer(); } | |
112 | ||
a9aad96e | 113 | /// Return option for reading transformations from a file |
76497dec | 114 | inline Bool_t AliMUONGeometryBuilder::GetAlign() const |
115 | { return fAlign; } | |
116 | ||
d4bb94a1 | 117 | #endif //ALI_MUON_GEOMETRY_BUILDER_H |
118 | ||
119 | ||
120 | ||
121 | ||
122 | ||
123 | ||
124 |