Geant4  10.02.p03
ExTGDetectorConstructionWithSD Class Reference

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

#include <ExTGDetectorConstructionWithSD.hh>

Inheritance diagram for ExTGDetectorConstructionWithSD:
Collaboration diagram for ExTGDetectorConstructionWithSD:

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
 

Private Attributes

G4tgrMessengerfMessenger
 

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::ExTGDetectorConstructionWithSD ( )

◆ ~ExTGDetectorConstructionWithSD()

ExTGDetectorConstructionWithSD::~ExTGDetectorConstructionWithSD ( )

Definition at line 48 of file ExTGDetectorConstructionWithSD.cc.

49 {
50  delete fMessenger;
51 }

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * ExTGDetectorConstructionWithSD::Construct ( void  )
virtual

Implements G4VUserDetectorConstruction.

Definition at line 54 of file ExTGDetectorConstructionWithSD.cc.

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

◆ ConstructSDandField()

void ExTGDetectorConstructionWithSD::ConstructSDandField ( )
virtual

Reimplemented from G4VUserDetectorConstruction.

Definition at line 71 of file ExTGDetectorConstructionWithSD.cc.

72 {
73  //------------------------------------------------
74  // Sensitive detectors
75  //------------------------------------------------
76 
77  G4String trackerChamberSDname = "ExTextGeom/TrackerChamberSD";
78  ExTGTrackerSD* aTrackerSD = new ExTGTrackerSD( trackerChamberSDname );
79  G4LogicalVolume * logicChamber =
81  if(logicChamber)
82  {
83  SetSensitiveDetector("Chamber", aTrackerSD );
84  }
85  else
86  {
87  G4Exception("ExTGDetectorConstructionWithSD::Construct()",
88  "InvalidGeometry", JustWarning,
89  "Volume does not exists in geometry: Chamber");
90  }
91 
92 }
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)
Here is the call graph for this function:

Member Data Documentation

◆ fMessenger

G4tgrMessenger* ExTGDetectorConstructionWithSD::fMessenger
private

Definition at line 53 of file ExTGDetectorConstructionWithSD.hh.


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