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
!158
Changes to support complete use of RICH PMTs/panels in the reco
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Changes to support complete use of RICH PMTs/panels in the reco
jonrob/Detector:implement-detectionPoint-dd4hep
into
master
Overview
1
Commits
4
Pipelines
6
Changes
1
Merged
Christopher Rob Jones
requested to merge
jonrob/Detector:implement-detectionPoint-dd4hep
into
master
3 years ago
Overview
1
Commits
4
Pipelines
6
Changes
1
Expand
Supports changes in
LHCb!3454 (merged)
Edited
3 years ago
by
Christopher Rob Jones
0
0
Merge request reports
Viewing commit
878cfbaf
Prev
Next
Show latest version
1 file
+
26
−
18
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
878cfbaf
Add more parameter mappings to Rich/Utilities.h
· 878cfbaf
Christopher Rob Jones
authored
3 years ago
Detector/Rich/include/Detector/Rich/Utilities.h
+
26
−
18
Options
@@ -60,32 +60,40 @@ namespace LHCb::Detector::detail {
{
"RichPmtPixelXSize"
,
"RhPMTPixelXSize"
},
{
"RichPmtPixelYSize"
,
"RhPMTPixelYSize"
},
{
"RichGrandPmtPixelXSize"
,
"RhGrandPMTPixelXSize"
},
{
"RichGrandPmtPixelYSize"
,
"RhGrandPMTPixelYSize"
}};
{
"RichGrandPmtPixelYSize"
,
"RhGrandPMTPixelYSize"
},
{
"RichPmtAnodeXSize"
,
"RhPMTAnodeXSize"
},
{
"RichPmtAnodeYSize"
,
"RhPMTAnodeYSize"
},
{
"RichGrandPmtAnodeXSize"
,
"RhGrandPMTAnodeXSize"
},
{
"RichGrandPmtAnodeYSize"
,
"RhGrandPMTAnodeYSize"
},
{
"Rich1PmtDetPlaneZInPmtPanel"
,
"Rh1PMTDetPlaneZLocationInPhDetSupFrame"
},
{
"Rich2PmtDetPlaneZInPmtPanel"
,
"Rh2MixedPMTDetPlaneZLocationInPMTPanel"
}};
const
auto
mapped_name
=
name_map
.
find
(
name
);
if
(
mapped_name
!=
name_map
.
end
()
)
{
name
=
mapped_name
->
second
;
}
// // Another work around for DetDesc parameters I have not yet located the
// // equivalent of in dd4hep. So for now document them here with their values.
// using MissingMap = std::unordered_map<std::string, TYPE>;
// static const MissingMap missing_map = {{"RichPmtQWToSiMaxDist", TYPE( 10 )},
// {"'RichPmtSiliconDetectorLocalZlocation", TYPE( -4.05 )}};
// const auto missing_name = missing_map.find( name );
// if ( missing_name != missing_map.end() ) { return missing_name->second; }
// Convert inconvenient DD4HEP API to dispatch via template type
try
{
if
constexpr
(
std
::
is_arithmetic_v
<
TYPE
>
)
{
// deal with really (really) annoying units mis-match between dd4hep and everyone else.
// To be removed once the units are corrected 'at source' to be the expected Gaudi ones.
using
ScaleMap
=
std
::
unordered_map
<
std
::
string
,
TYPE
>
;
static
const
ScaleMap
scale_map
=
{
{
"Rh1QuartzWindowZSize"
,
TYPE
(
LHCb
::
Detector
::
detail
::
DD4hepToLHCbCm
)},
// cm -> mm
{
"Rh2QuartzWindowSizeZ"
,
TYPE
(
LHCb
::
Detector
::
detail
::
DD4hepToLHCbCm
)},
// cm -> mm
{
"RhPMTPixelXSize"
,
TYPE
(
LHCb
::
Detector
::
detail
::
DD4hepToLHCbCm
)},
// cm -> mm
{
"RhPMTPixelYSize"
,
TYPE
(
LHCb
::
Detector
::
detail
::
DD4hepToLHCbCm
)},
// cm -> mm
{
"RhGrandPMTPixelXSize"
,
TYPE
(
LHCb
::
Detector
::
detail
::
DD4hepToLHCbCm
)},
// cm -> mm
{
"RhGrandPMTPixelYSize"
,
TYPE
(
LHCb
::
Detector
::
detail
::
DD4hepToLHCbCm
)},
// cm -> mm
};
const
auto
scale
=
scale_map
.
find
(
name
);
const
auto
F
=
(
scale
==
scale_map
.
end
()
?
TYPE
(
1
)
:
scale
->
second
);
const
TYPE
cmTOmm
=
LHCb
::
Detector
::
detail
::
DD4hepToLHCbCm
;
// cm -> mm
static
const
ScaleMap
scale_map
=
{{
"Rh1QuartzWindowZSize"
,
cmTOmm
},
{
"Rh2QuartzWindowSizeZ"
,
cmTOmm
},
{
"RhPMTPixelXSize"
,
cmTOmm
},
{
"RhPMTPixelYSize"
,
cmTOmm
},
{
"RhGrandPMTPixelXSize"
,
cmTOmm
},
{
"RhGrandPMTPixelYSize"
,
cmTOmm
},
{
"RhPMTAnodeXSize"
,
cmTOmm
},
{
"RhPMTAnodeYSize"
,
cmTOmm
},
{
"RhGrandPMTAnodeXSize"
,
cmTOmm
},
{
"RhGrandPMTAnodeYSize"
,
cmTOmm
},
{
"Rh1PMTDetPlaneZLocationInPhDetSupFrame"
,
cmTOmm
},
{
"Rh2MixedPMTDetPlaneZLocationInPMTPanel"
,
cmTOmm
},
{
"Rh1PhDetSupXSize"
,
cmTOmm
},
{
"Rh1PhDetSupYSize"
,
cmTOmm
},
{
"Rh2PDPanelSizeX"
,
cmTOmm
},
{
"Rh2PDPanelSizeY"
,
cmTOmm
}};
const
auto
scale
=
scale_map
.
find
(
name
);
const
auto
F
=
(
scale
==
scale_map
.
end
()
?
TYPE
(
1
)
:
scale
->
second
);
// floating point types
if
constexpr
(
std
::
is_same_v
<
double
,
TYPE
>
)
{
return
F
*
static_cast
<
TYPE
>
(
dd4hep
::
_toDouble
(
name
.
c_str
()
)
);
Loading