AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONVGeometryBuilder.h
Go to the documentation of this file.
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice */
3 
4 // $Id$
5 // Revision of includes 07/05/2004
6 
12 
13 #ifndef ALI_MUONV_GEOMETRY_BUILDER_H
14 #define ALI_MUONV_GEOMETRY_BUILDER_H
15 
16 #include <fstream>
17 
18 #include <TObject.h>
19 #include <TObjArray.h>
20 #include <TGeoMatrix.h>
21 
22 class TGeoTranslation;
23 class TGeoRotation;
24 class TGeoCombiTrans;
25 
29 
30 class AliMUONVGeometryBuilder : public TObject
31 {
32  public:
33  AliMUONVGeometryBuilder(Int_t firstModuleId, Int_t nofModules);
35  virtual ~AliMUONVGeometryBuilder();
36 
37  // methods
38  void SetReferenceFrame(const TGeoCombiTrans& referenceFrame);
39  void RebuildSVMaps(Bool_t withEnvelopes = true) const;
40  void UpdateDetElements(Bool_t create) const;
41 
46  virtual void CreateMaterials() {} // make = 0; ?
47 
56  virtual void CreateGeometry() = 0;
57 
62  virtual void SetVolumes() = 0;
63 
68  virtual void SetTransformations() = 0;
69 
74  virtual void SetSensitiveVolumes() = 0;
75 
80  virtual bool ApplyGlobalTransformation() { return true; }
81 
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 
89  protected:
90  // methods
91  AliMUONGeometryModule* GetGeometry(Int_t moduleId) const;
92  AliMUONGeometryEnvelopeStore* GetEnvelopes(Int_t moduleId) const;
93  AliMUONStringIntMap* GetSVMap(Int_t moduleId) const;
94  Int_t GetModuleId(const TString& envName) const;
95 
96  // set module transformation
97  void SetTranslation(Int_t moduleId,
98  const TGeoTranslation& translation);
99  void SetTransformation(Int_t moduleId,
100  const TGeoTranslation& translation,
101  const TGeoRotation& rotation);
102 
103  // set volumes
104  void SetVolume(Int_t moduleId, const TString& volumeName,
105  Bool_t isVirtual = false);
106  void SetMotherVolume(Int_t moduleId, const TString& volumeName);
107 
108  private:
109  //methods
110 
115 
116  TGeoHMatrix ConvertTransform(const TGeoHMatrix& transform) const;
117  TGeoHMatrix ConvertDETransform(const TGeoHMatrix& transform) const;
118  TString ComposePath(const TString& volName, Int_t copyNo) const;
119  void MapSV(const TString& path0,
120  const TString& volName, Int_t detElemId) const;
121 
122  // data members
124  TGeoCombiTrans fReferenceFrame;
126 
129  ClassDef(AliMUONVGeometryBuilder,4) // MUON chamber geometry base class
130 };
131 
132 // inline functions
133 
136 { return fGeometryModules->GetEntriesFast(); }
137 
140 { return (AliMUONGeometryModule*)fGeometryModules->At(i); }
141 
142 #endif //ALI_MUONV_GEOMETRY_BUILDER_H
virtual void CreateGeometry()=0
Abstract base class for geometry construction per module(s)
TGeoHMatrix ConvertTransform(const TGeoHMatrix &transform) const
#define TObjArray
void SetMotherVolume(Int_t moduleId, const TString &volumeName)
void UpdateDetElements(Bool_t create) const
Int_t GetModuleId(const TString &envName) const
void SetTransformation(Int_t moduleId, const TGeoTranslation &translation, const TGeoRotation &rotation)
AliMUONStringIntMap * GetSVMap(Int_t moduleId) const
TGeoCombiTrans fReferenceFrame
the transformation from the builder reference frame to that of the transform
virtual void SetTransformations()=0
Substitutes map <string, int> which ALICE does not allow to use.
AliMUONGeometryModule * Geometry(Int_t i) const
Return the i th geometry module.
void SetTranslation(Int_t moduleId, const TGeoTranslation &translation)
TString ComposePath(const TString &volName, Int_t copyNo) const
AliMUONGeometryModule * GetGeometry(Int_t moduleId) const
AliMUONVGeometryBuilder & operator=(const AliMUONVGeometryBuilder &rhs)
Not implemented.
Store for temporary volumes envelopes.
virtual void SetVolumes()=0
and eventually the mother volume name should be defined
TGeoHMatrix ConvertDETransform(const TGeoHMatrix &transform) const
void MapSV(const TString &path0, const TString &volName, Int_t detElemId) const
AliMUONGeometryEnvelopeStore * GetEnvelopes(Int_t moduleId) const
TObjArray * fGeometryModules
the modules geometries that will be built by this builder
void SetReferenceFrame(const TGeoCombiTrans &referenceFrame)
void SetVolume(Int_t moduleId, const TString &volumeName, Bool_t isVirtual=false)
virtual bool ApplyGlobalTransformation()
Geometry parameters for detector module.
Int_t NofGeometries() const
Return the number of geometry modules.
virtual void SetSensitiveVolumes()=0
void RebuildSVMaps(Bool_t withEnvelopes=true) const