81 if (r1<=sphere_radius && r2>sphere_radius)
86 else if (r2<=sphere_radius && r1>sphere_radius)
100 c = r12-sphere_radius*sphere_radius;
101 d = std::sqrt(b*b-4.*a*c);
103 if (l > 1.) l=(-b-d)/2./a;
104 crossing_pos = pos1+l*dr;
105 cos_th = std::abs(dr.
cosTheta(crossing_pos));
119 if (step_at_boundary)
125 if (preStepTouchable && postStepTouchable
131 if (post_vol_name == volume_name )
136 else if (pre_vol_name == volume_name)
151 const G4String& mother_logical_vol_name,
158 if (step_at_boundary)
165 ? postStepTouchable->
GetVolume() :
nullptr;
167 ? preStepTouchable->
GetVolume() :
nullptr;
168 if (preStepTouchable !=
nullptr && postStepTouchable !=
nullptr
169 && postVol !=
nullptr && preVol !=
nullptr)
175 if (post_vol_name == volume_name
176 && pre_log_vol_name == mother_logical_vol_name)
181 else if (pre_vol_name == volume_name
182 && post_log_vol_name == mother_logical_vol_name )
205 cos_to_surface, GoingIn);
224 if (surf_type ==
"Sphere")
227 cos_to_surface, GoingIn);
229 else if (surf_type ==
"ExternalSurfaceOfAVolume")
232 cos_to_surface, GoingIn);
235 else if (surf_type ==
"BoundaryBetweenTwoVolumes")
239 cos_to_surface, GoingIn);
255 cos_to_surface, GoingIn))
276 if (step_at_boundary)
282 if (preStepTouchable && postStepTouchable)
285 if (post_vol_name ==
"")
291 if (pre_vol_name ==
"")
296 if (pre_vol_name == vol1_name && post_vol_name == vol2_name)
301 else if (pre_vol_name == vol2_name && post_vol_name == vol1_name)
318 Area = 4.*
pi*radius*radius;
352 thePhysicalVolume = thePhysVolStore->
GetVolume(volume_name);
353 if (thePhysicalVolume !=
nullptr)
358 while (mother !=
nullptr)
360 theTransformationFromPhysVolToWorld *=
363 for ( std::size_t i=0; i<thePhysVolStore->size(); ++i)
365 if ((*thePhysVolStore)[i]->GetLogicalVolume() == mother)
367 daughter = (*thePhysVolStore)[i];
374 G4cout <<
"Center of the spherical surface is at the position: "
394 thePhysicalVolume = thePhysVolStore->
GetVolume(volume_name);
395 if (thePhysicalVolume ==
nullptr)
403 if (theMother !=
nullptr) mother_vol_name= theMother->
GetName();
static const G4double pos
static constexpr double pi
static constexpr double cm
CLHEP::Hep3Vector G4ThreeVector
G4GLOB_DLL std::ostream G4cout
G4bool CrossingAGivenRegisteredSurface(const G4Step *aStep, const G4String &surface_name, G4ThreeVector &cross_pos, G4double &cos_to_surface, G4bool &GoingIn)
G4bool CrossingAnInterfaceBetweenTwoVolumes(const G4Step *aStep, const G4String &vol1_name, const G4String &vol2_name, G4ThreeVector &cross_pos, G4double &cos_to_surface, G4bool &GoingIn)
void ClearListOfSelectedSurface()
G4bool CrossingOneOfTheRegisteredSurface(const G4Step *aStep, G4String &surface_name, G4ThreeVector &cross_pos, G4double &cos_to_surface, G4bool &GoingIn)
~G4AdjointCrossSurfChecker()
G4bool AddaSphericalSurface(const G4String &SurfaceName, G4double radius, G4ThreeVector pos, G4double &area)
std::vector< G4String > ListOfSurfaceType
G4AdjointCrossSurfChecker()
std::vector< G4String > ListOfSurfaceName
G4bool GoingInOrOutOfaVolumeByExtSurface(const G4Step *aStep, const G4String &volume_name, const G4String &mother_lvol_name, G4double &cos_to_surface, G4bool &GoingIn)
G4bool AddanExtSurfaceOfAvolume(const G4String &SurfaceName, const G4String &volume_name, G4double &area)
static G4AdjointCrossSurfChecker * GetInstance()
G4bool AddanInterfaceBetweenTwoVolumes(const G4String &SurfaceName, const G4String &volume_name1, const G4String &volume_name2, G4double &area)
G4bool AddaSphericalSurfaceWithCenterAtTheCenterOfAVolume(const G4String &SurfaceName, G4double radius, const G4String &volume_name, G4ThreeVector ¢er, G4double &area)
std::vector< G4String > ListOfVol1Name
std::vector< G4ThreeVector > ListOfSphereCenter
std::vector< G4double > AreaOfSurface
G4bool GoingInOrOutOfaVolume(const G4Step *aStep, const G4String &volume_name, G4double &cos_to_surface, G4bool &GoingIn)
G4int FindRegisteredSurface(const G4String &name)
static G4ThreadLocal G4AdjointCrossSurfChecker * instance
G4bool CrossingASphere(const G4Step *aStep, G4double sphere_radius, G4ThreeVector sphere_center, G4ThreeVector &cross_pos, G4double &cos_to_surface, G4bool &GoingIn)
std::vector< G4String > ListOfVol2Name
std::vector< G4double > ListOfSphereRadius
G4VSolid * GetSolid() const
const G4String & GetName() const
static G4PhysicalVolumeStore * GetInstance()
G4VPhysicalVolume * GetVolume(const G4String &name, G4bool verbose=true, G4bool reverseSearch=false) const
G4StepStatus GetStepStatus() const
const G4VTouchable * GetTouchable() const
const G4ThreeVector & GetPosition() const
G4StepPoint * GetPreStepPoint() const
G4StepPoint * GetPostStepPoint() const
G4LogicalVolume * GetMotherLogical() const
G4LogicalVolume * GetLogicalVolume() const
const G4RotationMatrix * GetFrameRotation() const
const G4String & GetName() const
G4ThreeVector GetObjectTranslation() const
virtual G4double GetSurfaceArea()
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
const char * name(G4int ptype)