Belle II Software light-2406-ragdoll
GeoMagneticField.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#include <framework/dbobjects/MagneticField.h>
13
14#include <boost/function.hpp>
15#include <map>
16#include <string>
17
18
19namespace Belle2 {
25 class GearDir;
26
36
37 public:
38
43
48
56 virtual void create(const GearDir& content, G4LogicalVolume& topVolume, geometry::GeometryTypes type) override;
57
59 virtual void createFromDB(const std::string&, G4LogicalVolume&, geometry::GeometryTypes) override {}
60
61 virtual void createPayloads(const GearDir& content, const IntervalOfValidity& iov) override;
62
65
66 protected:
67
69 typedef std::map < std::string, boost::function < void (const GearDir&) > > CompTypeMap;
76 void readConstantBField(const GearDir& component);
77
82 void readRadialBField(const GearDir& component);
83
88 void readQuadBField(const GearDir& component);
89
93 void readBeamlineBField(const GearDir& component);
94
95
101 void readKlm1BField(const GearDir& component);
102
107 void read3dBField(const GearDir& component);
108
110 void addConstantBField(const GearDir& component, MagneticField& fieldmap);
112 void add3dBField(const GearDir& component, MagneticField& fielmap);
113 private:
114
115 };
116
118} //end of namespace Belle2
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:31
The GeoMagneticField class.
void readConstantBField(const GearDir &component)
Reads the parameters for a homogeneous magnetic field and adds the component to the global magnetic f...
void add3dBField(const GearDir &component, MagneticField &fielmap)
Add a 3D field component to a magnetic field configuration for the DB.
void readBeamlineBField(const GearDir &component)
Reads the 3D Bfield map and parameters near beam pipes and adds the component to the global magnetic ...
virtual void createFromDB(const std::string &, G4LogicalVolume &, geometry::GeometryTypes) override
Nothing to be done when creating from DB, the payload should be found automatically.
void readKlm1BField(const GearDir &component)
Reads the 2D Bfield map and parameters outside of solenoid and adds the component to the global magne...
CompTypeMap m_componentTypeMap
Maps the name of the component to the function reading the parameters.
virtual ~GeoMagneticField()
The destructor of the GeoMagneticField class.
void readRadialBField(const GearDir &component)
Reads the parameters for a radial magnetic field and adds the component to the global magnetic field.
virtual void createPayloads(const GearDir &content, const IntervalOfValidity &iov) override
Function to create the geometry database.
GeoMagneticField()
Constructor of the GeoMagneticField class.
void addConstantBField(const GearDir &component, MagneticField &fieldmap)
Add a constant field component to a magnetic field configuration for the DB.
std::map< std::string, boost::function< void(const GearDir &) > > CompTypeMap
Typedef for the map connecting the name of the component to the method reading the parameters.
MagneticField createConfiguration(const GearDir &content)
Create a Database configuration from Gearbox parameters.
void read3dBField(const GearDir &component)
Reads the parameters for 3d magnetic field (r,phi,z).
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Creates the global ROOT objects and prepares everything for other creators.
void readQuadBField(const GearDir &component)
Reads the parameters for a quadrupole magnetic field inside beam pipes and adds the component to the ...
A class that describes the interval of experiments/runs for which an object in the database is valid.
Magnetic field map.
Definition: MagneticField.h:32
Pure virtual base class for all geometry creators.
Definition: CreatorBase.h:28
GeometryTypes
Flag indiciating the type of geometry to be used.
Abstract base class for different kinds of events.
Definition: ClusterUtils.h:24