SHiP Data Model
Event data model for the SHiP experiment: C++ data classes with ROOT dictionary support.
Loading...
Searching...
No Matches
RecHit.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstdint>
5
6#include "SHiP/SimHit.hpp"
7
8namespace SHiP {
9
11struct RecHit {
12 std::int32_t detector_id{0};
13 std::int32_t track_id{0};
14 std::int32_t pdg_code{0};
15 std::array<double, 3> position{0, 0, 0};
16 std::array<double, 3> momentum{0, 0, 0};
17 double energy_deposit{0};
18 double time{0};
19 double path_length{0};
20
21 bool operator==(RecHit const&) const = default;
22};
23
24inline RecHit from_sim_hit(SimHit const& sp) {
25 return {.detector_id = sp.detector_id,
26 .track_id = sp.track_id,
27 .pdg_code = sp.pdg_code,
28 .position = sp.position,
29 .momentum = sp.momentum,
30 .energy_deposit = sp.energy_deposit,
31 .time = sp.time,
32 .path_length = sp.path_length};
33}
34
35} // namespace SHiP
Canonical ShipSoft unit vocabulary.
Definition CaloHit.hpp:4
detector_id
Definition detector_id.hpp:7
RecHit from_sim_hit(SimHit const &sp)
Definition RecHit.hpp:24
Reconstructed hit.
Definition RecHit.hpp:11
std::int32_t pdg_code
Definition RecHit.hpp:14
std::int32_t track_id
Definition RecHit.hpp:13
double energy_deposit
Energy deposited [GeV].
Definition RecHit.hpp:17
std::array< double, 3 > position
Hit position [mm].
Definition RecHit.hpp:15
double path_length
Step length [mm].
Definition RecHit.hpp:19
std::int32_t detector_id
Definition RecHit.hpp:12
bool operator==(RecHit const &) const =default
std::array< double, 3 > momentum
Momentum at hit [GeV/c].
Definition RecHit.hpp:16
double time
Global time [ns].
Definition RecHit.hpp:18
Simulation hit from Geant4 sensitive detectors.
Definition SimHit.hpp:9
std::int32_t detector_id
Definition SimHit.hpp:10
double energy_deposit
Energy deposited [GeV].
Definition SimHit.hpp:16
std::array< double, 3 > momentum
Momentum at hit [GeV/c].
Definition SimHit.hpp:15
std::int32_t track_id
Definition SimHit.hpp:12
std::array< double, 3 > position
Hit position [mm].
Definition SimHit.hpp:14
double time
Global time [ns].
Definition SimHit.hpp:17
std::int32_t pdg_code
Definition SimHit.hpp:13
double path_length
Step length [mm].
Definition SimHit.hpp:18