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
Commits
d44accd7
Commit
d44accd7
authored
1 year ago
by
Wouter Hulsbergen
Browse files
Options
Downloads
Patches
Plain Diff
use veloid derived from lhcbids for unbiasing
parent
8592bc6d
No related branches found
No related tags found
1 merge request
!4299
add PV pointer to particle, update v2 PV event model
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Event/PhysEvent/include/Event/Particle.h
+7
-8
7 additions, 8 deletions
Event/PhysEvent/include/Event/Particle.h
Event/PhysEvent/src/Particle.cpp
+10
-37
10 additions, 37 deletions
Event/PhysEvent/src/Particle.cpp
with
17 additions
and
45 deletions
Event/PhysEvent/include/Event/Particle.h
+
7
−
8
View file @
d44accd7
...
...
@@ -606,19 +606,18 @@ namespace LHCb {
}
/// routine to collect all velo-segment IDs from the decay chain of a particle.
boost
::
container
::
small_vector
<
int
,
16
>
collectVeloSegmentIDs
(
const
Particle
&
p
,
const
LHCb
::
Event
::
PV
::
PrimaryVertexContainer
&
PVs
);
boost
::
container
::
small_vector
<
uint32_t
,
16
>
collectVeloSegmentIDs
(
const
Particle
&
p
);
inline
std
::
optional
<
Event
::
PV
::
PrimaryVertex
>
unbiasedBestPV
(
const
LHCb
::
Event
::
PV
::
PrimaryVertexContainer
&
PVs
,
const
Particle
&
particle
)
{
inline
std
::
optional
<
PrimaryVertex
>
unbiasedBestPV
(
const
LHCb
::
Event
::
PV
::
PrimaryVertexContainer
&
PVs
,
const
Particle
&
particle
)
{
if
(
PVs
.
empty
()
)
return
{};
auto
ids
=
collectVeloSegmentIDs
(
particle
,
PVs
);
return
LHCb
::
Event
::
PV
::
unbiasedVertex
(
PVs
,
bestPVIndex
(
PVs
,
particle
),
ids
);
auto
ids
=
collectVeloSegmentIDs
(
particle
);
return
LHCb
::
Event
::
PV
::
unbiasedVertex
(
PVs
,
bestPVIndex
(
PVs
,
particle
),
LHCb
::
span
<
const
uint32_t
>
(
ids
)
);
}
inline
auto
unbiasedPVs
(
const
LHCb
::
Event
::
PV
::
PrimaryVertexContainer
&
PVs
,
const
LHCb
::
Particle
&
particle
)
{
auto
ids
=
collectVeloSegmentIDs
(
particle
,
PVs
);
return
LHCb
::
Event
::
PV
::
unbiasedVertices
(
PVs
,
ids
);
auto
ids
=
collectVeloSegmentIDs
(
particle
);
return
LHCb
::
Event
::
PV
::
unbiasedVertices
(
PVs
,
LHCb
::
span
<
const
uint32_t
>
(
ids
)
);
}
}
// namespace LHCb
...
...
This diff is collapsed.
Click to expand it.
Event/PhysEvent/src/Particle.cpp
+
10
−
37
View file @
d44accd7
...
...
@@ -144,52 +144,25 @@ const GaudiUtils::VectorMap<std::string, LHCb::Particle::additionalInfo>& LHCb::
}
namespace
{
template
<
typename
TrackType
>
const
TrackType
*
findPrPixelAncestor
(
const
TrackType
&
track
)
{
if
(
track
.
history
()
==
TrackType
::
History
::
PrPixel
)
return
&
track
;
else
{
for
(
const
auto
&
a
:
track
.
ancestors
()
)
{
const
auto
dau
=
findPrPixelAncestor
(
*
a
);
if
(
dau
)
return
dau
;
}
}
return
nullptr
;
}
template
<
typename
IndexContainer
,
typename
VeloTracks
>
inline
void
collectVeloIndices
(
const
LHCb
::
Particle
&
p
,
const
VeloTracks
&
pvtracks
,
IndexContainer
&
veloindices
)
{
// this can be very much simplified once every track has a velo index. then we also do not need the pvtracks
// argument anymore
template
<
typename
IndexContainer
>
inline
void
collectVeloIndices
(
const
LHCb
::
Particle
&
p
,
IndexContainer
&
veloindices
)
{
if
(
p
.
isBasicParticle
()
)
{
const
LHCb
::
ProtoParticle
*
proto
=
p
.
proto
();
if
(
proto
)
{
const
LHCb
::
Track
*
track
=
proto
->
track
();
if
(
track
)
{
// for the future, just use here index stored in track.
std
::
vector
<
LHCb
::
LHCbID
>
veloIDs
;
std
::
copy_if
(
track
->
lhcbIDs
().
begin
(),
track
->
lhcbIDs
().
end
(),
std
::
back_inserter
(
veloIDs
),
[](
const
auto
id
)
{
return
id
.
isVP
();
}
);
// now find the track. this will take for ever.
for
(
const
auto
&
pv_velotrack
:
pvtracks
)
{
auto
vtrack
=
pv_velotrack
.
veloTrack
();
if
(
veloIDs
==
vtrack
.
lhcbIDs
()
)
{
veloindices
.
emplace_back
(
pv_velotrack
.
offset
()
);
break
;
}
}
}
if
(
track
&&
track
->
lhcbIDs
().
size
()
>
0
)
{
veloindices
.
emplace_back
(
LHCb
::
Event
::
PV
::
uniqueVeloSegmentID
(
track
->
lhcbIDs
()
)
)
;
}
}
}
else
{
for
(
const
auto
&
dau
:
p
.
daughters
()
)
collectVeloIndices
(
*
dau
,
pvtracks
,
veloindices
);
for
(
const
auto
&
dau
:
p
.
daughters
()
)
collectVeloIndices
(
*
dau
,
veloindices
);
}
}
}
// namespace
boost
::
container
::
small_vector
<
int
,
16
>
LHCb
::
collectVeloSegmentIDs
(
const
LHCb
::
Particle
&
particle
,
const
LHCb
::
Event
::
PV
::
PrimaryVertexContainer
&
PVs
)
{
boost
::
container
::
small_vector
<
int
,
16
>
veloindices
;
collectVeloIndices
(
particle
,
PVs
.
tracks
.
scalar
(),
veloindices
);
boost
::
container
::
small_vector
<
u
int
32_t
,
16
>
LHCb
::
collectVeloSegmentIDs
(
const
LHCb
::
Particle
&
particle
)
{
boost
::
container
::
small_vector
<
u
int
32_t
,
16
>
veloindices
;
collectVeloIndices
(
particle
,
veloindices
);
return
veloindices
;
}
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