Project
Loading...
Searching...
No Matches
o2::simsetup::VecGeomG4Map Class Reference

#include <VecGeomG4Map.h>

Public Member Functions

void build (TG4RootDetectorConstruction const &dc, bool flattenAssemblies)
 
G4VPhysicalVolume *const * chain (int vgId, unsigned &size) const
 
vecgeom::VPlacedVolume const * toVecGeom (int g4Id) const
 
std::vector< vecgeom::VPlacedVolume const * > const & candidates (int g4Id) const
 The placements that share an ambiguous Geant4 volume, to be told apart by their chains.
 
bool chainMatches (vecgeom::VPlacedVolume const *pv, G4VPhysicalVolume *const *first, std::size_t n) const
 Whether a placement's chain is exactly the given run of Geant4 volumes.
 
unsigned chainSize (int vgId) const
 How many Geant4 levels a VecGeom placement accounts for.
 
vecgeom::VPlacedVolume const * world () const
 The outermost placement, standing for the Geant4 world volume.
 
std::size_t ambiguousCount () const
 How many Geant4 volumes share more than one VecGeom placement.
 
std::size_t size () const
 

Static Public Member Functions

static vecgeom::VPlacedVolume const * ambiguous ()
 Marks a Geant4 volume that several VecGeom placements reach.
 

Detailed Description

The correspondence between the VecGeom tree tgeo2vecgeom built and the Geant4 tree g4root built. Both are conversions of the same TGeoNode hierarchy, but not necessarily level for level: with assembly flattening one VecGeom placement stands for a whole assembly subtree, so a placement maps to a chain of Geant4 physical volumes rather than to one. Pushing the whole chain is what keeps the Geant4 touchable at the depth the TGeo navigator produces, and hence keeps every volume id, copy number and CurrentVolOffName offset unchanged.

Without flattening every chain has length one. Lookups are vector indexing: VecGeom placed-volume ids and Geant4 physical-volume instance ids are both dense.

Definition at line 38 of file VecGeomG4Map.h.

Member Function Documentation

◆ ambiguous()

static vecgeom::VPlacedVolume const * o2::simsetup::VecGeomG4Map::ambiguous ( )
inlinestatic

Marks a Geant4 volume that several VecGeom placements reach.

Definition at line 65 of file VecGeomG4Map.h.

◆ ambiguousCount()

std::size_t o2::simsetup::VecGeomG4Map::ambiguousCount ( ) const
inline

How many Geant4 volumes share more than one VecGeom placement.

Definition at line 104 of file VecGeomG4Map.h.

◆ build()

void o2::simsetup::VecGeomG4Map::build ( TG4RootDetectorConstruction const &  dc,
bool  flattenAssemblies 
)

Walks the TGeo hierarchy and pairs up the two conversions of it. Both must exist.

Parameters
flattenAssembliesmust match what the converter was told, since it decides how many TGeo nodes stand behind one VecGeom placement.

Definition at line 118 of file VecGeomG4Map.cxx.

◆ candidates()

std::vector< vecgeom::VPlacedVolume const * > const & o2::simsetup::VecGeomG4Map::candidates ( int  g4Id) const
inline

The placements that share an ambiguous Geant4 volume, to be told apart by their chains.

Definition at line 71 of file VecGeomG4Map.h.

◆ chain()

G4VPhysicalVolume *const * o2::simsetup::VecGeomG4Map::chain ( int  vgId,
unsigned &  size 
) const
inline

The Geant4 volumes a VecGeom placement stands for, outermost first. A size of zero means the placement was never paired up, which is a bug rather than a legal state.

Definition at line 48 of file VecGeomG4Map.h.

◆ chainMatches()

bool o2::simsetup::VecGeomG4Map::chainMatches ( vecgeom::VPlacedVolume const *  pv,
G4VPhysicalVolume *const *  first,
std::size_t  n 
) const
inline

Whether a placement's chain is exactly the given run of Geant4 volumes.

Definition at line 79 of file VecGeomG4Map.h.

◆ chainSize()

unsigned o2::simsetup::VecGeomG4Map::chainSize ( int  vgId) const
inline

How many Geant4 levels a VecGeom placement accounts for.

Definition at line 95 of file VecGeomG4Map.h.

◆ size()

std::size_t o2::simsetup::VecGeomG4Map::size ( ) const
inline

Definition at line 106 of file VecGeomG4Map.h.

◆ toVecGeom()

vecgeom::VPlacedVolume const * o2::simsetup::VecGeomG4Map::toVecGeom ( int  g4Id) const
inline

The VecGeom placement whose chain ends at the Geant4 volume g4Id. Null means that volume is only ever an intermediate assembly level, which flattening dissolved on the VecGeom side, so the walk extends past it. A plain vector index; the few Geant4 volumes reachable through more than one flattened chain answer ambiguous() and go to candidates().

Definition at line 62 of file VecGeomG4Map.h.

◆ world()

vecgeom::VPlacedVolume const * o2::simsetup::VecGeomG4Map::world ( ) const
inline

The outermost placement, standing for the Geant4 world volume.

Definition at line 101 of file VecGeomG4Map.h.


The documentation for this class was generated from the following files: