62 XrayFluoMercuryDetectorConstruction::XrayFluoMercuryDetectorConstruction()
63 : detectorType(0),mercuryGranularity(false), DeviceSizeX(0),
64 DeviceSizeY(0),DeviceThickness(0),
65 solidWorld(0),logicWorld(0),physiWorld(0),
66 solidHPGe(0),logicHPGe(0),physiHPGe(0),
67 solidScreen(0),logicScreen(0),physiScreen(0),
68 solidMercury (0),logicMercury(0),physiMercury (0),
69 solidOhmicPos(0),logicOhmicPos(0), physiOhmicPos(0),
70 solidOhmicNeg(0),logicOhmicNeg(0), physiOhmicNeg(0),
71 solidPixel(0),logicPixel(0), physiPixel(0),
72 screenMaterial(0),OhmicPosMaterial(0), OhmicNegMaterial(0),
73 pixelMaterial(0),mercuryMaterial(0),
74 defaultMaterial(0),HPGeSD(0)
79 DefineDefaultMaterials();
83 NbOfPixels = NbOfPixelRows*NbOfPixelColumns;
84 PixelSizeXY = std::sqrt(40.) *
mm *0.5e6;
85 PixelThickness = 3.5 *
mm * 1e6;
90 ContactSizeXY = std::sqrt(40.) *
mm * 0.5e6;
92 mercuryDia = 2 * 4880 *
km ;
93 sunDia = 1390000 *
km ;
94 mercurySunDistance = 57910000 *
km ;
97 OhmicNegThickness = 0.005*
mm *0.5e6 ;
98 OhmicPosThickness = 0.005*
mm *0.5e6 ;
100 screenThickness = 5 *
mm *0.5e6;
102 ThetaHPGe = 135. *
deg ;
103 PhiHPGe = 225. *
deg ;
106 distDe = (mercuryDia/2 + 400 *
km);
108 distScreen = distDe + (screenThickness+PixelThickness)/2+OhmicPosThickness ;
110 distOptic = distDe - 1.*
m * 1e5;
112 opticThickness = 1.*
cm *0.5e6;
113 opticDia = 21. *
cm *0.5e6;
114 opticAperture = 1. *
deg;
118 G4String defaultDetectorType =
"sili";
119 ComputeApparateParameters();
120 SetDetectorType(defaultDetectorType);
125 G4cout <<
"XrayFluoMercuryDetectorConstruction created" <<
G4endl;
149 else if (type==
"hpge")
156 execp << type +
"detector type unknown";
157 G4Exception(
"XrayFluoMercuryDetectorConstruction::SetDetectorType()",
"example-xray_fluorescence05",
172 delete detectorMessenger;
174 G4cout <<
"XrayFluoMercuryDetectorConstruction deleted" <<
G4endl;
181 return ConstructApparate();
185 void XrayFluoMercuryDetectorConstruction::DefineDefaultMaterials()
191 mercuryMaterial = materials->
GetMaterial(
"Anorthosite");
194 OhmicPosMaterial = materials->
GetMaterial(
"G4_Cu");
195 OhmicNegMaterial = materials->
GetMaterial(
"G4_Pb");
196 defaultMaterial = materials->
GetMaterial(
"G4_Galactic");
207 ComputeApparateParameters();
211 solidWorld =
new G4Box(
"World",
212 WorldSizeXY/2,WorldSizeXY/2,WorldSizeZ/2);
227 solidHPGe = 0; physiHPGe = 0; logicHPGe=0;
228 solidPixel=0; logicPixel=0; physiPixel=0;
230 if (DeviceThickness > 0.)
232 solidHPGe =
new G4Box(
"HPGeDetector",
233 DeviceSizeX/2,DeviceSizeY/2,DeviceThickness/2);
243 z = distDe * std::cos(ThetaHPGe);
244 y = distScreen * std::sin(ThetaHPGe);
259 for (
G4int j=0; j < NbOfPixelColumns ; j++ )
260 {
for (
G4int i=0; i < NbOfPixelRows ; i++ )
262 solidPixel=0; logicPixel=0; physiPixel=0;
263 if (PixelThickness > 0.)
264 solidPixel =
new G4Box(
"Pixel",
265 PixelSizeXY/2,PixelSizeXY/2, PixelThickness/2);
294 solidOhmicNeg=0; logicOhmicNeg=0; physiOhmicNeg=0;
296 if (OhmicNegThickness > 0.)
297 { solidOhmicNeg =
new G4Box(
"OhmicNeg",
298 PixelSizeXY/2,PixelSizeXY/2,OhmicNegThickness/2);
308 (PixelThickness+OhmicNegThickness)/2),
317 solidOhmicPos=0; logicOhmicPos=0; physiOhmicPos=0;
319 if (OhmicPosThickness > 0.)
320 { solidOhmicPos =
new G4Box(
"OhmicPos",
321 PixelSizeXY/2,PixelSizeXY/2,OhmicPosThickness/2);
330 (-PixelThickness-OhmicPosThickness)/2),
339 PixelCopyNb += PixelCopyNb;
347 if (DeviceThickness > 0.)
349 solidOptic =
new G4Tubs(
"DetectorOptic",
350 0.,opticDia/2, opticThickness, 0.,2.*
pi);
359 z = distOptic * std::cos(ThetaHPGe);
360 y = distOptic * std::sin(ThetaHPGe);
373 if (DeviceThickness > 0.)
375 solidScreen =
new G4Box(
"DetectorScreen",
376 screenSizeXY/2,screenSizeXY/2,screenThickness/2);
386 z = distScreen * std::cos(ThetaHPGe);
387 y = distScreen * std::sin(ThetaHPGe);
400 solidMercury=0; logicMercury=0; physiMercury=0;
409 solidMercury =
new G4Sphere(
"Mercury",0.,mercuryDia/2., 0.,
twopi, 0.,
pi);
487 G4cout <<
"-----------------------------------------------------------------------"
489 <<
"The mercury is a sphere whose diamter is: "
496 <<
"The Detector is a slice " << DeviceThickness/(1.e-6*
m)
497 <<
" micron thick of " << pixelMaterial->
GetName()<<G4endl
498 <<
"-------------------------------------------------------------------------"
513 delete solidOhmicNeg;
514 delete logicOhmicNeg;
515 delete physiOhmicNeg;
516 delete solidOhmicPos;
517 delete logicOhmicPos;
518 delete physiOhmicPos;
532 zRotPhiHPGe.
rotateX(-1.*PhiHPGe);
533 ComputeApparateParameters();
541 G4cout <<
"New Mercury Material: " << newMaterial <<
G4endl;
void PrintApparateParameters()
std::ostringstream G4ExceptionDescription
CLHEP::Hep3Vector G4ThreeVector
HepRotation & rotateX(double delta)
G4Material * GetMaterial() const
const G4String & GetName() const
void SetVisibility(G4bool)
void SetForceSolid(G4bool)
static XrayFluoMercuryDetectorConstruction * GetInstance()
static XrayFluoNistMaterials * GetInstance()
virtual void DefineWorldVolume(G4VPhysicalVolume *worldVol, G4bool topologyIsChanged=true)
static XrayFluoSiLiDetectorType * GetInstance()
G4GLOB_DLL std::ostream G4cout
void SetMercuryMaterial(G4String newMaterial)
G4Material * GetMaterial(G4String)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
void AddNewDetector(G4VSensitiveDetector *aSD)
G4VPhysicalVolume * Construct()
static G4RunManager * GetRunManager()
XrayFluoVDetectorType * GetDetectorType()
static G4SDManager * GetSDMpointer()
static const G4VisAttributes Invisible
static XrayFluoHPGeDetectorType * GetInstance()
~XrayFluoMercuryDetectorConstruction()
void SetMaterial(G4Material *pMaterial)
void SetDetectorType(G4String type)
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)