Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rec
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
Rec
Commits
b1aad0e5
Commit
b1aad0e5
authored
1 year ago
by
Christopher Rob Jones
Browse files
Options
Downloads
Patches
Plain Diff
RichDetectorHits: Protect against AIDA return nonsense indices
parent
2073f0bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!3788
Draft: Update SciFi cluster monitoring
,
!3642
Performance Updates to RICH Reconstruction
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Rich/RichFutureRecMonitors/src/RichDetectorHits.cpp
+19
-16
19 additions, 16 deletions
Rich/RichFutureRecMonitors/src/RichDetectorHits.cpp
with
19 additions
and
16 deletions
Rich/RichFutureRecMonitors/src/RichDetectorHits.cpp
+
19
−
16
View file @
b1aad0e5
...
...
@@ -24,6 +24,7 @@
#include
"AIDA/IAxis.h"
// STD
#include
<algorithm>
#include
<cstdint>
#include
<mutex>
#include
<vector>
...
...
@@ -133,8 +134,10 @@ namespace Rich::Future::Rec::Moni {
fillHisto
(
h_pixXLoc
[
rich
],
lPos
.
X
()
);
fillHisto
(
h_pixYLoc
[
rich
],
lPos
.
Y
()
);
// cache occupancy data
const
auto
iX
=
h_pdXYLocOcc
[
rich
]
->
xAxis
().
coordToIndex
(
lPos
.
X
()
);
const
auto
iY
=
h_pdXYLocOcc
[
rich
]
->
yAxis
().
coordToIndex
(
lPos
.
Y
()
);
const
auto
iX
=
std
::
clamp
(
h_pdXYOcc
[
rich
]
->
xAxis
().
coordToIndex
(
lPos
.
X
()
),
0
,
(
int
)
nBins2D
()
-
1
);
const
auto
iY
=
std
::
clamp
(
h_pdXYOcc
[
rich
]
->
yAxis
().
coordToIndex
(
lPos
.
Y
()
),
0
,
(
int
)
nBins2D
()
-
1
);
pdOccXY
.
at
(
iX
).
at
(
iY
)
=
rawIDs
.
size
();
}
...
...
@@ -151,14 +154,14 @@ namespace Rich::Future::Rec::Moni {
// Fill occupancies
for
(
auto
iX
=
0u
;
iX
<
nBins2D
();
++
iX
)
{
for
(
auto
iY
=
0u
;
iY
<
nBins2D
();
++
iY
)
{
const
auto
X
=
0.5
*
(
h_pdXYLocOcc
[
rich
]
->
xAxis
().
binLowerEdge
(
iX
)
+
h_pdXY
Loc
Occ
[
rich
]
->
xAxis
().
binUpperEdge
(
iX
)
);
const
auto
Y
=
0.5
*
(
h_pdXYLocOcc
[
rich
]
->
yAxis
().
binLowerEdge
(
iY
)
+
h_pdXY
Loc
Occ
[
rich
]
->
yAxis
().
binUpperEdge
(
iY
)
);
const
auto
occ
=
pdOccXY
.
at
(
iX
).
at
(
iY
)
;
fillHisto
(
h_pdXY
Loc
Occ
[
rich
],
X
,
Y
,
occ
);
fillHisto
(
h_pdX
Loc
Occ
[
rich
],
X
,
occ
);
fillHisto
(
h_pdY
Loc
Occ
[
rich
],
Y
,
occ
);
const
auto
X
=
0.5
*
(
h_pdXYOcc
[
rich
]
->
xAxis
().
binLowerEdge
(
iX
)
+
h_pdXYOcc
[
rich
]
->
xAxis
().
binUpperEdge
(
iX
)
);
const
auto
Y
=
0.5
*
(
h_pdXYOcc
[
rich
]
->
yAxis
().
binLowerEdge
(
iY
)
+
h_pdXYOcc
[
rich
]
->
yAxis
().
binUpperEdge
(
iY
)
);
const
auto
occ
=
pdOccXY
[
iX
][
iY
]
;
fillHisto
(
h_pdXYOcc
[
rich
],
X
,
Y
,
occ
);
fillHisto
(
h_pdXOcc
[
rich
],
X
,
occ
);
fillHisto
(
h_pdYOcc
[
rich
],
Y
,
occ
);
}
}
...
...
@@ -264,18 +267,18 @@ namespace Rich::Future::Rec::Moni {
"Local Y hits"
,
//
-
panelYsizes
[
rich
],
panelYsizes
[
rich
],
nBins1D
(),
//
"Local Y / mm"
)
);
ok
&=
saveAndCheck
(
h_pdXY
Loc
Occ
[
rich
],
//
ok
&=
saveAndCheck
(
h_pdXYOcc
[
rich
],
//
richProfile2D
(
HID
(
"pdOccXYLoc"
,
rich
),
//
"PD Average Occupancy (X,Y)"
,
//
-
panelXsizes
[
rich
],
panelXsizes
[
rich
],
nBins2D
(),
//
-
panelYsizes
[
rich
],
panelYsizes
[
rich
],
nBins2D
(),
//
"Local X / mm"
,
"Local Y / mm"
)
);
ok
&=
saveAndCheck
(
h_pdX
Loc
Occ
[
rich
],
//
ok
&=
saveAndCheck
(
h_pdXOcc
[
rich
],
//
richProfile1D
(
HID
(
"pdOccXLoc"
,
rich
),
//
"PD Average Occupancy (X)"
,
//
-
panelXsizes
[
rich
],
panelXsizes
[
rich
],
nBins2D
(),
//
"Local X / mm"
)
);
ok
&=
saveAndCheck
(
h_pdY
Loc
Occ
[
rich
],
//
ok
&=
saveAndCheck
(
h_pdYOcc
[
rich
],
//
richProfile1D
(
HID
(
"pdOccYLoc"
,
rich
),
//
"PD Average Occupancy (Y)"
,
//
-
panelYsizes
[
rich
],
panelYsizes
[
rich
],
nBins2D
(),
//
...
...
@@ -317,9 +320,9 @@ namespace Rich::Future::Rec::Moni {
DetectorArray
<
AIDA
::
IHistogram1D
*>
h_pixXLoc
=
{{}};
DetectorArray
<
AIDA
::
IHistogram1D
*>
h_pixYLoc
=
{{}};
DetectorArray
<
AIDA
::
IProfile2D
*>
h_pdXY
Loc
Occ
=
{{}};
DetectorArray
<
AIDA
::
IProfile1D
*>
h_pdX
Loc
Occ
=
{{}};
DetectorArray
<
AIDA
::
IProfile1D
*>
h_pdY
Loc
Occ
=
{{}};
DetectorArray
<
AIDA
::
IProfile2D
*>
h_pdXYOcc
=
{{}};
DetectorArray
<
AIDA
::
IProfile1D
*>
h_pdXOcc
=
{{}};
DetectorArray
<
AIDA
::
IProfile1D
*>
h_pdYOcc
=
{{}};
};
// Declaration of the Algorithm Factory
...
...
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