Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 

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 42 of file ExTGDetectorConstructionWithSD.cc.

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

Definition at line 48 of file ExTGDetectorConstructionWithSD.cc.

49 {
50  delete fMessenger;
51 }

Member Function Documentation

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:

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 );
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 }
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
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:40
static G4tgbVolumeMgr * GetInstance()
G4LogicalVolume * FindG4LogVol(const G4String &theName, const G4bool bExists=0)

Here is the call graph for this function:


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