Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Blumenthal
athena
Commits
a12f7037
Commit
a12f7037
authored
4 years ago
by
Christos Anastopoulos
Committed by
Frank Winklmeier
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
GaussianDensity : Try to avoid dynamic_cast
parent
bbae0bc0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
+14
-17
14 additions, 17 deletions
...ter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
with
14 additions
and
17 deletions
Tracking/TrkVertexFitter/TrkVertexSeedFinderUtils/src/GaussianTrackDensity.cxx
+
14
−
17
View file @
a12f7037
...
@@ -112,14 +112,11 @@ namespace Trk
...
@@ -112,14 +112,11 @@ namespace Trk
const
double
d0SignificanceCut
=
m_d0MaxSignificance
*
m_d0MaxSignificance
;
const
double
d0SignificanceCut
=
m_d0MaxSignificance
*
m_d0MaxSignificance
;
const
double
z0SignificanceCut
=
m_z0MaxSignificance
*
m_z0MaxSignificance
;
const
double
z0SignificanceCut
=
m_z0MaxSignificance
*
m_z0MaxSignificance
;
for
(
const
TrackParameters
*
iparam
:
perigeeList
)
for
(
const
TrackParameters
*
iparam
:
perigeeList
)
{
{
if
(
iparam
&&
iparam
->
surfaceType
()
==
Trk
::
Surface
::
Perigee
)
{
const
Perigee
*
itrk
=
dynamic_cast
<
const
Perigee
*>
(
iparam
);
density
.
addTrack
(
*
(
static_cast
<
const
Perigee
*>
(
iparam
)),
if
(
itrk
!=
nullptr
)
d0SignificanceCut
,
{
z0SignificanceCut
);
density
.
addTrack
(
*
itrk
,
d0SignificanceCut
,
z0SignificanceCut
);
}
}
}
}
}
}
...
@@ -129,12 +126,12 @@ namespace Trk
...
@@ -129,12 +126,12 @@ namespace Trk
GaussianTrackDensity
::
TrackEntry
::
TrackEntry
(
double
c0
,
double
c1
,
double
c2
,
GaussianTrackDensity
::
TrackEntry
::
TrackEntry
(
double
c0
,
double
c1
,
double
c2
,
double
zMin
,
double
zMax
)
double
zMin
,
double
zMax
)
:
c_0
(
c0
),
c_1
(
c1
),
c_2
(
c2
),
lowerBound
(
zMin
),
upperBound
(
zMax
)
:
c_0
(
c0
),
c_1
(
c1
),
c_2
(
c2
),
lowerBound
(
zMin
),
upperBound
(
zMax
)
{
}
{
}
// Dummy constructor for binary search
// Dummy constructor for binary search
GaussianTrackDensity
::
TrackEntry
::
TrackEntry
(
double
z
)
GaussianTrackDensity
::
TrackEntry
::
TrackEntry
(
double
z
)
:
c_0
(
0
),
c_1
(
0
),
c_2
(
0
),
lowerBound
(
z
),
upperBound
(
z
)
:
c_0
(
0
),
c_1
(
0
),
c_2
(
0
),
lowerBound
(
z
),
upperBound
(
z
)
{
}
{
}
...
@@ -149,10 +146,10 @@ namespace Trk
...
@@ -149,10 +146,10 @@ namespace Trk
double
GaussianTrackDensity
::
TrackDensity
::
trackDensity
(
double
z
)
const
double
GaussianTrackDensity
::
TrackDensity
::
trackDensity
(
double
z
)
const
{
{
double
firstDeriv
,
secondDeriv
=
0
;
// unused in this case
double
firstDeriv
,
secondDeriv
=
0
;
// unused in this case
double
density
=
0
;
double
density
=
0
;
// use the existing trackDensity method to avoid duplication of logic
// use the existing trackDensity method to avoid duplication of logic
trackDensity
(
z
,
density
,
firstDeriv
,
secondDeriv
);
trackDensity
(
z
,
density
,
firstDeriv
,
secondDeriv
);
return
density
;
return
density
;
}
}
...
@@ -168,14 +165,14 @@ namespace Trk
...
@@ -168,14 +165,14 @@ namespace Trk
{
{
TrackDensityEval
densityResult
(
z
);
TrackDensityEval
densityResult
(
z
);
for
(
const
auto
&
trackAndPerigeePair
:
m_lowerMap
){
for
(
const
auto
&
trackAndPerigeePair
:
m_lowerMap
){
densityResult
.
addTrack
(
trackAndPerigeePair
.
first
);
densityResult
.
addTrack
(
trackAndPerigeePair
.
first
);
}
}
density
=
densityResult
.
density
();
density
=
densityResult
.
density
();
firstDerivative
=
densityResult
.
firstDerivative
();
firstDerivative
=
densityResult
.
firstDerivative
();
secondDerivative
=
densityResult
.
secondDerivative
();
secondDerivative
=
densityResult
.
secondDerivative
();
}
}
std
::
pair
<
double
,
double
>
std
::
pair
<
double
,
double
>
GaussianTrackDensity
::
TrackDensity
::
globalMaximumWithWidth
(
MsgStream
&
msg
)
const
GaussianTrackDensity
::
TrackDensity
::
globalMaximumWithWidth
(
MsgStream
&
msg
)
const
{
{
// strategy:
// strategy:
...
@@ -200,7 +197,7 @@ namespace Trk
...
@@ -200,7 +197,7 @@ namespace Trk
double
slope
=
0.0
;
double
slope
=
0.0
;
double
curvature
=
0.0
;
double
curvature
=
0.0
;
trackDensity
(
trialZ
,
density
,
slope
,
curvature
);
trackDensity
(
trialZ
,
density
,
slope
,
curvature
);
if
(
curvature
>=
0.0
||
density
<=
0.0
)
continue
;
if
(
curvature
>=
0.0
||
density
<=
0.0
)
continue
;
updateMaximum
(
trialZ
,
density
,
curvature
,
maximumPosition
,
maximumDensity
,
maxCurvature
);
updateMaximum
(
trialZ
,
density
,
curvature
,
maximumPosition
,
maximumDensity
,
maxCurvature
);
trialZ
+=
stepSize
(
density
,
slope
,
curvature
);
trialZ
+=
stepSize
(
density
,
slope
,
curvature
);
trackDensity
(
trialZ
,
density
,
slope
,
curvature
);
trackDensity
(
trialZ
,
density
,
slope
,
curvature
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment