]>
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 |
d1cd2474 | 6 | // |
7 | // Class AliMUONVGeometryBuilder | |
8 | // ----------------------------- | |
9 | // Abstract base class for geometry construction per chamber(s). | |
10 | // | |
11 | // Author: Ivana Hrivnacova, IPN Orsay | |
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> |
d1cd2474 | 20 | |
21 | class TGeoTranslation; | |
22 | class TGeoRotation; | |
23 | class TGeoCombiTrans; | |
d1cd2474 | 24 | |
e118b27e | 25 | class AliMUONGeometryModule; |
2811276d | 26 | class AliMUONGeometryEnvelopeStore; |
e118b27e | 27 | class AliMUONGeometryStore; |
2811276d | 28 | class AliMUONGeometrySVMap; |
d1cd2474 | 29 | |
30 | class AliMUONVGeometryBuilder : public TObject | |
31 | { | |
32 | public: | |
2811276d | 33 | AliMUONVGeometryBuilder(const TString& fileName, |
e118b27e | 34 | AliMUONGeometryModule* mg1, |
35 | AliMUONGeometryModule* mg2 = 0, | |
36 | AliMUONGeometryModule* mg3 = 0, | |
37 | AliMUONGeometryModule* mg4 = 0, | |
38 | AliMUONGeometryModule* mg5 = 0, | |
39 | AliMUONGeometryModule* mg6 = 0); | |
d1cd2474 | 40 | AliMUONVGeometryBuilder(); |
41 | virtual ~AliMUONVGeometryBuilder(); | |
d1cd2474 | 42 | |
43 | // methods | |
2811276d | 44 | virtual void FillTransformations() const; |
45 | virtual void RebuildSVMaps() const; | |
46 | virtual Bool_t ReadTransformations() const; | |
47 | virtual Bool_t ReadSVMap() const; | |
48 | virtual Bool_t WriteTransformations() const; | |
49 | virtual Bool_t WriteSVMap(Bool_t rebuild) const; | |
50 | ||
d1cd2474 | 51 | virtual void CreateMaterials() {} // make = 0; ? |
52 | // Function to be overriden in a concrete chamber/station | |
53 | // geometry builder class. | |
54 | // Only materials that are not defined in the common | |
55 | // functions should be defined here. | |
56 | virtual void CreateGeometry() = 0; | |
57 | // Function to be overriden in a concrete chamber/station | |
58 | // geometry builder class. | |
59 | // The geometry built there should not be placed | |
60 | // in ALIC; but all volumes going to ALIC | |
61 | // have to be added as envelopes to the chamber | |
62 | // geometries | |
63 | // (They will be then placed automatically | |
64 | // usind the provided transformation. | |
65 | virtual void SetTransformations() = 0; | |
66 | // Function to be overriden in a concrete chamber/station | |
67 | // geometry class. | |
68 | // The transformation of each chamber(s) wrt ALICE | |
69 | // should be defined and set to its geometry class. | |
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. | |
2811276d | 75 | |
e118b27e | 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 | |
81 | // via moduleId | |
82 | ||
83 | ||
d1cd2474 | 84 | protected: |
30178c30 | 85 | AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs); |
86 | ||
87 | // operators | |
88 | AliMUONVGeometryBuilder& operator = (const AliMUONVGeometryBuilder& rhs); | |
89 | ||
d1cd2474 | 90 | // methods |
e118b27e | 91 | AliMUONGeometryModule* GetGeometry(Int_t moduleId) const; |
92 | AliMUONGeometryEnvelopeStore* GetEnvelopes(Int_t moduleId) const; | |
93 | AliMUONGeometryStore* GetDetElements(Int_t moduleId) const; | |
94 | AliMUONGeometrySVMap* GetSVMap(Int_t moduleId) const; | |
d1cd2474 | 95 | |
96 | private: | |
2811276d | 97 | //methods |
98 | TString ComposePath(const TString& volName, Int_t copyNo) const; | |
99 | void MapSV(const TString&path, const TString& volName, | |
100 | Int_t detElemId) const; | |
101 | ||
e118b27e | 102 | void FillData(Int_t moduleId, Int_t nofDetElements, |
2811276d | 103 | Double_t x, Double_t y, Double_t z, |
104 | Double_t a1, Double_t a2, Double_t a3, | |
105 | Double_t a4, Double_t a5, Double_t a6) const; | |
106 | void FillData(Int_t id, const TString& volName, Int_t copyNo, | |
107 | Double_t x, Double_t y, Double_t z, | |
108 | Double_t a1, Double_t a2, Double_t a3, | |
109 | Double_t a4, Double_t a5, Double_t a6) const; | |
110 | void FillData(const TString& sensVolumePath, Int_t detElemId) const; | |
111 | ||
112 | TString ReadData1(ifstream& in) const; | |
113 | TString ReadData2(ifstream& in) const; | |
114 | TString ReadData3(ifstream& in) const; | |
115 | ||
116 | void WriteTransform(ofstream& out, const TGeoCombiTrans* transform) const; | |
117 | void WriteData1(ofstream& out) const; | |
118 | void WriteData2(ofstream& out) const; | |
119 | void WriteData3(ofstream& out) const; | |
120 | ||
121 | // static data members | |
122 | static const TString fgkTransformFileNamePrefix; // the prefix for the name | |
123 | // of file with transformations | |
124 | static const TString fgkSVMapFileNamePrefix; // the prefix for the name of file | |
125 | // with sensitive volume map | |
126 | static const TString fgkOutFileNameSuffix; // the suffix for the name of | |
127 | // generated files | |
128 | ||
d1cd2474 | 129 | // data members |
2811276d | 130 | TString fTransformFileName; // the name file with transformations |
131 | TString fSVMapFileName; // the name file with sensitive volume map | |
e118b27e | 132 | TObjArray* fModuleGeometries; // the modules geometries that will be built |
133 | // by this builder | |
d1cd2474 | 134 | |
e118b27e | 135 | ClassDef(AliMUONVGeometryBuilder,3) // MUON chamber geometry base class |
d1cd2474 | 136 | }; |
137 | ||
e118b27e | 138 | // inline functions |
139 | ||
140 | inline Int_t AliMUONVGeometryBuilder::NofGeometries() const | |
141 | { return fModuleGeometries->GetEntriesFast(); } | |
142 | ||
143 | inline AliMUONGeometryModule* AliMUONVGeometryBuilder::Geometry(Int_t i) const | |
144 | { return (AliMUONGeometryModule*)fModuleGeometries->At(i); } | |
145 | ||
d1cd2474 | 146 | #endif //ALI_MUON_V_GEOMETRY_BUILDER_H |