]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONVGeometryBuilder.h
Incrementing class definitions
[u/mrichter/AliRoot.git] / MUON / AliMUONVGeometryBuilder.h
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 //
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
16 #include <fstream>
17
18 #include <TObject.h>
19
20 class TGeoTranslation;
21 class TGeoRotation;
22 class TGeoCombiTrans;
23 class TObjArray;
24
25 class AliMUONChamber;
26 class AliMUONChamberGeometry;
27 class AliMUONGeometryEnvelopeStore;
28 class AliMUONGeometryTransformStore;
29 class AliMUONGeometrySVMap;
30
31 class AliMUONVGeometryBuilder : public TObject
32 {
33   public:
34     AliMUONVGeometryBuilder(const TString& fileName,
35                             AliMUONChamber* ch1,
36                             AliMUONChamber* ch2 = 0,
37                             AliMUONChamber* ch3 = 0,
38                             AliMUONChamber* ch4 = 0,
39                             AliMUONChamber* ch5 = 0,
40                             AliMUONChamber* ch6 = 0);
41     AliMUONVGeometryBuilder();
42     virtual ~AliMUONVGeometryBuilder();
43   
44     // methods
45     virtual void  FillTransformations() const;
46     virtual void  RebuildSVMaps() const;
47     virtual Bool_t  ReadTransformations() const;
48     virtual Bool_t  ReadSVMap() const;
49     virtual Bool_t  WriteTransformations() const;
50     virtual Bool_t  WriteSVMap(Bool_t rebuild) const;
51     
52     virtual void CreateMaterials() {}  // make = 0; ?
53                   // Function to be overriden in a concrete chamber/station
54                   // geometry builder class.
55                   // Only materials that are not defined in the common
56                   // functions should be defined here.
57     virtual void CreateGeometry() = 0;
58                   // Function to be overriden in a concrete chamber/station
59                   // geometry builder class.
60                   // The geometry built there should not be placed
61                   // in ALIC; but all volumes going to ALIC
62                   // have to be added as envelopes to the chamber
63                   // geometries
64                   // (They will be then placed automatically 
65                   // usind the provided transformation.
66     virtual void SetTransformations() = 0;
67                   // Function to be overriden in a concrete chamber/station
68                   // geometry class.
69                   // The transformation of each chamber(s) wrt ALICE
70                   // should be defined and set to its geometry class. 
71     virtual void SetSensitiveVolumes() = 0;
72                   // Function to be overriden in a concrete chamber/station
73                   // geometry class.
74                   // The sensitive volumes Ids for each chamber
75                   // should be defined and set to its geometry class. 
76
77   protected:
78     AliMUONVGeometryBuilder(const AliMUONVGeometryBuilder& rhs);
79
80     // operators  
81     AliMUONVGeometryBuilder& operator = (const AliMUONVGeometryBuilder& rhs);
82
83     // methods
84     AliMUONChamber*                GetChamber(Int_t chamberId) const;
85     AliMUONGeometryEnvelopeStore*  GetEnvelopes(Int_t chamberId) const;
86     AliMUONGeometryTransformStore* GetTransforms(Int_t chamberId) const;
87     AliMUONGeometrySVMap*          GetSVMap(Int_t chamberId) const;
88     
89   private:
90     //methods
91     TString  ComposePath(const TString& volName, Int_t copyNo) const; 
92     void     MapSV(const TString&path, const TString& volName, 
93                   Int_t detElemId) const;
94
95     void FillData(Int_t chamberId, 
96                   Double_t x, Double_t y, Double_t z,
97                   Double_t a1, Double_t a2, Double_t a3, 
98                   Double_t a4, Double_t a5, Double_t a6) const; 
99     void FillData(Int_t id, const TString& volName, Int_t copyNo,
100                   Double_t x, Double_t y, Double_t z,
101                   Double_t a1, Double_t a2, Double_t a3, 
102                   Double_t a4, Double_t a5, Double_t a6) const;
103     void FillData(const TString& sensVolumePath, Int_t detElemId) const;                   
104
105     TString ReadData1(ifstream& in) const;
106     TString ReadData2(ifstream& in) const;
107     TString ReadData3(ifstream& in) const;
108
109     void WriteTransform(ofstream& out, const TGeoCombiTrans* transform) const;
110     void WriteData1(ofstream& out) const;
111     void WriteData2(ofstream& out) const;
112     void WriteData3(ofstream& out) const;
113
114     // static data members
115     static const TString fgkTransformFileNamePrefix; // the prefix for the name 
116                                                  // of file with transformations
117     static const TString fgkSVMapFileNamePrefix; // the prefix for the name of file 
118                                                  // with sensitive volume map
119     static const TString fgkOutFileNameSuffix;   // the suffix for the name of 
120                                                  // generated files
121     
122     // data members
123     TString     fTransformFileName; // the name file with transformations 
124     TString     fSVMapFileName;     // the name file with sensitive volume map 
125     TObjArray*  fChambers; // the chambers which geometry will be built
126                            // by this builder
127     
128   ClassDef(AliMUONVGeometryBuilder,2) // MUON chamber geometry base class
129 };
130
131 #endif //ALI_MUON_V_GEOMETRY_BUILDER_H