Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XrayFluoMercuryDetectorConstruction.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: XrayFluoMercuryDetectorConstruction.hh
28 // GEANT4 tag $Name:XrayFluo-V05-02-06
29 //
30 // Author: Alfonso Mantero (Alfonso.Mantero@ge.infn.it)
31 //
32 // History:
33 // -----------
34 //
35 // 08 Sep 2003 Alfonso Mantero created
36 //
37 // -------------------------------------------------------------------
38 
39 #ifndef XrayFluoMercuryDetectorConstruction_hh
40 #define XrayFluoMercuryDetectorConstruction_hh 1
41 
43 
44 #include "globals.hh"
46 #include "G4RotationMatrix.hh"
49 #include "XrayFluoSD.hh"
50 
51 class G4Box;
52 class G4Tubs;
53 class G4Sphere;
54 class G4LogicalVolume;
55 class G4VPhysicalVolume;
56 class G4Material;
59 
60 //class XrayFluoSD;
61 //class XrayFluoVDetectorType;
62 
63 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
64 
66 {
67 public:
68 
69 
71 
72 public:
73 
75 
76  void UpdateGeometry();
77 
78 
79  void SetMercuryMaterial(G4String newMaterial);
80 
81  void SetDetectorType(G4String type);
82 
84 
85  inline void SetOribitHeight(G4double size)
86  {distDe = size;};
87  inline void SetLatitude(G4double lat)
88  {ThetaHPGe = 180.* CLHEP::deg - lat;};
89 
91 
93 
94 
95  G4double GetWorldSizeZ() {return WorldSizeZ;};
96  G4double GetWorldSizeXY() {return WorldSizeXY;};
97 
98  G4double GetDeviceThickness() {return DeviceThickness;};
99  G4double GetDeviceSizeX() {return DeviceSizeX;};
100  G4double GetDeviceSizeY() {return DeviceSizeY;};
101  G4double GetPixelSizeXY() {return PixelSizeXY;};
102  G4double GetContactSizeXY() {return ContactSizeXY;};
103 
104  G4int GetNbOfPixels() {return NbOfPixels;}; //mandatory for XrayFluoSD
105  G4int GetNbOfPixelRows() {return NbOfPixelRows;};
106  G4int GetNbOfPixelColumns() {return NbOfPixelColumns;};
107 
108  G4Material* GetOhmicPosMaterial() {return OhmicPosMaterial;};
109  G4double GetOhmicPosThickness() {return OhmicPosThickness;};
110 
111  G4Material* GetOhmicNegMaterial() {return OhmicNegMaterial;};
112  G4double GetOhmicNegThickness() {return OhmicNegThickness;};
113 
114  const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
115  const G4VPhysicalVolume* GetHPGe() {return physiHPGe;};
116  const G4VPhysicalVolume* GetMercury() {return physiMercury;};
117 
118  const G4VPhysicalVolume* GetphysiPixel() {return physiPixel;};
119  const G4VPhysicalVolume* GetOhmicPos() {return physiOhmicPos;};
120  const G4VPhysicalVolume* GetOhmicNeg() {return physiOhmicNeg;};
121 
122  const G4VPhysicalVolume* GetOptic() {return physiOptic;};
123 
124 private:
125 
127 
128  static XrayFluoMercuryDetectorConstruction* instance;
129 
130  XrayFluoVDetectorType* detectorType;
131 
132  G4bool mercuryGranularity;
133 
134  G4double DeviceSizeX;
135  G4double DeviceSizeY;
136  G4double DeviceThickness;
137 
138  G4Box* solidWorld; //pointer to the solid World
139  G4LogicalVolume* logicWorld; //pointer to the logical World
140  G4VPhysicalVolume* physiWorld; //pointer to the physical World
141 
142  G4Box* solidHPGe; //pointer to the solid Sensor
143  G4LogicalVolume* logicHPGe; //pointer to the logical Sensor
144  G4VPhysicalVolume* physiHPGe; //pointer to the physical Sensor
145 
146  G4Box* solidScreen; //pointer to the solid Screen
147  G4LogicalVolume* logicScreen; //pointer to the logical Screen
148  G4VPhysicalVolume* physiScreen; //pointer to the physical Screen
149 
150  G4Sphere* solidMercury; //pointer to the solid Mercury
151  G4LogicalVolume* logicMercury; //pointer to the logical Mercury
152  G4VPhysicalVolume* physiMercury; //pointer to the physical Mercury
153 
154  // G4Tubs* solidDia1; //pointer to the solid Diaphragm
155  // G4LogicalVolume* logicDia1; //pointer to the logical Diaphragm
156  // G4VPhysicalVolume* physiDia1; //pointer to the physical Diaphragm
157 
158  // G4Tubs* solidDia3; //pointer to the solid Diaphragm
159  // G4LogicalVolume* logicDia3; //pointer to the logical Diaphragm
160  // G4VPhysicalVolume* physiDia3; //pointer to the physical Diaphragm
161 
162  G4Box* solidOhmicPos;
163  G4LogicalVolume* logicOhmicPos;
164  G4VPhysicalVolume* physiOhmicPos;
165 
166  G4Box* solidOhmicNeg;
167  G4LogicalVolume* logicOhmicNeg;
168  G4VPhysicalVolume* physiOhmicNeg;
169 
170  G4Box* solidPixel;
171  G4LogicalVolume* logicPixel;
172  G4VPhysicalVolume* physiPixel;
173 
174  G4Tubs* solidOptic;
175  G4LogicalVolume* logicOptic;
176  G4VPhysicalVolume* physiOptic;
177 
178  G4Sphere* solidGrain;
179  G4LogicalVolume* logicGrain;
180  G4VPhysicalVolume* physiGrain;
181 
182  //materials management
183  XrayFluoNistMaterials* materials;
184 
185  G4Material* screenMaterial;
186  G4Material* OhmicPosMaterial;
187  G4Material* OhmicNegMaterial;
188  G4Material* pixelMaterial;
189  G4Material* mercuryMaterial;
190  G4Material* opticMaterial;
191  // G4Material* Dia3Material;
192  G4Material* defaultMaterial;
193 
194  //apparate parameters
195 
196  G4double OhmicPosThickness;
197  G4double OhmicNegThickness;
198 
199  G4double opticDia;
200  G4double opticThickness;
201 
202  G4double screenSizeXY;
203  G4double screenThickness;
204 
205  G4int PixelCopyNb;
206  G4int grainCopyNb;
207  G4int NbOfPixels;
208  G4int NbOfPixelRows;
209  G4int NbOfPixelColumns;
210  G4double PixelThickness;
211  G4double PixelSizeXY;
212  G4double ContactSizeXY;
213 
214  G4double opticAperture;
215 
216  G4double mercuryDia;
217  G4double sunDia;
218 
219  G4double mercurySunDistance;
220 
221  G4double grainDia;
222 
223  G4double ThetaHPGe;
224 
225  G4double distDe;
226  G4double distScreen;
227  G4double distOptic;
228 
229 
230  G4double PhiHPGe;
231 
232  G4RotationMatrix zRotPhiHPGe;
233 
234  G4double WorldSizeXY;
235  G4double WorldSizeZ;
236 
237 
238  XrayFluoMercuryDetectorMessenger* detectorMessenger; //pointer to the Messenger
239 
240  XrayFluoSD* HPGeSD; //pointer to the sensitive detector
241 
242 
243 
244 public:
245 
246  G4Material* GetMercuryMaterial() {return mercuryMaterial;};
247  G4Material* GetPixelMaterial() {return pixelMaterial;};
248 
249  G4double GetMercuryDia() {return mercuryDia;};
250  G4double GetSunDia() {return sunDia;};
251 
252  //Inclinaton of the orbit respect Mercury respect the equator (latitude)
253 
254  G4double GetOrbitInclination() {return 180 * CLHEP::deg - ThetaHPGe;};
255  G4double GetOrbitDistance() {return distDe;};
256  G4double GetOpticAperture() {return opticAperture;};
257 
258 
259 
260 private:
261 
262  void DefineDefaultMaterials();
263  G4VPhysicalVolume* ConstructApparate();
264 
265  //calculates some quantities used to construct geometry
266  void ComputeApparateParameters();
267 
268 };
269 
270 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
271 
272 inline void XrayFluoMercuryDetectorConstruction::ComputeApparateParameters()
273 {
274  // Compute derived parameters of the apparate
275 
276  DeviceThickness = PixelThickness+OhmicNegThickness+OhmicPosThickness;
277 
279 
280  DeviceSizeY =(NbOfPixelRows * std::max(ContactSizeXY,PixelSizeXY));
281  DeviceSizeX =(NbOfPixelColumns * std::max(ContactSizeXY,PixelSizeXY));
282 
283  screenSizeXY = opticDia;
284 
285  G4cout << "DeviceSizeX(cm): "<< DeviceSizeX/CLHEP::cm <<G4endl;
286  G4cout << "DeviceSizeY(cm): "<< DeviceSizeY/CLHEP::cm << G4endl;
287 
288  //*********************************************************************
289  //** Astronomical distances reduce by a factor 10^-7 due to G4 Bug **
290  //*********************************************************************
291 
292  WorldSizeZ = 2 * mercurySunDistance ;
293  WorldSizeXY = (2 * distDe) + 2000 * CLHEP::km ;
294  //WorldSizeZ = WorldSizeXY;
295 }
296 
297 #endif