]>
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 | ||
11 | #include "AliModuleConstruction.h" | |
12 | #include "AliDetSwitch.h" | |
13 | #include "AliModuleType.h" | |
14 | ||
15 | #include <G4VUserDetectorConstruction.hh> | |
16 | #include <globals.hh> | |
17 | ||
18 | #include <g4rw/tpordvec.h> | |
19 | ||
20 | class AliModulesCompositionMessenger; | |
21 | class AliMoreModulesConstruction; | |
22 | class AliMagneticField; | |
23 | ||
24 | class G4VPhysicalVolume; | |
25 | ||
26 | class AliModulesComposition : public G4VUserDetectorConstruction | |
27 | { | |
28 | typedef G4RWTPtrOrderedVector<AliDetSwitch> AliDetSwitchVector; | |
29 | typedef G4RWTPtrOrderedVector<AliModuleConstruction> AliModuleConstructionVector; | |
30 | ||
31 | public: | |
32 | AliModulesComposition(); | |
33 | // --> protected | |
34 | // AliModulesComposition(const AliModulesComposition& right); | |
35 | virtual ~AliModulesComposition(); | |
36 | ||
37 | // methods | |
38 | virtual G4VPhysicalVolume* Construct() = 0; | |
39 | void SwitchDetOn(G4String moduleNameVer); | |
40 | void SwitchDetOn(G4String moduleName, G4int version); | |
41 | void SwitchDetOnDefault(G4String moduleName); | |
42 | void SwitchDetOff(G4String moduleName); | |
43 | void PrintSwitchedDets() const; | |
44 | void PrintAvailableDets() const; | |
45 | ||
46 | // set methods | |
47 | void SetMagField(G4double fieldValue); | |
48 | void SetAllLVSensitive(G4bool allLVSensitive); | |
49 | void SetReadGeometry(G4bool readGeometry); | |
50 | void SetWriteGeometry(G4bool writeGeometry); | |
51 | void SetProcessConfigToModules(G4bool processConfig); | |
52 | ||
53 | // get methods | |
54 | const G4RWTPtrOrderedVector<AliDetSwitch>& GetDetSwitchVector() const; | |
55 | G4String GetSwitchedDetsList() const; | |
56 | G4String GetAvailableDetsList() const; | |
57 | G4String GetAvailableDetsListWithCommas() const; | |
58 | G4String GetDetNamesList() const; | |
59 | G4String GetDetNamesListWithCommas() const; | |
60 | //G4ThreeVector GetMagField() const; | |
61 | ||
62 | protected: | |
63 | AliModulesComposition(const AliModulesComposition& right); | |
64 | ||
65 | // operators | |
66 | AliModulesComposition& operator=(const AliModulesComposition& right); | |
67 | ||
68 | // methods | |
69 | void AddDetSwitch(AliDetSwitch* detSwitch); | |
70 | void AddSingleModuleConstruction(G4String moduleName, G4int version, | |
71 | AliModuleType moduleType = kDetector); | |
72 | void AddMoreModuleConstruction(G4String moduleName, G4int version, | |
73 | AliModuleType moduleType = kDetector); | |
74 | void ConstructModules(); | |
75 | ||
76 | private: | |
77 | // methods | |
78 | void SetReadGeometryToModules(G4bool readGeometry); | |
79 | void SetWriteGeometryToModules(G4bool writeGeometry); | |
80 | void SetAllLVSensitiveToModules(G4bool allSensitive); | |
81 | ||
82 | // data members | |
83 | AliDetSwitchVector fDetSwitchVector; //vector of AliDetSwitch | |
84 | AliModuleConstructionVector fModuleConstructionVector; //vector of | |
85 | //AliModuleConstruction | |
86 | AliMoreModulesConstruction* fMoreModulesConstruction; //AliMoreModulesConstruction | |
87 | ||
88 | AliMagneticField* fMagneticField; //magnetic field | |
89 | AliModulesCompositionMessenger* fMessenger; //messenger | |
90 | G4bool fAllLVSensitive; //option applied to all modules | |
91 | G4bool fReadGeometry; //option applied to all modules | |
92 | G4bool fWriteGeometry; //option applied to all modules | |
93 | }; | |
94 | ||
95 | // inline methods | |
96 | ||
97 | inline void AliModulesComposition::SetAllLVSensitive(G4bool allLVSensitive) | |
98 | { fAllLVSensitive = allLVSensitive; } | |
99 | ||
100 | inline void AliModulesComposition::SetReadGeometry(G4bool readGeometry) | |
101 | { fReadGeometry = readGeometry; } | |
102 | ||
103 | inline void AliModulesComposition::SetWriteGeometry(G4bool writeGeometry) | |
104 | { fWriteGeometry = writeGeometry; } | |
105 | ||
106 | #endif //ALI_MODULES_COMPOSITION_H | |
107 |