Skip to content

Commit

Permalink
CKFTracking updates
Browse files Browse the repository at this point in the history
  • Loading branch information
DraTeots committed Nov 21, 2024
1 parent e0286d3 commit eccfd02
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 12 deletions.
5 changes: 3 additions & 2 deletions source/tdis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ add_executable(tdis
# tracking/Measurement2DFactory.h
tracking/TruthTrackParameterFactory.h
tracking/KalmanFittingFactory.h
tracking/CKFTracking.h
tracking/CKFTracking.cc
tracking/KalmanFittingFactory.cpp
# tracking/CKFTracking.h
# tracking/CKFTracking.cc
)

# ---------- FIND REQUIRED PACKAGES -------------
Expand Down
5 changes: 1 addition & 4 deletions source/tdis/tracking/CKFTracking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,8 @@ namespace eicrecon {
auto& constTracks = *(constTracks_v.front());

// Seed number column accessor
#if Acts_VERSION_MAJOR >= 32

const Acts::ConstProxyAccessor<unsigned int> constSeedNumber("seed");
#else
const Acts::ConstTrackAccessor<unsigned int> constSeedNumber("seed");
#endif

// Prepare the output data with MultiTrajectory, per seed
std::vector<ActsExamples::Trajectories*> acts_trajectories;
Expand Down
15 changes: 15 additions & 0 deletions source/tdis/tracking/CKFTracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,21 @@ namespace eicrecon {
process(const edm4eic::Measurement2DCollection& meas2Ds,
const edm4eic::TrackParametersCollection &init_trk_params);

private:
std::shared_ptr<spdlog::logger> m_log;
std::shared_ptr<const Acts::Logger> m_acts_logger{nullptr};
std::shared_ptr<CKFTrackingFunction> m_trackFinderFunc;
std::shared_ptr<const ActsGeometryProvider> m_geoSvc;

std::shared_ptr<const eicrecon::BField::DD4hepBField> m_BField = nullptr;
Acts::GeometryContext m_geoctx;
Acts::CalibrationContext m_calibctx;
Acts::MagneticFieldContext m_fieldctx;

Acts::MeasurementSelector::Config m_sourcelinkSelectorCfg;

/// Private access to the logging instance
const Acts::Logger& logger() const { return *m_acts_logger; }
};

} // namespace eicrecon::Reco
1 change: 1 addition & 0 deletions source/tdis/tracking/KalmanFittingFactory.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "KalmanFittingFactory.h""
26 changes: 20 additions & 6 deletions source/tdis/tracking/KalmanFittingFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@

#include <JANA/Components/JOmniFactory.h>
#include <JANA/JFactory.h>
#include <spdlog/logger.h>

#include <ActsExamples/EventData/Track.hpp>

#include "ActsGeometryService.h"
#include "podio_model/DigitizedMtpcMcHit.h"
#include "podio_model/Measurement2D.h"
#include "podio_model/TrackParameters.h"
#include "services/LogService.hpp"

namespace tdis::tracking {



struct KalmanFittingFactory : public JOmniFactory<KalmanFittingFactory> {

PodioInput<tdis::DigitizedMtpcMcHit> m_mc_hits_in{this, {"DigitizedMtpcMcHit"}};
PodioOutput<edm4eic::TrackerHit> m_tracker_hits_out{this, "TrackerHit"};
PodioOutput<edm4eic::Measurement2D> m_measurements_out{this, "Measurement2D"};
Service<ActsGeometryService> m_service_geometry{this};
PodioInput<edm4eic::TrackParameters> m_parameters_input {this};
PodioInput<edm4eic::Measurement2D> m_measurements_input {this};
Output<ActsExamples::Trajectories> m_acts_trajectories_output {this};
Output<ActsExamples::ConstTrackContainer> m_acts_tracks_output {this};

ParameterRef<std::vector<double>> m_etaBins {this, "EtaBins", config().etaBins, "Eta Bins for ACTS CKF tracking reco"};
ParameterRef<std::vector<double>> m_chi2CutOff {this, "Chi2CutOff", config().chi2CutOff, "Chi2 Cut Off for ACTS CKF tracking"};
ParameterRef<std::vector<size_t>> m_numMeasurementsCutOff {this, "NumMeasurementsCutOff", config().numMeasurementsCutOff, "Number of measurements Cut Off for ACTS CKF tracking"};


Service<ActsGeometryService> m_serviceGeometry{this};
Service<services::LogService> m_service_log{this};
Parameter<bool> m_cfg_use_true_pos{this, "acts:use_true_position", true, "Use true hits xyz instead of digitized one"};

Expand Down Expand Up @@ -66,8 +80,8 @@ namespace tdis::tracking {
private:
std::shared_ptr<spdlog::logger> m_log;
std::shared_ptr<const Acts::Logger> m_acts_logger{nullptr};
std::shared_ptr<CKFTrackingFunction> m_trackFinderFunc;
std::shared_ptr<const ActsGeometryProvider> m_geoSvc;
// std::shared_ptr<CKFTrackingFunction> m_trackFinderFunc;


std::shared_ptr<const eicrecon::BField::DD4hepBField> m_BField = nullptr;
Acts::GeometryContext m_geoctx;
Expand Down

0 comments on commit eccfd02

Please sign in to comment.