Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
B02PVolumeStore Class Reference

#include <B02PVolumeStore.hh>

Public Member Functions

 B02PVolumeStore ()
 
 ~B02PVolumeStore ()
 
void AddPVolume (const G4GeometryCell &cell)
 
const G4VPhysicalVolumeGetPVolume (const G4String &name) const
 
G4int Size ()
 
G4String GetPNames () const
 

Detailed Description

Definition at line 53 of file B02PVolumeStore.hh.

Constructor & Destructor Documentation

B02PVolumeStore::B02PVolumeStore ( )

Definition at line 48 of file B02PVolumeStore.cc.

48 {}
B02PVolumeStore::~B02PVolumeStore ( )

Definition at line 52 of file B02PVolumeStore.cc.

52 {}

Member Function Documentation

void B02PVolumeStore::AddPVolume ( const G4GeometryCell cell)

Definition at line 56 of file B02PVolumeStore.cc.

References G4cout, and G4endl.

Referenced by B02ImportanceDetectorConstruction::Construct().

56  {
57 
58  B02SetGeometryCell::iterator it =
59  fSetGeometryCell.find(cell);
60  if (it != fSetGeometryCell.end()) {
61  G4cout << "B02PVolumeStore::AddPVolume: cell already stored"
62  << G4endl;
63  return;
64  }
65 
66  fSetGeometryCell.insert(cell);
67 
68 
69 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4String B02PVolumeStore::GetPNames ( ) const

Definition at line 92 of file B02PVolumeStore.cc.

References G4VPhysicalVolume::GetName().

Referenced by B02ImportanceDetectorConstruction::ListPhysNamesAsG4String().

92  {
93  G4String NameString;
94  for (B02SetGeometryCell::const_iterator it = fSetGeometryCell.begin();
95  it != fSetGeometryCell.end(); ++it) {
96  const G4VPhysicalVolume &vol = it->GetPhysicalVolume();
97  std::ostringstream os;
98  os << vol.GetName() << "_" << it->GetReplicaNumber()
99  << "\n";
100  G4String cellname = os.str();
101 
102  // G4String cellname(vol.GetName());
103  // cellname += G4String("_");
104  // cellname += std::str(it->GetReplicaNumber());
105 
106  NameString += cellname;
107  }
108  return NameString;
109 }
const G4String & GetName() const
const G4VPhysicalVolume * B02PVolumeStore::GetPVolume ( const G4String name) const

Definition at line 74 of file B02PVolumeStore.cc.

References G4cout, G4endl, and G4VPhysicalVolume::GetName().

Referenced by B02ImportanceDetectorConstruction::GetGeometryCell(), and B02ImportanceDetectorConstruction::GetPhysicalVolumeByName().

74  {
75  const G4VPhysicalVolume *pvol = 0;
76  for (B02SetGeometryCell::const_iterator it = fSetGeometryCell.begin();
77  it != fSetGeometryCell.end(); ++it) {
78  const G4VPhysicalVolume &vol = it->GetPhysicalVolume();
79  if (vol.GetName() == name) {
80  pvol = &vol;
81  }
82  }
83  if (!pvol) {
84  G4cout << "B02PVolumeStore::GetPVolume: no physical volume named: "
85  << name << ", found" << G4endl;
86  }
87  return pvol;
88 }
const XML_Char * name
G4GLOB_DLL std::ostream G4cout
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61
G4int B02PVolumeStore::Size ( )

Definition at line 113 of file B02PVolumeStore.cc.

Referenced by B02ImportanceDetectorConstruction::CreateImportanceStore(), and B02ImportanceDetectorConstruction::CreateWeightWindowStore().

113  {
114  return fSetGeometryCell.size();
115 }

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