#include <DetectorConstruction.hh>
Public Member Functions | |
DetectorConstruction () | |
~DetectorConstruction () | |
G4VPhysicalVolume * | Construct () |
void | ResetMag (G4String) |
void | ReloadGeo (G4String) |
void | UpdateGeometry () |
Private Member Functions | |
G4VPhysicalVolume * | ConstructDetector () |
Private Attributes | |
DetectorMessenger * | detectorMessenger |
G4VPhysicalVolume * | world_pvol |
MyFieldSvc * | pMyFieldSvc |
MyDetectorManager * | pMyDetectorManager |
Definition at line 20 of file DetectorConstruction.hh.
DetectorConstruction::DetectorConstruction | ( | ) |
Definition at line 23 of file DetectorConstruction.cc.
References detectorMessenger, MyDetectorManager::GetMyDetectorManager(), MyFieldSvc::GetMyFieldSvc(), pMyDetectorManager, and pMyFieldSvc.
00023 { 00024 detectorMessenger = new DetectorMessenger(this); 00025 pMyFieldSvc = MyFieldSvc::GetMyFieldSvc(); 00026 pMyDetectorManager = MyDetectorManager::GetMyDetectorManager(); 00027 }
DetectorConstruction::~DetectorConstruction | ( | ) |
Definition at line 29 of file DetectorConstruction.cc.
References detectorMessenger.
00029 { 00030 delete detectorMessenger; 00031 }
G4VPhysicalVolume * DetectorConstruction::Construct | ( | ) |
Definition at line 33 of file DetectorConstruction.cc.
References ConstructDetector(), MaterialSvc::GetMaterialSvc(), pMyDetectorManager, pMyFieldSvc, MyDetectorManager::ReadCard(), MyFieldSvc::ReadCard(), and MaterialSvc::SetMaterial().
00033 { 00034 G4String CardName; 00035 00036 //=>Material 00037 CardName = getenv("MATERIALLISTROOT"); 00038 MaterialSvc* materialSvc = MaterialSvc::GetMaterialSvc(); 00039 materialSvc->SetMaterial(CardName); 00040 00041 //=>MagField 00042 CardName = getenv("MAGFIELDCARDROOT"); 00043 pMyFieldSvc->ReadCard( CardName ); 00044 00045 //=>Geometry 00046 CardName = getenv("GEOCARDROOT"); 00047 pMyDetectorManager->ReadCard( CardName ); 00048 00049 //=>ConstructDetector 00050 return ConstructDetector(); 00051 }
G4VPhysicalVolume * DetectorConstruction::ConstructDetector | ( | ) | [private] |
Definition at line 53 of file DetectorConstruction.cc.
References pMyDetectorManager, pMyFieldSvc, MyFieldSvc::SetField(), MyDetectorManager::SetGeometry(), and world_pvol.
Referenced by Construct(), and UpdateGeometry().
00054 { 00055 // Clean old geometry, if any 00056 G4GeometryManager::GetInstance()->OpenGeometry(); 00057 G4PhysicalVolumeStore::GetInstance()->Clean(); 00058 G4LogicalVolumeStore::GetInstance()->Clean(); 00059 G4SolidStore::GetInstance()->Clean(); 00060 00061 // Geometry 00062 world_pvol = pMyDetectorManager->SetGeometry(); 00063 00064 //MagField 00065 G4LogicalVolume* world_lvol = world_pvol->GetLogicalVolume(); 00066 pMyFieldSvc->SetField(world_lvol); 00067 00068 // reset userlimit 00069 world_pvol->GetLogicalVolume()->SetUserLimits(new G4UserLimits()); 00070 00071 //always return the physical world 00072 return world_pvol; 00073 }
void DetectorConstruction::ReloadGeo | ( | G4String | file_name | ) |
Definition at line 77 of file DetectorConstruction.cc.
References MyDetectorManager::ClearGeo(), pMyDetectorManager, MyDetectorManager::ReadCard(), and UpdateGeometry().
Referenced by DetectorMessenger::SetNewValue().
00077 { 00078 pMyDetectorManager->ClearGeo(); 00079 pMyDetectorManager->ReadCard(file_name); 00080 UpdateGeometry(); 00081 }
void DetectorConstruction::ResetMag | ( | G4String | file_name | ) |
Definition at line 83 of file DetectorConstruction.cc.
References pMyFieldSvc, MyFieldSvc::ReadCard(), MyFieldSvc::SetField(), and world_pvol.
Referenced by DetectorMessenger::SetNewValue().
00083 { 00084 pMyFieldSvc->ReadCard(file_name); 00085 pMyFieldSvc->SetField(world_pvol->GetLogicalVolume()); 00086 }
void DetectorConstruction::UpdateGeometry | ( | ) |
Definition at line 88 of file DetectorConstruction.cc.
References ConstructDetector().
Referenced by ReloadGeo(), and DetectorMessenger::SetNewValue().
00089 { 00090 G4RunManager::GetRunManager()->DefineWorldVolume(ConstructDetector()); 00091 }
Definition at line 41 of file DetectorConstruction.hh.
Referenced by DetectorConstruction(), and ~DetectorConstruction().
Definition at line 45 of file DetectorConstruction.hh.
Referenced by Construct(), ConstructDetector(), DetectorConstruction(), and ReloadGeo().
MyFieldSvc* DetectorConstruction::pMyFieldSvc [private] |
Definition at line 44 of file DetectorConstruction.hh.
Referenced by Construct(), ConstructDetector(), DetectorConstruction(), and ResetMag().
G4VPhysicalVolume* DetectorConstruction::world_pvol [private] |
Definition at line 43 of file DetectorConstruction.hh.
Referenced by ConstructDetector(), and ResetMag().