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

#include <OpNoviceGDMLDetectorConstruction.hh>

Inheritance diagram for OpNoviceGDMLDetectorConstruction:
G4VUserDetectorConstruction

Public Member Functions

 OpNoviceGDMLDetectorConstruction (G4String fname)
 
 ~OpNoviceGDMLDetectorConstruction () override
 
G4VPhysicalVolumeConstruct () override
 
void ConstructSDandField () override
 
void ReadGDML ()
 
void UpdateGeometry ()
 
void SetDumpGdml (G4bool)
 
G4bool IsDumpGdml () const
 
void SetVerbose (G4bool fverbose)
 
G4bool IsVerbose () const
 
void SetDumpGdmlFile (G4String fDumpGdmlFile)
 
G4String GetDumpGdmlFileName () const
 

Private Member Functions

OpNoviceGDMLDetectorConstructionoperator= (const OpNoviceGDMLDetectorConstruction &right)
 
 OpNoviceGDMLDetectorConstruction (const OpNoviceGDMLDetectorConstruction &)
 

Private Attributes

OpNoviceDetectorMessengerfDetectorMessenger = nullptr
 
G4GDMLParserfParser = nullptr
 
G4String fGdmlFile
 
G4String fDumpGdmlFileName = "OpNovice_dump.gdml"
 
G4bool fVerbose = false
 
G4bool fDumpGdml = false
 

Detailed Description

Definition at line 36 of file OpNoviceGDMLDetectorConstruction.hh.

Constructor & Destructor Documentation

◆ OpNoviceGDMLDetectorConstruction() [1/2]

OpNoviceGDMLDetectorConstruction::OpNoviceGDMLDetectorConstruction ( G4String  fname)

Definition at line 39 of file OpNoviceGDMLDetectorConstruction.cc.

42{
43 fGdmlFile = fname;
44 // create a messenger for this class
46
47 G4cout << "Building detector from GDML file: " << fname << G4endl << G4endl;
48}

◆ ~OpNoviceGDMLDetectorConstruction()

OpNoviceGDMLDetectorConstruction::~OpNoviceGDMLDetectorConstruction ( )
override

Definition at line 51 of file OpNoviceGDMLDetectorConstruction.cc.

◆ OpNoviceGDMLDetectorConstruction() [2/2]

OpNoviceGDMLDetectorConstruction::OpNoviceGDMLDetectorConstruction ( const OpNoviceGDMLDetectorConstruction )
private

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * OpNoviceGDMLDetectorConstruction::Construct ( )
override

◆ ConstructSDandField()

void OpNoviceGDMLDetectorConstruction::ConstructSDandField ( )
override

Definition at line 68 of file OpNoviceGDMLDetectorConstruction.cc.

68{}

◆ ReadGDML()

void OpNoviceGDMLDetectorConstruction::ReadGDML ( )

Definition at line 71 of file OpNoviceGDMLDetectorConstruction.cc.

72{
73 fParser = new G4GDMLParser();
74 fParser->Read(fGdmlFile, false);
75 G4VPhysicalVolume* world = fParser->GetWorldVolume();
76 // GDML parser makes world invisible. make it visible again.
77 G4LogicalVolume* pworldLogical = world->GetLogicalVolume();
78 pworldLogical->SetVisAttributes(nullptr);
79 G4cout << world->GetTranslation() << G4endl << G4endl;
80 if(fVerbose)
81 {
82 G4cout << "Found world: " << world->GetName() << G4endl;
83 G4cout << "world LV: " << world->GetLogicalVolume()->GetName() << G4endl;
84 }
85 G4LogicalVolumeStore* pLVStore = G4LogicalVolumeStore::GetInstance();
86 if(fVerbose)
87 {
88 G4cout << "Found " << pLVStore->size() << " logical volumes." << G4endl
89 << G4endl;
90 }
91 G4PhysicalVolumeStore* pPVStore = G4PhysicalVolumeStore::GetInstance();
92 if(fVerbose)
93 {
94 G4cout << "Found " << pPVStore->size() << " physical volumes." << G4endl
95 << G4endl;
96 }
97}

◆ UpdateGeometry()

void OpNoviceGDMLDetectorConstruction::UpdateGeometry ( )

Definition at line 100 of file OpNoviceGDMLDetectorConstruction.cc.

101{
102 G4RunManager::GetRunManager()->DefineWorldVolume(Construct());
103}

◆ SetDumpGdml()

void OpNoviceGDMLDetectorConstruction::SetDumpGdml ( G4bool  val)

Definition at line 106 of file OpNoviceGDMLDetectorConstruction.cc.

107{
108 fDumpGdml = val;
109}

◆ IsDumpGdml()

G4bool OpNoviceGDMLDetectorConstruction::IsDumpGdml ( ) const

Definition at line 112 of file OpNoviceGDMLDetectorConstruction.cc.

113{
114 return fDumpGdml;
115}

◆ SetVerbose()

void OpNoviceGDMLDetectorConstruction::SetVerbose ( G4bool  fverbose)

Definition at line 118 of file OpNoviceGDMLDetectorConstruction.cc.

119{
120 fVerbose = val;
121}

◆ IsVerbose()

G4bool OpNoviceGDMLDetectorConstruction::IsVerbose ( ) const

Definition at line 124 of file OpNoviceGDMLDetectorConstruction.cc.

124{ return fVerbose; }

◆ SetDumpGdmlFile()

void OpNoviceGDMLDetectorConstruction::SetDumpGdmlFile ( G4String  fDumpGdmlFile)

Definition at line 127 of file OpNoviceGDMLDetectorConstruction.cc.

128{
129 fDumpGdmlFileName = val;
130}

◆ GetDumpGdmlFileName()

G4String OpNoviceGDMLDetectorConstruction::GetDumpGdmlFileName ( ) const

Definition at line 133 of file OpNoviceGDMLDetectorConstruction.cc.

134{
135 return fDumpGdmlFileName;
136}

◆ operator=()

OpNoviceGDMLDetectorConstruction & OpNoviceGDMLDetectorConstruction::operator= ( const OpNoviceGDMLDetectorConstruction right)
private

Member Data Documentation

◆ fDetectorMessenger

OpNoviceDetectorMessenger* OpNoviceGDMLDetectorConstruction::fDetectorMessenger = nullptr
private

Definition at line 58 of file OpNoviceGDMLDetectorConstruction.hh.

◆ fParser

G4GDMLParser* OpNoviceGDMLDetectorConstruction::fParser = nullptr
private

Definition at line 59 of file OpNoviceGDMLDetectorConstruction.hh.

◆ fGdmlFile

G4String OpNoviceGDMLDetectorConstruction::fGdmlFile
private

Definition at line 61 of file OpNoviceGDMLDetectorConstruction.hh.

◆ fDumpGdmlFileName

G4String OpNoviceGDMLDetectorConstruction::fDumpGdmlFileName = "OpNovice_dump.gdml"
private

Definition at line 62 of file OpNoviceGDMLDetectorConstruction.hh.

◆ fVerbose

G4bool OpNoviceGDMLDetectorConstruction::fVerbose = false
private

Definition at line 63 of file OpNoviceGDMLDetectorConstruction.hh.

◆ fDumpGdml

G4bool OpNoviceGDMLDetectorConstruction::fDumpGdml = false
private

Definition at line 64 of file OpNoviceGDMLDetectorConstruction.hh.


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

Applications | User Support | Publications | Collaboration