Belle II Software development
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#pragma once
10
11#include <vector>
12#include <G4Transform3D.hh>
13
14class G4LogicalVolume;
15
16namespace Belle2 {
22 namespace VXD {
23
29 public:
31 typedef std::pair<G4LogicalVolume*, G4Transform3D> Placement;
32
37 void place(G4LogicalVolume* mother, const G4Transform3D& transform);
38
43 void add(G4LogicalVolume* volume, const G4Transform3D& transform = G4Transform3D())
44 {
45 m_volumes.push_back(std::make_pair(volume, transform));
46 }
47
52 void add(const GeoVXDAssembly& assembly, const G4Transform3D& transform = G4Transform3D())
53 {
54 for (const Placement& p : assembly.m_volumes) {
55 m_volumes.push_back(std::make_pair(p.first, transform * p.second));
56 }
57 }
58
59 private:
61 std::vector<Placement> m_volumes;
62 };
63 } //VXD namespace
65} //Belle2 namespace
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.
Namespace to provide code needed by both Vertex Detectors, PXD and SVD, and also testbeam telescopes.
Definition GeoCache.h:33
Abstract base class for different kinds of events.