]>
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; |
e118b27e | 28 | class AliMUONGeometryStore; |
fc01c870 | 29 | class AliMUONStringIntMap; |
d1cd2474 | 30 | |
31 | class AliMUONVGeometryBuilder : public TObject | |
32 | { | |
33 | public: | |
9a6c488e | 34 | AliMUONVGeometryBuilder(Int_t geometryModuleId1, |
35 | Int_t geometryModuleId2 = -1, | |
36 | Int_t geometryModuleId3 = -1, | |
37 | Int_t geometryModuleId4 = -1, | |
38 | Int_t geometryModuleId5 = -1, | |
39 | Int_t geometryModuleId6 = -1); | |
d1cd2474 | 40 | AliMUONVGeometryBuilder(); |
41 | virtual ~AliMUONVGeometryBuilder(); | |
d1cd2474 | 42 | |
43 | // methods | |
9a6c488e | 44 | void SetReferenceFrame(const TGeoCombiTrans& referenceFrame); |
fc01c870 | 45 | void RebuildSVMaps(Bool_t withEnvelopes = true) const; |
46 | void CreateDetElements() const; | |
067866a3 | 47 | |
a9aad96e | 48 | /// Function to be overriden in a concrete chamber/station |
49 | /// geometry builder class. | |
50 | /// Only materials that are not defined in the common | |
51 | /// functions should be defined here. | |
d1cd2474 | 52 | virtual void CreateMaterials() {} // make = 0; ? |
9a6c488e | 53 | |
a9aad96e | 54 | /// Function to be overriden in a concrete chamber/station |
55 | /// geometry builder class. \n | |
56 | /// The geometry built there should not be placed | |
57 | /// in ALIC; but all volumes going to ALIC | |
58 | /// have to be added as envelopes to the chamber | |
59 | /// geometries | |
60 | /// (They will be then placed automatically | |
61 | /// usind the provided transformation. | |
d1cd2474 | 62 | virtual void CreateGeometry() = 0; |
9a6c488e | 63 | |
a9aad96e | 64 | /// Function to be overriden in a concrete chamber/station |
65 | /// geometry class. \n | |
66 | /// The transformation of each chamber(s) wrt ALICE | |
67 | /// should be defined and set to its geometry class. | |
d1cd2474 | 68 | virtual void SetTransformations() = 0; |
9a6c488e | 69 | |
a9aad96e | 70 | /// Function to be overriden in a concrete chamber/station |
71 | /// geometry class. \n | |
72 | /// The sensitive volumes Ids for each chamber | |
73 | /// should be defined and set to its geometry class. | |
d1cd2474 | 74 | virtual void SetSensitiveVolumes() = 0; |
9a6c488e | 75 | |
a9aad96e | 76 | /// Function to be overriden (and return false) |
77 | /// in the concrete geometry builder classes | |
78 | /// which are already defined in the new ALICE | |
79 | /// coordinate frame | |
067866a3 | 80 | virtual bool ApplyGlobalTransformation() { return true; } |
2811276d | 81 | |
e118b27e | 82 | // access to module geometries |
83 | Int_t NofGeometries() const; | |
84 | AliMUONGeometryModule* Geometry(Int_t i) const; | |
85 | // In difference from protected GetGeometry() | |
86 | // this function access geometry via index and not | |
87 | // via moduleId | |
88 | ||
d1cd2474 | 89 | protected: |
90 | // methods | |
e118b27e | 91 | AliMUONGeometryModule* GetGeometry(Int_t moduleId) const; |
92 | AliMUONGeometryEnvelopeStore* GetEnvelopes(Int_t moduleId) const; | |
fc01c870 | 93 | AliMUONStringIntMap* GetSVMap(Int_t moduleId) const; |
d1cd2474 | 94 | |
9a6c488e | 95 | // set module transformation |
96 | void SetTranslation(Int_t moduleId, | |
97 | const TGeoTranslation& translation); | |
98 | void SetTransformation(Int_t moduleId, | |
99 | const TGeoTranslation& translation, | |
100 | const TGeoRotation& rotation); | |
fc01c870 | 101 | |
102 | // set volumes | |
103 | void SetVolume(Int_t moduleId, const TString& volumeName, | |
104 | Bool_t isVirtual = false); | |
105 | void SetMotherVolume(Int_t moduleId, const TString& volumeName); | |
9a6c488e | 106 | |
d1cd2474 | 107 | private: |
2811276d | 108 | //methods |
161d3338 | 109 | AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs); |
110 | AliMUONVGeometryBuilder& operator = (const AliMUONVGeometryBuilder& rhs); | |
111 | ||
9a6c488e | 112 | TGeoHMatrix ConvertTransform(const TGeoHMatrix& transform) const; |
6ec9cd4e | 113 | TGeoHMatrix ConvertDETransform(const TGeoHMatrix& transform) const; |
9a6c488e | 114 | TString ComposePath(const TString& volName, Int_t copyNo) const; |
115 | void MapSV(const TString& path0, | |
116 | const TString& volName, Int_t detElemId) const; | |
117 | ||
d1cd2474 | 118 | // data members |
829425a5 | 119 | TObjArray* fGeometryModules; ///< \brief the modules geometries that will be built |
120 | /// by this builder | |
121 | TGeoCombiTrans fReferenceFrame; ///< \brief the transformation from the builder | |
122 | /// reference frame to that of the transform | |
123 | /// data files | |
067866a3 | 124 | |
125 | ClassDef(AliMUONVGeometryBuilder,4) // MUON chamber geometry base class | |
d1cd2474 | 126 | }; |
127 | ||
e118b27e | 128 | // inline functions |
129 | ||
a9aad96e | 130 | /// Return the number of geometry modules |
e118b27e | 131 | inline Int_t AliMUONVGeometryBuilder::NofGeometries() const |
9a6c488e | 132 | { return fGeometryModules->GetEntriesFast(); } |
e118b27e | 133 | |
a9aad96e | 134 | /// Return the \a i th geometry module |
e118b27e | 135 | inline AliMUONGeometryModule* AliMUONVGeometryBuilder::Geometry(Int_t i) const |
9a6c488e | 136 | { return (AliMUONGeometryModule*)fGeometryModules->At(i); } |
067866a3 | 137 | |
d1cd2474 | 138 | #endif //ALI_MUON_V_GEOMETRY_BUILDER_H |