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 AliMUONGeometryBuilder
8 : /// \brief Manager class for geometry construction via geometry builders.
9 : ///
10 : /// \author Ivana Hrivnacova, IPN Orsay
11 :
12 : #ifndef ALI_MUON_GEOMETRY_BUILDER_H
13 : #define ALI_MUON_GEOMETRY_BUILDER_H
14 :
15 : #include "AliMUONGeometry.h"
16 :
17 : #include <TObject.h>
18 : #include <TGeoMatrix.h>
19 :
20 : class TObjArray;
21 :
22 : class AliModule;
23 : class AliMUONVGeometryBuilder;
24 :
25 : class AliMUONGeometryBuilder : public TObject
26 : {
27 : public:
28 : AliMUONGeometryBuilder(AliModule* detector);
29 : AliMUONGeometryBuilder();
30 : virtual ~AliMUONGeometryBuilder();
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);
38 :
39 : // methods
40 : //
41 : void AddBuilder(AliMUONVGeometryBuilder* geomBuilder);
42 : void CreateGeometry();
43 : void CreateMaterials();
44 :
45 : void InitGeometry();
46 : void InitGeometry(const TString& svmapFileName);
47 : void UpdateInternalGeometry();
48 :
49 : void WriteSVMaps();
50 : void WriteSVMaps(const TString& fileName,
51 : Bool_t rebuild = true, Bool_t writeEnvelopes = true);
52 :
53 : // Geometry parametrisation
54 : const AliMUONGeometry* GetGeometry() const;
55 : const AliMUONGeometryTransformer* GetTransformer() const;
56 :
57 : // Alignement
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);
61 :
62 : protected:
63 : /// Not implemented
64 : AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right);
65 : /// Not implemented
66 : AliMUONGeometryBuilder& operator = (const AliMUONGeometryBuilder& right);
67 :
68 : private:
69 : // static methods
70 : static const TString& GetDefaultTransformFileName();
71 : static const TString& GetDefaultSVMapFileName();
72 : static const TString& GetOutFileNameExtension();
73 :
74 : // method
75 : void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo,
76 : const TGeoHMatrix& matrix, Int_t npar, Double_t* param,
77 : const char* only, Bool_t makeAssembly = false) const;
78 : void CreateGeometryWithTGeo();
79 : void CreateGeometryWithoutTGeo();
80 : void SetAlignToBuilder(AliMUONVGeometryBuilder* builder) const;
81 :
82 : // data members
83 : AliModule* fModule; ///< the AliRoot module
84 : Bool_t fAlign; ///< \brief option to read transformations
85 : /// from a file
86 : TString fTransformFileName; ///< transformations file name
87 : TString fSVMapFileName; ///< svmaps file name
88 : TGeoCombiTrans fGlobalTransformation;///< \brief global transformation
89 : /// applied to the whole geometry
90 : TObjArray* fGeometryBuilders; ///< list of Geometry Builders
91 : AliMUONGeometry* fGeometry; ///< geometry parametrisation
92 :
93 54 : ClassDef(AliMUONGeometryBuilder,6) // Geometry builder
94 : };
95 :
96 : // inline functions
97 :
98 : /// Initialize geometry
99 : inline void AliMUONGeometryBuilder::InitGeometry()
100 2 : { InitGeometry(fSVMapFileName); }
101 :
102 : /// Write sensitive volume maps
103 : inline void AliMUONGeometryBuilder::WriteSVMaps()
104 0 : { WriteSVMaps(fSVMapFileName + GetOutFileNameExtension()); }
105 :
106 : /// Return geometry parametrisation
107 : inline
108 : const AliMUONGeometry* AliMUONGeometryBuilder::GetGeometry() const
109 341592 : { return fGeometry; }
110 :
111 : /// Return geometry transformer
112 : inline
113 : const AliMUONGeometryTransformer* AliMUONGeometryBuilder::GetTransformer() const
114 0 : { return fGeometry->GetTransformer(); }
115 :
116 : /// Return option for reading transformations from a file
117 : inline Bool_t AliMUONGeometryBuilder::GetAlign() const
118 0 : { return fAlign; }
119 :
120 : #endif //ALI_MUON_GEOMETRY_BUILDER_H
121 :
122 :
123 :
124 :
125 :
126 :
127 :
|