Construct detector based on text geometry description.
More...
Construct detector based on text geometry description.
Definition at line 419 of file gears.cc.
◆ TextDetectorBuilder()
| TextDetectorBuilder::TextDetectorBuilder |
( |
| ) |
|
|
inline |
Definition at line 421 of file gears.cc.
421 : G4tgbDetectorBuilder() {
Extension to default text geometry file line processor.
◆ ~TextDetectorBuilder()
| TextDetectorBuilder::~TextDetectorBuilder |
( |
| ) |
|
|
inline |
Definition at line 424 of file gears.cc.
424 {
delete fLineProcessor; }
◆ ConstructDetector()
| G4VPhysicalVolume * TextDetectorBuilder::ConstructDetector |
( |
const G4tgrVolume * |
topVol | ) |
|
Construct detector based on text geometry description.
Definition at line 451 of file gears.cc.
452 G4VPhysicalVolume *world = G4tgbDetectorBuilder::ConstructDetector(topVol);
454 G4tgbVolumeMgr *tgbVolmgr = G4tgbVolumeMgr::GetInstance();
457 G4String physV1 = border->
v1.substr(0, border->
v1.find(
":"));
458 G4String physV2 = border->
v2.substr(0, border->
v2.find(
":"));
459 int copyNo1 = atoi(border->
v1.substr(border->
v1.find(
":") + 1).data());
460 int copyNo2 = atoi(border->
v2.substr(border->
v2.find(
":") + 1).data());
461 G4LogicalVolume *m1 = tgbVolmgr->FindG4PhysVol(physV1)->GetMotherLogical();
462 G4LogicalVolume *m2 = tgbVolmgr->FindG4PhysVol(physV2)->GetMotherLogical();
464 G4VPhysicalVolume *v1 = 0, *v2 = 0;
465 for (
int i = 0; i < (int)m1->GetNoDaughters(); i++) {
466 v1 = m1->GetDaughter(i);
467 if (v1->GetCopyNo() == copyNo1)
470 for (
int i = 0; i < (int)m2->GetNoDaughters(); i++) {
471 v2 = m2->GetDaughter(i);
472 if (v2->GetCopyNo() == copyNo2)
476 new G4LogicalBorderSurface(border->
name, v1, v2, border->
optic);
477 G4cout <<
"Border surface " << border->
name <<
" in between " << physV1
478 <<
":" << copyNo1 <<
" and " << physV2 <<
":" << copyNo2
479 <<
" added" << G4endl;
481 border = border->
next;
BorderSurface * Border
pointer to a BorderSurface object
G4String v1
name of volume 1
G4OpticalSurface * optic
point to G4OpticalSurface object
G4String v2
name of volume 2
A link list of G4LogicalBorderSurface.
G4String name
name of the surface
BorderSurface * next
link to next border surface
◆ ReadDetector()
| const G4tgrVolume * TextDetectorBuilder::ReadDetector |
( |
| ) |
|
Read text geometry input.
Definition at line 439 of file gears.cc.
440 G4tgrFileReader *reader = G4tgrFileReader::GetInstance();
441 reader->SetLineProcessor(fLineProcessor);
443 G4tgrVolumeMgr *mgr = G4tgrVolumeMgr::GetInstance();
444 const G4tgrVolume *world = mgr->GetTopVolume();
The documentation for this class was generated from the following file: