EIC Software
Reference for
EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
EicConstantField.cxx
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file EicConstantField.cxx
1
// AYK (ayk@bnl.gov), 2014/09/03
2
//
3
// Constant field handler;
4
//
5
6
#include <
EicConstantField.h
>
7
8
// =======================================================================================
9
10
int
EicConstantField::Initialize
()
11
{
12
if
(
mTransformation
)
13
mTransformation
->LocalToMasterVect(
mFieldLocal
,
mFieldGlobal
);
14
else
15
memcpy(
mFieldGlobal
,
mFieldLocal
,
sizeof
(
mFieldGlobal
));
16
17
// Basically set mInitialized flag;
18
return
EicMagneticFieldMap::Initialize
();
19
}
// EicConstantField::Initialize()
20
21
// ---------------------------------------------------------------------------------------
22
23
int
EicConstantField::GetFieldValue
(
const
double
xx[],
double
B[])
const
24
{
25
if
(!
mInitialized
)
return
-1;
26
27
// Well, otherwise basically assume a constant field everywhere;
28
if
(
GetShape
() && !
Contains
(xx))
return
-1;
29
30
//printf("%f %f %f\n", mFieldGlobal[0], mFieldGlobal[1], mFieldGlobal[2]);
31
// And return once calculated rotated field value;
32
for
(
unsigned
iq=0; iq<3; iq++)
33
B[iq] =
mFieldGlobal
[iq];
34
35
return
0;
36
}
// EicConstantField::GetFieldValue()
37
38
// =======================================================================================
39
40
ClassImp
(
EicConstantField
)
41
ClassImp
(
EicConstantBoxField
)
42
ClassImp
(
EicConstantTubeField
)
EicRoot
blob
master
eic
field
EicConstantField.cxx
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:35
using
1.8.2 with
EIC GitHub integration