]>
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 | /// | |
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; |
2811276d | 29 | class AliMUONGeometrySVMap; |
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); |
45 | void RebuildSVMaps() const; | |
46 | void FillTransformations() const; | |
067866a3 | 47 | |
d1cd2474 | 48 | virtual void CreateMaterials() {} // make = 0; ? |
49 | // Function to be overriden in a concrete chamber/station | |
50 | // geometry builder class. | |
51 | // Only materials that are not defined in the common | |
52 | // functions should be defined here. | |
9a6c488e | 53 | |
d1cd2474 | 54 | virtual void CreateGeometry() = 0; |
55 | // Function to be overriden in a concrete chamber/station | |
56 | // geometry builder class. | |
57 | // The geometry built there should not be placed | |
58 | // in ALIC; but all volumes going to ALIC | |
59 | // have to be added as envelopes to the chamber | |
60 | // geometries | |
61 | // (They will be then placed automatically | |
62 | // usind the provided transformation. | |
9a6c488e | 63 | |
d1cd2474 | 64 | virtual void SetTransformations() = 0; |
65 | // Function to be overriden in a concrete chamber/station | |
66 | // geometry class. | |
67 | // The transformation of each chamber(s) wrt ALICE | |
68 | // should be defined and set to its geometry class. | |
9a6c488e | 69 | |
d1cd2474 | 70 | virtual void SetSensitiveVolumes() = 0; |
71 | // Function to be overriden in a concrete chamber/station | |
72 | // geometry class. | |
73 | // The sensitive volumes Ids for each chamber | |
74 | // should be defined and set to its geometry class. | |
9a6c488e | 75 | |
067866a3 | 76 | virtual bool ApplyGlobalTransformation() { return true; } |
77 | // Function to be overriden (and return false) | |
78 | // in the concrete geometry builder classes | |
79 | // which are already defined in the new ALICE | |
80 | // coordinate frame | |
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: |
30178c30 | 90 | AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs); |
91 | ||
92 | // operators | |
93 | AliMUONVGeometryBuilder& operator = (const AliMUONVGeometryBuilder& rhs); | |
94 | ||
d1cd2474 | 95 | // methods |
e118b27e | 96 | AliMUONGeometryModule* GetGeometry(Int_t moduleId) const; |
97 | AliMUONGeometryEnvelopeStore* GetEnvelopes(Int_t moduleId) const; | |
e118b27e | 98 | AliMUONGeometrySVMap* GetSVMap(Int_t moduleId) const; |
d1cd2474 | 99 | |
9a6c488e | 100 | // set module transformation |
101 | void SetTranslation(Int_t moduleId, | |
102 | const TGeoTranslation& translation); | |
103 | void SetTransformation(Int_t moduleId, | |
104 | const TGeoTranslation& translation, | |
105 | const TGeoRotation& rotation); | |
106 | ||
d1cd2474 | 107 | private: |
2811276d | 108 | //methods |
9a6c488e | 109 | TGeoHMatrix ConvertTransform(const TGeoHMatrix& transform) const; |
6ec9cd4e | 110 | TGeoHMatrix ConvertDETransform(const TGeoHMatrix& transform) const; |
9a6c488e | 111 | TString ComposePath(const TString& volName, Int_t copyNo) const; |
112 | void MapSV(const TString& path0, | |
113 | const TString& volName, Int_t detElemId) const; | |
114 | ||
d1cd2474 | 115 | // data members |
9a6c488e | 116 | TObjArray* fGeometryModules; // the modules geometries that will be built |
067866a3 | 117 | // by this builder |
118 | TGeoCombiTrans fReferenceFrame; // the transformation from the builder | |
119 | // reference frame to that of the transform | |
120 | // data files | |
121 | ||
122 | ClassDef(AliMUONVGeometryBuilder,4) // MUON chamber geometry base class | |
d1cd2474 | 123 | }; |
124 | ||
e118b27e | 125 | // inline functions |
126 | ||
127 | inline Int_t AliMUONVGeometryBuilder::NofGeometries() const | |
9a6c488e | 128 | { return fGeometryModules->GetEntriesFast(); } |
e118b27e | 129 | |
130 | inline AliMUONGeometryModule* AliMUONVGeometryBuilder::Geometry(Int_t i) const | |
9a6c488e | 131 | { return (AliMUONGeometryModule*)fGeometryModules->At(i); } |
067866a3 | 132 | |
d1cd2474 | 133 | #endif //ALI_MUON_V_GEOMETRY_BUILDER_H |