]>
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 | ||
ba6f5bec | 11 | #include "AliSingleModuleConstruction.h" |
676fb573 | 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 | { | |
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); | |
43 | void SwitchDetOff(G4String moduleName); | |
44 | void PrintSwitchedDets() const; | |
45 | void PrintAvailableDets() const; | |
46 | ||
47 | // set methods | |
48 | void SetMagField(G4double fieldValue); | |
49 | void SetAllLVSensitive(G4bool allLVSensitive); | |
50 | void SetReadGeometry(G4bool readGeometry); | |
51 | void SetWriteGeometry(G4bool writeGeometry); | |
52 | void SetProcessConfigToModules(G4bool processConfig); | |
53 | ||
54 | // get methods | |
55 | const G4RWTPtrOrderedVector<AliDetSwitch>& GetDetSwitchVector() const; | |
56 | G4String GetSwitchedDetsList() const; | |
57 | G4String GetAvailableDetsList() const; | |
58 | G4String GetAvailableDetsListWithCommas() const; | |
59 | G4String GetDetNamesList() const; | |
60 | G4String GetDetNamesListWithCommas() const; | |
61 | //G4ThreeVector GetMagField() const; | |
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 | ||
77 | private: | |
78 | // methods | |
79 | void SetReadGeometryToModules(G4bool readGeometry); | |
80 | void SetWriteGeometryToModules(G4bool writeGeometry); | |
81 | void SetAllLVSensitiveToModules(G4bool allSensitive); | |
82 | ||
83 | // data members | |
ba6f5bec | 84 | AliDetSwitchRWVector fDetSwitchVector; //.. |
85 | //vector of AliDetSwitch | |
86 | AliSingleModuleConstructionRWVector fModuleConstructionVector; //.. | |
87 | //vector of | |
88 | //AliSingleModuleConstruction | |
89 | AliMoreModulesConstruction* fMoreModulesConstruction; //.. | |
90 | //AliMoreModulesConstruction | |
676fb573 | 91 | |
92 | AliMagneticField* fMagneticField; //magnetic field | |
93 | AliModulesCompositionMessenger* fMessenger; //messenger | |
ba6f5bec | 94 | G4bool fAllLVSensitive; //option applied to all modules |
95 | G4bool fReadGeometry; //option applied to all modules | |
96 | G4bool fWriteGeometry; //option applied to all modules | |
676fb573 | 97 | }; |
98 | ||
99 | // inline methods | |
100 | ||
101 | inline void AliModulesComposition::SetAllLVSensitive(G4bool allLVSensitive) | |
102 | { fAllLVSensitive = allLVSensitive; } | |
103 | ||
104 | inline void AliModulesComposition::SetReadGeometry(G4bool readGeometry) | |
105 | { fReadGeometry = readGeometry; } | |
106 | ||
107 | inline void AliModulesComposition::SetWriteGeometry(G4bool writeGeometry) | |
108 | { fWriteGeometry = writeGeometry; } | |
109 | ||
110 | #endif //ALI_MODULES_COMPOSITION_H | |
111 |