Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eicd
Manage
Activity
Members
Labels
Plan
Issues
13
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
EIC
eicd
Merge requests
!72
Simplify the data model to converge towards EDM4hep
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Simplify the data model to converge towards EDM4hep
simplify_interface
into
master
Overview
0
Commits
5
Pipelines
4
Changes
8
Merged
Sylvester Joosten
requested to merge
simplify_interface
into
master
3 years ago
Overview
0
Commits
5
Pipelines
4
Changes
8
Expand
Remove VectorPolar, Direction, FloatPair
Remove remaining overlapping datatypes in favor of includes from EDM4hep
Migrate away from using eic::Index in favor of explicit relations
Rework and simplify the calorimetry data model
Add utility helpers to streamline usage of EDM4hep vectors and EDM4hep interoperability
Use get/set syntax consistent with EDM4hep
Edited
3 years ago
by
Sylvester Joosten
👍
0
👎
0
Merge request reports
Compare
master
version 3
a4f6ba1d
3 years ago
version 2
fddf2923
3 years ago
version 1
784ae74c
3 years ago
master (base)
and
latest version
latest version
b3d67f74
5 commits,
3 years ago
version 3
a4f6ba1d
1 commit,
3 years ago
version 2
fddf2923
1 commit,
3 years ago
version 1
784ae74c
1 commit,
3 years ago
8 files
+
266
−
168
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
source/include/eicd/helpers.h deleted
100644 → 0
+
0
−
43
Options
#ifndef EICD_HELPERS_HH
#define EICD_HELPERS_HH
#include
<algorithm>
#include
<cmath>
#include
<exception>
#include
<limits>
#include
<string>
#include
<vector>
#include
<Math/Vector4D.h>
#include
"eicd/TrackParametersCollection.h"
#include
"eicd/ReconstructedParticleCollection.h"
#include
"eicd/ReconstructedParticleData.h"
namespace
eicd
::
helpers
{
/** Four momentum from track and mass.
* Get a vector of 4-momenta from raw tracking info, using an externally
* provided particle mass assumption.
*/
inline
auto
momenta_from_tracking
(
const
std
::
vector
<
eic
::
TrackParametersData
>&
tracks
,
const
double
mass
)
{
std
::
vector
<
ROOT
::
Math
::
PxPyPzMVector
>
momenta
{
tracks
.
size
()};
// transform our raw tracker info into proper 4-momenta
std
::
transform
(
tracks
.
begin
(),
tracks
.
end
(),
momenta
.
begin
(),
[
mass
](
const
auto
&
track
)
{
// make sure we don't divide by zero
if
(
fabs
(
track
.
qOverP
)
<
1e-9
)
{
return
ROOT
::
Math
::
PxPyPzMVector
{};
}
const
double
p
=
fabs
(
1.
/
track
.
qOverP
);
const
double
px
=
p
*
cos
(
track
.
phi
)
*
sin
(
track
.
theta
);
const
double
py
=
p
*
sin
(
track
.
phi
)
*
sin
(
track
.
theta
);
const
double
pz
=
p
*
cos
(
track
.
theta
);
return
ROOT
::
Math
::
PxPyPzMVector
{
px
,
py
,
pz
,
mass
};
});
return
momenta
;
}
}
// namespace eicd::helpers
#endif
Loading