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)
74 auto magneticField = std::make_unique<ATLASMagneticFieldWrapper>();
75 std::shared_ptr<const Acts::TrackingGeometry> trackingGeometry =
m_trackingGeometryTool->trackingGeometry();
78 detail::Navigator::Config
cfg{trackingGeometry};
79 cfg.resolvePassive =
false;
80 cfg.resolveMaterial =
true;
81 cfg.resolveSensitive =
true;
89 Acts::MeasurementSelectorCuts measurementSelectorCuts({-4.0, 4.0});
90 Acts::MeasurementSelector measurementSelector(measurementSelectorCuts);
94 Acts::TrackSelector::EtaBinnedConfig trackSelectorCfg(std::vector<double>({0, 4}));
95 trackSelectorCfg.cutSets[0].ptMin = 1000;
96 trackSelectorCfg.cutSets[0].ptMax = 1000000;
97 trackSelectorCfg.cutSets[0].minMeasurements = 3;
98 trackSelectorCfg.cutSets[0].maxHoles = 1;
99 trackSelectorCfg.cutSets[0].maxOutliers = 1;
100 trackSelectorCfg.cutSets[0].maxSharedHits = 1;
101 trackSelectorCfg.cutSets[0].maxChi2 = 25.;
104 std::move(extrapolator),
105 {std::move(propagator),
m_logger->cloneWithSuffix(
"CKF")},
110 m_ckfConfig = std::make_unique<detail::CKF_config>(std::move(ckfConfig));
111 return StatusCode::SUCCESS;
122 Acts::VectorTrackContainer trackBackend;
123 Acts::VectorMultiTrajectory trackStateBackend;
125 std::shared_ptr<Acts::PerigeeSurface> perigeeSurface = Acts::Surface::makeShared<Acts::PerigeeSurface>(
Acts::Vector3::Zero());
128 Acts::MagneticFieldContext mfContext =
m_extrapolationTool->getMagneticFieldContext(context);
132 ATH_CHECK(detectorElementToGeometryIdMap.isValid());
134 const Acts::TrackingGeometry *
136 ATH_CHECK( acts_tracking_geometry !=
nullptr);
141 Acts::SourceLinkAccessorDelegate<ActsTrk::detail::UncalibSourceLinkAccessor::Iterator> slAccessorDelegate;
144 Acts::PropagatorPlainOptions plainOptions(tgContext, mfContext);
145 plainOptions.maxSteps = 1000;
146 plainOptions.direction=
m_propagateForward ? Acts::Direction::Forward : Acts::Direction::Backward;
155 perigeeSurface.get());
158 *acts_tracking_geometry,
159 **detectorElementToGeometryIdMap,
167 for (
auto truthParticle: *truthHandle ) {
168 ATH_MSG_DEBUG(
"truth: eta: " << truthParticle->eta() <<
" phi: " << truthParticle->phi() <<
" pt: " << truthParticle->pt());
171 ATH_MSG_DEBUG(
"Size of proto tracks collection " << protoTracksHandle->size());
173 if(protoTrack.measurements.empty())
continue;
178 auto res =
m_actsFitter->fit(context, protoTrack.measurements,*protoTrack.parameters,
181 Acts::CalibrationContext(),
182 **detectorElementToGeometryIdMap,
185 if (
res->size() == 0 )
continue;
186 ATH_MSG_DEBUG(
".......Done fit of track with "<< protoTrack.measurements.size() <<
" measurements");
187 const auto trackProxy =
res->getTrack(0);
188 if (not trackProxy.hasReferenceSurface()) {
189 ATH_MSG_INFO(
"There is not reference surface for this track");
192 Acts::BoundTrackParameters parametersAtRefSurface( trackProxy.referenceSurface().getSharedPtr(),
193 trackProxy.parameters(),
194 trackProxy.covariance(),
195 trackProxy.particleHypothesis());
199 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())));
200 ATH_MSG_DEBUG(
"Extending proto track of " << protoTrack.measurements.size() <<
" measurements");
202 tracksContainerTemp);
205 ATH_MSG_DEBUG(
"Built " << tracksContainerTemp.size() <<
" tracks from it");
206 for (detail::RecoTrackContainer::TrackProxy tempTrackProxy : tracksContainerTemp) {
207 ActsTrk::MutableTrackContainer::TrackProxy destTrackProxy = trackContainer.makeTrack();
208 ATH_MSG_DEBUG(
"Reco MTJ size " << trackStateBackend.size() );
209 for (
size_t stateIndex=0; stateIndex < trackStateBackend.size(); ++stateIndex) {
210 auto state = trackStateBackend.getTrackState(stateIndex);
213 ATH_MSG_DEBUG(
"Track has: " << tempTrackProxy.nMeasurements() <<
" measurements ");
214 ATH_MSG_DEBUG(
"track: eta: " << -1 *
log(
tan( tempTrackProxy.theta() * 0.5)) <<
" phi: " << tempTrackProxy.phi() <<
" pt:" << abs(1./tempTrackProxy.qOverP() *
sin(protoTrack.parameters->theta())));
216 destTrackProxy.copyFrom(tempTrackProxy);
220 std::unique_ptr<ActsTrk::TrackContainer> constTracksContainer =
222 std::move(trackContainer),
226 ATH_CHECK(trackContainerHandle.
record(std::move(constTracksContainer)));
228 return StatusCode::SUCCESS;
233 const EventContext& context,
238 ATH_MSG_DEBUG(
"Measurements (pixels only) size: " << pixelClustersHandle->
size());
240 measurements.
addMeasurements(0, *pixelClustersHandle, detectorElementToGeometryIdMap);