Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
ExTGDetectorConstructionWithSD Class Reference

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

#include <Doxymodules_persistency.h>

Inheritance diagram for ExTGDetectorConstructionWithSD:
G4VUserDetectorConstruction

Public Member Functions

 ExTGDetectorConstructionWithSD ()
 
 ~ExTGDetectorConstructionWithSD ()
 
G4VPhysicalVolumeConstruct ()
 
void ConstructSDandField ()
 

Private Attributes

G4tgrMessengerfMessenger
 

Detailed Description

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

Definition at line 118 of file Doxymodules_persistency.h.

Constructor & Destructor Documentation

◆ ExTGDetectorConstructionWithSD()

ExTGDetectorConstructionWithSD::ExTGDetectorConstructionWithSD ( )

◆ ~ExTGDetectorConstructionWithSD()

ExTGDetectorConstructionWithSD::~ExTGDetectorConstructionWithSD ( )

Definition at line 47 of file ExTGDetectorConstructionWithSD.cc.

48{
49 delete fMessenger;
50}

Member Function Documentation

◆ Construct()

G4VPhysicalVolume * ExTGDetectorConstructionWithSD::Construct ( )

Definition at line 53 of file ExTGDetectorConstructionWithSD.cc.

54{
55 //------------------------------------------------
56 // Define one or several text files containing the geometry description
57 //------------------------------------------------
58 G4String filename = "g4geom_SD.txt";
59 G4tgbVolumeMgr* volmgr = G4tgbVolumeMgr::GetInstance();
60 volmgr->AddTextFile(filename);
61
62 //------------------------------------------------
63 // Read the text files and construct the GEANT4 geometry
64 //------------------------------------------------
65 G4VPhysicalVolume* physiWorld = volmgr->ReadAndConstructDetector();
66
67 return physiWorld;
68}

◆ ConstructSDandField()

void ExTGDetectorConstructionWithSD::ConstructSDandField ( )

Definition at line 70 of file ExTGDetectorConstructionWithSD.cc.

71{
72 //------------------------------------------------
73 // Sensitive detectors
74 //------------------------------------------------
75
76 G4String trackerChamberSDname = "ExTextGeom/TrackerChamberSD";
77 ExTGTrackerSD* aTrackerSD = new ExTGTrackerSD( trackerChamberSDname );
78 G4SDManager::GetSDMpointer()->AddNewDetector(aTrackerSD);
79 G4LogicalVolume * logicChamber =
80 G4tgbVolumeMgr::GetInstance()->FindG4LogVol("Chamber",0);
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.

Member Data Documentation

◆ fMessenger

G4tgrMessenger* ExTGDetectorConstructionWithSD::fMessenger
private

Definition at line 52 of file ExTGDetectorConstructionWithSD.hh.


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

Applications | User Support | Publications | Collaboration