Belle II Software  release-05-01-25
GeoMagneticField.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010-2011 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Andreas Moll *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #ifndef GEOMAGNETICFIELD_H
12 #define GEOMAGNETICFIELD_H
13 
14 #include <geometry/CreatorBase.h>
15 #include <framework/dbobjects/MagneticField.h>
16 
17 #include <boost/function.hpp>
18 #include <map>
19 #include <string>
20 
21 
22 namespace Belle2 {
28  class GearDir;
29 
38  class GeoMagneticField : public geometry::CreatorBase {
39 
40  public:
41 
46 
50  virtual ~GeoMagneticField();
51 
57  virtual void create(const GearDir& content, G4LogicalVolume& topVolume, geometry::GeometryTypes type) override;
58 
60  virtual void createFromDB(const std::string&, G4LogicalVolume&, geometry::GeometryTypes) override {}
61 
62  virtual void createPayloads(const GearDir& content, const IntervalOfValidity& iov) override;
63 
66 
67  protected:
68 
70  typedef std::map < std::string, boost::function < void (const GearDir&) > > CompTypeMap;
77  void readConstantBField(const GearDir& component);
78 
83  void readRadialBField(const GearDir& component);
84 
89  void readQuadBField(const GearDir& component);
90 
94  void readBeamlineBField(const GearDir& component);
95 
96 
102  void readKlm1BField(const GearDir& component);
103 
108  void read3dBField(const GearDir& component);
109 
111  void addConstantBField(const GearDir& component, MagneticField& fieldmap);
113  void add3dBField(const GearDir& component, MagneticField& fielmap);
114  private:
115 
116  };
117 
119 } //end of namespace Belle2
120 
121 #endif /* GEOMAGNETICFIELD_H */
Belle2::IntervalOfValidity
A class that describes the interval of experiments/runs for which an object in the database is valid.
Definition: IntervalOfValidity.h:35
Belle2::GeoMagneticField::m_componentTypeMap
CompTypeMap m_componentTypeMap
Maps the name of the component to the function reading the parameters.
Definition: GeoMagneticField.h:79
Belle2::GeoMagneticField::addConstantBField
void addConstantBField(const GearDir &component, MagneticField &fieldmap)
Add a constant field component to a magnetic field configuration for the DB.
Definition: GeoMagneticField.cc:78
Belle2::GeoMagneticField::readBeamlineBField
void readBeamlineBField(const GearDir &component)
Reads the 3D Bfield map and parameters near beam pipes and adds the component to the global magnetic ...
Definition: GeoMagneticField.cc:241
Belle2::GeoMagneticField::CompTypeMap
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.
Definition: GeoMagneticField.h:78
Belle2::GeoMagneticField::readConstantBField
void readConstantBField(const GearDir &component)
Reads the parameters for a homogeneous magnetic field and adds the component to the global magnetic f...
Definition: GeoMagneticField.cc:176
Belle2::GeoMagneticField::createConfiguration
MagneticField createConfiguration(const GearDir &content)
Create a Database configuration from Gearbox parameters.
Definition: GeoMagneticField.cc:63
Belle2::GeoMagneticField::~GeoMagneticField
virtual ~GeoMagneticField()
The destructor of the GeoMagneticField class.
Belle2::GeoMagneticField::readQuadBField
void readQuadBField(const GearDir &component)
Reads the parameters for a quadrupole magnetic field inside beam pipes and adds the component to the ...
Definition: GeoMagneticField.cc:220
Belle2::GeoMagneticField::createFromDB
virtual void createFromDB(const std::string &, G4LogicalVolume &, geometry::GeometryTypes) override
Nothing to be done when creating from DB, the payload should be found automatically.
Definition: GeoMagneticField.h:68
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::GeoMagneticField::GeoMagneticField
GeoMagneticField()
Constructor of the GeoMagneticField class.
Definition: GeoMagneticField.cc:49
Belle2::GearDir
GearDir is the basic class used for accessing the parameter store.
Definition: GearDir.h:41
Belle2::GeoMagneticField::createPayloads
virtual void createPayloads(const GearDir &content, const IntervalOfValidity &iov) override
Function to create the geometry database.
Definition: GeoMagneticField.cc:141
Belle2::GeoMagneticField::add3dBField
void add3dBField(const GearDir &component, MagneticField &fielmap)
Add a 3D field component to a magnetic field configuration for the DB.
Definition: GeoMagneticField.cc:92
Belle2::GeoMagneticField::readKlm1BField
void readKlm1BField(const GearDir &component)
Reads the 2D Bfield map and parameters outside of solenoid and adds the component to the global magne...
Definition: GeoMagneticField.cc:264
Belle2::GeoMagneticField::readRadialBField
void readRadialBField(const GearDir &component)
Reads the parameters for a radial magnetic field and adds the component to the global magnetic field.
Definition: GeoMagneticField.cc:190
Belle2::MagneticField
Magnetic field map.
Definition: MagneticField.h:43
Belle2::GeoMagneticField::read3dBField
void read3dBField(const GearDir &component)
Reads the parameters for 3d magnetic field (r,phi,z).
Definition: GeoMagneticField.cc:292
Belle2::GeoMagneticField::create
virtual void create(const GearDir &content, G4LogicalVolume &topVolume, geometry::GeometryTypes type) override
Creates the global ROOT objects and prepares everything for other creators.
Definition: GeoMagneticField.cc:148
Belle2::geometry::GeometryTypes
GeometryTypes
Flag indiciating the type of geometry to be used.
Definition: GeometryManager.h:39