1 | // |
---|
2 | // ******************************************************************** |
---|
3 | // * License and Disclaimer * |
---|
4 | // * * |
---|
5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
7 | // * conditions of the Geant4 Software License, included in the file * |
---|
8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
9 | // * include a list of copyright holders. * |
---|
10 | // * * |
---|
11 | // * Neither the authors of this software system, nor their employing * |
---|
12 | // * institutes,nor the agencies providing financial support for this * |
---|
13 | // * work make any representation or warranty, express or implied, * |
---|
14 | // * regarding this software system or assume any liability for its * |
---|
15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
16 | // * for the full disclaimer and the limitation of liability. * |
---|
17 | // * * |
---|
18 | // * This code implementation is the result of the scientific and * |
---|
19 | // * technical work of the GEANT4 collaboration. * |
---|
20 | // * By using, copying, modifying or distributing the software (or * |
---|
21 | // * any work based on the software) you agree to acknowledge its * |
---|
22 | // * use in resulting scientific publications, and indicate your * |
---|
23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
24 | // ******************************************************************** |
---|
25 | // |
---|
26 | // |
---|
27 | // $Id: MedLinacDetectorConstruction.hh,v 1.7 2006/06/29 16:03:35 gunter Exp $ |
---|
28 | // |
---|
29 | // |
---|
30 | // Code developed by: M. Piergentili |
---|
31 | // |
---|
32 | #ifndef MedLinacDetectorConstruction_H |
---|
33 | #define MedLinacDetectorConstruction_H 1 |
---|
34 | #include "MedLinacDetectorMessenger.hh" |
---|
35 | |
---|
36 | #include "G4VUserDetectorConstruction.hh" |
---|
37 | #include "globals.hh" |
---|
38 | #include "G4VisAttributes.hh" |
---|
39 | |
---|
40 | class G4LogicalVolume; |
---|
41 | class G4VPhysicalVolume; |
---|
42 | class G4Material; |
---|
43 | class G4VPhysicalVolume; |
---|
44 | class MedLinacDetectorMessenger; |
---|
45 | class MedLinacVGeometryComponent; |
---|
46 | class MedLinacPhantomSD; |
---|
47 | class MedLinacPhantomROGeometry; |
---|
48 | class MedLinacVoxelParameterisation; |
---|
49 | class MedLinacDecorator; |
---|
50 | |
---|
51 | //#include "PhysicalConstants.hh" |
---|
52 | |
---|
53 | class MedLinacDetectorConstruction : public G4VUserDetectorConstruction |
---|
54 | { |
---|
55 | public: |
---|
56 | MedLinacDetectorConstruction(); |
---|
57 | ~MedLinacDetectorConstruction(); |
---|
58 | |
---|
59 | public: |
---|
60 | |
---|
61 | void SetJawX1Pos_x (G4double); |
---|
62 | void SetJawX2Pos_x (G4double); |
---|
63 | void SetJawY1Pos_y (G4double); |
---|
64 | void SetJawY2Pos_y (G4double); |
---|
65 | void SetPhantomDim (G4double); |
---|
66 | void SetNumberOfVoxels (G4int); |
---|
67 | void SetMaxStep (G4double); |
---|
68 | |
---|
69 | G4VPhysicalVolume* Construct(); |
---|
70 | |
---|
71 | void UpdateGeometry(); |
---|
72 | void ConstructVolume(); |
---|
73 | void ConstructSensitiveDetector(); |
---|
74 | //void SetPhantomMaterial(G4String); |
---|
75 | |
---|
76 | const G4int GetNumVoxelX() {return numberOfVoxelsAlongX;} |
---|
77 | const G4int GetNumVoxelY() {return numberOfVoxelsAlongY;} |
---|
78 | const G4int GetNumVoxelZ() {return numberOfVoxelsAlongZ;} |
---|
79 | const G4double VoxelWidth_X(){return phantomDim_x/numberOfVoxelsAlongX;} |
---|
80 | const G4double VoxelWidth_Y(){return phantomDim_y/numberOfVoxelsAlongY;} |
---|
81 | const G4double VoxelWidth_Z(){return phantomDim_z/numberOfVoxelsAlongZ;} |
---|
82 | void ComputeDimVoxel() {dimVoxel = phantomDim_x/numberOfVoxelsAlongX;} |
---|
83 | |
---|
84 | static MedLinacDetectorConstruction* GetInstance(G4String); |
---|
85 | |
---|
86 | |
---|
87 | public: |
---|
88 | |
---|
89 | void PrintParameters(); |
---|
90 | |
---|
91 | G4double GetJawX1Pos_x() {return fieldX1;}; |
---|
92 | G4double GetJawX2Pos_x() {return fieldX2;}; |
---|
93 | G4double GetJawY1Pos_y() {return fieldY1;}; |
---|
94 | G4double GetJawY2Pos_y() {return fieldY2;}; |
---|
95 | G4double GetPhantomDim() {return phantomDim;}; |
---|
96 | G4int GetNumberOfVoxels() {return numberOfVoxels;}; |
---|
97 | G4double GetMaxStep() {return maxStep;}; |
---|
98 | |
---|
99 | private: |
---|
100 | |
---|
101 | G4double fieldX1; |
---|
102 | G4double fieldX2; |
---|
103 | G4double fieldY1; |
---|
104 | G4double fieldY2; |
---|
105 | G4double phantomDim; |
---|
106 | G4int numberOfVoxels; |
---|
107 | G4double maxStep; |
---|
108 | |
---|
109 | G4VPhysicalVolume* ConstructGeom(); |
---|
110 | |
---|
111 | MedLinacVGeometryComponent* pHead; |
---|
112 | MedLinacDetectorMessenger* detectorMessenger; |
---|
113 | MedLinacDecorator* decorator; |
---|
114 | MedLinacDecorator* decorator1; |
---|
115 | MedLinacDetectorConstruction(G4String); |
---|
116 | |
---|
117 | static MedLinacDetectorConstruction* instance; |
---|
118 | |
---|
119 | MedLinacPhantomSD* phantomSD;//pointer to sensitive detector |
---|
120 | MedLinacPhantomROGeometry* phantomROGeometry;//pointer to ROGeometry |
---|
121 | |
---|
122 | G4double phantomDim_x; //Phantom XDimension |
---|
123 | G4double phantomDim_y; //Phantom YDimension |
---|
124 | G4double phantomDim_z; //Phantom ZDimension |
---|
125 | |
---|
126 | |
---|
127 | G4int numberOfVoxelsAlongX; //Number of voxels along x axis |
---|
128 | G4int numberOfVoxelsAlongY; //Number of voxels along y axis |
---|
129 | G4int numberOfVoxelsAlongZ; //Number of voxels along z axis |
---|
130 | G4String sensitiveDetectorName; |
---|
131 | G4double dimVoxel; |
---|
132 | // Logical volumes |
---|
133 | // |
---|
134 | G4LogicalVolume* experimentalHall_log; |
---|
135 | G4LogicalVolume* vacuumBlock_log; |
---|
136 | G4LogicalVolume* JawY1_log; |
---|
137 | G4LogicalVolume* JawY2_log; |
---|
138 | G4LogicalVolume* JawX1_log; |
---|
139 | G4LogicalVolume* JawX2_log; |
---|
140 | G4LogicalVolume* Phantom_log; |
---|
141 | |
---|
142 | // Physical volumes |
---|
143 | // |
---|
144 | G4VPhysicalVolume* experimentalHall_phys; |
---|
145 | G4VPhysicalVolume* vacuumBlock_phys; |
---|
146 | G4VPhysicalVolume* JawY1_phys; |
---|
147 | G4VPhysicalVolume* JawY2_phys; |
---|
148 | G4VPhysicalVolume* JawX1_phys; |
---|
149 | G4VPhysicalVolume* JawX2_phys; |
---|
150 | G4VPhysicalVolume* Phantom_phys; |
---|
151 | //Vis |
---|
152 | // |
---|
153 | G4VisAttributes* simpleH2OVisAtt; |
---|
154 | G4VisAttributes* simpleTungstenWVisAtt; |
---|
155 | G4VisAttributes* simpleTungstenSVisAtt; |
---|
156 | G4VisAttributes* simpleWorldVisAtt; |
---|
157 | |
---|
158 | }; |
---|
159 | |
---|
160 | #endif |
---|
161 | |
---|