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
FwdTrackFinder.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file FwdTrackFinder.h
1
2
#include <map>
3
4
#include <TVector3.h>
5
#include <TH1D.h>
6
7
#include <
FairTask.h
>
8
9
#include <
EicBoxGenerator.h
>
10
#include <
EicHtcTask.h
>
11
//#include <KalmanFilter.h>
12
#include <EicGeoParData.h>
13
#include <
FwdHoughTree.h
>
14
//#include <FwdKalmanFilter.h>
15
16
#ifndef _FWD_TRACK_FINDER_
17
#define _FWD_TRACK_FINDER_
18
19
class
ResolutionLevelPattern
:
public
TObject
20
{
21
public
:
22
ResolutionLevelPattern
():
mDiv
(0),
mCount
(0),
mDim
(0) {};
23
ResolutionLevelPattern
(
const
unsigned
div[],
unsigned
dim
,
unsigned
count):
24
mDim
(dim),
mCount
(count) {
25
mDiv
=
new
unsigned
[
dim
];
26
27
for
(
unsigned
iq=0; iq<
dim
; iq++)
28
mDiv
[iq] = div[iq];
29
};
30
~ResolutionLevelPattern
() {
if
(
mDiv
)
delete
[]
mDiv
; }
31
32
unsigned
GetRepetitionCount
()
const
{
return
mCount
; };
33
const
unsigned
*
GetDivPtr
()
const
{
return
mDiv
; };
34
35
private
:
36
unsigned
mDim
;
37
unsigned
*
mDiv
;
// [mDim]
38
unsigned
mCount
;
39
40
ClassDef
(
ResolutionLevelPattern
,2);
41
};
42
43
class
PhaseSpaceVariable
:
public
TObject
44
{
45
public
:
46
PhaseSpaceVariable
():
mGra
(0.0),
mMin
(0.0),
mMax
(0.0) {};
47
PhaseSpaceVariable
(
double
min
,
double
max
,
double
gra):
48
mGra
(gra),
mMin
(min),
mMax
(max) {};
49
~PhaseSpaceVariable
() {};
50
51
double
GetRange
()
const
{
return
mMax
-
mMin
; };
52
double
GetMin
()
const
{
return
mMin
; };
53
double
GetMax
()
const
{
return
mMax
; };
54
double
GetGra
()
const
{
return
mGra
; };
55
56
private
:
57
double
mMin
,
mMax
,
mGra
;
58
59
ClassDef(
PhaseSpaceVariable
,1)
60
};
61
62
//#define _DEFAULT_EXTRA_GRANULARITY_FACTOR_ (20./6.)
63
#define _DEFAULT_EXTRA_GRANULARITY_FACTOR_ (2.0)
64
65
// Assume 3 sigma is fine in both gaussian and digital case;
66
#define _DEFAULT_RELATIVE_HIT_SMEARING_ (3.0)
67
68
class
FwdTrackFinder
:
public
EicHtcTask
69
{
70
//FwdTrackFinderEicHtcTask(): FairTask("EIC HTC Task") { ResetVars(); };
71
//EicHtcTask(EicIdealTrackingCode *ideal, MfieldMode fieldMode = WithField);
72
public
:
73
FwdTrackFinder
():
EicHtcTask
() {};
74
FwdTrackFinder
(
EicIdealTrackingCode
*ideal,
MfieldMode
fieldMode =
WithField
):
75
EicHtcTask
(ideal, fieldMode),
76
//mGptr(0), mHits(0), mSmearing(0),
77
mRelativeHitSmearing
(
_DEFAULT_RELATIVE_HIT_SMEARING_
),
78
mAbsoluteSpatialSmearing
(0.0),
79
mBlindCellDecisionLevel
(0),
80
//mMinOkHitCounter(0), mMaxOkHitCounter(0),
81
mBorrowedHitCounterMax
(0),
82
mMeasurementNoiseInflationFactor
(1.0),
83
mVtxKfNode
(0),
mEicBoxGenerator
(0),
84
mExtraGranularityFactor
(
_DEFAULT_EXTRA_GRANULARITY_FACTOR_
),
85
mBorrowedPlusMissingHitCounterMax
(0),
mCylindricalCoordPreference
(
false
),
86
mMissingHitCounterMax
(0) {
87
// Allocate Hough transform class instance;
88
mFwdHoughTree
=
new
FwdHoughTree
(
this
);
89
90
mTracks
=
new
TClonesArray(
"FwdMatchCandidate"
); assert(
mTracks
);
91
92
mPhiId
=
mThetaId
=
mInvMomentumId
=
mInvPtId
= -1;
93
mAngularCovMtxEstimate
=
mInversedMomentumRelatedCovMtxEstimate
= 0.0;
94
95
mStoredMinFilterChiSquareCCDF
= 0.0;
96
97
ccdf
=
new
TH1D(
"ccdf"
,
"ccdf"
, 100, 0.0, 1.0);
98
};
99
~FwdTrackFinder
() {};
100
101
void
ResetVtxNode
(
MatchCandidate
*match);
102
void
UpdateVtxNode
();
103
104
InitStatus
Init
();
105
void
Exec
(Option_t* opt);
106
void
FinishTask
();
107
// FIXME: a temporary hack;
108
TH1D *
ccdf
;
109
110
int
DefinePhiRange
(
double
min
,
double
max
,
double
gra);
111
// It turns out, that defining p-range in momentum itself is more confusing
112
// (because +/- signs need to be accounted and also min.granularity should
113
// be given in inversed momentum anyway);
114
int
DefineInversedMomentumRange
(
double
min
,
double
max
,
double
gra);
115
int
DefineInversedPtRange
(
double
min
,
double
max
,
double
gra);
116
int
DefineThetaRange
(
double
min
,
double
max
,
double
gra);
117
118
// These methods can be propagated to HoughTree right from the reconstruction.C;
119
void
SetVerbosityLevel
(
unsigned
level) {
mFwdHoughTree
->
SetVerbosityLevel
(level); };
120
int
AddDimension
(
const
char
*
name
,
double
min
,
double
max
) {
121
return
mFwdHoughTree
->
AddDimension
(name, min, max);
122
};
123
void
SetFastTreeSearchMode
(
unsigned
qualityItrNum) {
124
mFwdHoughTree
->
SetFastTreeSearchMode
(qualityItrNum);
125
};
126
//void ResolveAmbiguityViaWorstHit() { mFwdHoughTree->ResolveAmbiguityViaWorstHit(); };
127
128
// Well, not all of the operations with mFwdHoughTree pointer are allowed
129
// from reconstruction.C script (say AddResolutionLevel() makes sense
130
// only after plane structure is defined); therefore prefer to formulate
131
// "requests" in reconstruction.C, store data in intermediate variables
132
// and defer actual calls to HoughTree configuration methods until Init()
133
// call happens;
134
void
AddResolutionLevel
(
const
unsigned
div[],
unsigned
count) {
135
mResolutionLevelPatterns
.push_back(
new
ResolutionLevelPattern
(div,
mFwdHoughTree
->
GetDdim
(),
136
count));
137
//return 0;
138
};
139
140
MediaBank
*
ConfigureMediaBank
();
141
142
void
SetRelativeHitSmearing
(
double
smearing) {
mRelativeHitSmearing
= smearing; };
143
void
SetAbsoluteSpatialSmearing
(
double
smearing) {
mAbsoluteSpatialSmearing
= smearing; };
144
double
GetAbsoluteSpatialSmearing
()
const
{
return
mAbsoluteSpatialSmearing
; };
145
146
void
SetBorrowedHitCounterLimit
(
unsigned
max
) {
mBorrowedHitCounterMax
=
max
; };
147
148
void
SetMissingHitCounterLimit
(
unsigned
max
) {
149
mMissingHitCounterMax
=
max
;
150
};
151
void
SetBorrowedPlusMissingHitCounterLimit
(
unsigned
max
) {
152
mBorrowedPlusMissingHitCounterMax
=
max
;
153
};
154
void
SetBlindCellDecisionLevel
(
unsigned
level) {
155
mBlindCellDecisionLevel
= level;
156
};
157
158
void
PreferCylindricalCoordinates
() {
mCylindricalCoordPreference
=
true
; };
159
160
TrKalmanNode
*
GetVtxNode
()
const
{
return
mVtxKfNode
; };
161
EicBoxGenerator
*
GetEicBoxGenerator
()
const
{
return
mEicBoxGenerator
; };
162
163
bool
WithMagneticField
()
const
{
return
GetKalmanFilter
()->
GetFieldMode
() ==
WithField
; };
164
165
void
SetMeasurementNoiseInflationFactor
(
double
scale) {
mMeasurementNoiseInflationFactor
= scale; };
166
double
GetMeasurementNoiseInflationFactor
()
const
{
return
mMeasurementNoiseInflationFactor
; };
167
168
void
SetMinFilterChiSquareCCDF
(
double
value
) {
169
mStoredMinFilterChiSquareCCDF
=
value
;
170
GetKalmanFilter
()->
SetMinFilterChiSquareCCDF
(value);
171
};
172
double
GetStoredMinFilterChiSquareCCDF
()
const
{
return
mStoredMinFilterChiSquareCCDF
; };
173
void
SetLocationSeparationDistance
(
double
value
) {
174
GetKalmanFilter
()->
SetLocationSeparationDistance
(value);
175
};
176
void
SetExtraNdfCount
(
int
count) {
GetKalmanFilter
()->
SetExtraNdfCount
(count); };
177
void
AccountEnergyLosses
(
bool
flag) {
GetKalmanFilter
()->
AccountEnergyLosses
(flag); };
178
179
unsigned
GetMissingHitCounterMax
()
const
{
return
mMissingHitCounterMax
; };
180
181
void
SetExtraGranularityFactor
(
double
value
) {
mExtraGranularityFactor
=
value
; };
182
double
GetExtraGranularityFactor
()
const
{
return
mExtraGranularityFactor
; };
183
184
int
GetThetaId
()
const
{
return
mThetaId
; };
185
int
GetPhiId
()
const
{
return
mPhiId
; };
186
int
GetInvMomentumId
()
const
{
return
mInvMomentumId
; };
187
int
GetInvPtId
()
const
{
return
mInvPtId
; };
188
// NB: can still return -1, fine;
189
int
GetMomentumRelatedId
()
const
{
return
(
mInvPtId
!= -1 ?
mInvPtId
:
mInvMomentumId
); };
190
191
int
ConfigureResolutionLevels
(
unsigned
id
/*const PhaseSpaceVariable *psvar*/
);
192
193
private
:
194
// If looks like there is no need to save anything?; FIXME: actually may want
195
// to record FwdTrackFinder class;
196
FwdHoughTree
*
mFwdHoughTree
;
197
198
TrKalmanNode
*
mVtxKfNode
;
199
200
EicBoxGenerator
*
mEicBoxGenerator
;
201
202
bool
mCylindricalCoordPreference
;
203
204
double
mExtraGranularityFactor
;
205
206
// Want to help MappingCall() not to be dependent on the order of
207
// Define*Range() calls;
208
int
mPhiId
,
mThetaId
,
mInvMomentumId
,
mInvPtId
;
209
std::vector<PhaseSpaceVariable>
mPhaseSpaceVariables
;
210
double
mAngularCovMtxEstimate
,
mInversedMomentumRelatedCovMtxEstimate
;
211
212
std::vector<ResolutionLevelPattern*>
mResolutionLevelPatterns
;
213
214
// See HoughTree class description; same quantities, booked from
215
// reconstruction.C script for defered application in HoughTree::Init() calls;
216
unsigned
mBorrowedHitCounterMax
,
mBorrowedPlusMissingHitCounterMax
;
217
//unsigned mMinOkHitCounter, mMaxOkHitCounter;
218
unsigned
mMissingHitCounterMax
;
219
unsigned
mBlindCellDecisionLevel
;
220
221
double
mMeasurementNoiseInflationFactor
;
222
223
TClonesArray *
mTracks
;
224
225
// Smear hit range by +/- that many *sigma* (defined by respective digi template);
226
double
mRelativeHitSmearing
;
227
// Smear cell range by some number matching this value in [cm]; in case of
228
// XY- and R-measurements this will be just divided by spatial granularity when
229
// given to the ngroup->OffsetThisValue() call in HoughTree::CheckCell(); in case
230
// of A-measurements respective smearing will be guessed based on min.radius;
231
double
mAbsoluteSpatialSmearing
;
232
233
double
mStoredMinFilterChiSquareCCDF
;
234
235
ClassDef
(
FwdTrackFinder
,17);
236
};
237
238
#endif
EicRoot
blob
master
eic
htree
FwdTrackFinder.h
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:35
using
1.8.2 with
EIC GitHub integration