Geant4 11.2.2
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 (const G4String &worldName)
 
virtual ~G4VUserParallelWorld ()=default
 
virtual void Construct ()=0
 
virtual void ConstructSD ()
 
const G4StringGetName ()
 

Protected Member Functions

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

Protected Attributes

G4String fWorldName = "ParallelWorld"
 

Detailed Description

Definition at line 47 of file G4VUserParallelWorld.hh.

Constructor & Destructor Documentation

◆ G4VUserParallelWorld()

G4VUserParallelWorld::G4VUserParallelWorld ( const G4String & worldName)

Definition at line 41 of file G4VUserParallelWorld.cc.

42{
43 fWorldName = worldName;
44}

◆ ~G4VUserParallelWorld()

virtual G4VUserParallelWorld::~G4VUserParallelWorld ( )
virtualdefault

Member Function Documentation

◆ Construct()

virtual void G4VUserParallelWorld::Construct ( )
pure virtual

◆ ConstructSD()

virtual void G4VUserParallelWorld::ConstructSD ( )
inlinevirtual

Definition at line 54 of file G4VUserParallelWorld.hh.

54{}

◆ GetName()

const G4String & G4VUserParallelWorld::GetName ( )
inline

Definition at line 56 of file G4VUserParallelWorld.hh.

56{ return fWorldName; }

Referenced by G4VUserDetectorConstruction::RegisterParallelWorld().

◆ GetWorld()

G4VPhysicalVolume * G4VUserParallelWorld::GetWorld ( )
protected

Definition at line 47 of file G4VUserParallelWorld.cc.

48{
49 G4VPhysicalVolume* pWorld =
51 pWorld->SetName(fWorldName);
52 return pWorld;
53}
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.

58{
59 G4bool found = false;
61 auto volmap = store->GetMap();
62 auto pos = volmap.find(logVolName);
63 if (pos != volmap.cend()) {
64 if ((pos->second.size() > 1) && !multi) {
65 G4String eM = "More than one logical volumes of name <";
66 eM += pos->first;
67 eM += "> are found and thus the sensitive detector <";
68 eM += aSD->GetName();
69 eM += "> cannot be uniquely assigned.";
70 G4Exception("G4VUserParallelWorld::SetSensitiveDetector()", "Run0052", FatalErrorInArgument,
71 eM);
72 }
73 found = true;
74 for (auto& i : pos->second) {
76 }
77 }
78 if (!found) {
79 G4String eM2 = "No logical volume of name <";
80 eM2 += logVolName;
81 eM2 += "> is found. The specified sensitive detector <";
82 eM2 += aSD->GetName();
83 eM2 += "> couldn't be assigned to any volume.";
84 G4Exception("G4VUserParallelWorld::SetSensitiveDetector()", "Run0053", FatalErrorInArgument,
85 eM2);
86 }
87}
@ FatalErrorInArgument
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
bool G4bool
Definition G4Types.hh:86
const std::map< G4String, std::vector< G4LogicalVolume * > > & GetMap() const
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 90 of file G4VUserParallelWorld.cc.

91{
93 logVol->SetSensitiveDetector(aSD);
94}
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
static G4SDManager * GetSDMpointer()
void AddNewDetector(G4VSensitiveDetector *aSD)

Member Data Documentation

◆ fWorldName

G4String G4VUserParallelWorld::fWorldName = "ParallelWorld"
protected

Definition at line 66 of file G4VUserParallelWorld.hh.

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


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