Geant4_10
XrayFluoDetectorConstruction.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: 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 // Nov 2002 Alfonso Mantero materials added, Material selection implementation
36 // 16 Jul 2003 Alfonso Mantero Detector type selection added + minor fixes
37 // 21 Aug 2003 Alfonso Mantero Material Management moved to XrayFluoMaterials
38 //
39 // -------------------------------------------------------------------
40 
41 #ifndef XrayFluoDetectorConstruction_hh
42 #define XrayFluoDetectorConstruction_hh 1
43 
45 
46 #include "globals.hh"
47 #include "G4RotationMatrix.hh"
49 #include "G4Navigator.hh"
50 
53 #include "XrayFluoSD.hh"
54 #include "XrayFluoGeometry.hh"
55 
56 class G4Box;
57 class G4Tubs;
58 class G4Sphere;
59 class G4LogicalVolume;
60 class G4VPhysicalVolume;
61 class G4Material;
64 
65 //class XrayFluoSD;
66 //class XrayFluoVDetectorType;
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
69 
71 {
72 public:
73 
74 
76 
77 public:
78 
80 
81  void UpdateGeometry();
82 
84 
85  void SetSampleMaterial(G4String newMaterial);
86 
87  void SetDetectorType(G4String type);
88 
90 
91  inline void SetSampleGranularity(G4bool granularity)
92  {sampleGranularity = granularity;};
93 
94  inline void PhaseSpaceOn()
95  {phaseSpaceFlag = true;};
96 
97  inline void PhaseSpaceOff()
98  {phaseSpaceFlag = false;};
99 
101  {return phaseSpaceFlag;};
102 
103  inline void SetGrainDia(G4double size)
104  {grainDia = size;};
105 
106  void DeleteGrainObjects();
107 
108 public:
109 
110  void PrintApparateParameters();
111 
113 
114 
115  G4double GetWorldSizeZ() {return WorldSizeZ;};
116  G4double GetWorldSizeXY() {return WorldSizeXY;};
117 
118  G4double GetDeviceThickness() {return DeviceThickness;};
119  G4double GetDeviceSizeX() {return DeviceSizeX;};
120  G4double GetDeviceSizeY() {return DeviceSizeY;};
121  G4double GetPixelSizeXY() {return PixelSizeXY;};
122  G4double GetContactSizeXY() {return ContactSizeXY;};
123 
124  G4int GetNbOfPixels() {return NbOfPixels;};
125  G4int GetNbOfPixelRows() {return NbOfPixelRows;};
126  G4int GetNbOfPixelColumns() {return NbOfPixelColumns;};
127 
128  G4Material* GetOhmicPosMaterial() {return OhmicPosMaterial;};
129  G4double GetOhmicPosThickness() {return OhmicPosThickness;};
130 
131  G4Material* GetOhmicNegMaterial() {return OhmicNegMaterial;};
132  G4double GetOhmicNegThickness() {return OhmicNegThickness;};
133 
136 
137  const G4VPhysicalVolume* GetphysiWorld() {return physiWorld;};
138  const G4VPhysicalVolume* GetHPGe() {return physiHPGe;};
139  const G4VPhysicalVolume* GetSample() {return physiSample;};
140  const G4VPhysicalVolume* GetDia1() {return physiDia1;};
141  const G4VPhysicalVolume* GetDia3() {return physiDia3;};
142 
143  const G4VPhysicalVolume* GetphysiPixel() {return physiPixel;};
144  const G4VPhysicalVolume* GetOhmicPos() {return physiOhmicPos;};
145  const G4VPhysicalVolume* GetOhmicNeg() {return physiOhmicNeg;};
146  const G4VPhysicalVolume* GetWindow () {return physiWindow ;};
147 private:
148 
149  G4Navigator* aNavigator;
150 
152 
153  static XrayFluoDetectorConstruction* instance;
154 
155  XrayFluoVDetectorType* detectorType;
156 
157  G4bool sampleGranularity;
158  G4bool phaseSpaceFlag;
159 
160  G4double DeviceSizeX;
161  G4double DeviceSizeY;
162  G4double DeviceThickness;
163 
164  G4Box* solidWorld; //pointer to the solid World
165  G4LogicalVolume* logicWorld; //pointer to the logical World
166  G4VPhysicalVolume* physiWorld; //pointer to the physical World
167 
168  G4Box* solidHPGe; //pointer to the solid Sensor
169  G4LogicalVolume* logicHPGe; //pointer to the logical Sensor
170  G4VPhysicalVolume* physiHPGe; //pointer to the physical Sensor
171 
172  G4Box* solidSample; //pointer to the solid Sample
173  G4LogicalVolume* logicSample; //pointer to the logical Sample
174  G4VPhysicalVolume* physiSample; //pointer to the physical Sample
175 
176  G4Tubs* solidDia1; //pointer to the solid Diaphragm
177  G4LogicalVolume* logicDia1; //pointer to the logical Diaphragm
178  G4VPhysicalVolume* physiDia1; //pointer to the physical Diaphragm
179 
180  G4Tubs* solidDia3; //pointer to the solid Diaphragm
181  G4LogicalVolume* logicDia3; //pointer to the logical Diaphragm
182  G4VPhysicalVolume* physiDia3; //pointer to the physical Diaphragm
183 
184  G4Box* solidOhmicPos;
185  G4LogicalVolume* logicOhmicPos;
186  G4VPhysicalVolume* physiOhmicPos;
187 
188  G4Box* solidWindow; // added
189  G4LogicalVolume* logicWindow; // added
190  G4VPhysicalVolume* physiWindow; // added
191 
192  G4Box* solidOhmicNeg;
193  G4LogicalVolume* logicOhmicNeg;
194  G4VPhysicalVolume* physiOhmicNeg;
195 
196  G4Box* solidPixel;
197  G4LogicalVolume* logicPixel;
198  G4VPhysicalVolume* physiPixel;
199 
200  G4Sphere* solidGrain;
201  G4LogicalVolume* logicGrain;
202  G4VPhysicalVolume* physiGrain;
203 
204 
205  //materials management
206  XrayFluoNistMaterials* materials;
207 
208  G4Material* OhmicPosMaterial;
209  G4Material* OhmicNegMaterial;
210  G4Material* pixelMaterial;
211  G4Material* sampleMaterial;
212  G4Material* Dia1Material;
213  G4Material* Dia3Material;
214  G4Material* defaultMaterial;
215  G4Material* windowMaterial; //added
216 
217 
218  //apparate parameters
219 
220  G4double OhmicPosThickness;
221 
222  G4double OhmicNegThickness;
223 
224  G4double windowThickness; //added
225 
226  G4int PixelCopyNb;
227  G4int grainCopyNb;
228  G4int NbOfPixels;
229  G4int NbOfPixelRows;
230  G4int NbOfPixelColumns;
231  G4double PixelThickness; // added
232 
233 
234 
235  G4double PixelSizeXY;
236  G4double ContactSizeXY;
237 
238 public:
239 
240  G4Material* GetSampleMaterial() {return sampleMaterial;};
241  G4Material* GetPixelMaterial() {return pixelMaterial;};
242  G4Material* GetDia1Material() {return Dia1Material;};
243  G4Material* GetDia3Material() {return Dia3Material;};
244 
245  // GetSampleIlluminatedFacecoord();
246  // GetSampleShadowedFaceCoord();
247  // GetSampleXplusFaceCoord();
248  // GetSampleXminusFaceCoord();
249  // GetSampleYplusFaceCoord();
250  // GetSampleYminusFaceCoord();
251 
252  G4Navigator* GetGeometryNavigator() {return aNavigator;};
253 
254 private:
255 
256  G4double SampleThickness;
257  G4double SampleSizeXY;
258  G4double grainDia;
259  G4double Dia1Thickness;
260  G4double Dia1SizeXY;
261  G4double Dia3Thickness;
262  G4double Dia3SizeXY;
263  G4double DiaInnerSize;
264  G4double Dia3InnerSize;
265  // G4double DistSi;
266 public:
267 
268 
269  G4double GetSampleThickness() {return SampleThickness;};
270  G4double GetSampleSizeXY() {return SampleSizeXY;};
271 
272  G4double GetDia1Thickness() {return Dia1Thickness;};
273  G4double GetDia1SizeXY() {return Dia1SizeXY;};
274 
275  G4double GetDia3Thickness() {return Dia3Thickness;};
276  G4double GetDia3SizeXY() {return Dia3SizeXY;};
277 
278 
279 private:
280 
281 
282  G4double ThetaHPGe;
283  G4double ThetaDia1;
284  G4double ThetaDia3;
285 
286  G4double DistDe;
287  G4double DistDia;
288  G4double Dia3Dist;
289  G4double PhiHPGe;
290  G4double PhiDia1;
291  G4double PhiDia3;
292  G4double AlphaDia1;
293  G4double AlphaDia3;
294 
295 
296  G4RotationMatrix zRotPhiHPGe;
297  G4RotationMatrix zRotPhiDia1;
298  G4RotationMatrix zRotPhiDia3;
299  G4double WorldSizeXY;
300  G4double WorldSizeZ;
301 
302 
303  XrayFluoDetectorMessenger* detectorMessenger; //pointer to the Messenger
304 
305  XrayFluoSD* HPGeSD; //pointer to the sensitive detector
306 
307  G4Region* sampleRegion;
308 
309 
310 private:
311 
312  void DefineDefaultMaterials();
313  G4VPhysicalVolume* ConstructApparate();
314 
315  //calculates some quantities used to construct geometry
316  void ComputeApparateParameters();
317 
318 };
319 
320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
321 
322 inline void XrayFluoDetectorConstruction::ComputeApparateParameters()
323 {
324  // Compute derived parameters of the apparate
325 
326  if (phaseSpaceFlag) {
327 
328  WorldSizeZ = 10 *CLHEP::m;
329  WorldSizeXY = 10 *CLHEP::m;
330 
331  }
332  else {
333 
334  DeviceThickness = PixelThickness+OhmicNegThickness+OhmicPosThickness+windowThickness;//change!
335 
336  G4cout << "DeviceThickness(cm): "<< DeviceThickness/CLHEP::cm << G4endl;
337 
338  DeviceSizeY =(NbOfPixelRows * std::max(ContactSizeXY,PixelSizeXY));
339  DeviceSizeX =(NbOfPixelColumns * std::max(ContactSizeXY,PixelSizeXY));
340 
341  G4cout << "DeviceSizeX(cm): "<< DeviceSizeX/CLHEP::cm <<G4endl;
342  G4cout << "DeviceSizeY(cm): "<< DeviceSizeY/CLHEP::cm << G4endl;
343 
344  WorldSizeZ = (2 * (DistDe +1.4142 *(std::max(std::max(DeviceThickness,DeviceSizeY), DeviceSizeX))))+5*CLHEP::m;
345  WorldSizeXY = 2 * (DistDe +1.4142 *Dia1SizeXY)+5*CLHEP::m;
346 
347  }
348 }
349 
350 #endif
const G4VPhysicalVolume * GetphysiPixel()
CLHEP::Hep3Vector G4ThreeVector
Definition: G4Box.hh:63
Definition: G4Tubs.hh:84
int G4int
Definition: G4Types.hh:78
static XrayFluoDetectorConstruction * GetInstance()
const G4VPhysicalVolume * GetOhmicPos()
void SetSampleMaterial(G4String newMaterial)
G4GLOB_DLL std::ostream G4cout
const G4VPhysicalVolume * GetphysiWorld()
bool G4bool
Definition: G4Types.hh:79
const G4VPhysicalVolume * GetOhmicNeg()
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
void SetSampleGranularity(G4bool granularity)