Geant4_10
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  G4LogicalVolume* logicGrain;
179 
180  //materials management
181  XrayFluoNistMaterials* materials;
182 
183  G4Material* screenMaterial;
184  G4Material* OhmicPosMaterial;
185  G4Material* OhmicNegMaterial;
186  G4Material* pixelMaterial;
187  G4Material* mercuryMaterial;
188  // G4Material* Dia3Material;
189  G4Material* defaultMaterial;
190 
191  //apparate parameters
192 
193  G4double OhmicPosThickness;
194  G4double OhmicNegThickness;
195 
196  G4double opticDia;
197  G4double opticThickness;
198 
199  G4double screenSizeXY;
200  G4double screenThickness;
201 
202  G4int PixelCopyNb;
203  G4int grainCopyNb;
204  G4int NbOfPixels;
205  G4int NbOfPixelRows;
206  G4int NbOfPixelColumns;
207  G4double PixelThickness;
208  G4double PixelSizeXY;
209  G4double ContactSizeXY;
210 
211  G4double opticAperture;
212 
213  G4double mercuryDia;
214  G4double sunDia;
215 
216  G4double mercurySunDistance;
217 
218  G4double ThetaHPGe;
219 
220  G4double distDe;
221  G4double distScreen;
222  G4double distOptic;
223 
224 
225  G4double PhiHPGe;
226 
227  G4RotationMatrix zRotPhiHPGe;
228 
229  G4double WorldSizeXY;
230  G4double WorldSizeZ;
231 
232 
233  XrayFluoMercuryDetectorMessenger* detectorMessenger; //pointer to the Messenger
234 
235  XrayFluoSD* HPGeSD; //pointer to the sensitive detector
236 
237 
238 
239 public:
240 
241  G4Material* GetMercuryMaterial() {return mercuryMaterial;};
242  G4Material* GetPixelMaterial() {return pixelMaterial;};
243 
244  G4double GetMercuryDia() {return mercuryDia;};
245  G4double GetSunDia() {return sunDia;};
246 
247  //Inclinaton of the orbit respect Mercury respect the equator (latitude)
248 
249  G4double GetOrbitInclination() {return 180 * CLHEP::deg - ThetaHPGe;};
250  G4double GetOrbitDistance() {return distDe;};
251  G4double GetOpticAperture() {return opticAperture;};
252 
253 
254 
255 private:
256 
257  void DefineDefaultMaterials();
258  G4VPhysicalVolume* ConstructApparate();
259 
260  //calculates some quantities used to construct geometry
261  void ComputeApparateParameters();
262 
263 };
264 
265 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
266 
267 inline void XrayFluoMercuryDetectorConstruction::ComputeApparateParameters()
268 {
269  // Compute derived parameters of the apparate
270 
271  DeviceThickness = PixelThickness+OhmicNegThickness+OhmicPosThickness;
272 
274 
275  DeviceSizeY =(NbOfPixelRows * std::max(ContactSizeXY,PixelSizeXY));
276  DeviceSizeX =(NbOfPixelColumns * std::max(ContactSizeXY,PixelSizeXY));
277 
278  screenSizeXY = opticDia;
279 
280  G4cout << "DeviceSizeX(cm): "<< DeviceSizeX/CLHEP::cm <<G4endl;
281  G4cout << "DeviceSizeY(cm): "<< DeviceSizeY/CLHEP::cm << G4endl;
282 
283  //*********************************************************************
284  //** Astronomical distances reduce by a factor 10^-7 due to G4 Bug **
285  //*********************************************************************
286 
287  WorldSizeZ = 2 * mercurySunDistance ;
288  WorldSizeXY = (2 * distDe) + 2000 * CLHEP::km ;
289  //WorldSizeZ = WorldSizeXY;
290 }
291 
292 #endif
Definition: G4Box.hh:63
Definition: G4Tubs.hh:84
int G4int
Definition: G4Types.hh:78
static XrayFluoMercuryDetectorConstruction * 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