ATLAS Offline Software
Loading...
Searching...
No Matches
PVNotifier Class Reference

Notifier class to prepend detector name to all G4 Physical Volumes Only to be used by the G4GeometryNotifierSvc. More...

#include <PVNotifier.h>

Inheritance diagram for PVNotifier:
Collaboration diagram for PVNotifier:

Public Member Functions

void NotifyRegistration ()
void NotifyDeRegistration ()

Private Member Functions

 PVNotifier (G4GeometryNotifierSvc *)

Private Attributes

G4GeometryNotifierSvcm_notifierSvc

Friends

class G4GeometryNotifierSvc

Detailed Description

Notifier class to prepend detector name to all G4 Physical Volumes Only to be used by the G4GeometryNotifierSvc.

Definition at line 15 of file PVNotifier.h.

Constructor & Destructor Documentation

◆ PVNotifier()

PVNotifier::PVNotifier ( G4GeometryNotifierSvc * gs)
private

Definition at line 12 of file PVNotifier.cxx.

13 : m_notifierSvc(gs)
14{
15 G4PhysicalVolumeStore* store = G4PhysicalVolumeStore::GetInstance();
16 store->SetNotifier(this);
17}
G4GeometryNotifierSvc * m_notifierSvc
Definition PVNotifier.h:28
TestStore store
Definition TestStore.cxx:23

Member Function Documentation

◆ NotifyDeRegistration()

void PVNotifier::NotifyDeRegistration ( )

Definition at line 30 of file PVNotifier.cxx.

31{
32}

◆ NotifyRegistration()

void PVNotifier::NotifyRegistration ( )

Definition at line 19 of file PVNotifier.cxx.

20{
21 G4PhysicalVolumeStore* store = G4PhysicalVolumeStore::GetInstance();
22 unsigned int current = store->size();
23 G4VPhysicalVolume* lV = (*store)[current-1];
24 std::string temp1 = m_notifierSvc->GetCurrentDetectorName() + "::";
25 std::string temp2 = lV->GetName().substr(0, temp1.size());
26 if (temp1 != temp2)
27 lV->SetName(temp1 + lV->GetName());
28}

◆ G4GeometryNotifierSvc

friend class G4GeometryNotifierSvc
friend

Definition at line 17 of file PVNotifier.h.

Member Data Documentation

◆ m_notifierSvc

G4GeometryNotifierSvc* PVNotifier::m_notifierSvc
private

Definition at line 28 of file PVNotifier.h.


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