]>
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); | |
52 | void SetAllLVSensitive(G4bool allLVSensitive); | |
72c37c68 | 53 | void SetForceAllLVSensitive(G4bool allLVSensitive); |
676fb573 | 54 | void SetReadGeometry(G4bool readGeometry); |
55 | void SetWriteGeometry(G4bool writeGeometry); | |
56 | void SetProcessConfigToModules(G4bool processConfig); | |
57 | ||
58 | // get methods | |
676fb573 | 59 | G4String GetSwitchedDetsList() const; |
60 | G4String GetAvailableDetsList() const; | |
61 | G4String GetAvailableDetsListWithCommas() const; | |
62 | G4String GetDetNamesList() const; | |
63 | G4String GetDetNamesListWithCommas() const; | |
676fb573 | 64 | |
65 | protected: | |
66 | AliModulesComposition(const AliModulesComposition& right); | |
67 | ||
68 | // operators | |
69 | AliModulesComposition& operator=(const AliModulesComposition& right); | |
70 | ||
71 | // methods | |
72 | void AddDetSwitch(AliDetSwitch* detSwitch); | |
73 | void AddSingleModuleConstruction(G4String moduleName, G4int version, | |
74 | AliModuleType moduleType = kDetector); | |
75 | void AddMoreModuleConstruction(G4String moduleName, G4int version, | |
76 | AliModuleType moduleType = kDetector); | |
77 | void ConstructModules(); | |
78 | ||
886f0b7c | 79 | // get methods |
80 | AliDetSwitch* GetDetSwitch(const G4String& detName); | |
81 | ||
82 | // data members | |
83 | AliDetSwitchRWVector fDetSwitchVector; //vector of AliDetSwitch | |
84 | ||
676fb573 | 85 | private: |
86 | // methods | |
87 | void SetReadGeometryToModules(G4bool readGeometry); | |
88 | void SetWriteGeometryToModules(G4bool writeGeometry); | |
89 | void SetAllLVSensitiveToModules(G4bool allSensitive); | |
90 | ||
91 | // data members | |
ba6f5bec | 92 | AliSingleModuleConstructionRWVector fModuleConstructionVector; //.. |
93 | //vector of | |
94 | //AliSingleModuleConstruction | |
95 | AliMoreModulesConstruction* fMoreModulesConstruction; //.. | |
96 | //AliMoreModulesConstruction | |
676fb573 | 97 | |
98 | AliMagneticField* fMagneticField; //magnetic field | |
99 | AliModulesCompositionMessenger* fMessenger; //messenger | |
72c37c68 | 100 | G4bool fAllLVSensitive; //option applied to all modules |
101 | //(overriden by modules specific setting) | |
102 | G4bool fForceAllLVSensitive; //option applied to all modules | |
103 | //(overrides modules specific setting) | |
104 | G4bool fReadGeometry; //option applied to all modules | |
6f6d3706 | 105 | G4bool fWriteGeometry; //option applied to all modules |
676fb573 | 106 | }; |
107 | ||
108 | // inline methods | |
109 | ||
110 | inline void AliModulesComposition::SetAllLVSensitive(G4bool allLVSensitive) | |
111 | { fAllLVSensitive = allLVSensitive; } | |
112 | ||
72c37c68 | 113 | inline void AliModulesComposition::SetForceAllLVSensitive(G4bool forceAllLVSensitive) |
114 | { fForceAllLVSensitive = forceAllLVSensitive; } | |
115 | ||
676fb573 | 116 | inline void AliModulesComposition::SetReadGeometry(G4bool readGeometry) |
117 | { fReadGeometry = readGeometry; } | |
118 | ||
119 | inline void AliModulesComposition::SetWriteGeometry(G4bool writeGeometry) | |
120 | { fWriteGeometry = writeGeometry; } | |
121 | ||
122 | #endif //ALI_MODULES_COMPOSITION_H | |
123 |