Main Page
Namespaces
Classes
Package Documentation
MagneticField
Interpolation
src
MagneticFieldGrid.h
Go to the documentation of this file.
1
#ifndef MagneticFieldGrid_H
2
#define MagneticFieldGrid_H
3
19
// interpolation package
20
#include "
FWCore/Utilities/interface/Visibility.h
"
21
#include "
VectorFieldInterpolation.h
"
22
#include "
binary_ifstream.h
"
23
24
// used libs
25
#include <vector>
26
#include <algorithm>
27
#include <cmath>
28
#include <string>
29
#include <iostream>
30
#include <fstream>
31
32
class
dso_internal
MagneticFieldGrid
{
33
public
:
34
// constructor
35
MagneticFieldGrid
(){
36
GridType = 0;
37
for
(
int
i
=0;
i
<3; ++
i
) {NumberOfPoints[
i
] = 0;};
38
for
(
int
i
=0;
i
<3; ++
i
) {ReferencePoint[
i
] = 0.;};
39
for
(
int
i
=0;
i
<3; ++
i
) {BasicDistance0[
i
] = 0.;};
40
for
(
int
i
=0;
i
<3; ++
i
) {
for
(
int
j=0;j<3; ++j) {BasicDistance1[
i
][j] = 0.;};};
41
for
(
int
i
=0;
i
<3; ++
i
) {
for
(
int
j=0;j<3; ++j) {BasicDistance2[
i
][j] = 0.;};};
42
for
(
int
i
=0;
i
<4; ++
i
) {RParAsFunOfPhi[
i
] = 0.;};
43
for
(
int
i
=0;
i
<3; ++
i
) {EasyCoordinate[
i
] =
false
;};
44
}
45
// destructor
46
~MagneticFieldGrid
(){}
47
48
private
:
49
// header classes (5: one for each type)
50
class
dso_internal
HeaderType3
{
51
public
:
52
// constructor
53
HeaderType3
(){}
54
// destructor
55
~HeaderType3
(){}
56
private
:
57
public
:
58
void
printInfo
();
59
};
60
// b-field container
61
class
dso_internal
BVector
{
62
public
:
63
// constructor
64
BVector
(){}
65
// destructor
66
~BVector
(){}
67
private
:
68
// three component vector in float precision
69
float
B3[3];
70
public
:
71
// Accessors
72
void
putB3(
float
Bx,
float
By,
float
Bz);
73
float
bx();
74
float
by();
75
float
bz();
76
};
77
78
// DEFINITION OF GRID
79
// type
80
int
GridType
;
81
// header
82
int
NumberOfPoints[3];
83
double
ReferencePoint[3];
84
double
BasicDistance0[3];
// constant step
85
double
BasicDistance1[3][3];
// linear step
86
double
BasicDistance2[3][3];
// linear offset
87
double
RParAsFunOfPhi[4];
// R = f(phi) or const. (0,2: const. par. ; 1,3: const./sin(phi))
88
bool
EasyCoordinate[3];
89
// field (Bx,By,Bz) container
90
std::vector<BVector>
FieldValues
;
91
92
public
:
94
void
load
(
const
std::string
&
name
);
96
int
gridType();
97
99
void
interpolateAtPoint(
double
X1,
double
X2,
double
X3,
float
&Bx,
float
&By,
float
&Bz);
100
101
// calculates indices from coordinates
102
void
putCoordGetInd(
double
X1,
double
X2,
double
X3,
int
&Index1,
int
&Index2,
int
&Index3);
103
// takes indices and returns magnetic field values
104
void
putIndicesGetB(
int
Index1,
int
Index2,
int
Index3,
float
&Bx,
float
&By,
float
&Bz);
105
// takes indices, calculates coordinates, and returns coordinates
106
void
putIndGetCoord(
int
Index1,
int
Index2,
int
Index3,
double
&X1,
double
&X2,
double
&X3);
107
// converts three indices into one number (for the vector FieldValues)
108
int
lineNumber(
int
Index1,
int
Index2,
int
Index3);
109
};
110
111
112
#endif
VectorFieldInterpolation.h
mps_fire.i
i
Definition:
mps_fire.py:338
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
MagneticFieldGrid::HeaderType3::~HeaderType3
~HeaderType3()
Definition:
MagneticFieldGrid.h:55
MagneticFieldGrid
Definition:
MagneticFieldGrid.h:32
MagneticFieldGrid::HeaderType3
Definition:
MagneticFieldGrid.h:50
MagneticFieldGrid::FieldValues
std::vector< BVector > FieldValues
Definition:
MagneticFieldGrid.h:90
Visibility.h
dso_internal
#define dso_internal
Definition:
Visibility.h:13
MagneticFieldGrid::BVector::BVector
BVector()
Definition:
MagneticFieldGrid.h:64
svgfig.load
def load(fileName)
Definition:
svgfig.py:547
MagneticFieldGrid::~MagneticFieldGrid
~MagneticFieldGrid()
Definition:
MagneticFieldGrid.h:46
MagneticFieldGrid::MagneticFieldGrid
MagneticFieldGrid()
Definition:
MagneticFieldGrid.h:35
dataset.name
name
Definition:
dataset.py:45
MagneticFieldGrid::BVector
Definition:
MagneticFieldGrid.h:61
MagneticFieldGrid::GridType
int GridType
Definition:
MagneticFieldGrid.h:80
binary_ifstream.h
objects.IsoTrackAnalyzer.printInfo
def printInfo(self, event)
Definition:
IsoTrackAnalyzer.py:252
MagneticFieldGrid::BVector::~BVector
~BVector()
Definition:
MagneticFieldGrid.h:66
MagneticFieldGrid::HeaderType3::HeaderType3
HeaderType3()
Definition:
MagneticFieldGrid.h:53
Generated for CMSSW Reference Manual by
1.8.11