]>
Commit | Line | Data |
---|---|---|
30178c30 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
d1cd2474 | 4 | // $Id$ |
30178c30 | 5 | // Revision of includes 07/05/2004 |
692de412 | 6 | |
7 | /// \ingroup geometry | |
8 | /// \class AliMUONVGeometryBuilder | |
9 | /// \brief Abstract base class for geometry construction per module(s) | |
10 | /// | |
a9aad96e | 11 | /// \author Ivana Hrivnacova, IPN Orsay |
d1cd2474 | 12 | |
13 | #ifndef ALI_MUON_V_GEOMETRY_BUILDER_H | |
14 | #define ALI_MUON_V_GEOMETRY_BUILDER_H | |
15 | ||
2811276d | 16 | #include <fstream> |
17 | ||
d1cd2474 | 18 | #include <TObject.h> |
e118b27e | 19 | #include <TObjArray.h> |
067866a3 | 20 | #include <TGeoMatrix.h> |
d1cd2474 | 21 | |
22 | class TGeoTranslation; | |
23 | class TGeoRotation; | |
24 | class TGeoCombiTrans; | |
d1cd2474 | 25 | |
e118b27e | 26 | class AliMUONGeometryModule; |
2811276d | 27 | class AliMUONGeometryEnvelopeStore; |
fc01c870 | 28 | class AliMUONStringIntMap; |
d1cd2474 | 29 | |
30 | class AliMUONVGeometryBuilder : public TObject | |
31 | { | |
32 | public: | |
31607b6f | 33 | AliMUONVGeometryBuilder(Int_t firstModuleId, Int_t nofModules); |
d1cd2474 | 34 | AliMUONVGeometryBuilder(); |
35 | virtual ~AliMUONVGeometryBuilder(); | |
d1cd2474 | 36 | |
37 | // methods | |
9a6c488e | 38 | void SetReferenceFrame(const TGeoCombiTrans& referenceFrame); |
fc01c870 | 39 | void RebuildSVMaps(Bool_t withEnvelopes = true) const; |
40 | void CreateDetElements() const; | |
067866a3 | 41 | |
a9aad96e | 42 | /// Function to be overriden in a concrete chamber/station |
43 | /// geometry builder class. | |
44 | /// Only materials that are not defined in the common | |
45 | /// functions should be defined here. | |
d1cd2474 | 46 | virtual void CreateMaterials() {} // make = 0; ? |
9a6c488e | 47 | |
a9aad96e | 48 | /// Function to be overriden in a concrete chamber/station |
49 | /// geometry builder class. \n | |
50 | /// The geometry built there should not be placed | |
51 | /// in ALIC; but all volumes going to ALIC | |
52 | /// have to be added as envelopes to the chamber | |
53 | /// geometries | |
54 | /// (They will be then placed automatically | |
55 | /// usind the provided transformation. | |
d1cd2474 | 56 | virtual void CreateGeometry() = 0; |
9a6c488e | 57 | |
a9aad96e | 58 | /// Function to be overriden in a concrete chamber/station |
59 | /// geometry class. \n | |
60 | /// The transformation of each chamber(s) wrt ALICE | |
61 | /// should be defined and set to its geometry class. | |
d1cd2474 | 62 | virtual void SetTransformations() = 0; |
9a6c488e | 63 | |
a9aad96e | 64 | /// Function to be overriden in a concrete chamber/station |
65 | /// geometry class. \n | |
66 | /// The sensitive volumes Ids for each chamber | |
67 | /// should be defined and set to its geometry class. | |
d1cd2474 | 68 | virtual void SetSensitiveVolumes() = 0; |
9a6c488e | 69 | |
a9aad96e | 70 | /// Function to be overriden (and return false) |
71 | /// in the concrete geometry builder classes | |
72 | /// which are already defined in the new ALICE | |
73 | /// coordinate frame | |
067866a3 | 74 | virtual bool ApplyGlobalTransformation() { return true; } |
2811276d | 75 | |
e118b27e | 76 | // access to module geometries |
77 | Int_t NofGeometries() const; | |
78 | AliMUONGeometryModule* Geometry(Int_t i) const; | |
79 | // In difference from protected GetGeometry() | |
80 | // this function access geometry via index and not | |
81 | // via moduleId | |
82 | ||
d1cd2474 | 83 | protected: |
84 | // methods | |
e118b27e | 85 | AliMUONGeometryModule* GetGeometry(Int_t moduleId) const; |
86 | AliMUONGeometryEnvelopeStore* GetEnvelopes(Int_t moduleId) const; | |
fc01c870 | 87 | AliMUONStringIntMap* GetSVMap(Int_t moduleId) const; |
31607b6f | 88 | Int_t GetModuleId(const TString& envName) const; |
d1cd2474 | 89 | |
9a6c488e | 90 | // set module transformation |
91 | void SetTranslation(Int_t moduleId, | |
92 | const TGeoTranslation& translation); | |
93 | void SetTransformation(Int_t moduleId, | |
94 | const TGeoTranslation& translation, | |
95 | const TGeoRotation& rotation); | |
fc01c870 | 96 | |
97 | // set volumes | |
98 | void SetVolume(Int_t moduleId, const TString& volumeName, | |
99 | Bool_t isVirtual = false); | |
100 | void SetMotherVolume(Int_t moduleId, const TString& volumeName); | |
9a6c488e | 101 | |
d1cd2474 | 102 | private: |
2811276d | 103 | //methods |
71a2d3aa | 104 | |
105 | /// Not implemented | |
161d3338 | 106 | AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs); |
71a2d3aa | 107 | /// Not implemented |
161d3338 | 108 | AliMUONVGeometryBuilder& operator = (const AliMUONVGeometryBuilder& rhs); |
109 | ||
9a6c488e | 110 | TGeoHMatrix ConvertTransform(const TGeoHMatrix& transform) const; |
6ec9cd4e | 111 | TGeoHMatrix ConvertDETransform(const TGeoHMatrix& transform) const; |
9a6c488e | 112 | TString ComposePath(const TString& volName, Int_t copyNo) const; |
113 | void MapSV(const TString& path0, | |
114 | const TString& volName, Int_t detElemId) const; | |
115 | ||
d1cd2474 | 116 | // data members |
829425a5 | 117 | TObjArray* fGeometryModules; ///< \brief the modules geometries that will be built |
118 | /// by this builder | |
119 | TGeoCombiTrans fReferenceFrame; ///< \brief the transformation from the builder | |
120 | /// reference frame to that of the transform | |
121 | /// data files | |
067866a3 | 122 | |
123 | ClassDef(AliMUONVGeometryBuilder,4) // MUON chamber geometry base class | |
d1cd2474 | 124 | }; |
125 | ||
e118b27e | 126 | // inline functions |
127 | ||
a9aad96e | 128 | /// Return the number of geometry modules |
e118b27e | 129 | inline Int_t AliMUONVGeometryBuilder::NofGeometries() const |
9a6c488e | 130 | { return fGeometryModules->GetEntriesFast(); } |
e118b27e | 131 | |
a9aad96e | 132 | /// Return the \a i th geometry module |
e118b27e | 133 | inline AliMUONGeometryModule* AliMUONVGeometryBuilder::Geometry(Int_t i) const |
9a6c488e | 134 | { return (AliMUONGeometryModule*)fGeometryModules->At(i); } |
067866a3 | 135 | |
d1cd2474 | 136 | #endif //ALI_MUON_V_GEOMETRY_BUILDER_H |