Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
garsoft
DetectorInfo
GArMagneticField.h
Go to the documentation of this file.
1
/// \file MPDMagneticField.h
2
/// \brief Describe the magnetic field structure of a detector
3
///
4
/// \version $Id: MPDMagneticField.h,v 1.3 2019-11-06 02:46:38 trj Exp $
5
/// \author trj@fnal.gov
6
//////////////////////////////////////////////////////////////////////////
7
/// \namespace mag
8
/// A namespace for simulated magnetic fields
9
//////////////////////////////////////////////////////////////////////////
10
11
#ifndef MAG_GARMAGNETICFIELD_H
12
#define MAG_GARMAGNETICFIELD_H
13
14
// nug4 libraries
15
#include "nug4/MagneticField/MagneticField.h"
16
17
namespace
fhicl
{
class
ParameterSet; }
18
namespace
mag
19
{
20
21
// Specifies the magnetic field over all space
22
//
23
// The default implementation, however, uses a nearly trivial,
24
// non-physical hack.
25
class
GArMagneticField
:
public
MagneticField {
26
27
public
:
28
29
explicit
GArMagneticField
(
fhicl::ParameterSet
const
& pset);
30
GArMagneticField
(
GArMagneticField
const
&) =
delete
;
31
virtual
~
GArMagneticField
() =
default
;
32
33
void
reconfigure
(
fhicl::ParameterSet
const
& pset);
34
35
//Return std::vector<MagneticFieldDescription>
36
std::vector<MagneticFieldDescription>
const
&
Fields
()
const override
{
return
fFieldDescriptions; }
37
38
//Return std::vector<MagneticFieldDescription> size
39
size_t
NumFields
()
const override
{
return
fFieldDescriptions.size(); }
40
41
//Return the field mode
42
MagFieldMode_t
const
&
UseField
(
size_t
f
)
const override
{
return
fFieldDescriptions[
f
].fMode; }
43
44
//Return the magnetized volumes
45
std::string
const
&
MagnetizedVolume
(
size_t
f
)
const override
{
return
fFieldDescriptions[
f
].fVolume; }
46
47
// return the field at a particular point
48
G4ThreeVector
const
FieldAtPoint(G4ThreeVector
const
&
p
= G4ThreeVector(0))
const override
;
49
50
// This method will only return a uniform field based on the input
51
// volume name. If the input volume does not have a uniform field
52
// caveat emptor
53
G4ThreeVector
const
UniformFieldInVolume(
std::string
const
& volName)
const override
;
54
55
private
:
56
void
ReadRZFile(
const
std::string
&
filename
, RZFieldMap& rzmap);
57
void
ReadXYZFile(
const
std::string
& filename, XYZFieldMap& xyzmap,
const
float
unitFactor);
58
59
G4ThreeVector CalcRZField(G4ThreeVector
const
&
p
, RZFieldMap
const
& rzmap)
const
;
60
G4ThreeVector CalcXYZField(G4ThreeVector
const
& p, XYZFieldMap
const
& xyzmap)
const
;
61
62
float
fGlobalScaleFactor
;
63
std::vector<MagneticFieldDescription>
fFieldDescriptions
;
///< Descriptions of the fields
64
float
fUnitFactor
;
//factor to convert from map position units to mm
65
};
66
67
class
Interpolator
68
{
69
public
:
70
Interpolator
();
71
72
float
interpolate(
const
float
* point,
const
std::vector
<
std::vector
<std::vector<float>>>&
g
,
73
const
float
* delta,
const
float
* offset)
const
;
74
float
interpolate(
float
x
,
float
y
,
float
z
,
75
const
std::vector
<
std::vector
<std::vector<float>>>&
g
,
float
hx
,
float
hy
,
76
float
hz
,
float
xo,
float
yo,
float
zo)
const
;
77
78
private
:
79
float
conv_kernel(
float
s
)
const
;
80
};
81
82
}
// namespace mag
83
84
#endif // MAG_GARMAGNETICFIELD_H
mag::GArMagneticField::Fields
std::vector< MagneticFieldDescription > const & Fields() const override
Definition:
GArMagneticField.h:36
mag::GArMagneticField::fGlobalScaleFactor
float fGlobalScaleFactor
Definition:
GArMagneticField.h:62
keras_to_tensorflow.f
f
Definition:
keras_to_tensorflow.py:162
mag::GArMagneticField::MagnetizedVolume
std::string const & MagnetizedVolume(size_t f) const override
Definition:
GArMagneticField.h:45
truth_ana.hx
hx
Definition:
truth_ana.py:105
genie::units::g
static constexpr double g
Definition:
Units.h:144
string
std::string string
Definition:
nybbler.cc:12
vector
struct vector vector
mag
Definition:
GArMagneticField.cxx:43
train.filename
string filename
Definition:
train.py:213
mag::GArMagneticField::fFieldDescriptions
std::vector< MagneticFieldDescription > fFieldDescriptions
Descriptions of the fields.
Definition:
GArMagneticField.h:63
makePolycone.z
z
Definition:
makePolycone.py:153
RunHistoryService::reconfigure
virtual void reconfigure(fhicl::ParameterSet const &pset)
mag::GArMagneticField
Definition:
GArMagneticField.h:25
fhicl
Definition:
InputSourceFactory.h:7
test.p
p
Definition:
test.py:223
wirecell.validate.cmaps.y
y
Definition:
cmaps.py:73
mag::Interpolator
Definition:
GArMagneticField.h:67
truth_ana.hz
hz
Definition:
truth_ana.py:107
mag::GArMagneticField::fUnitFactor
float fUnitFactor
Definition:
GArMagneticField.h:64
mag::GArMagneticField::UseField
MagFieldMode_t const & UseField(size_t f) const override
Definition:
GArMagneticField.h:42
truth_ana.hy
hy
Definition:
truth_ana.py:106
train.x
list x
Definition:
train.py:276
s
static QCString * s
Definition:
config.cpp:1042
mag::GArMagneticField::NumFields
size_t NumFields() const override
Definition:
GArMagneticField.h:39
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11