DetectorConstruction Class Reference

#include <DetectorConstruction.hh>

List of all members.

Public Member Functions

 DetectorConstruction ()
 ~DetectorConstruction ()
G4VPhysicalVolume * Construct ()
void ResetMag (G4String)
void ReloadGeo (G4String)
void UpdateGeometry ()

Private Member Functions

G4VPhysicalVolume * ConstructDetector ()

Private Attributes

DetectorMessengerdetectorMessenger
G4VPhysicalVolume * world_pvol
MyFieldSvcpMyFieldSvc
MyDetectorManagerpMyDetectorManager

Detailed Description

Definition at line 20 of file DetectorConstruction.hh.


Constructor & Destructor Documentation

DetectorConstruction::DetectorConstruction (  ) 
DetectorConstruction::~DetectorConstruction (  ) 

Definition at line 29 of file DetectorConstruction.cc.

References detectorMessenger.

00029                                            {
00030   delete detectorMessenger;
00031 }


Member Function Documentation

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  ) 
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 }


Member Data Documentation

Definition at line 41 of file DetectorConstruction.hh.

Referenced by DetectorConstruction(), and ~DetectorConstruction().

G4VPhysicalVolume* DetectorConstruction::world_pvol [private]

Definition at line 43 of file DetectorConstruction.hh.

Referenced by ConstructDetector(), and ResetMag().


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

Generated on 15 Jun 2016 for g4sim by  doxygen 1.6.1