Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Detector
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
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
LHCb
Detector
Merge requests
!551
Synchronize master branch with 2024-patches
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Synchronize master branch with 2024-patches
2024-patches-sync
into
master
Overview
1
Commits
11
Pipelines
4
Changes
14
Merged
Marco Clemencic
requested to merge
2024-patches-sync
into
master
1 year ago
Overview
1
Commits
11
Pipelines
4
Changes
14
Expand
Includes:
Add check against missing 0 value for conditions (
!538 (merged)
)
cherry-pick the changes in checksum at master branch (
!540 (merged)
)
Access to LHC condition information (
!418 (merged)
)
Prepare Detector v1r31 (
!548 (merged)
)
UT ChannelID to provide subsector and asic info (
!470 (merged)
)
Edited
1 year ago
by
Marco Clemencic
0
0
Merge request reports
Compare
master
version 2
4d3f0a04
1 year ago
version 1
88923dc5
1 year ago
master (base)
and
latest version
latest version
00592969
11 commits,
11 months ago
version 2
4d3f0a04
11 commits,
1 year ago
version 1
88923dc5
10 commits,
1 year ago
14 files
+
239
−
30
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
14
Search (e.g. *.vue) (Ctrl+P)
Core/tests/src/test_DDS_lhcinfo.cpp
0 → 100644
+
70
−
0
Options
/*****************************************************************************\
* (c) Copyright 2024 CERN for the benefit of the LHCb Collaboration *
* *
* This software is distributed under the terms of the GNU General Public *
* Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". *
* *
* In applying this licence, CERN does not waive the privileges and immunities *
* granted to it by virtue of its status as an Intergovernmental Organization *
* or submit itself to any jurisdiction. *
\*****************************************************************************/
#include
<Core/DetectorDataService.h>
#include
<Core/Keys.h>
#include
<DD4hep/Detector.h>
#include
<Detector/LHCb/DeLHCb.h>
#include
<Detector/Test/Fixture.h>
#include
<cstdio>
#include
<catch2/catch.hpp>
TEST_CASE
(
"LHCCondition loading"
)
{
namespace
fs
=
std
::
filesystem
;
using
Catch
::
Matchers
::
Contains
;
Detector
::
Test
::
Fixture
f
;
auto
&
description
=
f
.
description
();
description
.
fromXML
(
"compact/run3/trunk/LHCb.xml"
);
REQUIRE
(
description
.
state
()
==
dd4hep
::
Detector
::
READY
);
auto
det
=
description
.
detector
(
"/world"
);
// the `!!` is needed because handles have `operator!` but not `operator bool`
REQUIRE
(
!!
det
);
LHCb
::
Detector
::
DetectorDataService
dds
(
description
,
{
"/world"
}
);
dds
.
initialize
(
nlohmann
::
json
(
{{
"repository"
,
"file:tests/ConditionsIOV"
}}
)
);
{
// get a condition slice where the condition exists
// - we should get the values from the condition
auto
slice
=
dds
.
get_slice
(
200
);
REQUIRE
(
slice
);
LHCb
::
Detector
::
DeLHCb
lhcb
=
slice
->
get
(
det
,
LHCb
::
Detector
::
Keys
::
deKey
);
REQUIRE
(
!!
lhcb
);
auto
lhcinfo
=
lhcb
.
lhcInfo
();
REQUIRE
(
lhcinfo
.
has_value
()
);
CHECK
(
lhcinfo
.
value
().
fillnumber
==
7974
);
CHECK
(
lhcinfo
.
value
().
lhcstate
==
"INJECTION"
);
CHECK
(
lhcinfo
.
value
().
lhcenergy
==
450
);
CHECK
(
abs
(
lhcinfo
.
value
().
lhcbclockphase
-
0.46556840909089
)
<
1e-6
);
}
{
// get a condition slice where the condition doesn't exist
// - we should get the fallback values
auto
slice
=
dds
.
get_slice
(
0
);
REQUIRE
(
slice
);
LHCb
::
Detector
::
DeLHCb
lhcb
=
slice
->
get
(
det
,
LHCb
::
Detector
::
Keys
::
deKey
);
REQUIRE
(
!!
lhcb
);
auto
lhcinfo
=
lhcb
.
lhcInfo
();
REQUIRE
(
!
lhcinfo
.
has_value
()
);
}
}
Loading