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
Merge requests
!3434
Get particle selection from WeightedRelationTable
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Get particle selection from WeightedRelationTable
tfulghes-persist-selection
into
master
Overview
16
Commits
7
Pipelines
7
Changes
1
Merged
Tommaso Fulghesu
requested to merge
tfulghes-persist-selection
into
master
1 year ago
Overview
6
Commits
7
Pipelines
7
Changes
1
Expand
Add temporary code to use to get a selection of particles from a filtered Relation Table, useful in
this case
as pointed by
@roneil
.
Edited
1 year ago
by
Tommaso Fulghesu
3
0
Merge request reports
Compare
master
version 5
7af8df02
1 year ago
version 4
fa986e3b
1 year ago
version 3
c85b8c07
1 year ago
version 2
74636c20
1 year ago
version 1
9634b5b0
1 year ago
master (base)
and
latest version
latest version
4e811950
7 commits,
1 year ago
version 5
7af8df02
6 commits,
1 year ago
version 4
fa986e3b
5 commits,
1 year ago
version 3
c85b8c07
4 commits,
1 year ago
version 2
74636c20
3 commits,
1 year ago
version 1
9634b5b0
1 commit,
1 year ago
1 file
+
23
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Phys/RelatedInfoTools/src/WeightedRelationTable.cpp
+
23
−
4
Options
@@ -22,9 +22,10 @@
namespace
{
using
WeightedRelationTable
=
LHCb
::
Relation1D
<
LHCb
::
Particle
,
LHCb
::
Particle
>
;
using
Transformer
=
using
RelTable
Transformer
=
LHCb
::
Algorithm
::
Transformer
<
WeightedRelationTable
(
const
LHCb
::
Particle
::
Range
&
,
const
LHCb
::
Particle
::
Range
&
)
>
;
using
weight_t
=
bool
;
using
SelectionTransformer
=
LHCb
::
Algorithm
::
Transformer
<
LHCb
::
Particle
::
Selection
(
const
WeightedRelationTable
&
)
>
;
using
weight_t
=
bool
;
struct
Funct
{
constexpr
static
auto
PropertyName
=
"Cut"
;
@@ -60,14 +61,14 @@ namespace {
// This algorithm includes GetPhotonsForDalitzDecay
struct
WeightedRelTableAlg
:
with_functors
<
Transformer
,
Funct
>
{
struct
WeightedRelTableAlg
final
:
with_functors
<
RelTable
Transformer
,
Funct
>
{
// ==========================================================================
/** the standard constructor
* @param name algorithm instance name
* @param pSvc service locator
*/
WeightedRelTableAlg
(
const
std
::
string
&
name
,
ISvcLocator
*
pSvc
)
:
with_functors
<
Transformer
,
Funct
>::
with_functors
(
:
with_functors
<
RelTable
Transformer
,
Funct
>::
with_functors
(
name
,
pSvc
,
{
KeyValue
{
"InputCandidates"
,
""
},
KeyValue
{
"ReferenceParticles"
,
""
}},
KeyValue
{
"OutputRelations"
,
""
}
)
{}
@@ -102,4 +103,22 @@ private:
mutable
Gaudi
::
Accumulators
::
SummingCounter
<>
m_outCount
{
this
,
"#OutputParticles"
};
};
struct
SelectionFromWeightedRelationTable
final
:
SelectionTransformer
{
// ==========================================================================
/** the standard constructor
* @param name algorithm instance name
* @param pSvc service locator
*/
SelectionFromWeightedRelationTable
(
const
std
::
string
&
name
,
ISvcLocator
*
svcLoc
)
:
Transformer
(
name
,
svcLoc
,
KeyValue
(
"InputRelations"
,
""
),
KeyValue
(
"OutputLocation"
,
""
)
)
{}
LHCb
::
Particle
::
Selection
operator
()(
const
WeightedRelationTable
&
input
)
const
override
{
LHCb
::
Particle
::
Selection
selection
;
for
(
const
auto
&
rel
:
input
.
relations
()
)
selection
.
push_back
(
rel
.
to
()
);
return
selection
;
}
};
DECLARE_COMPONENT
(
WeightedRelTableAlg
)
DECLARE_COMPONENT
(
SelectionFromWeightedRelationTable
)
Loading