Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
VG01DetectorConstruction Class Reference

#include <Doxymodules_geometry.h>

Inheritance diagram for VG01DetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 VG01DetectorConstruction ()
 
 ~VG01DetectorConstruction ()
 
G4VPhysicalVolumeConstruct () override
 
void SetGDMLFileName (const G4String &gdmlfile)
 
void SetUseVecGeom (bool b)
 
void SetMagFieldValue (const G4double fieldValue)
 

Static Public Member Functions

static G4double GetFieldValue ()
 

Private Member Functions

void CreateMagFieldAndIntegrator ()
 

Private Attributes

G4String fGDMLFileName
 
G4GDMLParser fParser
 
G4VPhysicalVolumefWorld
 
G4FieldManagerfFieldMgr
 
G4UniformMagFieldfUniformMagField
 
bool fUseVecGeom = true
 
VG01DetectorMessengerfDetectorMessenger = nullptr
 

Static Private Attributes

static G4double fglobFieldValue = 0.0
 

Detailed Description

Definition at line 26 of file Doxymodules_geometry.h.

Constructor & Destructor Documentation

◆ VG01DetectorConstruction()

VG01DetectorConstruction::VG01DetectorConstruction ( )

◆ ~VG01DetectorConstruction()

VG01DetectorConstruction::~VG01DetectorConstruction ( )

Definition at line 65 of file VG01DetectorConstruction.cc.

65 {
66 delete fDetectorMessenger;
67 if (fUniformMagField) {
68 delete fUniformMagField;
69 }
70}

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * VG01DetectorConstruction::Construct ( )
override

Definition at line 74 of file VG01DetectorConstruction.cc.

74 {
75 // parser.SetOverlapCheck(true);
77 G4TransportationManager::GetTransportationManager();
78 assert(trMgr);
79
80 fParser.Read(fGDMLFileName, false);
81 fWorld = (G4VPhysicalVolume *)fParser.GetWorldVolume();
82
83 // enabling 'check' mode in G4 Navigator
84 G4Navigator *nav = trMgr->GetNavigatorForTracking();
85 assert(nav);
86 nav->CheckMode(true);
87 // nav->SetVerboseLevel(1);
88 std::cout << "Enabled Check mode in G4Navigator";
89
90 // write back
91 // fParser.Write("out.gdml", fWorld);
92
93 fFieldMgr = trMgr->GetFieldManager();
94 fWorld->GetLogicalVolume()->SetVisAttributes(G4VisAttributes::GetInvisible());
95 if (fWorld==nullptr) {
96 G4ExceptionDescription ed;
97 ed << "World volume not set properly check your setup selection criteria"
98 << "or GDML input!" << G4endl;
99 G4Exception( "VG01DetectorConstruction::Construct()",
100 "G4VecGeomNavExtExample_0001", FatalException, ed );
101
102 }
104
105 if (fUseVecGeom) {
106 // This is converting the geometry to VecGeom and implicitely also setting
107 // the navigator; We should pull this out really
108 G4VecGeomConverter::Instance().SetVerbose(1);
109 G4VecGeomConverter::Instance().ConvertG4Geometry(fWorld);
110 G4cout << vecgeom::GeoManager::Instance().getMaxDepth() << "\n";
111 }
112 return fWorld;
113}

◆ SetGDMLFileName()

void VG01DetectorConstruction::SetGDMLFileName ( const G4String gdmlfile)
inline

Definition at line 53 of file VG01DetectorConstruction.hh.

53{ fGDMLFileName = gdmlfile; }

◆ SetUseVecGeom()

void VG01DetectorConstruction::SetUseVecGeom ( bool  b)
inline

Definition at line 54 of file VG01DetectorConstruction.hh.

54{ fUseVecGeom = b; }

◆ SetMagFieldValue()

void VG01DetectorConstruction::SetMagFieldValue ( const G4double  fieldValue)
inline

Definition at line 55 of file VG01DetectorConstruction.hh.

55{ fglobFieldValue = fieldValue; }

◆ GetFieldValue()

static G4double VG01DetectorConstruction::GetFieldValue ( )
inlinestatic

Definition at line 57 of file VG01DetectorConstruction.hh.

57{ return fglobFieldValue; }

◆ CreateMagFieldAndIntegrator()

void VG01DetectorConstruction::CreateMagFieldAndIntegrator ( )
private

Definition at line 117 of file VG01DetectorConstruction.cc.

118{
119 delete fUniformMagField;
120
121 if (std::abs(fglobFieldValue)>0.0) {
122 // Apply a global uniform magnetic field along the Z axis.
123 // Note: only when the magnetic field (pointer) is NOT zero,
124 // does the Geant4 transportion in field get activated.
126 new G4UniformMagField(G4ThreeVector(0.0,0.0,fglobFieldValue));
127 fFieldMgr->SetDetectorField(fUniformMagField);
128 fFieldMgr->CreateChordFinder(fUniformMagField);
129 G4cout << G4endl
130 << " *** SETTING MAGNETIC FIELD in Z direction : fieldValue = "
131 << fglobFieldValue / tesla << " tesla *** " << G4endl << G4endl;
132 }
133 else
134 {
135 fFieldMgr->SetDetectorField(nullptr);
136 G4cout << G4endl
137 << " *** NO MAGNETIC FIELD SET *** " << G4endl
138 << G4endl;
139 }
140}

Member Data Documentation

◆ fglobFieldValue

G4double VG01DetectorConstruction::fglobFieldValue = 0.0
staticprivate

Definition at line 64 of file VG01DetectorConstruction.hh.

◆ fGDMLFileName

G4String VG01DetectorConstruction::fGDMLFileName
private

Definition at line 66 of file VG01DetectorConstruction.hh.

◆ fParser

G4GDMLParser VG01DetectorConstruction::fParser
private

Definition at line 67 of file VG01DetectorConstruction.hh.

◆ fWorld

G4VPhysicalVolume* VG01DetectorConstruction::fWorld
private

Definition at line 68 of file VG01DetectorConstruction.hh.

◆ fFieldMgr

G4FieldManager* VG01DetectorConstruction::fFieldMgr
private

Definition at line 69 of file VG01DetectorConstruction.hh.

◆ fUniformMagField

G4UniformMagField* VG01DetectorConstruction::fUniformMagField
private

Definition at line 70 of file VG01DetectorConstruction.hh.

◆ fUseVecGeom

bool VG01DetectorConstruction::fUseVecGeom = true
private

Definition at line 71 of file VG01DetectorConstruction.hh.

◆ fDetectorMessenger

VG01DetectorMessenger* VG01DetectorConstruction::fDetectorMessenger = nullptr
private

Definition at line 72 of file VG01DetectorConstruction.hh.


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

Applications | User Support | Publications | Collaboration