SHiP Data Model
Event data model for the SHiP experiment: C++ data classes with ROOT dictionary support.
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions
SHiP Namespace Reference

Canonical ShipSoft unit vocabulary. More...

Namespaces

namespace  units
 
namespace  view
 Quantity views over the persisted data classes.
 

Classes

struct  CaloHit
 Hit reconstructed by the calorimeter. More...
 
struct  EventHeader
 Per-event metadata — one record per event. More...
 
struct  MCParticle
 Monte Carlo particle — input to simulation. More...
 
struct  RecHit
 Reconstructed hit. More...
 
struct  RecParticle
 Reconstructed particle. More...
 
struct  SBTHit
 Hit reconstructed by the SBT (Surround Background Tagger) More...
 
struct  SimHit
 Simulation hit from Geant4 sensitive detectors. More...
 
struct  SimParticle
 Tracked particle from simulation. More...
 
struct  SimResult
 Bundled result from one Geant4 event. More...
 
struct  StrawTubesHit
 Hit reconstructed by a layer of the straw tubes spectrometer. More...
 
struct  TimeDetHit
 Hit reconstructed by the timing detector. More...
 
struct  TrackFitResult
 Track fit result. More...
 
struct  UBTHit
 Hit reconstructed by the UBT (Upstream Background Tagger) More...
 

Typedefs

using Length = mp_units::quantity< units::mm, double >
 Canonical quantity types: double representation, storage unit baked in.
 
using Time = mp_units::quantity< units::ns, double >
 
using Energy = mp_units::quantity< units::GeV, double >
 
using Momentum = mp_units::quantity< units::GeV_per_c, double >
 
using Mass = mp_units::quantity< units::GeV_per_c2, double >
 
using Angle = mp_units::quantity< units::rad, double >
 
using MagneticField = mp_units::quantity< units::tesla, double >
 
template<typename Q >
using Vec3 = std::array< Q, 3 >
 

Enumerations

enum class  detector_id : std::int32_t {
  UpstreamTagger = 0 , SurroundTagger = 1 , StrawTubes = 2 , Calorimeter = 3 ,
  TimingDetector = 4
}
 

Functions

bool mothers_are_consistent (std::vector< MCParticle > const &particles)
 True when the mother indices of a whole collection are self-consistent, i.e.
 
bool mothers_are_populated (std::vector< MCParticle > const &particles)
 True when, on top of mothers_are_consistent(), every entry that has a mother carries the full list — mother_id >= 0 implies a non-empty mothers.
 
RecHit from_sim_hit (SimHit const &sp)
 
RecParticle from_sim_particle (SimParticle const &sp)
 
template<typename Q >
constexpr Q quantity_of (double v)
 Wrap a raw scalar, interpreting it in Q's canonical unit (bitwise).
 
template<typename Q >
constexpr double raw (Q q)
 Unwrap a scalar quantity to a raw double in Q's canonical unit (bitwise).
 
template<typename Q >
constexpr Vec3< Q > vec_of (std::array< double, 3 > const &v)
 Wrap a raw 3-vector, interpreting it in Q's canonical unit (bitwise).
 
template<typename Q >
constexpr std::array< double, 3 > raw (Vec3< Q > const &v)
 Unwrap a quantity 3-vector to raw doubles in Q's canonical unit (bitwise).
 

Detailed Description

Canonical ShipSoft unit vocabulary.

Storage convention (matches the data-class doxygen contracts and Key4hep): positions and lengths [mm], momenta [GeV/c], energies [GeV], times [ns]. Persisted classes keep plain doubles in these units; computation code works with the quantity types below and converts at the boundaries (see SHiP/QuantityView.hpp).

NEVER using namespace SHiP::units in a translation unit that includes CLHEP or Geant4 headers: G4SystemOfUnits.hh injects global mm, GeV, tesla, ... that collide with these names. Always qualify.

Typedef Documentation

◆ Angle

using SHiP::Angle = typedef mp_units::quantity<units::rad, double>

◆ Energy

using SHiP::Energy = typedef mp_units::quantity<units::GeV, double>

◆ Length

using SHiP::Length = typedef mp_units::quantity<units::mm, double>

Canonical quantity types: double representation, storage unit baked in.

◆ MagneticField

using SHiP::MagneticField = typedef mp_units::quantity<units::tesla, double>

◆ Mass

using SHiP::Mass = typedef mp_units::quantity<units::GeV_per_c2, double>

◆ Momentum

using SHiP::Momentum = typedef mp_units::quantity<units::GeV_per_c, double>

◆ Time

using SHiP::Time = typedef mp_units::quantity<units::ns, double>

◆ Vec3

template<typename Q >
using SHiP::Vec3 = typedef std::array<Q, 3>

Enumeration Type Documentation

◆ detector_id

enum class SHiP::detector_id : std::int32_t
strong
Enumerator
UpstreamTagger 
SurroundTagger 
StrawTubes 
Calorimeter 
TimingDetector 

Function Documentation

◆ from_sim_hit()

RecHit SHiP::from_sim_hit ( SimHit const &  sp)
inline

◆ from_sim_particle()

RecParticle SHiP::from_sim_particle ( SimParticle const &  sp)
inline

◆ mothers_are_consistent()

bool SHiP::mothers_are_consistent ( std::vector< MCParticle > const &  particles)
inline

True when the mother indices of a whole collection are self-consistent, i.e.

satisfy the four invariants documented above.

An empty mothers is always accepted: it means either that the entry has no mothers, or that the data was written before v0.5.0, when the field did not exist. Use mothers_are_populated() to additionally require the list on current-schema data.

◆ mothers_are_populated()

bool SHiP::mothers_are_populated ( std::vector< MCParticle > const &  particles)
inline

True when, on top of mothers_are_consistent(), every entry that has a mother carries the full list — mother_id >= 0 implies a non-empty mothers.

Only current-schema data can satisfy this: files written before v0.5.0 have no mothers field at all, so they read back with an empty list next to a perfectly valid mother_id.

◆ quantity_of()

template<typename Q >
constexpr Q SHiP::quantity_of ( double  v)
constexpr

Wrap a raw scalar, interpreting it in Q's canonical unit (bitwise).

◆ raw() [1/2]

template<typename Q >
constexpr double SHiP::raw ( Q  q)
constexpr

Unwrap a scalar quantity to a raw double in Q's canonical unit (bitwise).

◆ raw() [2/2]

template<typename Q >
constexpr std::array< double, 3 > SHiP::raw ( Vec3< Q > const &  v)
constexpr

Unwrap a quantity 3-vector to raw doubles in Q's canonical unit (bitwise).

◆ vec_of()

template<typename Q >
constexpr Vec3< Q > SHiP::vec_of ( std::array< double, 3 > const &  v)
constexpr

Wrap a raw 3-vector, interpreting it in Q's canonical unit (bitwise).