]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ |
2 | // Category: geometry | |
3 | // | |
4 | // Detector construction base class for building geometry | |
5 | // composed from independent modules with availability of interactive modules | |
6 | // setup. | |
7 | ||
8 | #ifndef ALI_MODULES_COMPOSITION_H | |
9 | #define ALI_MODULES_COMPOSITION_H | |
10 | ||
676fb573 | 11 | #include "AliModuleType.h" |
12 | ||
13 | #include <G4VUserDetectorConstruction.hh> | |
14 | #include <globals.hh> | |
15 | ||
16 | #include <g4rw/tpordvec.h> | |
17 | ||
c97337f9 | 18 | class AliSingleModuleConstruction; |
19 | class AliDetSwitch; | |
676fb573 | 20 | class AliModulesCompositionMessenger; |
21 | class AliMoreModulesConstruction; | |
22 | class AliMagneticField; | |
23 | ||
24 | class G4VPhysicalVolume; | |
25 | ||
26 | class AliModulesComposition : public G4VUserDetectorConstruction | |
27 | { | |
ba6f5bec | 28 | typedef G4RWTPtrOrderedVector<AliDetSwitch> AliDetSwitchRWVector; |
29 | typedef G4RWTPtrOrderedVector<AliSingleModuleConstruction> | |
30 | AliSingleModuleConstructionRWVector; | |
676fb573 | 31 | |
32 | public: | |
33 | AliModulesComposition(); | |
34 | // --> protected | |
35 | // AliModulesComposition(const AliModulesComposition& right); | |
36 | virtual ~AliModulesComposition(); | |
37 | ||
38 | // methods | |
39 | virtual G4VPhysicalVolume* Construct() = 0; | |
40 | void SwitchDetOn(G4String moduleNameVer); | |
41 | void SwitchDetOn(G4String moduleName, G4int version); | |
42 | void SwitchDetOnDefault(G4String moduleName); | |
6f6d3706 | 43 | void SwitchDetOnPPR(G4String moduleName); |
676fb573 | 44 | void SwitchDetOff(G4String moduleName); |
45 | void PrintSwitchedDets() const; | |
46 | void PrintAvailableDets() const; | |
51b5011c | 47 | void PrintMaterials() const; |
48 | void GenerateXMLGeometry() const; | |
676fb573 | 49 | |
50 | // set methods | |
51 | void SetMagField(G4double fieldValue); | |
676fb573 | 52 | void SetReadGeometry(G4bool readGeometry); |
53 | void SetWriteGeometry(G4bool writeGeometry); | |
54 | void SetProcessConfigToModules(G4bool processConfig); | |
55 | ||
56 | // get methods | |
676fb573 | 57 | G4String GetSwitchedDetsList() const; |
58 | G4String GetAvailableDetsList() const; | |
59 | G4String GetAvailableDetsListWithCommas() const; | |
60 | G4String GetDetNamesList() const; | |
61 | G4String GetDetNamesListWithCommas() const; | |
676fb573 | 62 | |
63 | protected: | |
64 | AliModulesComposition(const AliModulesComposition& right); | |
65 | ||
66 | // operators | |
67 | AliModulesComposition& operator=(const AliModulesComposition& right); | |
68 | ||
69 | // methods | |
70 | void AddDetSwitch(AliDetSwitch* detSwitch); | |
71 | void AddSingleModuleConstruction(G4String moduleName, G4int version, | |
72 | AliModuleType moduleType = kDetector); | |
73 | void AddMoreModuleConstruction(G4String moduleName, G4int version, | |
74 | AliModuleType moduleType = kDetector); | |
75 | void ConstructModules(); | |
76 | ||
886f0b7c | 77 | // get methods |
78 | AliDetSwitch* GetDetSwitch(const G4String& detName); | |
79 | ||
80 | // data members | |
81 | AliDetSwitchRWVector fDetSwitchVector; //vector of AliDetSwitch | |
82 | ||
676fb573 | 83 | private: |
84 | // methods | |
85 | void SetReadGeometryToModules(G4bool readGeometry); | |
86 | void SetWriteGeometryToModules(G4bool writeGeometry); | |
676fb573 | 87 | |
88 | // data members | |
ba6f5bec | 89 | AliSingleModuleConstructionRWVector fModuleConstructionVector; //.. |
90 | //vector of | |
91 | //AliSingleModuleConstruction | |
92 | AliMoreModulesConstruction* fMoreModulesConstruction; //.. | |
93 | //AliMoreModulesConstruction | |
676fb573 | 94 | |
95 | AliMagneticField* fMagneticField; //magnetic field | |
96 | AliModulesCompositionMessenger* fMessenger; //messenger | |
72c37c68 | 97 | G4bool fReadGeometry; //option applied to all modules |
6f6d3706 | 98 | G4bool fWriteGeometry; //option applied to all modules |
676fb573 | 99 | }; |
100 | ||
101 | // inline methods | |
102 | ||
676fb573 | 103 | inline void AliModulesComposition::SetReadGeometry(G4bool readGeometry) |
104 | { fReadGeometry = readGeometry; } | |
105 | ||
106 | inline void AliModulesComposition::SetWriteGeometry(G4bool writeGeometry) | |
107 | { fWriteGeometry = writeGeometry; } | |
108 | ||
109 | #endif //ALI_MODULES_COMPOSITION_H | |
110 |