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

#include <PhysicalVolumeAccessor.h>

Collaboration diagram for PhysicalVolumeAccessor:

Public Member Functions

 PhysicalVolumeAccessor (const std::string &)
 PhysicalVolumeAccessor (const std::string &, const std::string &)
const G4VPhysicalVolume * GetPhysicalVolume (int) const
void SetPhysicalVolumeList (const std::string &)

Private Member Functions

G4LogicalVolume * GetLV (const std::string &)

Private Attributes

G4LogicalVolume * m_theLogicalVolume
PVMap m_thePhysicalVolumes

Detailed Description

Definition at line 18 of file PhysicalVolumeAccessor.h.

Constructor & Destructor Documentation

◆ PhysicalVolumeAccessor() [1/2]

PhysicalVolumeAccessor::PhysicalVolumeAccessor ( const std::string & name)

Definition at line 22 of file PhysicalVolumeAccessor.cxx.

23{
25}
G4LogicalVolume * GetLV(const std::string &)
G4LogicalVolume * m_theLogicalVolume

◆ PhysicalVolumeAccessor() [2/2]

PhysicalVolumeAccessor::PhysicalVolumeAccessor ( const std::string & name,
const std::string & PVname )

Definition at line 27 of file PhysicalVolumeAccessor.cxx.

29{
31 assert (m_theLogicalVolume!=nullptr);
32 for (unsigned int i=0;i<m_theLogicalVolume->GetNoDaughters();i++)
33 {
34 G4VPhysicalVolume *pv=m_theLogicalVolume->GetDaughter(i);
35 if (PVname == static_cast<const std::string&>(pv->GetName()))
36 {
37 m_thePhysicalVolumes[pv->GetCopyNo()]=pv;
38 }
39 }
40}

Member Function Documentation

◆ GetLV()

G4LogicalVolume * PhysicalVolumeAccessor::GetLV ( const std::string & name)
private

Definition at line 10 of file PhysicalVolumeAccessor.cxx.

11{
12 G4LogicalVolumeStore *lvs=G4LogicalVolumeStore::GetInstance();
13 for (unsigned int i=0;i<lvs->size();i++)
14 {
15 std::string lname=((lvs->operator[](i))->GetName());
16 if (name==lname)
17 return (lvs->operator[](i));
18 }
19 return nullptr;
20}

◆ GetPhysicalVolume()

const G4VPhysicalVolume * PhysicalVolumeAccessor::GetPhysicalVolume ( int icopy) const

Definition at line 42 of file PhysicalVolumeAccessor.cxx.

43{
44 auto physVolIter = m_thePhysicalVolumes.find(icopy);
45 if (physVolIter!=m_thePhysicalVolumes.end())
46 return physVolIter->second;
47 else
48 {
49 return nullptr;
50 }
51}

◆ SetPhysicalVolumeList()

void PhysicalVolumeAccessor::SetPhysicalVolumeList ( const std::string & name)

Definition at line 53 of file PhysicalVolumeAccessor.cxx.

54{
55 // assert (m_thePhysicalVolumes.size()==0);
56 for (unsigned int i=0;i<m_theLogicalVolume->GetNoDaughters();i++)
57 {
58 G4VPhysicalVolume *pv=m_theLogicalVolume->GetDaughter(i);
59 if (name == static_cast<const std::string&>(pv->GetName()))
60 {
61 m_thePhysicalVolumes[pv->GetCopyNo()]=pv;
62 }
63 }
64}

Member Data Documentation

◆ m_theLogicalVolume

G4LogicalVolume* PhysicalVolumeAccessor::m_theLogicalVolume
private

Definition at line 25 of file PhysicalVolumeAccessor.h.

◆ m_thePhysicalVolumes

PVMap PhysicalVolumeAccessor::m_thePhysicalVolumes
private

Definition at line 26 of file PhysicalVolumeAccessor.h.


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