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 AliMUONStringIntMap;
30 class AliMUONVGeometryBuilder : public TObject
33 AliMUONVGeometryBuilder(Int_t firstModuleId, Int_t nofModules);
34 AliMUONVGeometryBuilder();
35 virtual ~AliMUONVGeometryBuilder();
38 void SetReferenceFrame(const TGeoCombiTrans& referenceFrame);
39 void RebuildSVMaps(Bool_t withEnvelopes = true) const;
40 void CreateDetElements() const;
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.
46 virtual void CreateMaterials() {} // make = 0; ?
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
54 /// (They will be then placed automatically
55 /// usind the provided transformation.
56 virtual void CreateGeometry() = 0;
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.
62 virtual void SetTransformations() = 0;
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.
68 virtual void SetSensitiveVolumes() = 0;
70 /// Function to be overriden (and return false)
71 /// in the concrete geometry builder classes
72 /// which are already defined in the new ALICE
74 virtual bool ApplyGlobalTransformation() { return true; }
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
85 AliMUONGeometryModule* GetGeometry(Int_t moduleId) const;
86 AliMUONGeometryEnvelopeStore* GetEnvelopes(Int_t moduleId) const;
87 AliMUONStringIntMap* GetSVMap(Int_t moduleId) const;
88 Int_t GetModuleId(const TString& envName) const;
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);
98 void SetVolume(Int_t moduleId, const TString& volumeName,
99 Bool_t isVirtual = false);
100 void SetMotherVolume(Int_t moduleId, const TString& volumeName);
104 AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs);
105 AliMUONVGeometryBuilder& operator = (const AliMUONVGeometryBuilder& rhs);
107 TGeoHMatrix ConvertTransform(const TGeoHMatrix& transform) const;
108 TGeoHMatrix ConvertDETransform(const TGeoHMatrix& transform) const;
109 TString ComposePath(const TString& volName, Int_t copyNo) const;
110 void MapSV(const TString& path0,
111 const TString& volName, Int_t detElemId) const;
114 TObjArray* fGeometryModules; ///< \brief the modules geometries that will be built
116 TGeoCombiTrans fReferenceFrame; ///< \brief the transformation from the builder
117 /// reference frame to that of the transform
120 ClassDef(AliMUONVGeometryBuilder,4) // MUON chamber geometry base class
125 /// Return the number of geometry modules
126 inline Int_t AliMUONVGeometryBuilder::NofGeometries() const
127 { return fGeometryModules->GetEntriesFast(); }
129 /// Return the \a i th geometry module
130 inline AliMUONGeometryModule* AliMUONVGeometryBuilder::Geometry(Int_t i) const
131 { return (AliMUONGeometryModule*)fGeometryModules->At(i); }
133 #endif //ALI_MUON_V_GEOMETRY_BUILDER_H