]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONGeometryBuilder.h
Comments for Doxygen (mostly added comments for inline functions)
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryBuilder.h
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
48     void  WriteSVMaps();
49     void  WriteSVMaps(const TString& fileName, Bool_t rebuild = true);
50     
51     // Geometry parametrisation
52     const AliMUONGeometry*            GetGeometry() const;
53     const AliMUONGeometryTransformer* GetTransformer() const;
54
55     // Alignement
56     virtual Bool_t  GetAlign() const;
57     virtual void    SetAlign(Bool_t align = true);
58     virtual void    SetAlign(const TString& fileName, Bool_t align = true);
59  
60   protected:
61     /// Not implemented
62     AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right);
63     /// Not implemented
64     AliMUONGeometryBuilder&  operator = (const AliMUONGeometryBuilder& right);
65  
66   private:
67     // method
68     void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo, 
69              const TGeoHMatrix& matrix, Int_t npar, Double_t* param,
70              const char* only, Bool_t makeAssembly = false) const;
71     void CreateGeometryWithTGeo();
72     void CreateGeometryWithoutTGeo();
73     void SetAlign(AliMUONVGeometryBuilder* builder);         
74
75     // static data members
76     static const TString  fgkDefaultVolPathsFileName;  ///< default volume paths file name                                         
77     static const TString  fgkDefaultTransformFileName; ///< default transformations file name                                      
78     static const TString  fgkDefaultSVMapFileName;     ///< default svmaps file name                                       
79     static const TString  fgkOutFileNameExtension;     ///< default output file name extension                                     
80
81     // data members
82     AliModule*       fModule;              ///< the AliRoot module
83     Bool_t           fAlign;               ///< \brief option to read transformations 
84                                            /// from a file
85     TString          fTransformFileName;   ///< transformations file name                                          
86     TString          fSVMapFileName;       ///< svmaps file name                                           
87     TGeoCombiTrans   fGlobalTransformation;///< \brief global transformation 
88                                            /// applied to the whole geometry 
89     TObjArray*       fGeometryBuilders;    ///< list of Geometry Builders
90     AliMUONGeometry* fGeometry;            ///< geometry parametrisation
91
92   ClassDef(AliMUONGeometryBuilder,6)  // Geometry builder
93 };
94
95 // inline functions
96
97 /// Initialize geometry
98 inline void  AliMUONGeometryBuilder::InitGeometry()
99 { InitGeometry(fSVMapFileName); }
100
101 /// Write sensitive volume maps
102 inline void  AliMUONGeometryBuilder::WriteSVMaps()
103 { WriteSVMaps(fSVMapFileName + fgkOutFileNameExtension); }
104
105 /// Return geometry parametrisation
106 inline 
107 const AliMUONGeometry* AliMUONGeometryBuilder::GetGeometry() const
108 { return fGeometry; }
109
110 /// Return geometry transformer
111 inline 
112 const AliMUONGeometryTransformer* AliMUONGeometryBuilder::GetTransformer() const
113 { return fGeometry->GetTransformer(); }
114
115 /// Return option for reading transformations from a file
116 inline Bool_t  AliMUONGeometryBuilder::GetAlign() const
117 { return fAlign; }
118
119 #endif //ALI_MUON_GEOMETRY_BUILDER_H
120
121
122
123
124
125
126