9 #include <boost/test/unit_test.hpp>
43 using namespace Acts::UnitLiterals;
55 return meas == rhs.
meas;
81 std::map<GeometryIdentifier::Value, VolumeResolution>;
83 std::normal_distribution<double>
gauss(0., 1.);
116 template <
typename propagator_state_t,
typename stepper_t>
117 void operator()(propagator_state_t& state,
const stepper_t&
stepper,
120 auto surface = state.navigation.currentSurface;
122 auto geoID =
surface->geometryId();
123 auto volumeID = geoID.volume();
124 auto layerID = geoID.layer();
126 auto vResolution = detectorResolution.find(volumeID);
127 if (vResolution != detectorResolution.end()) {
129 auto lResolution = vResolution->second.find(layerID);
130 if (lResolution != vResolution->second.end()) {
132 auto lpResult =
surface->globalToLocal(
133 state.geoContext, stepper.position(state.stepping),
134 stepper.direction(state.stepping));
136 if (lResolution->second.size() == 1) {
137 double sp = lResolution->second[0].second;
140 if (lResolution->second[0].first ==
eBoundLoc0) {
144 result.push_back(std::move(m0));
149 result.push_back(std::move(m1));
151 }
else if (lResolution->second.size() == 2) {
153 double sx = lResolution->second[
eBoundLoc0].second;
154 double sy = lResolution->second[
eBoundLoc1].second;
155 cov2D << sx * sx, 0., 0., sy * sy;
162 result.push_back(std::move(m01));
192 MeasurementPropagator mPropagator(mStepper, mNavigator);
208 pixelVolumeRes[2] = pixelElementRes;
209 pixelVolumeRes[4] = pixelElementRes;
212 stripVolumeRes[2] = stripElementResI;
213 stripVolumeRes[4] = stripElementResO;
214 stripVolumeRes[6] = stripElementResI;
215 stripVolumeRes[8] = stripElementResO;
218 detRes[2] = pixelVolumeRes;
219 detRes[3] = stripVolumeRes;
228 std::multimap<size_t, FittableMeasurement<SourceLink>> measurements;
231 std::vector<SourceLink> sourcelinks;
235 std::map<size_t, Vector3D> startingPos;
236 startingPos.emplace(0,
Vector3D{-3_m, 0., 0.});
237 startingPos.emplace(1,
Vector3D{-3_m, -1.0 *
eps, -1.0 * eps});
243 for (
const auto& [trackID, mPos] : startingPos) {
248 auto result = mPropagator.propagate(mStart, mOptions);
249 BOOST_CHECK(result.ok());
252 auto value = std::move(result.value());
254 for (
auto& meas : measurementsCreated) {
255 measurements.emplace(trackID, std::move(meas));
261 std::back_inserter(sourcelinks), [](
const auto&
m) {
266 BOOST_CHECK_EQUAL(sourcelinks.size(), 18);
271 rNavigator.resolvePassive =
false;
272 rNavigator.resolveMaterial =
true;
273 rNavigator.resolveSensitive =
true;
278 RecoStepper rStepper(bField);
280 RecoPropagator rPropagator(rStepper, rNavigator);
307 for (
const auto& [trackID,
pos] : startingPos) {
310 cov << pow(10_um, 2), 0., 0., 0., 0., 0., 0., pow(10_um, 2), 0., 0., 0., 0.,
311 0., 0., pow(0.0002, 2), 0., 0., 0., 0., 0., 0., pow(0.0002, 2), 0., 0.,
312 0., 0., 0., 0., 0.0001, 0., 0., 0., 0., 0., 0., 1.;
329 auto combKalmanFilterRes = cKF.
findTracks(sourcelinks, rStart, ckfOptions);
330 BOOST_CHECK(combKalmanFilterRes.ok());
332 auto foundTrack = *combKalmanFilterRes;
333 auto& fittedStates = foundTrack.fittedStates;
334 auto& trackTips = foundTrack.trackTips;
336 for (
const auto& tip : trackTips) {
337 std::vector<size_t> sourceIds;
338 fittedStates.visitBackwards(tip, [&](
const auto& trackState) {
339 sourceIds.push_back(trackState.uncalibrated().sourceID);
342 BOOST_CHECK_EQUAL(sourceIds.size(), 6);
344 size_t numFakeHit = 0;
345 for (
const auto&
id : sourceIds) {
346 numFakeHit = numFakeHit + (
id != trackID ? 1 : 0);
350 BOOST_CHECK_EQUAL(numFakeHit, 0);