Belle II Software development
DetectorConstruction.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 <framework/logging/Logger.h>
12#include <geometry/GeometryManager.h>
13#include "G4VUserDetectorConstruction.hh"
14
15namespace Belle2 {
20
27 class DetectorConstruction: public G4VUserDetectorConstruction {
28 public:
30 G4VPhysicalVolume* Construct()
31 {
32 G4VPhysicalVolume* topVolume = geometry::GeometryManager::getInstance().getTopVolume();
33 if (!topVolume) B2FATAL("No Geometry defined, please create the geometry"
34 " before doing simulation, normally by using the Geometry module.");
35 return topVolume;
36 }
37 };
38
40} //Belle2 namespace
Class responsible to connect to geometry to simulation.
G4VPhysicalVolume * Construct()
Return pointer to top volume.
G4VPhysicalVolume * getTopVolume()
Return a pointer to the top volume.
static GeometryManager & getInstance()
Return a reference to the instance.
Abstract base class for different kinds of events.