Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
ExTGDetectorConstructionWithSD Class Reference

Detector construction class using text geometry file and using a sensitive detector. More...

#include <ExTGDetectorConstructionWithSD.hh>

Inheritance diagram for ExTGDetectorConstructionWithSD:
G4VUserDetectorConstruction

Public Member Functions

 ExTGDetectorConstructionWithSD ()
 
 ~ExTGDetectorConstructionWithSD ()
 
G4VPhysicalVolumeConstruct ()
 
void ConstructSDandField ()
 
- Public Member Functions inherited from G4VUserDetectorConstruction
 G4VUserDetectorConstruction ()
 
virtual ~G4VUserDetectorConstruction ()
 
virtual void CloneSD ()
 
virtual void CloneF ()
 
void RegisterParallelWorld (G4VUserParallelWorld *)
 
G4int ConstructParallelGeometries ()
 
void ConstructParallelSD ()
 
G4int GetNumberOfParallelWorld () const
 
G4VUserParallelWorldGetParallelWorld (G4int i) const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VUserDetectorConstruction
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Detailed Description

Detector construction class using text geometry file and using a sensitive detector.

Definition at line 41 of file ExTGDetectorConstructionWithSD.hh.

Constructor & Destructor Documentation

ExTGDetectorConstructionWithSD::ExTGDetectorConstructionWithSD ( )

Definition at line 43 of file ExTGDetectorConstructionWithSD.cc.

44 {
45  fMessenger = new G4tgrMessenger;
46 }
ExTGDetectorConstructionWithSD::~ExTGDetectorConstructionWithSD ( )

Definition at line 49 of file ExTGDetectorConstructionWithSD.cc.

50 {
51  delete fMessenger;
52 }

Member Function Documentation

G4VPhysicalVolume * ExTGDetectorConstructionWithSD::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 55 of file ExTGDetectorConstructionWithSD.cc.

References G4tgbVolumeMgr::AddTextFile(), G4tgbVolumeMgr::GetInstance(), and G4tgbVolumeMgr::ReadAndConstructDetector().

56 {
57  //------------------------------------------------
58  // Define one or several text files containing the geometry description
59  //------------------------------------------------
60  G4String filename = "g4geom_SD.txt";
62  volmgr->AddTextFile(filename);
63 
64  //------------------------------------------------
65  // Read the text files and construct the GEANT4 geometry
66  //------------------------------------------------
67  G4VPhysicalVolume* physiWorld = volmgr->ReadAndConstructDetector();
68 
69  return physiWorld;
70 }
G4VPhysicalVolume * ReadAndConstructDetector()
void AddTextFile(const G4String &fname)
static G4tgbVolumeMgr * GetInstance()
void ExTGDetectorConstructionWithSD::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 72 of file ExTGDetectorConstructionWithSD.cc.

References G4tgbVolumeMgr::FindG4LogVol(), G4Exception(), G4tgbVolumeMgr::GetInstance(), JustWarning, and G4VUserDetectorConstruction::SetSensitiveDetector().

73 {
74  //------------------------------------------------
75  // Sensitive detectors
76  //------------------------------------------------
77 
78  G4String trackerChamberSDname = "ExTextGeom/TrackerChamberSD";
79  ExTGTrackerSD* aTrackerSD = new ExTGTrackerSD( trackerChamberSDname );
80  G4LogicalVolume * logicChamber =
82  if(logicChamber)
83  {
84  SetSensitiveDetector("Chamber", aTrackerSD );
85  }
86  else
87  {
88  G4Exception("ExTGDetectorConstructionWithSD::Construct()",
89  "InvalidGeometry", JustWarning,
90  "Volume does not exists in geometry: Chamber");
91  }
92 
93 
94 }
Example of Sensitive detector.
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static G4tgbVolumeMgr * GetInstance()
G4LogicalVolume * FindG4LogVol(const G4String &theName, const G4bool bExists=0)

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