Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NPDet
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
Container registry
Model registry
Operate
Environments
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
NPDet
Commits
fb8dbb49
Commit
fb8dbb49
authored
3 years ago
by
Sylvester Joosten
Browse files
Options
Downloads
Patches
Plain Diff
Update to more closely mirror the DD4hep internal data structure
parent
d17efb7d
Branches
82-set-charge-by-pdg-id-in-hepmc-reader
Branches containing commit
No related tags found
4 merge requests
!273
Draft: Resolve "Support FastSim and GFlash"
,
!210
Draft: Resolve "Set charge by pdg ID in hepmc reader"
,
!209
Update to more closely mirror the DD4hep internal data structure
,
!197
Allow for multithreading in npsim
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dd4pod/dd4hep.yaml
+17
-17
17 additions, 17 deletions
src/dd4pod/dd4hep.yaml
with
17 additions
and
17 deletions
src/dd4pod/dd4hep.yaml
+
17
−
17
View file @
fb8dbb49
...
...
@@ -20,13 +20,13 @@ components:
VectorXYZ(double
xx,
double
yy,
double
zz)
:
x{xx},
y{yy},
z{zz}
{}
\n
double&
operator[](unsigned
i)
{return
*(&x
+
i);}
\n
const
double&
operator[](unsigned
i)
const
{return
*(&x
+
i);}
\n
doublemag()
const
{return
std::hypot(x,
y,
z);}
\n
doubler()
const
{return
mag();}
\n
doubletheta()
const
{return
acos(z/mag());}
\n
doublephi()
const
{return
atan2(y,x);}
\n
doubleeta()
const
{return
-log(tan(0.5*theta()));}
\n
double
mag()
const
{return
std::hypot(x,
y,
z);}
\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()));}
\n
operator
std::tuple<double,
double,
double>()
{return
{x,
y,
z};}
\n
doubledot(const
VectorXYZ&
rhs)
const
{return
x*rhs.x
+
y*rhs.y
+
z*rhs.z;}
\n
double
dot(const
VectorXYZ&
rhs)
const
{return
x*rhs.x
+
y*rhs.y
+
z*rhs.z;}
\n
VectorXYZ
add(const
VectorXYZ&
rhs)
const
{return
{x+rhs.x,
y+rhs.y,
z+rhs.z};}
\n
VectorXYZ
subtract(const
VectorXYZ&
rhs)
const
{return
{x-rhs.x,
y-rhs.y,
z-rhs.z};}
\n
VectorXYZ
scale(double
f)
const
{return
{f*x,
f*y,
f*z};}
\n
...
...
@@ -41,17 +41,17 @@ components:
-
double deposit // energy deposit [GeV]
-
double time // time [ns]
-
double length // length [mm]
-
double
x // x position [mm]
-
double
y // y position [mm]
-
double
z // z position [mm]
-
float
x // x position [mm]
-
float
y // y position [mm]
-
float
z // z position [mm]
ExtraCode
:
includes
:
"
#include
<cmath>"
declaration
:
"
MonteCarloContrib()
:
trackID{-1},
pdgID{0},
deposit{0},
time{0},
x{0},
y{0},
z{0}
{}
\n
MonteCarloContrib(int32_t
id,
int32_t
pdg,
double
e,
double
t,
\n
double
l,
double
xx,
double
yy,
double
zz)
\n
:
trackID{id},
pdgID{pdg},
deposit{e
)
},
time{t
)
},
length{l
)
}
\n
,
x{
xx)},
y{yy)},
z{
zz)}
{}
\n
:
trackID{id},
pdgID{pdg},
deposit{e},
time{t},
length{l}
\n
,
x{
static_cast<float>(xx)},
y{static_cast<float>(yy)},
z{static_cast<float>(
zz)}
{}
\n
double
mag()
const
{return
std::hypot(x,
y,
z);}
\n
double
r()
const
{return
mag();}
\n
double
theta()
const
{return
acos(z/mag());}
\n
...
...
@@ -78,8 +78,8 @@ datatypes :
-
std::array<int,2> colorFlow // TODO document
-
int32_t genStatus // Generator status code
-
int32_t charge // Particle charge
-
int32_t spare
//
TODO document, note, used to be array<int,1>
-
std::array<
double
,3> spin // Particle spin state
-
int32_t
_
spare //
extra int to have doubles properly aligned at 8 bytes
-
std::array<
float
,3> spin // Particle spin state
-
dd4pod::VectorXYZ vs // Start vertex [mm]
-
dd4pod::VectorXYZ ve // End vertex [mm]
-
dd4pod::VectorXYZ ps // 3-momentum at start vertex [GeV]
...
...
@@ -92,10 +92,10 @@ datatypes :
-
int32_t daughters // daughter IDs
ConstExtraCode
:
declaration
:
"
doublepx()
const
{return
ps().x;}
\n
doublepy()
const
{return
ps().y;}
\n
doublepz()
const
{return
ps().z;}
\n
doubleenergy()
const
{return
std::hypot(ps().mag(),
mass());}
double
px()
const
{return
ps().x;}
\n
double
py()
const
{return
ps().y;}
\n
double
pz()
const
{return
ps().z;}
\n
double
energy()
const
{return
std::hypot(ps().mag(),
mass());}
"
dd4pod::PhotoMultiplierHit
:
...
...
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