Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
---
options :
# should getters / setters be prefixed with get / set?
getSyntax: False
# should POD members be exposed with getters/setters in classes that have them as members?
exposePODMembers: False
includeSubfolder: True
components:
dd4pod::VectorXYZ:
Members:
- double x // [mm] or [GeV]
- double y //
- double z //
ExtraCode:
includes: "#include <cmath>\n#include<tuple>"
declaration: "
VectorXYZ() : x{0}, y{0}, z{0} {}\n
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
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
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
"
dd4pod::MonteCarloContrib:
#Description: "Podio implementation of dd4hep's dd4hep::sim::MonteCarloContrib class"
#Author : "W.Armstrong"
Members:
- int32_t trackID // track id, -1 if none/invalid
- int32_t pdgID // PDG Particle ID code
- double deposit // energy deposit [GeV]
- double time // time [ns]
- double length // length [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{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
double phi() const {return atan2(y,x);}\n
double eta() const {return -log(tan(0.5*theta()));}
bool valid() const {return trackID >= 0;}\n
bool empty() const {return trackID < 0;}\n
"
datatypes :
dd4pod::Geant4Particle:
Description: "Podio implementation of dd4hep's dd4hep::sim::Geant4Particle class"
Author : "W.Armstrong"
Members:
- int32_t ID // unique identifier for this particle
- int32_t g4Parent // g4 parent particle
- int32_t reason // TODO document
- int32_t mask // TODO document
- int32_t steps // TODO document
- int32_t secondaries // TODO document
- int32_t pdgID // TODO document
- int32_t status // TODO document
- std::array<int,2> colorFlow // TODO document
- int32_t genStatus // Generator status code
- int32_t charge // Particle charge
- 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]
- dd4pod::VectorXYZ pe // 3-momentum at end vertex [GeV]
- double mass // particle mass [GeV]
- double time // start vertex time [ns]
- double properTime // proper time
VectorMembers:
- int32_t parents // parent IDs
- int32_t daughters // daughter IDs
ConstExtraCode :
declaration: "
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:
Description: "Podio implementation of a pmt hit "
Author : "W.Armstrong"
Members:
- int64_t cellID // cellID
- int32_t flag // User flag to classify hits
- int32_t g4ID // Original Geant4 track identifier of the creating track (for debugging)
- dd4pod::VectorXYZ position // hit position [mm]
- dd4pod::VectorXYZ momentum // 3-momentum [GeV]
- double length // length [mm]
- dd4pod::MonteCarloContrib truth // truth info
- double energy // photon energy [GeV]
dd4pod::TrackerHit:
Description: "Podio implementation of dd4hep's dd4hep::sim::Geant4Tracker::Hit class"
Author : "W.Armstrong"
Members:
- int64_t cellID // cellID
- int32_t flag // User flag to classify hits
- int32_t g4ID // Original Geant4 track identifier of the creating track (debugging)
- dd4pod::VectorXYZ position // position [mm]
- dd4pod::VectorXYZ momentum // 3-momentum [GeV]
- double length // length [mm]
- dd4pod::MonteCarloContrib truth // truth info
- double energyDeposit // energy deposit [GeV]
dd4pod::CalorimeterHit:
Description: "Podio implementation of dd4hep's dd4hep::sim::Geant4Calorimeter::Hit class"
Author : "W.Armstrong"
Members:
- int64_t cellID // cellID
- int32_t flag // User flag to classify hits
- int32_t g4ID // Original Geant4 track identifier of the creating track (debugging)
- dd4pod::VectorXYZ position // position [mm]
- dd4pod::MonteCarloContrib truth // truth-info
- double energyDeposit // energy deposit [GeV]