Skip to content
Snippets Groups Projects
Commit 0dd883c2 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

first pass done, ready for debugging (and comments)

parent b9cce0e7
No related branches found
No related tags found
1 merge request!33Draft: Streamline data model
Pipeline #14380 failed
...@@ -17,37 +17,73 @@ options: ...@@ -17,37 +17,73 @@ options:
## - Data alignment: data should be aligned with a 64-bit structure. ## - Data alignment: data should be aligned with a 64-bit structure.
## Make sure 32 bit values (eg int32_t) come either in pairs, or are ## Make sure 32 bit values (eg int32_t) come either in pairs, or are
## located at the end of the structure ## located at the end of the structure
## - Indices are stored as signed integers, where -1 significes "no index" ## - Indices are stored as signed integers, where -1 significes "no index". This is
## automatically provided by the eic::Index component, with good defaults
## - Provide explicit copy/assignment instructors from the Const... classes, as ## - Provide explicit copy/assignment instructors from the Const... classes, as
## doing this here will avoid errors in the algorithms. ## doing this here will avoid errors in the algorithms.
## - Explicitly specify the integer length (use the typedefs from <cstdint>,
## such as int32_t etc)
components: components:
## first-second or first-last pair of integers ## simple numerical index, but with good automatic default values
eic::IntegerPair: eic::Index:
Members:
- int32_t value
ExtraCode:
declaration: "
Index() : value{-1} {}\n
Index(int32_t idx) : value {idx} {}\n
Index& operator=(int32_t idx) {value = idx; return *this;}\n
Index(const ConstIndex& cv) : value{cv.value()} {}\n
Index& operator=(const ConstIndex& cv) {value = cv.value(); return *this;}\n
operator int32_t() const {return value;}\n
bool valid() const {return value >= 0;}
bool empty() const {return value < 0;}
"
ConstExtraCode:
declaration: "
ConstIndex() : value{-1} {}\n
ConstIndex(int32_t idx) : value {idx} {}\n
operator int32_t() const {return value;}\n
bool valid() const {return value >= 0;}
bool empty() const {return value < 0;}
"
## first-second or first-last Index pair
eic::IndexPair:
Members: Members:
- int32_t first - int32_t first
- int32_t second - int32_t second
ExtraCode: ExtraCode:
includes: "#include <span>\n#include <cmath>\n#include <pair>" includes: "#include <span>\n#include <pair>"
declaration: " declaration: "
IntegerPair() : first{0}, second{0} {}\n IndexPair() : first{-1}, second{-1} {}\n
IntegerPair(int32_t a, int32_t b) : first{a}, second{b} {}\n IndexPair(int32_t a) : first{a}, second{-1} {}\n
IntegerPair(std::span<int32_t> v) : first{v[0]}, second{v[1]} {}\n IndexPair operator=(int32_t a) {first = a; second = -1; return *this;}
IntegerPair& operator=(std::span<int32_t> v) {first=v[0]; second=v[1]; return *this;}\n IndexPair(int32_t a, int32_t b) : first{a}, second{b} {}\n
IntegerPair(const std::pair<int32_t, int32_t>& p) : first{p.first}, second{p.second} {}\n IndexPair(std::span<int32_t> v) : first{v[0]}, second{v[1]} {}\n
IntegerPair& operator=(const std::pair<int32_t, int32_t>& p) {first = p.first; second = p.second; return *this;}\n IndexPair& operator=(std::span<int32_t> v) {first=v[0]; second=v[1]; return *this;}\n
explicit IntegerPair(const ConstIntegerPair& cv) : first{cv.first()}, second{cv.second()}} {}\n IndexPair(const std::pair<int32_t, int32_t>& p) : first{p.first}, second{p.second} {}\n
IntegerPair& operator=(const ConstIntegerPair& cv) {first = cv.first(); second = cv.second(); return *this;}\n IndexPair& operator=(const std::pair<int32_t, int32_t>& p) {first = p.first; second = p.second; return *this;}\n
explicit IndexPair(const ConstIndexPair& cv) : first{cv.first()}, second{cv.second()}} {}\n
IndexPair& operator=(const ConstIndexPair& cv) {first = cv.first(); second = cv.second(); return *this;}\n
int32_t operator[](unsigned i) const { return *(&first + i); }\n int32_t operator[](unsigned i) const { return *(&first + i); }\n
int32_t last() const {return second;}\n int32_t last() const {return second;}\n
int32_t last(int32_t b) {second = b; return second;}\n int32_t last(int32_t b) {second = b; return second;}\n
operator std::pair<int32_t>() const {return {first, second};}
bool valid() const {return first >= 0;}
bool empty() const {return first < 0;}
bool single() const {return !empty() && second < 0;}
" "
ConstExtraCode: ConstExtraCode:
includes: "#include <cmath>"
declaration: " declaration: "
int32_t operator[](unsigned i) const { return *(&first + i); }\n int32_t operator[](unsigned i) const { return *(&first + i); }\n
int32_t last() const {return second;}\n int32_t last() const {return second;}\n
operator std::pair<int32_t>() const {return {first, second};}
bool valid() const {return first >= 0;}
bool empty() const {return first < 0;}
bool single() const {return !empty() && second < 0;}
" "
## first-second pair of float s ## first-second pair of float s
...@@ -56,7 +92,7 @@ components: ...@@ -56,7 +92,7 @@ components:
- float first - float first
- float second - float second
ExtraCode: ExtraCode:
includes: "#include <span>\n#include <cmath>\n#include <pair>" includes: "#include <span>\n#include <pair>"
declaration: " declaration: "
FloatPair() : first{0}, second{0} {}\n FloatPair() : first{0}, second{0} {}\n
FloatPair(float a, float b) : first{a}, second{b} {}\n FloatPair(float a, float b) : first{a}, second{b} {}\n
...@@ -68,11 +104,13 @@ components: ...@@ -68,11 +104,13 @@ components:
explicit FloatPair(const ConstFloatPair& cv) : first{cv.first()}, second{cv.second()}} {}\n explicit FloatPair(const ConstFloatPair& cv) : first{cv.first()}, second{cv.second()}} {}\n
FloatPair& operator=(const ConstFloatPair& cv) {first = cv.first(); second = cv.second(); return *this}\n FloatPair& operator=(const ConstFloatPair& cv) {first = cv.first(); second = cv.second(); return *this}\n
float operator[](unsigned i) const { return *(&first + i); }\n float operator[](unsigned i) const { return *(&first + i); }\n
operator std::pair<float, float>() const {return {first, second};}
" "
ConstExtraCode: ConstExtraCode:
includes: "#include <cmath>" includes: "#include <cmath>"
declaration: " declaration: "
float operator[](unsigned i) const { return *(&first + i); }\n float operator[](unsigned i) const { return *(&first + i); }\n
operator std::pair<float, float>() const {return {first, second};}
" "
eic::VectorXY: eic::VectorXY:
...@@ -94,6 +132,7 @@ components: ...@@ -94,6 +132,7 @@ components:
float py() const {return y();}\n float py() const {return y();}\n
float px(float xx) {x = xx; return x;}\n float px(float xx) {x = xx; return x;}\n
float py(float yy) {y = yy; return y;}\n float py(float yy) {y = yy; return y;}\n
operator std::pair<float, float>() const {return {first, second};}
" "
ConstExtraCode: ConstExtraCode:
includes: "#include <cmath>" includes: "#include <cmath>"
...@@ -102,19 +141,25 @@ components: ...@@ -102,19 +141,25 @@ components:
float mag() const {return std::hypot(x, y);}\n float mag() const {return std::hypot(x, y);}\n
float px() const {return x();}\n float px() const {return x();}\n
float py() const {return y();}\n float py() const {return y();}\n
operator std::pair<float, float>() const {return {first, second};}
" "
eic::Direction: eic::Direction:
Members: Members:
- float theta // [rad] - float theta // [rad]
- float phi // - float phi //
ExtraCode: ExtraCode:
includes: "#include <cmath>" includes: "#include <cmath>\n#include <pair>"
declaration: " declaration: "
Direction() : theta{0}, phi{0} {}\n Direction() : theta{0}, phi{0} {}\n
Direction(float th, float ph) : theta{th}, phi{ph} {}\n Direction(float th, float ph) : theta{th}, phi{ph} {}\n
Direction(float x, float y, float z) : theta{return acos(z/std::hypot(x,y,z))}, phi{atan2(y,x)} {}\n Direction(float x, float y, float z) : theta{return acos(z/std::hypot(x,y,z))}, phi{atan2(y,x)} {}\n
explicit Direction(const ConstDirection& cv) : theta{cv.theta()}, phi{cv.phi()}} {}\n explicit Direction(const ConstDirection& cv) : theta{cv.theta()}, phi{cv.phi()}} {}\n
Direction& operator=(const ConstDirection& cv) {theta = cv.theta(); phi = cv.phi(); return *this;}\n Direction& operator=(const ConstDirection& cv) {theta = cv.theta(); phi = cv.phi(); return *this;}\n
operator std::pair<float, float>() const {return {first, second};}
"
ConstExtraCode:
declaration: "
operator std::pair<float, float>() const {return {first, second};}
" "
eic::VectorXYZ: eic::VectorXYZ:
...@@ -123,7 +168,7 @@ components: ...@@ -123,7 +168,7 @@ components:
- float y // - float y //
- float z // - float z //
ExtraCode: ExtraCode:
includes: "#include <span>\n#include <cmath>\n" includes: "#include <span>\n#include <cmath>\n#include<tuple>"
declaration: " declaration: "
VectorXYZ() : x{0}, y{0}, z{0} {}\n VectorXYZ() : x{0}, y{0}, z{0} {}\n
VectorXYZ(float xx, float yy, float zz) : x{xx}, y{yy}, z{zz} {}\n VectorXYZ(float xx, float yy, float zz) : x{xx}, y{yy}, z{zz} {}\n
...@@ -139,8 +184,10 @@ components: ...@@ -139,8 +184,10 @@ components:
float px() const {return x();}\n float px() const {return x();}\n
float py() const {return y();}\n float py() const {return y();}\n
float pz() const {return z();}\n float pz() const {return z();}\n
operator std::tuple<float, float, float>() {return {x, y, z};}
" "
ConstExtraCode: ConstExtraCode:
includes: "#include <tuple>"
declaration: " declaration: "
float operator[](unsigned i) const { return *(&x + i); }\n float operator[](unsigned i) const { return *(&x + i); }\n
float mag() const {return std::hypot(x, y, z);}\n float mag() const {return std::hypot(x, y, z);}\n
...@@ -150,6 +197,7 @@ components: ...@@ -150,6 +197,7 @@ components:
float px() const {return x();}\n float px() const {return x();}\n
float py() const {return y();}\n float py() const {return y();}\n
float pz() const {return z();}\n float pz() const {return z();}\n
operator std::tuple<float, float, float>() {return {x, y, z};}
" "
eic::VectorPolar: eic::VectorPolar:
Members: Members:
...@@ -157,7 +205,7 @@ components: ...@@ -157,7 +205,7 @@ components:
- float theta // [rad] - float theta // [rad]
- float phi // - float phi //
ExtraCode: ExtraCode:
includes: "#include <span>\n#include <cmath>\n" includes: "#include <span>\n#include <cmath>\n#include<tuple>"
declaration: " declaration: "
VectorPolar() : x{0}, theta{0}, phi{0} {}\n VectorPolar() : x{0}, theta{0}, phi{0} {}\n
VectorPolar(float rr, float th, float ph) : r{rr}, theta{th}, phi{ph} {}\n VectorPolar(float rr, float th, float ph) : r{rr}, theta{th}, phi{ph} {}\n
...@@ -170,9 +218,10 @@ components: ...@@ -170,9 +218,10 @@ components:
float px() const {return x();}\n float px() const {return x();}\n
float py() const {return y();}\n float py() const {return y();}\n
float pz() const {return z();}\n float pz() const {return z();}\n
operator std::tuple<float, float, float>() {return {r, theta, phi};}
" "
ConstExtraCode: ConstExtraCode:
includes: "#include <span>\n#include <cmath>\n" includes: "#include <span>\n#include <cmath>\n#include<tuple>"
declaration: " declaration: "
float mag() const {return r;}\n float mag() const {return r;}\n
float x() const {return r * cos(phi) * sin(theta);}\n float x() const {return r * cos(phi) * sin(theta);}\n
...@@ -181,6 +230,7 @@ components: ...@@ -181,6 +230,7 @@ components:
float px() const {return x();}\n float px() const {return x();}\n
float py() const {return y();}\n float py() const {return y();}\n
float pz() const {return z();}\n float pz() const {return z();}\n
operator std::tuple<float, float, float>() {return {r, theta, phi};}
" "
eic::VectorXYZT: eic::VectorXYZT:
...@@ -190,7 +240,7 @@ components: ...@@ -190,7 +240,7 @@ components:
- double z // - double z //
- double t // [ns] or [GeV] - double t // [ns] or [GeV]
ExtraCode: ExtraCode:
includes: "#include <span>\n#include <cmath>\n" includes: "#include <span>\n#include <cmath>\n#include <tuple>"
declaration: " declaration: "
VectorXYZT() : x{0}, y{0}, z{0}, t{0] {}\n VectorXYZT() : x{0}, y{0}, z{0}, t{0] {}\n
VectorXYZT(double xx, double yy, double zz, double tt) : x{xx}, y{yy}, z{zz}, t{tt} {}\n VectorXYZT(double xx, double yy, double zz, double tt) : x{xx}, y{yy}, z{zz}, t{tt} {}\n
...@@ -212,9 +262,10 @@ components: ...@@ -212,9 +262,10 @@ components:
double py(py) { y = py; return y;}\n double py(py) { y = py; return y;}\n
double pz(pz) { z = pz; return z;}\n double pz(pz) { z = pz; return z;}\n
double energy(E) {t = E; return t;}\n double energy(E) {t = E; return t;}\n
operator std::tuple<double, double, double>() {return {x, y, z, t};}
" "
ConstExtraCode: ConstExtraCode:
includes: "#include <cmath>\n" includes: "#include <cmath>\n#include <tuple>"
declaration: " declaration: "
double operator[](unsigned i) const { return *(&x + i); }\n double operator[](unsigned i) const { return *(&x + i); }\n
double mag() const {return std::hypot(x, y, z);}\n double mag() const {return std::hypot(x, y, z);}\n
...@@ -226,6 +277,7 @@ components: ...@@ -226,6 +277,7 @@ components:
double py() const {return y;}\n double py() const {return y;}\n
double pz() const {return z;}\n double pz() const {return z;}\n
double energy() const {return t;}\n double energy() const {return t;}\n
operator std::tuple<double, double, double, double>() {return {x, y, z, t};}
" "
eic::VectorPxPyPzM: eic::VectorPxPyPzM:
Members: Members:
...@@ -234,7 +286,7 @@ components: ...@@ -234,7 +286,7 @@ components:
- double z // - double z //
- double m // - double m //
ExtraCode: ExtraCode:
includes: "#include <span>\n#include <cmath>\n" includes: "#include <span>\n#include <cmath>\n#include <tuple>"
declaration: " declaration: "
VectorPxPyPzM() : x{0}, y{0}, z{0}, m{0] {}\n VectorPxPyPzM() : x{0}, y{0}, z{0}, m{0] {}\n
VectorPxPyPzM(double xx, double yy, double zz, double mm) : x{xx}, y{yy}, z{zz}, m{mm} {}\n VectorPxPyPzM(double xx, double yy, double zz, double mm) : x{xx}, y{yy}, z{zz}, m{mm} {}\n
...@@ -255,9 +307,10 @@ components: ...@@ -255,9 +307,10 @@ components:
double px(px) { x = px;}\n double px(px) { x = px;}\n
double py(py) { y = py;}\n double py(py) { y = py;}\n
double pz(pz) { z = pz;}\n double pz(pz) { z = pz;}\n
operator std::tuple<double, double, double, double>() {return {x, y, z, m};}
" "
ConstExtraCode: ConstExtraCode:
includes: "#include <cmath>" includes: "#include <cmath>\n#include <tuple>"
declaration: " declaration: "
double operator[](unsigned i) const { return *(&x + i); }\n double operator[](unsigned i) const { return *(&x + i); }\n
double mag() const {return std::hypot(x, y, z);}\n double mag() const {return std::hypot(x, y, z);}\n
...@@ -269,6 +322,7 @@ components: ...@@ -269,6 +322,7 @@ components:
double pz() const {return z;}\n double pz() const {return z;}\n
double energy() const {return sqrt(x*x + y*y + z*z + m*m);}\n double energy() const {return sqrt(x*x + y*y + z*z + m*m);}\n
double mass() const {return m;}\n double mass() const {return m;}\n
operator std::tuple<double, double, double, double>() {return {x, y, z, m};}
" "
eic::CovDiagXYZ: eic::CovDiagXYZ:
...@@ -363,14 +417,18 @@ datatypes: ...@@ -363,14 +417,18 @@ datatypes:
Description: "Basic Particle used for reconstructed and generated particles" Description: "Basic Particle used for reconstructed and generated particles"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- eic::VectorPxPyPzM p // Four momentum [GeV] - eic::Index ID // Unique particle index
- eic::VectorXYZT v // vertex [mm, ns]. - int32_t charge // Particle charge (or sign)
- int32_t pid // Particle type identification code - eic::VectorXYZ p // momentum [GeV]
- eic::VectorXYZ v // vertex [mm]
- float time // Time in [ns]
- int32_t status // Status code - int32_t status // Status code
ExtraCode: ExtraCode:
declaration: " declaration: "
explicit Particle(const ConstParticle& cv) : p{cv.p()}, v{cv.v()}, pid{cv.pid()}, status{cv.status()} {}\n explicit Particle(const ConstParticle& cv)
Particle& operator=(const ConstParticle& cv) {p = cv.p(); v = cv.v(); pid = cv.pid(); status = cv.status();return *this;}\n : ID{cv.ID()}, charge{cv.charge()}, p{cv.p()}, v{cv.v()}, time{cv.time()}, status{cv.status()} {}\n
Particle& operator=(const ConstParticle& cv) {
ID = cv.ID; charge = cv.charge(); p = cv.p(); v = cv.v(); time = cv.time(); status = cv.status(); return *this;}\n
" "
## NOTE: this class seems to be unused right now? ## NOTE: this class seems to be unused right now?
...@@ -378,15 +436,15 @@ datatypes: ...@@ -378,15 +436,15 @@ datatypes:
Description: "EIC MC Particle" Description: "EIC MC Particle"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- int32_t ID // Unique particle index - eic::Index ID // Unique particle index
- int32_t pid // The PDG code of the particle. - int32_t pid // The PDG code of the particle.
- int32_t status // The status for particles as defined by the generator. - int32_t status // The status for particles as defined by the generator.
- float charge // The particle's charge. - int32_t charge // The particle's charge.
- eic::VectorPxPyPzM p // The particle's 4-momentum at the production vertex in [GeV] - eic::VectorPxPyPzM p // The particle's 4-momentum at the production vertex in [GeV]
- eic::VectorXYZT v // The production vertex and time of the particle in [mm, ns]. - eic::VectorXYZT v // The production vertex and time of the particle in [mm, ns].
- eic::VectorXYZ endpoint // The endpoint of the particle in [mm] - eic::VectorXYZ endpoint // The endpoint of the particle in [mm]
- eic::IntegerPair parentIDs // IDs of the first and second parent, or -1 - eic::IndexPair parentIDs // IDs of the first and second parent, or -1
- eic::IntegerPair childIDs // IDs of the first and last children, or -1 - eic::IndexPair childIDs // IDs of the first and last children, or -1
- bool endpointSet // Whether the endpoint has been set - bool endpointSet // Whether the endpoint has been set
ExtraCode: ExtraCode:
declaration: " declaration: "
...@@ -409,53 +467,50 @@ datatypes: ...@@ -409,53 +467,50 @@ datatypes:
Description: "EIC Reconstructed Particle" Description: "EIC Reconstructed Particle"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- int32_t ID // Unique particle index - eic::Index ID // Unique particle index
- int32_t charge // Particle charge (or sign)
- eic::VectorXYZ p // momentum [GeV]
- eic::VectorXYZ v // vertex [mm]
- float time // Time in [ns]
- int32_t status // Status code
- int32_t pid // PID of reconstructed particle. - int32_t pid // PID of reconstructed particle.
- eic::VectorXYZ p // three momentum [GeV], from tracking or calorimetry
- eic::VexterXYZ v // vertex position of the reconstructed particle [mm]
- float energy // Energy (from calorimetery) of the particle [GeV] - float energy // Energy (from calorimetery) of the particle [GeV]
- float mass // The mass of the particle in [GeV] - float mass // The mass of the particle in [GeV]
- float time // Vertex time [ns] - eic::Index parentID // Parent particle reconstructed from this particle, -1 if none
- float charge // The particle's charge [e] - eic::Index vertexID // Start vertex ID for this particle
- int32_t parentID // Parent particle reconstructed from this particle, -1 if none
- int32_t vertexID // Start vertex for this particle
ExtraCode: ExtraCode:
declaration: " declaration: "
explicit ReconstructedParticle(const ConstReconstructedParticle& cv) explicit ReconstructedParticle(const ConstReconstructedParticle& cv)
: ID{cv.ID()}, pid{cv.pid()}, p{cv.p()}, v{cv.v()}, energy{cv.energy()}, mass{cv.mass()}, time{cv.time()} : ID{cv.ID()}, charge{cv.charge()}, p{cv.p()}, v{cv.v()}, time{cv.time()}, status{cv.status()}
, charge{cv.charge()}, parentID{cv.parentID()}, vertexID{cv.vertexID()} {}\n , pid{cv.pid()}, energy{cv.energy()}, mass{cv.mass()}, parentID{cv.parentID()}, vertexID{cv.vertexID()} {}\n
ReconstructedParticle& operator=(const ConstReconstructedParticle& cv) { ReconstructedParticle& operator=(const ConstReconstructedParticle& cv) {
ID = cv.ID(); pid = cv.pid(); p = cv.p(); v = cv.v(); energy = cv.energy(); mass = cv.mass(); time = cv.time(); ID = cv.ID; charge = cv.charge(); p = cv.p(); v = cv.v(); time = cv.time(); status = cv.status();
charge = cv.charge(); parentID = cv.parentID(); vertexID = cv.vertexID(); return *this;}\n pid = cv.pid(); energy = cv.energy(); mass = cv.mass(); parentID = cv.parentID();
bool has_parent() const {return parentID >= 0;} vertexID = cv.vertexID(); return *this;}\n
"
ConstExtraCode:
declaration: "
bool has_parent() const {return parentID >= 0;}
" "
eic::RawCalorimeterHit: eic::RawCalorimeterHit:
Description: "Raw (digitized) calorimeter hit" Description: "Raw (digitized) calorimeter hit"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- int64_t ID // unique ID for this hit
- int64_t cellID // The detector specific (geometrical) cell id. - int64_t cellID // The detector specific (geometrical) cell id.
- int64_t amplitude // The amplitude of the hit in ADC counts. - int64_t amplitude // The amplitude of the hit in ADC counts.
- eic::Index ID // unique ID for this hit
ExtraCode: ExtraCode:
declaration: " declaration: "
explicit RawCalorimeterHit(const ConstRawCalorimeterHit& cv) : ID{cv.ID()}, cellID{cv.cellID()}, amplitude{cv.amplitude()} {}\n explicit RawCalorimeterHit(const ConstRawCalorimeterHit& cv) : cellID{cv.cellID()}, amplitude{cv.amplitude()}, ID{cv.ID()} {}\n
RawCalorimeterHit& operator=(const ConstRawCalorimeterHit& cv) {ID = cv.ID(); cellID = cv.cellID(); amplitude = cv.amplitude();return *this;}\n RawCalorimeterHit& operator=(const ConstRawCalorimeterHit& cv) {cellID = cv.cellID(); amplitude = cv.amplitude(); ID = cv.ID(); return *this;}\n
" "
eic::CalorimeterHit: eic::CalorimeterHit:
Description: "Calorimeter hit" Description: "Calorimeter hit"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- int64_t ID // unique ID for this hit
- int64_t cellID // The detector specific (geometrical) cell id. - int64_t cellID // The detector specific (geometrical) cell id.
- int32_t layerID // ID of the layer that has this hit (-1 if none) - eic::Index ID // unique ID for this hit
- int32_t sectorID // ID of the sector that has this hit (-1 if none) - eic::Index layerID // ID of the layer that has this hit (-1 if none)
- int32_t clusterID // ID of the cluster associated with this hit (-1 if none) - eic::Index sectorID // ID of the sector that has this hit (-1 if none)
- eic::Index clusterID // ID of the cluster associated with this hit (-1 if none)
- int32_t type // The type of the hit. - int32_t type // The type of the hit.
- float energy // The energy of the hit in [GeV]. - float energy // The energy of the hit in [GeV].
- float time // The time of the hit in [ns]. - float time // The time of the hit in [ns].
...@@ -465,11 +520,11 @@ datatypes: ...@@ -465,11 +520,11 @@ datatypes:
ExtraCode: ExtraCode:
declaration: " declaration: "
explicit CalorimeterHit(const ConstCalorimeterHit& cv) explicit CalorimeterHit(const ConstCalorimeterHit& cv)
: ID{cv.ID()}, cellID{cv.cellID()}, layerID{cv.layerID()}, sectorID{cv.sectorID()}, clusterID{cv.clusterID()} : cellID{cv.cellID()}, ID{cv.ID()}, layerID{cv.layerID()}, sectorID{cv.sectorID()}, clusterID{cv.clusterID()}
, type{cv.type()}, energy{cv.energy()}, time{cv.time()}, position{cv.position()}, local{cv.local()} , type{cv.type()}, energy{cv.energy()}, time{cv.time()}, position{cv.position()}, local{cv.local()}
, dimension{cv.dimension()} {}\n , dimension{cv.dimension()} {}\n
CalorimeterHit& operator=(const ConstCalorimeterHit& cv) { CalorimeterHit& operator=(const ConstCalorimeterHit& cv) {
ID = cv.ID(); cellID = cv.cellID(); layerID = cv.layerID(); sectorID = cv.sectorID(); clusterID = cv.clusterID(); cellID = cv.cellID(); ID = cv.ID(); layerID = cv.layerID(); sectorID = cv.sectorID(); clusterID = cv.clusterID();
type = cv.type(); energy = cv.energy(); time = cv.time(); position = cv.position(); local = cv.local(); type = cv.type(); energy = cv.energy(); time = cv.time(); position = cv.position(); local = cv.local();
dimension = cv.dimension();}\n dimension = cv.dimension();}\n
" "
...@@ -478,94 +533,84 @@ datatypes: ...@@ -478,94 +533,84 @@ datatypes:
Description: "Raw (digitized) tracker hit" Description: "Raw (digitized) tracker hit"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- int64_t ID // unique ID for this hit
- int64_t cellID // The detector specific (geometrical) cell id. - int64_t cellID // The detector specific (geometrical) cell id.
- eic::Index ID // unique ID for this hit
- int32_t time // tdc value. - int32_t time // tdc value.
- int32_t charge // adc value - int32_t charge // adc value
ExtraCode: ExtraCode:
declaration: " declaration: "
explicit RawTrackerHit(const ConstRawTrackerHit& cv) : ID{cv.ID()}, cellID{cv.cellID()}, time{cv.time()}, charge{cv.charge()} {}\n explicit RawTrackerHit(const ConstRawTrackerHit& cv) : cellID{cv.cellID()}, ID{cv.ID()}, time{cv.time()}, charge{cv.charge()} {}\n
RawTrackerHit& operator=(const ConstRawTrackerHit& cv) {ID = cv.ID(); cellID = cv.cellID(); time = cv.time(); charge = cv.charge(); return *this;}\n RawTrackerHit& operator=(const ConstRawTrackerHit& cv) {cellID = cv.cellID(); ID = cv.ID(); time = cv.time(); charge = cv.charge(); return *this;}\n
" "
eic::TrackerHit: eic::TrackerHit:
Description: "Tracker hit (reconstructed from Raw)" Description: "Tracker hit (reconstructed from Raw)"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- int64_t ID // unique ID for this hit
- int64_t cellID // The detector specific (geometrical) cell id. - int64_t cellID // The detector specific (geometrical) cell id.
- int32_t clusterID // Associated cluster ID if applicable (-1 if not set) - eic::Index ID // unique ID for this hit
- eic::Index clusterID // Associated cluster ID if applicable (-1 if not set)
- float time // The time of the hit. [ns] - float time // The time of the hit. [ns]
- float edep // Energy deposit in this hit [GeV] - float edep // Energy deposit in this hit [GeV]
- float edepError // Error on the energy deposit [GeV] - float edepError // Error on the energy deposit [GeV]
- eic::VectorXYZ position // Hit (cell) position [mm] - eic::VectorXYZ position // Hit (cell) position [mm]
- eic::CovDiagXYZ covMatrix // Covariance Matrix - eic::CovDiagXYZ covMatrix // Covariance Matrix
- int32_t trackID // ID of associated track (-1 if not set) - eic::Index trackID // ID of associated track (-1 if not set)
ExtraCode: ExtraCode:
declaration: " declaration: "
explicit TrackerHit(const ConstTrackerHit& cv) explicit TrackerHit(const ConstTrackerHit& cv)
: ID{cv.ID()}, cellID{cv.cellID()}, clusterID{cv.clusterID()} : cellID{cv.cellID()}, ID{cv.ID()}, clusterID{cv.clusterID()}
, time{cv.time()}, EDep{cv.EDep()}, EDepError{cv.EDepError()} , time{cv.time()}, EDep{cv.EDep()}, EDepError{cv.EDepError()}
, position{cv.position()}, covMatrix{cv.covMatrix()} {} \n , position{cv.position()}, covMatrix{cv.covMatrix()} {} \n
TrackerHit& operator=(const ConstTrackerHit& cv) { TrackerHit& operator=(const ConstTrackerHit& cv) {
ID = cv.ID(); cellID = cv.cellID(); cellID = cv.cellID(); ID = cv.ID();
time = cv.time(); EDep = cv.EDep(); EDepError = cv.EDepError(); time = cv.time(); EDep = cv.EDep(); EDepError = cv.EDepError();
position = cv.position(); covMatrix = cv.covMatrix(); return *this;}\n position = cv.position(); covMatrix = cv.covMatrix(); return *this;}\n
bool has_track() const {return trackID >= 0;}
"
ConstExtraCode:
declaration: "
bool has_track() const {return trackID >= 0;}
" "
eic::Cluster: eic::Cluster:
Description: "EIC cluster" Description: "EIC cluster"
Author: "W. Armstrong, S. Joosten, C.Peng" Author: "W. Armstrong, S. Joosten, C.Peng"
Members: Members:
- int32_t ID // unique ID for this cluster - eic::Index ID // unique ID for this cluster
- float energy // Reconstructed energy of the cluster [GeV]. - float energy // Reconstructed energy of the cluster [GeV].
- float edep // Energy deposit of the cluster [GeV]. - float edep // Energy deposit of the cluster [GeV].
- uint32_t nhits // Number of hits in the cluster. - uint32_t nhits // Number of hits in the cluster.
- eic::VectorXYZ position // Global position of the cluster [mm]. - eic::VectorXYZ position // Global position of the cluster [mm].
- eic::CovXYZ positionError // Covariance matrix of the position (6 Parameters). - eic::CovXYZ positionError // Covariance matrix of the position (6 Parameters).
- eic::VectorPolar polar // Polar coordinates for global position.
- eic::Direction direction // Intrinsic direction of the cluster at the central position [rad] - eic::Direction direction // Intrinsic direction of the cluster at the central position [rad]
- int32_t recID // ID of the reconstructed particle associated with this cluster, or -1 if none - eic::Index recID // ID of the reconstructed particle associated with this cluster, or -1 if none
# TODO: determine if polar is really needed, as we also access the spherical
# coordinates through the position XYZ member functions
#- eic::VectorPolar polar // Polar coordinates for global position.
ExtraCode: ExtraCode:
declaration: " declaration: "
explicit Cluster(const ConstCluster& cv) explicit Cluster(const ConstCluster& cv)
: ID{cv.ID()}, energy{cv.energy()}, edep{cv.edep()}, nhits{cv.nhits()} : ID{cv.ID()}, energy{cv.energy()}, edep{cv.edep()}, nhits{cv.nhits()}
, position{cv.position()}, positionError{cv.positionError()}, direction{cv.direction()} {}\n , position{cv.position()}, positionError{cv.positionError()}, polar{cv.polar()}, direction{cv.direction()} {}\n
Cluster& operator=(const ConstCluster& cv) { Cluster& operator=(const ConstCluster& cv) {
ID = cv.ID(); energy = cv.energy(); edep = cv.edep(); nhits = cv.nhits(); ID = cv.ID(); energy = cv.energy(); edep = cv.edep(); nhits = cv.nhits();
position = cv.position(); positionError = cv.positionError(); direction = cv.direction(); return *this;}\n position = cv.position(); positionError = cv.positionError(); polar = cv.polar(); direction = cv.direction(); return *this;}\n
bool has_reconstructedParticle() const {return recID >= 0;}
"
ConstExtraCode:
declaration: "
bool has_reconstructedParticle() const {return recID >= 0;}
" "
eic::TrackParameters: eic::TrackParameters:
Description: "ACTS Track parameters" Description: "ACTS Track parameters"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- eic::Index ID // unique ID for this track
- eic::FloatPair loc // tracking location - eic::FloatPair loc // tracking location
- eic::FloatPair locError // error on the location - eic::FloatPair locError // error on the location
- eic::Direction direction // track direction (theta, phi) [rad] - eic::Direction direction // track direction (theta, phi) [rad]
- eic::Direction directionError // error on the direction [rad] - eic::Direction directionError // error on the direction [rad]
- float qOverP // [e/GeV] - float qOverP // [e/GeV]
- float time // track time [ns] - float time // track time [ns]
- eic::Index recID // associated reconstructed particle, or -1 if not set
ExtraCode: ExtraCode:
declaration: " declaration: "
explicit TrackParameters(const ConstTrackParameters& cv) explicit TrackParameters(const ConstTrackParameters& cv)
: loc{cv.loc()}, locError{cv.locError()}, direction{cv.direction()}, directionError{cv.directionError} : loc{cv.loc()}, locError{cv.locError()}, direction{cv.direction()}, directionError{cv.directionError}
, qOverP{cv.qOverP()}, time{cv.time()} {}\n , qOverP{cv.qOverP()}, time{cv.time()}, recID{cv.recID()} {}\n
TrackParameters& operator=(const ConstTrackParameters& cv) { TrackParameters& operator=(const ConstTrackParameters& cv) {
loc = cv.loc(); locError = cv.locError(); direction = cv.direction(); directionError = cv.directionError loc = cv.loc(); locError = cv.locError(); direction = cv.direction(); directionError = cv.directionError
qOverP = cv.qOverP(); time = cv.time(); return *this'}\n qOverP = cv.qOverP(); time = cv.time(); recID = cv.recID(); return *this'}\n
" "
# TODO: needed? currently not used in Juggler # TODO: needed? currently not used in Juggler
...@@ -604,79 +649,135 @@ datatypes: ...@@ -604,79 +649,135 @@ datatypes:
Description: "EIC vertex" Description: "EIC vertex"
Author: "W. Armstrong, S. Joosten" Author: "W. Armstrong, S. Joosten"
Members: Members:
- eic::VectorXYZT position // postion and time of vertex [mm, ns] - eic::Index ID // unique vertex ID
- eic::VectorXYZ position // postion of vertex [mm]
- float time // time of vertex [ns]
- float chi2 // Chi squared of the vertex fit. - float chi2 // Chi squared of the vertex fit.
- float probability // Probability of the vertex fit - float probability // Probability of the vertex fit
- bool primary // Whether it is the primary vertex of the event - bool primary // Whether it is the primary vertex of the event
OneToOneRelations: # no recID here, as a single vertex usually corresponds with multiple tracks
- eic::ReconstructedParticle particle // Reconstructed Particle associated to the Vertex. ExtraCode:
declaration: "
explicit Vertex(const ConstVertex& cv)
: ID{cv.ID}, position{cv.position()}, chi2{cv.chi2()}, probability{cv.probability()}, primary{cv.primary} {}\n
Vertex& operator=(const ConstVertex& cv) {
ID = cv.ID(); position = cv.position(); chi2 = cv.chi2(); probability = cv.probability(); primary = cv.primary();
return *this;}\n
"
eic::RawPMTHit: eic::RawPMTHit:
Description: "EIC Raw PMT hit" Description: "EIC Raw PMT hit"
Author: "C. Peng" Author: "S. Joosten, C. Peng"
Members: Members:
- int64_t cellID // The detector specific (geometrical) cell id. - int64_t cellID // The detector specific (geometrical) cell id.
- unsigned amplitude // PMT signal amplitude - eic::Index ID // unique hit ID
- unsigned timeStamp // PMT signal time - uint32_t amplitude // PMT signal amplitude [ADC]
- uint32_t time // PMT signal time [TDC]
ExtraCode:
declaration: "
explicit RawPMTHit(const ConstRawPMTHit& cv)
: cellID{cv.cellID()}, ID{cv.ID()}, amplitude{cv.amplitude()}, time{cv.time()} {}\n
RawPMTHit& operator=(const ConstRawPMTHit& cv)
cellID = cv.cellID(); ID = cv.ID(); amplitude = cv.amplitude(); time = cv.time();
return *this;}\n
"
eic::PMTHit: eic::PMTHit:
Description: "EIC PMT hit" Description: "EIC PMT hit"
Author: "C. Peng" Author: "S. Joosten, C. Peng"
Members: Members:
- int64_t cellID // The detector specific (geometrical) cell id. - int64_t cellID // The detector specific (geometrical) cell id.
- float npe // estimated number of photo-electrons - eic::Index ID // Unique hit ID
- float time // time - float npe // estimated number of photo-electrons [#]
- eic::VectorXYZ position // PMT hit position - float time // time [ns]
- eic::VectorXYZLocal local // The local position of the hit in detector coordinates. - eic::VectorXYZ position // PMT hit position [mm]
- eic::VectorXYZ local // The local position of the hit in detector coordinates [mm]
eic::RIChCluster: - eic::Index clusterID // Associated cluster info (e.g. RICH cluster, -1 if none)
Description: "EIC RICh Cluster" ExtraCode:
Author: "C. Peng" declaration: "
explicit PMTHit(const ConstPMTHit& cv)
: cellID{cv.cellID()}, ID{cv.ID()}, npe{cv.npe()}, time{cv.time()}, position{cv.position()}, local{cv.local()} {}\n
PMTHit& operator=(const ConstPMTHit& cv)
cellID = cv.cellID(); ID = cv.ID(); npe = cv.npe(); time = cv.time(); position = cv.position(); local = cv.local();
return *this;}\n
"
eic::RICHCluster:
Description: "EIC RICH Cluster"
Author: "S. Joosten, C. Peng"
Members: Members:
- eic::VectorXYZ position // Global position of the cluster. - eic::Index ID // Unique cluster ID
- float theta // opening angle of the ring - eic::VectorXYZ position // Global position of the cluster [mm]
- float radius // radius of the best fit ring - float theta // opening angle of the ring [rad]
- float radiusError // estimated error from the fit - float radius // radius of the best fit ring [mm]
- float npe // number of photo-electrons - float radiusError // estimated error from the fit [mm]
OneToManyRelations: - float npe // number of photo-electrons [#]
- eic::PMTHit hits // The hits that have been included in this cluster ## probably need to keep track of the associated PID info here with an index
ExtraCode:
declaration: "
explicit RICHCluster(const ConstRICHCluster& cv)
: ID{cv.ID()}, position{cv.position()}, theta{cv.theta()}, radius{cv.radius()}, radiusError{cv.radiusError()}, npe{cv.npe()} {}\n
RICHCluster& operator=(const ConstRICHCluster& cv) {
ID = cv.ID(); position = cv.position(); theta = cv.theta(); radius = cv.radius(); radiusError = cv.radiusError(); npe = cv.npe();
return *this;}\n
"
eic::ImagingPixel: eic::ImagingPixel:
Description: "Pixel for Imaging Calorimeter" Description: "Pixel for Imaging Calorimeter"
Author: "C. Peng" Author: "S. Joosten, C. Peng"
Members: Members:
- int clusterID // Cluster id - eic::Index ID // Unique pixel ID
- int layerID // Layer id - eic::Index clusterID // Cluster ID, -1 if none
- int sectorID // Sector id - eic::Index layerID // Layer id, -1 if none
- int hitID // Hit id - eic::Index sectorID // Sector id, -1 if none
- float edep // Energy deposition - float edep // Energy deposition [GeV]
- float time // Timestamp - float time // Timestamp [ns]
- float eta // Pseudorapidity - float eta // Pseudorapidity
- eic::VectorXYZLocal local // Local position in its sector - eic::VectorXYZ local // Local position in its sector [mm]
- eic::VectorXYZ position // Global position - eic::VectorXYZ position // Global position [mm]
- eic::VectorPolar polar // Global position in polar coordinates - eic::VectorPolar polar // Global position in polar coordinates [mm, rad]
ExtraCode:
declaration: "
explicit ImagingPixel(const ConstImagingPixel& cv)
: ID{cv.ID()}, clusterID{cv.clusterID()}, layerID{cv.layerID()}, sectorID{cv.sectorID()}
, edep{cv.edep()}, time{cv.time()}, eta{cv.eta()}, local{cv.local()}, position{cv.position()}, polar{cv.polar()} {}\n
ImagingPixel& operator=(const ConstImagingPixel& cv) {
ID = cv.ID(); clusterID = cv.clusterID(); layerID = cv.layerID(); sectorID = cv.sectorID();
edep = cv.edep(); time = cv.time(); eta = cv.eta(); local = cv.local(); position = cv.position(); polar = cv.polar();
return *this;}\n
"
eic::ImagingLayer: eic::ImagingLayer:
Description: "Layer for Imaging Calorimeter" Description: "Layer for Imaging Calorimeter"
Author: "C. Peng" Author: "S. Joosten, C. Peng"
Members: Members:
- int clusterID // Cluster id - eic::Index ID // unique layer ID
- int layerID // Layer id - eic::Index clusterID // associated cluster ID, -1 if none
- int nhits // Number of hits - int nhits // Number of hits
- float edep // Energy deposit - float edep // Energy deposit [GeV]
- float radius // Shower radius - float radius // Shower radius [mm]
- float skewness // Skewness of hits distribution - float skewness // Skewness of hits distribution
- float eta // Pseudorapidity - float eta // Pseudorapidity
- eic::VectorXYZ position // Global center position. - eic::VectorXYZ position // Global center position. [mm]
- eic::VectorPolar polar // Global center position in polar coordinates - eic::VectorPolar polar // Global center position in polar coordinates [mm, rad]
OneToManyRelations: ExtraCode:
- eic::ImagingPixel hits // hits data declaration: "
explicit ImagingLayer(const ConstImagingLayer& cv)
: ID{cv.ID()}, clusterID{cv.clusterID()}, nhits{cv.nhits()}, edep{cv.edep()}, radius{cv.radius()}
, skewness{cv.skewness()}, eta{cv.eta()}, position{cv.position()}, polar{cv.polar()} {}\n
ImagingLayer& operator=(const ConstImagingLayer& cv) {
ID = cv.ID(); clusterID = cv.clusterID(); nhits = cv.nhits(); edep = cv.edep(); radius = cv.radius();
skewness = cv.skewness(); eta = cv.eta(); position = cv.position(); polar = cv.polar();
return *this;
}\n
"
## FIXME: Not updating ImagingCluster as it's deprecated and will be superceded by Cluster
eic::ImagingCluster: eic::ImagingCluster:
Description: "Cluster for Imaging Calorimeter" Description: "Cluster for Imaging Calorimeter"
Author: "S. Joosten, C. Peng" Author: "S. Joosten, C. Peng"
Members: Members:
- int clusterID // Cluster id - eic::Index clusterID // unique Cluster id
- int nhits // Number of hits in this cluster. - int nhits // Number of hits in this cluster.
- float energy // Energy of the cluster. - float energy // Energy of the cluster.
- float edep // Energy deposit of the cluster. - float edep // Energy deposit of the cluster.
...@@ -688,8 +789,3 @@ datatypes: ...@@ -688,8 +789,3 @@ datatypes:
- eic::VectorPolar polar // Polar coordinates for global position. - eic::VectorPolar polar // Polar coordinates for global position.
- float cl_theta // Intrinsic direction of cluster at position - Theta. - float cl_theta // Intrinsic direction of cluster at position - Theta.
- float cl_phi // Intrinsic direction of cluster at position - Phi. - float cl_phi // Intrinsic direction of cluster at position - Phi.
OneToManyRelations:
# cluster <-> hit relation is deprecated
- eic::ImagingPixel hits // hits data
- eic::ImagingLayer layers // layer data
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment