1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
7 /// \class AliMUONGeometryBuilder
8 /// \brief Manager class for geometry construction via geometry builders.
10 /// \author Ivana Hrivnacova, IPN Orsay
12 #ifndef ALI_MUON_GEOMETRY_BUILDER_H
13 #define ALI_MUON_GEOMETRY_BUILDER_H
15 #include "AliMUONGeometry.h"
18 #include <TGeoMatrix.h>
23 class AliMUONVGeometryBuilder;
25 class AliMUONGeometryBuilder : public TObject
28 AliMUONGeometryBuilder(AliModule* detector);
29 AliMUONGeometryBuilder();
30 virtual ~AliMUONGeometryBuilder();
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);
41 void AddBuilder(AliMUONVGeometryBuilder* geomBuilder);
42 void CreateGeometry();
43 void CreateMaterials();
46 void InitGeometry(const TString& svmapFileName);
47 void UpdateInternalGeometry();
50 void WriteSVMaps(const TString& fileName,
51 Bool_t rebuild = true, Bool_t writeEnvelopes = true);
53 // Geometry parametrisation
54 const AliMUONGeometry* GetGeometry() const;
55 const AliMUONGeometryTransformer* GetTransformer() const;
58 virtual Bool_t GetAlign() const;
59 virtual void SetAlign(Bool_t align = true);
60 virtual void SetAlign(const TString& fileName, Bool_t align = true);
64 AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right);
66 AliMUONGeometryBuilder& operator = (const AliMUONGeometryBuilder& right);
70 void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo,
71 const TGeoHMatrix& matrix, Int_t npar, Double_t* param,
72 const char* only, Bool_t makeAssembly = false) const;
73 void CreateGeometryWithTGeo();
74 void CreateGeometryWithoutTGeo();
75 void SetAlign(AliMUONVGeometryBuilder* builder);
77 // static data members
78 static const TString fgkDefaultVolPathsFileName; ///< default volume paths file name
79 static const TString fgkDefaultTransformFileName; ///< default transformations file name
80 static const TString fgkDefaultSVMapFileName; ///< default svmaps file name
81 static const TString fgkOutFileNameExtension; ///< default output file name extension
84 AliModule* fModule; ///< the AliRoot module
85 Bool_t fAlign; ///< \brief option to read transformations
87 TString fTransformFileName; ///< transformations file name
88 TString fSVMapFileName; ///< svmaps file name
89 TGeoCombiTrans fGlobalTransformation;///< \brief global transformation
90 /// applied to the whole geometry
91 TObjArray* fGeometryBuilders; ///< list of Geometry Builders
92 AliMUONGeometry* fGeometry; ///< geometry parametrisation
94 ClassDef(AliMUONGeometryBuilder,6) // Geometry builder
99 /// Initialize geometry
100 inline void AliMUONGeometryBuilder::InitGeometry()
101 { InitGeometry(fSVMapFileName); }
103 /// Write sensitive volume maps
104 inline void AliMUONGeometryBuilder::WriteSVMaps()
105 { WriteSVMaps(fSVMapFileName + fgkOutFileNameExtension); }
107 /// Return geometry parametrisation
109 const AliMUONGeometry* AliMUONGeometryBuilder::GetGeometry() const
110 { return fGeometry; }
112 /// Return geometry transformer
114 const AliMUONGeometryTransformer* AliMUONGeometryBuilder::GetTransformer() const
115 { return fGeometry->GetTransformer(); }
117 /// Return option for reading transformations from a file
118 inline Bool_t AliMUONGeometryBuilder::GetAlign() const
121 #endif //ALI_MUON_GEOMETRY_BUILDER_H