Belle II Software development
GeoHeavyMetalShieldCreator.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 <geometry/CreatorBase.h>
12
13#include <framework/logging/Logger.h>
14#include <framework/database/DBObjPtr.h>
15#include <framework/database/DBImportObjPtr.h>
16#include <framework/database/IntervalOfValidity.h>
17
18#include <vxd/dbobjects/HeavyMetalShieldGeometryPar.h>
19
20namespace Belle2 {
25
27 namespace VXD {
28
31 private:
34
36 void createGeometry(const HeavyMetalShieldGeometryPar& parameters, G4LogicalVolume& topVolume, geometry::GeometryTypes type);
37
38 public:
41 virtual void create(const GearDir& content, G4LogicalVolume& topVolume, geometry::GeometryTypes type) override
42 {
44 createGeometry(config, topVolume, type);
45 }
46
49 virtual void createPayloads(const GearDir& content, const IntervalOfValidity& iov) override
50 {
52 importObj.construct(createConfiguration(content));
53 importObj.import(iov);
54 }
55
57 virtual void createFromDB(const std::string& name, G4LogicalVolume& topVolume, geometry::GeometryTypes type) override
58 {
60 if (!dbObj) {
61 // Check that we found the object and if not report the problem
62 B2FATAL("No configuration for " << name << " found.");
63 }
64 createGeometry(*dbObj, topVolume, type);
65 }
66 };
67 }
69}
bool import(const IntervalOfValidity &iov)
Import the object to database.
Class for importing a single object to the database.
void construct(Args &&... params)
Construct an object of type T in this DBImportObjPtr using the provided constructor arguments.
Class for accessing objects in the database.
Definition DBObjPtr.h:21
GearDir is the basic class used for accessing the parameter store.
Definition GearDir.h:31
The Class for VXD Heavy Metal Shield.
A class that describes the interval of experiments/runs for which an object in the database is valid.
The creator for the HeavyMetalShield geometry of the Belle II detector.
virtual void createPayloads(const GearDir &content, const IntervalOfValidity &iov) override
Create the configuration objects and save them in the Database.
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
The old create member: create the configuration object(s) on the fly and call the geometry creation r...
HeavyMetalShieldGeometryPar createConfiguration(const GearDir &param)
Create a parameter object from the Gearbox XML parameters.
void createGeometry(const HeavyMetalShieldGeometryPar &parameters, G4LogicalVolume &topVolume, geometry::GeometryTypes type)
Create the geometry from a parameter object.
virtual void createFromDB(const std::string &name, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Create the geometry from the Database.
Pure virtual base class for all geometry creators.
Definition CreatorBase.h:28
Namespace to provide code needed by both Vertex Detectors, PXD and SVD, and also testbeam telescopes.
Definition GeoCache.h:33
GeometryTypes
Flag indicating the type of geometry to be used.
Abstract base class for different kinds of events.