ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
ISF
ISF_Geant4
ISF_Geant4Tools
src
G4DetectorConstruction.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// G4DetectorConstruction.cxx, (c) ATLAS Detector software
8
9
// class header
10
#include "
G4DetectorConstruction.h
"
11
12
// CLHEP
13
#include "CLHEP/Units/SystemOfUnits.h"
14
15
// Geant4 includes
16
#include "G4Material.hh"
17
#include "G4Box.hh"
18
#include "G4LogicalVolume.hh"
19
#include "G4ThreeVector.hh"
20
#include "G4PVPlacement.hh"
21
#include "globals.hh"
22
23
G4DetectorConstruction::G4DetectorConstruction
()
24
:
m_worldLog
(nullptr),
25
m_worldPhys
(nullptr)
26
{}
27
28
29
G4DetectorConstruction::~G4DetectorConstruction
()
30
{}
31
32
33
void
G4DetectorConstruction::dummyDetector
()
34
{
35
G4ThreeVector materialPosition(0.,0.,0.);
36
37
// (1) WORLD
38
// create the world setup
39
G4Box* worldBox =
new
G4Box(
"WorldBox"
,25000.,25000.,25000.);
40
41
// G4 material : vacuum setup
42
G4Material* g4vacuum = G4Material::GetMaterial(
"Vacuum"
,
false
);
43
if
(!g4vacuum) g4vacuum =
new
G4Material(
"FatrasDummyVacuum"
,1.,1.01*CLHEP::g/CLHEP::mole,
44
CLHEP::universe_mean_density,
45
kStateGas,0.1*CLHEP::kelvin, 1.e-19*CLHEP::pascal);
46
47
m_worldLog
=
m_worldLog
?
new
(
m_worldLog
) G4LogicalVolume(worldBox,g4vacuum,
"WorldLogical"
, 0, 0, 0) :
48
new
G4LogicalVolume(worldBox,g4vacuum,
"WorldLogical"
, 0, 0, 0);
49
m_worldPhys
=
m_worldPhys
?
new
(
m_worldPhys
) G4PVPlacement(0,G4ThreeVector(0.,0.,0),
"WorldPhysical"
,
m_worldLog
,0,
false
,0) :
50
new
G4PVPlacement(0,materialPosition,
"WorldPhysical"
,
m_worldLog
,0,
false
,0);
51
52
// (2) DETECTOR
53
// create the detector setup, by definition 3 times the thickness
54
//G4Box* detectordBox = new G4Box("WorldBox",10*thickness,10*thickness,10*thickness);
55
//m_detectorLog = m_detectorLog ? new(m_detectorLog) G4LogicalVolume(worldBox,s_g4vacuum,"DetectorLogical", 0, 0, 0) :
56
// new G4LogicalVolume(detectordBox,s_g4vacuum,"DetectordLogical", 0, 0, 0);
57
//m_detectorPhys = m_detectorPhys ? new(m_detectorPhys) G4PVPlacement(0,materialPosition,"DetectorPhysical",m_detectorLog,0,false,0) :
58
// new G4PVPlacement(0,materialPosition,"DetectorPhysical",m_detectorLog,m_worldPhys,false,0);
59
60
}
61
62
63
G4VPhysicalVolume*
G4DetectorConstruction::Construct
()
64
{
65
// call the update detector method
66
dummyDetector
();
67
return
m_worldPhys
;
68
}
G4DetectorConstruction.h
G4DetectorConstruction::m_worldLog
G4LogicalVolume * m_worldLog
Definition
G4DetectorConstruction.h:38
G4DetectorConstruction::dummyDetector
void dummyDetector()
Definition
G4DetectorConstruction.cxx:33
G4DetectorConstruction::Construct
G4VPhysicalVolume * Construct()
Definition
G4DetectorConstruction.cxx:63
G4DetectorConstruction::m_worldPhys
G4VPhysicalVolume * m_worldPhys
Definition
G4DetectorConstruction.h:42
G4DetectorConstruction::~G4DetectorConstruction
~G4DetectorConstruction()
Definition
G4DetectorConstruction.cxx:29
G4DetectorConstruction::G4DetectorConstruction
G4DetectorConstruction()
Definition
G4DetectorConstruction.cxx:23
Generated on
for ATLAS Offline Software by
1.17.0