1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
5 // Revision of includes 07/05/2004
8 /// \class AliMUONVGeometryBuilder
9 /// \brief Abstract base class for geometry construction per module(s)
11 /// \author Ivana Hrivnacova, IPN Orsay
13 #ifndef ALI_MUON_V_GEOMETRY_BUILDER_H
14 #define ALI_MUON_V_GEOMETRY_BUILDER_H
19 #include <TObjArray.h>
20 #include <TGeoMatrix.h>
22 class TGeoTranslation;
26 class AliMUONGeometryModule;
27 class AliMUONGeometryEnvelopeStore;
28 class AliMUONGeometryStore;
29 class AliMUONStringIntMap;
31 class AliMUONVGeometryBuilder : public TObject
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);
40 AliMUONVGeometryBuilder();
41 virtual ~AliMUONVGeometryBuilder();
44 void SetReferenceFrame(const TGeoCombiTrans& referenceFrame);
45 void RebuildSVMaps(Bool_t withEnvelopes = true) const;
46 void CreateDetElements() const;
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.
52 virtual void CreateMaterials() {} // make = 0; ?
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
60 /// (They will be then placed automatically
61 /// usind the provided transformation.
62 virtual void CreateGeometry() = 0;
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.
68 virtual void SetTransformations() = 0;
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.
74 virtual void SetSensitiveVolumes() = 0;
76 /// Function to be overriden (and return false)
77 /// in the concrete geometry builder classes
78 /// which are already defined in the new ALICE
80 virtual bool ApplyGlobalTransformation() { return true; }
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
91 AliMUONGeometryModule* GetGeometry(Int_t moduleId) const;
92 AliMUONGeometryEnvelopeStore* GetEnvelopes(Int_t moduleId) const;
93 AliMUONStringIntMap* GetSVMap(Int_t moduleId) const;
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);
103 void SetVolume(Int_t moduleId, const TString& volumeName,
104 Bool_t isVirtual = false);
105 void SetMotherVolume(Int_t moduleId, const TString& volumeName);
109 AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs);
110 AliMUONVGeometryBuilder& operator = (const AliMUONVGeometryBuilder& rhs);
112 TGeoHMatrix ConvertTransform(const TGeoHMatrix& transform) const;
113 TGeoHMatrix ConvertDETransform(const TGeoHMatrix& transform) const;
114 TString ComposePath(const TString& volName, Int_t copyNo) const;
115 void MapSV(const TString& path0,
116 const TString& volName, Int_t detElemId) const;
119 TObjArray* fGeometryModules; ///< \brief the modules geometries that will be built
121 TGeoCombiTrans fReferenceFrame; ///< \brief the transformation from the builder
122 /// reference frame to that of the transform
125 ClassDef(AliMUONVGeometryBuilder,4) // MUON chamber geometry base class
130 /// Return the number of geometry modules
131 inline Int_t AliMUONVGeometryBuilder::NofGeometries() const
132 { return fGeometryModules->GetEntriesFast(); }
134 /// Return the \a i th geometry module
135 inline AliMUONGeometryModule* AliMUONVGeometryBuilder::Geometry(Int_t i) const
136 { return (AliMUONGeometryModule*)fGeometryModules->At(i); }
138 #endif //ALI_MUON_V_GEOMETRY_BUILDER_H