Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cbmroot
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Computing
cbmroot
Commits
616f957a
Commit
616f957a
authored
3 years ago
by
Sergei Zharko
Browse files
Options
Downloads
Patches
Plain Diff
L1: added limits check for tracking iteration parameters
parent
6e35fa2b
No related branches found
No related tags found
1 merge request
!972
L1: Finalized track finder iterations + envelope classes for tracking QA
Pipeline
#19292
passed
3 years ago
Stage: build
Changes
3
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
reco/L1/L1Algo/L1CAIteration.cxx
+48
-23
48 additions, 23 deletions
reco/L1/L1Algo/L1CAIteration.cxx
reco/L1/L1Algo/L1CAIteration.h
+26
-0
26 additions, 0 deletions
reco/L1/L1Algo/L1CAIteration.h
reco/L1/L1Algo/L1Parameters.cxx
+14
-2
14 additions, 2 deletions
reco/L1/L1Algo/L1Parameters.cxx
with
88 additions
and
25 deletions
reco/L1/L1Algo/L1CAIteration.cxx
+
48
−
23
View file @
616f957a
...
...
@@ -11,15 +11,18 @@
#include
"L1CAIteration.h"
#include
<FairLogger.h>
#include
<sstream>
//
//----------------------------------------------------------------------------------------------------------------------
#include
"L1Constants.h"
using
namespace
L1Constants
::
size
;
// ---------------------------------------------------------------------------------------------------------------------
//
L1CAIteration
::
L1CAIteration
()
noexcept
{
LOG
(
debug
)
<<
"L1CAIteration: Default constructor called for "
<<
this
;
}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
L1CAIteration
::
L1CAIteration
(
const
L1CAIteration
&
other
)
noexcept
// Basic fields
...
...
@@ -46,31 +49,31 @@ L1CAIteration::L1CAIteration(const L1CAIteration& other) noexcept
,
fIfSuppressGhost
(
other
.
fIfSuppressGhost
)
{
}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
L1CAIteration
::
L1CAIteration
(
L1CAIteration
&&
other
)
noexcept
{
this
->
Swap
(
other
);
}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
L1CAIteration
::
L1CAIteration
(
const
std
::
string
&
name
)
noexcept
:
fName
(
name
)
{}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
L1CAIteration
::~
L1CAIteration
()
noexcept
{}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
L1CAIteration
&
L1CAIteration
::
operator
=
(
const
L1CAIteration
&
other
)
noexcept
{
if
(
this
!=
&
other
)
{
L1CAIteration
(
other
).
Swap
(
*
this
);
}
return
*
this
;
}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
L1CAIteration
&
L1CAIteration
::
operator
=
(
L1CAIteration
&&
other
)
noexcept
{
...
...
@@ -80,24 +83,46 @@ L1CAIteration& L1CAIteration::operator=(L1CAIteration&& other) noexcept
}
return
*
this
;
}
// ---------------------------------------------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------------------------------------------
bool
L1CAIteration
::
Check
()
const
{
bool
res
=
true
;
// TODO: SZh 06.10.2022: These values should be tuned
res
=
this
->
CheckValueLimits
<
float
>
(
"track_chi2_cut"
,
fTrackChi2Cut
,
0.f
,
12.f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"triplet_chi2_cut"
,
fTripletChi2Cut
,
0.f
,
30.f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"doublet_chi2_cut"
,
fDoubletChi2Cut
,
0.f
,
15.f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"pick_gather"
,
fPickGather
,
2.f
,
5.f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"pick_neighbour"
,
fPickNeighbour
,
2.f
,
6.f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"min_momentum"
,
fMaxInvMom
,
1.f
/
1.f
,
1.f
/
0.05f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"max_slope_pv"
,
fMaxSlopePV
,
0.1f
,
2.f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"max_slope"
,
fMaxSlope
,
1.f
,
3.f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"max_dz"
,
fMaxDZ
,
0.f
,
1.0f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
int
>
(
"min_start_triplet_lvl"
,
fMinLevelTripletStart
,
0
,
5
)
&&
res
;
res
=
this
->
CheckValueLimits
<
int
>
(
"first_station_index"
,
fFirstStationIndex
,
0
,
kMaxNstations
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"target_pos_sigma_x"
,
fTargetPosSigmaX
,
0.01f
,
15.f
)
&&
res
;
res
=
this
->
CheckValueLimits
<
float
>
(
"target_pos_sigma_y"
,
fTargetPosSigmaY
,
0.01f
,
15.f
)
&&
res
;
return
res
;
}
// ---------------------------------------------------------------------------------------------------------------------
//
void
L1CAIteration
::
Print
(
int
verbosityLevel
)
const
{
if
(
verbosityLevel
==
0
)
{
LOG
(
info
)
<<
" - "
<<
fName
;
}
if
(
verbosityLevel
>
0
)
{
LOG
(
info
)
<<
ToString
(
0
);
}
}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
void
L1CAIteration
::
SetTargetPosSigmaXY
(
float
sigmaX
,
float
sigmaY
)
{
fTargetPosSigmaX
=
sigmaX
;
fTargetPosSigmaY
=
sigmaY
;
}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
void
L1CAIteration
::
Swap
(
L1CAIteration
&
other
)
noexcept
{
...
...
@@ -124,8 +149,8 @@ void L1CAIteration::Swap(L1CAIteration& other) noexcept
std
::
swap
(
fIfJumped
,
other
.
fIfJumped
);
std
::
swap
(
fIfSuppressGhost
,
other
.
fIfSuppressGhost
);
}
//
//
-
---------------------------------------------------------------------------------------------------------------------
//
---------------------------------------------------------------------------------------------------------------------
//
std
::
string
L1CAIteration
::
ToString
(
int
indentLevel
)
const
{
...
...
This diff is collapsed.
Click to expand it.
reco/L1/L1Algo/L1CAIteration.h
+
26
−
0
View file @
616f957a
...
...
@@ -12,6 +12,8 @@
#ifndef L1CAIteration_h
#define L1CAIteration_h 1
#include
<FairLogger.h>
#include
<boost/serialization/access.hpp>
#include
<boost/serialization/string.hpp>
...
...
@@ -48,6 +50,9 @@ public:
/// Move assignment operator
L1CAIteration
&
operator
=
(
L1CAIteration
&&
other
)
noexcept
;
/// Checks parameters consistency
bool
Check
()
const
;
/// Gets doublet chi2 upper cut
float
GetDoubletChi2Cut
()
const
{
return
fDoubletChi2Cut
;
}
...
...
@@ -270,8 +275,29 @@ private:
ar
&
fIfSuppressGhost
;
}
/// Checks, if a particular value lies within selected limits. In case of fail throws std::logic_error
/// \param name Name of parameters
/// \param value Value of parameter
/// \param lLimit Lower limit of parameter
/// \param uLimit Upper limit of parameter
template
<
typename
T
>
static
bool
CheckValueLimits
(
const
std
::
string
&
name
,
T
value
,
T
lLimit
,
T
uLimit
);
// ^ TODO: invent more proper name
};
// ---------------------------------------------------------------------------------------------------------------------
// TODO: SZh. 06.10.2022: Probably, this method should be replaced to L1Utils
template
<
typename
T
>
bool
L1CAIteration
::
CheckValueLimits
(
const
std
::
string
&
name
,
T
value
,
T
lLimit
,
T
uLimit
)
{
if
(
value
<
lLimit
||
value
>
uLimit
)
{
LOG
(
error
)
<<
"parameter
\033
[1;32m"
<<
name
<<
"
\033
[0m ("
<<
value
<<
") runs out of range: ["
<<
lLimit
<<
','
<<
uLimit
<<
']'
;
return
false
;
}
return
true
;
}
#endif // L1CAIteration_h
This diff is collapsed.
Click to expand it.
reco/L1/L1Algo/L1Parameters.cxx
+
14
−
2
View file @
616f957a
...
...
@@ -235,8 +235,10 @@ void L1Parameters::CheckConsistency() const
/*
* Check iterations sequence
* 1. Number of iterations with TrackFromTriplets flag turned on no more then 1
* 2. If this iteration exists, it should be the last one in the sequence
* 1. Number of iterations should be larger then zero
* 2. Each iteration should contain values within predefined limits
* 3. Number of iterations with TrackFromTriplets flag turned on no more then 1
* 4. If the TrackFromTriplets iteration exists, it should be the last one in the sequence
*/
{
int
nIterations
=
fCAIterations
.
size
();
...
...
@@ -246,6 +248,16 @@ void L1Parameters::CheckConsistency() const
throw
std
::
logic_error
(
msg
.
str
());
}
std
::
string
names
=
""
;
for
(
const
auto
iter
:
fCAIterations
)
{
if
(
!
iter
.
Check
())
{
names
+=
iter
.
GetName
()
+
" "
;
}
}
if
(
names
.
size
())
{
std
::
stringstream
msg
;
msg
<<
"L1Parameters: some parameters are out of range for the following iterations: "
<<
names
;
throw
std
::
logic_error
(
msg
.
str
());
}
nIterations
=
std
::
count_if
(
fCAIterations
.
begin
(),
fCAIterations
.
end
(),
[
=
](
const
L1CAIteration
&
it
)
{
return
it
.
GetTrackFromTripletsFlag
();
});
if
(
nIterations
>
1
)
{
...
...
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