aegir
Phlex-based simulation framework for the SHiP experiment.
Loading...
Searching...
No Matches
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
scoring_planes.hpp File Reference
#include <spdlog/spdlog.h>
#include <G4Box.hh>
#include <G4LogicalVolume.hh>
#include <G4LogicalVolumeStore.hh>
#include <G4Navigator.hh>
#include <G4NistManager.hh>
#include <G4PVPlacement.hh>
#include <G4Point3D.hh>
#include <G4SDManager.hh>
#include <G4Step.hh>
#include <G4StepPoint.hh>
#include <G4String.hh>
#include <G4ThreeVector.hh>
#include <G4Track.hh>
#include <G4Transform3D.hh>
#include <G4TransportationManager.hh>
#include <G4Tubs.hh>
#include <G4VPhysicalVolume.hh>
#include <G4VSensitiveDetector.hh>
#include <G4VSolid.hh>
#include <G4VUserParallelWorld.hh>
#include <SHiP/QuantityView.hpp>
#include <SHiP/SimHit.hpp>
#include <SHiP/Units.hpp>
#include <algorithm>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <numbers>
#include <optional>
#include <stdexcept>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include "geant4_sim_core.hpp"
#include "scoring_plane_id.hpp"
#include "units/clhep_bridge.hpp"
Include dependency graph for scoring_planes.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SHiP::g4::ScoringPlaneConfig
 One scoring plane, as configured in the geant4 module's scoring_planes. More...
 
struct  SHiP::g4::ScoringPlaneInfo
 What the sensitive detector needs to know about a placed plane. More...
 
struct  SHiP::g4::scoring_plane_detail::Placement
 A physical volume reached from the world, with the transform taking its local frame to the global one. More...
 
struct  SHiP::g4::scoring_plane_detail::Extent
 A placed plane's extent in the global frame (Geant4 internal units). More...
 
class  SHiP::g4::ScoringPlaneSD
 Records one SimHit per track entering a scoring plane through its surface, regardless of particle type or energy deposit. More...
 
class  SHiP::g4::ScoringParallelWorld
 The parallel world holding the scoring planes. More...
 

Namespaces

namespace  SHiP
 
namespace  SHiP::g4
 
namespace  SHiP::g4::scoring_plane_detail
 

Typedefs

using SHiP::g4::ScoringPlaneMap = std::unordered_map< G4LogicalVolume *, ScoringPlaneInfo >
 

Enumerations

enum class  SHiP::g4::ScoringShape : std::uint8_t { SHiP::g4::box , SHiP::g4::tube }
 

Functions

std::string SHiP::g4::scoring_plane_detail::shape_error (ScoringPlaneConfig const &p)
 What is wrong with a plane's shape and size, or an empty string.
 
std::string SHiP::g4::scoring_plane_detail::placement_error (ScoringPlaneConfig const &p)
 What is wrong with a plane's placement settings, or an empty string.
 
void SHiP::g4::validate_scoring_planes (std::vector< ScoringPlaneConfig > const &planes)
 Check a set of plane configurations for consistency on their own (no geometry needed); throws std::invalid_argument naming the offending plane.
 
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.
 
Placement SHiP::g4::scoring_plane_detail::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 > SHiP::g4::scoring_plane_detail::global_bounds (Placement const &p)
 Global axis-aligned bounding box of a placed volume.
 
G4ThreeVector SHiP::g4::scoring_plane_detail::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 SHiP::g4::scoring_plane_detail::extent (ScoringPlaneConfig const &cfg, G4ThreeVector centre)
 
std::pair< double, double > SHiP::g4::scoring_plane_detail::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 > SHiP::g4::scoring_plane_detail::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 SHiP::g4::scoring_plane_detail::overlap (Extent const &a, Extent const &b)
 Whether two axis-aligned planes share any volume; planes that only touch do not overlap.
 
void SHiP::g4::scoring_plane_detail::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 * SHiP::g4::scoring_plane_detail::make_solid (ScoringPlaneConfig const &cfg)
 
ScoringPlaneMap SHiP::g4::place_scoring_planes (G4VPhysicalVolume *mass_world, G4VPhysicalVolume *scoring_world, std::vector< ScoringPlaneConfig > const &planes)
 Build the configured planes and place them in scoring_world, the parallel world; after_volume references are resolved in the detector geometry under mass_world.
 

Variables

constexpr char const * SHiP::g4::kScoringWorldName = "aegir_scoring_planes"
 Name of the parallel world holding the scoring planes, and of the G4ParallelWorldPhysics constructor that makes Geant4 track through it.