Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LHCb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
LHCb
LHCb
Commits
ee934536
Commit
ee934536
authored
1 year ago
by
Andre Gunther
Browse files
Options
Downloads
Patches
Plain Diff
PrimaryVertices abort fit when invChol fails
parent
8915f061
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!4468
MatVec invChol check for failure
Pipeline
#7172860
passed
11 months ago
Stage: test
Stage: .post
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Event/RecEvent/src/PrimaryVertices.cpp
+15
-13
15 additions, 13 deletions
Event/RecEvent/src/PrimaryVertices.cpp
with
15 additions
and
13 deletions
Event/RecEvent/src/PrimaryVertices.cpp
+
15
−
13
View file @
ee934536
...
...
@@ -96,7 +96,7 @@ namespace LHCb::Event::PV {
pv
.
setHalfDChi2DX
(
LinAlg
::
initialize_with_zeros
<
LHCb
::
LinAlg
::
Vec
<
double
,
3
>>
()
);
pv
.
setCovMatrix
(
convertToSMatrix
<
double
>
(
cov
)
);
pv
.
setSumOfWeights
(
accumulator
.
sumw
);
bool
converged
=
std
::
abs
(
delta
(
2
)
)
<
maxDeltaZConverged
&&
abs
(
deltachi2
)
<
maxDeltaChi2Converged
;
bool
converged
=
std
::
abs
(
delta
.
z
(
)
)
<
maxDeltaZConverged
&&
abs
(
deltachi2
)
<
maxDeltaChi2Converged
;
return
converged
?
PVFitStatus
::
Converged
:
PVFitStatus
::
NotConverged
;
};
...
...
@@ -258,24 +258,26 @@ namespace LHCb::Event::PV {
auto
status
=
PVFitStatus
::
NotConverged
;
auto
zcache
=
pv
.
position
().
z
();
unsigned
iter
{
0
};
for
(
;
iter
<
fitconfig
.
maxFitIter
&&
status
==
PVFitStatus
::
NotConverged
;
++
iter
)
{
for
(
;
iter
<
fitconfig
.
maxFitIter
&&
(
status
==
PVFitStatus
::
NotConverged
||
iter
<
fitconfig
.
numAnnealingSteps
);
++
iter
)
{
// dumb 1-step annealing scheme. don't use for refits.
const
auto
chi2maxmultiplier
=
std
::
max
(
int
(
fitconfig
.
numAnnealingSteps
)
-
int
(
iter
)
+
1
,
1
);
const
auto
thischi2max
=
chi2maxmultiplier
*
fitconfig
.
maxDeltaChi2
;
// Update the 2nd derivative cache only when vtx moved significantly, or on the first iteration
const
auto
maxDeltaZForCache
=
0.2
;
const
auto
vtxz
=
pv
.
position
().
z
();
if
(
iter
==
0
||
std
::
abs
(
vtxz
-
zcache
)
>
maxDeltaZForCache
)
{
status
=
fitSingleStep
<
true
>
(
pv
,
pvtracks
,
thischi2max
,
fitconfig
.
maxDeltaZConverged
,
fitconfig
.
maxDeltaChi2Converged
);
zcache
=
vtxz
;
}
else
{
status
=
fitSingleStep
<
false
>
(
pv
,
pvtracks
,
thischi2max
,
fitconfig
.
maxDeltaZConverged
,
fitconfig
.
maxDeltaChi2Converged
);
constexpr
auto
maxDeltaZForCache
=
0.2
*
Gaudi
::
Units
::
mm
;
const
auto
vtxz
=
pv
.
position
().
z
();
const
auto
updateWeightMatrix
=
(
iter
==
0
)
||
(
std
::
abs
(
vtxz
-
zcache
)
>
maxDeltaZForCache
);
status
=
updateWeightMatrix
?
fitSingleStep
<
true
>
(
pv
,
pvtracks
,
thischi2max
,
fitconfig
.
maxDeltaZConverged
,
fitconfig
.
maxDeltaChi2Converged
)
:
fitSingleStep
<
false
>
(
pv
,
pvtracks
,
thischi2max
,
fitconfig
.
maxDeltaZConverged
,
fitconfig
.
maxDeltaChi2Converged
);
if
(
status
==
PVFitStatus
::
Failed
)
{
pv
.
setStatus
(
status
);
return
status
;
}
// make sure to continue if still annealing
if
(
status
==
PVFitStatus
::
Converged
&&
iter
<
fitconfig
.
numAnnealingSteps
)
status
=
PVFitStatus
::
NotConverged
;
if
(
updateWeightMatrix
)
zcache
=
vtxz
;
}
// To make sure that we can read back the same vertices from the persistency without storing everything,
// we update once more the derivatives and weights
...
...
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