Belle II Software  release-05-01-25
GeoVXDAssembly.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef GEOVXDASSEMBLY_H
12 #define GEOVXDASSEMBLY_H
13 
14 #include <vector>
15 #include <G4Transform3D.hh>
16 
17 class G4LogicalVolume;
18 
19 namespace Belle2 {
25  namespace VXD {
26 
32  public:
34  typedef std::pair<G4LogicalVolume*, G4Transform3D> Placement;
35 
40  void place(G4LogicalVolume* mother, const G4Transform3D& transform);
41 
46  void add(G4LogicalVolume* volume, const G4Transform3D& transform = G4Transform3D())
47  {
48  m_volumes.push_back(std::make_pair(volume, transform));
49  }
50 
55  void add(const GeoVXDAssembly& assembly, const G4Transform3D& transform = G4Transform3D())
56  {
57  for (const Placement& p : assembly.m_volumes) {
58  m_volumes.push_back(std::make_pair(p.first, transform * p.second));
59  }
60  }
61 
62  private:
64  std::vector<Placement> m_volumes;
65  };
66  } //VXD namespace
68 } //Belle2 namespace
69 #endif
Belle2::VXD::GeoVXDAssembly
Class to group some Geant4 volumes and place them all at once with a given transformation matrix.
Definition: GeoVXDAssembly.h:31
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::VXD::GeoVXDAssembly::add
void add(G4LogicalVolume *volume, const G4Transform3D &transform=G4Transform3D())
Add a volume to the assembly.
Definition: GeoVXDAssembly.h:46
Belle2::VXD::GeoVXDAssembly::add
void add(const GeoVXDAssembly &assembly, const G4Transform3D &transform=G4Transform3D())
Add a assembly to the assembly.
Definition: GeoVXDAssembly.h:55
Belle2::VXD::GeoVXDAssembly::place
void place(G4LogicalVolume *mother, const G4Transform3D &transform)
Place all the volumes already added to the assembly in the given mother.
Definition: GeoVXDAssembly.cc:32
Belle2::VXD::GeoVXDAssembly::Placement
std::pair< G4LogicalVolume *, G4Transform3D > Placement
Placement of a logical volume consists of the Volume and ins transformation.
Definition: GeoVXDAssembly.h:34
Belle2::VXD::GeoVXDAssembly::m_volumes
std::vector< Placement > m_volumes
Array of all volumes and their placements in the assembly.
Definition: GeoVXDAssembly.h:64