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 detectorId{0};
13 std::int32_t trackId{0};
14 std::int32_t pdgCode{0};
15 std::array<double, 3> position{0, 0, 0};
16 std::array<double, 3> momentum{0, 0, 0};
17 double energyDeposit{0};
18 double time{0};
19 double pathLength{0};
20
21 bool operator==(RecHit const&) const = default;
22};
23
24inline RecHit fromSimHit(SimHit const& sp) {
25 return {.detectorId = sp.detectorId,
26 .trackId = sp.trackId,
27 .pdgCode = sp.pdgCode,
28 .position = sp.position,
29 .momentum = sp.momentum,
30 .energyDeposit = sp.energyDeposit,
31 .time = sp.time,
32 .pathLength = sp.pathLength};
33}
34
35} // namespace SHiP
Definition CaloHit.hpp:4
RecHit fromSimHit(SimHit const &sp)
Definition RecHit.hpp:24
Reconstructed hit.
Definition RecHit.hpp:11
double pathLength
Step length [mm].
Definition RecHit.hpp:19
std::array< double, 3 > position
Hit position [mm].
Definition RecHit.hpp:15
double energyDeposit
Energy deposited [GeV].
Definition RecHit.hpp:17
bool operator==(RecHit const &) const =default
std::int32_t pdgCode
Definition RecHit.hpp:14
std::int32_t detectorId
Definition RecHit.hpp:12
std::array< double, 3 > momentum
Momentum at hit [GeV/c].
Definition RecHit.hpp:16
double time
Global time [ns].
Definition RecHit.hpp:18
std::int32_t trackId
Definition RecHit.hpp:13
Simulation hit from Geant4 sensitive detectors.
Definition SimHit.hpp:9
double energyDeposit
Energy deposited [GeV].
Definition SimHit.hpp:16
std::array< double, 3 > momentum
Momentum at hit [GeV/c].
Definition SimHit.hpp:15
std::int32_t detectorId
Definition SimHit.hpp:10
std::int32_t trackId
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 pdgCode
Definition SimHit.hpp:13
double pathLength
Step length [mm].
Definition SimHit.hpp:18