Skip to content
Snippets Groups Projects
Commit c706ae5c authored by Tobias Bockh's avatar Tobias Bockh
Browse files

smear true measurements

parent 0d9bd038
No related branches found
No related tags found
1 merge request!225Re-Fit Tracks
...@@ -58,6 +58,10 @@ private: ...@@ -58,6 +58,10 @@ private:
ToolHandle<IFaserActsTrackingGeometryTool> m_trackingGeometryTool { ToolHandle<IFaserActsTrackingGeometryTool> m_trackingGeometryTool {
this, "TrackingGeometryTool", "FaserActsTrackingGeometryTool"}; this, "TrackingGeometryTool", "FaserActsTrackingGeometryTool"};
// smearing of measurements
Gaudi::Property<double> m_sigma0 {this, "sigma0", 0.02};
Gaudi::Property<double> m_sigma1 {this, "sigma1", 0.02};
// covariance of the measurements // covariance of the measurements
Gaudi::Property<double> m_covMeasLoc0 {this, "covMeasLoc0", 0.01}; Gaudi::Property<double> m_covMeasLoc0 {this, "covMeasLoc0", 0.01};
Gaudi::Property<double> m_covMeasLoc1 {this, "covMeasLoc1", 0.01}; Gaudi::Property<double> m_covMeasLoc1 {this, "covMeasLoc1", 0.01};
......
...@@ -54,12 +54,13 @@ def FaserActsKalmanFilterCfg(flags, **kwargs): ...@@ -54,12 +54,13 @@ def FaserActsKalmanFilterCfg(flags, **kwargs):
acc = ComponentAccumulator() acc = ComponentAccumulator()
trajectory_writer_tool = CompFactory.TrajectoryWriterTool() trajectory_writer_tool = CompFactory.TrajectoryWriterTool()
trajectory_writer_tool.FilePath = "KalmanFilterTrajectories.root" trajectory_writer_tool.FilePath = "KalmanFilterTrajectories.root"
track_finder_tool = CompFactory.TruthSeededTrackFinderTool() track_finder_tool = CompFactory.TruthTrackFinderTool()
track_finder_tool.covLoc0 = 1e-3 # track_finder_tool = CompFactory.TruthSeededTrackFinderTool()
track_finder_tool.covLoc1 = 1e-3 # track_finder_tool.covLoc0 = 1e-1
track_finder_tool.covPhi = 1e-3 # track_finder_tool.covLoc1 = 1e-1
track_finder_tool.covTheta = 1e-3 # track_finder_tool.covPhi = 1e-1
track_finder_tool.covQOverP = 1e-3 # track_finder_tool.covTheta = 1e-1
# track_finder_tool.covQOverP = 1e-1
kalman_filter = CompFactory.FaserActsKalmanFilterAlg(**kwargs) kalman_filter = CompFactory.FaserActsKalmanFilterAlg(**kwargs)
kalman_filter.OutputTool = trajectory_writer_tool kalman_filter.OutputTool = trajectory_writer_tool
kalman_filter.TrackFinderTool = track_finder_tool kalman_filter.TrackFinderTool = track_finder_tool
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "TrackerReadoutGeometry/SCT_DetectorManager.h" #include "TrackerReadoutGeometry/SCT_DetectorManager.h"
#include "TrackerReadoutGeometry/SiDetectorElement.h" #include "TrackerReadoutGeometry/SiDetectorElement.h"
#include <array> #include <array>
#include <random>
TruthTrackFinderTool::TruthTrackFinderTool(const std::string& type, const std::string& name, const IInterface* parent) TruthTrackFinderTool::TruthTrackFinderTool(const std::string& type, const std::string& name, const IInterface* parent)
...@@ -99,12 +100,18 @@ StatusCode TruthTrackFinderTool::run() { ...@@ -99,12 +100,18 @@ StatusCode TruthTrackFinderTool::run() {
ATH_MSG_FATAL("Could not construct bound parameters"); ATH_MSG_FATAL("Could not construct bound parameters");
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
const auto &boundParams = boundParamsRes.value(); const ParametersVector &boundParams = boundParamsRes.value();
ATH_MSG_DEBUG(boundParams[0] << ", " << boundParams[1]); ATH_MSG_DEBUG(boundParams[0] << ", " << boundParams[1]);
std::random_device rd;
std::default_random_engine rng {rd()};
std::normal_distribution<> norm;
ParametersVector smearedBoundParams = {boundParams[0] * norm(rng) * m_sigma0, boundParams[1] * norm(rng) * m_sigma1};
ParametersVector par = ParametersVector::Zero(); ParametersVector par = ParametersVector::Zero();
par[0] = boundParams[0]; par[0] = smearedBoundParams[0];
par[1] = boundParams[1]; par[1] = smearedBoundParams[1];
CovarianceMatrix cov = CovarianceMatrix::Zero(); CovarianceMatrix cov = CovarianceMatrix::Zero();
cov(0, 0) = m_covMeasLoc0; cov(0, 0) = m_covMeasLoc0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment