66 XrayFluoMercuryDetectorConstruction::XrayFluoMercuryDetectorConstruction()
67 : detectorType(0),mercuryGranularity(false), DeviceSizeX(0),
68 DeviceSizeY(0),DeviceThickness(0),
69 solidWorld(0),logicWorld(0),physiWorld(0),
70 solidHPGe(0),logicHPGe(0),physiHPGe(0),
71 solidScreen(0),logicScreen(0),physiScreen(0),
72 solidMercury (0),logicMercury(0),physiMercury (0),
73 solidOhmicPos(0),logicOhmicPos(0), physiOhmicPos(0),
74 solidOhmicNeg(0),logicOhmicNeg(0), physiOhmicNeg(0),
75 solidPixel(0),logicPixel(0), physiPixel(0),
76 screenMaterial(0),OhmicPosMaterial(0), OhmicNegMaterial(0),
77 pixelMaterial(0),mercuryMaterial(0),
78 defaultMaterial(0),HPGeSD(0)
83 DefineDefaultMaterials();
87 NbOfPixels = NbOfPixelRows*NbOfPixelColumns;
88 PixelSizeXY = std::sqrt(40.) *
mm *0.5e6;
89 PixelThickness = 3.5 *
mm * 1e6;
94 ContactSizeXY = std::sqrt(40.) *
mm * 0.5e6;
96 mercuryDia = 2 * 4880 *
km ;
97 sunDia = 1390000 *
km ;
98 mercurySunDistance = 57910000 *
km ;
101 OhmicNegThickness = 0.005*
mm *0.5e6 ;
102 OhmicPosThickness = 0.005*
mm *0.5e6 ;
104 screenThickness = 5 *
mm *0.5e6;
106 ThetaHPGe = 135. *
deg ;
107 PhiHPGe = 225. *
deg ;
110 distDe = (mercuryDia/2 + 400 *
km);
112 distScreen = distDe + (screenThickness+PixelThickness)/2+OhmicPosThickness ;
114 distOptic = distDe - 1.*
m * 1e5;
116 opticThickness = 1.*
cm *0.5e6;
117 opticDia = 21. *
cm *0.5e6;
118 opticAperture = 1. *
deg;
122 G4String defaultDetectorType =
"sili";
123 ComputeApparateParameters();
124 SetDetectorType(defaultDetectorType);
129 G4cout <<
"XrayFluoMercuryDetectorConstruction created" <<
G4endl;
153 else if (type==
"hpge")
160 execp << type +
"detector type unknown";
161 G4Exception(
"XrayFluoMercuryDetectorConstruction::SetDetectorType()",
"example-xray_fluorescence05",
178 delete detectorMessenger;
180 G4cout <<
"XrayFluoMercuryDetectorConstruction deleted" <<
G4endl;
187 return ConstructApparate();
191 void XrayFluoMercuryDetectorConstruction::DefineDefaultMaterials()
197 mercuryMaterial = materials->
GetMaterial(
"Anorthosite");
200 OhmicPosMaterial = materials->
GetMaterial(
"G4_Cu");
201 OhmicNegMaterial = materials->
GetMaterial(
"G4_Pb");
202 defaultMaterial = materials->
GetMaterial(
"G4_Galactic");
213 ComputeApparateParameters();
217 solidWorld =
new G4Box(
"World",
218 WorldSizeXY/2,WorldSizeXY/2,WorldSizeZ/2);
233 solidHPGe = 0; physiHPGe = 0; logicHPGe=0;
234 solidPixel=0; logicPixel=0; physiPixel=0;
236 if (DeviceThickness > 0.)
238 solidHPGe =
new G4Box(
"HPGeDetector",
239 DeviceSizeX/2,DeviceSizeY/2,DeviceThickness/2);
249 z = distDe * std::cos(ThetaHPGe);
250 y = distScreen * std::sin(ThetaHPGe);
265 for (
G4int j=0; j < NbOfPixelColumns ; j++ )
266 {
for (
G4int i=0; i < NbOfPixelRows ; i++ )
268 solidPixel=0; logicPixel=0; physiPixel=0;
269 if (PixelThickness > 0.)
270 solidPixel =
new G4Box(
"Pixel",
271 PixelSizeXY/2,PixelSizeXY/2, PixelThickness/2);
300 solidOhmicNeg=0; logicOhmicNeg=0; physiOhmicNeg=0;
302 if (OhmicNegThickness > 0.)
303 { solidOhmicNeg =
new G4Box(
"OhmicNeg",
304 PixelSizeXY/2,PixelSizeXY/2,OhmicNegThickness/2);
314 (PixelThickness+OhmicNegThickness)/2),
323 solidOhmicPos=0; logicOhmicPos=0; physiOhmicPos=0;
325 if (OhmicPosThickness > 0.)
326 { solidOhmicPos =
new G4Box(
"OhmicPos",
327 PixelSizeXY/2,PixelSizeXY/2,OhmicPosThickness/2);
336 (-PixelThickness-OhmicPosThickness)/2),
345 PixelCopyNb += PixelCopyNb;
353 if (DeviceThickness > 0.)
355 solidOptic =
new G4Tubs(
"DetectorOptic",
356 0.,opticDia/2, opticThickness, 0.,2.*
pi);
365 z = distOptic * std::cos(ThetaHPGe);
366 y = distOptic * std::sin(ThetaHPGe);
379 if (DeviceThickness > 0.)
381 solidScreen =
new G4Box(
"DetectorScreen",
382 screenSizeXY/2,screenSizeXY/2,screenThickness/2);
392 z = distScreen * std::cos(ThetaHPGe);
393 y = distScreen * std::sin(ThetaHPGe);
406 solidMercury=0; logicMercury=0; physiMercury=0;
415 solidMercury =
new G4Sphere(
"Mercury",0.,mercuryDia/2., 0.,
twopi, 0.,
pi);
482 if (HPGeSD.
Get() == 0)
496 G4cout <<
"-----------------------------------------------------------------------"
498 <<
"The mercury is a sphere whose diamter is: "
505 <<
"The Detector is a slice " << DeviceThickness/(1.e-6*
m)
506 <<
" micron thick of " << pixelMaterial->
GetName()<<G4endl
507 <<
"-------------------------------------------------------------------------"
520 zRotPhiHPGe.
rotateX(-1.*PhiHPGe);
521 ComputeApparateParameters();
532 G4cout <<
"New Mercury Material: " << newMaterial <<
G4endl;
void PrintApparateParameters()
static constexpr double km
static constexpr double mm
G4Material * GetMaterial() const
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
HepRotation & rotateX(double delta)
const G4String & GetName() const
static XrayFluoMercuryDetectorConstruction * GetInstance()
void SetForceSolid(G4bool=true)
static XrayFluoNistMaterials * GetInstance()
static constexpr double twopi
static XrayFluoSiLiDetectorType * GetInstance()
void ConstructSDandField()
G4GLOB_DLL std::ostream G4cout
static constexpr double m
void SetMercuryMaterial(G4String newMaterial)
void SetVisibility(G4bool=true)
static constexpr double cm
static G4GeometryManager * GetInstance()
G4Material * GetMaterial(G4String)
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
void ReinitializeGeometry(G4bool destroyFirst=false, G4bool prop=true)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void AddNewDetector(G4VSensitiveDetector *aSD)
G4VPhysicalVolume * Construct()
static G4RunManager * GetRunManager()
XrayFluoVDetectorType * GetDetectorType() const
static G4SDManager * GetSDMpointer()
static XrayFluoHPGeDetectorType * GetInstance()
~XrayFluoMercuryDetectorConstruction()
void OpenGeometry(G4VPhysicalVolume *vol=0)
static constexpr double pi
static constexpr double deg
void SetMaterial(G4Material *pMaterial)
void Put(const value_type &val) const
static const G4VisAttributes & GetInvisible()
void SetDetectorType(G4String type)
void SetVisAttributes(const G4VisAttributes *pVA)