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
Merge requests
!3718
Add support for RICH readout mapping versions
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add support for RICH readout mapping versions
jonrob/LHCb:rich-support-readout-mapping-version
into
master
Overview
1
Commits
1
Pipelines
4
Changes
7
Merged
Christopher Rob Jones
requested to merge
jonrob/LHCb:rich-support-readout-mapping-version
into
master
2 years ago
Overview
1
Commits
1
Pipelines
4
Changes
7
Expand
0
0
Merge request reports
Compare
master
version 2
0f78af63
2 years ago
version 1
03c0c93f
2 years ago
master (base)
and
latest version
latest version
c8f8b3dd
1 commit,
2 years ago
version 2
0f78af63
2 commits,
2 years ago
version 1
03c0c93f
1 commit,
2 years ago
7 files
+
153
−
14
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
7
Search (e.g. *.vue) (Ctrl+P)
Rich/RichDetectors/include/RichDetectors/Condition.h
+
30
−
3
Options
@@ -18,6 +18,7 @@
#endif
#include
<cassert>
#include
<utility>
namespace
Rich
::
Detector
{
@@ -27,21 +28,47 @@ namespace Rich::Detector {
using
Condition
=
ParamValidDataObject
;
#endif
// tutorial on how to use yaml-cpp can be found at
// https://github.com/jbeder/yaml-cpp/wiki/Tutorial
inline
auto
condition_param_exists
(
const
Condition
&
cond
,
const
std
::
string
&
paramName
)
{
#ifdef USE_DD4HEP
return
cond
[
paramName
].
IsDefined
();
#else
return
cond
.
exists
(
paramName
);
#endif
}
inline
auto
condition_param_exists
(
const
Condition
*
cond
,
const
std
::
string
&
paramName
)
{
assert
(
cond
);
return
condition_param_exists
(
*
cond
,
paramName
);
}
template
<
typename
T
>
inline
auto
condition_param
(
const
Condition
&
cond
,
const
std
::
string
&
paramName
)
{
#ifdef USE_DD4HEP
// tutorial on how to use yaml-cpp can be found at
// https://github.com/jbeder/yaml-cpp/wiki/Tutorial
return
cond
[
paramName
].
as
<
T
>
();
#else
return
cond
.
param
<
T
>
(
paramName
);
#endif
}
template
<
typename
T
>
inline
auto
condition_param
(
const
Condition
*
cond
,
const
std
::
string
&
paramName
)
{
assert
(
cond
);
return
condition_param
<
T
>
(
*
cond
,
paramName
);
}
template
<
typename
T
>
inline
auto
condition_param
(
const
Condition
&
cond
,
const
std
::
string
&
paramName
,
const
T
def
)
{
#ifdef USE_DD4HEP
return
cond
[
paramName
].
as
<
T
>
(
def
);
#else
return
(
condition_param_exists
(
cond
,
paramName
)
?
cond
.
param
<
T
>
(
paramName
)
:
def
);
#endif
}
template
<
typename
T
>
inline
auto
condition_param
(
const
Condition
*
cond
,
const
std
::
string
&
paramName
,
const
T
def
)
{
assert
(
cond
);
return
condition_param
<
T
>
(
*
cond
,
paramName
,
std
::
move
(
def
)
);
}
}
// namespace Rich::Detector
Loading