Smaller changes
[u/mrichter/AliRoot.git] / AliGeant4 / AliModulesComposition.h
1 // $Id$
2 // Category: geometry
3 //
4 // Author: I. Hrivnacova
5 //
6 // Class AliModulesComposition
7 // ---------------------------
8 // Detector construction base class for building geometry
9 // composed from modules.
10
11 #ifndef ALI_MODULES_COMPOSITION_H
12 #define ALI_MODULES_COMPOSITION_H
13
14 #include "AliModulesCompositionMessenger.h"
15 #include "AliModuleType.h"
16 #include "AliVerbose.h"
17
18 #include <G4VUserDetectorConstruction.hh>
19 #include <globals.hh>
20 #include <g4std/vector>
21
22 class AliModuleConstruction;
23 class AliMagneticField;
24
25 class G4VPhysicalVolume;
26
27 class AliModulesComposition : public G4VUserDetectorConstruction,
28                               public AliVerbose
29 {
30   typedef G4std::vector<AliModuleConstruction*> AliModuleConstructionVector;
31   
32   public:
33     AliModulesComposition();
34     // --> protected
35     // AliModulesComposition(const AliModulesComposition& right);
36     virtual ~AliModulesComposition();
37
38     // methods
39     virtual G4VPhysicalVolume* Construct() = 0;
40     virtual void GenerateXMLGeometry() const = 0;
41     virtual void PrintMaterials() const;
42
43     // set methods
44     void SetMagField(G4double fieldValue);
45     void SetReadGeometry(G4bool readGeometry);
46     void SetWriteGeometry(G4bool writeGeometry);
47     
48   protected:
49     AliModulesComposition(const AliModulesComposition& right);
50
51     // operators
52     AliModulesComposition& operator=(const AliModulesComposition& right);
53
54     // methods  
55     void AddModule(const G4String& name, 
56                    G4int version,
57                    AliModuleType moduleType = kDetector);
58     void ConstructModules();
59     void SetProcessConfigToModules(G4bool processConfig);
60     
61   private:    
62     // methods
63     void Configure();
64     void CreateG4Geometry();
65     void SetReadGeometryToModules(G4bool readGeometry);
66     void SetWriteGeometryToModules(G4bool writeGeometry);
67
68     // data members
69     AliModulesCompositionMessenger  fMessenger;      //messenger
70     AliModuleConstructionVector     fModuleConstructionVector; //..
71                                         //vector of AliModuleConstruction
72     AliMagneticField*  fMagneticField;  //magnetic field
73     G4bool             fReadGeometry;   //option applied to all modules
74     G4bool             fWriteGeometry;  //option applied to all modules     
75 };
76
77 // inline methods
78
79 inline void AliModulesComposition::SetReadGeometry(G4bool readGeometry)
80 { fReadGeometry = readGeometry; }
81
82 inline void AliModulesComposition::SetWriteGeometry(G4bool writeGeometry)
83 { fWriteGeometry = writeGeometry; }
84
85 #endif //ALI_MODULES_COMPOSITION_H
86