Belle II Software  release-08-01-10
GeoVXDAssembly.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #ifndef GEOVXDASSEMBLY_H
10 #define GEOVXDASSEMBLY_H
11 
12 #include <vector>
13 #include <G4Transform3D.hh>
14 
15 class G4LogicalVolume;
16 
17 namespace Belle2 {
23  namespace VXD {
24 
30  public:
32  typedef std::pair<G4LogicalVolume*, G4Transform3D> Placement;
33 
38  void place(G4LogicalVolume* mother, const G4Transform3D& transform);
39 
44  void add(G4LogicalVolume* volume, const G4Transform3D& transform = G4Transform3D())
45  {
46  m_volumes.push_back(std::make_pair(volume, transform));
47  }
48 
53  void add(const GeoVXDAssembly& assembly, const G4Transform3D& transform = G4Transform3D())
54  {
55  for (const Placement& p : assembly.m_volumes) {
56  m_volumes.push_back(std::make_pair(p.first, transform * p.second));
57  }
58  }
59 
60  private:
62  std::vector<Placement> m_volumes;
63  };
64  } //VXD namespace
66 } //Belle2 namespace
67 #endif
Class to group some Geant4 volumes and place them all at once with a given transformation matrix.
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.
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.
Abstract base class for different kinds of events.