File indexing completed on 2026-04-10 07:50:30
0001 #pragma once
0002
0003 #include "G4VPhysicalVolume.hh"
0004 #include "G4LogicalVolume.hh"
0005 #include "G4Material.hh"
0006
0007 #include "sstr.h"
0008 #include "U4Mat.h"
0009 #include "U4Surface.h"
0010
0011 struct U4Boundary
0012 {
0013 const G4LogicalVolume* const lv ;
0014 const G4LogicalVolume* const lv_p ;
0015 const G4Material* const imat_ ;
0016 const G4Material* const omat_ ;
0017 const G4MaterialPropertyVector* i_rindex ;
0018 const G4MaterialPropertyVector* o_rindex ;
0019 const char* imat ;
0020 const char* omat ;
0021 const G4LogicalSurface* const osur_ ;
0022 const G4LogicalSurface* const isur_ ;
0023 const char* isur ;
0024 const char* osur ;
0025 std::string bnd ;
0026
0027 U4Boundary(
0028 const G4VPhysicalVolume* const pv,
0029 const G4VPhysicalVolume* const pv_p
0030 );
0031
0032 };
0033
0034 inline U4Boundary::U4Boundary(
0035 const G4VPhysicalVolume* const pv,
0036 const G4VPhysicalVolume* const pv_p
0037 )
0038 :
0039 lv(pv->GetLogicalVolume()),
0040 lv_p(pv_p ? pv_p->GetLogicalVolume() : lv),
0041 imat_(lv->GetMaterial()),
0042 omat_(lv_p ? lv_p->GetMaterial() : imat_),
0043 i_rindex(U4Mat::GetRINDEX( imat_ )),
0044 o_rindex(U4Mat::GetRINDEX( omat_ )),
0045 imat(imat_->GetName().c_str()),
0046 omat(omat_->GetName().c_str()),
0047 osur_(U4Surface::Find( pv_p, pv )),
0048 isur_( i_rindex == nullptr ? nullptr : U4Surface::Find( pv , pv_p )),
0049 isur(isur_ ? isur_->GetName().c_str() : nullptr),
0050 osur(osur_ ? osur_->GetName().c_str() : nullptr),
0051 bnd(sstr::Join("/",omat,osur,isur,imat))
0052 {
0053 }
0054
0055
0056 inline std::ostream& operator<<(std::ostream& os, const U4Boundary& b)
0057 {
0058 os << "U4Boundary " << b.bnd ;
0059 return os;
0060 }
0061
0062