Belle II Software development
GeoSVDCreator.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 GEOSVDCREATOR_H
10#define GEOSVDCREATOR_H
11
12#include <vector>
13#include <vxd/geometry/GeoVXDCreator.h>
14#include <svd/dbobjects/SVDGeometryPar.h>
15
16
17namespace Belle2 {
23 namespace SVD {
24
25 class SensorInfo;
26
29 private:
32
34 void createGeometry(const SVDGeometryPar& parameters, G4LogicalVolume& topVolume, geometry::GeometryTypes type);
35 public:
37 GeoSVDCreator(): VXD::GeoVXDCreator("SVD") {};
38
40 virtual ~GeoSVDCreator();
41
44 virtual void create(const GearDir& content, G4LogicalVolume& topVolume, geometry::GeometryTypes type) override
45 {
46 SVDGeometryPar config = createConfiguration(content);
47 createGeometry(config, topVolume, type);
48 }
49
52 virtual void createPayloads(const GearDir& content, const IntervalOfValidity& iov) override
53 {
55 importObj.construct(createConfiguration(content));
56 importObj.import(iov);
57 }
58
60 virtual void createFromDB(const std::string& name, G4LogicalVolume& topVolume, geometry::GeometryTypes type) override
61 {
63 if (!dbObj) {
64 // Check that we found the object and if not report the problem
65 B2FATAL("No configuration for " << name << " found.");
66 }
67 createGeometry(*dbObj, topVolume, type);
68 }
69
75 virtual VXD::GeoVXDAssembly createLayerSupport(int, const SVDGeometryPar& parameters);
76
82 virtual VXD::GeoVXDAssembly createLadderSupport(int, const SVDGeometryPar& parameters);
83
90
95 virtual VXD::SensorInfoBase* createSensorInfo(const VXDGeoSensorPar& sensor) override;
96
102
110 VxdID sensorID, const VXDGeoSensor& sensor, const VXDGeoSensorPlacement& placement) override;
111
118 void readHalfShellSupport(const GearDir& support, SVDGeometryPar& svdGeometryPar);
119
126 void readLayerSupport(int layer, const GearDir& support, SVDGeometryPar& svdGeometryPar);
127
134 void readLadderSupport(int layer, const GearDir& support, SVDGeometryPar& svdGeometryPar);
135
136 private:
137
139 std::vector<SensorInfo*> m_SensorInfo;
140
141 }; // class GeoSVDCreator
142 } // namespace SVD
144} //namespace Belle2
145
146#endif /* GEOSVDCREATOR_H */
bool import(const IntervalOfValidity &iov)
Import the object to database.
Definition: DBImportBase.cc:36
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
A class that describes the interval of experiments/runs for which an object in the database is valid.
The Class for VXD geometry.
The Class for VXD geometry.
The creator for the SVD geometry of the Belle II detector.
Definition: GeoSVDCreator.h:28
virtual void createPayloads(const GearDir &content, const IntervalOfValidity &iov) override
Create the configuration objects and save them in the Database.
Definition: GeoSVDCreator.h:52
virtual VXD::SensitiveDetectorBase * createSensitiveDetector(VxdID sensorID, const VXDGeoSensor &sensor, const VXDGeoSensorPlacement &placement) override
Return a SensitiveDetector implementation for a given sensor.
void readLayerSupport(int layer, const GearDir &support, SVDGeometryPar &svdGeometryPar)
Create support structure for a SVD Layer.
void readLadderSupport(int layer, const GearDir &support, SVDGeometryPar &svdGeometryPar)
Create support structure for a SVD Ladder.
SVDGeometryPar createConfiguration(const GearDir &param)
Create a parameter object from the Gearbox XML parameters.
void readHalfShellSupport(const GearDir &support, SVDGeometryPar &svdGeometryPar)
Create support structure for SVD Half Shell, that means everything that does not depend on layer or s...
SVDSensorInfoPar * readSensorInfo(const GearDir &sensor)
Read the sensor definitions from gearbox.
std::vector< SensorInfo * > m_SensorInfo
Vector of pointers to SensorInfo objects.
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...
Definition: GeoSVDCreator.h:44
virtual VXD::GeoVXDAssembly createLayerSupport(int, const SVDGeometryPar &parameters)
Create support structure for a SVD Layer.
virtual ~GeoSVDCreator()
The destructor of the GeoSVDCreator class.
virtual VXD::GeoVXDAssembly createLadderSupport(int, const SVDGeometryPar &parameters)
Create support structure for a SVD Ladder.
virtual VXD::GeoVXDAssembly createHalfShellSupport(const SVDGeometryPar &parameters)
Create support structure for SVD Half Shell, that means everything that does not depend on layer or s...
void createGeometry(const SVDGeometryPar &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.
Definition: GeoSVDCreator.h:60
virtual VXD::SensorInfoBase * createSensorInfo(const VXDGeoSensorPar &sensor) override
Read the sensor definitions from the database.
GeoSVDCreator()
Constructor of the GeoSVDCreator class.
Definition: GeoSVDCreator.h:37
Specific implementation of SensorInfo for SVD Sensors which provides additional sensor specific infor...
Definition: SensorInfo.h:25
The Class for VXD Sensor payload.
Struct holding the information where a sensor should be placed inside the ladder.
Struct holding all parameters for a completeVXD Sensor.
Class to group some Geant4 volumes and place them all at once with a given transformation matrix.
The creator for the VXD geometry of the Belle II detector.
Definition: GeoVXDCreator.h:48
GeoVXDCreator(const std::string &prefix)
Constructor of the GeoVXDCreator class.
Base class for Sensitive Detector implementation of PXD and SVD.
Base class to provide Sensor Information for PXD and SVD.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
GeometryTypes
Flag indiciating the type of geometry to be used.
Abstract base class for different kinds of events.