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