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#ifndef DETECTORCONSTRUCTION_H
10#define DETECTORCONSTRUCTION_H
11
12#include <framework/logging/Logger.h>
13#include <geometry/GeometryManager.h>
14#include "G4VUserDetectorConstruction.hh"
15
16namespace Belle2 {
28 class DetectorConstruction: public G4VUserDetectorConstruction {
29 public:
31 G4VPhysicalVolume* Construct()
32 {
33 G4VPhysicalVolume* topVolume = geometry::GeometryManager::getInstance().getTopVolume();
34 if (!topVolume) B2FATAL("No Geometry defined, please create the geometry"
35 " before doing simulation, normally by using the Geometry module.");
36 return topVolume;
37 }
38 };
39
41} //Belle2 namespace
42#endif
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.