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

#include <B03PVolumeStore.hh>

Public Member Functions

 B03PVolumeStore ()
 
 ~B03PVolumeStore ()
 
void AddPVolume (const G4GeometryCell &cell)
 
const G4VPhysicalVolumeGetPVolume (const G4String &name) const
 
G4String GetPNames () const
 

Detailed Description

Definition at line 53 of file B03PVolumeStore.hh.

Constructor & Destructor Documentation

B03PVolumeStore::B03PVolumeStore ( )

Definition at line 48 of file B03PVolumeStore.cc.

48 {}
B03PVolumeStore::~B03PVolumeStore ( )

Definition at line 52 of file B03PVolumeStore.cc.

52 {}

Member Function Documentation

void B03PVolumeStore::AddPVolume ( const G4GeometryCell cell)

Definition at line 56 of file B03PVolumeStore.cc.

References G4cout, and G4endl.

56  {
57 
58  B03SetGeometryCell::iterator it =
59  fSetGeometryCell.find(cell);
60  if (it != fSetGeometryCell.end()) {
61  G4cout << "B03PVolumeStore::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 B03PVolumeStore::GetPNames ( ) const

Definition at line 92 of file B03PVolumeStore.cc.

References G4VPhysicalVolume::GetName().

Referenced by B03ImportanceDetectorConstruction::ListPhysNamesAsG4String().

92  {
93  G4String NameString;
94  for (B03SetGeometryCell::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 * B03PVolumeStore::GetPVolume ( const G4String name) const

Definition at line 74 of file B03PVolumeStore.cc.

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

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

74  {
75  const G4VPhysicalVolume *pvol = 0;
76  for (B03SetGeometryCell::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 << "B03PVolumeStore::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

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