Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d9f71f2
add rec particle
Jun 9, 2026
a2ca5b2
style: pre-commit fixes
pre-commit-ci[bot] Jun 9, 2026
668f31e
reorder header
Jun 9, 2026
a5f1b5a
style: pre-commit fixes
pre-commit-ci[bot] Jun 9, 2026
807d28d
make it work
Jun 9, 2026
2ebed80
make it work
Jun 9, 2026
9d4c399
style: pre-commit fixes
pre-commit-ci[bot] Jun 9, 2026
56e7960
things
Jun 9, 2026
5580f28
Merge branch 'rec_particle' of github.com:mesmith75/data-model into r…
Jun 9, 2026
e12c868
style: pre-commit fixes
pre-commit-ci[bot] Jun 9, 2026
b8212b5
tidy
Jun 9, 2026
7ac38a0
style: pre-commit fixes
pre-commit-ci[bot] Jun 9, 2026
e9c61ea
order
Jun 9, 2026
9286927
style: pre-commit fixes
pre-commit-ci[bot] Jun 9, 2026
07ca11d
add RecHit
Jun 17, 2026
9b7c58c
conflict resolution
Jun 17, 2026
ddac47a
style: pre-commit fixes
pre-commit-ci[bot] Jun 19, 2026
48f111f
vector
Jun 19, 2026
e87e1bc
Merge branch 'rec_particle' of github.com-mesmith75-data-model:mesmit…
Jun 19, 2026
71ab115
style: pre-commit fixes
pre-commit-ci[bot] Jun 19, 2026
b84aa05
add track fit result
Jul 2, 2026
de59998
tidy
Jul 2, 2026
c65136c
conflict resolution
Jul 2, 2026
8cd7edc
conflict resolution
Jul 2, 2026
9a581d2
adjust
Jul 3, 2026
38cd925
Merge branch 'main' into rec_particle
Jul 3, 2026
0971774
Add subdetector hits
Jul 9, 2026
8a7efd7
add some detector particles
Jul 9, 2026
0554e47
update CMakeLists.txt
Jul 9, 2026
4ac87a3
fix
Jul 9, 2026
8f776e3
Merge branch 'main' into rec_particle
Jul 9, 2026
8989d3c
fix compilation
Jul 9, 2026
888722b
update
Jul 10, 2026
33c6eee
tidy
Jul 10, 2026
6678dd8
updates for digitisatio
Jul 11, 2026
46f207b
Merge branch 'main' into rec_particle
mesmith75 Jul 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ target_sources(
include/SHiP/SimHit.hpp
include/SHiP/SimParticle.hpp
include/SHiP/SimResult.hpp
include/SHiP/RecHit.hpp
include/SHiP/TrackFitResult.hpp
include/SHiP/RecParticle.hpp
include/SHiP/detectors/UBTHit.hpp
include/SHiP/detectors/SBTHit.hpp
include/SHiP/detectors/StrawTubesHit.hpp
include/SHiP/detectors/CaloHit.hpp
include/SHiP/detectors/TimeDetHit.hpp
include/SHiP/detectors/DetectorID.hpp
)
target_link_libraries(SHiPDataModel PUBLIC ROOT::Core)
set_target_properties(SHiPDataModel PROPERTIES LINKER_LANGUAGE CXX)
Expand All @@ -47,7 +55,14 @@ root_generate_dictionary(
SHiP/SimHit.hpp
SHiP/SimParticle.hpp
SHiP/SimResult.hpp
SHiP/RecHit.hpp
SHiP/TrackFitResult.hpp
SHiP/RecParticle.hpp
SHiP/detectors/UBTHit.hpp
SHiP/detectors/SBTHit.hpp
SHiP/detectors/StrawTubesHit.hpp
SHiP/detectors/CaloHit.hpp
SHiP/detectors/TimeDetHit.hpp
MODULE
SHiPDataModel
LINKDEF
Expand All @@ -60,7 +75,10 @@ install(
TARGETS SHiPDataModel
EXPORT SHiPDataModelTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
FILE_SET headers
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
FILE_SET headers DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(TARGETS SHiPUnits EXPORT SHiPDataModelTargets FILE_SET headers)
install(
Expand Down Expand Up @@ -93,6 +111,7 @@ install(
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/SHiPDataModel
)


include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
Expand Down
16 changes: 16 additions & 0 deletions include/SHiP/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,23 @@
#pragma link C++ class std::vector<SHiP::SimHit>+;
#pragma link C++ class std::vector<SHiP::SimParticle>+;

// Digitisation
#pragma link C++ class SHiP::RecHit+;
#pragma link C++ class std::vector<SHiP::RecHit>+;
#pragma link C++ class SHiP::UBTHit+;
#pragma link C++ class std::vector<SHiP::UBTHit>+;
#pragma link C++ class SHiP::SBTHit+;
#pragma link C++ class std::vector<SHiP::SBTHit>+;
#pragma link C++ class SHiP::TimeDetHit+;
#pragma link C++ class std::vector<SHiP::TimeDetHit>+;
#pragma link C++ class SHiP::StrawTubesHit+;
#pragma link C++ class std::vector<SHiP::StrawTubesHit>+;
#pragma link C++ class SHiP::CaloHit+;
#pragma link C++ class std::vector<SHiP::CaloHit>+;

// Reconstruction
#pragma link C++ class SHiP::TrackFitResult+;
#pragma link C++ class std::vector<SHiP::TrackFitResult>+;
#pragma link C++ class SHiP::RecParticle+;
#pragma link C++ class std::vector<SHiP::RecParticle>+;
#endif
33 changes: 33 additions & 0 deletions include/SHiP/RecHit.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#pragma once

#include <array>
#include <cstdint>

#include "SHiP/SimHit.hpp"

namespace SHiP {

/// Reconstructed particle
Comment thread
mesmith75 marked this conversation as resolved.
struct RecHit {
std::int32_t detectorId{0};
std::int32_t trackId{0};
std::int32_t pdgCode{0};
std::array<double, 3> position{0, 0, 0}; ///< Hit position [mm]
std::array<double, 3> momentum{0, 0, 0}; ///< Momentum at hit [GeV/c]
double energyDeposit{0}; ///< Energy deposited [GeV]
double time{0}; ///< Global time [ns]
double pathLength{0}; ///< Step length [mm]
};

inline RecHit fromSimHit(SimHit const& sp) {
return {.detectorId = sp.detectorId,
.trackId = sp.trackId,
.pdgCode = sp.pdgCode,
.position = sp.position,
.momentum = sp.momentum,
.energyDeposit = sp.energyDeposit,
.time = sp.time,
.pathLength = sp.pathLength};
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.

} // namespace SHiP
7 changes: 5 additions & 2 deletions include/SHiP/RecParticle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

#include <array>
#include <cstdint>
#include <vector>

#include "SHiP/RecHit.hpp"
#include "SHiP/SimParticle.hpp"

namespace SHiP {
Expand All @@ -15,8 +17,9 @@ struct RecParticle {
std::array<double, 3> vertex{0, 0, 0}; ///< Production vertex [mm]
std::array<double, 3> endpoint{0, 0, 0}; ///< End point [mm]
std::array<double, 3> momentum{0, 0, 0}; ///< Initial momentum [GeV/c]
double energy{0}; ///< Initial kinetic energy [GeV]
double time{0}; ///< Production time [ns]
std::vector<RecHit> hits{};
double energy{0}; ///< Initial kinetic energy [GeV]
double time{0}; ///< Production time [ns]
std::int32_t creatorProcess{0};
double ipPV{0}; ///< IP wrt to the PV (at 0,0,0) [mm]
};
Expand Down
27 changes: 27 additions & 0 deletions include/SHiP/TrackFitResult.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#pragma once

#include <array>
#include <vector>
#include <cstdint>

namespace SHiP {

/// Reconstructed particle
Comment thread
mesmith75 marked this conversation as resolved.
struct TrackFitResult {
std::int32_t nMeas{0};
std::int32_t fitStatus{1}; // 0 = success, 1 = failure
double chi2{0};
std::int32_t ndf{0};
double qoverp{0};
double phi{0};
double theta{0};
double time{0};
std::array<double, 3> refLoc{0,0,0};
std::vector<double> inputMeasurementsX{};
std::vector<double> inputMeasurementsY{};
std::vector<double> fittedMeasurementsX{};
std::vector<double> fittedMeasurementsY{};
std::vector<double> residualsX{};
std::vector<double> residualsY{};
};
} // namespace SHiP
11 changes: 11 additions & 0 deletions include/SHiP/detectors/CaloHit.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
#include "SHiP/RecHit.hpp"

namespace SHiP {

/// Hit reconstructed by the calorimeter
struct CaloHit{
RecHit recHit; ///< The reconstructed hit
};

} // namespace SHiP
16 changes: 16 additions & 0 deletions include/SHiP/detectors/DetectorID.hpp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently unused. Was the intention to use this as the type of detectorId in RecHit? (also, could we make it detector_id?)
In that case, we might have to add a dict, not sure.

@mesmith75 mesmith75 Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used in the digitisation and will be in the reconstruction. I guess we could use it in Aegir too. The point is to make sure that each detector always uses something consistent.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SHiP/DetectorID.hpp
Comment thread
mesmith75 marked this conversation as resolved.
#pragma once

#include <cstdint>

namespace SHiP {

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

} // namespace SHiP
Comment thread
mesmith75 marked this conversation as resolved.
11 changes: 11 additions & 0 deletions include/SHiP/detectors/SBTHit.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
#include "SHiP/RecHit.hpp"

namespace SHiP {

/// Hit reconstructed by the SBT (Surround Background Tagger)
struct SBTHit{
RecHit recHit; ///< The reconstructed hit
};

} // namespace SHiP
11 changes: 11 additions & 0 deletions include/SHiP/detectors/StrawTubesHit.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
#include "SHiP/RecHit.hpp"

namespace SHiP {

/// Hit reconstructed by a layer of the straw tubes spectrometer
struct StrawTubesHit{
RecHit recHit; ///< The reconstructed hit
};

} // namespace SHiP
11 changes: 11 additions & 0 deletions include/SHiP/detectors/TimeDetHit.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
#include "SHiP/RecHit.hpp"

namespace SHiP {

/// Hit reconstructed by the timing detector
struct TimeDetHit{
RecHit recHit; ///< The reconstructed hit
};

} // namespace SHiP
11 changes: 11 additions & 0 deletions include/SHiP/detectors/UBTHit.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#pragma once
#include "SHiP/RecHit.hpp"

namespace SHiP {

/// Hit reconstructed by the UBT (Upstream Background Tagger)
struct UBTHit{
RecHit recHit; ///< The reconstructed hit
};

} // namespace SHiP
Loading