Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
eicd
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Commits
0ba3071c
Commit
0ba3071c
authored
3 years ago
by
Wouter Deconinck
Browse files
Options
Downloads
Patches
Plain Diff
VectorXYZT and LorentzVectorXYZT are different types
parent
268fc174
Branches
Branches containing commit
No related tags found
1 merge request
!58
Draft: Resolve "VectorXYZT::mag() may be confusing since not four-vector magnitude"
Pipeline
#23082
passed
3 years ago
Stage: config
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eic_data.yaml
+31
-4
31 additions, 4 deletions
eic_data.yaml
with
31 additions
and
4 deletions
eic_data.yaml
+
31
−
4
View file @
0ba3071c
...
@@ -183,16 +183,43 @@ components:
...
@@ -183,16 +183,43 @@ components:
double
theta()
const
{return
acos(z/mag());}
\n
double
theta()
const
{return
acos(z/mag());}
\n
double
phi()
const
{return
atan2(y,x);}
\n
double
phi()
const
{return
atan2(y,x);}
\n
double
eta()
const
{return
-log(tan(0.5*theta()));}
double
eta()
const
{return
-log(tan(0.5*theta()));}
double
energy()
const
{return
t;}
\n
double
mass2()
const
{return
t*t
-
x*x
-
y*y
-
z*z;}
\n
double
mass()
const
{return
sqrt(t*t
-
x*x
-
y*y
-
z*z);}
\n
operator
std::tuple<double,
double,
double,
double>()
{return
{x,
y,
z,
t};}
\n
operator
std::tuple<double,
double,
double,
double>()
{return
{x,
y,
z,
t};}
\n
double
dot(const
VectorXYZT&
rhs)
const
{return
t*rhs.t
-
x*rhs.x
-
y*rhs.y
-
z*rhs.z;}
\n
VectorXYZT
add(const
VectorXYZT&
rhs)
const
{return
{x+rhs.x,
y+rhs.y,
z+rhs.z,
t+rhs.t};}
\n
VectorXYZT
add(const
VectorXYZT&
rhs)
const
{return
{x+rhs.x,
y+rhs.y,
z+rhs.z,
t+rhs.t};}
\n
VectorXYZT
subtract(const
VectorXYZT&
rhs)
const
{return
{x-rhs.x,
y-rhs.y,
z-rhs.z,
t-rhs.t};}
\n
VectorXYZT
subtract(const
VectorXYZT&
rhs)
const
{return
{x-rhs.x,
y-rhs.y,
z-rhs.z,
t-rhs.t};}
\n
VectorXYZT
scale(double
f)
const
{return
{f*x,
f*y,
f*z,
f*t};}
\n
VectorXYZT
scale(double
f)
const
{return
{f*x,
f*y,
f*z,
f*t};}
\n
"
"
eic::LorentzVectorXYZT
:
Members
:
-
double x // [mm] or [GeV]
-
double y //
-
double z //
-
double t // [ns] or [GeV]
ExtraCode
:
includes
:
"
#include
<cmath>
\n
#include
<tuple>"
declaration
:
"
LorentzVectorXYZT()
:
x{0},
y{0},
z{0},
t{0}
{}
\n
LorentzVectorXYZT(double
xx,
double
yy,
double
zz,
double
tt)
:
x{xx},
y{yy},
z{zz},
t{tt}
{}
\n
template<class
VectorXYZType>
LorentzVectorXYZT(const
VectorXYZType&
v,
double
tt):
x{v.x()},
y{v.y()},
z{v.z()},
t{tt}
{}
\n
double&
operator[](unsigned
i)
{return
*(&x
+
i);}
\n
const
double&
operator[](unsigned
i)
const
{return
*(&x
+
i);}
\n
double
mag2()
const
{return
x*x
+
y*y
+
z*z
-
t*t;}
\n
double
mag()
const
{return
std::sqrt(mag2());}
\n
double
r()
const
{return
mag();}
\n
double
theta()
const
{return
acos(z/mag());}
\n
double
phi()
const
{return
atan2(y,x);}
\n
double
eta()
const
{return
-log(tan(0.5*theta()));}
double
energy()
const
{return
t;}
\n
double
mass2()
const
{return
t*t
-
x*x
-
y*y
-
z*z;}
\n
double
mass()
const
{return
sqrt(t*t
-
x*x
-
y*y
-
z*z);}
\n
operator
std::tuple<double,
double,
double,
double>()
{return
{x,
y,
z,
t};}
\n
double
dot(const
LorentzVectorXYZT&
rhs)
const
{return
t*rhs.t
-
x*rhs.x
-
y*rhs.y
-
z*rhs.z;}
\n
LorentzVectorXYZT
add(const
LorentzVectorXYZT&
rhs)
const
{return
{x+rhs.x,
y+rhs.y,
z+rhs.z,
t+rhs.t};}
\n
LorentzVectorXYZT
subtract(const
LorentzVectorXYZT&
rhs)
const
{return
{x-rhs.x,
y-rhs.y,
z-rhs.z,
t-rhs.t};}
\n
LorentzVectorXYZT
scale(double
f)
const
{return
{f*x,
f*y,
f*z,
f*t};}
\n
"
eic::CovDiagXYZ
:
eic::CovDiagXYZ
:
Members
:
Members
:
-
float xx
-
float xx
...
...
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