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: XrayFluoDetectorConstruction.hh |
---|
28 | // GEANT4 tag $Name: xray_fluo-V03-02-00 |
---|
29 | // |
---|
30 | // Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) |
---|
31 | // |
---|
32 | // History: |
---|
33 | // ----------- |
---|
34 | // 28 Nov 2001 Elena Guardincerri Created |
---|
35 | // |
---|
36 | // ------------------------------------------------------------------- |
---|
37 | |
---|
38 | #ifndef XrayFluoDetectorConstruction_h |
---|
39 | #define XrayFluoDetectorConstruction_h 1 |
---|
40 | |
---|
41 | #include "G4VUserDetectorConstruction.hh" |
---|
42 | #include "globals.hh" |
---|
43 | #include "G4RotationMatrix.hh" |
---|
44 | class G4Box; |
---|
45 | class G4Tubs; |
---|
46 | class G4LogicalVolume; |
---|
47 | class G4VPhysicalVolume; |
---|
48 | class G4Material; |
---|
49 | class XrayFluoDetectorMessenger; |
---|
50 | class XrayFluoHPGeSD; |
---|
51 | |
---|
52 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
53 | |
---|
54 | class XrayFluoDetectorConstruction : public G4VUserDetectorConstruction |
---|
55 | { |
---|
56 | public: |
---|
57 | |
---|
58 | XrayFluoDetectorConstruction(); |
---|
59 | ~XrayFluoDetectorConstruction(); |
---|
60 | |
---|
61 | public: |
---|
62 | |
---|
63 | G4VPhysicalVolume* Construct(); |
---|
64 | |
---|
65 | void UpdateGeometry(); |
---|
66 | |
---|
67 | public: |
---|
68 | |
---|
69 | void PrintApparateParameters(); |
---|
70 | |
---|
71 | G4double GetWorldSizeZ() {return WorldSizeZ;}; |
---|
72 | G4double GetWorldSizeXY() {return WorldSizeXY;}; |
---|
73 | |
---|
74 | G4double GetDeviceThickness() {return DeviceThickness;}; |
---|
75 | G4double GetDeviceSizeX() {return DeviceSizeX;}; |
---|
76 | G4double GetDeviceSizeY() {return DeviceSizeY;}; |
---|
77 | G4double GetPixelSizeXY() {return PixelSizeXY;}; |
---|
78 | G4double GetContactSizeXY() {return ContactSizeXY;}; |
---|
79 | |
---|
80 | G4int GetNbOfPixels() {return NbOfPixels;}; |
---|
81 | G4int GetNbOfPixelRows() {return NbOfPixelRows;}; |
---|
82 | G4int GetNbOfPixelColumns() {return NbOfPixelColumns;}; |
---|
83 | |
---|
84 | G4Material* GetOhmicPosMaterial() {return OhmicPosMaterial;}; |
---|
85 | G4double GetOhmicPosThickness() {return OhmicPosThickness;}; |
---|
86 | |
---|
87 | G4Material* GetOhmicNegMaterial() {return OhmicNegMaterial;}; |
---|
88 | G4double GetOhmicNegThickness() {return OhmicNegThickness;}; |
---|
89 | |
---|
90 | const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;}; |
---|
91 | const G4VPhysicalVolume* GetHPGe() {return physiHPGe;}; |
---|
92 | const G4VPhysicalVolume* GetSample() {return physiSample;}; |
---|
93 | const G4VPhysicalVolume* GetDia1() {return physiDia1;}; |
---|
94 | const G4VPhysicalVolume* GetDia3() {return physiDia3;}; |
---|
95 | |
---|
96 | const G4VPhysicalVolume* GetphysiPixel() {return physiPixel;}; |
---|
97 | const G4VPhysicalVolume* GetOhmicPos() {return physiOhmicPos;}; |
---|
98 | const G4VPhysicalVolume* GetOhmicNeg() {return physiOhmicNeg;}; |
---|
99 | |
---|
100 | |
---|
101 | private: |
---|
102 | |
---|
103 | G4double DeviceSizeX; |
---|
104 | G4double DeviceSizeY; |
---|
105 | G4double DeviceThickness; |
---|
106 | |
---|
107 | G4Box* solidWorld; //pointer to the solid World |
---|
108 | G4LogicalVolume* logicWorld; //pointer to the logical World |
---|
109 | G4VPhysicalVolume* physiWorld; //pointer to the physical World |
---|
110 | |
---|
111 | G4Box* solidHPGe; //pointer to the solid Sensor |
---|
112 | G4LogicalVolume* logicHPGe; //pointer to the logical Sensor |
---|
113 | G4VPhysicalVolume* physiHPGe; //pointer to the physical Sensor |
---|
114 | |
---|
115 | G4Box* solidSample; //pointer to the solid Sample |
---|
116 | G4LogicalVolume* logicSample; //pointer to the logical Sample |
---|
117 | G4VPhysicalVolume* physiSample; //pointer to the physical Sample |
---|
118 | |
---|
119 | G4Tubs* solidDia1; //pointer to the solid Diaphragm |
---|
120 | G4LogicalVolume* logicDia1; //pointer to the logical Diaphragm |
---|
121 | G4VPhysicalVolume* physiDia1; //pointer to the physical Diaphragm |
---|
122 | |
---|
123 | G4Tubs* solidDia3; //pointer to the solid Diaphragm |
---|
124 | G4LogicalVolume* logicDia3; //pointer to the logical Diaphragm |
---|
125 | G4VPhysicalVolume* physiDia3; //pointer to the physical Diaphragm |
---|
126 | |
---|
127 | G4Box* solidOhmicPos; |
---|
128 | G4LogicalVolume* logicOhmicPos; |
---|
129 | G4VPhysicalVolume* physiOhmicPos; |
---|
130 | |
---|
131 | G4Box* solidOhmicNeg; |
---|
132 | G4LogicalVolume* logicOhmicNeg; |
---|
133 | G4VPhysicalVolume* physiOhmicNeg; |
---|
134 | |
---|
135 | G4Box* solidPixel; |
---|
136 | G4LogicalVolume* logicPixel; |
---|
137 | G4VPhysicalVolume* physiPixel; |
---|
138 | |
---|
139 | //pointers to the materials used |
---|
140 | G4Material* OhmicPosMaterial; |
---|
141 | G4Material* OhmicNegMaterial; |
---|
142 | G4Material* pixelMaterial; |
---|
143 | G4Material* sampleMaterial; |
---|
144 | G4Material* Dia1Material; |
---|
145 | G4Material* Dia3Material; |
---|
146 | G4Material* defaultMaterial; |
---|
147 | G4double OhmicPosThickness; |
---|
148 | |
---|
149 | G4double OhmicNegThickness; |
---|
150 | |
---|
151 | G4int PixelCopyNb; |
---|
152 | G4int NbOfPixels; |
---|
153 | G4int NbOfPixelRows; |
---|
154 | G4int NbOfPixelColumns; |
---|
155 | G4double PixelThickness; |
---|
156 | |
---|
157 | G4double PixelSizeXY; |
---|
158 | G4double ContactSizeXY; |
---|
159 | |
---|
160 | public: |
---|
161 | |
---|
162 | G4Material* GetSampleMaterial() {return sampleMaterial;}; |
---|
163 | G4Material* GetPixelMaterial() {return pixelMaterial;}; |
---|
164 | G4Material* GetDia1Material() {return Dia1Material;}; |
---|
165 | G4Material* GetDia3Material() {return Dia3Material;}; |
---|
166 | |
---|
167 | private: |
---|
168 | |
---|
169 | G4double SampleThickness; |
---|
170 | G4double SampleSizeXY; |
---|
171 | G4double SiSizeXY; |
---|
172 | G4double Dia1Thickness; |
---|
173 | G4double Dia1SizeXY; |
---|
174 | G4double Dia3Thickness; |
---|
175 | G4double Dia3SizeXY; |
---|
176 | G4double DiaInnerSize; |
---|
177 | G4double Dia3InnerSize; |
---|
178 | G4double DistSi; |
---|
179 | public: |
---|
180 | |
---|
181 | |
---|
182 | G4double GetSampleThickness() {return SampleThickness;}; |
---|
183 | G4double GetSampleSizeXY() {return SampleSizeXY;}; |
---|
184 | |
---|
185 | G4double GetDia1Thickness() {return Dia1Thickness;}; |
---|
186 | G4double GetDia1SizeXY() {return Dia1SizeXY;}; |
---|
187 | |
---|
188 | G4double GetDia3Thickness() {return Dia3Thickness;}; |
---|
189 | G4double GetDia3SizeXY() {return Dia3SizeXY;}; |
---|
190 | |
---|
191 | |
---|
192 | private: |
---|
193 | |
---|
194 | |
---|
195 | G4double ThetaHPGe; |
---|
196 | G4double ThetaDia1; |
---|
197 | G4double ThetaDia3; |
---|
198 | |
---|
199 | G4double DistDe; |
---|
200 | G4double DistDia; |
---|
201 | G4double Dia3Dist; |
---|
202 | G4double PhiHPGe; |
---|
203 | G4double PhiDia1; |
---|
204 | G4double PhiDia3; |
---|
205 | G4double AlphaDia1; |
---|
206 | G4double AlphaDia3; |
---|
207 | |
---|
208 | |
---|
209 | G4RotationMatrix zRotPhiHPGe; |
---|
210 | G4RotationMatrix zRotPhiDia1; |
---|
211 | G4RotationMatrix zRotPhiDia3; |
---|
212 | G4double WorldSizeXY; |
---|
213 | G4double WorldSizeZ; |
---|
214 | |
---|
215 | |
---|
216 | XrayFluoDetectorMessenger* detectorMessenger; //pointer to the Messenger |
---|
217 | |
---|
218 | XrayFluoHPGeSD* HPGeSD; //pointer to the sensitive detector |
---|
219 | |
---|
220 | private: |
---|
221 | |
---|
222 | void DefineMaterials(); |
---|
223 | G4VPhysicalVolume* ConstructApparate(); |
---|
224 | |
---|
225 | //calculates some quantities used to construct geometry |
---|
226 | void ComputeApparateParameters(); |
---|
227 | }; |
---|
228 | |
---|
229 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... |
---|
230 | |
---|
231 | inline void XrayFluoDetectorConstruction::ComputeApparateParameters() |
---|
232 | { |
---|
233 | // Compute derived parameters of the apparate |
---|
234 | |
---|
235 | DeviceThickness = PixelThickness+OhmicNegThickness+OhmicPosThickness; |
---|
236 | DeviceSizeY =NbOfPixelRows*max(ContactSizeXY,PixelSizeXY); |
---|
237 | DeviceSizeX =NbOfPixelColumns*max(ContactSizeXY,PixelSizeXY); |
---|
238 | |
---|
239 | WorldSizeZ = (2 * (DistDe +1.4142 *(max(max(DeviceThickness,DeviceSizeY), DeviceSizeX))))+5*m; |
---|
240 | WorldSizeXY = 2 * (DistDe +1.4142 *Dia1SizeXY)+5*m; |
---|
241 | |
---|
242 | } |
---|
243 | |
---|
244 | #endif |
---|
245 | |
---|
246 | |
---|
247 | |
---|
248 | |
---|
249 | |
---|
250 | |
---|