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
TrKalmanFilter.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TrKalmanFilter.h
1
//
2
// AYK (ayk@bnl.gov)
3
//
4
// Forward detector tracking application of the Kalman filter stuff;
5
// ported from HERMES/OLYMPUS sources; cleaned up 2014/10/17;
6
//
7
8
#include <
Mgrid.h
>
9
10
class
MediaBank
;
11
struct
t_particle_group
;
12
13
extern
"C"
t_particle_group
*
get_particle_group_by_name
(
const
char
*
name
);
14
15
#include <
TrKalmanNode.h
>
16
#include <
KalmanFilter.h
>
17
18
#ifndef _TR_KALMAN_FILTER_
19
#define _TR_KALMAN_FILTER_
20
21
class
TrKalmanFilter
:
public
KalmanFilter
{
22
public
:
23
// The constructor; just call KalmanFilter() constructor;
24
TrKalmanFilter
(
MfieldMode
fieldMode =
WithField
):
25
KalmanFilter
(fieldMode ==
WithField
? 5 : 4),
mFieldMode
(fieldMode),
26
mLocationHead
(0),
mLocationTail
(0),
mAccountEnergyLosses
(
true
),
mLocationSeparationDistance
(0.0) {};
27
28
t_particle_group
*
SetParticleGroup
(
const
char
*group) {
29
mParticleGroup
=
get_particle_group_by_name
(group);
30
31
return
mParticleGroup
;
32
};
33
34
MfieldMode
GetFieldMode
()
const
{
return
mFieldMode
; };
35
36
int
Configure
(
MediaBank
*media_bank,
StringList
*
config
);
37
38
virtual
MgridSlice
*
InitializeMgridSlice
(
double
z0) = 0;
39
int
InitializeRungeKuttaFrames
();
40
int
InitializeMediaSlices
(
MediaBank
*media_bank);
41
void
SetLocationSeparationDistance
(
double
value
) {
mLocationSeparationDistance
=
value
; };
42
43
int
CalculateHMatrix
(
KalmanNode
*node);
44
int
Transport
(
KalmanNode
*from,
KalmanFilter::Direction
fb,
unsigned
mode);
45
// Multiple scattering and dE/dx accounting;
46
int
TransportExtra
(
KalmanNode
*from,
KalmanFilter::Direction
fb,
unsigned
mode);
47
48
// Prepare node to become a starting point of a filter pass (so
49
// basically reset x0[], xp[], CP[][] & mInversedMomentum); FIXME: need to make
50
// cov.matrix parameters configurable as well;
51
void
ResetNode
(
TrKalmanNode
*node,
double
S[],
int
assignmentMode);
52
53
void
SelectActiveNodes
();
54
void
SetUpLocations
();
55
56
TrKalmanNodeLocation
*
GetLocationHead
()
const
{
return
mLocationHead
; };
57
58
// Do this better later (bind FF[]- matrix calculation to locations rather
59
// than nodes);
60
void
BuildNodeList
() {
61
KalmanFilter::BuildNodeList
();
62
63
CalculateMagnetOffTransportMatrices
();
64
};
65
66
void
AccountEnergyLosses
(
bool
flag) {
mAccountEnergyLosses
= flag; };
67
68
protected
:
69
double
mLocationSeparationDistance
;
70
TrKalmanNodeLocation
*
mLocationHead
, *
mLocationTail
;
71
72
private
:
73
MfieldMode
mFieldMode
;
74
75
// It turns out to be very convenient to store particle type
76
// in a separate variable instead of passing application-specific
77
// pointers to tfun()/.../xfun() functions;
78
t_particle_group
*
mParticleGroup
;
79
80
bool
mAccountEnergyLosses
;
81
82
// Yes, this is the trick: allocate extra space compared to the
83
// KalmanNode base class; whether it is correct or not I do not
84
// care to the moment; from memory allocation model I'd suppose it is;
85
KalmanNode
*
AllocateNode
() {
return
new
TrKalmanNode
(); };
86
87
// Yes, for tracking Kalman filter this call checks field/no-field mode;
88
// FIXME: may want to return back the functionality to check for field-free regions;
89
bool
NeedNonLinearTransport
(
double
z
)
const
{
90
return
mFieldMode
==
WithField
?
true
:
false
;
91
};
92
93
int
AccountIonizationLosses
(
TrKalmanNode
*from,
KalmanFilter::Direction
fb);
94
int
CalculateProcessNoise
(
TrKalmanNode
*from,
KalmanFilter::Direction
fb);
95
96
int
CalculateMagnetOffTransportMatrices
();
97
};
98
99
#endif
EicRoot
blob
master
eic
htc
TrKalmanFilter.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:35
using
1.8.2 with
EIC GitHub integration