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