recover the detector tag int and not the string from the AOD particle
[u/mrichter/AliRoot.git] / MUON / AliMUONGeometryBuilder.h
CommitLineData
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 20class TObjArray;
21
e118b27e 22class AliModule;
d4bb94a1 23class AliMUONVGeometryBuilder;
24
25class 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);
450ca6fb 47 void UpdateInternalGeometry();
eea63c73 48
eea63c73 49 void WriteSVMaps();
94bc50cf 50 void WriteSVMaps(const TString& fileName,
51 Bool_t rebuild = true, Bool_t writeEnvelopes = true);
9a6c488e 52
53 // Geometry parametrisation
54 const AliMUONGeometry* GetGeometry() const;
55 const AliMUONGeometryTransformer* GetTransformer() const;
76497dec 56
57 // Alignement
58 virtual Bool_t GetAlign() const;
eea63c73 59 virtual void SetAlign(Bool_t align = true);
60 virtual void SetAlign(const TString& fileName, Bool_t align = true);
d4bb94a1 61
d4bb94a1 62 protected:
71a2d3aa 63 /// Not implemented
d4bb94a1 64 AliMUONGeometryBuilder(const AliMUONGeometryBuilder& right);
71a2d3aa 65 /// Not implemented
d4bb94a1 66 AliMUONGeometryBuilder& operator = (const AliMUONGeometryBuilder& right);
67
68 private:
31edb2d7 69 // static methods
70 static const TString& GetDefaultTransformFileName();
71 static const TString& GetDefaultSVMapFileName();
72 static const TString& GetOutFileNameExtension();
73
d4bb94a1 74 // method
75 void PlaceVolume(const TString& name, const TString& mName, Int_t copyNo,
76 const TGeoHMatrix& matrix, Int_t npar, Double_t* param,
beec1d7e 77 const char* only, Bool_t makeAssembly = false) const;
78 void CreateGeometryWithTGeo();
79 void CreateGeometryWithoutTGeo();
9ee1d6ff 80 void SetAlignToBuilder(AliMUONVGeometryBuilder* builder) const;
d4bb94a1 81
82 // data members
829425a5 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
d4bb94a1 92
beec1d7e 93 ClassDef(AliMUONGeometryBuilder,6) // Geometry builder
d4bb94a1 94};
95
76497dec 96// inline functions
97
a9aad96e 98/// Initialize geometry
eea63c73 99inline void AliMUONGeometryBuilder::InitGeometry()
100{ InitGeometry(fSVMapFileName); }
101
a9aad96e 102/// Write sensitive volume maps
eea63c73 103inline void AliMUONGeometryBuilder::WriteSVMaps()
31edb2d7 104{ WriteSVMaps(fSVMapFileName + GetOutFileNameExtension()); }
eea63c73 105
a9aad96e 106/// Return geometry parametrisation
9a6c488e 107inline
108const AliMUONGeometry* AliMUONGeometryBuilder::GetGeometry() const
109{ return fGeometry; }
110
a9aad96e 111/// Return geometry transformer
9a6c488e 112inline
113const AliMUONGeometryTransformer* AliMUONGeometryBuilder::GetTransformer() const
114{ return fGeometry->GetTransformer(); }
115
a9aad96e 116/// Return option for reading transformations from a file
76497dec 117inline Bool_t AliMUONGeometryBuilder::GetAlign() const
118{ return fAlign; }
119
d4bb94a1 120#endif //ALI_MUON_GEOMETRY_BUILDER_H
121
122
123
124
125
126
127