Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b1e09f5
Added 10ns bunch aware hit partitioning to far detector tracking, for…
Garypenman Aug 7, 2026
62fa86b
Propagate track associatoins through transportation ML for far detectors
Garypenman Aug 7, 2026
b2f7b9e
minor syntax change
Garypenman Aug 7, 2026
6daeab1
update LOWQ2.cc for farforward ML factory track propagation changes
Garypenman Aug 7, 2026
d111914
added protections to instances of trk->getTrajectory for LOWQ2 tracks…
Garypenman Aug 7, 2026
34f0e4e
Merge remote-tracking branch 'origin/main' into fix/vertex_traj_protect
simonge Aug 7, 2026
411b4a9
Revert "Added 10ns bunch aware hit partitioning to far detector track…
simonge Aug 7, 2026
fa7c55b
Remove comments and change formatting
simonge Aug 7, 2026
867df65
Remove todo comment
simonge Aug 7, 2026
1e3af5e
tab tab tab
simonge Aug 7, 2026
9f44762
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2026
61e9709
Potential fix for pull request finding
simonge Aug 7, 2026
b0a7493
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2026
d57ba38
Apply suggestions from code review
simonge Aug 7, 2026
073ce92
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 7, 2026
7314897
Merge branch 'main' into fix/vertex_traj_protect
simonge Aug 9, 2026
757d2c5
Merge branch 'main' into fix/vertex_traj_protect
simonge Aug 20, 2026
af5e56c
Apply suggestions from code review
simonge Aug 20, 2026
fe2546f
Merge branch 'main' into fix/vertex_traj_protect
simonge Sep 1, 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
17 changes: 13 additions & 4 deletions src/algorithms/fardetectors/FarDetectorTransportationPostML.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ void FarDetectorTransportationPostML::process(
const FarDetectorTransportationPostML::Input& input,
const FarDetectorTransportationPostML::Output& output) const {

const auto [prediction_tensors, track_associations, beamElectrons] = input;
auto [out_particles, out_links, out_associations] = output;
const auto [prediction_tensors, tracks, track_associations, beamElectrons] = input;
auto [out_particles, out_links, out_associations] = output;

//Set beam energy from first MCBeamElectron, using std::call_once
if (beamElectrons != nullptr) {
Expand Down Expand Up @@ -111,6 +111,17 @@ void FarDetectorTransportationPostML::process(
particle.setMass(m_mass);
particle.setPDG(m_cfg.pdg_value);

if (tracks == nullptr) {
error("No tracks collection provided; cannot set ReconstructedParticle-Track relation");
throw std::runtime_error("No tracks collection provided");
}
Comment thread
simonge marked this conversation as resolved.
Outdated
if (i >= tracks->size()) {
error("Prediction tensor row {} has no corresponding track (tracks size={})", i,
tracks->size());
throw std::runtime_error("Prediction tensor/track size mismatch");
}
particle.addToTracks(tracks->at(i));

//Check if both association collections are set and copy the MCParticle association
if ((track_associations != nullptr) && (track_associations->size() > i)) {
// Copy the association from the input to the output
Expand All @@ -125,8 +136,6 @@ void FarDetectorTransportationPostML::process(
out_association.setWeight(association.getWeight());
}
}

// TODO: Implement the association of the reconstructed particles with the tracks
}

} // namespace eicrecon
5 changes: 3 additions & 2 deletions src/algorithms/fardetectors/FarDetectorTransportationPostML.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <edm4eic/ReconstructedParticleCollection.h>
#include <edm4eic/TensorCollection.h>
#include <edm4hep/MCParticleCollection.h>
#include <edm4eic/TrackCollection.h>
#include <mutex>
#include <optional>
#include <string>
Expand All @@ -21,7 +22,7 @@
namespace eicrecon {

using FarDetectorTransportationPostMLAlgorithm = algorithms::Algorithm<
algorithms::Input<edm4eic::TensorCollection,
algorithms::Input<edm4eic::TensorCollection, edm4eic::TrackCollection,
std::optional<edm4eic::MCRecoTrackParticleAssociationCollection>,
std::optional<edm4hep::MCParticleCollection>>,
algorithms::Output<edm4eic::ReconstructedParticleCollection,
Expand All @@ -36,7 +37,7 @@ class FarDetectorTransportationPostML
FarDetectorTransportationPostML(std::string_view name)
: FarDetectorTransportationPostMLAlgorithm{
name,
{"inputPredictionsTensor", "trackAssociations", "beamElectrons"},
{"inputPredictionsTensor", "tracks", "trackAssociations", "beamElectrons"},
{"outputParticles", "outputLinks", "outputAssociations"},
"Convert ML output tensor into reconstructed electron"} {}

Expand Down
4 changes: 3 additions & 1 deletion src/algorithms/reco/Helix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ Helix::Helix(const edm4hep::Vector3f& p, const edm4hep::Vector3f& o, const doubl
Helix::Helix(const edm4eic::ReconstructedParticle& p, const double b_field) {
Comment thread
simonge marked this conversation as resolved.
const auto& tracks = p.getTracks();
for (const auto& trk : tracks) {
const auto& traj = trk.getTrajectory();
const auto& traj = trk.getTrajectory();
if (!traj.isAvailable())
Comment thread
simonge marked this conversation as resolved.
Outdated
continue;
const auto& trkPars = traj.getTrackParameters();
Comment thread
simonge marked this conversation as resolved.
Comment thread
simonge marked this conversation as resolved.
for (const auto& par : trkPars) {
setParameters(par, b_field);
Expand Down
4 changes: 3 additions & 1 deletion src/algorithms/tracking/IterativeVertexFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ void eicrecon::IterativeVertexFinder::process(const Input& input, const Output&
for (const auto& part : *reconParticles) {
const auto& tracks = part.getTracks();
for (const auto& trk : tracks) {
const auto& traj = trk.getTrajectory();
const auto& traj = trk.getTrajectory();
if (!traj.isAvailable())
Comment thread
simonge marked this conversation as resolved.
Outdated
continue;
const auto& trkPars = traj.getTrackParameters();
Comment thread
simonge marked this conversation as resolved.
for (const auto& par : trkPars) {
const double EPSILON = 1.0e-4; // mm
Expand Down
4 changes: 3 additions & 1 deletion src/algorithms/tracking/SecondaryVertexFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ void SecondaryVertexFinder::storeVertices(
for (const auto& part : reconParticles) {
const auto& tracks = part.getTracks();
for (const auto& trk : tracks) {
const auto& traj = trk.getTrajectory();
const auto& traj = trk.getTrajectory();
if (!traj.isAvailable())
Comment thread
simonge marked this conversation as resolved.
Outdated
continue;
const auto& trkPars = traj.getTrackParameters();
Comment thread
simonge marked this conversation as resolved.
for (const auto& trkPar : trkPars) {
double EPSILON = std::numeric_limits<double>::epsilon();
Expand Down
2 changes: 2 additions & 0 deletions src/algorithms/tracking/TracksToParticles.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ void TracksToParticles::process(const TracksToParticles::Input& input,

for (const auto& track : *tracks) {
auto trajectory = track.getTrajectory();
if (!trajectory.isAvailable())
Comment thread
simonge marked this conversation as resolved.
Outdated
continue;
for (const auto& trk : trajectory.getTrackParameters()) {
Comment thread
simonge marked this conversation as resolved.
const auto mom = edm4hep::utils::sphericalToVector(1.0 / std::abs(trk.getQOverP()),
trk.getTheta(), trk.getPhi());
Expand Down
3 changes: 2 additions & 1 deletion src/detectors/LOWQ2/LOWQ2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ void InitPlugin(JApplication* app) {
app));
app->Add(new JOmniFactoryGeneratorT<FarDetectorTransportationPostML_factory>(
"TaggerTrackerTransportationPostML",
{"TaggerTrackerPredictionTensor", "TaggerTrackerLocalTrackAssociations", "MCBeamElectrons"},
{"TaggerTrackerPredictionTensor", "TaggerTrackerLocalTracks",
"TaggerTrackerLocalTrackAssociations", "MCBeamElectrons"},
{"TaggerTrackerReconstructedParticles", "TaggerTrackerReconstructedParticleLinks",
"TaggerTrackerReconstructedParticleAssociations"},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "algorithms/fardetectors/FarDetectorTransportationPostML.h"
#include "services/algorithms_init/AlgorithmsInit_service.h"
#include "extensions/jana/JOmniFactory.h"
#include <edm4eic/TrackCollection.h>

namespace eicrecon {

Expand All @@ -21,6 +22,7 @@ class FarDetectorTransportationPostML_factory
std::unique_ptr<AlgoT> m_algo;

PodioInput<edm4eic::Tensor> m_prediction_tensor_input{this};
PodioInput<edm4eic::Track> m_tracks_input{this};
PodioInput<edm4eic::MCRecoTrackParticleAssociation> m_association_input{this};
PodioInput<edm4hep::MCParticle> m_beamelectrons_input{this};

Expand All @@ -47,7 +49,8 @@ class FarDetectorTransportationPostML_factory

void Process(int32_t /* run_number */, uint64_t /* event_number */) {
m_algo->process(
{m_prediction_tensor_input(), m_association_input(), m_beamelectrons_input()},
{m_prediction_tensor_input(), m_tracks_input(), m_association_input(),
m_beamelectrons_input()},
{m_particle_output().get(), m_links_output().get(), m_association_output().get()});
}
};
Expand Down
Loading