Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
VtkVis::DetectorConstruction Class Reference

Detector construction class to define materials and geometry. More...

#include <Doxymodules_visualization.h>

Inheritance diagram for VtkVis::DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 DetectorConstruction ()=default
 
 ~DetectorConstruction () override=default
 
G4VPhysicalVolumeConstruct () override
 
G4LogicalVolumeGetScoringVolume () const
 

Protected Attributes

G4LogicalVolumefScoringVolume = nullptr
 

Detailed Description

Detector construction class to define materials and geometry.

Definition at line 50 of file Doxymodules_visualization.h.

Constructor & Destructor Documentation

◆ DetectorConstruction()

VtkVis::DetectorConstruction::DetectorConstruction ( )
default

◆ ~DetectorConstruction()

VtkVis::DetectorConstruction::~DetectorConstruction ( )
overridedefault

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * VtkVis::DetectorConstruction::Construct ( )
override

Definition at line 48 of file DetectorConstruction.cc.

49{
50 // Get nist material manager
51 G4NistManager* nist = G4NistManager::Instance();
52
53 // Envelope parameters
54 //
55 G4double env_sizeXY = 10*m, env_sizeZ = 10*m;
56 G4Material* env_mat = nist->FindOrBuildMaterial("G4_Galactic");
57
58 // Option to switch on/off checking of volumes overlaps
59 //
60 G4bool checkOverlaps = true;
61
62 //
63 // World
64 //
65 G4double world_sizeXY = 1.2*env_sizeXY;
66 G4double world_sizeZ = 1.2*env_sizeZ;
67 G4Material* world_mat = nist->FindOrBuildMaterial("G4_AIR");
68
69 auto solidWorld = new G4Box("World", // its name
70 0.5 * world_sizeXY, 0.5 * world_sizeXY, 0.5 * world_sizeZ); // its size
71
72 auto logicWorld = new G4LogicalVolume(solidWorld, // its solid
73 world_mat, // its material
74 "World"); // its name
75
76 auto physWorld = new G4PVPlacement(nullptr, // no rotation
77 G4ThreeVector(), // at (0,0,0)
78 logicWorld, // its logical volume
79 "World", // its name
80 nullptr, // its mother volume
81 false, // no boolean operation
82 0, // copy number
83 checkOverlaps); // overlaps checking
84
85 //
86 // Envelope
87 //
88 auto solidEnv = new G4Box("Envelope", // its name
89 0.5 * env_sizeXY, 0.5 * env_sizeXY, 0.5 * env_sizeZ); // its size
90
91 auto logicEnv = new G4LogicalVolume(solidEnv, // its solid
92 env_mat, // its material
93 "Envelope"); // its name
94
95 new G4PVPlacement(nullptr, // no rotation
96 G4ThreeVector(), // at (0,0,0)
97 logicEnv, // its logical volume
98 "Envelope", // its name
99 logicWorld, // its mother volume
100 false, // no boolean operation
101 0, // copy number
102 checkOverlaps); // overlaps checking
103
104
105 auto dumpPos = G4ThreeVector(0, 0, 0);
106 auto dumpMat = nist->FindOrBuildMaterial("G4_CONCRETE");
107 auto dumpShape1 = new G4Box("dumpShape1", 1*m, 1*m, 0.5*m);
108
109 auto dumpCutoutPos = G4ThreeVector(0, 0, -5.1*cm);
110 auto dumpCutoutShape = new G4Tubs("DumpCutoutShape", 0*cm, 10*cm, 90/2*cm, 0, 2*M_PI);
111
112 auto dumpShape2 = new G4SubtractionSolid("dumpShape2",dumpShape1, dumpCutoutShape, 0,
113 dumpCutoutPos);
114
115 auto dumpLogical = new G4LogicalVolume(dumpShape2,
116 dumpMat, // its material
117 "dump");
118 // its name
119 new G4PVPlacement(nullptr, // no rotation
120 dumpPos, // at position
121 dumpLogical, // its logical volume
122 "dump", // its name
123 logicEnv, // its mother volume
124 false, // no boolean operation
125 0, // copy number
126 checkOverlaps); // overlaps checking
127
128
129
130 fScoringVolume = dumpLogical;
131
132 //
133 //always return the physical World
134 //
135 return physWorld;
136}

◆ GetScoringVolume()

G4LogicalVolume * VtkVis::DetectorConstruction::GetScoringVolume ( ) const
inline

Definition at line 52 of file DetectorConstruction.hh.

52{ return fScoringVolume; }

Member Data Documentation

◆ fScoringVolume

G4LogicalVolume* VtkVis::DetectorConstruction::fScoringVolume = nullptr
protected

Definition at line 55 of file DetectorConstruction.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration