]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ |
2 | // Category: geometry | |
3 | // | |
4 | // Abstract base class for modular construction of geometry, | |
5 | // providing methods for browsing geometry (list volumes trees, | |
6 | // visualization). | |
7 | ||
8 | #ifndef ALI_MODULE_CONSTRUCTION_H | |
9 | #define ALI_MODULE_CONSTRUCTION_H | |
10 | ||
11 | #include "AliModuleConstructionMessenger.h" | |
12 | #include "AliModule.h" | |
13 | ||
14 | #include <globals.hh> | |
15 | #ifdef ALICE_VISUALIZE | |
16 | #include <G4VisAttributes.hh> | |
17 | #endif | |
18 | ||
19 | class AliLVStructure; | |
20 | ||
21 | class G4VPhysicalVolume; | |
22 | class G4LogicalVolume; | |
23 | #ifdef ALICE_VISUALIZE | |
24 | class G4Colour; | |
25 | #endif | |
26 | ||
27 | class AliModuleConstruction | |
28 | { | |
29 | public: | |
30 | AliModuleConstruction(G4String moduleName); | |
31 | AliModuleConstruction(const AliModuleConstruction& right); | |
32 | // --> protected | |
33 | // AliModuleConstruction(); | |
34 | virtual ~AliModuleConstruction(); | |
35 | ||
36 | // operators | |
37 | AliModuleConstruction& operator=(const AliModuleConstruction &right); | |
38 | G4int operator==(const AliModuleConstruction& right) const; | |
39 | G4int operator!=(const AliModuleConstruction& right) const; | |
40 | ||
41 | // methods | |
42 | virtual void Construct() = 0; | |
43 | void ListAllLVTree(); | |
44 | void ListAllLVTreeLong(); | |
45 | void ListLVTree(G4String lvName); | |
46 | void ListLVTreeLong(G4String lvName); | |
47 | G4LogicalVolume* FindLogicalVolume(G4String name, | |
48 | G4bool silent = false) const; | |
49 | ||
50 | // set methods | |
51 | void SetDetFrame(G4bool warn = true); | |
52 | void SetDetFrame(G4String frameName, G4bool warn = true); | |
53 | void SetReadGeometry(G4bool readGeometry); | |
54 | void SetWriteGeometry(G4bool writeGeometry); | |
55 | #ifdef ALICE_VISUALIZE | |
56 | void SetDetVisibility(G4bool visibility); | |
57 | void SetLVTreeVisibility(G4LogicalVolume* lv, G4bool visibility); | |
58 | void SetVolumeVisibility(G4LogicalVolume* lv, G4bool visibility); | |
59 | void SetDetColour(G4String colName); | |
60 | void SetLVTreeColour(G4LogicalVolume* lv, G4String colName); | |
61 | void SetVolumeColour(G4LogicalVolume* lv, G4String colName); | |
62 | #endif | |
63 | ||
64 | // get methods | |
65 | G4String GetDetName() const; | |
66 | G4LogicalVolume* GetDetFrame() const; | |
67 | AliModule* GetAliModule() const; | |
68 | G4bool GetReadGeometry() const; | |
69 | G4bool GetWriteGeometry() const; | |
70 | G4String GetDataFilePath() const; | |
71 | ||
72 | protected: | |
73 | AliModuleConstruction(); | |
74 | ||
75 | // data members | |
76 | G4String fModuleName; //module name | |
77 | G4String fModuleFrameName; //module frame name | |
78 | //(used for retrieving the frame LV) | |
79 | G4LogicalVolume* fModuleFrameLV; //module frame logical volume | |
80 | ||
81 | // to be moved to AliSingleModuleConstruction | |
82 | // in order to make AliModuleConstruction independent on | |
83 | // AliRoot | |
84 | AliModule* fAliModule; //AliModule | |
85 | G4bool fReadGeometry; //if true: geometry is read from file | |
86 | G4bool fWriteGeometry; //if true: geometry is written to file | |
87 | G4String fDataFilePath; //path to geometry data file | |
88 | ||
89 | private: | |
90 | // methods | |
91 | void RegisterLogicalVolume(G4LogicalVolume* lv, G4String path, | |
92 | AliLVStructure& lvStructure); | |
93 | ||
94 | // data members | |
95 | AliModuleConstructionMessenger* fMessenger; //messenger | |
96 | }; | |
97 | ||
98 | // inline methods | |
99 | ||
100 | inline void AliModuleConstruction::SetReadGeometry(G4bool readGeometry) | |
101 | { fReadGeometry = readGeometry; } | |
102 | ||
103 | inline void AliModuleConstruction::SetWriteGeometry(G4bool writeGeometry) | |
104 | { fWriteGeometry = writeGeometry; } | |
105 | ||
106 | inline G4String AliModuleConstruction::GetDetName() const | |
107 | { return fModuleName; } | |
108 | ||
109 | inline G4LogicalVolume* AliModuleConstruction::GetDetFrame() const | |
110 | { return fModuleFrameLV; } | |
111 | ||
112 | inline AliModule* AliModuleConstruction::GetAliModule() const | |
113 | { return fAliModule; } | |
114 | ||
115 | inline G4bool AliModuleConstruction::GetReadGeometry() const | |
116 | { return fReadGeometry; } | |
117 | ||
118 | inline G4bool AliModuleConstruction::GetWriteGeometry() const | |
119 | { return fWriteGeometry; } | |
120 | ||
121 | inline G4String AliModuleConstruction::GetDataFilePath() const | |
122 | { return fDataFilePath; } | |
123 | ||
124 | #endif //ALI_MODULE_CONSTRUCTION_H | |
125 |