aegir
Phlex-based simulation framework for the SHiP experiment.
Loading...
Searching...
No Matches
Classes | Functions
SHiP::g4::scoring_plane_detail Namespace Reference

Classes

struct  Extent
 A placed plane's extent in the global frame (Geant4 internal units). More...
 
struct  Placement
 A physical volume reached from the world, with the transform taking its local frame to the global one. More...
 

Functions

std::string shape_error (ScoringPlaneConfig const &p)
 What is wrong with a plane's shape and size, or an empty string.
 
std::string placement_error (ScoringPlaneConfig const &p)
 What is wrong with a plane's placement settings, or an empty string.
 
template<typename Visit >
void walk (G4VPhysicalVolume *pv, G4VPhysicalVolume *parent, G4Transform3D const &to_global, Visit &visit)
 Depth-first visit of every placement below (and including) pv.
 
Placement find_unique (G4VPhysicalVolume *world, std::string const &lv_name, std::string const &plane, char const *role)
 The single placement of the logical volume named lv_name.
 
std::pair< G4ThreeVector, G4ThreeVector > global_bounds (Placement const &p)
 Global axis-aligned bounding box of a placed volume.
 
G4ThreeVector plane_centre (ScoringPlaneConfig const &cfg, G4VPhysicalVolume *mass_world)
 A plane's centre in the global frame: its position, or behind its after_volume in the detector geometry under mass_world.
 
Extent extent (ScoringPlaneConfig const &cfg, G4ThreeVector centre)
 
std::pair< double, double > distance_range_to_box (double x, double y, Extent const &box)
 Closest and farthest distance from the point (x, y) to the points of a box's cross-section, an axis-aligned rectangle.
 
std::pair< double, double > distance_range_to_tube (double x, double y, Extent const &tube)
 Closest and farthest distance from the point (x, y) to the points of a tube's cross-section, an annulus.
 
bool overlap (Extent const &a, Extent const &b)
 Whether two axis-aligned planes share any volume; planes that only touch do not overlap.
 
void check_inside_world (std::string const &name, Extent const &e, G4VPhysicalVolume *world)
 Throw if e (plane name) is not inside the world's bounding box.
 
G4VSolid * make_solid (ScoringPlaneConfig const &cfg)
 

Function Documentation

◆ check_inside_world()

void SHiP::g4::scoring_plane_detail::check_inside_world ( std::string const &  name,
Extent const &  e,
G4VPhysicalVolume *  world 
)
inline

Throw if e (plane name) is not inside the world's bounding box.

Exact for the usual box-shaped world; CheckOverlaps() backs it up for others.

◆ distance_range_to_box()

std::pair< double, double > SHiP::g4::scoring_plane_detail::distance_range_to_box ( double  x,
double  y,
Extent const &  box 
)
inline

Closest and farthest distance from the point (x, y) to the points of a box's cross-section, an axis-aligned rectangle.

◆ distance_range_to_tube()

std::pair< double, double > SHiP::g4::scoring_plane_detail::distance_range_to_tube ( double  x,
double  y,
Extent const &  tube 
)
inline

Closest and farthest distance from the point (x, y) to the points of a tube's cross-section, an annulus.

◆ extent()

Extent SHiP::g4::scoring_plane_detail::extent ( ScoringPlaneConfig const &  cfg,
G4ThreeVector  centre 
)
inline

◆ find_unique()

Placement SHiP::g4::scoring_plane_detail::find_unique ( G4VPhysicalVolume *  world,
std::string const &  lv_name,
std::string const &  plane,
char const *  role 
)
inline

The single placement of the logical volume named lv_name.

A volume placed more than once is rejected: a plane added to (or positioned from) it would be ambiguous or silently duplicated in every copy.

◆ global_bounds()

std::pair< G4ThreeVector, G4ThreeVector > SHiP::g4::scoring_plane_detail::global_bounds ( Placement const &  p)
inline

Global axis-aligned bounding box of a placed volume.

◆ make_solid()

G4VSolid * SHiP::g4::scoring_plane_detail::make_solid ( ScoringPlaneConfig const &  cfg)
inline

◆ overlap()

bool SHiP::g4::scoring_plane_detail::overlap ( Extent const &  a,
Extent const &  b 
)
inline

Whether two axis-aligned planes share any volume; planes that only touch do not overlap.

Exact for every pair of shapes: each cross-section is connected, so the distances from a tube's axis to the other cross-section cover the whole interval between their closest and farthest values, and the two overlap exactly when that interval meets the tube's radial range.

◆ placement_error()

std::string SHiP::g4::scoring_plane_detail::placement_error ( ScoringPlaneConfig const &  p)
inline

What is wrong with a plane's placement settings, or an empty string.

◆ plane_centre()

G4ThreeVector SHiP::g4::scoring_plane_detail::plane_centre ( ScoringPlaneConfig const &  cfg,
G4VPhysicalVolume *  mass_world 
)
inline

A plane's centre in the global frame: its position, or behind its after_volume in the detector geometry under mass_world.

◆ shape_error()

std::string SHiP::g4::scoring_plane_detail::shape_error ( ScoringPlaneConfig const &  p)
inline

What is wrong with a plane's shape and size, or an empty string.

◆ walk()

template<typename Visit >
void SHiP::g4::scoring_plane_detail::walk ( G4VPhysicalVolume *  pv,
G4VPhysicalVolume *  parent,
G4Transform3D const &  to_global,
Visit &  visit 
)

Depth-first visit of every placement below (and including) pv.

Replicated and parameterised volumes have no single transform, so they and their contents are not visited.