Belle II Software development
GeoVXDAssembly Class Reference

Class to group some Geant4 volumes and place them all at once with a given transformation matrix. More...

#include <GeoVXDAssembly.h>

Public Types

typedef std::pair< G4LogicalVolume *, G4Transform3D > Placement
 Placement of a logical volume consists of the Volume and ins transformation.
 

Public Member Functions

void place (G4LogicalVolume *mother, const G4Transform3D &transform)
 Place all the volumes already added to the assembly in the given mother.
 
void add (G4LogicalVolume *volume, const G4Transform3D &transform=G4Transform3D())
 Add a volume to the assembly.
 
void add (const GeoVXDAssembly &assembly, const G4Transform3D &transform=G4Transform3D())
 Add a assembly to the assembly.
 

Private Attributes

std::vector< Placementm_volumes
 Array of all volumes and their placements in the assembly.
 

Detailed Description

Class to group some Geant4 volumes and place them all at once with a given transformation matrix.

This is similar to the G4VolumeAssembly but is much simpler and with less options

Definition at line 29 of file GeoVXDAssembly.h.

Member Typedef Documentation

◆ Placement

typedef std::pair<G4LogicalVolume*, G4Transform3D> Placement

Placement of a logical volume consists of the Volume and ins transformation.

Definition at line 32 of file GeoVXDAssembly.h.

Member Function Documentation

◆ add() [1/2]

void add ( const GeoVXDAssembly assembly,
const G4Transform3D &  transform = G4Transform3D() 
)
inline

Add a assembly to the assembly.

Parameters
assemblyassembly to be added
transformTransformation to be applied to the volume

Definition at line 53 of file GeoVXDAssembly.h.

54 {
55 for (const Placement& p : assembly.m_volumes) {
56 m_volumes.push_back(std::make_pair(p.first, transform * p.second));
57 }
58 }
std::pair< G4LogicalVolume *, G4Transform3D > Placement
Placement of a logical volume consists of the Volume and ins transformation.
std::vector< Placement > m_volumes
Array of all volumes and their placements in the assembly.

◆ add() [2/2]

void add ( G4LogicalVolume *  volume,
const G4Transform3D &  transform = G4Transform3D() 
)
inline

Add a volume to the assembly.

Parameters
volumeVolume to be added
transformTransformation to be applied to the volume

Definition at line 44 of file GeoVXDAssembly.h.

45 {
46 m_volumes.push_back(std::make_pair(volume, transform));
47 }

◆ place()

void place ( G4LogicalVolume *  mother,
const G4Transform3D &  transform 
)

Place all the volumes already added to the assembly in the given mother.

Parameters
motherPointer to the volume everything should be placed in
transformTransformation to apply to all volumes when placing them

Definition at line 20 of file GeoVXDAssembly.cc.

21 {
22 G4ReflectionFactory& reflection = *G4ReflectionFactory::Instance();
23 int numberOfDaughters = mother->GetNoDaughters();
24 for (Placement& p : m_volumes) {
25 reflection.Place(transform * p.second, p.first->GetName(), p.first,
26 mother, false, ++numberOfDaughters, false);
27 }
28 }

Member Data Documentation

◆ m_volumes

std::vector<Placement> m_volumes
private

Array of all volumes and their placements in the assembly.

Definition at line 62 of file GeoVXDAssembly.h.


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