6 #include "Acts/Propagator/PropagatorOptions.hpp"
21 #include "Acts/Definitions/Units.hpp"
22 #include "Acts/Geometry/TrackingGeometry.hpp"
23 #include "Acts/Geometry/GeometryIdentifier.hpp"
24 #include "Acts/MagneticField/MagneticFieldProvider.hpp"
25 #include "Acts/Surfaces/Surface.hpp"
26 #include "Acts/TrackFinding/MeasurementSelector.hpp"
27 #include "Acts/TrackFinding/CombinatorialKalmanFilter.hpp"
28 #include "Acts/Surfaces/PerigeeSurface.hpp"
29 #include "Acts/Utilities/TrackHelpers.hpp"
43 #include <initializer_list>
54 ISvcLocator* pSvcLocator)
73 auto magneticField = std::make_unique<ATLASMagneticFieldWrapper>();
74 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry =
m_trackingGeometryTool->trackingGeometry();
77 detail::Navigator::Config
cfg{trackingGeometry};
78 cfg.resolvePassive =
false;
79 cfg.resolveMaterial =
true;
80 cfg.resolveSensitive =
true;
88 Acts::MeasurementSelectorCuts measurementSelectorCuts({-4.0, 4.0});
89 Acts::MeasurementSelector measurementSelector(measurementSelectorCuts);
93 Acts::TrackSelector::EtaBinnedConfig trackSelectorCfg(std::vector<double>({0, 4}));
94 trackSelectorCfg.cutSets[0].ptMin = 1000;
95 trackSelectorCfg.cutSets[0].ptMax = 1000000;
96 trackSelectorCfg.cutSets[0].minMeasurements = 3;
97 trackSelectorCfg.cutSets[0].maxHoles = 1;
98 trackSelectorCfg.cutSets[0].maxOutliers = 1;
99 trackSelectorCfg.cutSets[0].maxSharedHits = 1;
100 trackSelectorCfg.cutSets[0].maxChi2 = 25.;
103 std::move(extrapolator),
104 {std::move(propagator),
m_logger->cloneWithSuffix(
"CKF")},
109 m_ckfConfig = std::make_unique<detail::CKF_config>(std::move(ckfConfig));
110 return StatusCode::SUCCESS;
121 Acts::VectorTrackContainer trackBackend;
122 Acts::VectorMultiTrajectory trackStateBackend;
124 std::shared_ptr<Acts::PerigeeSurface> perigeeSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
Acts::Vector3::Zero());
127 Acts::MagneticFieldContext mfContext =
m_extrapolationTool->getMagneticFieldContext(context);
131 ATH_CHECK(detectorElementToGeometryIdMap.isValid());
133 const Acts::TrackingGeometry *
135 ATH_CHECK( acts_tracking_geometry !=
nullptr);
140 Acts::SourceLinkAccessorDelegate<ActsTrk::detail::UncalibSourceLinkAccessor::Iterator> slAccessorDelegate;
143 Acts::PropagatorPlainOptions plainOptions(tgContext, mfContext);
144 plainOptions.maxSteps = 1000;
145 plainOptions.direction=
m_propagateForward ? Acts::Direction::Forward : Acts::Direction::Backward;
154 perigeeSurface.get());
157 *acts_tracking_geometry,
158 **detectorElementToGeometryIdMap,
164 for (
auto truthParticle: *truthHandle ) {
165 ATH_MSG_DEBUG(
"truth: eta: " << truthParticle->eta() <<
" phi: " << truthParticle->phi() <<
" pt: " << truthParticle->pt());
168 ATH_MSG_DEBUG(
"Size of proto tracks collection " << protoTracksHandle->size());
170 if(protoTrack.measurements.empty())
continue;
175 auto res =
m_actsFitter->fit(context, protoTrack.measurements,*protoTrack.parameters,
178 Acts::CalibrationContext(),
179 **detectorElementToGeometryIdMap,
182 if (
res->size() == 0 )
continue;
183 ATH_MSG_DEBUG(
".......Done fit of track with "<< protoTrack.measurements.size() <<
" measurements");
184 const auto trackProxy =
res->getTrack(0);
185 if (not trackProxy.hasReferenceSurface()) {
186 ATH_MSG_INFO(
"There is not reference surface for this track");
189 Acts::BoundTrackParameters parametersAtRefSurface( trackProxy.referenceSurface().getSharedPtr(),
190 trackProxy.parameters(),
191 trackProxy.covariance(),
192 trackProxy.particleHypothesis());
196 ATH_MSG_DEBUG(
"proto track: eta: " << -1 *
log(
tan( parametersAtRefSurface.theta() * 0.5)) <<
" phi: " << parametersAtRefSurface.phi() <<
" pt:" << abs(1./protoTrack.parameters->qOverP() *
sin(protoTrack.parameters->theta())));
197 ATH_MSG_DEBUG(
"Extending proto track of " << protoTrack.measurements.size() <<
" measurements");
199 tracksContainerTemp);
202 ATH_MSG_DEBUG(
"Built " << tracksContainerTemp.size() <<
" tracks from it");
203 for (detail::RecoTrackContainer::TrackProxy tempTrackProxy : tracksContainerTemp) {
204 ActsTrk::MutableTrackContainer::TrackProxy destTrackProxy = trackContainer.makeTrack();
205 ATH_MSG_DEBUG(
"Reco MTJ size " << trackStateBackend.size() );
206 for (
size_t stateIndex=0; stateIndex < trackStateBackend.size(); ++stateIndex) {
207 auto state = trackStateBackend.getTrackState(stateIndex);
210 ATH_MSG_DEBUG(
"Track has: " << tempTrackProxy.nMeasurements() <<
" measurements ");
211 ATH_MSG_DEBUG(
"track: eta: " << -1 *
log(
tan( tempTrackProxy.theta() * 0.5)) <<
" phi: " << tempTrackProxy.phi() <<
" pt:" << abs(1./tempTrackProxy.qOverP() *
sin(protoTrack.parameters->theta())));
213 destTrackProxy.copyFrom(tempTrackProxy);
217 std::unique_ptr<ActsTrk::TrackContainer> constTracksContainer =
219 std::move(trackContainer),
223 ATH_CHECK(trackContainerHandle.
record(std::move(constTracksContainer)));
225 return StatusCode::SUCCESS;
230 const EventContext& context,
235 ATH_MSG_DEBUG(
"Measurements (pixels only) size: " << pixelClustersHandle->
size());
237 measurements.
addMeasurements(0, *pixelClustersHandle, detectorElementToGeometryIdMap);