Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Corryvreckan
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Naomi Davis
Corryvreckan
Commits
9dac3406
Commit
9dac3406
authored
2 years ago
by
Simon Spannagel
Browse files
Options
Downloads
Patches
Plain Diff
Detector: update aligment parsing
parent
ed1a4bfd
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
src/core/detector/Detector.hpp
+27
-2
27 additions, 2 deletions
src/core/detector/Detector.hpp
with
27 additions
and
2 deletions
src/core/detector/Detector.hpp
+
27
−
2
View file @
9dac3406
...
...
@@ -112,9 +112,33 @@ namespace corryvreckan {
py
=
std
::
make_shared
<
TFormula
>
(
"py"
,
position_functions
.
at
(
1
).
c_str
(),
false
);
pz
=
std
::
make_shared
<
TFormula
>
(
"pz"
,
position_functions
.
at
(
2
).
c_str
(),
false
);
// Check that the formulae could correctly be compiled
if
(
!
(
px
->
IsValid
()
&&
py
->
IsValid
()
&&
pz
->
IsValid
()))
{
throw
InvalidValueError
(
config
,
"position"
,
"Invalid formulae"
);
}
// Check that we have the correct number of dimensions
if
(
px
->
GetNdim
()
>
1
||
py
->
GetNdim
()
>
1
||
pz
->
GetNdim
()
>
1
)
{
throw
InvalidValueError
(
config
,
"position"
,
"Invalid number of dimensions, only 1d is supported"
);
}
// We have constant values, no update needed
if
(
px
->
GetNdim
()
==
0
&&
py
->
GetNdim
()
==
0
&&
pz
->
GetNdim
()
==
0
)
{
needs_update_
=
false
;
}
else
{
needs_update_
=
true
;
}
// Check if we expect parameters
auto
allpars
=
static_cast
<
size_t
>
(
px
->
GetNpar
()
+
py
->
GetNpar
()
+
pz
->
GetNpar
());
if
(
allpars
==
0
)
{
LOG
(
DEBUG
)
<<
"No parameters."
;
return
;
}
// Parse parameters:
auto
position_parameters
=
config
.
getArray
<
double
>
(
"position_parameters"
);
if
(
static_cast
<
size_t
>
(
px
->
GetNpar
()
+
py
->
GetNpar
()
+
pz
->
GetNpar
())
!=
position_parameters
.
size
())
{
if
(
allpars
!=
position_parameters
.
size
())
{
throw
InvalidValueError
(
config
,
"position_parameters"
,
...
...
@@ -157,7 +181,7 @@ namespace corryvreckan {
private
:
void
update
(
double
time
)
{
// Check if we need to update already
if
(
time
<
last_time_
+
granularity_
)
{
if
(
time
<
last_time_
+
granularity_
||
!
needs_update_
)
{
return
;
}
...
...
@@ -184,6 +208,7 @@ namespace corryvreckan {
// Cache for last time the transformations were renewed, in ns:
double
last_time_
{};
double
granularity_
{};
bool
needs_update_
{
false
};
// Cache for calculated transformations
ROOT
::
Math
::
XYZPoint
origin_
;
...
...
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