Geant4_10
XrayFluoPlaneDetectorConstruction.hh
Go to the documentation of this file.
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:
29 //
30 // Author: Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
31 //
32 // History:
33 // -----------
34 //
35 // 29 Aug 2003 Alfonso Mantero created
36 //
37 // -------------------------------------------------------------------
38 
39 #ifndef XrayFluoPlaneDetectorConstruction_hh
40 #define XrayFluoPlaneDetectorConstruction_hh 1
41 
43 
44 #include "globals.hh"
45 #include "G4RotationMatrix.hh"
47 
50 #include "XrayFluoSD.hh"
51 
52 class G4Box;
53 class G4Sphere;
54 class G4LogicalVolume;
55 class G4VPhysicalVolume;
56 class G4Material;
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
61 
63 {
64 public:
65 
66 
68 
69 public:
70 
72 
73  void UpdateGeometry();
74 
75 
76  void SetPlaneMaterial(G4String newMaterial);
77 
78  void SetDetectorType(G4String type);
79 
81 
82  inline void SetPlaneGranularity(G4bool granularity)
83  {planeGranularity = granularity;};
84 
85  inline void SetGrainDia(G4double size)
86  {grainDia = size;};
87 
88  void DeleteGrainObjects();
89 
90 public:
91 
93 
95 
96 
97  G4double GetWorldSizeZ() {return WorldSizeZ;};
98  G4double GetWorldSizeXY() {return WorldSizeXY;};
99 
100  G4double GetDeviceThickness() {return DeviceThickness;};
101  G4double GetDeviceSizeX() {return DeviceSizeX;};
102  G4double GetDeviceSizeY() {return DeviceSizeY;};
103  G4double GetPixelSizeXY() {return PixelSizeXY;};
104  G4double GetContactSizeXY() {return ContactSizeXY;};
105 
106  G4int GetNbOfPixels() {return NbOfPixels;}; //mandatory for XrayFluoSD
107  G4int GetNbOfPixelRows() {return NbOfPixelRows;};
108  G4int GetNbOfPixelColumns() {return NbOfPixelColumns;};
109 
110  G4Material* GetOhmicPosMaterial() {return OhmicPosMaterial;};
111  G4double GetOhmicPosThickness() {return OhmicPosThickness;};
112 
113  G4Material* GetOhmicNegMaterial() {return OhmicNegMaterial;};
114  G4double GetOhmicNegThickness() {return OhmicNegThickness;};
115 
116  const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
117  const G4VPhysicalVolume* GetHPGe() {return physiHPGe;};
118  const G4VPhysicalVolume* GetPlane() {return physiPlane;};
119  // const G4VPhysicalVolume* GetDia1() {return physiDia1;};
120  // const G4VPhysicalVolume* GetDia3() {return physiDia3;};
121 
122  const G4VPhysicalVolume* GetphysiPixel() {return physiPixel;};
123  const G4VPhysicalVolume* GetOhmicPos() {return physiOhmicPos;};
124  const G4VPhysicalVolume* GetOhmicNeg() {return physiOhmicNeg;};
125 
126 private:
127 
129 
130  static XrayFluoPlaneDetectorConstruction* instance;
131 
132  XrayFluoVDetectorType* detectorType;
133 
134  G4bool planeGranularity;
135 
136  G4double DeviceSizeX;
137  G4double DeviceSizeY;
138  G4double DeviceThickness;
139 
140  G4Box* solidWorld; //pointer to the solid World
141  G4LogicalVolume* logicWorld; //pointer to the logical World
142  G4VPhysicalVolume* physiWorld; //pointer to the physical World
143 
144  G4Box* solidHPGe; //pointer to the solid Sensor
145  G4LogicalVolume* logicHPGe; //pointer to the logical Sensor
146  G4VPhysicalVolume* physiHPGe; //pointer to the physical Sensor
147 
148  G4Box* solidScreen; //pointer to the solid Screen
149  G4LogicalVolume* logicScreen; //pointer to the logical Screen
150  G4VPhysicalVolume* physiScreen; //pointer to the physical Screen
151 
152  G4Box* solidPlane; //pointer to the solid Plane
153  G4LogicalVolume* logicPlane; //pointer to the logical Plane
154  G4VPhysicalVolume* physiPlane; //pointer to the physical Plane
155 
156  // G4Tubs* solidDia1; //pointer to the solid Diaphragm
157  // G4LogicalVolume* logicDia1; //pointer to the logical Diaphragm
158  // G4VPhysicalVolume* physiDia1; //pointer to the physical Diaphragm
159 
160  // G4Tubs* solidDia3; //pointer to the solid Diaphragm
161  // G4LogicalVolume* logicDia3; //pointer to the logical Diaphragm
162  // G4VPhysicalVolume* physiDia3; //pointer to the physical Diaphragm
163 
164  G4Box* solidOhmicPos;
165  G4LogicalVolume* logicOhmicPos;
166  G4VPhysicalVolume* physiOhmicPos;
167 
168  G4Box* solidOhmicNeg;
169  G4LogicalVolume* logicOhmicNeg;
170  G4VPhysicalVolume* physiOhmicNeg;
171 
172  G4Box* solidPixel;
173  G4LogicalVolume* logicPixel;
174  G4VPhysicalVolume* physiPixel;
175 
176  G4Sphere* solidGrain;
177  G4LogicalVolume* logicGrain;
178  G4VPhysicalVolume* physiGrain;
179 
180  //materials management
181  XrayFluoNistMaterials* materials;
182 
183  G4Material* screenMaterial;
184  G4Material* OhmicPosMaterial;
185  G4Material* OhmicNegMaterial;
186  G4Material* pixelMaterial;
187  G4Material* planeMaterial;
188  // G4Material* Dia1Material;
189  // G4Material* Dia3Material;
190  G4Material* defaultMaterial;
191 
192  //apparate parameters
193 
194  G4double OhmicPosThickness;
195  G4double OhmicNegThickness;
196 
197  G4double screenSizeXY;
198  G4double screenThickness;
199 
200  G4int PixelCopyNb;
201  G4int grainCopyNb;
202  G4int NbOfPixels;
203  G4int NbOfPixelRows;
204  G4int NbOfPixelColumns;
205  G4double PixelThickness;
206  G4double PixelSizeXY;
207  G4double ContactSizeXY;
208 
209  G4double planeThickness;
210  G4double planeSizeXY;
211  G4double grainDia;
212  // G4double Dia1Thickness;
213  // G4double Dia1SizeXY;
214  // G4double Dia3Thickness;
215  // G4double Dia3SizeXY;
216  // G4double DiaInnerSize;
217  // G4double Dia3InnerSize;
218 
219 
220 public:
221 
222  G4Material* GetPlaneMaterial() {return planeMaterial;};
223  G4Material* GetPixelMaterial() {return pixelMaterial;};
224  // G4Material* GetDia1Material() {return Dia1Material;};
225  // G4Material* GetDia3Material() {return Dia3Material;};
226 
227  G4double GetPlaneThickness() {return planeThickness;};
228  G4double GetPlaneSizeXY() {return planeSizeXY;};
229 
230 // G4double GetDia1Thickness() {return Dia1Thickness;};
231 // G4double GetDia1SizeXY() {return Dia1SizeXY;};
232 
233 // G4double GetDia3Thickness() {return Dia3Thickness;};
234 // G4double GetDia3SizeXY() {return Dia3SizeXY;};
235 
236 
237 private:
238 
239 
240  G4double ThetaHPGe;
241 
242  G4double DistDe;
243  G4double distScreen;
244 
245  // G4double DistDia;
246  // G4double Dia3Dist;
247  G4double PhiHPGe;
248  // G4double PhiDia1;
249  // G4double PhiDia3;
250  // G4double AlphaDia1;
251  // G4double AlphaDia3;
252 
253 
254  G4RotationMatrix zRotPhiHPGe;
255  // G4RotationMatrix zRotPhiDia1;
256  // G4RotationMatrix zRotPhiDia3;
257  G4double WorldSizeXY;
258  G4double WorldSizeZ;
259 
260 
261  XrayFluoPlaneDetectorMessenger* detectorMessenger; //pointer to the Messenger
262 
263  XrayFluoSD* HPGeSD; //pointer to the sensitive detector
264 
265 private:
266 
267  void DefineDefaultMaterials();
268  G4VPhysicalVolume* ConstructApparate();
269 
270  //calculates some quantities used to construct geometry
271  void ComputeApparateParameters();
272 
273 };
274 
275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
276 
277 inline void XrayFluoPlaneDetectorConstruction::ComputeApparateParameters()
278 {
279  // Compute derived parameters of the apparate
280 
281  DeviceThickness = PixelThickness+OhmicNegThickness+OhmicPosThickness;
282 
283  G4cout << "DeviceThickness(cm): "<< DeviceThickness/CLHEP::cm << G4endl;
284 
285  DeviceSizeY =(NbOfPixelRows * std::max(ContactSizeXY,PixelSizeXY));
286  DeviceSizeX =(NbOfPixelColumns * std::max(ContactSizeXY,PixelSizeXY));
287 
288  screenSizeXY = 2 * DeviceThickness + std::max(DeviceSizeY,DeviceSizeX);
289 
290  G4cout << "DeviceSizeX(cm): "<< DeviceSizeX/CLHEP::cm <<G4endl;
291  G4cout << "DeviceSizeY(cm): "<< DeviceSizeY/CLHEP::cm << G4endl;
292 
293  WorldSizeZ = (2 * (DistDe + DeviceThickness + screenThickness)) + 5*CLHEP::m;
294  WorldSizeXY = (2 * (planeSizeXY))+ 5*CLHEP::m;
295 
296 }
297 
298 #endif
Definition: G4Box.hh:63
int G4int
Definition: G4Types.hh:78
static XrayFluoPlaneDetectorConstruction * GetInstance()
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
T max(const T t1, const T t2)
brief Return the largest of the two arguments
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76