Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VUserParallelWorld Class Referenceabstract

#include <G4VUserParallelWorld.hh>

Public Member Functions

 G4VUserParallelWorld (G4String worldName)
 
virtual ~G4VUserParallelWorld ()
 
virtual void Construct ()=0
 
virtual void ConstructSD ()
 
G4String GetName ()
 

Protected Member Functions

G4VPhysicalVolumeGetWorld ()
 
void SetSensitiveDetector (const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)
 
void SetSensitiveDetector (G4LogicalVolume *logVol, G4VSensitiveDetector *aSD)
 

Protected Attributes

G4String fWorldName
 

Detailed Description

Definition at line 47 of file G4VUserParallelWorld.hh.

Constructor & Destructor Documentation

◆ G4VUserParallelWorld()

G4VUserParallelWorld::G4VUserParallelWorld ( G4String  worldName)

Definition at line 38 of file G4VUserParallelWorld.cc.

39{
40 fWorldName = worldName;
41}

◆ ~G4VUserParallelWorld()

G4VUserParallelWorld::~G4VUserParallelWorld ( )
virtual

Definition at line 43 of file G4VUserParallelWorld.cc.

43{ ; }

Member Function Documentation

◆ Construct()

virtual void G4VUserParallelWorld::Construct ( )
pure virtual

◆ ConstructSD()

void G4VUserParallelWorld::ConstructSD ( )
virtual

Definition at line 45 of file G4VUserParallelWorld.cc.

45{ ; }

◆ GetName()

G4String G4VUserParallelWorld::GetName ( )
inline

Definition at line 64 of file G4VUserParallelWorld.hh.

64{ return fWorldName; }

Referenced by G4VUserDetectorConstruction::RegisterParallelWorld().

◆ GetWorld()

G4VPhysicalVolume * G4VUserParallelWorld::GetWorld ( )
protected

Definition at line 47 of file G4VUserParallelWorld.cc.

48{
49 G4VPhysicalVolume* pWorld =
52 pWorld->SetName(fWorldName);
53 return pWorld;
54}
G4VPhysicalVolume * GetParallelWorld(const G4String &worldName)
static G4TransportationManager * GetTransportationManager()
void SetName(const G4String &pName)

◆ SetSensitiveDetector() [1/2]

void G4VUserParallelWorld::SetSensitiveDetector ( const G4String logVolName,
G4VSensitiveDetector aSD,
G4bool  multi = false 
)
protected

Definition at line 56 of file G4VUserParallelWorld.cc.

59{
60 G4bool found = false;
62 for(G4LogicalVolumeStore::iterator pos = store->begin(); pos != store->end();
63 pos++)
64 {
65 if((*pos)->GetName() == logVolName)
66 {
67 if(found && !multi)
68 {
69 G4String eM = "More than one logical volumes of the name <";
70 eM += (*pos)->GetName();
71 eM += "> are found and thus the sensitive detector <";
72 eM += aSD->GetName();
73 eM += "> cannot be uniquely assigned.";
74 G4Exception("G4VUserParallelWorld::SetSensitiveDetector", "Run5052",
76 }
77 found = true;
78 SetSensitiveDetector(*pos, aSD);
79 }
80 }
81 if(!found)
82 {
83 G4String eM2 = "No logical volume of the name <";
84 eM2 += logVolName;
85 eM2 += "> is found. The specified sensitive detector <";
86 eM2 += aSD->GetName();
87 eM2 += "> couldn't be assigned to any volume.";
88 G4Exception("G4VUserParallelWorld::SetSensitiveDetector", "Run5053",
90 }
91}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
bool G4bool
Definition: G4Types.hh:86
static G4LogicalVolumeStore * GetInstance()
void SetSensitiveDetector(const G4String &logVolName, G4VSensitiveDetector *aSD, G4bool multi=false)

Referenced by SetSensitiveDetector().

◆ SetSensitiveDetector() [2/2]

void G4VUserParallelWorld::SetSensitiveDetector ( G4LogicalVolume logVol,
G4VSensitiveDetector aSD 
)
protected

Definition at line 93 of file G4VUserParallelWorld.cc.

95{
97 logVol->SetSensitiveDetector(aSD);
98}
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
static G4SDManager * GetSDMpointer()
Definition: G4SDManager.cc:39
void AddNewDetector(G4VSensitiveDetector *aSD)
Definition: G4SDManager.cc:71

Member Data Documentation

◆ fWorldName

G4String G4VUserParallelWorld::fWorldName
protected

Definition at line 58 of file G4VUserParallelWorld.hh.

Referenced by G4VUserParallelWorld(), GetName(), and GetWorld().


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